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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
58b39d610eae8b36afa5ec0f450ede4efe4c78d4
| 342
|
py
|
Python
|
blog/views.py
|
artkapl/django-blog-project
|
16494465042dd6846f3a2cd560c0cfe7737cc8e0
|
[
"MIT"
] | null | null | null |
blog/views.py
|
artkapl/django-blog-project
|
16494465042dd6846f3a2cd560c0cfe7737cc8e0
|
[
"MIT"
] | null | null | null |
blog/views.py
|
artkapl/django-blog-project
|
16494465042dd6846f3a2cd560c0cfe7737cc8e0
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render
from .models import Post
def home(request):
context = {
'posts': Post.objects.all()
}
return render(request=request, template_name='blog/home.html', context=context)
def about(request):
return render(request=request, template_name='blog/about.html', context={'title': 'About'})
| 24.428571
| 95
| 0.701754
| 43
| 342
| 5.534884
| 0.488372
| 0.10084
| 0.159664
| 0.218487
| 0.352941
| 0.352941
| 0.352941
| 0
| 0
| 0
| 0
| 0
| 0.160819
| 342
| 13
| 96
| 26.307692
| 0.829268
| 0
| 0
| 0
| 0
| 0
| 0.128655
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0
| 0.222222
| 0.111111
| 0.666667
| 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
|
58ba74567e6fec0a65ad5136fbd9ca609c0ebda8
| 416
|
py
|
Python
|
Python/6 - kyu/6 kyu - Detect Pangram.py
|
danielbom/codewars
|
d45b5a813c6f1d952a50d22f0b2fcea4ef3d0e27
|
[
"MIT"
] | null | null | null |
Python/6 - kyu/6 kyu - Detect Pangram.py
|
danielbom/codewars
|
d45b5a813c6f1d952a50d22f0b2fcea4ef3d0e27
|
[
"MIT"
] | null | null | null |
Python/6 - kyu/6 kyu - Detect Pangram.py
|
danielbom/codewars
|
d45b5a813c6f1d952a50d22f0b2fcea4ef3d0e27
|
[
"MIT"
] | null | null | null |
# https://www.codewars.com/kata/detect-pangram/train/python
# My solution
import string
def is_pangram(text):
return len( {letter.lower() for letter in text if letter.isalpha()} ) == 26
# ...
import string
def is_pangram(s):
return set(string.lowercase) <= set(s.lower())
# ...
import string
def is_pangram(s):
s = s.lower()
return all(letter in s for letter in string.lowercase)
| 23.111111
| 80
| 0.658654
| 61
| 416
| 4.442623
| 0.47541
| 0.132841
| 0.166052
| 0.188192
| 0.273063
| 0.184502
| 0
| 0
| 0
| 0
| 0
| 0.006024
| 0.201923
| 416
| 17
| 81
| 24.470588
| 0.810241
| 0.185096
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.3
| false
| 0
| 0.3
| 0.2
| 0.9
| 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
|
58d1b1562239fddc199cba78a4c7fd5ac432e0af
| 102
|
py
|
Python
|
src/mtvs/__init__.py
|
digsim/mtvs
|
d89d12d4cd65eafe732226e588a54874123db7f4
|
[
"Apache-2.0"
] | 2
|
2017-11-19T05:51:31.000Z
|
2020-01-22T08:12:53.000Z
|
src/mtvs/__init__.py
|
digsim/mtvs
|
d89d12d4cd65eafe732226e588a54874123db7f4
|
[
"Apache-2.0"
] | 3
|
2015-12-03T00:34:46.000Z
|
2016-01-04T15:49:14.000Z
|
src/mtvs/__init__.py
|
digsim/missingTvShows
|
f17660dc965c7a6eef1b0cfad9577d62087cba56
|
[
"Apache-2.0"
] | null | null | null |
# -*- coding: utf-8 -*-
import pkg_resources
__version__ = pkg_resources.require("mtvs")[0].version
| 17
| 54
| 0.705882
| 13
| 102
| 5.076923
| 0.769231
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.022222
| 0.117647
| 102
| 5
| 55
| 20.4
| 0.711111
| 0.205882
| 0
| 0
| 0
| 0
| 0.051282
| 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
|
58fae9bfd3e0a20200a7b3dc48f407ee12665c55
| 246
|
py
|
Python
|
import_new_tournaments/process_hh_files/process/hands/extract/position_info/extract_stack_from_seat_line.py
|
michaelcukier/Poker-Hand-Tracker
|
9adae42fab9f640e6939ba06bd588ab1a2feb90f
|
[
"MIT"
] | 5
|
2021-02-28T18:33:02.000Z
|
2022-03-12T01:43:40.000Z
|
import_new_tournaments/process_hh_files/process/hands/extract/position_info/extract_stack_from_seat_line.py
|
michaelcukier/Poker-Hand-Tracker
|
9adae42fab9f640e6939ba06bd588ab1a2feb90f
|
[
"MIT"
] | null | null | null |
import_new_tournaments/process_hh_files/process/hands/extract/position_info/extract_stack_from_seat_line.py
|
michaelcukier/Poker-Hand-Tracker
|
9adae42fab9f640e6939ba06bd588ab1a2feb90f
|
[
"MIT"
] | 2
|
2021-03-01T03:08:04.000Z
|
2021-12-31T17:53:46.000Z
|
def extract_stack_from_seat_line(seat_line: str) -> float or None:
# Seat 3: PokerPete24 (40518.00)
if 'will be allowed to play after the button' in seat_line:
return None
return float(seat_line.split(' (')[1].split(')')[0])
| 35.142857
| 66
| 0.670732
| 39
| 246
| 4.051282
| 0.717949
| 0.202532
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.060914
| 0.199187
| 246
| 6
| 67
| 41
| 0.741117
| 0.121951
| 0
| 0
| 0
| 0
| 0.200935
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0
| 0.75
| 0
| 0
| 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
| 1
| 0
|
0
| 4
|
58fc01c36853b26f8562e022eac13585ff61105f
| 69
|
py
|
Python
|
nbviewerbot/__main__.py
|
JohnPaton/nbviewerbot
|
a9564655ba041e53db9a6916fb424e9582704321
|
[
"MIT"
] | 7
|
2018-08-06T20:02:13.000Z
|
2021-04-12T06:04:46.000Z
|
nbviewerbot/__main__.py
|
JohnPaton/nbviewerbot
|
a9564655ba041e53db9a6916fb424e9582704321
|
[
"MIT"
] | 5
|
2018-09-13T20:53:32.000Z
|
2021-03-31T18:55:48.000Z
|
nbviewerbot/__main__.py
|
JohnPaton/nbviewerbot
|
a9564655ba041e53db9a6916fb424e9582704321
|
[
"MIT"
] | null | null | null |
import nbviewerbot
if __name__ == "__main__":
nbviewerbot.cli()
| 13.8
| 26
| 0.710145
| 7
| 69
| 5.857143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173913
| 69
| 4
| 27
| 17.25
| 0.719298
| 0
| 0
| 0
| 0
| 0
| 0.115942
| 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
|
45168a0a61e3273b57493bda1e9d073423e6c698
| 8,105
|
py
|
Python
|
tests/hahm/test_config_flow.py
|
Voxxie/custom_homematic
|
d199f1fcc565febe42e686198a9eb33ef4d755f6
|
[
"MIT"
] | null | null | null |
tests/hahm/test_config_flow.py
|
Voxxie/custom_homematic
|
d199f1fcc565febe42e686198a9eb33ef4d755f6
|
[
"MIT"
] | null | null | null |
tests/hahm/test_config_flow.py
|
Voxxie/custom_homematic
|
d199f1fcc565febe42e686198a9eb33ef4d755f6
|
[
"MIT"
] | null | null | null |
"""Test the HaHomematic config flow."""
from typing import Any
from unittest.mock import patch
from homeassistant import config_entries
from homeassistant.components.hahm.config_flow import (
ATTR_BICDOS_RF_ENABLED,
ATTR_BICDOS_RF_PORT,
ATTR_HMIP_RF_ENABLED,
ATTR_HOST,
ATTR_HS485D_ENABLED,
ATTR_INSTANCE_NAME,
ATTR_PASSWORD,
ATTR_PORT,
ATTR_TLS,
ATTR_USERNAME,
ATTR_VIRTUAL_DEVICES_ENABLED,
IF_BIDCOS_RF_NAME,
IF_HMIP_RF_NAME,
IF_HS485D_NAME,
IF_VIRTUAL_DEVICES_NAME,
CannotConnect,
InvalidAuth,
)
from homeassistant.components.hahm.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import RESULT_TYPE_CREATE_ENTRY, RESULT_TYPE_FORM
TEST_INSTANCE_NAME = "pytest"
TEST_HOST = "1.1.1.1"
TEST_USERNAME = "test-username"
TEST_PASSWORD = "test-password"
async def test_form(hass: HomeAssistant) -> None:
"""Test we get the form."""
interface = await async_check_form(hass, interface_data={})
if_hmip_rf = interface[IF_HMIP_RF_NAME]
assert if_hmip_rf[ATTR_PORT] == 2010
if_bidcos_rf = interface[IF_BIDCOS_RF_NAME]
assert if_bidcos_rf[ATTR_PORT] == 2001
if_virtual_devices = interface[IF_VIRTUAL_DEVICES_NAME]
assert if_virtual_devices[ATTR_PORT] == 9292
assert interface.get(IF_HS485D_NAME) is None
async def test_form_no_hmip_other_bidcos_port(hass: HomeAssistant) -> None:
"""Test we get the form."""
interface_data = {ATTR_HMIP_RF_ENABLED: False, ATTR_BICDOS_RF_PORT: 5555}
interface = await async_check_form(hass, interface_data=interface_data)
assert interface.get(IF_HMIP_RF_NAME) is None
if_bidcos_rf = interface[IF_BIDCOS_RF_NAME]
assert if_bidcos_rf[ATTR_PORT] == 5555
if_virtual_devices = interface[IF_VIRTUAL_DEVICES_NAME]
assert if_virtual_devices[ATTR_PORT] == 9292
assert interface.get(IF_HS485D_NAME) is None
async def test_form_only_hs485(hass: HomeAssistant) -> None:
"""Test we get the form."""
interface_data = {
ATTR_HMIP_RF_ENABLED: False,
ATTR_BICDOS_RF_ENABLED: False,
ATTR_VIRTUAL_DEVICES_ENABLED: False,
ATTR_HS485D_ENABLED: True,
}
interface = await async_check_form(hass, interface_data=interface_data)
assert interface.get(IF_HMIP_RF_NAME) is None
assert interface.get(IF_BIDCOS_RF_NAME) is None
assert interface.get(IF_VIRTUAL_DEVICES_NAME) is None
if_hs485d = interface[IF_HS485D_NAME]
assert if_hs485d[ATTR_PORT] == 2000
async def test_form_tls(hass: HomeAssistant) -> None:
"""Test we get the form with tls."""
interface = await async_check_form(hass, interface_data={}, tls=True)
if_hmip_rf = interface[IF_HMIP_RF_NAME]
assert if_hmip_rf[ATTR_PORT] == 42010
if_bidcos_rf = interface[IF_BIDCOS_RF_NAME]
assert if_bidcos_rf[ATTR_PORT] == 42001
if_virtual_devices = interface[IF_VIRTUAL_DEVICES_NAME]
assert if_virtual_devices[ATTR_PORT] == 49292
assert interface.get(IF_HS485D_NAME) is None
async def async_check_form(
hass: HomeAssistant, interface_data: dict[str, Any], tls: bool = False
) -> dict[str, Any]:
"""Test we get the form."""
if interface_data is None:
interface_data = {}
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == RESULT_TYPE_FORM
assert result["errors"] is None
with patch(
"homeassistant.components.hahm.config_flow.validate_input",
return_value=True,
), patch(
"homeassistant.components.hahm.async_setup_entry",
return_value=True,
):
result2 = await hass.config_entries.flow.async_configure(
result["flow_id"],
{
ATTR_INSTANCE_NAME: TEST_INSTANCE_NAME,
ATTR_HOST: TEST_HOST,
ATTR_USERNAME: TEST_USERNAME,
ATTR_PASSWORD: TEST_PASSWORD,
ATTR_TLS: tls,
},
)
await hass.async_block_till_done()
assert result2["type"] == RESULT_TYPE_FORM
assert result2["handler"] == DOMAIN
assert result2["step_id"] == "interface"
flow = next(
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
assert flow["context"]["unique_id"] == "pytest"
result3 = await hass.config_entries.flow.async_configure(
result["flow_id"],
interface_data,
)
await hass.async_block_till_done()
assert result3["type"] == RESULT_TYPE_CREATE_ENTRY
assert result3["handler"] == DOMAIN
assert result3["title"] == TEST_INSTANCE_NAME
data = result3["data"]
assert data[ATTR_INSTANCE_NAME] == TEST_INSTANCE_NAME
assert data[ATTR_HOST] == TEST_HOST
assert data[ATTR_USERNAME] == TEST_USERNAME
assert data[ATTR_PASSWORD] == TEST_PASSWORD
return data["interface"]
async def test_form_invalid_auth(hass: HomeAssistant) -> None:
"""Test we handle invalid auth."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == RESULT_TYPE_FORM
assert result["errors"] is None
with patch(
"homeassistant.components.hahm.config_flow.validate_input",
side_effect=InvalidAuth,
), patch(
"homeassistant.components.hahm.async_setup_entry",
return_value=True,
):
result2 = await hass.config_entries.flow.async_configure(
result["flow_id"],
{
ATTR_INSTANCE_NAME: TEST_INSTANCE_NAME,
ATTR_HOST: TEST_HOST,
ATTR_USERNAME: TEST_USERNAME,
ATTR_PASSWORD: TEST_PASSWORD,
},
)
await hass.async_block_till_done()
assert result2["type"] == RESULT_TYPE_FORM
assert result2["handler"] == DOMAIN
assert result2["step_id"] == "interface"
flow = next(
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
assert flow["context"]["unique_id"] == "pytest"
result3 = await hass.config_entries.flow.async_configure(
result["flow_id"],
{},
)
await hass.async_block_till_done()
assert result3["type"] == RESULT_TYPE_FORM
assert result3["errors"] == {"base": "invalid_auth"}
async def test_form_cannot_connect(hass: HomeAssistant) -> None:
"""Test we handle cannot connect error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)
assert result["type"] == RESULT_TYPE_FORM
assert result["errors"] is None
with patch(
"homeassistant.components.hahm.config_flow.validate_input",
side_effect=CannotConnect,
), patch(
"homeassistant.components.hahm.async_setup_entry",
return_value=True,
):
result2 = await hass.config_entries.flow.async_configure(
result["flow_id"],
{
ATTR_INSTANCE_NAME: TEST_INSTANCE_NAME,
ATTR_HOST: TEST_HOST,
ATTR_USERNAME: TEST_USERNAME,
ATTR_PASSWORD: TEST_PASSWORD,
},
)
await hass.async_block_till_done()
assert result2["type"] == RESULT_TYPE_FORM
assert result2["handler"] == DOMAIN
assert result2["step_id"] == "interface"
flow = next(
flow
for flow in hass.config_entries.flow.async_progress()
if flow["flow_id"] == result["flow_id"]
)
assert flow["context"]["unique_id"] == "pytest"
result3 = await hass.config_entries.flow.async_configure(
result["flow_id"],
{},
)
await hass.async_block_till_done()
assert result3["type"] == RESULT_TYPE_FORM
assert result3["errors"] == {"base": "cannot_connect"}
| 33.217213
| 84
| 0.664405
| 996
| 8,105
| 5.067269
| 0.109438
| 0.041213
| 0.04042
| 0.049931
| 0.732118
| 0.721617
| 0.702199
| 0.702199
| 0.668516
| 0.659402
| 0
| 0.01621
| 0.238865
| 8,105
| 243
| 85
| 33.353909
| 0.801913
| 0.004072
| 0
| 0.535354
| 0
| 0
| 0.090492
| 0.039383
| 0
| 0
| 0
| 0
| 0.227273
| 1
| 0
| false
| 0.030303
| 0.035354
| 0
| 0.040404
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
45278aea9c424ae5e3cd32a1bd843d89d29dbea4
| 156
|
py
|
Python
|
project euler/q2.py
|
milkmeat/thomas
|
fbc72af34267488d931a4885d4e19fce22fea582
|
[
"MIT"
] | null | null | null |
project euler/q2.py
|
milkmeat/thomas
|
fbc72af34267488d931a4885d4e19fce22fea582
|
[
"MIT"
] | null | null | null |
project euler/q2.py
|
milkmeat/thomas
|
fbc72af34267488d931a4885d4e19fce22fea582
|
[
"MIT"
] | null | null | null |
l=[0]*100
l[0]=1
l[1]=2
for x in range (2,100):
l[x]=l[x-1]+l[x-2]
#print l
f=0
for c in l:
if c%2==0 and c<4000000:
f=f+c
print f
| 14.181818
| 29
| 0.474359
| 43
| 156
| 1.72093
| 0.348837
| 0.081081
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.222222
| 0.307692
| 156
| 11
| 30
| 14.181818
| 0.462963
| 0.044872
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0.1
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
189105da68157256feb66cf959f48a9d4b0c8a3a
| 51
|
py
|
Python
|
tests/development/destination/gcs/test_delete_bucket.py
|
denssk/backup
|
292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e
|
[
"Apache-2.0"
] | 69
|
2016-06-29T16:13:55.000Z
|
2022-03-21T06:38:37.000Z
|
tests/development/destination/gcs/test_delete_bucket.py
|
denssk/backup
|
292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e
|
[
"Apache-2.0"
] | 237
|
2016-09-28T02:12:34.000Z
|
2022-03-25T13:32:23.000Z
|
tests/development/destination/gcs/test_delete_bucket.py
|
denssk/backup
|
292d5f1b1a3765ce0ea8d3cab8bd1ae0c583f72e
|
[
"Apache-2.0"
] | 45
|
2017-01-04T21:20:27.000Z
|
2021-12-29T10:42:22.000Z
|
def test_delete_bucket(gs):
gs.delete_bucket()
| 17
| 27
| 0.745098
| 8
| 51
| 4.375
| 0.625
| 0.685714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.137255
| 51
| 2
| 28
| 25.5
| 0.795455
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
18b566b173e3af542df61de7dc132ac1fb281305
| 231
|
py
|
Python
|
tests/WebkitGtkDriverBenchmarkTest.py
|
hiroshitoda/WebDriverBenchmark.py
|
74b643b9f299436ef6fb50741a60f04c0c69cf8c
|
[
"Apache-2.0"
] | null | null | null |
tests/WebkitGtkDriverBenchmarkTest.py
|
hiroshitoda/WebDriverBenchmark.py
|
74b643b9f299436ef6fb50741a60f04c0c69cf8c
|
[
"Apache-2.0"
] | null | null | null |
tests/WebkitGtkDriverBenchmarkTest.py
|
hiroshitoda/WebDriverBenchmark.py
|
74b643b9f299436ef6fb50741a60f04c0c69cf8c
|
[
"Apache-2.0"
] | null | null | null |
import unittest
from selenium import webdriver
from tests import Base
class WebKitGTKDriverBenchmarkTest(Base.Base):
def getDriver(self):
return webdriver.WebKitGTK()
if __name__ == "__main__":
unittest.main()
| 16.5
| 46
| 0.74026
| 25
| 231
| 6.52
| 0.68
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 231
| 13
| 47
| 17.769231
| 0.862434
| 0
| 0
| 0
| 0
| 0
| 0.034632
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0.375
| 0.125
| 0.75
| 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
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
18d67d5d9fabdd711ac5fef81a528edb66bc9e9b
| 136
|
py
|
Python
|
lms_python/lms_app/admin.py
|
gabrielmdsantos/LMSBD
|
dff3001a560f8cccb938957bf2d5732d4ae3d163
|
[
"Apache-2.0"
] | null | null | null |
lms_python/lms_app/admin.py
|
gabrielmdsantos/LMSBD
|
dff3001a560f8cccb938957bf2d5732d4ae3d163
|
[
"Apache-2.0"
] | null | null | null |
lms_python/lms_app/admin.py
|
gabrielmdsantos/LMSBD
|
dff3001a560f8cccb938957bf2d5732d4ae3d163
|
[
"Apache-2.0"
] | null | null | null |
from django.contrib import admin
from lms_app.models import Professor
admin.site.register(Professor)
# Register your models here.
| 22.666667
| 37
| 0.794118
| 19
| 136
| 5.631579
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147059
| 136
| 5
| 38
| 27.2
| 0.922414
| 0.191176
| 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
|
18d91850121d98d86b712bda14df3f044488a26e
| 479
|
py
|
Python
|
Exercício feitos pela primeira vez/ex004colorido.py
|
Claayton/pythonExerciciosLinux
|
696cdb16983638418bd0d0d4fe44dc72662b9c97
|
[
"MIT"
] | 1
|
2021-01-23T15:43:34.000Z
|
2021-01-23T15:43:34.000Z
|
Exercício feitos pela primeira vez/ex004colorido.py
|
Claayton/pythonExerciciosLinux
|
696cdb16983638418bd0d0d4fe44dc72662b9c97
|
[
"MIT"
] | null | null | null |
Exercício feitos pela primeira vez/ex004colorido.py
|
Claayton/pythonExerciciosLinux
|
696cdb16983638418bd0d0d4fe44dc72662b9c97
|
[
"MIT"
] | null | null | null |
#Ex004b
algo = (input('\033[34m''Digite algo: ''\033[m'))
print('São letras ou palavras?: \033[33m{}\033[m'.format(algo.isalpha()))
print('Está em maiúsculo?: \033[34m{}\033[m'.format(algo.isupper()))
print('Está em minúsculo?: \033[35m{}\033[m'.format(algo.islower()))
print('Está captalizada?: \033[36m{}\033[m'.format(algo.istitle()))
print('Só tem espaço?: \033[31m{}\033[m'.format(algo.isspace()))
print('É numérico?: \033[32m{}\033[m'.format(algo.isnumeric()))
print('xD')
| 47.9
| 73
| 0.668058
| 76
| 479
| 4.210526
| 0.460526
| 0.0875
| 0.1875
| 0.2625
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131403
| 0.06263
| 479
| 9
| 74
| 53.222222
| 0.581292
| 0.012526
| 0
| 0
| 0
| 0
| 0.504237
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.875
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
18e8661bfba7a01963831fc9dac3f2b59f8ea633
| 2,074
|
py
|
Python
|
examples/set_holidaydates.py
|
ultratolido/ekmmetters
|
e15325023262e228b4dc037021c28a8d2b9b9b03
|
[
"MIT"
] | null | null | null |
examples/set_holidaydates.py
|
ultratolido/ekmmetters
|
e15325023262e228b4dc037021c28a8d2b9b9b03
|
[
"MIT"
] | null | null | null |
examples/set_holidaydates.py
|
ultratolido/ekmmetters
|
e15325023262e228b4dc037021c28a8d2b9b9b03
|
[
"MIT"
] | null | null | null |
""" Simple example set holiday dates
(c) 2016 EKM Metering.
"""
import random
from ekmmeters import *
#port setup
my_port_name = "COM3"
my_meter_address = "300001162"
#log to console
ekm_set_log(ekm_print_log)
# init port and meter
port = SerialPort(my_port_name)
if (port.initPort() == True):
my_meter = V4Meter(my_meter_address)
my_meter.attachPort(port)
else:
print "Cannot open port"
exit()
# input over range(Extents.Holidays)
for holiday in range(Extents.Holidays):
day = random.randint(1,28)
mon = random.randint(1,12)
my_meter.assignHolidayDate(holiday, mon, day)
my_meter.setHolidayDates()
# input directly
param_buf = OrderedDict()
param_buf["Holiday_1_Month"] = 1
param_buf["Holiday_1_Day"] = 1
param_buf["Holiday_2_Month"] = 2
param_buf["Holiday_2_Day"] = 3
param_buf["Holiday_3_Month"] = 4
param_buf["Holiday_3_Day"] = 4
param_buf["Holiday_4_Month"] = 4
param_buf["Holiday_4_Day"] = 5
param_buf["Holiday_5_Month"] = 5
param_buf["Holiday_5_Day"] = 4
param_buf["Holiday_6_Month"] = 0
param_buf["Holiday_6_Day"] = 0
param_buf["Holiday_7_Month"] = 0
param_buf["Holiday_7_Day"] = 0
param_buf["Holiday_8_Month"] = 0
param_buf["Holiday_8_Day"] = 0
param_buf["Holiday_9_Month"] = 0
param_buf["Holiday_9_Day"] = 0
param_buf["Holiday_10_Month"] = 0
param_buf["Holiday_10_Day"] = 0
param_buf["Holiday_11_Month"] = 0
param_buf["Holiday_11_Day"] = 0
param_buf["Holiday_12_Month"] = 0
param_buf["Holiday_12_Day"] = 0
param_buf["Holiday_13_Month"] = 0
param_buf["Holiday_13_Day"] = 0
param_buf["Holiday_14_Month"] = 0
param_buf["Holiday_14_Day"] = 0
param_buf["Holiday_15_Month"] = 0
param_buf["Holiday_15_Day"] = 0
param_buf["Holiday_16_Month"] = 0
param_buf["Holiday_16_Day"] = 0
param_buf["Holiday_17_Month"] = 0
param_buf["Holiday_17_Day"] = 0
param_buf["Holiday_18_Month"] = 0
param_buf["Holiday_18_Day"] = 0
param_buf["Holiday_19_Month"] = 0
param_buf["Holiday_19_Day"] = 0
param_buf["Holiday_20_Month"] = 1
param_buf["Holiday_20_Day"] = 9
if my_meter.setHolidayDates(param_buf):
print "Set holiday dates success."
port.closePort()
| 27.289474
| 49
| 0.747348
| 350
| 2,074
| 4.031429
| 0.222857
| 0.238129
| 0.42523
| 0.317505
| 0.54146
| 0
| 0
| 0
| 0
| 0
| 0
| 0.067103
| 0.116201
| 2,074
| 76
| 50
| 27.289474
| 0.702673
| 0.045323
| 0
| 0
| 0
| 0
| 0.332985
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 0.032787
| null | null | 0.04918
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
18ea8109933fbbfe2b0922e33bce91ae934e86e1
| 2,010
|
py
|
Python
|
StateTracing/tester_helper.py
|
junchenfeng/diagnosis_tracing
|
4e26e2ad0c7abc547f22774b6c9c299999a152c3
|
[
"MIT"
] | null | null | null |
StateTracing/tester_helper.py
|
junchenfeng/diagnosis_tracing
|
4e26e2ad0c7abc547f22774b6c9c299999a152c3
|
[
"MIT"
] | null | null | null |
StateTracing/tester_helper.py
|
junchenfeng/diagnosis_tracing
|
4e26e2ad0c7abc547f22774b6c9c299999a152c3
|
[
"MIT"
] | 1
|
2020-09-08T13:42:16.000Z
|
2020-09-08T13:42:16.000Z
|
# -*- coding: utf-8 -*-
import numpy as np
from torch import load as Tload
from torch import tensor
from dataloader import read_data,DataLoader,load_init
from cdkt import CDKT
if 'model' not in dir():
model = CDKT()
model.load_state_dict(Tload('model.pkl'))
#
inits = load_init()
data = """0 506123310064654031030450460312100605
0 506123310064654031230450460312100605
0 506123310064654031231450460312100605
0 506123310064654031231456460312100605
0 506123310064654031231456460312100645
0 506123310564654031231456460312100645
0 506123310564654231231456460312100645
0 506123310564654231231456460312100605
0 506123310564654231231456460312100645
0 506123312564654231231456460312100645
0 546123312564654231231456460312100645
0 546123312564654231231456465312100645
0 546123312564654231231456465312120645
0 546123312564654231231456465312123645
1 002163163050030425245001316542000000
1 002163163054030425245001316542000000
1 002163163054030425245001316542000006"""
# 1 002163163054030425245001316542030006
# 1 002163163054030425245001316542000006
# 1 002163163054031425245001316542000006
# 1 002163163054631425245001316542000006
# 1 002163163254631425245001316542000006
# 1 002163163254631425245601316542000006
# 1 002163163254631425245631316542000006
# 1 052163163254631425245631316542000006
# 1 452163163254631425245631316542000006
# 1 452163163254631425245631316542000016
# 1 452163163254631425245631316542000316
# 1 452163163254631425245631316542003316
# 1 452163163254631425245631316542000316
# 1 452163163254631425245631316542500316
# 1 452163163254631425245631316542520316
# 1 452163163254631425245631316542524316"""
data = [d.strip().split() for d in data.split('\n')]
states = [list(map(int,s)) for i,s in data]
states = tensor([states])
out = model.predicts(states)
prds = np.argmax(out[0],axis=2).flatten()*np.array(inits[2])
| 35.892857
| 60
| 0.783085
| 152
| 2,010
| 10.322368
| 0.506579
| 0.011472
| 0.01912
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.728733
| 0.163682
| 2,010
| 56
| 60
| 35.892857
| 0.20464
| 0.346269
| 0
| 0.064516
| 0
| 0
| 0.597905
| 0.493151
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.16129
| 0
| 0.16129
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
7a1607febbd34072033d2922ea13752164e46320
| 357
|
py
|
Python
|
src/__init__.py
|
w9PcJLyb/GFootball
|
b271238bd0dc922787a0a9b984a8ae598cea2b2b
|
[
"Apache-2.0"
] | null | null | null |
src/__init__.py
|
w9PcJLyb/GFootball
|
b271238bd0dc922787a0a9b984a8ae598cea2b2b
|
[
"Apache-2.0"
] | null | null | null |
src/__init__.py
|
w9PcJLyb/GFootball
|
b271238bd0dc922787a0a9b984a8ae598cea2b2b
|
[
"Apache-2.0"
] | null | null | null |
from .board import Board
from .slide import slide_action
from .corner import corner_action
from .control import control_action
from .penalty import penalty_action
from .throwin import throwin_action
from .kickoff import kickoff_action
from .goalkick import goalkick_action
from .freekick import freekick_action
from .without_ball import without_ball_action
| 32.454545
| 45
| 0.859944
| 51
| 357
| 5.803922
| 0.27451
| 0.27027
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.112045
| 357
| 10
| 46
| 35.7
| 0.933754
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
7a1eab82419109b15e6baf92f1df08cd9c6fa14b
| 856
|
py
|
Python
|
class_exercises/using_numpy.py
|
Eddz7/astr-19
|
380c6b45762e0207cd6c237fa28a4d796b1aef94
|
[
"MIT"
] | null | null | null |
class_exercises/using_numpy.py
|
Eddz7/astr-19
|
380c6b45762e0207cd6c237fa28a4d796b1aef94
|
[
"MIT"
] | 1
|
2022-03-31T17:57:17.000Z
|
2022-03-31T17:57:17.000Z
|
class_exercises/using_numpy.py
|
Eddz7/astr-19
|
380c6b45762e0207cd6c237fa28a4d796b1aef94
|
[
"MIT"
] | null | null | null |
import numpy as np
x = 1.0 #define a float
y = 2.0 #define another float
#trigonometry
print(f"np.sin({x}) = {np.sin(x)}") #sin(x)
print(f"np.cos({x}) = {np.cos(x)}") #cos(x)
print(f"np.tan({x}) = {np.tan(x)}") #tan(x)
print(f"np.arcsin({x}) = {np.arcsin(x)}") #arcsin(x)
print(f"np.arccos({x}) = {np.arccos(x)}") #arccos(x)
print(f"np.arctan({x}) = {np.arctan(x)}") #arctan(x)
print(f"np.arctan2({x}) = {np.arctan2(x,y)}") #arctan(x/y)
print(f"np.rad2deg({x}) = {np.rad2deg(x)}") #convert rad to degree
#hyperbolic functions
print(f"np.sinh({x}) = {np.sinh(x)}") #sinh(x)
print(f"np.cosh({x}) = {np.cosh(x)}") #cosh(x)
print(f"np.tanh({x}) = {np.tanh(x)}") #tanh(x)
print(f"np.arcsinh({x}) = {np.arcsinh(x)}") #arcsinh(x)
print(f"np.arccosh({x}) = {np.arccosh(x)}") #arccosh(x)
print(f"np.arctanh({x}) = {np.arctanh(x)}") #arctanh(x)
| 40.761905
| 67
| 0.580607
| 163
| 856
| 3.04908
| 0.220859
| 0.169014
| 0.225352
| 0.199195
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010568
| 0.115654
| 856
| 21
| 68
| 40.761905
| 0.645971
| 0.226636
| 0
| 0
| 0
| 0
| 0.6656
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.058824
| 0
| 0.058824
| 0.823529
| 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
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
e12ea6090b7a3fc25058fb7f99f94d6f336e2f07
| 17,628
|
py
|
Python
|
docs/pyqbdi.py
|
pbrunet/QBDI
|
39a936b2efd000f0c5def0a8ea27538d7d5fab47
|
[
"Apache-2.0"
] | 1
|
2019-10-01T08:32:41.000Z
|
2019-10-01T08:32:41.000Z
|
docs/pyqbdi.py
|
pbrunet/QBDI
|
39a936b2efd000f0c5def0a8ea27538d7d5fab47
|
[
"Apache-2.0"
] | null | null | null |
docs/pyqbdi.py
|
pbrunet/QBDI
|
39a936b2efd000f0c5def0a8ea27538d7d5fab47
|
[
"Apache-2.0"
] | null | null | null |
# This file is only used to generate documentation
# VM class
class vm():
def getGPRState():
"""Obtain the current general purpose register state.
:returns: GPRState (an object containing the GPR state).
"""
pass
def getFPRState():
"""Obtain the current floating point register state.
:returns: FPRState (an object containing the FPR state).
"""
pass
def setGPRState(gprState):
"""Set the general purpose register state.
:param grpState: An object containing the GPR state.
"""
pass
def setFPRState(fprState):
"""Set the current floating point register state.
:param fprState: An object containing the FPR state
"""
pass
def run(start, stop):
"""Start the execution by the DBI from a given address (and stop when another is reached).
:param start: Address of the first instruction to execute.
:param stop: Stop the execution when this instruction is reached.
:returns: True if at least one block has been executed.
"""
pass
def call(function, args):
"""Call a function using the DBI (and its current state).
:param function: Address of the function start instruction.
:param args: The arguments as a list [arg0, arg1, arg2, ...].
:returns: (True, retValue) if at least one block has been executed.
"""
pass
def addCodeCB(pos, cbk, data):
"""Register a callback event for a specific instruction event.
:param pos: Relative position of the event callback (:py:const:`pyqbdi.PREINST` / :py:const:`pyqbdi.POSTINST`).
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def addCodeAddrCB(address, pos, cbk, data):
"""Register a callback for when a specific address is executed.
:param address: Code address which will trigger the callback.
:param pos: Relative position of the event callback (:py:const:`pyqbdi.PREINST` / :py:const:`pyqbdi.POSTINST`).
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def addCodeRangeCB(start, end, pos, cbk, data):
"""Register a callback for when a specific address range is executed.
:param start: Start of the address range which will trigger the callback.
:param end: End of the address range which will trigger the callback.
:param pos: Relative position of the event callback (:py:const:`pyqbdi.PREINST` / :py:const:`pyqbdi.POSTINST`).
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def addMnemonicCB(mnemonic, pos, cbk, data):
"""Register a callback event if the instruction matches the mnemonic.
:param mnemonic: Mnemonic to match.
:param pos: Relative position of the event callback (:py:const:`pyqbdi.PREINST` / :py:const:`pyqbdi.POSTINST`).
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def deleteInstrumentation(id):
"""Remove an instrumentation.
:param id: The id of the instrumentation to remove.
:returns: True if instrumentation has been removed.
"""
pass
def deleteAllInstrumentations():
"""Remove all the registered instrumentations.
"""
pass
def addMemAddrCB(address, type, cbk, data):
"""Add a virtual callback which is triggered for any memory access at a specific address matching the access type. Virtual callbacks are called via callback forwarding by a gate callback triggered on every memory access. This incurs a high performance cost.
:param address: Code address which will trigger the callback.
:param type: A mode bitfield: either :py:const:`pyqbdi.MEMORY_READ`, :py:const:`pyqbdi.MEMORY_WRITE` or both (:py:const:`pyqbdi.MEMORY_READ_WRITE`).
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def addMemRangeCB(start, end, type, cbk, data):
"""Add a virtual callback which is triggered for any memory access in a specific address range matching the access type. Virtual callbacks are called via callback forwarding by a gate callback triggered on every memory access. This incurs a high performance cost.
:param start: Start of the address range which will trigger the callback.
:param end: End of the address range which will trigger the callback.
:param type: A mode bitfield: either :py:const:`pyqbdi.MEMORY_READ`, :py:const:`pyqbdi.MEMORY_WRITE` or both (:py:const:`pyqbdi.MEMORY_READ_WRITE`).
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def addMemAccessCB(type, cbk, data):
"""Register a callback event for every memory access matching the type bitfield made by an instruction.
:param type: A mode bitfield: either :py:const:`pyqbdi.MEMORY_READ`, :py:const:`pyqbdi.MEMORY_WRITE` or both (:py:const:`pyqbdi.MEMORY_READ_WRITE`).
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def recordMemoryAccess(type):
"""Add instrumentation rules to log memory access using inline instrumentation and instruction shadows.
:param type: Memory mode bitfield to activate the logging for: either :py:const:`pyqbdi.MEMORY_READ`, :py:const:`pyqbdi.MEMORY_WRITE` or both (:py:const:`pyqbdi.MEMORY_READ_WRITE`).
:returns: True if inline memory logging is supported, False if not or in case of error.
"""
pass
def getInstAnalysis(type):
""" Obtain the analysis of an instruction metadata. Analysis results are cached in the VM. The validity of the returned object is only guaranteed until the end of the callback, else a deepcopy of the object is required.
:param type: Properties to retrieve during analysis (pyqbdi.ANALYSIS_INSTRUCTION, pyqbdi.ANALYSIS_DISASSEMBLY, pyqbdi.ANALYSIS_OPERANDS, pyqbdi.ANALYSIS_SYMBOL).
:returns: A :py:class:`InstAnalysis` object containing the analysis result.
"""
pass
def getInstMemoryAccess():
"""Obtain the memory accesses made by the last executed instruction.
:returns: A list of memory accesses (:py:class:`MemoryAccess`) made by the instruction.
"""
pass
def getBBMemoryAccess():
"""Obtain the memory accesses made by the last executed basic block.
:returns: A list of memory accesses (:py:class:`MemoryAccess`) made by the basic block.
"""
pass
def precacheBasicBlock(pc):
"""Pre-cache a known basic block
:param pc: Start address of a basic block
:returns: True if basic block has been inserted in cache.
"""
pass
def clearCache(start, end):
"""Clear a specific address range from the translation cache.
:param start: Start of the address range to clear from the cache.
:param end: End of the address range to clear from the cache.
"""
pass
def clearAllCache():
"""Clear the entire translation cache.
"""
pass
def addVMEventCB(mask, cbk, data):
"""Register a callback event for a specific VM event.
:param mask: A mask of VM event type which will trigger the callback.
:param cbk: A function to be called back.
:param data: User defined data passed to the callback.
:returns: The id of the registered instrumentation (or :py:const:`pyqbdi.INVALID_EVENTID` in case of failure).
"""
pass
def addInstrumentedModule(name):
"""Add the executable address ranges of a module to the set of instrumented address ranges.
:param name: The module's name.
:returns: True if at least one range was added to the instrumented ranges.
"""
pass
def addInstrumentedModuleFromAddr(addr):
""" Add the executable address ranges of a module to the set of instrumented address ranges using an address belonging to the module.
:param addr: An address contained by module's range.
:returns: True if at least one range was added to the instrumented ranges.
"""
pass
def addInstrumentedRange(start, end):
"""Add an address range to the set of instrumented address ranges.
:param start: Start address of the range (included).
:param end: End address of the range (excluded).
"""
pass
def instrumentAllExecutableMaps():
"""Adds all the executable memory maps to the instrumented range set.
:returns: True if at least one range was added to the instrumented ranges.
"""
pass
def removeAllInstrumentedRanges():
"""Remove all instrumented ranges.
"""
pass
def removeInstrumentedModule(name):
"""Remove the executable address ranges of a module from the set of instrumented address ranges.
:param name: The module's name.
:returns: True if at least one range was removed from the instrumented ranges.
"""
pass
def removeInstrumentedModuleFromAddr(addr):
"""Remove the executable address ranges of a module from the set of instrumented address ranges using an address belonging to the module.
:param addr: An address contained by module's range.
:returns: True if at least one range was removed from the instrumented ranges.
"""
pass
def removeInstrumentedRange(start, end):
"""Remove an address range from the set of instrumented address ranges.
:param start: Start address of the range (included).
:param end: End address of the range (excluded).
"""
pass
# PyQBDI module functions
def alignedAlloc(size, align):
"""Allocate a block of memory of a specified sized with an aligned base address.
:param size: Allocation size in bytes.
:param align: Base address alignement in bytes.
:returns: Pointer to the allocated memory (as a long) or NULL in case an error was encountered.
"""
pass
def alignedFree():
"""
"""
pass
def allocateVirtualStack(ctx, stackSize):
"""Allocate a new stack and setup the GPRState accordingly.
The allocated stack needs to be freed with alignedFree().
:param ctx: GPRState which will be setup to use the new stack.
:param stackSize: Size of the stack to be allocated.
:returns: A tuple (bool, stack) where 'bool' is true if stack allocation was successfull. And 'stack' the newly allocated stack pointer.
"""
pass
def simulateCall(ctx, returnAddress, args):
"""Simulate a call by modifying the stack and registers accordingly.
:param ctx: GPRState where the simulated call will be setup. The state needs to point to a valid stack for example setup with allocateVirtualStack().
:param returnAddress: Return address of the call to simulate.
:param args: A list of arguments.
"""
pass
def getModuleNames():
""" Get a list of all the module names loaded in the process memory.
:returns: A list of strings, each one containing the name of a loaded module.
"""
pass
def getCurrentProcessMaps():
""" Get a list of all the memory maps (regions) of the current process.
:returns: A list of :py:class:`MemoryMap` object.
"""
pass
def readMemory(address, size):
"""Read a memory content from a base address.
:param address: Base address
:param size: Read size
:returns: Bytes of content.
.. warning::
This API is hazardous as the whole process memory can be read.
"""
pass
def writeMemory(address, bytes):
"""Write a memory content to a base address.
:param address: Base address
:param bytes: Memory content
.. warning::
This API is hazardous as the whole process memory can be written.
"""
pass
def decodeFloat(val):
""" Decode a float stored as a long.
:param val: Long value.
"""
pass
def encodeFloat(val):
"""Encode a float as a long.
:param val: Float value
"""
pass
# Various objects
class MemoryMap:
""" Map of a memory area (region).
"""
range = (0, 0xffff)
""" A range of memory (region), delimited between a start and an (excluded) end address. """
permission = 0
""" Region access rights (PF_READ, PF_WRITE, PF_EXEC). """
name = ""
""" Region name (useful when a region is mapping a module). """
class InstAnalysis:
""" Object containing analysis results of an instruction provided by the VM.
"""
mnemonic = ""
""" LLVM mnemonic (warning: None if !ANALYSIS_INSTRUCTION) """
address = 0
""" Instruction address """
instSize = 0
""" Instruction size (in bytes) """
affectControlFlow = False
""" true if instruction affects control flow """
isBranch = False
""" true if instruction acts like a 'jump' """
isCall = False
""" true if instruction acts like a 'call' """
isReturn = False
""" true if instruction acts like a 'return' """
isCompare = False
""" true if instruction is a comparison """
isPredicable = False
""" true if instruction contains a predicate (~is conditional) """
mayLoad = False
""" true if instruction 'may' load data from memory """
mayStore = False
""" true if instruction 'may' store data to memory """
disassembly = ""
""" Instruction disassembly (warning: None if !ANALYSIS_DISASSEMBLY) """
numOperands = 0
""" Number of operands used by the instruction """
operands = []
""" A list of :py:class:`OperandAnalysis` objects.
(warning: empty if !ANALYSIS_OPERANDS) """
symbol = ""
""" Instruction symbol (warning: None if !ANALYSIS_SYMBOL or not found) """
symbolOffset = 0
""" Instruction symbol offset """
module = ""
""" Instruction module name (warning: None if !ANALYSIS_SYMBOL or not found) """
class OperandAnalysis:
""" Object containing analysis results of an operand provided by the VM.
"""
# Common fields
type = 0
""" Operand type (pyqbdi.OPERAND_IMM, pyqbdi.OPERAND_REG, pyqbdi.OPERAND_PRED) """
value = 0
""" Operand value (if immediate), or register Id """
size = 0
""" Operand size (in bytes) """
# Register specific fields
regOff = 0
""" Sub-register offset in register (in bits) """
regCtxIdx = 0
""" Register index in VM state """
regName = ""
""" Register name """
regAccess = 0
""" Register access type (pyqbdi.REGISTER_READ, pyqbdi.REGISTER_WRITE, pyqbdi.REGISTER_READ_WRITE) """
class VMState:
""" Object describing the current VM state.
"""
event = 0
""" The event(s) which triggered the callback (must be checked using a mask: event & pyqbdi.BASIC_BLOCK_ENTRY). """
basicBlockStart = 0
""" The current basic block start address which can also be the execution transfer destination. """
basicBlockEnd = 0
""" The current basic block end address which can also be the execution transfer destination. """
sequenceStart = 0
""" The current sequence start address which can also be the execution transfer destination. """
sequenceEnd = 0
""" The current sequence end address which can also be the execution transfer destination. """
class MemoryAccess:
""" Describe a memory access
"""
instAddress = 0
""" Address of instruction making the access. """
accessAddress = 0
""" Address of accessed memory. """
value = 0
""" Value read from / written to memory. """
size = 0
""" Size of memory access (in bytes). """
type = 0
""" Memory access type (pyqbdi.MEMORY_READ, pyqbdi.MEMORY_WRITE, pyqbdi.MEMORY_READ_WRITE). """
GPRState = None
""" GPRState object, a binding to :cpp:type:`QBDI::GPRState`
"""
FPRState = None
""" FPRState object, a binding to :cpp:type:`QBDI::FPRState`
"""
| 35.90224
| 271
| 0.645677
| 2,219
| 17,628
| 5.107256
| 0.169896
| 0.024089
| 0.032119
| 0.020118
| 0.501015
| 0.487779
| 0.469073
| 0.447896
| 0.427424
| 0.398306
| 0
| 0.002021
| 0.270082
| 17,628
| 490
| 272
| 35.97551
| 0.87876
| 0.579986
| 0
| 0.370079
| 1
| 0
| 0
| 0
| 0
| 0
| 0.001773
| 0
| 0
| 1
| 0.322835
| false
| 0.322835
| 0
| 0
| 0.661417
| 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
|
e13042781e2e380894da0aab1c6ec72861b3ce01
| 227
|
py
|
Python
|
krkbipscraper/settings.py
|
pawmar/krkbipscraper
|
f2629bede33930cf91378caa7f2ee5d683cf1616
|
[
"BSD-3-Clause"
] | null | null | null |
krkbipscraper/settings.py
|
pawmar/krkbipscraper
|
f2629bede33930cf91378caa7f2ee5d683cf1616
|
[
"BSD-3-Clause"
] | null | null | null |
krkbipscraper/settings.py
|
pawmar/krkbipscraper
|
f2629bede33930cf91378caa7f2ee5d683cf1616
|
[
"BSD-3-Clause"
] | null | null | null |
# -*- coding: utf-8 -*-
"""Scrapy settings."""
BOT_NAME = 'krkbipscraper'
SPIDER_MODULES = ['krkbipscraper.spiders']
NEWSPIDER_MODULE = 'krkbipscraper.spiders'
ITEM_PIPELINES = ['krkbipscraper.pipelines.JsonWriterPipeline']
| 22.7
| 63
| 0.744493
| 21
| 227
| 7.857143
| 0.761905
| 0.242424
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004878
| 0.096916
| 227
| 9
| 64
| 25.222222
| 0.8
| 0.171806
| 0
| 0
| 0
| 0
| 0.532967
| 0.461538
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e13fba4b45b4ccda568c26a9f752c38c0cf1cb17
| 97
|
py
|
Python
|
venv/lib/python3.8/site-packages/pip/_internal/network/__init__.py
|
realxwx/leetcode-solve
|
3a7d7d8e92a5fd5fecc347d141a1c532b92e763e
|
[
"Apache-2.0"
] | null | null | null |
venv/lib/python3.8/site-packages/pip/_internal/network/__init__.py
|
realxwx/leetcode-solve
|
3a7d7d8e92a5fd5fecc347d141a1c532b92e763e
|
[
"Apache-2.0"
] | null | null | null |
venv/lib/python3.8/site-packages/pip/_internal/network/__init__.py
|
realxwx/leetcode-solve
|
3a7d7d8e92a5fd5fecc347d141a1c532b92e763e
|
[
"Apache-2.0"
] | null | null | null |
# Copyright (c) 2020
# Author: xiaoweixiang
"""Contains purely network-related utilities.
"""
| 16.166667
| 45
| 0.71134
| 10
| 97
| 6.9
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.04878
| 0.154639
| 97
| 5
| 46
| 19.4
| 0.792683
| 0.876289
| 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
|
e13fc219ca69c0c1e1bed3ebfc6ec504fbe94731
| 1,153
|
py
|
Python
|
server/global_config.py
|
CLG0125/elemesdk
|
344466398bad7cf026e082e47c77d3ca98621ef3
|
[
"MIT"
] | 1
|
2021-04-03T05:11:29.000Z
|
2021-04-03T05:11:29.000Z
|
server/global_config.py
|
CLG0125/elemesdk
|
344466398bad7cf026e082e47c77d3ca98621ef3
|
[
"MIT"
] | null | null | null |
server/global_config.py
|
CLG0125/elemesdk
|
344466398bad7cf026e082e47c77d3ca98621ef3
|
[
"MIT"
] | null | null | null |
class Global:
sand_box = True
app_key = None
# your secret
secret = None
callback_url = None
server_url = None
log = None
def __init__(self, config):
Global.sand_box = config.get_env()
Global.app_key = config.get_app_key()
Global.secret = config.get_secret()
Global.callback_url = config.get_callback_url()
Global.log = config.get_log()
@staticmethod
def get_env():
return Global.sand_box
@staticmethod
def get_app_key():
return Global.app_key
@staticmethod
def get_secret():
return Global.secret
@staticmethod
def get_callback_url():
return Global.callback_url
@staticmethod
def get_log():
return Global.log
@staticmethod
def get_server_url():
return Global.server_url
@staticmethod
def get_access_token_url():
return Global.get_server_url() + "/token"
@staticmethod
def get_api_server_url():
return Global.get_server_url() + "/api/v1/"
@staticmethod
def get_authorize_url():
return Global.get_server_url() + "/authorize"
| 20.589286
| 55
| 0.632264
| 139
| 1,153
| 4.920863
| 0.194245
| 0.197368
| 0.236842
| 0.078947
| 0.118421
| 0.118421
| 0
| 0
| 0
| 0
| 0
| 0.001203
| 0.279271
| 1,153
| 56
| 56
| 20.589286
| 0.821901
| 0.00954
| 0
| 0.225
| 0
| 0
| 0.021034
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0
| 0.225
| 0.65
| 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
|
e15f893232695e92454619ed0274fe5e5ba282b5
| 101
|
py
|
Python
|
src/myapp/admin.py
|
anmquangw/viu-upload-file
|
bfbff413cc92e454226fced5fe504b7cebc6c102
|
[
"MIT"
] | null | null | null |
src/myapp/admin.py
|
anmquangw/viu-upload-file
|
bfbff413cc92e454226fced5fe504b7cebc6c102
|
[
"MIT"
] | 2
|
2020-06-21T01:47:59.000Z
|
2020-06-27T12:39:24.000Z
|
src/myapp/admin.py
|
sonnhfit/DocShare
|
50d9b8c333144780385f970197519ddda61bd502
|
[
"MIT"
] | null | null | null |
"""from django.contrib import admin
from .models import DemoModel
admin.site.register(DemoModel)"""
| 20.2
| 35
| 0.782178
| 13
| 101
| 6.076923
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.09901
| 101
| 4
| 36
| 25.25
| 0.868132
| 0.930693
| 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
|
e163903fd0678839e9ef90435028e77dc1cbf097
| 103
|
py
|
Python
|
src/moredataframes/mdf_core.py
|
GlorifiedStatistics/MoreDataframes
|
147d5b8104d1cbd1cf2836220f43fb6c8ca099b7
|
[
"MIT"
] | null | null | null |
src/moredataframes/mdf_core.py
|
GlorifiedStatistics/MoreDataframes
|
147d5b8104d1cbd1cf2836220f43fb6c8ca099b7
|
[
"MIT"
] | null | null | null |
src/moredataframes/mdf_core.py
|
GlorifiedStatistics/MoreDataframes
|
147d5b8104d1cbd1cf2836220f43fb6c8ca099b7
|
[
"MIT"
] | null | null | null |
"""
A collection of useful functions for manipulating/encoding pandas dataframes for data science.
"""
| 25.75
| 94
| 0.786408
| 13
| 103
| 6.230769
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135922
| 103
| 3
| 95
| 34.333333
| 0.910112
| 0.912621
| 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
|
e16c926aa6450fc30f72e50b4463f6a0fcd7d9ad
| 276
|
py
|
Python
|
venv/Lib/site-packages/numpy/typing/tests/data/fail/lib_utils.py
|
ajayiagbebaku/NFL-Model
|
afcc67a85ca7138c58c3334d45988ada2da158ed
|
[
"MIT"
] | 11
|
2020-06-28T04:30:26.000Z
|
2022-03-26T08:40:47.000Z
|
venv/Lib/site-packages/numpy/typing/tests/data/fail/lib_utils.py
|
ajayiagbebaku/NFL-Model
|
afcc67a85ca7138c58c3334d45988ada2da158ed
|
[
"MIT"
] | 150
|
2019-09-30T11:22:36.000Z
|
2021-08-02T06:19:29.000Z
|
venv/Lib/site-packages/numpy/typing/tests/data/fail/lib_utils.py
|
ajayiagbebaku/NFL-Model
|
afcc67a85ca7138c58c3334d45988ada2da158ed
|
[
"MIT"
] | 20
|
2021-11-07T13:55:56.000Z
|
2021-12-02T10:54:01.000Z
|
import numpy as np
np.deprecate(1) # E: No overload variant
np.deprecate_with_doc(1) # E: incompatible type
np.byte_bounds(1) # E: incompatible type
np.who(1) # E: incompatible type
np.lookfor(None) # E: incompatible type
np.safe_eval(None) # E: incompatible type
| 19.714286
| 48
| 0.721014
| 45
| 276
| 4.333333
| 0.466667
| 0.333333
| 0.435897
| 0.389744
| 0.307692
| 0
| 0
| 0
| 0
| 0
| 0
| 0.017467
| 0.17029
| 276
| 13
| 49
| 21.230769
| 0.834061
| 0.460145
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.142857
| 0
| 0.142857
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
e1a1374935fa7cc8ec68a7212a8ba5b8c016fac8
| 2,107
|
py
|
Python
|
pyob/mixins/pyob_set_label.py
|
khunspoonzi/pyob
|
b1b134b708585add15d04fa75001f3364f31dd74
|
[
"MIT"
] | null | null | null |
pyob/mixins/pyob_set_label.py
|
khunspoonzi/pyob
|
b1b134b708585add15d04fa75001f3364f31dd74
|
[
"MIT"
] | null | null | null |
pyob/mixins/pyob_set_label.py
|
khunspoonzi/pyob
|
b1b134b708585add15d04fa75001f3364f31dd74
|
[
"MIT"
] | null | null | null |
# ┌─────────────────────────────────────────────────────────────────────────────────────
# │ PYOB SET LABEL MIXIN
# └─────────────────────────────────────────────────────────────────────────────────────
class PyObSetLabelMixin:
"""A mixin class for PyOb set label methods"""
# ┌─────────────────────────────────────────────────────────────────────────────────
# │ LABEL SINGULAR
# └─────────────────────────────────────────────────────────────────────────────────
@property
def label_singular(self):
"""Returns a singular label for the PyOb set"""
# Determine if PyOb set is mixed
is_mixed = self.count() > 1 and self._PyObClass is None
# Get PyOb label
ob_label = "Mixed" if is_mixed else self.ob_label_singular
# Return singular label
return self.__class__.__name__.replace("Ob", ob_label + " ")
# ┌─────────────────────────────────────────────────────────────────────────────────
# │ LABEL PLURAL
# └─────────────────────────────────────────────────────────────────────────────────
@property
def label_plural(self):
"""Returns a plural label for the PyOb set"""
# Return plural label
return self.label_singular + "s"
# ┌─────────────────────────────────────────────────────────────────────────────────
# │ OB LABEL SINGULAR
# └─────────────────────────────────────────────────────────────────────────────────
@property
def ob_label_singular(self):
"""Returns a singular label based on related PyOb if any"""
# Return singular label
return (self._PyObClass and self._PyObClass.label_singular) or "Ob"
# ┌─────────────────────────────────────────────────────────────────────────────────
# │ OB LABEL PLURAL
# └─────────────────────────────────────────────────────────────────────────────────
@property
def ob_label_plural(self):
"""Returns a plural label based on related object if any"""
# Return plural label
return (self._PyObClass and self._PyObClass.label_plural) or "Obs"
| 36.327586
| 88
| 0.366398
| 172
| 2,107
| 9.168605
| 0.255814
| 0.057705
| 0.235891
| 0.130628
| 0.485732
| 0.148383
| 0.148383
| 0.05707
| 0
| 0
| 0
| 0.000584
| 0.18747
| 2,107
| 57
| 89
| 36.964912
| 0.433995
| 0.613194
| 0
| 0.266667
| 0
| 0
| 0.018205
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.266667
| false
| 0
| 0
| 0
| 0.6
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
e1b1b1bf75362e9f77713c3b8bcaddbf1477de81
| 55
|
py
|
Python
|
Tests/playground.py
|
mbtaPredict/Main
|
e1c3320ff08b61355ac96f51be9e20c57372f13b
|
[
"MIT"
] | null | null | null |
Tests/playground.py
|
mbtaPredict/Main
|
e1c3320ff08b61355ac96f51be9e20c57372f13b
|
[
"MIT"
] | null | null | null |
Tests/playground.py
|
mbtaPredict/Main
|
e1c3320ff08b61355ac96f51be9e20c57372f13b
|
[
"MIT"
] | null | null | null |
import matplotlib.pyplot as plt
plt.plot()
plt.show()
| 11
| 31
| 0.745455
| 9
| 55
| 4.555556
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.127273
| 55
| 5
| 32
| 11
| 0.854167
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
e1b37b3b7be2be9f06bdec60a631822373a8b7f7
| 185
|
py
|
Python
|
awards/forms.py
|
danalvin/Django-IP3
|
6df0adaddf998fd4195b23ee97f81938e741215a
|
[
"MIT"
] | null | null | null |
awards/forms.py
|
danalvin/Django-IP3
|
6df0adaddf998fd4195b23ee97f81938e741215a
|
[
"MIT"
] | 4
|
2020-06-05T19:20:59.000Z
|
2021-09-08T00:32:49.000Z
|
awards/forms.py
|
danalvin/Django-IP3
|
6df0adaddf998fd4195b23ee97f81938e741215a
|
[
"MIT"
] | null | null | null |
from django import forms
from .models import Project
class ProjectForm(forms.ModelForm):
class Meta:
model = Project
exclude = ['profile', 'posted_time', 'user']
| 18.5
| 52
| 0.67027
| 21
| 185
| 5.857143
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.232432
| 185
| 9
| 53
| 20.555556
| 0.866197
| 0
| 0
| 0
| 0
| 0
| 0.118919
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
e1ba723285119341020fa35acb08aec8be4bb131
| 200
|
py
|
Python
|
src/resdk/__init__.py
|
AGregorc/resolwe-bio-py
|
62304e5d4c54c917575421701c6977dc63fc3a8f
|
[
"Apache-2.0"
] | 4
|
2016-09-28T16:00:05.000Z
|
2018-08-16T16:14:10.000Z
|
src/resdk/__init__.py
|
AGregorc/resolwe-bio-py
|
62304e5d4c54c917575421701c6977dc63fc3a8f
|
[
"Apache-2.0"
] | 229
|
2016-03-28T19:41:00.000Z
|
2022-03-16T15:02:15.000Z
|
src/resdk/__init__.py
|
AGregorc/resolwe-bio-py
|
62304e5d4c54c917575421701c6977dc63fc3a8f
|
[
"Apache-2.0"
] | 18
|
2016-03-10T16:11:57.000Z
|
2021-06-01T10:01:49.000Z
|
"""Resolwe SDK for Python."""
from .collection_tables import CollectionTables # noqa
from .resdk_logger import log_to_stdout, start_logging # noqa
from .resolwe import Resolwe, ResolweQuery # noqa
| 40
| 62
| 0.79
| 26
| 200
| 5.884615
| 0.692308
| 0.104575
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.135
| 200
| 4
| 63
| 50
| 0.884393
| 0.195
| 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
|
bed0237d9ebc522d5a4384033d2b57c729cc7ede
| 39
|
py
|
Python
|
__init__.py
|
amueller/information-theoretic-mst
|
178fd4396bc9a9a499ec3d18d5047b320a5c32f2
|
[
"Unlicense"
] | 20
|
2016-05-03T13:29:09.000Z
|
2021-10-06T20:41:36.000Z
|
__init__.py
|
amueller/information-theoretic-mst
|
178fd4396bc9a9a499ec3d18d5047b320a5c32f2
|
[
"Unlicense"
] | 1
|
2018-04-21T15:32:07.000Z
|
2020-05-19T00:28:52.000Z
|
__init__.py
|
amueller/information-theoretic-mst
|
178fd4396bc9a9a499ec3d18d5047b320a5c32f2
|
[
"Unlicense"
] | 5
|
2015-04-21T00:27:49.000Z
|
2019-02-23T20:46:33.000Z
|
from itm import ITM
__all__ = ['ITM']
| 9.75
| 19
| 0.666667
| 6
| 39
| 3.666667
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.205128
| 39
| 3
| 20
| 13
| 0.709677
| 0
| 0
| 0
| 0
| 0
| 0.076923
| 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
|
bef16a350cb321f3059e524b8af8bbcaac507956
| 123
|
py
|
Python
|
email_log/apps.py
|
bernd-wechner/django-email-log
|
dbbe0ef6cee8b8067d6420dccc7a8f2061662a68
|
[
"MIT"
] | 26
|
2015-04-14T18:24:54.000Z
|
2022-03-07T13:01:34.000Z
|
email_log/apps.py
|
bernd-wechner/django-email-log
|
dbbe0ef6cee8b8067d6420dccc7a8f2061662a68
|
[
"MIT"
] | 23
|
2015-06-23T02:40:39.000Z
|
2022-02-08T05:07:42.000Z
|
email_log/apps.py
|
bernd-wechner/django-email-log
|
dbbe0ef6cee8b8067d6420dccc7a8f2061662a68
|
[
"MIT"
] | 25
|
2015-02-04T16:16:05.000Z
|
2021-09-28T10:53:00.000Z
|
from django.apps import AppConfig
class EmailLogConfig(AppConfig):
name = 'email_log'
verbose_name = "Email log"
| 17.571429
| 33
| 0.731707
| 15
| 123
| 5.866667
| 0.733333
| 0.204545
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186992
| 123
| 6
| 34
| 20.5
| 0.88
| 0
| 0
| 0
| 0
| 0
| 0.146341
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.25
| 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
|
bef32dc0efa2656e8a84216ea747c7b952e1b452
| 43
|
py
|
Python
|
moban/_version.py
|
CLiu13/moban
|
5deada1af7ff24a6adf698de6a8b589a258d4dc2
|
[
"MIT"
] | 1
|
2018-12-16T01:16:22.000Z
|
2018-12-16T01:16:22.000Z
|
moban/_version.py
|
CLiu13/moban
|
5deada1af7ff24a6adf698de6a8b589a258d4dc2
|
[
"MIT"
] | null | null | null |
moban/_version.py
|
CLiu13/moban
|
5deada1af7ff24a6adf698de6a8b589a258d4dc2
|
[
"MIT"
] | null | null | null |
__version__ = "0.3.9"
__author__ = "C. W."
| 14.333333
| 21
| 0.604651
| 7
| 43
| 2.571429
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.083333
| 0.162791
| 43
| 2
| 22
| 21.5
| 0.416667
| 0
| 0
| 0
| 0
| 0
| 0.232558
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
bef57e6edf7a67698588bda9e271df4b1e689682
| 131
|
py
|
Python
|
catalyst/dl/experiment/__init__.py
|
andrey-avdeev/catalyst
|
fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3
|
[
"Apache-2.0"
] | 3
|
2019-11-02T05:37:06.000Z
|
2020-01-13T02:26:07.000Z
|
catalyst/dl/experiment/__init__.py
|
andrey-avdeev/catalyst
|
fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3
|
[
"Apache-2.0"
] | null | null | null |
catalyst/dl/experiment/__init__.py
|
andrey-avdeev/catalyst
|
fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3
|
[
"Apache-2.0"
] | 1
|
2021-12-20T07:32:25.000Z
|
2021-12-20T07:32:25.000Z
|
# flake8: noqa
from .base import BaseExperiment
from .config import ConfigExperiment
from .supervised import SupervisedExperiment
| 21.833333
| 44
| 0.839695
| 14
| 131
| 7.857143
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008696
| 0.122137
| 131
| 5
| 45
| 26.2
| 0.947826
| 0.091603
| 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
|
bef6dbd81f470e4f916903c6f30ebc2cb970bd0a
| 310
|
py
|
Python
|
url_shortener_client/exceptions/__init__.py
|
Andrelpoj/hire.me
|
79428e2094a6b56e762a7f958e1b75f395f59cef
|
[
"Apache-2.0"
] | null | null | null |
url_shortener_client/exceptions/__init__.py
|
Andrelpoj/hire.me
|
79428e2094a6b56e762a7f958e1b75f395f59cef
|
[
"Apache-2.0"
] | null | null | null |
url_shortener_client/exceptions/__init__.py
|
Andrelpoj/hire.me
|
79428e2094a6b56e762a7f958e1b75f395f59cef
|
[
"Apache-2.0"
] | null | null | null |
class AliasNotFound(Exception):
def __init__(self, alias):
self.alias = alias
class AliasAlreadyExists(Exception):
def __init__(self, alias):
self.alias = alias
class UnexpectedServerResponse(Exception):
def __init__(self, response):
self.response = response
| 25.833333
| 43
| 0.670968
| 30
| 310
| 6.533333
| 0.333333
| 0.183673
| 0.244898
| 0.306122
| 0.44898
| 0.44898
| 0.44898
| 0.44898
| 0.44898
| 0
| 0
| 0
| 0.241935
| 310
| 11
| 44
| 28.181818
| 0.834043
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0
| 0.666667
| 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
|
8316bb71d181ce8ce3eff4b2a0a627c1843d8260
| 485
|
py
|
Python
|
syndata/__init__.py
|
Menelau/synthetic_datasets
|
86fd99042cff6a8bbdfa195fe6eee938a9c9d8f5
|
[
"MIT"
] | 6
|
2018-02-07T02:02:00.000Z
|
2020-01-22T10:33:01.000Z
|
syndata/__init__.py
|
Menelau/synthetic_datasets
|
86fd99042cff6a8bbdfa195fe6eee938a9c9d8f5
|
[
"MIT"
] | null | null | null |
syndata/__init__.py
|
Menelau/synthetic_datasets
|
86fd99042cff6a8bbdfa195fe6eee938a9c9d8f5
|
[
"MIT"
] | null | null | null |
# coding=utf-8
# Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com>
#
# License: MIT
"""
The :mod:`deslib.util` This module includes various utilities. They are divided into three parts:
syndata.synthethic_datasets - Provide functions to generate several 2D classification datasets.
syndata.plot_tools - Provides some routines to easily plot datasets and decision borders of a scikit-learn classifier.
"""
from .plot_tools import *
from .synthetic_datasets import *
| 28.529412
| 118
| 0.785567
| 66
| 485
| 5.712121
| 0.848485
| 0.047745
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004796
| 0.140206
| 485
| 16
| 119
| 30.3125
| 0.899281
| 0.837113
| 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
|
83404f40a03d9276b97c34aee6e5fb4ad81499f8
| 101
|
py
|
Python
|
gen_newsletter.py
|
pnijjar/google-calendar-rss
|
6f4e6b9acbeffcf74112e6b33d99eaf1ea912be4
|
[
"Apache-2.0"
] | 1
|
2021-06-29T04:10:48.000Z
|
2021-06-29T04:10:48.000Z
|
gen_newsletter.py
|
pnijjar/google-calendar-rss
|
6f4e6b9acbeffcf74112e6b33d99eaf1ea912be4
|
[
"Apache-2.0"
] | 1
|
2021-06-29T05:03:36.000Z
|
2021-06-29T05:03:36.000Z
|
gen_newsletter.py
|
pnijjar/google-calendar-rss
|
6f4e6b9acbeffcf74112e6b33d99eaf1ea912be4
|
[
"Apache-2.0"
] | 2
|
2019-08-07T15:33:25.000Z
|
2021-06-29T04:37:21.000Z
|
#!/usr/bin/env python3
from gcal_helpers import helpers
helpers.write_transformation("newsletter")
| 16.833333
| 42
| 0.811881
| 13
| 101
| 6.153846
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.01087
| 0.089109
| 101
| 5
| 43
| 20.2
| 0.858696
| 0.207921
| 0
| 0
| 0
| 0
| 0.126582
| 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
|
55d7d78c6937d21c0eddc062cc73761c958ba202
| 1,175
|
py
|
Python
|
python/setup.py
|
chrisdembia/StateMint
|
53fdaabc7ba83fb477523ae9b79ccc964e791080
|
[
"BSD-3-Clause"
] | null | null | null |
python/setup.py
|
chrisdembia/StateMint
|
53fdaabc7ba83fb477523ae9b79ccc964e791080
|
[
"BSD-3-Clause"
] | null | null | null |
python/setup.py
|
chrisdembia/StateMint
|
53fdaabc7ba83fb477523ae9b79ccc964e791080
|
[
"BSD-3-Clause"
] | null | null | null |
import setuptools
with open('README.md') as f:
long_description=f.read()
setuptools.setup(
name="StateMint",
version="1.0.0",
author="Cameron Devine",
author_email="camdev@uw.edu",
description="A library for finding State Space models of dynamical systems.",
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/CameronDevine/StateMint",
packages=setuptools.find_packages(),
python_requires=">=2.7",
install_requires=("sympy>=0.7.3",),
classifiers=(
"Development Status :: 4 - Beta",
"Framework :: Jupyter",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.0",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Operating System :: OS Independent",
),
)
| 31.756757
| 78
| 0.691064
| 140
| 1,175
| 5.728571
| 0.542857
| 0.236908
| 0.311721
| 0.259352
| 0.067332
| 0
| 0
| 0
| 0
| 0
| 0
| 0.026839
| 0.14383
| 1,175
| 36
| 79
| 32.638889
| 0.770378
| 0
| 0
| 0
| 0
| 0
| 0.628936
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.029412
| 0
| 0.029412
| 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
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
360246393544aa24389fdcd4c6b8786fa1b242b5
| 232
|
py
|
Python
|
src/CodeLearn/plaintextCode/BloomTech/BTU5W1/U5W1P2_Task3_w1.py
|
MingjunGeng/Code-Knowledge
|
5b376f6b3ff9e7fa0ab41c7b57e3a80313fa0daa
|
[
"MIT"
] | null | null | null |
src/CodeLearn/plaintextCode/BloomTech/BTU5W1/U5W1P2_Task3_w1.py
|
MingjunGeng/Code-Knowledge
|
5b376f6b3ff9e7fa0ab41c7b57e3a80313fa0daa
|
[
"MIT"
] | null | null | null |
src/CodeLearn/plaintextCode/BloomTech/BTU5W1/U5W1P2_Task3_w1.py
|
MingjunGeng/Code-Knowledge
|
5b376f6b3ff9e7fa0ab41c7b57e3a80313fa0daa
|
[
"MIT"
] | 1
|
2022-03-18T04:52:10.000Z
|
2022-03-18T04:52:10.000Z
|
#!/usr/bin/python3
# --- 001 > U5W2P1_Task3_w1
def solution(i):
return float(i)
if __name__ == "__main__":
print('----------start------------')
i = 12
print(solution( i ))
print('------------end------------')
| 19.333333
| 40
| 0.465517
| 25
| 232
| 3.92
| 0.76
| 0.183673
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.058824
| 0.193966
| 232
| 11
| 41
| 21.090909
| 0.465241
| 0.185345
| 0
| 0
| 0
| 0
| 0.331551
| 0.28877
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0
| 0
| 0.142857
| 0.285714
| 0.428571
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
|
0
| 4
|
36087ed60369c020bd543832aa6b41bed88a5c17
| 100
|
py
|
Python
|
easyfl/test.py
|
weimingwill/easyfl-pypi
|
f9135ab14f8d486d4a1065fa62ade43fa14490a5
|
[
"MIT"
] | 2
|
2021-11-08T12:24:06.000Z
|
2021-11-08T12:24:33.000Z
|
easyfl/test.py
|
weimingwill/easyfl-pypi
|
f9135ab14f8d486d4a1065fa62ade43fa14490a5
|
[
"MIT"
] | null | null | null |
easyfl/test.py
|
weimingwill/easyfl-pypi
|
f9135ab14f8d486d4a1065fa62ade43fa14490a5
|
[
"MIT"
] | null | null | null |
class Test:
def __init__(self):
pass
def hi(self):
print("hello world")
| 16.666667
| 28
| 0.52
| 12
| 100
| 4
| 0.833333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.37
| 100
| 6
| 28
| 16.666667
| 0.761905
| 0
| 0
| 0
| 0
| 0
| 0.108911
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0.2
| 0
| 0
| 0.6
| 0.2
| 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
| 1
| 0
| 0
| 0
| 0
|
0
| 4
|
3610620368663e7a20b5544000c84c6865a97120
| 88
|
py
|
Python
|
sum of digits using recursion.py
|
kingRovo/PythonCodingChalenge
|
b62938592df10ccafec9930b69c14c778e19ad37
|
[
"bzip2-1.0.6"
] | 1
|
2021-08-02T16:52:55.000Z
|
2021-08-02T16:52:55.000Z
|
sum of digits using recursion.py
|
kingRovo/PythonCodingChalenge
|
b62938592df10ccafec9930b69c14c778e19ad37
|
[
"bzip2-1.0.6"
] | null | null | null |
sum of digits using recursion.py
|
kingRovo/PythonCodingChalenge
|
b62938592df10ccafec9930b69c14c778e19ad37
|
[
"bzip2-1.0.6"
] | null | null | null |
def rec_sum(n):
if(n<=1):
return n
else:
return(n+rec_sum(n-1))
| 14.666667
| 30
| 0.477273
| 16
| 88
| 2.5
| 0.5
| 0.3
| 0.35
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.035088
| 0.352273
| 88
| 5
| 31
| 17.6
| 0.666667
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0
| 0
| 0.4
| 0
| 1
| 0
| 0
| null | 1
| 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
|
36134c0670c8fbaeb545400c9c8d63641cf7bd8e
| 248
|
py
|
Python
|
accounts/management/commands/run-stats.py
|
ChristianJStarr/Scratch-Bowling-Series-Website
|
283c7b1b38ffce660464889de3f4dc8050b4008c
|
[
"MIT"
] | 1
|
2021-05-19T19:30:40.000Z
|
2021-05-19T19:30:40.000Z
|
accounts/management/commands/run-stats.py
|
ChristianJStarr/Scratch-Bowling-Series-Website
|
283c7b1b38ffce660464889de3f4dc8050b4008c
|
[
"MIT"
] | null | null | null |
accounts/management/commands/run-stats.py
|
ChristianJStarr/Scratch-Bowling-Series-Website
|
283c7b1b38ffce660464889de3f4dc8050b4008c
|
[
"MIT"
] | null | null | null |
from django.core.management.base import BaseCommand, CommandError
from scoreboard.ranking import calculate_statistics
class Command(BaseCommand):
help = 'Run Statistics'
def handle(self, *args, **options):
calculate_statistics()
| 24.8
| 65
| 0.758065
| 27
| 248
| 6.888889
| 0.777778
| 0.204301
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.157258
| 248
| 10
| 66
| 24.8
| 0.889952
| 0
| 0
| 0
| 0
| 0
| 0.056225
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
36360d07dd0f1e6bcc68b6986125359b768850eb
| 885
|
py
|
Python
|
VersionMonitorDeamonForPy/deamon/ZTest.py
|
xblia/Upgrade-service-for-java-application
|
6118cb270daba5d6511f41a2b3f0784c5a444c17
|
[
"Apache-2.0"
] | null | null | null |
VersionMonitorDeamonForPy/deamon/ZTest.py
|
xblia/Upgrade-service-for-java-application
|
6118cb270daba5d6511f41a2b3f0784c5a444c17
|
[
"Apache-2.0"
] | null | null | null |
VersionMonitorDeamonForPy/deamon/ZTest.py
|
xblia/Upgrade-service-for-java-application
|
6118cb270daba5d6511f41a2b3f0784c5a444c17
|
[
"Apache-2.0"
] | null | null | null |
#coding=utf-8
'''/*
* Copyright 2015 lixiaobo
*
* VersionUpgrade project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/'''
'''
Created on 2015年12月30日
@author: xiaobolx
'''
import os
if __name__ == '__main__':
os.rename(r"D:\eclipse_workspace\VersionMonitorDeamonForPy\build\aaa", r"D:\eclipse_workspace\VersionMonitorDeamonForPy\build\exe.win32xxxx")
| 34.038462
| 145
| 0.748023
| 125
| 885
| 5.216
| 0.68
| 0.092025
| 0.039877
| 0.04908
| 0.147239
| 0.147239
| 0
| 0
| 0
| 0
| 0
| 0.025503
| 0.158192
| 885
| 26
| 145
| 34.038462
| 0.849664
| 0.710734
| 0
| 0
| 0
| 0
| 0.691489
| 0.648936
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 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
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3662bd8e72712ef2032fb1273a5b29f2780ed323
| 144
|
py
|
Python
|
users.py
|
VinasRibeiro/DownStoriesInsta
|
56c8dc402b50a07db2b207c683e39e045fda83e1
|
[
"MIT"
] | null | null | null |
users.py
|
VinasRibeiro/DownStoriesInsta
|
56c8dc402b50a07db2b207c683e39e045fda83e1
|
[
"MIT"
] | null | null | null |
users.py
|
VinasRibeiro/DownStoriesInsta
|
56c8dc402b50a07db2b207c683e39e045fda83e1
|
[
"MIT"
] | null | null | null |
class Users:
usernamep = 'your_user_email'
passwordp = 'your_password'
linkp = 'https://www.instagram.com/stories/cznburak/'
| 18
| 57
| 0.666667
| 16
| 144
| 5.8125
| 0.9375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.208333
| 144
| 7
| 58
| 20.571429
| 0.815789
| 0
| 0
| 0
| 0
| 0
| 0.496504
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.25
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
366b6bc762ff4618c8e2b630d09921664231bc91
| 53
|
py
|
Python
|
3_team/tests/unittest_sample_ng/sample.py
|
pyfirst/pymook-samplecode
|
82321237c34515d287f28bd51ea86f870c1f5514
|
[
"MIT"
] | 31
|
2017-09-27T14:54:39.000Z
|
2021-05-26T14:03:44.000Z
|
3_team/tests/unittest_sample_ng/sample.py
|
pyfirst/pymook-samplecode
|
82321237c34515d287f28bd51ea86f870c1f5514
|
[
"MIT"
] | 11
|
2018-03-11T05:28:14.000Z
|
2022-03-11T23:19:36.000Z
|
3_team/tests/unittest_sample_ng/sample.py
|
pyfirst/pymook-samplecode
|
82321237c34515d287f28bd51ea86f870c1f5514
|
[
"MIT"
] | 41
|
2017-10-21T04:45:56.000Z
|
2021-07-16T14:12:33.000Z
|
def add(m, n):
"""mとnを加算して返す"""
return m - n
| 13.25
| 20
| 0.490566
| 8
| 53
| 3.25
| 0.75
| 0.153846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.301887
| 53
| 3
| 21
| 17.666667
| 0.702703
| 0.188679
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
369370477fede6ca05479665d356d7b8ddbbef42
| 211
|
py
|
Python
|
src/settings/settings.py
|
lamas1901/telegram__pdf-bot
|
995bd3a41edba744efc07a99296ff109427ed310
|
[
"MIT"
] | null | null | null |
src/settings/settings.py
|
lamas1901/telegram__pdf-bot
|
995bd3a41edba744efc07a99296ff109427ed310
|
[
"MIT"
] | null | null | null |
src/settings/settings.py
|
lamas1901/telegram__pdf-bot
|
995bd3a41edba744efc07a99296ff109427ed310
|
[
"MIT"
] | null | null | null |
from ..utils import get_env_var
from pathlib import Path
BASE_DIR = Path(__file__).parent.parent
TG_TOKEN = get_env_var('TG_TOKEN')
YMONEY_TOKEN = get_env_var('YTOKEN')
PROMO_CODE = get_env_var('PROMO_CODE')
| 21.1
| 39
| 0.78673
| 36
| 211
| 4.111111
| 0.5
| 0.162162
| 0.243243
| 0.189189
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109005
| 211
| 9
| 40
| 23.444444
| 0.787234
| 0
| 0
| 0
| 0
| 0
| 0.113744
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
36b8bfd65b80b877d57938c5b868d8f66abde496
| 65
|
py
|
Python
|
ml/av/io/__init__.py
|
necla-ml/ml
|
7ebd29382326e3958297607da7182c211865e7ff
|
[
"BSD-3-Clause"
] | 1
|
2022-02-21T21:06:29.000Z
|
2022-02-21T21:06:29.000Z
|
ml/av/io/__init__.py
|
necla-ml/ml
|
7ebd29382326e3958297607da7182c211865e7ff
|
[
"BSD-3-Clause"
] | null | null | null |
ml/av/io/__init__.py
|
necla-ml/ml
|
7ebd29382326e3958297607da7182c211865e7ff
|
[
"BSD-3-Clause"
] | null | null | null |
"""APIs from ml.vision.io and ml.audio.io
"""
from .api import *
| 16.25
| 41
| 0.661538
| 12
| 65
| 3.583333
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.153846
| 65
| 4
| 42
| 16.25
| 0.781818
| 0.584615
| 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
|
7fcd0efe44d52a8f5eb0ccaff5033e799faefab2
| 503
|
py
|
Python
|
json-read.py
|
ccoffrin/py-json-examples
|
c01bf6994e4480470939621ed0b4b7043b38819f
|
[
"MIT"
] | null | null | null |
json-read.py
|
ccoffrin/py-json-examples
|
c01bf6994e4480470939621ed0b4b7043b38819f
|
[
"MIT"
] | null | null | null |
json-read.py
|
ccoffrin/py-json-examples
|
c01bf6994e4480470939621ed0b4b7043b38819f
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python3
import json
data_json = {}
with open('data/json_00.json', 'r') as file:
data_json = json.load(file)
print(data_json)
print(data_json[0])
print(data_json[1])
print(data_json[2])
print(data_json[3])
print(data_json[4])
print(data_json[5])
print(data_json[6])
print(data_json[5][0])
print(data_json[5][1])
print(data_json[5][2])
print(data_json[5][3])
print(data_json[6])
print(data_json[6]["A"])
print(data_json[6]["B"])
print(data_json[6]["C"])
print(data_json[6]["D"])
| 16.766667
| 44
| 0.691849
| 97
| 503
| 3.381443
| 0.268041
| 0.487805
| 0.67378
| 0.256098
| 0.164634
| 0.164634
| 0.164634
| 0
| 0
| 0
| 0
| 0.05
| 0.085487
| 503
| 29
| 45
| 17.344828
| 0.663043
| 0.04175
| 0
| 0.095238
| 0
| 0
| 0.045738
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.047619
| 0
| 0.047619
| 0.809524
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
7fda7ecbf9da0226a54341ecb40e210f62c31957
| 1,951
|
py
|
Python
|
proj/python/Test/dictStock.py
|
jumib/BlackTensor
|
d66a4fb5289dbe86104900072284e4a881f55645
|
[
"MIT"
] | null | null | null |
proj/python/Test/dictStock.py
|
jumib/BlackTensor
|
d66a4fb5289dbe86104900072284e4a881f55645
|
[
"MIT"
] | null | null | null |
proj/python/Test/dictStock.py
|
jumib/BlackTensor
|
d66a4fb5289dbe86104900072284e4a881f55645
|
[
"MIT"
] | null | null | null |
import requests
# host = 'localhost:8080'
# path = '/member/changeAppId'
# payload = {'UserId' : userId }
# r = requests.get('localhost:8080/member/changeAppId', params=payload)
# import requests
# import json
#
# # GET
# res = requests.get('http://localhost:8080/member/changeAppId')
# print(str(res.status_code) + " | " + res.text)
#
# # POST (JSON)
# headers = {'Content-Type': 'application/json; chearset=utf-8'}
# payload = {'UserId' : 'userId' }
# res = requests.post('http://localhost:8080/member/changeAppId', payload=json.dumps(payload), headers=headers)
# print(str(res.status_code) + " | " + res.text)
#
# class DictStock:
# @app.route('/history/buy')
# def PythonServerResponse(self, itemName, m_date, openPrice, highPrice, lowPrice, currentPrice, volumn, tradingValue):
# print("It's operate")
# # self.myViewController = vc.ViewController()
# json_object = {
# "name": itemName,
# "일자": m_date,
# "시가": openPrice,
# "고가": highPrice,
# "저가": lowPrice,
# "현재가": currentPrice,
# "거래량": volumn,
# "거래대금": tradingValue
# }
# json_string = json.dumps(json_object)
# print(json_string)
# # return jsonify(json_object)
#
# app.run()
# # # data = {
# # # # 'itemName' : itemName,
# # # 'date' : m_date,
# # # 'openPrice' : openPrice
# # # }
# # # json_data = json.dumps(data)
# # # print(json_data)
# #
# #
# # # import json
# # #
# # # json_object = {
# # # "id": 1,
# # # "username": "Bret",
# # # "email": "Sincere@april.biz",
# # # "address": {
# # # "street": "Kulas Light",
# # # "suite": "Apt. 556",
# # # "city": "Gwenborough",
# # # "zipcode": "92998-3874"
# # # },
# # # "admin": False,
# # # "hobbies": None
# # # }
# # #
# # # json_string = json.dumps(json_object)
# # # print(json_string)
| 26.364865
| 123
| 0.538186
| 187
| 1,951
| 5.529412
| 0.491979
| 0.048356
| 0.055126
| 0.087041
| 0.205029
| 0.139265
| 0.139265
| 0.085106
| 0.085106
| 0
| 0
| 0.020935
| 0.265505
| 1,951
| 73
| 124
| 26.726027
| 0.700628
| 0.892363
| 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
|
7ff1b8e6fdd883cf61f529bf469c18df4b7174fc
| 166
|
py
|
Python
|
django_gotolong/bhav/apps.py
|
ParikhKadam/gotolong
|
839beb8aa37055a2078eaa289b8ae05b62e8905e
|
[
"BSD-2-Clause",
"BSD-3-Clause"
] | 15
|
2019-12-06T16:19:45.000Z
|
2021-08-20T13:22:22.000Z
|
django_gotolong/bhav/apps.py
|
ParikhKadam/gotolong
|
839beb8aa37055a2078eaa289b8ae05b62e8905e
|
[
"BSD-2-Clause",
"BSD-3-Clause"
] | 14
|
2020-12-08T10:45:05.000Z
|
2021-09-21T17:23:45.000Z
|
django_gotolong/bhav/apps.py
|
ParikhKadam/gotolong
|
839beb8aa37055a2078eaa289b8ae05b62e8905e
|
[
"BSD-2-Clause",
"BSD-3-Clause"
] | 9
|
2020-01-01T03:04:29.000Z
|
2021-04-18T08:42:30.000Z
|
from django.apps import AppConfig
from django_gotolong.bhav.views import start
class BhavConfig(AppConfig):
name = 'bhav'
def ready(self):
start()
| 16.6
| 44
| 0.704819
| 21
| 166
| 5.52381
| 0.714286
| 0.172414
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.210843
| 166
| 9
| 45
| 18.444444
| 0.885496
| 0
| 0
| 0
| 0
| 0
| 0.024096
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
7ff4886052822174f0f2c10e163f3567d0699ee7
| 133
|
py
|
Python
|
geotweet/tests/integration/twitter/__init__.py
|
meyersj/geotweet
|
1a6b55f98adf34d1b91f172d9187d599616412d9
|
[
"MIT"
] | 6
|
2016-03-26T19:29:25.000Z
|
2020-07-12T02:18:22.000Z
|
geotweet/tests/integration/twitter/__init__.py
|
meyersj/geotweet
|
1a6b55f98adf34d1b91f172d9187d599616412d9
|
[
"MIT"
] | null | null | null |
geotweet/tests/integration/twitter/__init__.py
|
meyersj/geotweet
|
1a6b55f98adf34d1b91f172d9187d599616412d9
|
[
"MIT"
] | 1
|
2020-01-06T01:25:05.000Z
|
2020-01-06T01:25:05.000Z
|
import os
from os.path import dirname
import sys
ROOT = dirname(dirname(dirname(os.path.abspath(__file__))))
sys.path.append(ROOT)
| 16.625
| 59
| 0.774436
| 21
| 133
| 4.714286
| 0.47619
| 0.121212
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 133
| 7
| 60
| 19
| 0.831933
| 0
| 0
| 0
| 0
| 0
| 0
| 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
|
7ffeda80306a79591e192335e97b6bc94abc7f4b
| 160
|
py
|
Python
|
DublinBusTest/forms.py
|
Eimg851/DublinBusApp_ResearchPracticum
|
41b2c559dc4608705fd1348480ce729c645d6d5a
|
[
"BSD-2-Clause"
] | null | null | null |
DublinBusTest/forms.py
|
Eimg851/DublinBusApp_ResearchPracticum
|
41b2c559dc4608705fd1348480ce729c645d6d5a
|
[
"BSD-2-Clause"
] | null | null | null |
DublinBusTest/forms.py
|
Eimg851/DublinBusApp_ResearchPracticum
|
41b2c559dc4608705fd1348480ce729c645d6d5a
|
[
"BSD-2-Clause"
] | 1
|
2020-06-20T09:53:15.000Z
|
2020-06-20T09:53:15.000Z
|
from django import forms
from .models import *
class routeForm(forms.ModelForm):
class Meta:
model = Routes
fields = ('route_short_name',)
| 20
| 38
| 0.66875
| 19
| 160
| 5.526316
| 0.789474
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.24375
| 160
| 7
| 39
| 22.857143
| 0.867769
| 0
| 0
| 0
| 0
| 0
| 0.1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
3d1b7856aab4b6896a8bd50f1e84b7518ab5535b
| 21
|
py
|
Python
|
custom_components/ztm/__init__.py
|
peetereczek/ztm
|
1fd4870720dca16863d085759a360f1ebdd9ab1f
|
[
"MIT"
] | 4
|
2020-02-23T08:08:12.000Z
|
2021-06-26T15:46:27.000Z
|
custom_components/ztm/__init__.py
|
peetereczek/ztm
|
1fd4870720dca16863d085759a360f1ebdd9ab1f
|
[
"MIT"
] | 15
|
2020-01-30T09:54:58.000Z
|
2022-02-02T11:13:32.000Z
|
custom_components/ztm/__init__.py
|
peetereczek/ztm
|
1fd4870720dca16863d085759a360f1ebdd9ab1f
|
[
"MIT"
] | 1
|
2022-01-17T08:51:34.000Z
|
2022-01-17T08:51:34.000Z
|
"""
module init
"""
| 7
| 12
| 0.47619
| 2
| 21
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.238095
| 21
| 3
| 13
| 7
| 0.625
| 0.52381
| 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
|
3d319597951dce7996b3f7f4aeae76d89320c801
| 2,716
|
py
|
Python
|
ROS/my_initials.py
|
Vishwajeetiitb/Autumn-of-Automation
|
bd8c78662734f867b6aa6fd9179a12913387a01c
|
[
"MIT"
] | null | null | null |
ROS/my_initials.py
|
Vishwajeetiitb/Autumn-of-Automation
|
bd8c78662734f867b6aa6fd9179a12913387a01c
|
[
"MIT"
] | null | null | null |
ROS/my_initials.py
|
Vishwajeetiitb/Autumn-of-Automation
|
bd8c78662734f867b6aa6fd9179a12913387a01c
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
import rospy
from geometry_msgs.msg import Twist
import math
import os
from turtlesim.msg import Pose
import time
os.system("rosrun")
def callback(msg):
global current_angle
current_angle = msg.theta
# print(msg)
def move():
# Starts a new node
rospy.init_node('robot_cleaner', anonymous=True)
velocity_publisher = rospy.Publisher('/turtle1/cmd_vel', Twist, queue_size=10)
sub = rospy.Subscriber("turtle1/pose",Pose,callback)
time.sleep(1)
vel_msg = Twist()
speed = 2
distance = 4
angle = math.pi/3
angular_ve1 = 1
vel_msg.angular.z = 0
current_distance = 0
t0 = rospy.Time.now().to_sec()
# t0 = rospy.Time.now().to_sec()
vel_msg.linear.x = 0
vel_msg.angular.z = angular_ve1
while current_angle < angle:
velocity_publisher.publish(vel_msg)
#Takes actual time to velocity calculus
t1=rospy.Time.now().to_sec()
print(current_angle)
vel_msg.linear.x = 0
vel_msg.angular.z = 0
velocity_publisher.publish(vel_msg)
t0 = rospy.Time.now().to_sec()
vel_msg.linear.x = speed
vel_msg.angular.z =0
while current_distance < distance:
velocity_publisher.publish(vel_msg)
t1=rospy.Time.now().to_sec()
current_distance = speed*(t1-t0)
vel_msg.linear.x = 0
vel_msg.angular.z = 0
velocity_publisher.publish(vel_msg)
t0 = rospy.Time.now().to_sec()
vel_msg.linear.x = -speed
vel_msg.angular.z =0
current_distance = 0
while current_distance < distance:
velocity_publisher.publish(vel_msg)
t1=rospy.Time.now().to_sec()
current_distance = speed*(t1-t0)
vel_msg.linear.x = 0
vel_msg.angular.z = 0
velocity_publisher.publish(vel_msg)
t0 = rospy.Time.now().to_sec()
vel_msg.linear.x = 0
vel_msg.angular.z = angular_ve1
while current_angle < 2*angle:
velocity_publisher.publish(vel_msg)
#Takes actual time to velocity calculus
t1=rospy.Time.now().to_sec()
print(current_angle)
vel_msg.linear.x = 0
vel_msg.angular.z = 0
velocity_publisher.publish(vel_msg)
t0 = rospy.Time.now().to_sec()
vel_msg.linear.x = speed
vel_msg.angular.z =0
current_distance = 0
while current_distance < distance:
velocity_publisher.publish(vel_msg)
t1=rospy.Time.now().to_sec()
current_distance = speed*(t1-t0)
vel_msg.linear.x = 0
vel_msg.angular.z = 0
velocity_publisher.publish(vel_msg)
if __name__ == '__main__':
try:
#Testing our function
move()
except rospy.ROSInterruptException: pass
| 28
| 82
| 0.645066
| 384
| 2,716
| 4.341146
| 0.205729
| 0.115177
| 0.085783
| 0.092382
| 0.715057
| 0.715057
| 0.703659
| 0.703659
| 0.685063
| 0.685063
| 0
| 0.023973
| 0.247423
| 2,716
| 97
| 83
| 28
| 0.791585
| 0.064801
| 0
| 0.653846
| 0
| 0
| 0.021705
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.025641
| false
| 0.012821
| 0.076923
| 0
| 0.102564
| 0.025641
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
3d34e6acbf5b6084146e881a817272a730156e45
| 525
|
py
|
Python
|
performanceplatform/collector/ga/plugins/load_plugin.py
|
alphagov/performanceplatform-collector
|
de68ab4aa500c31e436e050fa1268fa928c522a5
|
[
"MIT"
] | 3
|
2015-05-01T14:57:28.000Z
|
2016-04-08T12:53:59.000Z
|
performanceplatform/collector/ga/plugins/load_plugin.py
|
alphagov/performanceplatform-collector
|
de68ab4aa500c31e436e050fa1268fa928c522a5
|
[
"MIT"
] | 15
|
2015-02-11T11:43:02.000Z
|
2021-03-24T10:54:35.000Z
|
performanceplatform/collector/ga/plugins/load_plugin.py
|
alphagov/performanceplatform-collector
|
de68ab4aa500c31e436e050fa1268fa928c522a5
|
[
"MIT"
] | 7
|
2015-05-04T16:56:02.000Z
|
2021-04-10T19:42:35.000Z
|
"""
load_plugin.py
--------------
Responsible for taking plugin strings and returning plugin callables.
"""
# For the linter
import __builtin__
import performanceplatform.collector.ga.plugins
def load_plugins(plugin_names):
return [load_plugin(plugin_name) for plugin_name in plugin_names]
def load_plugin(plugin_name):
expr = compile(plugin_name, "performanceplatform.collector plugin", "eval")
return eval(expr, __builtin__.__dict__,
performanceplatform.collector.ga.plugins.__dict__)
| 21
| 79
| 0.744762
| 61
| 525
| 5.983607
| 0.442623
| 0.109589
| 0.164384
| 0.20274
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.150476
| 525
| 24
| 80
| 21.875
| 0.818386
| 0.220952
| 0
| 0
| 0
| 0
| 0.1
| 0.0725
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.125
| 0.75
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
3d49f7eaf598f54df886dcfb77904d84e8c9f173
| 108
|
py
|
Python
|
nylas/util/__init__.py
|
nylas/nylas-production-python
|
a0979cd104a43f80750b2361aa580516b8dbfcfc
|
[
"Apache-2.0",
"MIT"
] | 19
|
2015-11-20T12:38:34.000Z
|
2022-01-13T15:40:25.000Z
|
nylas/api/__init__.py
|
nylas/nylas-production-python
|
a0979cd104a43f80750b2361aa580516b8dbfcfc
|
[
"Apache-2.0",
"MIT"
] | null | null | null |
nylas/api/__init__.py
|
nylas/nylas-production-python
|
a0979cd104a43f80750b2361aa580516b8dbfcfc
|
[
"Apache-2.0",
"MIT"
] | 10
|
2016-03-12T00:38:54.000Z
|
2018-12-13T05:58:13.000Z
|
from pkgutil import extend_path
# Allow out-of-tree submodules.
__path__ = extend_path(__path__, __name__)
| 21.6
| 42
| 0.805556
| 15
| 108
| 4.866667
| 0.733333
| 0.273973
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.12037
| 108
| 4
| 43
| 27
| 0.768421
| 0.268519
| 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
|
3d5394f2af4816cbcec8e499c06b15d66ed6fb8e
| 920
|
py
|
Python
|
simple_ml/__init__.py
|
Yangruipis/simple_ml
|
09657f6b017b973a5201aa611774d6ac8f0fc0a2
|
[
"MIT"
] | 25
|
2018-04-17T04:38:51.000Z
|
2021-10-09T04:07:53.000Z
|
simple_ml/__init__.py
|
Yangruipis/simple_ml
|
09657f6b017b973a5201aa611774d6ac8f0fc0a2
|
[
"MIT"
] | null | null | null |
simple_ml/__init__.py
|
Yangruipis/simple_ml
|
09657f6b017b973a5201aa611774d6ac8f0fc0a2
|
[
"MIT"
] | 5
|
2018-04-17T05:27:00.000Z
|
2020-12-01T02:55:15.000Z
|
# -*- coding:utf-8 -*-
"""
==================================
Simple Machine Learning
一个简单的机器学习算法实现
==================================
"""
from simple_ml.bayes import *
from simple_ml.classify_data import *
from simple_ml.auto import *
from simple_ml.classify_data import *
from simple_ml.ensemble import *
from simple_ml.evaluation import *
from simple_ml.feature_select import *
from simple_ml.knn import *
from simple_ml.logistic import *
from simple_ml.neural_network import *
from simple_ml.pca import *
from simple_ml.regression import *
from simple_ml.support_vector import *
# from simple_ml.svm import *
from simple_ml.tree import *
__all__ = [
'bayes',
'auto',
'classify_data',
'cluster',
'data_handle',
'ensemble',
'evaluation',
'feature_select',
'knn',
'svm',
'logistic',
'neural_network',
'pca',
'regression',
'support_vector',
'tree',
]
| 20
| 38
| 0.644565
| 109
| 920
| 5.174312
| 0.284404
| 0.265957
| 0.319149
| 0.446809
| 0.170213
| 0.170213
| 0.170213
| 0.170213
| 0.170213
| 0.170213
| 0
| 0.001319
| 0.176087
| 920
| 45
| 39
| 20.444444
| 0.742744
| 0.173913
| 0
| 0.0625
| 0
| 0
| 0.174434
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.4375
| 0
| 0.4375
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
180d3a3f60ca987d84a73cb66042ea85d5cffea9
| 758
|
py
|
Python
|
tests/contrib/django/testapp/middleware.py
|
mvas/apm-agent-python
|
f4582e90eb5308b915ca51e2e98620fc22af09ec
|
[
"BSD-3-Clause"
] | null | null | null |
tests/contrib/django/testapp/middleware.py
|
mvas/apm-agent-python
|
f4582e90eb5308b915ca51e2e98620fc22af09ec
|
[
"BSD-3-Clause"
] | null | null | null |
tests/contrib/django/testapp/middleware.py
|
mvas/apm-agent-python
|
f4582e90eb5308b915ca51e2e98620fc22af09ec
|
[
"BSD-3-Clause"
] | null | null | null |
try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
# no-op class for Django < 1.10
class MiddlewareMixin(object):
pass
class BrokenRequestMiddleware(MiddlewareMixin):
def process_request(self, request):
raise ImportError('request')
class BrokenResponseMiddleware(MiddlewareMixin):
def process_response(self, request, response):
raise ImportError('response')
class BrokenViewMiddleware(MiddlewareMixin):
def process_view(self, request, func, args, kwargs):
raise ImportError('view')
class MetricsNameOverrideMiddleware(MiddlewareMixin):
def process_response(self, request, response):
request._elasticapm_transaction_name = 'foobar'
return response
| 27.071429
| 56
| 0.740106
| 73
| 758
| 7.589041
| 0.493151
| 0.129964
| 0.180505
| 0.119134
| 0.187726
| 0.187726
| 0.187726
| 0
| 0
| 0
| 0
| 0.004831
| 0.180739
| 758
| 27
| 57
| 28.074074
| 0.887279
| 0.038259
| 0
| 0.111111
| 0
| 0
| 0.034388
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.222222
| false
| 0.055556
| 0.277778
| 0
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
183cd22d8adcd570cdd6c5eceb4ba00ee9152282
| 61
|
py
|
Python
|
src/yookassa_payout/domain/response/__init__.py
|
yoomoney/yookassa-payout-sdk-python
|
f6953e97573bb4a4ee6f830f726a6fcfdf504e2a
|
[
"MIT"
] | 5
|
2021-03-11T14:38:25.000Z
|
2021-08-13T10:41:50.000Z
|
src/yookassa_payout/domain/common/__init__.py
|
yoomoney/yookassa-payout-sdk-python
|
f6953e97573bb4a4ee6f830f726a6fcfdf504e2a
|
[
"MIT"
] | 2
|
2021-02-15T18:18:34.000Z
|
2021-08-13T13:49:46.000Z
|
src/yookassa_payout/domain/request/__init__.py
|
yoomoney/yookassa-payout-sdk-python
|
f6953e97573bb4a4ee6f830f726a6fcfdf504e2a
|
[
"MIT"
] | 1
|
2022-01-29T08:47:02.000Z
|
2022-01-29T08:47:02.000Z
|
"""Package for YooKassa Payout API Python Client Library."""
| 30.5
| 60
| 0.754098
| 8
| 61
| 5.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.131148
| 61
| 1
| 61
| 61
| 0.867925
| 0.885246
| 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
|
18412368254bcf43c33a2c706aa24bebe16b5a08
| 16
|
py
|
Python
|
roomai/games/__init__.py
|
tonyxxq/RoomAI
|
5f28e31e659dd7808127c3c3cc386e6892a93982
|
[
"MIT"
] | 1
|
2018-11-29T01:57:18.000Z
|
2018-11-29T01:57:18.000Z
|
roomai/models/texasholdem/__init__.py
|
tonyxxq/RoomAI
|
5f28e31e659dd7808127c3c3cc386e6892a93982
|
[
"MIT"
] | null | null | null |
roomai/models/texasholdem/__init__.py
|
tonyxxq/RoomAI
|
5f28e31e659dd7808127c3c3cc386e6892a93982
|
[
"MIT"
] | null | null | null |
#!/bin/python
| 4
| 13
| 0.5625
| 2
| 16
| 4.5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1875
| 16
| 3
| 14
| 5.333333
| 0.692308
| 0.75
| 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
|
1878e0fb7794287a25d9e67514272eb4ae4e8c3c
| 148
|
py
|
Python
|
WD/Cwiczenia/rzymskie.py
|
galursa/UWM
|
b7ab4a275662764a91af6c5bc79da0d98177d0ac
|
[
"MIT"
] | 1
|
2020-02-29T14:38:33.000Z
|
2020-02-29T14:38:33.000Z
|
WD/Cwiczenia/rzymskie.py
|
galursa/UWM
|
b7ab4a275662764a91af6c5bc79da0d98177d0ac
|
[
"MIT"
] | null | null | null |
WD/Cwiczenia/rzymskie.py
|
galursa/UWM
|
b7ab4a275662764a91af6c5bc79da0d98177d0ac
|
[
"MIT"
] | null | null | null |
rzymskie={'I':1,'II':2,'III':3,'IV':4,'V':5,'VI':6,'VII':7,'VIII':8}
print(rzymskie)
print('Jeden element slownika: \n')
print(rzymskie['I'])
| 24.666667
| 69
| 0.587838
| 27
| 148
| 3.222222
| 0.814815
| 0.206897
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.059259
| 0.087838
| 148
| 5
| 70
| 29.6
| 0.585185
| 0
| 0
| 0
| 0
| 0
| 0.314685
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.75
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
43ebc0969b2793f79841f3adb90ba457341afae3
| 67,834
|
py
|
Python
|
sdk/python/pulumi_google_native/vmmigration/v1alpha1/outputs.py
|
AaronFriel/pulumi-google-native
|
75d1cda425e33d4610348972cd70bddf35f1770d
|
[
"Apache-2.0"
] | 44
|
2021-04-18T23:00:48.000Z
|
2022-02-14T17:43:15.000Z
|
sdk/python/pulumi_google_native/vmmigration/v1alpha1/outputs.py
|
AaronFriel/pulumi-google-native
|
75d1cda425e33d4610348972cd70bddf35f1770d
|
[
"Apache-2.0"
] | 354
|
2021-04-16T16:48:39.000Z
|
2022-03-31T17:16:39.000Z
|
sdk/python/pulumi_google_native/vmmigration/v1alpha1/outputs.py
|
AaronFriel/pulumi-google-native
|
75d1cda425e33d4610348972cd70bddf35f1770d
|
[
"Apache-2.0"
] | 8
|
2021-04-24T17:46:51.000Z
|
2022-01-05T10:40:21.000Z
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
__all__ = [
'AppliedLicenseResponse',
'CloneJobResponse',
'ComputeEngineTargetDefaultsResponse',
'ComputeEngineTargetDetailsResponse',
'ComputeSchedulingResponse',
'CutoverJobResponse',
'NetworkInterfaceResponse',
'ReplicationCycleResponse',
'ReplicationSyncResponse',
'SchedulePolicyResponse',
'SchedulingNodeAffinityResponse',
'StatusResponse',
'VmUtilizationInfoResponse',
'VmUtilizationMetricsResponse',
'VmwareSourceDetailsResponse',
'VmwareVmDetailsResponse',
]
@pulumi.output_type
class AppliedLicenseResponse(dict):
"""
AppliedLicense holds the license data returned by adaptation module report.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "osLicense":
suggest = "os_license"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in AppliedLicenseResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
AppliedLicenseResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
AppliedLicenseResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
os_license: str,
type: str):
"""
AppliedLicense holds the license data returned by adaptation module report.
:param str os_license: The OS license returned from the adaptation module's report.
:param str type: The license type that was used in OS adaptation.
"""
pulumi.set(__self__, "os_license", os_license)
pulumi.set(__self__, "type", type)
@property
@pulumi.getter(name="osLicense")
def os_license(self) -> str:
"""
The OS license returned from the adaptation module's report.
"""
return pulumi.get(self, "os_license")
@property
@pulumi.getter
def type(self) -> str:
"""
The license type that was used in OS adaptation.
"""
return pulumi.get(self, "type")
@pulumi.output_type
class CloneJobResponse(dict):
"""
CloneJob describes the process of creating a clone of a MigratingVM to the requested target based on the latest successful uploaded snapshots. While the migration cycles of a MigratingVm take place, it is possible to verify the uploaded VM can be started in the cloud, by creating a clone. The clone can be created without any downtime, and it is created using the latest snapshots which are already in the cloud. The cloneJob is only responsible for its work, not its products, which means once it is finished, it will never touch the instance it created. It will only delete it in case of the CloneJob being cancelled or upon failure to clone.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "computeEngineTargetDetails":
suggest = "compute_engine_target_details"
elif key == "createTime":
suggest = "create_time"
elif key == "stateTime":
suggest = "state_time"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CloneJobResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CloneJobResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CloneJobResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
compute_engine_target_details: 'outputs.ComputeEngineTargetDetailsResponse',
create_time: str,
error: 'outputs.StatusResponse',
name: str,
state: str,
state_time: str):
"""
CloneJob describes the process of creating a clone of a MigratingVM to the requested target based on the latest successful uploaded snapshots. While the migration cycles of a MigratingVm take place, it is possible to verify the uploaded VM can be started in the cloud, by creating a clone. The clone can be created without any downtime, and it is created using the latest snapshots which are already in the cloud. The cloneJob is only responsible for its work, not its products, which means once it is finished, it will never touch the instance it created. It will only delete it in case of the CloneJob being cancelled or upon failure to clone.
:param 'ComputeEngineTargetDetailsResponse' compute_engine_target_details: Details of the target VM in Compute Engine.
:param str create_time: The time the clone job was created (as an API call, not when it was actually created in the target).
:param 'StatusResponse' error: Provides details for the errors that led to the Clone Job's state.
:param str name: The name of the clone.
:param str state: State of the clone job.
:param str state_time: The time the state was last updated.
"""
pulumi.set(__self__, "compute_engine_target_details", compute_engine_target_details)
pulumi.set(__self__, "create_time", create_time)
pulumi.set(__self__, "error", error)
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "state", state)
pulumi.set(__self__, "state_time", state_time)
@property
@pulumi.getter(name="computeEngineTargetDetails")
def compute_engine_target_details(self) -> 'outputs.ComputeEngineTargetDetailsResponse':
"""
Details of the target VM in Compute Engine.
"""
return pulumi.get(self, "compute_engine_target_details")
@property
@pulumi.getter(name="createTime")
def create_time(self) -> str:
"""
The time the clone job was created (as an API call, not when it was actually created in the target).
"""
return pulumi.get(self, "create_time")
@property
@pulumi.getter
def error(self) -> 'outputs.StatusResponse':
"""
Provides details for the errors that led to the Clone Job's state.
"""
return pulumi.get(self, "error")
@property
@pulumi.getter
def name(self) -> str:
"""
The name of the clone.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def state(self) -> str:
"""
State of the clone job.
"""
return pulumi.get(self, "state")
@property
@pulumi.getter(name="stateTime")
def state_time(self) -> str:
"""
The time the state was last updated.
"""
return pulumi.get(self, "state_time")
@pulumi.output_type
class ComputeEngineTargetDefaultsResponse(dict):
"""
ComputeEngineTargetDefaults is a collection of details for creating a VM in a target Compute Engine project.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "additionalLicenses":
suggest = "additional_licenses"
elif key == "appliedLicense":
suggest = "applied_license"
elif key == "bootOption":
suggest = "boot_option"
elif key == "computeScheduling":
suggest = "compute_scheduling"
elif key == "diskType":
suggest = "disk_type"
elif key == "licenseType":
suggest = "license_type"
elif key == "machineType":
suggest = "machine_type"
elif key == "machineTypeSeries":
suggest = "machine_type_series"
elif key == "networkInterfaces":
suggest = "network_interfaces"
elif key == "networkTags":
suggest = "network_tags"
elif key == "secureBoot":
suggest = "secure_boot"
elif key == "serviceAccount":
suggest = "service_account"
elif key == "targetProject":
suggest = "target_project"
elif key == "vmName":
suggest = "vm_name"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in ComputeEngineTargetDefaultsResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
ComputeEngineTargetDefaultsResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
ComputeEngineTargetDefaultsResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
additional_licenses: Sequence[str],
applied_license: 'outputs.AppliedLicenseResponse',
boot_option: str,
compute_scheduling: 'outputs.ComputeSchedulingResponse',
disk_type: str,
labels: Mapping[str, str],
license_type: str,
machine_type: str,
machine_type_series: str,
metadata: Mapping[str, str],
network_interfaces: Sequence['outputs.NetworkInterfaceResponse'],
network_tags: Sequence[str],
secure_boot: bool,
service_account: str,
target_project: str,
vm_name: str,
zone: str):
"""
ComputeEngineTargetDefaults is a collection of details for creating a VM in a target Compute Engine project.
:param Sequence[str] additional_licenses: Additional licenses to assign to the VM.
:param 'AppliedLicenseResponse' applied_license: The OS license returned from the adaptation module report.
:param str boot_option: The VM Boot Option, as set in the source vm.
:param 'ComputeSchedulingResponse' compute_scheduling: Compute instance scheduling information (if empty default is used).
:param str disk_type: The disk type to use in the VM.
:param Mapping[str, str] labels: A map of labels to associate with the VM.
:param str license_type: The license type to use in OS adaptation.
:param str machine_type: The machine type to create the VM with.
:param str machine_type_series: The machine type series to create the VM with.
:param Mapping[str, str] metadata: The metadata key/value pairs to assign to the VM.
:param Sequence['NetworkInterfaceResponse'] network_interfaces: List of NICs connected to this VM.
:param Sequence[str] network_tags: A map of network tags to associate with the VM.
:param bool secure_boot: Defines whether the instance has Secure Boot enabled. This can be set to true only if the vm boot option is EFI.
:param str service_account: The service account to associate the VM with.
:param str target_project: The full path of the resource of type TargetProject which represents the Compute Engine project in which to create this VM.
:param str vm_name: The name of the VM to create.
:param str zone: The zone in which to create the VM.
"""
pulumi.set(__self__, "additional_licenses", additional_licenses)
pulumi.set(__self__, "applied_license", applied_license)
pulumi.set(__self__, "boot_option", boot_option)
pulumi.set(__self__, "compute_scheduling", compute_scheduling)
pulumi.set(__self__, "disk_type", disk_type)
pulumi.set(__self__, "labels", labels)
pulumi.set(__self__, "license_type", license_type)
pulumi.set(__self__, "machine_type", machine_type)
pulumi.set(__self__, "machine_type_series", machine_type_series)
pulumi.set(__self__, "metadata", metadata)
pulumi.set(__self__, "network_interfaces", network_interfaces)
pulumi.set(__self__, "network_tags", network_tags)
pulumi.set(__self__, "secure_boot", secure_boot)
pulumi.set(__self__, "service_account", service_account)
pulumi.set(__self__, "target_project", target_project)
pulumi.set(__self__, "vm_name", vm_name)
pulumi.set(__self__, "zone", zone)
@property
@pulumi.getter(name="additionalLicenses")
def additional_licenses(self) -> Sequence[str]:
"""
Additional licenses to assign to the VM.
"""
return pulumi.get(self, "additional_licenses")
@property
@pulumi.getter(name="appliedLicense")
def applied_license(self) -> 'outputs.AppliedLicenseResponse':
"""
The OS license returned from the adaptation module report.
"""
return pulumi.get(self, "applied_license")
@property
@pulumi.getter(name="bootOption")
def boot_option(self) -> str:
"""
The VM Boot Option, as set in the source vm.
"""
return pulumi.get(self, "boot_option")
@property
@pulumi.getter(name="computeScheduling")
def compute_scheduling(self) -> 'outputs.ComputeSchedulingResponse':
"""
Compute instance scheduling information (if empty default is used).
"""
return pulumi.get(self, "compute_scheduling")
@property
@pulumi.getter(name="diskType")
def disk_type(self) -> str:
"""
The disk type to use in the VM.
"""
return pulumi.get(self, "disk_type")
@property
@pulumi.getter
def labels(self) -> Mapping[str, str]:
"""
A map of labels to associate with the VM.
"""
return pulumi.get(self, "labels")
@property
@pulumi.getter(name="licenseType")
def license_type(self) -> str:
"""
The license type to use in OS adaptation.
"""
return pulumi.get(self, "license_type")
@property
@pulumi.getter(name="machineType")
def machine_type(self) -> str:
"""
The machine type to create the VM with.
"""
return pulumi.get(self, "machine_type")
@property
@pulumi.getter(name="machineTypeSeries")
def machine_type_series(self) -> str:
"""
The machine type series to create the VM with.
"""
return pulumi.get(self, "machine_type_series")
@property
@pulumi.getter
def metadata(self) -> Mapping[str, str]:
"""
The metadata key/value pairs to assign to the VM.
"""
return pulumi.get(self, "metadata")
@property
@pulumi.getter(name="networkInterfaces")
def network_interfaces(self) -> Sequence['outputs.NetworkInterfaceResponse']:
"""
List of NICs connected to this VM.
"""
return pulumi.get(self, "network_interfaces")
@property
@pulumi.getter(name="networkTags")
def network_tags(self) -> Sequence[str]:
"""
A map of network tags to associate with the VM.
"""
return pulumi.get(self, "network_tags")
@property
@pulumi.getter(name="secureBoot")
def secure_boot(self) -> bool:
"""
Defines whether the instance has Secure Boot enabled. This can be set to true only if the vm boot option is EFI.
"""
return pulumi.get(self, "secure_boot")
@property
@pulumi.getter(name="serviceAccount")
def service_account(self) -> str:
"""
The service account to associate the VM with.
"""
return pulumi.get(self, "service_account")
@property
@pulumi.getter(name="targetProject")
def target_project(self) -> str:
"""
The full path of the resource of type TargetProject which represents the Compute Engine project in which to create this VM.
"""
return pulumi.get(self, "target_project")
@property
@pulumi.getter(name="vmName")
def vm_name(self) -> str:
"""
The name of the VM to create.
"""
return pulumi.get(self, "vm_name")
@property
@pulumi.getter
def zone(self) -> str:
"""
The zone in which to create the VM.
"""
return pulumi.get(self, "zone")
@pulumi.output_type
class ComputeEngineTargetDetailsResponse(dict):
"""
ComputeEngineTargetDetails is a collection of details for creating a VM in a target Compute Engine project.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "additionalLicenses":
suggest = "additional_licenses"
elif key == "appliedLicense":
suggest = "applied_license"
elif key == "bootOption":
suggest = "boot_option"
elif key == "computeScheduling":
suggest = "compute_scheduling"
elif key == "diskType":
suggest = "disk_type"
elif key == "licenseType":
suggest = "license_type"
elif key == "machineType":
suggest = "machine_type"
elif key == "machineTypeSeries":
suggest = "machine_type_series"
elif key == "networkInterfaces":
suggest = "network_interfaces"
elif key == "networkTags":
suggest = "network_tags"
elif key == "secureBoot":
suggest = "secure_boot"
elif key == "serviceAccount":
suggest = "service_account"
elif key == "vmName":
suggest = "vm_name"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in ComputeEngineTargetDetailsResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
ComputeEngineTargetDetailsResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
ComputeEngineTargetDetailsResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
additional_licenses: Sequence[str],
applied_license: 'outputs.AppliedLicenseResponse',
boot_option: str,
compute_scheduling: 'outputs.ComputeSchedulingResponse',
disk_type: str,
labels: Mapping[str, str],
license_type: str,
machine_type: str,
machine_type_series: str,
metadata: Mapping[str, str],
network_interfaces: Sequence['outputs.NetworkInterfaceResponse'],
network_tags: Sequence[str],
project: str,
secure_boot: bool,
service_account: str,
vm_name: str,
zone: str):
"""
ComputeEngineTargetDetails is a collection of details for creating a VM in a target Compute Engine project.
:param Sequence[str] additional_licenses: Additional licenses to assign to the VM.
:param 'AppliedLicenseResponse' applied_license: The OS license returned from the adaptation module report.
:param str boot_option: The VM Boot Option, as set in the source vm.
:param 'ComputeSchedulingResponse' compute_scheduling: Compute instance scheduling information (if empty default is used).
:param str disk_type: The disk type to use in the VM.
:param Mapping[str, str] labels: A map of labels to associate with the VM.
:param str license_type: The license type to use in OS adaptation.
:param str machine_type: The machine type to create the VM with.
:param str machine_type_series: The machine type series to create the VM with.
:param Mapping[str, str] metadata: The metadata key/value pairs to assign to the VM.
:param Sequence['NetworkInterfaceResponse'] network_interfaces: List of NICs connected to this VM.
:param Sequence[str] network_tags: A map of network tags to associate with the VM.
:param str project: The GCP target project ID or project name.
:param bool secure_boot: Defines whether the instance has Secure Boot enabled. This can be set to true only if the vm boot option is EFI.
:param str service_account: The service account to associate the VM with.
:param str vm_name: The name of the VM to create.
:param str zone: The zone in which to create the VM.
"""
pulumi.set(__self__, "additional_licenses", additional_licenses)
pulumi.set(__self__, "applied_license", applied_license)
pulumi.set(__self__, "boot_option", boot_option)
pulumi.set(__self__, "compute_scheduling", compute_scheduling)
pulumi.set(__self__, "disk_type", disk_type)
pulumi.set(__self__, "labels", labels)
pulumi.set(__self__, "license_type", license_type)
pulumi.set(__self__, "machine_type", machine_type)
pulumi.set(__self__, "machine_type_series", machine_type_series)
pulumi.set(__self__, "metadata", metadata)
pulumi.set(__self__, "network_interfaces", network_interfaces)
pulumi.set(__self__, "network_tags", network_tags)
pulumi.set(__self__, "project", project)
pulumi.set(__self__, "secure_boot", secure_boot)
pulumi.set(__self__, "service_account", service_account)
pulumi.set(__self__, "vm_name", vm_name)
pulumi.set(__self__, "zone", zone)
@property
@pulumi.getter(name="additionalLicenses")
def additional_licenses(self) -> Sequence[str]:
"""
Additional licenses to assign to the VM.
"""
return pulumi.get(self, "additional_licenses")
@property
@pulumi.getter(name="appliedLicense")
def applied_license(self) -> 'outputs.AppliedLicenseResponse':
"""
The OS license returned from the adaptation module report.
"""
return pulumi.get(self, "applied_license")
@property
@pulumi.getter(name="bootOption")
def boot_option(self) -> str:
"""
The VM Boot Option, as set in the source vm.
"""
return pulumi.get(self, "boot_option")
@property
@pulumi.getter(name="computeScheduling")
def compute_scheduling(self) -> 'outputs.ComputeSchedulingResponse':
"""
Compute instance scheduling information (if empty default is used).
"""
return pulumi.get(self, "compute_scheduling")
@property
@pulumi.getter(name="diskType")
def disk_type(self) -> str:
"""
The disk type to use in the VM.
"""
return pulumi.get(self, "disk_type")
@property
@pulumi.getter
def labels(self) -> Mapping[str, str]:
"""
A map of labels to associate with the VM.
"""
return pulumi.get(self, "labels")
@property
@pulumi.getter(name="licenseType")
def license_type(self) -> str:
"""
The license type to use in OS adaptation.
"""
return pulumi.get(self, "license_type")
@property
@pulumi.getter(name="machineType")
def machine_type(self) -> str:
"""
The machine type to create the VM with.
"""
return pulumi.get(self, "machine_type")
@property
@pulumi.getter(name="machineTypeSeries")
def machine_type_series(self) -> str:
"""
The machine type series to create the VM with.
"""
return pulumi.get(self, "machine_type_series")
@property
@pulumi.getter
def metadata(self) -> Mapping[str, str]:
"""
The metadata key/value pairs to assign to the VM.
"""
return pulumi.get(self, "metadata")
@property
@pulumi.getter(name="networkInterfaces")
def network_interfaces(self) -> Sequence['outputs.NetworkInterfaceResponse']:
"""
List of NICs connected to this VM.
"""
return pulumi.get(self, "network_interfaces")
@property
@pulumi.getter(name="networkTags")
def network_tags(self) -> Sequence[str]:
"""
A map of network tags to associate with the VM.
"""
return pulumi.get(self, "network_tags")
@property
@pulumi.getter
def project(self) -> str:
"""
The GCP target project ID or project name.
"""
return pulumi.get(self, "project")
@property
@pulumi.getter(name="secureBoot")
def secure_boot(self) -> bool:
"""
Defines whether the instance has Secure Boot enabled. This can be set to true only if the vm boot option is EFI.
"""
return pulumi.get(self, "secure_boot")
@property
@pulumi.getter(name="serviceAccount")
def service_account(self) -> str:
"""
The service account to associate the VM with.
"""
return pulumi.get(self, "service_account")
@property
@pulumi.getter(name="vmName")
def vm_name(self) -> str:
"""
The name of the VM to create.
"""
return pulumi.get(self, "vm_name")
@property
@pulumi.getter
def zone(self) -> str:
"""
The zone in which to create the VM.
"""
return pulumi.get(self, "zone")
@pulumi.output_type
class ComputeSchedulingResponse(dict):
"""
Scheduling information for VM on maintenance/restart behaviour and node allocation in sole tenant nodes.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "automaticRestart":
suggest = "automatic_restart"
elif key == "minNodeCpus":
suggest = "min_node_cpus"
elif key == "nodeAffinities":
suggest = "node_affinities"
elif key == "onHostMaintenance":
suggest = "on_host_maintenance"
elif key == "restartType":
suggest = "restart_type"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in ComputeSchedulingResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
ComputeSchedulingResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
ComputeSchedulingResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
automatic_restart: bool,
min_node_cpus: int,
node_affinities: Sequence['outputs.SchedulingNodeAffinityResponse'],
on_host_maintenance: str,
restart_type: str):
"""
Scheduling information for VM on maintenance/restart behaviour and node allocation in sole tenant nodes.
:param int min_node_cpus: The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. Ignored if no node_affinites are configured.
:param Sequence['SchedulingNodeAffinityResponse'] node_affinities: A set of node affinity and anti-affinity configurations for sole tenant nodes.
:param str on_host_maintenance: How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.
:param str restart_type: Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user). This configuration is identical to `automaticRestart` field in Compute Engine create instance under scheduling. It was changed to an enum (instead of a boolean) to match the default value in Compute Engine which is automatic restart.
"""
pulumi.set(__self__, "automatic_restart", automatic_restart)
pulumi.set(__self__, "min_node_cpus", min_node_cpus)
pulumi.set(__self__, "node_affinities", node_affinities)
pulumi.set(__self__, "on_host_maintenance", on_host_maintenance)
pulumi.set(__self__, "restart_type", restart_type)
@property
@pulumi.getter(name="automaticRestart")
def automatic_restart(self) -> bool:
return pulumi.get(self, "automatic_restart")
@property
@pulumi.getter(name="minNodeCpus")
def min_node_cpus(self) -> int:
"""
The minimum number of virtual CPUs this instance will consume when running on a sole-tenant node. Ignored if no node_affinites are configured.
"""
return pulumi.get(self, "min_node_cpus")
@property
@pulumi.getter(name="nodeAffinities")
def node_affinities(self) -> Sequence['outputs.SchedulingNodeAffinityResponse']:
"""
A set of node affinity and anti-affinity configurations for sole tenant nodes.
"""
return pulumi.get(self, "node_affinities")
@property
@pulumi.getter(name="onHostMaintenance")
def on_host_maintenance(self) -> str:
"""
How the instance should behave when the host machine undergoes maintenance that may temporarily impact instance performance.
"""
return pulumi.get(self, "on_host_maintenance")
@property
@pulumi.getter(name="restartType")
def restart_type(self) -> str:
"""
Whether the Instance should be automatically restarted whenever it is terminated by Compute Engine (not terminated by user). This configuration is identical to `automaticRestart` field in Compute Engine create instance under scheduling. It was changed to an enum (instead of a boolean) to match the default value in Compute Engine which is automatic restart.
"""
return pulumi.get(self, "restart_type")
@pulumi.output_type
class CutoverJobResponse(dict):
"""
CutoverJob message describes a cutover of a migrating VM. The CutoverJob is the operation of shutting down the VM, creating a snapshot and clonning the VM using the replicated snapshot.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "computeEngineTargetDetails":
suggest = "compute_engine_target_details"
elif key == "createTime":
suggest = "create_time"
elif key == "progressPercent":
suggest = "progress_percent"
elif key == "stateMessage":
suggest = "state_message"
elif key == "stateTime":
suggest = "state_time"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CutoverJobResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CutoverJobResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CutoverJobResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
compute_engine_target_details: 'outputs.ComputeEngineTargetDetailsResponse',
create_time: str,
error: 'outputs.StatusResponse',
name: str,
progress: int,
progress_percent: int,
state: str,
state_message: str,
state_time: str):
"""
CutoverJob message describes a cutover of a migrating VM. The CutoverJob is the operation of shutting down the VM, creating a snapshot and clonning the VM using the replicated snapshot.
:param 'ComputeEngineTargetDetailsResponse' compute_engine_target_details: Details of the target VM in Compute Engine.
:param str create_time: The time the cutover job was created (as an API call, not when it was actually created in the target).
:param 'StatusResponse' error: Provides details for the errors that led to the Cutover Job's state.
:param str name: The name of the cutover job.
:param int progress: The current progress in percentage of the cutover job.
:param int progress_percent: The current progress in percentage of the cutover job.
:param str state: State of the cutover job.
:param str state_message: A message providing possible extra details about the current state.
:param str state_time: The time the state was last updated.
"""
pulumi.set(__self__, "compute_engine_target_details", compute_engine_target_details)
pulumi.set(__self__, "create_time", create_time)
pulumi.set(__self__, "error", error)
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "progress", progress)
pulumi.set(__self__, "progress_percent", progress_percent)
pulumi.set(__self__, "state", state)
pulumi.set(__self__, "state_message", state_message)
pulumi.set(__self__, "state_time", state_time)
@property
@pulumi.getter(name="computeEngineTargetDetails")
def compute_engine_target_details(self) -> 'outputs.ComputeEngineTargetDetailsResponse':
"""
Details of the target VM in Compute Engine.
"""
return pulumi.get(self, "compute_engine_target_details")
@property
@pulumi.getter(name="createTime")
def create_time(self) -> str:
"""
The time the cutover job was created (as an API call, not when it was actually created in the target).
"""
return pulumi.get(self, "create_time")
@property
@pulumi.getter
def error(self) -> 'outputs.StatusResponse':
"""
Provides details for the errors that led to the Cutover Job's state.
"""
return pulumi.get(self, "error")
@property
@pulumi.getter
def name(self) -> str:
"""
The name of the cutover job.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def progress(self) -> int:
"""
The current progress in percentage of the cutover job.
"""
return pulumi.get(self, "progress")
@property
@pulumi.getter(name="progressPercent")
def progress_percent(self) -> int:
"""
The current progress in percentage of the cutover job.
"""
return pulumi.get(self, "progress_percent")
@property
@pulumi.getter
def state(self) -> str:
"""
State of the cutover job.
"""
return pulumi.get(self, "state")
@property
@pulumi.getter(name="stateMessage")
def state_message(self) -> str:
"""
A message providing possible extra details about the current state.
"""
return pulumi.get(self, "state_message")
@property
@pulumi.getter(name="stateTime")
def state_time(self) -> str:
"""
The time the state was last updated.
"""
return pulumi.get(self, "state_time")
@pulumi.output_type
class NetworkInterfaceResponse(dict):
"""
NetworkInterface represents a NIC of a VM.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "externalIp":
suggest = "external_ip"
elif key == "internalIp":
suggest = "internal_ip"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in NetworkInterfaceResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
NetworkInterfaceResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
NetworkInterfaceResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
external_ip: str,
internal_ip: str,
network: str,
subnetwork: str):
"""
NetworkInterface represents a NIC of a VM.
:param str external_ip: The external IP to define in the NIC.
:param str internal_ip: The internal IP to define in the NIC. The formats accepted are: `ephemeral` \ ipv4 address \ a named address resource full path.
:param str network: The network to connect the NIC to.
:param str subnetwork: The subnetwork to connect the NIC to.
"""
pulumi.set(__self__, "external_ip", external_ip)
pulumi.set(__self__, "internal_ip", internal_ip)
pulumi.set(__self__, "network", network)
pulumi.set(__self__, "subnetwork", subnetwork)
@property
@pulumi.getter(name="externalIp")
def external_ip(self) -> str:
"""
The external IP to define in the NIC.
"""
return pulumi.get(self, "external_ip")
@property
@pulumi.getter(name="internalIp")
def internal_ip(self) -> str:
"""
The internal IP to define in the NIC. The formats accepted are: `ephemeral` \ ipv4 address \ a named address resource full path.
"""
return pulumi.get(self, "internal_ip")
@property
@pulumi.getter
def network(self) -> str:
"""
The network to connect the NIC to.
"""
return pulumi.get(self, "network")
@property
@pulumi.getter
def subnetwork(self) -> str:
"""
The subnetwork to connect the NIC to.
"""
return pulumi.get(self, "subnetwork")
@pulumi.output_type
class ReplicationCycleResponse(dict):
"""
ReplicationCycle contains information about the current replication cycle status.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "progressPercent":
suggest = "progress_percent"
elif key == "startTime":
suggest = "start_time"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in ReplicationCycleResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
ReplicationCycleResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
ReplicationCycleResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
progress: int,
progress_percent: int,
start_time: str):
"""
ReplicationCycle contains information about the current replication cycle status.
:param int progress: The current progress in percentage of this cycle.
:param int progress_percent: The current progress in percentage of this cycle.
:param str start_time: The time the replication cycle has started.
"""
pulumi.set(__self__, "progress", progress)
pulumi.set(__self__, "progress_percent", progress_percent)
pulumi.set(__self__, "start_time", start_time)
@property
@pulumi.getter
def progress(self) -> int:
"""
The current progress in percentage of this cycle.
"""
return pulumi.get(self, "progress")
@property
@pulumi.getter(name="progressPercent")
def progress_percent(self) -> int:
"""
The current progress in percentage of this cycle.
"""
return pulumi.get(self, "progress_percent")
@property
@pulumi.getter(name="startTime")
def start_time(self) -> str:
"""
The time the replication cycle has started.
"""
return pulumi.get(self, "start_time")
@pulumi.output_type
class ReplicationSyncResponse(dict):
"""
ReplicationSync contain information about the last replica sync to the cloud.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "lastSyncTime":
suggest = "last_sync_time"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in ReplicationSyncResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
ReplicationSyncResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
ReplicationSyncResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
last_sync_time: str):
"""
ReplicationSync contain information about the last replica sync to the cloud.
:param str last_sync_time: The most updated snapshot created time in the source that finished replication.
"""
pulumi.set(__self__, "last_sync_time", last_sync_time)
@property
@pulumi.getter(name="lastSyncTime")
def last_sync_time(self) -> str:
"""
The most updated snapshot created time in the source that finished replication.
"""
return pulumi.get(self, "last_sync_time")
@pulumi.output_type
class SchedulePolicyResponse(dict):
"""
A policy for scheduling replications.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "idleDuration":
suggest = "idle_duration"
elif key == "skipOsAdaptation":
suggest = "skip_os_adaptation"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in SchedulePolicyResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
SchedulePolicyResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
SchedulePolicyResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
idle_duration: str,
skip_os_adaptation: bool):
"""
A policy for scheduling replications.
:param str idle_duration: The idle duration between replication stages.
:param bool skip_os_adaptation: A flag to indicate whether to skip OS adaptation during the replication sync. OS adaptation is a process where the VM's operating system undergoes changes and adaptations to fully function on Compute Engine.
"""
pulumi.set(__self__, "idle_duration", idle_duration)
pulumi.set(__self__, "skip_os_adaptation", skip_os_adaptation)
@property
@pulumi.getter(name="idleDuration")
def idle_duration(self) -> str:
"""
The idle duration between replication stages.
"""
return pulumi.get(self, "idle_duration")
@property
@pulumi.getter(name="skipOsAdaptation")
def skip_os_adaptation(self) -> bool:
"""
A flag to indicate whether to skip OS adaptation during the replication sync. OS adaptation is a process where the VM's operating system undergoes changes and adaptations to fully function on Compute Engine.
"""
return pulumi.get(self, "skip_os_adaptation")
@pulumi.output_type
class SchedulingNodeAffinityResponse(dict):
"""
Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. Based on https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling
"""
def __init__(__self__, *,
key: str,
operator: str,
values: Sequence[str]):
"""
Node Affinity: the configuration of desired nodes onto which this Instance could be scheduled. Based on https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling
:param str key: The label key of Node resource to reference.
:param str operator: The operator to use for the node resources specified in the `values` parameter.
:param Sequence[str] values: Corresponds to the label values of Node resource.
"""
pulumi.set(__self__, "key", key)
pulumi.set(__self__, "operator", operator)
pulumi.set(__self__, "values", values)
@property
@pulumi.getter
def key(self) -> str:
"""
The label key of Node resource to reference.
"""
return pulumi.get(self, "key")
@property
@pulumi.getter
def operator(self) -> str:
"""
The operator to use for the node resources specified in the `values` parameter.
"""
return pulumi.get(self, "operator")
@property
@pulumi.getter
def values(self) -> Sequence[str]:
"""
Corresponds to the label values of Node resource.
"""
return pulumi.get(self, "values")
@pulumi.output_type
class StatusResponse(dict):
"""
The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
"""
def __init__(__self__, *,
code: int,
details: Sequence[Mapping[str, str]],
message: str):
"""
The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
:param int code: The status code, which should be an enum value of google.rpc.Code.
:param Sequence[Mapping[str, str]] details: A list of messages that carry the error details. There is a common set of message types for APIs to use.
:param str message: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
"""
pulumi.set(__self__, "code", code)
pulumi.set(__self__, "details", details)
pulumi.set(__self__, "message", message)
@property
@pulumi.getter
def code(self) -> int:
"""
The status code, which should be an enum value of google.rpc.Code.
"""
return pulumi.get(self, "code")
@property
@pulumi.getter
def details(self) -> Sequence[Mapping[str, str]]:
"""
A list of messages that carry the error details. There is a common set of message types for APIs to use.
"""
return pulumi.get(self, "details")
@property
@pulumi.getter
def message(self) -> str:
"""
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
"""
return pulumi.get(self, "message")
@pulumi.output_type
class VmUtilizationInfoResponse(dict):
"""
Utilization information of a single VM.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "vmId":
suggest = "vm_id"
elif key == "vmwareVmDetails":
suggest = "vmware_vm_details"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in VmUtilizationInfoResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
VmUtilizationInfoResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
VmUtilizationInfoResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
utilization: 'outputs.VmUtilizationMetricsResponse',
vm_id: str,
vmware_vm_details: 'outputs.VmwareVmDetailsResponse'):
"""
Utilization information of a single VM.
:param 'VmUtilizationMetricsResponse' utilization: Utilization metrics for this VM.
:param str vm_id: The VM's ID in the source.
:param 'VmwareVmDetailsResponse' vmware_vm_details: The description of the VM in a Source of type Vmware.
"""
pulumi.set(__self__, "utilization", utilization)
pulumi.set(__self__, "vm_id", vm_id)
pulumi.set(__self__, "vmware_vm_details", vmware_vm_details)
@property
@pulumi.getter
def utilization(self) -> 'outputs.VmUtilizationMetricsResponse':
"""
Utilization metrics for this VM.
"""
return pulumi.get(self, "utilization")
@property
@pulumi.getter(name="vmId")
def vm_id(self) -> str:
"""
The VM's ID in the source.
"""
return pulumi.get(self, "vm_id")
@property
@pulumi.getter(name="vmwareVmDetails")
def vmware_vm_details(self) -> 'outputs.VmwareVmDetailsResponse':
"""
The description of the VM in a Source of type Vmware.
"""
return pulumi.get(self, "vmware_vm_details")
@pulumi.output_type
class VmUtilizationMetricsResponse(dict):
"""
Utilization metrics values for a single VM.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "cpuAverage":
suggest = "cpu_average"
elif key == "cpuAveragePercent":
suggest = "cpu_average_percent"
elif key == "cpuMax":
suggest = "cpu_max"
elif key == "cpuMaxPercent":
suggest = "cpu_max_percent"
elif key == "diskIoRateAverage":
suggest = "disk_io_rate_average"
elif key == "diskIoRateAverageKbps":
suggest = "disk_io_rate_average_kbps"
elif key == "diskIoRateMax":
suggest = "disk_io_rate_max"
elif key == "diskIoRateMaxKbps":
suggest = "disk_io_rate_max_kbps"
elif key == "memoryAverage":
suggest = "memory_average"
elif key == "memoryAveragePercent":
suggest = "memory_average_percent"
elif key == "memoryMax":
suggest = "memory_max"
elif key == "memoryMaxPercent":
suggest = "memory_max_percent"
elif key == "networkThroughputAverage":
suggest = "network_throughput_average"
elif key == "networkThroughputAverageKbps":
suggest = "network_throughput_average_kbps"
elif key == "networkThroughputMax":
suggest = "network_throughput_max"
elif key == "networkThroughputMaxKbps":
suggest = "network_throughput_max_kbps"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in VmUtilizationMetricsResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
VmUtilizationMetricsResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
VmUtilizationMetricsResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
cpu_average: int,
cpu_average_percent: int,
cpu_max: int,
cpu_max_percent: int,
disk_io_rate_average: str,
disk_io_rate_average_kbps: str,
disk_io_rate_max: str,
disk_io_rate_max_kbps: str,
memory_average: int,
memory_average_percent: int,
memory_max: int,
memory_max_percent: int,
network_throughput_average: str,
network_throughput_average_kbps: str,
network_throughput_max: str,
network_throughput_max_kbps: str):
"""
Utilization metrics values for a single VM.
:param int cpu_average: Average CPU usage, percent.
:param int cpu_average_percent: Average CPU usage, percent.
:param int cpu_max: Max CPU usage, percent.
:param int cpu_max_percent: Max CPU usage, percent.
:param str disk_io_rate_average: Average disk IO rate, in kilobytes per second.
:param str disk_io_rate_average_kbps: Average disk IO rate, in kilobytes per second.
:param str disk_io_rate_max: Max disk IO rate, in kilobytes per second.
:param str disk_io_rate_max_kbps: Max disk IO rate, in kilobytes per second.
:param int memory_average: Average memory usage, percent.
:param int memory_average_percent: Average memory usage, percent.
:param int memory_max: Max memory usage, percent.
:param int memory_max_percent: Max memory usage, percent.
:param str network_throughput_average: Average network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
:param str network_throughput_average_kbps: Average network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
:param str network_throughput_max: Max network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
:param str network_throughput_max_kbps: Max network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
"""
pulumi.set(__self__, "cpu_average", cpu_average)
pulumi.set(__self__, "cpu_average_percent", cpu_average_percent)
pulumi.set(__self__, "cpu_max", cpu_max)
pulumi.set(__self__, "cpu_max_percent", cpu_max_percent)
pulumi.set(__self__, "disk_io_rate_average", disk_io_rate_average)
pulumi.set(__self__, "disk_io_rate_average_kbps", disk_io_rate_average_kbps)
pulumi.set(__self__, "disk_io_rate_max", disk_io_rate_max)
pulumi.set(__self__, "disk_io_rate_max_kbps", disk_io_rate_max_kbps)
pulumi.set(__self__, "memory_average", memory_average)
pulumi.set(__self__, "memory_average_percent", memory_average_percent)
pulumi.set(__self__, "memory_max", memory_max)
pulumi.set(__self__, "memory_max_percent", memory_max_percent)
pulumi.set(__self__, "network_throughput_average", network_throughput_average)
pulumi.set(__self__, "network_throughput_average_kbps", network_throughput_average_kbps)
pulumi.set(__self__, "network_throughput_max", network_throughput_max)
pulumi.set(__self__, "network_throughput_max_kbps", network_throughput_max_kbps)
@property
@pulumi.getter(name="cpuAverage")
def cpu_average(self) -> int:
"""
Average CPU usage, percent.
"""
return pulumi.get(self, "cpu_average")
@property
@pulumi.getter(name="cpuAveragePercent")
def cpu_average_percent(self) -> int:
"""
Average CPU usage, percent.
"""
return pulumi.get(self, "cpu_average_percent")
@property
@pulumi.getter(name="cpuMax")
def cpu_max(self) -> int:
"""
Max CPU usage, percent.
"""
return pulumi.get(self, "cpu_max")
@property
@pulumi.getter(name="cpuMaxPercent")
def cpu_max_percent(self) -> int:
"""
Max CPU usage, percent.
"""
return pulumi.get(self, "cpu_max_percent")
@property
@pulumi.getter(name="diskIoRateAverage")
def disk_io_rate_average(self) -> str:
"""
Average disk IO rate, in kilobytes per second.
"""
return pulumi.get(self, "disk_io_rate_average")
@property
@pulumi.getter(name="diskIoRateAverageKbps")
def disk_io_rate_average_kbps(self) -> str:
"""
Average disk IO rate, in kilobytes per second.
"""
return pulumi.get(self, "disk_io_rate_average_kbps")
@property
@pulumi.getter(name="diskIoRateMax")
def disk_io_rate_max(self) -> str:
"""
Max disk IO rate, in kilobytes per second.
"""
return pulumi.get(self, "disk_io_rate_max")
@property
@pulumi.getter(name="diskIoRateMaxKbps")
def disk_io_rate_max_kbps(self) -> str:
"""
Max disk IO rate, in kilobytes per second.
"""
return pulumi.get(self, "disk_io_rate_max_kbps")
@property
@pulumi.getter(name="memoryAverage")
def memory_average(self) -> int:
"""
Average memory usage, percent.
"""
return pulumi.get(self, "memory_average")
@property
@pulumi.getter(name="memoryAveragePercent")
def memory_average_percent(self) -> int:
"""
Average memory usage, percent.
"""
return pulumi.get(self, "memory_average_percent")
@property
@pulumi.getter(name="memoryMax")
def memory_max(self) -> int:
"""
Max memory usage, percent.
"""
return pulumi.get(self, "memory_max")
@property
@pulumi.getter(name="memoryMaxPercent")
def memory_max_percent(self) -> int:
"""
Max memory usage, percent.
"""
return pulumi.get(self, "memory_max_percent")
@property
@pulumi.getter(name="networkThroughputAverage")
def network_throughput_average(self) -> str:
"""
Average network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
"""
return pulumi.get(self, "network_throughput_average")
@property
@pulumi.getter(name="networkThroughputAverageKbps")
def network_throughput_average_kbps(self) -> str:
"""
Average network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
"""
return pulumi.get(self, "network_throughput_average_kbps")
@property
@pulumi.getter(name="networkThroughputMax")
def network_throughput_max(self) -> str:
"""
Max network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
"""
return pulumi.get(self, "network_throughput_max")
@property
@pulumi.getter(name="networkThroughputMaxKbps")
def network_throughput_max_kbps(self) -> str:
"""
Max network throughput (combined transmit-rates and receive-rates), in kilobytes per second.
"""
return pulumi.get(self, "network_throughput_max_kbps")
@pulumi.output_type
class VmwareSourceDetailsResponse(dict):
"""
VmwareSourceDetails message describes a specific source details for the vmware source type.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "vcenterIp":
suggest = "vcenter_ip"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in VmwareSourceDetailsResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
VmwareSourceDetailsResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
VmwareSourceDetailsResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
password: str,
thumbprint: str,
username: str,
vcenter_ip: str):
"""
VmwareSourceDetails message describes a specific source details for the vmware source type.
:param str password: Input only. The credentials password. This is write only and can not be read in a GET operation.
:param str thumbprint: The thumbprint representing the certificate for the vcenter.
:param str username: The credentials username.
:param str vcenter_ip: The ip address of the vcenter this Source represents.
"""
pulumi.set(__self__, "password", password)
pulumi.set(__self__, "thumbprint", thumbprint)
pulumi.set(__self__, "username", username)
pulumi.set(__self__, "vcenter_ip", vcenter_ip)
@property
@pulumi.getter
def password(self) -> str:
"""
Input only. The credentials password. This is write only and can not be read in a GET operation.
"""
return pulumi.get(self, "password")
@property
@pulumi.getter
def thumbprint(self) -> str:
"""
The thumbprint representing the certificate for the vcenter.
"""
return pulumi.get(self, "thumbprint")
@property
@pulumi.getter
def username(self) -> str:
"""
The credentials username.
"""
return pulumi.get(self, "username")
@property
@pulumi.getter(name="vcenterIp")
def vcenter_ip(self) -> str:
"""
The ip address of the vcenter this Source represents.
"""
return pulumi.get(self, "vcenter_ip")
@pulumi.output_type
class VmwareVmDetailsResponse(dict):
"""
VmwareVmDetails describes a VM in vCenter.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "bootOption":
suggest = "boot_option"
elif key == "committedStorage":
suggest = "committed_storage"
elif key == "committedStorageMb":
suggest = "committed_storage_mb"
elif key == "cpuCount":
suggest = "cpu_count"
elif key == "datacenterDescription":
suggest = "datacenter_description"
elif key == "datacenterId":
suggest = "datacenter_id"
elif key == "diskCount":
suggest = "disk_count"
elif key == "displayName":
suggest = "display_name"
elif key == "guestDescription":
suggest = "guest_description"
elif key == "memoryMb":
suggest = "memory_mb"
elif key == "powerState":
suggest = "power_state"
elif key == "vmId":
suggest = "vm_id"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in VmwareVmDetailsResponse. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
VmwareVmDetailsResponse.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
VmwareVmDetailsResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
boot_option: str,
committed_storage: str,
committed_storage_mb: str,
cpu_count: int,
datacenter_description: str,
datacenter_id: str,
disk_count: int,
display_name: str,
guest_description: str,
memory_mb: int,
power_state: str,
uuid: str,
vm_id: str):
"""
VmwareVmDetails describes a VM in vCenter.
:param str boot_option: The VM Boot Option.
:param str committed_storage: The total size of the storage allocated to the VM in MB.
:param str committed_storage_mb: The total size of the storage allocated to the VM in MB.
:param int cpu_count: The number of cpus in the VM.
:param str datacenter_description: The descriptive name of the vCenter's datacenter this VM is contained in.
:param str datacenter_id: The id of the vCenter's datacenter this VM is contained in.
:param int disk_count: The number of disks the VM has.
:param str display_name: The display name of the VM. Note that this is not necessarily unique.
:param str guest_description: The VM's OS. See for example https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html for types of strings this might hold.
:param int memory_mb: The size of the memory of the VM in MB.
:param str power_state: The power state of the VM at the moment list was taken.
:param str uuid: The unique identifier of the VM in vCenter.
:param str vm_id: The VM's id in the source (note that this is not the MigratingVm's id). This is the moref id of the VM.
"""
pulumi.set(__self__, "boot_option", boot_option)
pulumi.set(__self__, "committed_storage", committed_storage)
pulumi.set(__self__, "committed_storage_mb", committed_storage_mb)
pulumi.set(__self__, "cpu_count", cpu_count)
pulumi.set(__self__, "datacenter_description", datacenter_description)
pulumi.set(__self__, "datacenter_id", datacenter_id)
pulumi.set(__self__, "disk_count", disk_count)
pulumi.set(__self__, "display_name", display_name)
pulumi.set(__self__, "guest_description", guest_description)
pulumi.set(__self__, "memory_mb", memory_mb)
pulumi.set(__self__, "power_state", power_state)
pulumi.set(__self__, "uuid", uuid)
pulumi.set(__self__, "vm_id", vm_id)
@property
@pulumi.getter(name="bootOption")
def boot_option(self) -> str:
"""
The VM Boot Option.
"""
return pulumi.get(self, "boot_option")
@property
@pulumi.getter(name="committedStorage")
def committed_storage(self) -> str:
"""
The total size of the storage allocated to the VM in MB.
"""
return pulumi.get(self, "committed_storage")
@property
@pulumi.getter(name="committedStorageMb")
def committed_storage_mb(self) -> str:
"""
The total size of the storage allocated to the VM in MB.
"""
return pulumi.get(self, "committed_storage_mb")
@property
@pulumi.getter(name="cpuCount")
def cpu_count(self) -> int:
"""
The number of cpus in the VM.
"""
return pulumi.get(self, "cpu_count")
@property
@pulumi.getter(name="datacenterDescription")
def datacenter_description(self) -> str:
"""
The descriptive name of the vCenter's datacenter this VM is contained in.
"""
return pulumi.get(self, "datacenter_description")
@property
@pulumi.getter(name="datacenterId")
def datacenter_id(self) -> str:
"""
The id of the vCenter's datacenter this VM is contained in.
"""
return pulumi.get(self, "datacenter_id")
@property
@pulumi.getter(name="diskCount")
def disk_count(self) -> int:
"""
The number of disks the VM has.
"""
return pulumi.get(self, "disk_count")
@property
@pulumi.getter(name="displayName")
def display_name(self) -> str:
"""
The display name of the VM. Note that this is not necessarily unique.
"""
return pulumi.get(self, "display_name")
@property
@pulumi.getter(name="guestDescription")
def guest_description(self) -> str:
"""
The VM's OS. See for example https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html for types of strings this might hold.
"""
return pulumi.get(self, "guest_description")
@property
@pulumi.getter(name="memoryMb")
def memory_mb(self) -> int:
"""
The size of the memory of the VM in MB.
"""
return pulumi.get(self, "memory_mb")
@property
@pulumi.getter(name="powerState")
def power_state(self) -> str:
"""
The power state of the VM at the moment list was taken.
"""
return pulumi.get(self, "power_state")
@property
@pulumi.getter
def uuid(self) -> str:
"""
The unique identifier of the VM in vCenter.
"""
return pulumi.get(self, "uuid")
@property
@pulumi.getter(name="vmId")
def vm_id(self) -> str:
"""
The VM's id in the source (note that this is not the MigratingVm's id). This is the moref id of the VM.
"""
return pulumi.get(self, "vm_id")
| 38.542045
| 653
| 0.637306
| 7,863
| 67,834
| 5.294798
| 0.064734
| 0.020513
| 0.033723
| 0.049288
| 0.776379
| 0.731727
| 0.709365
| 0.668316
| 0.655754
| 0.640502
| 0
| 0.000222
| 0.26873
| 67,834
| 1,759
| 654
| 38.563957
| 0.839069
| 0.309358
| 0
| 0.597289
| 1
| 0.013553
| 0.20527
| 0.060905
| 0
| 0
| 0
| 0
| 0
| 1
| 0.160697
| false
| 0.003872
| 0.006776
| 0.000968
| 0.314618
| 0.003872
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 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
|
a10b1c87fe2ffd2a2fe1dee4b23ec1fe16f8cf15
| 287
|
py
|
Python
|
electroPyy/io/__init__.py
|
ludo67100/electroPyy_Dev
|
3b940adbfdf005dd8231e7ac61aca708033d5a95
|
[
"OML"
] | null | null | null |
electroPyy/io/__init__.py
|
ludo67100/electroPyy_Dev
|
3b940adbfdf005dd8231e7ac61aca708033d5a95
|
[
"OML"
] | null | null | null |
electroPyy/io/__init__.py
|
ludo67100/electroPyy_Dev
|
3b940adbfdf005dd8231e7ac61aca708033d5a95
|
[
"OML"
] | null | null | null |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 21 14:54:51 2019
@author: Ludovic.SPAETH
"""
from electroPyy.io.BaseRawIO import BaseRawIO
from electroPyy.io.HdF5IO import HdF5IO
from electroPyy.io.NeuroExIO import NeuroExIO
from electroPyy.io.WinWcpRawIO import WinWcpRawIO
| 23.916667
| 50
| 0.745645
| 39
| 287
| 5.487179
| 0.589744
| 0.261682
| 0.299065
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.061983
| 0.156794
| 287
| 11
| 51
| 26.090909
| 0.822314
| 0.289199
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 0
| 0
|
0
| 4
|
a14dc76d87023f8e5ab3f4a7babd9708c41bf004
| 34,030
|
py
|
Python
|
Project1/cl1_p1_wsd.py
|
Sanghyun-Hong/NLPProjects
|
9f81fa680946648f64ac25e5ca8197e9f3386deb
|
[
"MIT"
] | null | null | null |
Project1/cl1_p1_wsd.py
|
Sanghyun-Hong/NLPProjects
|
9f81fa680946648f64ac25e5ca8197e9f3386deb
|
[
"MIT"
] | null | null | null |
Project1/cl1_p1_wsd.py
|
Sanghyun-Hong/NLPProjects
|
9f81fa680946648f64ac25e5ca8197e9f3386deb
|
[
"MIT"
] | null | null | null |
import numpy as np
import operator
# SHHONG: custom modules imported
import json
import random
import itertools
from math import pow, log
from collections import Counter
import os
import sys
sys.stdout = open(os.devnull, 'w')
"""
CMSC723 / INST725 / LING723 -- Fall 2016
Project 1: Implementing Word Sense Disambiguation Systems
"""
"""
read one of train, dev, test subsets
subset - one of train, dev, test
output is a tuple of three lists
labels: one of the 6 possible senses <cord, division, formation, phone, product, text >
targets: the index within the text of the token to be disambiguated
texts: a list of tokenized and normalized text input (note that there can be multiple sentences)
"""
import nltk
#### added dev_manual to the subset of allowable files
def read_dataset(subset):
labels = []
texts = []
targets = []
if subset in ['train', 'dev', 'test', 'dev_manual']:
with open('data/wsd_'+subset+'.txt') as inp_hndl:
for example in inp_hndl:
label, text = example.strip().split('\t')
text = nltk.word_tokenize(text.lower().replace('" ','"'))
if 'line' in text:
ambig_ix = text.index('line')
elif 'lines' in text:
ambig_ix = text.index('lines')
else:
ldjal
targets.append(ambig_ix)
labels.append(label)
texts.append(text)
return (labels, targets, texts)
else:
print '>>>> invalid input !!! <<<<<'
"""
computes f1-score of the classification accuracy
gold_labels - is a list of the gold labels
predicted_labels - is a list of the predicted labels
output is a tuple of the micro averaged score and the macro averaged score
"""
import sklearn.metrics
#### changed method name from eval because of naming conflict with python keyword
def eval_performance(gold_labels, predicted_labels):
return ( sklearn.metrics.f1_score(gold_labels, predicted_labels, average='micro'),
sklearn.metrics.f1_score(gold_labels, predicted_labels, average='macro') )
"""
a helper method that takes a list of predictions and writes them to a file (1 prediction per line)
predictions - list of predictions (strings)
file_name - name of the output file
"""
def write_predictions(predictions, file_name):
with open(file_name, 'w') as outh:
for p in predictions:
outh.write(p+'\n')
"""
Trains a naive bayes model with bag of words features and computes the accuracy on the test set
train_texts, train_targets, train_labels are as described in read_dataset above
The same thing applies to the reset of the parameters.
"""
def run_bow_naivebayes_classifier(train_texts, train_targets, train_labels,
dev_texts, dev_targets, dev_labels, test_texts, test_targets, test_labels):
# control variables
improved = True
alpha = 0.04
silent = True
# Part 2.1 (c_s/c_sw)
c_s = dict.fromkeys(set(train_labels), 0)
multiples = list(itertools.product(c_s.keys(), ['time', 'loss', 'export']))
c_sw = dict.fromkeys(multiples, 0)
t_w = [each_word for each_text in train_texts for each_word in each_text]
multiples = list(itertools.product(c_s.keys(), t_w))
t_sw = dict.fromkeys(multiples, 0)
for idx, label in enumerate(train_labels):
cur_text = train_texts[idx]
# compute c_s
c_s[label] += len(cur_text)
# compute c_sw
time_cnt = cur_text.count('time')
loss_cnt = cur_text.count('loss')
export_cnt = cur_text.count('export')
c_sw[(label, 'time')] += time_cnt
c_sw[(label, 'loss')] += loss_cnt
c_sw[(label, 'export')] += export_cnt
# compute t_sw (total occurances): of (label, word): occurances
for each_word in cur_text:
t_sw[(label, each_word)] += 1
# total # of distinct words: will be used for smoothing
t_dw = Counter(t_w)
if not silent:
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('s', 'cord', 'division', 'formation', 'phone', 'product', 'text')
print '------------------------------------------------------------------------------------------'
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s)', c_s['cord'], c_s['division'], c_s['formation'], c_s['phone'], c_s['product'], c_s['text'])
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s,time)', c_sw[('cord', 'time')], c_sw[('division', 'time')], c_sw[('formation', 'time')], \
c_sw[('phone', 'time')], c_sw[('product', 'time')], c_sw[('text', 'time')])
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s,loss)', c_sw[('cord', 'loss')], c_sw[('division', 'loss')], c_sw[('formation', 'loss')], \
c_sw[('phone', 'loss')], c_sw[('product', 'loss')], c_sw[('text', 'loss')])
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s,export)', c_sw[('cord', 'export')], c_sw[('division', 'export')], c_sw[('formation', 'export')], \
c_sw[('phone', 'export')], c_sw[('product', 'export')], c_sw[('text', 'export')])
print '------------------------------------------------------------------------------------------'
print ' total distinct words: %d ' % (len(t_dw.keys()))
# Part 2.2 (p_s/p_ws)
total_occurances = float(sum(c_s.values()))
label_count = Counter(train_labels)
p_s = {key: (value / float( sum( label_count.values() )) ) for key, value in label_count.iteritems()}
if improved:
p_ws = {key: ( (value + alpha) / \
(float(c_s[key[0]]) + alpha*len(t_dw.keys())) ) \
for key, value in c_sw.iteritems()}
t_ws = {key: ( (value + alpha) / \
(float(c_s[key[0]]) + alpha*len(t_dw.keys())) ) \
for key, value in t_sw.iteritems()}
else:
p_ws = {key: (value / float(c_s[key[0]])) for key, value in c_sw.iteritems()}
t_ws = {key: (value / float(c_s[key[0]])) for key, value in t_sw.iteritems()}
# normalization steps
norm_denominators = {
'time': 0.0,
'loss': 0.0,
'export': 0.0
}
for key, value in p_ws.iteritems():
norm_denominators[key[1]] += value
p_ws_norm = {key: (value / norm_denominators[key[1]]) for key, value in p_ws.iteritems()}
p_ws = p_ws_norm
if not silent:
print '------------------------------------------------------------------------------------------'
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(s)', p_s['cord'], p_s['division'], p_s['formation'], p_s['phone'], p_s['product'], p_s['text'])
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(time|s)', p_ws[('cord', 'time')], p_ws[('division', 'time')], p_ws[('formation', 'time')], \
p_ws[('phone', 'time')], p_ws[('product', 'time')], p_ws[('text', 'time')])
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(loss|s)', p_ws[('cord', 'loss')], p_ws[('division', 'loss')], p_ws[('formation', 'loss')], \
p_ws[('phone', 'loss')], p_ws[('product', 'loss')], p_ws[('text', 'loss')])
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(export|s)', p_ws[('cord', 'export')], p_ws[('division', 'export')], p_ws[('formation', 'export')], \
p_ws[('phone', 'export')], p_ws[('product', 'export')], p_ws[('text', 'export')])
# Part 2.3 (p_sxd, on the 1st line on test set)
p_sxd = dict.fromkeys(c_s.keys(), 0.0)
lp_sxd = dict.fromkeys(c_s.keys(), 0.0)
cur_text = dev_texts[0]
for key in p_sxd.keys():
# compute p for each class
if improved:
tp_sxd = p_s[key]
tlp_sxd = log(p_s[key])
else:
tp_sxd = p_s[key]
# compute for each word
for each_word in cur_text:
if t_ws.has_key((key, each_word)):
if improved:
tp_sxd *= t_ws[(key, each_word)]
tlp_sxd += log(t_ws[(key, each_word)])
else:
tp_sxd *= t_ws[(key, each_word)]
# add to the dict
if improved:
p_sxd[key] = tp_sxd
lp_sxd[key] = tlp_sxd
else:
p_sxd[key] = tp_sxd
if not silent:
print '------------------------------------------------------------------------------------------'
print ' %s | %s | %s | %s | %s | %s | %s |' % \
('p(s|X)', p_sxd['cord'], p_sxd['division'], p_sxd['formation'], \
p_sxd['phone'], p_sxd['product'], p_sxd['text'])
print '------------------------------------------------------------------------------------------'
print ' 1st label in dev : %s ' % (dev_labels[0])
print ' 1st text in dev[:5]: %s ' % (dev_texts[0][:5])
if improved:
print '------------------------------------------------------------------------------------------'
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('log(p(s|X))', lp_sxd['cord'], lp_sxd['division'], lp_sxd['formation'], \
lp_sxd['phone'], lp_sxd['product'], lp_sxd['text'])
# Part 2.4: compute all the prob on the test dataset
p_sx = list()
for idx, text in enumerate(test_texts):
t_prob = dict.fromkeys(c_s.keys(), 0.0)
for key in t_prob.keys():
# compute p for each class
if improved:
tp_sxt = log(p_s[key])
else:
tp_sxt = p_s[key]
for each_word in text:
if t_ws.has_key((key, each_word)):
if improved:
tp_sxt += log(t_ws[(key, each_word)])
else:
tp_sxt *= t_ws[(key, each_word)]
# add to the dict
t_prob[key] = tp_sxt
# add dict to the entire list
p_sx.append(t_prob)
# Part 2.4 (run the classifier for all)
labels_predicted = list()
for idx, label in enumerate(test_labels):
maximum_probs = max(p_sx[idx].values())
label_prediction = [key for key, value in p_sx[idx].iteritems() if value == maximum_probs]
label_prediction = random.choice(label_prediction)
# based on the prob
labels_predicted.append(label_prediction)
naivebayes_performance = eval_performance(test_labels, labels_predicted)
# save the implementation to the file
with open('q4p2.txt', 'wb') as q4p2_output:
for each_label in labels_predicted:
q4p2_output.write(each_label+'\n')
# Part 2.5 (do more tuning for the classifier)
# - Laplace smoothing
# - Log likelihoods
if not silent:
print '------------------------------------------------------------------------------------------'
return 'Naive Bayes: micro/macro = [%.2f, %.2f] @ (alpha: %s)' % \
(naivebayes_performance[0]*100, naivebayes_performance[1]*100, alpha)
## extract all the distinct words from a set of texts
## return a dictionary {word:index} that maps each word to a unique index
def extract_all_words(texts,prev_set=set()):
all_words = prev_set
for t in texts:
for w in t:
all_words.add(w)
all_words_idx = {}
for i,w in enumerate(all_words):
all_words_idx[w] = i
return all_words_idx
## extract all distinct labels from a dataset
## return a dictionary {label:index} that maps each label to a unique index
def extract_all_labels(labels):
distinct_labels = list(set(labels))
all_labels_idx = {}
for i,l in enumerate(distinct_labels):
all_labels_idx[l] = i
return all_labels_idx
## construct a bow feature matrix for a set of instances
## the returned matrix has the size NUM_INSTANCES X NUM_FEATURES
def extract_features(all_words_idx,all_labels_idx,texts):
NUM_FEATURES = len(all_words_idx.keys())
NUM_INSTANCES = len(texts)
features_matrix = np.zeros((NUM_INSTANCES,NUM_FEATURES))
for i,instance in enumerate(texts):
for word in instance:
if all_words_idx.get(word,None) is None:
continue
features_matrix[i][all_words_idx[word]] += 1
return features_matrix
## compute the feature vector for a set of words and a given label
## the features are computed as described in Slide #19 of:
## http://www.cs.umd.edu/class/fall2016/cmsc723/slides/slides_02.pdf
def get_features_for_label(instance,label,class_labels):
num_labels = len(class_labels)
num_feats = len(instance)
feats = np.zeros(len(instance)*num_labels+1)
assert len(feats[num_feats*label:num_feats*label+num_feats]) == len(instance)
feats[num_feats*label:num_feats*label+num_feats] = instance
return feats
## get the predicted label for a given instance
## the predicted label is the one with the highest dot product of theta*feature_vector
## return the predicted label, the dot product scores for all labels and the features computed for all labels for that instance
def get_predicted_label(inst,class_labels,theta):
all_labels_scores = {}
all_labels_features = {}
for lbl in class_labels:
feat_vec = get_features_for_label(inst,lbl,class_labels)
assert len(feat_vec) == len(theta)
all_labels_scores[lbl] = np.dot(feat_vec,theta)
predicted_label = max(all_labels_scores.iteritems(), key=operator.itemgetter(1))[0]
return predicted_label
## train the perceptron by iterating over the entire training dataset
## the algorithm is an implementation of the pseudocode from Slide #23 of:
## http://www.cs.umd.edu/class/fall2016/cmsc723/slides/slides_03.pdf
def train_perceptron(train_features,train_labels,class_labels,num_features):
NO_MAX_ITERATIONS = 20
np.random.seed(0)
theta = np.zeros(num_features)
print '# Training Instances:',len(train_features)
num_iterations = 0
cnt_updates_total = 0
cnt_updates_prev = 0
m = np.zeros(num_features)
print '# Total Updates / # Current Iteration Updates:'
for piter in range(NO_MAX_ITERATIONS):
shuffled_indices = np.arange(len(train_features))
np.random.shuffle(shuffled_indices)
cnt_updates_crt = 0
for i in shuffled_indices:
inst = train_features[i]
actual_label = train_labels[i]
predicted_label = get_predicted_label(inst,class_labels,theta)
if predicted_label != actual_label:
cnt_updates_total += 1
cnt_updates_crt += 1
theta = theta + get_features_for_label(inst,actual_label,class_labels) - get_features_for_label(inst,predicted_label,class_labels)
m = m + theta
num_iterations += 1
print cnt_updates_total,'/',cnt_updates_crt
if cnt_updates_crt == 0:
break
theta = m/cnt_updates_total
print '# Iterations:',piter
print '# Iterations over instances:',num_iterations
print '# Total Updates:',cnt_updates_total
return theta
## return the predictions of the perceptron on a test set
def test_perceptron(theta,test_features,test_labels,class_labels):
predictions = []
for inst in test_features:
predicted_label = get_predicted_label(inst,class_labels,theta)
predictions.append(predicted_label)
return predictions
"""
Trains a perceptron model with bag of words features and computes the accuracy on the test set
train_texts, train_targets, train_labels are as described in read_dataset above
The same thing applies to the reset of the parameters.
"""
def run_bow_perceptron_classifier(train_texts, train_targets,train_labels,
dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_labels):
all_words_idx = extract_all_words(train_texts)
all_labels_idx = extract_all_labels(train_labels)
num_features = len(all_words_idx.keys())*len(all_labels_idx.keys())+1
class_labels = all_labels_idx.values()
train_features = extract_features(all_words_idx,all_labels_idx,train_texts)
train_labels = map(lambda e: all_labels_idx[e],train_labels)
test_features = extract_features(all_words_idx,all_labels_idx,test_texts)
test_labels = map(lambda e: all_labels_idx[e],test_labels)
for l in class_labels:
inst = train_features[0]
ffl = get_features_for_label(inst,l,class_labels)
assert False not in (inst == ffl[l*len(inst):(l+1)*len(inst)])
theta = train_perceptron(train_features,train_labels,class_labels,num_features)
test_predictions = test_perceptron(theta,test_features,test_labels,class_labels)
eval_test = eval_performance(test_labels,test_predictions)
inverse_labels_index = {}
for k in all_labels_idx.keys():
inverse_labels_index[all_labels_idx[k]] = k
test_predictions_names = map(lambda e: inverse_labels_index[e],test_predictions)
with open('q3p3.txt', 'wb') as file_output:
for each_label in test_predictions_names:
file_output.write(each_label+'\n')
return ('test-micro=%d%%, test-macro=%d%%' % (int(eval_test[0]*100),int(eval_test[1]*100)))
"""
Trains a naive bayes model with bag of words features + two additional features
and computes the accuracy on the test set
train_texts, train_targets, train_labels are as described in read_dataset above
The same thing applies to the reset of the parameters.
"""
def run_extended_bow_naivebayes_classifier(train_texts, train_targets,train_labels,
dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_labels):
# control variables
improved = True
alpha = 0.04
silent = True
RUN_EXP = 'Both' # set to 'B', None, or 'Both'
# feature extensions (A)
if 'A' in RUN_EXP:
train_features, dev_features, test_features = get_feature_A(train_texts, train_targets, train_labels,
dev_texts, dev_targets, dev_labels,
test_texts, test_targets, test_labels)
for idx, each_text in enumerate(train_texts):
each_text.append(str(float(train_features[idx])))
for idx, each_text in enumerate(dev_texts):
each_text.append(str(float(dev_features[idx])))
for idx, each_text in enumerate(test_texts):
each_text.append(str(float(test_features[idx])))
# feature extensions (B)
elif 'B' in RUN_EXP:
train_features, dev_features, test_features = get_feature_B(train_texts, train_targets, train_labels,
dev_texts, dev_targets, dev_labels,
test_texts, test_targets, test_labels)
for idx, each_text in enumerate(train_texts):
each_text.append(str(int(train_features[idx])))
for idx, each_text in enumerate(dev_texts):
each_text.append(str(int(dev_features[idx])))
for idx, each_text in enumerate(test_texts):
each_text.append(str(int(test_features[idx])))
# feature extensions with both two A and B
elif 'Both' in RUN_EXP:
train_features_A, dev_features_A, test_features_A = get_feature_A(train_texts, train_targets, train_labels,
dev_texts, dev_targets, dev_labels,
test_texts, test_targets, test_labels)
train_features_B, dev_features_B, test_features_B = get_feature_B(train_texts, train_targets, train_labels,
dev_texts, dev_targets, dev_labels,
test_texts, test_targets, test_labels)
for idx, each_text in enumerate(train_texts):
each_text.append(str(float(train_features_A[idx])))
each_text.append(str(int(train_features_B[idx])))
for idx, each_text in enumerate(dev_texts):
each_text.append(str(float(dev_features_A[idx])))
each_text.append(str(intern(train_features_B[idx])))
for idx, each_text in enumerate(test_texts):
each_text.append(str(float(test_features_A[idx])))
each_text.append(str(int(train_features_B[idx])))
else:
train_features, dev_features, test_features = None, None, None
if not silent:
print ' extension of the Naive Bayes classifier w. feature set: [%s] ' % (RUN_EXP)
print '------------------------------------------------------------------------------------------'
# Part 2.1 (c_s/c_sw)
c_s = dict.fromkeys(set(train_labels), 0)
multiples = list(itertools.product(c_s.keys(), ['time', 'loss', 'export']))
c_sw = dict.fromkeys(multiples, 0)
t_w = [each_word for each_text in train_texts for each_word in each_text]
multiples = list(itertools.product(c_s.keys(), t_w))
t_sw = dict.fromkeys(multiples, 0)
for idx, label in enumerate(train_labels):
cur_text = train_texts[idx]
# compute c_s
c_s[label] += len(cur_text)
# compute c_sw
time_cnt = cur_text.count('time')
loss_cnt = cur_text.count('loss')
export_cnt = cur_text.count('export')
c_sw[(label, 'time')] += time_cnt
c_sw[(label, 'loss')] += loss_cnt
c_sw[(label, 'export')] += export_cnt
# compute t_sw (total occurances): of (label, word): occurances
for each_word in cur_text:
t_sw[(label, each_word)] += 1
# total # of distinct words: will be used for smoothing
t_dw = Counter(t_w)
if not silent:
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('s', 'cord', 'division', 'formation', 'phone', 'product', 'text')
print '------------------------------------------------------------------------------------------'
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s)', c_s['cord'], c_s['division'], c_s['formation'], c_s['phone'], c_s['product'], c_s['text'])
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s,time)', c_sw[('cord', 'time')], c_sw[('division', 'time')], c_sw[('formation', 'time')], \
c_sw[('phone', 'time')], c_sw[('product', 'time')], c_sw[('text', 'time')])
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s,loss)', c_sw[('cord', 'loss')], c_sw[('division', 'loss')], c_sw[('formation', 'loss')], \
c_sw[('phone', 'loss')], c_sw[('product', 'loss')], c_sw[('text', 'loss')])
print '{:<11} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} | {:<10} |'.\
format('c(s,export)', c_sw[('cord', 'export')], c_sw[('division', 'export')], c_sw[('formation', 'export')], \
c_sw[('phone', 'export')], c_sw[('product', 'export')], c_sw[('text', 'export')])
print '------------------------------------------------------------------------------------------'
print ' total distinct words: %d ' % (len(t_dw.keys()))
# Part 2.2 (p_s/p_ws)
total_occurances = float(sum(c_s.values()))
label_count = Counter(train_labels)
p_s = {key: (value / float( sum( label_count.values() )) ) for key, value in label_count.iteritems()}
if improved:
p_ws = {key: ( (value + alpha) / \
(float(c_s[key[0]]) + alpha*len(t_dw.keys())) ) \
for key, value in c_sw.iteritems()}
t_ws = {key: ( (value + alpha) / \
(float(c_s[key[0]]) + alpha*len(t_dw.keys())) ) \
for key, value in t_sw.iteritems()}
else:
p_ws = {key: (value / float(c_s[key[0]])) for key, value in c_sw.iteritems()}
t_ws = {key: (value / float(c_s[key[0]])) for key, value in t_sw.iteritems()}
# normalization steps
norm_denominators = {
'time': 0.0,
'loss': 0.0,
'export': 0.0
}
for key, value in p_ws.iteritems():
norm_denominators[key[1]] += value
p_ws_norm = {key: (value / norm_denominators[key[1]]) for key, value in p_ws.iteritems()}
p_ws = p_ws_norm
if not silent:
print '------------------------------------------------------------------------------------------'
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(s)', p_s['cord'], p_s['division'], p_s['formation'], p_s['phone'], p_s['product'], p_s['text'])
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(time|s)', p_ws[('cord', 'time')], p_ws[('division', 'time')], p_ws[('formation', 'time')], \
p_ws[('phone', 'time')], p_ws[('product', 'time')], p_ws[('text', 'time')])
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(loss|s)', p_ws[('cord', 'loss')], p_ws[('division', 'loss')], p_ws[('formation', 'loss')], \
p_ws[('phone', 'loss')], p_ws[('product', 'loss')], p_ws[('text', 'loss')])
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('p(export|s)', p_ws[('cord', 'export')], p_ws[('division', 'export')], p_ws[('formation', 'export')], \
p_ws[('phone', 'export')], p_ws[('product', 'export')], p_ws[('text', 'export')])
# Part 2.3 (p_sxd, on the 1st line on test set)
p_sxd = dict.fromkeys(c_s.keys(), 0.0)
lp_sxd = dict.fromkeys(c_s.keys(), 0.0)
cur_text = dev_texts[0]
for key in p_sxd.keys():
# compute p for each class
if improved:
tp_sxd = p_s[key]
tlp_sxd = log(p_s[key])
else:
tp_sxd = p_s[key]
# compute for each word
for each_word in cur_text:
if t_ws.has_key((key, each_word)):
if improved:
tp_sxd *= t_ws[(key, each_word)]
tlp_sxd += log(t_ws[(key, each_word)])
else:
tp_sxd *= t_ws[(key, each_word)]
# add to the dict
if improved:
p_sxd[key] = tp_sxd
lp_sxd[key] = tlp_sxd
else:
p_sxd[key] = tp_sxd
if not silent:
print '------------------------------------------------------------------------------------------'
print ' %s | %s | %s | %s | %s | %s | %s |' % \
('p(s|X)', p_sxd['cord'], p_sxd['division'], p_sxd['formation'], \
p_sxd['phone'], p_sxd['product'], p_sxd['text'])
print '------------------------------------------------------------------------------------------'
print ' 1st label in dev : %s ' % (dev_labels[0])
print ' 1st text in dev[:5]: %s ' % (dev_texts[0][:5])
if improved:
print '------------------------------------------------------------------------------------------'
print '{:<11} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} | {:<10.8f} |'.\
format('log(p(s|X))', lp_sxd['cord'], lp_sxd['division'], lp_sxd['formation'], \
lp_sxd['phone'], lp_sxd['product'], lp_sxd['text'])
# Part 2.4: compute all the prob on the test dataset
p_sx = list()
for idx, text in enumerate(test_texts):
t_prob = dict.fromkeys(c_s.keys(), 0.0)
for key in t_prob.keys():
# compute p for each class
if improved:
tp_sxt = log(p_s[key])
else:
tp_sxt = p_s[key]
for each_word in text:
if t_ws.has_key((key, each_word)):
if improved:
tp_sxt += log(t_ws[(key, each_word)])
else:
tp_sxt *= t_ws[(key, each_word)]
# add to the dict
t_prob[key] = tp_sxt
# add dict to the entire list
p_sx.append(t_prob)
# Part 2.4 (run the classifier for all)
labels_predicted = list()
for idx, label in enumerate(test_labels):
maximum_probs = max(p_sx[idx].values())
label_prediction = [key for key, value in p_sx[idx].iteritems() if value == maximum_probs]
label_prediction = random.choice(label_prediction)
# based on the prob
labels_predicted.append(label_prediction)
naivebayes_performance = eval_performance(test_labels, labels_predicted)
# save the implementation to the file
with open('q4p4_nb.txt', 'wb') as q4p4_nb_output:
for each_label in labels_predicted:
q4p4_nb_output.write(each_label+'\n')
# Part 2.5 (do more tuning for the classifier)
# - Laplace smoothing
# - Log likelihoods
if not silent:
print '------------------------------------------------------------------------------------------'
return 'Naive Bayes: micro/macro = [%.2f, %.2f] @ (alpha: %s)' % \
(naivebayes_performance[0]*100, naivebayes_performance[1]*100, alpha)
## this feature is just a random number generated for each instance
def get_feature_A(train_texts, train_targets,train_labels,
dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_label):
# call this everytime, makes the same random number
np.random.seed(0)
train_feature_vector = np.random.random_sample((len(train_texts),))
dev_feature_vector = np.random.random_sample((len(dev_texts),))
test_feature_vector = np.random.random_sample((len(test_texts),))
return train_feature_vector,dev_feature_vector,test_feature_vector
## this feature encodes the number of distinct words in each instance
def get_feature_B(train_texts, train_targets,train_labels,
dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_label):
train_feature_vector = np.zeros(len(train_texts))
dev_feature_vector = np.zeros(len(dev_texts))
test_feature_vector = np.zeros(len(test_texts))
for i,text in enumerate(train_texts):
nw = len(set(text))
train_feature_vector[i] = nw
for i,text in enumerate(dev_texts):
nw = len(set(text))
dev_feature_vector[i] = nw
for i,text in enumerate(test_texts):
nw = len(set(text))
test_feature_vector[i] = nw
return train_feature_vector,dev_feature_vector,test_feature_vector
"""
Trains a perceptron model with bag of words features + two additional features
and computes the accuracy on the test set
train_texts, train_targets, train_labels are as described in read_dataset above
The same thing applies to the reset of the parameters.
"""
def run_extended_bow_perceptron_classifier(train_texts, train_targets,train_labels,
dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_labels):
RUN_EXP_A = True # set to True for running on feature A
RUN_EXP_B = True # set to True for running on feature B
num_extra_features = 0
if RUN_EXP_A:
train_new_feature_vectorA,dev_new_feature_vectorA,test_new_feature_vectorA = get_feature_A(train_texts, train_targets,train_labels, dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_labels)
num_extra_features += 1
if RUN_EXP_B:
train_new_feature_vectorB,dev_new_feature_vectorB,test_new_feature_vectorB = get_feature_B(train_texts, train_targets,train_labels, dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_labels)
num_extra_features += 1
all_words_idx = extract_all_words(train_texts)
all_labels_idx = extract_all_labels(train_labels)
num_features = (len(all_words_idx.keys())+num_extra_features)*len(all_labels_idx.keys())+1
class_labels = all_labels_idx.values()
train_features = extract_features(all_words_idx,all_labels_idx,train_texts)
train_labels = map(lambda e: all_labels_idx[e],train_labels)
test_features = extract_features(all_words_idx,all_labels_idx,test_texts)
test_labels = map(lambda e: all_labels_idx[e],test_labels)
if RUN_EXP_A:
train_features = np.c_[train_features, train_new_feature_vectorA]
test_features = np.c_[test_features, test_new_feature_vectorA]
if RUN_EXP_B:
train_features = np.c_[train_features, train_new_feature_vectorB]
test_features = np.c_[test_features, test_new_feature_vectorB]
for l in class_labels:
inst = train_features[0]
ffl = get_features_for_label(inst,l,class_labels)
assert False not in (inst == ffl[l*len(inst):(l+1)*len(inst)])
theta = train_perceptron(train_features,train_labels,class_labels,num_features)
test_predictions = test_perceptron(theta,test_features,test_labels,class_labels)
eval_test = eval_performance(test_labels,test_predictions)
inverse_labels_index = {}
for k in all_labels_idx.keys():
inverse_labels_index[all_labels_idx[k]] = k
test_predictions_names = map(lambda e: inverse_labels_index[e],test_predictions)
with open('q4p4_pn.txt', 'wb') as file_output:
for each_label in test_predictions_names:
file_output.write(each_label+'\n')
return ('test-micro=%d%%, test-macro=%d%%' % (int(eval_test[0]*100),int(eval_test[1]*100)))
# Part 1.1
def run_most_frequent_class_classifier(train_texts, train_targets,train_labels,
dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_labels):
labels_freq = {}
for l in train_labels:
if labels_freq.get(l,None) is None:
labels_freq[l] = 0
labels_freq[l] += 1
most_frequent_label = max(labels_freq.iteritems(), key=operator.itemgetter(1))[0]
train_pred = [most_frequent_label]*len(train_labels)
dev_pred = [most_frequent_label]*len(dev_labels)
assert train_pred[2] == train_labels[2]
eval_train = eval_performance(train_labels,train_pred)
eval_dev = eval_performance(dev_labels,dev_pred)
return ('training-micro=%d%%, training-macro=%d%%, dev-micro=%d%%, dev-macro=%d%%' % (int(eval_train[0]*100),int(eval_train[1]*100),int(eval_dev[0]*100),int(eval_dev[1]*100)))
# Part 1.2
def run_inner_annotator_agreement(train_texts, train_targets,train_labels,
dev_texts, dev_targets,dev_labels, test_texts, test_targets, test_labels):
dev_labels_manual, dev_targets_manual, dev_texts_manual = read_dataset('dev_manual')
return '%.2f' % sklearn.metrics.cohen_kappa_score(dev_labels[:20],dev_labels_manual)
"""
Main (able to change the classifier to other ones)
"""
if __name__ == "__main__":
# reading, tokenizing, and normalizing data
train_labels, train_targets, train_texts = read_dataset('train')
dev_labels, dev_targets, dev_texts = read_dataset('dev')
test_labels, test_targets, test_texts = read_dataset('test')
#running the classifier
test_scores = run_bow_perceptron_classifier(train_texts, train_targets, train_labels,
dev_texts, dev_targets, dev_labels, test_texts, test_targets, test_labels)
print test_scores
| 43.075949
| 211
| 0.614634
| 4,849
| 34,030
| 4.064756
| 0.079192
| 0.012177
| 0.015221
| 0.020294
| 0.746778
| 0.718924
| 0.70761
| 0.688382
| 0.681431
| 0.650381
| 0
| 0.021244
| 0.201881
| 34,030
| 789
| 212
| 43.130545
| 0.704455
| 0.085542
| 0
| 0.647913
| 0
| 0.041742
| 0.173983
| 0.046483
| 0
| 0
| 0
| 0
| 0.009074
| 0
| null | null | 0
| 0.019964
| null | null | 0.094374
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a173546fb4be8c1b52e29b792d62de5b919bbc8f
| 97
|
py
|
Python
|
Python/Phani.py
|
baroood/Hacktoberfest-2k17
|
87383df4bf705358866a5a4120dd678a3f2acd3e
|
[
"MIT"
] | 28
|
2017-10-04T19:42:26.000Z
|
2021-03-26T04:00:48.000Z
|
Python/Phani.py
|
baroood/Hacktoberfest-2k17
|
87383df4bf705358866a5a4120dd678a3f2acd3e
|
[
"MIT"
] | 375
|
2017-09-28T02:58:37.000Z
|
2019-10-31T09:10:38.000Z
|
Python/Phani.py
|
baroood/Hacktoberfest-2k17
|
87383df4bf705358866a5a4120dd678a3f2acd3e
|
[
"MIT"
] | 519
|
2017-09-28T02:40:29.000Z
|
2021-02-15T08:29:17.000Z
|
a = input("Enter the first number")
b = input("Enter the second number")
print('the sum is',a+b)
| 24.25
| 36
| 0.680412
| 18
| 97
| 3.666667
| 0.611111
| 0.30303
| 0.393939
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.154639
| 97
| 3
| 37
| 32.333333
| 0.804878
| 0
| 0
| 0
| 0
| 0
| 0.56701
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0
| 0
| null | 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a1841c43709e67515946480883952c56edc55654
| 57
|
py
|
Python
|
run.py
|
JonLMyers/MetroTransitAPI
|
d8f467570368cd563d69564b680cfdd47ad6b622
|
[
"MIT"
] | null | null | null |
run.py
|
JonLMyers/MetroTransitAPI
|
d8f467570368cd563d69564b680cfdd47ad6b622
|
[
"MIT"
] | null | null | null |
run.py
|
JonLMyers/MetroTransitAPI
|
d8f467570368cd563d69564b680cfdd47ad6b622
|
[
"MIT"
] | null | null | null |
""" Runs the server """
from aaxus import app
app.run()
| 11.4
| 23
| 0.649123
| 9
| 57
| 4.111111
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.192982
| 57
| 4
| 24
| 14.25
| 0.804348
| 0.263158
| 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
|
a1ab946e745fb18496c5d63e37229b34b0071a28
| 112
|
py
|
Python
|
libs/test_utils.py
|
bongnv/sublime-go
|
9f5f4f9795357ec595f73c1f71e479eca694b61e
|
[
"MIT"
] | 6
|
2018-05-12T04:43:36.000Z
|
2018-09-21T17:44:53.000Z
|
libs/test_utils.py
|
bongnv/sublime-go
|
9f5f4f9795357ec595f73c1f71e479eca694b61e
|
[
"MIT"
] | null | null | null |
libs/test_utils.py
|
bongnv/sublime-go
|
9f5f4f9795357ec595f73c1f71e479eca694b61e
|
[
"MIT"
] | null | null | null |
import unittest
class TestIsGoView(unittest.TestCase):
def test_nil(self):
self.assertFalse(None)
| 16
| 38
| 0.723214
| 13
| 112
| 6.153846
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1875
| 112
| 6
| 39
| 18.666667
| 0.879121
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.25
| 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
|
a1d4680a92b1711d0003c4bd4a72a28789727f68
| 221
|
py
|
Python
|
Muta3DMaps/core/__init__.py
|
NatureGeorge/SIFTS_Plus_Muta_Maps
|
60f84e6024508e65ee3791103762b95666d3c646
|
[
"MIT"
] | null | null | null |
Muta3DMaps/core/__init__.py
|
NatureGeorge/SIFTS_Plus_Muta_Maps
|
60f84e6024508e65ee3791103762b95666d3c646
|
[
"MIT"
] | null | null | null |
Muta3DMaps/core/__init__.py
|
NatureGeorge/SIFTS_Plus_Muta_Maps
|
60f84e6024508e65ee3791103762b95666d3c646
|
[
"MIT"
] | null | null | null |
# @Created Date: 2019-11-24 09:07:07 pm
# @Filename: __init__.py
# @Email: 1730416009@stu.suda.edu.cn
# @Author: ZeFeng Zhu
# @Last Modified: 2019-12-23 04:23:51 pm
# @Copyright (c) 2019 MinghuiGroup, Soochow University
| 31.571429
| 54
| 0.714932
| 36
| 221
| 4.277778
| 0.861111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.219895
| 0.135747
| 221
| 6
| 55
| 36.833333
| 0.586387
| 0.941176
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
|
62a6cdcc5cf9bca5a11b6dc4e9f38e91015abe52
| 502
|
py
|
Python
|
cortex/export/__init__.py
|
mvdoc/pycortex
|
bc8a93cac9518e3c1cd89650c703f9f3814e805b
|
[
"BSD-2-Clause"
] | 423
|
2015-01-06T02:46:46.000Z
|
2022-03-23T17:20:38.000Z
|
cortex/export/__init__.py
|
mvdoc/pycortex
|
bc8a93cac9518e3c1cd89650c703f9f3814e805b
|
[
"BSD-2-Clause"
] | 243
|
2015-01-03T02:10:03.000Z
|
2022-03-31T19:29:48.000Z
|
cortex/export/__init__.py
|
mvdoc/pycortex
|
bc8a93cac9518e3c1cd89650c703f9f3814e805b
|
[
"BSD-2-Clause"
] | 136
|
2015-03-23T20:35:59.000Z
|
2022-03-09T13:39:10.000Z
|
from .save_views import save_3d_views
from .panels import plot_panels
from ._default_params import (
params_inflatedless_lateral_medial_ventral,
params_flatmap_lateral_medial,
params_occipital_triple_view,
params_inflated_dorsal_lateral_medial_ventral,
)
__all__ = [
"save_3d_views",
"plot_panels",
"params_flatmap_lateral_medial",
"params_occipital_triple_view",
"params_inflatedless_lateral_medial_ventral",
"params_inflated_dorsal_lateral_medial_ventral",
]
| 27.888889
| 52
| 0.804781
| 60
| 502
| 6.016667
| 0.333333
| 0.216066
| 0.221607
| 0.171745
| 0.714681
| 0.714681
| 0.315789
| 0.315789
| 0.315789
| 0
| 0
| 0.004608
| 0.135458
| 502
| 17
| 53
| 29.529412
| 0.827189
| 0
| 0
| 0
| 0
| 0
| 0.334661
| 0.286853
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.1875
| 0
| 0.1875
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
62bd6807be95587bd7a23aaac66d6f7511aacb65
| 156
|
py
|
Python
|
tensorflowonspark/__init__.py
|
DerekRen/TensorFlowOnSpark
|
52dda7b006f2dd0d98f0cc5d362de555263623fd
|
[
"Apache-2.0"
] | 1
|
2020-11-06T08:30:30.000Z
|
2020-11-06T08:30:30.000Z
|
tensorflowonspark/__init__.py
|
DerekRen/TensorFlowOnSpark
|
52dda7b006f2dd0d98f0cc5d362de555263623fd
|
[
"Apache-2.0"
] | null | null | null |
tensorflowonspark/__init__.py
|
DerekRen/TensorFlowOnSpark
|
52dda7b006f2dd0d98f0cc5d362de555263623fd
|
[
"Apache-2.0"
] | null | null | null |
import logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s (%(threadName)s-%(process)d) %(message)s")
__version__ = "2.2.0"
| 26
| 116
| 0.717949
| 22
| 156
| 4.909091
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.020833
| 0.076923
| 156
| 5
| 117
| 31.2
| 0.729167
| 0
| 0
| 0
| 0
| 0.333333
| 0.455128
| 0.179487
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
62dd4a508db411e5b7ff314613aafdeaeb5656d2
| 376
|
py
|
Python
|
muon/__init__.py
|
WeilerP/muon
|
8e0988f07ae23be4fa913bb297ef059e5ab702a0
|
[
"BSD-3-Clause"
] | null | null | null |
muon/__init__.py
|
WeilerP/muon
|
8e0988f07ae23be4fa913bb297ef059e5ab702a0
|
[
"BSD-3-Clause"
] | null | null | null |
muon/__init__.py
|
WeilerP/muon
|
8e0988f07ae23be4fa913bb297ef059e5ab702a0
|
[
"BSD-3-Clause"
] | null | null | null |
"""Multimodal omics analysis framework"""
from ._core.mudata import MuData
from ._core import preproc as pp
from ._core import tools as tl
from ._core import plot as pl
from ._core import utils
from ._core.io import *
from ._core.config import set_options
from . import atac
from . import prot
__version__ = "0.1.0"
__mudataversion__ = "0.1.0"
__anndataversion__ = "0.1.0"
| 22.117647
| 41
| 0.755319
| 59
| 376
| 4.474576
| 0.457627
| 0.212121
| 0.212121
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.028302
| 0.154255
| 376
| 16
| 42
| 23.5
| 0.801887
| 0.093085
| 0
| 0
| 0
| 0
| 0.044776
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 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
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
1a018ecb1b4832d82200c28fb3048b3345de111f
| 33
|
py
|
Python
|
gmocoin/__init__.py
|
makotookamura/GmoCoin
|
025d3e68364bf52418dbc3445987ff21528db732
|
[
"Apache-2.0"
] | null | null | null |
gmocoin/__init__.py
|
makotookamura/GmoCoin
|
025d3e68364bf52418dbc3445987ff21528db732
|
[
"Apache-2.0"
] | null | null | null |
gmocoin/__init__.py
|
makotookamura/GmoCoin
|
025d3e68364bf52418dbc3445987ff21528db732
|
[
"Apache-2.0"
] | 1
|
2021-07-17T16:56:03.000Z
|
2021-07-17T16:56:03.000Z
|
#!python3
__version__ = '0.0.12'
| 11
| 22
| 0.666667
| 5
| 33
| 3.6
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.172414
| 0.121212
| 33
| 2
| 23
| 16.5
| 0.448276
| 0.242424
| 0
| 0
| 0
| 0
| 0.25
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
1a11560f409eb43a0ed24b3b54e89719dbd21b76
| 171
|
py
|
Python
|
Theseus/Tests/__init__.py
|
amias-iohk/theseus
|
88d9294721e3bbbb756b983f55df6d669e632da4
|
[
"MIT"
] | 4
|
2018-08-08T07:11:29.000Z
|
2018-11-08T02:43:11.000Z
|
Theseus/Tests/__init__.py
|
amias-iohk/theseus
|
88d9294721e3bbbb756b983f55df6d669e632da4
|
[
"MIT"
] | null | null | null |
Theseus/Tests/__init__.py
|
amias-iohk/theseus
|
88d9294721e3bbbb756b983f55df6d669e632da4
|
[
"MIT"
] | 3
|
2018-10-18T13:42:24.000Z
|
2021-01-20T15:21:25.000Z
|
__author__ = 'Amias Channer <amias.channer@iohk.io> for IOHK'
__doc__ = 'Daedalus Testing functions'
from .Cardano import *
from .Daedalus import *
from .Common import *
| 24.428571
| 61
| 0.754386
| 22
| 171
| 5.5
| 0.636364
| 0.198347
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146199
| 171
| 6
| 62
| 28.5
| 0.828767
| 0
| 0
| 0
| 0
| 0
| 0.421053
| 0.134503
| 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
|
1a12b43b837e725bb85bfe8e14b6c166c2be8e99
| 691
|
py
|
Python
|
model/sample/adg.py
|
sdy99/PowerAI
|
ef40bacddbad72322e3e423417ae13d478d56a6d
|
[
"MIT"
] | 7
|
2020-04-11T03:28:50.000Z
|
2021-03-29T14:53:36.000Z
|
model/sample/adg.py
|
sdy99/PowerAI
|
ef40bacddbad72322e3e423417ae13d478d56a6d
|
[
"MIT"
] | null | null | null |
model/sample/adg.py
|
sdy99/PowerAI
|
ef40bacddbad72322e3e423417ae13d478d56a6d
|
[
"MIT"
] | 5
|
2020-04-11T03:28:52.000Z
|
2021-11-27T05:23:12.000Z
|
# coding: gbk
"""
@author: sdy
@email: sdy@epri.sgcc.com.cn
Abstract distribution and generation class
"""
class ADG(object):
def __init__(self, work_path, fmt):
self.work_path = work_path
self.fmt = fmt
self.features = None
self.mode = 'all'
def distribution_assess(self):
raise NotImplementedError
def generate_all(self):
raise NotImplementedError
def choose_samples(self, size):
raise NotImplementedError
def generate_one(self, power, idx, out_path):
raise NotImplementedError
def remove_samples(self):
raise NotImplementedError
def done(self):
raise NotImplementedError
| 20.323529
| 49
| 0.662808
| 78
| 691
| 5.705128
| 0.5
| 0.323596
| 0.303371
| 0.208989
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.256151
| 691
| 33
| 50
| 20.939394
| 0.865759
| 0.141823
| 0
| 0.333333
| 0
| 0
| 0.005128
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.388889
| false
| 0
| 0
| 0
| 0.444444
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
a7de746c56c67620e56b1437e51a6c5e5965554a
| 1,102
|
py
|
Python
|
rssfly/tests/common.py
|
lidavidm/rssfly
|
1cfb893a249e4095412b966a1bf50fc3de7744e7
|
[
"Apache-2.0"
] | 1
|
2021-02-14T03:44:35.000Z
|
2021-02-14T03:44:35.000Z
|
rssfly/tests/common.py
|
lidavidm/rssfly
|
1cfb893a249e4095412b966a1bf50fc3de7744e7
|
[
"Apache-2.0"
] | 6
|
2021-07-15T13:03:19.000Z
|
2022-03-26T14:14:14.000Z
|
rssfly/tests/common.py
|
lidavidm/rssfly
|
1cfb893a249e4095412b966a1bf50fc3de7744e7
|
[
"Apache-2.0"
] | null | null | null |
# Copyright 2021 David Li
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from pathlib import Path
from typing import Dict
class FakeContext:
def __init__(self, urls: Dict[str, str]):
self._urls = urls
def get_text(self, url, **kwargs):
# TODO: raise proper error
return self._urls[url]
def get_bytes(self, url, **kwargs):
# TODO: raise proper error
return self._urls[url]
def get_test_data(path: str) -> str:
root = Path(os.environ.get("RSSFLY_TEST_DATA_ROOT", ".")) / path
with root.open("rb") as f:
return f.read()
| 29.783784
| 74
| 0.696915
| 166
| 1,102
| 4.542169
| 0.578313
| 0.079576
| 0.034483
| 0.04244
| 0.148541
| 0.148541
| 0.148541
| 0.148541
| 0.148541
| 0.148541
| 0
| 0.009206
| 0.211434
| 1,102
| 36
| 75
| 30.611111
| 0.858458
| 0.540835
| 0
| 0.142857
| 0
| 0
| 0.04898
| 0.042857
| 0
| 0
| 0
| 0.027778
| 0
| 1
| 0.285714
| false
| 0
| 0.214286
| 0.142857
| 0.785714
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
a7f04cab3ce9aa87269ec6d3083f5676dec9b76a
| 421
|
py
|
Python
|
Algorithm/Mathematical/453. Minimum Moves to Equal Array Elements.py
|
smsubham/Data-Structure-Algorithms-Questions
|
45da68231907068ef4e4a0444ffdac69b337fa7c
|
[
"Apache-2.0"
] | null | null | null |
Algorithm/Mathematical/453. Minimum Moves to Equal Array Elements.py
|
smsubham/Data-Structure-Algorithms-Questions
|
45da68231907068ef4e4a0444ffdac69b337fa7c
|
[
"Apache-2.0"
] | null | null | null |
Algorithm/Mathematical/453. Minimum Moves to Equal Array Elements.py
|
smsubham/Data-Structure-Algorithms-Questions
|
45da68231907068ef4e4a0444ffdac69b337fa7c
|
[
"Apache-2.0"
] | null | null | null |
# https://leetcode.com/problems/minimum-moves-to-equal-array-elements/
# Explanation: https://leetcode.com/problems/minimum-moves-to-equal-array-elements/discuss/93817/It-is-a-math-question
# Source: https://leetcode.com/problems/minimum-moves-to-equal-array-elements/discuss/272994/Python-Greedy-Sum-Min*Len
class Solution:
def minMoves(self, nums: List[int]) -> int:
return sum(nums) - min(nums)*len(nums)
| 60.142857
| 118
| 0.752969
| 62
| 421
| 5.112903
| 0.548387
| 0.123028
| 0.15142
| 0.227129
| 0.574132
| 0.574132
| 0.574132
| 0.574132
| 0.574132
| 0.574132
| 0
| 0.028351
| 0.078385
| 421
| 7
| 119
| 60.142857
| 0.78866
| 0.71734
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 4
|
a7fa41d77e47cb4e42dcb175ead24d162418cceb
| 363
|
py
|
Python
|
Python Backend/diarization/build/lib/s4d/__init__.py
|
AdityaK1211/Final_Year_Project_SCET
|
1a6092e1345dad473375ada787fb5cb00ee7515f
|
[
"MIT"
] | 1
|
2022-02-15T02:49:22.000Z
|
2022-02-15T02:49:22.000Z
|
Python Backend/diarization/build/lib/s4d/__init__.py
|
AdityaK1211/Final_Year_Project_SCET
|
1a6092e1345dad473375ada787fb5cb00ee7515f
|
[
"MIT"
] | null | null | null |
Python Backend/diarization/build/lib/s4d/__init__.py
|
AdityaK1211/Final_Year_Project_SCET
|
1a6092e1345dad473375ada787fb5cb00ee7515f
|
[
"MIT"
] | 2
|
2021-07-11T12:42:43.000Z
|
2022-02-15T02:49:24.000Z
|
__author__ = 'meignier'
import s4d.clustering.hac_bic
import s4d.clustering.hac_clr
import s4d.clustering.hac_iv
import s4d.clustering.hac_utils
import s4d.model_iv
from s4d.clustering.cc_iv import ConnectedComponent
from s4d.diar import Diar
from s4d.segmentation import sanity_check, bic_linear, div_gauss
from s4d.viterbi import Viterbi
__version__ = "0.0.1"
| 27.923077
| 64
| 0.837466
| 57
| 363
| 5.035088
| 0.438596
| 0.156794
| 0.264808
| 0.30662
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.036585
| 0.096419
| 363
| 13
| 65
| 27.923077
| 0.838415
| 0
| 0
| 0
| 0
| 0
| 0.035714
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.818182
| 0
| 0.818182
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c50ac3b029d23e93f95a2998c1cb8c9b33f3b8ee
| 294
|
py
|
Python
|
core/middleware/scheduler.py
|
jiangxuewen16/hq-crawler
|
f03ec1e454513307e335943f224f4d927eaf2bbf
|
[
"MIT"
] | 1
|
2021-02-25T08:33:40.000Z
|
2021-02-25T08:33:40.000Z
|
core/middleware/scheduler.py
|
jiangxuewen16/hq-crawler
|
f03ec1e454513307e335943f224f4d927eaf2bbf
|
[
"MIT"
] | null | null | null |
core/middleware/scheduler.py
|
jiangxuewen16/hq-crawler
|
f03ec1e454513307e335943f224f4d927eaf2bbf
|
[
"MIT"
] | 2
|
2021-03-08T07:25:16.000Z
|
2021-12-07T15:28:02.000Z
|
from django.utils.deprecation import MiddlewareMixin
from django.utils.autoreload import logger
class Scheduler(MiddlewareMixin):
def process_request(self, request):
pass
# logger.info(request)
def process_response(self, request, response):
return response
| 21
| 52
| 0.731293
| 32
| 294
| 6.65625
| 0.5625
| 0.093897
| 0.140845
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.20068
| 294
| 13
| 53
| 22.615385
| 0.906383
| 0.068027
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0.142857
| 0.285714
| 0.142857
| 0.857143
| 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
|
c522238afd1828d1190c7360573f7b8dc442a5a0
| 1,537
|
py
|
Python
|
SourceWatch/buffer.py
|
spezifanta/SourceWatch
|
aaf2cf1ba00015947689181daf77b80bde9b4feb
|
[
"MIT"
] | 6
|
2019-07-09T19:40:01.000Z
|
2022-01-24T12:01:37.000Z
|
SourceWatch/buffer.py
|
spezifanta/SourceWatch
|
aaf2cf1ba00015947689181daf77b80bde9b4feb
|
[
"MIT"
] | null | null | null |
SourceWatch/buffer.py
|
spezifanta/SourceWatch
|
aaf2cf1ba00015947689181daf77b80bde9b4feb
|
[
"MIT"
] | 1
|
2020-11-07T13:06:58.000Z
|
2020-11-07T13:06:58.000Z
|
import io
import struct
class SteamPacketBuffer(io.BytesIO):
"""In-memory byte buffer."""
def __len__(self):
return len(self.getvalue())
def __repr__(self):
return '<PacketBuffer: {}: {}>'.format(len(self), self.getvalue())
def __str__(self):
return str(self.getvalue())
def read_byte(self):
return struct.unpack('<B', self.read(1))[0]
def write_byte(self, value):
self.write(struct.pack('<B', value))
def read_short(self):
return struct.unpack('<h', self.read(2))[0]
def write_short(self, value):
self.write(struct.pack('<h', value))
def read_float(self):
return struct.unpack('<f', self.read(4))[0]
def write_float(self, value):
self.write(struct.pack('<f', value))
def read_long(self):
return struct.unpack('<l', self.read(4))[0]
def write_long(self, value):
self.write(struct.pack('<l', value))
def read_long_long(self):
return struct.unpack('<Q', self.read(8))[0]
def write_long_long(self, value):
self.write(struct.pack('<Q', value))
def read_string(self):
# TODO: find a more pythonic way doing this
value = []
while True:
char = self.read(1)
if char == b'\x00':
break
else:
value.append(char)
return ''.join(map(lambda char: chr(ord(char)), value))
def write_string(self, value):
self.write(bytearray('{0}\x00'.format(value), 'utf-8'))
| 25.616667
| 74
| 0.573845
| 204
| 1,537
| 4.196078
| 0.29902
| 0.093458
| 0.091122
| 0.126168
| 0.275701
| 0.214953
| 0.074766
| 0
| 0
| 0
| 0
| 0.014991
| 0.262199
| 1,537
| 59
| 75
| 26.050847
| 0.739859
| 0.04229
| 0
| 0
| 0
| 0
| 0.039563
| 0
| 0
| 0
| 0
| 0.016949
| 0
| 1
| 0.375
| false
| 0
| 0.05
| 0.2
| 0.675
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 4
|
c53ebab62d8ce95d55ec92330a072c34d445b216
| 296
|
py
|
Python
|
tests/polynomials.py
|
mernst/cozy
|
d7b2c0ee575057dea4ebec201d579f0ecd785b1b
|
[
"Apache-2.0"
] | 188
|
2017-11-27T18:59:34.000Z
|
2021-12-31T02:28:33.000Z
|
tests/polynomials.py
|
mernst/cozy
|
d7b2c0ee575057dea4ebec201d579f0ecd785b1b
|
[
"Apache-2.0"
] | 95
|
2017-11-13T01:21:48.000Z
|
2020-10-30T06:38:14.000Z
|
tests/polynomials.py
|
mernst/cozy
|
d7b2c0ee575057dea4ebec201d579f0ecd785b1b
|
[
"Apache-2.0"
] | 16
|
2018-02-13T04:49:09.000Z
|
2021-02-06T13:26:46.000Z
|
import unittest
from cozy.polynomials import Polynomial
class TestPolynomials(unittest.TestCase):
def test_sorting(self):
self.assertLess(Polynomial([2019, 944, 95]), Polynomial([2012, 945, 95]))
self.assertGreater(Polynomial([2012, 945, 95]), Polynomial([2019, 944, 95]))
| 29.6
| 84
| 0.712838
| 35
| 296
| 6
| 0.571429
| 0.133333
| 0.161905
| 0.180952
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.143426
| 0.152027
| 296
| 9
| 85
| 32.888889
| 0.693227
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.166667
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
c55a6c83c0c4deda47ef169a2a79ced739a7f4c8
| 106
|
py
|
Python
|
src/invoice_medicine/apps.py
|
vandana0608/Pharmacy-Managament
|
f99bdec11c24027a432858daa19247a21cecc092
|
[
"bzip2-1.0.6"
] | null | null | null |
src/invoice_medicine/apps.py
|
vandana0608/Pharmacy-Managament
|
f99bdec11c24027a432858daa19247a21cecc092
|
[
"bzip2-1.0.6"
] | null | null | null |
src/invoice_medicine/apps.py
|
vandana0608/Pharmacy-Managament
|
f99bdec11c24027a432858daa19247a21cecc092
|
[
"bzip2-1.0.6"
] | null | null | null |
from django.apps import AppConfig
class InvoiceMedicineConfig(AppConfig):
name = 'invoice_medicine'
| 17.666667
| 39
| 0.792453
| 11
| 106
| 7.545455
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141509
| 106
| 5
| 40
| 21.2
| 0.912088
| 0
| 0
| 0
| 0
| 0
| 0.150943
| 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
|
c570fd6a05953760ae560c4fbed0f8ac9f2fd02d
| 100
|
py
|
Python
|
src/cattrs/errors.py
|
aha79/cattrs
|
50ba769c8349f5891b157d2bb7f06602822ac0a3
|
[
"MIT"
] | null | null | null |
src/cattrs/errors.py
|
aha79/cattrs
|
50ba769c8349f5891b157d2bb7f06602822ac0a3
|
[
"MIT"
] | null | null | null |
src/cattrs/errors.py
|
aha79/cattrs
|
50ba769c8349f5891b157d2bb7f06602822ac0a3
|
[
"MIT"
] | null | null | null |
from cattr.errors import StructureHandlerNotFoundError
__all__ = ["StructureHandlerNotFoundError"]
| 25
| 54
| 0.86
| 7
| 100
| 11.714286
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.08
| 100
| 3
| 55
| 33.333333
| 0.891304
| 0
| 0
| 0
| 0
| 0
| 0.29
| 0.29
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
3dfe1030cd691567d0eb0ceab815ccdf039f3393
| 269
|
py
|
Python
|
python-crypt-service/services/dbservice.py
|
Shirish-Singh/crypt-analysis
|
eed6d00925389ee0973733e6b7397cd460f97f99
|
[
"Apache-2.0"
] | null | null | null |
python-crypt-service/services/dbservice.py
|
Shirish-Singh/crypt-analysis
|
eed6d00925389ee0973733e6b7397cd460f97f99
|
[
"Apache-2.0"
] | null | null | null |
python-crypt-service/services/dbservice.py
|
Shirish-Singh/crypt-analysis
|
eed6d00925389ee0973733e6b7397cd460f97f99
|
[
"Apache-2.0"
] | null | null | null |
from __future__ import print_function
from configurations import configuration
from pymongo import MongoClient
MONGO_HOST= configuration.MONGO_HOST
client = MongoClient(MONGO_HOST)
class DBConnection():
def getConnection(self):
return client.analyticsDB
| 20.692308
| 40
| 0.814126
| 30
| 269
| 7.033333
| 0.633333
| 0.127962
| 0.189573
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.141264
| 269
| 12
| 41
| 22.416667
| 0.91342
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.125
| false
| 0
| 0.375
| 0.125
| 0.75
| 0.125
| 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
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
9a91a0bb1c2222107ec4d2fbb68724bb0b797301
| 247
|
py
|
Python
|
paperplane/backends/click/choice.py
|
abhilash1in/paperplane
|
1dfda182dc8a70fe08fa2284ea63b434246c394b
|
[
"MIT"
] | null | null | null |
paperplane/backends/click/choice.py
|
abhilash1in/paperplane
|
1dfda182dc8a70fe08fa2284ea63b434246c394b
|
[
"MIT"
] | null | null | null |
paperplane/backends/click/choice.py
|
abhilash1in/paperplane
|
1dfda182dc8a70fe08fa2284ea63b434246c394b
|
[
"MIT"
] | null | null | null |
import click
from typing import Any, Optional
from paperplane.backends.click import _prompt
def run(prompt: str, choices: list, default: Optional[Any] = None):
return _prompt(text=prompt, default=default, type=click.Choice(choices=choices))
| 30.875
| 84
| 0.777328
| 34
| 247
| 5.588235
| 0.588235
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121457
| 247
| 7
| 85
| 35.285714
| 0.875576
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0
| 0.6
| 0.2
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
|
0
| 4
|
9aa8e28e915cdb48539530ca48ffdc1fa280bc82
| 140
|
py
|
Python
|
setup.py
|
adrienbrunet/mixt
|
d725ec752ce430d135e993bc988bfdf2b8457c4b
|
[
"MIT"
] | 27
|
2018-06-04T19:11:42.000Z
|
2022-02-23T22:46:39.000Z
|
setup.py
|
adrienbrunet/mixt
|
d725ec752ce430d135e993bc988bfdf2b8457c4b
|
[
"MIT"
] | 7
|
2018-06-09T15:27:51.000Z
|
2021-03-11T20:00:35.000Z
|
setup.py
|
adrienbrunet/mixt
|
d725ec752ce430d135e993bc988bfdf2b8457c4b
|
[
"MIT"
] | 3
|
2018-07-29T10:20:02.000Z
|
2021-11-18T19:55:07.000Z
|
#!/usr/bin/env python
"""Setup file for the ``mixt`` module. Configuration is in ``setup.cfg``."""
from setuptools import setup
setup()
| 15.555556
| 76
| 0.678571
| 20
| 140
| 4.75
| 0.85
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15
| 140
| 8
| 77
| 17.5
| 0.798319
| 0.65
| 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
|
9aaf20b86321deb4ac2d2c3951af5c3c52764470
| 115
|
py
|
Python
|
rplint/__main__.py
|
lpozo/rplint
|
907cb5342827b2c38e79721bc2dc99b3b6f7912b
|
[
"MIT"
] | 7
|
2020-09-10T15:39:07.000Z
|
2021-02-15T17:45:04.000Z
|
rplint/__main__.py
|
lpozo/rplint
|
907cb5342827b2c38e79721bc2dc99b3b6f7912b
|
[
"MIT"
] | 6
|
2020-11-11T02:42:37.000Z
|
2021-03-17T01:00:27.000Z
|
rplint/__main__.py
|
lpozo/rplint
|
907cb5342827b2c38e79721bc2dc99b3b6f7912b
|
[
"MIT"
] | 3
|
2020-11-11T02:10:22.000Z
|
2020-12-12T01:02:29.000Z
|
#!/usr/bin/env python3
from .main import rplint
if __name__ == "__main__":
rplint.main(prog_name=__package__)
| 19.166667
| 38
| 0.730435
| 16
| 115
| 4.4375
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010101
| 0.13913
| 115
| 5
| 39
| 23
| 0.707071
| 0.182609
| 0
| 0
| 0
| 0
| 0.086022
| 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
|
9ac1c767370071e77aa1a0a522794a49b7886db3
| 205
|
py
|
Python
|
python/test/is_prime.test.py
|
hotate29/kyopro_lib
|
20085381372d2555439980c79887ca6b0809bb77
|
[
"MIT"
] | null | null | null |
python/test/is_prime.test.py
|
hotate29/kyopro_lib
|
20085381372d2555439980c79887ca6b0809bb77
|
[
"MIT"
] | 2
|
2020-10-13T17:02:12.000Z
|
2020-10-17T16:04:48.000Z
|
python/test/is_prime.test.py
|
hotate29/kyopro_lib
|
20085381372d2555439980c79887ca6b0809bb77
|
[
"MIT"
] | null | null | null |
# verification-helper: PROBLEM http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C
from python.lib.is_prime import isprime
print(sum(isprime(int(input())) for _ in range(int(input()))))
| 25.625
| 97
| 0.756098
| 33
| 205
| 4.575758
| 0.909091
| 0.10596
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.010638
| 0.082927
| 205
| 7
| 98
| 29.285714
| 0.792553
| 0.463415
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 4
|
9acd4db9f55911f16eb79b057e6fc8abf0b3c6d4
| 210
|
py
|
Python
|
resident/views.py
|
felipeue/SmartBuilding
|
57d904c6166c87f836bc8fada9eb5a2bc82069b8
|
[
"MIT"
] | null | null | null |
resident/views.py
|
felipeue/SmartBuilding
|
57d904c6166c87f836bc8fada9eb5a2bc82069b8
|
[
"MIT"
] | null | null | null |
resident/views.py
|
felipeue/SmartBuilding
|
57d904c6166c87f836bc8fada9eb5a2bc82069b8
|
[
"MIT"
] | null | null | null |
from django.views.generic import TemplateView
from main.permissions import ResidentLoginRequiredMixin
class DashboardView(ResidentLoginRequiredMixin, TemplateView):
template_name = "index_dashboard.html"
| 30
| 62
| 0.852381
| 20
| 210
| 8.85
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 210
| 6
| 63
| 35
| 0.931579
| 0
| 0
| 0
| 0
| 0
| 0.095238
| 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
|
9ae1bc0d9c8249afc93cd2e786ee58fa70373ce4
| 2,544
|
py
|
Python
|
tests/importing/test_read_genes.py
|
EKingma/Transposonmapper
|
1413bda16a0bd5f5f3ccf84d86193c2dba0ab01b
|
[
"Apache-2.0"
] | 2
|
2021-11-23T09:39:35.000Z
|
2022-01-25T15:49:45.000Z
|
tests/importing/test_read_genes.py
|
EKingma/Transposonmapper
|
1413bda16a0bd5f5f3ccf84d86193c2dba0ab01b
|
[
"Apache-2.0"
] | 76
|
2021-07-07T18:31:44.000Z
|
2022-03-22T10:04:40.000Z
|
tests/importing/test_read_genes.py
|
EKingma/Transposonmapper
|
1413bda16a0bd5f5f3ccf84d86193c2dba0ab01b
|
[
"Apache-2.0"
] | 2
|
2021-09-16T10:56:20.000Z
|
2022-01-25T12:33:25.000Z
|
from transposonmapper.importing import (
load_default_files,read_genes
)
def test_output_format():
a,b,c=load_default_files(gff_file=None,essentials_file=None,gene_names_file=None)
a_0,b_0,c_0=read_genes(gff_file=a,essentials_file=b,gene_names_file=c)
assert type(a_0)==dict, "the gene coordinates have to be a dict"
assert type(b_0)==dict, "the gene coordinates have to be a dict"
assert type(c_0)==dict, "the gene coordinates have to be a dict"
def test_output_length():
a,b,c=load_default_files(gff_file=None,essentials_file=None,gene_names_file=None)
a_0,b_0,c_0=read_genes(gff_file=a,essentials_file=b,gene_names_file=c)
assert len(a_0)>=6600, "the total number of genes should not be less than 6600"
assert len(b_0)<6600, "the total number of essential genes should not be more than the number of genes"
assert len(c_0)>=6600, "the total number of genes should not be less than 6600"
def test_output_content_gff():
a,b,c=load_default_files(gff_file=None,essentials_file=None,gene_names_file=None)
a_0,b_0,c_0=read_genes(gff_file=a,essentials_file=b,gene_names_file=c)
#read the first value of the dict
first_value=next(iter(a_0.values()))
# read the first key
first_key=next(iter(a_0))
assert first_value==['I', 335, 649, '+'], "The first value of the gene coordinates is wrong"
assert first_key== 'YAL069W', "The first gene in the array should be YAL069W"
def test_output_content_essentials():
a,b,c=load_default_files(gff_file=None,essentials_file=None,gene_names_file=None)
a_0,b_0,c_0=read_genes(gff_file=a,essentials_file=b,gene_names_file=c)
#read the first value of the dict
first_value=next(iter(b_0.values()))
# read the first key
first_key=next(iter(b_0))
assert first_value==['I', 147594, 151166, '-'], "The first value of the gene coordinates is wrong"
assert first_key== 'YAL001C', "The first gene in the array should be YAL001C"
def test_output_content_names():
a,b,c=load_default_files(gff_file=None,essentials_file=None,gene_names_file=None)
a_0,b_0,c_0=read_genes(gff_file=a,essentials_file=b,gene_names_file=c)
#read the first value of the dict
first_value=next(iter(c_0.values()))
# read the first key
first_key=next(iter(c_0))
assert first_value==['AAC1'], "The first value of the gene names is wrong"
assert first_key== 'YMR056C', "The first gene in the array should be YMR056C"
| 39.138462
| 107
| 0.717374
| 447
| 2,544
| 3.836689
| 0.14094
| 0.069971
| 0.075802
| 0.052478
| 0.797085
| 0.763848
| 0.738776
| 0.738776
| 0.686297
| 0.686297
| 0
| 0.040191
| 0.178459
| 2,544
| 65
| 108
| 39.138462
| 0.780383
| 0.060142
| 0
| 0.277778
| 0
| 0
| 0.25283
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 1
| 0.138889
| false
| 0
| 0.027778
| 0
| 0.166667
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
9aff8c7e14210fed3124a5e6c2fdfe6fc51837d4
| 58
|
py
|
Python
|
contest/abc106/A.py
|
mola1129/atcoder
|
1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db
|
[
"MIT"
] | null | null | null |
contest/abc106/A.py
|
mola1129/atcoder
|
1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db
|
[
"MIT"
] | null | null | null |
contest/abc106/A.py
|
mola1129/atcoder
|
1d3b18cb92d0ba18c41172f49bfcd0dd8d29f9db
|
[
"MIT"
] | null | null | null |
A, B = map(int, input().split())
print((A - 1) * (B - 1))
| 19.333333
| 32
| 0.465517
| 11
| 58
| 2.454545
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.043478
| 0.206897
| 58
| 2
| 33
| 29
| 0.543478
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
b114d5a538b75c9a4b75747db2d55272076b7fcc
| 232
|
py
|
Python
|
oldcontrib/media/image/servee_registry.py
|
servee/django-servee-oldcontrib
|
836447ebbd53db0b53879a35468c02e57f65105f
|
[
"BSD-Source-Code"
] | null | null | null |
oldcontrib/media/image/servee_registry.py
|
servee/django-servee-oldcontrib
|
836447ebbd53db0b53879a35468c02e57f65105f
|
[
"BSD-Source-Code"
] | null | null | null |
oldcontrib/media/image/servee_registry.py
|
servee/django-servee-oldcontrib
|
836447ebbd53db0b53879a35468c02e57f65105f
|
[
"BSD-Source-Code"
] | null | null | null |
from servee import frontendadmin
from servee.frontendadmin.insert import ModelInsert
from oldcontrib.media.image.models import Image
class ImageInsert(ModelInsert):
model = Image
frontendadmin.site.register_insert(ImageInsert)
| 29
| 51
| 0.844828
| 27
| 232
| 7.222222
| 0.555556
| 0.102564
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.099138
| 232
| 8
| 52
| 29
| 0.933014
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.833333
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 4
|
b12709adc431ec818c3f1dc683d016b6ef1c240b
| 508
|
py
|
Python
|
mamba/exceptions.py
|
bmintz/mamba-lang
|
f63e205dc4de5e8ba3308e2b47b1675a9b508e70
|
[
"MIT"
] | 20
|
2015-01-15T19:40:33.000Z
|
2021-09-22T15:26:27.000Z
|
mamba/exceptions.py
|
bmintz/mamba-lang
|
f63e205dc4de5e8ba3308e2b47b1675a9b508e70
|
[
"MIT"
] | 3
|
2015-03-25T21:53:48.000Z
|
2017-05-07T12:22:20.000Z
|
mamba/exceptions.py
|
bmintz/mamba-lang
|
f63e205dc4de5e8ba3308e2b47b1675a9b508e70
|
[
"MIT"
] | 11
|
2017-09-15T21:41:04.000Z
|
2021-09-22T15:15:58.000Z
|
class InterpreterException(Exception):
def __init__(self, message):
self.message = message
def __str__(self):
return self.message
class SymbolNotFound(InterpreterException):
pass
class UnexpectedCharacter(InterpreterException):
pass
class ParserSyntaxError(InterpreterException):
pass
class DuplicateSymbol(InterpreterException):
pass
class InterpreterRuntimeError(InterpreterException):
pass
class InvalidParamCount(InterpreterRuntimeError):
pass
| 16.933333
| 52
| 0.761811
| 40
| 508
| 9.475
| 0.4
| 0.316623
| 0.382586
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.177165
| 508
| 30
| 53
| 16.933333
| 0.906699
| 0
| 0
| 0.352941
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.117647
| false
| 0.352941
| 0
| 0.058824
| 0.588235
| 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
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 4
|
b1318eb081bf81d3b2433e9aac0b4bedfc511b35
| 186
|
py
|
Python
|
notes/notebook/apps.py
|
spam128/notes
|
100008b7e0a2afa5677c15826588105027f52883
|
[
"MIT"
] | null | null | null |
notes/notebook/apps.py
|
spam128/notes
|
100008b7e0a2afa5677c15826588105027f52883
|
[
"MIT"
] | null | null | null |
notes/notebook/apps.py
|
spam128/notes
|
100008b7e0a2afa5677c15826588105027f52883
|
[
"MIT"
] | null | null | null |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class NotebookConfig(AppConfig):
name = "notes.notebook"
verbose_name = _("Notebook")
| 20.666667
| 54
| 0.763441
| 22
| 186
| 6.272727
| 0.727273
| 0.144928
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.155914
| 186
| 8
| 55
| 23.25
| 0.878981
| 0
| 0
| 0
| 0
| 0
| 0.118919
| 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
|
b133ecf4dd2609e5dbd8da4502d3368bb3abe2c9
| 172
|
py
|
Python
|
test.py
|
uuidd/SimilarCharacter
|
22e5f4b0b2798d903435aeb989ff2d0a4ad59d70
|
[
"MIT"
] | 199
|
2019-09-09T08:44:19.000Z
|
2022-03-24T12:42:04.000Z
|
test.py
|
uuidd/SimilarCharacter
|
22e5f4b0b2798d903435aeb989ff2d0a4ad59d70
|
[
"MIT"
] | 4
|
2020-08-06T08:03:28.000Z
|
2022-01-06T15:14:36.000Z
|
test.py
|
uuidd/SimilarCharacter
|
22e5f4b0b2798d903435aeb989ff2d0a4ad59d70
|
[
"MIT"
] | 58
|
2019-10-10T06:56:43.000Z
|
2022-03-21T02:58:01.000Z
|
import cv2
import ProcessWithCV2
img1 = cv2.imread("D:/py/chinese/7.png")
img2 = cv2.imread("D:/py/chinese/8.png")
a = ProcessWithCV2.dHash(img1, img2, 1)
print(a)
| 21.5
| 41
| 0.686047
| 28
| 172
| 4.214286
| 0.571429
| 0.152542
| 0.169492
| 0.20339
| 0.322034
| 0
| 0
| 0
| 0
| 0
| 0
| 0.081081
| 0.139535
| 172
| 7
| 42
| 24.571429
| 0.716216
| 0
| 0
| 0
| 0
| 0
| 0.230303
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 0.166667
| 1
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b14a72da64d12a7c8066ba502beb5c9606168931
| 147
|
py
|
Python
|
Booleans/4.2.4 If/4.2.5 Fix the problem.py
|
ferrerinicolas/python_samples
|
107cead4fbee30b275a5e2be1257833129ce5e46
|
[
"MIT"
] | null | null | null |
Booleans/4.2.4 If/4.2.5 Fix the problem.py
|
ferrerinicolas/python_samples
|
107cead4fbee30b275a5e2be1257833129ce5e46
|
[
"MIT"
] | null | null | null |
Booleans/4.2.4 If/4.2.5 Fix the problem.py
|
ferrerinicolas/python_samples
|
107cead4fbee30b275a5e2be1257833129ce5e46
|
[
"MIT"
] | null | null | null |
can_juggle = True
# The code below has problems. See if
# you can fix them!
#if can_juggle print("I can juggle!")
#else
print("I can't juggle.")
| 16.333333
| 37
| 0.693878
| 27
| 147
| 3.703704
| 0.62963
| 0.27
| 0.18
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.183673
| 147
| 8
| 38
| 18.375
| 0.833333
| 0.632653
| 0
| 0
| 0
| 0
| 0.3125
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
|
0
| 4
|
b1542cd589e62fb7173b027c1b40c713b7897ca2
| 615
|
py
|
Python
|
sample_project/env/lib/python3.9/site-packages/qtpy/tests/test_qtprintsupport.py
|
Istiakmorsalin/ML-Data-Science
|
681e68059b146343ef55b0671432dc946970730d
|
[
"MIT"
] | 4
|
2021-11-19T03:25:13.000Z
|
2022-02-24T15:32:30.000Z
|
sample_project/env/lib/python3.9/site-packages/qtpy/tests/test_qtprintsupport.py
|
Istiakmorsalin/ML-Data-Science
|
681e68059b146343ef55b0671432dc946970730d
|
[
"MIT"
] | null | null | null |
sample_project/env/lib/python3.9/site-packages/qtpy/tests/test_qtprintsupport.py
|
Istiakmorsalin/ML-Data-Science
|
681e68059b146343ef55b0671432dc946970730d
|
[
"MIT"
] | 3
|
2020-08-04T02:48:32.000Z
|
2020-08-17T01:20:09.000Z
|
from __future__ import absolute_import
import pytest
from qtpy import QtPrintSupport
def test_qtprintsupport():
"""Test the qtpy.QtPrintSupport namespace"""
assert QtPrintSupport.QAbstractPrintDialog is not None
assert QtPrintSupport.QPageSetupDialog is not None
assert QtPrintSupport.QPrintDialog is not None
assert QtPrintSupport.QPrintPreviewDialog is not None
assert QtPrintSupport.QPrintEngine is not None
assert QtPrintSupport.QPrinter is not None
assert QtPrintSupport.QPrinterInfo is not None
assert QtPrintSupport.QPrintPreviewWidget is not None
| 32.368421
| 59
| 0.782114
| 67
| 615
| 7.089552
| 0.343284
| 0.336842
| 0.151579
| 0.221053
| 0.427368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188618
| 615
| 18
| 60
| 34.166667
| 0.951904
| 0.061789
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.666667
| 1
| 0.083333
| true
| 0
| 0.25
| 0
| 0.333333
| 0.083333
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b16bfa5767e1c86af8aeaefb5fff8896cc5aa5cc
| 1,523
|
py
|
Python
|
dxlnmapclient/constants.py
|
camilastock/opendxl-nmap-client-python
|
2221adcb154a412c14925935159afc67ed9ba7a5
|
[
"Apache-2.0"
] | null | null | null |
dxlnmapclient/constants.py
|
camilastock/opendxl-nmap-client-python
|
2221adcb154a412c14925935159afc67ed9ba7a5
|
[
"Apache-2.0"
] | null | null | null |
dxlnmapclient/constants.py
|
camilastock/opendxl-nmap-client-python
|
2221adcb154a412c14925935159afc67ed9ba7a5
|
[
"Apache-2.0"
] | 1
|
2018-02-12T18:20:18.000Z
|
2018-02-12T18:20:18.000Z
|
class DxlNmapOptions:
"""
Constants that are used to execute Nmap tool
+-------------+---------+----------------------------------------------------------+
| Option | Command | Description |
+=============+=========+==========================================================+
| Aggressive | -A | Aggressive Scan |
| Scan | | |
+-------------+---------+----------------------------------------------------------+
| Operating | -O | Operating system in the current host |
| System | | |
+-------------+---------+----------------------------------------------------------+
| Aggressive | -O - A | Both options |
| Scan | | |
| + | | |
| Operating | | |
| System | | |
+-------------+---------+----------------------------------------------------------+
"""
AGGRESSIVE_SCAN = "-A"
OPERATING_SYSTEM = "-O"
AGGRESSIVE_SCAN_OP_SYSTEM = "-O -A"
| 60.92
| 88
| 0.169402
| 47
| 1,523
| 5.382979
| 0.553191
| 0.166008
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.512147
| 1,523
| 24
| 89
| 63.458333
| 0.340511
| 0.86671
| 0
| 0
| 0
| 0
| 0.07377
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
|
0
| 4
|
b16c522c8657dbedfb8cc24e18349f5784c77002
| 8,203
|
py
|
Python
|
2019/intcode/intcode/tests/test_intcode.py
|
Ganon11/AdventCode
|
eebf3413c8e73c45d0e0a65a80e57eaf594baead
|
[
"MIT"
] | null | null | null |
2019/intcode/intcode/tests/test_intcode.py
|
Ganon11/AdventCode
|
eebf3413c8e73c45d0e0a65a80e57eaf594baead
|
[
"MIT"
] | null | null | null |
2019/intcode/intcode/tests/test_intcode.py
|
Ganon11/AdventCode
|
eebf3413c8e73c45d0e0a65a80e57eaf594baead
|
[
"MIT"
] | null | null | null |
import intcode
def test_default_constructor(): # pylint: disable=C0116
values = [0, 1, 2, 0, 99]
program = intcode.IntCodeProgram(values)
assert program.instruction_pointer == 0
assert program.memory == values
def test_noun_verb(): # pylint: disable=C0116
values = [0, 1, 2, 0, 99]
program = intcode.IntCodeProgram(values)
assert program.instruction_pointer == 0
assert program.memory == values
program.set_noun(7)
assert program.memory[1] == 7
program.set_verb(3)
assert program.memory[2] == 3
def test_from_text(): # pylint: disable=C0116
values = [0, 1, 2, 0, 99]
program = intcode.IntCodeProgram.from_text("0,1,2,0,99")
assert program.instruction_pointer == 0
assert program.memory == values
program2 = intcode.IntCodeProgram.from_text("0, 1, 2, 0, 99")
assert program2.instruction_pointer == 0
assert program2.memory == values
program3 = intcode.IntCodeProgram.from_text(" 0, 1 , 2 , 0, 99 ")
assert program3.instruction_pointer == 0
assert program3.memory == values
def test_execute_add(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1, 1, 2, 0, 99])
output = program.execute()
assert output == 3
assert program.instruction_pointer == 4
def test_execute_mul(): # pylint: disable=C0116
program = intcode.IntCodeProgram([2, 1, 2, 0, 99])
output = program.execute()
assert output == 2
assert program.instruction_pointer == 4
def test_execute_input(): # pylint: disable=C0116
values = [3, 0, 99]
program = intcode.IntCodeProgram(values, user_input=[77])
output = program.execute()
assert program.instruction_pointer == 2
assert program.memory[0] == 77
assert output == 77
program2 = intcode.IntCodeProgram(values, user_input=77)
output2 = program2.execute()
assert program2.instruction_pointer == 2
assert program2.memory[0] == 77
assert output2 == 77
def test_multiple_input(): # pylint: disable=C0116
values = [3, 0, 3, 1, 99]
program = intcode.IntCodeProgram(values, user_input=[1, 2])
output = program.execute()
assert program.instruction_pointer == 4
assert program.memory[0] == 1
assert program.memory[1] == 2
assert output == 1
program2 = intcode.IntCodeProgram(values, user_input=1)
program2.provide_input(2)
output2 = program2.execute()
assert program2.instruction_pointer == 4
assert program2.memory[0] == 1
assert program2.memory[1] == 2
assert output2 == 1
def test_execute_output(): # pylint: disable=C0116
program = intcode.IntCodeProgram([4, 0, 99])
output = program.execute()
assert program.instruction_pointer == 2
assert output == 4
assert len(program.output) == 1
assert 4 in program.output
def test_execute_output_immediate_mode(): # pylint: disable=C0116
program = intcode.IntCodeProgram([104, 50, 99])
output = program.execute()
assert program.instruction_pointer == 2
assert output == 104
assert len(program.output) == 1
assert 50 in program.output
def test_execute_multiple_output(): # pylint: disable=C0116
program = intcode.IntCodeProgram([4, 0, 104, 50, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 4
assert len(program.output) == 2
assert 4 in program.output
assert 50 in program.output
def test_execute_add_immediate_mode(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1101, 50, 60, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 110
def test_execute_add_mixed_modes(): # pylint: disable=C0116
program = intcode.IntCodeProgram([101, 50, 0, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 151
program = intcode.IntCodeProgram([1001, 0, 50, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 1051
def test_execute_mul_immediate_mode(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1102, 5, 6, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 30
def test_execute_mul_mixed_modes(): # pylint: disable=C0116
program = intcode.IntCodeProgram([102, 2, 0, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 204
program = intcode.IntCodeProgram([1002, 0, 2, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 2004
def test_execute_jump_if_true(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1105, 1, 7, 1102, 0, 0, 0, 99])
output = program.execute()
assert program.instruction_pointer == 7
assert output == 1105
program = intcode.IntCodeProgram([1105, 0, 7, 1102, 0, 0, 0, 99])
output = program.execute()
assert program.instruction_pointer == 7
assert output == 0
def test_execute_jump_if_false(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1106, 1, 7, 1102, 0, 0, 0, 99])
output = program.execute()
assert program.instruction_pointer == 7
assert output == 0
program = intcode.IntCodeProgram([1106, 0, 7, 1102, 0, 0, 0, 99])
output = program.execute()
assert program.instruction_pointer == 7
assert output == 1106
def test_execute_less_than(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1107, 1, 2, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 1
program = intcode.IntCodeProgram([1107, 2, 2, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 0
program = intcode.IntCodeProgram([1107, 2, 1, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 0
def test_execute_equals(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1108, 1, 2, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 0
program = intcode.IntCodeProgram([1108, 2, 2, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 1
program = intcode.IntCodeProgram([1108, 2, 1, 0, 99])
output = program.execute()
assert program.instruction_pointer == 4
assert output == 0
def test_step(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1108, 1, 2, 0, 1108, 2, 2, 0, 1108, 2, 1, 0, 99])
program.step()
assert not program.has_halted
assert program.instruction_pointer == 4
program.step()
assert not program.has_halted
assert program.instruction_pointer == 8
program.step()
assert not program.has_halted
assert program.instruction_pointer == 12
program.step()
assert program.has_halted
assert program.instruction_pointer == 12
def test_step_without_input_is_no_op(): # pylint: disable=C0116
program = intcode.IntCodeProgram([3, 1, 99])
program.step()
assert program.instruction_pointer == 0
assert not program.has_halted
program.provide_input(103)
program.step()
assert program.instruction_pointer == 2
assert not program.has_halted
program.step()
assert program.instruction_pointer == 2
assert program.has_halted
def test_execute_will_return_early_if_waiting_for_input(): # pylint: disable=C0116
program = intcode.IntCodeProgram([3, 1, 99])
program.execute()
assert not program.has_halted
assert program.instruction_pointer == 0
program.provide_input(103)
program.execute()
assert program.instruction_pointer == 2
assert program.has_halted
def test_update_relative_base(): # pylint: disable=C0116
program = intcode.IntCodeProgram([201, 2, 1, 17, 109, 17, 2201, 0, 0, 19, 99])
program.execute()
assert program.instruction_pointer == 10
assert program.has_halted
assert program._relative_base == 17 # pylint: disable=W0212
def test_increased_available_memory(): # pylint: disable=C0116
program = intcode.IntCodeProgram([1101, 1, 2, 17, 99])
program.execute()
assert len(program.memory) == 18
assert program.instruction_pointer == 4
assert program.has_halted
def test_reddit(): # pylint: disable=C0116
program = intcode.IntCodeProgram([109, 1, 203, 2, 204, 2, 99])
program.provide_input(77)
program.execute()
print(program)
print(program.output)
if __name__ == "__main__":
test_reddit()
| 31.30916
| 85
| 0.720224
| 1,098
| 8,203
| 5.24408
| 0.098361
| 0.115144
| 0.15422
| 0.199201
| 0.80462
| 0.784995
| 0.661167
| 0.589614
| 0.491316
| 0.417332
| 0
| 0.085174
| 0.161282
| 8,203
| 261
| 86
| 31.429119
| 0.751744
| 0.066927
| 0
| 0.528302
| 0
| 0
| 0.007997
| 0
| 0
| 0
| 0
| 0
| 0.466981
| 1
| 0.113208
| false
| 0
| 0.004717
| 0
| 0.117925
| 0.009434
| 0
| 0
| 0
| null | 0
| 0
| 1
| 1
| 1
| 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
|
b17454e4938df93dd6729a10260ca6df34c9564c
| 84
|
py
|
Python
|
scripts/python/make-dist-cfg.py
|
brakmic/cm3
|
b99e280eca00c322e04e0586951de50108e51343
|
[
"BSD-4-Clause-UC",
"BSD-4-Clause",
"BSD-3-Clause"
] | 2
|
2015-03-02T17:01:32.000Z
|
2021-12-29T14:34:46.000Z
|
scripts/python/make-dist-cfg.py
|
ganeshbabuNN/cm3
|
9fb432d44a2ba89575febb38f7c1eb3dca6a3879
|
[
"BSD-4-Clause-UC",
"BSD-4-Clause",
"BSD-3-Clause"
] | 1
|
2015-07-23T07:51:22.000Z
|
2015-07-23T07:51:22.000Z
|
scripts/python/make-dist-cfg.py
|
RodneyBates/M3Devel
|
7b8dd3fc8f5b05d1c69774d92234ea50d143a692
|
[
"BSD-4-Clause-UC",
"BSD-4-Clause"
] | 1
|
2021-12-29T14:35:47.000Z
|
2021-12-29T14:35:47.000Z
|
#! /usr/bin/env python
from pylib import *
CopyConfigForDistribution(InstallRoot)
| 14
| 38
| 0.785714
| 9
| 84
| 7.333333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.119048
| 84
| 5
| 39
| 16.8
| 0.891892
| 0.25
| 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
|
b1784fe113bca2d558cd14a80d284029cd03a532
| 92
|
py
|
Python
|
tests/samples/importing/nested/base.py
|
machinable-org/machinable
|
9d96e942dde05d68699bc7bc0c3d062ee18652ad
|
[
"MIT"
] | 23
|
2020-02-28T14:29:04.000Z
|
2021-12-23T20:50:54.000Z
|
tests/samples/importing/nested/base.py
|
machinable-org/machinable
|
9d96e942dde05d68699bc7bc0c3d062ee18652ad
|
[
"MIT"
] | 172
|
2020-02-24T12:12:11.000Z
|
2022-03-29T03:08:24.000Z
|
tests/samples/importing/nested/base.py
|
machinable-org/machinable
|
9d96e942dde05d68699bc7bc0c3d062ee18652ad
|
[
"MIT"
] | 1
|
2020-11-23T22:42:20.000Z
|
2020-11-23T22:42:20.000Z
|
from machinable import Component
class BaseComponent(Component):
"""Base component"""
| 15.333333
| 32
| 0.75
| 9
| 92
| 7.666667
| 0.777778
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.152174
| 92
| 5
| 33
| 18.4
| 0.884615
| 0.152174
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 4
|
b17998122b0c9414fb547e0a5c5bf8d5f8b4473a
| 63
|
py
|
Python
|
src/oscar/apps/customer/__init__.py
|
QueoLda/django-oscar
|
8dd992d82e31d26c929b3caa0e08b57e9701d097
|
[
"BSD-3-Clause"
] | 4,639
|
2015-01-01T00:42:33.000Z
|
2022-03-29T18:32:12.000Z
|
src/oscar/apps/customer/__init__.py
|
QueoLda/django-oscar
|
8dd992d82e31d26c929b3caa0e08b57e9701d097
|
[
"BSD-3-Clause"
] | 2,215
|
2015-01-02T22:32:51.000Z
|
2022-03-29T12:16:23.000Z
|
src/oscar/apps/customer/__init__.py
|
QueoLda/django-oscar
|
8dd992d82e31d26c929b3caa0e08b57e9701d097
|
[
"BSD-3-Clause"
] | 2,187
|
2015-01-02T06:33:31.000Z
|
2022-03-31T15:32:36.000Z
|
default_app_config = 'oscar.apps.customer.apps.CustomerConfig'
| 31.5
| 62
| 0.84127
| 8
| 63
| 6.375
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047619
| 63
| 1
| 63
| 63
| 0.85
| 0
| 0
| 0
| 0
| 0
| 0.619048
| 0.619048
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b17eab4940677c2202b0aa8a880f82fca874b795
| 2,732
|
py
|
Python
|
examples/example_hello_world.py
|
clbarnes/figurefirst
|
ed38e246a96f28530bf663eb6920da1c3ccee610
|
[
"MIT"
] | 67
|
2016-06-03T20:37:56.000Z
|
2022-03-08T19:05:06.000Z
|
examples/example_hello_world.py
|
clbarnes/figurefirst
|
ed38e246a96f28530bf663eb6920da1c3ccee610
|
[
"MIT"
] | 56
|
2016-05-23T17:44:04.000Z
|
2021-11-18T19:23:52.000Z
|
examples/example_hello_world.py
|
clbarnes/figurefirst
|
ed38e246a96f28530bf663eb6920da1c3ccee610
|
[
"MIT"
] | 11
|
2017-07-13T14:25:08.000Z
|
2021-12-01T00:15:01.000Z
|
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
plt.ion()
from figurefirst import FigureLayout
layout = FigureLayout('example_hello_world_layout.svg')
layout.make_mplfigures()
d = np.array([[144, 57], [138, 57], [138, 59], [141, 61], [141, 82], [138, 84], [138, 85], [142, 85], [147, 85], [147, 84], [144, 82], [144, 57], [144, 57], [155, 57], [149, 57], [149, 59], [152, 61], [152, 82], [149, 84], [149, 85], [153, 85], [158, 85], [158, 84], [155, 82], [155, 57], [155, 57], [273, 57], [267, 57], [267, 59], [270, 61], [270, 82], [267, 84], [267, 85], [271, 85], [276, 85], [276, 84], [273, 82], [273, 57], [273, 57], [295, 57], [289, 57], [289, 59], [292, 61], [292, 70], [287, 67], [278, 76], [287, 85], [292, 83], [292, 85], [298, 85], [298, 84], [295, 81], [295, 57], [295, 57], [90, 57], [90, 59], [91, 59], [94, 61], [94, 82], [91, 84], [90, 84], [90, 85], [96, 85], [102, 85], [102, 84], [101, 84], [98, 82], [98, 71], [110, 71], [110, 82], [107, 84], [106, 84], [106, 85], [112, 85], [118, 85], [118, 84], [117, 84], [113, 82], [113, 61], [117, 59], [118, 59], [118, 57], [112, 58], [106, 57], [106, 59], [107, 59], [110, 61], [110, 70], [98, 70], [98, 61], [101, 59], [102, 59], [102, 57], [96, 58], [90, 57], [90, 57], [193, 57], [193, 59], [197, 60], [205, 85], [205, 86], [206, 85], [213, 65], [219, 85], [220, 86], [221, 85], [229, 61], [233, 59], [233, 57], [229, 58], [224, 57], [224, 59], [228, 61], [227, 62], [221, 80], [215, 60], [215, 60], [218, 59], [218, 57], [213, 58], [208, 57], [208, 59], [211, 60], [212, 63], [207, 80], [200, 60], [200, 60], [203, 59], [203, 57], [198, 58], [193, 57], [193, 57], [128, 67], [120, 76], [129, 85], [135, 80], [135, 80], [134, 80], [129, 84], [125, 82], [123, 76], [134, 76], [135, 75], [128, 67], [128, 67], [169, 67], [160, 76], [169, 85], [178, 76], [169, 67], [169, 67], [240, 67], [231, 76], [240, 85], [249, 76], [240, 67], [240, 67], [257, 67], [251, 68], [251, 69], [254, 71], [254, 82], [251, 84], [251, 85], [256, 85], [261, 85], [261, 84], [260, 84], [257, 82], [257, 75], [262, 68], [262, 68], [261, 70], [263, 71], [265, 70], [262, 67], [257, 71], [257, 67], [257, 67], [128, 68], [133, 75], [123, 75], [128, 68], [128, 68], [169, 68], [173, 70], [174, 76], [173, 81], [169, 84], [164, 82], [163, 76], [164, 70], [169, 68], [169, 68], [240, 68], [244, 70], [246, 76], [245, 81], [240, 84], [235, 82], [234, 76], [235, 70], [240, 68], [240, 68], [287, 68], [292, 70], [292, 72], [292, 80], [292, 82], [287, 84], [283, 82], [281, 76], [283, 71], [287, 68], [287, 68]])
ax = layout.axes['ax_name']['axis']
ax.plot(d[:,0], -d[:,1], lw=4)
layout.insert_figures('target_layer_name')
layout.write_svg('example_hello_world_output.svg')
| 143.789474
| 2,363
| 0.493411
| 490
| 2,732
| 2.726531
| 0.312245
| 0.011228
| 0.025449
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.468461
| 0.170205
| 2,732
| 18
| 2,364
| 151.777778
| 0.120865
| 0.007321
| 0
| 0
| 0
| 0
| 0.03246
| 0.022132
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.272727
| 0
| 0.272727
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b1a93d370fc62aa987aa9250ab1bac4da3444f9c
| 35
|
py
|
Python
|
tests/__init__.py
|
jsta/nhdpy
|
38f52a68907e4d838715c77b18e61450eb775c72
|
[
"MIT"
] | null | null | null |
tests/__init__.py
|
jsta/nhdpy
|
38f52a68907e4d838715c77b18e61450eb775c72
|
[
"MIT"
] | 8
|
2020-11-12T16:42:23.000Z
|
2021-03-04T19:00:09.000Z
|
tests/__init__.py
|
jsta/nhdpy
|
38f52a68907e4d838715c77b18e61450eb775c72
|
[
"MIT"
] | null | null | null |
"""Unit test package for nhdpy."""
| 17.5
| 34
| 0.657143
| 5
| 35
| 4.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.142857
| 35
| 1
| 35
| 35
| 0.766667
| 0.8
| 0
| null | 0
| null | 0
| 0
| null | 0
| 0
| 0
| null | 1
| null | true
| 0
| 0
| null | null | null | 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
b1ac9e7af9abde201568a2b9eff7f851241bb02a
| 168
|
py
|
Python
|
configs/tsmnet/tsmnet_r50-d1_769x769_40k_cityscapes_video.py
|
labdeeman7/TRDP_temporal_stability_semantic_segmentation
|
efe0f13c2ed4e203d1caa41810e39e09152b508e
|
[
"Apache-2.0"
] | null | null | null |
configs/tsmnet/tsmnet_r50-d1_769x769_40k_cityscapes_video.py
|
labdeeman7/TRDP_temporal_stability_semantic_segmentation
|
efe0f13c2ed4e203d1caa41810e39e09152b508e
|
[
"Apache-2.0"
] | null | null | null |
configs/tsmnet/tsmnet_r50-d1_769x769_40k_cityscapes_video.py
|
labdeeman7/TRDP_temporal_stability_semantic_segmentation
|
efe0f13c2ed4e203d1caa41810e39e09152b508e
|
[
"Apache-2.0"
] | null | null | null |
_base_ = [
'../_base_/models/tsm_r50-d8.py', '../_base_/datasets/cityscapes_769x769.py',
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py'
]
| 42
| 81
| 0.684524
| 21
| 168
| 4.809524
| 0.666667
| 0.178218
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.071895
| 0.089286
| 168
| 4
| 82
| 42
| 0.588235
| 0
| 0
| 0
| 0
| 0
| 0.786982
| 0.786982
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 4
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.