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
b608402c0e8072771b347f2c3ecc7549b510eb7d
327
py
Python
bchscript/__init__.py
gandrewstone/bchscript
c73a69f259b4cfb71546903c736e4a94fd0680d7
[ "MIT" ]
7
2018-05-31T18:21:37.000Z
2020-07-13T05:20:05.000Z
bchscript/__init__.py
gandrewstone/bchscript
c73a69f259b4cfb71546903c736e4a94fd0680d7
[ "MIT" ]
1
2018-06-19T18:14:48.000Z
2018-06-19T18:14:48.000Z
bchscript/__init__.py
gandrewstone/bchscript
c73a69f259b4cfb71546903c736e4a94fd0680d7
[ "MIT" ]
4
2018-06-01T00:29:32.000Z
2020-07-13T05:19:30.000Z
from bchscript.bchutil import BCH_TESTNET, BCH_MAINNET, BCH_REGTEST, bitcoinAddress2bin from bchscript.bchscript import compile, script2hex, script2bin, prettyPrint def mode(m): global BCH_ADDRESS_PREFIX BCH_ADDRESS_PREFIX = m # print("setting bch network to '%s'" % BCH_ADDRESS_PREFIX) __all__ = ["bchscript"]
27.25
87
0.7737
41
327
5.853659
0.609756
0.125
0.2
0
0
0
0
0
0
0
0
0.010753
0.146789
327
11
88
29.727273
0.849462
0.174312
0
0
0
0
0.033582
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.5
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
3733d3e30660680d9a0362cfceee9dfad9c58b74
2,871
py
Python
examples3/sac/visualize_deepmind.py
lgvaz/torchrl
cfff8acaf70d1fec72169162b95ab5ad3547d17a
[ "MIT" ]
5
2018-06-21T14:33:40.000Z
2018-08-18T02:26:03.000Z
examples3/sac/visualize_deepmind.py
lgvaz/reward
cfff8acaf70d1fec72169162b95ab5ad3547d17a
[ "MIT" ]
null
null
null
examples3/sac/visualize_deepmind.py
lgvaz/reward
cfff8acaf70d1fec72169162b95ab5ad3547d17a
[ "MIT" ]
2
2018-05-08T03:34:49.000Z
2018-06-22T15:04:17.000Z
import torch, torch.nn as nn, numpy as np import reward as rw, reward.utils as U from dm_control import suite, viewer DEVICE = U.device.get() class PolicyNN(nn.Module): def __init__(self, n_in, n_out, hidden=256, activation=nn.ReLU, logstd_range=(-20, 2)): super().__init__() self.logstd_range = logstd_range layers = [] layers += [nn.Linear(n_in, hidden), activation()] layers += [nn.Linear(hidden, hidden), activation()] self.layers = nn.Sequential(*layers) self.mean = nn.Linear(hidden, n_out) self.mean.weight.data.uniform_(-3e-3, 3e-3) self.mean.bias.data.uniform_(-3e-3, 3e-3) self.log_std = nn.Linear(hidden, n_out) self.log_std.weight.data.uniform_(-3e-3, 3e-3) self.log_std.bias.data.uniform_(-3e-3, 3e-3) def forward(self, x): x = self.layers(x) mean = self.mean(x) log_std = self.log_std(x).clamp(*self.logstd_range) return mean, log_std class Policy: def __init__(self, nn): self.nn = nn def get_dist(self, s): mean, log_std = self.nn(s) return rw.dist.TanhNormal(loc=mean, scale=log_std.exp()) def get_act(self, s=None, dist=None): assert (s is not None and dist is None) or (s is None and dist is not None) dist = dist or self.get_dist(s=s) return dist.rsample() def get_act_pre(self, s=None, dist=None): assert (s is not None and dist is None) or (s is None and dist is not None) dist = dist or self.get_dist(s=s) return dist.rsample_with_pre() def logprob(self, dist, acs): return dist.log_prob(acs).sum(-1, keepdim=True) def logprob_pre(self, dist, acs): return dist.log_prob_pre(acs).sum(-1, keepdim=True) def mean(self, dist): return dist.loc def std(self, dist): return dist.scale def concat_state_shape(s_spec): return (int(np.sum([np.prod(o.shape) for o in s_spec.values()])), ) def concat_state(s): return np.concatenate([o.flatten() for o in s.values()]) def get_act_fn(policy, a_map): def get(tstep): s = S(concat_state(tstep.observation)[None]).to_tensor() return a_map(U.to_np(policy.get_act(s)[0])) return get # env = suite.load(domain_name="cartpole", task_name="three_poles") env = suite.load(domain_name="walker", task_name="run") # Define spaces S = rw.space.Continuous(shape=concat_state_shape(env.observation_spec()), low=-np.inf, high=np.inf) A = rw.space.Continuous(low=env.action_spec().minimum, high=env.action_spec().maximum, shape=env.action_spec().shape) a_map = U.map_range(-1, 1, A.low[0], A.high[0]) pnn = PolicyNN(n_in=S.shape[0], n_out=A.shape[0]).to(DEVICE) policy = Policy(nn=pnn) U.load_model(pnn, path='logs/dm/walker/run-max999-v9-2/models/pnn_checkpoint') get_act = get_act_fn(policy=policy, a_map=a_map) viewer.launch(env, policy=get_act)
38.797297
117
0.66388
489
2,871
3.730061
0.251534
0.013158
0.028509
0.030702
0.285088
0.260965
0.213816
0.169408
0.151316
0.121711
0
0.015411
0.186346
2,871
73
118
39.328767
0.765411
0.027517
0
0.071429
0
0
0.021872
0.018645
0
0
0
0
0.035714
1
0.25
false
0
0.053571
0.107143
0.446429
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
3752032895f97132483d0cfa4339b37fb1eaf5c4
151
py
Python
3.py
guillesiesta/python_comprehensions
4d2765b29b8165a5fa2488e6a50a49235238c82f
[ "Apache-2.0" ]
null
null
null
3.py
guillesiesta/python_comprehensions
4d2765b29b8165a5fa2488e6a50a49235238c82f
[ "Apache-2.0" ]
null
null
null
3.py
guillesiesta/python_comprehensions
4d2765b29b8165a5fa2488e6a50a49235238c82f
[ "Apache-2.0" ]
null
null
null
hola = True adiosguillermomurielsanchezlafuente = True if (adiosguillermomurielsanchezlafuente and hola): print("ok con nombre muy largo")
21.571429
42
0.761589
14
151
8.214286
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.178808
151
6
43
25.166667
0.927419
0
0
0
0
0
0.152318
0
0
0
0
0
0
1
0
false
0
0
0
0
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
3756ed66b18a82931a6853bd82ac2dc78630d72b
1,597
py
Python
src/foxdot/sandbox/180823_0948_compo_036.py
Neko250/aisthesis
1d4a2c3070d10596c28b25ea2170523583e7eff0
[ "Apache-2.0" ]
4
2018-06-29T18:39:34.000Z
2021-06-20T16:44:29.000Z
src/foxdot/sandbox/180823_0948_compo_036.py
Neko250/aisthesis
1d4a2c3070d10596c28b25ea2170523583e7eff0
[ "Apache-2.0" ]
null
null
null
src/foxdot/sandbox/180823_0948_compo_036.py
Neko250/aisthesis
1d4a2c3070d10596c28b25ea2170523583e7eff0
[ "Apache-2.0" ]
null
null
null
Scale.default = Scale.chromatic Root.default = 0 Clock.bpm = 120 var.ch = var(P[1,5,0,3],8) ~p1 >> play('m', amp=.8, dur=PDur(3,8), rate=[1,(1,2)]) ~p2 >> play('-', amp=.5, dur=2, hpf=2000, hpr=linvar([.1,1],16), sample=1).often('stutter', 4, dur=3).every(8, 'sample.offadd', 1) ~p3 >> play('{ ppP[pP][Pp]}', amp=.8, dur=.5, sample=PRand(7), rate=PRand([.5,1,2])) ~p4 >> play('V', amp=.8, dur=1) ~p5 >> play('#', amp=1.2, dur=16, drive=.1, chop=128, formant=1) ~s1 >> glass(var.ch+(0,5,12), amp=1, dur=8, coarse=8) ~s2 >> piano(var.ch+(0,[5,5,3,7],12), amp=1, dur=8, delay=(0,.25,.5)) Group(p1, p2, p3).stop() p4.lpf = linvar([4000,10],[32,0]) p4.stop() s2.stop() ~s3 >> saw(var.ch+PWalk(), amp=PRand([0,.8])[:24], dur=PDur(3,8), scale=Scale.minor, oct=PRand([4,5,6])[:32], drive=.05, room=1, mix=.5).spread() ~s3 >> saw(var.ch+PWalk(), amp=PRand([0,.8])[:20], dur=PDur(5,8), scale=Scale.minor, oct=PRand([4,5,6])[:32], drive=.05, room=1, mix=.5).spread() ~s3 >> saw(var.ch+PWalk(), amp=PRand([0,.8])[:64], dur=.25, scale=Scale.minor, oct=PRand([4,5,6])[:32], drive=.05, room=1, mix=.5).spread() ~p4 >> play('V', amp=.5, dur=1, room=1, lpf=1200).every(7, 'stutter', cycle=16) ~p6 >> play('n', amp=.5, dur=1, delay=.5, room=1, hpf=linvar([2000,4000],16), hpr=.1) s1.oct = 4 s1.formant = 1 ~p3 >> play('{ ppP[pP][Pp]}', amp=.5, dur=.5, sample=PRand(7), rate=PRand([.5,1,2]), room=1, mix=.25) Group(p6, s3).stop() ~s2 >> piano(var.ch+([12,0],[5,5,3,7],[0,12]), amp=1, dur=8, delay=(0,.25,.5), room=1, mix=.5, drive=.05, chop=32, echo=[1,2,1,4]) Group(p3, s1).stop() Clock.clear()
33.270833
145
0.566061
333
1,597
2.714715
0.24024
0.038717
0.044248
0.039823
0.414823
0.392699
0.392699
0.355089
0.355089
0.285398
0
0.146564
0.107076
1,597
47
146
33.978723
0.487377
0
0
0
0
0
0.038197
0
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
375c4db97fae968fedba9552a5d467ff9af0a2d3
1,216
py
Python
statmail/Types.py
birm/StatMail
61e39346a4754f8e9bab1736caf02f4cb1c2c2a5
[ "MIT" ]
null
null
null
statmail/Types.py
birm/StatMail
61e39346a4754f8e9bab1736caf02f4cb1c2c2a5
[ "MIT" ]
7
2016-10-18T18:30:47.000Z
2017-01-17T21:28:40.000Z
statmail/Types.py
birm/StatMail
61e39346a4754f8e9bab1736caf02f4cb1c2c2a5
[ "MIT" ]
null
null
null
from .SMBase import SMBase """ A collection of builtin server types. """ class Types(SMBase): """A class for keeping track of all types supported.""" # TODO read from files later for types, but for now... supported = ["minimal"] @classmethod def supported(self, stype): """Determine if the type given is supported.""" return stype in self.supported @classmethod def find_template(self, stype): """Find specific templates for types.""" """template format is: for one server with {NAME}, and {description}, {result} for each report item. The returned list is [header, name section, result, footer] in html""" # TODO use files for templates if stype == "minimal": return ["<html>", "{NAME}<br/>", "{description}:{result}<br/>", "</html>"] else: return False @classmethod def find_reporter(self, stype): """Get report items.""" """ should be list of [descrption, test] items""" if stype == "minimal": return [["CPU Usage", "mpstat | awk '$12 ~ /[0-9.]+/ { \ print 100 - $12\"%\" }'"]] else: return False
32.864865
86
0.564967
140
1,216
4.892857
0.528571
0.061314
0.052555
0.058394
0
0
0
0
0
0
0
0.010502
0.29523
1,216
36
87
33.777778
0.788798
0.186678
0
0.473684
0
0
0.121345
0.039474
0
0
0
0.055556
0
1
0.157895
false
0
0.052632
0
0.578947
0.052632
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
377f113688c643f861a107b95cf2a20826771ea4
445
py
Python
check_db.py
Yaremenko-R/python_training
f198b898bd9947afd4f71bc01f992909df392a57
[ "Apache-2.0" ]
null
null
null
check_db.py
Yaremenko-R/python_training
f198b898bd9947afd4f71bc01f992909df392a57
[ "Apache-2.0" ]
null
null
null
check_db.py
Yaremenko-R/python_training
f198b898bd9947afd4f71bc01f992909df392a57
[ "Apache-2.0" ]
null
null
null
from fixture.orm import ORMFixture from fixture.db import DbFixture from model.group import Group from model.contact import Contact database = ORMFixture(host="localhost", name="addressbook", user="root", password="") try: l = database.get_contacts_in_group(Group(id="174")) # l = sorted(database.get_groups_contact_added(Contact(id="1")), key=Group.id_or_max) for item in l: print(item) print(len(l)) finally: pass
27.8125
88
0.723596
65
445
4.830769
0.584615
0.070064
0
0
0
0
0
0
0
0
0
0.01061
0.152809
445
15
89
29.666667
0.822281
0.186517
0
0
0
0
0.07563
0
0
0
0
0
0
1
0
false
0.166667
0.333333
0
0.333333
0.166667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
2
379e57a273cd4876cffb73afd2c43311830a75c5
86
py
Python
consent/__init__.py
alekosot/django-consent
545363978e5ef9e404e633f198d94295b5aa384b
[ "MIT" ]
1
2019-09-25T06:37:45.000Z
2019-09-25T06:37:45.000Z
consent/__init__.py
d0ugal/django-consent
8b72b487ace0a09e59962646ddb63b95796ca55a
[ "MIT" ]
null
null
null
consent/__init__.py
d0ugal/django-consent
8b72b487ace0a09e59962646ddb63b95796ca55a
[ "MIT" ]
null
null
null
# following PEP 386, versiontools will pick it up __version__ = (0, 2, 0, "final", 0)
28.666667
49
0.686047
14
86
3.928571
0.857143
0
0
0
0
0
0
0
0
0
0
0.1
0.186047
86
2
50
43
0.685714
0.546512
0
0
0
0
0.135135
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
37a1dff781641c0f7cb06a0378062d227d3b4139
1,441
py
Python
tests/test_processor.py
manslogic/rasa_core
17c82e6be052fc147caef9a9914d06f79a944687
[ "Apache-2.0" ]
1
2017-12-27T04:07:24.000Z
2017-12-27T04:07:24.000Z
tests/test_processor.py
jenish-cj/botnlufoodrest
b41aa2c7a1f6e492e10f07e67562b612b5b13a53
[ "Apache-2.0" ]
null
null
null
tests/test_processor.py
jenish-cj/botnlufoodrest
b41aa2c7a1f6e492e10f07e67562b612b5b13a53
[ "Apache-2.0" ]
null
null
null
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from rasa_core.channels import UserMessage from rasa_core.channels.direct import CollectingOutputChannel from rasa_core.featurizers import BinaryFeaturizer from rasa_core.interpreter import RegexInterpreter from rasa_core.channels.console import ConsoleOutputChannel from rasa_core.policies import PolicyTrainer from rasa_core.policies.ensemble import SimplePolicyEnsemble from rasa_core.policies.scoring_policy import ScoringPolicy from rasa_core.processor import MessageProcessor from rasa_core.tracker_store import InMemoryTrackerStore def test_message_processor(default_domain, capsys): story_filename = "data/dsl_stories/stories_defaultdomain.md" ensemble = SimplePolicyEnsemble([ScoringPolicy()]) interpreter = RegexInterpreter() PolicyTrainer(ensemble, default_domain, BinaryFeaturizer()).train( story_filename, max_history=3) tracker_store = InMemoryTrackerStore(default_domain) processor = MessageProcessor(interpreter, ensemble, default_domain, tracker_store) out = CollectingOutputChannel() processor.handle_message(UserMessage("_greet[name=Core]", out)) assert ("default", "hey there Core!") == out.latest_output()
40.027778
70
0.764053
147
1,441
7.170068
0.401361
0.075901
0.113852
0.056926
0
0
0
0
0
0
0
0.000846
0.179736
1,441
35
71
41.171429
0.890863
0
0
0
0
0
0.055517
0.028452
0
0
0
0
0.034483
1
0.034483
false
0
0.482759
0
0.517241
0.034483
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
37ad375b563b64c735e0509a6bc22b77f4aa298e
2,633
py
Python
arse/biclustering/deflation.py
marianotepper/comdet
ca55083fdcd555b3f80586423cbe8a09498993d2
[ "BSD-3-Clause" ]
null
null
null
arse/biclustering/deflation.py
marianotepper/comdet
ca55083fdcd555b3f80586423cbe8a09498993d2
[ "BSD-3-Clause" ]
null
null
null
arse/biclustering/deflation.py
marianotepper/comdet
ca55083fdcd555b3f80586423cbe8a09498993d2
[ "BSD-3-Clause" ]
null
null
null
from __future__ import absolute_import from . import compression from . import utils class DeflationError(RuntimeError): def __init__(self, *args, **kwargs): super(DeflationError, self).__init__(*args, **kwargs) class Deflator(utils.Downdater): def __init__(self, array): super(Deflator, self).__init__(array) @property def compressed_array(self): raise DeflationError('Could not compress the array.') class L1CompressedDeflator(Deflator): def __init__(self, array, n_samples): super(L1CompressedDeflator, self).__init__(array) if n_samples >= array.shape[1]: self._compressor = DummyCompressor(array, n_samples) else: self._compressor = compression.OnlineColumnCompressor(array, n_samples) self._inner_compress() def _inner_compress(self): selection = self._compressor.compress() if selection is None or self.n_samples > selection.size: try: del self._selection del self._compressed_array except AttributeError: pass else: self._selection = selection self._compressed_array = self.array[:, self.selection] @property def compressed_array(self): try: return self._compressed_array except AttributeError: raise DeflationError('Could not compress the array.') @property def selection(self): try: return self._selection except AttributeError: raise DeflationError('Could not compress the array.') @property def n_samples(self): return self._compressor.n_samples def additive_downdate(self, u, v): super(L1CompressedDeflator, self).additive_downdate(u, v) self._compressor.additive_downdate(u, v) self._inner_compress() def remove_columns(self, idx_cols): super(L1CompressedDeflator, self).remove_columns(idx_cols) self._compressor.remove_columns(idx_cols) self._inner_compress() def remove_rows(self, idx_rows): super(L1CompressedDeflator, self).remove_rows(idx_rows) self._compressor.remove_rows(idx_rows) self._inner_compress() class DummyCompressor(object): def __init__(self, array, n_samples): self.n_samples = n_samples def compress(self): return None def additive_downdate(self, u, v): pass def remove_columns(self, idx): pass def remove_rows(self, idx): pass
28.934066
76
0.635777
277
2,633
5.722022
0.205776
0.050473
0.02776
0.030284
0.411987
0.182334
0.120505
0.093375
0.093375
0.093375
0
0.003171
0.281428
2,633
90
77
29.255556
0.834567
0
0
0.414286
0
0
0.033042
0
0
0
0
0
0
1
0.228571
false
0.057143
0.042857
0.028571
0.385714
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
37b13ac6a482ca464f323ea8e9763e6ccd5bd832
3,646
py
Python
Data Structures/Heap/JesseAndCookies.py
aibenStunner/HackerRank
de223f2b1fa95d1959deef9ce14b39baa61100ba
[ "MIT" ]
2
2020-04-17T02:54:59.000Z
2020-06-08T23:32:12.000Z
Data Structures/Heap/JesseAndCookies.py
aibenStunner/HackerRank
de223f2b1fa95d1959deef9ce14b39baa61100ba
[ "MIT" ]
null
null
null
Data Structures/Heap/JesseAndCookies.py
aibenStunner/HackerRank
de223f2b1fa95d1959deef9ce14b39baa61100ba
[ "MIT" ]
1
2021-11-16T14:05:22.000Z
2021-11-16T14:05:22.000Z
#!/bin/python3 import os import sys class minHeap: def __init__(self): self.items = [] self.size = len(self.items) def getLeftChildIndex(self, parentIndex): return 2 * parentIndex + 1 def getRightChildIndex(self, parentIndex): return 2 * parentIndex + 2 def getParentIndex(self, childIndex): return int((childIndex - 1) / 2) def hasLeftChild(self, index): return self.getLeftChildIndex(index) < self.size def hasRightChild(self, index): return self.getRightChildIndex(index) < self.size def hasParent(self, index): return self.getParentIndex(index) >= 0 def leftChild(self, index): return self.items[self.getLeftChildIndex(index)] def rightChild(self, index): return self.items[self.getRightChildIndex(index)] def parent(self, index): return self.items[self.getParentIndex(index)] def swap(self, indexOne, indexTwo): temp = self.items[indexOne] self.items[indexOne] = self.items[indexTwo] self.items[indexTwo] = temp def pop(self): if self.size == 0: raise Exception("Empty Heap!!") else: item = self.items[0] self.items[0] = self.items[self.size - 1] del(self.items[self.size - 1]) self.size = len(self.items) self.heapifyDown() return item def peek(self): if self.size == 0: raise Exception("Empty Heap!!") else: return self.items[0] def add(self, item): self.items.append(item) self.size = len(self.items) self.heapifyUp() def heapify(self, arr): for elem in arr: self.add(elem) def heapifyUp(self): index = self.size - 1 while (self.hasParent(index) and self.parent(index) > self.items[index]): self.swap(self.getParentIndex(index), index) index = self.getParentIndex(index) def heapifyDown(self): index = 0 while(self.hasLeftChild(index)): smallerChildIndex = self.getLeftChildIndex(index) if(self.hasRightChild(index) and self.rightChild(index) < self.leftChild(index)): smallerChildIndex = self.getRightChildIndex(index) if(self.items[index] < self.items[smallerChildIndex]): break else: self.swap(index, smallerChildIndex) index = smallerChildIndex # # Complete the cookies function below. # def cookies(k, A): qHeap = minHeap() qHeap.heapify(A) count = 0 try: while qHeap.peek() < k: count += 1 a, b = qHeap.pop(), qHeap.pop() newCookie = (1*a)+(2*b) qHeap.add(newCookie) return count except: return -1 if __name__ == '__main__': # fptr = open(os.environ['OUTPUT_PATH'], 'w') nk = input().split() n = int(nk[0]) k = int(nk[1]) A = list(map(int, input().rstrip().split())) result = cookies(k, A) print(result) # fptr.write(str(result) + '\n') # fptr.close() # def cookies(k, A): # from heapq import heappop,heappush,heapify # heapify(A) # fC = 0 # try: # while A[0] < k: # fC+=1 # c1 = heappop(A) # c2 = heappop(A) # newCookie=(1*c1)+(2*c2) # heappush(A,newCookie) # return fC # except: # return -1
26.42029
93
0.538124
396
3,646
4.921717
0.244949
0.092355
0.053361
0.058492
0.205747
0.110826
0.043099
0.043099
0.043099
0.043099
0
0.014173
0.342019
3,646
137
94
26.613139
0.798249
0.153319
0
0.116279
0
0
0.010437
0
0
0
0
0
0
1
0.209302
false
0
0.023256
0.104651
0.395349
0.011628
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
37c68daf5d38e300ea366a9d35adffa55a0cf4c8
261
py
Python
Python3/Exercises/DictionaryMethods/dictionary_methods.py
norbertosanchezdichi/TIL
2e9719ddd288022f53b094a42679e849bdbcc625
[ "MIT" ]
null
null
null
Python3/Exercises/DictionaryMethods/dictionary_methods.py
norbertosanchezdichi/TIL
2e9719ddd288022f53b094a42679e849bdbcc625
[ "MIT" ]
null
null
null
Python3/Exercises/DictionaryMethods/dictionary_methods.py
norbertosanchezdichi/TIL
2e9719ddd288022f53b094a42679e849bdbcc625
[ "MIT" ]
null
null
null
inventory = {'croissant': 19, 'bagel': 4, 'muffin': 8, 'cake': 1} print(f'{inventory =}') stock_list = inventory.copy() print(f'{stock_list =}') stock_list['hot cheetos'] = 25 stock_list.update({'cookie' : 18}) stock_list.pop('cake') print(f'{stock_list =}')
23.727273
65
0.655172
38
261
4.342105
0.552632
0.327273
0.133333
0.181818
0
0
0
0
0
0
0
0.038793
0.111111
261
11
66
23.727273
0.672414
0
0
0.25
0
0
0.328244
0
0
0
0
0
0
1
0
false
0
0
0
0
0.375
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
805ebe18518a4388e308601d10dffab1db81feb4
304
py
Python
tests/file_test_util.py
lyksdu/langmodels
5a49ee523e84513915f6fa747e03e5ef813aec17
[ "MIT" ]
9
2020-01-21T13:34:49.000Z
2022-03-18T02:34:30.000Z
tests/file_test_util.py
lyksdu/langmodels
5a49ee523e84513915f6fa747e03e5ef813aec17
[ "MIT" ]
6
2020-05-02T07:03:26.000Z
2022-03-11T23:48:38.000Z
tests/file_test_util.py
lyksdu/langmodels
5a49ee523e84513915f6fa747e03e5ef813aec17
[ "MIT" ]
3
2019-08-03T00:06:19.000Z
2020-05-07T00:37:19.000Z
from typing import List from unittest.mock import MagicMock def file_mock_with_lines(lines: List[str]): file_mock = MagicMock(spec=['__enter__', '__exit__']) handle1 = file_mock.__enter__.return_value handle1.__iter__.return_value = iter(map(lambda l: l + '\n', lines)) return file_mock
33.777778
72
0.740132
43
304
4.674419
0.534884
0.159204
0
0
0
0
0
0
0
0
0
0.007722
0.148026
304
9
73
33.777778
0.76834
0
0
0
0
0
0.062295
0
0
0
0
0
0
1
0.142857
false
0
0.285714
0
0.571429
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
80601f4e57df490107c52562edfb5325419b2d30
624
py
Python
noheavenbot/utils/database_config.py
Molanito13/noheaven-bot
ad126d4601321ecabff9d1d214ce7d3f4e258c3e
[ "MIT" ]
3
2018-10-13T14:05:24.000Z
2018-12-25T21:40:21.000Z
noheavenbot/utils/database_config.py
Molanito13/noheaven-bot
ad126d4601321ecabff9d1d214ce7d3f4e258c3e
[ "MIT" ]
2
2018-10-08T14:33:39.000Z
2020-03-02T18:00:47.000Z
noheavenbot/utils/database_config.py
Molanito13/noheaven-bot
ad126d4601321ecabff9d1d214ce7d3f4e258c3e
[ "MIT" ]
5
2018-10-08T14:18:58.000Z
2020-11-01T17:55:51.000Z
import logging try: from asyncpg import create_pool except ModuleNotFoundError: logging.warning('Database not set up, install asyncpg') from noheavenbot.utils.constants import EnvVariables class Database: @classmethod async def connect(cls): credentials = {'user': EnvVariables.get('DB_USER'), 'password': EnvVariables.get('DB_PASS'), 'database': EnvVariables.get('DB_DATABASE'), 'host': EnvVariables.get('DB_HOST'), 'port': EnvVariables.get('DB_PORT')} return await create_pool(**credentials)
28.363636
67
0.621795
62
624
6.145161
0.564516
0.19685
0.223097
0
0
0
0
0
0
0
0
0
0.272436
624
21
68
29.714286
0.839207
0
0
0
0
0
0.165064
0
0
0
0
0
0
1
0
false
0.066667
0.2
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
8070ca9d70fe00ca55a340a59c8f92988b806d9b
1,427
py
Python
style/predict/servable/base.py
imagination-ai/kerem-side-projects-monorepo
3d9da9d57f305ac2d6a03bab3787acfbee7269ee
[ "MIT" ]
null
null
null
style/predict/servable/base.py
imagination-ai/kerem-side-projects-monorepo
3d9da9d57f305ac2d6a03bab3787acfbee7269ee
[ "MIT" ]
2
2022-01-20T15:46:39.000Z
2022-02-16T20:51:47.000Z
style/predict/servable/base.py
imagination-ai/kerem-side-projects-monorepo
3d9da9d57f305ac2d6a03bab3787acfbee7269ee
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod import dill class BaseServable(ABC): SCHEMA_SLUG = "schema.json" MODEL_TYPE: str MODEL_VARIANT: str def __init__(self, model): self.model = model @abstractmethod def export(self, path): raise NotImplementedError @abstractmethod def run_inference(self, *args, **kwargs): raise NotImplementedError @classmethod @abstractmethod def load(cls, path): raise NotImplementedError class SklearnBasedClassifierServable(BaseServable): MODEL_VARIANT = "sklearn-classification" def export(self, path): with open(path, "wb") as f: dill.dump(self.model, f) def run_inference(self, texts): prediction = self.model.predict([texts]) print(prediction) return prediction[0] def run_inference_multiclass(self, texts): prob = self.model.predict_proba([texts]).tolist()[0] labels = self.model.classes_ output = sorted(zip(labels, prob), reverse=True, key=lambda e: e[1]) return output @classmethod def load(cls, path): return cls(model=dill.load(open(path, "rb"))) class MockServable(BaseServable): def run_inference(self, texts): return {"Bon jovi": 0.15, "Kerem": 0.55, "Osman": 0.30} @classmethod def load(cls, path): return cls(model=None) def export(self, path): pass
23.393443
76
0.641205
166
1,427
5.421687
0.415663
0.06
0.066667
0.056667
0.14
0.086667
0.086667
0.086667
0
0
0
0.011204
0.249474
1,427
60
77
23.783333
0.829132
0
0
0.395349
0
0
0.038542
0.015417
0
0
0
0
0
1
0.255814
false
0.023256
0.046512
0.069767
0.581395
0.023256
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
8078d7a28563705ea00176138060393918bcd846
219
py
Python
0.1/game/maptest.py
icefoxen/games-drewfe
7606330b89e4ad37e98637e79af2c058b18112d7
[ "MIT" ]
null
null
null
0.1/game/maptest.py
icefoxen/games-drewfe
7606330b89e4ad37e98637e79af2c058b18112d7
[ "MIT" ]
null
null
null
0.1/game/maptest.py
icefoxen/games-drewfe
7606330b89e4ad37e98637e79af2c058b18112d7
[ "MIT" ]
null
null
null
import pygame from pygame.locals import * from map import * a = Map( 'test.map' ) scr = pygame.display.set_mode( (400, 300) ) a.draw( scr, 0, 0, 400, 300 ) pygame.display.flip() #a.printTileset() while True: pass
15.642857
43
0.671233
35
219
4.171429
0.571429
0.178082
0
0
0
0
0
0
0
0
0
0.077778
0.178082
219
13
44
16.846154
0.733333
0.073059
0
0
0
0
0.039604
0
0
0
0
0
0
1
0
false
0.111111
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
2
807f6be89f92fe14527544c6ac0f3f6e3bb7e50f
1,066
py
Python
server/src/service/image/i_image_controller_service.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
4
2021-12-31T10:06:34.000Z
2022-01-16T16:34:50.000Z
server/src/service/image/i_image_controller_service.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
null
null
null
server/src/service/image/i_image_controller_service.py
konrad2508/picgal
7f7822a02145fd2efa697e1c7750af9af680a3da
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod from model.image.data.count_data import CountData from model.image.data.image_data import ImageData from model.image.data.tag_data import TagData from model.image.data.virtual_tag_data import VirtualTagData from model.image.request.image_modification_request import ImageModificationRequest class IImageControllerService(ABC): @abstractmethod def get_infos(self, image_url: str, preview_url: str, sample_url: str, tags: str | None, page: int) -> list[ImageData]: ... @abstractmethod def modify_info(self, image_url: str, preview_url: str, sample_url: str, id: int, modifications: ImageModificationRequest) -> ImageData: ... @abstractmethod def get_infos_count(self, tags: str | None) -> CountData: ... @abstractmethod def get_tags(self) -> list[TagData | VirtualTagData]: ... @abstractmethod def get_image_path(self, id: int) -> str: ... @abstractmethod def get_preview_path(self, id: int) -> str: ... @abstractmethod def get_sample_path(self, id: int) -> str: ...
34.387097
144
0.732645
135
1,066
5.607407
0.274074
0.157199
0.15852
0.095112
0.221929
0.200793
0.200793
0.200793
0.10568
0.10568
0
0
0.157599
1,066
30
145
35.533333
0.842984
0
0
0.333333
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.285714
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
80866b9b24652869ee934797eac93607bc5366aa
386
py
Python
cursecreatortests.py
kushtrimh/curse-of-tenebrae
374ca8684debb686a651c216e2be78f449b983de
[ "BSD-2-Clause" ]
null
null
null
cursecreatortests.py
kushtrimh/curse-of-tenebrae
374ca8684debb686a651c216e2be78f449b983de
[ "BSD-2-Clause" ]
null
null
null
cursecreatortests.py
kushtrimh/curse-of-tenebrae
374ca8684debb686a651c216e2be78f449b983de
[ "BSD-2-Clause" ]
null
null
null
import unittest import mock import Tkinter from cursecreator import Application class TestNPCCreator(unittest.TestCase): def setUp(self): root = Tkinter.Tk() self.app = Application(root) def test_attribute_fixer(self): self.assertTrue(self.app.attribute_fixer("health", 0)) self.assertFalse(self.app.attribute_fixer("banana", 0)) if __name__ == "__main__": unittest.main()
24.125
57
0.766839
50
386
5.68
0.54
0.073944
0.112676
0.147887
0
0
0
0
0
0
0
0.005848
0.11399
386
16
58
24.125
0.824561
0
0
0
0
0
0.05168
0
0
0
0
0
0.153846
1
0.153846
false
0
0.307692
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
808721236b1e32630e399cfed97544fb1b0949bc
813
py
Python
external/modbus_tk/modbus_tk/__init__.py
iconnect-iot/intel-device-resource-mgt-lib
3be2f7342b6f79836439e9712e2a36939c986760
[ "Apache-2.0" ]
2
2020-03-26T07:23:09.000Z
2020-04-19T14:20:42.000Z
external/modbus_tk/modbus_tk/__init__.py
iconnect-iot/intel-device-resource-mgt-lib
3be2f7342b6f79836439e9712e2a36939c986760
[ "Apache-2.0" ]
1
2020-06-02T04:32:15.000Z
2020-06-02T04:32:34.000Z
external/modbus_tk/modbus_tk/__init__.py
iconnect-iot/intel-device-resource-mgt-lib
3be2f7342b6f79836439e9712e2a36939c986760
[ "Apache-2.0" ]
15
2018-04-06T11:43:38.000Z
2022-02-07T03:25:43.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Modbus TestKit: Implementation of Modbus protocol in python (C)2009 - Luc Jean - luc.jean@gmail.com (C)2009 - Apidev - http://www.apidev.fr This is distributed under GNU LGPL license, see license.txt Make possible to write modbus TCP and RTU master and slave for testing purpose Modbus TestKit is different from pymodbus which is another implementation of the modbus stack in python contributors: ---------------------------------- * OrangeTux * denisstogl * MELabs * idahogray * riaan.doorduin * tor.sjowall * smachin1000 * GadgetSteve * dhoomakethu * zerox1212 * ffreckle * Matthew West Please let us know if your name is missing! """ VERSION = '0.5.4' import logging LOGGER = logging.getLogger("modbus_tk")
21.394737
80
0.675277
106
813
5.169811
0.792453
0.047445
0
0
0
0
0
0
0
0
0
0.030817
0.201722
813
37
81
21.972973
0.813559
0.845018
0
0
0
0
0.179487
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
808b93fe478dc64ffdbfa77f3e6535748754649c
1,296
py
Python
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/EGL/MESA/drm_image.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/EGL/MESA/drm_image.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/EGL/MESA/drm_image.py
JE-Chen/je_old_repo
a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5
[ "MIT" ]
null
null
null
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.EGL import _types as _cs # End users want this... from OpenGL.raw.EGL._types import * from OpenGL.raw.EGL import _errors from OpenGL.constant import Constant as _C import ctypes _EXTENSION_NAME = 'EGL_MESA_drm_image' def _f( function ): return _p.createFunction( function,_p.PLATFORM.EGL,'EGL_MESA_drm_image',error_checker=_errors._error_checker) EGL_DRM_BUFFER_FORMAT_ARGB32_MESA=_C('EGL_DRM_BUFFER_FORMAT_ARGB32_MESA',0x31D2) EGL_DRM_BUFFER_FORMAT_MESA=_C('EGL_DRM_BUFFER_FORMAT_MESA',0x31D0) EGL_DRM_BUFFER_MESA=_C('EGL_DRM_BUFFER_MESA',0x31D3) EGL_DRM_BUFFER_STRIDE_MESA=_C('EGL_DRM_BUFFER_STRIDE_MESA',0x31D4) EGL_DRM_BUFFER_USE_MESA=_C('EGL_DRM_BUFFER_USE_MESA',0x31D1) EGL_DRM_BUFFER_USE_SCANOUT_MESA=_C('EGL_DRM_BUFFER_USE_SCANOUT_MESA',0x00000001) EGL_DRM_BUFFER_USE_SHARE_MESA=_C('EGL_DRM_BUFFER_USE_SHARE_MESA',0x00000002) @_f @_p.types(_cs.EGLImageKHR,_cs.EGLDisplay,arrays.GLintArray) def eglCreateDRMImageMESA(dpy,attrib_list):pass @_f @_p.types(_cs.EGLBoolean,_cs.EGLDisplay,_cs.EGLImageKHR,arrays.GLintArray,arrays.GLintArray,arrays.GLintArray) def eglExportDRMImageMESA(dpy,image,name,handle,stride):pass
48
114
0.828704
203
1,296
4.802956
0.330049
0.086154
0.172308
0.078974
0.382564
0.207179
0
0
0
0
0
0.035176
0.078704
1,296
26
115
49.846154
0.781407
0.07716
0
0.090909
1
0
0.191745
0.144454
0
0
0.042992
0
0
1
0.136364
false
0.090909
0.272727
0.045455
0.454545
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
809d1a480aa05cc6e8c44d78d1263f97f33db820
312
py
Python
Python/02-Django/01-Try-Django/Challenges/01-Getting-Started/03/mainurls.py
pabhd3/Code-School
5115c1bdc1e99ea667bdc942667342123ae3929a
[ "MIT" ]
null
null
null
Python/02-Django/01-Try-Django/Challenges/01-Getting-Started/03/mainurls.py
pabhd3/Code-School
5115c1bdc1e99ea667bdc942667342123ae3929a
[ "MIT" ]
null
null
null
Python/02-Django/01-Try-Django/Challenges/01-Getting-Started/03/mainurls.py
pabhd3/Code-School
5115c1bdc1e99ea667bdc942667342123ae3929a
[ "MIT" ]
null
null
null
# Python # Django # Try Django # Getting Started (Level 1) # Challenge 03 - Refactor the existing URL Dispatchers from django.conf.urls import url from . import views urlpatterns = [ # TODO: Add a url() object whose regex parameter takes an empty path that # terminates, and goes to views.home ]
24
78
0.711538
44
312
5.045455
0.840909
0
0
0
0
0
0
0
0
0
0
0.012346
0.221154
312
13
79
24
0.901235
0.695513
0
0
0
0
0
0
0
0
0
0.076923
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
2
80b6a675ace70af0f9c0466a40acaf8e75019f1e
179
py
Python
tests/cases/help/see_for_top_level/test_see_for_top_level.py
WilliamMayor/vantage
05cda557cfc27cbf8aaf80a472a023a896e98546
[ "MIT" ]
1
2018-02-21T09:50:53.000Z
2018-02-21T09:50:53.000Z
tests/cases/help/see_for_top_level/test_see_for_top_level.py
WilliamMayor/vantage
05cda557cfc27cbf8aaf80a472a023a896e98546
[ "MIT" ]
15
2015-04-30T15:19:29.000Z
2021-07-28T14:34:46.000Z
tests/cases/help/see_for_top_level/test_see_for_top_level.py
WilliamMayor/vantage
05cda557cfc27cbf8aaf80a472a023a896e98546
[ "MIT" ]
null
null
null
def test_see_for_top_level(result): assert ( "usage: vantage [-a PATH] [-e NAME ...] [-v KEY=[VALUE] ...] [--verbose] [-h] COMMAND..." in result.stdout_ )
29.833333
97
0.547486
23
179
4.043478
0.956522
0
0
0
0
0
0
0
0
0
0
0
0.24581
179
5
98
35.8
0.688889
0
0
0
0
0.2
0.486034
0
0
0
0
0
0.2
1
0.2
false
0
0
0
0.2
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
80b90025f8cfff3aebe55376e817e68ada7a4f80
3,256
py
Python
models/__init__.py
davmre/sigvisa
91a1f163b8f3a258dfb78d88a07f2a11da41bd04
[ "BSD-3-Clause" ]
null
null
null
models/__init__.py
davmre/sigvisa
91a1f163b8f3a258dfb78d88a07f2a11da41bd04
[ "BSD-3-Clause" ]
null
null
null
models/__init__.py
davmre/sigvisa
91a1f163b8f3a258dfb78d88a07f2a11da41bd04
[ "BSD-3-Clause" ]
null
null
null
import numpy as np import cPickle class Distribution(object): def dim(self): raise NotImplementedError('abstract base class') def predict(self, cond=None): raise NotImplementedError('abstract base class') def sample(self, cond=None, key_prefix=""): raise NotImplementedError('abstract base class') def log_p(self, x, cond=None, key_prefix=""): raise NotImplementedError('abstract base class') def deriv_log_p(self, x, idx=None, cond=None, cond_key=None, cond_idx=None, lp0=None, eps=1e-4, **kwargs): """ Derivative of log P(X = x | cond = cond) with respect to x_idx (if idx is not None) or with respect to cond[cond_key]_{cond_idx} (if those quantities are not None). The default implementation computes a numerical approximation to the derivative: df/dx ~= f(x + eps) """ lp0 = lp0 if lp0 else self.log_p(x=x, cond=cond, **kwargs) if cond_key is None: # we're computing df/dx if idx is None: # assume x is scalar deriv = ( self.log_p(x = x + eps, cond=cond, **kwargs) - lp0 ) / eps else: x[idx] += eps deriv = ( self.log_p(x = x, cond=cond, **kwargs) - lp0 ) / eps x[idx] -= eps else: # we're computing df/dcond[cond_key] if cond_idx is None: cond[cond_key] += eps deriv = ( self.log_p(x = x, cond=cond, **kwargs) - lp0 ) / eps cond[cond_key] -= eps else: cond[cond_key][cond_idx] += eps deriv = ( self.log_p(x = x, cond=cond, **kwargs) - lp0 ) / eps cond[cond_key][cond_idx] -= eps return deriv def dump_to_file(self, fname): with open(fname, 'wb') as f: cPickle.dump(self, f, cPickle.HIGHEST_PROTOCOL) @staticmethod def load_from_file(fname): raise NotImplementedError('abstract base class') def save_to_db(self, dbconn): raise NotImplementedError('abstract base class') @staticmethod def load_from_db(dbconn, return_extra=False): raise NotImplementedError('abstract base class') class TimeSeriesDist(Distribution): def predict(self, n): raise NotImplementedError('abstract base class') def sample(self, n): raise NotImplementedError('abstract base class') class DummyModel(Distribution): def __init__(self, default_value = None, **kwargs): super(DummyModel, self).__init__(**kwargs) self.default_value = default_value if default_value is not None else 0.0 def log_p(self, x, **kwargs): return 0.0 def sample(self, **kwargs): return self.default_value def predict(self, **kwargs): return self.default_value class Constraint(DummyModel): def __init__(self, a=0, b=0, **kwargs): super(Constraint, self).__init__(**kwargs) self.a=a self.b=b def log_p(self, x, **kwargs): if self.a is not None and x < self.a: return -np.inf if self.b is not None and x > self.b: return -np.inf return 0.0
28.313043
110
0.585381
429
3,256
4.305361
0.202797
0.047645
0.155929
0.17542
0.464537
0.416892
0.239848
0.214402
0.142934
0.142934
0
0.007968
0.306204
3,256
114
111
28.561404
0.80965
0.105344
0
0.373134
0
0
0.061001
0
0
0
0
0
0
1
0.253731
false
0
0.029851
0.044776
0.447761
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
80c8767c767968d7e7fa23b2ecf6dcc08bf852f7
3,884
py
Python
semana4/app.py
ArseniumGX/bluemer-modulo2
24e5071b734de362dc47ef9d402c191699d15b43
[ "MIT" ]
null
null
null
semana4/app.py
ArseniumGX/bluemer-modulo2
24e5071b734de362dc47ef9d402c191699d15b43
[ "MIT" ]
null
null
null
semana4/app.py
ArseniumGX/bluemer-modulo2
24e5071b734de362dc47ef9d402c191699d15b43
[ "MIT" ]
null
null
null
from werkzeug.security import generate_password_hash, check_password_hash from flask import Flask, render_template, jsonify, request, redirect, flash, url_for from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, UserMixin, current_user, login_required, logout_user, login_user app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://user:password@localhost:3009/blue_modulo3' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True app.config['SECRET_KEY'] = b'_5#y2L"F4Q8z\n\xec]/' db = SQLAlchemy(app) login = LoginManager(app) ######################################################################## class Projeto(db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(25), nullable=False) description = db.Column(db.String(85)) image = db.Column(db.String) link = db.Column(db.String, nullable=False) last_login = db.Column(db.Date) def __init__(self, name, description, image, link) -> None: super().__init__() self.name = name self.description = description self.image = image self.link = link ######################################################################## ######################################################################## class Admin(UserMixin, db.Model): id = db.Column(db.Integer, primary_key=True, autoincrement=True) name = db.Column(db.String(50), nullable=False) username = db.Column(db.String(25), nullable=False) password = db.Column(db.String(103), nullable=False) last_login = db.Column(db.Date, nullable=True) def __init__(self, name, username, password) -> None: super().__init__() self.name = name self.username = username self.password = password self.last_login = None def set_password(self, pwd): self.password = generate_password_hash(pwd) def check_password(self, pwd): return check_password_hash(self.password, pwd) def set_date(self): from datetime import date self.last_login = date.today() ######################################################################## @login.user_loader def load_user(id): return Admin.query.get(int(id)) ######################################################################## @app.route('/') def index(): return render_template('index.html') @app.route('/signup', methods=['POST']) def signup(): if request.method == 'POST': admin = Admin( request.json['name'], request.json['username'], request.json['password'] ) admin.set_password(request.json['password']) db.session.add(admin) db.session.commit() return jsonify({'Message': 'Administrator created!'}), 201 @app.route('/login', methods=['GET', 'POST']) def login(): if current_user.is_authenticated: return redirect(url_for('admin')) if request.method == 'GET': return render_template('login.html') if request.method == 'POST': user = Admin.query.filter_by(username=request.form['username']).first() if user and user.check_password(request.form['password']): login_user(user, remember=True) user.set_date() db.session.commit() return redirect(url_for('admin')) else: flash('Usuário ou senha inválidos!') return redirect(url_for('login')) @app.route('/admin') @login_required def admin(): return render_template('admin.html') @app.route('/admin/logout') def logout(): logout_user() return redirect(url_for('index')) @app.route('/<slug>') def slug(slug): return render_template('notfound.html', slug=slug), 404 if __name__ == '__main__': # db.drop_all() db.create_all() app.run(debug=True, host='0.0.0.0', port=3000)
32.638655
102
0.598095
450
3,884
4.982222
0.28
0.039251
0.049063
0.049955
0.169492
0.14719
0.14719
0.100803
0.068689
0.068689
0
0.010719
0.183316
3,884
119
103
32.638655
0.696091
0.003347
0
0.133333
1
0
0.107407
0.030484
0
0
0
0
0
1
0.133333
false
0.133333
0.055556
0.055556
0.455556
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
80f13a81a491ee548192c6197ec3cfb3667be23d
65
py
Python
mdstudio/mdstudio/deferred/__init__.py
NLeSC/LIEStudio
03c163b4a2590b4e2204621e1c941c28a9624887
[ "Apache-2.0" ]
10
2017-09-14T07:26:15.000Z
2021-04-01T09:33:03.000Z
mdstudio/mdstudio/deferred/__init__.py
NLeSC/LIEStudio
03c163b4a2590b4e2204621e1c941c28a9624887
[ "Apache-2.0" ]
117
2017-09-13T08:09:48.000Z
2019-10-03T12:19:13.000Z
mdstudio/mdstudio/deferred/__init__.py
NLeSC/LIEStudio
03c163b4a2590b4e2204621e1c941c28a9624887
[ "Apache-2.0" ]
1
2018-09-26T09:40:51.000Z
2018-09-26T09:40:51.000Z
__all__ = ['chainable', 'make_deferred', "return_value", 'lock']
32.5
64
0.692308
7
65
5.571429
1
0
0
0
0
0
0
0
0
0
0
0
0.092308
65
1
65
65
0.661017
0
0
0
0
0
0.584615
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
80f142bd0ab437969db559a95c9f06b07679a259
1,440
py
Python
setup.py
TheMatjaz/RangeForce
906b0e303d2e4eecac75dc4680f7d9b1a86bd79c
[ "BSD-3-Clause" ]
null
null
null
setup.py
TheMatjaz/RangeForce
906b0e303d2e4eecac75dc4680f7d9b1a86bd79c
[ "BSD-3-Clause" ]
null
null
null
setup.py
TheMatjaz/RangeForce
906b0e303d2e4eecac75dc4680f7d9b1a86bd79c
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright © 2019-2020, Matjaž Guštin <dev@matjaz.it> <https://matjaz.it>. # Released under the BSD 3-Clause License """Package setup for the Rangeforce library.""" from distutils.core import setup # noinspection PyUnresolvedReferences import setuptools setup( name='Rangeforce', version='1.1.0', description='Developer-friendly range checks with user-friendly error ' 'messages', long_description=open('README.md').read(), long_description_content_type='text/markdown', author='Matjaž Guštin', author_email='dev@matjaz.it', url='https://github.com/TheMatjaz/Rangeforce', license='BSD', py_modules=[ 'rangeforce', ], keywords=[ 'range', 'domain', 'limited', 'validation', 'user-input', 'friendly', 'understandable', ], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Topic :: Software Development', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', ], python_requires='>=3', )
28.235294
75
0.603472
147
1,440
5.870748
0.62585
0.132097
0.173812
0.180765
0
0
0
0
0
0
0
0.024931
0.247917
1,440
50
76
28.8
0.771006
0.163194
0
0.076923
0
0
0.505863
0
0
0
0
0
0
1
0
true
0
0.051282
0
0.051282
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
80fd13c03cdfaa618f595e649dee4f74f7c9f3b9
498
py
Python
genthreads/actor.py
f1sty/genthreads
00e509b7315b7e0107e1c46235ec11e044aeb9ef
[ "MIT" ]
null
null
null
genthreads/actor.py
f1sty/genthreads
00e509b7315b7e0107e1c46235ec11e044aeb9ef
[ "MIT" ]
null
null
null
genthreads/actor.py
f1sty/genthreads
00e509b7315b7e0107e1c46235ec11e044aeb9ef
[ "MIT" ]
null
null
null
from multiprocessing import Process class InboxFullError(Exception): pass class Actor(Process): def __init__(self, inbox_size=48): super(Actor, self).__init__() self._inbox = list() self._inbox_size = inbox_size def send(self, value): if len(self._inbox) < self._inbox_size: self._inbox.append(value) else: raise InboxFullError('no more space in inbox') @property def inbox(self): return self._inbox
21.652174
58
0.628514
59
498
5
0.508475
0.213559
0.132203
0
0
0
0
0
0
0
0
0.005556
0.277108
498
22
59
22.636364
0.813889
0
0
0
0
0
0.044177
0
0
0
0
0
0
1
0.1875
false
0.0625
0.0625
0.0625
0.4375
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
0384989e82636b5dbefe82692c4b228ca4b5e756
607
py
Python
class4/pm.py
patrebert/pynet_cert
b82cce3ddb20d9e4abc89d74579ddeb3513bdf55
[ "Apache-2.0" ]
null
null
null
class4/pm.py
patrebert/pynet_cert
b82cce3ddb20d9e4abc89d74579ddeb3513bdf55
[ "Apache-2.0" ]
null
null
null
class4/pm.py
patrebert/pynet_cert
b82cce3ddb20d9e4abc89d74579ddeb3513bdf55
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """ Demonstrate use of paramiko to connect to managed device, send commands, get output """ import sys import paramiko from getpass import getpass from time import sleep ip_addr = '184.105.247.70' username = 'pyclass' password = '88newclass' password=getpass() sess=paramiko.SSHClient() sess.set_missing_host_key_policy(paramiko.AutoAddPolicy()) sess.connect(ip_addr,username=username,password=password, look_for_keys=False, allow_agent=False) rc = sess.invoke_shell() outp = rc.recv(5000) print outp rc.send("show ip int brief\n") sleep(1) outp=rc.recv(5000) print outp sys.exit()
22.481481
58
0.775947
94
607
4.904255
0.62766
0.039046
0.043384
0.060738
0.099783
0.099783
0
0
0
0
0
0.040516
0.105437
607
26
59
23.346154
0.808471
0.032949
0
0.2
0
0
0.10101
0
0
0
0
0
0
0
null
null
0.2
0.2
null
null
0.1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
03b414db96d625b3d6c44cb1055d545e44f688f9
1,332
py
Python
my_web_project/authentication/forms.py
AlexYankoff/my_web_project
d7d2c26289c561bc39d713ad5a1adff7a01b6508
[ "MIT" ]
null
null
null
my_web_project/authentication/forms.py
AlexYankoff/my_web_project
d7d2c26289c561bc39d713ad5a1adff7a01b6508
[ "MIT" ]
null
null
null
my_web_project/authentication/forms.py
AlexYankoff/my_web_project
d7d2c26289c561bc39d713ad5a1adff7a01b6508
[ "MIT" ]
null
null
null
from django import forms from django.contrib.auth import authenticate from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.core.exceptions import ValidationError from my_web_project.common.forms import BootstrapFormMixin from my_web_project.main.models import Student, Teacher class StudentForm(BootstrapFormMixin,forms.ModelForm): class Meta: model = Student # fields = '__all__' exclude = ('user','is_complete') class TeacherForm(BootstrapFormMixin,forms.ModelForm): class Meta: model = Teacher exclude = ('user', 'is_complete') class LoginForm(BootstrapFormMixin,forms.Form): user = None username = forms.CharField(max_length=30, ) password = forms.CharField( max_length=15, widget=forms.PasswordInput(), ) def clean(self): self.user = authenticate( username=self.cleaned_data['username'], password=self.cleaned_data['password'], ) if not self.user: raise ValidationError('Incorrect username and/or passworord ') def save(self): return self.user class MyUserCreationForm(BootstrapFormMixin,UserCreationForm): pass # class Meta: # model = User # fields = ("username","is_staff",)
25.132075
74
0.686186
143
1,332
6.286713
0.426573
0.055617
0.05673
0.070078
0.160178
0.102336
0
0
0
0
0
0.003861
0.222222
1,332
52
75
25.615385
0.8639
0.070571
0
0.121212
0
0
0.06737
0
0
0
0
0
0
1
0.060606
false
0.151515
0.212121
0.030303
0.575758
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
03b7252c4a570f5045354d6d3a9bb828ebea09f4
3,340
py
Python
source_code/ghc2018.py
nuno-chicoria/GHC_2018
d3a19c4f6293dd24ca06d24fdde58da04800781b
[ "Unlicense" ]
null
null
null
source_code/ghc2018.py
nuno-chicoria/GHC_2018
d3a19c4f6293dd24ca06d24fdde58da04800781b
[ "Unlicense" ]
null
null
null
source_code/ghc2018.py
nuno-chicoria/GHC_2018
d3a19c4f6293dd24ca06d24fdde58da04800781b
[ "Unlicense" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Mar 1 18:44:04 2018 @author: JavaWizards """ import numpy as np file = "/Users/nuno_chicoria/Downloads/b_should_be_easy.in" handle = open(file) R, C, F, N, B, T = handle.readline().split() rides = [] index = [] for i in range(int(N)): index.append(i) for line in handle: rides.append(line.split()) rides_np = np.asarray(rides) rides_np = np.column_stack([rides_np, index]) rides_np = rides_np.astype(np.int) rides_np = rides_np[rides_np[:,5].argsort()] vehicles = {} for i in range(int(F)): vehicles [i] = ["A", [0, 0], [0, 0], [0, 0], []] for i in range(int(T)): rides_np = rides_np[rides_np[:,5] > i] for item in range(len(vehicles)): if vehicles[item][0] == "A": if rides_np.size != 0: if abs(vehicles[item][1][0] - rides_np[0, 0]) + abs(vehicles[item][1][1] - rides_np[0, 1]) + i >= rides_np[0, 4]: if abs(vehicles[item][1][0] - rides_np[0, 0]) + abs(vehicles[item][1][1] - rides_np[0, 1]) + i + abs(rides_np[0,0] - rides_np[0,2]) + abs(rides_np[0,1] - rides_np[0,3]) <= rides_np[0, 5]: vehicles[item][0] = "C" vehicles[item][2] = [rides_np[0, 0], rides_np[0, 1]] vehicles[item][3] = [rides_np[0, 2], rides_np[0, 3]] vehicles[item][4].append(rides_np[0, 6]) rides_np = np.delete(rides_np, (0), axis=0) else: rides_np = np.delete(rides_np, (0), axis=0) for item in range(len(vehicles)): if vehicles[item][0] == "C": if vehicles[item][1][0] < vehicles[item][2][0]: vehicles[item][1][0] = vehicles[item][1][0] + 1 elif vehicles[item][1][0] > vehicles[item][2][0]: vehicles[item][1][0] = vehicles[item][1][0] - 1 elif vehicles[item][1][0] == vehicles[item][2][0]: if vehicles[item][1][1] < vehicles[item][2][1]: vehicles[item][1][1] = vehicles[item][1][1] + 1 elif vehicles[item][1][1] > vehicles[item][2][1]: vehicles[item][1][1] = vehicles[item][1][1] - 1 else: vehicles[item][0] = "D" for item in range(len(vehicles)): if vehicles[item][0] == "D": if vehicles[item][1][0] < vehicles[item][3][0]: vehicles[item][1][0] += 1 elif vehicles[item][1][0] > vehicles[item][3][0]: vehicles[item][1][0] -= 1 elif vehicles[item][1][0] == vehicles[item][3][0]: if vehicles[item][1][1] < vehicles[item][3][1]: vehicles[item][1][1] += 1 elif vehicles[item][1][1] > vehicles[item][3][1]: vehicles[item][1][1] -= 1 else: vehicles[item][0] = "A" vehicles[item][2] = None vehicles[item][3] = None results = open("ghc2018.txt", "w+") for item in range(len(vehicles)): if len(vehicles[item][4]) !=0: results.write(str(len(vehicles[item][4]))) for ride in vehicles[item][4]: results.write(" ") results.write(str(ride)) results.write("\n") results.close()
38.390805
208
0.498204
483
3,340
3.3706
0.167702
0.36855
0.207617
0.120393
0.590295
0.560811
0.560811
0.493857
0.4914
0.457002
0
0.0671
0.308383
3,340
86
209
38.837209
0.637662
0.03024
0
0.132353
0
0
0.022601
0.01548
0
0
0
0
0
1
0
false
0
0.014706
0
0.014706
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
03c7dfec4bf01608ff9510185092140717400a2f
170
py
Python
zinc/utils/validation.py
PressLabs/zinc
9e1dc852f31f9897e7759962cf0f3e6d42fbe637
[ "Apache-2.0" ]
29
2017-06-29T15:03:49.000Z
2018-01-30T14:07:26.000Z
zinc/utils/validation.py
presslabs/zinc
94146e5203fc93ee0e8bb011a4db0ffcd4b0096e
[ "Apache-2.0" ]
9
2019-01-11T09:07:17.000Z
2022-02-03T12:50:21.000Z
zinc/utils/validation.py
PressLabs/zinc
9e1dc852f31f9897e7759962cf0f3e6d42fbe637
[ "Apache-2.0" ]
1
2020-08-09T18:17:25.000Z
2020-08-09T18:17:25.000Z
import ipaddress def is_ipv6(ip_addr): try: ipaddress.IPv6Address(ip_addr) return True except ipaddress.AddressValueError: return False
17
39
0.676471
19
170
5.894737
0.736842
0.107143
0
0
0
0
0
0
0
0
0
0.016129
0.270588
170
9
40
18.888889
0.887097
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
false
0
0.142857
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
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
2
03cdffc4aa94129ab097ff69eb0662a8a2afab32
1,026
py
Python
013-Flareon 6 Reloadered/resolve.py
schommi/low-tech
8dc1c823204da9088ff696c5d23d5471eef317e1
[ "MIT" ]
null
null
null
013-Flareon 6 Reloadered/resolve.py
schommi/low-tech
8dc1c823204da9088ff696c5d23d5471eef317e1
[ "MIT" ]
null
null
null
013-Flareon 6 Reloadered/resolve.py
schommi/low-tech
8dc1c823204da9088ff696c5d23d5471eef317e1
[ "MIT" ]
null
null
null
import itertools secret = [ 0x7A, 0x17, 0x08, 0x34, 0x17, 0x31, 0x3B, 0x25, 0x5B, 0x18, 0x2E, 0x3A, 0x15, 0x56, 0x0E, 0x11, 0x3E, 0x0D, 0x11, 0x3B, 0x24, 0x21, 0x31, 0x06, 0x3C, 0x26, 0x7C, 0x3C, 0x0D, 0x24, 0x16, 0x3A, 0x14, 0x79, 0x01, 0x3A, 0x18, 0x5A, 0x58, 0x73, 0x2E, 0x09, 0x00, 0x16, 0x00, 0x49, 0x22, 0x01, 0x40, 0x08, 0x0A, 0x14 ] key = [0 for x in range(13)] def decrypt(): result = "" key_index = 0 for index in range(len(secret)): result += chr(key [key_index] ^ secret[index]) key_index = (key_index + 1) % len (key) return result key[0] = ord ("@") ^ secret[-13] key[1] = ord ("f") ^ secret[-12] key[2] = ord ("l") ^ secret[-11] key[3] = ord ("a") ^ secret[-10] key[4] = ord ("r") ^ secret[-9] key[5] = ord ("e") ^ secret[-8] key[6] = ord ("-") ^ secret[-7] key[7] = ord ("o") ^ secret[-6] key[8] = ord ("n") ^ secret[-5] key[9] = ord (".") ^ secret[-4] key[10] = ord ("c") ^ secret[-3] key[11] = ord ("o") ^ secret[-2] key[12] = ord ("m") ^ secret[-1] dbg = decrypt() print(dbg)
27.72973
97
0.567251
169
1,026
3.420118
0.455621
0.055363
0.044983
0
0
0
0
0
0
0
0
0.214634
0.20078
1,026
36
98
28.5
0.490244
0
0
0
0
0
0.012683
0
0
0
0.202927
0
0
1
0.034483
false
0
0.034483
0
0.103448
0.034483
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
03d0163037b3ffb3243f9f7b36c80a6e4a2647ef
1,098
py
Python
py/cidoc_crm_types/entities/e66_formation.py
minorg/cidoc-crm-types
9018bdbf0658e4d28a87bc94543e467be45d8aa5
[ "Apache-2.0" ]
null
null
null
py/cidoc_crm_types/entities/e66_formation.py
minorg/cidoc-crm-types
9018bdbf0658e4d28a87bc94543e467be45d8aa5
[ "Apache-2.0" ]
null
null
null
py/cidoc_crm_types/entities/e66_formation.py
minorg/cidoc-crm-types
9018bdbf0658e4d28a87bc94543e467be45d8aa5
[ "Apache-2.0" ]
null
null
null
from .e63_beginning_of_existence import E63BeginningofExistence from .e7_activity import E7Activity from dataclasses import dataclass @dataclass class E66Formation(E63BeginningofExistence, E7Activity): """ Scope note: This class comprises events that result in the formation of a formal or informal E74 Group of people, such as a club, society, association, corporation or nation. E66 Formation does not include the arbitrary aggregation of people who do not act as a collective. The formation of an instance of E74 Group does not require that the group is populated with members at the time of formation. In order to express the joining of members at the time of formation, the respective activity should be simultaneously an instance of both E66 Formation and E85 Joining. Examples: - the formation of the CIDOC CRM Special Interest Group - the formation of the Soviet Union (Pipes, 1964) - the conspiring of the murderers of Caesar (Irwin, 1935) In First Order Logic: E66(x) &#8835; E7(x) E66(x) &#8835; E63(x) """ TYPE_URI = "http://erlangen-crm.org/current/E66_Formation"
40.666667
393
0.784153
168
1,098
5.089286
0.547619
0.05614
0.065497
0.037427
0.063158
0.063158
0
0
0
0
0
0.050054
0.163024
1,098
26
394
42.230769
0.880305
0.740437
0
0
0
0
0.164835
0
0
0
0
0
0
1
0
false
0
0.5
0
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
03d052fd2d3ee2a1a9e3667dd101b990d188cf77
7,269
py
Python
platform/radio/efr32_multiphy_configurator/pro2_chip_configurator/src/si4440_modem_calc/pro2plusapilist.py
lmnotran/gecko_sdk
2e82050dc8823c9fe0e8908c1b2666fb83056230
[ "Zlib" ]
82
2016-06-29T17:24:43.000Z
2021-04-16T06:49:17.000Z
platform/radio/efr32_multiphy_configurator/pro2_chip_configurator/src/si4440_modem_calc/pro2plusapilist.py
lmnotran/gecko_sdk
2e82050dc8823c9fe0e8908c1b2666fb83056230
[ "Zlib" ]
6
2022-01-12T18:22:08.000Z
2022-03-25T10:19:27.000Z
platform/radio/efr32_multiphy_configurator/pro2_chip_configurator/src/si4440_modem_calc/pro2plusapilist.py
lmnotran/gecko_sdk
2e82050dc8823c9fe0e8908c1b2666fb83056230
[ "Zlib" ]
56
2016-08-02T10:50:50.000Z
2021-07-19T08:57:34.000Z
''' Created on Apr 4, 2013 @author: sesuskic ''' from .pro2apilist import Pro2ApiList from .trueround import trueround __all__ = ["Pro2PlusApiList"] class Pro2PlusApiList(Pro2ApiList): def _add_seq_cfg(self, modem_calc, api_list): # api_list['SEQ_CFG0'] = (modem_calc.modulator.fields.close_hw_dly_comp) # need API in FW pass def _add_modem_raw_search_api(self, modem_calc, api_list): sch_frzen = modem_calc.demodulator.fields.sch_frzen rawflt_sel = modem_calc.demodulator.fields.rawflt_sel schprd_h = modem_calc.demodulator.fields.schprd_h schprd_low = modem_calc.demodulator.fields.schprd_low api_list['MODEM_RAW_SEARCH2'] = sch_frzen * 2 ** 7 + rawflt_sel * 2**6 + schprd_h * 2 ** 3 + schprd_low def _add_chflt_rx_apis(self, modem_calc, api_list): super(Pro2PlusApiList, self)._add_chflt_rx_apis(modem_calc, api_list) spike_rm_en = modem_calc.demodulator.fields.spike_rm_en spike_det_thd = modem_calc.demodulator.fields.spike_det_thd api_list['MODEM_SPIKE_DET'] = int(trueround(spike_rm_en*2**7 + spike_det_thd)) & 0xff arriving_src = modem_calc.demodulator.fields.arriving_src signal_dsa_mode = modem_calc.demodulator.fields.signal_dsa_mode arr_rst_en = modem_calc.demodulator.fields.arr_rst_en est_osr_en = modem_calc.demodulator.fields.est_osr_en arr_toler = modem_calc.demodulator.fields.arr_toler api_list['MODEM_DSA_CTRL1'] = (arriving_src*2**6+signal_dsa_mode *2**5+arr_toler) & 0xff # jira-1652: put arr_q_sync_en back into rev-c2 arr_q_sync_en = modem_calc.demodulator.fields.arr_q_sync_en if modem_calc.revc0_c1: arr_q_pm_en = modem_calc.demodulator.fields.arr_q_pm_en skip_pm_det = modem_calc.demodulator.fields.skip_pm_det else: rx_pream_src = modem_calc.demodulator.fields.rx_pream_src bcr_sw_sycw = modem_calc.demodulator.fields.bcr_sw_sycw arrival_thd = modem_calc.demodulator.fields.arrival_thd if modem_calc.revc0_c1: api_list['MODEM_DSA_CTRL2'] = (arr_q_pm_en*2**7+arr_q_sync_en*2**6+bcr_sw_sycw*2**5+skip_pm_det*2**4+arrival_thd) & 0xff else: api_list['MODEM_DSA_CTRL2'] = (arr_q_sync_en*2**6 + bcr_sw_sycw*2**5 + arrival_thd) & 0xff api_list['MODEM_ONE_SHOT_AFC'] = ((modem_calc.demodulator.fields.oneshot_afc*2**7 + modem_calc.demodulator.fields.bcr_align_en*2**6 + modem_calc.demodulator.fields.est_osr_en*2**5 + modem_calc.demodulator.fields.afcma_en*2**4 + modem_calc.demodulator.fields.oneshot_waitcnt) & 0xff) api_list['MODEM_DSA_QUAL'] = (int(modem_calc.demodulator.fields.eye_qua_sel*2**7 + modem_calc.demodulator.fields.arr_eye_qual) & 0xff) api_list['MODEM_DSA_RSSI'] =(modem_calc.demodulator.fields.arr_squelch*2**7 + modem_calc.demodulator.fields.rssi_arr_thd) api_list['MODEM_DECIMATION_CFG2'] = ((modem_calc.demodulator.fields.ndec3*32 + modem_calc.demodulator.fields.ndec2gain*8 + modem_calc.demodulator.fields.ndec2agc*4) & 0xff) # jira-1651: set IFPKD-TH for ETSI modes if modem_calc.revc0_c1 == False: api_list['MODEM_IFPKD_THRESHOLDS'] = modem_calc.demodulator.fields.ifpkd_th; api_list['MODEM_RSSI_MUTE'] = (modem_calc.demodulator.fields.mute_rssi_sel*2**3 + modem_calc.demodulator.fields.mute_rssi_cnt) api_list['MODEM_DSA_MISC'] = (modem_calc.demodulator.fields.eyexest_en*2**6 + modem_calc.demodulator.fields.eyexest_fast*2**5 + modem_calc.demodulator.fields.low_duty) if modem_calc.revc0_c1 == False: api_list['PREAMBLE_CONFIG'] = rx_pream_src*2**7 + 0x21 # DSA RX hopping for super low data rate if(modem_calc.demodulator.fields.rx_hopping_en ==1): api_list['MODEM_DSM_CTRL'] = 0x13 api_list['RX_HOP_CONTROL'] = 0x10 api_list['RX_HOP_TABLE_SIZE'] = modem_calc.demodulator.fields.fh_ch_number+1 #'SET_PROPERTY' 'RX_HOP_TABLE_ENTRY_0' 05 table_entry = 0 while table_entry <= modem_calc.demodulator.fields.fh_ch_number: hop_table = "RX_HOP_TABLE_ENTRY_" + str(table_entry) api_list[hop_table] = table_entry table_entry = table_entry + 1 def _add_ook_blopk(self, modem_calc, api_list): api_list['MODEM_OOK_BLOPK'] = modem_calc.demodulator.fields.bw_peak def _add_rssi_group(self, modem_calc, api_list): # api_list['MODEM_RSSI_THRESH'] = 0 # default, not touched by calc api_list['MODEM_RSSI_JUMP_THRESH'] = modem_calc.demodulator.fields.rssijmpthd # self._api_list['MODEM_RSSI_CONTROL'] = 1 # default: latch at pmdet api_list['MODEM_RSSI_CONTROL'] = (modem_calc.demodulator.fields.rssi_sel*8 + 1) api_list['MODEM_RSSI_CONTROL2'] = (modem_calc.demodulator.fields.rssijmp_dwn*32 + modem_calc.demodulator.fields.rssijmp_up*16 + modem_calc.demodulator.fields.enrssijmp*8 + modem_calc.demodulator.fields.jmpdlylen*4 + modem_calc.demodulator.fields.enjmprx*2) def _add_modem_if_control(self, api_list, modem_calc): super(Pro2PlusApiList, self)._add_modem_if_control(api_list, modem_calc) api_list['MODEM_IF_CONTROL'] += int(modem_calc.inputs.API_ETSI % 3) # if 3, write 0 # jira 1658: add 3 fields into OOK_MISC def _add_modem_ook_misc(self, api_list, modem_calc): fast_ma = modem_calc.demodulator.fields.fast_ma detector = modem_calc.demodulator.fields.detector api_list['MODEM_OOK_MISC'] = int(fast_ma*128 + modem_calc.demodulator.fields.ook_limit_discharge*32 + modem_calc.demodulator.fields.ook_squelch_en*16 + modem_calc.demodulator.fields.ook_discharge_div*4 + detector) def _add_modem_bcr_misc0(self, api_list, modem_calc): if modem_calc.revc0_c1 == False: # only write BCR_MISC0 in revC2 # api_list['MODEM_BCR_MISC0'] = int(adcwatch*128 + adcrst*64 + distogg*32 + ph0size*16) # DSA_BCR_RST == diff0rst_en api_list['MODEM_BCR_MISC0'] = int( modem_calc.demodulator.fields.res_lockup_byp*8 + modem_calc.demodulator.fields.diff0rst_en) def __init__(self): super(Pro2PlusApiList, self).__init__()
57.23622
138
0.618104
932
7,269
4.412017
0.2103
0.15321
0.257782
0.335117
0.454523
0.191391
0.116488
0.041342
0.011187
0.011187
0
0.030757
0.2933
7,269
126
139
57.690476
0.76971
0.086945
0
0.076923
0
0
0.061687
0.009828
0
0
0.006048
0
0
1
0.098901
false
0.010989
0.021978
0
0.131868
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
03e1aa08a772e435ec4bfa6b688a45a8f113fb37
25,849
py
Python
lookerapi/models/query.py
jcarah/python_sdk
3bff34d04a828c940c3f93055e10b6a0095c2327
[ "MIT" ]
null
null
null
lookerapi/models/query.py
jcarah/python_sdk
3bff34d04a828c940c3f93055e10b6a0095c2327
[ "MIT" ]
null
null
null
lookerapi/models/query.py
jcarah/python_sdk
3bff34d04a828c940c3f93055e10b6a0095c2327
[ "MIT" ]
null
null
null
# coding: utf-8 """ Looker API 3.1 Reference ### Authorization The Looker API uses Looker **API3** credentials for authorization and access control. Looker admins can create API3 credentials on Looker's **Admin/Users** page. Pass API3 credentials to the **/login** endpoint to obtain a temporary access_token. Include that access_token in the Authorization header of Looker API requests. For details, see [Looker API Authorization](https://looker.com/docs/r/api/authorization) ### Client SDKs The Looker API is a RESTful system that should be usable by any programming language capable of making HTTPS requests. Client SDKs for a variety of programming languages can be generated from the Looker API's Swagger JSON metadata to streamline use of the Looker API in your applications. A client SDK for Ruby is available as an example. For more information, see [Looker API Client SDKs](https://looker.com/docs/r/api/client_sdks) ### Try It Out! The 'api-docs' page served by the Looker instance includes 'Try It Out!' buttons for each API method. After logging in with API3 credentials, you can use the \"Try It Out!\" buttons to call the API directly from the documentation page to interactively explore API features and responses. Note! With great power comes great responsibility: The \"Try It Out!\" button makes API calls to your live Looker instance. Be especially careful with destructive API operations such as `delete_user` or similar. There is no \"undo\" for API operations. ### Versioning Future releases of Looker will expand this API release-by-release to securely expose more and more of the core power of Looker to API client applications. API endpoints marked as \"beta\" may receive breaking changes without warning (but we will try to avoid doing that). Stable (non-beta) API endpoints should not receive breaking changes in future releases. For more information, see [Looker API Versioning](https://looker.com/docs/r/api/versioning) This **API 3.1** is in active development. This is where support for new Looker features will appear as non-breaking additions - new functions, new optional parameters on existing functions, or new optional properties in existing types. Additive changes should not impact your existing application code that calls the Looker API. Your existing application code will not be aware of any new Looker API functionality until you choose to upgrade your app to use a newer Looker API client SDK release. The following are a few examples of noteworthy items that have changed between API 3.0 and API 3.1. For more comprehensive coverage of API changes, please see the release notes for your Looker release. ### Examples of new things added in API 3.1: * Dashboard construction APIs * Themes and custom color collections APIs * Create and run SQL_runner queries * Create and run merged results queries * Create and modify dashboard filters * Create and modify password requirements ### Deprecated in API 3.0 The following functions and properties have been deprecated in API 3.0. They continue to exist and work in API 3.0 for the next several Looker releases but they have not been carried forward to API 3.1: * Dashboard Prefetch functions * User access_filter functions * User API 1.0 credentials functions * Space.is_root and Space.is_user_root properties. Use Space.is_shared_root and Space.is_users_root instead. ### Semantic changes in API 3.1: * `all_looks` no longer includes soft-deleted looks, matching `all_dashboards` behavior. You can find soft-deleted looks using `search_looks` with the `deleted` param set to True. * `all_spaces` no longer includes duplicate items * `search_users` no longer accepts Y,y,1,0,N,n for Boolean params, only \"true\" and \"false\". * For greater client and network compatibility, `render_task_results` now returns HTTP status ***202 Accepted*** instead of HTTP status ***102 Processing*** * `all_running_queries` and `kill_query` functions have moved into the `Query` function group. If you have application code which relies on the old behavior of the APIs above, you may continue using the API 3.0 functions in this Looker release. We strongly suggest you update your code to use API 3.1 analogs as soon as possible. OpenAPI spec version: 3.1.0 Contact: support@looker.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class Query(object): """ NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ def __init__(self, id=None, model=None, view=None, fields=None, pivots=None, fill_fields=None, filters=None, filter_expression=None, sorts=None, limit=None, column_limit=None, total=None, row_total=None, subtotals=None, runtime=None, vis_config=None, filter_config=None, visible_ui_sections=None, slug=None, dynamic_fields=None, client_id=None, share_url=None, expanded_share_url=None, url=None, query_timezone=None, has_table_calculations=None, can=None): """ Query - a model defined in Swagger :param dict swaggerTypes: The key is attribute name and the value is attribute type. :param dict attributeMap: The key is attribute name and the value is json key in definition. """ self.swagger_types = { 'id': 'int', 'model': 'str', 'view': 'str', 'fields': 'list[str]', 'pivots': 'list[str]', 'fill_fields': 'list[str]', 'filters': 'dict(str, str)', 'filter_expression': 'str', 'sorts': 'list[str]', 'limit': 'str', 'column_limit': 'str', 'total': 'bool', 'row_total': 'str', 'subtotals': 'list[str]', 'runtime': 'float', 'vis_config': 'dict(str, str)', 'filter_config': 'dict(str, str)', 'visible_ui_sections': 'str', 'slug': 'str', 'dynamic_fields': 'str', 'client_id': 'str', 'share_url': 'str', 'expanded_share_url': 'str', 'url': 'str', 'query_timezone': 'str', 'has_table_calculations': 'bool', 'can': 'dict(str, bool)' } self.attribute_map = { 'id': 'id', 'model': 'model', 'view': 'view', 'fields': 'fields', 'pivots': 'pivots', 'fill_fields': 'fill_fields', 'filters': 'filters', 'filter_expression': 'filter_expression', 'sorts': 'sorts', 'limit': 'limit', 'column_limit': 'column_limit', 'total': 'total', 'row_total': 'row_total', 'subtotals': 'subtotals', 'runtime': 'runtime', 'vis_config': 'vis_config', 'filter_config': 'filter_config', 'visible_ui_sections': 'visible_ui_sections', 'slug': 'slug', 'dynamic_fields': 'dynamic_fields', 'client_id': 'client_id', 'share_url': 'share_url', 'expanded_share_url': 'expanded_share_url', 'url': 'url', 'query_timezone': 'query_timezone', 'has_table_calculations': 'has_table_calculations', 'can': 'can' } self._id = id self._model = model self._view = view self._fields = fields self._pivots = pivots self._fill_fields = fill_fields self._filters = filters self._filter_expression = filter_expression self._sorts = sorts self._limit = limit self._column_limit = column_limit self._total = total self._row_total = row_total self._subtotals = subtotals self._runtime = runtime self._vis_config = vis_config self._filter_config = filter_config self._visible_ui_sections = visible_ui_sections self._slug = slug self._dynamic_fields = dynamic_fields self._client_id = client_id self._share_url = share_url self._expanded_share_url = expanded_share_url self._url = url self._query_timezone = query_timezone self._has_table_calculations = has_table_calculations self._can = can @property def id(self): """ Gets the id of this Query. Unique Id :return: The id of this Query. :rtype: int """ return self._id @id.setter def id(self, id): """ Sets the id of this Query. Unique Id :param id: The id of this Query. :type: int """ self._id = id @property def model(self): """ Gets the model of this Query. Model :return: The model of this Query. :rtype: str """ return self._model @model.setter def model(self, model): """ Sets the model of this Query. Model :param model: The model of this Query. :type: str """ if model is None: raise ValueError("Invalid value for `model`, must not be `None`") self._model = model @property def view(self): """ Gets the view of this Query. Explore Name :return: The view of this Query. :rtype: str """ return self._view @view.setter def view(self, view): """ Sets the view of this Query. Explore Name :param view: The view of this Query. :type: str """ if view is None: raise ValueError("Invalid value for `view`, must not be `None`") self._view = view @property def fields(self): """ Gets the fields of this Query. Fields :return: The fields of this Query. :rtype: list[str] """ return self._fields @fields.setter def fields(self, fields): """ Sets the fields of this Query. Fields :param fields: The fields of this Query. :type: list[str] """ self._fields = fields @property def pivots(self): """ Gets the pivots of this Query. Pivots :return: The pivots of this Query. :rtype: list[str] """ return self._pivots @pivots.setter def pivots(self, pivots): """ Sets the pivots of this Query. Pivots :param pivots: The pivots of this Query. :type: list[str] """ self._pivots = pivots @property def fill_fields(self): """ Gets the fill_fields of this Query. Fill Fields :return: The fill_fields of this Query. :rtype: list[str] """ return self._fill_fields @fill_fields.setter def fill_fields(self, fill_fields): """ Sets the fill_fields of this Query. Fill Fields :param fill_fields: The fill_fields of this Query. :type: list[str] """ self._fill_fields = fill_fields @property def filters(self): """ Gets the filters of this Query. Filters :return: The filters of this Query. :rtype: dict(str, str) """ return self._filters @filters.setter def filters(self, filters): """ Sets the filters of this Query. Filters :param filters: The filters of this Query. :type: dict(str, str) """ self._filters = filters @property def filter_expression(self): """ Gets the filter_expression of this Query. Filter Expression :return: The filter_expression of this Query. :rtype: str """ return self._filter_expression @filter_expression.setter def filter_expression(self, filter_expression): """ Sets the filter_expression of this Query. Filter Expression :param filter_expression: The filter_expression of this Query. :type: str """ self._filter_expression = filter_expression @property def sorts(self): """ Gets the sorts of this Query. Sorting for the query results. Use the format `[\"view.field\", ...]` to sort on fields in ascending order. Use the format `[\"view.field desc\", ...]` to sort on fields in descending order. Use `[\"__UNSORTED__\"]` (2 underscores before and after) to disable sorting entirely. Empty sorts `[]` will trigger a default sort. :return: The sorts of this Query. :rtype: list[str] """ return self._sorts @sorts.setter def sorts(self, sorts): """ Sets the sorts of this Query. Sorting for the query results. Use the format `[\"view.field\", ...]` to sort on fields in ascending order. Use the format `[\"view.field desc\", ...]` to sort on fields in descending order. Use `[\"__UNSORTED__\"]` (2 underscores before and after) to disable sorting entirely. Empty sorts `[]` will trigger a default sort. :param sorts: The sorts of this Query. :type: list[str] """ self._sorts = sorts @property def limit(self): """ Gets the limit of this Query. Limit :return: The limit of this Query. :rtype: str """ return self._limit @limit.setter def limit(self, limit): """ Sets the limit of this Query. Limit :param limit: The limit of this Query. :type: str """ self._limit = limit @property def column_limit(self): """ Gets the column_limit of this Query. Column Limit :return: The column_limit of this Query. :rtype: str """ return self._column_limit @column_limit.setter def column_limit(self, column_limit): """ Sets the column_limit of this Query. Column Limit :param column_limit: The column_limit of this Query. :type: str """ self._column_limit = column_limit @property def total(self): """ Gets the total of this Query. Total :return: The total of this Query. :rtype: bool """ return self._total @total.setter def total(self, total): """ Sets the total of this Query. Total :param total: The total of this Query. :type: bool """ self._total = total @property def row_total(self): """ Gets the row_total of this Query. Raw Total :return: The row_total of this Query. :rtype: str """ return self._row_total @row_total.setter def row_total(self, row_total): """ Sets the row_total of this Query. Raw Total :param row_total: The row_total of this Query. :type: str """ self._row_total = row_total @property def subtotals(self): """ Gets the subtotals of this Query. Fields on which to run subtotals :return: The subtotals of this Query. :rtype: list[str] """ return self._subtotals @subtotals.setter def subtotals(self, subtotals): """ Sets the subtotals of this Query. Fields on which to run subtotals :param subtotals: The subtotals of this Query. :type: list[str] """ self._subtotals = subtotals @property def runtime(self): """ Gets the runtime of this Query. Runtime :return: The runtime of this Query. :rtype: float """ return self._runtime @runtime.setter def runtime(self, runtime): """ Sets the runtime of this Query. Runtime :param runtime: The runtime of this Query. :type: float """ self._runtime = runtime @property def vis_config(self): """ Gets the vis_config of this Query. Visualization configuration properties. These properties are typically opaque and differ based on the type of visualization used. There is no specified set of allowed keys. The values can be any type supported by JSON. A \"type\" key with a string value is often present, and is used by Looker to determine which visualization to present. Visualizations ignore unknown vis_config properties. :return: The vis_config of this Query. :rtype: dict(str, str) """ return self._vis_config @vis_config.setter def vis_config(self, vis_config): """ Sets the vis_config of this Query. Visualization configuration properties. These properties are typically opaque and differ based on the type of visualization used. There is no specified set of allowed keys. The values can be any type supported by JSON. A \"type\" key with a string value is often present, and is used by Looker to determine which visualization to present. Visualizations ignore unknown vis_config properties. :param vis_config: The vis_config of this Query. :type: dict(str, str) """ self._vis_config = vis_config @property def filter_config(self): """ Gets the filter_config of this Query. The filter_config represents the state of the filter UI on the explore page for a given query. When running a query via the Looker UI, this parameter takes precedence over \"filters\". When creating a query or modifying an existing query, \"filter_config\" should be set to null. Setting it to any other value could cause unexpected filtering behavior. The format should be considered opaque. :return: The filter_config of this Query. :rtype: dict(str, str) """ return self._filter_config @filter_config.setter def filter_config(self, filter_config): """ Sets the filter_config of this Query. The filter_config represents the state of the filter UI on the explore page for a given query. When running a query via the Looker UI, this parameter takes precedence over \"filters\". When creating a query or modifying an existing query, \"filter_config\" should be set to null. Setting it to any other value could cause unexpected filtering behavior. The format should be considered opaque. :param filter_config: The filter_config of this Query. :type: dict(str, str) """ self._filter_config = filter_config @property def visible_ui_sections(self): """ Gets the visible_ui_sections of this Query. Visible UI Sections :return: The visible_ui_sections of this Query. :rtype: str """ return self._visible_ui_sections @visible_ui_sections.setter def visible_ui_sections(self, visible_ui_sections): """ Sets the visible_ui_sections of this Query. Visible UI Sections :param visible_ui_sections: The visible_ui_sections of this Query. :type: str """ self._visible_ui_sections = visible_ui_sections @property def slug(self): """ Gets the slug of this Query. Slug :return: The slug of this Query. :rtype: str """ return self._slug @slug.setter def slug(self, slug): """ Sets the slug of this Query. Slug :param slug: The slug of this Query. :type: str """ self._slug = slug @property def dynamic_fields(self): """ Gets the dynamic_fields of this Query. Dynamic Fields :return: The dynamic_fields of this Query. :rtype: str """ return self._dynamic_fields @dynamic_fields.setter def dynamic_fields(self, dynamic_fields): """ Sets the dynamic_fields of this Query. Dynamic Fields :param dynamic_fields: The dynamic_fields of this Query. :type: str """ self._dynamic_fields = dynamic_fields @property def client_id(self): """ Gets the client_id of this Query. Client Id: used to generate shortened explore URLs. If set by client, must be a unique 22 character alphanumeric string. Otherwise one will be generated. :return: The client_id of this Query. :rtype: str """ return self._client_id @client_id.setter def client_id(self, client_id): """ Sets the client_id of this Query. Client Id: used to generate shortened explore URLs. If set by client, must be a unique 22 character alphanumeric string. Otherwise one will be generated. :param client_id: The client_id of this Query. :type: str """ self._client_id = client_id @property def share_url(self): """ Gets the share_url of this Query. Share Url :return: The share_url of this Query. :rtype: str """ return self._share_url @share_url.setter def share_url(self, share_url): """ Sets the share_url of this Query. Share Url :param share_url: The share_url of this Query. :type: str """ self._share_url = share_url @property def expanded_share_url(self): """ Gets the expanded_share_url of this Query. Expanded Share Url :return: The expanded_share_url of this Query. :rtype: str """ return self._expanded_share_url @expanded_share_url.setter def expanded_share_url(self, expanded_share_url): """ Sets the expanded_share_url of this Query. Expanded Share Url :param expanded_share_url: The expanded_share_url of this Query. :type: str """ self._expanded_share_url = expanded_share_url @property def url(self): """ Gets the url of this Query. Expanded Url :return: The url of this Query. :rtype: str """ return self._url @url.setter def url(self, url): """ Sets the url of this Query. Expanded Url :param url: The url of this Query. :type: str """ self._url = url @property def query_timezone(self): """ Gets the query_timezone of this Query. Query Timezone :return: The query_timezone of this Query. :rtype: str """ return self._query_timezone @query_timezone.setter def query_timezone(self, query_timezone): """ Sets the query_timezone of this Query. Query Timezone :param query_timezone: The query_timezone of this Query. :type: str """ self._query_timezone = query_timezone @property def has_table_calculations(self): """ Gets the has_table_calculations of this Query. Has Table Calculations :return: The has_table_calculations of this Query. :rtype: bool """ return self._has_table_calculations @has_table_calculations.setter def has_table_calculations(self, has_table_calculations): """ Sets the has_table_calculations of this Query. Has Table Calculations :param has_table_calculations: The has_table_calculations of this Query. :type: bool """ self._has_table_calculations = has_table_calculations @property def can(self): """ Gets the can of this Query. Operations the current user is able to perform on this object :return: The can of this Query. :rtype: dict(str, bool) """ return self._can @can.setter def can(self, can): """ Sets the can of this Query. Operations the current user is able to perform on this object :param can: The can of this Query. :type: dict(str, bool) """ self._can = can def to_dict(self): """ Returns the model properties as a dict """ result = {} for attr, _ in iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value return result def to_str(self): """ Returns the string representation of the model """ return pformat(self.to_dict()) def __repr__(self): """ For `print` and `pprint` """ return self.to_str() def __eq__(self, other): """ Returns true if both objects are equal """ if not isinstance(other, Query): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """ Returns true if both objects are not equal """ return not self == other
32.392231
4,190
0.607954
3,253
25,849
4.694436
0.134952
0.042433
0.077795
0.028289
0.491651
0.415493
0.340777
0.263506
0.202213
0.180866
0
0.00286
0.310147
25,849
797
4,191
32.432873
0.853522
0.505668
0
0.29021
0
0
0.101532
0.006609
0
0
0
0
0
1
0.20979
false
0
0.01049
0
0.339161
0.003497
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
ff0002f28ad3a199bd96b680511c5012fe2c72ff
107
py
Python
src/filtermaker/__init__.py
yukihira1992/filtermaker
0fdd76771ea551ecdfe3328eadec32f59d0f5f8c
[ "MIT" ]
null
null
null
src/filtermaker/__init__.py
yukihira1992/filtermaker
0fdd76771ea551ecdfe3328eadec32f59d0f5f8c
[ "MIT" ]
null
null
null
src/filtermaker/__init__.py
yukihira1992/filtermaker
0fdd76771ea551ecdfe3328eadec32f59d0f5f8c
[ "MIT" ]
null
null
null
from .filters import TextFilter __version__ = '0.0.1' __all__ = ( '__version__', 'TextFilter', )
11.888889
31
0.64486
11
107
5.181818
0.727273
0
0
0
0
0
0
0
0
0
0
0.035714
0.214953
107
8
32
13.375
0.642857
0
0
0
0
0
0.242991
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ff06a4859edba98a7a88d5622aad9b23c4419609
12,017
py
Python
kafka_proto_api/protos/etf_http_ref_pb2.py
Ycallaer/kafka_proto_py
478f0ac7a95e4c14f4bb2f1deeef60df0c8aa133
[ "MIT" ]
1
2021-03-24T12:43:24.000Z
2021-03-24T12:43:24.000Z
kafka_proto_api/protos/etf_http_ref_pb2.py
Ycallaer/kafka_proto_py
478f0ac7a95e4c14f4bb2f1deeef60df0c8aa133
[ "MIT" ]
null
null
null
kafka_proto_api/protos/etf_http_ref_pb2.py
Ycallaer/kafka_proto_py
478f0ac7a95e4c14f4bb2f1deeef60df0c8aa133
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: etf_http_ref.proto """Generated protocol buffer code.""" from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='etf_http_ref.proto', package='', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x12\x65tf_http_ref.proto\x1a google/protobuf/descriptor.proto\"\xa5\x01\n\x0c\x65tf_http_ref\x12\x0c\n\x04\x64\x61te\x18\x01 \x01(\t\x12\x0c\n\x04open\x18\x02 \x01(\x01\x12\x0c\n\x04high\x18\x03 \x01(\x01\x12\x0b\n\x03low\x18\x04 \x01(\x01\x12\r\n\x05\x63lose\x18\x05 \x01(\x01\x12\x0e\n\x06volume\x18\x06 \x01(\x03\x12\x0f\n\x07openint\x18\x07 \x01(\x03:.\xd8\xed\x1a\x02\xe2\xed\x1a&https://en.wikipedia.org/wiki/ISO_8601*\xae\x01\n\nTermSource\x12\x1b\n\x17TERM_SOURCE_UNSPECIFIED\x10\x00\x12\x13\n\x0fTERM_SOURCE_ONE\x10\x01\x12\x14\n\x10TERM_SOURCE_FIBO\x10\x02\x12\x13\n\x0fTERM_SOURCE_ISO\x10\x03\x12\x18\n\x14TERM_SOURCE_ISO20022\x10\x04\x12\x13\n\x0fTERM_SOURCE_FIX\x10\x05\x12\x14\n\x10TERM_SOURCE_FPML\x10\x06:8\n\rcoding_scheme\x12\x1f.google.protobuf.MessageOptions\x18\xda\xad\x03 \x01(\t:C\n\x0bterm_source\x12\x1f.google.protobuf.MessageOptions\x18\xdb\xad\x03 \x01(\x0e\x32\x0b.TermSource::\n\x0fterm_source_ref\x12\x1f.google.protobuf.MessageOptions\x18\xdc\xad\x03 \x01(\t:8\n\rmsg_term_link\x12\x1f.google.protobuf.MessageOptions\x18\xdd\xad\x03 \x01(\t:6\n\ris_identifier\x12\x1d.google.protobuf.FieldOptions\x18\xc2\xb5\x03 \x01(\x08:8\n\x0f\x65xternal_schema\x12\x1d.google.protobuf.FieldOptions\x18\xc3\xb5\x03 \x01(\t:8\n\x0f\x66ield_term_link\x12\x1d.google.protobuf.FieldOptions\x18\xc4\xb5\x03 \x01(\tb\x06proto3' , dependencies=[google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) _TERMSOURCE = _descriptor.EnumDescriptor( name='TermSource', full_name='TermSource', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='TERM_SOURCE_UNSPECIFIED', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TERM_SOURCE_ONE', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TERM_SOURCE_FIBO', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TERM_SOURCE_ISO', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TERM_SOURCE_ISO20022', index=4, number=4, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TERM_SOURCE_FIX', index=5, number=5, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='TERM_SOURCE_FPML', index=6, number=6, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=225, serialized_end=399, ) _sym_db.RegisterEnumDescriptor(_TERMSOURCE) TermSource = enum_type_wrapper.EnumTypeWrapper(_TERMSOURCE) TERM_SOURCE_UNSPECIFIED = 0 TERM_SOURCE_ONE = 1 TERM_SOURCE_FIBO = 2 TERM_SOURCE_ISO = 3 TERM_SOURCE_ISO20022 = 4 TERM_SOURCE_FIX = 5 TERM_SOURCE_FPML = 6 CODING_SCHEME_FIELD_NUMBER = 55002 coding_scheme = _descriptor.FieldDescriptor( name='coding_scheme', full_name='coding_scheme', index=0, number=55002, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) TERM_SOURCE_FIELD_NUMBER = 55003 term_source = _descriptor.FieldDescriptor( name='term_source', full_name='term_source', index=1, number=55003, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) TERM_SOURCE_REF_FIELD_NUMBER = 55004 term_source_ref = _descriptor.FieldDescriptor( name='term_source_ref', full_name='term_source_ref', index=2, number=55004, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) MSG_TERM_LINK_FIELD_NUMBER = 55005 msg_term_link = _descriptor.FieldDescriptor( name='msg_term_link', full_name='msg_term_link', index=3, number=55005, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) IS_IDENTIFIER_FIELD_NUMBER = 56002 is_identifier = _descriptor.FieldDescriptor( name='is_identifier', full_name='is_identifier', index=4, number=56002, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) EXTERNAL_SCHEMA_FIELD_NUMBER = 56003 external_schema = _descriptor.FieldDescriptor( name='external_schema', full_name='external_schema', index=5, number=56003, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) FIELD_TERM_LINK_FIELD_NUMBER = 56004 field_term_link = _descriptor.FieldDescriptor( name='field_term_link', full_name='field_term_link', index=6, number=56004, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=True, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key) _ETF_HTTP_REF = _descriptor.Descriptor( name='etf_http_ref', full_name='etf_http_ref', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='date', full_name='etf_http_ref.date', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='open', full_name='etf_http_ref.open', index=1, number=2, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='high', full_name='etf_http_ref.high', index=2, number=3, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='low', full_name='etf_http_ref.low', index=3, number=4, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='close', full_name='etf_http_ref.close', index=4, number=5, type=1, cpp_type=5, label=1, has_default_value=False, default_value=float(0), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='volume', full_name='etf_http_ref.volume', index=5, number=6, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='openint', full_name='etf_http_ref.openint', index=6, number=7, type=3, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=b'\330\355\032\002\342\355\032&https://en.wikipedia.org/wiki/ISO_8601', is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=57, serialized_end=222, ) DESCRIPTOR.message_types_by_name['etf_http_ref'] = _ETF_HTTP_REF DESCRIPTOR.enum_types_by_name['TermSource'] = _TERMSOURCE DESCRIPTOR.extensions_by_name['coding_scheme'] = coding_scheme DESCRIPTOR.extensions_by_name['term_source'] = term_source DESCRIPTOR.extensions_by_name['term_source_ref'] = term_source_ref DESCRIPTOR.extensions_by_name['msg_term_link'] = msg_term_link DESCRIPTOR.extensions_by_name['is_identifier'] = is_identifier DESCRIPTOR.extensions_by_name['external_schema'] = external_schema DESCRIPTOR.extensions_by_name['field_term_link'] = field_term_link _sym_db.RegisterFileDescriptor(DESCRIPTOR) etf_http_ref = _reflection.GeneratedProtocolMessageType('etf_http_ref', (_message.Message,), { 'DESCRIPTOR' : _ETF_HTTP_REF, '__module__' : 'etf_http_ref_pb2' # @@protoc_insertion_point(class_scope:etf_http_ref) }) _sym_db.RegisterMessage(etf_http_ref) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(coding_scheme) term_source.enum_type = _TERMSOURCE google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(term_source) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(term_source_ref) google_dot_protobuf_dot_descriptor__pb2.MessageOptions.RegisterExtension(msg_term_link) google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(is_identifier) google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(external_schema) google_dot_protobuf_dot_descriptor__pb2.FieldOptions.RegisterExtension(field_term_link) _ETF_HTTP_REF._options = None # @@protoc_insertion_point(module_scope)
48.651822
1,362
0.785471
1,693
12,017
5.204962
0.125222
0.046301
0.077621
0.073536
0.610872
0.551294
0.514412
0.493305
0.462892
0.441557
0
0.046971
0.101772
12,017
246
1,363
48.849594
0.769409
0.021802
0
0.48
1
0.008889
0.182732
0.075272
0
0
0
0
0
1
0
false
0
0.026667
0
0.026667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ff1d37048cb854203f9a4fa6e024de7bc7ef651a
356
py
Python
exercicios-Python/desaf109/pythonteste.py
marcelo-py/Exercicios-Python
d654d54821983897dbc377a2d3db97671dd75b5b
[ "MIT" ]
null
null
null
exercicios-Python/desaf109/pythonteste.py
marcelo-py/Exercicios-Python
d654d54821983897dbc377a2d3db97671dd75b5b
[ "MIT" ]
null
null
null
exercicios-Python/desaf109/pythonteste.py
marcelo-py/Exercicios-Python
d654d54821983897dbc377a2d3db97671dd75b5b
[ "MIT" ]
null
null
null
from desaf109 import moeda p = float(input('Digite um preço: R$')) print('A metade de {} é {}'.format(moeda.moeda(p), moeda.metade(p, True))) print('O dobro de {} é {}'.format(moeda.moeda(p), moeda.dobro(p, True))) print('Se adcionarmos 10% fica {}'.format(moeda.aumentar(p, 10, True))) print('Se tirarmos 13% fica {}'.format(moeda.diminuir(p, 13, True)))
59.333333
74
0.671348
59
356
4.050847
0.474576
0.1841
0.075314
0.117155
0.209205
0.209205
0.209205
0
0
0
0
0.03481
0.11236
356
6
75
59.333333
0.721519
0
0
0
0
0
0.296919
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0.666667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
206c60f444384827b5b58347d59f704ffc3951d0
964
py
Python
src/malign/alignment.py
tresoldi/malign
dad7f2585db3b12f2edbf587f591463aed7c98f5
[ "MIT" ]
null
null
null
src/malign/alignment.py
tresoldi/malign
dad7f2585db3b12f2edbf587f591463aed7c98f5
[ "MIT" ]
1
2020-08-07T13:01:29.000Z
2020-08-07T13:01:29.000Z
src/malign/alignment.py
tresoldi/malign
dad7f2585db3b12f2edbf587f591463aed7c98f5
[ "MIT" ]
null
null
null
""" Module for the Alignment class. The `Alignment` class is a simple data class that holds aligned sequences and their score. It was originally a dictionary passed back and forth among functions, for which a data class is a good replacement. """ from dataclasses import dataclass from typing import Sequence, Hashable # TODO: write methods for comparison, based on score # TODO: add various checks post-initialization @dataclass class Alignment: seqs: Sequence[Hashable] score: float def __len__(self) -> int: """ Return the number of sequences in the alignment. @return: The number of sequences in the alignment. """ return len(self.seqs) def __getitem__(self, idx: int) -> Hashable: """ Return a sequence by its index. @param idx: The index of the sequence in the alignment. @return: The sequence at the requested index. """ return self.seqs[idx]
25.368421
77
0.678423
128
964
5.046875
0.5
0.092879
0.065015
0.092879
0.168731
0.133127
0.133127
0.133127
0.133127
0
0
0
0.253112
964
37
78
26.054054
0.897222
0.593361
0
0
0
0
0
0
0
0
0
0.027027
0
1
0.2
false
0
0.2
0
0.9
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
209687c99cd37798d8ff94e233db49d920a9fa57
14,653
py
Python
tests/test_record_parsing.py
jodal/python-netsgiro
b180ad3e6c8e4788c2dc539bdcd35b64b2bf6247
[ "Apache-2.0" ]
null
null
null
tests/test_record_parsing.py
jodal/python-netsgiro
b180ad3e6c8e4788c2dc539bdcd35b64b2bf6247
[ "Apache-2.0" ]
null
null
null
tests/test_record_parsing.py
jodal/python-netsgiro
b180ad3e6c8e4788c2dc539bdcd35b64b2bf6247
[ "Apache-2.0" ]
null
null
null
from datetime import date import pytest import netsgiro import netsgiro.records def test_transmission_start(): record = netsgiro.records.TransmissionStart.from_string( 'NY00001055555555100008100008080000000000' '0000000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.NONE assert record.RECORD_TYPE == netsgiro.RecordType.TRANSMISSION_START assert record.data_transmitter == '55555555' assert record.transmission_number == '1000081' assert record.data_recipient == '00008080' def test_transmission_start_fails_when_invalid_format(): line = 'XX' + ('0' * 78) with pytest.raises( ValueError, match='{!r} did not match TransmissionStart record format'.format(line), ): netsgiro.records.TransmissionStart.from_string(line) def test_transmission_end(): record = netsgiro.records.TransmissionEnd.from_string( 'NY00008900000006000000220000000000000060' '0170604000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.NONE assert record.RECORD_TYPE == netsgiro.RecordType.TRANSMISSION_END assert record.num_transactions == 6 assert record.num_records == 22 assert record.total_amount == 600 assert record.nets_date == date(2004, 6, 17) def test_assignment_start_for_avtalegiro_payment_requests(): record = netsgiro.records.AssignmentStart.from_string( 'NY21002000000000040000868888888888800000' '0000000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_START assert record.assignment_type == netsgiro.AssignmentType.TRANSACTIONS assert record.agreement_id == '000000000' assert record.assignment_number == '4000086' assert record.assignment_account == '88888888888' def test_assignment_start_for_avtalegiro_agreements(): record = netsgiro.records.AssignmentStart.from_string( 'NY21242000000000040000868888888888800000' '0000000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_START assert record.assignment_type == ( netsgiro.AssignmentType.AVTALEGIRO_AGREEMENTS ) assert record.agreement_id is None assert record.assignment_number == '4000086' assert record.assignment_account == '88888888888' def test_assignment_start_for_avtalegiro_cancellation(): record = netsgiro.records.AssignmentStart.from_string( 'NY21362000000000040000868888888888800000' '0000000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_START assert record.assignment_type == ( netsgiro.AssignmentType.AVTALEGIRO_CANCELLATIONS ) assert record.agreement_id is None assert record.assignment_number == '4000086' assert record.assignment_account == '88888888888' def test_assignment_start_for_ocr_giro_transactions(): record = netsgiro.records.AssignmentStart.from_string( 'NY09002000100856600000029999104276400000' '0000000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.OCR_GIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_START assert record.assignment_type == netsgiro.AssignmentType.TRANSACTIONS assert record.agreement_id == '001008566' assert record.assignment_number == '0000002' assert record.assignment_account == '99991042764' def test_assignment_end_for_avtalegiro_payment_requests(): record = netsgiro.records.AssignmentEnd.from_string( 'NY21008800000006000000200000000000000060' '0170604170604000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_END assert record.assignment_type == netsgiro.AssignmentType.TRANSACTIONS assert record.num_transactions == 6 assert record.num_records == 20 assert record.total_amount == 600 assert record.nets_date_earliest == date(2004, 6, 17) assert record.nets_date_latest == date(2004, 6, 17) def test_assignment_end_for_avtalegiro_agreements(): record = netsgiro.records.AssignmentEnd.from_string( 'NY21248800000006000000200000000000000000' '0000000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_END assert record.assignment_type == ( netsgiro.AssignmentType.AVTALEGIRO_AGREEMENTS ) assert record.num_transactions == 6 assert record.num_records == 20 assert record.total_amount is None assert record.nets_date_earliest is None assert record.nets_date_latest is None def test_assignment_end_for_avtalegiro_cancellations(): record = netsgiro.records.AssignmentEnd.from_string( 'NY21368800000006000000200000000000000060' '0170604170604000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_END assert record.assignment_type == ( netsgiro.AssignmentType.AVTALEGIRO_CANCELLATIONS ) assert record.num_transactions == 6 assert record.num_records == 20 assert record.total_amount == 600 assert record.nets_date_latest == date(2004, 6, 17) assert record.nets_date_earliest == date(2004, 6, 17) def test_assignment_end_for_ocr_giro_transactions(): record = netsgiro.records.AssignmentEnd.from_string( 'NY09008800000020000000420000000000514490' '0200192200192200192000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.OCR_GIRO assert record.RECORD_TYPE == netsgiro.RecordType.ASSIGNMENT_END assert record.assignment_type == netsgiro.AssignmentType.TRANSACTIONS assert record.num_transactions == 20 assert record.num_records == 42 assert record.total_amount == 5144900 assert record.nets_date == date(1992, 1, 20) assert record.nets_date_earliest == date(1992, 1, 20) assert record.nets_date_latest == date(1992, 1, 20) def test_transaction_amount_item_1_for_avtalegiro_payment_request(): record = netsgiro.records.TransactionAmountItem1.from_string( 'NY2121300000001170604 00000000' '000000100 008000011688373000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AMOUNT_ITEM_1 assert record.transaction_type == ( netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION ) assert record.transaction_number == 1 assert record.nets_date == date(2004, 6, 17) assert record.amount == 100 assert record.kid == '008000011688373' def test_transaction_amount_item_1_for_avtalegiro_cancellation(): record = netsgiro.records.TransactionAmountItem1.from_string( 'NY2193300000001170604 00000000' '000000100 008000011688373000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AMOUNT_ITEM_1 assert record.transaction_type == ( netsgiro.TransactionType.AVTALEGIRO_CANCELLATION ) assert record.transaction_number == 1 assert record.nets_date == date(2004, 6, 17) assert record.amount == 100 assert record.kid == '008000011688373' def test_transaction_amount_item_1_for_ocr_giro_transactions(): record = netsgiro.records.TransactionAmountItem1.from_string( 'NY09103000000012001921320101464000000000' '000102000 0000531000000' ) assert record.service_code == netsgiro.ServiceCode.OCR_GIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AMOUNT_ITEM_1 assert record.transaction_type == ( netsgiro.TransactionType.FROM_GIRO_DEBITED_ACCOUNT ) assert record.transaction_number == 1 assert record.nets_date == date(1992, 1, 20) assert record.centre_id == '13' assert record.day_code == 20 assert record.partial_settlement_number == 1 assert record.partial_settlement_serial_number == '01464' assert record.sign == '0' assert record.amount == 102000 assert record.kid == '0000531' def test_transaction_amount_item_2_for_avtalegiro_payment_request(): record = netsgiro.records.TransactionAmountItem2.from_string( 'NY2121310000001NAVN ' ' 00000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AMOUNT_ITEM_2 assert record.transaction_type == ( netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION ) assert record.transaction_number == 1 assert record.payer_name == 'NAVN' assert record.reference is None def test_transaction_amount_item_2_for_ocr_giro_transactions(): record = netsgiro.records.TransactionAmountItem2.from_string( 'NY09103100000019636827194099038562000000' '0160192999905123410000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.OCR_GIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AMOUNT_ITEM_2 assert record.transaction_type == ( netsgiro.TransactionType.FROM_GIRO_DEBITED_ACCOUNT ) assert record.transaction_number == 1 assert record.form_number == '9636827194' assert record.payer_name is None assert record.reference == '099038562' assert record.bank_date == date(1992, 1, 16) assert record.debit_account == '99990512341' def test_transaction_amount_item_2_for_ocr_giro_with_data_in_filler_field(): record = netsgiro.records.TransactionAmountItem2.from_string( 'NY09103100000029797596016097596016188320' '6160192999910055240000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.OCR_GIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AMOUNT_ITEM_2 assert record.transaction_type == ( netsgiro.TransactionType.FROM_GIRO_DEBITED_ACCOUNT ) assert record.transaction_number == 2 assert record.form_number == '9797596016' assert record.payer_name is None assert record.reference == '097596016' assert record.bank_date == date(1992, 1, 16) assert record.debit_account == '99991005524' assert record._filler == '1883206' def test_transaction_amount_item_3_for_ocr_giro_transactions(): record = netsgiro.records.TransactionAmountItem3.from_string( 'NY0921320000001Foo bar baz ' ' 0000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.OCR_GIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AMOUNT_ITEM_3 assert record.transaction_type == ( netsgiro.TransactionType.PURCHASE_WITH_TEXT ) assert record.transaction_number == 1 assert record.text == 'Foo bar baz' def test_transaction_specification_for_avtalegiro_payment_request(): record = netsgiro.records.TransactionSpecification.from_string( 'NY212149000000140011 Gjelder Faktura: 16' '8837 Dato: 19/03/0400000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_SPECIFICATION assert record.transaction_type == ( netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION ) assert record.transaction_number == 1 assert record.line_number == 1 assert record.column_number == 1 assert record.text == ' Gjelder Faktura: 168837 Dato: 19/03/04' def make_specification_records(num_lines, num_columns=2): return [ netsgiro.records.TransactionSpecification( service_code=netsgiro.ServiceCode.AVTALEGIRO, transaction_type=( netsgiro.TransactionType.AVTALEGIRO_WITH_BANK_NOTIFICATION ), transaction_number=1, line_number=line, column_number=column, text='Line {}, column {}'.format(line, column), ) for line in range(1, num_lines + 1) for column in range(1, num_columns + 1) ] def test_transaction_specification_to_text_with_max_number_of_records(): records = make_specification_records(42) result = netsgiro.records.TransactionSpecification.to_text(records) assert len(result.splitlines()) == 42 assert 'Line 1, column 1' in result assert 'Line 42, column 2' in result def test_transaction_specification_to_text_with_too_many_records(): records = make_specification_records(43) with pytest.raises( ValueError, match='Max 84 specification records allowed, got 86' ): netsgiro.records.TransactionSpecification.to_text(records) def test_avtalegiro_active_agreement(): record = netsgiro.records.AvtaleGiroAgreement.from_string( 'NY21947000000010 00800001168837' '3J00000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AGREEMENTS assert record.transaction_type == ( netsgiro.TransactionType.AVTALEGIRO_AGREEMENT ) assert record.transaction_number == 1 assert record.registration_type == ( netsgiro.AvtaleGiroRegistrationType.ACTIVE_AGREEMENT ) assert record.kid == '008000011688373' assert record.notify is True def test_avtalegiro_new_or_updated_agreement(): record = netsgiro.records.AvtaleGiroAgreement.from_string( 'NY21947000000011 00800001168837' '3N00000000000000000000000000000000000000' ) assert record.service_code == netsgiro.ServiceCode.AVTALEGIRO assert record.RECORD_TYPE == netsgiro.RecordType.TRANSACTION_AGREEMENTS assert record.transaction_type == ( netsgiro.TransactionType.AVTALEGIRO_AGREEMENT ) assert record.transaction_number == 1 assert record.registration_type == ( netsgiro.AvtaleGiroRegistrationType.NEW_OR_UPDATED_AGREEMENT ) assert record.kid == '008000011688373' assert record.notify is False
34.076744
80
0.743943
1,479
14,653
7.102772
0.140636
0.165635
0.037982
0.059971
0.752118
0.720609
0.640076
0.564588
0.548406
0.49643
0
0.151303
0.182693
14,653
429
81
34.156177
0.725868
0
0
0.460317
0
0
0.140449
0.083055
0
0
0
0
0.469841
1
0.07619
false
0
0.012698
0.003175
0.092063
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
2
209da4aca789fa213327efbbc4af529de39c5ec3
507
py
Python
pyexlatex/presentation/beamer/templates/control/tocsection.py
whoopnip/py-ex-latex
66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6
[ "MIT" ]
4
2020-06-08T07:17:12.000Z
2021-11-04T21:39:52.000Z
pyexlatex/presentation/beamer/templates/control/tocsection.py
nickderobertis/py-ex-latex
66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6
[ "MIT" ]
24
2020-02-17T17:20:44.000Z
2021-12-20T00:10:19.000Z
pyexlatex/presentation/beamer/templates/control/tocsection.py
nickderobertis/py-ex-latex
66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6
[ "MIT" ]
null
null
null
from pyexlatex.models.template import Template from pyexlatex.presentation import Frame from pyexlatex.presentation.beamer.control.atbeginsection import AtBeginSection from pyexlatex.models.toc import TableOfContents class TableOfContentsAtBeginSection(Template): def __init__(self): toc = TableOfContents(options=('currentsection',)) frame = Frame([toc], title='Table of Contents') at_begin = AtBeginSection(frame) self.contents = at_begin super().__init__()
33.8
79
0.751479
52
507
7.134615
0.5
0.140162
0.102426
0
0
0
0
0
0
0
0
0
0.163708
507
14
80
36.214286
0.875
0
0
0
0
0
0.061144
0
0
0
0
0
0
1
0.090909
false
0
0.363636
0
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
20a7c1efa318407820ebb42f64ba8d670b3812f6
1,800
py
Python
order/models.py
akashbindal91/django_ecommerce_practice
28b882efe384f8f5312e98cd06263f095756b3a9
[ "MIT" ]
null
null
null
order/models.py
akashbindal91/django_ecommerce_practice
28b882efe384f8f5312e98cd06263f095756b3a9
[ "MIT" ]
null
null
null
order/models.py
akashbindal91/django_ecommerce_practice
28b882efe384f8f5312e98cd06263f095756b3a9
[ "MIT" ]
null
null
null
from django.db import models # Create your models here. class Order(models.Model): """ docstring """ token = models.CharField(max_length=250, blank=True) total = models.DecimalField( verbose_name="GBP Order Total", max_digits=10, decimal_places=2) emailAddress = models.EmailField( verbose_name="Email Address", max_length=254, blank=True) created = models.DateTimeField(auto_now_add=True) billingName = models.CharField(max_length=250, blank=True) billingAddress1 = models.CharField(max_length=250, blank=True) billingCity = models.CharField(max_length=250, blank=True) billingPostCode = models.CharField(max_length=250, blank=True) billingCountry = models.CharField(max_length=250, blank=True) shippingName = models.CharField(max_length=250, blank=True) shippingAddress1 = models.CharField(max_length=250, blank=True) shippingCity = models.CharField(max_length=250, blank=True) shippingPostCode = models.CharField(max_length=250, blank=True) shippingCountry = models.CharField(max_length=250, blank=True) class Meta: """ docstring """ db_table = 'Order' ordering = ['-created'] def __str__(self): return str(self.id) class OrderItem(models.Model): """ docstring """ product = models.CharField(max_length=254) quantity = models.IntegerField() price = models.DecimalField( max_digits=10, decimal_places=2, verbose_name="GBP Order Total",) order = models.ForeignKey( Order, on_delete=models.CASCADE) class Meta: """ docstring """ db_table = 'OrderItem' def sub_total(self): return self.quantity * self.price def __str__(self): return self.product
30
73
0.675556
207
1,800
5.710145
0.323672
0.098985
0.182741
0.243655
0.460237
0.377327
0.335025
0
0
0
0
0.033263
0.215
1,800
59
74
30.508475
0.803255
0.036111
0
0.111111
0
0
0.039204
0
0
0
0
0
0
1
0.083333
false
0
0.027778
0.083333
0.805556
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
20aa667a3ce1f1ef065e0ad54f6366095acc219b
149
py
Python
program-4/4a)Extracting substring.py
sumukhmg/PYTHON-LAB-SET-PROGRAMS
685d11ae8dd6e4352f83288fff1e3922e84bf022
[ "MIT" ]
12
2022-02-19T14:03:41.000Z
2022-03-16T12:52:47.000Z
program-4/4a)Extracting substring.py
sumukhmg/PYTHON-LAB-SET-PROGRAMS
685d11ae8dd6e4352f83288fff1e3922e84bf022
[ "MIT" ]
1
2022-03-02T14:55:37.000Z
2022-03-02T14:55:37.000Z
program-4/4a)Extracting substring.py
sumukhmg/PYTHON-LAB-SET-PROGRAMS
685d11ae8dd6e4352f83288fff1e3922e84bf022
[ "MIT" ]
2
2022-03-02T14:36:14.000Z
2022-03-12T08:37:25.000Z
a = input("Enter the string:") b = a.find("@") c = a.find("#") print("The original string is:",a) print("The substring between @ and # is:",a[b+1:c])
29.8
51
0.604027
27
149
3.333333
0.555556
0.111111
0
0
0
0
0
0
0
0
0
0.007813
0.14094
149
5
51
29.8
0.695313
0
0
0
0
0
0.5
0
0
0
0
0
0
1
0
false
0
0
0
0
0.4
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
20bc2480212b49d6e810222a91c0c84532ff3e85
230
py
Python
scripts/read_value.py
jayantpatil/brownie-simple-storage
f501e94e88576a9a267ea451c046cedcb7100871
[ "MIT" ]
null
null
null
scripts/read_value.py
jayantpatil/brownie-simple-storage
f501e94e88576a9a267ea451c046cedcb7100871
[ "MIT" ]
null
null
null
scripts/read_value.py
jayantpatil/brownie-simple-storage
f501e94e88576a9a267ea451c046cedcb7100871
[ "MIT" ]
null
null
null
from brownie import accounts, config, SimpleStorage def read_contract(): # -1 index gets most recent transaction simple_storage = SimpleStorage[-1] print(simple_storage.retrieve()) def main(): read_contract()
19.166667
51
0.721739
27
230
6
0.740741
0.148148
0
0
0
0
0
0
0
0
0
0.010695
0.186957
230
11
52
20.909091
0.855615
0.16087
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.166667
0
0.5
0.166667
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
20ca2e167b593c60175aa9358fd246b00b8a7d20
382
py
Python
ebrains_drive/__init__.py
apdavison/ebrains-drive
8ff11fc60e77c1b605485f550efc350c1a5f443a
[ "Apache-2.0" ]
5
2020-12-20T16:12:18.000Z
2022-03-29T09:56:34.000Z
ebrains_drive/__init__.py
apdavison/ebrains-drive
8ff11fc60e77c1b605485f550efc350c1a5f443a
[ "Apache-2.0" ]
9
2020-09-25T08:27:41.000Z
2022-01-03T08:41:48.000Z
ebrains_drive/__init__.py
apdavison/ebrains-drive
8ff11fc60e77c1b605485f550efc350c1a5f443a
[ "Apache-2.0" ]
2
2020-09-18T17:32:38.000Z
2020-10-13T13:34:38.000Z
""" A Python package for working with the Human Brain Project Model Validation Framework. Andrew Davison and Shailesh Appukuttan, CNRS, 2017-2020 License: BSD 3-clause, see LICENSE.txt """ from ebrains_drive.client import DriveApiClient def connect(username=None, password=None, token=None, env=""): client = DriveApiClient(username, password, token, env) return client
27.285714
85
0.767016
51
382
5.72549
0.803922
0
0
0
0
0
0
0
0
0
0
0.027607
0.146597
382
14
86
27.285714
0.868098
0.47644
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0.5
0.25
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
20cc6c6f266cf22a4841a420e28fb03f3c12ecb1
1,290
py
Python
test/mock/mock_lens.py
AshKelly/PyAutoLens
043795966338a655339e61782253ad67cc3c14e6
[ "MIT" ]
null
null
null
test/mock/mock_lens.py
AshKelly/PyAutoLens
043795966338a655339e61782253ad67cc3c14e6
[ "MIT" ]
null
null
null
test/mock/mock_lens.py
AshKelly/PyAutoLens
043795966338a655339e61782253ad67cc3c14e6
[ "MIT" ]
null
null
null
from test.mock.mock_inversion import MockMapper from test.mock.mock_galaxy import MockHyperGalaxy class MockTracer(object): def __init__(self, unblurred_image_1d, blurring_image_1d, has_light_profile, has_pixelization, has_hyper_galaxy, has_grid_mappers=False): self.unblurred_image_1d = unblurred_image_1d self.blurring_image_1d = blurring_image_1d self.has_light_profile = has_light_profile self.has_pixelization = has_pixelization self.has_hyper_galaxy = has_hyper_galaxy self.has_grid_mappers = has_grid_mappers @property def all_planes(self): return [] @property def image_plane_image_1d(self): return self.unblurred_image_1d @property def image_plane_blurring_image_1d(self): return self.blurring_image_1d @property def image_plane_images_1d(self): return [self.unblurred_image_1d] @property def image_plane_blurring_images_1d(self): return [self.blurring_image_1d] @property def mappers_of_planes(self): return [MockMapper()] @property def regularization_of_planes(self): return [MockMapper()] @property def hyper_galaxies(self): return [MockHyperGalaxy(), MockHyperGalaxy()]
28.043478
116
0.713178
158
1,290
5.398734
0.221519
0.098476
0.10551
0.093787
0.42204
0.344666
0.332943
0.241501
0.241501
0.143025
0
0.013917
0.220155
1,290
46
117
28.043478
0.833996
0
0
0.285714
0
0
0
0
0
0
0
0
0
1
0.257143
false
0
0.057143
0.228571
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
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
20d0d67fe1712516c0256a25ca26beffb42631c7
187
py
Python
2-6 motto2.py
Holaplace/path_to_python
8fae2aca8d6da04c39a67514948fdf50e883750a
[ "MIT" ]
1
2019-02-06T01:49:18.000Z
2019-02-06T01:49:18.000Z
2-6 motto2.py
Holaplace/path_to_python
8fae2aca8d6da04c39a67514948fdf50e883750a
[ "MIT" ]
null
null
null
2-6 motto2.py
Holaplace/path_to_python
8fae2aca8d6da04c39a67514948fdf50e883750a
[ "MIT" ]
null
null
null
famous_name = "albert einstein" motto = "A person who never made a mistake never tried anything new." message = famous_name.title() + "once said, " + '"' + motto + '"' print(message)
37.4
70
0.673797
25
187
4.96
0.76
0.16129
0
0
0
0
0
0
0
0
0
0
0.187166
187
5
71
37.4
0.815789
0
0
0
0
0
0.472826
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
20df17921cd623c6203bd44e441ee7f224b6468c
2,273
py
Python
04_Data Manipulation with pandas/02_Aggregating Data/09_Multiple grouped summaries.py
mohd-faizy/DataScience-With-Python
13ebb10cf9083343056d5b782957241de1d595f9
[ "MIT" ]
5
2021-02-03T14:36:58.000Z
2022-01-01T10:29:26.000Z
04_Data Manipulation with pandas/02_Aggregating Data/09_Multiple grouped summaries.py
mohd-faizy/DataScience-With-Python
13ebb10cf9083343056d5b782957241de1d595f9
[ "MIT" ]
null
null
null
04_Data Manipulation with pandas/02_Aggregating Data/09_Multiple grouped summaries.py
mohd-faizy/DataScience-With-Python
13ebb10cf9083343056d5b782957241de1d595f9
[ "MIT" ]
3
2021-02-08T00:31:16.000Z
2022-03-17T13:52:32.000Z
''' 09 - Multiple grouped summaries Earlier in this chapter, you saw that the .agg() method is useful to compute multiple statistics on multiple variables. It also works with grouped data. NumPy, which is imported as np, has many different summary statistics functions, including: np.min, np.max, np.mean, and np.median. Instructions: - Import numpy with the alias np. - Get the min, max, mean, and median of weekly_sales for each store type using .groupby() and .agg(). Store this as sales_stats. Make sure to use numpy functions! - Get the min, max, mean, and median of unemployment and fuel_price_usd_per_l for each store type. Store this as unemp_fuel_stats. ----------------------------------------------------------------------------------------------------------------- sales.head() store type department date weekly_sales is_holiday temperature_c fuel_price_usd_per_l unemployment 0 1 A 1 2010-02-05 24924.50 False 5.728 0.679 8.106 1 1 A 1 2010-03-05 21827.90 False 8.056 0.693 8.106 2 1 A 1 2010-04-02 57258.43 False 16.817 0.718 7.808 3 1 A 1 2010-05-07 17413.94 False 22.528 0.749 7.808 4 1 A 1 2010-06-04 17558.09 False 27.050 0.715 7.808 ----------------------------------------------------------------------------------------------------------------- ''' # Import pandas and numpy import numpy as np import pandas as pd sales = pd.read_csv('content/wallmart_sales.csv') # Import numpy with the alias np import numpy as np # For each store type, aggregate weekly_sales: get min, max, mean, and median sales_stats = sales.groupby('type')['weekly_sales'].agg([np.min, np.max, np.mean, np.median]) # Print sales_stats print(sales_stats) # For each store type, aggregate unemployment and fuel_price_usd_per_l: get min, max, mean, and median unemp_fuel_stats = sales.groupby('type')[['fuel_price_usd_per_l', 'unemployment']].agg([np.min, np.max, np.mean, np.median]) # Print unemp_fuel_stats print(unemp_fuel_stats)
45.46
124
0.571051
322
2,273
3.919255
0.375776
0.027734
0.011886
0.027734
0.313788
0.274168
0.142631
0.093502
0.050713
0.050713
0
0.092207
0.260449
2,273
49
125
46.387755
0.658537
0.826221
0
0.25
0
0
0.204188
0.068063
0
0
0
0
0
1
0
false
0
0.375
0
0.375
0.25
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
20e33764352d730024b8287c9a46b924f5639e3d
342
py
Python
MatrixSqrt.py
aminya/smop
d1ef857dbae08ed071b54685c106d4b5b40747c3
[ "MIT" ]
null
null
null
MatrixSqrt.py
aminya/smop
d1ef857dbae08ed071b54685c106d4b5b40747c3
[ "MIT" ]
1
2019-10-16T03:45:08.000Z
2019-10-16T03:45:08.000Z
MatrixSqrt.py
aminya/smop-for-Julia-Matlab-Python-Benchmark
d1ef857dbae08ed071b54685c106d4b5b40747c3
[ "MIT" ]
null
null
null
# Generated with SMOP 0.41 from libsmop import * # MatrixSqrt.m @function def MatrixSqrt(matrixSize=None,mX=None,mY=None,*args,**kwargs): varargin = MatrixSqrt.varargin nargin = MatrixSqrt.nargin mY=dot(mX.T,mX) # MatrixSqrt.m:3 mA=sqrtm(mY) # MatrixSqrt.m:5 return mA if __name__ == '__main__': pass
18
63
0.660819
47
342
4.638298
0.659574
0.151376
0
0
0
0
0
0
0
0
0
0.018657
0.216374
342
19
64
18
0.794776
0.19883
0
0
1
0
0.02963
0
0
0
0
0
0
1
0.1
false
0.1
0.1
0
0.3
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
456204f6871f6eb8dedf973fadca394db0e5504c
87
py
Python
scripts/exercicios/ex025.py
RuanBarretodosSantos/python
4142ccd71c4ffb4bb6a10d61c85f612758f5bb41
[ "MIT" ]
null
null
null
scripts/exercicios/ex025.py
RuanBarretodosSantos/python
4142ccd71c4ffb4bb6a10d61c85f612758f5bb41
[ "MIT" ]
null
null
null
scripts/exercicios/ex025.py
RuanBarretodosSantos/python
4142ccd71c4ffb4bb6a10d61c85f612758f5bb41
[ "MIT" ]
null
null
null
nome = str(input('Digite seu nome: ')).strip() cap = nome.title() print('Silva' in cap)
29
46
0.655172
14
87
4.071429
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.126437
87
3
47
29
0.75
0
0
0
0
0
0.25
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
457331800134bf6e126c42a54f07847df0aef032
179
py
Python
where my anagrams at.py
faaiqbilal/codewars-code
decc7001134234f7ec9ffa74653e2dca5fa40ef6
[ "MIT" ]
null
null
null
where my anagrams at.py
faaiqbilal/codewars-code
decc7001134234f7ec9ffa74653e2dca5fa40ef6
[ "MIT" ]
null
null
null
where my anagrams at.py
faaiqbilal/codewars-code
decc7001134234f7ec9ffa74653e2dca5fa40ef6
[ "MIT" ]
null
null
null
def anagrams(word, words): agrams = [] s1 = sorted(word) for i in range (0, len(words)): s2 = sorted(words[i]) if s1 == s2: agrams.append(words[i]) return agrams
22.375
33
0.603352
28
179
3.857143
0.607143
0.111111
0
0
0
0
0
0
0
0
0
0.036496
0.234637
179
8
34
22.375
0.751825
0
0
0
0
0
0
0
0
0
0
0
0
1
0.125
false
0
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
0
0
0
0
0
0
0
0
2
45770058508f21a3a4be648d911aa80a191fe520
5,858
py
Python
utils/ErrorMetrics.py
caozidong/Depth-Completion
a4d95cd33f29c5c8610fc8f40dd3b1fc81186143
[ "Apache-2.0" ]
5
2021-01-19T13:59:14.000Z
2021-12-01T12:09:01.000Z
utils/ErrorMetrics.py
caozidong/Depth-Completion
a4d95cd33f29c5c8610fc8f40dd3b1fc81186143
[ "Apache-2.0" ]
null
null
null
utils/ErrorMetrics.py
caozidong/Depth-Completion
a4d95cd33f29c5c8610fc8f40dd3b1fc81186143
[ "Apache-2.0" ]
null
null
null
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np class MAE(nn.Module): def __init__(self): super(MAE, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float().cuda() err = torch.abs(target * val_pixels - outputs * val_pixels) loss = torch.sum(err.view(err.size(0), 1, -1), -1, keepdim=True) cnt = torch.sum(val_pixels.view(val_pixels.size(0), 1, -1), -1, keepdim=True) return torch.mean(loss / cnt) class RMSE(nn.Module): def __init__(self): super(RMSE, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float().cuda() err = (target * val_pixels - outputs * val_pixels) ** 2 loss = torch.sum(err.view(err.size(0), 1, -1), -1, keepdim=True) cnt = torch.sum(val_pixels.view(val_pixels.size(0), 1, -1), -1, keepdim=True) return torch.mean(torch.sqrt(loss / cnt)) class Deltas(nn.Module): def __init__(self): super(Deltas, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float().cuda() rel = torch.max((target * val_pixels) / (outputs * val_pixels + 1e-3), (outputs * val_pixels) / (target * val_pixels)) cnt = torch.sum(val_pixels.view(val_pixels.size(0), 1, -1), -1, keepdim=True) def del_i(i): r = (rel < 1.01 ** i).float() delta = torch.sum(r.view(r.size(0), 1, -1), -1, keepdim=True) / cnt return torch.mean(delta) return del_i(1), del_i(2), del_i(3) class Huber(nn.Module): def __init__(self): super(Huber, self).__init__() def forward(self, outputs, target, delta=5): l1_loss = F.l1_loss(outputs, target, reduce=False) mse_loss = F.mse_loss(outputs, target, reduce=False) mask = (l1_loss < delta).float() loss = (0.5 * mse_loss) * mask + delta * (l1_loss - 0.5 * delta) * (1 - mask) return torch.mean(loss) class EPE_metric(nn.Module): def __init__(self): super(EPE_metric, self).__init__() def forward(self, outputs, target): mask = (target > 0) outputs, target = outputs[mask], target[mask] err = torch.abs(target - outputs) loss = torch.mean(err) return loss class D1_metric(nn.Module): def __init__(self): super(D1_metric, self).__init__() def forward(self, outputs, target): mask = (target > 0) outputs, target = outputs[mask], target[mask] E = torch.abs(outputs - target) # err_mask = (E > 3) & (E / target.abs() > 0.05) err_mask = (E > 3) return torch.mean(err_mask.float()) class Thres_metric(nn.Module): def __init__(self): super(Thres_metric, self).__init__() def forward(self, outputs, target): mask_tar = (target > 0) mask_out = (outputs > 0) mask = mask_tar * mask_out # mask = (target > 0) thres = 3 assert isinstance(thres, (int, float)) outputs, target = outputs[mask], target[mask] E = torch.abs(target - outputs) err_mask = (E > thres) return torch.mean(err_mask.float()) class Deltas_Paint(nn.Module): def __init__(self): super(Deltas_Paint, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float().cuda() rel = torch.max((target * val_pixels) / (outputs * val_pixels + 1e-3), (outputs * val_pixels) / (target * val_pixels)) cnt = torch.sum(val_pixels.view(val_pixels.size(0), 1, -1), -1, keepdim=True) def del_i(i): r = (rel < 1.25 ** i).float() delta = torch.sum(r.view(r.size(0), 1, -1), -1, keepdim=True) / cnt return torch.mean(delta) def del_j(i): r = (rel < i).float() delta = torch.sum(r.view(r.size(0), 1, -1), -1, keepdim=True) / cnt return torch.mean(delta) return del_j(1.05), del_j(1.10), del_i(1), del_i(2), del_i(3), cnt class SSIM_Metric(nn.Module): def __init__(self): super(SSIM_Metric, self).__init__() def forward(self, x, y): C1 = 0.01 ** 2 C2 = 0.03 ** 2 mu_x = F.avg_pool2d(x, 3, 1, 1) mu_y = F.avg_pool2d(y, 3, 1, 1) sigma_x = F.avg_pool2d(x ** 2, 3, 1, 1) - mu_x ** 2 sigma_y = F.avg_pool2d(y ** 2, 3, 1, 1) - mu_y ** 2 sigma_xy = F.avg_pool2d(x * y, 3, 1, 1) - mu_x * mu_y SSIM_n = (2 * mu_x * mu_y + C1) * (2 * sigma_xy + C2) SSIM_d = (mu_x ** 2 + mu_y ** 2 + C1) * (sigma_x + sigma_y + C2) SSIM = SSIM_n / SSIM_d # return torch.clamp((1 - SSIM) / 2, 0, 1) return SSIM.mean(), torch.tensor([torch.numel(x)]) class MAE_Paint(nn.Module): def __init__(self): super(MAE_Paint, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float().cuda() err = torch.abs(target * val_pixels - outputs * val_pixels) loss = torch.sum(err.view(err.size(0), 1, -1), -1, keepdim=True) cnt = torch.sum(val_pixels.view(val_pixels.size(0), 1, -1), -1, keepdim=True) return torch.mean(loss / torch.numel(outputs)), torch.tensor([torch.numel(outputs)]) class RMSE_Paint(nn.Module): def __init__(self): super(RMSE_Paint, self).__init__() def forward(self, outputs, target, *args): val_pixels = (target > 0).float().cuda() err = (target * val_pixels - outputs * val_pixels) ** 2 loss = torch.sum(err.view(err.size(0), 1, -1), -1, keepdim=True) cnt = torch.sum(val_pixels.view(val_pixels.size(0), 1, -1), -1, keepdim=True) return (loss / torch.numel(outputs)), torch.tensor([torch.numel(outputs)])
35.50303
92
0.575111
857
5,858
3.711785
0.101517
0.096196
0.024521
0.028607
0.773342
0.732788
0.716441
0.589437
0.589437
0.520905
0
0.0351
0.26562
5,858
165
93
35.50303
0.704324
0.018266
0
0.472
0
0
0
0
0
0
0
0
0.008
1
0.2
false
0
0.032
0
0.432
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
457a13fcc5619e763cff2978c285e3ac7191dd4c
349
py
Python
easy/count-as-i-count/main.py
khanh-alice/codingame-python
3d84361db2e3371104db8d9befcf4dbb47f6ac6e
[ "Apache-2.0" ]
null
null
null
easy/count-as-i-count/main.py
khanh-alice/codingame-python
3d84361db2e3371104db8d9befcf4dbb47f6ac6e
[ "Apache-2.0" ]
null
null
null
easy/count-as-i-count/main.py
khanh-alice/codingame-python
3d84361db2e3371104db8d9befcf4dbb47f6ac6e
[ "Apache-2.0" ]
null
null
null
initialScore = int(input()) def count_solutions(score, turn): if score > 50 or turn > 4: return 0 if score == 50: return 1 result = count_solutions(score + 1, turn + 1) for i in range(2, 13): result += 2 * count_solutions(score + i, turn + 1) return result print(count_solutions(initialScore, 0))
17.45
58
0.601719
49
349
4.204082
0.469388
0.271845
0.276699
0
0
0
0
0
0
0
0
0.060484
0.289398
349
19
59
18.368421
0.770161
0
0
0
0
0
0
0
0
0
0
0
0
1
0.090909
false
0
0
0
0.363636
0.090909
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
457d8ed76184da607ae120220f6d3c830a2b03ff
399
py
Python
kafka_streamer/topic/datatype/base.py
sam-mosleh/kafka-streamer
be977af192b33a335b42af0a42ad05d9f3f9fef4
[ "BSD-3-Clause" ]
1
2020-06-26T00:10:05.000Z
2020-06-26T00:10:05.000Z
kafka_streamer/topic/datatype/base.py
sam-mosleh/kafka-streamer
be977af192b33a335b42af0a42ad05d9f3f9fef4
[ "BSD-3-Clause" ]
null
null
null
kafka_streamer/topic/datatype/base.py
sam-mosleh/kafka-streamer
be977af192b33a335b42af0a42ad05d9f3f9fef4
[ "BSD-3-Clause" ]
null
null
null
from abc import ABC, abstractmethod from typing import Type, Union from kafka_streamer.models import SchematicRecord, Serializable class KafkaDataType(ABC): _MAGIC_BYTE = 0 @abstractmethod def deserialize(self, data: bytes): pass @abstractmethod def serialize( self, data: Union[SchematicRecord, Type[Serializable], bytes, None] ) -> bytes: pass
21
75
0.696742
43
399
6.395349
0.581395
0.123636
0
0
0
0
0
0
0
0
0
0.003257
0.230576
399
18
76
22.166667
0.892508
0
0
0.307692
0
0
0
0
0
0
0
0
0
1
0.153846
false
0.153846
0.230769
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
459f5157ab1931fdcbdbea8249e936a2e4eee079
332
py
Python
_fred-v1/fred/endpoints/shutdown.py
elviva404/frontend-regression-validator
21df2a127712bdf0688dc9aedf478c6a2a90a3c3
[ "ECL-2.0", "Apache-2.0" ]
70
2019-09-16T13:30:49.000Z
2022-02-25T17:46:23.000Z
_fred-v1/fred/endpoints/shutdown.py
elviva404/frontend-regression-validator
21df2a127712bdf0688dc9aedf478c6a2a90a3c3
[ "ECL-2.0", "Apache-2.0" ]
2
2020-01-13T09:15:47.000Z
2020-07-29T11:49:25.000Z
_fred-v1/fred/endpoints/shutdown.py
elviva404/frontend-regression-validator
21df2a127712bdf0688dc9aedf478c6a2a90a3c3
[ "ECL-2.0", "Apache-2.0" ]
10
2019-10-06T08:22:05.000Z
2022-02-03T18:45:08.000Z
from flask_restful import Resource from flask import request class Shutdown(Resource): def get(self): shutdown = request.environ.get('werkzeug.server.shutdown') if shutdown is None: raise RuntimeError('Not running with the Werkzeug Server') shutdown() return 'Server shutting down'
27.666667
70
0.683735
39
332
5.794872
0.666667
0.079646
0.19469
0
0
0
0
0
0
0
0
0
0.243976
332
11
71
30.181818
0.900398
0
0
0
0
0
0.240964
0.072289
0
0
0
0
0
1
0.111111
false
0
0.222222
0
0.555556
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
45cd6b7941697c04db1bb1d94a1276f8ec7934e6
177
py
Python
tests/__init__.py
obytes/tap-python
bc119cb785dc353f0c67241a64d9fcb30f21fbf7
[ "MIT" ]
3
2019-05-28T16:19:57.000Z
2022-03-05T13:16:43.000Z
tests/__init__.py
obytes/tap-python
bc119cb785dc353f0c67241a64d9fcb30f21fbf7
[ "MIT" ]
2
2019-07-02T21:45:09.000Z
2019-07-03T13:55:54.000Z
tests/__init__.py
obytes/tap-python
bc119cb785dc353f0c67241a64d9fcb30f21fbf7
[ "MIT" ]
null
null
null
import vcr tap_vcr = vcr.VCR( serializer='yaml', cassette_library_dir='tests/fixtures/vcr_cassettes', record_mode='new_episodes', match_on=['uri', 'method'], )
19.666667
56
0.689266
23
177
5
0.826087
0.104348
0
0
0
0
0
0
0
0
0
0
0.158192
177
8
57
22.125
0.771812
0
0
0
0
0
0.299435
0.158192
0
0
0
0
0
1
0
false
0
0.142857
0
0.142857
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
45e49b8126b2a37679ad85ae284597124464cca3
465
py
Python
netmiko/ciena/ciena_saos_ssh.py
mostau1/netmiko
5b5463fb01e39e771be553281748477a48c7391c
[ "MIT" ]
null
null
null
netmiko/ciena/ciena_saos_ssh.py
mostau1/netmiko
5b5463fb01e39e771be553281748477a48c7391c
[ "MIT" ]
8
2020-02-05T14:17:32.000Z
2021-09-23T23:27:46.000Z
netmiko/ciena/ciena_saos_ssh.py
mostau1/netmiko
5b5463fb01e39e771be553281748477a48c7391c
[ "MIT" ]
null
null
null
"""Ciena SAOS support.""" from __future__ import print_function from __future__ import unicode_literals from netmiko.cisco_base_connection import CiscoSSHConnection class CienaSaosSSH(CiscoSSHConnection): """Ciena SAOS support.""" def session_preparation(self): self._test_channel_read() self.set_base_prompt() self.disable_paging(command="system shell session set more off\n") def enable(self, *args, **kwargs): pass
29.0625
74
0.733333
55
465
5.854545
0.690909
0.055901
0.099379
0
0
0
0
0
0
0
0
0
0.176344
465
15
75
31
0.840731
0.083871
0
0
0
0
0.084337
0
0
0
0
0
0
1
0.2
false
0.1
0.3
0
0.6
0.1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
afe94ca2d45bfd979c9c6fa0ac9fdd90eb8ec0aa
1,647
py
Python
authors/apps/articles/views/article_favourite_view.py
AmosWels/ah-django
5b8e39053d63f1dfb3c14066b163a1d37af91076
[ "BSD-3-Clause" ]
null
null
null
authors/apps/articles/views/article_favourite_view.py
AmosWels/ah-django
5b8e39053d63f1dfb3c14066b163a1d37af91076
[ "BSD-3-Clause" ]
null
null
null
authors/apps/articles/views/article_favourite_view.py
AmosWels/ah-django
5b8e39053d63f1dfb3c14066b163a1d37af91076
[ "BSD-3-Clause" ]
null
null
null
from django.http import Http404 from django.core import exceptions from rest_framework import status from rest_framework.generics import RetrieveUpdateAPIView from rest_framework.permissions import ( IsAuthenticatedOrReadOnly, IsAuthenticated ) from rest_framework.response import Response from rest_framework.views import APIView from ..models import Article from ..renderers import ArticleJSONRenderer from ..serializers import ( ArticleSerializer ) from ..exceptions import ArticleDoesNotExist from django.db.models import Avg from django.shortcuts import render, get_object_or_404 class ArticleFavouriteAPIView(APIView): permission_classes = (IsAuthenticated,) renderer_classes = (ArticleJSONRenderer,) serializer_class = ArticleSerializer def post(self, request, slug): profile = request.user.profile serializer_context = {'request': request} article = self.get_article(slug) profile.favourite(article) serializer = self.serializer_class(article, context=serializer_context) return Response(serializer.data, status=status.HTTP_201_CREATED) def delete(self, request, slug): profile = request.user.profile serializer_context = {'request': request} article = self.get_article(slug) profile.unfavourite(article) serializer = self.serializer_class(article, context=serializer_context) return Response(serializer.data, status=status.HTTP_200_OK) def get_article(self, slug): try: return Article.objects.get(slug=slug) except Article.DoesNotExist: raise Http404
29.410714
79
0.743169
176
1,647
6.818182
0.346591
0.033333
0.070833
0.036667
0.356667
0.356667
0.356667
0.356667
0.356667
0.356667
0
0.011219
0.188221
1,647
55
80
29.945455
0.886313
0
0
0.2
0
0
0.0085
0
0
0
0
0
0
1
0.075
false
0
0.325
0
0.575
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
b30c782f3342ff4875fb902c643ddb150ecbbb77
1,106
py
Python
bot/migrators/config_migrator.py
yukie-nobuharu/TTMediaBot
9d34aadb1cfa41fcceee212931ff12526d3d137f
[ "MIT" ]
null
null
null
bot/migrators/config_migrator.py
yukie-nobuharu/TTMediaBot
9d34aadb1cfa41fcceee212931ff12526d3d137f
[ "MIT" ]
null
null
null
bot/migrators/config_migrator.py
yukie-nobuharu/TTMediaBot
9d34aadb1cfa41fcceee212931ff12526d3d137f
[ "MIT" ]
null
null
null
import sys from bot.config import ConfigManager, config_data_type def to_v1(config_data: config_data_type) -> config_data_type: return update_version(config_data, 1) migrate_functs = {1: to_v1} def migrate( config_manager: ConfigManager, config_data: config_data_type, ) -> config_data_type: if "config_version" not in config_data: update_version(config_data, 0) elif ( not isinstance(config_data["config_version"], int) or config_data["config_version"] > config_manager.version ): sys.exit("Error: invalid config_version value") elif config_data["config_version"] == config_manager.version: return config_data else: for ver in migrate_functs: if ver > config_data["config_version"]: config_data = migrate_functs[ver](config_data) config_manager._dump(config_data) return config_data def update_version(config_data: config_data_type, version: int) -> config_data_type: _config_data = {"config_version": version} _config_data.update(config_data) return _config_data
29.105263
84
0.712477
144
1,106
5.083333
0.236111
0.355191
0.196721
0.157104
0.397541
0.221311
0.221311
0.103825
0
0
0
0.005675
0.203436
1,106
37
85
29.891892
0.825199
0
0
0.071429
0
0
0.107595
0
0
0
0
0
0
1
0.107143
false
0
0.071429
0.035714
0.321429
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b312fd40137f1f88994faa7dd28816b492eac96b
18,544
py
Python
ocrj/misc/nihongo.py
eggplants/OCR_Japanease
15ed5df66a66047fa877ded2e935f7b2fb006c2b
[ "MIT" ]
2
2021-08-08T07:14:36.000Z
2021-08-08T07:25:43.000Z
ocrj/misc/nihongo.py
eggplants/ocrj
15ed5df66a66047fa877ded2e935f7b2fb006c2b
[ "MIT" ]
null
null
null
ocrj/misc/nihongo.py
eggplants/ocrj
15ed5df66a66047fa877ded2e935f7b2fb006c2b
[ "MIT" ]
null
null
null
import string hiragana = \ ['あ', 'い', 'う', 'え', 'お', 'か', 'き', 'く', 'け', 'こ', 'さ', 'し', 'す', 'せ', 'そ', 'た', 'ち', 'つ', 'て', 'と', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ひ', 'ふ', 'へ', 'ほ', 'ま', 'み', 'む', 'め', 'も', 'ら', 'り', 'る', 'れ', 'ろ', 'が', 'ぎ', 'ぐ', 'げ', 'ご', 'ざ', 'じ', 'ず', 'ぜ', 'ぞ', 'だ', 'ぢ', 'づ', 'で', 'ど', 'ば', 'び', 'ぶ', 'べ', 'ぼ', 'ぱ', 'ぴ', 'ぷ', 'ぺ', 'ぽ', 'や', 'ゆ', 'よ', 'わ', 'を', 'ん'] katakana = \ ['ア', 'イ', 'ウ', 'エ', 'オ', 'カ', 'キ', 'ク', 'ケ', 'コ', 'サ', 'シ', 'ス', 'セ', 'ソ', 'タ', 'チ', 'ツ', 'テ', 'ト', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'ヒ', 'フ', 'ヘ', 'ホ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ガ', 'ギ', 'グ', 'ゲ', 'ゴ', 'ザ', 'ジ', 'ズ', 'ゼ', 'ゾ', 'ダ', 'ヂ', 'ヅ', 'デ', 'ド', 'バ', 'ビ', 'ブ', 'ベ', 'ボ', 'パ', 'ピ', 'プ', 'ペ', 'ポ', 'ヤ', 'ユ', 'ヨ', 'ワ', 'ヲ', 'ン', 'ー'] alphabet_upper = list(string.ascii_uppercase) alphabet_lower = list(string.ascii_lowercase) numetric = list(string.digits) alphabet_num = list(string.ascii_letters + string.digits) kigou = \ ['(', ')', '[', ']', '「', '」', '『', '』', '<', '>', '¥', '/', '÷', '*', '+', '×', '?', '=', '〜', '|', ':', ';', '。', '、', '.', ','] jyouyou_kanji = \ ['亜', '哀', '挨', '愛', '曖', '悪', '握', '圧', '扱', '宛', '嵐', '安', '案', '暗', '以', '衣', '位', '囲', '医', '依', '委', '威', '為', '畏', '胃', '尉', '異', '移', '萎', '偉', '椅', '彙', '意', '違', '維', '慰', '遺', '緯', '域', '育', '一', '壱', '逸', '茨', '芋', '引', '印', '因', '咽', '姻', '員', '院', '淫', '陰', '飲', '隠', '韻', '右', '宇', '羽', '雨', '唄', '鬱', '畝', '浦', '運', '雲', '永', '泳', '英', '映', '栄', '営', '詠', '影', '鋭', '衛', '易', '疫', '益', '液', '駅', '悦', '越', '謁', '閲', '円', '延', '沿', '炎', '怨', '宴', '媛', '援', '園', '煙', '猿', '遠', '鉛', '塩', '演', '縁', '艶', '汚', '王', '凹', '央', '応', '往', '押', '旺', '欧', '殴', '桜', '翁', '奥', '横', '岡', '屋', '億', '憶', '臆', '虞', '乙', '俺', '卸', '音', '恩', '温', '穏', '下', '化', '火', '加', '可', '仮', '何', '花', '佳', '価', '果', '河', '苛', '科', '架', '夏', '家', '荷', '華', '菓', '貨', '渦', '過', '嫁', '暇', '禍', '靴', '寡', '歌', '箇', '稼', '課', '蚊', '牙', '瓦', '我', '画', '芽', '賀', '雅', '餓', '介', '回', '灰', '会', '快', '戒', '改', '怪', '拐', '悔', '海', '界', '皆', '械', '絵', '開', '階', '塊', '楷', '解', '潰', '壊', '懐', '諧', '貝', '外', '劾', '害', '崖', '涯', '街', '慨', '蓋', '該', '概', '骸', '垣', '柿', '各', '角', '拡', '革', '格', '核', '殻', '郭', '覚', '較', '隔', '閣', '確', '獲', '嚇', '穫', '学', '岳', '楽', '額', '顎', '掛', '潟', '括', '活', '喝', '渇', '割', '葛', '滑', '褐', '轄', '且', '株', '釜', '鎌', '刈', '干', '刊', '甘', '汗', '缶', '完', '肝', '官', '冠', '巻', '看', '陥', '乾', '勘', '患', '貫', '寒', '喚', '堪', '換', '敢', '棺', '款', '間', '閑', '勧', '寛', '幹', '感', '漢', '慣', '管', '関', '歓', '監', '緩', '憾', '還', '館', '環', '簡', '観', '韓', '艦', '鑑', '丸', '含', '岸', '岩', '玩', '眼', '頑', '顔', '願', '企', '伎', '危', '机', '気', '岐', '希', '忌', '汽', '奇', '祈', '季', '紀', '軌', '既', '无', '記', '起', '飢', '鬼', '帰', '基', '寄', '規', '亀', '喜', '幾', '揮', '期', '棋', '貴', '棄', '毀', '旗', '器', '畿', '輝', '機', '騎', '技', '宜', '偽', '欺', '義', '疑', '儀', '戯', '擬', '犠', '議', '菊', '吉', '喫', '詰', '却', '客', '脚', '逆', '虐', '九', '久', '及', '弓', '丘', '旧', '休', '吸', '朽', '臼', '求', '究', '泣', '急', '級', '糾', '宮', '救', '球', '給', '嗅', '窮', '牛', '去', '巨', '居', '拒', '拠', '挙', '虚', '許', '距', '魚', '御', '漁', '凶', '共', '叫', '狂', '京', '享', '供', '協', '況', '峡', '挟', '狭', '恐', '恭', '胸', '脅', '強', '教', '郷', '境', '橋', '矯', '鏡', '競', '響', '驚', '仰', '暁', '業', '凝', '曲', '局', '極', '玉', '巾', '斤', '均', '近', '金', '菌', '勤', '琴', '筋', '僅', '禁', '緊', '錦', '謹', '襟', '吟', '銀', '区', '句', '苦', '駆', '具', '惧', '愚', '空', '偶', '遇', '隅', '串', '屈', '掘', '窟', '熊', '繰', '君', '訓', '勲', '薫', '軍', '郡', '群', '兄', '刑', '形', '系', '径', '茎', '係', '型', '契', '計', '恵', '啓', '掲', '渓', '経', '蛍', '敬', '景', '軽', '傾', '携', '継', '詣', '慶', '憬', '稽', '憩', '警', '鶏', '芸', '艸', '迎', '鯨', '隙', '劇', '撃', '激', '桁', '欠', '穴', '血', '決', '結', '傑', '潔', '月', '犬', '件', '見', '券', '肩', '建', '研', '県', '倹', '兼', '剣', '拳', '軒', '健', '険', '圏', '堅', '検', '嫌', '献', '絹', '遣', '権', '憲', '賢', '謙', '鍵', '繭', '顕', '験', '懸', '元', '幻', '玄', '言', '弦', '限', '原', '現', '舷', '減', '源', '厳', '己', '戸', '古', '呼', '固', '股', '虎', '孤', '弧', '故', '枯', '個', '庫', '湖', '雇', '誇', '鼓', '錮', '顧', '五', '互', '午', '呉', '後', '娯', '悟', '碁', '語', '誤', '護', '口', '工', '公', '勾', '孔', '功', '巧', '広', '甲', '交', '光', '向', '后', '好', '江', '考', '行', '坑', '孝', '抗', '攻', '更', '効', '幸', '拘', '肯', '侯', '厚', '恒', '洪', '皇', '紅', '荒', '郊', '香', '候', '校', '耕', '航', '貢', '降', '高', '康', '控', '梗', '黄', '喉', '慌', '港', '硬', '絞', '項', '溝', '鉱', '構', '綱', '酵', '稿', '興', '衡', '鋼', '講', '購', '乞', '号', '合', '拷', '剛', '傲', '豪', '克', '告', '谷', '刻', '国', '黒', '穀', '酷', '獄', '骨', '駒', '込', '頃', '今', '困', '昆', '恨', '根', '婚', '混', '痕', '紺', '魂', '墾', '懇', '左', '佐', '沙', '査', '砂', '唆', '差', '詐', '鎖', '座', '挫', '才', '再', '災', '妻', '采', '砕', '宰', '栽', '彩', '採', '済', '祭', '斎', '細', '菜', '最', '裁', '債', '催', '塞', '歳', '載', '際', '埼', '在', '材', '剤', '財', '罪', '崎', '作', '削', '昨', '柵', '索', '策', '酢', '搾', '錯', '咲', '冊', '札', '刷', '刹', '拶', '殺', '察', '撮', '擦', '雑', '皿', '三', '山', '参', '桟', '蚕', '惨', '産', '傘', '散', '算', '酸', '賛', '残', '斬', '暫', '士', '子', '支', '止', '氏', '仕', '史', '司', '四', '市', '矢', '旨', '死', '糸', '糸', '至', '伺', '志', '私', '使', '刺', '始', '姉', '枝', '祉', '肢', '姿', '思', '指', '施', '師', '恣', '紙', '脂', '視', '紫', '詞', '歯', '嗣', '試', '詩', '資', '飼', '誌', '雌', '摯', '賜', '諮', '示', '字', '寺', '次', '耳', '自', '似', '児', '事', '侍', '治', '持', '時', '滋', '慈', '辞', '磁', '餌', '璽', '鹿', '式', '識', '軸', '七', '𠮟', '失', '室', '疾', '執', '湿', '嫉', '漆', '質', '実', '芝', '写', '社', '車', '舎', '者', '射', '捨', '赦', '斜', '煮', '遮', '謝', '邪', '蛇', '勺', '尺', '借', '酌', '釈', '爵', '若', '弱', '寂', '手', '主', '守', '朱', '取', '狩', '首', '殊', '珠', '酒', '腫', '種', '趣', '寿', '受', '呪', '授', '需', '儒', '樹', '収', '囚', '州', '舟', '秀', '周', '宗', '拾', '秋', '臭', '修', '袖', '終', '羞', '習', '週', '就', '衆', '集', '愁', '酬', '醜', '蹴', '襲', '十', '汁', '充', '住', '柔', '重', '従', '渋', '銃', '獣', '縦', '叔', '祝', '宿', '淑', '粛', '縮', '塾', '熟', '出', '述', '術', '俊', '春', '瞬', '旬', '巡', '盾', '准', '殉', '純', '循', '順', '準', '潤', '遵', '処', '初', '所', '書', '庶', '暑', '署', '緒', '諸', '女', '如', '助', '序', '叙', '徐', '除', '小', '升', '少', '召', '匠', '床', '抄', '肖', '尚', '招', '承', '昇', '松', '沼', '昭', '宵', '将', '消', '症', '祥', '称', '笑', '唱', '商', '渉', '章', '紹', '訟', '勝', '掌', '晶', '焼', '焦', '硝', '粧', '詔', '証', '言', '象', '傷', '奨', '照', '詳', '彰', '障', '憧', '衝', '賞', '償', '礁', '鐘', '上', '丈', '冗', '条', '状', '乗', '城', '浄', '剰', '常', '情', '場', '畳', '蒸', '縄', '壌', '嬢', '錠', '譲', '醸', '色', '拭', '食', '植', '殖', '飾', '触', '嘱', '織', '職', '辱', '尻', '心', '申', '伸', '臣', '芯', '身', '辛', '侵', '信', '津', '神', '唇', '娠', '振', '浸', '真', '針', '深', '紳', '進', '森', '診', '寝', '慎', '新', '審', '震', '薪', '親', '人', '刃', '仁', '尽', '迅', '甚', '陣', '尋', '腎', '須', '図', '水', '吹', '垂', '炊', '帥', '粋', '衰', '推', '酔', '遂', '睡', '穂', '錘', '随', '髄', '枢', '崇', '数', '据', '杉', '裾', '寸', '瀬', '是', '井', '世', '正', '生', '成', '西', '声', '制', '姓', '征', '性', '青', '斉', '政', '星', '牲', '省', '凄', '逝', '清', '盛', '婿', '晴', '勢', '聖', '誠', '精', '製', '誓', '静', '請', '整', '醒', '税', '夕', '斥', '石', '赤', '昔', '析', '席', '脊', '隻', '惜', '戚', '責', '跡', '積', '績', '籍', '切', '折', '拙', '窃', '接', '設', '雪', '摂', '節', '説', '舌', '絶', '千', '川', '仙', '占', '先', '宣', '専', '泉', '浅', '洗', '染', '扇', '栓', '旋', '船', '戦', '煎', '羨', '腺', '詮', '践', '箋', '銭', '銑', '潜', '線', '遷', '選', '薦', '繊', '鮮', '全', '前', '善', '然', '禅', '漸', '膳', '繕', '狙', '阻', '祖', '租', '素', '措', '粗', '組', '疎', '訴', '塑', '遡', '礎', '双', '壮', '早', '争', '走', '奏', '相', '荘', '草', '送', '倉', '捜', '挿', '桑', '巣', '掃', '曹', '曽', '爽', '窓', '創', '喪', '痩', '葬', '装', '僧', '想', '層', '総', '遭', '槽', '踪', '操', '燥', '霜', '騒', '藻', '造', '像', '増', '憎', '蔵', '贈', '臓', '即', '束', '足', '促', '則', '息', '捉', '速', '側', '測', '俗', '族', '属', '賊', '続', '卒', '率', '存', '村', '孫', '尊', '損', '遜', '他', '多', '汰', '打', '妥', '唾', '堕', '惰', '駄', '太', '対', '体', '人', '耐', '待', '怠', '胎', '退', '帯', '泰', '堆', '袋', '逮', '替', '貸', '隊', '滞', '態', '戴', '大', '代', '台', '口', '第', '題', '滝', '宅', '択', '沢', '卓', '拓', '託', '濯', '諾', '濁', '但', '達', '脱', '奪', '棚', '誰', '丹', '旦', '担', '単', '炭', '胆', '探', '淡', '短', '嘆', '端', '綻', '誕', '鍛', '団', '男', '段', '断', '弾', '暖', '談', '壇', '地', '池', '知', '値', '恥', '致', '遅', '痴', '稚', '置', '緻', '竹', '畜', '逐', '蓄', '築', '秩', '窒', '茶', '着', '嫡', '中', '仲', '虫', '虫', '沖', '宙', '忠', '抽', '注', '昼', '柱', '衷', '酎', '鋳', '駐', '著', '貯', '丁', '弔', '庁', '兆', '町', '長', '挑', '帳', '張', '彫', '眺', '釣', '頂', '鳥', '朝', '脹', '貼', '超', '腸', '跳', '徴', '嘲', '潮', '澄', '調', '聴', '懲', '直', '勅', '捗', '沈', '珍', '朕', '陳', '賃', '鎮', '追', '椎', '墜', '通', '痛', '塚', '漬', '坪', '爪', '鶴', '低', '呈', '廷', '弟', '定', '底', '抵', '邸', '亭', '貞', '帝', '訂', '庭', '逓', '停', '偵', '堤', '提', '程', '艇', '締', '諦', '泥', '的', '笛', '摘', '滴', '適', '敵', '溺', '迭', '哲', '鉄', '徹', '撤', '天', '典', '店', '点', '展', '添', '転', '塡', '田', '伝', '殿', '電', '斗', '吐', '妬', '徒', '途', '都', '渡', '塗', '賭', '土', '奴', '努', '度', '怒', '刀', '冬', '灯', '火', '当', '投', '豆', '東', '到', '逃', '倒', '凍', '唐', '島', '桃', '討', '透', '党', '悼', '盗', '陶', '塔', '搭', '棟', '湯', '痘', '登', '答', '等', '筒', '統', '稲', '踏', '糖', '頭', '謄', '藤', '闘', '鬥', '騰', '同', '洞', '胴', '動', '堂', '童', '道', '働', '銅', '導', '瞳', '峠', '匿', '特', '得', '督', '徳', '篤', '毒', '独', '読', '栃', '凸', '突', '届', '屯', '豚', '頓', '貪', '鈍', '曇', '丼', '那', '奈', '内', '梨', '謎', '鍋', '南', '軟', '難', '二', '尼', '弐', '匂', '肉', '虹', '日', '入', '乳', '尿', '任', '妊', '忍', '認', '寧', '熱', '年', '念', '捻', '粘', '燃', '悩', '納', '能', '脳', '農', '濃', '把', '波', '派', '破', '覇', '馬', '婆', '罵', '拝', '杯', '背', '肺', '俳', '配', '排', '敗', '廃', '輩', '売', '倍', '梅', '培', '陪', '媒', '買', '賠', '白', '伯', '拍', '泊', '迫', '剝', '舶', '博', '薄', '麦', '漠', '縛', '爆', '箱', '箸', '畑', '肌', '八', '鉢', '発', '髪', '伐', '抜', '罰', '閥', '反', '半', '氾', '犯', '帆', '汎', '伴', '判', '坂', '阪', '板', '版', '班', '畔', '般', '販', '斑', '飯', '搬', '煩', '頒', '範', '繁', '藩', '晩', '番', '蛮', '盤', '比', '皮', '妃', '否', '批', '彼', '披', '肥', '非', '卑', '飛', '疲', '秘', '被', '悲', '扉', '費', '碑', '罷', '避', '尾', '眉', '美', '備', '微', '鼻', '膝', '肘', '匹', '必', '泌', '筆', '姫', '百', '氷', '表', '俵', '票', '評', '漂', '標', '苗', '秒', '病', '描', '猫', '品', '浜', '水', '貧', '賓', '頻', '敏', '瓶', '不', '夫', '父', '付', '布', '扶', '府', '怖', '阜', '附', '訃', '負', '赴', '浮', '婦', '符', '富', '普', '腐', '敷', '膚', '賦', '譜', '侮', '武', '部', '舞', '封', '風', '伏', '服', '副', '幅', '復', '福', '腹', '複', '覆', '払', '沸', '仏', '物', '粉', '紛', '雰', '噴', '墳', '憤', '奮', '分', '文', '聞', '丙', '平', '兵', '併', '並', '柄', '陛', '閉', '塀', '幣', '弊', '蔽', '餅', '米', '壁', '璧', '癖', '別', '蔑', '片', '辺', '返', '変', '偏', '遍', '編', '弁', '廾', '便', '勉', '歩', '保', '哺', '捕', '補', '舗', '母', '募', '墓', '慕', '暮', '簿', '方', '包', '芳', '邦', '奉', '宝', '抱', '放', '法', '泡', '胞', '俸', '倣', '峰', '砲', '崩', '訪', '報', '蜂', '豊', '飽', '褒', '縫', '亡', '乏', '忙', '坊', '妨', '忘', '防', '房', '肪', '某', '冒', '剖', '紡', '望', '傍', '帽', '棒', '貿', '貌', '暴', '膨', '謀', '頰', '北', '木', '朴', '牧', '睦', '僕', '墨', '撲', '没', '勃', '堀', '本', '奔', '翻', '凡', '盆', '麻', '摩', '磨', '魔', '毎', '妹', '枚', '昧', '埋', '幕', '膜', '枕', '又', '末', '抹', '万', '満', '慢', '漫', '未', '味', '魅', '岬', '密', '蜜', '脈', '妙', '民', '眠', '矛', '務', '無', '夢', '霧', '娘', '名', '命', '明', '迷', '冥', '盟', '銘', '鳴', '滅', '免', '面', '綿', '麺', '茂', '模', '毛', '妄', '盲', '耗', '猛', '網', '目', '黙', '門', '紋', '問', '匁', '冶', '夜', '野', '弥', '厄', '役', '約', '訳', '薬', '躍', '闇', '由', '油', '喩', '愉', '諭', '輸', '癒', '唯', '友', '有', '勇', '幽', '悠', '郵', '湧', '猶', '裕', '遊', '雄', '誘', '憂', '融', '優', '与', '予', '余', '人', '誉', '預', '幼', '用', '羊', '妖', '洋', '要', '容', '庸', '揚', '揺', '葉', '陽', '溶', '腰', '様', '瘍', '踊', '窯', '養', '擁', '謡', '曜', '抑', '沃', '浴', '欲', '翌', '翼', '拉', '裸', '羅', '来', '雷', '頼', '絡', '落', '酪', '辣', '乱', '卵', '覧', '濫', '藍', '欄', '吏', '利', '里', '理', '痢', '裏', '履', '璃', '離', '陸', '立', '律', '慄', '略', '柳', '流', '留', '竜', '粒', '隆', '硫', '侶', '旅', '虜', '慮', '了', '両', '良', '料', '涼', '猟', '陵', '量', '僚', '領', '寮', '療', '瞭', '糧', '力', '緑', '林', '厘', '倫', '輪', '隣', '臨', '瑠', '涙', '累', '塁', '類', '令', '礼', '示', '冷', '励', '戻', '例', '鈴', '零', '霊', '隷', '齢', '麗', '暦', '歴', '列', '劣', '烈', '裂', '恋', '連', '廉', '練', '錬', '呂', '炉', '賂', '路', '露', '老', '労', '弄', '郎', '朗', '浪', '廊', '楼', '漏', '籠', '六', '録', '麓', '論', '和', '話', '賄', '脇', '惑', '枠', '湾', '腕'] nihongo = hiragana + katakana + alphabet_num + kigou + jyouyou_kanji nihongo_class = ['']+nihongo filter_word = \ [('り', 'リ', katakana, katakana), ('リ', 'り', hiragana, hiragana), ('へ', 'ヘ', katakana, katakana), ('ヘ', 'へ', hiragana, hiragana), ('べ', 'ベ', katakana, katakana), ('ベ', 'べ', hiragana, hiragana), ('ぺ', 'ペ', katakana, katakana), ('ペ', 'ぺ', hiragana, hiragana), ('か', 'ガ', katakana, katakana), ('ガ', 'か', hiragana, hiragana), ('口', 'ロ', katakana, katakana), ('ロ', '口', jyouyou_kanji, jyouyou_kanji), ('工', 'エ', katakana, katakana), ('エ', '工', jyouyou_kanji, jyouyou_kanji), ('二', 'ニ', katakana, katakana), ('こ', 'ニ', katakana, katakana), ('ニ', '二', jyouyou_kanji, jyouyou_kanji), ('こ', '二', jyouyou_kanji, jyouyou_kanji), ('ニ', 'こ', hiragana, hiragana), ('二', 'こ', hiragana, hiragana), ('一', 'ー', katakana, katakana), ('ー', '一', jyouyou_kanji, jyouyou_kanji), ('七', 'セ', katakana, katakana), ('セ', '七', jyouyou_kanji, jyouyou_kanji), ('八', 'ハ', katakana, katakana), ('ハ', '八', jyouyou_kanji, jyouyou_kanji), ('力', 'カ', katakana, katakana), ('刀', 'カ', katakana, katakana), ('カ', '力', jyouyou_kanji, jyouyou_kanji), ('カ', '刀', jyouyou_kanji, jyouyou_kanji), ('干', 'チ', katakana, katakana), ('千', 'チ', katakana, katakana), ('チ', '干', jyouyou_kanji, jyouyou_kanji), ('チ', '千', jyouyou_kanji, jyouyou_kanji), ('手', 'キ', katakana, katakana), ('キ', '手', jyouyou_kanji, jyouyou_kanji), ('か', 'ガ', katakana, katakana), ('ガ', 'か', hiragana, hiragana), ('ホ', '木', jyouyou_kanji, jyouyou_kanji), ('木', 'ホ', katakana, katakana), ('J', 'ノ', katakana, katakana), ('ノ', 'J', alphabet_upper, alphabet_upper), ('ノ', 'J', None, alphabet_lower), ('j', 'ノ', katakana, katakana), ('ノ', 'j', alphabet_lower, alphabet_lower), ('T', '丁', jyouyou_kanji, jyouyou_kanji), ('丁', 'T', alphabet_upper, alphabet_upper), ('丁', 'T', None, alphabet_lower), ('T', 'イ', katakana, katakana), ('イ', 'T', alphabet_upper, alphabet_upper), ('イ', 'T', None, alphabet_lower), ('0', 'o', alphabet_lower+alphabet_upper, alphabet_lower), ('0', 'O', alphabet_upper, alphabet_upper), ('o', '0', numetric, numetric), ('O', '0', numetric, numetric), ('1', 'l', alphabet_lower+alphabet_upper, alphabet_lower), ('|', 'l', alphabet_lower+alphabet_upper, alphabet_lower), ('1', 'I', alphabet_upper, alphabet_upper), ('|', 'I', alphabet_upper, alphabet_upper), ('1', 'I', None, alphabet_lower), ('|', 'I', None, alphabet_lower), ('l', '1', numetric, numetric), ('I', '1', numetric, numetric), ('|', '1', numetric, numetric), ('ス', '又', jyouyou_kanji, jyouyou_kanji), ('又', 'ス', katakana, katakana), ('フ', '7', numetric, numetric), ('7', 'フ', katakana, katakana), ('5', 's', alphabet_lower+alphabet_upper, alphabet_lower), ('5', 'S', alphabet_upper, alphabet_upper), ('s', '5', numetric, numetric), ('S', '5', numetric, numetric), ('K', 'k', alphabet_lower, alphabet_lower), ('k', 'K', alphabet_upper, alphabet_upper), ('O', 'o', alphabet_lower, alphabet_lower), ('o', 'O', alphabet_upper, alphabet_upper), ('P', 'p', alphabet_lower, alphabet_lower), ('p', 'P', alphabet_upper, alphabet_upper), ('S', 's', alphabet_lower, alphabet_lower), ('s', 'S', alphabet_upper, alphabet_upper), ('U', 'u', alphabet_lower, alphabet_lower), ('u', 'U', alphabet_upper, alphabet_upper), ('V', 'v', alphabet_lower, alphabet_lower), ('v', 'V', alphabet_upper, alphabet_upper), ('V', 'v', alphabet_lower, alphabet_lower), ('v', 'V', alphabet_upper, alphabet_upper), ('W', 'w', alphabet_lower, alphabet_lower), ('w', 'W', alphabet_upper, alphabet_upper), ('X', 'x', alphabet_lower, alphabet_lower), ('x', 'X', alphabet_upper, alphabet_upper), ('Y', 'y', alphabet_lower, alphabet_lower), ('y', 'Y', alphabet_upper, alphabet_upper), ('Z', 'z', alphabet_lower, alphabet_lower), ('z', 'Z', alphabet_upper, alphabet_upper), ('十', '+', kigou, kigou), ('t', '+', kigou, kigou), ('メ', '+', kigou, kigou), ('+', '十', jyouyou_kanji, jyouyou_kanji), ('t', '十', jyouyou_kanji, jyouyou_kanji), ('メ', '十', jyouyou_kanji, jyouyou_kanji), ('+', 't', alphabet_lower+alphabet_upper, alphabet_lower), ('十', 't', alphabet_lower+alphabet_upper, alphabet_lower), ('メ', 'y', alphabet_lower+alphabet_upper, alphabet_lower), ('二', '=', kigou, kigou), ('ニ', '=', kigou, kigou), ('こ', '=', kigou, kigou), ('=', '二', jyouyou_kanji, jyouyou_kanji), ('=', 'ニ', katakana, katakana), ('=', 'こ', hiragana, hiragana), ('。', 'o', alphabet_lower+alphabet_upper, alphabet_lower), ('。', 'O', alphabet_upper, alphabet_upper), ('。', '0', numetric, numetric), ('o', '。', hiragana + katakana + jyouyou_kanji, None), ('O', '。', hiragana + katakana + jyouyou_kanji, None), ('0', '。', hiragana + katakana + jyouyou_kanji, None), ('2', 'っ', hiragana + jyouyou_kanji, ['た', 'ち', 'つ', 'て', 'と']), ('?', 'っ', hiragana + jyouyou_kanji, ['た', 'ち', 'つ', 'て', 'と']), ('つ', 'っ', hiragana + jyouyou_kanji, ['た', 'ち', 'つ', 'て', 'と']), ('ツ', 'ッ', katakana + jyouyou_kanji, ['タ', 'チ', 'ツ', 'テ', 'ト']), ('や', 'ゃ', ['き', 'し', 'ち', 'に', 'み', 'り', 'ぎ', 'ぢ', 'じ'], None), ('ゆ', 'ゅ', ['き', 'し', 'ち', 'に', 'み', 'り', 'ぎ', 'ぢ', 'じ'], None), ('よ', 'ょ', ['き', 'し', 'ち', 'に', 'み', 'り', 'ぎ', 'ぢ', 'じ'], None), ('ヤ', 'ャ', ['キ', 'シ', 'チ', 'ニ', 'ミ', 'リ', 'ギ', 'ヂ', 'ジ'], None), ('ユ', 'ュ', ['キ', 'シ', 'チ', 'ニ', 'ミ', 'リ', 'ギ', 'ヂ', 'ジ'], None), ('ヨ', 'ョ', ['キ', 'シ', 'チ', 'ニ', 'ミ', 'リ', 'ギ', 'ヂ', 'ジ'], None)]
61
79
0.303117
3,043
18,544
1.800854
0.770292
0.111496
0.103467
0.083212
0.240876
0.165876
0.120803
0.066788
0.05365
0.039416
0
0.00134
0.235224
18,544
303
80
61.20132
0.384643
0
0
0.027304
0
0
0.142742
0
0
0
0
0
0
1
0
false
0
0.003413
0
0.003413
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
b34fbde2e6b2d38c2db36ca1c3b839a7216bdccf
1,788
py
Python
tablas.py
yakairi/Tienda.py
afc7c5734833e2974c0a6b9aceab1b7097db9add
[ "MIT" ]
null
null
null
tablas.py
yakairi/Tienda.py
afc7c5734833e2974c0a6b9aceab1b7097db9add
[ "MIT" ]
null
null
null
tablas.py
yakairi/Tienda.py
afc7c5734833e2974c0a6b9aceab1b7097db9add
[ "MIT" ]
null
null
null
# Tienda CREATE TABLE `cliente` ( `idCliente` int NOT NULL AUTO_INCREMENT, `nombre` varchar(45) DEFAULT NULL, `apellido` varchar(45) DEFAULT NULL, `telefono` varchar(45) DEFAULT NULL, `email` varchar(45) DEFAULT NULL, `ciudad` varchar(45) DEFAULT NULL, `pais` varchar(45) DEFAULT NULL, PRIMARY KEY (`idCliente`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `departamento` ( `idDepartamento` INT NOT NULL AUTO_INCREMENT, `nombre` VARCHAR(45) NULL, PRIMARY KEY (`idDepartamento`) )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `empleado` ( `idEmpleado` int NOT NULL AUTO_INCREMENT, `nombre` varchar(45) DEFAULT NULL, `apellido` varchar(45) DEFAULT NULL, `fechaIngreso` date DEFAULT NULL, `fechaNacimiento` date DEFAULT NULL, `sexo` ENUM('hombre', 'mujer') DEFAULT NULL, `email` varchar(45) DEFAULT NULL, `telefono` varchar(45) DEFAULT NULL, `salario` decimal(10,2) DEFAULT NULL, `idDepartamento` int NULL, PRIMARY KEY (`idEmpleado`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `categoria` ( `idCategoria` int NOT NULL AUTO_INCREMENT, `nombre` varchar(45) DEFAULT NULL, `descripcion` varchar(45) DEFAULT NULL, PRIMARY KEY (`idCategoria`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `factura` ( `idFactura` int NOT NULL AUTO_INCREMENT, `fecha` datetime DEFAULT NULL, `idCliente` int DEFAULT NULL, `idEmpleado` int DEFAULT NULL, PRIMARY KEY (`idFactura`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE `detalle_factura` ( `idDetalle` int NOT NULL AUTO_INCREMENT, `idFactura` int DEFAULT NULL, `idProducto` int DEFAULT NULL, `precioUnitario` decimal(10,2) DEFAULT NULL, `cantidad` int DEFAULT NULL, PRIMARY KEY (`idDetalle`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
29.311475
47
0.730984
221
1,788
5.882353
0.235294
0.194615
0.147692
0.184615
0.620769
0.490769
0.444615
0.243846
0.214615
0.156154
0
0.029216
0.157718
1,788
60
48
29.8
0.833997
0.003356
0
0.306122
0
0
0.006194
0
0
0
0
0
0
0
null
null
0
0
null
null
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
1
0
0
0
0
0
0
0
0
2
b350585827e6f65d1b53d617dcc78e85b78cd6c3
398
py
Python
Python POO/Getters e Setters/exemplo02/pessoa.py
luccasocastro/Curso-Python
7ad2b980bb2f95f833811291273d6ca1beb0fe77
[ "MIT" ]
null
null
null
Python POO/Getters e Setters/exemplo02/pessoa.py
luccasocastro/Curso-Python
7ad2b980bb2f95f833811291273d6ca1beb0fe77
[ "MIT" ]
null
null
null
Python POO/Getters e Setters/exemplo02/pessoa.py
luccasocastro/Curso-Python
7ad2b980bb2f95f833811291273d6ca1beb0fe77
[ "MIT" ]
null
null
null
class Pessoa: #substantivo def __init__(self, nome: str, idade: int) -> None: self.nome = nome #substantivo self.idade = idade #substantivo def dirigir(self, veiculo: str) -> None: #verbos print(f'Dirigindo um(a) {veiculo}') def cantar(self) -> None: #verbos print('lalalala') def apresentar_idade(self) -> int: #verbos return self.idade
26.533333
54
0.61809
48
398
5.020833
0.479167
0.116183
0.124481
0
0
0
0
0
0
0
0
0
0.256281
398
14
55
28.428571
0.814189
0.128141
0
0
0
0
0.097059
0
0
0
0
0
0
1
0.4
false
0
0
0.1
0.6
0.2
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
b367137798db5a8033c70626264857c8575384f8
851
py
Python
account/urls.py
bopopescu/storyboard
0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2
[ "MIT" ]
null
null
null
account/urls.py
bopopescu/storyboard
0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2
[ "MIT" ]
null
null
null
account/urls.py
bopopescu/storyboard
0258fd6f80b6bbd9d0ca493cbaaae87c3a6d16e2
[ "MIT" ]
null
null
null
#!/usr/bin/env python # encoding: utf-8 """ urls.py Created by Darcy Liu on 2012-03-03. Copyright (c) 2012 Close To U. All rights reserved. """ from django.conf.urls import * from django.contrib.auth import views as auth_views urlpatterns = patterns('account.views', (r'^$','index'), (r'^signup$','signup'), (r'^signin$','signin'), (r'^signout$','signout'), (r'^logs$','logs'), (r'^avatar/(?P<username>\w+).png$','avatar'), (r'^custom_style$','custom_style'), (r'^password_change$', 'password_change'), (r'^password_change_done$', 'password_change_done'), (r'^password/change/$',auth_views.password_change), (r'^password/change/done/$',auth_views.password_change_done), (r'^password/$','index'), )
34.04
73
0.564042
101
851
4.613861
0.504951
0.240343
0.128755
0.098712
0.257511
0.141631
0
0
0
0
0
0.020093
0.239718
851
25
74
34.04
0.700155
0.156287
0
0
0
0
0.376056
0.105634
0
0
0
0
0
1
0
false
0.3125
0.125
0
0.125
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
2fa1d4df373d09a209451df383587b67198a18fa
438
py
Python
Study/src/com/company/test/favorite_languages.py
guptasuresh2004/python_handson
8f47784b09bddabd5ab28d38641cfca671869623
[ "MIT" ]
null
null
null
Study/src/com/company/test/favorite_languages.py
guptasuresh2004/python_handson
8f47784b09bddabd5ab28d38641cfca671869623
[ "MIT" ]
null
null
null
Study/src/com/company/test/favorite_languages.py
guptasuresh2004/python_handson
8f47784b09bddabd5ab28d38641cfca671869623
[ "MIT" ]
null
null
null
from collections import OrderedDict favorite_languages = OrderedDict() favorite_languages["Suresh"]="python" favorite_languages["Kumar"]="Java" favorite_languages["Gupta"]="c" for key in favorite_languages.keys(): print(key+" like to use :"+favorite_languages[key].title()) lang = {} lang["Suresh"]="python" lang["Kumar"]="Java" lang["Gupta"]="c" lang["1"]="2" for key in lang.keys(): print(key+" like to use :"+lang[key])
24.333333
63
0.694064
59
438
5.050847
0.40678
0.342282
0.187919
0.107383
0.14094
0.14094
0
0
0
0
0
0.005155
0.114155
438
17
64
25.764706
0.762887
0
0
0
0
0
0.191781
0
0
0
0
0
0
1
0
false
0
0.071429
0
0.071429
0.142857
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2fc259b569e3c130b039ed738e6f79be4ca77223
6,768
py
Python
pymap/bytes/__init__.py
BoniLindsley/pymap
b3190d20799a6d342888e51bfc55cdfcbfe3ed26
[ "MIT" ]
null
null
null
pymap/bytes/__init__.py
BoniLindsley/pymap
b3190d20799a6d342888e51bfc55cdfcbfe3ed26
[ "MIT" ]
null
null
null
pymap/bytes/__init__.py
BoniLindsley/pymap
b3190d20799a6d342888e51bfc55cdfcbfe3ed26
[ "MIT" ]
null
null
null
"""Defines useful types and utilities for working with bytestrings.""" from __future__ import annotations import zlib from abc import abstractmethod, ABCMeta from collections.abc import Iterable, Sequence from io import BytesIO from itertools import chain from typing import cast, final, Any, Final, TypeVar, SupportsBytes, Union, \ Protocol __all__ = ['MaybeBytes', 'MaybeBytesT', 'WriteStream', 'Writeable', 'BytesFormat'] #: A bytes object, memoryview, or an object with a ``__bytes__`` method. MaybeBytes = Union[bytes, bytearray, memoryview, SupportsBytes] #: A type variable bound to :class:`MaybeBytes`. MaybeBytesT = TypeVar('MaybeBytesT', bound=MaybeBytes) _FormatArg = Union[MaybeBytes, int] class WriteStream(Protocol): """Typing protocol indicating the object implements the :meth:`.write` method. See Also: :class:`~asyncio.StreamWriter`, :class:`~typing.BinaryIO` """ @abstractmethod def write(self, data: bytes) -> Any: """Defines an abstract method where ``data`` is written to a stream or buffer. Args: data: The data to write. """ ... class HashStream(WriteStream): """A stream that a :class:`Writeable` can use to generate a non-cryptographic hash using :func:`zlib.adler32`. """ __slots__ = ['_digest'] def __init__(self) -> None: super().__init__() self._digest = zlib.adler32(b'') def write(self, data: bytes) -> None: self._digest = zlib.adler32(data, self._digest) def digest(self, data: Writeable = None) -> bytes: """Return the digest of the data written to the hash stream. Args: data: The data to write before computing the digest. """ if data is not None: data.write(self) return self._digest.to_bytes(4, 'big') class Writeable(metaclass=ABCMeta): """Base class for types that can be written to a stream.""" __slots__: Sequence[str] = [] @final def tobytes(self) -> bytes: """Convert the writeable object back into a bytestring using the :meth:`.write` method. """ writer = BytesIO() self.write(writer) return writer.getvalue() @classmethod def empty(cls) -> Writeable: """Return a :class:`Writeable` for an empty string.""" return _EmptyWriteable() @classmethod def wrap(cls, data: MaybeBytes) -> Writeable: """Wrap the bytes in a :class:`Writeable`. Args: data: The object to wrap. """ return _WrappedWriteable(data) @classmethod def concat(cls, data: Iterable[MaybeBytes]) -> Writeable: """Wrap the iterable in a :class:`Writeable` that will write each item. Args: data: The iterable to wrap. """ return _ConcatWriteable(data) def write(self, writer: WriteStream) -> None: """Write the object to the stream, with one or more calls to :meth:`~WriteStream.write`. Args: writer: The output stream. """ writer.write(bytes(self)) def __bool__(self) -> bool: return True def __len__(self) -> int: return len(bytes(self)) @abstractmethod def __bytes__(self) -> bytes: ... class _EmptyWriteable(Writeable): __slots__: Sequence[str] = [] def write(self, writer: WriteStream) -> None: pass def __bytes__(self) -> bytes: return b'' def __repr__(self) -> str: return '<Writeable empty>' class _WrappedWriteable(Writeable): __slots__ = ['data'] def __init__(self, data: MaybeBytes) -> None: if isinstance(data, bytes): self.data = data else: self.data = bytes(data) def __bytes__(self) -> bytes: return self.data def __repr__(self) -> str: return f'<Writeable {repr(self.data)}>' class _ConcatWriteable(Writeable): __slots__ = ['data'] def __init__(self, data: Iterable[MaybeBytes]) -> None: self.data = list(data) def write(self, writer: WriteStream) -> None: for item in self.data: if isinstance(item, Writeable): item.write(writer) else: writer.write(bytes(item)) def __bytes__(self) -> bytes: return BytesFormat(b'').join(self.data) def __repr__(self) -> str: return f'<Writeable {repr(self.data)}>' class BytesFormat: """Helper utility for performing formatting operations that produce bytestrings. While similar to the builtin formatting and join operations, this class intends to provide cleaner typing. Args: how: The formatting string or join delimiter to use. """ __slots__ = ['how'] def __init__(self, how: bytes) -> None: super().__init__() self.how: Final = how def __mod__(self, other: Union[_FormatArg, Iterable[_FormatArg]]) -> bytes: """String interpolation, shortcut for :meth:`.format`. Args: other: The data interpolated into the format string. """ if isinstance(other, bytes): return self.format([other]) elif hasattr(other, '__bytes__'): supports_bytes = cast(SupportsBytes, other) return self.format([bytes(supports_bytes)]) elif hasattr(other, '__iter__'): items = cast(Iterable[_FormatArg], other) return self.format(items) return NotImplemented @classmethod def _fix_format_arg(cls, data: _FormatArg) -> Any: if isinstance(data, int): return data else: return bytes(data) def format(self, data: Iterable[_FormatArg]) -> bytes: """String interpolation into the format string. Args: data: The data interpolated into the format string. Examples: :: BytesFormat(b'Hello, %b!') % b'World' BytesFormat(b'%b, %b!') % (b'Hello', b'World') """ fix_arg = self._fix_format_arg return self.how % tuple(fix_arg(item) for item in data) @classmethod def _fix_join_arg(cls, data: _FormatArg) -> Any: if isinstance(data, int): return b'%d' % data else: return bytes(data) def join(self, *data: Iterable[_FormatArg]) -> bytes: """Iterable join on a delimiter. Args: data: Iterable of items to join. Examples: :: BytesFormat(b' ').join([b'one', b'two', b'three']) """ fix_arg = self._fix_join_arg return self.how.join(fix_arg(item) for item in chain(*data))
25.73384
79
0.599143
760
6,768
5.143421
0.227632
0.030698
0.015349
0.017396
0.214377
0.150166
0.107444
0.052187
0.052187
0.052187
0
0.001453
0.288121
6,768
262
80
25.832061
0.80988
0.283245
0
0.294118
0
0
0.040217
0
0
0
0
0
0
1
0.235294
false
0.008403
0.058824
0.067227
0.596639
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
2fc47242aa3943850747abcba7e7e472c1fce0f5
113
py
Python
_solutions/pandas/dataframe/pandas_df_sample_a.py
sages-pl/2022-01-pythonsqlalchemy-aptiv
1d6d856608e9dbe25b139e8968c48b7f46753b84
[ "MIT" ]
null
null
null
_solutions/pandas/dataframe/pandas_df_sample_a.py
sages-pl/2022-01-pythonsqlalchemy-aptiv
1d6d856608e9dbe25b139e8968c48b7f46753b84
[ "MIT" ]
null
null
null
_solutions/pandas/dataframe/pandas_df_sample_a.py
sages-pl/2022-01-pythonsqlalchemy-aptiv
1d6d856608e9dbe25b139e8968c48b7f46753b84
[ "MIT" ]
null
null
null
df = pd.read_csv(DATA) df = df.sample(frac=1.0) df.reset_index(drop=True, inplace=True) result = df.tail(n=10)
16.142857
39
0.699115
23
113
3.347826
0.782609
0
0
0
0
0
0
0
0
0
0
0.04
0.115044
113
6
40
18.833333
0.73
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2fc5eb9ac5bb61a25a0a92e01993111c6aae7c68
967
py
Python
coursework1/task6/reducer.py
foundnet/UOE_EP_coursework1
25ab8ff2beaa4fbde5a0d4519abb84d8e43cf9d8
[ "Apache-2.0" ]
null
null
null
coursework1/task6/reducer.py
foundnet/UOE_EP_coursework1
25ab8ff2beaa4fbde5a0d4519abb84d8e43cf9d8
[ "Apache-2.0" ]
null
null
null
coursework1/task6/reducer.py
foundnet/UOE_EP_coursework1
25ab8ff2beaa4fbde5a0d4519abb84d8e43cf9d8
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python import sys import math prev_key = "" hresult = 0.0 totalcnt = 0 cntlist = [] for line in sys.stdin: key,info = line.strip().split("\t",1) if key != prev_key: if prev_key != "": hresult = 0.0 cntlist = strinfo.split(",") cntlist = map(int,cntlist) totalcnt = sum(cntlist) for v in cntlist: hresult = hresult - float(v) / totalcnt *\ math.log(float(v)/totalcnt,2) print "%s\t%f"%(prev_key,hresult) prev_key = key strinfo = info.strip() else: strinfo = strinfo + "," + info.strip() if prev_key != "": hresult = 0.0 cntlist = strinfo.split(",") cntlist = map(int,cntlist) totalcnt = sum(cntlist) for v in cntlist: hresult = hresult - float(v) / totalcnt *\ math.log(float(v)/totalcnt,2) print "%s\t%f"%(prev_key,hresult)
25.447368
64
0.511892
118
967
4.135593
0.288136
0.10041
0.143443
0.092213
0.688525
0.655738
0.655738
0.655738
0.655738
0.655738
0
0.015848
0.347466
967
37
65
26.135135
0.757528
0.016546
0
0.612903
0
0
0.017895
0
0
0
0
0
0
0
null
null
0
0.064516
null
null
0.064516
0
0
0
null
0
0
0
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
1
0
0
0
0
0
0
0
0
2
2fd399ef21d1427fd4d75eb210dc4fb1e1e0b5ec
152
py
Python
Exercicios/Todos/ex049.py
Edson921/exerciciosResolvidos
72a3089f4848650c62ac0dd876abf5695a64525a
[ "MIT" ]
null
null
null
Exercicios/Todos/ex049.py
Edson921/exerciciosResolvidos
72a3089f4848650c62ac0dd876abf5695a64525a
[ "MIT" ]
null
null
null
Exercicios/Todos/ex049.py
Edson921/exerciciosResolvidos
72a3089f4848650c62ac0dd876abf5695a64525a
[ "MIT" ]
null
null
null
#Calculadora de tabuada n = int(input('Deseja ver tabuada de que numero?')) for c in range(1, 13): print('{} X {:2}= {} '. format(n, c, n * c))
30.4
51
0.572368
26
152
3.346154
0.769231
0.045977
0
0
0
0
0
0
0
0
0
0.033898
0.223684
152
5
52
30.4
0.70339
0.144737
0
0
0
0
0.361538
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2fd4591d238347442d7ceffec0998337ad85bf70
362
py
Python
rede/eevc/models/RegistroTotalizadorMatriz.py
marcioinfo/edi_reader
9d19cb3fa462c4eb91a0a2f983e12e3de1b596eb
[ "MIT" ]
null
null
null
rede/eevc/models/RegistroTotalizadorMatriz.py
marcioinfo/edi_reader
9d19cb3fa462c4eb91a0a2f983e12e3de1b596eb
[ "MIT" ]
null
null
null
rede/eevc/models/RegistroTotalizadorMatriz.py
marcioinfo/edi_reader
9d19cb3fa462c4eb91a0a2f983e12e3de1b596eb
[ "MIT" ]
null
null
null
COLUMNS = [ 'tipo_registro', 'nro_pv_matriz', 'vl_total_bruto', 'qtde_cvnsu', 'vl_total_rejeitado', 'vl_total_rotativo', 'vl_total_parcelado_sem_juros', 'vl_total_parcelado_iata', 'vl_total_dolar', 'vl_total_desconto', 'vl_total_liquido', 'vl_total_gorjeta', 'vl_total_tx_embarque', 'qtde_cvnsu_acatados' ]
22.625
35
0.676796
45
362
4.777778
0.533333
0.325581
0.148837
0
0
0
0
0
0
0
0
0
0.201657
362
16
36
22.625
0.743945
0
0
0
0
0
0.655647
0.140496
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
2fe058dd084d71d3320c034887d2a6bdbc3b3c7b
322
py
Python
basic_ml/notebooks/numpy/performance_test.py
jmetzz/ml-laboratory
26b1e87bd0d80efa4f15280f7f32ad46d59efc1f
[ "MIT" ]
1
2021-09-10T16:55:35.000Z
2021-09-10T16:55:35.000Z
basic_ml/notebooks/numpy/performance_test.py
jmetzz/ml-laboratory
26b1e87bd0d80efa4f15280f7f32ad46d59efc1f
[ "MIT" ]
14
2022-03-12T01:06:08.000Z
2022-03-30T14:30:22.000Z
basic_ml/notebooks/numpy/performance_test.py
jmetzz/ml-laboratory
26b1e87bd0d80efa4f15280f7f32ad46d59efc1f
[ "MIT" ]
null
null
null
import numpy as np # Create an array with 10^7 elements arr = np.arange(1e7) # Converting ndarray to list larr = arr.tolist() def list_times(alist, scalar): return [val * scalar for val in alist] # Using IPython's magic # timeit command timeit arr * 1.1 # timeit list_times(larr, 1.1) # box(x, y){line=snake}
15.333333
42
0.692547
55
322
4.018182
0.727273
0.081448
0
0
0
0
0
0
0
0
0
0.034884
0.198758
322
20
43
16.1
0.821705
0.515528
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0.2
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
641df5fb5db24eb21cd2895f9c79ad3ad2b58d9b
321
py
Python
src/mars_profiling/__init__.py
wjsi/mars-profiling
1accb00c90da67b46ad98ea1592fecc524625454
[ "MIT" ]
1
2021-01-21T09:11:58.000Z
2021-01-21T09:11:58.000Z
src/mars_profiling/__init__.py
wjsi/mars-profiling
1accb00c90da67b46ad98ea1592fecc524625454
[ "MIT" ]
null
null
null
src/mars_profiling/__init__.py
wjsi/mars-profiling
1accb00c90da67b46ad98ea1592fecc524625454
[ "MIT" ]
1
2020-12-30T08:32:29.000Z
2020-12-30T08:32:29.000Z
"""Main module of pandas-profiling. .. include:: ../../README.md """ from mars_profiling.config import Config, config from mars_profiling.controller import pandas_decorator from mars_profiling.profile_report import ProfileReport from mars_profiling.version import __version__ clear_config = ProfileReport.clear_config
26.75
55
0.82243
40
321
6.3
0.475
0.126984
0.269841
0
0
0
0
0
0
0
0
0
0.096573
321
11
56
29.181818
0.868966
0.193146
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.8
0
0.8
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
642258fc8f2651e821a5bcb66a823371ffdb8d3d
213
py
Python
C1.py
dpocheng/SIMPLESEM-Compiler-Semantic
9725968a4d8a78ed95e617ad3dbcdb4fc41bd53d
[ "Apache-2.0" ]
null
null
null
C1.py
dpocheng/SIMPLESEM-Compiler-Semantic
9725968a4d8a78ed95e617ad3dbcdb4fc41bd53d
[ "Apache-2.0" ]
null
null
null
C1.py
dpocheng/SIMPLESEM-Compiler-Semantic
9725968a4d8a78ed95e617ad3dbcdb4fc41bd53d
[ "Apache-2.0" ]
null
null
null
a, b, c = 3, 1, -1 def main(): global a, b while a > c: if a == 0: print b else: b = b + a a = a - 1 print a print b print c main()
15.214286
22
0.328638
33
213
2.121212
0.393939
0.057143
0
0
0
0
0
0
0
0
0
0.054348
0.568075
213
13
23
16.384615
0.706522
0
0
0.153846
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
0.307692
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
642d2e7d44ed6fcd127074d651ed9e62d6aa3d5f
450
py
Python
33-inheritance.py
MKen212/pymosh
6db31f181081baf3e4cc3d7228a3480b16bd3cda
[ "MIT" ]
null
null
null
33-inheritance.py
MKen212/pymosh
6db31f181081baf3e4cc3d7228a3480b16bd3cda
[ "MIT" ]
null
null
null
33-inheritance.py
MKen212/pymosh
6db31f181081baf3e4cc3d7228a3480b16bd3cda
[ "MIT" ]
null
null
null
class Mammal: x = 10 def walk(self): print("Walking") # class Dog: # def walk(self): # print("Walking") # class Cat: # def walk(self): # print("Walking") class Dog(Mammal): def bark(self): print("Woof, woof!") class Cat(Mammal): pass # Just used here as Python does not like empty classes. Pass just passes... rover = Dog() print(rover.x) rover.bark() fluffy = Cat() fluffy.walk()
13.636364
85
0.575556
60
450
4.316667
0.45
0.138996
0.127413
0.185328
0.34749
0.34749
0.239382
0
0
0
0
0.006154
0.277778
450
32
86
14.0625
0.790769
0.411111
0
0
0
0
0.070588
0
0
0
0
0
0
1
0.142857
false
0.071429
0
0
0.428571
0.214286
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
6438cc3d752def2341c27211310e7e6e164ba110
1,242
py
Python
travel_blog/blog/models.py
kennethlove/travel_blog_livestream
a6bc74e99b4922b5ac0d3a8ed0f2d5dbebde6fd2
[ "MIT" ]
2
2016-12-17T02:56:22.000Z
2017-07-19T05:13:59.000Z
travel_blog/blog/models.py
kennethlove/travel_blog_livestream
a6bc74e99b4922b5ac0d3a8ed0f2d5dbebde6fd2
[ "MIT" ]
null
null
null
travel_blog/blog/models.py
kennethlove/travel_blog_livestream
a6bc74e99b4922b5ac0d3a8ed0f2d5dbebde6fd2
[ "MIT" ]
1
2018-12-19T06:34:37.000Z
2018-12-19T06:34:37.000Z
from django.contrib.gis.db import models from django.core.urlresolvers import reverse from django.utils import timezone import markdown class Post(models.Model): title = models.CharField(max_length=255) slug = models.SlugField() content = models.TextField() content_html = models.TextField(editable=False) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) published_at = models.DateTimeField(default=timezone.now) coords = models.PointField(blank=True, null=True) class Meta: ordering = ['-published_at', '-id'] def __str__(self): return self.title def save(self, *args, **kwargs): self.content_html = markdown.markdown(self.content) super().save(*args, **kwargs) def get_absolute_url(self): return reverse('blog:detail', kwargs={'slug': self.slug}) @property def latlng(self): return (self.coords[1], self.coords[0]) class Image(models.Model): upload = models.ImageField(upload_to='posts/images/') description = models.TextField(blank=True, default='') post = models.ForeignKey(Post, related_name='images') def __str__(self): return self.description
28.883721
65
0.694042
153
1,242
5.490196
0.470588
0.047619
0.075
0.059524
0.114286
0
0
0
0
0
0
0.004931
0.183575
1,242
42
66
29.571429
0.823471
0
0
0.064516
0
0
0.040258
0
0
0
0
0
0
1
0.16129
false
0
0.129032
0.129032
0.870968
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
ff3c1fbbadea09a6b0eb293f80eec2bc2157f2ee
692
py
Python
guest/models.py
TylerBackman/chemminetools
1896c2dd7362f44193528aef028390543a125921
[ "BSD-4-Clause-UC" ]
16
2015-03-24T18:34:18.000Z
2018-04-11T06:02:52.000Z
guest/models.py
zagrosman/chemminetools
1896c2dd7362f44193528aef028390543a125921
[ "BSD-4-Clause-UC" ]
60
2019-01-03T18:15:55.000Z
2022-03-12T00:14:59.000Z
guest/models.py
zagrosman/chemminetools
1896c2dd7362f44193528aef028390543a125921
[ "BSD-4-Clause-UC" ]
13
2018-04-25T18:25:09.000Z
2022-02-14T08:15:03.000Z
import datetime from django.db import models from django.contrib.auth.models import User from django.contrib.sessions.models import Session class Guest(models.Model): """ A temporary user. Fields: ``user`` - The temporary user. ``last_used`` - The last time we noted this user doing something. All users with a record in this model are temporary and should be deleted after GUEST_DELETE_TIME. """ user = models.ForeignKey(User,on_delete=models.CASCADE) last_used = models.DateTimeField(User) @classmethod def create_guest(self, user): guest = Guest(user=user, last_used=datetime.datetime.now()) return guest
24.714286
69
0.693642
92
692
5.141304
0.521739
0.063425
0.071882
0
0
0
0
0
0
0
0
0
0.222543
692
27
70
25.62963
0.879182
0.322254
0
0
0
0
0
0
0
0
0
0
0
1
0.090909
false
0
0.363636
0
0.818182
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
ff3fe555e0f853acd0d7022e07b47e9bc456ae3d
323
py
Python
tests/client/test_get_balance.py
kanzure/eth-testrpc
cbb22ff2bebc9f12098b0bb7f2a245f3510522b4
[ "MIT" ]
164
2016-04-20T08:30:22.000Z
2022-01-05T07:43:12.000Z
tests/client/test_get_balance.py
kanzure/eth-testrpc
cbb22ff2bebc9f12098b0bb7f2a245f3510522b4
[ "MIT" ]
55
2016-06-30T20:06:56.000Z
2019-12-12T07:36:02.000Z
tests/client/test_get_balance.py
kanzure/eth-testrpc
cbb22ff2bebc9f12098b0bb7f2a245f3510522b4
[ "MIT" ]
46
2016-04-27T16:28:46.000Z
2022-01-09T17:59:09.000Z
def test_deploying_contract(client, hex_accounts): pre_balance = client.get_balance(hex_accounts[1]) client.send_transaction( _from=hex_accounts[0], to=hex_accounts[1], value=1234, ) post_balance = client.get_balance(hex_accounts[1]) assert post_balance - pre_balance == 1234
24.846154
54
0.693498
42
323
4.97619
0.47619
0.263158
0.172249
0.220096
0.334928
0.334928
0.334928
0
0
0
0
0.046875
0.20743
323
12
55
26.916667
0.769531
0
0
0
0
0
0
0
0
0
0
0
0.111111
1
0.111111
false
0
0
0
0.111111
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ff54be97770be18ceff808d68e4d32c92c411113
2,411
py
Python
tests/saliency_tests/visualizer_tests/test_mol_visualizer.py
k-ishiguro/chainer-chemistry
aec33496def16e76bdfbefa508ba01ab9f79a592
[ "MIT" ]
1
2019-06-19T00:05:59.000Z
2019-06-19T00:05:59.000Z
tests/saliency_tests/visualizer_tests/test_mol_visualizer.py
k-ishiguro/chainer-chemistry
aec33496def16e76bdfbefa508ba01ab9f79a592
[ "MIT" ]
null
null
null
tests/saliency_tests/visualizer_tests/test_mol_visualizer.py
k-ishiguro/chainer-chemistry
aec33496def16e76bdfbefa508ba01ab9f79a592
[ "MIT" ]
1
2020-10-12T07:23:44.000Z
2020-10-12T07:23:44.000Z
import os import numpy import pytest from rdkit import Chem from chainer_chemistry.saliency.visualizer.mol_visualizer import MolVisualier # NOQA from chainer_chemistry.saliency.visualizer.mol_visualizer import SmilesVisualizer # NOQA def test_mol_visualizer(tmpdir): # Only test file is saved without error smiles = 'OCO' mol = Chem.MolFromSmiles(smiles) saliency = numpy.array([0.5, 0.3, 0.2]) visualizer = MolVisualier() # 1. test with setting save_filepath save_filepath = os.path.join(str(tmpdir), 'tmp.svg') visualizer.visualize(saliency, mol, save_filepath=save_filepath) assert os.path.exists(save_filepath) # 2. test with `save_filepath=None` runs without error visualizer.visualize( saliency, mol, save_filepath=None, visualize_ratio=0.5,) def test_smiles_visualizer(tmpdir): # Only test file is saved without error smiles = 'OCO' saliency = numpy.array([0.5, 0.3, 0.2]) visualizer = SmilesVisualizer() # 1. test with setting save_filepath save_filepath = os.path.join(str(tmpdir), 'tmp.svg') visualizer.visualize(saliency, smiles, save_filepath=save_filepath, add_Hs=False) assert os.path.exists(save_filepath) save_filepath = os.path.join(str(tmpdir), 'tmp.png') visualizer.visualize(saliency, smiles, save_filepath=save_filepath, add_Hs=False) # TODO(nakago): support png save test. # Do not test for now (cairosvg is necessary) # assert os.path.exists(save_filepath) # 2. test with `save_filepath=None` runs without error visualizer.visualize( saliency, smiles, save_filepath=None, visualize_ratio=0.5, add_Hs=False, use_canonical_smiles=True) def test_mol_visualizer_assert_raises(tmpdir): visualizer = MolVisualier() smiles = 'OCO' mol = Chem.MolFromSmiles(smiles) with pytest.raises(ValueError): # --- Invalid saliency shape --- saliency = numpy.array([[0.5, 0.3, 0.2], [0.5, 0.3, 0.2]]) visualizer.visualize(saliency, mol) with pytest.raises(ValueError): # --- Invalid sort key --- saliency = numpy.array([0.5, 0.3, 0.2]) invalid_ext_filepath = os.path.join(str(tmpdir), 'tmp.hoge') visualizer.visualize(saliency, mol, save_filepath=invalid_ext_filepath) if __name__ == '__main__': pytest.main([__file__, '-v', '-s'])
33.957746
89
0.686022
316
2,411
5.063291
0.243671
0.1425
0.118125
0.09
0.7475
0.70625
0.615625
0.546875
0.475625
0.445625
0
0.01972
0.200747
2,411
70
90
34.442857
0.810586
0.180423
0
0.511628
0
0
0.025484
0
0
0
0
0.014286
0.069767
1
0.069767
false
0
0.139535
0
0.209302
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
2
ff586db231494de039c35a8707572150023a7b03
971
py
Python
crawlers/news/items.py
Ceruleanacg/rena
eb651b7e4d8d8db0ca87e1415a5c9190abb346d2
[ "MIT" ]
7
2018-04-01T16:07:31.000Z
2018-07-01T10:33:26.000Z
crawlers/news/items.py
Ceruleanacg/rena
eb651b7e4d8d8db0ca87e1415a5c9190abb346d2
[ "MIT" ]
null
null
null
crawlers/news/items.py
Ceruleanacg/rena
eb651b7e4d8d8db0ca87e1415a5c9190abb346d2
[ "MIT" ]
1
2016-02-04T20:33:06.000Z
2016-02-04T20:33:06.000Z
# -*- coding: utf-8 -*- # Define here the models for your scraped items # # See documentation in: # http://doc.scrapy.org/en/latest/topics/items.html from scrapy import Item, Field from scrapy.loader.processors import TakeFirst, Join class NewsItem(Item): url = Field( output_processor=TakeFirst() ) type = Field( output_processor=TakeFirst() ) source = Field( output_processor=TakeFirst() ) title = Field( output_processor=TakeFirst() ) article = Field( output_processor=TakeFirst() ) create_date = Field( output_processor=TakeFirst() ) image_urls = Field() class SinaCaptchaItem(Item): image_urls = Field() images = Field() class SinaStarItem(Item): name = Field( output_processor=TakeFirst() ) avatar_url = Field( output_processor=TakeFirst() ) weibo_url = Field( output_processor=TakeFirst() )
16.741379
52
0.625129
100
971
5.93
0.49
0.166948
0.303541
0.440135
0.161889
0
0
0
0
0
0
0.001414
0.271885
971
58
53
16.741379
0.837341
0.143151
0
0.314286
0
0
0
0
0
0
0
0
0
1
0
false
0
0.057143
0
0.485714
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ff687b565ac41fe08f64ade140dd3095099140f5
30,770
py
Python
math/tests/testcases.py
fuz-woo/gpython
06dadad26f41e35b57c144ffdac01fb3f23977e9
[ "BSD-3-Clause" ]
520
2018-08-21T19:28:23.000Z
2022-03-30T21:26:10.000Z
math/tests/testcases.py
fuz-woo/gpython
06dadad26f41e35b57c144ffdac01fb3f23977e9
[ "BSD-3-Clause" ]
165
2018-08-22T07:54:29.000Z
2022-03-31T20:34:21.000Z
math/tests/testcases.py
fuz-woo/gpython
06dadad26f41e35b57c144ffdac01fb3f23977e9
[ "BSD-3-Clause" ]
84
2018-08-27T03:29:09.000Z
2022-03-15T23:19:13.000Z
# Copyright 2018 The go-python Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. # Testcases for functions in math. # # Each line takes the form: # # <testid> <function> <input_value> -> <output_value> <flags> # # where: # # <testid> is a short name identifying the test, # # <function> is the function to be tested (exp, cos, asinh, ...), # # <input_value> is a string representing a floating-point value # # <output_value> is the expected (ideal) output value, again # represented as a string. # # <flags> is a list of the floating-point flags required by C99 # # The possible flags are: # # divide-by-zero : raised when a finite input gives a # mathematically infinite result. # # overflow : raised when a finite input gives a finite result that # is too large to fit in the usual range of an IEEE 754 double. # # invalid : raised for invalid inputs (e.g., sqrt(-1)) # # ignore-sign : indicates that the sign of the result is # unspecified; e.g., if the result is given as inf, # then both -inf and inf should be accepted as correct. # # Flags may appear in any order. # # Lines beginning with '--' (like this one) start a comment, and are # ignored. Blank lines, or lines containing only whitespace, are also # ignored. # Many of the values below were computed with the help of # version 2.4 of the MPFR library for multiple-precision # floating-point computations with correct rounding. All output # values in this file are (modulo yet-to-be-discovered bugs) # correctly rounded, provided that each input and output decimal # floating-point value below is interpreted as a representation of # the corresponding nearest IEEE 754 double-precision value. See the # MPFR homepage at http://www.mpfr.org for more information about the # MPFR project. import math from libtest import * from libulp import * doc="testcases" inf = float("inf") nan = float("nan") def tolerance(a, b, e): """Return if a-b is within tolerance e""" d = a - b if d < 0: d = -d if a != 0: e = e * a if e < 0: e = -e return d <= e def acc_check(what, want, got, rel_err=2e-15, abs_err = 5e-323): """Determine whether non-NaN floats a and b are equal to within a (small) rounding error. The default values for rel_err and abs_err are chosen to be suitable for platforms where a float is represented by an IEEE 754 double. They allow an error of between 9 and 19 ulps.""" # need to special case infinities, since inf - inf gives nan if math.isinf(want) and got == want: return error = got - want permitted_error = rel_err * abs(want) if abs_err > permitted_error: permitted_error = abs_err if abs(error) < permitted_error: return raise AssertionError("%s: want %g, got %g: error = %g; permitted error = %g" % (what, want, got, error, permitted_error)) def t(name, fn, x, want, exc=None): global doc doc = name if exc is None: got = fn(x) if math.isnan(want) and math.isnan(got): return if want == inf and got == inf: return if want == -inf and got == -inf: return if fn == math.lgamma: # we use a weaker accuracy test for lgamma; # lgamma only achieves an absolute error of # a few multiples of the machine accuracy, in # general. acc_check(doc, want, got, rel_err = 5e-15, abs_err = 5e-15) elif fn == math.erfc: # erfc has less-than-ideal accuracy for large # arguments (x ~ 25 or so), mainly due to the # error involved in computing exp(-x*x). # # XXX Would be better to weaken this test only # for large x, instead of for all x. ulps_check(doc, want, got, 2000) else: ulps_check(doc, want, got, 20) else: try: got = fn(x) except exc as e: pass else: assert False, "%s not raised" % exc # # erf: error function -- # t("erf0000", math.erf, 0.0, 0.0) t("erf0001", math.erf, -0.0, -0.0) t("erf0002", math.erf, inf, 1.0) t("erf0003", math.erf, -inf, -1.0) t("erf0004", math.erf, nan, nan) # tiny values t("erf0010", math.erf, 1e-308, 1.1283791670955125e-308) t("erf0011", math.erf, 5e-324, 4.9406564584124654e-324) t("erf0012", math.erf, 1e-10, 1.1283791670955126e-10) # small integers t("erf0020", math.erf, 1, 0.84270079294971489) t("erf0021", math.erf, 2, 0.99532226501895271) t("erf0022", math.erf, 3, 0.99997790950300136) t("erf0023", math.erf, 4, 0.99999998458274209) t("erf0024", math.erf, 5, 0.99999999999846256) t("erf0025", math.erf, 6, 1.0) t("erf0030", math.erf, -1, -0.84270079294971489) t("erf0031", math.erf, -2, -0.99532226501895271) t("erf0032", math.erf, -3, -0.99997790950300136) t("erf0033", math.erf, -4, -0.99999998458274209) t("erf0034", math.erf, -5, -0.99999999999846256) t("erf0035", math.erf, -6, -1.0) # huge values should all go to +/-1, depending on sign t("erf0040", math.erf, -40, -1.0) t("erf0041", math.erf, 1e16, 1.0) t("erf0042", math.erf, -1e150, -1.0) t("erf0043", math.erf, 1.7e308, 1.0) # Issue 8986: inputs x with exp(-x*x) near the underflow threshold # incorrectly signalled overflow on some platforms. t("erf0100", math.erf, 26.2, 1.0) t("erf0101", math.erf, 26.4, 1.0) t("erf0102", math.erf, 26.6, 1.0) t("erf0103", math.erf, 26.8, 1.0) t("erf0104", math.erf, 27.0, 1.0) t("erf0105", math.erf, 27.2, 1.0) t("erf0106", math.erf, 27.4, 1.0) t("erf0107", math.erf, 27.6, 1.0) t("erf0110", math.erf, -26.2, -1.0) t("erf0111", math.erf, -26.4, -1.0) t("erf0112", math.erf, -26.6, -1.0) t("erf0113", math.erf, -26.8, -1.0) t("erf0114", math.erf, -27.0, -1.0) t("erf0115", math.erf, -27.2, -1.0) t("erf0116", math.erf, -27.4, -1.0) t("erf0117", math.erf, -27.6, -1.0) # # erfc: complementary error function -- # t("erfc0000", math.erfc, 0.0, 1.0) t("erfc0001", math.erfc, -0.0, 1.0) t("erfc0002", math.erfc, inf, 0.0) t("erfc0003", math.erfc, -inf, 2.0) t("erfc0004", math.erfc, nan, nan) # tiny values t("erfc0010", math.erfc, 1e-308, 1.0) t("erfc0011", math.erfc, 5e-324, 1.0) t("erfc0012", math.erfc, 1e-10, 0.99999999988716204) # small integers t("erfc0020", math.erfc, 1, 0.15729920705028513) t("erfc0021", math.erfc, 2, 0.0046777349810472662) t("erfc0022", math.erfc, 3, 2.2090496998585441e-05) t("erfc0023", math.erfc, 4, 1.541725790028002e-08) t("erfc0024", math.erfc, 5, 1.5374597944280349e-12) t("erfc0025", math.erfc, 6, 2.1519736712498913e-17) t("erfc0030", math.erfc, -1, 1.8427007929497148) t("erfc0031", math.erfc, -2, 1.9953222650189528) t("erfc0032", math.erfc, -3, 1.9999779095030015) t("erfc0033", math.erfc, -4, 1.9999999845827421) t("erfc0034", math.erfc, -5, 1.9999999999984626) t("erfc0035", math.erfc, -6, 2.0) # as x -> infinity, erfc(x) behaves like exp(-x*x)/x/sqrt(pi) t("erfc0040", math.erfc, 20, 5.3958656116079012e-176) t("erfc0041", math.erfc, 25, 8.3001725711965228e-274) # FIXME(underflows to 0) t("erfc0042", math.erfc, 27, 5.2370464393526292e-319) t("erfc0043", math.erfc, 28, 0.0) # huge values t("erfc0050", math.erfc, -40, 2.0) t("erfc0051", math.erfc, 1e16, 0.0) t("erfc0052", math.erfc, -1e150, 2.0) t("erfc0053", math.erfc, 1.7e308, 0.0) # Issue 8986: inputs x with exp(-x*x) near the underflow threshold # incorrectly signalled overflow on some platforms. t("erfc0100", math.erfc, 26.2, 1.6432507924389461e-300) t("erfc0101", math.erfc, 26.4, 4.4017768588035426e-305) t("erfc0102", math.erfc, 26.6, 1.0885125885442269e-309) # FIXME(underflows to 0) t("erfc0103", math.erfc, 26.8, 2.4849621571966629e-314) # FIXME(underflows to 0) t("erfc0104", math.erfc, 27.0, 5.2370464393526292e-319) # FIXME(underflows to 0) t("erfc0105", math.erfc, 27.2, 9.8813129168249309e-324) t("erfc0106", math.erfc, 27.4, 0.0) t("erfc0107", math.erfc, 27.6, 0.0) t("erfc0110", math.erfc, -26.2, 2.0) t("erfc0111", math.erfc, -26.4, 2.0) t("erfc0112", math.erfc, -26.6, 2.0) t("erfc0113", math.erfc, -26.8, 2.0) t("erfc0114", math.erfc, -27.0, 2.0) t("erfc0115", math.erfc, -27.2, 2.0) t("erfc0116", math.erfc, -27.4, 2.0) t("erfc0117", math.erfc, -27.6, 2.0) # # lgamma: log of absolute value of the gamma function -- # # special values t("lgam0000", math.lgamma, 0.0, inf, ValueError) t("lgam0001", math.lgamma, -0.0, inf, ValueError) t("lgam0002", math.lgamma, inf, inf) # FIXME(ValueError) t("lgam0003", math.lgamma, -inf, inf) t("lgam0004", math.lgamma, nan, nan) # negative integers t("lgam0010", math.lgamma, -1, inf, ValueError) t("lgam0011", math.lgamma, -2, inf, ValueError) t("lgam0012", math.lgamma, -1e16, inf, ValueError) t("lgam0013", math.lgamma, -1e300, inf, ValueError) t("lgam0014", math.lgamma, -1.79e308, inf, ValueError) # small positive integers give factorials t("lgam0020", math.lgamma, 1, 0.0) t("lgam0021", math.lgamma, 2, 0.0) t("lgam0022", math.lgamma, 3, 0.69314718055994529) t("lgam0023", math.lgamma, 4, 1.791759469228055) t("lgam0024", math.lgamma, 5, 3.1780538303479458) t("lgam0025", math.lgamma, 6, 4.7874917427820458) # half integers t("lgam0030", math.lgamma, 0.5, 0.57236494292470008) t("lgam0031", math.lgamma, 1.5, -0.12078223763524522) t("lgam0032", math.lgamma, 2.5, 0.28468287047291918) t("lgam0033", math.lgamma, 3.5, 1.2009736023470743) t("lgam0034", math.lgamma, -0.5, 1.2655121234846454) t("lgam0035", math.lgamma, -1.5, 0.86004701537648098) t("lgam0036", math.lgamma, -2.5, -0.056243716497674054) t("lgam0037", math.lgamma, -3.5, -1.309006684993042) # values near 0 t("lgam0040", math.lgamma, 0.1, 2.252712651734206) t("lgam0041", math.lgamma, 0.01, 4.5994798780420219) t("lgam0042", math.lgamma, 1e-8, 18.420680738180209) t("lgam0043", math.lgamma, 1e-16, 36.841361487904734) t("lgam0044", math.lgamma, 1e-30, 69.077552789821368) t("lgam0045", math.lgamma, 1e-160, 368.41361487904732) # FIXME(inaccurate) t("lgam0046", math.lgamma, 1e-308, 709.19620864216608) # FIXME(inaccurate) t("lgam0047", math.lgamma, 5.6e-309, 709.77602713741896) # FIXME(inaccurate) t("lgam0048", math.lgamma, 5.5e-309, 709.79404564292167) # FIXME(inaccurate) t("lgam0049", math.lgamma, 1e-309, 711.49879373516012) # FIXME(inaccurate) t("lgam0050", math.lgamma, 1e-323, 743.74692474082133) # FIXME(inaccurate) t("lgam0051", math.lgamma, 5e-324, 744.44007192138122) t("lgam0060", math.lgamma, -0.1, 2.3689613327287886) t("lgam0061", math.lgamma, -0.01, 4.6110249927528013) t("lgam0062", math.lgamma, -1e-8, 18.420680749724522) t("lgam0063", math.lgamma, -1e-16, 36.841361487904734) t("lgam0064", math.lgamma, -1e-30, 69.077552789821368) t("lgam0065", math.lgamma, -1e-160, 368.41361487904732) # FIXME(inaccurate) t("lgam0066", math.lgamma, -1e-308, 709.19620864216608) # FIXME(inaccurate) t("lgam0067", math.lgamma, -5.6e-309, 709.77602713741896) # FIXME(inaccurate) t("lgam0068", math.lgamma, -5.5e-309, 709.79404564292167) # FIXME(inaccurate) t("lgam0069", math.lgamma, -1e-309, 711.49879373516012) # FIXME(inaccurate) t("lgam0070", math.lgamma, -1e-323, 743.74692474082133) # FIXME(inaccurate) t("lgam0071", math.lgamma, -5e-324, 744.44007192138122) # values near negative integers t("lgam0080", math.lgamma, -0.99999999999999989, 36.736800569677101) t("lgam0081", math.lgamma, -1.0000000000000002, 36.043653389117154) t("lgam0082", math.lgamma, -1.9999999999999998, 35.350506208557213) t("lgam0083", math.lgamma, -2.0000000000000004, 34.657359027997266) t("lgam0084", math.lgamma, -100.00000000000001, -331.85460524980607) t("lgam0085", math.lgamma, -99.999999999999986, -331.85460524980596) # large inputs t("lgam0100", math.lgamma, 170, 701.43726380873704) t("lgam0101", math.lgamma, 171, 706.57306224578736) t("lgam0102", math.lgamma, 171.624, 709.78077443669895) t("lgam0103", math.lgamma, 171.625, 709.78591682948365) t("lgam0104", math.lgamma, 172, 711.71472580228999) t("lgam0105", math.lgamma, 2000, 13198.923448054265) t("lgam0106", math.lgamma, 2.55998332785163e305, 1.7976931348623099e+308) t("lgam0107", math.lgamma, 2.55998332785164e305, inf, OverflowError) t("lgam0108", math.lgamma, 1.7e308, inf, OverflowError) # inputs for which gamma(x) is tiny t("lgam0120", math.lgamma, -100.5, -364.90096830942736) t("lgam0121", math.lgamma, -160.5, -656.88005261126432) t("lgam0122", math.lgamma, -170.5, -707.99843314507882) t("lgam0123", math.lgamma, -171.5, -713.14301641168481) t("lgam0124", math.lgamma, -176.5, -738.95247590846486) t("lgam0125", math.lgamma, -177.5, -744.13144651738037) t("lgam0126", math.lgamma, -178.5, -749.3160351186001) t("lgam0130", math.lgamma, -1000.5, -5914.4377011168517) t("lgam0131", math.lgamma, -30000.5, -279278.6629959144) # FIXME t("lgam0132", math.lgamma, -4503599627370495.5, -1.5782258434492883e+17) # results close to 0: positive argument ... t("lgam0150", math.lgamma, 0.99999999999999989, 6.4083812134800075e-17) t("lgam0151", math.lgamma, 1.0000000000000002, -1.2816762426960008e-16) t("lgam0152", math.lgamma, 1.9999999999999998, -9.3876980655431170e-17) t("lgam0153", math.lgamma, 2.0000000000000004, 1.8775396131086244e-16) # ... and negative argument # these are very inaccurate in python3 t("lgam0160", math.lgamma, -2.7476826467, -5.2477408147689136e-11) t("lgam0161", math.lgamma, -2.457024738, 3.3464637541912932e-10) # # gamma: Gamma function -- # # special values t("gam0000", math.gamma, 0.0, inf, ValueError) t("gam0001", math.gamma, -0.0, -inf, ValueError) t("gam0002", math.gamma, inf, inf) t("gam0003", math.gamma, -inf, nan, ValueError) t("gam0004", math.gamma, nan, nan) # negative integers inputs are invalid t("gam0010", math.gamma, -1, nan, ValueError) t("gam0011", math.gamma, -2, nan, ValueError) t("gam0012", math.gamma, -1e16, nan, ValueError) t("gam0013", math.gamma, -1e300, nan, ValueError) # small positive integers give factorials t("gam0020", math.gamma, 1, 1) t("gam0021", math.gamma, 2, 1) t("gam0022", math.gamma, 3, 2) t("gam0023", math.gamma, 4, 6) t("gam0024", math.gamma, 5, 24) t("gam0025", math.gamma, 6, 120) # half integers t("gam0030", math.gamma, 0.5, 1.7724538509055161) t("gam0031", math.gamma, 1.5, 0.88622692545275805) t("gam0032", math.gamma, 2.5, 1.3293403881791370) t("gam0033", math.gamma, 3.5, 3.3233509704478426) t("gam0034", math.gamma, -0.5, -3.5449077018110322) t("gam0035", math.gamma, -1.5, 2.3632718012073548) t("gam0036", math.gamma, -2.5, -0.94530872048294190) t("gam0037", math.gamma, -3.5, 0.27008820585226911) # values near 0 t("gam0040", math.gamma, 0.1, 9.5135076986687306) t("gam0041", math.gamma, 0.01, 99.432585119150602) t("gam0042", math.gamma, 1e-8, 99999999.422784343) t("gam0043", math.gamma, 1e-16, 10000000000000000) t("gam0044", math.gamma, 1e-30, 9.9999999999999988e+29) t("gam0045", math.gamma, 1e-160, 1.0000000000000000e+160) t("gam0046", math.gamma, 1e-308, 1.0000000000000000e+308) t("gam0047", math.gamma, 5.6e-309, 1.7857142857142848e+308) t("gam0048", math.gamma, 5.5e-309, inf, OverflowError) t("gam0049", math.gamma, 1e-309, inf, OverflowError) t("gam0050", math.gamma, 1e-323, inf, OverflowError) t("gam0051", math.gamma, 5e-324, inf, OverflowError) t("gam0060", math.gamma, -0.1, -10.686287021193193) t("gam0061", math.gamma, -0.01, -100.58719796441078) t("gam0062", math.gamma, -1e-8, -100000000.57721567) t("gam0063", math.gamma, -1e-16, -10000000000000000) t("gam0064", math.gamma, -1e-30, -9.9999999999999988e+29) t("gam0065", math.gamma, -1e-160, -1.0000000000000000e+160) t("gam0066", math.gamma, -1e-308, -1.0000000000000000e+308) t("gam0067", math.gamma, -5.6e-309, -1.7857142857142848e+308) t("gam0068", math.gamma, -5.5e-309, -inf, OverflowError) t("gam0069", math.gamma, -1e-309, -inf, OverflowError) t("gam0070", math.gamma, -1e-323, -inf, OverflowError) t("gam0071", math.gamma, -5e-324, -inf, OverflowError) # values near negative integers t("gam0080", math.gamma, -0.99999999999999989, -9007199254740992.0) t("gam0081", math.gamma, -1.0000000000000002, 4503599627370495.5) t("gam0082", math.gamma, -1.9999999999999998, 2251799813685248.5) t("gam0083", math.gamma, -2.0000000000000004, -1125899906842623.5) t("gam0084", math.gamma, -100.00000000000001, -7.5400833348831090e-145) t("gam0085", math.gamma, -99.999999999999986, 7.5400833348840962e-145) # large inputs t("gam0100", math.gamma, 170, 4.2690680090047051e+304) t("gam0101", math.gamma, 171, 7.2574156153079990e+306) # FIXME(overflows) t("gam0102", math.gamma, 171.624, 1.7942117599248104e+308) t("gam0103", math.gamma, 171.625, inf, OverflowError) t("gam0104", math.gamma, 172, inf, OverflowError) t("gam0105", math.gamma, 2000, inf, OverflowError) t("gam0106", math.gamma, 1.7e308, inf, OverflowError) # inputs for which gamma(x) is tiny t("gam0120", math.gamma, -100.5, -3.3536908198076787e-159) t("gam0121", math.gamma, -160.5, -5.2555464470078293e-286) t("gam0122", math.gamma, -170.5, -3.3127395215386074e-308) # Reported as https://github.com/golang/go/issues/11441 # FIXME(overflows) t("gam0123", math.gamma, -171.5, 1.9316265431711902e-310) # FIXME(overflows) t("gam0124", math.gamma, -176.5, -1.1956388629358166e-321) # FIXME(overflows) t("gam0125", math.gamma, -177.5, 4.9406564584124654e-324) # FIXME(overflows) t("gam0126", math.gamma, -178.5, -0.0) # FIXME(overflows) t("gam0127", math.gamma, -179.5, 0.0) # FIXME(overflows) t("gam0128", math.gamma, -201.0001, 0.0) # FIXME(overflows) t("gam0129", math.gamma, -202.9999, -0.0) # FIXME(overflows) t("gam0130", math.gamma, -1000.5, -0.0) # FIXME(overflows) t("gam0131", math.gamma, -1000000000.3, -0.0) # FIXME(overflows) t("gam0132", math.gamma, -4503599627370495.5, 0.0) # inputs that cause problems for the standard reflection formula, # thanks to loss of accuracy in 1-x t("gam0140", math.gamma, -63.349078729022985, 4.1777971677761880e-88) t("gam0141", math.gamma, -127.45117632943295, 1.1831110896236810e-214) # # log1p: log(1 + x), without precision loss for small x -- # # special values t("log1p0000", math.log1p, 0.0, 0.0) t("log1p0001", math.log1p, -0.0, -0.0) t("log1p0002", math.log1p, inf, inf) t("log1p0003", math.log1p, -inf, nan, ValueError) t("log1p0004", math.log1p, nan, nan) # singularity at -1.0 t("log1p0010", math.log1p, -1.0, -inf, ValueError) t("log1p0011", math.log1p, -0.9999999999999999, -36.736800569677101) # finite values < 1.0 are invalid t("log1p0020", math.log1p, -1.0000000000000002, nan, ValueError) t("log1p0021", math.log1p, -1.1, nan, ValueError) t("log1p0022", math.log1p, -2.0, nan, ValueError) t("log1p0023", math.log1p, -1e300, nan, ValueError) # tiny x: log1p(x) ~ x t("log1p0110", math.log1p, 5e-324, 5e-324) t("log1p0111", math.log1p, 1e-320, 1e-320) t("log1p0112", math.log1p, 1e-300, 1e-300) t("log1p0113", math.log1p, 1e-150, 1e-150) t("log1p0114", math.log1p, 1e-20, 1e-20) t("log1p0120", math.log1p, -5e-324, -5e-324) t("log1p0121", math.log1p, -1e-320, -1e-320) t("log1p0122", math.log1p, -1e-300, -1e-300) t("log1p0123", math.log1p, -1e-150, -1e-150) t("log1p0124", math.log1p, -1e-20, -1e-20) # some (mostly) random small and moderate-sized values t("log1p0200", math.log1p, -0.89156889782277482, -2.2216403106762863) t("log1p0201", math.log1p, -0.23858496047770464, -0.27257668276980057) t("log1p0202", math.log1p, -0.011641726191307515, -0.011710021654495657) t("log1p0203", math.log1p, -0.0090126398571693817, -0.0090534993825007650) t("log1p0204", math.log1p, -0.00023442805985712781, -0.00023445554240995693) t("log1p0205", math.log1p, -1.5672870980936349e-5, -1.5672993801662046e-5) t("log1p0206", math.log1p, -7.9650013274825295e-6, -7.9650330482740401e-6) t("log1p0207", math.log1p, -2.5202948343227410e-7, -2.5202951519170971e-7) t("log1p0208", math.log1p, -8.2446372820745855e-11, -8.2446372824144559e-11) t("log1p0209", math.log1p, -8.1663670046490789e-12, -8.1663670046824230e-12) t("log1p0210", math.log1p, 7.0351735084656292e-18, 7.0351735084656292e-18) t("log1p0211", math.log1p, 5.2732161907375226e-12, 5.2732161907236188e-12) t("log1p0212", math.log1p, 1.0000000000000000e-10, 9.9999999995000007e-11) t("log1p0213", math.log1p, 2.1401273266000197e-9, 2.1401273243099470e-9) t("log1p0214", math.log1p, 1.2668914653979560e-8, 1.2668914573728861e-8) t("log1p0215", math.log1p, 1.6250007816299069e-6, 1.6249994613175672e-6) t("log1p0216", math.log1p, 8.3740495645839399e-6, 8.3740145024266269e-6) t("log1p0217", math.log1p, 3.0000000000000001e-5, 2.9999550008999799e-5) t("log1p0218", math.log1p, 0.0070000000000000001, 0.0069756137364252423) t("log1p0219", math.log1p, 0.013026235315053002, 0.012942123564008787) t("log1p0220", math.log1p, 0.013497160797236184, 0.013406885521915038) t("log1p0221", math.log1p, 0.027625599078135284, 0.027250897463483054) t("log1p0222", math.log1p, 0.14179687245544870, 0.13260322540908789) # large values t("log1p0300", math.log1p, 1.7976931348623157e+308, 709.78271289338397) t("log1p0301", math.log1p, 1.0000000000000001e+300, 690.77552789821368) t("log1p0302", math.log1p, 1.0000000000000001e+70, 161.18095650958321) t("log1p0303", math.log1p, 10000000000.000000, 23.025850930040455) # other values transferred from testLog1p in test_math t("log1p0400", math.log1p, -0.63212055882855767, -1.0000000000000000) t("log1p0401", math.log1p, 1.7182818284590451, 1.0000000000000000) t("log1p0402", math.log1p, 1.0000000000000000, 0.69314718055994529) t("log1p0403", math.log1p, 1.2379400392853803e+27, 62.383246250395075) # # expm1: exp(x) - 1, without precision loss for small x -- # # special values t("expm10000", math.expm1, 0.0, 0.0) t("expm10001", math.expm1, -0.0, -0.0) t("expm10002", math.expm1, inf, inf) t("expm10003", math.expm1, -inf, -1.0) t("expm10004", math.expm1, nan, nan) # expm1(x) ~ x for tiny x t("expm10010", math.expm1, 5e-324, 5e-324) t("expm10011", math.expm1, 1e-320, 1e-320) t("expm10012", math.expm1, 1e-300, 1e-300) t("expm10013", math.expm1, 1e-150, 1e-150) t("expm10014", math.expm1, 1e-20, 1e-20) t("expm10020", math.expm1, -5e-324, -5e-324) t("expm10021", math.expm1, -1e-320, -1e-320) t("expm10022", math.expm1, -1e-300, -1e-300) t("expm10023", math.expm1, -1e-150, -1e-150) t("expm10024", math.expm1, -1e-20, -1e-20) # moderate sized values, where direct evaluation runs into trouble t("expm10100", math.expm1, 1e-10, 1.0000000000500000e-10) t("expm10101", math.expm1, -9.9999999999999995e-08, -9.9999995000000163e-8) t("expm10102", math.expm1, 3.0000000000000001e-05, 3.0000450004500034e-5) t("expm10103", math.expm1, -0.0070000000000000001, -0.0069755570667648951) t("expm10104", math.expm1, -0.071499208740094633, -0.069002985744820250) t("expm10105", math.expm1, -0.063296004180116799, -0.061334416373633009) t("expm10106", math.expm1, 0.02390954035597756, 0.024197665143819942) t("expm10107", math.expm1, 0.085637352649044901, 0.089411184580357767) t("expm10108", math.expm1, 0.5966174947411006, 0.81596588596501485) t("expm10109", math.expm1, 0.30247206212075139, 0.35319987035848677) t("expm10110", math.expm1, 0.74574727375889516, 1.1080161116737459) t("expm10111", math.expm1, 0.97767512926555711, 1.6582689207372185) t("expm10112", math.expm1, 0.8450154566787712, 1.3280137976535897) t("expm10113", math.expm1, -0.13979260323125264, -0.13046144381396060) t("expm10114", math.expm1, -0.52899322039643271, -0.41080213643695923) t("expm10115", math.expm1, -0.74083261478900631, -0.52328317124797097) t("expm10116", math.expm1, -0.93847766984546055, -0.60877704724085946) t("expm10117", math.expm1, 10.0, 22025.465794806718) t("expm10118", math.expm1, 27.0, 532048240600.79865) t("expm10119", math.expm1, 123, 2.6195173187490626e+53) t("expm10120", math.expm1, -12.0, -0.99999385578764666) t("expm10121", math.expm1, -35.100000000000001, -0.99999999999999944) # extreme negative values t("expm10201", math.expm1, -37.0, -0.99999999999999989) t("expm10200", math.expm1, -38.0, -1.0) # FIXME(overflows) t("expm10210", math.expm1, -710.0, -1.0) # the formula expm1(x) = 2 * sinh(x/2) * exp(x/2) doesn't work so # well when exp(x/2) is subnormal or underflows to zero; check we're # not using it! # Reported as https://github.com/golang/go/issues/11442 # FIXME(overflows) t("expm10211", math.expm1, -1420.0, -1.0) # FIXME(overflows) t("expm10212", math.expm1, -1450.0, -1.0) # FIXME(overflows) t("expm10213", math.expm1, -1500.0, -1.0) # FIXME(overflows) t("expm10214", math.expm1, -1e50, -1.0) # FIXME(overflows) t("expm10215", math.expm1, -1.79e308, -1.0) # extreme positive values # FIXME(fails on 32 bit) t("expm10300", math.expm1, 300, 1.9424263952412558e+130) # FIXME(fails on 32 bit) t("expm10301", math.expm1, 700, 1.0142320547350045e+304) # the next test (expm10302) is disabled because it causes failure on # OS X 10.4/Intel: apparently all values over 709.78 produce an # overflow on that platform. See issue #7575. # expm10302 expm1 709.78271289328393 -> 1.7976931346824240e+308 t("expm10303", math.expm1, 709.78271289348402, inf, OverflowError) t("expm10304", math.expm1, 1000, inf, OverflowError) t("expm10305", math.expm1, 1e50, inf, OverflowError) t("expm10306", math.expm1, 1.79e308, inf, OverflowError) # weaker version of expm10302 # FIXME(fails on 32 bit) t("expm10307", math.expm1, 709.5, 1.3549863193146328e+308) # # log2: log to base 2 -- # # special values t("log20000", math.log2, 0.0, -inf, ValueError) t("log20001", math.log2, -0.0, -inf, ValueError) t("log20002", math.log2, inf, inf) t("log20003", math.log2, -inf, nan, ValueError) t("log20004", math.log2, nan, nan) # exact value at 1.0 t("log20010", math.log2, 1.0, 0.0) # negatives t("log20020", math.log2, -5e-324, nan, ValueError) t("log20021", math.log2, -1.0, nan, ValueError) t("log20022", math.log2, -1.7e-308, nan, ValueError) # exact values at powers of 2 t("log20100", math.log2, 2.0, 1.0) t("log20101", math.log2, 4.0, 2.0) t("log20102", math.log2, 8.0, 3.0) t("log20103", math.log2, 16.0, 4.0) t("log20104", math.log2, 32.0, 5.0) t("log20105", math.log2, 64.0, 6.0) t("log20106", math.log2, 128.0, 7.0) t("log20107", math.log2, 256.0, 8.0) t("log20108", math.log2, 512.0, 9.0) t("log20109", math.log2, 1024.0, 10.0) t("log20110", math.log2, 2048.0, 11.0) t("log20200", math.log2, 0.5, -1.0) t("log20201", math.log2, 0.25, -2.0) t("log20202", math.log2, 0.125, -3.0) t("log20203", math.log2, 0.0625, -4.0) # values close to 1.0 # FIXME(inaccurate) t("log20300", math.log2, 1.0000000000000002, 3.2034265038149171e-16) # FIXME(inaccurate) t("log20301", math.log2, 1.0000000001, 1.4426951601859516e-10) # FIXME(inaccurate) t("log20302", math.log2, 1.00001, 1.4426878274712997e-5) t("log20310", math.log2, 0.9999999999999999, -1.6017132519074588e-16) t("log20311", math.log2, 0.9999999999, -1.4426951603302210e-10) t("log20312", math.log2, 0.99999, -1.4427022544056922e-5) # tiny values t("log20400", math.log2, 5e-324, -1074.0) t("log20401", math.log2, 1e-323, -1073.0) t("log20402", math.log2, 1.5e-323, -1072.4150374992789) t("log20403", math.log2, 2e-323, -1072.0) t("log20410", math.log2, 1e-308, -1023.1538532253076) t("log20411", math.log2, 2.2250738585072014e-308, -1022.0) t("log20412", math.log2, 4.4501477170144028e-308, -1021.0) t("log20413", math.log2, 1e-307, -1019.8319251304202) # huge values t("log20500", math.log2, 1.7976931348623157e+308, 1024.0) t("log20501", math.log2, 1.7e+308, 1023.9193879716706) t("log20502", math.log2, 8.9884656743115795e+307, 1023.0) # selection of random values t("log20600", math.log2, -7.2174324841039838e+289, nan, ValueError) t("log20601", math.log2, -2.861319734089617e+265, nan, ValueError) t("log20602", math.log2, -4.3507646894008962e+257, nan, ValueError) t("log20603", math.log2, -6.6717265307520224e+234, nan, ValueError) t("log20604", math.log2, -3.9118023786619294e+229, nan, ValueError) t("log20605", math.log2, -1.5478221302505161e+206, nan, ValueError) t("log20606", math.log2, -1.4380485131364602e+200, nan, ValueError) t("log20607", math.log2, -3.7235198730382645e+185, nan, ValueError) t("log20608", math.log2, -1.0472242235095724e+184, nan, ValueError) t("log20609", math.log2, -5.0141781956163884e+160, nan, ValueError) t("log20610", math.log2, -2.1157958031160324e+124, nan, ValueError) t("log20611", math.log2, -7.9677558612567718e+90, nan, ValueError) t("log20612", math.log2, -5.5553906194063732e+45, nan, ValueError) t("log20613", math.log2, -16573900952607.953, nan, ValueError) t("log20614", math.log2, -37198371019.888618, nan, ValueError) t("log20615", math.log2, -6.0727115121422674e-32, nan, ValueError) t("log20616", math.log2, -2.5406841656526057e-38, nan, ValueError) t("log20617", math.log2, -4.9056766703267657e-43, nan, ValueError) t("log20618", math.log2, -2.1646786075228305e-71, nan, ValueError) t("log20619", math.log2, -2.470826790488573e-78, nan, ValueError) t("log20620", math.log2, -3.8661709303489064e-165, nan, ValueError) t("log20621", math.log2, -1.0516496976649986e-182, nan, ValueError) t("log20622", math.log2, -1.5935458614317996e-255, nan, ValueError) t("log20623", math.log2, -2.8750977267336654e-293, nan, ValueError) t("log20624", math.log2, -7.6079466794732585e-296, nan, ValueError) t("log20625", math.log2, 3.2073253539988545e-307, -1018.1505544209213) t("log20626", math.log2, 1.674937885472249e-244, -809.80634755783126) t("log20627", math.log2, 1.0911259044931283e-214, -710.76679472274213) t("log20628", math.log2, 2.0275372624809709e-154, -510.55719818383272) t("log20629", math.log2, 7.3926087369631841e-115, -379.13564735312292) t("log20630", math.log2, 1.3480198206342423e-86, -285.25497445094436) t("log20631", math.log2, 8.9927384655719947e-83, -272.55127136401637) t("log20632", math.log2, 3.1452398713597487e-60, -197.66251564496875) t("log20633", math.log2, 7.0706573215457351e-55, -179.88420087782217) t("log20634", math.log2, 3.1258285390731669e-49, -161.13023800505653) t("log20635", math.log2, 8.2253046627829942e-41, -133.15898277355879) t("log20636", math.log2, 7.8691367397519897e+49, 165.75068202732419) t("log20637", math.log2, 2.9920561983925013e+64, 214.18453534573757) t("log20638", math.log2, 4.7827254553946841e+77, 258.04629628445673) t("log20639", math.log2, 3.1903566496481868e+105, 350.47616767491166) t("log20640", math.log2, 5.6195082449502419e+113, 377.86831861008250) t("log20641", math.log2, 9.9625658250651047e+125, 418.55752921228753) t("log20642", math.log2, 2.7358945220961532e+145, 483.13158636923413) t("log20643", math.log2, 2.785842387926931e+174, 579.49360214860280) t("log20644", math.log2, 2.4169172507252751e+193, 642.40529039289652) t("log20645", math.log2, 3.1689091206395632e+205, 682.65924573798395) t("log20646", math.log2, 2.535995592365391e+208, 692.30359597460460) t("log20647", math.log2, 6.2011236566089916e+233, 776.64177576730913) t("log20648", math.log2, 2.1843274820677632e+253, 841.57499717289647) t("log20649", math.log2, 8.7493931063474791e+297, 989.74182713073981) doc="finished"
43.034965
125
0.70819
4,612
30,770
4.719861
0.28144
0.033444
0.023153
0.008085
0.17953
0.153804
0.119166
0.065968
0.049798
0.022234
0
0.370685
0.11599
30,770
714
126
43.095238
0.42958
0.249041
0
0.022624
0
0.002262
0.140467
0
0
0
0
0.001401
0.004525
1
0.006787
false
0.002262
0.006787
0
0.027149
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
ff88e0f5ccecc3c701f512768bb897a2dfbe68cb
1,035
py
Python
sis-api/test/bdd/steps/membership.serialization.py
maxbilbow/7054CEM-sis
1c5067c9afc38e340fcce046048f8ae21d267365
[ "MIT" ]
null
null
null
sis-api/test/bdd/steps/membership.serialization.py
maxbilbow/7054CEM-sis
1c5067c9afc38e340fcce046048f8ae21d267365
[ "MIT" ]
null
null
null
sis-api/test/bdd/steps/membership.serialization.py
maxbilbow/7054CEM-sis
1c5067c9afc38e340fcce046048f8ae21d267365
[ "MIT" ]
null
null
null
from datetime import date from behave import * from core.model import to_dict from core.model.membership import Membership from core.model.membership_type import MembershipType from core.utils.serialization import serialize use_step_matcher("re") @when("a serialized membership is requested") def step_impl(context): """ :type context: behave.runner.Context """ context.dict = serialize(context.membership).for_api() @given("a membership is created with date (?P<date_string>.+)") def step_impl(context, date_string: str): """ :type context: behave.runner.Context :type date: str """ date_obj = date.fromisoformat(date_string) context.membership = Membership(id=1, user_id=1,start_date=date_obj, end_date=date_obj, type=MembershipType.Smart) @then("the dates are converted to ISO date format (?P<date_string>.+)") def step_impl(context, date_string: str): """ :type context: behave.runner.Context :type date: str """ assert context.dict["start_date"] == date_string
27.236842
118
0.72657
142
1,035
5.147887
0.366197
0.082079
0.053352
0.073871
0.268126
0.227086
0.227086
0.227086
0.227086
0.227086
0
0.002291
0.156522
1,035
37
119
27.972973
0.835052
0.137198
0
0.117647
0
0
0.194279
0
0
0
0
0
0.058824
1
0.176471
false
0
0.352941
0
0.529412
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
ffb515697db4de0f590ab614acfa4b387f024c15
482
py
Python
io_scene_vrm/editor/extension.py
989onan/VRM_Addon_for_Blender
af894a87bdf2bc02b69842c6de082f097f1e0939
[ "MIT" ]
344
2021-02-09T15:06:26.000Z
2022-03-31T07:13:40.000Z
io_scene_vrm/editor/extension.py
989onan/VRM_Addon_for_Blender
af894a87bdf2bc02b69842c6de082f097f1e0939
[ "MIT" ]
47
2021-02-06T23:44:43.000Z
2022-03-22T21:45:21.000Z
io_scene_vrm/editor/extension.py
989onan/VRM_Addon_for_Blender
af894a87bdf2bc02b69842c6de082f097f1e0939
[ "MIT" ]
44
2021-02-21T14:15:38.000Z
2022-03-31T01:53:12.000Z
import bpy from .vrm0.property_group import Vrm0PropertyGroup class VrmAddonArmatureExtensionPropertyGroup(bpy.types.PropertyGroup): # type: ignore[misc] addon_version: bpy.props.IntVectorProperty( # type: ignore[valid-type] size=3 # noqa: F722 ) vrm0: bpy.props.PointerProperty( # type: ignore[valid-type] name="VRM 0.x", type=Vrm0PropertyGroup # noqa: F722 ) armature_data_name: bpy.props.StringProperty() # type: ignore[valid-type]
30.125
92
0.715768
55
482
6.2
0.563636
0.117302
0.131965
0.167155
0
0
0
0
0
0
0
0.030227
0.176349
482
15
93
32.133333
0.828715
0.238589
0
0
0
0
0.019444
0
0
0
0
0
0
1
0
true
0
0.2
0
0.6
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
44155aabada0f13fedb7c839b6f8e15ee94c7153
327
py
Python
gz.17zwd.com/17wang.py
zzh-python/all-project
915a47fb42d63ff3a36814992283c2f4ed8703a3
[ "Apache-2.0" ]
58
2019-03-01T08:15:19.000Z
2022-03-28T03:16:17.000Z
gz.17zwd.com/17wang.py
zzh-python/all-project
915a47fb42d63ff3a36814992283c2f4ed8703a3
[ "Apache-2.0" ]
2
2020-06-08T08:07:46.000Z
2020-11-02T11:48:05.000Z
gz.17zwd.com/17wang.py
zzh-python/all-project
915a47fb42d63ff3a36814992283c2f4ed8703a3
[ "Apache-2.0" ]
37
2019-02-26T23:30:08.000Z
2022-01-27T05:10:18.000Z
from bs4 import BeautifulSoup import requests import csv import sys from urllib.error import HTTPError sys.path.append("..") import mytemp import time import json url='https://gz.17zwd.com/api/shop/get-list/73' resp=requests.get(url) f=open('17wang.txt','w+',encoding='utf-8') f.write(resp.text) print(resp.text)
21.8
48
0.730887
53
327
4.509434
0.698113
0.066946
0
0
0
0
0
0
0
0
0
0.027875
0.122324
327
15
49
21.8
0.804878
0
0
0
0
0
0.191083
0
0
0
0
0
0
1
0
false
0
0.571429
0
0.571429
0.071429
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
4453e7148b48df800b321d8e53272108159d1a65
346
py
Python
login.py
kepler0301/test_git
22b42b627b26224fff0bef29e43937b6a08c968a
[ "MIT" ]
1
2018-12-27T12:58:46.000Z
2018-12-27T12:58:46.000Z
login.py
kepler0301/test_git
22b42b627b26224fff0bef29e43937b6a08c968a
[ "MIT" ]
null
null
null
login.py
kepler0301/test_git
22b42b627b26224fff0bef29e43937b6a08c968a
[ "MIT" ]
null
null
null
print('helo world') <<<<<<< HEAD from flask import Flask app = Flask(__name__) def index(): return 'hello world' id __name__ == '__main__' app.run() ======= from flask import Flask app = Flask(__name__) @app/route('/') def index(): return 'hello world' >>>>>>> b644c89d3eb5e1fcd31fedf63470ab57d597d9dd print('bey') num1 = 40
13.307692
48
0.647399
40
346
5.2
0.525
0.086538
0.144231
0.192308
0.538462
0.307692
0.307692
0
0
0
0
0.084507
0.179191
346
25
49
13.84
0.647887
0
0
0.470588
0
0
0.127168
0
0
0
0
0
0
0
null
null
0
0.117647
null
null
0.117647
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
1
0
0
0
0
0
0
0
0
2
4457c61974adf6ea23263c3521814d88592f3989
198
py
Python
translateSfw.py
tkarabela/translate-swf
4756079294de9faa55d95b320d9b8a5ae6c40104
[ "MIT" ]
1
2022-03-15T21:44:50.000Z
2022-03-15T21:44:50.000Z
translateSfw.py
tkarabela/translate-swf
4756079294de9faa55d95b320d9b8a5ae6c40104
[ "MIT" ]
null
null
null
translateSfw.py
tkarabela/translate-swf
4756079294de9faa55d95b320d9b8a5ae6c40104
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import pyTranslateSwf import sys def main(): cli = pyTranslateSwf.PyTranslateSwfCLI() return cli.run(sys.argv[1:]) if __name__ == '__main__': sys.exit(main())
15.230769
44
0.681818
25
198
5.08
0.72
0
0
0
0
0
0
0
0
0
0
0.012195
0.171717
198
12
45
16.5
0.762195
0.106061
0
0
0
0
0.045455
0
0
0
0
0
0
1
0.142857
false
0
0.285714
0
0.571429
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
44588a8251975fab2aceaf05fcf35cad8b89e5fe
656
py
Python
GT/GT_app/models.py
10K-Linesofcode/Glowing-Tribble
be0e17ce5391b589792e4ae6b02156d7ee4ce145
[ "MIT" ]
null
null
null
GT/GT_app/models.py
10K-Linesofcode/Glowing-Tribble
be0e17ce5391b589792e4ae6b02156d7ee4ce145
[ "MIT" ]
null
null
null
GT/GT_app/models.py
10K-Linesofcode/Glowing-Tribble
be0e17ce5391b589792e4ae6b02156d7ee4ce145
[ "MIT" ]
null
null
null
from __future__ import unicode_literals from django.db import models # Create your models here. class Topic(models.Model): top_name= models.CharField(max_length=264,unique=True) def __str__(self): return self.top_name class Webpage(models.Model): topic=models.ForeignKey(Topic,on_delete=models.DO_NOTHING) name=models.CharField(max_length=264,unique=True) url=models.URLField(unique=True) def __str__(self): return self.name class AccessRecord(models.Model): name=models.ForeignKey(Webpage,on_delete=models.DO_NOTHING) date = models.DateField() def __str__(self): return str(self.date)
22.62069
63
0.731707
89
656
5.11236
0.41573
0.061538
0.065934
0.105495
0.391209
0.29011
0.29011
0.18022
0
0
0
0.010989
0.167683
656
28
64
23.428571
0.822344
0.036585
0
0.176471
0
0
0
0
0
0
0
0
0
1
0.176471
false
0
0.117647
0.176471
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
4461eff877eb304b062070484689204017151234
150
py
Python
A/A 1030 In Search of an Easy Problem.py
zielman/Codeforces-solutions
636f11a9eb10939d09d2e50ddc5ec53327d0b7ab
[ "MIT" ]
null
null
null
A/A 1030 In Search of an Easy Problem.py
zielman/Codeforces-solutions
636f11a9eb10939d09d2e50ddc5ec53327d0b7ab
[ "MIT" ]
1
2021-05-05T17:05:03.000Z
2021-05-05T17:05:03.000Z
A/A 1030 In Search of an Easy Problem.py
zielman/Codeforces-solutions
636f11a9eb10939d09d2e50ddc5ec53327d0b7ab
[ "MIT" ]
null
null
null
# https://codeforces.com/problemset/problem/1030/A n = int(input()) o = list(map(int, input().split())) print('HARD' if o.count(1) != 0 else 'EASY')
25
50
0.646667
25
150
3.88
0.88
0.164948
0
0
0
0
0
0
0
0
0
0.045113
0.113333
150
6
51
25
0.684211
0.32
0
0
0
0
0.079208
0
0
0
0
0
0
1
0
false
0
0
0
0
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
44631cbd82bde4053d51f4b0bd82dc77e1e5e801
1,290
py
Python
diplomacy_research/models/gym/__init__.py
wwongkamjan/dipnet_press
787263c1b9484698904f525c8d78d0e333e1c0d9
[ "MIT" ]
39
2019-09-06T13:42:24.000Z
2022-03-18T18:38:43.000Z
diplomacy_research/models/gym/__init__.py
wwongkamjan/dipnet_press
787263c1b9484698904f525c8d78d0e333e1c0d9
[ "MIT" ]
9
2019-09-19T22:35:32.000Z
2022-02-24T18:04:57.000Z
diplomacy_research/models/gym/__init__.py
wwongkamjan/dipnet_press
787263c1b9484698904f525c8d78d0e333e1c0d9
[ "MIT" ]
8
2019-10-16T21:09:14.000Z
2022-02-23T05:20:37.000Z
# ============================================================================== # Copyright 2019 - Philip Paquette # # NOTICE: Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # ============================================================================== """ OpenAI Gym integration modules """ import warnings from gym.envs.registration import register from diplomacy_research.models.gym.wrappers import AutoDraw, LimitNumberYears, LoopDetection, SetInitialState, \ AssignPlayers, RandomizePlayers, SetPlayerSeed, SaveGame # Ignore specific warnings warnings.filterwarnings('ignore', message='Parameters to load are deprecated') register( id='DiplomacyEnv-v0', entry_point='diplomacy_research.models.gym.environment:DiplomacyEnv')
49.615385
112
0.684496
143
1,290
6.153846
0.65035
0.0625
0.029545
0.059091
0
0
0
0
0
0
0
0.004476
0.134109
1,290
25
113
51.6
0.783348
0.644186
0
0
0
0
0.246014
0.123007
0
0
0
0
0
1
0
true
0
0.375
0
0.375
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
446910272f530e7a9c174ed37e4268b3d0995159
29,890
py
Python
src/rc_icons.py
lmdu/dockey
a8ae34c780c952cb26270a173de08897b34c7252
[ "MIT" ]
null
null
null
src/rc_icons.py
lmdu/dockey
a8ae34c780c952cb26270a173de08897b34c7252
[ "MIT" ]
null
null
null
src/rc_icons.py
lmdu/dockey
a8ae34c780c952cb26270a173de08897b34c7252
[ "MIT" ]
null
null
null
# Resource object code (Python 3) # Created by: object code # Created by: The Resource Compiler for Qt version 6.3.0 # WARNING! All changes made in this file will be lost! from PySide6 import QtCore qt_resource_data = b"\ \x00\x00\x02\xd8\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<g>\ \x0d\x0a\x09<path d=\x22M9,4\ c2.8,0,5,2.2,5,5\ s-2.2,5-5,5s-5-2\ .2-5-5S6.2,4,9,4\ M9,3C5.7,3,3,5.\ 7,3,9s2.7,6,6,6s\ 6-2.7,6-6S12.3,3\ ,9,3L9,3z\x22/>\x0d\x0a</\ g>\x0d\x0a<path d=\x22M15\ .9,8h1.6C17.8,8,\ 18,8.2,18,8.5v9c\ 0,0.3-0.2,0.5-0.\ 5,0.5h-9C8.2,18,\ 8,17.8,8,17.5v-1\ .6c-0.3,0-0.7-0.\ 1-1-0.2v1.8\x0d\x0a\x09C7\ ,18.3,7.7,19,8.5\ ,19l0,0h9c0.8,0,\ 1.5-0.7,1.5-1.5l\ 0,0v-9C19,7.7,18\ .3,7,17.5,7h-1.8\ C15.8,7.3,15.9,7\ .7,15.9,8z\x22/>\x0d\x0a<\ /svg>\x0d\x0a\ \x00\x00\x03\x13\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M9,12c0-0.\ 3,0.2-0.5,0.5-0.\ 5h3c0.3,0,0.5,0.\ 2,0.5,0.5s-0.2,0\ .5-0.5,0.5h-3C9.\ 2,12.5,9,12.3,9,\ 12z M6.9,7.1\x0d\x0a\x09C\ 6.7,7,6.3,7,6.1,\ 7.1S6,7.7,6.1,7.\ 9l0,0l1.6,1.6l-1\ .6,1.6c-0.2,0.2-\ 0.2,0.5,0,0.7s0.\ 5,0.2,0.7,0l2-2C\ 9,9.7,9,9.3,8.9,\ 9.1l0,0\x0d\x0a\x09L6.9,7\ .1z\x22/>\x0d\x0a<path d=\ \x22M5,4C3.9,4,3,4.\ 9,3,6v10c0,1.1,0\ .9,2,2,2h12c1.1,\ 0,2-0.9,2-2V6c0-\ 1.1-0.9-2-2-2H5z\ M17,5c0.6,0,1,0\ .4,1,1v10\x0d\x0a\x09c0,0\ .6-0.4,1-1,1H5c-\ 0.6,0-1-0.4-1-1V\ 6c0-0.6,0.4-1,1-\ 1H17z\x22/>\x0d\x0a</svg>\ \x0d\x0a\ \x00\x00\x02\x8d\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22em\ oji\x22 xmlns=\x22http\ ://www.w3.org/20\ 00/svg\x22 xmlns:xl\ ink=\x22http://www.\ w3.org/1999/xlin\ k\x22 x=\x220px\x22 y=\x220p\ x\x22\x0d\x0a\x09 viewBox=\x220\ 0 72 72\x22 style=\ \x22enable-backgrou\ nd:new 0 0 72 72\ ;\x22 xml:space=\x22pr\ eserve\x22>\x0d\x0a<style\ type=\x22text/css\x22\ >\x0d\x0a\x09.st0{opacity\ :0.6;}\x0d\x0a\x09.st1{fi\ ll:#DC3545;}\x0d\x0a\x09.\ st2{fill:none;st\ roke:#000000;str\ oke-width:2;stro\ ke-linejoin:roun\ d;}\x0d\x0a</style>\x0d\x0a<\ g id=\x22color\x22 cla\ ss=\x22st0\x22>\x0d\x0a\x09<cir\ cle class=\x22st1\x22 \ cx=\x2236\x22 cy=\x2236\x22 \ r=\x2230\x22/>\x0d\x0a</g>\x0d\x0a\ <g id=\x22line\x22>\x0d\x0a\x09\ <circle class=\x22s\ t2\x22 cx=\x2236\x22 cy=\x22\ 36\x22 r=\x2231\x22/>\x0d\x0a</\ g>\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x03$\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 focusabl\ e=\x22false\x22 xmlns=\ \x22http://www.w3.o\ rg/2000/svg\x22 xml\ ns:xlink=\x22http:/\ /www.w3.org/1999\ /xlink\x22\x0d\x0a\x09 x=\x220p\ x\x22 y=\x220px\x22 viewB\ ox=\x220 0 512 512\x22\ style=\x22enable-b\ ackground:new 0 \ 0 512 512;\x22 xml:\ space=\x22preserve\x22\ >\x0d\x0a<style type=\x22\ text/css\x22>\x0d\x0a\x09.st\ 0{fill:#2A7400;s\ troke:#000000;st\ roke-width:5;str\ oke-miterlimit:1\ 0;}\x0d\x0a\x09.st1{fill:\ #FFFFFF;}\x0d\x0a</sty\ le>\x0d\x0a<path class\ =\x22st0\x22 d=\x22M256,0\ C114.6,0,0,114.6\ ,0,256s114.6,256\ ,256,256s256-114\ .6,256-256S397.4\ ,0,256,0z\x22/>\x0d\x0a<p\ ath class=\x22st1\x22 \ d=\x22M208,335.99V1\ 52c0-13.25-10.75\ -24-24-24h0c-13.\ 25,0-24,10.75-24\ ,24v183.99v23c0,\ 13.81,11.19,25,2\ 5,25h23h120.06\x0d\x0a\ \x09c13.25,0,24-10.\ 75,24-24v0c0-13.\ 25-10.75-24-24-2\ 4H208z\x22/>\x0d\x0a</svg\ >\x0d\x0a\ \x00\x00\x03\xcb\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 26.2.1,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M16.5,4C15\ .7,4,15,4.7,15,5\ .5S15.7,7,16.5,7\ C17.3,7,18,6.3,1\ 8,5.5S17.3,4,16.\ 5,4z M14,5.5C14,\ 4.1,15.1,3,16.5,\ 3\x0d\x0a\x09C17.9,3,19,4\ .1,19,5.5C19,6.9\ ,17.9,8,16.5,8c-\ 0.7,0-1.4-0.3-1.\ 9-0.9l-6.7,3.1c0\ .2,0.5,0.2,1,0,1\ .5l6.7,3.1c0.9-1\ ,2.5-1.2,3.5-0.3\ \x0d\x0a\x09c1,0.9,1.2,2.\ 5,0.3,3.5s-2.5,1\ .2-3.5,0.3c-0.8-\ 0.7-1.1-1.7-0.8-\ 2.6l-6.7-3.1c-0.\ 9,1-2.5,1.2-3.5,\ 0.3s-1.2-2.5-0.3\ -3.5\x0d\x0a\x09s2.5-1.2,\ 3.5-0.3c0.1,0.1,\ 0.2,0.2,0.3,0.3l\ 6.7-3.1C14,6,14,\ 5.8,14,5.5z M5.5\ ,9.5C4.7,9.5,4,1\ 0.2,4,11s0.7,1.5\ ,1.5,1.5S7,11.8,\ 7,11\x0d\x0a\x09S6.3,9.5,\ 5.5,9.5z M16.5,1\ 5c-0.8,0-1.5,0.7\ -1.5,1.5c0,0.8,0\ .7,1.5,1.5,1.5c0\ .8,0,1.5-0.7,1.5\ -1.5C18,15.7,17.\ 3,15,16.5,15z\x22/>\ \x0d\x0a</svg>\x0d\x0a\ \x00\x00\x03\xc7\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 20 20\x22 sty\ le=\x22enable-backg\ round:new 0 0 20\ 20;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<st\ yle type=\x22text/c\ ss\x22>\x0d\x0a\x09.st0{fill\ -rule:evenodd;cl\ ip-rule:evenodd;\ }\x0d\x0a</style>\x0d\x0a<pa\ th class=\x22st0\x22 d\ =\x22M8.5,14c3,0,5.\ 5-2.5,5.5-5.5S11\ .5,3,8.5,3l0,0C5\ .5,3,3,5.5,3,8.5\ S5.5,14,8.5,14z \ M15,8.5c0,3.6-2.\ 9,6.5-6.5,6.5\x0d\x0a\x09\ S2,12.1,2,8.5S4.\ 9,2,8.5,2S15,4.9\ ,15,8.5z\x22/>\x0d\x0a<pa\ th d=\x22M12.3,13.7\ c0,0,0.1,0.1,0.1\ ,0.1l3.9,3.8c0.4\ ,0.4,1,0.4,1.4,0\ s0.4-1,0-1.4l-3.\ 9-3.9c0,0-0.1-0.\ 1-0.1-0.1\x0d\x0a\x09C13.\ 3,12.9,12.9,13.3\ ,12.3,13.7L12.3,\ 13.7z\x22/>\x0d\x0a<path \ class=\x22st0\x22 d=\x22M\ 8.5,5C8.8,5,9,5.\ 2,9,5.5V8h2.5C11\ .8,8,12,8.2,12,8\ .5S11.8,9,11.5,9\ H9v2.5C9,11.8,8.\ 8,12,8.5,12S8,11\ .8,8,11.5\x0d\x0a\x09V9H5\ .5C5.2,9,5,8.8,5\ ,8.5S5.2,8,5.5,8\ H8V5.5C8,5.2,8.2\ ,5,8.5,5z\x22/>\x0d\x0a</\ svg>\x0d\x0a\ \x00\x00\x02\xc7\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M11.2,4.1c\ -0.1,0-0.3,0-0.4\ ,0l-6,2.4L11,9l6\ .2-2.5L11.2,4.1z\ M18,7.2l-6.5,2.\ 6v7.9l6.5-2.6V7.\ 2L18,7.2z M10.5,\ 17.8V9.8\x0d\x0a\x09L4,7.\ 2v7.9C4,15.2,10.\ 5,17.8,10.5,17.8\ z M10.4,3.2c0.4-\ 0.1,0.8-0.1,1.1,\ 0L18.7,6C18.9,6.\ 1,19,6.3,19,6.5v\ 8.7c0,0.4-0.2,0.\ 8-0.6,0.9\x0d\x0a\x09L11.\ 2,19c-0.1,0-0.3,\ 0-0.4,0l-7.2-2.9\ C3.2,15.9,3,15.6\ ,3,15.2V6.5C3,6.\ 3,3.1,6.1,3.3,6L\ 10.4,3.2z\x22/>\x0d\x0a</\ svg>\x0d\x0a\ \x00\x00\x08\x98\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 256 256\x22 s\ tyle=\x22enable-bac\ kground:new 0 0 \ 256 256;\x22 xml:sp\ ace=\x22preserve\x22>\x0d\ \x0a<style type=\x22te\ xt/css\x22>\x0d\x0a\x09.st0{\ fill:none;}\x0d\x0a\x09.s\ t1{display:none;\ }\x0d\x0a\x09.st2{display\ :inline;fill:non\ e;}\x0d\x0a\x09.st3{displ\ ay:inline;fill:#\ FFFFFF;}\x0d\x0a\x09.st4{\ fill:#39B54A;}\x0d\x0a\ </style>\x0d\x0a<path \ class=\x22st0\x22 d=\x22M\ 256,128\x22/>\x0d\x0a<pat\ h class=\x22st0\x22 d=\ \x22M128,256C57.3,2\ 56,0,198.7,0,128\ S57.3,0,128,0\x22/>\ \x0d\x0a<g class=\x22st1\x22\ >\x0d\x0a\x09<path class=\ \x22st2\x22 d=\x22M129.5,\ 202.9c42.2,2.6,7\ 7.1-32.2,74.4-74\ .4c-2.3-35.3-31.\ 1-63.6-66.4-65.3\ C113.7,62,92.4,7\ 2.8,78.9,90l52.1\ ,52\x0d\x0a\x09\x09L78.9,89.\ 9c-9.7,12.4-15.4\ ,28.2-14.8,45.3C\ 65.2,171.1,93.7,\ 200.6,129.5,202.\ 9z\x22/>\x0d\x0a\x09<path cl\ ass=\x22st3\x22 d=\x22M13\ 5.8,33c-31.4-0.5\ -58.5,12.4-77.2,\ 34.5L84,61l-4.1,\ 27.9c13.5-17.2,3\ 3.8-26.9,57.6-25\ .8\x0d\x0a\x09\x09c35.3,1.7,\ 64.1,30,66.4,65.\ 3c2.7,42.3-32.1,\ 77.1-74.3,74.4c-\ 35.8-2.2-64.4-31\ .8-65.5-67.6c-0.\ 4-13.1,2.8-25.3,\ 8.6-35.9\x0d\x0a\x09\x09c3.3\ -5.9,2.4-13.3-2.\ 4-18l0,0c-7.1-7.\ 1-19-5.3-23.8,3.\ 4c-8,14.5-12.6,3\ 1.3-12.4,49.2c0.\ 5,54.9,45.8,99.6\ ,100.7,99.1\x0d\x0a\x09\x09c\ 55.6-0.4,100.3-4\ 6.1,99.3-102C232\ .9,77.5,189.3,34\ ,135.8,33z\x22/>\x0d\x0a<\ /g>\x0d\x0a<g>\x0d\x0a\x09<path\ class=\x22st4\x22 d=\x22\ M-212,148.3\x22/>\x0d\x0a\ \x09<path class=\x22st\ 4\x22 d=\x22M-212,125.\ 3\x22/>\x0d\x0a</g>\x0d\x0a<g>\x0d\ \x0a\x09<path class=\x22s\ t4\x22 d=\x22M128,158.\ 5c-18,0-32.5-15.\ 8-30.3-34.3c1.7-\ 14,13-25.1,26.9-\ 26.6c11.7-1.2,22\ .2,4.1,28.2,12.8\ \x0d\x0a\x09\x09c2.6,3.7,6.8\ ,6,11.3,6l82.6,0\ c3,0,5.4-2.6,5-5\ .6C243.5,50,191.\ 3,3,128,3C73.7,3\ ,27.6,37.6,10.3,\ 85.8c-5.4,14.9,5\ .8,30.7,21.7,30.\ 7\x0d\x0a\x09\x09h0c9.7,0,18\ .3-6.1,21.7-15.2\ C64.7,70.7,94.2,\ 48.8,128.3,49c23\ .9,0.1,45.3,10.8\ ,59.7,27.7c6.6,7\ .7,3.9,19.7-5.5,\ 23.6l0,0\x0d\x0a\x09\x09c-6.\ 1,2.6-13.1,0.8-1\ 7.4-4.2C156.3,85\ .7,142.9,79,128,\ 79c-26.5,0-48.1,\ 21.1-49,47.4c-0.\ 9,27.2,21.4,50.4\ ,48.6,50.6\x0d\x0a\x09\x09c1\ 5.2,0.1,28.7-6.7\ ,37.8-17.4c4.2-5\ ,11.2-6.5,17.2-3\ .9l0,0c9.2,3.9,1\ 2.2,15.7,5.7,23.\ 3c-14.5,17.1-36.\ 1,28-60.4,28\x0d\x0a\x09\x09\ c-34.2,0-63.3-21\ .7-74.3-52.2c-3.\ 3-9.2-11.9-15.3-\ 21.7-15.3h0c-15.\ 9,0-27,15.7-21.7\ ,30.6C27.5,218.4\ ,73.7,253,128,25\ 3\x0d\x0a\x09\x09c63.3,0,115\ .5-47,123.9-107.\ 9c0.4-3-2-5.6-5-\ 5.6h-82.6c-4.5,0\ -8.6,2.2-11.2,5.\ 8C147.6,153.3,13\ 8.4,158.5,128,15\ 8.5z\x22/>\x0d\x0a</g>\x0d\x0a<\ /svg>\x0d\x0a\ \x00\x00\x02\xfc\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M11,9.5c0.\ 3,0,0.5,0.2,0.5,\ 0.5v1.5H13c0.3,0\ ,0.5,0.2,0.5,0.5\ s-0.2,0.5-0.5,0.\ 5h-1.5V14c0,0.3-\ 0.2,0.5-0.5,0.5\x0d\ \x0a\x09s-0.5-0.2-0.5-\ 0.5v-1.5H9c-0.3,\ 0-0.5-0.2-0.5-0.\ 5s0.2-0.5,0.5-0.\ 5h1.5V10C10.5,9.\ 7,10.7,9.5,11,9.\ 5z\x22/>\x0d\x0a<path d=\x22\ M17,7.5V17c0,1.1\ -0.9,2-2,2H7c-1.\ 1,0-2-0.9-2-2V5c\ 0-1.1,0.9-2,2-2h\ 5.5L17,7.5z M14,\ 7.5c-0.8,0-1.5-0\ .7-1.5-1.5V4H7\x0d\x0a\ \x09C6.4,4,6,4.4,6,\ 5v12c0,0.6,0.4,1\ ,1,1h8c0.6,0,1-0\ .4,1-1V7.5H14z\x22/\ >\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x02\xa0\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 26.2.1,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M9,8.5C9,9\ .3,8.3,10,7.5,10\ S6,9.3,6,8.5S6.7\ ,7,7.5,7S9,7.7,9\ ,8.5z\x22/>\x0d\x0a<path \ d=\x22M5,4C3.9,4,3,\ 4.9,3,6v10c0,1.1\ ,0.9,2,2,2h12c1.\ 1,0,2-0.9,2-2V6c\ 0-1.1-0.9-2-2-2C\ 17,4,5,4,5,4z M1\ 7,5c0.6,0,1,0.4,\ 1,1v6.5\x0d\x0a\x09l-3.8-\ 1.9c-0.2-0.1-0.4\ -0.1-0.6,0.1l-3.\ 7,3.7l-2.7-1.8c-\ 0.2-0.1-0.5-0.1-\ 0.6,0.1L4,15V6c0\ -0.6,0.4-1,1-1H1\ 7z\x22/>\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x04\x88\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22iso\ -8859-1\x22?>\x0d\x0a<!--\ Generator: Adob\ e Illustrator 19\ .0.0, SVG Export\ Plug-In . SVG V\ ersion: 6.00 Bui\ ld 0) -->\x0d\x0a<svg\ version=\x221.1\x22 i\ d=\x22Layer_1\x22 xmln\ s=\x22http://www.w3\ .org/2000/svg\x22 x\ mlns:xlink=\x22http\ ://www.w3.org/19\ 99/xlink\x22 x=\x220px\ \x22 y=\x220px\x22\x0d\x0a\x09 vie\ wBox=\x220 0 309.26\ 7 309.267\x22 style\ =\x22enable-backgro\ und:new 0 0 309.\ 267 309.267;\x22 xm\ l:space=\x22preserv\ e\x22>\x0d\x0a<g>\x0d\x0a\x09<path\ style=\x22fill:#D0\ 994B;\x22 d=\x22M260.9\ 44,43.491H125.64\ c0,0-18.324-28.9\ 94-28.994-28.994\ H48.323c-10.67,0\ -19.329,8.65-19.\ 329,19.329\x0d\x0a\x09\x09v2\ 22.286c0,10.67,8\ .659,19.329,19.3\ 29,19.329h212.62\ 1c10.67,0,19.329\ -8.659,19.329-19\ .329V62.82\x0d\x0a\x09\x09C2\ 80.273,52.15,271\ .614,43.491,260.\ 944,43.491z\x22/>\x0d\x0a\ \x09<path style=\x22fi\ ll:#E4E7E7;\x22 d=\x22\ M28.994,72.484h2\ 51.279v77.317H28\ .994V72.484z\x22/>\x0d\ \x0a\x09<path style=\x22f\ ill:#F4B459;\x22 d=\ \x22M19.329,91.814h\ 270.609c10.67,0,\ 19.329,8.65,19.3\ 29,19.329l-19.32\ 9,164.298\x0d\x0a\x09\x09c0,\ 10.67-8.659,19.3\ 29-19.329,19.329\ H38.658c-10.67,0\ -19.329-8.659-19\ .329-19.329L0,11\ 1.143C0,100.463,\ 8.659,91.814,19.\ 329,91.814z\x0d\x0a\x09\x09\x22\ />\x0d\x0a</g>\x0d\x0a<g>\x0d\x0a<\ /g>\x0d\x0a<g>\x0d\x0a</g>\x0d\x0a\ <g>\x0d\x0a</g>\x0d\x0a<g>\x0d\x0a\ </g>\x0d\x0a<g>\x0d\x0a</g>\x0d\ \x0a<g>\x0d\x0a</g>\x0d\x0a<g>\x0d\ \x0a</g>\x0d\x0a<g>\x0d\x0a</g>\ \x0d\x0a<g>\x0d\x0a</g>\x0d\x0a<g>\ \x0d\x0a</g>\x0d\x0a<g>\x0d\x0a</g\ >\x0d\x0a<g>\x0d\x0a</g>\x0d\x0a<g\ >\x0d\x0a</g>\x0d\x0a<g>\x0d\x0a</\ g>\x0d\x0a<g>\x0d\x0a</g>\x0d\x0a<\ /svg>\x0d\x0a\ \x00\x00\x02\x5c\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M17,7.6v6.\ 8L11,18l-6-3.6V7\ .6L11,4C11,4,17,\ 7.6,17,7.6z M11.\ 5,3.1c-0.3-0.2-0\ .7-0.2-1,0l-6,3.\ 6C4.2,6.9,4,7.2,\ 4,7.6v6.8\x0d\x0a\x09c0,0\ .4,0.2,0.7,0.5,0\ .9l6,3.6c0.3,0.2\ ,0.7,0.2,1,0l6-3\ .6c0.3-0.2,0.5-0\ .5,0.5-0.9V7.6c0\ -0.4-0.2-0.7-0.5\ -0.9L11.5,3.1z\x22/\ >\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x03\xc4\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 focusabl\ e=\x22false\x22 xmlns=\ \x22http://www.w3.o\ rg/2000/svg\x22 xml\ ns:xlink=\x22http:/\ /www.w3.org/1999\ /xlink\x22\x0d\x0a\x09 x=\x220p\ x\x22 y=\x220px\x22 viewB\ ox=\x220 0 512 512\x22\ style=\x22enable-b\ ackground:new 0 \ 0 512 512;\x22 xml:\ space=\x22preserve\x22\ >\x0d\x0a<style type=\x22\ text/css\x22>\x0d\x0a\x09.st\ 0{fill:#941400;s\ troke:#000000;st\ roke-width:5;str\ oke-miterlimit:1\ 0;}\x0d\x0a\x09.st1{fill:\ #FFFFFF;}\x0d\x0a\x09.st2\ {fill:#941400;}\x0d\ \x0a</style>\x0d\x0a<circ\ le class=\x22st0\x22 c\ x=\x22256\x22 cy=\x22256\x22\ r=\x22256\x22/>\x0d\x0a<pat\ h class=\x22st1\x22 d=\ \x22M349.8,349.8c5.\ 59,12.03,0.44,26\ .31-11.56,31.94c\ -3.31,1.53-6.75,\ 2.25-10.19,2.25c\ -9,0-17.66-5.13-\ 21.75-13.81\x0d\x0a\x09l-\ 38.46-82.19H208v\ 72c0,13.25-10.75\ ,24-24,24s-24-10\ .75-24-24V152c0-\ 13.25,10.75-24,2\ 4-24l88,0c44.13,\ 0,80,35.88,80,80\ \x0d\x0a\x09c0,28.32-14.8\ 7,53.09-37.12,67\ .31L349.8,349.8z\ \x22/>\x0d\x0a<path class\ =\x22st2\x22 d=\x22M272,1\ 76h-64v64h64c17.\ 66,0,32-14.34,32\ -32S289.7,176,27\ 2,176z\x22/>\x0d\x0a</svg\ >\x0d\x0a\ \x00\x00\x03p\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 20 20\x22 sty\ le=\x22enable-backg\ round:new 0 0 20\ 20;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<st\ yle type=\x22text/c\ ss\x22>\x0d\x0a\x09.st0{fill\ -rule:evenodd;cl\ ip-rule:evenodd;\ }\x0d\x0a</style>\x0d\x0a<pa\ th class=\x22st0\x22 d\ =\x22M8.5,14c3,0,5.\ 5-2.5,5.5-5.5S11\ .5,3,8.5,3l0,0C5\ .5,3,3,5.5,3,8.5\ S5.5,14,8.5,14z \ M15,8.5c0,3.6-2.\ 9,6.5-6.5,6.5\x0d\x0a\x09\ S2,12.1,2,8.5S4.\ 9,2,8.5,2S15,4.9\ ,15,8.5z\x22/>\x0d\x0a<pa\ th d=\x22M12.3,13.7\ c0,0,0.1,0.1,0.1\ ,0.1l3.9,3.8c0.4\ ,0.4,1,0.4,1.4,0\ s0.4-1,0-1.4l-3.\ 9-3.9c0,0-0.1-0.\ 1-0.1-0.1\x0d\x0a\x09C13.\ 3,12.9,12.9,13.3\ ,12.3,13.7L12.3,\ 13.7z\x22/>\x0d\x0a<path \ class=\x22st0\x22 d=\x22M\ 5,8.5C5,8.2,5.2,\ 8,5.5,8h6C11.8,8\ ,12,8.2,12,8.5S1\ 1.8,9,11.5,9h-6C\ 5.2,9,5,8.8,5,8.\ 5z\x22/>\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x02\x8d\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22em\ oji\x22 xmlns=\x22http\ ://www.w3.org/20\ 00/svg\x22 xmlns:xl\ ink=\x22http://www.\ w3.org/1999/xlin\ k\x22 x=\x220px\x22 y=\x220p\ x\x22\x0d\x0a\x09 viewBox=\x220\ 0 72 72\x22 style=\ \x22enable-backgrou\ nd:new 0 0 72 72\ ;\x22 xml:space=\x22pr\ eserve\x22>\x0d\x0a<style\ type=\x22text/css\x22\ >\x0d\x0a\x09.st0{opacity\ :0.6;}\x0d\x0a\x09.st1{fi\ ll:#0D6EFD;}\x0d\x0a\x09.\ st2{fill:none;st\ roke:#000000;str\ oke-width:2;stro\ ke-linejoin:roun\ d;}\x0d\x0a</style>\x0d\x0a<\ g id=\x22color\x22 cla\ ss=\x22st0\x22>\x0d\x0a\x09<cir\ cle class=\x22st1\x22 \ cx=\x2236\x22 cy=\x2236\x22 \ r=\x2230\x22/>\x0d\x0a</g>\x0d\x0a\ <g id=\x22line\x22>\x0d\x0a\x09\ <circle class=\x22s\ t2\x22 cx=\x2236\x22 cy=\x22\ 36\x22 r=\x2231\x22/>\x0d\x0a</\ g>\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x02\x8d\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22em\ oji\x22 xmlns=\x22http\ ://www.w3.org/20\ 00/svg\x22 xmlns:xl\ ink=\x22http://www.\ w3.org/1999/xlin\ k\x22 x=\x220px\x22 y=\x220p\ x\x22\x0d\x0a\x09 viewBox=\x220\ 0 72 72\x22 style=\ \x22enable-backgrou\ nd:new 0 0 72 72\ ;\x22 xml:space=\x22pr\ eserve\x22>\x0d\x0a<style\ type=\x22text/css\x22\ >\x0d\x0a\x09.st0{opacity\ :0.6;}\x0d\x0a\x09.st1{fi\ ll:#FFC107;}\x0d\x0a\x09.\ st2{fill:none;st\ roke:#000000;str\ oke-width:2;stro\ ke-linejoin:roun\ d;}\x0d\x0a</style>\x0d\x0a<\ g id=\x22color\x22 cla\ ss=\x22st0\x22>\x0d\x0a\x09<cir\ cle class=\x22st1\x22 \ cx=\x2236\x22 cy=\x2236\x22 \ r=\x2230\x22/>\x0d\x0a</g>\x0d\x0a\ <g id=\x22line\x22>\x0d\x0a\x09\ <circle class=\x22s\ t2\x22 cx=\x2236\x22 cy=\x22\ 36\x22 r=\x2231\x22/>\x0d\x0a</\ g>\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x03\xbc\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M4.5,5.5C4\ .5,4.7,5.2,4,6,4\ h10c0.8,0,1.5,0.\ 7,1.5,1.5v3.6c1.\ 1,0.3,1.7,1.4,1.\ 4,2.4c-0.2,0.7-0\ .7,1.3-1.4,1.4v3\ .6\x0d\x0a\x09c0,0.8-0.7,\ 1.5-1.5,1.5H6c-0\ .8,0-1.5-0.7-1.5\ -1.5v-3.6c-1.1-0\ .3-1.7-1.4-1.4-2\ .4c0.2-0.7,0.7-1\ .3,1.4-1.4V5.5z \ M5.5,9.1\x0d\x0a\x09c1.1,\ 0.3,1.7,1.4,1.4,\ 2.4c-0.2,0.7-0.7\ ,1.3-1.4,1.4v3.6\ C5.5,16.8,5.7,17\ ,6,17h10c0.3,0,0\ .5-0.2,0.5-0.5v-\ 3.6\x0d\x0a\x09c-1.1-0.3-\ 1.7-1.4-1.4-2.4c\ 0.2-0.7,0.7-1.3,\ 1.4-1.4V5.5C16.5\ ,5.2,16.3,5,16,5\ H6C5.7,5,5.5,5.2\ ,5.5,5.5V9.1z M5\ ,10c-0.6,0-1,0.4\ -1,1\x0d\x0a\x09c0,0.6,0.\ 4,1,1,1s1-0.4,1-\ 1C6,10.4,5.6,10,\ 5,10z M17,10c-0.\ 6,0-1,0.4-1,1c0,\ 0.6,0.4,1,1,1s1-\ 0.4,1-1C18,10.4,\ 17.6,10,17,10z\x22/\ >\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x03\xef\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M5,4C4.4,4\ ,4,4.4,4,5s0.4,1\ ,1,1s1-0.4,1-1S5\ .6,4,5,4z M3,5c0\ -1.1,0.9-2,2-2c0\ .9,0,1.7,0.6,1.9\ ,1.5h8.1\x0d\x0a\x09c0.3-\ 1.1,1.4-1.7,2.4-\ 1.4s1.7,1.4,1.4,\ 2.4c-0.2,0.7-0.7\ ,1.3-1.4,1.4v8.1\ c1.1,0.3,1.7,1.4\ ,1.4,2.4s-1.4,1.\ 7-2.4,1.4\x0d\x0a\x09c-0.\ 7-0.2-1.3-0.7-1.\ 4-1.4H6.9c-0.3,1\ .1-1.4,1.7-2.4,1\ .4s-1.7-1.4-1.4-\ 2.4c0.2-0.7,0.7-\ 1.3,1.4-1.4V6.9C\ 3.6,6.7,3,5.9,3,\ 5z M5.5,6.9\x0d\x0a\x09v8\ .1c0.7,0.2,1.3,0\ .7,1.4,1.4h8.1c0\ .2-0.7,0.7-1.3,1\ .4-1.4V6.9c-0.7-\ 0.2-1.3-0.7-1.4-\ 1.4H6.9C6.8,6.2,\ 6.2,6.8,5.5,6.9z\ M17,4\x0d\x0a\x09c-0.6,0\ -1,0.4-1,1s0.4,1\ ,1,1s1-0.4,1-1S1\ 7.6,4,17,4z M5,1\ 6c-0.6,0-1,0.4-1\ ,1s0.4,1,1,1s1-0\ .4,1-1S5.6,16,5,\ 16z M17,16\x0d\x0a\x09c-0\ .6,0-1,0.4-1,1s0\ .4,1,1,1s1-0.4,1\ -1S17.6,16,17,16\ z\x22/>\x0d\x0a</svg>\x0d\x0a\ \x00\x00\x03H\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M8.5,10C8.\ 2,10,8,10.2,8,10\ .5S8.2,11,8.5,11\ h5c0.3,0,0.5-0.2\ ,0.5-0.5S13.8,10\ ,13.5,10H8.5z M8\ ,12.5C8,12.2,8.2\ ,12,8.5,12h5\x0d\x0a\x09c\ 0.3,0,0.5,0.2,0.\ 5,0.5S13.8,13,13\ .5,13h-5C8.2,13,\ 8,12.8,8,12.5z M\ 8,14.5C8,14.2,8.\ 2,14,8.5,14h2c0.\ 3,0,0.5,0.2,0.5,\ 0.5\x0d\x0a\x09S10.8,15,1\ 0.5,15h-2C8.2,15\ ,8,14.8,8,14.5z\x22\ />\x0d\x0a<path d=\x22M12\ .5,3H7C5.9,3,5,3\ .9,5,5v12c0,1.1,\ 0.9,2,2,2h8c1.1,\ 0,2-0.9,2-2V7.5L\ 12.5,3z M12.5,4v\ 2c0,0.8,0.7,1.5,\ 1.5,1.5h2V17\x0d\x0a\x09c\ 0,0.6-0.4,1-1,1H\ 7c-0.6,0-1-0.4-1\ -1V5c0-0.6,0.4-1\ ,1-1H12.5z\x22/>\x0d\x0a<\ /svg>\x0d\x0a\ \x00\x00\x03\xd1\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22\xe5\x9b\ \xbe\xe5\xb1\x82_1\x22 xmlns=\x22h\ ttp://www.w3.org\ /2000/svg\x22 xmlns\ :xlink=\x22http://w\ ww.w3.org/1999/x\ link\x22 x=\x220px\x22 y=\ \x220px\x22\x0d\x0a\x09 viewBox\ =\x220 0 22 22\x22 sty\ le=\x22enable-backg\ round:new 0 0 22\ 22;\x22 xml:space=\ \x22preserve\x22>\x0d\x0a<pa\ th d=\x22M17,7.5V17\ c0,1.1-0.9,2-2,2\ H7c-1.1,0-2-0.9-\ 2-2V5c0-1.1,0.9-\ 2,2-2h5.5L17,7.5\ z M14,7.5c-0.8,0\ -1.5-0.7-1.5-1.5\ V4H7\x0d\x0a\x09C6.4,4,6,\ 4.4,6,5v12c0,0.6\ ,0.4,1,1,1h8c0.6\ ,0,1-0.4,1-1V7.5\ H14z\x22/>\x0d\x0a<path d\ =\x22M7.5,15.5C7.5,\ 15.2,7.7,15,8,15\ h3c0.3,0,0.5,0.2\ ,0.5,0.5S11.3,16\ ,11,16H8C7.7,16,\ 7.5,15.8,7.5,15.\ 5z M7.5,13.5\x0d\x0a\x09C\ 7.5,13.2,7.7,13,\ 8,13h6c0.3,0,0.5\ ,0.2,0.5,0.5S14.\ 3,14,14,14H8C7.7\ ,14,7.5,13.8,7.5\ ,13.5z M9.1,9.8l\ 1.3,0.9l1.9-1.9\x0d\ \x0a\x09c0.1-0.1,0.2-0\ .1,0.3,0l1.9,1v1\ .8c0,0.3-0.2,0.5\ -0.5,0.5H8c-0.3,\ 0-0.5-0.2-0.5-0.\ 5V11C7.5,11,9,9.\ 7,9.1,9.8z M9.3,\ 9\x0d\x0a\x09C9.7,9,10,8.\ 7,10,8.3c0-0.4-0\ .3-0.8-0.8-0.8S8\ .5,7.8,8.5,8.3C8\ .5,8.7,8.8,9,9.3\ ,9z\x22/>\x0d\x0a</svg>\x0d\x0a\ \ \x00\x00\x02\x8d\ <\ ?xml version=\x221.\ 0\x22 encoding=\x22utf\ -8\x22?>\x0d\x0a<!-- Gene\ rator: Adobe Ill\ ustrator 24.1.2,\ SVG Export Plug\ -In . SVG Versio\ n: 6.00 Build 0)\ -->\x0d\x0a<svg vers\ ion=\x221.1\x22 id=\x22em\ oji\x22 xmlns=\x22http\ ://www.w3.org/20\ 00/svg\x22 xmlns:xl\ ink=\x22http://www.\ w3.org/1999/xlin\ k\x22 x=\x220px\x22 y=\x220p\ x\x22\x0d\x0a\x09 viewBox=\x220\ 0 72 72\x22 style=\ \x22enable-backgrou\ nd:new 0 0 72 72\ ;\x22 xml:space=\x22pr\ eserve\x22>\x0d\x0a<style\ type=\x22text/css\x22\ >\x0d\x0a\x09.st0{opacity\ :0.6;}\x0d\x0a\x09.st1{fi\ ll:#198754;}\x0d\x0a\x09.\ st2{fill:none;st\ roke:#000000;str\ oke-width:2;stro\ ke-linejoin:roun\ d;}\x0d\x0a</style>\x0d\x0a<\ g id=\x22color\x22 cla\ ss=\x22st0\x22>\x0d\x0a\x09<cir\ cle class=\x22st1\x22 \ cx=\x2236\x22 cy=\x2236\x22 \ r=\x2230\x22/>\x0d\x0a</g>\x0d\x0a\ <g id=\x22line\x22>\x0d\x0a\x09\ <circle class=\x22s\ t2\x22 cx=\x2236\x22 cy=\x22\ 36\x22 r=\x2231\x22/>\x0d\x0a</\ g>\x0d\x0a</svg>\x0d\x0a\ " qt_resource_name = b"\ \x00\x05\ \x00o\xa6S\ \x00i\ \x00c\x00o\x00n\x00s\ \x00\x08\ \x06\x98T'\ \x00p\ \x00o\x00s\x00e\x00.\x00s\x00v\x00g\ \x00\x07\ \x0a7Z\x07\ \x00c\ \x00m\x00d\x00.\x00s\x00v\x00g\ \x00\x09\ \x09e\x83\xe7\ \x00e\ \x00r\x00r\x00o\x00r\x00.\x00s\x00v\x00g\ \x00\x0a\ \x08I\x05g\ \x00l\ \x00i\x00g\x00a\x00n\x00d\x00.\x00s\x00v\x00g\ \x00\x09\ \x08\x88\xa9\x07\ \x00s\ \x00h\x00a\x00r\x00e\x00.\x00s\x00v\x00g\ \x00\x0a\ \x04\x11v\x07\ \x00z\ \x00o\x00o\x00m\x00i\x00n\x00.\x00s\x00v\x00g\ \x00\x07\ \x09kZ\x07\ \x00b\ \x00o\x00x\x00.\x00s\x00v\x00g\ \x00\x08\ \x05\xe2T\xa7\ \x00l\ \x00o\x00g\x00o\x00.\x00s\x00v\x00g\ \x00\x07\ \x04\xcaZ'\ \x00n\ \x00e\x00w\x00.\x00s\x00v\x00g\ \x00\x09\ \x07\xd8\xba\xa7\ \x00i\ \x00m\x00a\x00g\x00e\x00.\x00s\x00v\x00g\ \x00\x0a\ \x0a\xc8\xf6\x87\ \x00f\ \x00o\x00l\x00d\x00e\x00r\x00.\x00s\x00v\x00g\ \x00\x0d\ \x0a@.\x07\ \x00m\ \x00o\x00l\x00e\x00c\x00u\x00l\x00a\x00r\x00.\x00s\x00v\x00g\ \x00\x0c\ \x04rb'\ \x00r\ \x00e\x00c\x00e\x00p\x00t\x00o\x00r\x00.\x00s\x00v\x00g\ \x00\x0b\ \x07\xc5\x96G\ \x00z\ \x00o\x00o\x00m\x00o\x00u\x00t\x00.\x00s\x00v\x00g\ \x00\x07\ \x09\xc1Z'\ \x00r\ \x00u\x00n\x00.\x00s\x00v\x00g\ \x00\x08\ \x0cGT\x07\ \x00p\ \x00e\x00n\x00d\x00.\x00s\x00v\x00g\ \x00\x07\ \x01UZ'\ \x00j\ \x00o\x00b\x00.\x00s\x00v\x00g\ \x00\x0c\ \x05g\xd3\x87\ \x00b\ \x00o\x00u\x00n\x00d\x00i\x00n\x00g\x00.\x00s\x00v\x00g\ \x00\x08\ \x06\xc1T\x07\ \x00o\ \x00p\x00e\x00n\x00.\x00s\x00v\x00g\ \x00\x08\ \x08\xc8U\xe7\ \x00s\ \x00a\x00v\x00e\x00.\x00s\x00v\x00g\ \x00\x0b\ \x0cS)\xe7\ \x00s\ \x00u\x00c\x00c\x00e\x00s\x00s\x00.\x00s\x00v\x00g\ " qt_resource_struct = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x15\x00\x00\x00\x02\ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x01\x92\x00\x00\x00\x00\x00\x01\x00\x007\x9b\ \x00\x00\x01\x806k\x809\ \x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x00\x0f{\ \x00\x00\x01\x806k\x80>\ \x00\x00\x01.\x00\x00\x00\x00\x00\x01\x00\x00+=\ \x00\x00\x01\x806k\x80>\ \x00\x00\x00\xc8\x00\x00\x00\x00\x00\x01\x00\x00\x1e\xad\ \x00\x00\x01\x806k\x80>\ \x00\x00\x01\xa6\x00\x00\x00\x00\x00\x01\x00\x00;[\ \x00\x00\x01\x806k\x809\ \x00\x00\x00\xb2\x00\x00\x00\x00\x00\x01\x00\x00\x16\x11\ \x00\x00\x01\x806k\x80=\ \x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x01\x806k\x80>\ \x00\x00\x01\xc4\x00\x00\x00\x00\x00\x01\x00\x00?N\ \x00\x00\x01\x806k\x80>\ \x00\x00\x01L\x00\x00\x00\x00\x00\x01\x00\x00/\x05\ \x00\x00\x01\x806k\x80>\ \x00\x00\x00\xdc\x00\x00\x00\x00\x00\x01\x00\x00!\xad\ \x00\x00\x01\x80\x94\xc9\xa3y\ \x00\x00\x00R\x00\x00\x00\x00\x00\x01\x00\x00\x08\x84\ \x00\x00\x01\x806k\x80:\ \x00\x00\x00l\x00\x00\x00\x00\x00\x01\x00\x00\x0b\xac\ \x00\x00\x01\x80\x94\xceT\xed\ \x00\x00\x01\xda\x00\x00\x00\x00\x00\x01\x00\x00B\x9a\ \x00\x00\x01\x806k\x80>\ \x00\x00\x00:\x00\x00\x00\x00\x00\x01\x00\x00\x05\xf3\ \x00\x00\x01\x806k\x809\ \x00\x00\x00\x9e\x00\x00\x00\x00\x00\x01\x00\x00\x13F\ \x00\x00\x01\x806k\x809\ \x00\x00\x01h\x00\x00\x00\x00\x00\x01\x00\x002y\ \x00\x00\x01\x806k\x80>\ \x00\x00\x00&\x00\x00\x00\x00\x00\x01\x00\x00\x02\xdc\ \x00\x00\x01\x806k\x809\ \x00\x00\x01\x0e\x00\x00\x00\x00\x00\x01\x00\x00(\xdd\ \x00\x00\x01\x806k\x80=\ \x00\x00\x00\xf4\x00\x00\x00\x00\x00\x01\x00\x00$Q\ \x00\x00\x01\x806k\x809\ \x00\x00\x01|\x00\x00\x00\x00\x00\x01\x00\x005\x0a\ \x00\x00\x01\x806k\x80>\ \x00\x00\x01\xf0\x00\x00\x00\x00\x00\x01\x00\x00Fo\ \x00\x00\x01\x806k\x80>\ " def qInitResources(): QtCore.qRegisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) def qCleanupResources(): QtCore.qUnregisterResourceData(0x03, qt_resource_struct, qt_resource_name, qt_resource_data) qInitResources()
21.801605
96
0.636434
7,324
29,890
2.592572
0.114555
0.095429
0.060196
0.045502
0.708447
0.691911
0.654413
0.624289
0.585633
0.555298
0
0.335722
0.075611
29,890
1,370
97
21.817518
0.351502
0.005453
0
0.495217
0
0.020603
0
0
0
0
0.000269
0
0
1
0.001472
false
0
0.000736
0
0.002208
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
447112b6fa86b5ec0c006f66a69b184bd85f3270
267
py
Python
recursion/base_converter.py
Yasir323/Data-Structures-and-Algorithms-in-Python
b721d0ca0218b9665d4f6ca0bbfd4417244bcdf0
[ "MIT" ]
null
null
null
recursion/base_converter.py
Yasir323/Data-Structures-and-Algorithms-in-Python
b721d0ca0218b9665d4f6ca0bbfd4417244bcdf0
[ "MIT" ]
null
null
null
recursion/base_converter.py
Yasir323/Data-Structures-and-Algorithms-in-Python
b721d0ca0218b9665d4f6ca0bbfd4417244bcdf0
[ "MIT" ]
null
null
null
def decimal2base(num, base): convert_string = "0123456789ABCDEF" if num < base: return convert_string[num] remainder = num % base num = num // base return decimal2base(num, base) + convert_string[remainder] print(decimal2base(1453, 16))
24.272727
62
0.677903
31
267
5.741935
0.419355
0.196629
0.213483
0.292135
0.359551
0
0
0
0
0
0
0.091346
0.220974
267
10
63
26.7
0.764423
0
0
0
0
0
0.059925
0
0
0
0
0
0
1
0.125
false
0
0
0
0.375
0.125
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
447b46504e3f133d3560744b576f31426d682d53
1,242
py
Python
app/main/forms.py
macymuhia/Blogspot
b1a578a4120bebb2c4c2a57201ac43eec7a161e9
[ "MIT" ]
null
null
null
app/main/forms.py
macymuhia/Blogspot
b1a578a4120bebb2c4c2a57201ac43eec7a161e9
[ "MIT" ]
6
2021-02-08T20:33:48.000Z
2022-03-11T23:56:14.000Z
app/main/forms.py
macymuhia/Blogspot
b1a578a4120bebb2c4c2a57201ac43eec7a161e9
[ "MIT" ]
null
null
null
from flask_wtf import FlaskForm from wtforms import StringField, TextAreaField, SubmitField, SelectField from wtforms.validators import Required class BlogForm(FlaskForm): blog_title = StringField("Blog title", validators=[Required()]) blog_description = StringField("Blog description", validators=[Required()]) story = TextAreaField("Blog content", validators=[Required()]) category = SelectField( "Category", choices=[ ("Gaming", "Gaming"), ("Career", "Career"), ("Technology", "Technology"), ("Sports", "Sports"), ("Fitness", "Fitness"), ], validators=[Required()], ) submit = SubmitField("Post") class CommentForm(FlaskForm): details = TextAreaField("Your comment", validators=[Required()]) submit = SubmitField("Comment") class UpdateProfile(FlaskForm): bio = TextAreaField("Tell us about you.", validators=[Required()]) submit = SubmitField("Submit") # class DeletePost(FlaskForm): # comment_id = StringField() # delete = SubmitField('Delete') class UpdateProfile(FlaskForm): bio = TextAreaField("Tell us about you.", validators=[Required()]) submit = SubmitField("Submit")
27
79
0.650564
108
1,242
7.444444
0.37963
0.156716
0.119403
0.174129
0.243781
0.243781
0.243781
0.243781
0.243781
0.243781
0
0
0.20934
1,242
45
80
27.6
0.818737
0.075684
0
0.214286
0
0
0.163605
0
0
0
0
0
0
1
0
false
0
0.107143
0
0.642857
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
447e060bfaf57ff9d2bd90b071b3844072392c17
3,912
py
Python
tests/test_file_structure.py
ChrisWellsWood/carpyt
6bdabd4924d0af5a83863dc25bec8961f321daaa
[ "MIT" ]
null
null
null
tests/test_file_structure.py
ChrisWellsWood/carpyt
6bdabd4924d0af5a83863dc25bec8961f321daaa
[ "MIT" ]
null
null
null
tests/test_file_structure.py
ChrisWellsWood/carpyt
6bdabd4924d0af5a83863dc25bec8961f321daaa
[ "MIT" ]
null
null
null
"""Tests for creating file structure.""" import os from pathlib import Path import tempfile from unittest import TestCase import carpyt TEST_TEMPLATES = Path(os.path.abspath(__file__)).parent / 'test_templates' class TestTemplateParsing(TestCase): """Tests that templates are parsed correctly.""" def test_simple_template(self): """Tests creation of nested parse tree.""" template_path = TEST_TEMPLATES / 'nested_simple.yml' file_tree = carpyt.run_template_parser(template_path) self.assertTrue(file_tree.name == 'nested_simple') self.assertTrue(file_tree[0].name == '{module}') self.assertTrue(file_tree[0][0].name == 'tests') self.assertTrue(file_tree[0][0][0].name == 'test.py') self.assertTrue(file_tree[0][0][0].content is None) def test_branched_template(self): """Tests creation of branched parse tree.""" template_path = TEST_TEMPLATES / 'nested_branched.yml' file_tree = carpyt.run_template_parser(template_path) self.assertTrue(file_tree.name == 'nested_branched') self.assertTrue(file_tree[0].name == 'docs') self.assertTrue(file_tree[1].name == 'tests') self.assertTrue(file_tree[1][0].name == 'test_files') self.assertTrue(file_tree[1][0].content is None) self.assertTrue(file_tree[2].name == '{module}') self.assertTrue(file_tree[2][0].name == '__init__.py') self.assertTrue('content' in file_tree[2][0].content) def test_linked_template(self): """Tests creation of parse tree with linked templates.""" template_path = TEST_TEMPLATES / 'parent.yml' file_tree = carpyt.run_template_parser(template_path) self.assertTrue(file_tree.name == 'parent') self.assertTrue(file_tree[0].name == '{module}') self.assertTrue(file_tree[0][0].name == 'child') self.assertTrue(file_tree[0][0][0].name == 'test_files') self.assertTrue(file_tree[0][0][0][0].name == 'tests.py') self.assertTrue(file_tree[0][0][0][0].content is None) self.assertTrue(file_tree[1].name == 'setup.py') self.assertTrue(file_tree[1].content is None) def test_recursive_template(self): """Tests error handling in recursive linked templates.""" template_path = TEST_TEMPLATES / 'recursive.yml' with self.assertRaises(RecursionError): carpyt.run_template_parser(template_path) def test_reuse_template(self): """Tests reuse of linked templates.""" template_path = TEST_TEMPLATES / 'reuse.yml' file_tree = carpyt.run_template_parser(template_path) self.assertTrue(len(file_tree.content) == 1) class TestFileCreation(TestCase): """Tests that all required files are generated correctly.""" def test_simple_project(self): """Tests the file structure of the standard python template.""" with tempfile.TemporaryDirectory() as tempdir: td_path = Path(tempdir) template_path = carpyt.TEMPLATES / 'python_module.yml' file_tree = carpyt.run_template_parser(template_path) file_tree.make(td_path) top_dir = td_path / 'python_module' self.assertTrue(top_dir.exists()) lib_dir = top_dir / '{module}' self.assertTrue((lib_dir).exists()) self.assertTrue((lib_dir / '__init__.py').exists()) self.assertTrue((lib_dir / 'lib.py').exists()) tests_dir = top_dir / 'tests' self.assertTrue(tests_dir.exists()) self.assertTrue((tests_dir / 'test_lib.py').exists()) docs_dir = top_dir / 'docs' self.assertTrue(docs_dir.exists()) self.assertTrue((top_dir / 'README.md').exists()) self.assertTrue((top_dir / 'MANIFEST.in').exists()) self.assertTrue((top_dir / 'setup.py').exists())
43.466667
74
0.650562
489
3,912
4.97546
0.167689
0.184135
0.147965
0.180847
0.556104
0.447185
0.326757
0.293876
0.21455
0.168516
0
0.012064
0.216002
3,912
89
75
43.955056
0.781219
0.103016
0
0.106061
0
0
0.093272
0
0
0
0
0
0.5
1
0.090909
false
0
0.075758
0
0.19697
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
1
0
0
0
0
0
0
0
0
0
2
44816770ada7ebc5eb5982830625b9550b145802
408
py
Python
Flask/server/config.py
VincentParsons/DigSig
195c97e34237dab78de40efd2d3a1e0269a82b70
[ "MIT" ]
null
null
null
Flask/server/config.py
VincentParsons/DigSig
195c97e34237dab78de40efd2d3a1e0269a82b70
[ "MIT" ]
1
2022-02-13T01:23:59.000Z
2022-02-13T01:23:59.000Z
Flask/server/config.py
VincentParsons/DigSig
195c97e34237dab78de40efd2d3a1e0269a82b70
[ "MIT" ]
null
null
null
from dotenv import load_dotenv import os load_dotenv() class ApplicationConfig: SECRET_KEY = "asdadsd" SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ECHO = True SQLALCHEMY_DATABASE_URI = r"sqlite:///./db.sqlite" SESSION_TYPE = "filesystem" SESSION_PERMANENT = False SESSION_USE_SIGNER = True EMAIL_ADDRESS = "digsigsupp@gmail.com" EMAIL_PASSWORD = "DigSigRocks"
20.4
54
0.732843
46
408
6.195652
0.73913
0.084211
0
0
0
0
0
0
0
0
0
0
0.191176
408
19
55
21.473684
0.863636
0
0
0
0
0
0.169533
0.051597
0
0
0
0
0
1
0
false
0.076923
0.153846
0
0.923077
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
4497c0bd8ba875e530e105c67eb98c37b9208182
2,151
py
Python
tests/test_configManager.py
Helene/ibm-spectrum-scale-bridge-for-grafana
9ec7953071d9fbe90332cb670a3f6c00ebf3291b
[ "Apache-2.0" ]
28
2019-11-21T21:11:55.000Z
2022-03-14T16:53:12.000Z
tests/test_configManager.py
Helene/ibm-spectrum-scale-bridge-for-grafana
9ec7953071d9fbe90332cb670a3f6c00ebf3291b
[ "Apache-2.0" ]
23
2019-12-17T08:44:09.000Z
2022-01-07T11:02:01.000Z
tests/test_configManager.py
Helene/ibm-spectrum-scale-bridge-for-grafana
9ec7953071d9fbe90332cb670a3f6c00ebf3291b
[ "Apache-2.0" ]
7
2019-12-04T09:41:17.000Z
2021-12-10T15:01:08.000Z
from source.confParser import ConfigManager from source.__version__ import __version__ as version def test_case01(): cm = ConfigManager() result = cm.readConfigFile('config.ini') assert isinstance(result, dict) def test_case02(): cm = ConfigManager() result = cm.readConfigFile('config.ini') assert len(result.keys()) > 0 def test_case03(): cm = ConfigManager() result = cm.readConfigFile('config.ini') assert 'tls' in result.keys() def test_case04(): cm = ConfigManager() result = cm.readConfigFile('config.ini') connection = result['connection'] assert len(connection) > 0 assert isinstance(connection, dict) assert len(connection) > 0 assert 'port' in connection.keys() def test_case05(): cm = ConfigManager() result = cm.parse_defaults() assert isinstance(result, dict) def test_case06(): cm = ConfigManager() result = cm.parse_defaults() assert len(result.keys()) > 0 def test_case07(): cm = ConfigManager() result = cm.parse_defaults() result1 = cm.defaults assert len(result) == len(result1) def test_case08(): cm = ConfigManager() result = cm.defaults elements = list(result.keys()) mandatoryItems = ['port', 'serverPort'] assert all(item in elements for item in mandatoryItems) def test_case09(): cm = ConfigManager() result = cm.defaults value = int(result['port']) assert value == 4242 def test_case10(): cm = ConfigManager() result = cm.defaults if version < "7.0": assert int(result['port']) == 4242 and int(result['serverPort']) == 9084 else: assert int(result['port']) == 4242 and int(result['serverPort']) == 9980 def test_case11(): cm = ConfigManager() result = cm.defaults assert 'includeDiskData' in result.keys() assert result['includeDiskData'] == 'no' def test_case12(): cm = ConfigManager() result = cm.defaults assert 'apiKeyValue' not in result.keys() def test_case13(): cm = ConfigManager() result = cm.defaults assert 'protocol' in result.keys() assert result['protocol'] == 'http'
22.882979
80
0.656439
250
2,151
5.552
0.248
0.065562
0.196686
0.215418
0.612392
0.445965
0.301153
0.177233
0.064842
0
0
0.031991
0.215249
2,151
93
81
23.129032
0.790284
0
0
0.477612
0
0
0.078568
0
0
0
0
0
0.283582
1
0.19403
false
0
0.029851
0
0.223881
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
9225d697e78183c1ad43794ee9e4cd4755df5089
2,260
py
Python
orbit.py
srujan71/CubeSat-Mission-Planner
34030254109def0b13e82116ed5122ecf79a82f7
[ "MIT" ]
1
2021-07-26T16:17:30.000Z
2021-07-26T16:17:30.000Z
orbit.py
leizhang2020/CubeSat-Mission-Planner
62d1ad33c2dcb1a2f8fb3ff615cc5cc0e6716969
[ "MIT" ]
null
null
null
orbit.py
leizhang2020/CubeSat-Mission-Planner
62d1ad33c2dcb1a2f8fb3ff615cc5cc0e6716969
[ "MIT" ]
2
2021-09-18T08:50:44.000Z
2022-01-20T02:41:38.000Z
""" orbit.py "Frankly, a very limited and highly specific implementation of an Orbit class. If used for applications other than the original usecase, this class will either need to be bypassed or heavily expanded upon." @author: Johan Monster (https://github.com/Hans-Bananendans/) """ from numpy import log class Orbit: """This class stores and supplies orbital parameters for given circular SSO orbit""" def __init__(self,h,i,LTAN): self.h = h #[km] self.i = i #[deg] self.LTAN = LTAN #0-23[h] e.g. 14 is 14:00 def period(self): """ Parameters ---------- h : double Orbital altitude in [km]. Returns ------- int Orbital period in [s]. """ return int(2*3.141593 * ((1000*(6371+self.h))**3/(3.986*10**14))**0.5) def eclipse(self): """ eclipse(h) Note: Only valid between LTAN [10:00, 11:00], based on logarithmic regression of simulated eclipse data in GMAT. For more info, consult eclipse_predictions.xlsx. ACCURATE TO WITHIN A FEW SECONDS Parameters ---------- h : double Orbital altitude in [km]. Returns ------- double Total eclipse duration (including penumbras) in [s]. """ # If LTAN is 10:00 # e = -151*log(self.h) + 2965 # [s] # If LTAN is 10:30 e = -125*log(self.h) + 2860 # [s] # If LTAN is 11:00 # e = -109*log(self.h) + 2800 # [s] return e def eclipse_frac(self): """ eclipse(h) Note: Only valid for LTAN 10:00, 10:30, 11:00, based on logarithmic regression of simulated eclipse data in GMAT. For more info, consult eclipse_predictions.xlsx. ACCURACY TO WITHIN 0.1 OF TRUE VALUE Parameters ---------- h : double Orbital altitude in [km]. Returns ------- double Percentage of orbit that is in ECLIPSE [%]. """ return self.eclipse()/self.period()
25.111111
78
0.509735
273
2,260
4.194139
0.450549
0.026201
0.044541
0.062882
0.360699
0.341485
0.297817
0.297817
0.260262
0.174672
0
0.064631
0.376991
2,260
90
79
25.111111
0.74858
0.600442
0
0
0
0
0
0
0
0
0
0
0
1
0.307692
false
0
0.076923
0
0.692308
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
922f623f7a3d41cac0130a562f5b7e6ac382fee1
2,639
py
Python
mikelint/analysers/analyser.py
mike-fam/mikelint
4e512039d11e9bbfde18a8cadcbc4608295e663f
[ "MIT" ]
2
2021-04-27T01:13:37.000Z
2021-05-21T02:28:24.000Z
mikelint/analysers/analyser.py
mike-fam/mikelint
4e512039d11e9bbfde18a8cadcbc4608295e663f
[ "MIT" ]
3
2021-05-05T10:21:25.000Z
2021-05-30T12:51:43.000Z
mikelint/analysers/analyser.py
mike-fam/mikelint
4e512039d11e9bbfde18a8cadcbc4608295e663f
[ "MIT" ]
null
null
null
""" Abstract analyser """ from functools import wraps from inspect import getmembers, ismethod from typing import Callable from ..type_hints import AnalyserResults, AnalyserHelper from ..utils import SyntaxTree, BaseViolation, ViolationResult def register_check(error_format: str): """ Registers a new checker to an analyser Args: error_format: error format of violation """ def decorator(check_method: Callable): @wraps(check_method) def wrapper(*args, **kwargs): analyser = args[0] checker_name = check_method.__name__ analyser.register_checker(checker_name, check_method.__doc__, error_format) result: list[ViolationResult] = check_method(*args, **kwargs) analyser.add_violations(checker_name, result) return wrapper return decorator class Analyser: """Abstract base analyser""" def __init__(self, sources: dict[str, AnalyserHelper]): """ Constructor Args: tree: syntax tree source: list of lines from source code """ self._check_results: AnalyserResults = {} self._sources = sources def register_checker(self, name: str, description: str, error_format: str): """ Registers a new checker to this analyser Args: name: name of the checker, typically the method name description: description of this checker error_format: format string used to display violations """ self._check_results[name] = BaseViolation(description, error_format, []) def get_results(self) -> AnalyserResults: """ Returns results of all checkers of this analyser """ return self._check_results def add_violations(self, checker_name: str, results: list[ViolationResult]) -> None: """ Adds violation results to a checker Args: checker_name: name of the checker results: list of violation results """ self._check_results[checker_name].values.extend(results) def get_line(self, file_name: str, line_number: int) -> str: """Returns line given line number""" return self._sources[file_name].source[line_number - 1].strip() def run(self): """ Runs all checkers """ for method_name, method in getmembers(self, predicate=ismethod): if not method_name.startswith("check_"): continue method()
32.182927
80
0.611595
277
2,639
5.631769
0.32491
0.049359
0.041026
0.029487
0.071795
0.046154
0.046154
0.046154
0
0
0
0.001095
0.307692
2,639
81
81
32.580247
0.852764
0.241379
0
0
0
0
0.003398
0
0
0
0
0
0
1
0.25
false
0
0.138889
0
0.527778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
9240a548d742f534b991d13e7dee47d24390d843
416
py
Python
aiocloudflare/api/user/billing/subscriptions/subscriptions.py
Stewart86/aioCloudflare
341c0941f8f888a8b7e696e64550bce5da4949e6
[ "MIT" ]
2
2021-09-14T13:20:55.000Z
2022-02-24T14:18:24.000Z
aiocloudflare/api/user/billing/subscriptions/subscriptions.py
Stewart86/aioCloudflare
341c0941f8f888a8b7e696e64550bce5da4949e6
[ "MIT" ]
46
2021-09-08T08:39:45.000Z
2022-03-29T12:31:05.000Z
aiocloudflare/api/user/billing/subscriptions/subscriptions.py
Stewart86/aioCloudflare
341c0941f8f888a8b7e696e64550bce5da4949e6
[ "MIT" ]
1
2021-12-30T23:02:23.000Z
2021-12-30T23:02:23.000Z
from aiocloudflare.commons.unused import Unused from .apps.apps import Apps from .zones.zones import Zones class Subscriptions(Unused): _endpoint1 = "user/billing/subscriptions" _endpoint2 = None _endpoint3 = None @property def apps(self) -> Apps: return Apps(self._config, self._session) @property def zones(self) -> Zones: return Zones(self._config, self._session)
21.894737
49
0.697115
49
416
5.77551
0.428571
0.077739
0.09894
0.14841
0
0
0
0
0
0
0
0.009146
0.211538
416
18
50
23.111111
0.853659
0
0
0.153846
0
0
0.0625
0.0625
0
0
0
0
0
1
0.153846
false
0
0.230769
0.153846
0.846154
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
92414f09496d34fe212d6725d451c35584414eae
1,548
py
Python
dlutils/timer.py
podgorskiy/dlutils
716c99fd26cde73550c58b2be1071d64c67ca036
[ "Apache-2.0" ]
5
2019-11-06T20:42:38.000Z
2020-09-06T02:09:56.000Z
dlutils/timer.py
podgorskiy/dlutils
716c99fd26cde73550c58b2be1071d64c67ca036
[ "Apache-2.0" ]
2
2020-04-23T09:22:29.000Z
2020-04-23T14:41:22.000Z
dlutils/timer.py
podgorskiy/dlutils
716c99fd26cde73550c58b2be1071d64c67ca036
[ "Apache-2.0" ]
3
2020-04-28T18:12:47.000Z
2020-08-28T06:50:34.000Z
# Copyright 2017-2019 Stanislav Pidhorskyi # # 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. # ============================================================================== """Profiling utils""" import time def timer(f): """ Decorator for timeing function (method) execution time. After return from function will print string: ``func: <function name> took: <time in seconds> sec``. Args: f (Callable[Any]): function to decorate. Returns: Callable[Any]: Decorated function. Example: :: >>> from dlutils import timer >>> @timer.timer ... def foo(x): ... for i in range(x): ... pass ... >>> foo(100000) func:'foo' took: 0.0019 sec """ def __wrapper(*args, **kw): time_start = time.time() result = f(*args, **kw) time_end = time.time() print('func:%r took: %2.4f sec' % (f.__name__, time_end - time_start)) return result return __wrapper
29.769231
104
0.583333
189
1,548
4.714286
0.571429
0.06734
0.029181
0.035915
0
0
0
0
0
0
0
0.021968
0.264858
1,548
51
105
30.352941
0.760984
0.747416
0
0
0
0
0.08
0
0
0
0
0
0
1
0.222222
false
0
0.111111
0
0.555556
0.111111
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
924aac08eec6f6d80fd3a7f3fb5250d621f04816
162
py
Python
tests/configuration/config.py
NHSDigital/karsten-ratelimit-test
f4eeccd999ef440d4a1ec4d0a71ffc187665877d
[ "MIT" ]
1
2021-11-08T14:54:07.000Z
2021-11-08T14:54:07.000Z
tests/configuration/config.py
NHSDigital/karsten-ratelimit-test
f4eeccd999ef440d4a1ec4d0a71ffc187665877d
[ "MIT" ]
36
2020-06-24T10:55:10.000Z
2022-02-11T10:11:07.000Z
tests/configuration/config.py
NHSDigital/public-data-catalogue
7c385698a8db241cc9496a74bd41a1806bee2907
[ "MIT" ]
1
2021-04-11T07:32:37.000Z
2021-04-11T07:32:37.000Z
from .environment import ENV # Api Details ENVIRONMENT = ENV["environment"] BASE_URL = f"https://{ENVIRONMENT}.api.service.nhs.uk" BASE_PATH = ENV["base_path"]
20.25
54
0.740741
23
162
5.086957
0.608696
0.136752
0
0
0
0
0
0
0
0
0
0
0.111111
162
7
55
23.142857
0.8125
0.067901
0
0
0
0
0.402685
0
0
0
0
0
0
1
0
false
0
0.25
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
0
0
0
0
0
0
0
0
2
9257db98b395b4b7c78f60feda8d5c9358ca061b
709
py
Python
ADTs/Node.py
pacevedom/three-in-line-AI
9e42c1512bbfccbf5bccd9adc4a5da8bc595d4e5
[ "MIT" ]
null
null
null
ADTs/Node.py
pacevedom/three-in-line-AI
9e42c1512bbfccbf5bccd9adc4a5da8bc595d4e5
[ "MIT" ]
null
null
null
ADTs/Node.py
pacevedom/three-in-line-AI
9e42c1512bbfccbf5bccd9adc4a5da8bc595d4e5
[ "MIT" ]
1
2021-11-28T15:42:44.000Z
2021-11-28T15:42:44.000Z
class Node: def __init__(self, value, child, parent): self._value = value self._child = child self._parent = parent def get_value(self): #Return the value of a node return self._value def get_child(self): #Return the value of a node return self._child def get_parent(self): #Return the parent of a node return self._parent def set_value(self, value): #Change the value of a node self._value = value def set_child(self, child): #Change the value of a node self._child = child def set_parent(self, parent): #Change the parent reference self._parent = parent
24.448276
45
0.602257
96
709
4.25
0.166667
0.110294
0.085784
0.107843
0.335784
0.294118
0.294118
0.171569
0.171569
0
0
0
0.328632
709
29
46
24.448276
0.857143
0.222849
0
0.352941
0
0
0
0
0
0
0
0
0
1
0.411765
false
0
0
0.176471
0.647059
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
926055753876c29c748828d168304c3ef6c8a5b4
578
py
Python
Unit 8 Libraries/shapes.py
ItsMrTurtle/PythonChris
4513dea336e68f48fabf480ad87bc538a323c2cd
[ "MIT" ]
null
null
null
Unit 8 Libraries/shapes.py
ItsMrTurtle/PythonChris
4513dea336e68f48fabf480ad87bc538a323c2cd
[ "MIT" ]
null
null
null
Unit 8 Libraries/shapes.py
ItsMrTurtle/PythonChris
4513dea336e68f48fabf480ad87bc538a323c2cd
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Thu May 28 15:30:04 2020 @author: Christopher Cheng """ class Circle (object): def __init__(self): self.radius = 0 def change_radius(self, radius): self.radius = radius def get_radius (self): return self.radius class Rectangle(object): # A rectangle object with a width and height def __init__(self,length,width): self.length = length self.width = width def set_length(self,length): self.length = length def set_width(self,width): self.width = width
23.12
48
0.626298
77
578
4.545455
0.441558
0.114286
0.062857
0
0
0
0
0
0
0
0
0.033019
0.266436
578
24
49
24.083333
0.792453
0.223183
0
0.266667
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0
0.066667
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
926441ea90cbc6c22b98d9270a3adf3f083c5bbf
889
py
Python
card/models.py
tyhunt99/card-collector-db
932bd829eb46f9492e6a25326140823629161bab
[ "MIT" ]
null
null
null
card/models.py
tyhunt99/card-collector-db
932bd829eb46f9492e6a25326140823629161bab
[ "MIT" ]
4
2020-06-05T20:53:52.000Z
2022-02-10T08:32:51.000Z
card/models.py
tyhunt99/card-collector-db
932bd829eb46f9492e6a25326140823629161bab
[ "MIT" ]
null
null
null
import datetime from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models class Collection(models.Model): ''' A collection of cards. ''' name = models.CharField(max_length=250) class Card(models.Model): first_name = models.CharField(max_length=150) last_name = models.CharField(max_length=150) team = models.CharField(max_length=100) year = models.PositiveIntegerField( validators=[ MinValueValidator(1887), # first produced baseball card (source?) MaxValueValidator(datetime.datetime.now().year), ], help_text='Use the following format: <YYYY>', ) company = models.CharField(max_length=250) value = models.DecimalField( decimal_places=2, max_digits=50, default=0, ) collection = models.ManyToManyField(Collection)
26.939394
78
0.68054
96
889
6.197917
0.541667
0.12605
0.151261
0.201681
0.201681
0.104202
0
0
0
0
0
0.033189
0.220472
889
32
79
27.78125
0.825397
0.069741
0
0
0
0
0.039457
0
0
0
0
0
0
1
0
false
0
0.130435
0
0.565217
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2