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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f5eb484e6ca96bda90cc1532c82396be0a56ffae
| 571
|
py
|
Python
|
src/ahjo/operations/tsql/__init__.py
|
olasirtep/ahjo
|
7475feaf72c65d424d018082960ffbac6e59bab8
|
[
"Apache-2.0"
] | null | null | null |
src/ahjo/operations/tsql/__init__.py
|
olasirtep/ahjo
|
7475feaf72c65d424d018082960ffbac6e59bab8
|
[
"Apache-2.0"
] | null | null | null |
src/ahjo/operations/tsql/__init__.py
|
olasirtep/ahjo
|
7475feaf72c65d424d018082960ffbac6e59bab8
|
[
"Apache-2.0"
] | 1
|
2021-08-31T07:26:46.000Z
|
2021-08-31T07:26:46.000Z
|
# Ahjo - Database deployment framework
#
# Copyright 2019, 2020, 2021 ALM Partners Oy
# SPDX-License-Identifier: Apache-2.0
"""Module for operations requiring SQLServer backend."""
from ahjo.operations.tsql.create_db import create_db
from ahjo.operations.tsql.create_db_login import create_db_login
from ahjo.operations.tsql.create_db_permissions import create_db_permissions
from ahjo.operations.tsql.create_db_structure import create_db_structure
from ahjo.operations.tsql.db_object_properties import (
update_file_object_properties, update_db_object_properties)
| 40.785714
| 76
| 0.844133
| 81
| 571
| 5.679012
| 0.432099
| 0.13913
| 0.195652
| 0.23913
| 0.26087
| 0.26087
| 0
| 0
| 0
| 0
| 0
| 0.026975
| 0.091068
| 571
| 13
| 77
| 43.923077
| 0.859345
| 0.292469
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.833333
| 0
| 0.833333
| 0
| 0
| 0
| 0
| null | 0
| 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
| 1
| 0
| 1
| 0
|
0
| 5
|
de99c9c59aa10096f7801c5898ffa75df1f810d7
| 189
|
py
|
Python
|
shopkit/core/config.py
|
sakkada/django-shopkit
|
35e6f8ac73bf6aa40887aa9b1b860d27db8b2975
|
[
"BSD-3-Clause"
] | null | null | null |
shopkit/core/config.py
|
sakkada/django-shopkit
|
35e6f8ac73bf6aa40887aa9b1b860d27db8b2975
|
[
"BSD-3-Clause"
] | null | null | null |
shopkit/core/config.py
|
sakkada/django-shopkit
|
35e6f8ac73bf6aa40887aa9b1b860d27db8b2975
|
[
"BSD-3-Clause"
] | null | null | null |
from django.apps import AppConfig
class CoreConfig(AppConfig):
label = u'shopkit.core'
name = u'shopkit.core'
verbose_name = u'Shopkit Core'
def ready(self):
pass
| 17.181818
| 34
| 0.666667
| 25
| 189
| 5
| 0.68
| 0.192
| 0.288
| 0.256
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.238095
| 189
| 10
| 35
| 18.9
| 0.868056
| 0
| 0
| 0
| 0
| 0
| 0.190476
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0.142857
| 0.142857
| 0
| 0.857143
| 0
| 1
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
deaa9ece9a76ba886443a8f83cbcfb764c38f376
| 60
|
py
|
Python
|
tests/roots/test-advanced/apidoc_dummy_package/apidoc_dummy_submodule_b.py
|
dhellmann/apidoc
|
7fc95da3f1e5912bd6e98aa71b57535257788916
|
[
"BSD-2-Clause"
] | null | null | null |
tests/roots/test-advanced/apidoc_dummy_package/apidoc_dummy_submodule_b.py
|
dhellmann/apidoc
|
7fc95da3f1e5912bd6e98aa71b57535257788916
|
[
"BSD-2-Clause"
] | null | null | null |
tests/roots/test-advanced/apidoc_dummy_package/apidoc_dummy_submodule_b.py
|
dhellmann/apidoc
|
7fc95da3f1e5912bd6e98aa71b57535257788916
|
[
"BSD-2-Clause"
] | null | null | null |
class Baz(object):
def inga(self):
return 1 + 3
| 15
| 20
| 0.55
| 9
| 60
| 3.666667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.05
| 0.333333
| 60
| 3
| 21
| 20
| 0.775
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 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
| 1
| 1
| 0
|
0
| 5
|
dec32c33ee9f4261c5e65f6f1a41f9fa302dcf9b
| 449
|
py
|
Python
|
flask-api/app/models.py
|
burwinliu/FamilyTree
|
7009e9b07c312b808c9c01dc515b9237225682d8
|
[
"Apache-2.0"
] | null | null | null |
flask-api/app/models.py
|
burwinliu/FamilyTree
|
7009e9b07c312b808c9c01dc515b9237225682d8
|
[
"Apache-2.0"
] | null | null | null |
flask-api/app/models.py
|
burwinliu/FamilyTree
|
7009e9b07c312b808c9c01dc515b9237225682d8
|
[
"Apache-2.0"
] | null | null | null |
# /app/models.py
class Family:
def __init__(self):
pass
def get_tree(self):
"""
Return tree of all family members
"""
pass
def jsonify(self):
pass
class Person:
def __init__(self):
pass
def get_profile(self):
"""
Returns profile of user
TODO Juliette try and complete
"""
pass
def jsonify(self):
pass
| 14.483871
| 45
| 0.494432
| 48
| 449
| 4.416667
| 0.520833
| 0.150943
| 0.103774
| 0.141509
| 0.40566
| 0.198113
| 0
| 0
| 0
| 0
| 0
| 0
| 0.42539
| 449
| 31
| 46
| 14.483871
| 0.821705
| 0.233853
| 0
| 0.714286
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.032258
| 0
| 1
| 0.428571
| false
| 0.428571
| 0
| 0
| 0.571429
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
def74f4f9d57f0851babbaace26ba9b9708b4a4a
| 30
|
py
|
Python
|
tools/dataset/models_aoda/__init__.py
|
arkel23/mmgeneration
|
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
|
[
"Apache-2.0"
] | null | null | null |
tools/dataset/models_aoda/__init__.py
|
arkel23/mmgeneration
|
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
|
[
"Apache-2.0"
] | null | null | null |
tools/dataset/models_aoda/__init__.py
|
arkel23/mmgeneration
|
41a30e2972f2037f6aac60ed761bed3fe47bfe4d
|
[
"Apache-2.0"
] | null | null | null |
from .aoda import create_aoda
| 15
| 29
| 0.833333
| 5
| 30
| 4.8
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.133333
| 30
| 1
| 30
| 30
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
defc04664ecce10bb9f6f24e1da51c8eff683ab4
| 212
|
py
|
Python
|
gans/building_blocks/__init__.py
|
christophstach/research-project-gan
|
1619565e30163a77d4777c5e9738d2393bac59af
|
[
"Apache-2.0"
] | 1
|
2021-02-13T10:50:28.000Z
|
2021-02-13T10:50:28.000Z
|
gans/building_blocks/__init__.py
|
christophstach/research-project-gan
|
1619565e30163a77d4777c5e9738d2393bac59af
|
[
"Apache-2.0"
] | null | null | null |
gans/building_blocks/__init__.py
|
christophstach/research-project-gan
|
1619565e30163a77d4777c5e9738d2393bac59af
|
[
"Apache-2.0"
] | null | null | null |
from .attention import SelfAttention2d
from .minibatch_std_dev import MinibatchStdDev
from .pixel_norm import PixelNorm
from .convolution import Conv2d, ConvTranspose2d, SubPixelConv2d, _ConvTranspose2d, _Conv2d
| 42.4
| 91
| 0.867925
| 23
| 212
| 7.782609
| 0.652174
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.09434
| 212
| 4
| 92
| 53
| 0.901042
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
defe6358d0c047bed7536b6bc93a2ca4496fc049
| 16,352
|
py
|
Python
|
modelzoo/mclstm.py
|
ml-jku/mc-lstm
|
8bbaece3ecb4187a76c6318d4c6e40c1dcc71303
|
[
"MIT"
] | 18
|
2021-03-27T06:31:59.000Z
|
2022-02-24T09:48:57.000Z
|
modelzoo/mclstm.py
|
ml-jku/mc-lstm
|
8bbaece3ecb4187a76c6318d4c6e40c1dcc71303
|
[
"MIT"
] | null | null | null |
modelzoo/mclstm.py
|
ml-jku/mc-lstm
|
8bbaece3ecb4187a76c6318d4c6e40c1dcc71303
|
[
"MIT"
] | 7
|
2021-03-27T21:01:23.000Z
|
2021-09-21T14:27:59.000Z
|
import torch
import torch.nn as nn
from modelzoo.normalisers import NormalisedSigmoid
from modelzoo.redistributions import Gate
from modelzoo.redistributions import get_redistribution
class MCModel(nn.Module):
def __init__(self, cfg: dict):
super().__init__()
self.mclstm = MCLSTMv2(cfg['mass_input_size'],
cfg['aux_input_size'],
cfg['hidden_size'],
redistribution_type=cfg['redistribution_type'],
normaliser=cfg.get('normaliser'))
self.fc = nn.Linear(cfg['hidden_size'], cfg['out_size'])
self.reset_parameters()
def reset_parameters(self):
self.mclstm.reset_parameters()
nn.init.kaiming_uniform_(self.fc.weight, nonlinearity='linear')
nn.init.zeros_(self.fc.bias)
def forward(self, x_m, x_a) -> tuple:
m_out, c = self.mclstm(x_m, x_a)
return self.fc(m_out[:, -1]), c
class MCSum(nn.Module):
def __init__(self, cfg: dict):
super().__init__()
self.mclstm = MCLSTMv2(cfg['mass_input_size'],
cfg['aux_input_size'],
cfg['hidden_size'],
redistribution_type=cfg['redistribution_type'],
normaliser=cfg.get('normaliser'))
self.reset_parameters()
def reset_parameters(self):
self.mclstm.reset_parameters()
def forward(self, x_m, x_a) -> tuple:
m_out, c = self.mclstm(x_m, x_a)
return m_out[:, -1].sum(dim=-1, keepdims=True), c
class MCProd(MCModel):
def forward(self, x_m, x_a) -> tuple:
m_out, c = self.mclstm(torch.log(x_m), x_a)
return torch.exp(self.fc(m_out[:, -1])), c
class MCWrappedModel(nn.Module):
def __init__(self, cfg: dict):
super().__init__()
self.mclstm = MCLSTMv2(cfg['mass_input_size'],
cfg['aux_input_size'],
cfg['hidden_size'],
redistribution_type=cfg['redistribution_type'],
normaliser=cfg.get('normaliser'))
self.pre_mlp = nn.Sequential(nn.Linear(cfg['mass_input_size'], cfg['inter_size']), nn.ReLU(),
nn.Linear(cfg['inter_size'], cfg['mass_input_size']))
self.post_mlp = nn.Sequential(nn.Linear(cfg['hidden_size'], cfg['inter_size']), nn.ReLU(),
nn.Linear(cfg['inter_size'], cfg['out_size']))
self.reset_parameters()
def reset_parameters(self):
self.mclstm.reset_parameters()
nn.init.kaiming_uniform_(self.pre_mlp[0].weight)
nn.init.zeros_(self.pre_mlp[0].bias)
nn.init.kaiming_uniform_(self.pre_mlp[2].weight)
nn.init.zeros_(self.pre_mlp[2].bias)
nn.init.kaiming_uniform_(self.post_mlp[0].weight)
nn.init.zeros_(self.post_mlp[0].bias)
nn.init.kaiming_uniform_(self.post_mlp[2].weight)
nn.init.zeros_(self.post_mlp[2].bias)
def forward(self, x_m, x_a) -> tuple:
x_m = self.pre_mlp(x_m)
m_out, c = self.mclstm(x_m, x_a)
m_out = self.post_mlp(m_out[:, -1])
return m_out, c
class MassConservingTemplate(nn.Module):
""" Base class for different flavours of Mass Conserving LSTMs. """
def __init__(self,
mass_input_size: int,
aux_input_size: int,
hidden_size: int,
redistribution_type: str = "gate",
normaliser: str = "softmax",
batch_first: bool = True):
"""
Parameters
----------
mass_input_size : int
Number of mass input features at each time step.
aux_input_size : int
Number of auxiliary input features at each time step.
hidden_size : int
Number of output features at each time step.
redistribution_type : str, optional
Specifies how the redistribution matrix should be computed.
batch_first : bool, optional
Whether or not the first dimension is the batch dimension.
"""
super(MassConservingTemplate, self).__init__()
self.mass_input_size = mass_input_size
self.aux_input_size = aux_input_size
self.hidden_size = hidden_size
self.redistribution_type = redistribution_type
self.batch_first = batch_first
if normaliser == 'sigmoid':
self.normaliser = NormalisedSigmoid(dim=-1)
elif normaliser == 'id':
self.normaliser = lambda x: x
elif normaliser == 'nonorm':
self.normaliser = nn.Sigmoid()
else:
self.normaliser = nn.Softmax(dim=-1)
@torch.no_grad()
def get_initial_state(self, x0: torch.Tensor):
return x0.new_zeros((len(x0), self.hidden_size))
def forward(self, x_m: torch.Tensor, x_a: torch.Tensor, init_state: torch.Tensor = None):
if self.batch_first:
x_m = x_m.transpose(0, 1)
x_a = x_a.transpose(0, 1)
ct = self.get_initial_state(x_m[0])
if init_state is not None:
ct = ct + init_state
m_out, c = [], []
for xt_m, xt_a in zip(x_m, x_a):
mt_out, ct = self._step(xt_m, xt_a, ct)
m_out.append(mt_out)
c.append(ct)
m_out, c = torch.stack(m_out), torch.stack(c)
if self.batch_first:
m_out = m_out.transpose(0, 1)
c = c.transpose(0, 1)
return m_out, c
def _step(self, xt_m, xt_a, c):
""" Make a single time step in the MCLSTM. """
raise NotImplementedError("subclass must implement this method")
class MCLSTM(MassConservingTemplate):
""" Mass conserving LSTM.
Using all inputs in all gates.
"""
def __init__(self,
mass_input_size: int,
aux_input_size: int,
hidden_size: int,
redistribution_type: str = "gate",
normaliser: str = "sigmoid",
batch_first: bool = True):
"""
Parameters
----------
mass_input_size : int
Number of mass input features at each time step.
aux_input_size : int
Number of auxiliary input features at each time step.
hidden_size : int
Number of output features at each time step.
redistribution_type : str, optional
Specifies how the redistribution matrix should be computed.
batch_first : bool, optional
Whether or not the first dimension is the batch dimension.
"""
super(MCLSTM, self).__init__(mass_input_size, aux_input_size, hidden_size, redistribution_type, normaliser,
batch_first)
in_shape = self.mass_input_size + self.aux_input_size + self.hidden_size
self.out_gate = Gate(self.hidden_size, in_shape)
# NOTE: without normalised sigmoid here, there seem to be troubles!
self.junction = get_redistribution("gate",
num_states=self.mass_input_size,
num_features=in_shape,
num_out=self.hidden_size,
normaliser=self.normaliser)
self.redistribution = get_redistribution(self.redistribution_type,
num_states=self.hidden_size,
num_features=in_shape,
normaliser=self.normaliser)
self.reset_parameters()
def reset_parameters(self):
self.out_gate.reset_parameters()
self.junction.reset_parameters()
self.redistribution.reset_parameters()
def _step(self, xt_m, xt_a, c):
""" Make a single time step in the MCLSTM. """
features = torch.cat([xt_m, xt_a, c], dim=-1)
j = self.junction(features)
r = self.redistribution(features)
o = self.out_gate(features)
m_in = torch.matmul(xt_m.unsqueeze(-2), j).squeeze(-2)
m_sys = torch.matmul(c.unsqueeze(-2), r).squeeze(-2)
m_new = m_in + m_sys
return o * m_new, (1 - o) * m_new
class MCLSTMv2(MassConservingTemplate):
""" Mass conserving LSTM.
Using only auxiliary inputs in all gates.
"""
def __init__(self,
mass_input_size: int,
aux_input_size: int,
hidden_size: int,
redistribution_type: str = "gate",
normaliser: str = "softmax",
batch_first: bool = True):
super(MCLSTMv2, self).__init__(mass_input_size, aux_input_size, hidden_size, redistribution_type, normaliser,
batch_first)
self.out_gate = Gate(self.hidden_size, self.aux_input_size)
# NOTE: without normalised sigmoid here, there seem to be troubles!
self.junction = get_redistribution("gate",
num_states=self.mass_input_size,
num_features=self.aux_input_size,
num_out=self.hidden_size,
normaliser=nn.Softmax(dim=-1))
self.redistribution = get_redistribution(self.redistribution_type,
num_states=self.hidden_size,
num_features=self.aux_input_size,
normaliser=self.normaliser)
self.reset_parameters()
def reset_parameters(self):
self.out_gate.reset_parameters()
nn.init.constant_(self.out_gate.fc.bias, -3.)
self.junction.reset_parameters()
self.redistribution.reset_parameters()
def _step(self, xt_m, xt_a, c):
""" Make a single time step in the MCLSTM. """
j = self.junction(xt_a)
r = self.redistribution(xt_a)
o = self.out_gate(xt_a)
m_in = torch.matmul(xt_m.unsqueeze(-2), j).squeeze(-2)
m_sys = torch.matmul(c.unsqueeze(-2), r).squeeze(-2)
m_new = m_in + m_sys
return o * m_new, (1 - o) * m_new
class MCLSTMv3(MassConservingTemplate):
""" Mass conserving LSTM.
Using auxiliary inputs and normalised cell states (no mass inputs) in all gates.
"""
def __init__(self,
mass_input_size: int,
aux_input_size: int,
hidden_size: int,
redistribution_type: str = "gate",
normaliser: str = "softmax",
batch_first: bool = True):
super().__init__(mass_input_size, aux_input_size, hidden_size, redistribution_type, normaliser, batch_first)
input_size = self.aux_input_size + hidden_size
self.out_gate = Gate(self.hidden_size, input_size)
self.junction = get_redistribution("gate",
num_states=self.mass_input_size,
num_features=input_size,
num_out=self.hidden_size,
normaliser=nn.Softmax(dim=-1))
self.redistribution = get_redistribution(self.redistribution_type,
num_states=self.hidden_size,
num_features=input_size,
normaliser=self.normaliser)
self.reset_parameters()
def reset_parameters(self):
self.out_gate.reset_parameters()
nn.init.constant_(self.out_gate.fc.bias, -3.)
self.junction.reset_parameters()
self.redistribution.reset_parameters()
def _step(self, xt_m, xt_a, c):
""" Make a single time step in the MCLSTM. """
c_sum = torch.sum(c, dim=-1, keepdim=True)
normaliser = torch.where(c_sum == 0, c_sum.new_ones(c_sum.shape), c_sum)
aux = torch.cat([xt_a, c / normaliser], dim=-1)
j = self.junction(aux)
r = self.redistribution(aux)
o = self.out_gate(aux)
m_in = torch.matmul(xt_m.unsqueeze(-2), j).squeeze(-2)
m_sys = torch.matmul(c.unsqueeze(-2), r).squeeze(-2)
m_new = m_in + m_sys
return o * m_new, (1 - o) * m_new
class MCLSTMMultiOutBad(MassConservingTemplate):
""" Mass conserving LSTM.
NOTE: FAULTY MODEL FOR MASS-CONSERVATION!
(multiple output gates can make cell states negative)
Using auxiliary inputs and normalised cell states (no mass inputs) in all gates
with multiple output gates (one for each output).
"""
def __init__(self,
mass_input_size: int,
aux_input_size: int,
hidden_size: int,
output_size: int,
redistribution_type: str = "gate",
normaliser: str = "softmax",
batch_first: bool = True):
super().__init__(mass_input_size, aux_input_size, hidden_size, redistribution_type, normaliser, batch_first)
input_size = self.aux_input_size + hidden_size
self.output_size = output_size
self.out_gate = Gate(self.hidden_size * output_size, input_size)
self.junction = get_redistribution("gate",
num_states=self.mass_input_size,
num_features=input_size,
num_out=self.hidden_size,
normaliser=nn.Softmax(dim=-1))
self.redistribution = get_redistribution(self.redistribution_type,
num_states=self.hidden_size,
num_features=input_size,
normaliser=self.normaliser)
self.reset_parameters()
def reset_parameters(self):
self.out_gate.reset_parameters()
nn.init.constant_(self.out_gate.fc.bias, -3.)
self.junction.reset_parameters()
self.redistribution.reset_parameters()
def _step(self, xt_m, xt_a, c):
""" Make a single time step in the MCLSTM. """
c_sum = torch.sum(c, dim=-1, keepdim=True)
normaliser = torch.where(c_sum == 0, c_sum.new_ones(c_sum.shape), c_sum)
aux = torch.cat([xt_a, c / normaliser], dim=-1)
j = self.junction(aux)
r = self.redistribution(aux)
o = self.out_gate(aux).reshape(-1, self.hidden_size, self.output_size)
m_in = torch.matmul(xt_m.unsqueeze(-2), j).squeeze(-2)
m_sys = torch.matmul(c.unsqueeze(-2), r).squeeze(-2)
m_new = m_in + m_sys
m_out = o * m_new.unsqueeze(-1)
return m_out.sum(1), m_new - m_out.sum(-1)
class MCLSTMMultiOut(MCLSTMv3):
""" Mass conserving LSTM.
Using auxiliary inputs and normalised cell states (no mass inputs) in all gates
with multiple output gates (one for each output).
"""
def __init__(self,
mass_input_size: int,
aux_input_size: int,
hidden_size: int,
output_size: int,
redistribution_type: str = "gate",
normaliser: str = "softmax",
batch_first: bool = True):
super().__init__(mass_input_size, aux_input_size, hidden_size, redistribution_type, normaliser, batch_first)
self.output_size = output_size
self.final = get_redistribution("linear",
num_states=self.hidden_size,
num_features=0,
num_out=self.output_size,
normaliser=nn.Softmax(dim=-1))
self.final.reset_parameters()
def _step(self, xt_m, xt_a, c):
""" Make a single time step in the MCLSTM. """
tmp, c = super()._step(xt_m, xt_a, c)
out_redist = self.final(None)
h = torch.matmul(tmp.unsqueeze(-2), out_redist).squeeze(-2)
return h, c
| 39.59322
| 117
| 0.559014
| 1,932
| 16,352
| 4.46118
| 0.094721
| 0.05952
| 0.037707
| 0.023669
| 0.806358
| 0.768303
| 0.747999
| 0.711335
| 0.695208
| 0.682446
| 0
| 0.006882
| 0.342466
| 16,352
| 412
| 118
| 39.68932
| 0.794736
| 0.117967
| 0
| 0.660714
| 0
| 0
| 0.032641
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.1
| false
| 0
| 0.017857
| 0.003571
| 0.192857
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 5
|
72139aa9913e35d32438a70c5545d98cab647917
| 197
|
py
|
Python
|
arch_nemesis/sources/__init__.py
|
trickeydan/arch-nemesis
|
7582bd2ec76b5605b8ae1cf0ec1b4e2555044ddd
|
[
"MIT"
] | null | null | null |
arch_nemesis/sources/__init__.py
|
trickeydan/arch-nemesis
|
7582bd2ec76b5605b8ae1cf0ec1b4e2555044ddd
|
[
"MIT"
] | null | null | null |
arch_nemesis/sources/__init__.py
|
trickeydan/arch-nemesis
|
7582bd2ec76b5605b8ae1cf0ec1b4e2555044ddd
|
[
"MIT"
] | null | null | null |
"""Possible package sources."""
from .github_asset import GitHubAssetSource, GitHubTarSource
from .source import PackageSource
__all__ = ['GitHubAssetSource', 'GitHubTarSource', 'PackageSource']
| 28.142857
| 67
| 0.796954
| 17
| 197
| 8.941176
| 0.705882
| 0.421053
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096447
| 197
| 6
| 68
| 32.833333
| 0.853933
| 0.126904
| 0
| 0
| 0
| 0
| 0.271084
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
722e1a1897276005e187111db0994a82026c8300
| 180
|
py
|
Python
|
taps/db/__init__.py
|
schinavro/taps
|
c03b4e23ed299824c1b062225b837a0b7cfff216
|
[
"MIT"
] | null | null | null |
taps/db/__init__.py
|
schinavro/taps
|
c03b4e23ed299824c1b062225b837a0b7cfff216
|
[
"MIT"
] | null | null | null |
taps/db/__init__.py
|
schinavro/taps
|
c03b4e23ed299824c1b062225b837a0b7cfff216
|
[
"MIT"
] | null | null | null |
from taps.db.database import Database
from taps.db.imagedb import ImageDatabase
from taps.db.pathsdb import PathsDatabase
__all__ = ['Database', 'ImageDatabase', 'PathsDatabase']
| 30
| 56
| 0.805556
| 22
| 180
| 6.409091
| 0.454545
| 0.170213
| 0.212766
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.1
| 180
| 5
| 57
| 36
| 0.87037
| 0
| 0
| 0
| 0
| 0
| 0.188889
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.75
| 0
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
723da38ece213f3afd16426d8b380b49b947e3da
| 4,184
|
py
|
Python
|
decibinary.py
|
baduy9x/AlgorithmPractice
|
9fb956aedf67c0515b66f2af93d8383dba697fec
|
[
"Apache-2.0"
] | null | null | null |
decibinary.py
|
baduy9x/AlgorithmPractice
|
9fb956aedf67c0515b66f2af93d8383dba697fec
|
[
"Apache-2.0"
] | null | null | null |
decibinary.py
|
baduy9x/AlgorithmPractice
|
9fb956aedf67c0515b66f2af93d8383dba697fec
|
[
"Apache-2.0"
] | null | null | null |
import pandas as pd
df = pd.DataFrame({'grade': {0: 10,1: 12,2: 10,3: 9,4: 10,5: 12,6: 10,7: 11,8: 11,9: 12,10: 12,11: 9,12: 12,13: 12,14: 10,15: 11,16: 11,17: 11,18: 10,19: 12,20: 11,21: 10,22: 10,23: 10,24: 11,25: 9,26: 10,27: 9,28: 10,29: 11,30: 12,31: 11,32: 12,33: 12,34: 12,35: 9,36: 11,37: 10,38: 11,39: 10,40: 12,41: 12,42: 11,43: 11,44: 11,45: 9,46: 12,47: 12,48: 9,49: 10,50: 10,51: 12,52: 9,53: 11,54: 11,55: 11,56: 12,57: 10,58: 12,59: 12,60: 12,61: 9,62: 10,63: 12,64: 10,65: 12,66: 12,67: 10,68: 10,69: 10,70: 10,71: 10,72: 11,73: 12,74: 11,75: 9,76: 11,77: 12,78: 11,79: 9,80: 9,81: 10,82: 12,83: 10,84: 9,85: 9,86: 12,87: 11,88: 11,89: 10,90: 12,91: 9,92: 11,93: 9,94: 12,95: 11,96: 11,97: 10,98: 12,99: 11,100: 9,101: 12,102: 12,103: 11,104: 11,105: 12,106: 11,107: 10,108: 11,109: 9,110: 10,111: 10,112: 11,113: 10,114: 9,115: 12,116: 12,117: 10,118: 10,119: 12,120: 11,121: 9,122: 11,123: 11,124: 11,125: 9,126: 9,127: 11,128: 11,129: 10,130: 11,131: 9,132: 12,133: 11,134: 10,135: 11,136: 11,137: 12,138: 9,139: 9,140: 9,141: 11,142: 9,143: 9,144: 10,145: 11,146: 11,147: 9,148: 9,149: 11,150: 11,151: 9,152: 11,153: 12,154: 11,155: 9,156: 9,157: 10,158: 9,159: 11,160: 10,161: 10,162: 10,163: 10,164: 11,165: 11,166: 12,167: 11,168: 11,169: 9,170: 11,171: 11,172: 9,173: 9,174: 9,175: 10,176: 11,177: 9,178: 12,179: 9,180: 12,181: 10,182: 11,183: 11,184: 9,185: 12,186: 12,187: 11,188: 10,189: 12,190: 11,191: 10,192: 12,193: 12,194: 11,195: 9,196: 11,197: 11,198: 11,199: 11},
'test_score': {0: 76,1: 40,2: 7,3: 48,4: 9,5: 46,6: 6,7: 28,8: 18,9: 12,10: 74,11: 90,12: 39,13: 8,14: 60,15: 12,16: 43,17: 71,18: 37,19: 90,20: 22,21: 80,22: 81,23: 87,24: 26,25: 2,26: 11,27: 42,28: 76,29: 24,30: 25,31: 51,32: 39,33: 42,34: 11,35: 78,36: 2,37: 27,38: 27,39: 86,40: 0,41: 26,42: 64,43: 78,44: 54,45: 89,46: 77,47: 5,48: 94,49: 65,50: 61,51: 51,52: 17,53: 20,54: 17,55: 54,56: 95,57: 76,58: 47,59: 94,60: 51,61: 21,62: 62,63: 59,64: 63,65: 16,66: 81,67: 6,68: 4,69: 48,70: 19,71: 45,72: 21,73: 64,74: 72,75: 73,76: 53,77: 71,78: 95,79: 16,80: 17,81: 22,82: 27,83: 1,84: 85,85: 34,86: 34,87: 92,88: 79,89: 9,90: 11,91: 11,92: 63,93: 79,94: 57,95: 75,96: 22,97: 9,98: 77,99: 49,100: 52,101: 72,102: 10,103: 48,104: 1,105: 40,106: 10,107: 71,108: 4,109: 73,110: 70,111: 40,112: 39,113: 76,114: 85,115: 89,116: 52,117: 15,118: 30,119: 66,120: 28,121: 0,122: 30,123: 40,124: 76,125: 77,126: 21,127: 17,128: 52,129: 21,130: 76,131: 8,132: 33,133: 65,134: 30,135: 1,136: 49,137: 78,138: 31,139: 95,140: 68,141: 73,142: 45,143: 86,144: 27,145: 81,146: 82,147: 60,148: 17,149: 30,150: 69,151: 17,152: 41,153: 34,154: 26,155: 45,156: 33,157: 87,158: 75,159: 73,160: 0,161: 96,162: 5,163: 50,164: 2,165: 90,166: 40,167: 66,168: 68,169: 34,170: 0,171: 69,172: 56,173: 83,174: 16,175: 98,176: 57,177: 18,178: 50,179: 24,180: 64,181: 77,182: 94,183: 54,184: 30,185: 8,186: 98,187: 80,188: 69,189: 25,190: 67,191: 58,192: 10,193: 87,194: 86,195: 61,196: 65,197: 22,198: 15,199: 24}})
# Enter your code here
# print(df.head())
def get_cumumative_scores(df):
key = sorted(df['grade'].unique())
grades = []
state = []
result = []
for item in key:
sub_df = df.query("grade == {}".format(item))
p50 = ((len(sub_df.query("test_score <= 50")) / len(sub_df)) * 100)
p75 = ((len(sub_df.query("test_score <= 75")) / len(sub_df)) * 100)
p90 = ((len(sub_df.query("test_score <= 90")) / len(sub_df)) * 100)
p100 = ((len(sub_df.query("test_score <= 100")) / len(sub_df)) * 100)
print(0.5 * round(p50) / 0.5, 0.5 * round(p75) / 0.5, 0.5 * round(p90) / 0.5, 0.5 * round(p100) / 0.5)
grades.extend([item, item, item , item])
state.extend(["<=50", "<=75", "<=90", "<=100"])
result.extend(["{}%".format(round(p50 * 2) / 2), "{}%".format(p75), "{}%".format(p90), "{}%".format(p100)])
print(p50, p75, p90, p100)
return pd.DataFrame.from_dict({'grade': grades, 'test_score': state, 'percentage': result})
result_df = get_cumumative_scores(df)
result_df.set_index('grade', inplace= True)
# print(result_df.reset_index().columns.values.tolist() + result_df.reset_index().values.tolist())
| 139.466667
| 1,485
| 0.58413
| 983
| 4,184
| 2.4588
| 0.254324
| 0.018618
| 0.026479
| 0.021514
| 0.04758
| 0.036409
| 0
| 0
| 0
| 0
| 0
| 0.509632
| 0.15631
| 4,184
| 30
| 1,486
| 139.466667
| 0.175071
| 0.032027
| 0
| 0
| 0
| 0
| 0.0383
| 0
| 0
| 0
| 0
| 0.033333
| 0
| 1
| 0.045455
| false
| 0
| 0.045455
| 0
| 0.136364
| 0.090909
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a0ffe6ae46d3999e6004a742a253e846b24dbae4
| 63
|
py
|
Python
|
yolact/__init__.py
|
ar90n/yolact
|
86040800a40ffdfa8873961dcbdd05bf34896b9d
|
[
"MIT"
] | 6
|
2020-01-14T11:13:13.000Z
|
2021-09-01T02:15:07.000Z
|
__init__.py
|
Chirag-v09/yolact
|
47f5a98f38a06daba17d2ee4f61e676537d609db
|
[
"MIT"
] | null | null | null |
__init__.py
|
Chirag-v09/yolact
|
47f5a98f38a06daba17d2ee4f61e676537d609db
|
[
"MIT"
] | 8
|
2019-08-02T17:17:11.000Z
|
2021-10-10T03:24:31.000Z
|
from . import backbone, data, layers, utils, web, yolact, eval
| 31.5
| 62
| 0.730159
| 9
| 63
| 5.111111
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.15873
| 63
| 1
| 63
| 63
| 0.867925
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
9d0ebf2da8d7df30217e102ed79be190b035ffa6
| 76
|
py
|
Python
|
simuvex/simuvex/s_pcap.py
|
Ruide/angr-dev
|
964dc80c758e25c698c2cbcc454ef5954c5fa0a0
|
[
"BSD-2-Clause"
] | 86
|
2015-08-06T23:25:07.000Z
|
2022-02-17T14:58:22.000Z
|
simuvex/simuvex/s_pcap.py
|
Ruide/angr-dev
|
964dc80c758e25c698c2cbcc454ef5954c5fa0a0
|
[
"BSD-2-Clause"
] | 132
|
2015-09-10T19:06:59.000Z
|
2018-10-04T20:36:45.000Z
|
simuvex/simuvex/s_pcap.py
|
Ruide/angr-dev
|
964dc80c758e25c698c2cbcc454ef5954c5fa0a0
|
[
"BSD-2-Clause"
] | 80
|
2015-08-07T10:30:20.000Z
|
2020-03-21T14:45:28.000Z
|
print '... Importing simuvex/s_pcap.py ...'
from angr.storage.pcap import *
| 25.333333
| 43
| 0.710526
| 11
| 76
| 4.818182
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.118421
| 76
| 2
| 44
| 38
| 0.791045
| 0
| 0
| 0
| 0
| 0
| 0.460526
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | null | 0
| 1
| null | null | 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
9d19af6109cffb87cec15491b31bdb0197d6f0bf
| 33
|
py
|
Python
|
Lib/test/badsyntax_async5.py
|
Hadron/python
|
73137f499ed658169f49273eee46845e3b53e800
|
[
"PSF-2.0"
] | 486
|
2016-05-28T18:51:54.000Z
|
2022-03-20T17:30:31.000Z
|
Lib/test/badsyntax_async5.py
|
Hadron/python
|
73137f499ed658169f49273eee46845e3b53e800
|
[
"PSF-2.0"
] | 70
|
2017-02-02T21:20:07.000Z
|
2022-02-04T15:32:45.000Z
|
Lib/test/badsyntax_async5.py
|
Hadron/python
|
73137f499ed658169f49273eee46845e3b53e800
|
[
"PSF-2.0"
] | 74
|
2015-05-29T17:18:53.000Z
|
2022-01-15T14:06:44.000Z
|
def foo():
await something()
| 11
| 21
| 0.606061
| 4
| 33
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.242424
| 33
| 2
| 22
| 16.5
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| true
| 0
| 0
| 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
| 1
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
9d39aa791487f41b6802da3285cf75edee94438e
| 12,148
|
py
|
Python
|
shtk/test/Shell/Shell.py
|
jroose/shtk
|
caba1babe49399f34a7be8ab820a380e346d1515
|
[
"BSD-3-Clause"
] | 24
|
2021-02-02T09:22:53.000Z
|
2021-09-13T00:12:13.000Z
|
shtk/test/Shell/Shell.py
|
jroose/shtk
|
caba1babe49399f34a7be8ab820a380e346d1515
|
[
"BSD-3-Clause"
] | 15
|
2021-02-02T03:00:35.000Z
|
2022-02-20T22:48:30.000Z
|
shtk/test/Shell/Shell.py
|
jroose/shtk
|
caba1babe49399f34a7be8ab820a380e346d1515
|
[
"BSD-3-Clause"
] | 1
|
2021-02-02T11:49:53.000Z
|
2021-02-02T11:49:53.000Z
|
import asyncio
import grp
import importlib.resources
import os
import pathlib
import pwd
import sys
import unittest
from ...Shell import Shell
from ...util import which, export
from ..test_util import register, TmpDirMixin
__all__ = []
async def build_and_wait(factory, *args, **kwargs):
obj = await factory.build(*args, **kwargs)
return await obj.wait()
@export
@register()
class TestRunCommand(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
input_file = "input.txt"
output_file = "output.txt"
message = "Hello World!"
with Shell(cwd=cwd) as sh:
cat = sh.command('cat')
with (cwd / input_file).open('w') as fout:
fout.write(message)
job = sh(
cat.stdin(str(input_file)).stdout(str(output_file)).stderr(None),
wait=False
)[0]
return_codes = job.wait()
self.assertEqual(return_codes, (0,))
self.assertTrue(os.path.exists(str(cwd / output_file)))
with (cwd / output_file).open('r') as fin:
observed = fin.read()
self.assertEqual(message, observed)
@export
@register()
class TestRunCommandAndWait(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
input_file = "input.txt"
output_file = "output.txt"
message = "Hello World!"
with Shell(cwd=cwd) as sh:
cat = sh.command('cat')
with (cwd / input_file).open('w') as fout:
fout.write(message)
job = sh(
cat.stdin(str(input_file)).stdout(str(output_file)).stderr(None)
)[0]
self.assertTrue(os.path.exists(str(cwd / output_file)))
with (cwd / output_file).open('r') as fin:
observed = fin.read()
self.assertEqual(message, observed)
@export
@register()
class TestCommandDoesntExist(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
with Shell(cwd=cwd) as sh:
with self.assertRaises(RuntimeError):
sh.command('./DOES NOT EXIST')
@export
@register()
class TestCommandNotExecutable(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
tmpfile = cwd / "notexecutable.sh"
tmpfile.touch(mode=0o600)
with Shell(cwd=cwd) as sh:
with self.assertRaises(RuntimeError):
sh.command(f"./{tmpfile.name}")
@export
@register()
class TestCommandNotReadable(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
tmpfile = cwd / "notreadable.sh"
tmpfile.touch(mode=0o300)
with Shell(cwd=cwd) as sh:
if os.getuid() != 0:
with self.assertRaises(RuntimeError):
sh.command(f"./{tmpfile.name}")
else:
sh.command(f"./{tmpfile.name}")
@export
@register()
class TestNoEnvironment(TmpDirMixin):
def runTest(self):
with Shell(env={}) as sh:
self.assertEqual(len(sh.environment), 0)
@export
@register()
class TestWithEnvironment(TmpDirMixin):
def runTest(self):
num_existing = len(os.environ)
message = 'Hello World!'
MESSAGE = 'MESSAGE'
os.environ[MESSAGE] = message
with Shell(env=os.environ, cwd=os.getcwd()) as sh:
self.assertEqual(message, sh.getenv(MESSAGE))
self.assertEqual(num_existing + 1, len(sh.environment))
@export
@register()
class TestChangeDirectory(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
input_file = "input.txt"
output_file = "output.txt"
message = "Hello World!"
with Shell(cwd=cwd) as sh:
cat = sh.command('cat')
with (cwd / input_file).open('w') as fout:
fout.write(message)
job = sh(
cat.stdin(str(input_file)).stdout(str(output_file)).stderr(None),
wait=False
)[0]
return_codes = job.wait()
self.assertEqual(return_codes, (0,))
self.assertTrue(os.path.exists(str(cwd / output_file)))
with (cwd / output_file).open('r') as fin:
observed = fin.read()
self.assertEqual(message, observed)
@export
@register()
class TestEvaluate(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
input_file = "input.txt"
output_file = "output.txt"
message = "Hello World!"
with Shell(cwd=cwd) as sh:
cat = sh.command('cat')
with (cwd / input_file).open('w') as fout:
fout.write(message)
observed = sh.evaluate(
cat.stdin(str(input_file)).stderr(None)
)
self.assertEqual(message, observed)
@export
@register()
class TestEnvironmentSet(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
message = "Hello World!"
from .. import test_util
with importlib.resources.path(test_util.__package__, 'echo_env.py') as echo_env:
with Shell(cwd=cwd) as sh:
sh.export(
MESSAGE = message
)
python3 = sh.command('python3')
observed = sh.evaluate(
python3(echo_env, "MESSAGE")
)
self.assertEqual(message, observed)
@export
@register()
class TestEnvironmentSetGet(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
message = "Hello World!"
from .. import test_util
with Shell(cwd=cwd) as sh:
sh.export(
MESSAGE = message
)
observed = sh.getenv('MESSAGE')
self.assertEqual(message, observed)
@export
@register()
class TestChangeDirectoryManager(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
input_file = cwd / "input.txt"
output_file = cwd / "output.txt"
message = "Hello World!"
os.chdir("/")
with Shell(cwd=os.getcwd()) as sh:
cat = sh.command(which('cat'))
with input_file.open('w') as fout:
fout.write(message)
old_cwd = sh.cwd
self.assertNotEqual(old_cwd, cwd)
with sh.cd_manager(cwd) as target_cwd:
self.assertEqual(cwd, target_cwd)
job = sh(
cat.stdin(input_file.name).stdout(output_file.name).stderr(None),
wait=False
)[0]
self.assertEqual(sh.cwd, cwd)
self.assertEqual(sh.pwd, old_cwd)
self.assertEqual(sh.cwd, old_cwd)
self.assertEqual(sh.pwd, cwd)
return_codes = job.wait()
self.assertEqual(return_codes, (0,))
self.assertTrue(os.path.exists(str(output_file)))
with output_file.open('r') as fin:
observed = fin.read()
self.assertEqual(message, observed)
@export
@register()
class TestRunCommandDefaultShell(TmpDirMixin):
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
input_file = cwd / "input.txt"
output_file = cwd / "output.txt"
message = "Hello World!"
sh = Shell.get_shell()
cat = sh.command('cat')
with input_file.open('w') as fout:
fout.write(message)
job = sh(
cat.stdin(str(input_file)).stdout(str(output_file)).stderr(None),
wait=False
)[0]
return_codes = job.wait()
self.assertEqual(return_codes, (0,))
self.assertTrue(os.path.exists(str(output_file)))
with output_file.open('r') as fin:
observed = fin.read()
self.assertEqual(message, observed)
@export
@register()
class TestRunAsDifferentUser(TmpDirMixin):
def setUp(self):
super().setUp()
if ((sys.version_info.major, sys.version_info.minor) < (3, 9)):
raise unittest.SkipTest("Python version is less than 3.9")
if os.getuid() != 0:
raise unittest.SkipTest("Not running as root")
def unless_key_error(fun):
try:
return fun()
except KeyError:
return None
self.uid = unless_key_error(lambda: pwd.getpwnam('nobody').pw_uid)
if self.uid is None:
raise unittest.SkipTest("No user exists with name 'nobody'")
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
outfile = cwd / "result.txt"
with Shell(cwd=cwd, user=self.uid) as sh:
cmd_id = sh.command(which('id'))
sh.run(cmd_id('-u').stdout(outfile))
with outfile.open('r') as fin:
observed_uid = fin.read()
self.assertEqual(observed_uid.strip(), str(self.uid))
self.assertEqual(outfile.owner(), "nobody")
@export
@register()
class TestRunAsDifferentGroup(TmpDirMixin):
def setUp(self):
super().setUp()
if ((sys.version_info.major, sys.version_info.minor) < (3, 9)):
raise unittest.SkipTest("Python version is less than 3.9")
if os.getuid() != 0:
raise unittest.SkipTest("Not running as root")
def unless_key_error(fun):
try:
return fun()
except KeyError:
return None
self.gid = unless_key_error(lambda: pwd.getpwnam('nobody').pw_gid)
if self.gid is None:
raise unittest.SkipTest("No group exists with name 'nobody'")
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
outfile = cwd / "result.txt"
with Shell(cwd=cwd, group=self.gid) as sh:
cmd_id = sh.command(which('id'))
sh.run(cmd_id('-g').stdout(outfile))
with outfile.open('r') as fin:
observed_gid = fin.read()
self.assertEqual(observed_gid.strip(), str(self.gid))
self.assertEqual(grp.getgrnam(outfile.group()).gr_gid, self.gid)
@export
@register()
class TestEvaluateAsDifferentUser(TmpDirMixin):
def setUp(self):
super().setUp()
if ((sys.version_info.major, sys.version_info.minor) < (3, 9)):
raise unittest.SkipTest("Python version is less than 3.9")
if os.getuid() != 0:
raise unittest.SkipTest("Not running as root")
def unless_key_error(fun):
try:
return fun()
except KeyError:
return None
self.uid = unless_key_error(lambda: pwd.getpwnam('nobody').pw_uid)
if self.uid is None:
raise unittest.SkipTest("No user exists with name 'nobody'")
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
with Shell(cwd=cwd, user=self.uid) as sh:
cmd_id = sh.command(which('id'))
observed_uid = sh.evaluate(cmd_id('-u'))
self.assertEqual(observed_uid.strip(), str(self.uid))
@export
@register()
class TestEvaluateAsDifferentGroup(TmpDirMixin):
def setUp(self):
super().setUp()
if ((sys.version_info.major, sys.version_info.minor) < (3, 9)):
raise unittest.SkipTest("Python version is less than 3.9")
if os.getuid() != 0:
raise unittest.SkipTest("Not running as root")
def unless_key_error(fun):
try:
return fun()
except KeyError:
return None
self.gid = unless_key_error(lambda: pwd.getpwnam('nobody').pw_gid)
if self.gid is None:
raise unittest.SkipTest("No group exists with name 'nobody'")
def runTest(self):
cwd = pathlib.Path(self.tmpdir.name)
with Shell(cwd=cwd, group=self.gid) as sh:
cmd_id = sh.command(which('id'))
observed_gid = sh.evaluate(cmd_id('-g'))
self.assertEqual(observed_gid.strip(), str(self.gid))
| 28.317016
| 88
| 0.572028
| 1,410
| 12,148
| 4.843972
| 0.117731
| 0.057101
| 0.047291
| 0.037335
| 0.768228
| 0.73631
| 0.733529
| 0.726354
| 0.677306
| 0.653148
| 0
| 0.005099
| 0.305812
| 12,148
| 428
| 89
| 28.383178
| 0.804814
| 0
| 0
| 0.76
| 0
| 0
| 0.064784
| 0
| 0
| 0
| 0
| 0
| 0.107692
| 1
| 0.076923
| false
| 0
| 0.043077
| 0
| 0.2
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
19bf1e1efbb245188e8cdb9050060a92c71d703c
| 180
|
py
|
Python
|
sessao03/30_87-CriandoModulos/aplicativo.py
|
Ruteski/CursoPythonOM
|
afe5ad5e50f903dab370be2b76966a81f07e51dd
|
[
"MIT"
] | null | null | null |
sessao03/30_87-CriandoModulos/aplicativo.py
|
Ruteski/CursoPythonOM
|
afe5ad5e50f903dab370be2b76966a81f07e51dd
|
[
"MIT"
] | null | null | null |
sessao03/30_87-CriandoModulos/aplicativo.py
|
Ruteski/CursoPythonOM
|
afe5ad5e50f903dab370be2b76966a81f07e51dd
|
[
"MIT"
] | null | null | null |
# import aula87 as calculos
#
# print(calculos.PI)
#
# lista = [2,4]
# print(calculos.multiplica(lista))
from aula87 import dobra_lista, PI, multiplica
print(multiplica([2,4]))
| 15
| 46
| 0.711111
| 25
| 180
| 5.08
| 0.48
| 0.204724
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.051613
| 0.138889
| 180
| 12
| 47
| 15
| 0.767742
| 0.511111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 0.5
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 1
|
0
| 5
|
19d5bcfdc7b9d4f6bade73ca112ca8f3cc783b0d
| 57
|
py
|
Python
|
profanity-detector/test.py
|
dibyadhar/Python-MVP
|
a0004bc72330cefea8a707c4342eb666d0404e02
|
[
"MIT"
] | null | null | null |
profanity-detector/test.py
|
dibyadhar/Python-MVP
|
a0004bc72330cefea8a707c4342eb666d0404e02
|
[
"MIT"
] | null | null | null |
profanity-detector/test.py
|
dibyadhar/Python-MVP
|
a0004bc72330cefea8a707c4342eb666d0404e02
|
[
"MIT"
] | null | null | null |
from profanity import read_text
read_text("quotes.txt")
| 14.25
| 31
| 0.807018
| 9
| 57
| 4.888889
| 0.777778
| 0.363636
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.105263
| 57
| 3
| 32
| 19
| 0.862745
| 0
| 0
| 0
| 0
| 0
| 0.175439
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
c22d2240528e7a8615f9e3cb7d824a5dc6832bbf
| 202
|
py
|
Python
|
relm/code_relm/relm/codebase/__init__.py
|
jkapila/paper-codebase
|
35198a924b66299cab0bf405d4f5ab54ca504be9
|
[
"BSD-3-Clause"
] | null | null | null |
relm/code_relm/relm/codebase/__init__.py
|
jkapila/paper-codebase
|
35198a924b66299cab0bf405d4f5ab54ca504be9
|
[
"BSD-3-Clause"
] | null | null | null |
relm/code_relm/relm/codebase/__init__.py
|
jkapila/paper-codebase
|
35198a924b66299cab0bf405d4f5ab54ca504be9
|
[
"BSD-3-Clause"
] | null | null | null |
from .environment import TheEnvironment,RELMEvaluator
from .utils import plot_learning,plot_ROC,plot_pair
from .model_population import ModelParam,Model,ModelPopulation
from .relm_agent import RELMAgent
| 50.5
| 62
| 0.881188
| 26
| 202
| 6.653846
| 0.653846
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.074257
| 202
| 4
| 63
| 50.5
| 0.925134
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
c2398bca1acd60aab111c98c2cf48daeb936900c
| 176
|
py
|
Python
|
auth_service/adapters/db/__init__.py
|
rahungria/clean_arquitecture_auth
|
1d0276c2fd5b83705805dfe33f6781dde3bc064a
|
[
"MIT"
] | 1
|
2022-03-11T21:33:36.000Z
|
2022-03-11T21:33:36.000Z
|
auth_service/adapters/db/__init__.py
|
rahungria/clean_arquitecture_auth
|
1d0276c2fd5b83705805dfe33f6781dde3bc064a
|
[
"MIT"
] | null | null | null |
auth_service/adapters/db/__init__.py
|
rahungria/clean_arquitecture_auth
|
1d0276c2fd5b83705805dfe33f6781dde3bc064a
|
[
"MIT"
] | null | null | null |
from auth_service.adapters.db.user_psql_adapter import UserDBAdapter
from auth_service.main.db import psql_connection_manager
user_db = UserDBAdapter(psql_connection_manager)
| 35.2
| 68
| 0.886364
| 25
| 176
| 5.88
| 0.52
| 0.108844
| 0.204082
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.068182
| 176
| 4
| 69
| 44
| 0.896341
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
dfe51ee5522865053b504473f31973f59560a60f
| 11,247
|
py
|
Python
|
advancepayment/reference.py
|
Ridhosribumi/advancepayment
|
2973d5bc294a2c8eb903facc13528edce39193b2
|
[
"MIT"
] | null | null | null |
advancepayment/reference.py
|
Ridhosribumi/advancepayment
|
2973d5bc294a2c8eb903facc13528edce39193b2
|
[
"MIT"
] | null | null | null |
advancepayment/reference.py
|
Ridhosribumi/advancepayment
|
2973d5bc294a2c8eb903facc13528edce39193b2
|
[
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Ridhosribumi and contributors
# For license information, please see license.txt
# Ridhosribumi August 2019
from __future__ import unicode_literals
import frappe, json
from frappe.utils import nowdate, cstr, flt, now, getdate, add_months
from frappe import msgprint, _
from frappe.model.document import Document
from frappe.model.mapper import get_mapped_doc
@frappe.whitelist()
def get_items_tampungan(related_doc, tipe, percen,company):
si_list = []
item_dp = frappe.get_single('Item Settings').default_item_for_dp
item_child = frappe.db.sql("""select income_account, expense_account from `tabItem Default` where parent =%s and company = %s""",(item_dp,company), as_dict=1)
item = frappe.db.get_value("Item",item_dp,["item_name","description","stock_uom"], as_dict=1)
if tipe == "Down Payment":
so = frappe.db.get_value("Sales Order",related_doc,["total"], as_dict=1)
else:
so = frappe.db.get_value("Delivery Note",related_doc,["total"], as_dict=1)
rate = (flt(percen)/100) * flt(so.total)
rate_round = round(rate, 0)
si_list.append(frappe._dict({
'item_code': item_dp,
'item_name': item.item_name,
'description': item.description,
'qty': 1,
'uom': item.stock_uom,
'rate': rate_round,
'rate1': rate_round,
'amount': rate_round,
'income_account': item_child[0].income_account,
'expense_account': item_child[0].expense_account
}))
return si_list
@frappe.whitelist()
def get_sales_invoice(sales_order, tipe):
invoice_list = frappe.db.sql("""select sales_invoice, posting_date, total, net_total from `tabSales Order Invoice` where docstatus = '1' and parent = %s order by sales_invoice asc""", sales_order, as_dict=True)
si_list = []
for d in invoice_list:
status = frappe.db.get_value("Sales Invoice", d.sales_invoice, "status")
si_list.append(frappe._dict({
'sales_invoice': d.sales_invoice,
'status': status,
'posting_date': d.posting_date,
'total': round(d.total, 0),
'net_total': round(d.net_total, 0)
}))
return si_list
@frappe.whitelist()
def get_sales_invoice2(sales_order,delivery,tipe,total):
if sales_order != 'none':
si_list = []
invoice_list = frappe.db.sql("""select sales_invoice, posting_date, total, net_total from `tabSales Order Invoice` where docstatus = '1' and parent = %s order by sales_invoice asc""",sales_order,as_dict=True)
for d in invoice_list:
total_so = frappe.db.sql("""select net_total as so from `tabSales Order` where docstatus = '1' and name = %s""", sales_order)[0][0]
total_si = (flt(total) / flt(total_so)) * flt(d.total)
net_total = (flt(total) / flt(total_so)) * flt(d.net_total)
status = frappe.db.get_value("Sales Invoice", d.sales_invoice, "status")
si_list.append(frappe._dict({
'sales_invoice': d.sales_invoice,
'status': status,
'posting_date': d.posting_date,
'total': round(total_si, 0),
'net_total': round(net_total, 0)
}))
return si_list
if delivery != 'none':
so = frappe.db.sql("""select distinct(against_sales_order) as so from `tabDelivery Note Item` where docstatus = '1' and parent = %s """, delivery, as_dict=True)
for ss in so:
si_list = []
invoice_list = frappe.db.sql("""select sales_invoice, posting_date, total, net_total from `tabSales Order Invoice` where docstatus = '1' and parent = %s order by sales_invoice asc""", ss.so, as_dict=True)
for d in invoice_list:
total_so = frappe.db.sql("""select net_total as so from `tabSales Order` where docstatus = '1' and `name` = %s """, ss.so)[0][0]
total_si = (flt(total) / flt(total_so)) * flt(d.total)
net_total = (flt(total) / flt(total_so)) * flt(d.net_total)
si_list.append(frappe._dict({
'sales_invoice': d.sales_invoice,
'posting_date': d.posting_date,
'total': round(total_si, 0),
'net_total': round(net_total, 0)
}))
return si_list
@frappe.whitelist()
def get_items_from_pelunasan(sales_order, total_delivery, percen,company):
si_list = []
item_dp = frappe.get_single('Item Settings').default_item_for_dp
item_child = frappe.db.sql("""select income_account, expense_account from `tabItem Default` where parent =%s and company = %s""",(item_dp,company), as_dict=1)
item = frappe.db.get_value("Item", item_dp, ["item_name", "description", "stock_uom"], as_dict=1)
rate = (flt(percen)/100) * flt(total_delivery)
si_list.append(frappe._dict({
'item_code': item_dp,
'item_name': item.item_name,
'description': item.description,
'qty':1,
'uom': item.stock_uom,
'rate': rate,
'amount': rate,
'income_account': item_child[0].income_account,
'expense_account': item_child[0].expense_account
}))
return si_list
@frappe.whitelist()
def get_delivery_note(sales_order):
if sales_order:
dn_list = []
invoice_list = frappe.db.sql("""select distinct(dn.`name`), dn.posting_date, dn.total, dn.net_total from `tabDelivery Note` dn inner join `tabDelivery Note Item` dni on dn.`name` = dni.parent where dn.docstatus = '1' and dni.against_sales_order = %s""", sales_order, as_dict=True)
for d in invoice_list:
dn_list.append(frappe._dict({
'delivery_note': d.name,
'posting_date': d.posting_date,
'total': round(d.total, 0),
'net_total': round(d.net_total, 0)
}))
return dn_list
@frappe.whitelist()
def make_reverse_journal(source_name, target_doc=None):
def set_missing_values(source, target):
target.reversing_entry = 1
target.run_method("set_missing_values")
jv = get_mapped_doc("Journal Entry", source_name, {
"Journal Entry": {
"doctype": "Journal Entry",
"field_map":{
"posting_date": "posting_date"
},
},
"Journal Entry Account": {
"doctype": "Journal Entry Account",
"field_map":{
"credit_in_account_currency": "debit_in_account_currency",
"debit_in_account_currency": "credit_in_account_currency",
},
},
}, target_doc, set_missing_values)
return jv
@frappe.whitelist()
def get_amount_dn(dn, si):
dn_list = []
if si != "None":
inv_date = str(frappe.db.get_value("Sales Invoice", si, "posting_date"))
invoice_date = "%%%s%%" % str(frappe.db.get_value("Sales Invoice", si, "posting_date"))[:-3]
invoice_list = frappe.db.sql("""select distinct(sales_order) from `tabSales Invoice Item` where parent = %s""", si, as_dict=True)
dn_cogs = 0
for sinv in invoice_list:
delivery_list = frappe.db.sql("""select dni.`name` as dn_detail from `tabDelivery Note Item` dni, `tabDelivery Note` dn where dn.`name` = dni.parent and dn.docstatus = '1' and dni.against_sales_order = %s and dn.posting_date like %s""", (sinv.sales_order, invoice_date), as_dict=1)
for dn in delivery_list:
dn_cogs += frappe.db.get_value("Stock Ledger Entry", {"voucher_detail_no":dn.dn_detail}, "(actual_qty * -1 * valuation_rate)")
si_cogs = 0
inv_list = frappe.db.sql("""select * from `tabSales Invoice Item` where parent = %s""", si, as_dict=1)
for inv in inv_list:
count_valuation_rate = frappe.db.get_value("Stock Ledger Entry", {"item_code":inv.item_code, "posting_date": ["<=", inv_date], "warehouse":inv.warehouse}, "count(*)")
if flt(count_valuation_rate) >= 1:
valuation_rate = frappe.db.sql("""select valuation_rate from `tabStock Ledger Entry` where item_code = %s and posting_date <= %s and warehouse = %s order by concat_ws(" ", posting_date, posting_time) desc limit 1""", (inv.item_code, inv_date, inv.warehouse))[0][0]
else:
valuation_rate = 0
si_cogs += flt(inv.stock_qty) * flt(valuation_rate)
total_cogs = flt(si_cogs) - flt(dn_cogs)
else:
total_cogs = frappe.db.get_value("Stock Ledger Entry", {"voucher_no":dn}, "sum(actual_qty * -1 * valuation_rate)")
dn_list.append(frappe._dict({
'debit': flt(total_cogs),
'credit': ''
}))
dn_list.append(frappe._dict({
'credit': total_cogs,
'debit': ''
}))
return dn_list
@frappe.whitelist()
def make_rjv(dn, si):
dn_list = []
if si != "None":
inv_date = str(frappe.db.get_value("Sales Invoice", si, "posting_date"))
invoice_date = "%%%s%%" % str(frappe.db.get_value("Sales Invoice", si, "posting_date"))[:-3]
invoice_list = frappe.db.sql("""select distinct(sales_order) from `tabSales Invoice Item` where parent = %s""", si, as_dict=True)
dn_cogs = 0
for sinv in invoice_list:
delivery_list = frappe.db.sql("""select dni.`name` as dn_detail from `tabDelivery Note Item` dni, `tabDelivery Note` dn where dn.`name` = dni.parent and dn.docstatus = '1' and dni.against_sales_order = %s and dn.posting_date like %s""", (sinv.sales_order, invoice_date), as_dict=1)
for dn in delivery_list:
dn_cogs += frappe.db.get_value("Stock Ledger Entry", {"voucher_detail_no":dn.dn_detail}, "(actual_qty * -1 * valuation_rate)")
si_cogs = 0
inv_list = frappe.db.sql("""select * from `tabSales Invoice Item` where parent = %s""", si, as_dict=1)
for inv in inv_list:
valuation_rate = frappe.db.sql("""select valuation_rate from `tabStock Ledger Entry` where item_code = %s and posting_date <= %s and warehouse = %s order by concat_ws(" ", posting_date, posting_time) desc limit 1""", (inv.item_code, inv_date, inv.warehouse))[0][0]
si_cogs += flt(inv.stock_qty) * flt(valuation_rate)
total_cogs = flt(si_cogs) - flt(dn_cogs)
else:
total_cogs = frappe.db.get_value("Stock Ledger Entry", {"voucher_no":dn}, "sum(actual_qty * -1 * valuation_rate)")
dn_list.append(frappe._dict({
'debit': flt(total_cogs),
'credit': ''
}))
dn_list.append(frappe._dict({
'credit': total_cogs,
'debit': ''
}))
return dn_list
@frappe.whitelist()
def get_amount_si(si):
dn_list = []
si_cogs = frappe.db.get_value("Sales Invoice Item", {"parent":si}, "sum(qty * conversion_factor * cogs)")
list1 = frappe.db.sql("""select net_total as debit from `tabSales Invoice` where `name` = %s""", si, as_dict=True)
for d in list1:
dn_list.append(frappe._dict({
'party_type': 'Customer',
'debit': si_cogs,
'credit': ''
}))
list2 = frappe.db.sql("""select net_total as credit from `tabSales Invoice` where `name` = %s""", si, as_dict=True)
for d in list2:
dn_list.append(frappe._dict({
'party_type': 'Customer',
'debit': '',
'credit': si_cogs
}))
return dn_list
| 48.9
| 293
| 0.631368
| 1,543
| 11,247
| 4.359041
| 0.106286
| 0.04163
| 0.031073
| 0.048023
| 0.789771
| 0.763307
| 0.749926
| 0.717365
| 0.709188
| 0.690752
| 0
| 0.009008
| 0.230106
| 11,247
| 229
| 294
| 49.113537
| 0.767756
| 0.012803
| 0
| 0.699531
| 0
| 0.046948
| 0.327897
| 0.021806
| 0
| 0
| 0
| 0
| 0
| 1
| 0.046948
| false
| 0
| 0.028169
| 0
| 0.122066
| 0.004695
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
5f1a0d727f8daaa4af8929d10ccc5142e354a1db
| 156
|
py
|
Python
|
tests/language-service/snippet_cases/functions.py
|
jaydeetay/pxt
|
aad1beaf15edc46e1327806367298cbc942dcbc1
|
[
"MIT"
] | 977
|
2019-05-06T23:12:55.000Z
|
2022-03-29T19:11:44.000Z
|
tests/language-service/snippet_cases/functions.py
|
jaydeetay/pxt
|
aad1beaf15edc46e1327806367298cbc942dcbc1
|
[
"MIT"
] | 3,980
|
2019-05-09T20:48:14.000Z
|
2022-03-28T20:33:07.000Z
|
tests/language-service/snippet_cases/functions.py
|
jaydeetay/pxt
|
aad1beaf15edc46e1327806367298cbc942dcbc1
|
[
"MIT"
] | 306
|
2016-04-09T05:28:07.000Z
|
2019-05-02T14:23:29.000Z
|
# testNamespace.someFunction
testNamespace.some_function("", 0, False)
# testNamespace.someFunctionWithDefl
testNamespace.some_function_with_defl(5, True)
| 26
| 46
| 0.839744
| 16
| 156
| 7.9375
| 0.6875
| 0.267717
| 0.393701
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.013699
| 0.064103
| 156
| 5
| 47
| 31.2
| 0.856164
| 0.391026
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5f392c3816d967aa6e79b5bc45489cf24e57e292
| 61
|
py
|
Python
|
src/core/__init__.py
|
Bobholamovic/CDLab-PP
|
1fe4262353caf42a08ef1d9c601c9794f430e30c
|
[
"Unlicense"
] | 12
|
2021-12-28T00:48:24.000Z
|
2022-02-20T09:45:02.000Z
|
src/core/__init__.py
|
Bobholamovic/CDLab-PP
|
1fe4262353caf42a08ef1d9c601c9794f430e30c
|
[
"Unlicense"
] | null | null | null |
src/core/__init__.py
|
Bobholamovic/CDLab-PP
|
1fe4262353caf42a08ef1d9c601c9794f430e30c
|
[
"Unlicense"
] | 2
|
2021-12-28T07:08:33.000Z
|
2022-03-28T04:10:53.000Z
|
# Initialize all
from .misc import *
from .builders import *
| 15.25
| 23
| 0.737705
| 8
| 61
| 5.625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.180328
| 61
| 4
| 23
| 15.25
| 0.9
| 0.229508
| 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
| 1
| 0
|
0
| 5
|
a026bdd9941b84522367588763c531890aed9531
| 1,949
|
py
|
Python
|
src/TMscore_test.py
|
h3nnn4n/TMscore.py
|
ed15ca060a4bc69f1e307d27637f56307aa89367
|
[
"MIT"
] | 2
|
2020-12-30T03:19:51.000Z
|
2022-01-22T00:06:43.000Z
|
src/TMscore_test.py
|
h3nnn4n/TMscore.py
|
ed15ca060a4bc69f1e307d27637f56307aa89367
|
[
"MIT"
] | null | null | null |
src/TMscore_test.py
|
h3nnn4n/TMscore.py
|
ed15ca060a4bc69f1e307d27637f56307aa89367
|
[
"MIT"
] | 2
|
2017-12-18T01:55:51.000Z
|
2022-02-16T00:01:04.000Z
|
import pytest
from TMscore import TMscore
def test_init():
tmscore = TMscore("./TMscore")
assert tmscore is not None
def test_init_no_args():
tmscore = TMscore()
assert tmscore is not None
def test_init_wrong_path():
with pytest.raises(FileNotFoundError):
TMscore('this path is bananas')
def test_call():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
data = tmscore.get_all()
assert data['gdt_ha'] == (0.2772, (0.1304, 0.1957, 0.2609, 0.5217))
assert data['gdt_ts'] == (0.4402, (0.1957, 0.2609, 0.5217, 0.7826))
assert data['maxsub'] == 0.3286
assert data['tm_score'] == 0.2875
assert data['rmsd'] == 6.709
def test_get_rmsd():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_rmsd() == 6.709
def test_get_tm_score():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_tm_score() == 0.2875
def test_get_gdt_ts():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ts() == 0.4402
def test_get_gdt_ts_info():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ts_info() == (0.4402, (0.1957, 0.2609, 0.5217, 0.7826))
def test_get_gdt_ha():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ha() == 0.2772
def test_get_gdt_ha_info():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_gdt_ha_info() == (0.2772, (0.1304, 0.1957, 0.2609, 0.5217))
def test_get_maxsub():
tmscore = TMscore("./TMscore")
tmscore("../proteins/1crn.pdb", "../proteins/best.pdb")
assert tmscore.get_maxsub() == 0.3286
| 24.670886
| 82
| 0.639302
| 274
| 1,949
| 4.375912
| 0.175182
| 0.315263
| 0.297748
| 0.186822
| 0.745621
| 0.69558
| 0.665555
| 0.665555
| 0.665555
| 0.665555
| 0
| 0.090235
| 0.169831
| 1,949
| 78
| 83
| 24.987179
| 0.650803
| 0
| 0
| 0.395833
| 0
| 0
| 0.231401
| 0
| 0
| 0
| 0
| 0
| 0.291667
| 1
| 0.229167
| false
| 0
| 0.041667
| 0
| 0.270833
| 0
| 0
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
a0c4c7786c3dd2c6397b897815561afeaed4b1bb
| 120
|
py
|
Python
|
src/iotc/test/__init__.py
|
jimbobbennett/iotc-python-client
|
1f357353d5c370da6d2721c994a2555894c9a142
|
[
"MIT"
] | 3
|
2020-06-30T05:26:54.000Z
|
2021-03-27T07:05:58.000Z
|
src/iotc/test/__init__.py
|
jimbobbennett/iotc-python-client
|
1f357353d5c370da6d2721c994a2555894c9a142
|
[
"MIT"
] | 3
|
2020-06-30T05:46:14.000Z
|
2021-07-05T09:33:02.000Z
|
src/iotc/test/__init__.py
|
jimbobbennett/iotc-python-client
|
1f357353d5c370da6d2721c994a2555894c9a142
|
[
"MIT"
] | 1
|
2021-08-17T22:38:33.000Z
|
2021-08-17T22:38:33.000Z
|
class dummy_storage:
def retrieve(self):
return {}
def persist(self, credentials):
return None
| 17.142857
| 35
| 0.616667
| 13
| 120
| 5.615385
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.3
| 120
| 6
| 36
| 20
| 0.869048
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.4
| false
| 0
| 0
| 0.4
| 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
| 1
| 1
| 0
|
0
| 5
|
26092612300787e4b2bba54774cd934b438b92bc
| 360
|
py
|
Python
|
tests/conftest.py
|
FawziAS/secret-santa
|
64adedbe1fc2d6f76d38d1e5e6ce0b53159ed002
|
[
"Unlicense"
] | 2
|
2021-12-24T09:01:16.000Z
|
2022-03-01T22:43:08.000Z
|
tests/conftest.py
|
FawziAS/secret-santa
|
64adedbe1fc2d6f76d38d1e5e6ce0b53159ed002
|
[
"Unlicense"
] | null | null | null |
tests/conftest.py
|
FawziAS/secret-santa
|
64adedbe1fc2d6f76d38d1e5e6ce0b53159ed002
|
[
"Unlicense"
] | null | null | null |
from pathlib import Path
import pytest
@pytest.fixture(autouse=True)
def tests_directory() -> Path:
return Path(__file__).parent
@pytest.fixture(autouse=True)
def project_root_directory() -> Path:
return Path(__file__).parent.parent
@pytest.fixture(autouse=True)
def test_root_directory(request) -> Path:
return Path(request.config.rootdir)
| 18.947368
| 41
| 0.758333
| 47
| 360
| 5.531915
| 0.425532
| 0.15
| 0.230769
| 0.276923
| 0.588462
| 0.484615
| 0
| 0
| 0
| 0
| 0
| 0
| 0.127778
| 360
| 18
| 42
| 20
| 0.828025
| 0
| 0
| 0.272727
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.272727
| false
| 0
| 0.181818
| 0.272727
| 0.727273
| 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
| 1
| 1
| 0
|
0
| 5
|
2622fc234fba7a3873ecfc0b115338ac22d2517e
| 174
|
py
|
Python
|
bajes/obs/utils/__init__.py
|
jacopok/bajes
|
caa89ce49d29bc6e67ba8b96831fb7ebbcf3e7de
|
[
"MIT"
] | 17
|
2021-02-02T02:43:22.000Z
|
2022-01-02T20:25:51.000Z
|
bajes/obs/utils/__init__.py
|
jacopok/bajes
|
caa89ce49d29bc6e67ba8b96831fb7ebbcf3e7de
|
[
"MIT"
] | 1
|
2021-02-11T11:25:29.000Z
|
2021-02-22T16:07:31.000Z
|
bajes/obs/utils/__init__.py
|
jacopok/bajes
|
caa89ce49d29bc6e67ba8b96831fb7ebbcf3e7de
|
[
"MIT"
] | 3
|
2021-02-03T20:02:33.000Z
|
2021-09-07T23:50:50.000Z
|
#!/usr/bin/env python
from __future__ import absolute_import
__import__("pkg_resources").declare_namespace(__name__)
from .cosmo import Cosmology
from .tov import TOVSolver
| 24.857143
| 55
| 0.827586
| 23
| 174
| 5.608696
| 0.73913
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.091954
| 174
| 6
| 56
| 29
| 0.816456
| 0.114943
| 0
| 0
| 0
| 0
| 0.084967
| 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
| 1
| 0
|
0
| 5
|
262a34fee222e63c79de65d40b58d09932e0139e
| 64
|
py
|
Python
|
bomdia.py
|
felipaoasmoura/estudos_python
|
cabeb0f9d2c391aaf619db7cb0b1556107741c4b
|
[
"MIT"
] | null | null | null |
bomdia.py
|
felipaoasmoura/estudos_python
|
cabeb0f9d2c391aaf619db7cb0b1556107741c4b
|
[
"MIT"
] | null | null | null |
bomdia.py
|
felipaoasmoura/estudos_python
|
cabeb0f9d2c391aaf619db7cb0b1556107741c4b
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
import sys
print('Bom dia, ' + sys.argv[1])
| 10.666667
| 32
| 0.625
| 11
| 64
| 3.636364
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.018519
| 0.15625
| 64
| 6
| 32
| 10.666667
| 0.722222
| 0.25
| 0
| 0
| 0
| 0
| 0.1875
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
| 1
| 0
| 0
| 1
|
0
| 5
|
2634882e67392cc9d7a7ba94a4cbb1debca6fa01
| 252
|
py
|
Python
|
test/solution_tests/HLO/test_hello.py
|
DPNT-Sourcecode/CHK-jkez01
|
5f4eeec8b12704bb25b2d4468e296415100f027d
|
[
"Apache-2.0"
] | null | null | null |
test/solution_tests/HLO/test_hello.py
|
DPNT-Sourcecode/CHK-jkez01
|
5f4eeec8b12704bb25b2d4468e296415100f027d
|
[
"Apache-2.0"
] | null | null | null |
test/solution_tests/HLO/test_hello.py
|
DPNT-Sourcecode/CHK-jkez01
|
5f4eeec8b12704bb25b2d4468e296415100f027d
|
[
"Apache-2.0"
] | null | null | null |
from solutions.HLO import hello_solution
import pytest
class TestHello():
def test_one(self):
assert hello_solution.hello("World") == "Hello, World!"
def test_two(self):
assert hello_solution.hello("John") == "Hello, John!"
| 21
| 63
| 0.674603
| 32
| 252
| 5.15625
| 0.53125
| 0.236364
| 0.181818
| 0.278788
| 0.339394
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.198413
| 252
| 11
| 64
| 22.909091
| 0.816832
| 0
| 0
| 0
| 0
| 0
| 0.135458
| 0
| 0
| 0
| 0
| 0
| 0.285714
| 1
| 0.285714
| false
| 0
| 0.285714
| 0
| 0.714286
| 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
| 1
| 0
|
0
| 5
|
263d8f4eac9efe42d320b957c983e26edbbecec1
| 300
|
py
|
Python
|
ares/inference/__init__.py
|
astrojhgu/ares
|
42008c8e4bf79f0b000cc833e02a86510bce7611
|
[
"MIT"
] | 1
|
2019-01-04T15:13:18.000Z
|
2019-01-04T15:13:18.000Z
|
ares/inference/__init__.py
|
astrojhgu/ares
|
42008c8e4bf79f0b000cc833e02a86510bce7611
|
[
"MIT"
] | null | null | null |
ares/inference/__init__.py
|
astrojhgu/ares
|
42008c8e4bf79f0b000cc833e02a86510bce7611
|
[
"MIT"
] | null | null | null |
from .PriorSet import PriorSet
from .ModelGrid import ModelGrid
from .ModelSample import ModelSample
from .FitGlobal21cm import FitGlobal21cm
#from .AbundanceMatching import AbundanceMatching
from .OptimizeSpectrum import SpectrumOptimization
from .FitLuminosityFunction import FitLuminosityFunction
| 37.5
| 56
| 0.88
| 28
| 300
| 9.428571
| 0.357143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.014706
| 0.093333
| 300
| 7
| 57
| 42.857143
| 0.955882
| 0.16
| 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
| 1
| 0
|
0
| 5
|
265fed90f702f7ee6dcfb3ea3e3d593b07a306d9
| 36,720
|
py
|
Python
|
fricas_kernel.py
|
scios/fricas_kernel
|
1520c9b1fb864ac75b251cad2e11cf666797616e
|
[
"BSD-2-Clause"
] | 2
|
2016-07-18T23:58:23.000Z
|
2016-08-21T03:40:06.000Z
|
fricas_kernel.py
|
scios/fricas_kernel
|
1520c9b1fb864ac75b251cad2e11cf666797616e
|
[
"BSD-2-Clause"
] | null | null | null |
fricas_kernel.py
|
scios/fricas_kernel
|
1520c9b1fb864ac75b251cad2e11cf666797616e
|
[
"BSD-2-Clause"
] | null | null | null |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
__author__ = "Kurt Pagani <nilqed@gmail.com>"
__svn_id__ = "$Id: theKernel.py 3 2015-08-18 03:28:01Z pagani $"
from IPython.kernel.zmq.kernelbase import Kernel
import re, os, tempfile
if os.name == 'nt':
import winpexpect as xp
spawn = xp.winspawn
else:
import pexpect as xp
spawn = xp.spawn
__version__ = '0.5'
#====================#
# User configuration #
#====================#
# theApp
executable = "fricas -nosman"
prompt_pat = "\([0-9]+\) ->"
cont_char = "_"
quit_cmd = ")quit"
readq = ')read "{}" )quiet'
tmpfile_kw = {'prefix':'ax$', 'suffix':'.input', 'delete':False}
type_color = r"blue"
type_size = r"\scriptsize"
tex_color = r"black"
tex_size = r"\normalsize"
# theKernel
_protocol_version_ = '5.0'
_implementation_ = 'fricas_kernel'
_language_ = 'spad'
_language_version_ = '0.1'
_language_info_ = {'name': 'spad', 'mimetype': 'text/plain'}
_banner_ = "FriCAS Kernel"
_help_links_ = {'text': 'FriCAS API', 'url': 'http://fricas.github.io/'}
# Templates (TeX)
pretex1 = r"\(\def\sp{^}\def\sb{_}\def\leqno(#1){}\)"
pretex2 = r"\(\def\erf\{\mathrm{erf}}\def\sinh{\mathrm{sinh}}\)"
pretex3 = r"\(\def\zag#1#2{{{ \left.{#1}\right|}\over{\left|{#2}\right.}}}\)"
pretex4 = r"\(\require{color}\)"
pretex = pretex1+pretex2+pretex3+pretex4
ljax = r"$$" # variants: r"\("
rjax = r"$$" # r"\)"
# texout_types.format(tex_color,tex_size,tex,type_color,type_size,type)
texout_types = r"""
{{\color{{{0}}} {1} {2}}} \\[0.9ex] {{\color{{{3}}} {4} \text{{{5}}}}} \\
"""
# texout.format(tex_color,tex_size,tex)
texout = r"""
{{\color{{{0}}} {1} {2}}}
"""
#==============#
# theApp class #
#==============#
class theApp():
def __init__(self, app = executable, re_prompt = prompt_pat ):
# Store parameters
self.app = app
self.re_prompt = re_prompt
# Define the App process
self.axp = None
# The header/banner read when started
self.banner = None
# The current prompt
self.prompt = None
# Output caught after a command has been sent (always unmodified)
self.output = None
# Last error enountered (0: OK, 1: EOF, 2: TIMEOUT)
self.error = None
# Log file ([win]spawn)
self.logfile = None
def _axp_expect(self):
"""
Return True if the prompt was matched otherwise return False and
set the error = 1 if EOF or error = 2 if TIMEOUT.
"""
self.error = self.axp.expect([self.re_prompt, xp.EOF, xp.TIMEOUT])
if self.error == 0:
self.error = None
return True
else:
return False
def _axp_sendline(self, txt):
"""
Send the text + os.linesep to the App and expect the prompt. Moreover
reset the error state. Return value is as in _axp_expect.
"""
self.error = None
n = self.axp.sendline(txt)
return self._axp_expect()
def start(self, **kwargs):
"""
Action: Start (spawning) theApp.
Return: True or False
The following keywords (kwargs) may be used:
args=[], timeout=30, maxread=2000, searchwindowsize=None
logfile=None, cwd=None, env=None, username=None, domain=None
password=None
For details consult the pexpect manual as this parameters are
the same as in the spawn/winspawn function respectively.
Note: after start one may access the values as follows:
<app_instance>.axp.<keyword>, e.g. a.axp.timeout -> 30.
"""
if self.axp is None:
self.axp = spawn(self.app, **kwargs)
if os.name != "nt" : self.axp.setecho(False)
#error on NT
if self._axp_expect():
self.banner = self.axp.before
self.prompt = self.axp.after
return True
else:
return False
def stop(self):
"""
Stop theApp (the hard way). One may also send the native quit command.
to the App using writeln for example.
The return value is that of the isalive() function.
"""
if self.axp is not None:
self.axp.close()
self.axp = None
return not self.isalive()
def isalive(self):
"""
Check if theApp is running.
"""
if self.axp is not None:
return self.axp.isalive()
else:
return False
def haserror(self):
"""
True if there was an error.
"""
return self.error is not None
def hasoutput(self):
"""
True if there is output.
"""
return self.output is not None
def writeln(self, src):
"""
Write a line to theApp, i.e. as if it were entered into the
interactive console. Output - if any - is (unmodified) stored
in 'output'. Note: src should not contain any control characters;
a newline (in fact os.linesep) will be added automatically.
The continuation character, however, is no problem.
"""
if self._axp_sendline(src):
self.output = self.axp.before
self.prompt = self.axp.after
return True
else:
self.output = None
return False
def writef(self, filename):
"""
Write the content of the file to theApp, i.e. urge theApp to read it
in by itself.
"""
if os.path.isfile(filename):
return self.writeln(readq.format(filename))
else:
return False
def write(self, src): # not needed here
"""
Place the string src into a temp file and call writef, that
is command theApp to read in the temp file. Note: the temp file
will be deleted after having been read into theApp.
This command allows multiline input in SPAD/Aldor form.
"""
tmpf = tempfile.NamedTemporaryFile(**tmpfile_kw)
tmpf.write(src)
tmpf.close()
rc = self.writef(tmpf.name)
os.unlink(tmpf.name)
return rc
#=========================#
# Generic part ends here. #
#=========================#
def cont_check(self, l):
"""
Check if multiline code w. continuation characters is correct.
Note: l = code.split('\n')
"""
b = map(lambda x:x.strip()[-1] == cont_char, l[:-2])
return reduce(lambda x,y:x and y ,b)
def get_code_type(self, code):
"""
Determine the code type:
0 = single line
1 = multiline with continuation
2 = multiline with indentation
"""
l = code.split('\n')
if (len(l) == 2) and (l[1]==''):
return 0
if (len(l) > 2) and self.cont_check(l):
return 1
else:
return 2
def get_index(self, prompt):
"""
Return the number N in the input prompt (N) -> of False.
"""
m = re.match("\(([0-9]+)\)", prompt)
if m is not None and len(m.groups()) == 1:
return int(m.group(1))
else:
return False
def get_type_and_value(self, output = None):
"""
Get index, type and value in the 'output'.
Default is the current output.
"""
if output is None: output = self.output
r = output.strip(" \n").split("Type:")
ri = re.match("^\(([0-9]+)\)", r[0]).group(1)
rv = re.split("^\([0-9]+\)",r[0])[1].strip(" \n")
rv = re.sub("_\n","", rv)
rt = r[1].strip()
return ri, rt, rv
def extract_types(self, data):
"""
Extract the type(s) returned (if any).
"""
ty = re.findall('Type:[a-zA-Z0-9_.\(\) ]*', data)
ty = map(lambda x: x.replace('Type:',''), ty)
return map(lambda x: x.strip(), ty)
def extract_tex(self, data):
"""
Extract TeX code from data.
"""
tex = re.findall('\$\$[^\$]*\$\$', data)
return tex
def remove_tex(self, data, tex = []):
"""
Remove TeX code from data.
"""
for s in tex:
data = data.replace(s,'')
return data
def split_tex(self, data):
"""
Split the output by TeX code into text substrings .
"""
return re.split('\$\$[^\$]*\$\$', data)
def tex_breqn(self, tex):
"""
Transform TeX code for using the breqn package.
Remove 'leqno'.
"""
tex = re.sub(r"\\leqno\(\d*\)", "%", tex)
tex = r"\begin{dmath*}" + "\n" + tex + "\n" + r"\end{dmath*}"
return tex
#Issues: setecho in winpexpect!
#theKernel
#=================#
# theKernel class #
#=================#
class theKernel(Kernel):
implementation = _implementation_
implementation_version = __version__
language = _language_
language_version = _language_version_
language_info = _language_info_
banner = _banner_
# help_links = _help_links_
# protocol_version = _protocol_version_
def __init__(self, **kwargs):
Kernel.__init__(self, **kwargs)
self.app = theApp()
self.app.start()
def do_execute(self, code, silent, store_history = True,
user_expressions = None, allow_stdin = False):
if not code.strip():
return {'status': 'ok', 'execution_count': self.execution_count,
'payload': [], 'user_expressions': {}}
try:
if code.strip() == quit_cmd:
return self.do_shutdown(False)
if code.startswith(")python"):
# compile/exec , namespaces ?
result = str(eval(code.replace(")python","").lstrip()))
data = {'text/plain':result}
display_data = {'source':'me', 'data':data, 'metadata':{}}
self.send_response(self.iopub_socket, 'display_data', display_data)
return {'status': 'ok', 'execution_count': self.execution_count,
'payload': [], 'user_expressions': {}}
if code.startswith(")logo"):
data = {'image/png':logo}
display_data = {'source':'me', 'data':data, 'metadata':{}}
self.send_response(self.iopub_socket, 'display_data', display_data)
return {'status': 'ok', 'execution_count': self.execution_count,
'payload': [], 'user_expressions': {}}
if code.startswith(")plot"):
try:
import matplotlib.pyplot as plt
from io import BytesIO
import base64
except:
return False
plt.figure()
plt.plot([1,2,3,4,5,6,7], [1,4,9,16,25,36,49])
plt.title('PyPlot Test')
#
figfile = BytesIO()
plt.savefig(figfile, format='png')
figfile.seek(0) # rewind
figdata_png = base64.b64encode(figfile.getvalue())
#
# <img src="data:image/png;base64,{{ result }}"\>
#
data = {'image/png':figdata_png}
display_data = {'source':'me', 'data':data, 'metadata':{}}
self.send_response(self.iopub_socket, 'display_data', display_data)
return {'status': 'ok', 'execution_count': self.execution_count,
'payload': [], 'user_expressions': {}}
if self.app.get_code_type(code) == 2:
self.app.write(code)
else:
self.app.writeln(code.rstrip())
if self.app.hasoutput:
output = self.app.output
tex = self.app.extract_tex(output)
else:
output = None
if tex == []:
data = {'text/plain':output}
else:
ty = self.app.extract_types(output)
if len(ty) >= len(tex):
b = ""
for j in range(0,len(tex)):
b += texout_types.format(tex_color,tex_size,
tex[j].strip().strip('$$'), type_color,
type_size, ty[j])
texstr = pretex + ljax + b + rjax
data = {'text/plain':output,'text/latex':texstr}
else:
b = ""
for j in range(0,len(tex)):
b += texout.format(tex_color,tex_size,
tex[j].strip().strip('$$'))
texstr = pretex + ljax + b + rjax
data = {'text/plain':output,'text/latex':texstr}
if not silent:
display_data = {'source':'pax', 'data':data, 'metadata':{}}
self.send_response(self.iopub_socket, 'display_data', display_data)
if interrupted:
return {'status': 'abort', 'execution_count': self.execution_count}
except:
self.app.output = None
try:
exitcode = 0
if not self.app.isalive():
exitcode = 1
except Exception:
exitcode = 1
if exitcode:
return {'status': 'error', 'execution_count': self.execution_count,
'ename': '', 'evalue': str(exitcode), 'traceback': []}
else:
return {'status': 'ok', 'execution_count': self.execution_count,
'payload': [], 'user_expressions': {}}
def do_complete(self, code, cursor_pos):
code = code[:cursor_pos]
default = {'matches': [], 'cursor_start': 0,
'cursor_end': cursor_pos, 'metadata': dict(),
'status': 'ok'}
if not code or code[-1] == ' ':
return default
tokens = code.replace(';', ' ').split()
if not tokens:
return default
token = tokens[-1]
start = cursor_pos - len(token)
cmd = ')what operations %s' % token
self.app.writeln(cmd)
if self.app.hasoutput():
output = self.app.output.rstrip()
matches = output.split()
if not matches:
return default
matches = [m for m in matches if m.startswith(token)]
return {'matches': matches, 'cursor_start': start,
'cursor_end': cursor_pos, 'metadata': dict(),
'status': 'ok'}
def do_inspect(self, code, cursor_pos, detail_level=0):
data = dict()
if (not code or not len(code) >= cursor_pos or
not code[cursor_pos - 1] == '('):
return {'status': 'ok', 'data': data, 'metadata': dict()}
else:
token = code[:cursor_pos - 1].split()[-1]
self.app.writeln(")d op " + token)
docstring = self.app.output
self.app.output = None
if docstring:
data = {'text/plain': docstring}
#attention: msg changed in version 5.0
return {'status': 'ok', 'found': True,
'data': data, 'metadata': dict()}
def do_shutdown(self, restart):
"Changes in 5.0: <data> replaced by <text>"
output = "-- Bye. Kernel shutdown "
stream_content = {'name': 'stdout', 'text': output}
self.send_response(self.iopub_socket, 'stream', stream_content)
self.app.stop()
return {'restart': False}
#import base64
#with open("t.png", "rb") as imageFile:
# str = base64.b64encode(imageFile.read())
# print str
logo = """iVBORw0KGgoAAAANSUhEUgAAAOQAAAAwCAYAAAAB+Na0AAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB98IEgEMIp3LtFAAACAASURBVHjazJ13nF1Hefe/M6fdfu927Uq7KpYbNlYzNq6YZtMDoYQXbGzT/BI6IRDAiYHQDCGQQGIgGLCRSQghAULowYAxGNuyLHdZXdq+e7fcfk+Zef845+7erVpZknlnP0e72nLOnJnnmed5fk8TLDK270JWapw/VeQKNE8FzpCSdiFIK4XQi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ernelApp
IPKernelApp.launch_instance(kernel_class=theKernel)
| 66.763636
| 20,877
| 0.774346
| 2,488
| 36,720
| 11.342846
| 0.432878
| 0.005209
| 0.003473
| 0.006697
| 0.053152
| 0.048404
| 0.044541
| 0.043478
| 0.036746
| 0.034265
| 0
| 0.107809
| 0.144172
| 36,720
| 549
| 20,878
| 66.885246
| 0.790206
| 0.087037
| 0
| 0.272109
| 0
| 0.010204
| 0.681894
| 0.639375
| 0
| 1
| 0
| 0
| 0
| 1
| 0.085034
| false
| 0
| 0.027211
| 0
| 0.285714
| 0
| 0
| 0
| 1
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
cd0460a6321b6491b0c98643c51a6b60dc943fa4
| 121
|
py
|
Python
|
offer/admin.py
|
divyesh1099/badboystyle
|
f4fec0858b43e14f0e1f173261f363d4262c28ea
|
[
"MIT"
] | null | null | null |
offer/admin.py
|
divyesh1099/badboystyle
|
f4fec0858b43e14f0e1f173261f363d4262c28ea
|
[
"MIT"
] | null | null | null |
offer/admin.py
|
divyesh1099/badboystyle
|
f4fec0858b43e14f0e1f173261f363d4262c28ea
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from offer.models import Offer
# Register your models here.
admin.site.register(Offer)
| 20.166667
| 32
| 0.809917
| 18
| 121
| 5.444444
| 0.611111
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123967
| 121
| 6
| 33
| 20.166667
| 0.924528
| 0.214876
| 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
| 1
| 0
|
0
| 5
|
cd068519ad066e19b201690189aff6a0d901e84e
| 287
|
py
|
Python
|
scripts/serializers.py
|
akxen/nemde-worker
|
1a6e4f654ce7378b9a56f8985b916f1e8cbe8098
|
[
"Apache-2.0"
] | null | null | null |
scripts/serializers.py
|
akxen/nemde-worker
|
1a6e4f654ce7378b9a56f8985b916f1e8cbe8098
|
[
"Apache-2.0"
] | null | null | null |
scripts/serializers.py
|
akxen/nemde-worker
|
1a6e4f654ce7378b9a56f8985b916f1e8cbe8098
|
[
"Apache-2.0"
] | null | null | null |
"""Custom serializers"""
import json
class JSONSerializer:
@staticmethod
def dumps(*args, **kwargs):
return json.dumps(*args, **kwargs).encode('utf-8')
@staticmethod
def loads(s, *args, **kwargs):
return json.loads(s.decode('utf-8'), *args, **kwargs)
| 20.5
| 61
| 0.620209
| 34
| 287
| 5.235294
| 0.529412
| 0.224719
| 0.168539
| 0.224719
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008734
| 0.202091
| 287
| 13
| 62
| 22.076923
| 0.768559
| 0.062718
| 0
| 0.25
| 0
| 0
| 0.038023
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.125
| 0.25
| 0.75
| 0
| 0
| 0
| 0
| null | 1
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
cd113f44e83c038cd0630a686e5d6557ceb54c81
| 49
|
py
|
Python
|
ox_profile/ui/__init__.py
|
SergeyPiskunov/ox_profile
|
6959c1e96fb24b2996f8b31e0167ff6f16d4aabd
|
[
"MIT"
] | 17
|
2019-04-25T00:30:20.000Z
|
2020-08-28T21:09:28.000Z
|
ox_profile/ui/__init__.py
|
SergeyPiskunov/ox_profile
|
6959c1e96fb24b2996f8b31e0167ff6f16d4aabd
|
[
"MIT"
] | 2
|
2019-09-22T15:14:53.000Z
|
2019-10-05T22:29:01.000Z
|
ox_profile/ui/__init__.py
|
SergeyPiskunov/ox_profile
|
6959c1e96fb24b2996f8b31e0167ff6f16d4aabd
|
[
"MIT"
] | 2
|
2019-07-07T11:42:04.000Z
|
2019-08-10T09:51:14.000Z
|
"""Package for user interfaces to ox_profile.
"""
| 24.5
| 45
| 0.734694
| 7
| 49
| 5
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122449
| 49
| 2
| 46
| 24.5
| 0.813953
| 0.857143
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
cd382c20e15e7dc9daa9c798a75938e1294c230d
| 125
|
py
|
Python
|
src/camera.py
|
thebruce87/Photobooth
|
43ba9e9537bd51040c2cb2ffb809d7a8ca0633ef
|
[
"MIT"
] | null | null | null |
src/camera.py
|
thebruce87/Photobooth
|
43ba9e9537bd51040c2cb2ffb809d7a8ca0633ef
|
[
"MIT"
] | null | null | null |
src/camera.py
|
thebruce87/Photobooth
|
43ba9e9537bd51040c2cb2ffb809d7a8ca0633ef
|
[
"MIT"
] | null | null | null |
import subprocess
class Camera():
def __init__(self):
pass
def captureAndDownload(filename = 'capture.jpg'):
pass
| 12.5
| 50
| 0.712
| 14
| 125
| 6.071429
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.184
| 125
| 9
| 51
| 13.888889
| 0.833333
| 0
| 0
| 0.333333
| 0
| 0
| 0.088
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0.333333
| 0.166667
| 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
| 1
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
cd41a7363e39ec5857330fc09a68e1c3ca0162f1
| 133
|
py
|
Python
|
pypci/__init__.py
|
AEW2015/pypci
|
317e1ad1fe1fddf937fe19d7dead37b8533953d7
|
[
"MIT"
] | 2
|
2020-04-20T15:12:06.000Z
|
2020-06-04T08:04:39.000Z
|
pypci/__init__.py
|
AEW2015/pypci
|
317e1ad1fe1fddf937fe19d7dead37b8533953d7
|
[
"MIT"
] | null | null | null |
pypci/__init__.py
|
AEW2015/pypci
|
317e1ad1fe1fddf937fe19d7dead37b8533953d7
|
[
"MIT"
] | 2
|
2020-07-08T10:05:27.000Z
|
2021-02-27T14:59:11.000Z
|
__version__ = '0.1.3'
try:
from .pypci import lspci
from .pypci import read
from .pypci import write
except:
pass
| 12.090909
| 28
| 0.646617
| 19
| 133
| 4.315789
| 0.684211
| 0.329268
| 0.54878
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.03125
| 0.278195
| 133
| 10
| 29
| 13.3
| 0.822917
| 0
| 0
| 0
| 0
| 0
| 0.037879
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0.142857
| 0.428571
| 0
| 0.428571
| 0
| 1
| 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
| 1
| 0
| 0
| 0
|
0
| 5
|
cd5690ce108881d5ac087cc2e5f6834083ecdec1
| 8,544
|
py
|
Python
|
tests/test_conversion.py
|
zapatacomputing/z-quantum-qubo
|
eda4db91c696f3252dcb0cb69938845c6856e099
|
[
"Apache-2.0"
] | 2
|
2021-01-22T18:38:47.000Z
|
2021-11-17T11:36:54.000Z
|
tests/test_conversion.py
|
zapatacomputing/z-quantum-qubo
|
eda4db91c696f3252dcb0cb69938845c6856e099
|
[
"Apache-2.0"
] | 15
|
2021-01-29T20:22:46.000Z
|
2022-03-30T21:40:45.000Z
|
tests/test_conversion.py
|
zapatacomputing/z-quantum-qubo
|
eda4db91c696f3252dcb0cb69938845c6856e099
|
[
"Apache-2.0"
] | 1
|
2021-01-22T18:40:03.000Z
|
2021-01-22T18:40:03.000Z
|
from openfermion.ops.operators.ising_operator import IsingOperator
import pytest
import numpy as np
import dimod
from zquantum.qubo.conversions import (
convert_qubo_to_openfermion_ising,
convert_openfermion_ising_to_qubo,
convert_sampleset_to_measurements,
convert_measurements_to_sampleset,
)
from zquantum.core.measurement import Measurements
def test_qubo_conversion_with_binary_fractions():
qubo = dimod.BinaryQuadraticModel(
{0: 1, 1: 2, 2: 3},
{(1, 2): 0.5, (1, 0): -0.25, (0, 2): 2.125},
-1,
vartype=dimod.BINARY,
)
ising = convert_qubo_to_openfermion_ising(qubo)
new_qubo = convert_openfermion_ising_to_qubo(ising)
assert qubo == new_qubo
def test_qubo_conversion_with_non_binary_fractions():
qubo = dimod.BinaryQuadraticModel(
{0: 1.01, 1: -2.03, 2: 3},
{(1, 2): 0.51, (1, 0): -0.9, (0, 2): 2.125},
-1,
vartype=dimod.BINARY,
)
ising = convert_qubo_to_openfermion_ising(qubo)
new_qubo = convert_openfermion_ising_to_qubo(ising)
assert len(qubo.linear) == len(new_qubo.linear)
assert len(qubo.quadratic) == len(new_qubo.quadratic)
assert np.isclose(qubo.offset, new_qubo.offset)
assert qubo.vartype == new_qubo.vartype
for key in qubo.linear.keys():
assert np.isclose(qubo.linear[key], new_qubo.linear[key])
for key in qubo.quadratic.keys():
assert np.isclose(qubo.quadratic[key], new_qubo.quadratic[key])
def test_converted_ising_evaluates_to_the_same_energy_as_original_qubo():
qubo = dimod.BinaryQuadraticModel(
{0: 1, 1: 2, 2: 3},
{
(0, 1): 1,
(0, 2): 0.5,
(1, 2): 0.5,
},
-1,
vartype=dimod.BINARY,
)
all_solutions = [
[0, 0, 0],
[0, 0, 1],
[0, 1, 0],
[0, 1, 1],
[1, 0, 0],
[1, 0, 1],
[1, 1, 0],
[1, 1, 1],
]
ising = convert_qubo_to_openfermion_ising(qubo)
for solution in all_solutions:
qubo_energy = qubo.energy(solution)
ising_energy = np.sum(
Measurements([solution]).get_expectation_values(ising).values
)
assert qubo_energy == ising_energy
def test_converted_qubo_evaluates_to_the_same_energy_as_original_ising():
ising = IsingOperator(
"2.5 [] + [Z0] + 2[Z0 Z1] +0.5[Z0 Z2] +[Z1] + 0.75[Z1 Z2] -[Z2]"
)
all_solutions = [
[0, 0, 0],
[0, 0, 1],
[0, 1, 0],
[0, 1, 1],
[1, 0, 0],
[1, 0, 1],
[1, 1, 0],
[1, 1, 1],
]
qubo = convert_openfermion_ising_to_qubo(ising)
for solution in all_solutions:
qubo_energy = qubo.energy(solution)
ising_energy = np.sum(
Measurements([solution]).get_expectation_values(ising).values
)
assert qubo_energy == ising_energy
def test_convert_sampleset_to_measurements():
bitstrings = [
(0, 0, 0),
(0, 0, 1),
(0, 1, 0),
(0, 1, 1),
(1, 0, 0),
(1, 1, 0),
(1, 1, 1),
(1, 0, 1),
(0, 0, 1),
]
energies = [0 for i in range(len(bitstrings))]
sampleset = dimod.SampleSet.from_samples(bitstrings, dimod.BINARY, energies)
target_measurements = Measurements(bitstrings)
converted_measurements = convert_sampleset_to_measurements(sampleset)
assert converted_measurements.bitstrings == target_measurements.bitstrings
def test_convert_sampleset_to_measurements_with_change_bitstring_convention():
bitstrings = [
(0, 0, 0),
(0, 0, 1),
(0, 1, 0),
(0, 1, 1),
(1, 0, 0),
(1, 1, 0),
(1, 1, 1),
(1, 0, 1),
(0, 0, 1),
]
target_bitstrings = [
(1, 1, 1),
(1, 1, 0),
(1, 0, 1),
(1, 0, 0),
(0, 1, 1),
(0, 0, 1),
(0, 0, 0),
(0, 1, 0),
(1, 1, 0),
]
change_bitstring_convention = True
energies = [0 for i in range(len(bitstrings))]
sampleset = dimod.SampleSet.from_samples(bitstrings, dimod.BINARY, energies)
target_measurements = Measurements(target_bitstrings)
converted_measurements = convert_sampleset_to_measurements(
sampleset, change_bitstring_convention=change_bitstring_convention
)
assert converted_measurements.bitstrings == target_measurements.bitstrings
def test_convert_sampleset_to_measurements_fails_for_non_binary_vartype():
bitstrings = [
(0, 0, 0),
]
energies = [0 for _ in range(len(bitstrings))]
sampleset = dimod.SampleSet.from_samples(bitstrings, dimod.SPIN, energies)
with pytest.raises(Exception):
converted_measurements = convert_sampleset_to_measurements(sampleset)
def test_convert_sampleset_to_measurements_fails_for_non_int_variables():
bitstrings = [
(0, 0, 0),
]
energies = [0 for _ in range(len(bitstrings))]
sampleset = dimod.SampleSet.from_samples(bitstrings, dimod.SPIN, energies)
sampleset = sampleset.relabel_variables({0: 0.0, 1: 0.1, 2: 0.2})
with pytest.raises(Exception):
converted_measurements = convert_sampleset_to_measurements(sampleset)
def test_convert_sampleset_to_measurements_fails_for_variables_from_wrong_range():
bitstrings = [
(0, 0, 0),
]
energies = [0 for _ in range(len(bitstrings))]
sampleset = dimod.SampleSet.from_samples(bitstrings, dimod.SPIN, energies)
sampleset = sampleset.relabel_variables({0: 1, 1: 2, 2: 3})
with pytest.raises(Exception):
converted_measurements = convert_sampleset_to_measurements(sampleset)
def test_convert_measurements_to_sampleset_without_qubo():
bitstrings = [
(0, 0, 0),
(0, 0, 1),
(0, 1, 0),
(0, 1, 1),
(1, 0, 0),
(1, 1, 0),
(1, 1, 1),
(1, 0, 1),
(0, 0, 1),
]
measurements = Measurements(bitstrings)
target_sampleset = dimod.SampleSet.from_samples(
bitstrings, dimod.BINARY, [np.nan for _ in bitstrings]
)
converted_sampleset = convert_measurements_to_sampleset(measurements)
# Since energies should be np.nans, using "==" will result in error
for (target_record, converted_record) in zip(
target_sampleset.record, converted_sampleset.record
):
for target_element, converted_element in zip(target_record, converted_record):
np.testing.assert_equal(target_element, converted_element)
assert converted_sampleset.vartype == target_sampleset.vartype
def test_convert_measurements_to_sampleset_with_change_bitstring_convention():
bitstrings = [
(0, 0, 0),
(0, 0, 1),
(0, 1, 0),
(0, 1, 1),
(1, 0, 0),
(1, 1, 0),
(1, 1, 1),
(1, 0, 1),
(0, 0, 1),
]
target_bitstrings = [
(1, 1, 1),
(1, 1, 0),
(1, 0, 1),
(1, 0, 0),
(0, 1, 1),
(0, 0, 1),
(0, 0, 0),
(0, 1, 0),
(1, 1, 0),
]
change_bitstring_convention = True
measurements = Measurements(bitstrings)
target_sampleset = dimod.SampleSet.from_samples(
target_bitstrings, dimod.BINARY, [np.nan for _ in bitstrings]
)
converted_sampleset = convert_measurements_to_sampleset(
measurements, change_bitstring_convention=change_bitstring_convention
)
# Since energies should be np.nans, using "==" will result in error
for (target_record, converted_record) in zip(
target_sampleset.record, converted_sampleset.record
):
for target_element, converted_element in zip(target_record, converted_record):
np.testing.assert_equal(target_element, converted_element)
assert converted_sampleset.vartype == target_sampleset.vartype
def test_convert_measurements_to_sampleset_with_qubo():
bitstrings = [
(0, 0, 0),
(0, 0, 1),
(0, 1, 0),
(0, 1, 1),
(1, 0, 0),
(1, 1, 0),
(1, 1, 1),
(1, 0, 1),
(0, 0, 1),
]
qubo = dimod.BinaryQuadraticModel(
{0: 1, 1: 2, 2: 3},
{(1, 2): 0.5, (1, 0): -0.25, (0, 2): 2.125},
0,
vartype=dimod.BINARY,
)
energies = [0, 3, 2, 5.5, 1, 2.75, 8.375, 6.125, 3]
measurements = Measurements(bitstrings)
target_sampleset = dimod.SampleSet.from_samples(bitstrings, dimod.BINARY, energies)
converted_sampleset = convert_measurements_to_sampleset(measurements, qubo)
assert target_sampleset == converted_sampleset
| 29.666667
| 87
| 0.610253
| 1,087
| 8,544
| 4.562098
| 0.097516
| 0.028232
| 0.019964
| 0.016939
| 0.845735
| 0.812664
| 0.779794
| 0.726356
| 0.698125
| 0.671708
| 0
| 0.061972
| 0.265332
| 8,544
| 287
| 88
| 29.770035
| 0.728055
| 0.015332
| 0
| 0.668033
| 0
| 0.004098
| 0.007372
| 0
| 0
| 0
| 0
| 0
| 0.065574
| 1
| 0.04918
| false
| 0
| 0.02459
| 0
| 0.07377
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 5
|
2699bec2267d932c578d74f4c73047cde31f4273
| 98
|
py
|
Python
|
backend/core/views/errors.py
|
block-id/wallet
|
b5479df7df0e5b5733f0ae262ffc17f9b923347d
|
[
"Apache-2.0"
] | null | null | null |
backend/core/views/errors.py
|
block-id/wallet
|
b5479df7df0e5b5733f0ae262ffc17f9b923347d
|
[
"Apache-2.0"
] | null | null | null |
backend/core/views/errors.py
|
block-id/wallet
|
b5479df7df0e5b5733f0ae262ffc17f9b923347d
|
[
"Apache-2.0"
] | 1
|
2021-12-31T17:27:44.000Z
|
2021-12-31T17:27:44.000Z
|
from django.http.response import Http404
def http_404(request):
raise Http404("Not found.")
| 16.333333
| 40
| 0.744898
| 14
| 98
| 5.142857
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.108434
| 0.153061
| 98
| 5
| 41
| 19.6
| 0.759036
| 0
| 0
| 0
| 0
| 0
| 0.102041
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| 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
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
26b162ac1fc0730e085c5db5e49eb77197bd6607
| 132
|
py
|
Python
|
Ene-Jun-2019/Ejemplos/Code Golf/albertos-solution.py
|
Arbupa/DAS_Sistemas
|
52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1
|
[
"MIT"
] | 41
|
2017-09-26T09:36:32.000Z
|
2022-03-19T18:05:25.000Z
|
Ene-Jun-2019/Ejemplos/Code Golf/albertos-solution.py
|
Arbupa/DAS_Sistemas
|
52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1
|
[
"MIT"
] | 67
|
2017-09-11T05:06:12.000Z
|
2022-02-14T04:44:04.000Z
|
Ene-Jun-2019/Ejemplos/Code Golf/albertos-solution.py
|
Arbupa/DAS_Sistemas
|
52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1
|
[
"MIT"
] | 210
|
2017-09-01T00:10:08.000Z
|
2022-03-19T18:05:12.000Z
|
for j in [6,11,4,19,61,100,1001,5001,55556,777778]:
print(' '.join([str(i) for i in range(1,j)]),end='' if j==777778 else '\n')
| 44
| 79
| 0.598485
| 29
| 132
| 2.724138
| 0.793103
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.324561
| 0.136364
| 132
| 2
| 80
| 66
| 0.368421
| 0
| 0
| 0
| 0
| 0
| 0.022727
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0.5
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 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
| 1
|
0
| 5
|
26f27d246b84c463c6fe5304aa037e7f4d523d15
| 200
|
py
|
Python
|
tests/test_testTime.py
|
aaronaddleman/python-experiments
|
ab79790bbb604e54f7c4fd64ee905a313b6ad913
|
[
"MIT"
] | null | null | null |
tests/test_testTime.py
|
aaronaddleman/python-experiments
|
ab79790bbb604e54f7c4fd64ee905a313b6ad913
|
[
"MIT"
] | null | null | null |
tests/test_testTime.py
|
aaronaddleman/python-experiments
|
ab79790bbb604e54f7c4fd64ee905a313b6ad913
|
[
"MIT"
] | null | null | null |
import pytest
from testTime import EpochTime
def test_EpochTime():
newtime = EpochTime(t=1605679892756, unit='milliseconds_since_epoch', divide_by=1000)
assert isinstance(newtime, EpochTime)
| 28.571429
| 89
| 0.795
| 24
| 200
| 6.458333
| 0.791667
| 0.206452
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.097143
| 0.125
| 200
| 6
| 90
| 33.333333
| 0.788571
| 0
| 0
| 0
| 0
| 0
| 0.12
| 0.12
| 0
| 0
| 0
| 0
| 0.2
| 1
| 0.2
| false
| 0
| 0.4
| 0
| 0.6
| 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
| 1
| 0
|
0
| 5
|
f82830bf1853f6e34aad287960a585b412b624aa
| 150
|
py
|
Python
|
toolbox/scraper/admin.py
|
akshedu/toolbox
|
7c647433b68f1098ee4c8623f836f74785dc970c
|
[
"MIT"
] | null | null | null |
toolbox/scraper/admin.py
|
akshedu/toolbox
|
7c647433b68f1098ee4c8623f836f74785dc970c
|
[
"MIT"
] | null | null | null |
toolbox/scraper/admin.py
|
akshedu/toolbox
|
7c647433b68f1098ee4c8623f836f74785dc970c
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
# Register your models here.
from toolbox.scraper.models import TrackedChannel
admin.site.register(TrackedChannel)
| 21.428571
| 49
| 0.833333
| 19
| 150
| 6.578947
| 0.684211
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.106667
| 150
| 6
| 50
| 25
| 0.932836
| 0.173333
| 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
| 1
| 0
|
0
| 5
|
f859690dd0d990d0138623d909668f78cc8aadce
| 162
|
py
|
Python
|
locker/admin.py
|
alexhong121/ai_cupboard
|
50baa791c969b951de5b47d980e19c0df3c04e7f
|
[
"MIT"
] | null | null | null |
locker/admin.py
|
alexhong121/ai_cupboard
|
50baa791c969b951de5b47d980e19c0df3c04e7f
|
[
"MIT"
] | null | null | null |
locker/admin.py
|
alexhong121/ai_cupboard
|
50baa791c969b951de5b47d980e19c0df3c04e7f
|
[
"MIT"
] | null | null | null |
from django.contrib import admin
from locker.models import Cabinet,Lockers
# Register your models here.
admin.site.register(Cabinet)
admin.site.register(Lockers)
| 27
| 41
| 0.82716
| 23
| 162
| 5.826087
| 0.565217
| 0.134328
| 0.253731
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.092593
| 162
| 6
| 42
| 27
| 0.911565
| 0.160494
| 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
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
f88d9e3c04a2015ae56977d7b88c77b5c30b9596
| 1,347
|
py
|
Python
|
rvpvp/isa/rvv/vwxxx_wx.py
|
ultrafive/riscv-pvp
|
843e38422c3d545352b955764927d5e7847e5453
|
[
"Unlicense"
] | 5
|
2021-05-10T09:57:00.000Z
|
2021-10-05T14:39:20.000Z
|
rvpvp/isa/rvv/vwxxx_wx.py
|
ultrafive/riscv-pvp
|
843e38422c3d545352b955764927d5e7847e5453
|
[
"Unlicense"
] | null | null | null |
rvpvp/isa/rvv/vwxxx_wx.py
|
ultrafive/riscv-pvp
|
843e38422c3d545352b955764927d5e7847e5453
|
[
"Unlicense"
] | 1
|
2021-05-14T20:24:11.000Z
|
2021-05-14T20:24:11.000Z
|
from ...isa.inst import *
import numpy as np
class Vwadd_wx(Inst):
name = 'vwadd.wx'
# vwadd.wx vd, vs2, rs1, vm
def golden(self):
if self['vl']==0:
return self['ori']
result = self['ori'].copy()
maskflag = 1 if 'mask' in self else 0
vstart = self['vstart'] if 'vstart' in self else 0
print("vstart = "+str(vstart))
print("vl = "+str(self['vl']))
for ii in range(vstart, self['vl']):
if (maskflag == 0) or (maskflag == 1 and np.unpackbits(self['mask'], bitorder='little')[ii] ):
result[ii] = self['vs2'][ii].astype(object) + self['rs1']
return result
class Vwaddu_wx(Vwadd_wx):
name = 'vwaddu.wx'
class Vwsub_wx(Inst):
name = 'vwsub.wx'
# vwsub.wx vd, vs2, rs1, vm
def golden(self):
if self['vl']==0:
return self['ori']
result = self['ori'].copy()
maskflag = 1 if 'mask' in self else 0
vstart = self['vstart'] if 'vstart' in self else 0
for ii in range(vstart, self['vl']):
if (maskflag == 0) or (maskflag == 1 and np.unpackbits(self['mask'], bitorder='little')[ii] ):
result[ii] = self['vs2'][ii].astype(object) - self['rs1']
return result
class Vwsubu_wx(Vwsub_wx):
name = 'vwsubu.wx'
| 32.853659
| 106
| 0.533036
| 185
| 1,347
| 3.848649
| 0.248649
| 0.042135
| 0.05618
| 0.061798
| 0.738764
| 0.738764
| 0.738764
| 0.738764
| 0.738764
| 0.738764
| 0
| 0.021299
| 0.302895
| 1,347
| 40
| 107
| 33.675
| 0.736954
| 0.039347
| 0
| 0.5625
| 0
| 0
| 0.107143
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.0625
| false
| 0
| 0.0625
| 0
| 0.5
| 0.0625
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
f8a2c00a26b699a980abe9f34df4fe3f40d2731a
| 143
|
py
|
Python
|
example1/hello.py
|
dddiaz/cg-python-demo
|
f83658b2d4b5419c3f07555aa91688c0608a1f03
|
[
"MIT"
] | null | null | null |
example1/hello.py
|
dddiaz/cg-python-demo
|
f83658b2d4b5419c3f07555aa91688c0608a1f03
|
[
"MIT"
] | null | null | null |
example1/hello.py
|
dddiaz/cg-python-demo
|
f83658b2d4b5419c3f07555aa91688c0608a1f03
|
[
"MIT"
] | null | null | null |
def hello():
# Hey i'm a comment
# I am a helpful note for humans, and will not be ran
pass
if __name__ == '__main__':
hello()
| 20.428571
| 57
| 0.608392
| 24
| 143
| 3.291667
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.293706
| 143
| 7
| 58
| 20.428571
| 0.782178
| 0.482517
| 0
| 0
| 0
| 0
| 0.111111
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| true
| 0.25
| 0
| 0
| 0.25
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
f8a5760be5357464fc406cd7681052085a0bcf64
| 114
|
py
|
Python
|
dlpfs/__init__.py
|
IBM/data-leakage-prevention-filesystem
|
9b3c0fb2692512dbc0066825162aa0852d7ae883
|
[
"Apache-2.0"
] | 10
|
2022-03-04T08:46:42.000Z
|
2022-03-22T15:28:25.000Z
|
dlpfs/__init__.py
|
IBM/data-leakage-prevention-filesystem
|
9b3c0fb2692512dbc0066825162aa0852d7ae883
|
[
"Apache-2.0"
] | null | null | null |
dlpfs/__init__.py
|
IBM/data-leakage-prevention-filesystem
|
9b3c0fb2692512dbc0066825162aa0852d7ae883
|
[
"Apache-2.0"
] | 1
|
2022-03-04T09:25:55.000Z
|
2022-03-04T09:25:55.000Z
|
from .loopback import Loopback # noqa
from .dataleakageprevention import DataLeakagePreventionFileSystem # noqa
| 38
| 74
| 0.842105
| 10
| 114
| 9.6
| 0.6
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.122807
| 114
| 2
| 75
| 57
| 0.96
| 0.078947
| 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
| 1
| 0
|
0
| 5
|
f8d32a91b7dcf899716319e527aacb82f85b491d
| 96
|
py
|
Python
|
venv/lib/python3.8/site-packages/cachy/serializers/json_serializer.py
|
GiulianaPola/select_repeats
|
17a0d053d4f874e42cf654dd142168c2ec8fbd11
|
[
"MIT"
] | 2
|
2022-03-13T01:58:52.000Z
|
2022-03-31T06:07:54.000Z
|
venv/lib/python3.8/site-packages/cachy/serializers/json_serializer.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | 19
|
2021-11-20T04:09:18.000Z
|
2022-03-23T15:05:55.000Z
|
venv/lib/python3.8/site-packages/cachy/serializers/json_serializer.py
|
DesmoSearch/Desmobot
|
b70b45df3485351f471080deb5c785c4bc5c4beb
|
[
"MIT"
] | null | null | null |
/home/runner/.cache/pip/pool/50/d8/d2/31ad1ab81f5c548f91bba341e5db6f5caa9243535eeba7e594e2f0c53d
| 96
| 96
| 0.895833
| 9
| 96
| 9.555556
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.375
| 0
| 96
| 1
| 96
| 96
| 0.520833
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| null | null | 0
| 0
| null | null | 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 1
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
6ef1845a3f1c476968e48ff0506631fb5e48d96b
| 142
|
py
|
Python
|
domain/updatable.py
|
JJimenez-1/ollivanders_wands_shop
|
7adefd58b24853db518cf5b5d0b5efe0826eee4c
|
[
"MIT"
] | null | null | null |
domain/updatable.py
|
JJimenez-1/ollivanders_wands_shop
|
7adefd58b24853db518cf5b5d0b5efe0826eee4c
|
[
"MIT"
] | null | null | null |
domain/updatable.py
|
JJimenez-1/ollivanders_wands_shop
|
7adefd58b24853db518cf5b5d0b5efe0826eee4c
|
[
"MIT"
] | 1
|
2020-02-27T12:42:51.000Z
|
2020-02-27T12:42:51.000Z
|
from abc import ABCMeta, abstractmethod
class Updatable(metaclass=ABCMeta):
@abstractmethod
def update_quality(self):
pass
| 15.777778
| 39
| 0.725352
| 15
| 142
| 6.8
| 0.866667
| 0.411765
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.211268
| 142
| 8
| 40
| 17.75
| 0.910714
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.2
| 0
| 0.6
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
3e0ee4a148a0080b57f49e891ac2ca627aaf5bca
| 1,050
|
py
|
Python
|
personal_portfolio/Home/migrations/0010_auto_20200627_1510.py
|
zahrakoohestani/personalPortfolio
|
922b4c5bf1006f68e9203b2ac99cc1671a20796a
|
[
"MIT"
] | 1
|
2020-08-30T12:27:12.000Z
|
2020-08-30T12:27:12.000Z
|
personal_portfolio/Home/migrations/0010_auto_20200627_1510.py
|
zahrakoohestani/personalPortfolio
|
922b4c5bf1006f68e9203b2ac99cc1671a20796a
|
[
"MIT"
] | null | null | null |
personal_portfolio/Home/migrations/0010_auto_20200627_1510.py
|
zahrakoohestani/personalPortfolio
|
922b4c5bf1006f68e9203b2ac99cc1671a20796a
|
[
"MIT"
] | null | null | null |
# Generated by Django 3.0.7 on 2020-06-27 10:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Home', '0009_auto_20200627_1504'),
]
operations = [
migrations.AddField(
model_name='about_me',
name='li_1',
field=models.CharField(default='', max_length=100),
),
migrations.AddField(
model_name='about_me',
name='li_2',
field=models.CharField(default='', max_length=100),
),
migrations.AddField(
model_name='about_me',
name='li_3',
field=models.CharField(default='', max_length=100),
),
migrations.AddField(
model_name='about_me',
name='li_4',
field=models.CharField(default='', max_length=100),
),
migrations.AddField(
model_name='about_me',
name='li_5',
field=models.CharField(default='', max_length=100),
),
]
| 26.923077
| 63
| 0.542857
| 109
| 1,050
| 5.018349
| 0.385321
| 0.164534
| 0.210238
| 0.246801
| 0.722121
| 0.722121
| 0.722121
| 0.650823
| 0.577697
| 0.577697
| 0
| 0.072238
| 0.327619
| 1,050
| 38
| 64
| 27.631579
| 0.70255
| 0.042857
| 0
| 0.625
| 1
| 0
| 0.08674
| 0.022931
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.03125
| 0
| 0.125
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
3e0fea84af8b156ec4acbadc4f1851ebb835e7df
| 92
|
py
|
Python
|
xently/core/exceptions.py
|
ajharry69/django-xently
|
f6dd273ea6c3a4c01f46b440c4a0d0e1edb24f8b
|
[
"BSD-2-Clause"
] | 2
|
2021-06-20T20:28:30.000Z
|
2021-08-02T15:08:03.000Z
|
realzhub/core/exceptions.py
|
andy1729/RealzHub
|
8e476d972d1b8f47442744c935ada570edbb9e1e
|
[
"MIT"
] | 1
|
2021-08-02T21:09:22.000Z
|
2021-08-02T21:09:22.000Z
|
xently/core/exceptions.py
|
ajharry69/django-xently
|
f6dd273ea6c3a4c01f46b440c4a0d0e1edb24f8b
|
[
"BSD-2-Clause"
] | null | null | null |
class AppNotFoundError(Exception):
pass
class ClassNotFoundError(Exception):
pass
| 13.142857
| 36
| 0.76087
| 8
| 92
| 8.75
| 0.625
| 0.371429
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.173913
| 92
| 6
| 37
| 15.333333
| 0.921053
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 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
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
3e13b693e936f9a773ca42ada244d82a866e297b
| 291
|
py
|
Python
|
medical_prescription/landing/views.py
|
ristovao/2017.2-Receituario-Medico
|
5387eb80dfb354e948abe64f7d8bbe087fc4f136
|
[
"MIT"
] | 11
|
2017-09-19T00:29:40.000Z
|
2018-04-05T23:52:39.000Z
|
medical_prescription/landing/views.py
|
ristovao/2017.2-Receituario-Medico
|
5387eb80dfb354e948abe64f7d8bbe087fc4f136
|
[
"MIT"
] | 271
|
2017-09-09T00:07:28.000Z
|
2017-12-07T05:00:45.000Z
|
medical_prescription/landing/views.py
|
ristovao/2017.2-Receituario-Medico
|
5387eb80dfb354e948abe64f7d8bbe087fc4f136
|
[
"MIT"
] | 26
|
2017-08-31T20:48:49.000Z
|
2018-03-21T15:11:27.000Z
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
from user.decorators import user_is_logged
@user_is_logged
def home(request):
return render(request, 'landing.html')
def team_page(request):
return render(request, 'team.html')
| 18.1875
| 42
| 0.752577
| 40
| 291
| 5.225
| 0.575
| 0.057416
| 0.114833
| 0.248804
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.004016
| 0.14433
| 291
| 15
| 43
| 19.4
| 0.835341
| 0.072165
| 0
| 0
| 0
| 0
| 0.078358
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.375
| 0.25
| 0.875
| 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
| 1
| 1
| 1
| 0
|
0
| 5
|
3e3ea7f40a61fff6fae1134879087a10f6d9d0ec
| 307
|
py
|
Python
|
src/pyjion/wsgi.py
|
psydox/Pyjion
|
ddf69db27b356710ff7db3c4ba9c3e0b55de1039
|
[
"MIT"
] | 1,137
|
2020-10-14T10:24:18.000Z
|
2022-03-31T09:37:03.000Z
|
src/pyjion/wsgi.py
|
psydox/Pyjion
|
ddf69db27b356710ff7db3c4ba9c3e0b55de1039
|
[
"MIT"
] | 310
|
2016-05-21T05:30:23.000Z
|
2022-03-21T00:59:57.000Z
|
src/pyjion/wsgi.py
|
psydox/Pyjion
|
ddf69db27b356710ff7db3c4ba9c3e0b55de1039
|
[
"MIT"
] | 55
|
2016-05-20T06:11:28.000Z
|
2022-03-15T12:48:00.000Z
|
import pyjion
class PyjionWsgiMiddleware:
"""Enables the Pyjion JIT for all WSGI requests."""
def __init__(self, application):
pyjion.enable()
self.application = application
def __call__(self, environ, start_response):
return self.application(environ, start_response)
| 25.583333
| 56
| 0.703583
| 33
| 307
| 6.242424
| 0.636364
| 0.218447
| 0.194175
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.211726
| 307
| 11
| 57
| 27.909091
| 0.85124
| 0.14658
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.714286
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
3e487d48290f1bfe2bc704ee538cb9cf841f4ab2
| 37
|
py
|
Python
|
ostools/exceptions.py
|
bluepython508/filepath
|
692cc61e86c6a0ed9c347cce7f7c04036a82b894
|
[
"MIT"
] | null | null | null |
ostools/exceptions.py
|
bluepython508/filepath
|
692cc61e86c6a0ed9c347cce7f7c04036a82b894
|
[
"MIT"
] | null | null | null |
ostools/exceptions.py
|
bluepython508/filepath
|
692cc61e86c6a0ed9c347cce7f7c04036a82b894
|
[
"MIT"
] | null | null | null |
class PathError(Exception):
pass
| 12.333333
| 27
| 0.72973
| 4
| 37
| 6.75
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.189189
| 37
| 2
| 28
| 18.5
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 0
| 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
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
e42a9ba4d35682373cb617507767952ce5fee3f4
| 85
|
py
|
Python
|
apc_pdu_controller/__init__.py
|
ahribeng/apc_pdu_controller
|
9576c7023ada282b51dbe0a1d0e88b2b84dcc498
|
[
"MIT"
] | null | null | null |
apc_pdu_controller/__init__.py
|
ahribeng/apc_pdu_controller
|
9576c7023ada282b51dbe0a1d0e88b2b84dcc498
|
[
"MIT"
] | null | null | null |
apc_pdu_controller/__init__.py
|
ahribeng/apc_pdu_controller
|
9576c7023ada282b51dbe0a1d0e88b2b84dcc498
|
[
"MIT"
] | null | null | null |
from apc_pdu_controller.apc_pdu_controller import APCController, APCBase, Connection
| 42.5
| 84
| 0.894118
| 11
| 85
| 6.545455
| 0.727273
| 0.166667
| 0.444444
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.070588
| 85
| 1
| 85
| 85
| 0.911392
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e42c453d4bb1512b96a298bd2205f9f81ecd197b
| 156
|
py
|
Python
|
src/py220_supplemental/lessons/lesson06/class_content/ProfilingPerformance/source/solutions/cython/great_circle_setup_v2.py
|
UWPCE-Python-Course-2-Materials/supplementary_files
|
d3155b09a92d9660099da0f331663f472a9289eb
|
[
"MIT"
] | 10
|
2020-06-28T05:38:32.000Z
|
2022-01-27T13:48:51.000Z
|
src/py220_supplemental/lessons/lesson06/class_content/ProfilingPerformance/source/solutions/cython/great_circle_setup_v2.py
|
UWPCE-Python-Course-2-Materials/supplementary_files
|
d3155b09a92d9660099da0f331663f472a9289eb
|
[
"MIT"
] | null | null | null |
src/py220_supplemental/lessons/lesson06/class_content/ProfilingPerformance/source/solutions/cython/great_circle_setup_v2.py
|
UWPCE-Python-Course-2-Materials/supplementary_files
|
d3155b09a92d9660099da0f331663f472a9289eb
|
[
"MIT"
] | 5
|
2020-09-24T20:14:36.000Z
|
2021-11-07T22:47:23.000Z
|
from distutils.core import setup
from Cython.Build import cythonize
setup(
name='Great Circle v2',
ext_modules=cythonize("great_circle_v2.pyx"),
)
| 19.5
| 49
| 0.75641
| 22
| 156
| 5.227273
| 0.681818
| 0.191304
| 0.226087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.015038
| 0.147436
| 156
| 7
| 50
| 22.285714
| 0.849624
| 0
| 0
| 0
| 0
| 0
| 0.217949
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.333333
| 0
| 0.333333
| 0
| 1
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e430609bb248b986d386b211e70cbe21749f113a
| 124
|
py
|
Python
|
katas/kyu_6/find_the_divisors.py
|
the-zebulan/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 40
|
2016-03-09T12:26:20.000Z
|
2022-03-23T08:44:51.000Z
|
katas/kyu_6/find_the_divisors.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | null | null | null |
katas/kyu_6/find_the_divisors.py
|
akalynych/CodeWars
|
1eafd1247d60955a5dfb63e4882e8ce86019f43a
|
[
"MIT"
] | 36
|
2016-11-07T19:59:58.000Z
|
2022-03-31T11:18:27.000Z
|
def divisors(num):
return [a for a in xrange(2, num / 2 + 1) if num % a == 0] or \
'{} is prime'.format(num)
| 31
| 67
| 0.516129
| 22
| 124
| 2.909091
| 0.727273
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.047059
| 0.314516
| 124
| 3
| 68
| 41.333333
| 0.705882
| 0
| 0
| 0
| 0
| 0
| 0.08871
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
e445511a262cada2700d933e63ff9f1b826ec493
| 106
|
py
|
Python
|
sample/api.py
|
DewMaple/falcon_router
|
70f0ed4afdeb9e30a73a5e4713267eab1dfec3fa
|
[
"BSD-3-Clause"
] | 1
|
2021-06-29T05:29:29.000Z
|
2021-06-29T05:29:29.000Z
|
sample/api.py
|
DewMaple/falcon_router
|
70f0ed4afdeb9e30a73a5e4713267eab1dfec3fa
|
[
"BSD-3-Clause"
] | null | null | null |
sample/api.py
|
DewMaple/falcon_router
|
70f0ed4afdeb9e30a73a5e4713267eab1dfec3fa
|
[
"BSD-3-Clause"
] | null | null | null |
from ..router import route
@route("/hello", method="GET")
def hello(org_id: int):
return "Hello"
| 17.666667
| 30
| 0.641509
| 15
| 106
| 4.466667
| 0.8
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188679
| 106
| 6
| 31
| 17.666667
| 0.77907
| 0
| 0
| 0
| 0
| 0
| 0.130841
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.25
| false
| 0
| 0.25
| 0.25
| 0.75
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
e45a9f79e2ebf673c543917fb694a518142429a8
| 58
|
py
|
Python
|
ratelimit/__init__.py
|
devkral/django-fast-ratelimit
|
576729bbf52721ac2849c79c2ff8e075ecdc02b2
|
[
"MIT"
] | 1
|
2021-05-18T00:03:11.000Z
|
2021-05-18T00:03:11.000Z
|
ratelimit/__init__.py
|
devkral/django-fast-ratelimit
|
576729bbf52721ac2849c79c2ff8e075ecdc02b2
|
[
"MIT"
] | 1
|
2019-10-28T11:40:04.000Z
|
2019-11-09T23:35:24.000Z
|
ratelimit/__init__.py
|
devkral/django-fast-ratelimit
|
576729bbf52721ac2849c79c2ff8e075ecdc02b2
|
[
"MIT"
] | 1
|
2019-11-10T10:05:15.000Z
|
2019-11-10T10:05:15.000Z
|
from ._core import * # noqa
from .misc import * # noqa
| 14.5
| 28
| 0.637931
| 8
| 58
| 4.5
| 0.625
| 0.555556
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.258621
| 58
| 3
| 29
| 19.333333
| 0.837209
| 0.155172
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
e45ff497fcbbbcaa22d84438124b45972555347f
| 2,621
|
py
|
Python
|
app/shoppinglist.py
|
prcleary/shoppinglist
|
e9559f387a85dec8ee1f5ee8c1857da55c8cb88a
|
[
"MIT"
] | null | null | null |
app/shoppinglist.py
|
prcleary/shoppinglist
|
e9559f387a85dec8ee1f5ee8c1857da55c8cb88a
|
[
"MIT"
] | 1
|
2021-02-19T19:35:38.000Z
|
2021-02-19T19:36:08.000Z
|
app/shoppinglist.py
|
prcleary/shoppinglist
|
e9559f387a85dec8ee1f5ee8c1857da55c8cb88a
|
[
"MIT"
] | null | null | null |
from flask import Flask, render_template, request
def get_listitems():
listitems = { "Miscellaneous" : ["Antihistamines", "Cards", "Newspaper", "Wrapping paper"], "Fruit and vegetables" : ["Apples", "Avocadoes", "Bananas", "Berries", "Broccoli", "Cabbage", "Carrots", "Cauliflower", "Celery", "Cherries", "Chillis", "Corn on cob", "Courgettes", "Cucumber", "Fresh herbs", "Garlic", "Ginger", "Grapes", "Lemons", "Lettuce", "Limes", "Mange tout", "Melons", "Mushrooms", "Nectarines", "Onions", "Oranges", "Peaches", "Pears", "Peppers", "Plums", "Potato", "Raspberries", "Salad leaves", "Shallots", "Spinach", "Strawberries", "Sugar snaps", "Sweet potato", "Tomatoes", "Watermelon"], "Meat" : ["Chicken", "Mince"], "Bakery" : ["Bagels", "Bread for kids", "Bread for parents", "Sliced bread", "Wraps"], "Lunch" : ["Hummus", "Oatcakes", "Pitta bread", "Quorn eggs"], "Dairy" : ["Butter (cooking)", "Butter (low fat)", "Cheese (block/grated)", "Cottage cheese", "Cream cheese", "Creme fraiche", "Eggs", "Milk", "Yogurt"], "Ingredients and condiments" : ["Brown sugar", "Cashew nuts", "Dried fruit", "Flour", "Honey", "Jam", "Ketchup", "Lea and Perrins", "Lemon juice", "Mayonnaise", "Mustard", "Olive oil", "Pasta", "Pepper", "Rice", "Salad dressing", "Salt", "Soy sauce", "Sugar", "Vegetable oil"], "Tins" : ["Baked beans", "Butter beans", "Chickpeas", "Kidney beans"], "Breakfast" : ["Muesli", "Peanut butter", "Porridge", "Weetabix"], "Desserts" : ["Ice cream", "Jelly"], "Household" : ["Batteries", "Bird food", "Bleach", "Cling film", "Cotton buds", "Dental floss", "Deodorant (Neena)", "Deodorant (Paul)", "Dishwasher tablets", "Dog food", "Freezer/sandwich bags", "Furniture polish", "Hand wash dispensers", "Kitchen foil", "Light bulbs", "Mouthwash", "Paper towels", "Plasters", "Razors (Neena)", "Razors (Paul)", "Rubbish bags", "Sandwich bags", "Shampoo (Paul)", "Shampoo for kids", "Shaving foam", "Soap", "Sponges /scrubbers", "Tissues", "Toilet paper", "Toothbrushes", "Toothpaste", "Washing powder", "Washing up liquid"], "Frozen" : ["Fish fingers", "Frozen pizzas", "Frozen vegetables"], "Snacks" : ["Biscuits", "Crackers", "Crisps", "Nuts", "Sweets"], "Drinks" : ["Beer", "Bottled water", "Chai", "Cocoa", "Coffee", "Fruit juice", "Herbal teas", "Rooibos", "Tea", "Vimto", "Wine"]}
return listitems
app = Flask(__name__, template_folder = 'templates')
@app.route('/')
def index():
return render_template('index.html',
listitems = get_listitems())
@app.route('/about/')
def about():
return render_template('about.html')
if __name__ == '__main__':
app.run(host='0.0.0.0')
| 124.809524
| 2,225
| 0.648989
| 289
| 2,621
| 5.823529
| 0.757785
| 0.024955
| 0.023767
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.001744
| 0.124762
| 2,621
| 20
| 2,226
| 131.05
| 0.731909
| 0
| 0
| 0
| 0
| 0
| 0.600763
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.214286
| false
| 0
| 0.071429
| 0.142857
| 0.5
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 0
| 0
|
0
| 5
|
e47abcc11dcfdc18dc94a903136e68e6476cbde9
| 99
|
py
|
Python
|
collective/ckeditor/tests/__init__.py
|
vindula/collective.ckeditor
|
43129d98c77fa567fca4ffc0ce4a911f47b721d0
|
[
"ZPL-1.1"
] | null | null | null |
collective/ckeditor/tests/__init__.py
|
vindula/collective.ckeditor
|
43129d98c77fa567fca4ffc0ce4a911f47b721d0
|
[
"ZPL-1.1"
] | null | null | null |
collective/ckeditor/tests/__init__.py
|
vindula/collective.ckeditor
|
43129d98c77fa567fca4ffc0ce4a911f47b721d0
|
[
"ZPL-1.1"
] | null | null | null |
# Other packages may find this useful
from collective.ckeditor.tests.base import CKEditorTestCase
| 24.75
| 59
| 0.838384
| 13
| 99
| 6.384615
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.121212
| 99
| 3
| 60
| 33
| 0.954023
| 0.353535
| 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
| 1
| 0
|
0
| 5
|
e4e28805217ee2804848faf1fb0e0d61e4eddfac
| 64
|
py
|
Python
|
pyviz3d/color.py
|
butala/pyviz3d
|
275ae6596de61a767ce7b7f3470c391596150421
|
[
"MIT"
] | null | null | null |
pyviz3d/color.py
|
butala/pyviz3d
|
275ae6596de61a767ce7b7f3470c391596150421
|
[
"MIT"
] | null | null | null |
pyviz3d/color.py
|
butala/pyviz3d
|
275ae6596de61a767ce7b7f3470c391596150421
|
[
"MIT"
] | null | null | null |
YELLOW = (255, 255, 0)
CYAN = (0, 255, 255)
RED = (255, 0, 0)
| 10.666667
| 22
| 0.5
| 12
| 64
| 2.666667
| 0.416667
| 0.375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.404255
| 0.265625
| 64
| 5
| 23
| 12.8
| 0.276596
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 1
| 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
| 5
|
9011617987e2f0d8476d7468acbd67bd671458a1
| 185
|
py
|
Python
|
flytekit/core/with_metadata.py
|
latchbio/flaightkit
|
365e339cea21965680a9252b91085f6a5c3207d5
|
[
"Apache-2.0"
] | null | null | null |
flytekit/core/with_metadata.py
|
latchbio/flaightkit
|
365e339cea21965680a9252b91085f6a5c3207d5
|
[
"Apache-2.0"
] | null | null | null |
flytekit/core/with_metadata.py
|
latchbio/flaightkit
|
365e339cea21965680a9252b91085f6a5c3207d5
|
[
"Apache-2.0"
] | null | null | null |
from typing import Any, Dict
class FlyteMetadata:
def __init__(self, data: Dict[str, Any]):
self._data = data
@property
def data(self):
return self._data
| 16.818182
| 45
| 0.632432
| 24
| 185
| 4.625
| 0.583333
| 0.216216
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.275676
| 185
| 10
| 46
| 18.5
| 0.828358
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.285714
| false
| 0
| 0.142857
| 0.142857
| 0.714286
| 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
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
9047897866bf1d2f814b3477d2ba5a8c0e793d11
| 104
|
py
|
Python
|
run.py
|
jod35/Fast-Food-Fast
|
7dbe2ea8b602460f917bc0dc76ad65f3ae09b829
|
[
"Apache-2.0"
] | null | null | null |
run.py
|
jod35/Fast-Food-Fast
|
7dbe2ea8b602460f917bc0dc76ad65f3ae09b829
|
[
"Apache-2.0"
] | null | null | null |
run.py
|
jod35/Fast-Food-Fast
|
7dbe2ea8b602460f917bc0dc76ad65f3ae09b829
|
[
"Apache-2.0"
] | null | null | null |
from app import create_app
from app.config import DevConfig
if __name__ == "__main__":
create_app()
| 20.8
| 32
| 0.759615
| 15
| 104
| 4.6
| 0.6
| 0.202899
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.163462
| 104
| 5
| 33
| 20.8
| 0.793103
| 0
| 0
| 0
| 0
| 0
| 0.07619
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
5f409e22915bb10fe39fd3cb7bddaf5c33ca505e
| 373
|
py
|
Python
|
raopy/rtsp/__init__.py
|
Schlaubischlump/raopy_old
|
2f969f4392208bd6440cd86d9e3f332961f80b3e
|
[
"MIT"
] | null | null | null |
raopy/rtsp/__init__.py
|
Schlaubischlump/raopy_old
|
2f969f4392208bd6440cd86d9e3f332961f80b3e
|
[
"MIT"
] | null | null | null |
raopy/rtsp/__init__.py
|
Schlaubischlump/raopy_old
|
2f969f4392208bd6440cd86d9e3f332961f80b3e
|
[
"MIT"
] | null | null | null |
"""
Classes in this package are used to create an RSTP connection to the AirTunesDevice and perform the initial
authentication and the handshake.
"""
from .rtspclient import RTSPClient, RAOPCrypto, RAOPCodec, RTSPReason, RTSPStatus
from .dmap import DmapList, DmapItem
__all__ = ["RTSPClient", "RAOPCrypto", "RAOPCodec", "RTSPReason", "RTSPStatus", "DmapItem", "DmapList"]
| 46.625
| 107
| 0.77748
| 43
| 373
| 6.651163
| 0.674419
| 0.13986
| 0.202797
| 0.272727
| 0.342657
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.123324
| 373
| 8
| 108
| 46.625
| 0.874618
| 0.378016
| 0
| 0
| 0
| 0
| 0.288889
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.666667
| 0
| 0.666667
| 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
| 1
| 0
|
0
| 5
|
5f5344cf29c4fdb63ca909ca6ba3ea9cd0476925
| 90
|
py
|
Python
|
pyqmri/_helper_fun/__init__.py
|
agahkarakuzu/PyQMRI
|
30871de4cc15dee573f9fa71990b1a4331a690f2
|
[
"Apache-2.0"
] | 18
|
2019-08-09T18:42:33.000Z
|
2022-03-22T07:56:48.000Z
|
pyqmri/_helper_fun/__init__.py
|
agahkarakuzu/PyQMRI
|
30871de4cc15dee573f9fa71990b1a4331a690f2
|
[
"Apache-2.0"
] | 4
|
2020-10-05T15:56:58.000Z
|
2021-08-19T11:51:54.000Z
|
pyqmri/_helper_fun/__init__.py
|
agahkarakuzu/PyQMRI
|
30871de4cc15dee573f9fa71990b1a4331a690f2
|
[
"Apache-2.0"
] | 5
|
2020-04-21T17:28:58.000Z
|
2020-12-05T21:44:50.000Z
|
"""Utility functions for Fitting and Reconstruction."""
from ._clprogram import CLProgram
| 30
| 55
| 0.8
| 10
| 90
| 7.1
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111111
| 90
| 2
| 56
| 45
| 0.8875
| 0.544444
| 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
| 1
| 0
|
0
| 5
|
5f62bb8164539fec803814680b81617b2c4c4356
| 42
|
py
|
Python
|
www/speed/benchmarks/big_integers.py
|
sejalseth/brython
|
0b59368eac40a3b1eef7b13f2102b18cb5629687
|
[
"BSD-3-Clause"
] | 5,926
|
2015-01-01T07:45:08.000Z
|
2022-03-31T12:34:38.000Z
|
www/speed/benchmarks/big_integers.py
|
sejalseth/brython
|
0b59368eac40a3b1eef7b13f2102b18cb5629687
|
[
"BSD-3-Clause"
] | 1,728
|
2015-01-01T01:09:12.000Z
|
2022-03-30T23:25:22.000Z
|
www/speed/benchmarks/big_integers.py
|
sejalseth/brython
|
0b59368eac40a3b1eef7b13f2102b18cb5629687
|
[
"BSD-3-Clause"
] | 574
|
2015-01-02T01:36:10.000Z
|
2022-03-26T10:18:48.000Z
|
n = 60
for i in range(10000):
2 ** n
| 8.4
| 22
| 0.5
| 9
| 42
| 2.333333
| 0.888889
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.296296
| 0.357143
| 42
| 4
| 23
| 10.5
| 0.481481
| 0
| 0
| 0
| 0
| 0
| 0
| 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
| 1
| 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
| 5
|
5f93b32b217c95e10aaf40d51be82c1b75a955f0
| 1,259
|
py
|
Python
|
py/levels/bombs.py
|
triffid/kiki
|
b64b8524063c149a5cc9118f48d80afec1d8a942
|
[
"Unlicense"
] | 2
|
2020-01-04T23:44:10.000Z
|
2020-07-12T17:10:09.000Z
|
py/levels/bombs.py
|
triffid/kiki
|
b64b8524063c149a5cc9118f48d80afec1d8a942
|
[
"Unlicense"
] | null | null | null |
py/levels/bombs.py
|
triffid/kiki
|
b64b8524063c149a5cc9118f48d80afec1d8a942
|
[
"Unlicense"
] | 1
|
2022-03-16T05:43:33.000Z
|
2022-03-16T05:43:33.000Z
|
# .................................................................................................................
level_dict["bombs"] = {
"scheme": "red_scheme",
"size": (9,9,9),
"intro": "bombs",
"help": (
"$scale(1.5)mission:\nget to the exit!\n\n" + \
"to get to the exit,\nuse the bombs",
),
"player": { "position": (0,-4,0),
},
"exits": [
{
"name": "exit",
"active": 1,
"position": (0,2,0),
},
],
"create":
"""
world.addObjectAtPos (KikiBomb(), world.decenter (0,-4,2))
world.addObjectAtPos (KikiBomb(), world.decenter (0,-4,-2))
world.addObjectAtPos (KikiBomb(), world.decenter (-3,-2,0))
""",
}
| 50.36
| 115
| 0.230342
| 70
| 1,259
| 4.114286
| 0.485714
| 0.020833
| 0.28125
| 0.333333
| 0.4375
| 0.4375
| 0.4375
| 0.4375
| 0.4375
| 0.4375
| 0
| 0.038532
| 0.567117
| 1,259
| 25
| 116
| 50.36
| 0.489908
| 0.089754
| 0
| 0
| 0
| 0
| 0.167883
| 0.025026
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
5f97987fe4efb5e8219a5bdd0dc5a3ec959421d9
| 250
|
py
|
Python
|
src/pages/__init__.py
|
byran/ScreenPlayExample
|
1108a8567aacc8ddc8e460a42f54409ad7dc0f23
|
[
"MIT"
] | null | null | null |
src/pages/__init__.py
|
byran/ScreenPlayExample
|
1108a8567aacc8ddc8e460a42f54409ad7dc0f23
|
[
"MIT"
] | null | null | null |
src/pages/__init__.py
|
byran/ScreenPlayExample
|
1108a8567aacc8ddc8e460a42f54409ad7dc0f23
|
[
"MIT"
] | null | null | null |
from .duckduckgo_homepage import duckduckgo_homepage
from .duckduckgo_search_results import duckduckgo_search_results
__all__ = [
'duckduckgo_homepage', # duckduckgo_homepage.py
'duckduckgo_search_results' # duckduckgo_search_results.py
]
| 31.25
| 64
| 0.828
| 27
| 250
| 7.074074
| 0.296296
| 0.376963
| 0.481675
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.116
| 250
| 7
| 65
| 35.714286
| 0.864253
| 0.204
| 0
| 0
| 0
| 0
| 0.22449
| 0.127551
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.333333
| 0
| 0.333333
| 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
| 1
| 0
| 0
| 0
|
0
| 5
|
5fa4427dbca823e25fc451d65cd5edf9faae16fb
| 90
|
py
|
Python
|
jax_bayes/variational/__init__.py
|
jamesvuc/jax-bayes
|
b91432cbf39dc0faebd1879a021fb2939d6072da
|
[
"MIT"
] | 9
|
2020-08-14T14:25:54.000Z
|
2022-03-17T13:28:32.000Z
|
jax_bayes/variational/__init__.py
|
jamesvuc/jax-bayes
|
b91432cbf39dc0faebd1879a021fb2939d6072da
|
[
"MIT"
] | null | null | null |
jax_bayes/variational/__init__.py
|
jamesvuc/jax-bayes
|
b91432cbf39dc0faebd1879a021fb2939d6072da
|
[
"MIT"
] | null | null | null |
from .families import diagonal_mvn_fns
from .variational_family import variational_family
| 30
| 50
| 0.888889
| 12
| 90
| 6.333333
| 0.666667
| 0.447368
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.088889
| 90
| 3
| 50
| 30
| 0.926829
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
5fce37d22cba2d6199fbb902be5345d6850179c6
| 1,685
|
py
|
Python
|
app/__init__.py
|
fractus-io/fidelio-api
|
d08048ab5d57d8b616f2da3a40f9f123863aecb6
|
[
"MIT"
] | null | null | null |
app/__init__.py
|
fractus-io/fidelio-api
|
d08048ab5d57d8b616f2da3a40f9f123863aecb6
|
[
"MIT"
] | null | null | null |
app/__init__.py
|
fractus-io/fidelio-api
|
d08048ab5d57d8b616f2da3a40f9f123863aecb6
|
[
"MIT"
] | null | null | null |
import os
from flask import Flask
from flask_profiler import Profiler
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from app.config import TestingConfig, DevelopmentConfig, ProductionConfig
app = Flask(__name__)
app.config.from_object(DevelopmentConfig)
db = SQLAlchemy()
profiler = Profiler()
ma = Marshmallow()
from app.cve.routes import cve
from app.cpe.routes import cpe
from app.software.routes import software
from app.errors.handlers import errors
from app.docs.routes import swag, swaggerui_blueprint, SWAGGER_URL
app.register_blueprint(cve, url_prefix="/api/cve")
app.register_blueprint(cpe, url_prefix="/api/cpe")
app.register_blueprint(software, url_prefix="/api/software")
app.register_blueprint(errors)
app.register_blueprint(swag)
app.register_blueprint(swaggerui_blueprint, url_prefix=SWAGGER_URL)
def create_app():
app = Flask(__name__)
app.config.from_object(DevelopmentConfig if str(os.environ.get(
"PRODUCTION")).lower() == 'true' else DevelopmentConfig)
db.init_app(app)
ma.init_app(app)
from app.cve.routes import cve
from app.cpe.routes import cpe
from app.software.routes import software
from app.errors.handlers import errors
from app.docs.routes import swag, swaggerui_blueprint, SWAGGER_URL
profiler.init_app(app)
app.register_blueprint(cve, url_prefix="/api/cve")
app.register_blueprint(cpe, url_prefix="/api/cpe")
app.register_blueprint(software, url_prefix="/api/software")
app.register_blueprint(errors)
app.register_blueprint(swag, url_prefix="/api")
app.register_blueprint(swaggerui_blueprint, url_prefix=SWAGGER_URL)
return app
| 31.203704
| 73
| 0.782789
| 230
| 1,685
| 5.534783
| 0.186957
| 0.103692
| 0.188531
| 0.023566
| 0.710134
| 0.710134
| 0.710134
| 0.710134
| 0.634721
| 0.545169
| 0
| 0
| 0.123442
| 1,685
| 53
| 74
| 31.792453
| 0.861882
| 0
| 0
| 0.536585
| 0
| 0
| 0.045104
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.02439
| false
| 0
| 0.390244
| 0
| 0.439024
| 0.341463
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
397cf01a005b89afc96e3869078734e3ebb23018
| 55
|
py
|
Python
|
FSWDF-Project/main.py
|
chrischism8063/Mongo-py
|
c531f93cd37cd9d9420e39811a37c8bcfc1e5d1c
|
[
"MIT"
] | null | null | null |
FSWDF-Project/main.py
|
chrischism8063/Mongo-py
|
c531f93cd37cd9d9420e39811a37c8bcfc1e5d1c
|
[
"MIT"
] | null | null | null |
FSWDF-Project/main.py
|
chrischism8063/Mongo-py
|
c531f93cd37cd9d9420e39811a37c8bcfc1e5d1c
|
[
"MIT"
] | null | null | null |
# main entry to the system
from application import app
| 18.333333
| 27
| 0.8
| 9
| 55
| 4.888889
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.181818
| 55
| 2
| 28
| 27.5
| 0.977778
| 0.436364
| 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
| 1
| 0
|
0
| 5
|
39846f3b40fcabb6a4e744e29f4109c0d5676031
| 208
|
py
|
Python
|
tests/test_preprocess.py
|
caoyulong/CDRTR
|
f61cf84c096a124066af90f6536d85be630ecdff
|
[
"BSD-2-Clause"
] | 9
|
2019-07-05T14:49:25.000Z
|
2021-05-12T13:37:19.000Z
|
tests/test_preprocess.py
|
caoyulong/CDRTR
|
f61cf84c096a124066af90f6536d85be630ecdff
|
[
"BSD-2-Clause"
] | null | null | null |
tests/test_preprocess.py
|
caoyulong/CDRTR
|
f61cf84c096a124066af90f6536d85be630ecdff
|
[
"BSD-2-Clause"
] | 1
|
2021-02-13T14:00:26.000Z
|
2021-02-13T14:00:26.000Z
|
# coding=utf-8
from .context import CDRTR
import unittest
class PreprocessTestSuite(unittest.TestCase):
'''Preprocess test cases'''
pass
# def test_readjson(self):
# self.assertIsNone(
| 17.333333
| 45
| 0.697115
| 23
| 208
| 6.26087
| 0.826087
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.006024
| 0.201923
| 208
| 11
| 46
| 18.909091
| 0.861446
| 0.4375
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.25
| 0.5
| 0
| 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
| 1
| 1
| 1
| 0
| 1
| 0
|
0
| 5
|
39bdbb21ec86654f8627dfd2f7bc75676d5fb1fd
| 76
|
py
|
Python
|
quantum_systems/time_evolution_operators/__init__.py
|
haakoek/quantum-systems
|
1d3421f15e8ba3ec203cbdda538e033bf9987682
|
[
"MIT"
] | null | null | null |
quantum_systems/time_evolution_operators/__init__.py
|
haakoek/quantum-systems
|
1d3421f15e8ba3ec203cbdda538e033bf9987682
|
[
"MIT"
] | null | null | null |
quantum_systems/time_evolution_operators/__init__.py
|
haakoek/quantum-systems
|
1d3421f15e8ba3ec203cbdda538e033bf9987682
|
[
"MIT"
] | null | null | null |
from .operator import TimeEvolutionOperator, LaserField, AdiabaticSwitching
| 38
| 75
| 0.881579
| 6
| 76
| 11.166667
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.078947
| 76
| 1
| 76
| 76
| 0.957143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
39ebc29620aa91916e2c8fe4bd3efe5711445d1d
| 239
|
py
|
Python
|
fairing/builders/container_image_builder.py
|
wbuchwalter/fairing-1
|
e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab
|
[
"Apache-2.0"
] | 21
|
2018-08-09T19:13:47.000Z
|
2020-07-22T05:21:11.000Z
|
fairing/builders/container_image_builder.py
|
wbuchwalter/fairing-1
|
e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab
|
[
"Apache-2.0"
] | 14
|
2018-08-02T18:44:09.000Z
|
2018-11-08T15:32:55.000Z
|
fairing/builders/container_image_builder.py
|
wbuchwalter/fairing-1
|
e6d459dc8413ffd3e8c4b0771a2ec79c74c383ab
|
[
"Apache-2.0"
] | 4
|
2018-08-09T19:13:59.000Z
|
2018-10-08T05:44:31.000Z
|
from abc import ABCMeta, abstractmethod
class ContainerImageBuilder(object):
__metaclass__ = metacclass=ABCMeta
@abstractmethod
def execute(self, repository, image_name, image_tag, base_image, dockerfile, publish, env): pass
| 29.875
| 100
| 0.782427
| 26
| 239
| 6.923077
| 0.846154
| 0.233333
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.146444
| 239
| 8
| 100
| 29.875
| 0.882353
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.2
| false
| 0.2
| 0.2
| 0
| 1
| 0
| 1
| 0
| 0
| null | 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
f2d8e21dba29d4ac9597e43628a7f26de624c72e
| 81
|
py
|
Python
|
drive/straight_fw.py
|
marco-a-wagner/robo
|
16bddfb06dadbf735be02e8115d1934887d612c8
|
[
"MIT"
] | null | null | null |
drive/straight_fw.py
|
marco-a-wagner/robo
|
16bddfb06dadbf735be02e8115d1934887d612c8
|
[
"MIT"
] | null | null | null |
drive/straight_fw.py
|
marco-a-wagner/robo
|
16bddfb06dadbf735be02e8115d1934887d612c8
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
import time
import basic_moves as move
move.straight_fw(300)
| 11.571429
| 26
| 0.777778
| 14
| 81
| 4.357143
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.042254
| 0.123457
| 81
| 6
| 27
| 13.5
| 0.816901
| 0.197531
| 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
| 1
| 0
|
0
| 5
|
f2d9826a7f19e9c1b42305f94bd791c08fbf4d2e
| 99
|
py
|
Python
|
Leetcode/1000-2000/1227. Airplane Seat Assignment Probability/1227.py
|
Next-Gen-UI/Code-Dynamics
|
a9b9d5e3f27e870b3e030c75a1060d88292de01c
|
[
"MIT"
] | null | null | null |
Leetcode/1000-2000/1227. Airplane Seat Assignment Probability/1227.py
|
Next-Gen-UI/Code-Dynamics
|
a9b9d5e3f27e870b3e030c75a1060d88292de01c
|
[
"MIT"
] | null | null | null |
Leetcode/1000-2000/1227. Airplane Seat Assignment Probability/1227.py
|
Next-Gen-UI/Code-Dynamics
|
a9b9d5e3f27e870b3e030c75a1060d88292de01c
|
[
"MIT"
] | null | null | null |
class Solution:
def nthPersonGetsNthSeat(self, n: int) -> float:
return 1 if n == 1 else 0.5
| 24.75
| 50
| 0.666667
| 16
| 99
| 4.125
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.051948
| 0.222222
| 99
| 3
| 51
| 33
| 0.805195
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0
| 0.333333
| 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
| 1
| 1
| 0
|
0
| 5
|
f2dfda9b6e579a218b2633b3dc93f25dea4f5bb7
| 244
|
py
|
Python
|
orbitkit/file_extractor/exception.py
|
clown-0726/orbitkit
|
233c4a8a7b4fda3bbdb1631de4fd4fbdf79c7b6f
|
[
"MIT"
] | 3
|
2021-07-27T10:39:56.000Z
|
2021-07-28T00:09:03.000Z
|
orbitkit/file_extractor/exception.py
|
clown-0726/orbitkit
|
233c4a8a7b4fda3bbdb1631de4fd4fbdf79c7b6f
|
[
"MIT"
] | null | null | null |
orbitkit/file_extractor/exception.py
|
clown-0726/orbitkit
|
233c4a8a7b4fda3bbdb1631de4fd4fbdf79c7b6f
|
[
"MIT"
] | null | null | null |
class FileExtractorTimeoutException(Exception):
pass
class ParamsInvalidException(Exception):
pass
class NoProperExtractorFindException(Exception):
def __init__(self):
super().__init__('NoProperExtractorFind Exception')
| 20.333333
| 59
| 0.77459
| 18
| 244
| 10.055556
| 0.611111
| 0.143646
| 0.198895
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.147541
| 244
| 11
| 60
| 22.181818
| 0.870192
| 0
| 0
| 0.285714
| 0
| 0
| 0.127049
| 0.086066
| 0
| 0
| 0
| 0
| 0
| 1
| 0.142857
| false
| 0.285714
| 0
| 0
| 0.571429
| 0
| 1
| 0
| 1
| 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
| 1
| 0
| 0
| 1
| 0
|
0
| 5
|
8421ec82785b6bb8f2ba72fb30eb39e6d58bc4ee
| 102
|
py
|
Python
|
tests/__init__.py
|
KarstenSchulz/twodolib
|
b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8
|
[
"ISC"
] | 10
|
2015-09-24T02:23:24.000Z
|
2020-03-08T09:21:20.000Z
|
tests/__init__.py
|
KarstenSchulz/twodolib
|
b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8
|
[
"ISC"
] | 7
|
2015-09-15T15:45:00.000Z
|
2020-08-21T07:04:44.000Z
|
tests/__init__.py
|
KarstenSchulz/twodolib
|
b9b2f0f23e5aeaf5edf5f5591319b6b3aea824d8
|
[
"ISC"
] | 2
|
2017-07-03T14:15:50.000Z
|
2019-08-30T13:58:39.000Z
|
# -*- coding: utf-8 -*-
"""Test package for `twodolib` module."""
from . import test_twodolib # noqa
| 25.5
| 41
| 0.637255
| 13
| 102
| 4.923077
| 0.846154
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.011765
| 0.166667
| 102
| 3
| 42
| 34
| 0.741176
| 0.617647
| 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
| 1
| 0
|
0
| 5
|
8424817d83c79185e0cce3f09ca09e8cf2122975
| 16,465
|
py
|
Python
|
tests/test_logger.py
|
uk-gov-mirror/ukgovdatascience.github-organisation-administration
|
f2bf83d2abd507d2e5b70732a57c6ef984e426a2
|
[
"MIT"
] | null | null | null |
tests/test_logger.py
|
uk-gov-mirror/ukgovdatascience.github-organisation-administration
|
f2bf83d2abd507d2e5b70732a57c6ef984e426a2
|
[
"MIT"
] | 3
|
2021-02-17T10:21:56.000Z
|
2021-04-15T09:04:26.000Z
|
tests/test_logger.py
|
ukgovdatascience/github_organisation_administration
|
f2bf83d2abd507d2e5b70732a57c6ef984e426a2
|
[
"MIT"
] | 1
|
2021-04-11T08:55:29.000Z
|
2021-04-11T08:55:29.000Z
|
from py.path import local
from src.utils.logger import Log, create_logger
from typing import Dict, Union
from unittest.mock import MagicMock
import logging
import os
import pytest
import re
# Define the expected logging format for the `create_logger` function
EXPECTED_LOG_FORMAT = "%(asctime)s - %(name)s - %(levelname)s: %(message)s"
# Define the expected base regular expression pattern for the log messages
EXPECTED_LOG_MESSAGE_BASE = r"\d{{4}}-\d{{2}}-\d{{2}} \d{{2}}:\d{{2}}:\d{{2}},\d{{3}} - {name} - {level}: `{function}`:"
@pytest.mark.parametrize("test_input_filename", [None, "hello.log", "world.log", "foo.log", "bar.log"])
@pytest.mark.parametrize("test_input_name", [None, "hello", "world", "foo", "bar"])
class TestCreateLogger:
"""Test the `create_logger` function."""
def test_log_name(self, temporary_log_directory: local, patch_logging_getlogger: MagicMock, test_input_name: str,
test_input_filename: str) -> None:
"""Test the function is assigned the correct name."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# Assert the correct name is used
patch_logging_getlogger.assert_called_with(test_input_name)
def test_log_level(self, temporary_log_directory: local, patch_logging_getlogger: MagicMock, test_input_name: str,
test_input_filename: str) -> None:
"""Test the correct logging level is set."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# Assert the correct logging level is set for the log
patch_logging_getlogger.return_value.setLevel.assert_called_once_with(logging.DEBUG)
def test_log_format(self, temporary_log_directory: local, patch_logging_formatter: MagicMock, test_input_name: str,
test_input_filename: str) -> None:
"""Test the format of the log."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# Assert the correct logging format is applied for the log
patch_logging_formatter.assert_called_once_with(EXPECTED_LOG_FORMAT)
def test_streamhandler_level(self, temporary_log_directory: local, patch_logging_streamhandler: MagicMock,
test_input_name: str, test_input_filename: str) -> None:
"""Test the correct logging level for the stream handler is used."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# Assert the correct logging level for the stream handler is used
patch_logging_streamhandler.return_value.setLevel.assert_called_once_with(logging.INFO)
def test_streamhandler_format(self, temporary_log_directory: local, patch_logging_formatter: MagicMock,
patch_logging_streamhandler: MagicMock, test_input_name: str,
test_input_filename: str) -> None:
"""Test the correct log format is used for the stream handler."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# Assert the correct log format is set for the stream handler
patch_logging_streamhandler.return_value.setFormatter.assert_called_once_with(
patch_logging_formatter.return_value
)
def test_filehandler_filename(self, temporary_log_directory: local, patch_logging_filehandler: MagicMock,
test_input_name: str, test_input_filename: str) -> None:
"""Test the file handler is set with the correct filename."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# If a filename is given, check that the file handler is set with it. Otherwise check the file handler is not
# called
if test_input_filename:
patch_logging_filehandler.assert_called_with(temporary_log_file_path)
else:
assert not patch_logging_filehandler.called
def test_filehandler_level(self, temporary_log_directory: local, patch_logging_filehandler: MagicMock,
test_input_name: str, test_input_filename: str) -> None:
"""Test the file handler is set with the correct logging level."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# If a filename is given, check that the file handler is set with the correct logging level. Otherwise check
# the file handler is not called
if test_input_filename:
patch_logging_filehandler.return_value.setLevel.assert_called_once_with(logging.INFO)
else:
assert not patch_logging_filehandler.called
def test_filehandler_format(self, temporary_log_directory: local, patch_logging_formatter: MagicMock,
patch_logging_filehandler: MagicMock, test_input_name: str,
test_input_filename: str) -> None:
"""Test the file handler is set with the correct logging format."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# If a filename is given, check the file handler is set with the correct logging format. Otherwise check that
# the file handler is not called
if test_input_filename:
patch_logging_filehandler.return_value.setFormatter.assert_called_once_with(
patch_logging_formatter.return_value
)
else:
assert not patch_logging_filehandler.called
def test_add_handlers_to_log(self, mocker, temporary_log_directory: local, patch_logging_getlogger: MagicMock,
patch_logging_streamhandler: MagicMock, patch_logging_filehandler: MagicMock,
test_input_name: str, test_input_filename: str) -> None:
"""Test the stream handler is added to the log, as well as the file handler, if a filename is given."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
_ = create_logger(test_input_name, temporary_log_file_path)
# If a filename is given, check that the last two handlers added to the log are stream and file handler.
# Otherwise, check that only the stream handler is added
if test_input_filename:
# Define the last two expected calls as the stream and file handlers (in order)
test_expected = [mocker.call(patch_logging_streamhandler.return_value),
mocker.call(patch_logging_filehandler.return_value)]
# Assert that the last two calls to `addHandler` are correct
assert patch_logging_getlogger.return_value.addHandler.call_args_list[-2:] == test_expected
else:
patch_logging_getlogger.return_value.addHandler.assert_called_with(patch_logging_streamhandler.return_value)
def test_log_output(self, temporary_log_directory: local, patch_logging_getlogger: MagicMock, test_input_name: str,
test_input_filename: str) -> None:
"""Test the function outputs the expected log."""
# Create a temporary log file, and get its path, if `test_input_filename` is not None
if test_input_filename:
temporary_log_file = temporary_log_directory.join(test_input_filename)
temporary_log_file_path = os.path.join(temporary_log_file.dirname, temporary_log_file.basename)
else:
temporary_log_file_path = None
# Run the `create_logger` function
test_output = create_logger(test_input_name, temporary_log_file_path)
# Assert the output is as expected
assert test_output == patch_logging_getlogger.return_value
# Define test cases for test_input_level argument in the `TestLog` test class
args_test_log_test_input_level = list(sum(
[(L, L.lower()) for L in ["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]],
()
))
@pytest.mark.parametrize("test_input_level", args_test_log_test_input_level)
class TestLog:
def test_logger(self, patch_src_utils_logger_create_logger: MagicMock, test_input_level: str) -> None:
"""Test the `self.logger` instance attribute."""
test_output = Log(patch_src_utils_logger_create_logger, test_input_level).logger
assert test_output == patch_src_utils_logger_create_logger
def test_level(self, patch_src_utils_logger_create_logger: MagicMock, test_input_level: str) -> None:
"""Test the `self.level` instance attribute."""
assert Log(patch_src_utils_logger_create_logger, test_input_level).level == test_input_level.lower()
@pytest.mark.parametrize("test_input_function_duration", range(1, 5))
def test_log_messages_correct_for_no_exceptions(
self, patch_src_utils_logger_time: MagicMock,
example_log_file: Dict[str, Union[logging.Logger, logging.RootLogger, str]], test_input_level: str,
test_input_function_duration: int
) -> None:
"""Test the decorator creates the correct log messages, if the function it wraps raises no exceptions."""
# Set the `side_effect` of `patch_src_utils_logger_time`
patch_src_utils_logger_time.side_effect = [0, test_input_function_duration]
@Log(example_log_file["logger"], test_input_level)
def example_function():
"""Example function that raises no errors."""
pass
# Define the base regular expression pattern of the log message. This will be a datetime stamp, followed by the
# logger name, logging level, and wrapped function name
log_base_pattern = EXPECTED_LOG_MESSAGE_BASE.format(name=example_log_file["logger"].name,
level=test_input_level.upper(),
function=example_function.__name__)
# Define the complete log message expected
test_expected_regex_pattern = fr"{log_base_pattern} Executing function\n{log_base_pattern} Executed in " \
fr"{test_input_function_duration:0.2f} s"
# Execute the `example_function`
_ = example_function()
# Open the log file, and assert the message is as expected. If level is DEBUG, assert the log is empty
with open(example_log_file["path"], "r") as f:
if test_input_level.upper() == "DEBUG":
assert f.read() == ""
else:
assert re.match(test_expected_regex_pattern, f.read())
@pytest.mark.parametrize("test_input_function_duration", range(1, 5))
def test_log_messages_correct_for_exceptions(
self, patch_src_utils_logger_time: MagicMock,
example_log_file: Dict[str, Union[logging.Logger, logging.RootLogger, str]], test_input_level: str,
test_input_function_duration: int
) -> None:
"""Test the decorator creates the correct log messages, if the function it wraps raises exceptions."""
# Set the `side_effect` of `patch_src_utils_logger_time`
patch_src_utils_logger_time.side_effect = [0, test_input_function_duration]
@Log(example_log_file["logger"], test_input_level)
def example_function():
"""Example function that raises a ValueError."""
raise ValueError("Testing for errors")
# Define the base regular expression pattern of the entry and error log messages
entry_log_base_pattern = EXPECTED_LOG_MESSAGE_BASE.format(name=example_log_file["logger"].name,
level=test_input_level.upper(),
function=example_function.__name__)
error_log_base_pattern = EXPECTED_LOG_MESSAGE_BASE.format(name=example_log_file["logger"].name, level="ERROR",
function=example_function.__name__)
# Define the expected entry and error log regular expression patterns
test_expected_entry_log_regex_pattern = entry_log_base_pattern + r" Executing function\n"
test_expected_error_log_regex_pattern = error_log_base_pattern + r" Raised an exception!"
# Execute the `example_function`, which should raise a `ValueError`
with pytest.raises(ValueError):
_ = example_function()
# Open the log file, and assert the message is as expected. If level is DEBUG, assert the log is empty
with open(example_log_file["path"], "r") as f:
if test_input_level.upper() == "DEBUG":
assert re.match(test_expected_error_log_regex_pattern, f.read())
else:
assert re.match(test_expected_entry_log_regex_pattern + test_expected_error_log_regex_pattern, f.read())
| 52.269841
| 120
| 0.687337
| 2,117
| 16,465
| 5.003307
| 0.085971
| 0.077323
| 0.107251
| 0.058535
| 0.802965
| 0.761046
| 0.731495
| 0.731495
| 0.696752
| 0.682685
| 0
| 0.001283
| 0.242697
| 16,465
| 314
| 121
| 52.436306
| 0.848184
| 0.248527
| 0
| 0.616667
| 0
| 0.005556
| 0.044533
| 0.014136
| 0
| 0
| 0
| 0
| 0.111111
| 1
| 0.088889
| false
| 0.005556
| 0.044444
| 0
| 0.144444
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 1
| 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
| 5
|
ffbc93d26b1d97aab9e19c960435098fdde4851f
| 85
|
py
|
Python
|
consumer/exceptions.py
|
svorcan/aws-prod-con
|
5adb89dc4e7f535624dcbcff833f8da1ab4e0930
|
[
"MIT"
] | null | null | null |
consumer/exceptions.py
|
svorcan/aws-prod-con
|
5adb89dc4e7f535624dcbcff833f8da1ab4e0930
|
[
"MIT"
] | 8
|
2021-02-02T22:07:43.000Z
|
2022-03-11T23:42:53.000Z
|
consumer/exceptions.py
|
stalker92/aws-prod-con
|
5adb89dc4e7f535624dcbcff833f8da1ab4e0930
|
[
"MIT"
] | null | null | null |
class AdapterError(Exception):
pass
class ServiceAPIError(Exception):
pass
| 12.142857
| 33
| 0.741176
| 8
| 85
| 7.875
| 0.625
| 0.412698
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.188235
| 85
| 6
| 34
| 14.166667
| 0.913043
| 0
| 0
| 0.5
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0.5
| 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
| 0
| 1
| 1
| 0
| 0
| 0
| 0
|
0
| 5
|
fff192dde7d2ffe576888d2a8a1f0ed626ffe06e
| 50
|
py
|
Python
|
src/amuse/community/mpiamrvac/__init__.py
|
sibonyves/amuse
|
5557bf88d14df1aa02133a199b6d60c0c57dcab7
|
[
"Apache-2.0"
] | null | null | null |
src/amuse/community/mpiamrvac/__init__.py
|
sibonyves/amuse
|
5557bf88d14df1aa02133a199b6d60c0c57dcab7
|
[
"Apache-2.0"
] | 12
|
2021-11-15T09:13:03.000Z
|
2022-02-02T14:53:04.000Z
|
src/amuse/community/mpiamrvac/__init__.py
|
sibonyves/amuse
|
5557bf88d14df1aa02133a199b6d60c0c57dcab7
|
[
"Apache-2.0"
] | null | null | null |
# generated file
from .interface import Mpiamrvac
| 16.666667
| 32
| 0.82
| 6
| 50
| 6.833333
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.14
| 50
| 2
| 33
| 25
| 0.953488
| 0.28
| 0
| 0
| 1
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 0
| 0
|
0
| 5
|
0803487d716b875cec0618a123e13681d925bd0e
| 3,388
|
py
|
Python
|
test/test_conversiondynamic.py
|
sdickler/FINE
|
3114fd009e80a7eadacffe26bf5ff8e6a126ac61
|
[
"MIT"
] | 34
|
2018-07-02T16:20:39.000Z
|
2022-03-30T09:46:44.000Z
|
test/test_conversiondynamic.py
|
sdickler/FINE
|
3114fd009e80a7eadacffe26bf5ff8e6a126ac61
|
[
"MIT"
] | 19
|
2018-11-09T07:56:20.000Z
|
2022-02-15T10:54:21.000Z
|
test/test_conversiondynamic.py
|
sdickler/FINE
|
3114fd009e80a7eadacffe26bf5ff8e6a126ac61
|
[
"MIT"
] | 42
|
2018-09-24T15:07:20.000Z
|
2022-02-25T18:41:52.000Z
|
#!/usr/bin/env python
# coding: utf-8
# # Workflow for a multi-regional energy system
#
import FINE as fn
import pandas as pd
import pytest
def test_ConversionDynamicNeedsCapacity():
esM = fn.EnergySystemModel(locations={'example_region1', },
commodities={'electricity','methane'},
commodityUnitsDict={'electricity': r'GW$_{el}$','methane': r'GW$_{th}$'},
verboseLogLevel=2)
with pytest.raises(ValueError, match=r".*hasCapacityVariable.*"):
fn.ConversionDynamic(esM=esM, name='restricted', physicalUnit=r'GW$_{el}$',
commodityConversionFactors={'electricity':1, 'methane':-1/0.625},
partLoadMin = 0.3, bigM= 100, rampDownMax=0.5,
investPerCapacity=0.5, opexPerCapacity=0.021, opexPerOperation =1, interestRate=0.08,
economicLifetime=33, hasCapacityVariable = False)
def test_ConversionDynamicNeedsHigherOperationRate():
numberOfTimeSteps = 4
locations = {'ElectrolyzerLocation', 'IndustryLocation'}
esM = fn.EnergySystemModel(locations=locations,
commodities={'electricity','methane'},
commodityUnitsDict={'electricity': r'GW$_{el}$','methane': r'GW$_{th}$'},
numberOfTimeSteps = numberOfTimeSteps, verboseLogLevel=2)
operationRateMax = pd.DataFrame([[0.2, 0.4, 1., 1.,],[0., 0., 0., 0.,]],
index = locations, columns = range(0,numberOfTimeSteps)).T
with pytest.raises(ValueError, match=r".*operationRateMax.*"):
fn.ConversionDynamic(esM=esM, name='restricted', physicalUnit=r'GW$_{el}$',
commodityConversionFactors={'electricity':1, 'methane':-1/0.625},
partLoadMin = 0.3, bigM= 100, rampDownMax=0.5, operationRateMax= operationRateMax,
investPerCapacity=0.5, opexPerCapacity=0.021, opexPerOperation =1, interestRate=0.08,
economicLifetime=33,)
def test_ConversionDynamicHasHigherOperationRate():
numberOfTimeSteps = 4
locations = {'ElectrolyzerLocation', 'IndustryLocation'}
esM = fn.EnergySystemModel(locations=locations,
commodities={'electricity','methane'},
commodityUnitsDict={'electricity': r'GW$_{el}$','methane': r'GW$_{th}$'},
numberOfTimeSteps = numberOfTimeSteps, verboseLogLevel=2)
operationRateMax = pd.DataFrame([[0., 0.4, 1., 1.,],[0., 0., 0., 0.,]],
index = locations, columns = range(0,numberOfTimeSteps)).T
fn.ConversionDynamic(esM=esM, name='restricted', physicalUnit=r'GW$_{el}$',
commodityConversionFactors={'electricity':1, 'methane':-1/0.625},
partLoadMin = 0.3, bigM= 100, rampDownMax=0.5, operationRateMax= operationRateMax,
investPerCapacity=0.5, opexPerCapacity=0.021, opexPerOperation =1, interestRate=0.08,
economicLifetime=33,)
if __name__ == "__main__":
test_ConversionDynamicNeedsCapacity()
test_ConversionDynamicNeedsHigherOperationRate()
test_ConversionDynamicHasHigherOperationRate()
| 47.71831
| 113
| 0.594451
| 287
| 3,388
| 6.933798
| 0.28223
| 0.013568
| 0.015075
| 0.046734
| 0.754774
| 0.754774
| 0.722613
| 0.722613
| 0.722613
| 0.722613
| 0
| 0.042127
| 0.278335
| 3,388
| 71
| 114
| 47.71831
| 0.771779
| 0.023318
| 0
| 0.617021
| 0
| 0
| 0.124357
| 0.006959
| 0
| 0
| 0
| 0
| 0
| 1
| 0.06383
| false
| 0
| 0.06383
| 0
| 0.12766
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
0822e4df5726b226d8e3c74d19a9529645f9ebac
| 229
|
py
|
Python
|
conftest.py
|
opennode/waldur-ansible
|
c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9
|
[
"MIT"
] | 1
|
2017-09-05T08:09:47.000Z
|
2017-09-05T08:09:47.000Z
|
conftest.py
|
opennode/waldur-ansible
|
c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9
|
[
"MIT"
] | null | null | null |
conftest.py
|
opennode/waldur-ansible
|
c81c5f0491be02fa9a55a6d5bf9d845750fd1ba9
|
[
"MIT"
] | 3
|
2017-09-24T03:13:19.000Z
|
2018-08-12T07:44:38.000Z
|
from waldur_ansible.common.tests.integration import integration_tests_config
def pytest_addoption(parser):
parser.addoption(integration_tests_config.TEST_TAG_FLAG, action="append", help="specify what type of tests to run")
| 38.166667
| 119
| 0.829694
| 32
| 229
| 5.6875
| 0.75
| 0.175824
| 0.241758
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.091703
| 229
| 5
| 120
| 45.8
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0.170306
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.333333
| 0
| 0.666667
| 0
| 0
| 0
| 0
| null | 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
082338bdd074b0d4491db9f49fd6e4d68e7406ed
| 542
|
py
|
Python
|
holobot/extensions/moderation/repositories/__init__.py
|
rexor12/holobot
|
89b7b416403d13ccfeee117ef942426b08d3651d
|
[
"MIT"
] | 1
|
2021-05-24T00:17:46.000Z
|
2021-05-24T00:17:46.000Z
|
holobot/extensions/moderation/repositories/__init__.py
|
rexor12/holobot
|
89b7b416403d13ccfeee117ef942426b08d3651d
|
[
"MIT"
] | 41
|
2021-03-24T22:50:09.000Z
|
2021-12-17T12:15:13.000Z
|
holobot/extensions/moderation/repositories/__init__.py
|
rexor12/holobot
|
89b7b416403d13ccfeee117ef942426b08d3651d
|
[
"MIT"
] | null | null | null |
from .ilog_settings_repository import ILogSettingsRepository
from .imutes_repository import IMutesRepository
from .ipermission_repository import IPermissionRepository
from .iwarn_repository import IWarnRepository
from .iwarn_settings_repository import IWarnSettingsRepository
from .log_settings_repository import LogSettingsRepository
from .mutes_repository import MutesRepository
from .permission_repository import PermissionRepository
from .warn_repository import WarnRepository
from .warn_settings_repository import WarnSettingsRepository
| 49.272727
| 62
| 0.907749
| 54
| 542
| 8.851852
| 0.407407
| 0.334728
| 0.200837
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.073801
| 542
| 10
| 63
| 54.2
| 0.952191
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
f256b8358018bd2e5f93be406fde605a776092d8
| 107
|
py
|
Python
|
_solutions/basics/types/type_int_d.py
|
sages-pl/2022-01-pythonsqlalchemy-aptiv
|
1d6d856608e9dbe25b139e8968c48b7f46753b84
|
[
"MIT"
] | null | null | null |
_solutions/basics/types/type_int_d.py
|
sages-pl/2022-01-pythonsqlalchemy-aptiv
|
1d6d856608e9dbe25b139e8968c48b7f46753b84
|
[
"MIT"
] | null | null | null |
_solutions/basics/types/type_int_d.py
|
sages-pl/2022-01-pythonsqlalchemy-aptiv
|
1d6d856608e9dbe25b139e8968c48b7f46753b84
|
[
"MIT"
] | null | null | null |
karman_line_earth = 100_000*m // km
karman_line_mars = 80_000*m // km
karman_line_venus = 250_000*m // km
| 21.4
| 35
| 0.738318
| 21
| 107
| 3.333333
| 0.52381
| 0.428571
| 0.257143
| 0.342857
| 0.457143
| 0
| 0
| 0
| 0
| 0
| 0
| 0.186813
| 0.149533
| 107
| 4
| 36
| 26.75
| 0.582418
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| null | 1
| 1
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f2771c82e7f449cf41de2abfd813eea9fc733da0
| 440
|
py
|
Python
|
tests/test_newlinecharacterconv.py
|
qinxian1989/newlinecharacterconv
|
69675e96641337aeba95f5a6cd8c71a00f04a030
|
[
"MIT"
] | null | null | null |
tests/test_newlinecharacterconv.py
|
qinxian1989/newlinecharacterconv
|
69675e96641337aeba95f5a6cd8c71a00f04a030
|
[
"MIT"
] | null | null | null |
tests/test_newlinecharacterconv.py
|
qinxian1989/newlinecharacterconv
|
69675e96641337aeba95f5a6cd8c71a00f04a030
|
[
"MIT"
] | null | null | null |
#!/usr/bin/env python
"""Tests for `newlinecharacterconv` package."""
import unittest
from newlinecharacterconv import lineconv
class TestNewlinecharacterconv(unittest.TestCase):
"""Tests for `newlinecharacterconv` package."""
def setUp(self):
"""Set up test fixtures, if any."""
def tearDown(self):
"""Tear down test fixtures, if any."""
def test_000_something(self):
"""Test something."""
| 20
| 51
| 0.668182
| 47
| 440
| 6.212766
| 0.617021
| 0.054795
| 0.191781
| 0.239726
| 0.136986
| 0
| 0
| 0
| 0
| 0
| 0
| 0.008499
| 0.197727
| 440
| 21
| 52
| 20.952381
| 0.818697
| 0.415909
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.5
| false
| 0
| 0.333333
| 0
| 1
| 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
| 1
| 0
| 1
| 0
|
0
| 5
|
f27869b790bf79d7618356d8aaf86a093af1c5b7
| 27
|
py
|
Python
|
derivative/__version__.py
|
andgoldschmidt/derivative
|
2c67d1348d6ed8d769c1e07b54c94b2e4c58f2f0
|
[
"MIT"
] | 18
|
2020-07-21T08:34:13.000Z
|
2022-02-11T09:24:40.000Z
|
venv/Lib/site-packages/derivative/__version__.py
|
ayandeephazra/Chemical_Origins_Of_Life
|
5858b51063c53b2db00529fe79a67d321193171e
|
[
"MIT"
] | 7
|
2020-07-28T16:11:52.000Z
|
2022-01-21T23:01:04.000Z
|
venv/Lib/site-packages/derivative/__version__.py
|
ayandeephazra/Chemical_Origins_Of_Life
|
5858b51063c53b2db00529fe79a67d321193171e
|
[
"MIT"
] | 3
|
2021-07-21T03:59:04.000Z
|
2021-12-29T22:45:43.000Z
|
__version__: str = '0.3.1'
| 13.5
| 26
| 0.62963
| 5
| 27
| 2.6
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.130435
| 0.148148
| 27
| 1
| 27
| 27
| 0.434783
| 0
| 0
| 0
| 0
| 0
| 0.185185
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0
| 0
| 0
| 0
| 1
| 1
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
f29b638b06c21e5d174f850e4fe8515d95c3a425
| 56
|
py
|
Python
|
__main__.py
|
mblanchard23/brefcrawler
|
5960d9d08ec8fddd822adf77292a2d3f21e80225
|
[
"MIT"
] | null | null | null |
__main__.py
|
mblanchard23/brefcrawler
|
5960d9d08ec8fddd822adf77292a2d3f21e80225
|
[
"MIT"
] | null | null | null |
__main__.py
|
mblanchard23/brefcrawler
|
5960d9d08ec8fddd822adf77292a2d3f21e80225
|
[
"MIT"
] | null | null | null |
from db_tables import insert_players, Players, session
| 18.666667
| 54
| 0.839286
| 8
| 56
| 5.625
| 0.875
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.125
| 56
| 2
| 55
| 28
| 0.918367
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4b4b7fc131ddf658f5043d431cbbcbca24833b07
| 81
|
py
|
Python
|
src/pins.py
|
CurlyTaleGamesLLC/PyKiln
|
6dfda8ec2d485bdf283b7ef7ef45d0848b8d5c99
|
[
"MIT"
] | 17
|
2021-01-01T12:27:40.000Z
|
2022-01-27T19:45:47.000Z
|
src/pins.py
|
CurlyTaleGamesLLC/PyKiln
|
6dfda8ec2d485bdf283b7ef7ef45d0848b8d5c99
|
[
"MIT"
] | 3
|
2021-06-02T03:36:57.000Z
|
2021-12-10T11:13:34.000Z
|
src/pins.py
|
CurlyTaleGamesLLC/PyKiln
|
6dfda8ec2d485bdf283b7ef7ef45d0848b8d5c99
|
[
"MIT"
] | 1
|
2020-10-09T18:32:38.000Z
|
2020-10-09T18:32:38.000Z
|
import device
class pins:
"""
Defines the pins used in PyKiln
"""
| 9
| 35
| 0.580247
| 10
| 81
| 4.7
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.333333
| 81
| 8
| 36
| 10.125
| 0.87037
| 0.382716
| 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
| 1
| 0
|
0
| 5
|
4b689780250789a4d6274fa15a4852dc375c8aeb
| 55
|
py
|
Python
|
deephsb/engine/solver/__init__.py
|
zudi-lin/human_behavior_prediction
|
557639fb30691e20959c277f82436a1a085eb0aa
|
[
"MIT"
] | 1
|
2020-12-25T14:51:17.000Z
|
2020-12-25T14:51:17.000Z
|
deephsb/engine/solver/__init__.py
|
zudi-lin/human_behavior_prediction
|
557639fb30691e20959c277f82436a1a085eb0aa
|
[
"MIT"
] | null | null | null |
deephsb/engine/solver/__init__.py
|
zudi-lin/human_behavior_prediction
|
557639fb30691e20959c277f82436a1a085eb0aa
|
[
"MIT"
] | null | null | null |
from .build import build_optimizer, build_lr_scheduler
| 27.5
| 54
| 0.872727
| 8
| 55
| 5.625
| 0.75
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.090909
| 55
| 1
| 55
| 55
| 0.9
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
4b873858bbc096906c6e474cb8e1ada9588836d0
| 66
|
py
|
Python
|
librespot/player/playback/__init__.py
|
JeffmeisterJ/librespot-python
|
0e0e1db65aa40262bd13479b97f81ae8c29ae049
|
[
"Apache-2.0"
] | 1
|
2021-12-15T22:44:46.000Z
|
2021-12-15T22:44:46.000Z
|
librespot/player/playback/__init__.py
|
JeffmeisterJ/librespot-python
|
0e0e1db65aa40262bd13479b97f81ae8c29ae049
|
[
"Apache-2.0"
] | 12
|
2021-10-06T02:18:44.000Z
|
2022-02-07T02:16:47.000Z
|
librespot/player/playback/__init__.py
|
JeffmeisterJ/librespot-python
|
0e0e1db65aa40262bd13479b97f81ae8c29ae049
|
[
"Apache-2.0"
] | null | null | null |
from librespot.player.playback.PlayerSession import PlayerSession
| 33
| 65
| 0.893939
| 7
| 66
| 8.428571
| 0.857143
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.060606
| 66
| 1
| 66
| 66
| 0.951613
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
298ac22fba8478d0c2178c9e806662e291a5a021
| 164
|
py
|
Python
|
thinc/shims/__init__.py
|
justindujardin/thinc
|
b3d641c4d42e430fe9917ded7cb2892256f9b7e1
|
[
"MIT"
] | null | null | null |
thinc/shims/__init__.py
|
justindujardin/thinc
|
b3d641c4d42e430fe9917ded7cb2892256f9b7e1
|
[
"MIT"
] | null | null | null |
thinc/shims/__init__.py
|
justindujardin/thinc
|
b3d641c4d42e430fe9917ded7cb2892256f9b7e1
|
[
"MIT"
] | null | null | null |
from .shim import Shim
from .pytorch import PyTorchShim
from .tensorflow import keras_model_fns, TensorFlowShim, maybe_handshake_model
from .mxnet import MXNetShim
| 32.8
| 78
| 0.853659
| 22
| 164
| 6.181818
| 0.636364
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.109756
| 164
| 4
| 79
| 41
| 0.931507
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 1
| 0
| 1
| 0
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
29a70ae50998c8da42e66d47d7b96e0f92514b60
| 62
|
py
|
Python
|
__init__.py
|
haisenzhao/CarpentryCompiler
|
c9714310b7ce7523a25becd397265bfaa3ab7ea3
|
[
"FSFAP"
] | 21
|
2019-12-06T09:57:10.000Z
|
2021-09-22T12:58:09.000Z
|
__init__.py
|
haisenzhao/CarpentryCompiler
|
c9714310b7ce7523a25becd397265bfaa3ab7ea3
|
[
"FSFAP"
] | null | null | null |
__init__.py
|
haisenzhao/CarpentryCompiler
|
c9714310b7ce7523a25becd397265bfaa3ab7ea3
|
[
"FSFAP"
] | 5
|
2020-11-18T00:09:30.000Z
|
2021-01-13T04:40:47.000Z
|
import _PartDesign
makeFilletArc = _PartDesign.makeFilletArc
| 15.5
| 41
| 0.870968
| 5
| 62
| 10.4
| 0.6
| 0.884615
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.096774
| 62
| 3
| 42
| 20.666667
| 0.928571
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| false
| 0
| 0.5
| 0
| 0.5
| 0
| 1
| 0
| 1
| 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
| 5
|
29ed02c9a6fa7f5a3f7c5b7c9ac7a825bd6b0a8c
| 86
|
py
|
Python
|
mundo-1/pythonteste/aula08a.py
|
fln99/curso-python
|
23176a65cec6d2e1e114ac7ff500d6b0dac95630
|
[
"MIT"
] | null | null | null |
mundo-1/pythonteste/aula08a.py
|
fln99/curso-python
|
23176a65cec6d2e1e114ac7ff500d6b0dac95630
|
[
"MIT"
] | null | null | null |
mundo-1/pythonteste/aula08a.py
|
fln99/curso-python
|
23176a65cec6d2e1e114ac7ff500d6b0dac95630
|
[
"MIT"
] | null | null | null |
import emoji
print(emoji.emojize('Python é foda! :earth_americas:', use_aliases=True))
| 43
| 73
| 0.790698
| 13
| 86
| 5.076923
| 0.923077
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.069767
| 86
| 2
| 73
| 43
| 0.825
| 0
| 0
| 0
| 0
| 0
| 0.356322
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.5
| 0
| 0.5
| 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
| 1
| 0
| 0
| 1
|
0
| 5
|
d99ab22ca86f57258edfaaa5a380ca150b082274
| 6,384
|
py
|
Python
|
tests/st/ops/cpu/test_minimum_op.py
|
PowerOlive/mindspore
|
bda20724a94113cedd12c3ed9083141012da1f15
|
[
"Apache-2.0"
] | 3,200
|
2020-02-17T12:45:41.000Z
|
2022-03-31T20:21:16.000Z
|
tests/st/ops/cpu/test_minimum_op.py
|
zimo-geek/mindspore
|
665ec683d4af85c71b2a1f0d6829356f2bc0e1ff
|
[
"Apache-2.0"
] | 176
|
2020-02-12T02:52:11.000Z
|
2022-03-28T22:15:55.000Z
|
tests/st/ops/cpu/test_minimum_op.py
|
zimo-geek/mindspore
|
665ec683d4af85c71b2a1f0d6829356f2bc0e1ff
|
[
"Apache-2.0"
] | 621
|
2020-03-09T01:31:41.000Z
|
2022-03-30T03:43:19.000Z
|
# Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
import numpy as np
import pytest
import mindspore.context as context
from mindspore.common.tensor import Tensor
from mindspore.nn import Cell
from mindspore.ops import operations as P
class ConstScalarAndTensorMinimum(Cell):
def __init__(self):
super(ConstScalarAndTensorMinimum, self).__init__()
self.min = P.Minimum()
self.x = 20
def construct(self, y):
return self.min(self.x, y)
class TwoTensorsMinimum(Cell):
def __init__(self):
super(TwoTensorsMinimum, self).__init__()
self.min = P.Minimum()
def construct(self, x, y):
return self.min(x, y)
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_constScalar_tensor_int():
x = Tensor(np.array([[2, 3, 4], [100, 200, 300]]).astype(np.int32))
expect = [[2, 3, 4], [20, 20, 20]]
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = ConstScalarAndTensorMinimum()
output = min_op(x)
assert np.all(output.asnumpy() == expect)
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_Not_Broadcast_int():
prop = 100 if np.random.random() > 0.5 else -100
x = np.random.randn(3, 4, 5).astype(np.int32) * prop
y = np.random.randn(3, 4, 5).astype(np.int32) * prop
expect = np.minimum(x, y).astype(np.int32)
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(Tensor(x), Tensor(y))
assert np.all(output.asnumpy() == expect)
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_Broadcast_int():
prop = 100 if np.random.random() > 0.5 else -100
x = np.random.randn(3, 4, 5).astype(np.int32) * prop
y = np.random.randn(3, 1, 1).astype(np.int32) * prop
expect = np.minimum(x, y).astype(np.int32)
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(Tensor(x), Tensor(y))
assert np.all(output.asnumpy() == expect)
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_Broadcast_oneDimension_int():
prop = 100 if np.random.random() > 0.5 else -100
x = np.random.randn(3).astype(np.int32) * prop
y = np.random.randn(3).astype(np.int32) * prop
expect = np.minimum(x, y).astype(np.int32)
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(Tensor(x), Tensor(y))
assert np.all(output.asnumpy() == expect)
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_notBroadcast_all_oneDimension_int():
x = Tensor(np.array([[2]]).astype(np.int32))
y = Tensor(np.array([[100]]).astype(np.int32))
expect = [[2]]
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(x, y)
assert np.all(output.asnumpy() == expect)
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_notBroadcast_float32():
prop = 100 if np.random.random() > 0.5 else -100
x = np.random.randn(3, 4, 5).astype(np.float32) * prop
y = np.random.randn(3, 4, 5).astype(np.float32) * prop
expect = np.minimum(x, y).astype(np.float32)
error = np.ones(shape=expect.shape) * 1.0e-5
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(Tensor(x), Tensor(y))
diff = output.asnumpy() - expect
assert np.all(np.abs(diff) < error)
assert output.shape == expect.shape
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_notBroadcast_float16():
prop = 100 if np.random.random() > 0.5 else -100
x = np.random.randn(3, 4, 5).astype(np.float16) * prop
y = np.random.randn(3, 4, 5).astype(np.float16) * prop
expect = np.minimum(x, y).astype(np.float16)
error = np.ones(shape=expect.shape) * 1.0e-5
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(Tensor(x), Tensor(y))
diff = output.asnumpy() - expect
assert np.all(np.abs(diff) < error)
assert output.shape == expect.shape
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_Broadcast_float16():
prop = 100 if np.random.random() > 0.5 else -100
x = np.random.randn(3, 4, 5).astype(np.float16) * prop
y = np.random.randn(3, 4, 1).astype(np.float16) * prop
expect = np.minimum(x, y).astype(np.float16)
error = np.ones(shape=expect.shape) * 1.0e-5
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(Tensor(x), Tensor(y))
diff = output.asnumpy() - expect
assert np.all(np.abs(diff) < error)
assert output.shape == expect.shape
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_minimum_two_tensors_notBroadcast_float64():
prop = 100 if np.random.random() > 0.5 else -100
x = np.random.randn(3, 4, 1).astype(np.float64) * prop
y = np.random.randn(3, 4, 5).astype(np.float64) * prop
expect = np.minimum(x, y).astype(np.float64)
error = np.ones(shape=expect.shape) * 1.0e-5
context.set_context(mode=context.GRAPH_MODE, device_target="CPU")
min_op = TwoTensorsMinimum()
output = min_op(Tensor(x), Tensor(y))
diff = output.asnumpy() - expect
assert np.all(np.abs(diff) < error)
assert output.shape == expect.shape
| 34.322581
| 78
| 0.693296
| 965
| 6,384
| 4.445596
| 0.148187
| 0.062937
| 0.042424
| 0.045688
| 0.775991
| 0.757343
| 0.738228
| 0.738228
| 0.72331
| 0.715851
| 0
| 0.041907
| 0.158991
| 6,384
| 185
| 79
| 34.508108
| 0.757124
| 0.099937
| 0
| 0.676471
| 0
| 0
| 0.004711
| 0
| 0
| 0
| 0
| 0
| 0.095588
| 1
| 0.095588
| false
| 0
| 0.044118
| 0.014706
| 0.169118
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
d9a46adbff47f565dbfd0838296c6ec269fc07ab
| 210
|
py
|
Python
|
Day28/Newproject/app/views/ajaxTest.py
|
DreamLose/python-
|
865249d7dba1fb1452189bde59c378aab8c99c9b
|
[
"MIT"
] | 1
|
2020-11-12T01:37:20.000Z
|
2020-11-12T01:37:20.000Z
|
Day28/Newproject/app/views/ajaxTest.py
|
DreamLose/python-
|
865249d7dba1fb1452189bde59c378aab8c99c9b
|
[
"MIT"
] | null | null | null |
Day28/Newproject/app/views/ajaxTest.py
|
DreamLose/python-
|
865249d7dba1fb1452189bde59c378aab8c99c9b
|
[
"MIT"
] | null | null | null |
from django.shortcuts import render,HttpResponse
def ajaxtest(request):
return render(request,'ajax.html')
def ajax2(request):
# list = request.GE
print(request.GET)
return HttpResponse('成功!')
| 23.333333
| 48
| 0.719048
| 26
| 210
| 5.807692
| 0.692308
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.005682
| 0.161905
| 210
| 9
| 49
| 23.333333
| 0.852273
| 0.080952
| 0
| 0
| 0
| 0
| 0.0625
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.333333
| false
| 0
| 0.166667
| 0.166667
| 0.833333
| 0.166667
| 1
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 1
| 1
| 0
|
0
| 5
|
d9d9db7ff4aad98dbf8f6cf5c1b2fdf697985a17
| 1,486
|
py
|
Python
|
setup.py
|
liangxin1300/clusterTestTool
|
5652b20f406a2536905583053cee263797fb829c
|
[
"BSD-3-Clause"
] | 2
|
2018-12-19T08:43:42.000Z
|
2019-06-04T08:18:58.000Z
|
setup.py
|
liangxin1300/clusterTestTool
|
5652b20f406a2536905583053cee263797fb829c
|
[
"BSD-3-Clause"
] | 10
|
2019-08-05T09:45:56.000Z
|
2019-10-15T01:35:27.000Z
|
setup.py
|
liangxin1300/cluster_preflight_check
|
5652b20f406a2536905583053cee263797fb829c
|
[
"BSD-3-Clause"
] | 1
|
2019-08-06T07:47:57.000Z
|
2019-08-06T07:47:57.000Z
|
import setuptools
setuptools.setup(
name="cluster_preflight_check",
version="0.0.34",
author="Xin Liang",
author_email="XLiang@suse.com",
url="https://github.com/liangxin1300/cluster_preflight_check.git",
license="BSD",
packages=setuptools.find_packages(exclude=["tests"]),
description="Tool for Standardize Testing of Basic Cluster Functionality",
entry_points={
'console_scripts': ['ha-cluster-preflight-check=cluster_preflight_check.main:main'],
},
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"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",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Clustering",
"Topic :: System :: Networking",
"Topic :: System :: Systems Administration",
]
)
| 40.162162
| 92
| 0.599596
| 143
| 1,486
| 6.160839
| 0.503497
| 0.23723
| 0.312145
| 0.206583
| 0.061294
| 0
| 0
| 0
| 0
| 0
| 0
| 0.024545
| 0.259758
| 1,486
| 36
| 93
| 41.277778
| 0.776364
| 0
| 0
| 0
| 0
| 0
| 0.635935
| 0.055855
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| true
| 0
| 0.028571
| 0
| 0.028571
| 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
| 1
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
8a197f384072aca6a516dd9bbbabae9f3ad20e10
| 10,404
|
py
|
Python
|
tip.py
|
ilmango-ChikaP/Tip-Sugar
|
f6f478d7b7b8a7ccc88d2dbed2d82b7c6cd65372
|
[
"MIT"
] | 8
|
2019-04-05T13:12:44.000Z
|
2020-11-17T14:53:24.000Z
|
tip.py
|
ilmango-ChikaP/Tip-Sugar
|
f6f478d7b7b8a7ccc88d2dbed2d82b7c6cd65372
|
[
"MIT"
] | 6
|
2019-09-17T21:47:11.000Z
|
2021-02-09T19:31:20.000Z
|
tip.py
|
sugarchain-project/Tip-Sugar
|
8052e83a57d3b52a94953f61de1799177e3a6d66
|
[
"MIT"
] | 8
|
2019-09-17T20:27:28.000Z
|
2021-05-20T09:42:58.000Z
|
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from decimal import Decimal
import discord
from discord.ext import commands
import user_db
import config
# connect to coind
rpc_connection = 'http://{0}:{1}@{2}:{3}'.format(config.rpc_user, config.rpc_password, config.ip, config.rpc_port)
def str_isfloat(str):
try:
float(str)
return True
except ValueError:
return False
class Tip(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
async def tip(self, ctx, mention=None, amount=None):
client = AuthServiceProxy(rpc_connection)
user_id = str(ctx.author.id)
if not user_db.check_user(user_id):
embed = discord.Embed(
title="**For first-use-user**",
color=0x0043ff)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="First of all, please type `//help`",
value="Welcome to world of Tip Sugar !")
embed.set_thumbnail(url=self.bot.user.avatar_url_as(format='png', size=1024))
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
else:
pass
if mention is None or amount is None:
embed = discord.Embed(color=0xffd800)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="Please check `//help` ",
value=" :mag: ")
embed.set_footer(
text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
elif not str_isfloat(amount):
embed = discord.Embed(color=0xff0000)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="invalid amount.",
value="`{0}`".format(amount))
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
else:
pass
tipfrom = str(ctx.author.id)
tipto = str(mention.replace('<@','').replace('>','')).replace('!','')
amount = Decimal(str(float(amount))) # Dealing with cases like "001.100", ".123" : "float(amount)"
if amount < Decimal('0.00000001'):
embed = discord.Embed(color=0xff0000)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="amount must be at least 0.00000001 SUGAR",
value="`{0}`".format(amount))
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
else:
if len(tipto) != 18 and len(tipto) != 17: # length of discord user id is 18 or 17
embed = discord.Embed(color=0xff0000)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="invalid user.",
value="`{0}`".format(str(mention)))
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
elif tipfrom == tipto:
embed = discord.Embed(color=0xff0000)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="You cannot tip to yourself.",
value=" :thinking: ")
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
elif amount > client.getbalance(tipfrom, config.CONFIRM):
embed = discord.Embed(color=0xff0000)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="You don't have enough balances.",
value="Your balances ```{0} SUGAR```".format(client.getbalance(tipfrom, config.CONFIRM)))
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
else:
if tipto == str(self.bot.user.id):
try:
move_istrue = client.move(tipfrom, 'tipsugar_wallet', float(amount))
except:
embed = discord.Embed(color=0xff0000)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="invalid amount.\n(You can not specify the einth decimal place or smaller than that.)",
value="`{0}`".format(amount))
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
if move_istrue:
embed = discord.Embed(color=0x0043ff)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="Thank you for donating!",
value="```{0} SUGAR```".format(amount))
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
else:
try:
move_istrue = client.move(tipfrom, tipto, float(amount))
except:
embed = discord.Embed(color=0xff0000)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="invalid amount.\n(You can not specify the einth decimal place or smaller than that.)",
value="`{0}`".format(amount))
embed.set_footer(
text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
if move_istrue:
embed = discord.Embed(color=0x0043ff)
embed.set_author(
name=ctx.author.display_name,
icon_url=ctx.author.avatar_url_as(format='png', size=256))
embed.add_field(
name="{0} tipped to {1} `{2} SUGAR`".format(ctx.author.display_name,
self.bot.get_user(int(tipto)).display_name,
amount),
value="yay!")
embed.set_footer(text="Tip Sugar {0} [Owner: {1}]".format(config.VERSION, self.bot.get_user(config.OWNER_ID)),
icon_url=self.bot.user.avatar_url_as(format='png', size=256))
await ctx.channel.send(embed=embed)
def setup(bot):
bot.add_cog(Tip(bot))
| 55.340426
| 142
| 0.476836
| 1,086
| 10,404
| 4.42081
| 0.140884
| 0.039367
| 0.052697
| 0.081441
| 0.741512
| 0.741512
| 0.714018
| 0.714018
| 0.714018
| 0.714018
| 0
| 0.031972
| 0.413783
| 10,404
| 187
| 143
| 55.636364
| 0.755206
| 0.010957
| 0
| 0.654545
| 0
| 0
| 0.09265
| 0
| 0
| 0
| 0.008555
| 0
| 0
| 1
| 0.018182
| false
| 0.018182
| 0.036364
| 0
| 0.072727
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 1
| 1
| 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
| 5
|
8a50a269607259e4143c2b8b2a0650c7eb564d6e
| 811
|
py
|
Python
|
atom/electron/python/test/test_ach_api.py
|
AbhiGupta03/SDK
|
f3a61aae7a847f07f0c22a154ca88dc378e9d25e
|
[
"Apache-2.0"
] | null | null | null |
atom/electron/python/test/test_ach_api.py
|
AbhiGupta03/SDK
|
f3a61aae7a847f07f0c22a154ca88dc378e9d25e
|
[
"Apache-2.0"
] | null | null | null |
atom/electron/python/test/test_ach_api.py
|
AbhiGupta03/SDK
|
f3a61aae7a847f07f0c22a154ca88dc378e9d25e
|
[
"Apache-2.0"
] | null | null | null |
# coding: utf-8
"""
Hydrogen Electron API
The Hydrogen Electron API # noqa: E501
OpenAPI spec version: 1.3.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import electron_api
from electron_api.api.ach_api import ACHApi # noqa: E501
from electron_api.rest import ApiException
class TestACHApi(unittest.TestCase):
"""ACHApi unit test stubs"""
def setUp(self):
self.api = electron_api.api.ach_api.ACHApi() # noqa: E501
def tearDown(self):
pass
def test_fund_card_using_post(self):
"""Test case for fund_card_using_post
Fund card # noqa: E501
"""
pass
if __name__ == '__main__':
unittest.main()
| 19.309524
| 68
| 0.678175
| 107
| 811
| 4.897196
| 0.504673
| 0.125954
| 0.072519
| 0.064886
| 0.076336
| 0
| 0
| 0
| 0
| 0
| 0
| 0.025559
| 0.228113
| 811
| 41
| 69
| 19.780488
| 0.811502
| 0.383477
| 0
| 0.142857
| 1
| 0
| 0.018059
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0.214286
| false
| 0.142857
| 0.357143
| 0
| 0.642857
| 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
| 1
| 0
| 1
| 0
|
0
| 5
|
8aa6a5e43f6aa8cb421b08971f3adda913894e0a
| 102
|
py
|
Python
|
enthought/physical_quantities/units.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 3
|
2016-12-09T06:05:18.000Z
|
2018-03-01T13:00:29.000Z
|
enthought/physical_quantities/units.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | 1
|
2020-12-02T00:51:32.000Z
|
2020-12-02T08:48:55.000Z
|
enthought/physical_quantities/units.py
|
enthought/etsproxy
|
4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347
|
[
"BSD-3-Clause"
] | null | null | null |
# proxy module
from __future__ import absolute_import
from scimath.physical_quantities.units import *
| 25.5
| 47
| 0.852941
| 13
| 102
| 6.230769
| 0.769231
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.107843
| 102
| 3
| 48
| 34
| 0.89011
| 0.117647
| 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
| 1
| 0
|
0
| 5
|
76edd5aad68774bd2fdc2bce4d25a3d6255e9d09
| 104
|
py
|
Python
|
generate_report/apps.py
|
amandabezerra/2018.1-Cardinals
|
cedaf7c9771eda6b25c35fdf722fa25e5c832114
|
[
"MIT"
] | 5
|
2018-03-26T15:27:01.000Z
|
2018-06-21T21:28:09.000Z
|
generate_report/apps.py
|
fga-eps-mds/2018.1-Cardinals
|
cedaf7c9771eda6b25c35fdf722fa25e5c832114
|
[
"MIT"
] | 135
|
2018-03-22T16:22:29.000Z
|
2018-06-29T20:55:28.000Z
|
generate_report/apps.py
|
amandabezerra/2018.1-Cardinals
|
cedaf7c9771eda6b25c35fdf722fa25e5c832114
|
[
"MIT"
] | 11
|
2018-03-23T23:56:49.000Z
|
2018-07-03T15:12:04.000Z
|
from django.apps import AppConfig
class GenerateReportConfig(AppConfig):
name = 'generate_report'
| 17.333333
| 38
| 0.788462
| 11
| 104
| 7.363636
| 0.909091
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.144231
| 104
| 5
| 39
| 20.8
| 0.910112
| 0
| 0
| 0
| 1
| 0
| 0.144231
| 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
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
76f0cdc37785f23ecac523d1ef450b1142edea2a
| 233
|
py
|
Python
|
chorogrid/__init__.py
|
jeffschecter/chorogrid
|
9d375848b2c051ff239d7d3fc0d94b8611a7c399
|
[
"MIT"
] | null | null | null |
chorogrid/__init__.py
|
jeffschecter/chorogrid
|
9d375848b2c051ff239d7d3fc0d94b8611a7c399
|
[
"MIT"
] | null | null | null |
chorogrid/__init__.py
|
jeffschecter/chorogrid
|
9d375848b2c051ff239d7d3fc0d94b8611a7c399
|
[
"MIT"
] | null | null | null |
#!/usr/bin/python
# Filename: __init__.py
# Author: David Taylor (@Prooffreader)
from chorogrid.Colorbin import Colorbin
from chorogrid.Chorogrid import Chorogrid
from chorogrid.plotting import plot
from zipcodes_df import zipcodes
| 25.888889
| 41
| 0.819742
| 30
| 233
| 6.2
| 0.6
| 0.209677
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0.111588
| 233
| 9
| 42
| 25.888889
| 0.898551
| 0.321888
| 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
| 1
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 1
| 0
| 1
| 0
|
0
| 5
|
0a164f7932c390bb2d2b94cafd5dcc2e9c94773b
| 88,167
|
py
|
Python
|
sdk/python/pulumi_kubernetes/apiextensions/v1beta1/outputs.py
|
polivbr/pulumi-kubernetes
|
36a5fb34240a38a60b52a5f4e55e66e248d9305f
|
[
"Apache-2.0"
] | 277
|
2018-06-18T14:57:09.000Z
|
2022-03-29T04:05:06.000Z
|
sdk/python/pulumi_kubernetes/apiextensions/v1beta1/outputs.py
|
polivbr/pulumi-kubernetes
|
36a5fb34240a38a60b52a5f4e55e66e248d9305f
|
[
"Apache-2.0"
] | 1,447
|
2018-06-20T00:58:34.000Z
|
2022-03-31T21:28:43.000Z
|
sdk/python/pulumi_kubernetes/apiextensions/v1beta1/outputs.py
|
polivbr/pulumi-kubernetes
|
36a5fb34240a38a60b52a5f4e55e66e248d9305f
|
[
"Apache-2.0"
] | 95
|
2018-06-30T03:30:05.000Z
|
2022-03-29T04:05:09.000Z
|
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** 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 ... import meta as _meta
__all__ = [
'CustomResourceColumnDefinition',
'CustomResourceConversion',
'CustomResourceDefinition',
'CustomResourceDefinitionCondition',
'CustomResourceDefinitionNames',
'CustomResourceDefinitionSpec',
'CustomResourceDefinitionStatus',
'CustomResourceDefinitionVersion',
'CustomResourceSubresourceScale',
'CustomResourceSubresources',
'CustomResourceValidation',
'ExternalDocumentation',
'JSONSchemaProps',
'ServiceReference',
'WebhookClientConfig',
]
@pulumi.output_type
class CustomResourceColumnDefinition(dict):
"""
CustomResourceColumnDefinition specifies a column for server side printing.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "JSONPath":
suggest = "json_path"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceColumnDefinition. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceColumnDefinition.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceColumnDefinition.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
json_path: str,
name: str,
type: str,
description: Optional[str] = None,
format: Optional[str] = None,
priority: Optional[int] = None):
"""
CustomResourceColumnDefinition specifies a column for server side printing.
:param str json_path: JSONPath is a simple JSON path (i.e. with array notation) which is evaluated against each custom resource to produce the value for this column.
:param str name: name is a human readable name for the column.
:param str type: type is an OpenAPI type definition for this column. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.
:param str description: description is a human readable description of this column.
:param str format: format is an optional OpenAPI type definition for this column. The 'name' format is applied to the primary identifier column to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.
:param int priority: priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a priority greater than 0.
"""
pulumi.set(__self__, "json_path", json_path)
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "type", type)
if description is not None:
pulumi.set(__self__, "description", description)
if format is not None:
pulumi.set(__self__, "format", format)
if priority is not None:
pulumi.set(__self__, "priority", priority)
@property
@pulumi.getter(name="JSONPath")
def json_path(self) -> str:
"""
JSONPath is a simple JSON path (i.e. with array notation) which is evaluated against each custom resource to produce the value for this column.
"""
return pulumi.get(self, "json_path")
@property
@pulumi.getter
def name(self) -> str:
"""
name is a human readable name for the column.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def type(self) -> str:
"""
type is an OpenAPI type definition for this column. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter
def description(self) -> Optional[str]:
"""
description is a human readable description of this column.
"""
return pulumi.get(self, "description")
@property
@pulumi.getter
def format(self) -> Optional[str]:
"""
format is an optional OpenAPI type definition for this column. The 'name' format is applied to the primary identifier column to assist in clients identifying column is the resource name. See https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types for details.
"""
return pulumi.get(self, "format")
@property
@pulumi.getter
def priority(self) -> Optional[int]:
"""
priority is an integer defining the relative importance of this column compared to others. Lower numbers are considered higher priority. Columns that may be omitted in limited space scenarios should be given a priority greater than 0.
"""
return pulumi.get(self, "priority")
@pulumi.output_type
class CustomResourceConversion(dict):
"""
CustomResourceConversion describes how to convert different versions of a CR.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "conversionReviewVersions":
suggest = "conversion_review_versions"
elif key == "webhookClientConfig":
suggest = "webhook_client_config"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceConversion. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceConversion.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceConversion.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
strategy: str,
conversion_review_versions: Optional[Sequence[str]] = None,
webhook_client_config: Optional['outputs.WebhookClientConfig'] = None):
"""
CustomResourceConversion describes how to convert different versions of a CR.
:param str strategy: strategy specifies how custom resources are converted between versions. Allowed values are: - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information
is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
:param Sequence[str] conversion_review_versions: conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to `["v1beta1"]`.
:param 'WebhookClientConfigArgs' webhook_client_config: webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`. Required when `strategy` is set to `Webhook`.
"""
pulumi.set(__self__, "strategy", strategy)
if conversion_review_versions is not None:
pulumi.set(__self__, "conversion_review_versions", conversion_review_versions)
if webhook_client_config is not None:
pulumi.set(__self__, "webhook_client_config", webhook_client_config)
@property
@pulumi.getter
def strategy(self) -> str:
"""
strategy specifies how custom resources are converted between versions. Allowed values are: - `None`: The converter only change the apiVersion and would not touch any other field in the custom resource. - `Webhook`: API Server will call to an external webhook to do the conversion. Additional information
is needed for this option. This requires spec.preserveUnknownFields to be false, and spec.conversion.webhookClientConfig to be set.
"""
return pulumi.get(self, "strategy")
@property
@pulumi.getter(name="conversionReviewVersions")
def conversion_review_versions(self) -> Optional[Sequence[str]]:
"""
conversionReviewVersions is an ordered list of preferred `ConversionReview` versions the Webhook expects. The API server will use the first version in the list which it supports. If none of the versions specified in this list are supported by API server, conversion will fail for the custom resource. If a persisted Webhook configuration specifies allowed versions and does not include any versions known to the API Server, calls to the webhook will fail. Defaults to `["v1beta1"]`.
"""
return pulumi.get(self, "conversion_review_versions")
@property
@pulumi.getter(name="webhookClientConfig")
def webhook_client_config(self) -> Optional['outputs.WebhookClientConfig']:
"""
webhookClientConfig is the instructions for how to call the webhook if strategy is `Webhook`. Required when `strategy` is set to `Webhook`.
"""
return pulumi.get(self, "webhook_client_config")
@pulumi.output_type
class CustomResourceDefinition(dict):
"""
CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. Deprecated in v1.16, planned for removal in v1.19. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "apiVersion":
suggest = "api_version"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceDefinition. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceDefinition.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceDefinition.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
spec: 'outputs.CustomResourceDefinitionSpec',
api_version: Optional[str] = None,
kind: Optional[str] = None,
metadata: Optional['_meta.v1.outputs.ObjectMeta'] = None,
status: Optional['outputs.CustomResourceDefinitionStatus'] = None):
"""
CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. Deprecated in v1.16, planned for removal in v1.19. Use apiextensions.k8s.io/v1 CustomResourceDefinition instead.
:param 'CustomResourceDefinitionSpecArgs' spec: spec describes how the user wants the resources to appear
:param str api_version: APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
:param str kind: Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
:param 'CustomResourceDefinitionStatusArgs' status: status indicates the actual state of the CustomResourceDefinition
"""
pulumi.set(__self__, "spec", spec)
if api_version is not None:
pulumi.set(__self__, "api_version", 'apiextensions.k8s.io/v1beta1')
if kind is not None:
pulumi.set(__self__, "kind", 'CustomResourceDefinition')
if metadata is not None:
pulumi.set(__self__, "metadata", metadata)
if status is not None:
pulumi.set(__self__, "status", status)
@property
@pulumi.getter
def spec(self) -> 'outputs.CustomResourceDefinitionSpec':
"""
spec describes how the user wants the resources to appear
"""
return pulumi.get(self, "spec")
@property
@pulumi.getter(name="apiVersion")
def api_version(self) -> Optional[str]:
"""
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
"""
return pulumi.get(self, "api_version")
@property
@pulumi.getter
def kind(self) -> Optional[str]:
"""
Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
"""
return pulumi.get(self, "kind")
@property
@pulumi.getter
def metadata(self) -> Optional['_meta.v1.outputs.ObjectMeta']:
return pulumi.get(self, "metadata")
@property
@pulumi.getter
def status(self) -> Optional['outputs.CustomResourceDefinitionStatus']:
"""
status indicates the actual state of the CustomResourceDefinition
"""
return pulumi.get(self, "status")
@pulumi.output_type
class CustomResourceDefinitionCondition(dict):
"""
CustomResourceDefinitionCondition contains details for the current condition of this pod.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "lastTransitionTime":
suggest = "last_transition_time"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceDefinitionCondition. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceDefinitionCondition.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceDefinitionCondition.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
status: str,
type: str,
last_transition_time: Optional[str] = None,
message: Optional[str] = None,
reason: Optional[str] = None):
"""
CustomResourceDefinitionCondition contains details for the current condition of this pod.
:param str status: status is the status of the condition. Can be True, False, Unknown.
:param str type: type is the type of the condition. Types include Established, NamesAccepted and Terminating.
:param str last_transition_time: lastTransitionTime last time the condition transitioned from one status to another.
:param str message: message is a human-readable message indicating details about last transition.
:param str reason: reason is a unique, one-word, CamelCase reason for the condition's last transition.
"""
pulumi.set(__self__, "status", status)
pulumi.set(__self__, "type", type)
if last_transition_time is not None:
pulumi.set(__self__, "last_transition_time", last_transition_time)
if message is not None:
pulumi.set(__self__, "message", message)
if reason is not None:
pulumi.set(__self__, "reason", reason)
@property
@pulumi.getter
def status(self) -> str:
"""
status is the status of the condition. Can be True, False, Unknown.
"""
return pulumi.get(self, "status")
@property
@pulumi.getter
def type(self) -> str:
"""
type is the type of the condition. Types include Established, NamesAccepted and Terminating.
"""
return pulumi.get(self, "type")
@property
@pulumi.getter(name="lastTransitionTime")
def last_transition_time(self) -> Optional[str]:
"""
lastTransitionTime last time the condition transitioned from one status to another.
"""
return pulumi.get(self, "last_transition_time")
@property
@pulumi.getter
def message(self) -> Optional[str]:
"""
message is a human-readable message indicating details about last transition.
"""
return pulumi.get(self, "message")
@property
@pulumi.getter
def reason(self) -> Optional[str]:
"""
reason is a unique, one-word, CamelCase reason for the condition's last transition.
"""
return pulumi.get(self, "reason")
@pulumi.output_type
class CustomResourceDefinitionNames(dict):
"""
CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "listKind":
suggest = "list_kind"
elif key == "shortNames":
suggest = "short_names"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceDefinitionNames. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceDefinitionNames.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceDefinitionNames.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
kind: str,
plural: str,
categories: Optional[Sequence[str]] = None,
list_kind: Optional[str] = None,
short_names: Optional[Sequence[str]] = None,
singular: Optional[str] = None):
"""
CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition
:param str kind: kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls.
:param str plural: plural is the plural name of the resource to serve. The custom resources are served under `/apis/<group>/<version>/.../<plural>`. Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`). Must be all lowercase.
:param Sequence[str] categories: categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`.
:param str list_kind: listKind is the serialized kind of the list for this resource. Defaults to "`kind`List".
:param Sequence[str] short_names: shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get <shortname>`. It must be all lowercase.
:param str singular: singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`.
"""
pulumi.set(__self__, "kind", kind)
pulumi.set(__self__, "plural", plural)
if categories is not None:
pulumi.set(__self__, "categories", categories)
if list_kind is not None:
pulumi.set(__self__, "list_kind", list_kind)
if short_names is not None:
pulumi.set(__self__, "short_names", short_names)
if singular is not None:
pulumi.set(__self__, "singular", singular)
@property
@pulumi.getter
def kind(self) -> str:
"""
kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls.
"""
return pulumi.get(self, "kind")
@property
@pulumi.getter
def plural(self) -> str:
"""
plural is the plural name of the resource to serve. The custom resources are served under `/apis/<group>/<version>/.../<plural>`. Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`). Must be all lowercase.
"""
return pulumi.get(self, "plural")
@property
@pulumi.getter
def categories(self) -> Optional[Sequence[str]]:
"""
categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`.
"""
return pulumi.get(self, "categories")
@property
@pulumi.getter(name="listKind")
def list_kind(self) -> Optional[str]:
"""
listKind is the serialized kind of the list for this resource. Defaults to "`kind`List".
"""
return pulumi.get(self, "list_kind")
@property
@pulumi.getter(name="shortNames")
def short_names(self) -> Optional[Sequence[str]]:
"""
shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get <shortname>`. It must be all lowercase.
"""
return pulumi.get(self, "short_names")
@property
@pulumi.getter
def singular(self) -> Optional[str]:
"""
singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`.
"""
return pulumi.get(self, "singular")
@pulumi.output_type
class CustomResourceDefinitionSpec(dict):
"""
CustomResourceDefinitionSpec describes how a user wants their resource to appear
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "additionalPrinterColumns":
suggest = "additional_printer_columns"
elif key == "preserveUnknownFields":
suggest = "preserve_unknown_fields"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceDefinitionSpec. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceDefinitionSpec.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceDefinitionSpec.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
group: str,
names: 'outputs.CustomResourceDefinitionNames',
scope: str,
additional_printer_columns: Optional[Sequence['outputs.CustomResourceColumnDefinition']] = None,
conversion: Optional['outputs.CustomResourceConversion'] = None,
preserve_unknown_fields: Optional[bool] = None,
subresources: Optional['outputs.CustomResourceSubresources'] = None,
validation: Optional['outputs.CustomResourceValidation'] = None,
version: Optional[str] = None,
versions: Optional[Sequence['outputs.CustomResourceDefinitionVersion']] = None):
"""
CustomResourceDefinitionSpec describes how a user wants their resource to appear
:param str group: group is the API group of the defined custom resource. The custom resources are served under `/apis/<group>/...`. Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`).
:param 'CustomResourceDefinitionNamesArgs' names: names specify the resource and kind names for the custom resource.
:param str scope: scope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are `Cluster` and `Namespaced`. Default is `Namespaced`.
:param Sequence['CustomResourceColumnDefinitionArgs'] additional_printer_columns: additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If present, this field configures columns for all versions. Top-level and per-version columns are mutually exclusive. If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
:param 'CustomResourceConversionArgs' conversion: conversion defines conversion settings for the CRD.
:param bool preserve_unknown_fields: preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. If false, schemas must be defined for all versions. Defaults to true in v1beta for backwards compatibility. Deprecated: will be required to be false in v1. Preservation of unknown fields can be specified in the validation schema using the `x-kubernetes-preserve-unknown-fields: true` extension. See https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields for details.
:param 'CustomResourceSubresourcesArgs' subresources: subresources specify what subresources the defined custom resource has. If present, this field configures subresources for all versions. Top-level and per-version subresources are mutually exclusive.
:param 'CustomResourceValidationArgs' validation: validation describes the schema used for validation and pruning of the custom resource. If present, this validation schema is used to validate all versions. Top-level and per-version schemas are mutually exclusive.
:param str version: version is the API version of the defined custom resource. The custom resources are served under `/apis/<group>/<version>/...`. Must match the name of the first item in the `versions` list if `version` and `versions` are both specified. Optional if `versions` is specified. Deprecated: use `versions` instead.
:param Sequence['CustomResourceDefinitionVersionArgs'] versions: versions is the list of all API versions of the defined custom resource. Optional if `version` is specified. The name of the first item in the `versions` list must match the `version` field if `version` and `versions` are both specified. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
"""
pulumi.set(__self__, "group", group)
pulumi.set(__self__, "names", names)
pulumi.set(__self__, "scope", scope)
if additional_printer_columns is not None:
pulumi.set(__self__, "additional_printer_columns", additional_printer_columns)
if conversion is not None:
pulumi.set(__self__, "conversion", conversion)
if preserve_unknown_fields is not None:
pulumi.set(__self__, "preserve_unknown_fields", preserve_unknown_fields)
if subresources is not None:
pulumi.set(__self__, "subresources", subresources)
if validation is not None:
pulumi.set(__self__, "validation", validation)
if version is not None:
pulumi.set(__self__, "version", version)
if versions is not None:
pulumi.set(__self__, "versions", versions)
@property
@pulumi.getter
def group(self) -> str:
"""
group is the API group of the defined custom resource. The custom resources are served under `/apis/<group>/...`. Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`).
"""
return pulumi.get(self, "group")
@property
@pulumi.getter
def names(self) -> 'outputs.CustomResourceDefinitionNames':
"""
names specify the resource and kind names for the custom resource.
"""
return pulumi.get(self, "names")
@property
@pulumi.getter
def scope(self) -> str:
"""
scope indicates whether the defined custom resource is cluster- or namespace-scoped. Allowed values are `Cluster` and `Namespaced`. Default is `Namespaced`.
"""
return pulumi.get(self, "scope")
@property
@pulumi.getter(name="additionalPrinterColumns")
def additional_printer_columns(self) -> Optional[Sequence['outputs.CustomResourceColumnDefinition']]:
"""
additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. If present, this field configures columns for all versions. Top-level and per-version columns are mutually exclusive. If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
"""
return pulumi.get(self, "additional_printer_columns")
@property
@pulumi.getter
def conversion(self) -> Optional['outputs.CustomResourceConversion']:
"""
conversion defines conversion settings for the CRD.
"""
return pulumi.get(self, "conversion")
@property
@pulumi.getter(name="preserveUnknownFields")
def preserve_unknown_fields(self) -> Optional[bool]:
"""
preserveUnknownFields indicates that object fields which are not specified in the OpenAPI schema should be preserved when persisting to storage. apiVersion, kind, metadata and known fields inside metadata are always preserved. If false, schemas must be defined for all versions. Defaults to true in v1beta for backwards compatibility. Deprecated: will be required to be false in v1. Preservation of unknown fields can be specified in the validation schema using the `x-kubernetes-preserve-unknown-fields: true` extension. See https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields for details.
"""
return pulumi.get(self, "preserve_unknown_fields")
@property
@pulumi.getter
def subresources(self) -> Optional['outputs.CustomResourceSubresources']:
"""
subresources specify what subresources the defined custom resource has. If present, this field configures subresources for all versions. Top-level and per-version subresources are mutually exclusive.
"""
return pulumi.get(self, "subresources")
@property
@pulumi.getter
def validation(self) -> Optional['outputs.CustomResourceValidation']:
"""
validation describes the schema used for validation and pruning of the custom resource. If present, this validation schema is used to validate all versions. Top-level and per-version schemas are mutually exclusive.
"""
return pulumi.get(self, "validation")
@property
@pulumi.getter
def version(self) -> Optional[str]:
"""
version is the API version of the defined custom resource. The custom resources are served under `/apis/<group>/<version>/...`. Must match the name of the first item in the `versions` list if `version` and `versions` are both specified. Optional if `versions` is specified. Deprecated: use `versions` instead.
"""
return pulumi.get(self, "version")
@property
@pulumi.getter
def versions(self) -> Optional[Sequence['outputs.CustomResourceDefinitionVersion']]:
"""
versions is the list of all API versions of the defined custom resource. Optional if `version` is specified. The name of the first item in the `versions` list must match the `version` field if `version` and `versions` are both specified. Version names are used to compute the order in which served versions are listed in API discovery. If the version string is "kube-like", it will sort above non "kube-like" version strings, which are ordered lexicographically. "Kube-like" versions start with a "v", then are followed by a number (the major version), then optionally the string "alpha" or "beta" and another number (the minor version). These are sorted first by GA > beta > alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.
"""
return pulumi.get(self, "versions")
@pulumi.output_type
class CustomResourceDefinitionStatus(dict):
"""
CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "acceptedNames":
suggest = "accepted_names"
elif key == "storedVersions":
suggest = "stored_versions"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceDefinitionStatus. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceDefinitionStatus.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceDefinitionStatus.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
accepted_names: 'outputs.CustomResourceDefinitionNames',
stored_versions: Sequence[str],
conditions: Optional[Sequence['outputs.CustomResourceDefinitionCondition']] = None):
"""
CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition
:param 'CustomResourceDefinitionNamesArgs' accepted_names: acceptedNames are the names that are actually being used to serve discovery. They may be different than the names in spec.
:param Sequence[str] stored_versions: storedVersions lists all versions of CustomResources that were ever persisted. Tracking these versions allows a migration path for stored versions in etcd. The field is mutable so a migration controller can finish a migration to another version (ensuring no old objects are left in storage), and then remove the rest of the versions from this list. Versions may not be removed from `spec.versions` while they exist in this list.
:param Sequence['CustomResourceDefinitionConditionArgs'] conditions: conditions indicate state for particular aspects of a CustomResourceDefinition
"""
pulumi.set(__self__, "accepted_names", accepted_names)
pulumi.set(__self__, "stored_versions", stored_versions)
if conditions is not None:
pulumi.set(__self__, "conditions", conditions)
@property
@pulumi.getter(name="acceptedNames")
def accepted_names(self) -> 'outputs.CustomResourceDefinitionNames':
"""
acceptedNames are the names that are actually being used to serve discovery. They may be different than the names in spec.
"""
return pulumi.get(self, "accepted_names")
@property
@pulumi.getter(name="storedVersions")
def stored_versions(self) -> Sequence[str]:
"""
storedVersions lists all versions of CustomResources that were ever persisted. Tracking these versions allows a migration path for stored versions in etcd. The field is mutable so a migration controller can finish a migration to another version (ensuring no old objects are left in storage), and then remove the rest of the versions from this list. Versions may not be removed from `spec.versions` while they exist in this list.
"""
return pulumi.get(self, "stored_versions")
@property
@pulumi.getter
def conditions(self) -> Optional[Sequence['outputs.CustomResourceDefinitionCondition']]:
"""
conditions indicate state for particular aspects of a CustomResourceDefinition
"""
return pulumi.get(self, "conditions")
@pulumi.output_type
class CustomResourceDefinitionVersion(dict):
"""
CustomResourceDefinitionVersion describes a version for CRD.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "additionalPrinterColumns":
suggest = "additional_printer_columns"
elif key == "deprecationWarning":
suggest = "deprecation_warning"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceDefinitionVersion. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceDefinitionVersion.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceDefinitionVersion.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
name: str,
served: bool,
storage: bool,
additional_printer_columns: Optional[Sequence['outputs.CustomResourceColumnDefinition']] = None,
deprecated: Optional[bool] = None,
deprecation_warning: Optional[str] = None,
schema: Optional['outputs.CustomResourceValidation'] = None,
subresources: Optional['outputs.CustomResourceSubresources'] = None):
"""
CustomResourceDefinitionVersion describes a version for CRD.
:param str name: name is the version name, e.g. “v1”, “v2beta1”, etc. The custom resources are served under this version at `/apis/<group>/<version>/...` if `served` is true.
:param bool served: served is a flag enabling/disabling this version from being served via REST APIs
:param bool storage: storage indicates this version should be used when persisting custom resources to storage. There must be exactly one version with storage=true.
:param Sequence['CustomResourceColumnDefinitionArgs'] additional_printer_columns: additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. Top-level and per-version columns are mutually exclusive. Per-version columns must not all be set to identical values (top-level columns should be used instead). If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
:param bool deprecated: deprecated indicates this version of the custom resource API is deprecated. When set to true, API requests to this version receive a warning header in the server response. Defaults to false.
:param str deprecation_warning: deprecationWarning overrides the default warning returned to API clients. May only be set when `deprecated` is true. The default warning indicates this version is deprecated and recommends use of the newest served version of equal or greater stability, if one exists.
:param 'CustomResourceValidationArgs' schema: schema describes the schema used for validation and pruning of this version of the custom resource. Top-level and per-version schemas are mutually exclusive. Per-version schemas must not all be set to identical values (top-level validation schema should be used instead).
:param 'CustomResourceSubresourcesArgs' subresources: subresources specify what subresources this version of the defined custom resource have. Top-level and per-version subresources are mutually exclusive. Per-version subresources must not all be set to identical values (top-level subresources should be used instead).
"""
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "served", served)
pulumi.set(__self__, "storage", storage)
if additional_printer_columns is not None:
pulumi.set(__self__, "additional_printer_columns", additional_printer_columns)
if deprecated is not None:
pulumi.set(__self__, "deprecated", deprecated)
if deprecation_warning is not None:
pulumi.set(__self__, "deprecation_warning", deprecation_warning)
if schema is not None:
pulumi.set(__self__, "schema", schema)
if subresources is not None:
pulumi.set(__self__, "subresources", subresources)
@property
@pulumi.getter
def name(self) -> str:
"""
name is the version name, e.g. “v1”, “v2beta1”, etc. The custom resources are served under this version at `/apis/<group>/<version>/...` if `served` is true.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def served(self) -> bool:
"""
served is a flag enabling/disabling this version from being served via REST APIs
"""
return pulumi.get(self, "served")
@property
@pulumi.getter
def storage(self) -> bool:
"""
storage indicates this version should be used when persisting custom resources to storage. There must be exactly one version with storage=true.
"""
return pulumi.get(self, "storage")
@property
@pulumi.getter(name="additionalPrinterColumns")
def additional_printer_columns(self) -> Optional[Sequence['outputs.CustomResourceColumnDefinition']]:
"""
additionalPrinterColumns specifies additional columns returned in Table output. See https://kubernetes.io/docs/reference/using-api/api-concepts/#receiving-resources-as-tables for details. Top-level and per-version columns are mutually exclusive. Per-version columns must not all be set to identical values (top-level columns should be used instead). If no top-level or per-version columns are specified, a single column displaying the age of the custom resource is used.
"""
return pulumi.get(self, "additional_printer_columns")
@property
@pulumi.getter
def deprecated(self) -> Optional[bool]:
"""
deprecated indicates this version of the custom resource API is deprecated. When set to true, API requests to this version receive a warning header in the server response. Defaults to false.
"""
return pulumi.get(self, "deprecated")
@property
@pulumi.getter(name="deprecationWarning")
def deprecation_warning(self) -> Optional[str]:
"""
deprecationWarning overrides the default warning returned to API clients. May only be set when `deprecated` is true. The default warning indicates this version is deprecated and recommends use of the newest served version of equal or greater stability, if one exists.
"""
return pulumi.get(self, "deprecation_warning")
@property
@pulumi.getter
def schema(self) -> Optional['outputs.CustomResourceValidation']:
"""
schema describes the schema used for validation and pruning of this version of the custom resource. Top-level and per-version schemas are mutually exclusive. Per-version schemas must not all be set to identical values (top-level validation schema should be used instead).
"""
return pulumi.get(self, "schema")
@property
@pulumi.getter
def subresources(self) -> Optional['outputs.CustomResourceSubresources']:
"""
subresources specify what subresources this version of the defined custom resource have. Top-level and per-version subresources are mutually exclusive. Per-version subresources must not all be set to identical values (top-level subresources should be used instead).
"""
return pulumi.get(self, "subresources")
@pulumi.output_type
class CustomResourceSubresourceScale(dict):
"""
CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "specReplicasPath":
suggest = "spec_replicas_path"
elif key == "statusReplicasPath":
suggest = "status_replicas_path"
elif key == "labelSelectorPath":
suggest = "label_selector_path"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceSubresourceScale. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceSubresourceScale.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceSubresourceScale.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
spec_replicas_path: str,
status_replicas_path: str,
label_selector_path: Optional[str] = None):
"""
CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.
:param str spec_replicas_path: specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.spec`. If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET.
:param str status_replicas_path: statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status`. If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource will default to 0.
:param str label_selector_path: labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status` or `.spec`. Must be set to work with HorizontalPodAutoscaler. The field pointed by this JSON path must be a string field (not a complex selector struct) which contains a serialized label selector in string form. More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` subresource will default to the empty string.
"""
pulumi.set(__self__, "spec_replicas_path", spec_replicas_path)
pulumi.set(__self__, "status_replicas_path", status_replicas_path)
if label_selector_path is not None:
pulumi.set(__self__, "label_selector_path", label_selector_path)
@property
@pulumi.getter(name="specReplicasPath")
def spec_replicas_path(self) -> str:
"""
specReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `spec.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.spec`. If there is no value under the given path in the custom resource, the `/scale` subresource will return an error on GET.
"""
return pulumi.get(self, "spec_replicas_path")
@property
@pulumi.getter(name="statusReplicasPath")
def status_replicas_path(self) -> str:
"""
statusReplicasPath defines the JSON path inside of a custom resource that corresponds to Scale `status.replicas`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status`. If there is no value under the given path in the custom resource, the `status.replicas` value in the `/scale` subresource will default to 0.
"""
return pulumi.get(self, "status_replicas_path")
@property
@pulumi.getter(name="labelSelectorPath")
def label_selector_path(self) -> Optional[str]:
"""
labelSelectorPath defines the JSON path inside of a custom resource that corresponds to Scale `status.selector`. Only JSON paths without the array notation are allowed. Must be a JSON Path under `.status` or `.spec`. Must be set to work with HorizontalPodAutoscaler. The field pointed by this JSON path must be a string field (not a complex selector struct) which contains a serialized label selector in string form. More info: https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource If there is no value under the given path in the custom resource, the `status.selector` value in the `/scale` subresource will default to the empty string.
"""
return pulumi.get(self, "label_selector_path")
@pulumi.output_type
class CustomResourceSubresources(dict):
"""
CustomResourceSubresources defines the status and scale subresources for CustomResources.
"""
def __init__(__self__, *,
scale: Optional['outputs.CustomResourceSubresourceScale'] = None,
status: Optional[Any] = None):
"""
CustomResourceSubresources defines the status and scale subresources for CustomResources.
:param 'CustomResourceSubresourceScaleArgs' scale: scale indicates the custom resource should serve a `/scale` subresource that returns an `autoscaling/v1` Scale object.
:param Any status: status indicates the custom resource should serve a `/status` subresource. When enabled: 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object.
"""
if scale is not None:
pulumi.set(__self__, "scale", scale)
if status is not None:
pulumi.set(__self__, "status", status)
@property
@pulumi.getter
def scale(self) -> Optional['outputs.CustomResourceSubresourceScale']:
"""
scale indicates the custom resource should serve a `/scale` subresource that returns an `autoscaling/v1` Scale object.
"""
return pulumi.get(self, "scale")
@property
@pulumi.getter
def status(self) -> Optional[Any]:
"""
status indicates the custom resource should serve a `/status` subresource. When enabled: 1. requests to the custom resource primary endpoint ignore changes to the `status` stanza of the object. 2. requests to the custom resource `/status` subresource ignore changes to anything other than the `status` stanza of the object.
"""
return pulumi.get(self, "status")
@pulumi.output_type
class CustomResourceValidation(dict):
"""
CustomResourceValidation is a list of validation methods for CustomResources.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "openAPIV3Schema":
suggest = "open_apiv3_schema"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomResourceValidation. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
CustomResourceValidation.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomResourceValidation.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
open_apiv3_schema: Optional['outputs.JSONSchemaProps'] = None):
"""
CustomResourceValidation is a list of validation methods for CustomResources.
:param 'JSONSchemaPropsArgs' open_apiv3_schema: openAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning.
"""
if open_apiv3_schema is not None:
pulumi.set(__self__, "open_apiv3_schema", open_apiv3_schema)
@property
@pulumi.getter(name="openAPIV3Schema")
def open_apiv3_schema(self) -> Optional['outputs.JSONSchemaProps']:
"""
openAPIV3Schema is the OpenAPI v3 schema to use for validation and pruning.
"""
return pulumi.get(self, "open_apiv3_schema")
@pulumi.output_type
class ExternalDocumentation(dict):
"""
ExternalDocumentation allows referencing an external resource for extended documentation.
"""
def __init__(__self__, *,
description: Optional[str] = None,
url: Optional[str] = None):
"""
ExternalDocumentation allows referencing an external resource for extended documentation.
"""
if description is not None:
pulumi.set(__self__, "description", description)
if url is not None:
pulumi.set(__self__, "url", url)
@property
@pulumi.getter
def description(self) -> Optional[str]:
return pulumi.get(self, "description")
@property
@pulumi.getter
def url(self) -> Optional[str]:
return pulumi.get(self, "url")
@pulumi.output_type
class JSONSchemaProps(dict):
"""
JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "$ref":
suggest = "_ref"
elif key == "$schema":
suggest = "_schema"
elif key == "additionalItems":
suggest = "additional_items"
elif key == "additionalProperties":
suggest = "additional_properties"
elif key == "allOf":
suggest = "all_of"
elif key == "anyOf":
suggest = "any_of"
elif key == "exclusiveMaximum":
suggest = "exclusive_maximum"
elif key == "exclusiveMinimum":
suggest = "exclusive_minimum"
elif key == "externalDocs":
suggest = "external_docs"
elif key == "maxItems":
suggest = "max_items"
elif key == "maxLength":
suggest = "max_length"
elif key == "maxProperties":
suggest = "max_properties"
elif key == "minItems":
suggest = "min_items"
elif key == "minLength":
suggest = "min_length"
elif key == "minProperties":
suggest = "min_properties"
elif key == "multipleOf":
suggest = "multiple_of"
elif key == "not":
suggest = "not_"
elif key == "oneOf":
suggest = "one_of"
elif key == "patternProperties":
suggest = "pattern_properties"
elif key == "uniqueItems":
suggest = "unique_items"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in JSONSchemaProps. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
JSONSchemaProps.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
JSONSchemaProps.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
_ref: Optional[str] = None,
_schema: Optional[str] = None,
additional_items: Optional[Any] = None,
additional_properties: Optional[Any] = None,
all_of: Optional[Sequence['outputs.JSONSchemaProps']] = None,
any_of: Optional[Sequence['outputs.JSONSchemaProps']] = None,
default: Optional[Any] = None,
definitions: Optional[Mapping[str, 'outputs.JSONSchemaProps']] = None,
dependencies: Optional[Mapping[str, Any]] = None,
description: Optional[str] = None,
enum: Optional[Sequence[Any]] = None,
example: Optional[Any] = None,
exclusive_maximum: Optional[bool] = None,
exclusive_minimum: Optional[bool] = None,
external_docs: Optional['outputs.ExternalDocumentation'] = None,
format: Optional[str] = None,
id: Optional[str] = None,
items: Optional[Any] = None,
max_items: Optional[int] = None,
max_length: Optional[int] = None,
max_properties: Optional[int] = None,
maximum: Optional[float] = None,
min_items: Optional[int] = None,
min_length: Optional[int] = None,
min_properties: Optional[int] = None,
minimum: Optional[float] = None,
multiple_of: Optional[float] = None,
not_: Optional['outputs.JSONSchemaProps'] = None,
nullable: Optional[bool] = None,
one_of: Optional[Sequence['outputs.JSONSchemaProps']] = None,
pattern: Optional[str] = None,
pattern_properties: Optional[Mapping[str, 'outputs.JSONSchemaProps']] = None,
properties: Optional[Mapping[str, 'outputs.JSONSchemaProps']] = None,
required: Optional[Sequence[str]] = None,
title: Optional[str] = None,
type: Optional[str] = None,
unique_items: Optional[bool] = None,
x_kubernetes_embedded_resource: Optional[bool] = None,
x_kubernetes_int_or_string: Optional[bool] = None,
x_kubernetes_list_map_keys: Optional[Sequence[str]] = None,
x_kubernetes_list_type: Optional[str] = None,
x_kubernetes_map_type: Optional[str] = None,
x_kubernetes_preserve_unknown_fields: Optional[bool] = None):
"""
JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).
:param Any default: default is a default value for undefined object fields. Defaulting is a beta feature under the CustomResourceDefaulting feature gate. CustomResourceDefinitions with defaults must be created using the v1 (or newer) CustomResourceDefinition API.
:param str format: format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated:
- bsonobjectid: a bson object ID, i.e. a 24 characters hex string - uri: an URI as parsed by Golang net/url.ParseRequestURI - email: an email address as parsed by Golang net/mail.ParseAddress - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - cidr: a CIDR as parsed by Golang net.ParseCIDR - mac: a MAC address as parsed by Golang net.ParseMAC - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - isbn: an ISBN10 or ISBN13 number string like "0321751043" or "978-0321751041" - isbn10: an ISBN10 number string like "0321751043" - isbn13: an ISBN13 number string like "978-0321751041" - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$ with any non digit characters mixed in - ssn: a U.S. social security number following the regex ^\d{3}[- ]?\d{2}[- ]?\d{4}$ - hexcolor: an hexadecimal color code like "#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ - rgbcolor: an RGB color code like rgb like "rgb(255,255,2559" - byte: base64 encoded binary data - password: any kind of string - date: a date string like "2006-01-02" as defined by full-date in RFC3339 - duration: a duration string like "22 ns" as parsed by Golang time.ParseDuration or compatible with Scala duration format - datetime: a date time string like "2014-12-15T19:30:20.000Z" as defined by date-time in RFC3339.
:param bool x_kubernetes_embedded_resource: x-kubernetes-embedded-resource defines that the value is an embedded Kubernetes runtime.Object, with TypeMeta and ObjectMeta. The type must be object. It is allowed to further restrict the embedded object. kind, apiVersion and metadata are validated automatically. x-kubernetes-preserve-unknown-fields is allowed to be true, but does not have to be if the object is fully specified (up to kind, apiVersion, metadata).
:param bool x_kubernetes_int_or_string: x-kubernetes-int-or-string specifies that this value is either an integer or a string. If this is true, an empty type is allowed and type as child of anyOf is permitted if following one of the following patterns:
1) anyOf:
- type: integer
- type: string
2) allOf:
- anyOf:
- type: integer
- type: string
- ... zero or more
:param Sequence[str] x_kubernetes_list_map_keys: x-kubernetes-list-map-keys annotates an array with the x-kubernetes-list-type `map` by specifying the keys used as the index of the map.
This tag MUST only be used on lists that have the "x-kubernetes-list-type" extension set to "map". Also, the values specified for this attribute must be a scalar typed field of the child structure (no nesting is supported).
:param str x_kubernetes_list_type: x-kubernetes-list-type annotates an array to further describe its topology. This extension must only be used on lists and may have 3 possible values:
1) `atomic`: the list is treated as a single entity, like a scalar.
Atomic lists will be entirely replaced when updated. This extension
may be used on any type of list (struct, scalar, ...).
2) `set`:
Sets are lists that must not have multiple items with the same value. Each
value must be a scalar, an object with x-kubernetes-map-type `atomic` or an
array with x-kubernetes-list-type `atomic`.
3) `map`:
These lists are like maps in that their elements have a non-index key
used to identify them. Order is preserved upon merge. The map tag
must only be used on a list with elements of type object.
Defaults to atomic for arrays.
:param str x_kubernetes_map_type: x-kubernetes-map-type annotates an object to further describe its topology. This extension must only be used when type is object and may have 2 possible values:
1) `granular`:
These maps are actual maps (key-value pairs) and each fields are independent
from each other (they can each be manipulated by separate actors). This is
the default behaviour for all maps.
2) `atomic`: the list is treated as a single entity, like a scalar.
Atomic maps will be entirely replaced when updated.
:param bool x_kubernetes_preserve_unknown_fields: x-kubernetes-preserve-unknown-fields stops the API server decoding step from pruning fields which are not specified in the validation schema. This affects fields recursively, but switches back to normal pruning behaviour if nested properties or additionalProperties are specified in the schema. This can either be true or undefined. False is forbidden.
"""
if _ref is not None:
pulumi.set(__self__, "_ref", _ref)
if _schema is not None:
pulumi.set(__self__, "_schema", _schema)
if additional_items is not None:
pulumi.set(__self__, "additional_items", additional_items)
if additional_properties is not None:
pulumi.set(__self__, "additional_properties", additional_properties)
if all_of is not None:
pulumi.set(__self__, "all_of", all_of)
if any_of is not None:
pulumi.set(__self__, "any_of", any_of)
if default is not None:
pulumi.set(__self__, "default", default)
if definitions is not None:
pulumi.set(__self__, "definitions", definitions)
if dependencies is not None:
pulumi.set(__self__, "dependencies", dependencies)
if description is not None:
pulumi.set(__self__, "description", description)
if enum is not None:
pulumi.set(__self__, "enum", enum)
if example is not None:
pulumi.set(__self__, "example", example)
if exclusive_maximum is not None:
pulumi.set(__self__, "exclusive_maximum", exclusive_maximum)
if exclusive_minimum is not None:
pulumi.set(__self__, "exclusive_minimum", exclusive_minimum)
if external_docs is not None:
pulumi.set(__self__, "external_docs", external_docs)
if format is not None:
pulumi.set(__self__, "format", format)
if id is not None:
pulumi.set(__self__, "id", id)
if items is not None:
pulumi.set(__self__, "items", items)
if max_items is not None:
pulumi.set(__self__, "max_items", max_items)
if max_length is not None:
pulumi.set(__self__, "max_length", max_length)
if max_properties is not None:
pulumi.set(__self__, "max_properties", max_properties)
if maximum is not None:
pulumi.set(__self__, "maximum", maximum)
if min_items is not None:
pulumi.set(__self__, "min_items", min_items)
if min_length is not None:
pulumi.set(__self__, "min_length", min_length)
if min_properties is not None:
pulumi.set(__self__, "min_properties", min_properties)
if minimum is not None:
pulumi.set(__self__, "minimum", minimum)
if multiple_of is not None:
pulumi.set(__self__, "multiple_of", multiple_of)
if not_ is not None:
pulumi.set(__self__, "not_", not_)
if nullable is not None:
pulumi.set(__self__, "nullable", nullable)
if one_of is not None:
pulumi.set(__self__, "one_of", one_of)
if pattern is not None:
pulumi.set(__self__, "pattern", pattern)
if pattern_properties is not None:
pulumi.set(__self__, "pattern_properties", pattern_properties)
if properties is not None:
pulumi.set(__self__, "properties", properties)
if required is not None:
pulumi.set(__self__, "required", required)
if title is not None:
pulumi.set(__self__, "title", title)
if type is not None:
pulumi.set(__self__, "type", type)
if unique_items is not None:
pulumi.set(__self__, "unique_items", unique_items)
if x_kubernetes_embedded_resource is not None:
pulumi.set(__self__, "x_kubernetes_embedded_resource", x_kubernetes_embedded_resource)
if x_kubernetes_int_or_string is not None:
pulumi.set(__self__, "x_kubernetes_int_or_string", x_kubernetes_int_or_string)
if x_kubernetes_list_map_keys is not None:
pulumi.set(__self__, "x_kubernetes_list_map_keys", x_kubernetes_list_map_keys)
if x_kubernetes_list_type is not None:
pulumi.set(__self__, "x_kubernetes_list_type", x_kubernetes_list_type)
if x_kubernetes_map_type is not None:
pulumi.set(__self__, "x_kubernetes_map_type", x_kubernetes_map_type)
if x_kubernetes_preserve_unknown_fields is not None:
pulumi.set(__self__, "x_kubernetes_preserve_unknown_fields", x_kubernetes_preserve_unknown_fields)
@property
@pulumi.getter(name="$ref")
def _ref(self) -> Optional[str]:
return pulumi.get(self, "_ref")
@property
@pulumi.getter(name="$schema")
def _schema(self) -> Optional[str]:
return pulumi.get(self, "_schema")
@property
@pulumi.getter(name="additionalItems")
def additional_items(self) -> Optional[Any]:
return pulumi.get(self, "additional_items")
@property
@pulumi.getter(name="additionalProperties")
def additional_properties(self) -> Optional[Any]:
return pulumi.get(self, "additional_properties")
@property
@pulumi.getter(name="allOf")
def all_of(self) -> Optional[Sequence['outputs.JSONSchemaProps']]:
return pulumi.get(self, "all_of")
@property
@pulumi.getter(name="anyOf")
def any_of(self) -> Optional[Sequence['outputs.JSONSchemaProps']]:
return pulumi.get(self, "any_of")
@property
@pulumi.getter
def default(self) -> Optional[Any]:
"""
default is a default value for undefined object fields. Defaulting is a beta feature under the CustomResourceDefaulting feature gate. CustomResourceDefinitions with defaults must be created using the v1 (or newer) CustomResourceDefinition API.
"""
return pulumi.get(self, "default")
@property
@pulumi.getter
def definitions(self) -> Optional[Mapping[str, 'outputs.JSONSchemaProps']]:
return pulumi.get(self, "definitions")
@property
@pulumi.getter
def dependencies(self) -> Optional[Mapping[str, Any]]:
return pulumi.get(self, "dependencies")
@property
@pulumi.getter
def description(self) -> Optional[str]:
return pulumi.get(self, "description")
@property
@pulumi.getter
def enum(self) -> Optional[Sequence[Any]]:
return pulumi.get(self, "enum")
@property
@pulumi.getter
def example(self) -> Optional[Any]:
return pulumi.get(self, "example")
@property
@pulumi.getter(name="exclusiveMaximum")
def exclusive_maximum(self) -> Optional[bool]:
return pulumi.get(self, "exclusive_maximum")
@property
@pulumi.getter(name="exclusiveMinimum")
def exclusive_minimum(self) -> Optional[bool]:
return pulumi.get(self, "exclusive_minimum")
@property
@pulumi.getter(name="externalDocs")
def external_docs(self) -> Optional['outputs.ExternalDocumentation']:
return pulumi.get(self, "external_docs")
@property
@pulumi.getter
def format(self) -> Optional[str]:
"""
format is an OpenAPI v3 format string. Unknown formats are ignored. The following formats are validated:
- bsonobjectid: a bson object ID, i.e. a 24 characters hex string - uri: an URI as parsed by Golang net/url.ParseRequestURI - email: an email address as parsed by Golang net/mail.ParseAddress - hostname: a valid representation for an Internet host name, as defined by RFC 1034, section 3.1 [RFC1034]. - ipv4: an IPv4 IP as parsed by Golang net.ParseIP - ipv6: an IPv6 IP as parsed by Golang net.ParseIP - cidr: a CIDR as parsed by Golang net.ParseCIDR - mac: a MAC address as parsed by Golang net.ParseMAC - uuid: an UUID that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid3: an UUID3 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?3[0-9a-f]{3}-?[0-9a-f]{4}-?[0-9a-f]{12}$ - uuid4: an UUID4 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - uuid5: an UUID5 that allows uppercase defined by the regex (?i)^[0-9a-f]{8}-?[0-9a-f]{4}-?5[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12}$ - isbn: an ISBN10 or ISBN13 number string like "0321751043" or "978-0321751041" - isbn10: an ISBN10 number string like "0321751043" - isbn13: an ISBN13 number string like "978-0321751041" - creditcard: a credit card number defined by the regex ^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$ with any non digit characters mixed in - ssn: a U.S. social security number following the regex ^\d{3}[- ]?\d{2}[- ]?\d{4}$ - hexcolor: an hexadecimal color code like "#FFFFFF: following the regex ^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$ - rgbcolor: an RGB color code like rgb like "rgb(255,255,2559" - byte: base64 encoded binary data - password: any kind of string - date: a date string like "2006-01-02" as defined by full-date in RFC3339 - duration: a duration string like "22 ns" as parsed by Golang time.ParseDuration or compatible with Scala duration format - datetime: a date time string like "2014-12-15T19:30:20.000Z" as defined by date-time in RFC3339.
"""
return pulumi.get(self, "format")
@property
@pulumi.getter
def id(self) -> Optional[str]:
return pulumi.get(self, "id")
@property
@pulumi.getter
def items(self) -> Optional[Any]:
return pulumi.get(self, "items")
@property
@pulumi.getter(name="maxItems")
def max_items(self) -> Optional[int]:
return pulumi.get(self, "max_items")
@property
@pulumi.getter(name="maxLength")
def max_length(self) -> Optional[int]:
return pulumi.get(self, "max_length")
@property
@pulumi.getter(name="maxProperties")
def max_properties(self) -> Optional[int]:
return pulumi.get(self, "max_properties")
@property
@pulumi.getter
def maximum(self) -> Optional[float]:
return pulumi.get(self, "maximum")
@property
@pulumi.getter(name="minItems")
def min_items(self) -> Optional[int]:
return pulumi.get(self, "min_items")
@property
@pulumi.getter(name="minLength")
def min_length(self) -> Optional[int]:
return pulumi.get(self, "min_length")
@property
@pulumi.getter(name="minProperties")
def min_properties(self) -> Optional[int]:
return pulumi.get(self, "min_properties")
@property
@pulumi.getter
def minimum(self) -> Optional[float]:
return pulumi.get(self, "minimum")
@property
@pulumi.getter(name="multipleOf")
def multiple_of(self) -> Optional[float]:
return pulumi.get(self, "multiple_of")
@property
@pulumi.getter(name="not")
def not_(self) -> Optional['outputs.JSONSchemaProps']:
return pulumi.get(self, "not_")
@property
@pulumi.getter
def nullable(self) -> Optional[bool]:
return pulumi.get(self, "nullable")
@property
@pulumi.getter(name="oneOf")
def one_of(self) -> Optional[Sequence['outputs.JSONSchemaProps']]:
return pulumi.get(self, "one_of")
@property
@pulumi.getter
def pattern(self) -> Optional[str]:
return pulumi.get(self, "pattern")
@property
@pulumi.getter(name="patternProperties")
def pattern_properties(self) -> Optional[Mapping[str, 'outputs.JSONSchemaProps']]:
return pulumi.get(self, "pattern_properties")
@property
@pulumi.getter
def properties(self) -> Optional[Mapping[str, 'outputs.JSONSchemaProps']]:
return pulumi.get(self, "properties")
@property
@pulumi.getter
def required(self) -> Optional[Sequence[str]]:
return pulumi.get(self, "required")
@property
@pulumi.getter
def title(self) -> Optional[str]:
return pulumi.get(self, "title")
@property
@pulumi.getter
def type(self) -> Optional[str]:
return pulumi.get(self, "type")
@property
@pulumi.getter(name="uniqueItems")
def unique_items(self) -> Optional[bool]:
return pulumi.get(self, "unique_items")
@property
@pulumi.getter
def x_kubernetes_embedded_resource(self) -> Optional[bool]:
"""
x-kubernetes-embedded-resource defines that the value is an embedded Kubernetes runtime.Object, with TypeMeta and ObjectMeta. The type must be object. It is allowed to further restrict the embedded object. kind, apiVersion and metadata are validated automatically. x-kubernetes-preserve-unknown-fields is allowed to be true, but does not have to be if the object is fully specified (up to kind, apiVersion, metadata).
"""
return pulumi.get(self, "x_kubernetes_embedded_resource")
@property
@pulumi.getter
def x_kubernetes_int_or_string(self) -> Optional[bool]:
"""
x-kubernetes-int-or-string specifies that this value is either an integer or a string. If this is true, an empty type is allowed and type as child of anyOf is permitted if following one of the following patterns:
1) anyOf:
- type: integer
- type: string
2) allOf:
- anyOf:
- type: integer
- type: string
- ... zero or more
"""
return pulumi.get(self, "x_kubernetes_int_or_string")
@property
@pulumi.getter
def x_kubernetes_list_map_keys(self) -> Optional[Sequence[str]]:
"""
x-kubernetes-list-map-keys annotates an array with the x-kubernetes-list-type `map` by specifying the keys used as the index of the map.
This tag MUST only be used on lists that have the "x-kubernetes-list-type" extension set to "map". Also, the values specified for this attribute must be a scalar typed field of the child structure (no nesting is supported).
"""
return pulumi.get(self, "x_kubernetes_list_map_keys")
@property
@pulumi.getter
def x_kubernetes_list_type(self) -> Optional[str]:
"""
x-kubernetes-list-type annotates an array to further describe its topology. This extension must only be used on lists and may have 3 possible values:
1) `atomic`: the list is treated as a single entity, like a scalar.
Atomic lists will be entirely replaced when updated. This extension
may be used on any type of list (struct, scalar, ...).
2) `set`:
Sets are lists that must not have multiple items with the same value. Each
value must be a scalar, an object with x-kubernetes-map-type `atomic` or an
array with x-kubernetes-list-type `atomic`.
3) `map`:
These lists are like maps in that their elements have a non-index key
used to identify them. Order is preserved upon merge. The map tag
must only be used on a list with elements of type object.
Defaults to atomic for arrays.
"""
return pulumi.get(self, "x_kubernetes_list_type")
@property
@pulumi.getter
def x_kubernetes_map_type(self) -> Optional[str]:
"""
x-kubernetes-map-type annotates an object to further describe its topology. This extension must only be used when type is object and may have 2 possible values:
1) `granular`:
These maps are actual maps (key-value pairs) and each fields are independent
from each other (they can each be manipulated by separate actors). This is
the default behaviour for all maps.
2) `atomic`: the list is treated as a single entity, like a scalar.
Atomic maps will be entirely replaced when updated.
"""
return pulumi.get(self, "x_kubernetes_map_type")
@property
@pulumi.getter
def x_kubernetes_preserve_unknown_fields(self) -> Optional[bool]:
"""
x-kubernetes-preserve-unknown-fields stops the API server decoding step from pruning fields which are not specified in the validation schema. This affects fields recursively, but switches back to normal pruning behaviour if nested properties or additionalProperties are specified in the schema. This can either be true or undefined. False is forbidden.
"""
return pulumi.get(self, "x_kubernetes_preserve_unknown_fields")
@pulumi.output_type
class ServiceReference(dict):
"""
ServiceReference holds a reference to Service.legacy.k8s.io
"""
def __init__(__self__, *,
name: str,
namespace: str,
path: Optional[str] = None,
port: Optional[int] = None):
"""
ServiceReference holds a reference to Service.legacy.k8s.io
:param str name: name is the name of the service. Required
:param str namespace: namespace is the namespace of the service. Required
:param str path: path is an optional URL path at which the webhook will be contacted.
:param int port: port is an optional service port at which the webhook will be contacted. `port` should be a valid port number (1-65535, inclusive). Defaults to 443 for backward compatibility.
"""
pulumi.set(__self__, "name", name)
pulumi.set(__self__, "namespace", namespace)
if path is not None:
pulumi.set(__self__, "path", path)
if port is not None:
pulumi.set(__self__, "port", port)
@property
@pulumi.getter
def name(self) -> str:
"""
name is the name of the service. Required
"""
return pulumi.get(self, "name")
@property
@pulumi.getter
def namespace(self) -> str:
"""
namespace is the namespace of the service. Required
"""
return pulumi.get(self, "namespace")
@property
@pulumi.getter
def path(self) -> Optional[str]:
"""
path is an optional URL path at which the webhook will be contacted.
"""
return pulumi.get(self, "path")
@property
@pulumi.getter
def port(self) -> Optional[int]:
"""
port is an optional service port at which the webhook will be contacted. `port` should be a valid port number (1-65535, inclusive). Defaults to 443 for backward compatibility.
"""
return pulumi.get(self, "port")
@pulumi.output_type
class WebhookClientConfig(dict):
"""
WebhookClientConfig contains the information to make a TLS connection with the webhook.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "caBundle":
suggest = "ca_bundle"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in WebhookClientConfig. Access the value via the '{suggest}' property getter instead.")
def __getitem__(self, key: str) -> Any:
WebhookClientConfig.__key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
WebhookClientConfig.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
ca_bundle: Optional[str] = None,
service: Optional['outputs.ServiceReference'] = None,
url: Optional[str] = None):
"""
WebhookClientConfig contains the information to make a TLS connection with the webhook.
:param str ca_bundle: caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.
:param 'ServiceReferenceArgs' service: service is a reference to the service for this webhook. Either service or url must be specified.
If the webhook is running within the cluster, then you should use `service`.
:param str url: url gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.
The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address.
Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster.
The scheme must be "https"; the URL must begin with "https://".
A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier.
Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either.
"""
if ca_bundle is not None:
pulumi.set(__self__, "ca_bundle", ca_bundle)
if service is not None:
pulumi.set(__self__, "service", service)
if url is not None:
pulumi.set(__self__, "url", url)
@property
@pulumi.getter(name="caBundle")
def ca_bundle(self) -> Optional[str]:
"""
caBundle is a PEM encoded CA bundle which will be used to validate the webhook's server certificate. If unspecified, system trust roots on the apiserver are used.
"""
return pulumi.get(self, "ca_bundle")
@property
@pulumi.getter
def service(self) -> Optional['outputs.ServiceReference']:
"""
service is a reference to the service for this webhook. Either service or url must be specified.
If the webhook is running within the cluster, then you should use `service`.
"""
return pulumi.get(self, "service")
@property
@pulumi.getter
def url(self) -> Optional[str]:
"""
url gives the location of the webhook, in standard URL form (`scheme://host:port/path`). Exactly one of `url` or `service` must be specified.
The `host` should not refer to a service running in the cluster; use the `service` field instead. The host might be resolved via external DNS in some apiservers (e.g., `kube-apiserver` cannot resolve in-cluster DNS as that would be a layering violation). `host` may also be an IP address.
Please note that using `localhost` or `127.0.0.1` as a `host` is risky unless you take great care to run this webhook on all hosts which run an apiserver which might need to make calls to this webhook. Such installs are likely to be non-portable, i.e., not easy to turn up in a new cluster.
The scheme must be "https"; the URL must begin with "https://".
A path is optional, and if present may be any string permissible in a URL. You may use the path to pass an arbitrary string to the webhook, for example, a cluster identifier.
Attempting to use a user or basic auth e.g. "user:password@" is not allowed. Fragments ("#...") and query parameters ("?...") are not allowed, either.
"""
return pulumi.get(self, "url")
| 54.45769
| 2,114
| 0.676228
| 11,093
| 88,167
| 5.260525
| 0.072749
| 0.013915
| 0.023169
| 0.033862
| 0.788279
| 0.757502
| 0.72328
| 0.675572
| 0.645634
| 0.617531
| 0
| 0.010423
| 0.233954
| 88,167
| 1,618
| 2,115
| 54.491347
| 0.853583
| 0.48745
| 0
| 0.417683
| 1
| 0.012195
| 0.170082
| 0.076477
| 0
| 0
| 0
| 0
| 0
| 1
| 0.15752
| false
| 0
| 0.007114
| 0.038618
| 0.309959
| 0.012195
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 1
| 1
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| 0
| 0
| 1
| 0
| 0
| 0
| null | 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
| 0
|
0
| 5
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.