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
fc473e035899e74ba37d13e6c82514e70923eb1f
55
py
Python
subjects/hello/hello.py
powerdev0510/pythonc
1d28044aa9a8d05267ca427a63dd0e73cef225b7
[ "Apache-2.0" ]
405
2015-07-27T06:39:20.000Z
2022-03-23T05:49:57.000Z
subjects/hello/hello.py
limkokhole/pytocs
ccd3aaf9e701ab205a7466080bb5989356f09ec3
[ "Apache-2.0" ]
73
2015-07-22T21:22:38.000Z
2022-01-27T12:02:39.000Z
subjects/hello/hello.py
limkokhole/pytocs
ccd3aaf9e701ab205a7466080bb5989356f09ec3
[ "Apache-2.0" ]
160
2015-12-23T08:15:57.000Z
2022-03-25T16:11:08.000Z
# Some code below def hello(): print "Hello World"
13.75
23
0.654545
8
55
4.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0.236364
55
3
24
18.333333
0.857143
0.272727
0
0
0
0
0.289474
0
0
0
0
0
0
0
null
null
0
0
null
null
0.5
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
4
fc54a2db0aa12eda4fb419a50f9ed25189b7bf4c
93
py
Python
config.py
mpslxz/icvae
7a1c2aa795742096d9cd97178f6cadc0ed73511f
[ "MIT" ]
2
2020-11-04T08:44:50.000Z
2020-12-11T21:42:20.000Z
config.py
mpslxz/icvae
7a1c2aa795742096d9cd97178f6cadc0ed73511f
[ "MIT" ]
1
2020-05-07T15:26:50.000Z
2020-05-07T15:26:50.000Z
config.py
mpslxz/icvae
7a1c2aa795742096d9cd97178f6cadc0ed73511f
[ "MIT" ]
1
2021-01-18T02:27:13.000Z
2021-01-18T02:27:13.000Z
input_size = (1, 128, 128) ORIG_SIZE = (480, 640) RESIZE_TO = (input_size[1], input_size[2])
23.25
42
0.677419
17
93
3.411765
0.588235
0.465517
0.344828
0
0
0
0
0
0
0
0
0.1875
0.139785
93
3
43
31
0.5375
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
fc588e5343a508c560ce19562308e8176c8460cd
328
py
Python
isw2-master/src/app/core/docente.py
marlanbar/academic-projects
bcdc8ca36b6984ab3f83c10b8a3ed45576ecfca1
[ "MIT" ]
null
null
null
isw2-master/src/app/core/docente.py
marlanbar/academic-projects
bcdc8ca36b6984ab3f83c10b8a3ed45576ecfca1
[ "MIT" ]
null
null
null
isw2-master/src/app/core/docente.py
marlanbar/academic-projects
bcdc8ca36b6984ab3f83c10b8a3ed45576ecfca1
[ "MIT" ]
null
null
null
from .autoridad import Autoridad class Docente(Autoridad): #Colaboradores Internos #nombre: String def __init__(self, nombre): self.nombre = nombre def getNombre(self): return self.nombre def puedeVisualizarInfoDeCurso(self, unCurso): return unCurso.getDocente() == self def __str__(self): return self.nombre
18.222222
47
0.756098
38
328
6.315789
0.473684
0.166667
0.116667
0.166667
0
0
0
0
0
0
0
0
0.152439
328
17
48
19.294118
0.863309
0.109756
0
0.2
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0.1
0.3
0.9
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
1
0
0
4
fc61a3804be19dd5e60ad8ddb48ef88911f02ccb
146
py
Python
ramda/juxt.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
56
2018-08-06T08:44:58.000Z
2022-03-17T09:49:03.000Z
ramda/juxt.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
28
2019-06-17T11:09:52.000Z
2022-02-18T16:59:21.000Z
ramda/juxt.py
jakobkolb/ramda.py
982b2172f4bb95b9a5b09eff8077362d6f2f0920
[ "MIT" ]
5
2019-09-18T09:24:38.000Z
2021-07-21T08:40:23.000Z
def juxt(functions, *args): """juxt applies a list of functions to a list of values""" return lambda *args: [f(*args) for f in functions]
36.5
62
0.671233
24
146
4.083333
0.625
0.102041
0.142857
0
0
0
0
0
0
0
0
0
0.205479
146
3
63
48.666667
0.844828
0.356164
0
0
0
0
0
0
0
0
0
0
0
1
0.5
false
0
0
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
fc8654f0f12304f3a98d83d944ef7a8ef998012b
93
py
Python
commodity/apps.py
akliuxingyuan/CarSalesManage
c042daba6c9d397dec5196a5ebdaecc675b6bba0
[ "Apache-2.0" ]
null
null
null
commodity/apps.py
akliuxingyuan/CarSalesManage
c042daba6c9d397dec5196a5ebdaecc675b6bba0
[ "Apache-2.0" ]
null
null
null
commodity/apps.py
akliuxingyuan/CarSalesManage
c042daba6c9d397dec5196a5ebdaecc675b6bba0
[ "Apache-2.0" ]
null
null
null
from django.apps import AppConfig class CommodityConfig(AppConfig): name = 'commodity'
15.5
33
0.763441
10
93
7.1
0.9
0
0
0
0
0
0
0
0
0
0
0
0.16129
93
5
34
18.6
0.910256
0
0
0
0
0
0.096774
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
fc8e84185421ca8d2af4018f03c8d9101e2f1538
163
py
Python
setup.py
pannal/systray
bf39df2d586e694574d7b020df1f9f92cb772d59
[ "BSD-3-Clause" ]
null
null
null
setup.py
pannal/systray
bf39df2d586e694574d7b020df1f9f92cb772d59
[ "BSD-3-Clause" ]
null
null
null
setup.py
pannal/systray
bf39df2d586e694574d7b020df1f9f92cb772d59
[ "BSD-3-Clause" ]
null
null
null
# coding=utf-8 from setuptools import setup from setuptools import find_packages setup( name="systray", version="0.1.11", packages=find_packages(), )
16.3
36
0.711656
22
163
5.181818
0.681818
0.245614
0.350877
0
0
0
0
0
0
0
0
0.037037
0.171779
163
10
37
16.3
0.807407
0.07362
0
0
0
0
0.086667
0
0
0
0
0
0
1
0
true
0
0.285714
0
0.285714
0
1
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
5df095b12d771e9593f3d39cddb2ea4930b613f4
67
py
Python
PyMonthlyExpense/__init__.py
jepierre/python_apps
ce3350480aed9c091bb92281d13711337b40b2dd
[ "MIT" ]
null
null
null
PyMonthlyExpense/__init__.py
jepierre/python_apps
ce3350480aed9c091bb92281d13711337b40b2dd
[ "MIT" ]
null
null
null
PyMonthlyExpense/__init__.py
jepierre/python_apps
ce3350480aed9c091bb92281d13711337b40b2dd
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """" Author: Jean Pierre Last Edited: """
9.571429
23
0.537313
8
67
4.5
1
0
0
0
0
0
0
0
0
0
0
0.018519
0.19403
67
6
24
11.166667
0.648148
0.850746
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
b90405e57c13bc1b848a3cc16621ec94c75ecd40
96
py
Python
appointments/apps/common/__init__.py
marceloomens/appointments
c4adff97e391dce2f4f04c357c4a823b017aa820
[ "MIT" ]
null
null
null
appointments/apps/common/__init__.py
marceloomens/appointments
c4adff97e391dce2f4f04c357c4a823b017aa820
[ "MIT" ]
2
2015-01-04T07:01:36.000Z
2015-05-12T18:30:31.000Z
appointments/apps/common/__init__.py
marceloomens/appointments
c4adff97e391dce2f4f04c357c4a823b017aa820
[ "MIT" ]
null
null
null
# Prepare for Django 1.7 default_app_config = 'appointments.apps.common.apps.AppointmentsConfig'
48
71
0.833333
13
96
6
0.923077
0
0
0
0
0
0
0
0
0
0
0.022472
0.072917
96
2
71
48
0.853933
0.229167
0
0
0
0
0.657534
0.657534
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
b90489456d963d04946cf879f80ee33c8cd97878
165
py
Python
shop/tools.py
jhihwei/eshop
e9861e9a2ee084201ecd36bed628cf50e9dbeb7e
[ "Apache-2.0" ]
null
null
null
shop/tools.py
jhihwei/eshop
e9861e9a2ee084201ecd36bed628cf50e9dbeb7e
[ "Apache-2.0" ]
null
null
null
shop/tools.py
jhihwei/eshop
e9861e9a2ee084201ecd36bed628cf50e9dbeb7e
[ "Apache-2.0" ]
null
null
null
from orders.models import OrderItem def get_product_string(order_item:OrderItem): products = [i.product.name+"#" for i in order_item] return "".join(products)
33
55
0.757576
24
165
5.041667
0.75
0.14876
0
0
0
0
0
0
0
0
0
0
0.127273
165
5
56
33
0.840278
0
0
0
0
0
0.006024
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
b905837ffee694ddc434cd52e25e9cdba4984548
642
py
Python
beaconServer/lib/__init__.py
progenetix/bycon
0f81ee17d81d37b55ce492a84814e9e8a90042f6
[ "CC0-1.0" ]
4
2020-07-21T09:36:38.000Z
2021-06-28T13:00:07.000Z
beaconServer/lib/__init__.py
progenetix/bycon
0f81ee17d81d37b55ce492a84814e9e8a90042f6
[ "CC0-1.0" ]
4
2020-07-22T08:14:27.000Z
2021-06-24T13:39:03.000Z
beaconServer/lib/__init__.py
progenetix/bycon
0f81ee17d81d37b55ce492a84814e9e8a90042f6
[ "CC0-1.0" ]
2
2021-03-16T19:34:13.000Z
2021-12-15T08:51:38.000Z
# __init__.py from os import pardir, path import sys dir_path = path.dirname( path.abspath(__file__) ) sys.path.append( dir_path ) from cgi_utils import * from datatable_utils import * from handover_execution import * from handover_generation import * from interval_utils import * from parse_filters import * from parse_variants import * from publication_utils import * from query_execution import * from query_generation import * from read_specs import * from remap_utils import * from schemas_parser import * from service_utils import * from biosample_responses import * from individual_responses import * from variant_responses import *
25.68
49
0.816199
89
642
5.58427
0.393258
0.321932
0.181087
0
0
0
0
0
0
0
0
0
0.135514
642
24
50
26.75
0.895496
0.017134
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.904762
0
0.904762
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
f8e31c40d881fbabcfb690a06b56a31759a206af
50
py
Python
tests/__init__.py
hemna/aprsd-twitter-plugin
06d36645860df9bf61dbe770300d22f172e554a4
[ "MIT" ]
2
2021-10-17T06:51:40.000Z
2022-01-22T05:25:19.000Z
tests/__init__.py
hemna/aprsd-twitter-plugin
06d36645860df9bf61dbe770300d22f172e554a4
[ "MIT" ]
null
null
null
tests/__init__.py
hemna/aprsd-twitter-plugin
06d36645860df9bf61dbe770300d22f172e554a4
[ "MIT" ]
null
null
null
"""Unit test package for aprsd_twitter_plugin."""
25
49
0.76
7
50
5.142857
1
0
0
0
0
0
0
0
0
0
0
0
0.1
50
1
50
50
0.8
0.86
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
f8e57c21d51cb1556850f92d9151bdc9d7cb8e69
279
py
Python
backend/tasker_business/admin.py
crowdbotics-apps/nsp-28646
ebbe680474ccf7fbbffc996fb0d68795b0b65f3b
[ "FTL", "AML", "RSA-MD" ]
null
null
null
backend/tasker_business/admin.py
crowdbotics-apps/nsp-28646
ebbe680474ccf7fbbffc996fb0d68795b0b65f3b
[ "FTL", "AML", "RSA-MD" ]
null
null
null
backend/tasker_business/admin.py
crowdbotics-apps/nsp-28646
ebbe680474ccf7fbbffc996fb0d68795b0b65f3b
[ "FTL", "AML", "RSA-MD" ]
null
null
null
from django.contrib import admin from .models import TaskerSkill, BusinessPhoto, Timeslot, TaskerAvailability admin.site.register(BusinessPhoto) admin.site.register(Timeslot) admin.site.register(TaskerSkill) admin.site.register(TaskerAvailability) # Register your models here.
27.9
76
0.83871
32
279
7.3125
0.4375
0.153846
0.290598
0
0
0
0
0
0
0
0
0
0.078853
279
9
77
31
0.910506
0.09319
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
f8efed0d4175037c0e7779cc04233ac4222f2680
60
py
Python
scripts/random/throwaway_gen.py
oxalorg/dotfiles
f49258abcc1dbc17fbb5fb9548863fce75779a17
[ "MIT" ]
13
2016-12-07T23:35:02.000Z
2021-05-18T14:48:46.000Z
scripts/random/throwaway_gen.py
oxalorg/dotfiles
f49258abcc1dbc17fbb5fb9548863fce75779a17
[ "MIT" ]
2
2017-08-15T16:29:24.000Z
2020-04-10T06:36:19.000Z
scripts/random/throwaway_gen.py
oxalorg/dotfiles
f49258abcc1dbc17fbb5fb9548863fce75779a17
[ "MIT" ]
5
2017-01-23T22:36:44.000Z
2021-11-02T20:44:45.000Z
import random import os username = ''.join(random.choice(
10
33
0.733333
8
60
5.5
0.75
0
0
0
0
0
0
0
0
0
0
0
0.15
60
5
34
12
0.862745
0
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0.666667
null
null
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
1
0
0
0
1
0
0
0
0
4
f8f67e9999301aa4558f77af0a41f51b493245d8
2,450
py
Python
sap_hana/tests/metrics.py
jstoja/integrations-core
704fa31f7db642c6df9e0969b3b2778fc6144fa7
[ "BSD-3-Clause" ]
null
null
null
sap_hana/tests/metrics.py
jstoja/integrations-core
704fa31f7db642c6df9e0969b3b2778fc6144fa7
[ "BSD-3-Clause" ]
null
null
null
sap_hana/tests/metrics.py
jstoja/integrations-core
704fa31f7db642c6df9e0969b3b2778fc6144fa7
[ "BSD-3-Clause" ]
1
2019-12-23T13:35:17.000Z
2019-12-23T13:35:17.000Z
# (C) Datadog, Inc. 2019 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) STANDARD = [ 'sap_hana.backup.latest', 'sap_hana.connection.idle', 'sap_hana.connection.open', 'sap_hana.connection.running', 'sap_hana.cpu.service.utilized', 'sap_hana.disk.free', 'sap_hana.disk.size', 'sap_hana.disk.used', 'sap_hana.disk.utilized', 'sap_hana.file.service.open', 'sap_hana.memory.row_store.free', 'sap_hana.memory.row_store.total', 'sap_hana.memory.row_store.used', 'sap_hana.memory.row_store.utilized', 'sap_hana.memory.service.component.used', 'sap_hana.memory.service.compactor.free', 'sap_hana.memory.service.compactor.total', 'sap_hana.memory.service.compactor.used', 'sap_hana.memory.service.compactor.utilized', 'sap_hana.memory.service.heap.free', 'sap_hana.memory.service.heap.total', 'sap_hana.memory.service.heap.used', 'sap_hana.memory.service.heap.utilized', 'sap_hana.memory.service.overall.physical.total', 'sap_hana.memory.service.overall.free', 'sap_hana.memory.service.overall.total', 'sap_hana.memory.service.overall.used', 'sap_hana.memory.service.overall.utilized', 'sap_hana.memory.service.overall.virtual.total', 'sap_hana.memory.service.shared.free', 'sap_hana.memory.service.shared.total', 'sap_hana.memory.service.shared.used', 'sap_hana.memory.service.shared.utilized', 'sap_hana.network.service.request.active', 'sap_hana.network.service.request.external.total_finished', 'sap_hana.network.service.request.internal.total_finished', 'sap_hana.network.service.request.pending', 'sap_hana.network.service.request.per_second', 'sap_hana.network.service.request.response_time', 'sap_hana.network.service.request.total_finished', 'sap_hana.thread.service.active', 'sap_hana.thread.service.inactive', 'sap_hana.thread.service.total', 'sap_hana.uptime', 'sap_hana.volume.io.read.count', 'sap_hana.volume.io.read.size.count', 'sap_hana.volume.io.read.size.total', 'sap_hana.volume.io.read.total', 'sap_hana.volume.io.read.utilized', 'sap_hana.volume.io.throughput', 'sap_hana.volume.io.utilized', 'sap_hana.volume.io.write.count', 'sap_hana.volume.io.write.size.count', 'sap_hana.volume.io.write.size.total', 'sap_hana.volume.io.write.total', 'sap_hana.volume.io.write.utilized', ]
39.516129
63
0.72
341
2,450
4.982405
0.187683
0.230724
0.175986
0.223661
0.696881
0.327251
0.115362
0
0
0
0
0.002329
0.123673
2,450
61
64
40.163934
0.789008
0.040816
0
0
0
0
0.801364
0.771952
0
0
0
0
0
1
0
false
0
0
0
0
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
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5d0450a0cc6a5ab9064a41ba088dcb2a8e874683
11,017
py
Python
tests/test_nc_mt_scenario.py
lrzpellegrini/avalanche_pre_public
522019a55ce08b92c1ec74b508a8ea6ae8751dfd
[ "MIT" ]
null
null
null
tests/test_nc_mt_scenario.py
lrzpellegrini/avalanche_pre_public
522019a55ce08b92c1ec74b508a8ea6ae8751dfd
[ "MIT" ]
null
null
null
tests/test_nc_mt_scenario.py
lrzpellegrini/avalanche_pre_public
522019a55ce08b92c1ec74b508a8ea6ae8751dfd
[ "MIT" ]
null
null
null
import unittest from torchvision.datasets import MNIST from avalanche.benchmarks.scenarios.new_classes import NCExperience from avalanche.benchmarks.utils import AvalancheSubset from avalanche.benchmarks.scenarios.new_classes.nc_utils import \ make_nc_transformation_subset from avalanche.benchmarks import nc_scenario, GenericScenarioStream class MultiTaskTests(unittest.TestCase): def test_mt_single_dataset(self): mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) my_nc_scenario = nc_scenario( mnist_train, mnist_test, 5, task_labels=True, shuffle=True, seed=1234, class_ids_from_zero_in_each_exp=True) self.assertEqual(5, my_nc_scenario.n_experiences) self.assertEqual(10, my_nc_scenario.n_classes) for task_id in range(5): self.assertEqual(2, len(my_nc_scenario.classes_in_experience[task_id])) all_classes = set() all_original_classes = set() for task_id in range(5): all_classes.update(my_nc_scenario.classes_in_experience[task_id]) all_original_classes.update( my_nc_scenario.original_classes_in_exp[task_id]) self.assertEqual(2, len(all_classes)) self.assertEqual(10, len(all_original_classes)) def test_mt_single_dataset_without_class_id_remap(self): mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) my_nc_scenario = nc_scenario( mnist_train, mnist_test, 5, task_labels=True, shuffle=True, seed=1234, class_ids_from_zero_in_each_exp=False) self.assertEqual(5, my_nc_scenario.n_experiences) self.assertEqual(10, my_nc_scenario.n_classes) for task_id in range(5): self.assertEqual(2, len(my_nc_scenario.classes_in_experience[task_id])) all_classes = set() for task_id in range(my_nc_scenario.n_experiences): all_classes.update(my_nc_scenario.classes_in_experience[task_id]) self.assertEqual(10, len(all_classes)) def test_mt_single_dataset_fixed_order(self): order = [2, 3, 5, 7, 8, 9, 0, 1, 4, 6] mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) my_nc_scenario = nc_scenario( mnist_train, mnist_test, 5, task_labels=True, fixed_class_order=order, class_ids_from_zero_in_each_exp=False) all_classes = [] for task_id in range(5): all_classes.extend(my_nc_scenario.classes_in_experience[task_id]) self.assertEqual(order, all_classes) def test_sit_single_dataset_fixed_order_subset(self): order = [2, 5, 7, 8, 9, 0, 1, 4] mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) my_nc_scenario = nc_scenario( mnist_train, mnist_test, 4, task_labels=True, fixed_class_order=order, class_ids_from_zero_in_each_exp=True) self.assertEqual(4, len(my_nc_scenario.classes_in_experience)) all_classes = [] for task_id in range(4): self.assertEqual(2, len(my_nc_scenario.classes_in_experience[task_id])) self.assertEqual(set(order[task_id*2:(task_id+1)*2]), my_nc_scenario.original_classes_in_exp[task_id]) all_classes.extend(my_nc_scenario.classes_in_experience[task_id]) self.assertEqual([0, 1] * 4, all_classes) def test_sit_single_dataset_fixed_subset_no_remap_idx(self): order = [2, 5, 7, 8, 9, 0, 1, 4] mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) my_nc_scenario = nc_scenario( mnist_train, mnist_test, 2, task_labels=True, fixed_class_order=order, class_ids_from_zero_in_each_exp=False) self.assertEqual(2, len(my_nc_scenario.classes_in_experience)) all_classes = set() for task_id in range(2): self.assertEqual(4, len(my_nc_scenario.classes_in_experience[task_id])) self.assertEqual(set(order[task_id*4:(task_id+1)*4]), my_nc_scenario.original_classes_in_exp[task_id]) all_classes.update(my_nc_scenario.classes_in_experience[task_id]) self.assertEqual(set(order), all_classes) def test_mt_single_dataset_reproducibility_data(self): mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) nc_scenario_ref = nc_scenario( mnist_train, mnist_test, 5, task_labels=True, shuffle=True, seed=5678) my_nc_scenario = nc_scenario( mnist_train, mnist_test, -1, task_labels=True, reproducibility_data=nc_scenario_ref.get_reproducibility_data()) self.assertEqual(nc_scenario_ref.train_exps_patterns_assignment, my_nc_scenario.train_exps_patterns_assignment) self.assertEqual(nc_scenario_ref.test_exps_patterns_assignment, my_nc_scenario.test_exps_patterns_assignment) def test_mt_single_dataset_task_size(self): mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) my_nc_scenario = nc_scenario( mnist_train, mnist_test, 3, task_labels=True, per_exp_classes={0: 5, 2: 2}, class_ids_from_zero_in_each_exp=True) self.assertEqual(3, my_nc_scenario.n_experiences) self.assertEqual(10, my_nc_scenario.n_classes) all_classes = set() for task_id in range(3): all_classes.update(my_nc_scenario.classes_in_experience[task_id]) self.assertEqual(5, len(all_classes)) self.assertEqual(5, len(my_nc_scenario.classes_in_experience[0])) self.assertEqual(3, len(my_nc_scenario.classes_in_experience[1])) self.assertEqual(2, len(my_nc_scenario.classes_in_experience[2])) def test_mt_multi_dataset_one_task_per_set(self): split_mapping = [0, 1, 2, 0, 1, 2, 3, 4, 5, 6] mnist_train = MNIST('./data/mnist', train=True, download=True) mnist_test = MNIST('./data/mnist', train=False, download=True) train_part1 = make_nc_transformation_subset( mnist_train, None, None, range(3)) train_part2 = make_nc_transformation_subset( mnist_train, None, None, range(3, 10)) train_part2 = AvalancheSubset( train_part2, class_mapping=split_mapping) test_part1 = make_nc_transformation_subset( mnist_test, None, None, range(3)) test_part2 = make_nc_transformation_subset( mnist_test, None, None, range(3, 10)) test_part2 = AvalancheSubset(test_part2, class_mapping=split_mapping) my_nc_scenario = nc_scenario( [train_part1, train_part2], [test_part1, test_part2], 2, task_labels=True, seed=1234, class_ids_from_zero_in_each_exp=True, one_dataset_per_exp=True) self.assertEqual(2, my_nc_scenario.n_experiences) self.assertEqual(10, my_nc_scenario.n_classes) self.assertEqual(2, len(my_nc_scenario.train_stream)) self.assertEqual(2, len(my_nc_scenario.test_stream)) exp_classes_train = [] exp_classes_test = [] all_classes_train = set() all_classes_test = set() task_info: NCExperience for task_id, task_info in enumerate(my_nc_scenario.train_stream): self.assertLessEqual(task_id, 1) all_classes_train.update(my_nc_scenario.classes_in_experience[task_id]) exp_classes_train.append(task_info.classes_in_this_experience) self.assertEqual(7, len(all_classes_train)) for task_id, task_info in enumerate(my_nc_scenario.test_stream): self.assertLessEqual(task_id, 1) all_classes_test.update(my_nc_scenario.classes_in_experience[task_id]) exp_classes_test.append(task_info.classes_in_this_experience) self.assertEqual(7, len(all_classes_test)) self.assertTrue( (my_nc_scenario.classes_in_experience[0] == {0, 1, 2} and my_nc_scenario.classes_in_experience[1] == set(range(0, 7))) or (my_nc_scenario.classes_in_experience[0] == set(range(0, 7)) and my_nc_scenario.classes_in_experience[1] == {0, 1, 2})) exp_classes_ref1 = [list(range(3)), list(range(7))] exp_classes_ref2 = [list(range(7)), list(range(3))] self.assertTrue(exp_classes_train == exp_classes_ref1 or exp_classes_train == exp_classes_ref2) if exp_classes_train == exp_classes_ref1: self.assertTrue(exp_classes_test == exp_classes_ref1) else: self.assertTrue(exp_classes_test == exp_classes_ref2) def test_nc_mt_slicing(self): mnist_train = MNIST( './data/mnist', train=True, download=True) mnist_test = MNIST( './data/mnist', train=False, download=True) my_nc_scenario = nc_scenario( mnist_train, mnist_test, 5, task_labels=True, shuffle=True, seed=1234) experience: NCExperience for batch_id, experience in enumerate(my_nc_scenario.train_stream): self.assertEqual(batch_id, experience.current_experience) self.assertIsInstance(experience, NCExperience) for batch_id, experience in enumerate(my_nc_scenario.test_stream): self.assertEqual(batch_id, experience.current_experience) self.assertIsInstance(experience, NCExperience) iterable_slice = [3, 4, 1] sliced_stream = my_nc_scenario.train_stream[iterable_slice] self.assertIsInstance(sliced_stream, GenericScenarioStream) self.assertEqual(len(iterable_slice), len(sliced_stream)) self.assertEqual('train', sliced_stream.name) for batch_id, experience in enumerate(sliced_stream): self.assertEqual(iterable_slice[batch_id], experience.current_experience) self.assertIsInstance(experience, NCExperience) sliced_stream = my_nc_scenario.test_stream[iterable_slice] self.assertIsInstance(sliced_stream, GenericScenarioStream) self.assertEqual(len(iterable_slice), len(sliced_stream)) self.assertEqual('test', sliced_stream.name) for batch_id, experience in enumerate(sliced_stream): self.assertEqual( iterable_slice[batch_id], experience.current_experience) self.assertIsInstance(experience, NCExperience) if __name__ == '__main__': unittest.main()
44.603239
85
0.679041
1,448
11,017
4.793508
0.07942
0.096528
0.089901
0.057485
0.837631
0.778274
0.74096
0.684772
0.634923
0.620228
0
0.019916
0.225197
11,017
246
86
44.784553
0.793229
0
0
0.384615
0
0
0.021149
0
0
0
0
0
0.266667
1
0.046154
false
0
0.030769
0
0.082051
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
5d47fc05691ba61d7d8b85f8cb8a96c23b68b713
12,585
py
Python
boto3_type_annotations_with_docs/boto3_type_annotations/datapipeline/paginator.py
cowboygneox/boto3_type_annotations
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
[ "MIT" ]
119
2018-12-01T18:20:57.000Z
2022-02-02T10:31:29.000Z
boto3_type_annotations_with_docs/boto3_type_annotations/datapipeline/paginator.py
cowboygneox/boto3_type_annotations
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
[ "MIT" ]
15
2018-11-16T00:16:44.000Z
2021-11-13T03:44:18.000Z
boto3_type_annotations_with_docs/boto3_type_annotations/datapipeline/paginator.py
cowboygneox/boto3_type_annotations
450dce1de4e066b939de7eac2ec560ed1a7ddaa2
[ "MIT" ]
11
2019-05-06T05:26:51.000Z
2021-09-28T15:27:59.000Z
from typing import Dict from typing import List from botocore.paginate import Paginator class DescribeObjects(Paginator): def paginate(self, pipelineId: str, objectIds: List, evaluateExpressions: bool = None, PaginationConfig: Dict = None) -> Dict: """ Creates an iterator that will paginate through responses from :py:meth:`DataPipeline.Client.describe_objects`. See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/DescribeObjects>`_ **Request Syntax** :: response_iterator = paginator.paginate( pipelineId='string', objectIds=[ 'string', ], evaluateExpressions=True|False, PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) **Response Syntax** :: { 'pipelineObjects': [ { 'id': 'string', 'name': 'string', 'fields': [ { 'key': 'string', 'stringValue': 'string', 'refValue': 'string' }, ] }, ], 'hasMoreResults': True|False, 'NextToken': 'string' } **Response Structure** - *(dict) --* Contains the output of DescribeObjects. - **pipelineObjects** *(list) --* An array of object definitions. - *(dict) --* Contains information about a pipeline object. This can be a logical, physical, or physical attempt pipeline object. The complete set of components of a pipeline defines the pipeline. - **id** *(string) --* The ID of the object. - **name** *(string) --* The name of the object. - **fields** *(list) --* Key-value pairs that define the properties of the object. - *(dict) --* A key-value pair that describes a property of a pipeline object. The value is specified as either a string value (``StringValue`` ) or a reference to another object (``RefValue`` ) but not as both. - **key** *(string) --* The field identifier. - **stringValue** *(string) --* The field value, expressed as a String. - **refValue** *(string) --* The field value, expressed as the identifier of another object. - **hasMoreResults** *(boolean) --* Indicates whether there are more results to return. - **NextToken** *(string) --* A token to resume pagination. :type pipelineId: string :param pipelineId: **[REQUIRED]** The ID of the pipeline that contains the object definitions. :type objectIds: list :param objectIds: **[REQUIRED]** The IDs of the pipeline objects that contain the definitions to be described. You can pass as many as 25 identifiers in a single call to ``DescribeObjects`` . - *(string) --* :type evaluateExpressions: boolean :param evaluateExpressions: Indicates whether any expressions in the object should be evaluated when the object descriptions are returned. :type PaginationConfig: dict :param PaginationConfig: A dictionary that provides parameters to control pagination. - **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a ``NextToken`` will be provided in the output that you can use to resume pagination. - **PageSize** *(integer) --* The size of each page. - **StartingToken** *(string) --* A token to specify where to start paginating. This is the ``NextToken`` from a previous response. :rtype: dict :returns: """ pass class ListPipelines(Paginator): def paginate(self, PaginationConfig: Dict = None) -> Dict: """ Creates an iterator that will paginate through responses from :py:meth:`DataPipeline.Client.list_pipelines`. See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/ListPipelines>`_ **Request Syntax** :: response_iterator = paginator.paginate( PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) **Response Syntax** :: { 'pipelineIdList': [ { 'id': 'string', 'name': 'string' }, ], 'hasMoreResults': True|False, 'NextToken': 'string' } **Response Structure** - *(dict) --* Contains the output of ListPipelines. - **pipelineIdList** *(list) --* The pipeline identifiers. If you require additional information about the pipelines, you can use these identifiers to call DescribePipelines and GetPipelineDefinition . - *(dict) --* Contains the name and identifier of a pipeline. - **id** *(string) --* The ID of the pipeline that was assigned by AWS Data Pipeline. This is a string of the form ``df-297EG78HU43EEXAMPLE`` . - **name** *(string) --* The name of the pipeline. - **hasMoreResults** *(boolean) --* Indicates whether there are more results that can be obtained by a subsequent call. - **NextToken** *(string) --* A token to resume pagination. :type PaginationConfig: dict :param PaginationConfig: A dictionary that provides parameters to control pagination. - **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a ``NextToken`` will be provided in the output that you can use to resume pagination. - **PageSize** *(integer) --* The size of each page. - **StartingToken** *(string) --* A token to specify where to start paginating. This is the ``NextToken`` from a previous response. :rtype: dict :returns: """ pass class QueryObjects(Paginator): def paginate(self, pipelineId: str, sphere: str, query: Dict = None, PaginationConfig: Dict = None) -> Dict: """ Creates an iterator that will paginate through responses from :py:meth:`DataPipeline.Client.query_objects`. See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/QueryObjects>`_ **Request Syntax** :: response_iterator = paginator.paginate( pipelineId='string', query={ 'selectors': [ { 'fieldName': 'string', 'operator': { 'type': 'EQ'|'REF_EQ'|'LE'|'GE'|'BETWEEN', 'values': [ 'string', ] } }, ] }, sphere='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) **Response Syntax** :: { 'ids': [ 'string', ], 'hasMoreResults': True|False, 'NextToken': 'string' } **Response Structure** - *(dict) --* Contains the output of QueryObjects. - **ids** *(list) --* The identifiers that match the query selectors. - *(string) --* - **hasMoreResults** *(boolean) --* Indicates whether there are more results that can be obtained by a subsequent call. - **NextToken** *(string) --* A token to resume pagination. :type pipelineId: string :param pipelineId: **[REQUIRED]** The ID of the pipeline. :type query: dict :param query: The query that defines the objects to be returned. The ``Query`` object can contain a maximum of ten selectors. The conditions in the query are limited to top-level String fields in the object. These filters can be applied to components, instances, and attempts. - **selectors** *(list) --* List of selectors that define the query. An object must satisfy all of the selectors to match the query. - *(dict) --* A comparision that is used to determine whether a query should return this object. - **fieldName** *(string) --* The name of the field that the operator will be applied to. The field name is the \"key\" portion of the field definition in the pipeline definition syntax that is used by the AWS Data Pipeline API. If the field is not set on the object, the condition fails. - **operator** *(dict) --* Contains a logical operation for comparing the value of a field with a specified value. - **type** *(string) --* The logical operation to be performed: equal (``EQ`` ), equal reference (``REF_EQ`` ), less than or equal (``LE`` ), greater than or equal (``GE`` ), or between (``BETWEEN`` ). Equal reference (``REF_EQ`` ) can be used only with reference fields. The other comparison types can be used only with String fields. The comparison types you can use apply only to certain object fields, as detailed below. The comparison operators EQ and REF_EQ act on the following fields: * name * @sphere * parent * @componentParent * @instanceParent * @status * @scheduledStartTime * @scheduledEndTime * @actualStartTime * @actualEndTime The comparison operators ``GE`` , ``LE`` , and ``BETWEEN`` act on the following fields: * @scheduledStartTime * @scheduledEndTime * @actualStartTime * @actualEndTime Note that fields beginning with the at sign (@) are read-only and set by the web service. When you name fields, you should choose names containing only alpha-numeric values, as symbols may be reserved by AWS Data Pipeline. User-defined fields that you add to a pipeline should prefix their name with the string \"my\". - **values** *(list) --* The value that the actual field value will be compared with. - *(string) --* :type sphere: string :param sphere: **[REQUIRED]** Indicates whether the query applies to components or instances. The possible values are: ``COMPONENT`` , ``INSTANCE`` , and ``ATTEMPT`` . :type PaginationConfig: dict :param PaginationConfig: A dictionary that provides parameters to control pagination. - **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a ``NextToken`` will be provided in the output that you can use to resume pagination. - **PageSize** *(integer) --* The size of each page. - **StartingToken** *(string) --* A token to specify where to start paginating. This is the ``NextToken`` from a previous response. :rtype: dict :returns: """ pass
48.590734
417
0.530393
1,217
12,585
5.474117
0.222679
0.009006
0.010808
0.012609
0.497298
0.482588
0.446563
0.438757
0.411738
0.379766
0
0.006503
0.376877
12,585
258
418
48.77907
0.843025
0.802463
0
0.25
0
0
0
0
0
0
0
0
0
1
0.25
false
0.25
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
1
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
1
0
0
4
5d557b0b379a48a61e9e913988c870b3d5e4b9cc
145
py
Python
venv/Lib/site-packages/cachetools/lru.py
ajayiagbebaku/NFL-Model
afcc67a85ca7138c58c3334d45988ada2da158ed
[ "MIT" ]
4
2021-10-20T12:39:09.000Z
2022-02-26T15:02:08.000Z
venv/Lib/site-packages/cachetools/lru.py
ajayiagbebaku/NFL-Model
afcc67a85ca7138c58c3334d45988ada2da158ed
[ "MIT" ]
null
null
null
venv/Lib/site-packages/cachetools/lru.py
ajayiagbebaku/NFL-Model
afcc67a85ca7138c58c3334d45988ada2da158ed
[ "MIT" ]
1
2021-10-20T13:47:10.000Z
2021-10-20T13:47:10.000Z
import warnings from . import LRUCache warnings.warn( "cachetools.lru is deprecated, please use cachetools.LRUCache", DeprecationWarning )
18.125
86
0.786207
16
145
7.125
0.75
0
0
0
0
0
0
0
0
0
0
0
0.144828
145
7
87
20.714286
0.919355
0
0
0
0
0
0.413793
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
5d62eeb5205282733dfd2f4d86ae3510aa193736
267
py
Python
utils/__init__.py
SCUT-BIP-Lab/SCUT-DHGA
1a75998b4ddc09e21da9352e6a51bed0c39ddfb8
[ "MIT" ]
6
2020-10-06T07:43:33.000Z
2022-03-21T00:12:27.000Z
utils/__init__.py
SCUT-BIP-Lab/SCUT-DHGA
1a75998b4ddc09e21da9352e6a51bed0c39ddfb8
[ "MIT" ]
null
null
null
utils/__init__.py
SCUT-BIP-Lab/SCUT-DHGA
1a75998b4ddc09e21da9352e6a51bed0c39ddfb8
[ "MIT" ]
2
2021-12-23T11:37:15.000Z
2021-12-24T02:24:13.000Z
''' @Description: file content @Date: 2019-11-25 16:32:06 @LastEditors: lxy @LastEditTime: 2019-11-27 21:36:24 ''' from utils.CenterLoss import CenterLoss from utils.transforms import RCropResize, CenterCrop, Random_gamma from utils.calculate_eer import calculate_eer
29.666667
66
0.801498
39
267
5.410256
0.717949
0.127962
0
0
0
0
0
0
0
0
0
0.116183
0.097378
267
9
67
29.666667
0.759336
0.397004
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
5d65605f692f90bf35e83a7c3dc362eede8d6926
11,769
py
Python
SqltDAO/CodeGen01/SqlSyntax.py
soft9000/PyDAO
1316bdf34b62187b7763c2c7dd0036837cdcc894
[ "MIT" ]
8
2018-03-10T05:33:58.000Z
2019-01-25T08:32:27.000Z
SqltDAO/CodeGen01/SqlSyntax.py
soft9000/PyDAO
1316bdf34b62187b7763c2c7dd0036837cdcc894
[ "MIT" ]
null
null
null
SqltDAO/CodeGen01/SqlSyntax.py
soft9000/PyDAO
1316bdf34b62187b7763c2c7dd0036837cdcc894
[ "MIT" ]
6
2018-10-15T17:07:28.000Z
2019-02-03T21:49:54.000Z
# Author: Soft9000.com # 2018/03/08: Class Created # 2021/02/18: Adding DAO / Dict I/O usages. import os import sys sys.path.insert(1, os.path.join(sys.path[0], '../..')) from collections import OrderedDict from SqltDAO.CodeGen01.OrderClass import OrderClass from SqltDAO.CodeGen01.CodeLevel import CodeLevel from SqltDAO.CodeGen01.DaoExceptions import GenOrderError from SqltDAO.CodeGen01.Normalizers import Norm class SqliteCrud: ''' Translates OrderClass + Fields into python source code. No files are created. ''' def __init__(self, order, fields): ''' Set-up class with an OrderClass and SQL Table-fields. Will raise an exception when proper types are not provided. ''' assert(isinstance(order, OrderClass)) self.order = order self.fields = Norm.NormCols(fields) self.level = CodeLevel() def code_class_template(self, text_file): ''' Translate a local order into Python code. Returns created source-code. ''' import time from SqltDAO.CodeGen01.Meta import Meta self.level.set(0) result = self.level.print("#!/usr/bin/env python3\n") result += self.level.print("'''") result += self.level.print("Generated by {}".format(Meta.Title())) result += self.level.print("Generated @ {}".format(time.asctime())) result += self.level.print("'''") result += self.level.print("\nfrom collections import OrderedDict\n") result += self.level.print("import sqlite3\n\n\nclass " + self.order.class_name + ":") result += self.level.print("") self.level.inc() result += self.level.print("def __init__(self):") self.level.inc() result += self.level.print("self.db = '" + Norm.NormPath(self.order.db_name) +"'") result += self.level.print("self.conn = None") result += self.level.print("self.curs = None") result += self.level.print("self.bOpen = False") result += self.level.print("self.fields = " + str(self.fields)) result += self.level.print("self.table_name = '" + self.order.table_name + "'") result += self.level.print("") self.level.dec() result += self.level.print("@classmethod") result += self.level.print("def get_fields(cls, value):") self.level.inc() result += self.level.print("if isinstance(value, cls):") self.level.inc() result += self.level.print("return list(value.fields.values())[1:]") self.level.dec() result += self.level.print("return value") result += self.level.print("") self.level.dec() result += self.level.print("def open(self):") self.level.inc() result += self.level.print("if self.bOpen is False:") self.level.inc(); result += self.level.print("self.conn = sqlite3.connect(self.db)") result += self.level.print("self.conn.row_factory = sqlite3.Row") result += self.level.print("self.curs = self.conn.cursor()") result += self.level.print("self.bOpen = True") self.level.dec() result += self.level.print("return True") result += self.level.print("") self.level.dec() result += self.level.print("def close(self):") self.level.inc() result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print("self.conn.commit()") result += self.level.print("self.bOpen = False") self.level.dec() result += self.level.print("return True") result += self.level.print("") self.level.dec() result += self.level.print("def count(self):") self.level.inc() result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print('res = self.curs.execute("SELECT count(*) FROM ' + self.order.table_name + ';")') result += self.level.print("return res.fetchone()[0]") self.level.dec() result += self.level.print("return -1") result += self.level.print("") self.level.dec() result += self.level.print("def drop_table(self):") self.level.inc() result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print('self.curs.execute("DrOp TaBLe IF EXISTS ' + self.order.table_name + ';")') result += self.level.print("return True") self.level.dec() result += self.level.print("return False") result += self.level.print("") self.level.dec() result += self.level.print("def create_table(self):") self.level.inc() result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print('self.curs.execute("' + self.sql_create_table() + '")') result += self.level.print("return True") self.level.dec() result += self.level.print("return False") result += self.level.print("") self.level.dec() result += self.level.print("def insert(self, fields):") self.level.inc() result += self.level.print("fields = " + self.order.class_name + ".get_fields(fields)") result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print('self.curs.execute("' + self.sql_insert_row() + '", fields)') result += self.level.print("return True") self.level.dec() result += self.level.print("return False") result += self.level.print("") self.level.dec() result += self.level.print("def update(self, id_, fields):") self.level.inc() result += self.level.print("fields = " + self.order.class_name + ".get_fields(fields)") result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print('self.curs.execute("' + self.sql_update_row('id_', "fields")) result += self.level.print("return True") self.level.dec() result += self.level.print("return False") result += self.level.print("") self.level.dec() result += self.level.print("def delete(self, primary_key):") self.level.inc() result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print('self.curs.execute("DELETE from ' + self.order.table_name + ' WHERE ID = ?;", [primary_key])') result += self.level.print("return True") self.level.dec() result += self.level.print("return False") result += self.level.print("") self.level.dec() result += self.level.print("def select(self, sql_select):") self.level.inc() result += self.level.print("if self.bOpen:") self.level.inc(); result += self.level.print('self.curs.execute(sql_select)') result += self.level.print("zlist = self.curs.fetchall()") result += self.level.print("for ref in zlist:") self.level.inc(); result += self.level.print("try:") self.level.inc(); result += self.level.print("yield ref") self.level.dec() result += self.level.print("except:") self.level.inc(); result += self.level.print("pass") self.level.dec() self.level.dec() result += self.level.print("return None") result += self.level.print("") self.level.dec() self.level.push() result += self.level.print("@staticmethod") if self.order.encoding: encoding = "'" + self.order.encoding + "'" else: encoding = str(self.order.encoding) result += self.level.print("def Import(dao, encoding=" + encoding + ", text_file='" + text_file + "', hasHeader=True, sep='" + self.order.sep[2] + "'):") self.level.inc() if self.order.sep[1] == 'CSV': result += self._inject_import_csv() else: result += self._inject_import() result += self.level.print("") self.level.dec() self.level.pop() result += self.level.print("") return result def sql_create_table(self): ''' Translate the order into a field-driven SQL Table creation statement. ''' result = "CREATE TABLE IF NOT EXISTS " + self.order.table_name result = result + '(ID INTEGER PRIMARY KEY AUTOINCREMENT,' for key in self.fields: if key.lower() == "id": continue result += ' ' result += key + " " result += self.fields[key] + "," result = result[0:len(result) - 1] result = result + ');' return result def sql_insert_row(self): ''' Translate the order into a field-driven SQL Row creation statement. ''' result = "INSERT INTO " + self.order.table_name + " (" final_keys = list() for key in self.fields: if key.lower() == "id": continue result += ' ' result += key + "," final_keys.append(key) result = result[0:len(result) - 1] # remove closing comma result = result + ') VALUES (' for val in final_keys: result += '?,' result = result[0:len(result) - 1] # remove closing comma result = result + ');' return result def sql_update_row(self, key_name, fields_name): ''' Translate the order into a field-driven SQL Row Update statement. ''' result = "UPDATE " + self.order.table_name + " SET" for key in self.fields: if key.lower() == "id": continue result += ' ' result += key + "=?," result = result[0:len(result) - 1] # remove closing comma result = result + ' WHERE ID = {};".format(' + key_name + "), " + fields_name + ")" return result def _inject_import_csv(self): result = '' result += self.level.print('import csv') result += self.level.print("with open(text_file, 'r', encoding=encoding) as fh:") self.level.inc() result += self.level.print('lines = csv.reader(fh)') result += self.level.print('for line in lines:') self.level.inc() result += self.level.print('dao.insert(line)') self.level.dec() self.level.dec() result += self.level.print('return True') return result def _inject_import(self): result = '' result += self.level.print("try:") self.level.inc() result += self.level.print('# dao.open()') result += self.level.print("with open(text_file, encoding=encoding) as fh:") self.level.inc() result += self.level.print("line = fh.readline().strip()") result += self.level.print("if hasHeader is True:") self.level.inc() result += self.level.print("line = fh.readline().strip()") self.level.dec() result += self.level.print("while len(line) != 0:") self.level.inc() result += self.level.print("if dao.insert(line.split(sep)) is False:") self.level.inc() result += self.level.print("return False") self.level.dec() result += self.level.print("line = fh.readline().strip()") self.level.dec() self.level.dec() result += self.level.print("# dao.close()") result += self.level.print("return True") self.level.dec() result += self.level.print("except:") self.level.inc() result += self.level.print("pass") self.level.dec() result += self.level.print("return False") return result
40.304795
129
0.570057
1,411
11,769
4.706591
0.128278
0.243939
0.248457
0.331275
0.690408
0.641018
0.595091
0.568438
0.499473
0.439994
0
0.005903
0.265868
11,769
291
130
40.443299
0.762731
0.053021
0
0.581673
0
0
0.186542
0.024175
0
0
0
0
0.003984
1
0.027888
false
0.007968
0.067729
0
0.123506
0.438247
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
5d728d9cb2bf78574167e25d9374a6f4d0a8cc08
62
py
Python
lib/smisk/test/mvc/__init__.py
rsms/smisk
f12a5606dfff49a15fa91448ff36652d60add4c0
[ "MIT" ]
4
2015-11-05T11:51:12.000Z
2020-12-30T18:55:58.000Z
lib/smisk/test/mvc/__init__.py
rsms/smisk
f12a5606dfff49a15fa91448ff36652d60add4c0
[ "MIT" ]
5
2021-11-16T17:21:51.000Z
2021-11-16T17:22:09.000Z
lib/smisk/test/mvc/__init__.py
rsms/smisk
f12a5606dfff49a15fa91448ff36652d60add4c0
[ "MIT" ]
null
null
null
# encoding: utf-8 '''Tests regarding the smisk.mvc module '''
15.5
39
0.693548
9
62
4.777778
1
0
0
0
0
0
0
0
0
0
0
0.018868
0.145161
62
3
40
20.666667
0.792453
0.854839
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
53aa881ffe973dc70355219e575de82555b51b03
171
py
Python
server/config.py
christinali/SQLProject
d5fccc7c1f00f3a8c1444dc69a18c03663405703
[ "MIT" ]
null
null
null
server/config.py
christinali/SQLProject
d5fccc7c1f00f3a8c1444dc69a18c03663405703
[ "MIT" ]
null
null
null
server/config.py
christinali/SQLProject
d5fccc7c1f00f3a8c1444dc69a18c03663405703
[ "MIT" ]
1
2018-11-15T03:36:40.000Z
2018-11-15T03:36:40.000Z
import getpass print(getpass.getuser()) SQLALCHEMY_DATABASE_URI = 'postgresql://'+getpass.getuser()+':dbpasswd@localhost/bookbagging' SQLALCHEMY_ECHO = True DEBUG = True
24.428571
93
0.789474
19
171
6.947368
0.736842
0.212121
0
0
0
0
0
0
0
0
0
0
0.076023
171
6
94
28.5
0.835443
0
0
0
0
0
0.25731
0.181287
0
0
0
0
0
1
0
false
0.6
0.2
0
0.2
0.2
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
53da8e2289a19da70767dafecb131c741f8dc692
123
py
Python
plusportals/__init__.py
StephenXie/PlusPortalsAPI
1b47905b253bcf39865d2184c9ec76adfe78c9be
[ "MIT" ]
null
null
null
plusportals/__init__.py
StephenXie/PlusPortalsAPI
1b47905b253bcf39865d2184c9ec76adfe78c9be
[ "MIT" ]
null
null
null
plusportals/__init__.py
StephenXie/PlusPortalsAPI
1b47905b253bcf39865d2184c9ec76adfe78c9be
[ "MIT" ]
null
null
null
from .client import * from .tracker import * """Unofficial, Reverse Engineered PlusPortals API.""" __version__ = '0.2.2'
20.5
53
0.715447
15
123
5.6
0.8
0
0
0
0
0
0
0
0
0
0
0.028571
0.146341
123
6
54
20.5
0.771429
0
0
0
0
0
0.070423
0
0
0
0
0
0
1
0
false
0
0.666667
0
0.666667
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
53e5ab4cad75e45fbe0fa1d4970c78ecab3b602f
83
py
Python
syncmanagerclient/legacy.py
Frie-man/syncmanager
f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6
[ "MIT" ]
null
null
null
syncmanagerclient/legacy.py
Frie-man/syncmanager
f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6
[ "MIT" ]
null
null
null
syncmanagerclient/legacy.py
Frie-man/syncmanager
f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6
[ "MIT" ]
null
null
null
from syncmanagerclient.main import legacy if __name__ == '__main__': legacy()
16.6
41
0.73494
9
83
5.888889
0.777778
0
0
0
0
0
0
0
0
0
0
0
0.168675
83
4
42
20.75
0.768116
0
0
0
0
0
0.096386
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
54c8b6682a541d2ea2332f1a594a56f0a040ebd7
5,970
py
Python
src/bxcommon/messages/bloxroute/bloxroute_version_manager.py
dolphinridercrypto/bxcommon
8f70557c1dbff785a5dd3fcdf91176066e085c3a
[ "MIT" ]
null
null
null
src/bxcommon/messages/bloxroute/bloxroute_version_manager.py
dolphinridercrypto/bxcommon
8f70557c1dbff785a5dd3fcdf91176066e085c3a
[ "MIT" ]
null
null
null
src/bxcommon/messages/bloxroute/bloxroute_version_manager.py
dolphinridercrypto/bxcommon
8f70557c1dbff785a5dd3fcdf91176066e085c3a
[ "MIT" ]
null
null
null
from bxcommon import constants from bxcommon.messages.bloxroute.bloxroute_message_factory import bloxroute_message_factory from bxcommon.messages.bloxroute.bloxroute_message_type import BloxrouteMessageType from bxcommon.messages.bloxroute.protocol_version import PROTOCOL_VERSION from bxcommon.messages.bloxroute.v22 import message_converter_factory_v22, bloxroute_message_factory_v22 from bxcommon.messages.bloxroute.v6.bloxroute_message_factory_v6 import bloxroute_message_factory_v6 from bxcommon.messages.bloxroute.v6.message_converter_factory_v6 import message_converter_factory_v6 from bxcommon.messages.bloxroute.v7.bloxroute_message_factory_v7 import bloxroute_message_factory_v7 from bxcommon.messages.bloxroute.v7.message_converter_factory_v7 import message_converter_factory_v7 from bxcommon.messages.bloxroute.v8.bloxroute_message_factory_v8 import bloxroute_message_factory_v8 from bxcommon.messages.bloxroute.v8.message_converter_factory_v8 import message_converter_factory_v8 from bxcommon.messages.bloxroute.v9.bloxroute_message_factory_v9 import bloxroute_message_factory_v9 from bxcommon.messages.bloxroute.v9.message_converter_factory_v9 import message_converter_factory_v9 from bxcommon.messages.bloxroute.v10.bloxroute_message_factory_v10 import bloxroute_message_factory_v10 from bxcommon.messages.bloxroute.v10.message_converter_factory_v10 import message_converter_factory_v10 from bxcommon.messages.bloxroute.v11.bloxroute_message_factory_v11 import bloxroute_message_factory_v11 from bxcommon.messages.bloxroute.v11.message_converter_factory_v11 import message_converter_factory_v11 from bxcommon.messages.bloxroute.v12.bloxroute_message_factory_v12 import bloxroute_message_factory_v12 from bxcommon.messages.bloxroute.v12.message_converter_factory_v12 import message_converter_factory_v12 from bxcommon.messages.bloxroute.v13.bloxroute_message_factory_v13 import bloxroute_message_factory_v13 from bxcommon.messages.bloxroute.v13.message_converter_factory_v13 import message_converter_factory_v13 from bxcommon.messages.bloxroute.v14.bloxroute_message_factory_v14 import bloxroute_message_factory_v14 from bxcommon.messages.bloxroute.v14.message_converter_factory_v14 import message_converter_factory_v14 from bxcommon.messages.bloxroute.v15.bloxroute_message_factory_v15 import bloxroute_message_factory_v15 from bxcommon.messages.bloxroute.v15.message_converter_factory_v15 import message_converter_factory_v15 from bxcommon.messages.bloxroute.v16.bloxroute_message_factory_v16 import bloxroute_message_factory_v16 from bxcommon.messages.bloxroute.v16.message_converter_factory_v16 import message_converter_factory_v16 from bxcommon.messages.bloxroute.v17.bloxroute_message_factory_v17 import bloxroute_message_factory_v17 from bxcommon.messages.bloxroute.v17.message_converter_factory_v17 import message_converter_factory_v17 from bxcommon.messages.bloxroute.v18.message_converter_factory_v18 import message_converter_factory_v18 from bxcommon.messages.bloxroute.v18.bloxroute_message_factory_v18 import bloxroute_message_factory_v18 from bxcommon.messages.bloxroute.v19.bloxroute_message_factory_v19 import bloxroute_message_factory_v19 from bxcommon.messages.bloxroute.v19.message_converter_factory_v19 import message_converter_factory_v19 from bxcommon.messages.bloxroute.v20.message_converter_factory_v20 import message_converter_factory_v20 from bxcommon.messages.bloxroute.v20.bloxroute_message_factory_v20 import bloxroute_message_factory_v20 from bxcommon.messages.bloxroute.v21.message_converter_factory_v21 import message_converter_factory_v21 from bxcommon.messages.bloxroute.v21.bloxroute_message_factory_v21 import bloxroute_message_factory_v21 from bxcommon.messages.versioning.abstract_version_manager import AbstractVersionManager class _BloxrouteVersionManager(AbstractVersionManager): CURRENT_PROTOCOL_VERSION = PROTOCOL_VERSION MIN_SUPPORTED_PROTOCOL_VERSION = 6 VERSION_MESSAGE_MAIN_LENGTH = constants.VERSIONED_HELLO_MSG_MIN_PAYLOAD_LEN _PROTOCOL_TO_CONVERTER_FACTORY_MAPPING = { 6: message_converter_factory_v6, 7: message_converter_factory_v7, 8: message_converter_factory_v8, 9: message_converter_factory_v9, 10: message_converter_factory_v10, 11: message_converter_factory_v11, 12: message_converter_factory_v12, 13: message_converter_factory_v13, 14: message_converter_factory_v14, 15: message_converter_factory_v15, 16: message_converter_factory_v16, 17: message_converter_factory_v17, 18: message_converter_factory_v18, 19: message_converter_factory_v19, 20: message_converter_factory_v20, 21: message_converter_factory_v21, 22: message_converter_factory_v22 } _PROTOCOL_TO_FACTORY_MAPPING = { 6: bloxroute_message_factory_v6, 7: bloxroute_message_factory_v7, 8: bloxroute_message_factory_v8, 9: bloxroute_message_factory_v9, 10: bloxroute_message_factory_v10, 11: bloxroute_message_factory_v11, 12: bloxroute_message_factory_v12, 13: bloxroute_message_factory_v13, 14: bloxroute_message_factory_v14, 15: bloxroute_message_factory_v15, 16: bloxroute_message_factory_v16, 17: bloxroute_message_factory_v17, 18: bloxroute_message_factory_v18, 19: bloxroute_message_factory_v19, 20: bloxroute_message_factory_v20, 21: bloxroute_message_factory_v21, 22: bloxroute_message_factory_v22, 23: bloxroute_message_factory } def __init__(self) -> None: super(_BloxrouteVersionManager, self).__init__() self.protocol_to_factory_mapping = self._PROTOCOL_TO_FACTORY_MAPPING self.protocol_to_converter_factory_mapping = self._PROTOCOL_TO_CONVERTER_FACTORY_MAPPING self.version_message_command = BloxrouteMessageType.HELLO bloxroute_version_manager = _BloxrouteVersionManager()
64.193548
104
0.856449
751
5,970
6.320905
0.095872
0.18201
0.256794
0.219928
0.338108
0.291974
0.028228
0.028228
0.019381
0
0
0.0554
0.10201
5,970
92
105
64.891304
0.830069
0
0
0
0
0
0
0
0
0
0
0
0
1
0.011494
false
0
0.436782
0
0.517241
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
54d09fd91066f57876f2572f330815896aa0d7d7
224
py
Python
scrubadub/detectors/credential.py
robclewley/scrubadub
465b5d50e6fc6fb3b3dde49dac5c7d95305a3f0c
[ "MIT" ]
3
2019-04-14T04:13:40.000Z
2020-04-22T05:10:28.000Z
scrubadub/detectors/credential.py
robclewley/scrubadub
465b5d50e6fc6fb3b3dde49dac5c7d95305a3f0c
[ "MIT" ]
1
2018-01-26T17:39:54.000Z
2018-01-26T17:39:54.000Z
scrubadub/detectors/credential.py
robclewley/scrubadub
465b5d50e6fc6fb3b3dde49dac5c7d95305a3f0c
[ "MIT" ]
3
2019-08-29T11:53:42.000Z
2021-04-10T19:51:26.000Z
from .base import RegexDetector from ..filth import CredentialFilth class CredentialDetector(RegexDetector): """Remove username/password combinations from dirty drity ``text``. """ filth_cls = CredentialFilth
22.4
71
0.754464
22
224
7.636364
0.727273
0
0
0
0
0
0
0
0
0
0
0
0.160714
224
9
72
24.888889
0.893617
0.285714
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
54d18c0078d0a835e70591dfcc816eb4b6b34759
8,753
py
Python
tests/test_rfc2315.py
pysnmp/pyasn1-modules
93f5699988fbb090be13aaa339498c128ba7dedb
[ "BSD-2-Clause" ]
null
null
null
tests/test_rfc2315.py
pysnmp/pyasn1-modules
93f5699988fbb090be13aaa339498c128ba7dedb
[ "BSD-2-Clause" ]
null
null
null
tests/test_rfc2315.py
pysnmp/pyasn1-modules
93f5699988fbb090be13aaa339498c128ba7dedb
[ "BSD-2-Clause" ]
null
null
null
# # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2020, Ilya Etingof <etingof@gmail.com> # License: http://snmplabs.com/pyasn1/license.html # import sys import unittest from pyasn1.codec.der.decoder import decode as der_decoder from pyasn1.codec.der.encoder import encode as der_encoder from pyasn1_modules import pem, rfc2315 class Pkcs7TestCase(unittest.TestCase): pem_text_unordered = """\ MIIKdQYJKoZIhvcNAQcCoIIKZjCCCmICAQExADALBgkqhkiG9w0BBwGgggpIMIIC XjCCAcegAwIBAgIBADANBgkqhkiG9w0BAQQFADB1MQswCQYDVQQGEwJSVTEPMA0G A1UEBxMGTW9zY293MRcwFQYDVQQKEw5Tb3ZhbSBUZWxlcG9ydDEMMAoGA1UECxMD TklTMQ8wDQYDVQQDEwZBQlMgQ0ExHTAbBgkqhkiG9w0BCQEWDmNlcnRAb25saW5l LnJ1MB4XDTk5MDgxNTE5MDI1OFoXDTAwMDExMjE5MDI1OFowdTELMAkGA1UEBhMC UlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOU292YW0gVGVsZXBvcnQxDDAK BgNVBAsTA05JUzEPMA0GA1UEAxMGQUJTIENBMR0wGwYJKoZIhvcNAQkBFg5jZXJ0 QG9ubGluZS5ydTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAw0g1P0yQAZIi ml2XOCOxnCcuhHmAgj4Ei9M2ebrrGwUMONPzr1a8W7JcpnR3FeOjxEIxrzkHr6UA oj4l/oC7Rv28uIig+Okf+82ekhH6VgAQNr5LAzfN8J6dZLx2OXAmmLleAqHuisT7 I40vEFRoRmC5hiMlILE2rIlIKJn6cUkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBZ 7ELDfGUNb+fbpHl5W3d9JMXsdOgd96+HG+X1SPgeiRAMjkla8WFCSaQPIR4vCy0m tm5a2bWSji6+vP5FGbjOz5iMlHMrCtu0He7Eim2zpaGI06ZIY75Cn1h2r3+KS0/R h01TJUbmsfV1tZm6Wk3bayJ+/K8A4mBHv8P6rhYacDCCAowwggH1oAMCAQICAQAw DQYJKoZIhvcNAQEEBQAwgYsxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cx FzAVBgNVBAoTDkdvbGRlbiBUZWxlY29tMQwwCgYDVQQLEwNST0wxHjAcBgNVBAMT FUdvbGRlbiBUZWxlY29tIEFCUyBDQTEkMCIGCSqGSIb3DQEJARYVY2VydEBnb2xk ZW50ZWxlY29tLnJ1MB4XDTAwMDEwNTE1MDY1MVoXDTEwMDExNTE1MDY1MVowgYsx CzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkdvbGRlbiBU ZWxlY29tMQwwCgYDVQQLEwNST0wxHjAcBgNVBAMTFUdvbGRlbiBUZWxlY29tIEFC UyBDQTEkMCIGCSqGSIb3DQEJARYVY2VydEBnb2xkZW50ZWxlY29tLnJ1MIGfMA0G CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPFel/Svli6ogoUEb6eLtEvNSjyalETSMP MIZXdmWIkWijvEUhDnNJVAE3knAt6dVYqxWq0vc6CbAGFZNqEyioGU48IECLzV0G toiYejF/c9PuyIKDejeV9/YZnNFaZAUOXhOjREdZURLISKhX4tAbQyvK0Qka9AAR MEy9DoqV8QIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAHQzgqFkoSMQr077UCr5C0l1 rxLA17TrocCmUC1/PLmN0LmUHD0d7TjjTQKJaJBHxcKIg6+FOY6LSSY4nAN79eXi nBz+jEUG7+NTU/jcEArI35yP7fi4Mwb96EYDmUkUGtcLNq3JBe/d1Zhmy9HnNBL1 Dn9thM2Q8RPYAJIU3JnGMIICqTCCAhICAQAwDQYJKoZIhvcNAQEEBQAwgZwxCzAJ BgNVBAYTAlJVMQ8wDQYDVQQIEwZNb3Njb3cxDzANBgNVBAcTBk1vc2NvdzEXMBUG A1UEChMOR29sZGVuIFRlbGVjb20xDDAKBgNVBAsTA1JPTDEeMBwGA1UEAxMVR29s ZGVuIFRlbGVjb20gQUJTIENBMSQwIgYJKoZIhvcNAQkBFhVjZXJ0QGdvbGRlbnRl bGVjb20ucnUwHhcNMTAwMTE1MTU0MDI2WhcNMjAwMjIyMTU0MDI2WjCBnDELMAkG A1UEBhMCUlUxDzANBgNVBAgTBk1vc2NvdzEPMA0GA1UEBxMGTW9zY293MRcwFQYD VQQKEw5Hb2xkZW4gVGVsZWNvbTEMMAoGA1UECxMDUk9MMR4wHAYDVQQDExVHb2xk ZW4gVGVsZWNvbSBBQlMgQ0ExJDAiBgkqhkiG9w0BCQEWFWNlcnRAZ29sZGVudGVs ZWNvbS5ydTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzxXpf0r5YuqIKFBG +ni7RLzUo8mpRE0jDzCGV3ZliJFoo7xFIQ5zSVQBN5JwLenVWKsVqtL3OgmwBhWT ahMoqBlOPCBAi81dBraImHoxf3PT7siCg3o3lff2GZzRWmQFDl4To0RHWVESyEio V+LQG0MrytEJGvQAETBMvQ6KlfECAwEAATANBgkqhkiG9w0BAQQFAAOBgQCMrS4T LIzxcpu8nwOq/xMcxW4Ctz/wjIoePWkmSLe+Tkb4zo7aTsvzn+ETaWb7qztUpyl0 QvlXn4vC2iCJloPpofPqSzF1UV3g5Zb93ReZu7E6kEyW0ag8R5XZKv0xuR3b3Le+ ZqolT8wQELd5Mmw5JPofZ+O2cGNvet8tYwOKFjCCAqUwggIOoAMCAQICAgboMA0G CSqGSIb3DQEBBAUAMIGcMQswCQYDVQQGEwJSVTEPMA0GA1UECBMGTW9zY293MQ8w DQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkdvbGRlbiBUZWxlY29tMQwwCgYDVQQL EwNST0wxHjAcBgNVBAMTFUdvbGRlbiBUZWxlY29tIEFCUyBDQTEkMCIGCSqGSIb3 DQEJARYVY2VydEBnb2xkZW50ZWxlY29tLnJ1MB4XDTExMDEyODEyMTcwOVoXDTEy MDIwMTAwMDAwMFowdjELMAkGA1UEBhMCUlUxDDAKBgNVBAgTA04vQTEXMBUGA1UE ChMOR29sZGVuIFRlbGVjb20xDDAKBgNVBAsTA0lTUDEWMBQGA1UEAxMNY3JheS5n bGFzLm5ldDEaMBgGCSqGSIb3DQEJARYLZWxpZUByb2wucnUwgZ8wDQYJKoZIhvcN AQEBBQADgY0AMIGJAoGBAPJAm8KG3ZCoJSvoGmLMPlGaMIpadu/EGSEYu+M/ybLp Cs8XmwB3876JVKKCbtGI6eqxOqvjedYXb+nKcyhz4Ztmm8RgAD7Z1WUItIpatejT 79EYOUWrDN713SLZsImMyP4B4EySl4LZfHFRU2iOwLB6WozGCYuULLqYS9MDPrnT AgMBAAGjGzAZMBcGCWCGSAGG+EIBDQQKFghDPS07Uz0tOzANBgkqhkiG9w0BAQQF AAOBgQDEttS70qYCA+MGBA3hOR88XiBcTmuBarJDwn/rj31vRjYZUgp9bbFwscRI Ic4lDnlyvunwNitl+341bDg7u6Ebu9hCMbciyu4EtrsDh77DlLzbmNcXbnhlvbFL K9GiPz3dNyvQMfmaA0twd62zJDOVJ1SmO04lLmu/pAx8GhBZkqEAMQA= """ # canonically ordered SET components pem_text_reordered = """\ MIIKcwYJKoZIhvcNAQcCoIIKZDCCCmACAQExADALBgkqhkiG9w0BBwGgggpIMIIC XjCCAcegAwIBAgIBADANBgkqhkiG9w0BAQQFADB1MQswCQYDVQQGEwJSVTEPMA0G A1UEBxMGTW9zY293MRcwFQYDVQQKEw5Tb3ZhbSBUZWxlcG9ydDEMMAoGA1UECxMD TklTMQ8wDQYDVQQDEwZBQlMgQ0ExHTAbBgkqhkiG9w0BCQEWDmNlcnRAb25saW5l LnJ1MB4XDTk5MDgxNTE5MDI1OFoXDTAwMDExMjE5MDI1OFowdTELMAkGA1UEBhMC UlUxDzANBgNVBAcTBk1vc2NvdzEXMBUGA1UEChMOU292YW0gVGVsZXBvcnQxDDAK BgNVBAsTA05JUzEPMA0GA1UEAxMGQUJTIENBMR0wGwYJKoZIhvcNAQkBFg5jZXJ0 QG9ubGluZS5ydTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAw0g1P0yQAZIi ml2XOCOxnCcuhHmAgj4Ei9M2ebrrGwUMONPzr1a8W7JcpnR3FeOjxEIxrzkHr6UA oj4l/oC7Rv28uIig+Okf+82ekhH6VgAQNr5LAzfN8J6dZLx2OXAmmLleAqHuisT7 I40vEFRoRmC5hiMlILE2rIlIKJn6cUkCAwEAATANBgkqhkiG9w0BAQQFAAOBgQBZ 7ELDfGUNb+fbpHl5W3d9JMXsdOgd96+HG+X1SPgeiRAMjkla8WFCSaQPIR4vCy0m tm5a2bWSji6+vP5FGbjOz5iMlHMrCtu0He7Eim2zpaGI06ZIY75Cn1h2r3+KS0/R h01TJUbmsfV1tZm6Wk3bayJ+/K8A4mBHv8P6rhYacDCCAowwggH1oAMCAQICAQAw DQYJKoZIhvcNAQEEBQAwgYsxCzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cx FzAVBgNVBAoTDkdvbGRlbiBUZWxlY29tMQwwCgYDVQQLEwNST0wxHjAcBgNVBAMT FUdvbGRlbiBUZWxlY29tIEFCUyBDQTEkMCIGCSqGSIb3DQEJARYVY2VydEBnb2xk ZW50ZWxlY29tLnJ1MB4XDTAwMDEwNTE1MDY1MVoXDTEwMDExNTE1MDY1MVowgYsx CzAJBgNVBAYTAlJVMQ8wDQYDVQQHEwZNb3Njb3cxFzAVBgNVBAoTDkdvbGRlbiBU ZWxlY29tMQwwCgYDVQQLEwNST0wxHjAcBgNVBAMTFUdvbGRlbiBUZWxlY29tIEFC UyBDQTEkMCIGCSqGSIb3DQEJARYVY2VydEBnb2xkZW50ZWxlY29tLnJ1MIGfMA0G CSqGSIb3DQEBAQUAA4GNADCBiQKBgQDPFel/Svli6ogoUEb6eLtEvNSjyalETSMP MIZXdmWIkWijvEUhDnNJVAE3knAt6dVYqxWq0vc6CbAGFZNqEyioGU48IECLzV0G toiYejF/c9PuyIKDejeV9/YZnNFaZAUOXhOjREdZURLISKhX4tAbQyvK0Qka9AAR MEy9DoqV8QIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAHQzgqFkoSMQr077UCr5C0l1 rxLA17TrocCmUC1/PLmN0LmUHD0d7TjjTQKJaJBHxcKIg6+FOY6LSSY4nAN79eXi nBz+jEUG7+NTU/jcEArI35yP7fi4Mwb96EYDmUkUGtcLNq3JBe/d1Zhmy9HnNBL1 Dn9thM2Q8RPYAJIU3JnGMIICpTCCAg6gAwIBAgICBugwDQYJKoZIhvcNAQEEBQAw gZwxCzAJBgNVBAYTAlJVMQ8wDQYDVQQIEwZNb3Njb3cxDzANBgNVBAcTBk1vc2Nv dzEXMBUGA1UEChMOR29sZGVuIFRlbGVjb20xDDAKBgNVBAsTA1JPTDEeMBwGA1UE AxMVR29sZGVuIFRlbGVjb20gQUJTIENBMSQwIgYJKoZIhvcNAQkBFhVjZXJ0QGdv bGRlbnRlbGVjb20ucnUwHhcNMTEwMTI4MTIxNzA5WhcNMTIwMjAxMDAwMDAwWjB2 MQswCQYDVQQGEwJSVTEMMAoGA1UECBMDTi9BMRcwFQYDVQQKEw5Hb2xkZW4gVGVs ZWNvbTEMMAoGA1UECxMDSVNQMRYwFAYDVQQDEw1jcmF5LmdsYXMubmV0MRowGAYJ KoZIhvcNAQkBFgtlbGllQHJvbC5ydTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC gYEA8kCbwobdkKglK+gaYsw+UZowilp278QZIRi74z/JsukKzxebAHfzvolUooJu 0Yjp6rE6q+N51hdv6cpzKHPhm2abxGAAPtnVZQi0ilq16NPv0Rg5RasM3vXdItmw iYzI/gHgTJKXgtl8cVFTaI7AsHpajMYJi5QsuphL0wM+udMCAwEAAaMbMBkwFwYJ YIZIAYb4QgENBAoWCEM9LTtTPS07MA0GCSqGSIb3DQEBBAUAA4GBAMS21LvSpgID 4wYEDeE5HzxeIFxOa4FqskPCf+uPfW9GNhlSCn1tsXCxxEghziUOeXK+6fA2K2X7 fjVsODu7oRu72EIxtyLK7gS2uwOHvsOUvNuY1xdueGW9sUsr0aI/Pd03K9Ax+ZoD S3B3rbMkM5UnVKY7TiUua7+kDHwaEFmSMIICqTCCAhICAQAwDQYJKoZIhvcNAQEE BQAwgZwxCzAJBgNVBAYTAlJVMQ8wDQYDVQQIEwZNb3Njb3cxDzANBgNVBAcTBk1v c2NvdzEXMBUGA1UEChMOR29sZGVuIFRlbGVjb20xDDAKBgNVBAsTA1JPTDEeMBwG A1UEAxMVR29sZGVuIFRlbGVjb20gQUJTIENBMSQwIgYJKoZIhvcNAQkBFhVjZXJ0 QGdvbGRlbnRlbGVjb20ucnUwHhcNMTAwMTE1MTU0MDI2WhcNMjAwMjIyMTU0MDI2 WjCBnDELMAkGA1UEBhMCUlUxDzANBgNVBAgTBk1vc2NvdzEPMA0GA1UEBxMGTW9z Y293MRcwFQYDVQQKEw5Hb2xkZW4gVGVsZWNvbTEMMAoGA1UECxMDUk9MMR4wHAYD VQQDExVHb2xkZW4gVGVsZWNvbSBBQlMgQ0ExJDAiBgkqhkiG9w0BCQEWFWNlcnRA Z29sZGVudGVsZWNvbS5ydTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzxXp f0r5YuqIKFBG+ni7RLzUo8mpRE0jDzCGV3ZliJFoo7xFIQ5zSVQBN5JwLenVWKsV qtL3OgmwBhWTahMoqBlOPCBAi81dBraImHoxf3PT7siCg3o3lff2GZzRWmQFDl4T o0RHWVESyEioV+LQG0MrytEJGvQAETBMvQ6KlfECAwEAATANBgkqhkiG9w0BAQQF AAOBgQCMrS4TLIzxcpu8nwOq/xMcxW4Ctz/wjIoePWkmSLe+Tkb4zo7aTsvzn+ET aWb7qztUpyl0QvlXn4vC2iCJloPpofPqSzF1UV3g5Zb93ReZu7E6kEyW0ag8R5XZ Kv0xuR3b3Le+ZqolT8wQELd5Mmw5JPofZ+O2cGNvet8tYwOKFjEA """ def setUp(self): self.asn1Spec = rfc2315.ContentInfo() def testDerCodec(self): substrate = pem.readBase64fromText(self.pem_text_unordered) asn1Object, rest = der_decoder(substrate, asn1Spec=self.asn1Spec) self.assertFalse(rest) self.assertTrue(asn1Object.prettyPrint()) self.assertEqual(substrate, der_encoder(asn1Object)) def testDerCodecDecodeOpenTypes(self): substrate = pem.readBase64fromText(self.pem_text_reordered) asn1Object, rest = der_decoder( substrate, asn1Spec=self.asn1Spec, decodeOpenTypes=True ) self.assertFalse(rest) self.assertTrue(asn1Object.prettyPrint()) self.assertEqual(substrate, der_encoder(asn1Object, omitEmptyOptionals=False)) suite = unittest.TestLoader().loadTestsFromModule(sys.modules[__name__]) if __name__ == "__main__": result = unittest.TextTestRunner(verbosity=2).run(suite) sys.exit(not result.wasSuccessful())
52.728916
86
0.930995
347
8,753
23.40634
0.608069
0.004925
0.003694
0.004432
0.45309
0.45309
0.45309
0.442009
0.428958
0.428958
0
0.099893
0.042728
8,753
165
87
53.048485
0.869435
0.021364
0
0.408451
0
0
0.849731
0.835242
0
1
0
0
0.042254
1
0.021127
false
0
0.035211
0
0.077465
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
4
54d6fb4bf6b48704d3dda2f2ea67c6a52102bffd
100
py
Python
luolearn/utils/__init__.py
luoshao23/ML_algorithm
6e94fdd0718cd892118fd036c7c5851cf3e6d796
[ "MIT" ]
4
2017-06-19T06:33:38.000Z
2019-01-31T12:07:12.000Z
luolearn/utils/__init__.py
luoshao23/ML_algorithm
6e94fdd0718cd892118fd036c7c5851cf3e6d796
[ "MIT" ]
null
null
null
luolearn/utils/__init__.py
luoshao23/ML_algorithm
6e94fdd0718cd892118fd036c7c5851cf3e6d796
[ "MIT" ]
1
2017-12-06T08:41:06.000Z
2017-12-06T08:41:06.000Z
from .validation import (check_consistent_length, column_or_1d, check_X_y)
33.333333
49
0.64
12
100
4.833333
0.916667
0
0
0
0
0
0
0
0
0
0
0.014493
0.31
100
2
50
50
0.826087
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
07141d2f1e443d7b2921fdb4214b3fbefb4b216d
2,746
py
Python
actor-linksprite-led-bar/led-bar.py
sahuyash/raspberrypi-examples
de5f20e6c20fe4eb713f34c7226c9d0d2249afc3
[ "MIT" ]
41
2015-06-08T13:15:11.000Z
2022-01-20T21:16:32.000Z
actor-linksprite-led-bar/led-bar.py
sahuyash/raspberrypi-examples
de5f20e6c20fe4eb713f34c7226c9d0d2249afc3
[ "MIT" ]
16
2016-04-24T14:17:19.000Z
2021-07-03T12:15:17.000Z
actor-linksprite-led-bar/led-bar.py
sahuyash/raspberrypi-examples
de5f20e6c20fe4eb713f34c7226c9d0d2249afc3
[ "MIT" ]
31
2016-04-24T13:03:36.000Z
2021-12-07T17:03:25.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import RPi.GPIO as GPIO import time pd = 17 #DATA IN pc = 18 #CLK IN CmdMode = 0x0000 # Work on 8-bit mode ON = 0x00ff # 8-bit 1 data OFF = 0x0000 # 8-bit 0 data def isBitSet(x, n): return (x & n**2) != 0 def sendData(d): clk = True GPIO.output(pc,0) time.sleep(0.0005) for i in range(1,17): GPIO.output(pc,clk) GPIO.output(pd,isBitSet(d,i)) clk = not clk time.sleep(0.00001) GPIO.output(pc,0) time.sleep(0.0005) def latchData(): l = False GPIO.output(pd,0) time.sleep(0.0005) for i in range(1,9): GPIO.output(pd,l) l = not l time.sleep(0.0005) def setup(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.setup(pd, GPIO.OUT) GPIO.setup(pc, GPIO.OUT) GPIO.output(pd,0) GPIO.output(pc,0) #sendData(CmdMode) for i in range(1,13): sendData(OFF) latchData() def sendLedArray(l): #sendData(CmdMode) for i in l: if i: sendData(ON) else: sendData(OFF) latchData() def pattern_countUp(): sendLedArray([1,0,0,0,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,0,0,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,0,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,1,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,1,1,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,1,1,1,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,1,1,1,1,0,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,1,1,1,1,1,0,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,1,1,1,1,1,1,0,0,0]) time.sleep(0.1) sendLedArray([1,1,1,1,1,1,1,1,1,1,0,0]) def pattern_Kitt(): sendLedArray([1,0,0,0,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,1,0,0,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,1,0,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,1,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,1,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,1,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,0,1,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,0,0,1,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,0,0,0,1,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,0,0,0,0,1,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,0,0,0,1,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,0,0,1,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,0,1,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,0,1,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,0,1,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,0,1,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,0,1,0,0,0,0,0,0,0,0,0]) time.sleep(0.1) sendLedArray([0,1,0,0,0,0,0,0,0,0,0,0]) setup() while(True): #pattern_Kitt() pattern_countUp() print('done.')
18.065789
40
0.611071
663
2,746
2.524887
0.099548
0.260454
0.31362
0.32497
0.668459
0.627838
0.627838
0.627838
0.60454
0.60454
0
0.189836
0.132921
2,746
151
41
18.18543
0.51323
0.053897
0
0.537736
0
0
0.001933
0
0
0
0.006958
0
0
1
0.066038
false
0
0.028302
0.009434
0.103774
0.009434
0
0
0
null
1
1
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
0728caa2a53df7e66ea8d5d7ec8c33ead5f09773
55
py
Python
code/vectormomentum/Code/Python/Libraries/__init__.py
ninamiolane/quicksilver
1baf251360dadea0afa3daaa09942d9d2d7c71fb
[ "Apache-2.0" ]
126
2017-04-06T03:19:03.000Z
2022-03-08T07:44:09.000Z
code/vectormomentum/Code/Python/Libraries/__init__.py
ninamiolane/quicksilver
1baf251360dadea0afa3daaa09942d9d2d7c71fb
[ "Apache-2.0" ]
7
2017-09-22T01:46:04.000Z
2021-04-29T07:22:44.000Z
code/vectormomentum/Code/Python/Libraries/__init__.py
ninamiolane/quicksilver
1baf251360dadea0afa3daaa09942d9d2d7c71fb
[ "Apache-2.0" ]
37
2017-04-03T17:14:44.000Z
2022-03-09T16:00:03.000Z
#from CAvmHGMCommon import * #from CAvmCommon import *
18.333333
28
0.781818
6
55
7.166667
0.666667
0
0
0
0
0
0
0
0
0
0
0
0.145455
55
2
29
27.5
0.914894
0.927273
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
072f0411a62f4fb96ca8ea8a8bd5fd0fc289f592
92
py
Python
__init__.py
gprasanthkumar/ML_Pipeline_Example
be866cfe9c1981452d490c8f2fc4ddb7a4f985f4
[ "MIT" ]
2
2021-09-16T15:45:03.000Z
2022-01-13T04:12:16.000Z
__init__.py
gprasanthkumar/ML_Pipeline_Example
be866cfe9c1981452d490c8f2fc4ddb7a4f985f4
[ "MIT" ]
1
2022-03-20T12:09:05.000Z
2022-03-20T12:09:05.000Z
__init__.py
gprasanthkumar/ML_Pipeline_Example
be866cfe9c1981452d490c8f2fc4ddb7a4f985f4
[ "MIT" ]
4
2021-09-16T00:56:27.000Z
2022-01-13T04:12:36.000Z
# -*- coding: utf-8 -*- """ Created on Sat Jul 31 17:42:50 2021 @author: tan_k """
11.5
36
0.521739
15
92
3.133333
1
0
0
0
0
0
0
0
0
0
0
0.19403
0.271739
92
7
37
13.142857
0.507463
0.804348
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
0735fd4ec5b22ca3172f8f480a813c2a0d983f1f
147
py
Python
kanvas/ui/textbox.py
KevinBusuttil/kanvas
7dca503b5a3cc5e401b6cb4d21c2c792c621452e
[ "MIT" ]
null
null
null
kanvas/ui/textbox.py
KevinBusuttil/kanvas
7dca503b5a3cc5e401b6cb4d21c2c792c621452e
[ "MIT" ]
null
null
null
kanvas/ui/textbox.py
KevinBusuttil/kanvas
7dca503b5a3cc5e401b6cb4d21c2c792c621452e
[ "MIT" ]
null
null
null
from .core import Widget class Textbox(Widget): def __init__(self) -> None: super().__init__() self.label = '' pass
21
33
0.564626
16
147
4.6875
0.8125
0.213333
0
0
0
0
0
0
0
0
0
0
0.312925
147
7
34
21
0.742574
0
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0.166667
0.166667
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
074dec8cda101534b966e22b3203ff9b306a327a
456
py
Python
ex8.py
FelipeRossoni/infosatc-lp-avaliativo-02
e73b8af363f334b21155917a317c6ccc8b6a73e7
[ "MIT" ]
null
null
null
ex8.py
FelipeRossoni/infosatc-lp-avaliativo-02
e73b8af363f334b21155917a317c6ccc8b6a73e7
[ "MIT" ]
null
null
null
ex8.py
FelipeRossoni/infosatc-lp-avaliativo-02
e73b8af363f334b21155917a317c6ccc8b6a73e7
[ "MIT" ]
null
null
null
lista = ['Intel Core i9-9900KF.','Gigabyte B360M-Gaming 3','32GB DDR4 GDDR6','GeForce RTX 2080Ti','1TB de HD + 480GB de SSD','80PLUS 600W','Noctua NH-D15'] print('lista de todas as suas compras :', (lista)) print('Notamos que o preço da compra ultrapassou o orçamento limite definido pelo cliente, por isso, tomamos a liberdade de retirar a placa de vídeo e o cooler master da sua lista de compras.') del lista[3] del lista[5] print('Nova lista :',(lista))
76
193
0.734649
78
456
4.294872
0.730769
0.041791
0
0
0
0
0
0
0
0
0
0.076923
0.144737
456
6
194
76
0.782051
0
0
0
0
0.166667
0.772429
0
0
0
0
0
0
1
0
false
0.166667
0
0
0
0.5
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
1
0
0
0
1
0
4
0765ed45561a487fb4dae3f48a3783f6acab20cf
4,802
py
Python
snippets/EM/scratch01.py
michielkleinnijenhuis/EM
f46a9b11298919b359e80d9f23a7e824df1356cb
[ "Apache-2.0" ]
null
null
null
snippets/EM/scratch01.py
michielkleinnijenhuis/EM
f46a9b11298919b359e80d9f23a7e824df1356cb
[ "Apache-2.0" ]
null
null
null
snippets/EM/scratch01.py
michielkleinnijenhuis/EM
f46a9b11298919b359e80d9f23a7e824df1356cb
[ "Apache-2.0" ]
null
null
null
export PATH=/data/ndcn-fmrib-water-brain/ndcn0180/anaconda2/bin:$PATH export CONDA_PATH="$(conda info --root)" scriptdir="${HOME}/workspace/EM" source activate root f=m000_maskMM f=m000_03000-04000_03000-04000_00030-00460 h5repack -v -f GZIP=4 $f.h5 ${f}_gzip.h5 & cd ~/Library/Application\ Support/Blender/2.78/scripts/addons/ '/Users/michielk/workspace/blender-build/build_darwin/bin/blender.app/Contents/Resources/2.78/scripts/addons/mesh_extra_tools/__init__.py' blender -b -P /home/ndcn-fmrib-water-brain/ndcn0180/workspace/EM/mesh/stl2blender.py -- /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1 _labelUA_final_d0.02collapse_s100-0.1_1 -L _labelUA_final -S /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1/_labelUA_final.03919.01.stl /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1/_labelUA_final.03920.01.stl /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1/_labelUA_final.03922.01.stl /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1/_labelUA_final.03923.01.stl /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1/_labelUA_final.03924.01.stl /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1/_labelUA_final.03925.01.stl /data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1/_labelUA_final.03926.01.stl -s 100 0.1 True True True -d 0.02 -e 0 host="ndcn0180@arcus-b.arc.ox.ac.uk" remdir="/data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1" localdir="/Users/michielk/oxdata/P01/EM/M3/M3_S1_GNU/M3S1GNU/ds7_arc/M3S1GNUds7/dmcsurf_1-1-1" rsync -avz "$host:$remdir/_labelUA_final.33???.01.stl" $localdir host="ndcn0180@arcus-b.arc.ox.ac.uk" remdir="/data/ndcn-fmrib-water-brain/ndcn0180/EM/M3/M3_S1_GNU_old" localdir="/Users/michielk/oxdata/P01/EM/M3/M3_S1_GNU/M3S1GNU/ds7_arc/pred_new" f="M3S1GNU_*_prediction_NPminimal_ws_l0.99_u1.00_s010_PA_str2_iter5_parallelh5_thr0.5_alg1_amaxX.npy" f="M3S1GNU_00000-01050_*-*_00030-00460_prediction_NPminimal_ws_l0.99_u1.00_s010_PA_str2_iter5_parallelh5_thr0.5_alg1.h5" rsync -avz "$host:$remdir/${f}" $localdir ## export PATH=/data/ndcn-fmrib-water-brain/ndcn0180/anaconda2/bin:$PATH export CONDA_PATH="$(conda info --root)" scriptdir="${HOME}/workspace/EM" datadir="${DATA}/EM/M3/M3_S1_GNU_old" && cd $datadir source datastems_90blocks.sh dspf='ds'; ds=7; export template='single' additions='conda' CONDA_ENV="scikit-image-devel_0.13" export njobs=1 nodes=1 tasks=1 memcpu=60GB wtime="10:00:00" q="" pf='_prediction_NPminimal_ws_l0.99_u1.00_s010_PA_str2_iter5_parallelh5_thr0.5_alg1' export jobname="merge${pf}_amax" export cmd="python $scriptdir/convert/EM_mergeblocks.py \ $datadir ${datastems[*]} \ -i ${pf} 'stack' -o "${pf}_amaxY" 'stack' \ -b $zo $yo $xo -p $zs $ys $xs -q $zm $ym $xm -s $zmax $ymax $xmax \ -l -n -r -F -B 1 ${ds} ${ds} -f 'np.amax'" source $scriptdir/pipelines/template_job_$template.sh import os import h5py import numpy as np from skimage.measure import regionprops, label datadir = "/Users/michielk/oxdata/P01/EM/M3/M3_S1_GNU/M3S1GNU/ds7_arc/pred_new" dset_name = 'M3S1GNU' labelvolume = ['_prediction_NPminimal_ws_l0.99_u1.00_s010_PA_str2_iter5_parallelh5_thr0.5_alg1_amaxX', 'stack'] f = h5py.File(os.path.join(datadir, dset_name + labelvolume[0] + '.h5'), 'r') MM = f[labelvolume[1]][:, :, :] f.close() ## label2stl datadir="/Users/michielk/oxdata/P01/EM/M3/M3_S1_GNU/M3S1GNU/ds7_arc/pred_new" datastem='M3S1GNUds7' python $scriptdir/mesh/label2stl.py $datadir $datastem \ -L '_labelUA' -f 'stack' -o 30 0 0 export PATH=/data/ndcn-fmrib-water-brain/ndcn0180/anaconda2/bin:$PATH export CONDA_PATH="$(conda info --root)" scriptdir="${HOME}/workspace/EM" datadir="${DATA}/EM/M3/M3_S1_GNU_old" && cd $datadir datastem='M3S1GNUds7' export template='single' additions='' CONDA_ENV='' export njobs=1 nodes=1 tasks=1 memcpu=50000 wtime="100:00:00" q="" export jobname="label2stl" export cmd="python $scriptdir/mesh/label2stl.py $datadir/ds7_arc $datastem \ -L '_labelUA_final' -f 'stack' -o 30 0 0" source $scriptdir/pipelines/template_job_$template.sh ### merge probs export template='single' additions='conda' CONDA_ENV="scikit-image-devel_0.13" export njobs=1 nodes=1 tasks=1 memcpu=60GB wtime="10:00:00" q="" pf='_probs' export jobname="merge${pf}" export cmd="python $scriptdir/convert/EM_mergeblocks.py \ $datadir ${datastems[*]} \ -i ${pf} 'volume/predictions' -o ${pf}_merged 'volume/predictions' \ -b $zo $yo $xo -p $zs $ys $xs -q $zm $ym $xm -s $zmax $ymax $xmax -m" source $scriptdir/pipelines/template_job_$template.sh
44.462963
1,112
0.770304
838
4,802
4.192124
0.236277
0.011956
0.027327
0.036436
0.719044
0.701679
0.674352
0.630231
0.621691
0.621691
0
0.107095
0.066639
4,802
107
1,113
44.878505
0.676707
0.004373
0
0.4
0
0.1
0.315525
0.239053
0
0
0
0
0
0
null
null
0
0.057143
null
null
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
4
4ae9feef306f3e9d441dfd3787b4eb1099481695
65
py
Python
2475.py
FelisCatusKR/Baekjoon_Python3
d84dc9421fe956001864d138b6d6ec9ebd793edf
[ "MIT" ]
null
null
null
2475.py
FelisCatusKR/Baekjoon_Python3
d84dc9421fe956001864d138b6d6ec9ebd793edf
[ "MIT" ]
null
null
null
2475.py
FelisCatusKR/Baekjoon_Python3
d84dc9421fe956001864d138b6d6ec9ebd793edf
[ "MIT" ]
null
null
null
# 2475.py print(sum([x*x for x in map(int,input().split())])%10)
32.5
54
0.615385
15
65
2.733333
0.866667
0
0
0
0
0
0
0
0
0
0
0.101695
0.092308
65
2
54
32.5
0.576271
0.107692
0
0
0
0
0
0
0
0
0
0
0
0
null
null
0
0
null
null
1
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
4
ab0754d608cfcdbbb26e2d9ac7fb7548ba256335
4,018
py
Python
tests/unit/similarities/edit_sim/test_esim.py
suamin/nemex
05d93c788bf1493a1f6da01e9eee03120da0f7d4
[ "MIT" ]
2
2021-03-24T12:12:55.000Z
2021-05-02T11:48:47.000Z
tests/unit/similarities/edit_sim/test_esim.py
suamin/nemex
05d93c788bf1493a1f6da01e9eee03120da0f7d4
[ "MIT" ]
null
null
null
tests/unit/similarities/edit_sim/test_esim.py
suamin/nemex
05d93c788bf1493a1f6da01e9eee03120da0f7d4
[ "MIT" ]
1
2021-05-16T17:44:08.000Z
2021-05-16T17:44:08.000Z
import unittest from nemex.similarities import EditSimilarity class TestEditSimilarity(unittest.TestCase): def setUp(self) -> None: self.sim = EditSimilarity() return None def test_OST(self): self.assertEqual(-2, self.sim.find_tau_min_overlap(1, 1, 0.2, 2)) self.assertEqual(0, self.sim.find_tau_min_overlap(1, 1, 0.7, 2)) self.assertEqual(-7, self.sim.find_tau_min_overlap(2, 2, 0.2, 3)) self.assertEqual(-1, self.sim.find_tau_min_overlap(2, 2, 0.7, 3)) self.assertEqual(-16, self.sim.find_tau_min_overlap(3, 3, 0.2, 4)) self.assertEqual(-4, self.sim.find_tau_min_overlap(3, 3, 0.7, 4)) self.assertEqual(-28, self.sim.find_tau_min_overlap(4, 4, 0.2, 5)) self.assertEqual(-8, self.sim.find_tau_min_overlap(4, 4, 0.7, 5)) self.assertEqual(-43, self.sim.find_tau_min_overlap(5, 5, 0.2, 6)) self.assertEqual(-13, self.sim.find_tau_min_overlap(5, 5, 0.7, 6)) return def test_LTS(self): self.assertEqual(0, self.sim.find_min_size(1, 0.2, 2)) self.assertEqual(1, self.sim.find_min_size(1, 0.7, 2)) self.assertEqual(-1, self.sim.find_min_size(2, 0.2, 3)) self.assertEqual(1, self.sim.find_min_size(2, 0.7, 3)) self.assertEqual(-1, self.sim.find_min_size(3, 0.2, 4)) self.assertEqual(2, self.sim.find_min_size(3, 0.7, 4)) self.assertEqual(-2, self.sim.find_min_size(4, 0.2, 5)) self.assertEqual(2, self.sim.find_min_size(4, 0.7, 5)) self.assertEqual(-3, self.sim.find_min_size(5, 0.2, 6)) self.assertEqual(2, self.sim.find_min_size(5, 0.7, 6)) return def test_UTS(self): self.assertEqual(9, self.sim.find_max_size(1, 0.2, 2)) self.assertEqual(1, self.sim.find_max_size(1, 0.7, 2)) self.assertEqual(18, self.sim.find_max_size(2, 0.2, 3)) self.assertEqual(3, self.sim.find_max_size(2, 0.7, 3)) self.assertEqual(27, self.sim.find_max_size(3, 0.2, 4)) self.assertEqual(5, self.sim.find_max_size(3, 0.7, 4)) self.assertEqual(36, self.sim.find_max_size(4, 0.2, 5)) self.assertEqual(7, self.sim.find_max_size(4, 0.7, 5)) self.assertEqual(45, self.sim.find_max_size(5, 0.2, 6)) self.assertEqual(9, self.sim.find_max_size(5, 0.7, 6)) return def test_LOST(self): self.assertEqual(-15, self.sim.find_lower_bound_of_entity(1, 0.2, 2)) self.assertEqual(0, self.sim.find_lower_bound_of_entity(1, 0.7, 2)) self.assertEqual(-46, self.sim.find_lower_bound_of_entity(2, 0.2, 3)) self.assertEqual(-3, self.sim.find_lower_bound_of_entity(2, 0.7, 3)) self.assertEqual(-93, self.sim.find_lower_bound_of_entity(3, 0.2, 4)) self.assertEqual(-7, self.sim.find_lower_bound_of_entity(3, 0.7, 4)) self.assertEqual(-156, self.sim.find_lower_bound_of_entity(4, 0.2, 5)) self.assertEqual(-13, self.sim.find_lower_bound_of_entity(4, 0.7, 5)) self.assertEqual(-235, self.sim.find_lower_bound_of_entity(5, 0.2, 6)) self.assertEqual(-20, self.sim.find_lower_bound_of_entity(5, 0.7, 6)) return def test_TNB(self): self.assertEqual(16, self.sim.tighter_neighbor_bound(1, 0.2, 2)) self.assertEqual(1, self.sim.tighter_neighbor_bound(1, 0.7, 2)) self.assertEqual(48, self.sim.tighter_neighbor_bound(2, 0.2, 3)) self.assertEqual(5, self.sim.tighter_neighbor_bound(2, 0.7, 3)) self.assertEqual(96, self.sim.tighter_neighbor_bound(3, 0.2, 4)) self.assertEqual(10, self.sim.tighter_neighbor_bound(3, 0.7, 4)) self.assertEqual(160, self.sim.tighter_neighbor_bound(4, 0.2, 5)) self.assertEqual(17, self.sim.tighter_neighbor_bound(4, 0.7, 5)) self.assertEqual(240, self.sim.tighter_neighbor_bound(5, 0.2, 6)) self.assertEqual(25, self.sim.tighter_neighbor_bound(5, 0.7, 6)) return def tearDown(self) -> None: return None if __name__ == '__main__': unittest.main()
48.409639
78
0.655301
696
4,018
3.577586
0.099138
0.143373
0.176707
0.056225
0.883133
0.874699
0.704016
0.456627
0.403614
0.148996
0
0.088118
0.189398
4,018
82
79
49
0.676389
0
0
0.1
0
0
0.001991
0
0
0
0
0
0.714286
1
0.1
false
0
0.028571
0.014286
0.242857
0
0
0
0
null
0
0
0
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
ab0a0b39faa5b8dee16b21f94738fba0320e239c
96
py
Python
assignment/sets/max_min_set.py
arc-arnob/256131
645437d7607f186967e0f84c80e6ca976f266622
[ "Apache-2.0" ]
null
null
null
assignment/sets/max_min_set.py
arc-arnob/256131
645437d7607f186967e0f84c80e6ca976f266622
[ "Apache-2.0" ]
1
2021-04-17T02:47:03.000Z
2021-04-17T02:47:03.000Z
assignment/sets/max_min_set.py
arc-arnob/256131
645437d7607f186967e0f84c80e6ca976f266622
[ "Apache-2.0" ]
null
null
null
s = set(map(int, input().split())) print(s) print("max is: ",max(s)) print("min is: ",min(s))
13.714286
34
0.5625
18
96
3
0.555556
0.222222
0
0
0
0
0
0
0
0
0
0
0.135417
96
6
35
16
0.650602
0
0
0
0
0
0.168421
0
0
0
0
0
0
1
0
false
0
0
0
0
0.75
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
ab36310e71aab5b7fae4dae1f2ab0fda8f0edcf3
98
py
Python
Python/Aula10/ExerciciosPython/ExerciciosElif/ComparandoNumeros.py
ekballo/Back-End
b252e3b2a16ce36486344823f14afa6691fde9bc
[ "MIT" ]
null
null
null
Python/Aula10/ExerciciosPython/ExerciciosElif/ComparandoNumeros.py
ekballo/Back-End
b252e3b2a16ce36486344823f14afa6691fde9bc
[ "MIT" ]
null
null
null
Python/Aula10/ExerciciosPython/ExerciciosElif/ComparandoNumeros.py
ekballo/Back-End
b252e3b2a16ce36486344823f14afa6691fde9bc
[ "MIT" ]
null
null
null
#Escreva um programa que leia dois números inteiros e compare-os. mostrando na tela uma mensagem:
49
97
0.806122
16
98
4.9375
1
0
0
0
0
0
0
0
0
0
0
0
0.153061
98
1
98
98
0.951807
0.979592
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
ab4c4b0b65f457b9b623585432e45a36adcb8951
24
py
Python
fastai2/__init__.py
krishnakalyan3/fastai2
68f23a66d587011fee625ef1c01e2d104e3f24ce
[ "Apache-2.0" ]
null
null
null
fastai2/__init__.py
krishnakalyan3/fastai2
68f23a66d587011fee625ef1c01e2d104e3f24ce
[ "Apache-2.0" ]
null
null
null
fastai2/__init__.py
krishnakalyan3/fastai2
68f23a66d587011fee625ef1c01e2d104e3f24ce
[ "Apache-2.0" ]
null
null
null
__version__ = "0.0.25"
8
22
0.625
4
24
2.75
0.75
0
0
0
0
0
0
0
0
0
0
0.2
0.166667
24
2
23
12
0.35
0
0
0
0
0
0.26087
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
ab613a58460daf70669d93d0d3ba053a77af6790
22,583
py
Python
bromelia/messages.py
post-cyberlabs/bromelia
a21c6af591fa3ebe5335f2f34b13b60f03a48b55
[ "MIT" ]
25
2021-04-03T20:26:57.000Z
2022-02-08T15:02:17.000Z
bromelia/messages.py
post-cyberlabs/bromelia
a21c6af591fa3ebe5335f2f34b13b60f03a48b55
[ "MIT" ]
8
2022-01-23T10:55:43.000Z
2022-03-01T14:03:01.000Z
bromelia/messages.py
post-cyberlabs/bromelia
a21c6af591fa3ebe5335f2f34b13b60f03a48b55
[ "MIT" ]
3
2021-09-16T11:23:25.000Z
2022-01-23T10:49:26.000Z
# -*- coding: utf-8 -*- """ bromelia.messages ~~~~~~~~~~~~~~~~~ This module contains the Diameter protocol base messages. :copyright: (c) 2020-present Henrique Marques Ribeiro. :license: MIT, see LICENSE for more details. """ import platform import socket from .avps import * from .base import DiameterAnswer, DiameterRequest from .constants import * from .exceptions import DiameterMessageError class CapabilitiesExchangeRequest(DiameterRequest): """Implementation of Capabilities-Exchange-Request (CER) in Section 5.3.1 of IETF RFC 6733. The Capabilities-Exchange-Request is indicated by the Command Code 257 and the Command Flags' 'R' bit set. Usage:: >>> from bromelia.messages import CapabilitiesExchangeRequest as CER >>> >>> cer = CER() <Diameter Message: 257 [CER], REQ Default, 6 AVP(s)> """ mandatory = { "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, "host_ip_address": HostIpAddressAVP, "vendor_id": VendorIdAVP, "product_name": ProductNameAVP } optionals = { "origin_state_id": OriginStateIdAVP, "supported_vendor_id": SupportedVendorIdAVP, "auth_application_id": AuthApplicationIdAVP, "inband_security_id": InbandSecurityIdAVP, "acct_application_id": AcctApplicationIdAVP, "vendor_specific_application_id": VendorSpecificApplicationIdAVP, "firmware_revision": FirmwareRevisionAVP } def __init__(self, origin_host=platform.node(), origin_realm=socket.getfqdn(), host_ip_address=socket.gethostbyname(platform.node()), vendor_id=VENDOR_ID_DEFAULT, product_name=PRODUCT_NAME, origin_state_id=None, supported_vendor_id=None, auth_application_id=None, inband_security_id=None, acct_application_id=None, vendor_specific_application_id=None, firmware_revision=FIRMWARE_VERSION, **kwargs): DiameterRequest.__init__(self, command_code=CAPABILITIES_EXCHANGE_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterRequest._load(self, locals()) class CapabilitiesExchangeAnswer(DiameterAnswer): """Implementation of Capabilities-Exchange-Answer (CEA) in Section 5.3.2 of IETF RFC 6733. The Capabilities-Exchange-Answer is indicated by the Command Code 257 and the Command Flags' 'R' bit cleared. Usage:: >>> from bromelia.messages import CapabilitiesExchangeAnswer as CEA >>> >>> cea = CEA() <Diameter Message: 257 [CEA], Default, 6 AVP(s)> """ mandatory = { "result_code": ResultCodeAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, "host_ip_address": HostIpAddressAVP, "vendor_id": VendorIdAVP, "product_name": ProductNameAVP } optionals = { "origin_state_id": OriginStateIdAVP, "error_message": ErrorMessageAVP, "failed_avp": FailedAvpAVP, "supported_vendor_id": SupportedVendorIdAVP, "auth_application_id": AuthApplicationIdAVP, "inband_security_id": InbandSecurityIdAVP, "acct_application_id": AcctApplicationIdAVP, "vendor_specific_application_id": VendorSpecificApplicationIdAVP, "firmware_revision": FirmwareRevisionAVP } def __init__(self, result_code=DIAMETER_SUCCESS, origin_host=platform.node(), origin_realm=socket.getfqdn(), host_ip_address=socket.gethostbyname(platform.node()), vendor_id=0, product_name=PRODUCT_NAME, origin_state_id=None, error_message=None, failed_avp=None, supported_vendor_id=None, auth_application_id=DIAMETER_APPLICATION_DEFAULT, inband_security_id=None, acct_application_id=None, vendor_specific_application_id=None, firmware_revision=None, **kwargs): DiameterAnswer.__init__(self, command_code=CAPABILITIES_EXCHANGE_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterAnswer._load(self, locals()) class ReAuthRequest(DiameterRequest): """Implementation of Re-Auth-Request (RAR) in Section 8.3.1 of IETF RFC 6733. The Re-Auth-Request is indicated by the Command Code 258 and the Command Flags' 'R' bit set. Usage:: >>> from bromelia.messages import ReAuthRequest as RAR >>> from bromelia import DIAMETER_APPLICATION_Gx >>> from bromelia import AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY >>> >>> rar_avps = { ... "auth_application_id": DIAMETER_APPLICATION_Gx, ... "destination_realm": "example.com", ... "destination_host": "host.example.com", ... "re_auth_request_type": AUTH_REQUEST_TYPE_AUTHENTICATE_ONLY ... } >>> rar = RAR(**rar_avps) <Diameter Message: 258 [RAR] REQ, PXY 3GPP Gx, 7 AVP(s)> """ mandatory = { "session_id": SessionIdAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, "destination_realm": DestinationRealmAVP, "destination_host": DestinationHostAVP, "auth_application_id": AuthApplicationIdAVP, "re_auth_request_type": ReAuthRequestTypeAVP } optionals = { "user_name": UserNameAVP, "origin_state_id": OriginStateIdAVP, "proxy_info": ProxyInfoAVP, "route_record": RouteRecordAVP } def __init__(self, session_id=platform.node(), origin_host=platform.node(), origin_realm=socket.getfqdn(), destination_realm=socket.gethostbyname(platform.node()), destination_host=None, auth_application_id=None, re_auth_request_type=None, user_name=None, origin_state_id=None, proxy_info=None, route_record=None, **kwargs): if not auth_application_id: raise DiameterMessageError("invalid auth_application_id value. "\ "It needs to include a valid Auth "\ "Application Id") DiameterRequest.__init__(self, command_code=RE_AUTH_MESSAGE, application_id=auth_application_id) DiameterRequest._load(self, locals()) class ReAuthAnswer(DiameterAnswer): """Implementation of Re-Auth-Answer (RAA) in Section 8.3.2 of IETF RFC 6733. The Re-Auth-Answer is indicated by the Command Code 258 and the Command Flags' 'R' bit cleared. Usage:: >>> from bromelia.messages import ReAuthAnswer as RAA >>> from bromelia import DIAMETER_APPLICATION_Rx >>> >>> raa = RAA() >>> raa.header.application_id = DIAMETER_APPLICATION_Rx <Diameter Message: 258 [RAA] PXY 3GPP Rx, 4 AVP(s)> """ mandatory = { "session_id": SessionIdAVP, "result_code": ResultCodeAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, } optionals = { "user_name": UserNameAVP, "origin_state_id": OriginStateIdAVP, "error_message": ErrorMessageAVP, "error_reporting_host": ErrorReportingHostAVP, "failed_avp": FailedAvpAVP, "redirect_host": RedirectHostAVP, "redirect_host_usage": RedirectHostUsageAVP, "redirect_max_cache_time": RedirectMaxCacheTimeAVP, "proxy_info": ProxyInfoAVP } def __init__(self, session_id=platform.node(), result_code=DIAMETER_SUCCESS, origin_host=platform.node(), origin_realm=socket.getfqdn(), user_name=None, origin_state_id=None, error_message=None, error_reporting_host=None, failed_avp=None, redirect_host=None, redirect_host_usage=None, redirect_max_cache_time=None, proxy_info=None, **kwargs): DiameterAnswer.__init__(self, command_code=RE_AUTH_MESSAGE, application_id=None) DiameterAnswer._load(self, locals()) class AbortSessionRequest(DiameterRequest): """Implementation of Abort-Session-Request (ASR) in Section 8.5.1 of IETF RFC 6733. The Abort-Session-Request is indicated by the Command Code 274 and the Command Flags' 'R' bit set. Usage:: >>> from bromelia.messages import AbortSessionRequest as ASR >>> from bromelia import DIAMETER_APPLICATION_Rx >>> >>> asr_avps = { ... "auth_application_id": DIAMETER_APPLICATION_Rx, ... "destination_realm": "example.com", ... "destination_host": "host.example.com" ... } >>> asr = ASR(**asr_avps) <Diameter Message: 274 [ASR] REQ, PXY 3GPP Rx, 6 AVP(s)> """ mandatory = { "session_id": SessionIdAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, "destination_realm": DestinationRealmAVP, "destination_host": DestinationHostAVP, "auth_application_id": AuthApplicationIdAVP } optionals = { "user_name": UserNameAVP, "origin_state_id": OriginStateIdAVP, "proxy_info": ProxyInfoAVP, "route_record": RouteRecordAVP } def __init__(self, session_id=platform.node(), origin_host=platform.node(), origin_realm=socket.getfqdn(), destination_realm=socket.gethostbyname(platform.node()), destination_host=None, auth_application_id=None, user_name=None, origin_state_id=None, proxy_info=None, route_record=None, **kwargs): if not auth_application_id: raise DiameterMessageError("invalid auth_application_id value. "\ "It needs to include a valid Auth "\ "Application Id") DiameterRequest.__init__(self, command_code=ABORT_SESSION_MESSAGE, application_id=auth_application_id) DiameterRequest._load(self, locals()) class AbortSessionAnswer(DiameterAnswer): """Implementation of Abort-Session-Answer (ASA) in Section 8.5.2 of IETF RFC 6733. The Abort-Session-Answer is indicated by the Command Code 274 and the Command Flags' 'R' bit cleared. Usage:: >>> from bromelia.messages import AbortSessionAnswer as ASA >>> from bromelia import DIAMETER_APPLICATION_Rx >>> >>> asa = ASA() >>> asa.header.application_id = DIAMETER_APPLICATION_Rx <Diameter Message: 274 [ASA] PXY 3GPP Rx, 4 AVP(s)> """ mandatory = { "session_id": SessionIdAVP, "result_code": ResultCodeAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, } optionals = { "user_name": UserNameAVP, "origin_state_id": OriginStateIdAVP, "error_message": ErrorMessageAVP, "error_reporting_host": ErrorReportingHostAVP, "failed_avp": FailedAvpAVP, "redirect_host": RedirectHostAVP, "redirect_host_usage": RedirectHostUsageAVP, "redirect_max_cache_time": RedirectMaxCacheTimeAVP, "proxy_info": ProxyInfoAVP } def __init__(self, session_id=platform.node(), result_code=DIAMETER_SUCCESS, origin_host=platform.node(), origin_realm=socket.getfqdn(), user_name=None, origin_state_id=None, error_message=None, error_reporting_host=None, failed_avp=None, redirect_host=None, redirect_host_usage=None, redirect_max_cache_time=None, proxy_info=None, **kwargs): DiameterAnswer.__init__(self, command_code=ABORT_SESSION_MESSAGE, application_id=None) DiameterAnswer._load(self, locals()) class SessionTerminationRequest(DiameterRequest): """Implementation of Session-Termination-Request (STR) in Section 8.4.1 of IETF RFC 6733. The Session-Termination-Request is indicated by the Command Code 275 and the Command Flags' 'R' bit set. Usage:: >>> from bromelia.messages import SessionTerminationRequest as STR >>> >>> _str = STR() <Diameter Message: 275 [STR], REQ Default, 6 AVP(s)> """ mandatory = { "session_id": SessionIdAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, "destination_realm": DestinationRealmAVP, "auth_application_id": AuthApplicationIdAVP, "termination_cause": TerminationCauseAVP, } optionals = { "user_name": UserNameAVP, "destination_host": DestinationHostAVP, "_class": ClassAVP, "origin_state_id": OriginStateIdAVP, "proxy_info": ProxyInfoAVP, "route_record": RouteRecordAVP } def __init__(self, session_id=platform.node(), origin_host=platform.node(), origin_realm=socket.getfqdn(), destination_realm=socket.gethostbyname(platform.node()), auth_application_id=DIAMETER_APPLICATION_DEFAULT, termination_cause=DIAMETER_LOGOUT, user_name=None, destination_host=None, _class=None, origin_state_id=None, proxy_info=None, route_record=None, **kwargs): DiameterRequest.__init__(self, command_code=SESSION_TERMINATION_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterRequest._load(self, locals()) class SessionTerminationAnswer(DiameterAnswer): """Implementation of Session-Termination-Answer (STA) in Section 8.4.2 of IETF RFC 6733. The Session-Termination-Answer is indicated by the Command Code 275 and the Command Flags' 'R' bit cleared. Usage:: >>> from bromelia.messages import SessionTerminationAnswer as STA >>> >>> sta = STA() <Diameter Message: 275 [STA], Default, 4 AVP(s)> """ mandatory = { "session_id": SessionIdAVP, "result_code": ResultCodeAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, } optionals = { "user_name": UserNameAVP, "_class": ClassAVP, "error_message": ErrorMessageAVP, "error_reporting_host": ErrorReportingHostAVP, "failed_avp": FailedAvpAVP, "origin_state_id": OriginStateIdAVP, "redirect_host": RedirectHostAVP, "redirect_host_usage": RedirectHostUsageAVP, "redirect_max_cache_time": RedirectMaxCacheTimeAVP, "proxy_info": ProxyInfoAVP } def __init__(self, session_id=platform.node(), result_code=DIAMETER_SUCCESS, origin_host=platform.node(), origin_realm=socket.getfqdn(), user_name=None, _class=None, error_message=None, error_reporting_host=None, failed_avp=None, origin_state_id=None, redirect_host=None, redirect_host_usage=None, redirect_max_cache_time=None, proxy_info=None, **kwargs): DiameterAnswer.__init__(self, command_code=SESSION_TERMINATION_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterAnswer._load(self, locals()) class DeviceWatchdogRequest(DiameterRequest): """Implementation of Device-Watchdog-Request (DWR) in Section 5.5.1 of IETF RFC 6733. The Device-Watchdog-Request is indicated by the Command Code 280 and the Command Flags' 'R' bit set. Usage:: >>> from bromelia.messages import DeviceWatchdogRequest as DWR >>> >>> dwr = DWR() <Diameter Message: 280 [DWR], REQ Default, 2 AVP(s)> """ mandatory = { "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, } optionals = { "origin_state_id": OriginStateIdAVP } def __init__(self, origin_host=platform.node(), origin_realm=socket.getfqdn(), origin_state_id=None, **kwargs): DiameterRequest.__init__(self, command_code=DEVICE_WATCHDOG_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterRequest._load(self, locals()) class DeviceWatchdogAnswer(DiameterAnswer): """Implementation of Device-Watchdog-Answer (DWA) in Section 5.5.2 of IETF RFC 6733. The Device-Watchdog-Answer is indicated by the Command Code 280 and the Command Flags' 'R' bit cleared. Usage:: >>> from bromelia.messages import DeviceWatchdogAnswer as DWA >>> >>> dwa = DWA() <Diameter Message: 280 [DWA], Default, 3 AVP(s)> """ mandatory = { "result_code": ResultCodeAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP } optionals = { "error_message": ErrorMessageAVP, "failed_avp": FailedAvpAVP, "origin_state_id": OriginStateIdAVP } def __init__(self, result_code=DIAMETER_SUCCESS, origin_host=platform.node(), origin_realm=socket.getfqdn(), error_message=None, failed_avp=None, origin_state_id=None, **kwargs): DiameterAnswer.__init__(self, command_code=DEVICE_WATCHDOG_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterAnswer._load(self, locals()) class DisconnectPeerRequest(DiameterRequest): """Implementation of Disconnect-Peer-Request (DPR) in Section 5.4.1 of IETF RFC 6733. The Disconnect-Peer-Request is indicated by the Command Code 282 and the Command Flags' 'R' bit set. Usage:: >>> from bromelia.messages import DisconnectPeerRequest as DPR >>> >>> dpr = DPR() <Diameter Message: 282 [DPR], REQ Default, 3 AVP(s)> """ mandatory = { "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, "disconnect_cause": DisconnectCauseAVP, } optionals = {} def __init__(self, origin_host=platform.node(), origin_realm=socket.getfqdn(), disconnect_cause=DISCONNECT_CAUSE_REBOOTING, **kwargs): DiameterRequest.__init__(self, command_code=DISCONNECT_PEER_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterRequest._load(self, locals()) class DisconnectPeerAnswer(DiameterAnswer): """Implementation of Disconnect-Peer-Answer (DPA) in Section 5.4.2 of IETF RFC 6733. The Disconnect-Peer-Answer is indicated by the Command Code 282 and the Command Flags' 'R' bit cleared. Usage:: >>> from bromelia.messages import DisconnectPeerAnswer as DPA >>> >>> dpa = DPA() <Diameter Message: 282 [DPA], Default, 3 AVP(s)> """ mandatory = { "result_code": ResultCodeAVP, "origin_host": OriginHostAVP, "origin_realm": OriginRealmAVP, } optionals = { "error_message": ErrorMessageAVP, "failed_avp": FailedAvpAVP } def __init__(self, result_code=DIAMETER_SUCCESS, origin_host=platform.node(), origin_realm=socket.getfqdn(), error_message=None, failed_avp=None, **kwargs): DiameterAnswer.__init__(self, command_code=DISCONNECT_PEER_MESSAGE, application_id=DIAMETER_APPLICATION_DEFAULT) DiameterAnswer._load(self, locals())
35.396552
85
0.556259
1,958
22,583
6.129724
0.107763
0.045492
0.021663
0.037327
0.798867
0.792868
0.75729
0.69855
0.673721
0.64081
0
0.012359
0.362219
22,583
638
86
35.396552
0.82094
0.233273
0
0.854881
0
0
0.105673
0.007719
0
0
0
0
0
1
0.031662
false
0
0.015831
0
0.14248
0
0
0
0
null
0
0
0
0
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
db4d967f97727f747037a4e8a241667be46b1839
328
py
Python
Object Oriented Programming/Object Oriented Programming dossier/enterprise.py
severinhaller/einf-machinelearning
4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b
[ "MIT" ]
null
null
null
Object Oriented Programming/Object Oriented Programming dossier/enterprise.py
severinhaller/einf-machinelearning
4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b
[ "MIT" ]
null
null
null
Object Oriented Programming/Object Oriented Programming dossier/enterprise.py
severinhaller/einf-machinelearning
4dfc8f1da0d81c5aa800d1459f81b72d1bf6dd9b
[ "MIT" ]
null
null
null
import main crew_mitglied_1 = main.CrewMitglied() crew_mitglied_1.nachname = "Quirk" print(crew_mitglied_1.nachname) crew_mitglied_4 = main.CrewMitglied() crew_mitglied_4.nachname = "Quirky" print(crew_mitglied_4.nachname) print(main.CrewMitglied) print(id(crew_mitglied_4.nachname)) print(crew_mitglied_4==crew_mitglied_1)
21.866667
39
0.82622
48
328
5.270833
0.25
0.426877
0.256917
0.249012
0.205534
0
0
0
0
0
0
0.029508
0.070122
328
14
40
23.428571
0.8
0
0
0
0
0
0.033742
0
0
0
0
0
0
1
0
false
0
0.1
0
0.1
0.5
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
4
db52c02db8738abb9b9c3051c0fc021fbd700748
416
py
Python
pyarm/agent/sigmoid.py
jeremiedecock/pyarm
c0561ded2087cf1f4a8f6552fd29fadd470b89e6
[ "MIT" ]
2
2015-06-08T13:01:37.000Z
2018-08-13T06:54:38.000Z
pyarm/agent/sigmoid.py
jeremiedecock/pyarm
c0561ded2087cf1f4a8f6552fd29fadd470b89e6
[ "MIT" ]
null
null
null
pyarm/agent/sigmoid.py
jeremiedecock/pyarm
c0561ded2087cf1f4a8f6552fd29fadd470b89e6
[ "MIT" ]
1
2018-12-05T13:47:50.000Z
2018-12-05T13:47:50.000Z
# -*- coding: utf-8 -*- # Copyright (c) 2010 Jérémie DECOCK (http://www.jdhp.org) import math class Agent: def __init__(self): pass def get_commands(self, angles, velocities, time): return (0., 0., sigmoid(time, 3.), 0., 0., 0.) def sigmoid(t, offset): return 1. / (1. + math.exp(-8. * (t - offset)))
18.086957
57
0.461538
48
416
3.895833
0.6875
0.032086
0
0
0
0
0
0
0
0
0
0.054688
0.384615
416
22
58
18.909091
0.675781
0.185096
0
0.230769
0
0
0
0
0
0
0
0
0
1
0.230769
false
0.076923
0.076923
0.153846
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
1
0
1
0
1
1
0
0
4
db6b13ccae108da8f71cb5e3de20da09842bcbab
818
py
Python
software/multifluids_icferst/tests/swe_mms_p2p1_quadratic_drag/swe_mms_p2p1_quadratic_drag_tools.py
msc-acse/acse-9-independent-research-project-Wade003
cfcba990d52ccf535171cf54c0a91b184db6f276
[ "MIT" ]
2
2020-05-11T02:39:46.000Z
2020-05-11T03:08:38.000Z
software/multifluids_icferst/tests/swe_mms_p2p1_quadratic_drag/swe_mms_p2p1_quadratic_drag_tools.py
msc-acse/acse-9-independent-research-project-Wade003
cfcba990d52ccf535171cf54c0a91b184db6f276
[ "MIT" ]
null
null
null
software/multifluids_icferst/tests/swe_mms_p2p1_quadratic_drag/swe_mms_p2p1_quadratic_drag_tools.py
msc-acse/acse-9-independent-research-project-Wade003
cfcba990d52ccf535171cf54c0a91b184db6f276
[ "MIT" ]
2
2020-05-21T22:50:19.000Z
2020-10-28T17:16:31.000Z
from math import sin, cos, tanh, pi, sqrt def u(x): return cos(x[1])*sin(x[0]) def v(x): return -cos(x[0])*sin(x[1]) def h(x): return sin(x[0])*sin(x[1]) def forcing_u(x): return cos(x[0])*cos(x[1])**2*sin(x[0]) + cos(x[0])*sin(x[0])*sin(x[1])**2 + 1.20*cos(x[1])*sin(x[0]) + 9.80*cos(x[0])*sin(x[1]) + 0.00250*sqrt(cos(x[1])**2*sin(x[0])**2 + cos(x[0])**2*sin(x[1])**2)*cos(x[1])*sin(x[0])/(sin(x[0])*sin(x[1]) + 20.0) def forcing_v(x): return cos(x[0])**2*cos(x[1])*sin(x[1]) + cos(x[1])*sin(x[0])**2*sin(x[1]) + 9.80*cos(x[1])*sin(x[0]) - 1.20*cos(x[0])*sin(x[1]) - 0.00250*sqrt(cos(x[1])**2*sin(x[0])**2 + cos(x[0])**2*sin(x[1])**2)*cos(x[0])*sin(x[1])/(sin(x[0])*sin(x[1]) + 20.0) def velocity(x): return [u(x), v(x)] def forcing_velocity(x): return [forcing_u(x), forcing_v(x)]
34.083333
251
0.52445
205
818
2.068293
0.112195
0.226415
0.141509
0.141509
0.683962
0.627358
0.375
0.334906
0.301887
0.226415
0
0.116343
0.117359
818
23
252
35.565217
0.470914
0
0
0
0
0
0
0
0
0
0
0
0
1
0.466667
false
0
0.066667
0.466667
1
0
0
0
0
null
1
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
1
0
0
0
1
0
0
0
4
db6eac597f5026a482cad8570e239c08cb9005e7
323
py
Python
onmt/modules/__init__.py
DanSchum/NMTGMinor
ebcf33cc77b7c2bc73192f1975b99487db0ebc8a
[ "MIT" ]
5
2020-05-25T01:11:51.000Z
2021-02-18T08:55:43.000Z
onmt/modules/__init__.py
DanSchum/NMTGMinor
ebcf33cc77b7c2bc73192f1975b99487db0ebc8a
[ "MIT" ]
null
null
null
onmt/modules/__init__.py
DanSchum/NMTGMinor
ebcf33cc77b7c2bc73192f1975b99487db0ebc8a
[ "MIT" ]
null
null
null
from onmt.modules.GlobalAttention import GlobalAttention from onmt.modules.ImageEncoder import ImageEncoder from onmt.modules.BaseModel import Generator, NMTModel from onmt.modules.StaticDropout import StaticDropout # For flake8 compatibility. __all__ = [GlobalAttention, ImageEncoder, Generator, NMTModel, StaticDropout]
40.375
77
0.854489
34
323
8
0.411765
0.117647
0.220588
0
0
0
0
0
0
0
0
0.003401
0.089783
323
7
78
46.142857
0.921769
0.077399
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
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
db7d90842b50dae7fc61ca03005b8d7633504f21
685
py
Python
cmd_utils/cmd_exception.py
graze/pycmd-utils
f35700d88265424b7e514e5c82cbebae5e2f57a2
[ "MIT" ]
null
null
null
cmd_utils/cmd_exception.py
graze/pycmd-utils
f35700d88265424b7e514e5c82cbebae5e2f57a2
[ "MIT" ]
1
2020-02-01T14:59:38.000Z
2020-02-01T14:59:38.000Z
cmd_utils/cmd_exception.py
graze/pycmd-utils
f35700d88265424b7e514e5c82cbebae5e2f57a2
[ "MIT" ]
null
null
null
"""Exceptions for cmd_utils.""" class CommandException(Exception): """ Base Exception for cmd_utils exceptions. Attributes: exc - string message return_code - return code of command """ def __init__(self, exc, return_code=None): Exception.__init__(self) self.exc = exc self.return_code = return_code def __str__(self): return self.__repr__() def __repr__(self): return self.exc class ReturnCodeError(CommandException): """Raised when a command returns a non-zero exit code.""" pass class SSHError(CommandException): """Raised when SSH connection fails.""" pass
17.564103
61
0.635036
76
685
5.381579
0.460526
0.122249
0.05379
0.0978
0
0
0
0
0
0
0
0
0.271533
685
38
62
18.026316
0.819639
0.348905
0
0.153846
0
0
0
0
0
0
0
0
0
1
0.230769
false
0.153846
0
0.153846
0.615385
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
1
1
0
0
4
dbac5f0ca22ffd63ebc900acce8160e38e67afaf
98
py
Python
app/apps.py
nkmurli/vasuNKproj
543f87d5ed2812d50b39867bca60c893a4d906d8
[ "MIT" ]
null
null
null
app/apps.py
nkmurli/vasuNKproj
543f87d5ed2812d50b39867bca60c893a4d906d8
[ "MIT" ]
7
2020-06-05T20:48:26.000Z
2021-09-22T18:29:26.000Z
app/apps.py
nkmurli/vasuNKproj
543f87d5ed2812d50b39867bca60c893a4d906d8
[ "MIT" ]
null
null
null
from django.apps import AppConfig class VasuappConfig(AppConfig): name = 'vasuproj.vasuapp'
16.333333
33
0.765306
11
98
6.818182
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.153061
98
5
34
19.6
0.903614
0
0
0
0
0
0.163265
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
dbc3ad91e40143b7d3055df18427435cb788ddfe
1,004
py
Python
test_non-equivalent-colourings.py
jcgwt/foobar
0eb13ea73c28456fde588acb0c1314ea5e413a21
[ "CNRI-Python" ]
null
null
null
test_non-equivalent-colourings.py
jcgwt/foobar
0eb13ea73c28456fde588acb0c1314ea5e413a21
[ "CNRI-Python" ]
null
null
null
test_non-equivalent-colourings.py
jcgwt/foobar
0eb13ea73c28456fde588acb0c1314ea5e413a21
[ "CNRI-Python" ]
null
null
null
import unittest import importlib colourings = importlib.import_module('non-equivalent-colourings') class TestCases(unittest.TestCase): def test_solution(self): self.assertEqual(colourings.solution(1,1,1), 1) self.assertEqual(colourings.solution(10,10,1), 1) self.assertEqual(colourings.solution(1,1,1000), 1000) self.assertEqual(colourings.solution(7,3,1000), 33068783763227519014651588965450182424626554362604265581000) self.assertEqual(colourings.solution(10,10,1000), 75940584281266233059295963476813407690465303634028067643120115987638768360299350432189628371332144284588102338919580926586742819469270026586348030871938085197343689280790904580324483625413736702601041419903161751121037817588203800360996035121655697677217564930154927270848934180754000000) if __name__ == '__main__': unittest.main()
47.809524
313
0.706175
64
1,004
10.921875
0.390625
0.107296
0.178827
0.236052
0.211731
0.211731
0
0
0
0
0
0.48906
0.226096
1,004
20
314
50.2
0.410553
0
0
0.117647
0
0
0.032869
0.0249
0
0
0
0
0.294118
1
0.058824
false
0
0.176471
0
0.294118
0
0
0
1
null
0
0
1
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
4
dbcb3b0a8a8282ac263bf5393ea70cfe78b70565
113
py
Python
test/normal_failure.py
praekeltfoundation/vaultkeeper-agent
7b62b0e77b4ced618bb28ad466fa15b87d709ea9
[ "BSD-3-Clause" ]
7
2017-11-20T15:13:56.000Z
2021-11-22T23:38:03.000Z
test/normal_failure.py
praekeltfoundation/vaultkeeper-agent
7b62b0e77b4ced618bb28ad466fa15b87d709ea9
[ "BSD-3-Clause" ]
11
2017-08-31T09:00:51.000Z
2018-02-09T10:17:48.000Z
test/normal_failure.py
praekeltfoundation/vaultkeeper-agent
7b62b0e77b4ced618bb28ad466fa15b87d709ea9
[ "BSD-3-Clause" ]
2
2018-04-11T11:00:25.000Z
2020-05-05T12:06:45.000Z
#!/usr/bin/python import sys import time print('Subprocess started...') time.sleep(1) print('Oops!') sys.exit(3)
14.125
30
0.707965
18
113
4.444444
0.777778
0
0
0
0
0
0
0
0
0
0
0.019417
0.088496
113
7
31
16.142857
0.757282
0.141593
0
0
0
0
0.270833
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0.333333
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
916eaab771a3b4ed5ee878bb1ab947ce58c15e20
341
py
Python
src/dataset/__init__.py
lux-jwang/goodoos
3b8f7778ea639d168218e2d0db5933bafab85fc9
[ "MIT" ]
1
2015-09-03T13:45:26.000Z
2015-09-03T13:45:26.000Z
src/dataset/__init__.py
lux-jwang/goodoos
3b8f7778ea639d168218e2d0db5933bafab85fc9
[ "MIT" ]
null
null
null
src/dataset/__init__.py
lux-jwang/goodoos
3b8f7778ea639d168218e2d0db5933bafab85fc9
[ "MIT" ]
null
null
null
from datawasher import get_friends_data,get_user_item_matrix, \ get_reputation,get_user_item_matrix_sub, get_reputation, \ get_original_user_item_matrix,get_original_UI, \ get_friends_data_index,get_moive100k, \ get_twittermovie_matrix, get_moive1m
56.833333
81
0.648094
38
341
5.184211
0.447368
0.121827
0.213198
0.172589
0
0
0
0
0
0
0
0.017021
0.31085
341
5
82
68.2
0.821277
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.2
0
0.2
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
91792f8fb1fa936f053d886206b4d625e7c67b55
24,124
py
Python
netbox/virtualization/tests/test_api.py
habalux/netbox
dd7249d2ef09a8f09139c228b8186683237ad3ee
[ "Apache-2.0" ]
2
2019-03-11T12:34:06.000Z
2021-04-22T12:55:04.000Z
netbox/virtualization/tests/test_api.py
habalux/netbox
dd7249d2ef09a8f09139c228b8186683237ad3ee
[ "Apache-2.0" ]
2
2021-09-08T00:50:06.000Z
2022-01-13T01:06:14.000Z
netbox/virtualization/tests/test_api.py
habalux/netbox
dd7249d2ef09a8f09139c228b8186683237ad3ee
[ "Apache-2.0" ]
1
2021-05-11T07:10:44.000Z
2021-05-11T07:10:44.000Z
from django.urls import reverse from netaddr import IPNetwork from rest_framework import status from dcim.constants import IFACE_FF_VIRTUAL, IFACE_MODE_TAGGED from dcim.models import Interface from ipam.models import IPAddress, VLAN from utilities.testing import APITestCase from virtualization.models import Cluster, ClusterGroup, ClusterType, VirtualMachine class ClusterTypeTest(APITestCase): def setUp(self): super().setUp() self.clustertype1 = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1') self.clustertype2 = ClusterType.objects.create(name='Test Cluster Type 2', slug='test-cluster-type-2') self.clustertype3 = ClusterType.objects.create(name='Test Cluster Type 3', slug='test-cluster-type-3') def test_get_clustertype(self): url = reverse('virtualization-api:clustertype-detail', kwargs={'pk': self.clustertype1.pk}) response = self.client.get(url, **self.header) self.assertEqual(response.data['name'], self.clustertype1.name) def test_list_clustertypes(self): url = reverse('virtualization-api:clustertype-list') response = self.client.get(url, **self.header) self.assertEqual(response.data['count'], 3) def test_list_clustertypes_brief(self): url = reverse('virtualization-api:clustertype-list') response = self.client.get('{}?brief=1'.format(url), **self.header) self.assertEqual( sorted(response.data['results'][0]), ['id', 'name', 'slug', 'url'] ) def test_create_clustertype(self): data = { 'name': 'Test Cluster Type 4', 'slug': 'test-cluster-type-4', } url = reverse('virtualization-api:clustertype-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(ClusterType.objects.count(), 4) clustertype4 = ClusterType.objects.get(pk=response.data['id']) self.assertEqual(clustertype4.name, data['name']) self.assertEqual(clustertype4.slug, data['slug']) def test_create_clustertype_bulk(self): data = [ { 'name': 'Test Cluster Type 4', 'slug': 'test-cluster-type-4', }, { 'name': 'Test Cluster Type 5', 'slug': 'test-cluster-type-5', }, { 'name': 'Test Cluster Type 6', 'slug': 'test-cluster-type-6', }, ] url = reverse('virtualization-api:clustertype-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(ClusterType.objects.count(), 6) self.assertEqual(response.data[0]['name'], data[0]['name']) self.assertEqual(response.data[1]['name'], data[1]['name']) self.assertEqual(response.data[2]['name'], data[2]['name']) def test_update_clustertype(self): data = { 'name': 'Test Cluster Type X', 'slug': 'test-cluster-type-x', } url = reverse('virtualization-api:clustertype-detail', kwargs={'pk': self.clustertype1.pk}) response = self.client.put(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(ClusterType.objects.count(), 3) clustertype1 = ClusterType.objects.get(pk=response.data['id']) self.assertEqual(clustertype1.name, data['name']) self.assertEqual(clustertype1.slug, data['slug']) def test_delete_clustertype(self): url = reverse('virtualization-api:clustertype-detail', kwargs={'pk': self.clustertype1.pk}) response = self.client.delete(url, **self.header) self.assertHttpStatus(response, status.HTTP_204_NO_CONTENT) self.assertEqual(ClusterType.objects.count(), 2) class ClusterGroupTest(APITestCase): def setUp(self): super().setUp() self.clustergroup1 = ClusterGroup.objects.create(name='Test Cluster Group 1', slug='test-cluster-group-1') self.clustergroup2 = ClusterGroup.objects.create(name='Test Cluster Group 2', slug='test-cluster-group-2') self.clustergroup3 = ClusterGroup.objects.create(name='Test Cluster Group 3', slug='test-cluster-group-3') def test_get_clustergroup(self): url = reverse('virtualization-api:clustergroup-detail', kwargs={'pk': self.clustergroup1.pk}) response = self.client.get(url, **self.header) self.assertEqual(response.data['name'], self.clustergroup1.name) def test_list_clustergroups(self): url = reverse('virtualization-api:clustergroup-list') response = self.client.get(url, **self.header) self.assertEqual(response.data['count'], 3) def test_list_clustergroups_brief(self): url = reverse('virtualization-api:clustergroup-list') response = self.client.get('{}?brief=1'.format(url), **self.header) self.assertEqual( sorted(response.data['results'][0]), ['id', 'name', 'slug', 'url'] ) def test_create_clustergroup(self): data = { 'name': 'Test Cluster Group 4', 'slug': 'test-cluster-group-4', } url = reverse('virtualization-api:clustergroup-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(ClusterGroup.objects.count(), 4) clustergroup4 = ClusterGroup.objects.get(pk=response.data['id']) self.assertEqual(clustergroup4.name, data['name']) self.assertEqual(clustergroup4.slug, data['slug']) def test_create_clustergroup_bulk(self): data = [ { 'name': 'Test Cluster Group 4', 'slug': 'test-cluster-group-4', }, { 'name': 'Test Cluster Group 5', 'slug': 'test-cluster-group-5', }, { 'name': 'Test Cluster Group 6', 'slug': 'test-cluster-group-6', }, ] url = reverse('virtualization-api:clustergroup-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(ClusterGroup.objects.count(), 6) self.assertEqual(response.data[0]['name'], data[0]['name']) self.assertEqual(response.data[1]['name'], data[1]['name']) self.assertEqual(response.data[2]['name'], data[2]['name']) def test_update_clustergroup(self): data = { 'name': 'Test Cluster Group X', 'slug': 'test-cluster-group-x', } url = reverse('virtualization-api:clustergroup-detail', kwargs={'pk': self.clustergroup1.pk}) response = self.client.put(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(ClusterGroup.objects.count(), 3) clustergroup1 = ClusterGroup.objects.get(pk=response.data['id']) self.assertEqual(clustergroup1.name, data['name']) self.assertEqual(clustergroup1.slug, data['slug']) def test_delete_clustergroup(self): url = reverse('virtualization-api:clustergroup-detail', kwargs={'pk': self.clustergroup1.pk}) response = self.client.delete(url, **self.header) self.assertHttpStatus(response, status.HTTP_204_NO_CONTENT) self.assertEqual(ClusterGroup.objects.count(), 2) class ClusterTest(APITestCase): def setUp(self): super().setUp() cluster_type = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1') cluster_group = ClusterGroup.objects.create(name='Test Cluster Group 1', slug='test-cluster-group-1') self.cluster1 = Cluster.objects.create(name='Test Cluster 1', type=cluster_type, group=cluster_group) self.cluster2 = Cluster.objects.create(name='Test Cluster 2', type=cluster_type, group=cluster_group) self.cluster3 = Cluster.objects.create(name='Test Cluster 3', type=cluster_type, group=cluster_group) def test_get_cluster(self): url = reverse('virtualization-api:cluster-detail', kwargs={'pk': self.cluster1.pk}) response = self.client.get(url, **self.header) self.assertEqual(response.data['name'], self.cluster1.name) def test_list_clusters(self): url = reverse('virtualization-api:cluster-list') response = self.client.get(url, **self.header) self.assertEqual(response.data['count'], 3) def test_list_clusters_brief(self): url = reverse('virtualization-api:cluster-list') response = self.client.get('{}?brief=1'.format(url), **self.header) self.assertEqual( sorted(response.data['results'][0]), ['id', 'name', 'url'] ) def test_create_cluster(self): data = { 'name': 'Test Cluster 4', 'type': ClusterType.objects.first().pk, 'group': ClusterGroup.objects.first().pk, } url = reverse('virtualization-api:cluster-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(Cluster.objects.count(), 4) cluster4 = Cluster.objects.get(pk=response.data['id']) self.assertEqual(cluster4.name, data['name']) self.assertEqual(cluster4.type.pk, data['type']) self.assertEqual(cluster4.group.pk, data['group']) def test_create_cluster_bulk(self): data = [ { 'name': 'Test Cluster 4', 'type': ClusterType.objects.first().pk, 'group': ClusterGroup.objects.first().pk, }, { 'name': 'Test Cluster 5', 'type': ClusterType.objects.first().pk, 'group': ClusterGroup.objects.first().pk, }, { 'name': 'Test Cluster 6', 'type': ClusterType.objects.first().pk, 'group': ClusterGroup.objects.first().pk, }, ] url = reverse('virtualization-api:cluster-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(Cluster.objects.count(), 6) self.assertEqual(response.data[0]['name'], data[0]['name']) self.assertEqual(response.data[1]['name'], data[1]['name']) self.assertEqual(response.data[2]['name'], data[2]['name']) def test_update_cluster(self): cluster_type2 = ClusterType.objects.create(name='Test Cluster Type 2', slug='test-cluster-type-2') cluster_group2 = ClusterGroup.objects.create(name='Test Cluster Group 2', slug='test-cluster-group-2') data = { 'name': 'Test Cluster X', 'type': cluster_type2.pk, 'group': cluster_group2.pk, } url = reverse('virtualization-api:cluster-detail', kwargs={'pk': self.cluster1.pk}) response = self.client.put(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(Cluster.objects.count(), 3) cluster1 = Cluster.objects.get(pk=response.data['id']) self.assertEqual(cluster1.name, data['name']) self.assertEqual(cluster1.type.pk, data['type']) self.assertEqual(cluster1.group.pk, data['group']) def test_delete_cluster(self): url = reverse('virtualization-api:cluster-detail', kwargs={'pk': self.cluster1.pk}) response = self.client.delete(url, **self.header) self.assertHttpStatus(response, status.HTTP_204_NO_CONTENT) self.assertEqual(Cluster.objects.count(), 2) class VirtualMachineTest(APITestCase): def setUp(self): super().setUp() cluster_type = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1') cluster_group = ClusterGroup.objects.create(name='Test Cluster Group 1', slug='test-cluster-group-1') self.cluster1 = Cluster.objects.create(name='Test Cluster 1', type=cluster_type, group=cluster_group) self.virtualmachine1 = VirtualMachine.objects.create(name='Test Virtual Machine 1', cluster=self.cluster1) self.virtualmachine2 = VirtualMachine.objects.create(name='Test Virtual Machine 2', cluster=self.cluster1) self.virtualmachine3 = VirtualMachine.objects.create(name='Test Virtual Machine 3', cluster=self.cluster1) def test_get_virtualmachine(self): url = reverse('virtualization-api:virtualmachine-detail', kwargs={'pk': self.virtualmachine1.pk}) response = self.client.get(url, **self.header) self.assertEqual(response.data['name'], self.virtualmachine1.name) def test_list_virtualmachines(self): url = reverse('virtualization-api:virtualmachine-list') response = self.client.get(url, **self.header) self.assertEqual(response.data['count'], 3) def test_list_virtualmachines_brief(self): url = reverse('virtualization-api:virtualmachine-list') response = self.client.get('{}?brief=1'.format(url), **self.header) self.assertEqual( sorted(response.data['results'][0]), ['id', 'name', 'url'] ) def test_create_virtualmachine(self): data = { 'name': 'Test Virtual Machine 4', 'cluster': self.cluster1.pk, } url = reverse('virtualization-api:virtualmachine-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(VirtualMachine.objects.count(), 4) virtualmachine4 = VirtualMachine.objects.get(pk=response.data['id']) self.assertEqual(virtualmachine4.name, data['name']) self.assertEqual(virtualmachine4.cluster.pk, data['cluster']) def test_create_virtualmachine_without_cluster(self): data = { 'name': 'Test Virtual Machine 4', } url = reverse('virtualization-api:virtualmachine-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_400_BAD_REQUEST) self.assertEqual(VirtualMachine.objects.count(), 3) def test_create_virtualmachine_bulk(self): data = [ { 'name': 'Test Virtual Machine 4', 'cluster': self.cluster1.pk, }, { 'name': 'Test Virtual Machine 5', 'cluster': self.cluster1.pk, }, { 'name': 'Test Virtual Machine 6', 'cluster': self.cluster1.pk, }, ] url = reverse('virtualization-api:virtualmachine-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(VirtualMachine.objects.count(), 6) self.assertEqual(response.data[0]['name'], data[0]['name']) self.assertEqual(response.data[1]['name'], data[1]['name']) self.assertEqual(response.data[2]['name'], data[2]['name']) def test_update_virtualmachine(self): interface = Interface.objects.create(name='Test Interface 1', virtual_machine=self.virtualmachine1) ip4_address = IPAddress.objects.create(address=IPNetwork('192.0.2.1/24'), interface=interface) ip6_address = IPAddress.objects.create(address=IPNetwork('2001:db8::1/64'), interface=interface) cluster2 = Cluster.objects.create( name='Test Cluster 2', type=ClusterType.objects.first(), group=ClusterGroup.objects.first() ) data = { 'name': 'Test Virtual Machine X', 'cluster': cluster2.pk, 'primary_ip4': ip4_address.pk, 'primary_ip6': ip6_address.pk, } url = reverse('virtualization-api:virtualmachine-detail', kwargs={'pk': self.virtualmachine1.pk}) response = self.client.put(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(VirtualMachine.objects.count(), 3) virtualmachine1 = VirtualMachine.objects.get(pk=response.data['id']) self.assertEqual(virtualmachine1.name, data['name']) self.assertEqual(virtualmachine1.cluster.pk, data['cluster']) self.assertEqual(virtualmachine1.primary_ip4.pk, data['primary_ip4']) self.assertEqual(virtualmachine1.primary_ip6.pk, data['primary_ip6']) def test_delete_virtualmachine(self): url = reverse('virtualization-api:virtualmachine-detail', kwargs={'pk': self.virtualmachine1.pk}) response = self.client.delete(url, **self.header) self.assertHttpStatus(response, status.HTTP_204_NO_CONTENT) self.assertEqual(VirtualMachine.objects.count(), 2) class InterfaceTest(APITestCase): def setUp(self): super().setUp() clustertype = ClusterType.objects.create(name='Test Cluster Type 1', slug='test-cluster-type-1') cluster = Cluster.objects.create(name='Test Cluster 1', type=clustertype) self.virtualmachine = VirtualMachine.objects.create(cluster=cluster, name='Test VM 1') self.interface1 = Interface.objects.create( virtual_machine=self.virtualmachine, name='Test Interface 1', form_factor=IFACE_FF_VIRTUAL ) self.interface2 = Interface.objects.create( virtual_machine=self.virtualmachine, name='Test Interface 2', form_factor=IFACE_FF_VIRTUAL ) self.interface3 = Interface.objects.create( virtual_machine=self.virtualmachine, name='Test Interface 3', form_factor=IFACE_FF_VIRTUAL ) self.vlan1 = VLAN.objects.create(name="Test VLAN 1", vid=1) self.vlan2 = VLAN.objects.create(name="Test VLAN 2", vid=2) self.vlan3 = VLAN.objects.create(name="Test VLAN 3", vid=3) def test_get_interface(self): url = reverse('virtualization-api:interface-detail', kwargs={'pk': self.interface1.pk}) response = self.client.get(url, **self.header) self.assertEqual(response.data['name'], self.interface1.name) def test_list_interfaces(self): url = reverse('virtualization-api:interface-list') response = self.client.get(url, **self.header) self.assertEqual(response.data['count'], 3) def test_list_interfaces_brief(self): url = reverse('virtualization-api:interface-list') response = self.client.get('{}?brief=1'.format(url), **self.header) self.assertEqual( sorted(response.data['results'][0]), ['id', 'name', 'url', 'virtual_machine'] ) def test_create_interface(self): data = { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 4', } url = reverse('virtualization-api:interface-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(Interface.objects.count(), 4) interface4 = Interface.objects.get(pk=response.data['id']) self.assertEqual(interface4.virtual_machine_id, data['virtual_machine']) self.assertEqual(interface4.name, data['name']) def test_create_interface_with_802_1q(self): data = { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 4', 'mode': IFACE_MODE_TAGGED, 'untagged_vlan': self.vlan3.id, 'tagged_vlans': [self.vlan1.id, self.vlan2.id], } url = reverse('virtualization-api:interface-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(Interface.objects.count(), 4) self.assertEqual(response.data['virtual_machine']['id'], data['virtual_machine']) self.assertEqual(response.data['name'], data['name']) self.assertEqual(response.data['untagged_vlan']['id'], data['untagged_vlan']) self.assertEqual([v['id'] for v in response.data['tagged_vlans']], data['tagged_vlans']) def test_create_interface_bulk(self): data = [ { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 4', }, { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 5', }, { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 6', }, ] url = reverse('virtualization-api:interface-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(Interface.objects.count(), 6) self.assertEqual(response.data[0]['name'], data[0]['name']) self.assertEqual(response.data[1]['name'], data[1]['name']) self.assertEqual(response.data[2]['name'], data[2]['name']) def test_create_interface_802_1q_bulk(self): data = [ { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 4', 'mode': IFACE_MODE_TAGGED, 'untagged_vlan': self.vlan2.id, 'tagged_vlans': [self.vlan1.id], }, { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 5', 'mode': IFACE_MODE_TAGGED, 'untagged_vlan': self.vlan2.id, 'tagged_vlans': [self.vlan1.id], }, { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface 6', 'mode': IFACE_MODE_TAGGED, 'untagged_vlan': self.vlan2.id, 'tagged_vlans': [self.vlan1.id], }, ] url = reverse('virtualization-api:interface-list') response = self.client.post(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_201_CREATED) self.assertEqual(Interface.objects.count(), 6) for i in range(0, 3): self.assertEqual(response.data[i]['name'], data[i]['name']) self.assertEqual([v['id'] for v in response.data[i]['tagged_vlans']], data[i]['tagged_vlans']) self.assertEqual(response.data[i]['untagged_vlan']['id'], data[i]['untagged_vlan']) def test_update_interface(self): data = { 'virtual_machine': self.virtualmachine.pk, 'name': 'Test Interface X', } url = reverse('virtualization-api:interface-detail', kwargs={'pk': self.interface1.pk}) response = self.client.put(url, data, format='json', **self.header) self.assertHttpStatus(response, status.HTTP_200_OK) self.assertEqual(Interface.objects.count(), 3) interface1 = Interface.objects.get(pk=response.data['id']) self.assertEqual(interface1.name, data['name']) def test_delete_interface(self): url = reverse('dcim-api:interface-detail', kwargs={'pk': self.interface1.pk}) response = self.client.delete(url, **self.header) self.assertHttpStatus(response, status.HTTP_204_NO_CONTENT) self.assertEqual(Interface.objects.count(), 2)
38.292063
114
0.623404
2,656
24,124
5.576054
0.055346
0.084065
0.046185
0.067454
0.820662
0.777448
0.72998
0.698042
0.684335
0.630993
0
0.018813
0.235409
24,124
629
115
38.352941
0.784115
0
0
0.490364
0
0
0.169665
0.055339
0
0
0
0
0.226981
1
0.092077
false
0
0.017131
0
0.119914
0
0
0
0
null
0
0
0
1
1
1
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
91abc0dbac4ab3bc9c9559c6c8dde28f641d97b6
3,733
py
Python
openpyxl/utils/formulas.py
xinetzone/openpyxl
df1507591952e6b4f865957bafc4f69e44845b75
[ "MIT" ]
null
null
null
openpyxl/utils/formulas.py
xinetzone/openpyxl
df1507591952e6b4f865957bafc4f69e44845b75
[ "MIT" ]
null
null
null
openpyxl/utils/formulas.py
xinetzone/openpyxl
df1507591952e6b4f865957bafc4f69e44845b75
[ "MIT" ]
null
null
null
# Copyright (c) 2010-2022 openpyxl """ List of builtin formulae """ FORMULAE = ("CUBEKPIMEMBER", "CUBEMEMBER", "CUBEMEMBERPROPERTY", "CUBERANKEDMEMBER", "CUBESET", "CUBESETCOUNT", "CUBEVALUE", "DAVERAGE", "DCOUNT", "DCOUNTA", "DGET", "DMAX", "DMIN", "DPRODUCT", "DSTDEV", "DSTDEVP", "DSUM", "DVAR", "DVARP", "DATE", "DATEDIF", "DATEVALUE", "DAY", "DAYS360", "EDATE", "EOMONTH", "HOUR", "MINUTE", "MONTH", "NETWORKDAYS", "NETWORKDAYS.INTL", "NOW", "SECOND", "TIME", "TIMEVALUE", "TODAY", "WEEKDAY", "WEEKNUM", "WORKDAY ", "WORKDAY.INTL", "YEAR", "YEARFRAC", "BESSELI", "BESSELJ", "BESSELK", "BESSELY", "BIN2DEC", "BIN2HEX", "BIN2OCT", "COMPLEX", "CONVERT", "DEC2BIN", "DEC2HEX", "DEC2OCT", "DELTA", "ERF", "ERFC", "GESTEP", "HEX2BIN", "HEX2DEC", "HEX2OCT", "IMABS", "IMAGINARY", "IMARGUMENT", "IMCONJUGATE", "IMCOS", "IMDIV", "IMEXP", "IMLN", "IMLOG10", "IMLOG2", "IMPOWER", "IMPRODUCT", "IMREAL", "IMSIN", "IMSQRT", "IMSUB", "IMSUM", "OCT2BIN", "OCT2DEC", "OCT2HEX", "ACCRINT", "ACCRINTM", "AMORDEGRC", "AMORLINC", "COUPDAYBS", "COUPDAYS", "COUPDAYSNC", "COUPNCD", "COUPNUM", "COUPPCD", "CUMIPMT", "CUMPRINC", "DB", "DDB", "DISC", "DOLLARDE", "DOLLARFR", "DURATION", "EFFECT", "FV", "FVSCHEDULE", "INTRATE", "IPMT", "IRR", "ISPMT", "MDURATION", "MIRR", "NOMINAL", "NPER", "NPV", "ODDFPRICE", "ODDFYIELD", "ODDLPRICE", "ODDLYIELD", "PMT", "PPMT", "PRICE", "PRICEDISC", "PRICEMAT", "PV", "RATE", "RECEIVED", "SLN", "SYD", "TBILLEQ", "TBILLPRICE", "TBILLYIELD", "VDB", "XIRR", "XNPV", "YIELD", "YIELDDISC", "YIELDMAT", "CELL", "ERROR.TYPE", "INFO", "ISBLANK", "ISERR", "ISERROR", "ISEVEN", "ISLOGICAL", "ISNA", "ISNONTEXT", "ISNUMBER", "ISODD", "ISREF", "ISTEXT", "N", "NA", "TYPE", "AND", "FALSE", "IF", "IFERROR", "NOT", "OR", "TRUE ADDRESS", "AREAS", "CHOOSE", "COLUMN", "COLUMNS", "GETPIVOTDATA", "HLOOKUP", "HYPERLINK", "INDEX", "INDIRECT", "LOOKUP", "MATCH", "OFFSET", "ROW", "ROWS", "RTD", "TRANSPOSE", "VLOOKUP", "ABS", "ACOS", "ACOSH", "ASIN", "ASINH", "ATAN", "ATAN2", "ATANH", "CEILING", "COMBIN", "COS", "COSH", "DEGREES", "ECMA.CEILING", "EVEN", "EXP", "FACT", "FACTDOUBLE", "FLOOR", "GCD", "INT", "ISO.CEILING", "LCM", "LN", "LOG", "LOG10", "MDETERM", "MINVERSE", "MMULT", "MOD", "MROUND", "MULTINOMIAL", "ODD", "PI", "POWER", "PRODUCT", "QUOTIENT", "RADIANS", "RAND", "RANDBETWEEN", "ROMAN", "ROUND", "ROUNDDOWN", "ROUNDUP", "SERIESSUM", "SIGN", "SIN", "SINH", "SQRT", "SQRTPI", "SUBTOTAL", "SUM", "SUMIF", "SUMIFS", "SUMPRODUCT", "SUMSQ", "SUMX2MY2", "SUMX2PY2", "SUMXMY2", "TAN", "TANH", "TRUNC", "AVEDEV", "AVERAGE", "AVERAGEA", "AVERAGEIF", "AVERAGEIFS", "BETADIST", "BETAINV", "BINOMDIST", "CHIDIST", "CHIINV", "CHITEST", "CONFIDENCE", "CORREL", "COUNT", "COUNTA", "COUNTBLANK", "COUNTIF", "COUNTIFS", "COVAR", "CRITBINOM", "DEVSQ", "EXPONDIST", "FDIST", "FINV", "FISHER", "FISHERINV", "FORECAST", "FREQUENCY", "FTEST", "GAMMADIST", "GAMMAINV", "GAMMALN", "GEOMEAN", "GROWTH", "HARMEAN", "HYPGEOMDIST", "INTERCEPT", "KURT", "LARGE", "LINEST", "LOGEST", "LOGINV", "LOGNORMDIST", "MAX", "MAXA", "MEDIAN", "MIN", "MINA", "MODE", "NEGBINOMDIST", "NORMDIST", "NORMINV", "NORMSDIST", "NORMSINV", "PEARSON", "PERCENTILE", "PERCENTRANK", "PERMUT", "POISSON", "PROB", "QUARTILE", "RANK", "RSQ", "SKEW", "SLOPE", "SMALL", "STANDARDIZE", "STDEV STDEVA", "STDEVP", "STDEVPA STEYX", "TDIST", "TINV", "TREND", "TRIMMEAN", "TTEST", "VAR", "VARA", "VARP", "VARPA", "WEIBULL", "ZTEST", "ASC", "BAHTTEXT", "CHAR", "CLEAN", "CODE", "CONCATENATE", "DOLLAR", "EXACT", "FIND", "FINDB", "FIXED", "JIS", "LEFT", "LEFTB", "LEN", "LENB", "LOWER", "MID", "MIDB", "PHONETIC", "PROPER", "REPLACE", "REPLACEB", "REPT", "RIGHT", "RIGHTB", "SEARCH", "SEARCHB", "SUBSTITUTE", "T", "TEXT", "TRIM", "UPPER", "VALUE") FORMULAE = frozenset(FORMULAE)
373.3
3,630
0.611305
373
3,733
6.117962
0.975871
0
0
0
0
0
0
0
0
0
0
0.010125
0.100455
3,733
9
3,631
414.777778
0.669446
0.015537
0
0
0
0
0.602945
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
91ad5006688a620485d7a87108a47b13ee71c66f
169
py
Python
bert/train/utils/pad.py
public1024/BERT-pytorch
50dd20816c7b33d863ddfd761de72859c7799c5e
[ "Unlicense" ]
66
2018-10-30T16:17:43.000Z
2022-03-18T13:13:01.000Z
bert/train/utils/pad.py
public1024/BERT-pytorch
50dd20816c7b33d863ddfd761de72859c7799c5e
[ "Unlicense" ]
4
2019-03-22T10:30:26.000Z
2022-03-21T12:19:22.000Z
bert/train/utils/pad.py
public1024/BERT-pytorch
50dd20816c7b33d863ddfd761de72859c7799c5e
[ "Unlicense" ]
28
2018-11-01T09:06:27.000Z
2022-03-11T04:56:10.000Z
from bert.preprocess import PAD_INDEX def pad_masking(x): # x: (batch_size, seq_len) padded_positions = x == PAD_INDEX return padded_positions.unsqueeze(1)
24.142857
40
0.733728
25
169
4.68
0.72
0.136752
0
0
0
0
0
0
0
0
0
0.007194
0.177515
169
7
40
24.142857
0.834532
0.142012
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
91addeb7ecdbf5ffb5543e60e03df7a521befc6b
3,834
py
Python
src/GUI_config.py
volovodenko/English
860ae0f971909b9aa299c193ea7d0161c88d0b22
[ "Apache-2.0" ]
31
2015-02-11T16:10:52.000Z
2021-08-31T12:39:05.000Z
src/GUI_config.py
volovodenko/English
860ae0f971909b9aa299c193ea7d0161c88d0b22
[ "Apache-2.0" ]
5
2015-05-26T09:38:02.000Z
2015-11-12T20:54:32.000Z
src/GUI_config.py
volovodenko/English
860ae0f971909b9aa299c193ea7d0161c88d0b22
[ "Apache-2.0" ]
9
2015-03-18T08:23:51.000Z
2022-01-05T05:51:04.000Z
# -*- coding: utf-8 -*- from Tkinter import PhotoImage clr_stat_frame = "#E9F6FE" clr_word_frame = "#FFFFE0" clr_answer_frame = "#E9F6FE" clr_success = "#348000" clr_error = "#FC0039" clr_black = "#000000" clr_stat = ["#7B7B00", "#007B00", "#7B7B7B"] def edit_image(): img = PhotoImage(format="gif", data="R0lGODlhEAAQAMQAAAAAAP//////3f/lbv/MAN2qAMSRAKp3AP/lzP+/mcxmM+WATf+ZZswzM5kz" + "M/9mZt1mZt3d3czMzLu7u6qqqpmZmYiIiGZmZjMzM////wAAAAAAAAAAAAAAAAAAAAAAACH5BAEA" + "ABkALAAAAAAQABAAAAVJYCaOpFg9T6lmVURBzToWAiVZsUwPhDVdOgGvUACudgTiITgsLI/CpJMp" + "faqQSmoW2rSWGAhDVZZZIBKHKRmTYDC8KwzGoSCPQgA7") return img def find_in_web_image(): img = PhotoImage(format="gif", data="R0lGODlhEAAQAPeoAP39/YX8iLa2tuXm5jF7m/z8/Pv7+37hparArEh/l83NzcDBwU6Yuu3t7YrB" + "kUiUtsHL0FCavD6KrKLE1GaLm0SQsyx7nVKbvVqiw0aStC5/oyp8oDx9mW6klWOuwpe5o4L1jYDr" + "mUGOsZC8z33dqlymzHi72IP3jIi3yFWewObo54T2kWm/s4LD4Wuy1p/D08bLzHW32MTIynSXp5fO" + "w4LniILvjpi+nJC3nMDAwLrJwG2yq16KnrTntqm1u87bz7e+wdjZ2oP4ipb2mVukwI6vrD6OtVyk" + "xbG5vILykWy+ukSemajE0KDPvO/v7+nz+KTO0zmHqm/Bu4XUiJ7FqXbXp0CNsOrr6+rr6tzc3Fig" + "wjyKrUmVt1mhw9rc2miNnFmypV25o8HjwTOCpUCOrlKEmefo6Jazo3q73KGus2OryJ6+zHjdoIT0" + "iWyfrMbNyILlp67BvLvFvKKxsbzHy5TrnDyDosLGxT+Qt4LrnnvSubS6tDCApH3vjoflnZPAlqLI" + "wDCBpNvd24T1kEmUtz+Mr/n5+TSEp2Wux5S7my1+op/OymC2rnrYrIKqspfA046zw9zc3UuVt4Dt" + "ldDi0TiHqlWGm4Gbpof6ip/VvzV8m4ysu3TPsOzt7ZSosTmHq1CcuNjo8V6hwIfA34iep3XHv6TD" + "0yl7n////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" + "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAKgALAAAAAAQABAA" + "AAjxAFEJRAVAEIIbHxB4ATCw4RUcbfSYiFHKxh8sDVGZccPmAJoWcEJIYTFFxUADM7QgSpJnxSAS" + "VY4wcmBAoAxJKTxwChDgQCMlXRiAeSPwUoYIGNSACHBikh9RXMgkIsjDCqELRIQEGEIpSyQmEjoA" + "KGApiogHoPpg+iEGygsIkMoUQPUlUKVCFcLUgbFoxKM1dCgITHNKw6FPW3bcyYSCBiAdcwR24nBq" + "gyI+Y3zEadJDDpUGA4FYOEX6lB1PAvY4KhGqIRJNpUkvqVHEiIsnDQeQSkCAQIIzA1BNwDMqo4Ic" + "AgQsUCAwyCZTGaMPdGIoIAA7") return img def stat_image(): img = PhotoImage(format="gif", data="R0lGODlhEAAQAOYAAAAAAP///5dxdJNtdI9qdItncl6Atnef33uk5Fx+s3uk44Cp6Iav7Yav64Wt" + "6Yew64uz7oq18Yy384659JC79Y638ZC785S+9ZO99JbA9qjP+qvS+maRMGCILV6FLJLAQZG+QpK/" + "SJbEPpXDP5PBQJDEII3BH4q+H5PHIYy/I47CJJLEJZjLKJfHMpjIN6HPPJzKO57MPKTSP6LQPqDP" + "Pp/NPZrIPKXUQZjGPafTTLzlYsjteJfKI5rOJZXHJp7QKJvOKp/QLKPVLqTVMqnZN6nZO6bUPqPR" + "Pa7dQajWQq7cRKnWQ6zYRa3ZSLPgTLPfTrDcTrnjVbTfVLnjV7jhW8fsdMfsdaKOGqSGG6CBHJx8" + "Hph3IJRzIZFvIotsJuaRUuaSUvCMSPGUVPSgZ/Slbt1XBOBdCuBmGuVqG+NrH+d3Lut7Me2FQZcx" + "DZQxDaaAdqWIgqF8dZx2df///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5" + "BAEAAHMALAAAAAAQABAAAAe4gHOCg4SFhoU7VVVWTIeEOlFRU0aOg1ROTk9HlYJSSEhKL4MbGhuF" + "UERERTGDGRQZhU1CQkMwgxcTF4VLPz9BNoMYEhhwYF9gV0k9PUA4gxYRFm9kY2RYNzw8LCKDFQwV" + "cWJhYlkyKCg+I4MQCxBybGtsWjMlJSskgw8KDwJqaGpbaJgwoeLDIAcHHAxIYyYNlxonTqQAMagB" + "ggYEzpQ50yVHixYuQgwykMBAgTZu2njp4KElhzmBAAA7") return img
62.852459
104
0.709963
151
3,834
17.927152
0.781457
0.008866
0.019948
0.026598
0.034355
0.034355
0
0
0
0
0
0.09596
0.225352
3,834
60
105
63.9
0.815488
0.005477
0
0.176471
0
0
0.666492
0.647599
0
1
0
0
0
1
0.058824
false
0
0.019608
0
0.137255
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
1
0
0
0
0
0
0
0
0
0
0
0
0
4
91c32185ee553a88e1ff40f83a8a3bb5178233a6
258
py
Python
students/k3342/practical_works/Shaidullina_Regina/simple_django_web_project/django_project_Shaidullina/project_first_app/admin.py
TonikX/ITMO_ICT_-WebProgramming_2020
ba566c1b3ab04585665c69860b713741906935a0
[ "MIT" ]
10
2020-03-20T09:06:12.000Z
2021-07-27T13:06:02.000Z
students/k3342/practical_works/Shaidullina_Regina/simple_django_web_project/django_project_Shaidullina/project_first_app/admin.py
TonikX/ITMO_ICT_-WebProgramming_2020
ba566c1b3ab04585665c69860b713741906935a0
[ "MIT" ]
134
2020-03-23T09:47:48.000Z
2022-03-12T01:05:19.000Z
students/k3342/practical_works/Shaidullina_Regina/simple_django_web_project/django_project_Shaidullina/project_first_app/admin.py
TonikX/ITMO_ICT_-WebProgramming_2020
ba566c1b3ab04585665c69860b713741906935a0
[ "MIT" ]
71
2020-03-20T12:45:56.000Z
2021-10-31T19:22:25.000Z
from django.contrib import admin from project_first_app.models import Owner, Car, Ownership, DriversLicense # Register your models here. admin.site.register(Owner) admin.site.register(Car) admin.site.register(Ownership) admin.site.register(DriversLicense)
25.8
74
0.825581
35
258
6.028571
0.485714
0.170616
0.322275
0
0
0
0
0
0
0
0
0
0.085271
258
9
75
28.666667
0.894068
0.100775
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.333333
0
0.333333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
91c89b2dd49a8cdaaab40d8db26987314f7600e6
37,555
py
Python
cardboard/cards/sets/saviors_of_kamigawa.py
Julian/cardboard
6ab676d04b38bf9b0d0c4a849364159947b8ea7f
[ "MIT" ]
5
2015-03-23T10:25:40.000Z
2021-05-29T06:00:40.000Z
cardboard/cards/sets/saviors_of_kamigawa.py
Julian/cardboard
6ab676d04b38bf9b0d0c4a849364159947b8ea7f
[ "MIT" ]
null
null
null
cardboard/cards/sets/saviors_of_kamigawa.py
Julian/cardboard
6ab676d04b38bf9b0d0c4a849364159947b8ea7f
[ "MIT" ]
1
2019-02-17T14:45:29.000Z
2019-02-17T14:45:29.000Z
from cardboard import types from cardboard.ability import ( AbilityNotImplemented, spell, activated, triggered, static ) from cardboard.cards import card, common, keywords, match @card("Hidetsugu's Second Rite") def hidetsugus_second_rite(card, abilities): def hidetsugus_second_rite(): return AbilityNotImplemented return hidetsugus_second_rite, @card("Kitsune Dawnblade") def kitsune_dawnblade(card, abilities): def kitsune_dawnblade(): return AbilityNotImplemented def kitsune_dawnblade(): return AbilityNotImplemented return kitsune_dawnblade, kitsune_dawnblade, @card("Measure of Wickedness") def measure_of_wickedness(card, abilities): def measure_of_wickedness(): return AbilityNotImplemented def measure_of_wickedness(): return AbilityNotImplemented return measure_of_wickedness, measure_of_wickedness, @card("Pithing Needle") def pithing_needle(card, abilities): def pithing_needle(): return AbilityNotImplemented def pithing_needle(): return AbilityNotImplemented return pithing_needle, pithing_needle, @card("Kuon, Ogre Ascendant") def kuon_ogre_ascendant(card, abilities): def kuon_ogre_ascendant(): return AbilityNotImplemented def kuon_ogre_ascendant(): return AbilityNotImplemented return kuon_ogre_ascendant, kuon_ogre_ascendant, @card("Kaho, Minamo Historian") def kaho_minamo_historian(card, abilities): def kaho_minamo_historian(): return AbilityNotImplemented def kaho_minamo_historian(): return AbilityNotImplemented return kaho_minamo_historian, kaho_minamo_historian, @card("Inner-Chamber Guard") def innerchamber_guard(card, abilities): def innerchamber_guard(): return AbilityNotImplemented return innerchamber_guard, @card("Nikko-Onna") def nikkoonna(card, abilities): def nikkoonna(): return AbilityNotImplemented def nikkoonna(): return AbilityNotImplemented return nikkoonna, nikkoonna, @card("Oppressive Will") def oppressive_will(card, abilities): def oppressive_will(): return AbilityNotImplemented return oppressive_will, @card("Soramaro, First to Dream") def soramaro_first_to_dream(card, abilities): def soramaro_first_to_dream(): return AbilityNotImplemented def soramaro_first_to_dream(): return AbilityNotImplemented def soramaro_first_to_dream(): return AbilityNotImplemented return soramaro_first_to_dream, soramaro_first_to_dream, soramaro_first_to_dream, @card("Kashi-Tribe Elite") def kashitribe_elite(card, abilities): def kashitribe_elite(): return AbilityNotImplemented def kashitribe_elite(): return AbilityNotImplemented return kashitribe_elite, kashitribe_elite, @card("Arashi, the Sky Asunder") def arashi_the_sky_asunder(card, abilities): def arashi_the_sky_asunder(): return AbilityNotImplemented def arashi_the_sky_asunder(): return AbilityNotImplemented return arashi_the_sky_asunder, arashi_the_sky_asunder, @card("Rune-Tail's Essence") def runetails_essence(card, abilities): def runetails_essence(): return AbilityNotImplemented def runetails_essence(): return AbilityNotImplemented return runetails_essence, runetails_essence, @card("Captive Flame") def captive_flame(card, abilities): def captive_flame(): return AbilityNotImplemented return captive_flame, @card("Shinen of Life's Roar") def shinen_of_lifes_roar(card, abilities): def shinen_of_lifes_roar(): return AbilityNotImplemented def shinen_of_lifes_roar(): return AbilityNotImplemented return shinen_of_lifes_roar, shinen_of_lifes_roar, @card("Oboro Envoy") def oboro_envoy(card, abilities): def oboro_envoy(): return AbilityNotImplemented def oboro_envoy(): return AbilityNotImplemented return oboro_envoy, oboro_envoy, @card("Shifting Borders") def shifting_borders(card, abilities): def shifting_borders(): return AbilityNotImplemented def shifting_borders(): return AbilityNotImplemented return shifting_borders, shifting_borders, @card("Presence of the Wise") def presence_of_the_wise(card, abilities): def presence_of_the_wise(): return AbilityNotImplemented return presence_of_the_wise, @card("Curtain of Light") def curtain_of_light(card, abilities): def curtain_of_light(): return AbilityNotImplemented def curtain_of_light(): return AbilityNotImplemented def curtain_of_light(): return AbilityNotImplemented return curtain_of_light, curtain_of_light, curtain_of_light, @card("Endless Swarm") def endless_swarm(card, abilities): def endless_swarm(): return AbilityNotImplemented def endless_swarm(): return AbilityNotImplemented return endless_swarm, endless_swarm, @card("Sokenzan Spellblade") def sokenzan_spellblade(card, abilities): def sokenzan_spellblade(): return AbilityNotImplemented def sokenzan_spellblade(): return AbilityNotImplemented return sokenzan_spellblade, sokenzan_spellblade, @card("Hand of Cruelty") def hand_of_cruelty(card, abilities): def hand_of_cruelty(): return AbilityNotImplemented def hand_of_cruelty(): return AbilityNotImplemented return hand_of_cruelty, hand_of_cruelty, @card("Neverending Torment") def neverending_torment(card, abilities): def neverending_torment(): return AbilityNotImplemented def neverending_torment(): return AbilityNotImplemented return neverending_torment, neverending_torment, @card("Sekki, Seasons' Guide") def sekki_seasons_guide(card, abilities): def sekki_seasons_guide(): return AbilityNotImplemented def sekki_seasons_guide(): return AbilityNotImplemented def sekki_seasons_guide(): return AbilityNotImplemented return sekki_seasons_guide, sekki_seasons_guide, sekki_seasons_guide, @card("Kagemaro's Clutch") def kagemaros_clutch(card, abilities): def kagemaros_clutch(): return AbilityNotImplemented def kagemaros_clutch(): return AbilityNotImplemented return kagemaros_clutch, kagemaros_clutch, @card("Shinen of Fear's Chill") def shinen_of_fears_chill(card, abilities): def shinen_of_fears_chill(): return AbilityNotImplemented def shinen_of_fears_chill(): return AbilityNotImplemented return shinen_of_fears_chill, shinen_of_fears_chill, @card("Adamaro, First to Desire") def adamaro_first_to_desire(card, abilities): def adamaro_first_to_desire(): return AbilityNotImplemented return adamaro_first_to_desire, @card("Celestial Kirin") def celestial_kirin(card, abilities): def celestial_kirin(): return AbilityNotImplemented def celestial_kirin(): return AbilityNotImplemented return celestial_kirin, celestial_kirin, @card("Ideas Unbound") def ideas_unbound(card, abilities): def ideas_unbound(): return AbilityNotImplemented return ideas_unbound, @card("Godo's Irregulars") def godos_irregulars(card, abilities): def godos_irregulars(): return AbilityNotImplemented return godos_irregulars, @card("Kitsune Loreweaver") def kitsune_loreweaver(card, abilities): def kitsune_loreweaver(): return AbilityNotImplemented return kitsune_loreweaver, @card("Promise of Bunrei") def promise_of_bunrei(card, abilities): def promise_of_bunrei(): return AbilityNotImplemented return promise_of_bunrei, @card("Nightsoil Kami") def nightsoil_kami(card, abilities): def nightsoil_kami(): return AbilityNotImplemented return nightsoil_kami, @card("Kagemaro, First to Suffer") def kagemaro_first_to_suffer(card, abilities): def kagemaro_first_to_suffer(): return AbilityNotImplemented def kagemaro_first_to_suffer(): return AbilityNotImplemented return kagemaro_first_to_suffer, kagemaro_first_to_suffer, @card("Homura, Human Ascendant") def homura_human_ascendant(card, abilities): def homura_human_ascendant(): return AbilityNotImplemented def homura_human_ascendant(): return AbilityNotImplemented def homura_human_ascendant(): return AbilityNotImplemented return homura_human_ascendant, homura_human_ascendant, homura_human_ascendant, @card("Erayo's Essence") def erayos_essence(card, abilities): def erayos_essence(): return AbilityNotImplemented def erayos_essence(): return AbilityNotImplemented return erayos_essence, erayos_essence, @card("Eternal Dominion") def eternal_dominion(card, abilities): def eternal_dominion(): return AbilityNotImplemented def eternal_dominion(): return AbilityNotImplemented return eternal_dominion, eternal_dominion, @card("Kami of the Tended Garden") def kami_of_the_tended_garden(card, abilities): def kami_of_the_tended_garden(): return AbilityNotImplemented def kami_of_the_tended_garden(): return AbilityNotImplemented return kami_of_the_tended_garden, kami_of_the_tended_garden, @card("Oboro, Palace in the Clouds") def oboro_palace_in_the_clouds(card, abilities): def oboro_palace_in_the_clouds(): return AbilityNotImplemented def oboro_palace_in_the_clouds(): return AbilityNotImplemented return oboro_palace_in_the_clouds, oboro_palace_in_the_clouds, @card("Rally the Horde") def rally_the_horde(card, abilities): def rally_the_horde(): return AbilityNotImplemented return rally_the_horde, @card("Sasaya, Orochi Ascendant") def sasaya_orochi_ascendant(card, abilities): def sasaya_orochi_ascendant(): return AbilityNotImplemented def sasaya_orochi_ascendant(): return AbilityNotImplemented return sasaya_orochi_ascendant, sasaya_orochi_ascendant, @card("Minamo Scrollkeeper") def minamo_scrollkeeper(card, abilities): def minamo_scrollkeeper(): return AbilityNotImplemented def minamo_scrollkeeper(): return AbilityNotImplemented return minamo_scrollkeeper, minamo_scrollkeeper, @card("Footsteps of the Goryo") def footsteps_of_the_goryo(card, abilities): def footsteps_of_the_goryo(): return AbilityNotImplemented return footsteps_of_the_goryo, @card("Cut the Earthly Bond") def cut_the_earthly_bond(card, abilities): def cut_the_earthly_bond(): return AbilityNotImplemented return cut_the_earthly_bond, @card("Dosan's Oldest Chant") def dosans_oldest_chant(card, abilities): def dosans_oldest_chant(): return AbilityNotImplemented def dosans_oldest_chant(): return AbilityNotImplemented return dosans_oldest_chant, dosans_oldest_chant, @card("Ghost-Lit Warder") def ghostlit_warder(card, abilities): def ghostlit_warder(): return AbilityNotImplemented def ghostlit_warder(): return AbilityNotImplemented return ghostlit_warder, ghostlit_warder, @card("Fiddlehead Kami") def fiddlehead_kami(card, abilities): def fiddlehead_kami(): return AbilityNotImplemented return fiddlehead_kami, @card("Dense Canopy") def dense_canopy(card, abilities): def dense_canopy(): return AbilityNotImplemented return dense_canopy, @card("Elder Pine of Jukai") def elder_pine_of_jukai(card, abilities): def elder_pine_of_jukai(): return AbilityNotImplemented def elder_pine_of_jukai(): return AbilityNotImplemented return elder_pine_of_jukai, elder_pine_of_jukai, @card("Iname as One") def iname_as_one(card, abilities): def iname_as_one(): return AbilityNotImplemented def iname_as_one(): return AbilityNotImplemented return iname_as_one, iname_as_one, @card("Rune-Tail, Kitsune Ascendant") def runetail_kitsune_ascendant(card, abilities): def runetail_kitsune_ascendant(): return AbilityNotImplemented def runetail_kitsune_ascendant(): return AbilityNotImplemented return runetail_kitsune_ascendant, runetail_kitsune_ascendant, @card("Gnat Miser") def gnat_miser(card, abilities): def gnat_miser(): return AbilityNotImplemented return gnat_miser, @card("Akki Underling") def akki_underling(card, abilities): def akki_underling(): return AbilityNotImplemented return akki_underling, @card("Kami of Empty Graves") def kami_of_empty_graves(card, abilities): def kami_of_empty_graves(): return AbilityNotImplemented return kami_of_empty_graves, @card("Kami of the Crescent Moon") def kami_of_the_crescent_moon(card, abilities): def kami_of_the_crescent_moon(): return AbilityNotImplemented return kami_of_the_crescent_moon, @card("Twincast") def twincast(card, abilities): def twincast(): return AbilityNotImplemented return twincast, @card("Deathknell Kami") def deathknell_kami(card, abilities): def deathknell_kami(): return AbilityNotImplemented def deathknell_kami(): return AbilityNotImplemented def deathknell_kami(): return AbilityNotImplemented return deathknell_kami, deathknell_kami, deathknell_kami, @card("Sakashima the Impostor") def sakashima_the_impostor(card, abilities): def sakashima_the_impostor(): return AbilityNotImplemented return sakashima_the_impostor, @card("Promised Kannushi") def promised_kannushi(card, abilities): def promised_kannushi(): return AbilityNotImplemented return promised_kannushi, @card("Homura's Essence") def homuras_essence(card, abilities): def homuras_essence(): return AbilityNotImplemented def homuras_essence(): return AbilityNotImplemented return homuras_essence, homuras_essence, @card("Sokenzan Renegade") def sokenzan_renegade(card, abilities): def sokenzan_renegade(): return AbilityNotImplemented def sokenzan_renegade(): return AbilityNotImplemented return sokenzan_renegade, sokenzan_renegade, @card("Overwhelming Intellect") def overwhelming_intellect(card, abilities): def overwhelming_intellect(): return AbilityNotImplemented return overwhelming_intellect, @card("Descendant of Kiyomaro") def descendant_of_kiyomaro(card, abilities): def descendant_of_kiyomaro(): return AbilityNotImplemented return descendant_of_kiyomaro, @card("Dreamcatcher") def dreamcatcher(card, abilities): def dreamcatcher(): return AbilityNotImplemented return dreamcatcher, @card("Kemuri-Onna") def kemurionna(card, abilities): def kemurionna(): return AbilityNotImplemented def kemurionna(): return AbilityNotImplemented return kemurionna, kemurionna, @card("Oni of Wild Places") def oni_of_wild_places(card, abilities): def oni_of_wild_places(): return AbilityNotImplemented def oni_of_wild_places(): return AbilityNotImplemented return oni_of_wild_places, oni_of_wild_places, @card("One with Nothing") def one_with_nothing(card, abilities): def one_with_nothing(): return AbilityNotImplemented return one_with_nothing, @card("Soratami Cloud Chariot") def soratami_cloud_chariot(card, abilities): def soratami_cloud_chariot(): return AbilityNotImplemented def soratami_cloud_chariot(): return AbilityNotImplemented return soratami_cloud_chariot, soratami_cloud_chariot, @card("Spiraling Embers") def spiraling_embers(card, abilities): def spiraling_embers(): return AbilityNotImplemented return spiraling_embers, @card("Akuta, Born of Ash") def akuta_born_of_ash(card, abilities): def akuta_born_of_ash(): return AbilityNotImplemented def akuta_born_of_ash(): return AbilityNotImplemented return akuta_born_of_ash, akuta_born_of_ash, @card("Feral Lightning") def feral_lightning(card, abilities): def feral_lightning(): return AbilityNotImplemented return feral_lightning, @card("Trusted Advisor") def trusted_advisor(card, abilities): def trusted_advisor(): return AbilityNotImplemented def trusted_advisor(): return AbilityNotImplemented return trusted_advisor, trusted_advisor, @card("Deathmask Nezumi") def deathmask_nezumi(card, abilities): def deathmask_nezumi(): return AbilityNotImplemented return deathmask_nezumi, @card("Path of Anger's Flame") def path_of_angers_flame(card, abilities): def path_of_angers_flame(): return AbilityNotImplemented return path_of_angers_flame, @card("Rushing-Tide Zubera") def rushingtide_zubera(card, abilities): def rushingtide_zubera(): return AbilityNotImplemented return rushingtide_zubera, @card("Descendant of Masumaro") def descendant_of_masumaro(card, abilities): def descendant_of_masumaro(): return AbilityNotImplemented return descendant_of_masumaro, @card("Kitsune Bonesetter") def kitsune_bonesetter(card, abilities): def kitsune_bonesetter(): return AbilityNotImplemented return kitsune_bonesetter, @card("Ashes of the Fallen") def ashes_of_the_fallen(card, abilities): def ashes_of_the_fallen(): return AbilityNotImplemented def ashes_of_the_fallen(): return AbilityNotImplemented return ashes_of_the_fallen, ashes_of_the_fallen, @card("Ghost-Lit Nourisher") def ghostlit_nourisher(card, abilities): def ghostlit_nourisher(): return AbilityNotImplemented def ghostlit_nourisher(): return AbilityNotImplemented return ghostlit_nourisher, ghostlit_nourisher, @card("Eiganjo Free-Riders") def eiganjo_freeriders(card, abilities): def eiganjo_freeriders(): return AbilityNotImplemented def eiganjo_freeriders(): return AbilityNotImplemented return eiganjo_freeriders, eiganjo_freeriders, @card("Kiyomaro, First to Stand") def kiyomaro_first_to_stand(card, abilities): def kiyomaro_first_to_stand(): return AbilityNotImplemented def kiyomaro_first_to_stand(): return AbilityNotImplemented def kiyomaro_first_to_stand(): return AbilityNotImplemented return kiyomaro_first_to_stand, kiyomaro_first_to_stand, kiyomaro_first_to_stand, @card("Evermind") def evermind(card, abilities): def evermind(): return AbilityNotImplemented def evermind(): return AbilityNotImplemented def evermind(): return AbilityNotImplemented def evermind(): return AbilityNotImplemented return evermind, evermind, evermind, evermind, @card("Bounteous Kirin") def bounteous_kirin(card, abilities): def bounteous_kirin(): return AbilityNotImplemented def bounteous_kirin(): return AbilityNotImplemented return bounteous_kirin, bounteous_kirin, @card("Enduring Ideal") def enduring_ideal(card, abilities): def enduring_ideal(): return AbilityNotImplemented def enduring_ideal(): return AbilityNotImplemented return enduring_ideal, enduring_ideal, @card("Ivory Crane Netsuke") def ivory_crane_netsuke(card, abilities): def ivory_crane_netsuke(): return AbilityNotImplemented return ivory_crane_netsuke, @card("Blood Clock") def blood_clock(card, abilities): def blood_clock(): return AbilityNotImplemented return blood_clock, @card("Infernal Kirin") def infernal_kirin(card, abilities): def infernal_kirin(): return AbilityNotImplemented def infernal_kirin(): return AbilityNotImplemented return infernal_kirin, infernal_kirin, @card("Michiko Konda, Truth Seeker") def michiko_konda_truth_seeker(card, abilities): def michiko_konda_truth_seeker(): return AbilityNotImplemented return michiko_konda_truth_seeker, @card("Manriki-Gusari") def manrikigusari(card, abilities): def manrikigusari(): return AbilityNotImplemented def manrikigusari(): return AbilityNotImplemented return manrikigusari, manrikigusari, @card("Masumaro, First to Live") def masumaro_first_to_live(card, abilities): def masumaro_first_to_live(): return AbilityNotImplemented return masumaro_first_to_live, @card("Cowed by Wisdom") def cowed_by_wisdom(card, abilities): def cowed_by_wisdom(): return AbilityNotImplemented def cowed_by_wisdom(): return AbilityNotImplemented return cowed_by_wisdom, cowed_by_wisdom, @card("Choice of Damnations") def choice_of_damnations(card, abilities): def choice_of_damnations(): return AbilityNotImplemented return choice_of_damnations, @card("Skull Collector") def skull_collector(card, abilities): def skull_collector(): return AbilityNotImplemented def skull_collector(): return AbilityNotImplemented return skull_collector, skull_collector, @card("Meishin, the Mind Cage") def meishin_the_mind_cage(card, abilities): def meishin_the_mind_cage(): return AbilityNotImplemented return meishin_the_mind_cage, @card("Shinen of Stars' Light") def shinen_of_stars_light(card, abilities): def shinen_of_stars_light(): return AbilityNotImplemented def shinen_of_stars_light(): return AbilityNotImplemented return shinen_of_stars_light, shinen_of_stars_light, @card("Hand of Honor") def hand_of_honor(card, abilities): def hand_of_honor(): return AbilityNotImplemented def hand_of_honor(): return AbilityNotImplemented return hand_of_honor, hand_of_honor, @card("Pure Intentions") def pure_intentions(card, abilities): def pure_intentions(): return AbilityNotImplemented def pure_intentions(): return AbilityNotImplemented return pure_intentions, pure_intentions, @card("Murmurs from Beyond") def murmurs_from_beyond(card, abilities): def murmurs_from_beyond(): return AbilityNotImplemented return murmurs_from_beyond, @card("Hail of Arrows") def hail_of_arrows(card, abilities): def hail_of_arrows(): return AbilityNotImplemented return hail_of_arrows, @card("Seek the Horizon") def seek_the_horizon(card, abilities): def seek_the_horizon(): return AbilityNotImplemented return seek_the_horizon, @card("Gaze of Adamaro") def gaze_of_adamaro(card, abilities): def gaze_of_adamaro(): return AbilityNotImplemented return gaze_of_adamaro, @card("Reki, the History of Kamigawa") def reki_the_history_of_kamigawa(card, abilities): def reki_the_history_of_kamigawa(): return AbilityNotImplemented return reki_the_history_of_kamigawa, @card("Kuon's Essence") def kuons_essence(card, abilities): def kuons_essence(): return AbilityNotImplemented def kuons_essence(): return AbilityNotImplemented return kuons_essence, kuons_essence, @card("Charge Across the Araba") def charge_across_the_araba(card, abilities): def charge_across_the_araba(): return AbilityNotImplemented return charge_across_the_araba, @card("Death Denied") def death_denied(card, abilities): def death_denied(): return AbilityNotImplemented return death_denied, @card("Ghost-Lit Raider") def ghostlit_raider(card, abilities): def ghostlit_raider(): return AbilityNotImplemented def ghostlit_raider(): return AbilityNotImplemented return ghostlit_raider, ghostlit_raider, @card("Thoughts of Ruin") def thoughts_of_ruin(card, abilities): def thoughts_of_ruin(): return AbilityNotImplemented return thoughts_of_ruin, @card("Kataki, War's Wage") def kataki_wars_wage(card, abilities): def kataki_wars_wage(): return AbilityNotImplemented return kataki_wars_wage, @card("O-Naginata") def onaginata(card, abilities): def onaginata(): return AbilityNotImplemented def onaginata(): return AbilityNotImplemented def onaginata(): return AbilityNotImplemented return onaginata, onaginata, onaginata, @card("Briarknit Kami") def briarknit_kami(card, abilities): def briarknit_kami(): return AbilityNotImplemented return briarknit_kami, @card("Glitterfang") def glitterfang(card, abilities): def glitterfang(): return AbilityNotImplemented def glitterfang(): return AbilityNotImplemented return glitterfang, glitterfang, @card("Reverence") def reverence(card, abilities): def reverence(): return AbilityNotImplemented return reverence, @card("Plow Through Reito") def plow_through_reito(card, abilities): def plow_through_reito(): return AbilityNotImplemented return plow_through_reito, @card("Undying Flames") def undying_flames(card, abilities): def undying_flames(): return AbilityNotImplemented def undying_flames(): return AbilityNotImplemented return undying_flames, undying_flames, @card("Sunder from Within") def sunder_from_within(card, abilities): def sunder_from_within(): return AbilityNotImplemented return sunder_from_within, @card("Barrel Down Sokenzan") def barrel_down_sokenzan(card, abilities): def barrel_down_sokenzan(): return AbilityNotImplemented return barrel_down_sokenzan, @card("Shape Stealer") def shape_stealer(card, abilities): def shape_stealer(): return AbilityNotImplemented return shape_stealer, @card("Razorjaw Oni") def razorjaw_oni(card, abilities): def razorjaw_oni(): return AbilityNotImplemented return razorjaw_oni, @card("Sink into Takenuma") def sink_into_takenuma(card, abilities): def sink_into_takenuma(): return AbilityNotImplemented return sink_into_takenuma, @card("Ghost-Lit Redeemer") def ghostlit_redeemer(card, abilities): def ghostlit_redeemer(): return AbilityNotImplemented def ghostlit_redeemer(): return AbilityNotImplemented return ghostlit_redeemer, ghostlit_redeemer, @card("Inner Fire") def inner_fire(card, abilities): def inner_fire(): return AbilityNotImplemented return inner_fire, @card("Moonwing Moth") def moonwing_moth(card, abilities): def moonwing_moth(): return AbilityNotImplemented def moonwing_moth(): return AbilityNotImplemented return moonwing_moth, moonwing_moth, @card("Kiku's Shadow") def kikus_shadow(card, abilities): def kikus_shadow(): return AbilityNotImplemented return kikus_shadow, @card("Locust Miser") def locust_miser(card, abilities): def locust_miser(): return AbilityNotImplemented return locust_miser, @card("Sakura-Tribe Scout") def sakuratribe_scout(card, abilities): def sakuratribe_scout(): return AbilityNotImplemented return sakuratribe_scout, @card("Rending Vines") def rending_vines(card, abilities): def rending_vines(): return AbilityNotImplemented def rending_vines(): return AbilityNotImplemented return rending_vines, rending_vines, @card("Stampeding Serow") def stampeding_serow(card, abilities): def stampeding_serow(): return AbilityNotImplemented def stampeding_serow(): return AbilityNotImplemented return stampeding_serow, stampeding_serow, @card("Skyfire Kirin") def skyfire_kirin(card, abilities): def skyfire_kirin(): return AbilityNotImplemented def skyfire_kirin(): return AbilityNotImplemented return skyfire_kirin, skyfire_kirin, @card("Cloudhoof Kirin") def cloudhoof_kirin(card, abilities): def cloudhoof_kirin(): return AbilityNotImplemented def cloudhoof_kirin(): return AbilityNotImplemented return cloudhoof_kirin, cloudhoof_kirin, @card("Spiritual Visit") def spiritual_visit(card, abilities): def spiritual_visit(): return AbilityNotImplemented def spiritual_visit(): return AbilityNotImplemented return spiritual_visit, spiritual_visit, @card("Into the Fray") def into_the_fray(card, abilities): def into_the_fray(): return AbilityNotImplemented def into_the_fray(): return AbilityNotImplemented return into_the_fray, into_the_fray, @card("Ghost-Lit Stalker") def ghostlit_stalker(card, abilities): def ghostlit_stalker(): return AbilityNotImplemented def ghostlit_stalker(): return AbilityNotImplemented return ghostlit_stalker, ghostlit_stalker, @card("Ronin Cavekeeper") def ronin_cavekeeper(card, abilities): def ronin_cavekeeper(): return AbilityNotImplemented return ronin_cavekeeper, @card("Araba Mothrider") def araba_mothrider(card, abilities): def araba_mothrider(): return AbilityNotImplemented def araba_mothrider(): return AbilityNotImplemented return araba_mothrider, araba_mothrider, @card("Okina Nightwatch") def okina_nightwatch(card, abilities): def okina_nightwatch(): return AbilityNotImplemented return okina_nightwatch, @card("Ayumi, the Last Visitor") def ayumi_the_last_visitor(card, abilities): def ayumi_the_last_visitor(): return AbilityNotImplemented return ayumi_the_last_visitor, @card("Haru-Onna") def haruonna(card, abilities): def haruonna(): return AbilityNotImplemented def haruonna(): return AbilityNotImplemented return haruonna, haruonna, @card("Molting Skin") def molting_skin(card, abilities): def molting_skin(): return AbilityNotImplemented return molting_skin, @card("Freed from the Real") def freed_from_the_real(card, abilities): def freed_from_the_real(): return AbilityNotImplemented def freed_from_the_real(): return AbilityNotImplemented def freed_from_the_real(): return AbilityNotImplemented return freed_from_the_real, freed_from_the_real, freed_from_the_real, @card("Inner Calm, Outer Strength") def inner_calm_outer_strength(card, abilities): def inner_calm_outer_strength(): return AbilityNotImplemented return inner_calm_outer_strength, @card("Raving Oni-Slave") def raving_onislave(card, abilities): def raving_onislave(): return AbilityNotImplemented return raving_onislave, @card("Seed the Land") def seed_the_land(card, abilities): def seed_the_land(): return AbilityNotImplemented return seed_the_land, @card("Descendant of Soramaro") def descendant_of_soramaro(card, abilities): def descendant_of_soramaro(): return AbilityNotImplemented return descendant_of_soramaro, @card("Maga, Traitor to Mortals") def maga_traitor_to_mortals(card, abilities): def maga_traitor_to_mortals(): return AbilityNotImplemented def maga_traitor_to_mortals(): return AbilityNotImplemented return maga_traitor_to_mortals, maga_traitor_to_mortals, @card("Kiri-Onna") def kirionna(card, abilities): def kirionna(): return AbilityNotImplemented def kirionna(): return AbilityNotImplemented return kirionna, kirionna, @card("Iizuka the Ruthless") def iizuka_the_ruthless(card, abilities): def iizuka_the_ruthless(): return AbilityNotImplemented def iizuka_the_ruthless(): return AbilityNotImplemented return iizuka_the_ruthless, iizuka_the_ruthless, @card("Yuki-Onna") def yukionna(card, abilities): def yukionna(): return AbilityNotImplemented def yukionna(): return AbilityNotImplemented return yukionna, yukionna, @card("Death of a Thousand Stings") def death_of_a_thousand_stings(card, abilities): def death_of_a_thousand_stings(): return AbilityNotImplemented def death_of_a_thousand_stings(): return AbilityNotImplemented return death_of_a_thousand_stings, death_of_a_thousand_stings, @card("Pain's Reward") def pains_reward(card, abilities): def pains_reward(): return AbilityNotImplemented return pains_reward, @card("Scroll of Origins") def scroll_of_origins(card, abilities): def scroll_of_origins(): return AbilityNotImplemented return scroll_of_origins, @card("Jiwari, the Earth Aflame") def jiwari_the_earth_aflame(card, abilities): def jiwari_the_earth_aflame(): return AbilityNotImplemented def jiwari_the_earth_aflame(): return AbilityNotImplemented return jiwari_the_earth_aflame, jiwari_the_earth_aflame, @card("Oboro Breezecaller") def oboro_breezecaller(card, abilities): def oboro_breezecaller(): return AbilityNotImplemented def oboro_breezecaller(): return AbilityNotImplemented return oboro_breezecaller, oboro_breezecaller, @card("Sasaya's Essence") def sasayas_essence(card, abilities): def sasayas_essence(): return AbilityNotImplemented def sasayas_essence(): return AbilityNotImplemented return sasayas_essence, sasayas_essence, @card("Tomb of Urami") def tomb_of_urami(card, abilities): def tomb_of_urami(): return AbilityNotImplemented def tomb_of_urami(): return AbilityNotImplemented return tomb_of_urami, tomb_of_urami, @card("Shinen of Flight's Wings") def shinen_of_flights_wings(card, abilities): def shinen_of_flights_wings(): return AbilityNotImplemented def shinen_of_flights_wings(): return AbilityNotImplemented return shinen_of_flights_wings, shinen_of_flights_wings, @card("Torii Watchward") def torii_watchward(card, abilities): def torii_watchward(): return AbilityNotImplemented def torii_watchward(): return AbilityNotImplemented return torii_watchward, torii_watchward, @card("Akki Drillmaster") def akki_drillmaster(card, abilities): def akki_drillmaster(): return AbilityNotImplemented return akki_drillmaster, @card("Secretkeeper") def secretkeeper(card, abilities): def secretkeeper(): return AbilityNotImplemented return secretkeeper, @card("Ebony Owl Netsuke") def ebony_owl_netsuke(card, abilities): def ebony_owl_netsuke(): return AbilityNotImplemented return ebony_owl_netsuke, @card("Moonbow Illusionist") def moonbow_illusionist(card, abilities): def moonbow_illusionist(): return AbilityNotImplemented def moonbow_illusionist(): return AbilityNotImplemented return moonbow_illusionist, moonbow_illusionist, @card("Kuro's Taken") def kuros_taken(card, abilities): def kuros_taken(): return AbilityNotImplemented def kuros_taken(): return AbilityNotImplemented return kuros_taken, kuros_taken, @card("Burning-Eye Zubera") def burningeye_zubera(card, abilities): def burningeye_zubera(): return AbilityNotImplemented return burningeye_zubera, @card("AEther Shockwave") def aether_shockwave(card, abilities): def aether_shockwave(): return AbilityNotImplemented return aether_shockwave, @card("Exile into Darkness") def exile_into_darkness(card, abilities): def exile_into_darkness(): return AbilityNotImplemented def exile_into_darkness(): return AbilityNotImplemented return exile_into_darkness, exile_into_darkness, @card("Wine of Blood and Iron") def wine_of_blood_and_iron(card, abilities): def wine_of_blood_and_iron(): return AbilityNotImplemented return wine_of_blood_and_iron, @card("Matsu-Tribe Birdstalker") def matsutribe_birdstalker(card, abilities): def matsutribe_birdstalker(): return AbilityNotImplemented def matsutribe_birdstalker(): return AbilityNotImplemented return matsutribe_birdstalker, matsutribe_birdstalker, @card("Shinen of Fury's Fire") def shinen_of_furys_fire(card, abilities): def shinen_of_furys_fire(): return AbilityNotImplemented def shinen_of_furys_fire(): return AbilityNotImplemented return shinen_of_furys_fire, shinen_of_furys_fire, @card("Miren, the Moaning Well") def miren_the_moaning_well(card, abilities): def miren_the_moaning_well(): return AbilityNotImplemented def miren_the_moaning_well(): return AbilityNotImplemented return miren_the_moaning_well, miren_the_moaning_well, @card("Erayo, Soratami Ascendant") def erayo_soratami_ascendant(card, abilities): def erayo_soratami_ascendant(): return AbilityNotImplemented def erayo_soratami_ascendant(): return AbilityNotImplemented def erayo_soratami_ascendant(): return AbilityNotImplemented return erayo_soratami_ascendant, erayo_soratami_ascendant, erayo_soratami_ascendant, @card("Mikokoro, Center of the Sea") def mikokoro_center_of_the_sea(card, abilities): def mikokoro_center_of_the_sea(): return AbilityNotImplemented def mikokoro_center_of_the_sea(): return AbilityNotImplemented return mikokoro_center_of_the_sea, mikokoro_center_of_the_sea,
20.332972
88
0.73431
4,067
37,555
6.493484
0.094173
0.280132
0.102995
0.006059
0.436404
0.205385
0.126472
0.075732
0.049264
0.049264
0
0
0.193689
37,555
1,847
89
20.332972
0.872131
0
0
0.443086
0
0
0.078603
0
0
0
0
0
0
1
0.417686
false
0
0.002822
0.257761
0.838194
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
1
0
0
0
1
1
0
0
4
91ca5a43e86875409a8c8d7ee26ca2d84b2cf503
118
py
Python
drf_messages/__init__.py
SaadBazaz/drf-messages
5c0d6fb13f7a845814556b4c251c7f1469396273
[ "BSD-3-Clause" ]
null
null
null
drf_messages/__init__.py
SaadBazaz/drf-messages
5c0d6fb13f7a845814556b4c251c7f1469396273
[ "BSD-3-Clause" ]
null
null
null
drf_messages/__init__.py
SaadBazaz/drf-messages
5c0d6fb13f7a845814556b4c251c7f1469396273
[ "BSD-3-Clause" ]
null
null
null
import logging logger = logging.getLogger("drf_messages") default_app_config = "drf_messages.apps.DrfMessagesConfig"
23.6
58
0.830508
14
118
6.714286
0.785714
0.234043
0
0
0
0
0
0
0
0
0
0
0.076271
118
4
59
29.5
0.862385
0
0
0
0
0
0.398305
0.29661
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
91d0a8a21d04086687250b9f6e83c840924c3703
154
py
Python
goodgames/friends/apps.py
mooshu1x2/goodgames
346c996cf6b561fbcb36a8e6b4616fa0c16104db
[ "Apache-2.0" ]
null
null
null
goodgames/friends/apps.py
mooshu1x2/goodgames
346c996cf6b561fbcb36a8e6b4616fa0c16104db
[ "Apache-2.0" ]
6
2020-02-12T00:20:09.000Z
2021-06-10T19:59:04.000Z
goodgames/friends/apps.py
michellebeard/goodgames
346c996cf6b561fbcb36a8e6b4616fa0c16104db
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class FriendsConfig(AppConfig): name = 'friends'
17.111111
39
0.733766
18
154
6
0.833333
0
0
0
0
0
0
0
0
0
0
0.007752
0.162338
154
8
40
19.25
0.829457
0.136364
0
0
0
0
0.053435
0
0
0
0
0
0
1
0
false
0
0.5
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
53255f8f8ca86a94bc275c3b5d332be24441e55e
32
py
Python
io_scene_xray/anm/fmt.py
vika-sonne/blender-xray
a9b9b9e3c83500e5431ec9e692ed57aff63ea43c
[ "BSD-2-Clause" ]
1
2021-02-14T11:52:25.000Z
2021-02-14T11:52:25.000Z
io_scene_xray/anm/fmt.py
vika-sonne/blender-xray
a9b9b9e3c83500e5431ec9e692ed57aff63ea43c
[ "BSD-2-Clause" ]
null
null
null
io_scene_xray/anm/fmt.py
vika-sonne/blender-xray
a9b9b9e3c83500e5431ec9e692ed57aff63ea43c
[ "BSD-2-Clause" ]
1
2021-06-30T15:52:46.000Z
2021-06-30T15:52:46.000Z
class Chunks: MAIN = 0x1100
10.666667
17
0.65625
4
32
5.25
1
0
0
0
0
0
0
0
0
0
0
0.217391
0.28125
32
2
18
16
0.695652
0
0
0
0
0
0
0
0
0
0.1875
0
0
1
0
false
0
0
0
1
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
53449a56489895838191639e5356a659765cf4c0
166
py
Python
python/Alura/data science/numpy/operacoes_arrays.py
alifoliveira/rep-estudos
73ffb7cfe77890f6cca8b5447db332f88454ef7e
[ "MIT" ]
null
null
null
python/Alura/data science/numpy/operacoes_arrays.py
alifoliveira/rep-estudos
73ffb7cfe77890f6cca8b5447db332f88454ef7e
[ "MIT" ]
null
null
null
python/Alura/data science/numpy/operacoes_arrays.py
alifoliveira/rep-estudos
73ffb7cfe77890f6cca8b5447db332f88454ef7e
[ "MIT" ]
null
null
null
import numpy as np km2 = np.array([44410., 5712., 37123., 0., 25757.]) anos2 = np.array([2003, 1991, 1990, 2019, 2006]) idade = 2019 - anos2 km_media = km2 / idade
20.75
51
0.644578
27
166
3.925926
0.740741
0.132075
0
0
0
0
0
0
0
0
0
0.352941
0.180723
166
7
52
23.714286
0.426471
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
1
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
535577c44b512d6f563845194dedef3cf5444817
185
py
Python
examples/basic/basic/urls.py
maxmzd/django-eventstream
20c5bf68263505f3a4ae4abdc5df71e9790b992c
[ "MIT" ]
null
null
null
examples/basic/basic/urls.py
maxmzd/django-eventstream
20c5bf68263505f3a4ae4abdc5df71e9790b992c
[ "MIT" ]
null
null
null
examples/basic/basic/urls.py
maxmzd/django-eventstream
20c5bf68263505f3a4ae4abdc5df71e9790b992c
[ "MIT" ]
null
null
null
from django.conf.urls import include, url import django_eventstream from . import views urlpatterns = [ url(r'^$', views.home), url(r'^events/', include(django_eventstream.urls)), ]
20.555556
52
0.735135
25
185
5.36
0.52
0.253731
0
0
0
0
0
0
0
0
0
0
0.118919
185
8
53
23.125
0.822086
0
0
0
0
0
0.054054
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
72702c5001f2a0083f7b408b465d7b66ed5f2055
9,880
py
Python
py/model.py
katiehuang1221/onl_ds5_project_2
dc9243d6bdc0c1952a761b2ed3e91a8548202b42
[ "MIT" ]
null
null
null
py/model.py
katiehuang1221/onl_ds5_project_2
dc9243d6bdc0c1952a761b2ed3e91a8548202b42
[ "MIT" ]
1
2021-01-20T02:34:07.000Z
2021-01-20T02:34:07.000Z
py/model.py
katiehuang1221/onl_ds5_project_2
dc9243d6bdc0c1952a761b2ed3e91a8548202b42
[ "MIT" ]
null
null
null
import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns sns.set() from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.linear_model import LinearRegression from sklearn.preprocessing import StandardScaler, PolynomialFeatures, OneHotEncoder from sklearn.pipeline import Pipeline from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression, Lasso, LassoCV, Ridge, RidgeCV from sklearn.metrics import r2_score, mean_squared_error """ 1. get_Xy(df): Separate features and target variable 2. get_score(X_train,X_val,y_train,y_val) 3. categorical(X_train,X_val,X_test,cat_variable) """ def get_Xy(df): df = df.dropna() target = 'opening_weekend_usa' all_column = df.columns.values.tolist() all_column.remove(target) y = df[target] X = df[all_column] return X, y def get_score(X_train,X_val,y_train,y_val): # fit linear regression to training data lr_model = LinearRegression() lr_model.fit(X_train, y_train) y_pred = lr_model.predict(X_val) # score fit model on validation data train_score = lr_model.score(X_train, y_train) val_score = lr_model.score(X_val, y_val) rmse = np.sqrt(mean_squared_error(y_val, y_pred)) # report results print('\nTrain R^2 score was:', train_score) print('Validation R^2 score was:', val_score) print(f'RMSE: {rmse:.2f} \n') # print('Feature coefficient results:') # for feature, coef in zip(X.columns, lr_model.coef_): # print(feature, ':', f'{coef:.2f}') # Visualization fig, ax = plt.subplots(1, 1) plt.scatter(y_val, y_pred, alpha=0.4) ax.set_xlabel('Opening weekend revenue ($ in millions)',fontsize=20) ax.set_ylabel('Prediction ($ in millions)',fontsize=20) ax.set_title('R$^2$: %0.2f' % val_score, fontsize=20) plt.xticks(fontsize=16) plt.yticks(fontsize=16) x=np.linspace(0,0.7e2,50) # x=np.linspace(4,9,50) y=x plt.plot(x,y,color='firebrick',linewidth=3,alpha=0.6) plt.ylim(0,) plt.xlim(0,) return fig, lr_model, y_pred def categorical_multilabel(X_train,X_val,X_test,cat_variable): """ Input: X_train,X_val,X_test,categorical_variable Processing: preprocessing the three sets separately: 1. Separate continuous and categorical variable 2. Scaling + polynomial fit the conitnuous variables and get_dummies on the categorical variable 3. Combine back the continuous and categorical data Return: tranformed X_train, X_val, X_test """ scaler = StandardScaler() poly = PolynomialFeatures(degree=2,interaction_only = False) # Train set # Convert genre to dummies X_train_genre = X_train[cat_variable].str.join(sep='*').str.get_dummies(sep='*') known_columns = X_train_genre.columns # Scaling continuous variables X_train_con = X_train[con_feature] X_train_con_scaled = scaler.fit_transform(X_train_con) X_train_con_scaled_df = pd.DataFrame(X_train_con_scaled, columns=X_train_con.columns, index=X_train_con.index) X_train_poly = poly.fit_transform(X_train_con_scaled) X_train_poly_df = pd.DataFrame(X_train_poly, columns=poly.get_feature_names(X_train_con.columns), index=X_train_con.index) #Combine # X_train = pd.concat([X_train_genre,X_train_con_scaled_df],axis=1) X_train = pd.concat([X_train_genre,X_train_poly_df],axis=1) # Val set # Convert genre to dummies X_val_genre = X_val[cat_variable].str.join(sep='*').str.get_dummies(sep='*') val_columns = X_val_genre.columns X_val_genre = X_val_genre[[x for x in val_columns if x in known_columns]] fill_dict = { c : 0 for c in [x for x in known_columns if x not in val_columns] } X_val_genre = X_val_genre.assign(**fill_dict) # Scaling continuous variables X_val_con = X_val[con_feature] X_val_con_scaled = scaler.transform(X_val_con) X_val_con_scaled_df = pd.DataFrame(X_val_con_scaled, columns=X_val_con.columns, index=X_val_con.index) X_val_poly = poly.transform(X_val_con_scaled) X_val_poly_df = pd.DataFrame(X_val_poly, columns=poly.get_feature_names(X_val_con.columns), index=X_val_con.index) #Combine # X_val = pd.concat([X_val_genre,X_val_con_scaled_df],axis=1) X_val = pd.concat([X_val_genre,X_val_poly_df],axis=1) # Test set # Convert genre to dummies X_test_genre = X_test[cat_variable].str.join(sep='*').str.get_dummies(sep='*') test_columns = X_test.columns X_test_genre = X_test_genre[[x for x in test_columns if x in known_columns]] fill_dict = { c : 0 for c in [x for x in known_columns if x not in test_columns] } X_test_genre = X_test_genre.assign(**fill_dict) # Scaling continuous variables X_test_con = X_test[con_feature] X_test_con_scaled = scaler.transform(X_test_con) X_test_con_scaled_df = pd.DataFrame(X_test_con_scaled, columns=X_test_con.columns, index=X_test_con.index) X_test_poly = poly.transform(X_test_con_scaled) X_test_poly_df = pd.DataFrame(X_test_poly, columns=poly.get_feature_names(X_test_con.columns), index=X_test_con.index) #Combine # X_test = pd.concat([X_test_genre,X_test_con_scaled_df],axis=1) X_test = pd.concat([X_test_genre,X_test_poly_df],axis=1) return X_train,X_val,X_test def categorical_singlelabel(X_train,X_val,X_test,cat_variable): """ Input: X_train,X_val,X_test,categorical_variable Processing: preprocessing the three sets separately: 1. Separate continuous and categorical variable 2. Scaling + polynomial fit the conitnuous variables and get_dummies on the categorical variable 3. Combine back the continuous and categorical data Return: tranformed X_train, X_val, X_test """ scaler = StandardScaler() poly = PolynomialFeatures(degree=2,interaction_only = False) # Train set # Convert genre to dummies X_train_genre = pd.get_dummies(X_train[cat_variable]) known_columns = X_train_genre.columns # Scaling continuous variables X_train_con = X_train[con_feature] X_train_con_scaled = scaler.fit_transform(X_train_con) X_train_con_scaled_df = pd.DataFrame(X_train_con_scaled, columns=X_train_con.columns, index=X_train_con.index) X_train_poly = poly.fit_transform(X_train_con_scaled) X_train_poly_df = pd.DataFrame(X_train_poly, columns=poly.get_feature_names(X_train_con.columns), index=X_train_con.index) #Combine X_train = pd.concat([X_train_genre,X_train_con_scaled_df],axis=1) # X_train = pd.concat([X_train_genre,X_train_poly_df],axis=1) # Val set # Convert genre to dummies X_val_genre = pd.get_dummies(X_val[cat_variable]) val_columns = X_val_genre.columns X_val_genre = X_val_genre[[x for x in val_columns if x in known_columns]] fill_dict = { c : 0 for c in [x for x in known_columns if x not in val_columns] } X_val_genre = X_val_genre.assign(**fill_dict) # Scaling continuous variables X_val_con = X_val[con_feature] X_val_con_scaled = scaler.transform(X_val_con) X_val_con_scaled_df = pd.DataFrame(X_val_con_scaled, columns=X_val_con.columns, index=X_val_con.index) X_val_poly = poly.transform(X_val_con_scaled) X_val_poly_df = pd.DataFrame(X_val_poly, columns=poly.get_feature_names(X_val_con.columns), index=X_val_con.index) #Combine X_val = pd.concat([X_val_genre,X_val_con_scaled_df],axis=1) # X_val = pd.concat([X_val_genre,X_val_poly_df],axis=1) # Test set # Convert genre to dummies X_test_genre = pd.get_dummies(X_test[cat_variable]) test_columns = X_test.columns X_test_genre = X_test_genre[[x for x in test_columns if x in known_columns]] fill_dict = { c : 0 for c in [x for x in known_columns if x not in test_columns] } X_test_genre = X_test_genre.assign(**fill_dict) # Scaling continuous variables X_test_con = X_test[con_feature] X_test_con_scaled = scaler.transform(X_test_con) X_test_con_scaled_df = pd.DataFrame(X_test_con_scaled, columns=X_test_con.columns, index=X_test_con.index) X_test_poly = poly.transform(X_test_con_scaled) X_test_poly_df = pd.DataFrame(X_test_poly, columns=poly.get_feature_names(X_test_con.columns), index=X_test_con.index) #Combine X_test = pd.concat([X_test_genre,X_test_con_scaled_df],axis=1) # X_test = pd.concat([X_test_genre,X_test_poly_df],axis=1) return X_train,X_val,X_test def opt_cat_number(df, cat_variable): """ Decide how many categories to keep for the categorical variable. """ score = [] for i in range(0,100,1): df[cat_variable].value_counts() top = df[cat_variable].value_counts().index.tolist()[:i] discard = list(set(df[cat_variable].unique()).difference(set(top))) # The rest will go to "Other" df['new_cat_variable'] = df[cat_variable].replace(discard,'Other') # Get the data from all_df with both continuous and selected categorical variable X, y = get_Xy(df) # train_test_split X_, X_test, y_, y_test = train_test_split(X, y, test_size=.2, random_state=42) X_train, X_val, y_train, y_val = train_test_split(X_, y_, test_size=.25, random_state=3) X_train,X_val,X_test = categorical_singlelabel(X_train,X_val,X_test,'new_cat_variable') lr_model = LinearRegression() lr_model.fit(X_train, y_train) y_pred = lr_model.predict(X_val) val_score = lr_model.score(X_val, y_val) score.append(round(val_score,3)) best_score = max(score) num = score.index(best_score) print('Optimal number of categories to keep is', num) print('Best score is', best_score) return num, best_score
34.911661
126
0.722672
1,624
9,880
4.052956
0.125616
0.043756
0.032817
0.02127
0.753266
0.731996
0.712701
0.70313
0.687177
0.661805
0
0.009373
0.179352
9,880
283
127
34.911661
0.802417
0.194636
0
0.481203
0
0
0.03464
0
0
0
0
0
0
1
0.037594
false
0
0.090226
0
0.165414
0.037594
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
727e72d54342b8ee2ba41b8b128dbb98a4df8dd5
423
py
Python
tests/test_rotateWord.py
clara0/learn-python
ab6d6f3503314ae01442a777c453a383aafdd190
[ "Apache-2.0" ]
null
null
null
tests/test_rotateWord.py
clara0/learn-python
ab6d6f3503314ae01442a777c453a383aafdd190
[ "Apache-2.0" ]
6
2020-08-08T16:58:01.000Z
2020-09-03T02:01:45.000Z
tests/test_rotateWord.py
clara0/learn-python
ab6d6f3503314ae01442a777c453a383aafdd190
[ "Apache-2.0" ]
1
2020-07-24T20:29:41.000Z
2020-07-24T20:29:41.000Z
import unittest import rotate_word class TestRotateWord(unittest.TestCase): def test_rotateWord(self): self.assertEqual(rotate_word.rotate('abc', 1), 'bcd') self.assertEqual(rotate_word.rotate('abcz', 2), 'cdeb') self.assertEqual(rotate_word.rotate('abc', 27), 'bcd') self.assertEqual(rotate_word.rotate('abc', -1), 'zab') self.assertEqual(rotate_word.rotate('ABC', 1), 'bcd')
35.25
63
0.676123
53
423
5.264151
0.377358
0.215054
0.376344
0.448029
0.641577
0.641577
0.397849
0.272401
0
0
0
0.016949
0.163121
423
11
64
38.454545
0.771186
0
0
0
0
0
0.07565
0
0
0
0
0
0.555556
1
0.111111
false
0
0.222222
0
0.444444
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4
72bf407a81e5ab6406aa86e7591b75d126b48e37
55
py
Python
papertalk/wsgi.py
karissa/papertalk
79d77383b1a6fb41e9fef8b9c4f619df97cc8a7c
[ "MIT" ]
null
null
null
papertalk/wsgi.py
karissa/papertalk
79d77383b1a6fb41e9fef8b9c4f619df97cc8a7c
[ "MIT" ]
2
2016-02-04T23:59:58.000Z
2016-02-04T23:59:58.000Z
papertalk/wsgi.py
karissa/papertalk
79d77383b1a6fb41e9fef8b9c4f619df97cc8a7c
[ "MIT" ]
null
null
null
from papertalk.server import make_app app = make_app()
18.333333
37
0.8
9
55
4.666667
0.666667
0.333333
0
0
0
0
0
0
0
0
0
0
0.127273
55
2
38
27.5
0.875
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
72d6dc7e6b5cdb80c359623ffb44a937de65c734
7,241
py
Python
flask_dance/consumer/requests.py
kerryhatcher/flask-dance
db7ace28e92bb21cf59c79c284d3f30d615c8ec0
[ "MIT" ]
836
2015-01-11T23:01:58.000Z
2022-03-28T07:32:52.000Z
flask_dance/consumer/requests.py
kerryhatcher/flask-dance
db7ace28e92bb21cf59c79c284d3f30d615c8ec0
[ "MIT" ]
353
2015-02-11T00:32:58.000Z
2022-03-28T14:45:38.000Z
flask_dance/consumer/requests.py
kerryhatcher/flask-dance
db7ace28e92bb21cf59c79c284d3f30d615c8ec0
[ "MIT" ]
189
2015-03-10T15:04:29.000Z
2022-03-16T21:49:11.000Z
from functools import wraps from flask import redirect, url_for from urlobject import URLObject from requests_oauthlib import OAuth1Session as BaseOAuth1Session from requests_oauthlib import OAuth2Session as BaseOAuth2Session from oauthlib.common import to_unicode from werkzeug.utils import cached_property from flask_dance.utils import invalidate_cached_property class OAuth1Session(BaseOAuth1Session): """ A :class:`requests.Session` subclass that can do some special things: * lazy-loads OAuth1 tokens from the storage via the blueprint * handles OAuth1 authentication (from :class:`requests_oauthlib.OAuth1Session` superclass) * has a ``base_url`` property used for relative URL resolution Note that this is a session between the consumer (your website) and the provider (e.g. Twitter), and *not* a session between a user of your website and your website. """ def __init__(self, blueprint=None, base_url=None, *args, **kwargs): super().__init__(*args, **kwargs) self.blueprint = blueprint self.base_url = URLObject(base_url) @cached_property def token(self): """ Get and set the values in the OAuth token, structured as a dictionary. """ return self.blueprint.token def load_token(self): t = self.token if t and "oauth_token" in t and "oauth_token_secret" in t: # This really, really violates the Law of Demeter, but # I don't see a better way to set these parameters. :( self.auth.client.resource_owner_key = to_unicode(t["oauth_token"]) self.auth.client.resource_owner_secret = to_unicode(t["oauth_token_secret"]) return True return False @property def authorized(self): """This is the property used when you have a statement in your code that reads "if <provider>.authorized:", e.g. "if twitter.authorized:". The way it works is kind of complicated: this function just tries to load the token, and then the 'super()' statement basically just tests if the token exists (see BaseOAuth1Session.authorized). To load the token, it calls the load_token() function within this class, which in turn checks the 'token' property of this class (another function), which in turn checks the 'token' property of the blueprint (see base.py), which calls 'storage.get()' to actually try to load the token from the cache/db (see the 'get()' function in storage/sqla.py). """ self.load_token() return super().authorized @property def authorization_required(self): """ .. versionadded:: 1.3.0 This is a decorator for a view function. If the current user does not have an OAuth token, then they will be redirected to the :meth:`~flask_dance.consumer.oauth1.OAuth1ConsumerBlueprint.login` view to obtain one. """ def wrapper(func): @wraps(func) def check_authorization(*args, **kwargs): if not self.authorized: endpoint = f"{self.blueprint.name}.login" return redirect(url_for(endpoint)) return func(*args, **kwargs) return check_authorization return wrapper def prepare_request(self, request): if self.base_url: request.url = self.base_url.relative(request.url) return super().prepare_request(request) def request( self, method, url, data=None, headers=None, should_load_token=True, **kwargs ): if should_load_token: self.load_token() return super().request( method=method, url=url, data=data, headers=headers, **kwargs ) class OAuth2Session(BaseOAuth2Session): """ A :class:`requests.Session` subclass that can do some special things: * lazy-loads OAuth2 tokens from the storage via the blueprint * handles OAuth2 authentication (from :class:`requests_oauthlib.OAuth2Session` superclass) * has a ``base_url`` property used for relative URL resolution Note that this is a session between the consumer (your website) and the provider (e.g. Twitter), and *not* a session between a user of your website and your website. """ def __init__(self, blueprint=None, base_url=None, *args, **kwargs): super().__init__(*args, **kwargs) self.blueprint = blueprint self.base_url = URLObject(base_url) invalidate_cached_property(self, "token") @cached_property def token(self): """ Get and set the values in the OAuth token, structured as a dictionary. """ return self.blueprint.token def load_token(self): self._client.token = self.token if self.token: self._client.populate_token_attributes(self.token) return True return False @property def access_token(self): """ Returns the ``access_token`` from the OAuth token. """ return self.token and self.token.get("access_token") @property def authorized(self): """This is the property used when you have a statement in your code that reads "if <provider>.authorized:", e.g. "if twitter.authorized:". The way it works is kind of complicated: this function just tries to load the token, and then the 'super()' statement basically just tests if the token exists (see BaseOAuth1Session.authorized). To load the token, it calls the load_token() function within this class, which in turn checks the 'token' property of this class (another function), which in turn checks the 'token' property of the blueprint (see base.py), which calls 'storage.get()' to actually try to load the token from the cache/db (see the 'get()' function in storage/sqla.py). """ self.load_token() return super().authorized @property def authorization_required(self): """ .. versionadded:: 1.3.0 This is a decorator for a view function. If the current user does not have an OAuth token, then they will be redirected to the :meth:`~flask_dance.consumer.oauth2.OAuth2ConsumerBlueprint.login` view to obtain one. """ def wrapper(func): @wraps(func) def check_authorization(*args, **kwargs): if not self.authorized: endpoint = f"{self.blueprint.name}.login" return redirect(url_for(endpoint)) return func(*args, **kwargs) return check_authorization return wrapper def request(self, method, url, data=None, headers=None, **kwargs): if self.base_url: url = self.base_url.relative(url) self.load_token() return super().request( method=method, url=url, data=data, headers=headers, client_id=self.blueprint.client_id, client_secret=self.blueprint.client_secret, **kwargs, )
36.024876
88
0.639967
911
7,241
4.989023
0.190999
0.018482
0.014521
0.018482
0.763916
0.716392
0.70473
0.70473
0.686249
0.668427
0
0.004964
0.276619
7,241
200
89
36.205
0.862734
0.421903
0
0.59375
0
0
0.034575
0.014473
0
0
0
0
0
1
0.1875
false
0
0.083333
0
0.5
0.104167
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
f4159c76e689c11110fa1a07c3472b6434617dd4
127
py
Python
ib/ext/cfg/CommissionReport.py
LewisW/IbPy
eb6ec62a3c578c650e6b98e56a9b6ed2c0a28f0f
[ "BSD-3-Clause" ]
1,260
2015-01-05T01:38:43.000Z
2022-03-28T14:08:02.000Z
ib/ext/cfg/CommissionReport.py
LewisW/IbPy
eb6ec62a3c578c650e6b98e56a9b6ed2c0a28f0f
[ "BSD-3-Clause" ]
46
2015-01-04T15:37:17.000Z
2019-10-24T09:53:40.000Z
ib/ext/cfg/CommissionReport.py
LewisW/IbPy
eb6ec62a3c578c650e6b98e56a9b6ed2c0a28f0f
[ "BSD-3-Clause" ]
521
2015-01-01T14:26:01.000Z
2022-03-26T16:22:36.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ib.ext.cfg.CommissionReport -> config module for CommissionReport.java. """
21.166667
75
0.661417
16
127
5.25
0.9375
0
0
0
0
0
0
0
0
0
0
0.009009
0.125984
127
5
76
25.4
0.747748
0.897638
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
f41e0715afc707d6e7794854ebb7834b7493552e
161
py
Python
setup.py
hubertgabrys/ml313
efb92cea1f030cd3e3628713c406aea225edb65c
[ "BSD-3-Clause" ]
2
2021-12-25T13:50:42.000Z
2022-01-29T23:02:54.000Z
setup.py
hubertgabrys/ml313
efb92cea1f030cd3e3628713c406aea225edb65c
[ "BSD-3-Clause" ]
null
null
null
setup.py
hubertgabrys/ml313
efb92cea1f030cd3e3628713c406aea225edb65c
[ "BSD-3-Clause" ]
1
2021-03-24T15:53:16.000Z
2021-03-24T15:53:16.000Z
from setuptools import setup, find_packages setup( name="ml313", version="0.1.0dev", packages=find_packages(), license='BSD 3-Clause License' )
17.888889
43
0.68323
21
161
5.142857
0.761905
0.222222
0
0
0
0
0
0
0
0
0
0.053435
0.186335
161
8
44
20.125
0.770992
0
0
0
0
0
0.204969
0
0
0
0
0
0
1
0
true
0
0.142857
0
0.142857
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
f4296f17fe6501f0e6b9390708cbf1764290e9a4
307
py
Python
worldcup18/utils.py
tadeoos/worldcup
c167251c7a6131253a1ea1914a0e6e418e9f32a7
[ "MIT" ]
2
2018-06-16T04:05:39.000Z
2018-06-18T12:20:37.000Z
worldcup18/utils.py
tadeoos/worldcup
c167251c7a6131253a1ea1914a0e6e418e9f32a7
[ "MIT" ]
null
null
null
worldcup18/utils.py
tadeoos/worldcup
c167251c7a6131253a1ea1914a0e6e418e9f32a7
[ "MIT" ]
null
null
null
# - *- coding: utf- 8 - *- from __future__ import absolute_import import dateutil.parser from tzlocal import get_localzone def iso_to_datetime(s): return dateutil.parser.parse(s) def get_nice_date(date): return iso_to_datetime(date).astimezone(get_localzone()).strftime("%A, %d. %B %Y %I:%M%p")
23.615385
94
0.726384
47
307
4.468085
0.638298
0.133333
0.12381
0
0
0
0
0
0
0
0
0.003774
0.136808
307
12
95
25.583333
0.788679
0.078176
0
0
0
0
0.074733
0
0
0
0
0
0
1
0.285714
false
0
0.428571
0.285714
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
1
1
0
0
4
f42b19bbf7aa6d5edf9724e9924db9513ae83cf5
87
py
Python
plugins/module_utils/__init__.py
cesarvr/keycloak-ansible-module
f0880e7f155b960e6641f6bd98226be027c33bef
[ "MIT" ]
null
null
null
plugins/module_utils/__init__.py
cesarvr/keycloak-ansible-module
f0880e7f155b960e6641f6bd98226be027c33bef
[ "MIT" ]
null
null
null
plugins/module_utils/__init__.py
cesarvr/keycloak-ansible-module
f0880e7f155b960e6641f6bd98226be027c33bef
[ "MIT" ]
null
null
null
from .ansible_rhsso import Action, AnsibleAction, AnsibleState, LoadResourcesFromFolder
87
87
0.885057
8
87
9.5
1
0
0
0
0
0
0
0
0
0
0
0
0.068966
87
1
87
87
0.938272
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
f42cc0b1de04eb6a24f6c95d772507c3f5241519
359
py
Python
src/cqparts_fasteners/solidtypes/screw_drives/__init__.py
luzpaz/cqparts
6bcc153c33ea1ac929102fe2e1a5418131af0c4e
[ "Apache-2.0" ]
69
2018-10-29T06:42:14.000Z
2022-03-18T09:20:11.000Z
src/cqparts_fasteners/solidtypes/screw_drives/__init__.py
luzpaz/cqparts
6bcc153c33ea1ac929102fe2e1a5418131af0c4e
[ "Apache-2.0" ]
112
2017-10-05T12:32:54.000Z
2018-10-27T06:45:18.000Z
src/cqparts_fasteners/solidtypes/screw_drives/__init__.py
luzpaz/cqparts
6bcc153c33ea1ac929102fe2e1a5418131af0c4e
[ "Apache-2.0" ]
14
2018-11-16T12:13:02.000Z
2022-03-15T22:32:34.000Z
__all__ = [ 'ScrewDrive', 'register', 'find', 'search', # Screw Drive types 'cruciform', 'hex', 'slotted', 'square', 'tamper_resistant', ] from .base import ScrewDrive, register, find, search # Screw Drive types from . import cruciform from . import hex from . import slotted from . import square from . import tamper_resistant
17.95
52
0.665738
40
359
5.825
0.425
0.214592
0.188841
0.240343
0.369099
0.369099
0.369099
0
0
0
0
0
0.220056
359
19
53
18.894737
0.832143
0.097493
0
0
0
0
0.214953
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
f4331bfc5fc1f79d9077844ee528065df82f90d1
61
py
Python
src/breadcrumbs/models.py
daniel-werner/stelagifts
809cb70f98a1ead3acbc2fd6aea99a87fdfd9435
[ "MIT" ]
null
null
null
src/breadcrumbs/models.py
daniel-werner/stelagifts
809cb70f98a1ead3acbc2fd6aea99a87fdfd9435
[ "MIT" ]
null
null
null
src/breadcrumbs/models.py
daniel-werner/stelagifts
809cb70f98a1ead3acbc2fd6aea99a87fdfd9435
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # just to be reconized as django app
20.333333
36
0.622951
10
61
3.8
1
0
0
0
0
0
0
0
0
0
0
0.020833
0.213115
61
2
37
30.5
0.770833
0.918033
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
f43d607960f6b4d370ad11ed2e3a312a382a102f
292
py
Python
tests/test_int_case.py
barak/autograd
4a693a2daac6435cb6bddf6b18bd918a46591a82
[ "MIT" ]
1
2015-03-21T18:29:29.000Z
2015-03-21T18:29:29.000Z
tests/test_int_case.py
barak/autograd
4a693a2daac6435cb6bddf6b18bd918a46591a82
[ "MIT" ]
null
null
null
tests/test_int_case.py
barak/autograd
4a693a2daac6435cb6bddf6b18bd918a46591a82
[ "MIT" ]
null
null
null
from test_util import * from autograd import grad def test_int_case(): check_equivalent((lambda x:x*x)(2.0), 4.0) check_equivalent((lambda x:x*x)(2) + 0.0, 4.0) check_equivalent(grad(lambda x:x*x)(2.0), 4.0) check_equivalent(grad(lambda x:x*x)(2) + 0.0, 4.0)
32.444444
54
0.626712
56
292
3.142857
0.285714
0.090909
0.181818
0.204545
0.693182
0.693182
0.693182
0.693182
0.607955
0.528409
0
0.077253
0.202055
292
8
55
36.5
0.678112
0
0
0
0
0
0
0
0
0
0
0
0
1
0.142857
true
0
0.285714
0
0.428571
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
f470e8e362a0f0ec944836fef60ae6bb3f966a9e
277
py
Python
tests/pbraiders/pages/contacts/actions/__init__.py
pbraiders/pomponne-test-bdd
7f2973936318221f54e65e0f8bd839cad7216fa4
[ "MIT" ]
1
2021-03-30T14:41:29.000Z
2021-03-30T14:41:29.000Z
tests/pbraiders/pages/contacts/actions/__init__.py
pbraiders/pomponne-test-bdd
7f2973936318221f54e65e0f8bd839cad7216fa4
[ "MIT" ]
null
null
null
tests/pbraiders/pages/contacts/actions/__init__.py
pbraiders/pomponne-test-bdd
7f2973936318221f54e65e0f8bd839cad7216fa4
[ "MIT" ]
null
null
null
# coding=utf-8 from .abstract import ContactActionAbstract from .contants import * from .create import ContactCreateAction from .delete import ContactDeleteAction from .read import ContactReadAction from .update import ContactUpdateAction from .write import ContactWriteAction
30.777778
43
0.851986
30
277
7.866667
0.6
0
0
0
0
0
0
0
0
0
0
0.004049
0.108303
277
8
44
34.625
0.951417
0.043321
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
f486805d98c6fb1d2d407974526190631cc23120
291
py
Python
crabageprediction/venv/Lib/site-packages/mpl_toolkits/axes_grid/anchored_artists.py
13rianlucero/CrabAgePrediction
92bc7fbe1040f49e820473e33cc3902a5a7177c7
[ "MIT" ]
603
2020-12-23T13:49:32.000Z
2022-03-31T23:38:03.000Z
venv/lib/python3.7/site-packages/mpl_toolkits/axes_grid/anchored_artists.py
John1001Song/Big-Data-Robo-Adviser
9444dce96954c546333d5aecc92a06c3bfd19aa5
[ "MIT" ]
387
2020-12-15T14:54:04.000Z
2022-03-31T07:00:21.000Z
venv/lib/python3.7/site-packages/mpl_toolkits/axes_grid/anchored_artists.py
John1001Song/Big-Data-Robo-Adviser
9444dce96954c546333d5aecc92a06c3bfd19aa5
[ "MIT" ]
64
2018-04-25T08:51:57.000Z
2022-01-29T14:13:57.000Z
from matplotlib.offsetbox import AnchoredOffsetbox, AuxTransformBox, VPacker,\ TextArea, AnchoredText, DrawingArea, AnnotationBbox from mpl_toolkits.axes_grid1.anchored_artists import \ AnchoredDrawingArea, AnchoredAuxTransformBox, \ AnchoredEllipse, AnchoredSizeBar
41.571429
78
0.800687
23
291
10
0.913043
0
0
0
0
0
0
0
0
0
0
0.004032
0.147766
291
6
79
48.5
0.923387
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.4
0
0.4
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
be35310eedef2271153ecab5a876c9b0e6fd8cc2
709
py
Python
demo/cpython/mat.py
dyalab/amino
e3063ceeeed7d1a3d55fc0d3071c9aacb4466b22
[ "BSD-3-Clause" ]
32
2015-06-02T20:06:09.000Z
2022-03-14T16:49:22.000Z
demo/cpython/mat.py
dyalab/amino
e3063ceeeed7d1a3d55fc0d3071c9aacb4466b22
[ "BSD-3-Clause" ]
28
2016-05-18T20:54:44.000Z
2021-03-22T23:43:23.000Z
demo/cpython/mat.py
dyalab/amino
e3063ceeeed7d1a3d55fc0d3071c9aacb4466b22
[ "BSD-3-Clause" ]
20
2016-01-05T18:55:14.000Z
2022-02-22T01:32:20.000Z
#!/usr/bin/env python from amino import * # v = DVec.create(2) # v.copy_from([1,2]) # print v print "Row" A = DMat.row_matrix( [1,2], [3,4] ) print A.col_vec(0) print A.col_vec(1) print A[0,0] print A[1,0] print A[0,1] print A[1,1] print A print "Col" A = DMat.col_matrix( [1,2], [3,4] ) print A.col_vec(0) print A.col_vec(1) print A[0,0] print A[1,0] print A[0,1] print A[1,1] print A # A = DMat( (2,2) ) # A[0,0] = 1 # A[1,0] = 2 # A[0,1] = 3 # A[1,1] = 4 # x = DVec( [1,2] ) # y = A*x # print y # print "c0: " + str(m.col_vec(0)) # print "c1: " + str(m.col_vec(1)) # print "r0: " + str(m.row_vec(0)) # print "r1: " + str(m.row_vec(1)) print "end"
12.660714
34
0.520451
153
709
2.339869
0.20915
0.234637
0.117318
0.134078
0.413408
0.413408
0.413408
0.413408
0.413408
0.413408
0
0.103774
0.252468
709
55
35
12.890909
0.571698
0.414669
0
0.727273
0
0
0.022556
0
0
0
0
0
0
0
null
null
0
0.045455
null
null
0.772727
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
4
be70c5e3b8f22d9cef664a91ce0318ddeee2b6b4
51
py
Python
kickstarter/__init__.py
BrandonSmith710/kickstarter3
ca968b3e5102a3109d649065271e213a4586184a
[ "MIT" ]
null
null
null
kickstarter/__init__.py
BrandonSmith710/kickstarter3
ca968b3e5102a3109d649065271e213a4586184a
[ "MIT" ]
null
null
null
kickstarter/__init__.py
BrandonSmith710/kickstarter3
ca968b3e5102a3109d649065271e213a4586184a
[ "MIT" ]
null
null
null
from .app import create_app APP = create_app()
12.75
28
0.705882
8
51
4.25
0.5
0.529412
0
0
0
0
0
0
0
0
0
0
0.215686
51
4
29
12.75
0.85
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
be71ac89755245dc0f02e0124b6e5b07d332503a
160
py
Python
models/setup.py
matt-rb/mobilenetv2_imagenet
77f962df0ff3526dff00551a16cf4b7bbb476ca5
[ "Apache-2.0" ]
null
null
null
models/setup.py
matt-rb/mobilenetv2_imagenet
77f962df0ff3526dff00551a16cf4b7bbb476ca5
[ "Apache-2.0" ]
null
null
null
models/setup.py
matt-rb/mobilenetv2_imagenet
77f962df0ff3526dff00551a16cf4b7bbb476ca5
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Mar 20 16:53:06 2019 @author: isip40 """ from setuptools import setup setup(name='imagenet')
16
35
0.66875
25
160
4.28
0.96
0
0
0
0
0
0
0
0
0
0
0.117647
0.15
160
9
36
17.777778
0.669118
0.6
0
0
0
0
0.145455
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
be72bbd53d803aa0c269d180022c5079e51b4512
147
py
Python
media.py
MiguelTeixeiraUFPB/Python-M1
43f13efb09aa4c11c77f9362e8642f4f51832768
[ "MIT" ]
null
null
null
media.py
MiguelTeixeiraUFPB/Python-M1
43f13efb09aa4c11c77f9362e8642f4f51832768
[ "MIT" ]
null
null
null
media.py
MiguelTeixeiraUFPB/Python-M1
43f13efb09aa4c11c77f9362e8642f4f51832768
[ "MIT" ]
null
null
null
nota1=float(input('digite sua primeira nota:')) nota2=float(input('digite sua segunda nota')) media=(nota1+nota2)/2 print('sua média é ', media)
21
47
0.721088
23
147
4.608696
0.608696
0.188679
0.301887
0.358491
0
0
0
0
0
0
0
0.038168
0.108844
147
6
48
24.5
0.770992
0
0
0
0
0
0.413793
0
0
0
0
0
0
1
0
false
0
0
0
0
0.25
1
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
be9bc0402d282281d62c36577da8e7c43dc62b03
11,558
py
Python
tests/integration/states/test_keystone.py
Noah-Huppert/salt
998c382f5f2c3b4cbf7d96aa6913ada6993909b3
[ "Apache-2.0" ]
19
2016-01-29T14:37:52.000Z
2022-03-30T18:08:01.000Z
tests/integration/states/test_keystone.py
Noah-Huppert/salt
998c382f5f2c3b4cbf7d96aa6913ada6993909b3
[ "Apache-2.0" ]
223
2016-03-02T16:39:41.000Z
2022-03-03T12:26:35.000Z
tests/integration/states/test_keystone.py
Noah-Huppert/salt
998c382f5f2c3b4cbf7d96aa6913ada6993909b3
[ "Apache-2.0" ]
64
2016-02-04T19:45:26.000Z
2021-12-15T02:02:31.000Z
# -*- coding: utf-8 -*- """ Tests for the Keystone states """ # Import python libs from __future__ import absolute_import, print_function, unicode_literals import logging # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.helpers import destructiveTest from tests.support.mixins import SaltReturnAssertsMixin from tests.support.unit import skipIf log = logging.getLogger(__name__) NO_KEYSTONE = False try: import keystoneclient # pylint: disable=import-error,unused-import except ImportError: NO_KEYSTONE = True @skipIf( NO_KEYSTONE, "Please install keystoneclient and a keystone server before running" "keystone integration tests.", ) class KeystoneStateTest(ModuleCase, SaltReturnAssertsMixin): """ Validate the keystone state """ endpoint = "http://localhost:35357/v2.0" token = "administrator" @destructiveTest def setUp(self): ret = self.run_state( "keystone.service_present", name="keystone", description="OpenStack Identity", service_type="identity", connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue( ret["keystone_|-keystone_|-keystone_|-service_present"]["result"] ) ret = self.run_state( "keystone.endpoint_present", name="keystone", region="RegionOne", publicurl="http://localhost:5000/v2.0", internalurl="http://localhost:5000/v2.0", adminurl="http://localhost:35357/v2.0", connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue( ret["keystone_|-keystone_|-keystone_|-endpoint_present"]["result"] ) ret = self.run_state( "keystone.tenant_present", name="admin", description="Admin Project", connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue(ret["keystone_|-admin_|-admin_|-tenant_present"]["result"]) ret = self.run_state( "keystone.tenant_present", name="demo", description="Demo Project", connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue(ret["keystone_|-demo_|-demo_|-tenant_present"]["result"]) ret = self.run_state( "keystone.role_present", name="admin", connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue(ret["keystone_|-admin_|-admin_|-role_present"]["result"]) ret = self.run_state( "keystone.role_present", name="user", connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue(ret["keystone_|-user_|-user_|-role_present"]["result"]) ret = self.run_state( "keystone.user_present", name="admin", email="admin@example.com", password="adminpass", tenant="admin", roles={"admin": ["admin"]}, connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue(ret["keystone_|-admin_|-admin_|-user_present"]["result"]) ret = self.run_state( "keystone.user_present", name="demo", email="demo@example.com", password="demopass", tenant="demo", roles={"demo": ["user"]}, connection_endpoint=self.endpoint, connection_token=self.token, ) self.assertTrue(ret["keystone_|-demo_|-demo_|-user_present"]["result"]) @destructiveTest def test_keystone_v2(self): ret = self.run_state( "keystone.service_present", name="testv2", description="Nova Service", service_type="compute", profile="adminv2", ) self.assertTrue(ret["keystone_|-testv2_|-testv2_|-service_present"]["result"]) ret = self.run_state( "keystone.endpoint_present", name="nova", description="Nova Service", publicurl="http://localhost:8774/v2.1/%(tenant_id)s", internalurl="http://localhost:8774/v2.1/%(tenant_id)s", adminurl="http://localhost:8774/v2.1/%(tenant_id)s", region="RegionOne", profile="adminv2", ) self.assertTrue(ret["keystone_|-nova_|-nova_|-endpoint_present"]["result"]) # Region Two ret = self.run_state( "keystone.endpoint_present", name="nova", description="Nova Service", publicurl="http://localhost:8774/v2.1/%(tenant_id)s", internalurl="http://localhost:8774/v2.1/%(tenant_id)s", adminurl="http://localhost:8774/v2.1/%(tenant_id)s", region="RegionTwo", profile="adminv2", ) self.assertTrue(ret["keystone_|-nova_|-nova_|-endpoint_present"]["result"]) # Region One, change publicurl ret = self.run_state( "keystone.endpoint_present", name="nova", description="Nova Service", publicurl="http://127.0.0.1:8774/v2.1/%(tenant_id)s", internalurl="http://localhost:8774/v2.1/%(tenant_id)s", adminurl="http://localhost:8774/v2.1/%(tenant_id)s", region="RegionOne", profile="adminv2", ) self.assertTrue(ret["keystone_|-nova_|-nova_|-endpoint_present"]["result"]) ret = self.run_state( "keystone.endpoint_get", name="nova", region="RegionOne", profile="adminv2" ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) self.assertTrue( ret["keystone_|-testv3_|-testv3_|-endpoint_present"][ "publicurl" ].start_with("http://127.0.0.1") ) ret = self.run_state( "keystone.tenant_present", name="test", description="Test Tenant", profile="adminv2", ) self.assertTrue(ret["keystone_|-test_|-test_|-tenant_present"]["result"]) ret = self.run_state("keystone.role_present", name="user", profile="adminv2") self.assertTrue(ret["keystone_|-user_|-user_|-role_present"]["result"]) ret = self.run_state( "keystone.user_present", name="test", email="test@example.com", tenant="test", password="testpass", roles={"test": ["user"]}, profile="adminv2", ) self.assertTrue(ret["keystone_|-test_|-test_|-user_present"]["result"]) ret = self.run_state( "keystone.service_absent", name="testv2", profile="adminv2" ) self.assertTrue(ret["keystone_|-testv2_|-testv2_|-service_absent"]["result"]) @destructiveTest def test_keystone_v3(self): ret = self.run_state( "keystone.service_present", name="testv3", description="Image Service", service_type="image", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-service_present"]["result"]) ret = self.run_state( "keystone.endpoint_present", name="testv3", description="Glance Service", interface="public", url="http://localhost:9292", region="RegionOne", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) ret = self.run_state( "keystone.endpoint_present", name="testv3", description="Glance Service", interface="internal", url="http://localhost:9292", region="RegionOne", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) ret = self.run_state( "keystone.endpoint_present", name="testv3", description="Glance Service", interface="admin", url="http://localhost:9292", region="RegionOne", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) # Region Two ret = self.run_state( "keystone.endpoint_present", name="testv3", description="Glance Service", interface="public", url="http://localhost:9292", region="RegionTwo", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) ret = self.run_state( "keystone.endpoint_present", name="testv3", description="Glance Service", interface="internal", url="http://localhost:9292", region="RegionTwo", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) ret = self.run_state( "keystone.endpoint_present", name="testv3", description="Glance Service", interface="admin", url="http://localhost:9292", region="RegionTwo", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) # Region One, change ret = self.run_state( "keystone.endpoint_present", name="testv3", description="Glance Service", interface="public", url="http://127.0.0.1:9292", region="RegionOne", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) ret = self.run_state( "keystone.endpoint_get", name="testv3", region="RegionOne", interface="public", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["result"]) self.assertTrue( ret["keystone_|-testv3_|-testv3_|-endpoint_present"]["endpoint"]["url"] == "http://127.0.0.1:9292" ) ret = self.run_state( "keystone.project_present", name="testv3", description="Test v3 Tenant", profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-project_present"]["result"]) ret = self.run_state("keystone.role_present", name="user", profile="adminv3") self.assertTrue(ret["keystone_|-user_|-user_|-role_present"]["result"]) ret = self.run_state( "keystone.user_present", name="testv3", email="testv3@example.com", project="testv3", password="testv3pass", roles={"testv3": ["user"]}, profile="adminv3", ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-user_present"]["result"]) ret = self.run_state( "keystone.service_absent", name="testv3", profile="adminv3" ) self.assertTrue(ret["keystone_|-testv3_|-testv3_|-service_absent"]["result"])
33.994118
87
0.566274
1,089
11,558
5.794307
0.117539
0.070998
0.086212
0.126783
0.785895
0.755309
0.752456
0.745325
0.699842
0.643899
0
0.026165
0.292352
11,558
339
88
34.094395
0.745323
0.020505
0
0.604167
0
0
0.344699
0.181738
0
0
0
0
0.118056
1
0.010417
false
0.013889
0.027778
0
0.048611
0.003472
0
0
0
null
0
0
0
0
1
1
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
beb2ef2a1ad9cde45f3df03c2071d6ad6e885781
255
py
Python
kumochan/core/kumo/htmlkumo.py
np-company/kumochan
13150224c897dae13b8228b480f48bc190219df3
[ "BSD-3-Clause" ]
null
null
null
kumochan/core/kumo/htmlkumo.py
np-company/kumochan
13150224c897dae13b8228b480f48bc190219df3
[ "BSD-3-Clause" ]
null
null
null
kumochan/core/kumo/htmlkumo.py
np-company/kumochan
13150224c897dae13b8228b480f48bc190219df3
[ "BSD-3-Clause" ]
null
null
null
from .kumo import Kumo from kumochan.core.consts import AttributeChoices from kumochan.core.query.query import Query import requests from bs4.element import Tag from bs4 import BeautifulSoup class HtmlKumo(Kumo): async def fetch(self): pass
21.25
49
0.784314
36
255
5.555556
0.555556
0.12
0.16
0
0
0
0
0
0
0
0
0.00939
0.164706
255
11
50
23.181818
0.929577
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0.111111
0.666667
0
0.777778
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
1
1
0
1
0
0
4
fe1f7af46ef9ed3dbb9fe4a5e898c981411ccdad
88
py
Python
shopping_cart/api_app/apps.py
leonyu1010/creating-a-rest-api-with-django
4e1f6e18578882b42737a8627b853fbe08ef8a70
[ "MIT" ]
8
2021-04-29T23:59:31.000Z
2021-11-27T06:30:16.000Z
shopping_cart/api_app/apps.py
leonyu1010/creating-a-rest-api-with-django
4e1f6e18578882b42737a8627b853fbe08ef8a70
[ "MIT" ]
11
2019-05-02T20:10:16.000Z
2022-02-10T07:10:25.000Z
api_project/api_project/api_app/apps.py
ankushrasgon/profile-rest-api
59a0d9a4852151d753e830f7d7141894c00b207c
[ "MIT" ]
2
2020-11-04T03:05:23.000Z
2020-11-05T08:14:14.000Z
from django.apps import AppConfig class ApiAppConfig(AppConfig): name = 'api_app'
14.666667
33
0.75
11
88
5.909091
0.909091
0
0
0
0
0
0
0
0
0
0
0
0.170455
88
5
34
17.6
0.890411
0
0
0
0
0
0.079545
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
fe22c2485bb4ca80f48e29abdab992103d6ceae0
135
py
Python
label_studio/tasks/mixins.py
mehdibenamorr/label-studio
213252d360b028eb031ca127969fb35a897dc2b6
[ "Apache-2.0" ]
4
2022-01-22T14:59:22.000Z
2022-02-23T18:52:36.000Z
label_studio/tasks/mixins.py
mehdibenamorr/label-studio
213252d360b028eb031ca127969fb35a897dc2b6
[ "Apache-2.0" ]
100
2021-09-30T21:28:32.000Z
2022-03-22T01:16:38.000Z
label_studio/tasks/mixins.py
mehdibenamorr/label-studio
213252d360b028eb031ca127969fb35a897dc2b6
[ "Apache-2.0" ]
1
2021-11-18T17:01:46.000Z
2021-11-18T17:01:46.000Z
class TaskMixin: def _get_is_labeled_value(self): n = self.completed_annotations.count() return n >= self.overlap
22.5
46
0.674074
17
135
5.058824
0.823529
0.116279
0
0
0
0
0
0
0
0
0
0
0.237037
135
5
47
27
0.834951
0
0
0
0
0
0
0
0
0
0
0
0
1
0.25
false
0
0
0
0.75
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
4
fe243fbfb816c3e69b399dc6a7f472af15a34a80
31
py
Python
marionette_tg/formats/__init__.py
kpdyer/marionette
bb40a334a18c82728eec01c9b56330bcb91a28da
[ "Apache-2.0" ]
73
2015-05-22T20:07:32.000Z
2015-11-12T15:09:00.000Z
marionette_tg/formats/__init__.py
kpdyer/marionette
bb40a334a18c82728eec01c9b56330bcb91a28da
[ "Apache-2.0" ]
20
2015-04-14T03:40:41.000Z
2015-10-02T00:57:28.000Z
marionette_tg/formats/__init__.py
kpdyer/marionette
bb40a334a18c82728eec01c9b56330bcb91a28da
[ "Apache-2.0" ]
14
2015-04-29T18:10:42.000Z
2015-11-03T00:36:29.000Z
### marionette formats dir ###
15.5
30
0.645161
3
31
6.666667
1
0
0
0
0
0
0
0
0
0
0
0
0.16129
31
1
31
31
0.769231
0.709677
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
fe3d0d3b0498ff4cdda842ae79bff6770c7c3f0d
79
py
Python
backend/django/ws/apps.py
Matbj/elva
021101944d4a93ba1171e3819146a3d8ab450816
[ "MIT" ]
2
2021-02-07T05:56:46.000Z
2021-05-12T02:11:24.000Z
ws/apps.py
magdev/opds-proxy
6e5afcdd9ef2fa8806b1f0b9245830f41c0e79fd
[ "MIT" ]
1
2019-07-21T20:07:19.000Z
2019-07-21T20:13:11.000Z
ws/apps.py
magdev/opds-proxy
6e5afcdd9ef2fa8806b1f0b9245830f41c0e79fd
[ "MIT" ]
null
null
null
from django.apps import AppConfig class WsConfig(AppConfig): name = 'ws'
13.166667
33
0.721519
10
79
5.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.189873
79
5
34
15.8
0.890625
0
0
0
0
0
0.025316
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
fe3f3fd302aaf03dff7bc35df7d5d12981fbaf9e
751
py
Python
django/week8/main/serializers.py
yrtby/Alotech-Fullstack-Bootcamp-Patika
e2fd775e2540b8d9698dcb7dc38f84a6d7912e8d
[ "MIT" ]
1
2021-11-05T09:45:25.000Z
2021-11-05T09:45:25.000Z
django/week8/main/serializers.py
yrtby/Alotech-Fullstack-Bootcamp-Patika
e2fd775e2540b8d9698dcb7dc38f84a6d7912e8d
[ "MIT" ]
null
null
null
django/week8/main/serializers.py
yrtby/Alotech-Fullstack-Bootcamp-Patika
e2fd775e2540b8d9698dcb7dc38f84a6d7912e8d
[ "MIT" ]
3
2021-11-07T07:16:30.000Z
2021-12-07T20:22:59.000Z
from django.contrib.auth.models import User from main.models import Post, Comment, Like from rest_framework import serializers class UserSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = User fields = ['url', 'username', 'email', 'is_staff'] class PostSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Post fields = ['content', 'author', 'created_at'] class CommentSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Comment fields = ['post', 'user', 'content', 'created_at'] class LikeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Like fields = ['post', 'user', 'created_at']
31.291667
64
0.696405
73
751
7.09589
0.438356
0.285714
0.324324
0.355212
0.393822
0
0
0
0
0
0
0
0.197071
751
23
65
32.652174
0.859038
0
0
0.210526
0
0
0.11984
0
0
0
0
0
0
1
0
false
0
0.157895
0
0.578947
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
4
fe3ffe5938d3da9bbf868dab8ef9815cdd201617
2,328
py
Python
SysPy_ver/funcs/_SysPyWarnings.py
evlog/SysPy
d1ee6e2ca60492d20339c0016a9c24d027170553
[ "CNRI-Python" ]
4
2017-12-28T14:00:16.000Z
2021-01-21T08:53:14.000Z
SysPy_ver/funcs/_SysPyWarnings.py
evlog/SysPy
d1ee6e2ca60492d20339c0016a9c24d027170553
[ "CNRI-Python" ]
1
2018-07-31T16:27:00.000Z
2018-07-31T16:27:37.000Z
SysPy_ver/funcs/_SysPyWarnings.py
evlog/SysPy
d1ee6e2ca60492d20339c0016a9c24d027170553
[ "CNRI-Python" ]
2
2015-10-12T09:13:13.000Z
2020-01-06T12:22:55.000Z
""" ***************************************************************************** * H E A D E R I N F O R M A T I O N * * ***************************************************************************** Project Name: SysPy (System Python) http://cgi.di.uoa.gr/~evlog/syspy.html File Name: _SysPyWarnings.py Created by: Evangelos Logaras ***************************************************************************** * C O P Y R I G H T N O T I C E * * ***************************************************************************** This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; version 2.1 of the License, a copy of which is available from http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ***************************************************************************** * D E S C R I P T I O N * * ***************************************************************************** Define warnings message format. """ import warnings, sys def customwarn(message, category, filename, lineno, file=None, line=None): sys.stdout.write(warnings.formatwarning(message, category, filename, lineno))
45.647059
81
0.390464
219
2,328
4.146119
0.584475
0.006608
0.039648
0.062775
0.110132
0.110132
0.07489
0
0
0
0
0.010309
0.375
2,328
50
82
46.56
0.613746
0.918814
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0.333333
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
1
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
1
0
1
0
0
4
fe592736b6c2312aa5c340e12635d78ae60a7269
114
py
Python
getpaid/backends/paymill/forms.py
nielsonsantana/django-getpaid2
9b566cf96ca6736306a7aa825dad66714c5f4885
[ "MIT" ]
5
2017-05-29T09:14:10.000Z
2017-05-29T15:29:24.000Z
getpaid/backends/paymill/forms.py
nielsonsantana/django-getpaid2
9b566cf96ca6736306a7aa825dad66714c5f4885
[ "MIT" ]
null
null
null
getpaid/backends/paymill/forms.py
nielsonsantana/django-getpaid2
9b566cf96ca6736306a7aa825dad66714c5f4885
[ "MIT" ]
3
2018-06-13T15:46:21.000Z
2020-05-11T19:24:43.000Z
from django import forms class PaymillForm(forms.Form): token = forms.CharField(widget=forms.HiddenInput())
19
55
0.763158
14
114
6.214286
0.785714
0
0
0
0
0
0
0
0
0
0
0
0.131579
114
5
56
22.8
0.878788
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
fe5b2343a1714a0066efa64489815f6ce9cccc88
1,013
py
Python
rbcl/__init__.py
nthparty/rbcl
6649d3cb1325209cad4e96ab3548cdc2cb9fa633
[ "MIT" ]
1
2021-11-05T18:27:48.000Z
2021-11-05T18:27:48.000Z
rbcl/__init__.py
nthparty/rbcl
6649d3cb1325209cad4e96ab3548cdc2cb9fa633
[ "MIT" ]
2
2021-04-27T18:04:43.000Z
2021-09-21T20:29:00.000Z
rbcl/__init__.py
nthparty/rbcl
6649d3cb1325209cad4e96ab3548cdc2cb9fa633
[ "MIT" ]
1
2021-11-30T17:03:01.000Z
2021-11-30T17:03:01.000Z
"""Allow users to use classes directly.""" from rbcl.rbcl import\ crypto_scalarmult_ristretto255,\ crypto_scalarmult_ristretto255_BYTES,\ crypto_scalarmult_ristretto255_SCALARBYTES,\ crypto_scalarmult_ristretto255_base,\ crypto_core_ristretto255_BYTES,\ crypto_core_ristretto255_HASHBYTES,\ crypto_core_ristretto255_NONREDUCEDSCALARBYTES,\ crypto_core_ristretto255_SCALARBYTES,\ crypto_core_ristretto255_add,\ crypto_core_ristretto255_from_hash,\ crypto_core_ristretto255_is_valid_point,\ crypto_core_ristretto255_random,\ crypto_core_ristretto255_scalar_add,\ crypto_core_ristretto255_scalar_complement,\ crypto_core_ristretto255_scalar_invert,\ crypto_core_ristretto255_scalar_mul,\ crypto_core_ristretto255_scalar_negate,\ crypto_core_ristretto255_scalar_random,\ crypto_core_ristretto255_scalar_reduce,\ crypto_core_ristretto255_scalar_sub,\ crypto_core_ristretto255_sub,\ randombytes,\ randombytes_buf_deterministic
38.961538
52
0.825271
108
1,013
7.046296
0.314815
0.22339
0.491459
0.29435
0.089356
0
0
0
0
0
0
0.070866
0.122409
1,013
25
53
40.52
0.785152
0.035538
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.041667
0
0.041667
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
fe74fe766cac19e1356006c75cc7afed058936ea
302
py
Python
main.py
Samyc2002/Arithmetic-Formatter
c781fb87aa8b440be87fc047cf7e482c440c349c
[ "MIT" ]
null
null
null
main.py
Samyc2002/Arithmetic-Formatter
c781fb87aa8b440be87fc047cf7e482c440c349c
[ "MIT" ]
null
null
null
main.py
Samyc2002/Arithmetic-Formatter
c781fb87aa8b440be87fc047cf7e482c440c349c
[ "MIT" ]
null
null
null
# This entrypoint file to be used in development. Start by reading README.md from arithmetic_arranger import arithmetic_arranger from unittest import main print(arithmetic_arranger(["32 + 698", "3801 - 2", "45 + 43", "123 + 49"])) # Run unit tests automatically main(module='test_module', exit=False)
37.75
76
0.758278
44
302
5.113636
0.818182
0.24
0
0
0
0
0
0
0
0
0
0.072797
0.135762
302
8
77
37.75
0.789272
0.34106
0
0
0
0
0.213198
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0.25
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
fe78b3adc5d8b9a2884c4201286adeb63b033264
89
py
Python
magasin/apps.py
kristoea/daljeweb
cfbce1d1c023c5d91c3e06ee7c92d8ac2831795a
[ "MIT" ]
null
null
null
magasin/apps.py
kristoea/daljeweb
cfbce1d1c023c5d91c3e06ee7c92d8ac2831795a
[ "MIT" ]
null
null
null
magasin/apps.py
kristoea/daljeweb
cfbce1d1c023c5d91c3e06ee7c92d8ac2831795a
[ "MIT" ]
null
null
null
from django.apps import AppConfig class MagasinConfig(AppConfig): name = 'magasin'
14.833333
33
0.752809
10
89
6.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.168539
89
5
34
17.8
0.905405
0
0
0
0
0
0.078652
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
fe85f646e19788a5fb683a19f0a82ba85133bceb
27,075
py
Python
optimization/first_sdEta_mjj_optimization/loose_analysis_sdeta_2.6_mjj_1250/Output/Histos/MadAnalysis5job_0/selection_2.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
optimization/first_sdEta_mjj_optimization/loose_analysis_sdeta_2.6_mjj_1250/Output/Histos/MadAnalysis5job_0/selection_2.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
optimization/first_sdEta_mjj_optimization/loose_analysis_sdeta_2.6_mjj_1250/Output/Histos/MadAnalysis5job_0/selection_2.py
sheride/axion_pheno
7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5
[ "MIT" ]
null
null
null
def selection_2(): # Library import import numpy import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec # Library version matplotlib_version = matplotlib.__version__ numpy_version = numpy.__version__ # Histo binning xBinning = numpy.linspace(-3.2,3.2,65,endpoint=True) # Creating data sequence: middle of each bin xData = numpy.array([-3.15,-3.05,-2.95,-2.85,-2.75,-2.65,-2.55,-2.45,-2.35,-2.25,-2.15,-2.05,-1.95,-1.85,-1.75,-1.65,-1.55,-1.45,-1.35,-1.25,-1.15,-1.05,-0.95,-0.85,-0.75,-0.65,-0.55,-0.45,-0.35,-0.25,-0.15,-0.05,0.05,0.15,0.25,0.35,0.45,0.55,0.65,0.75,0.85,0.95,1.05,1.15,1.25,1.35,1.45,1.55,1.65,1.75,1.85,1.95,2.05,2.15,2.25,2.35,2.45,2.55,2.65,2.75,2.85,2.95,3.05,3.15]) # Creating weights for histo: y3_PHI_0 y3_PHI_0_weights = numpy.array([11.4429661752,27.0659887615,26.7712170146,27.6391602694,27.4180804592,27.2297526209,27.5654683326,27.3034445576,27.0741767545,27.2543165998,26.4764412677,27.1683406736,27.0004848177,27.1765286666,27.4426444381,26.791684997,26.9841088318,27.4344564451,27.2952565646,26.8326249619,27.0127648072,27.2256566244,27.2788805787,27.7742641534,27.4057964697,27.9134640339,27.7128562061,26.9308848775,26.6934290814,26.513289236,27.4549284276,27.2829765752,27.1274007088,26.7712170146,27.7005722166,27.864336076,27.0291407931,27.610500294,27.6841962307,27.3362005295,26.9595448529,26.9472608634,27.4426444381,27.1519646877,27.5859363151,27.8274881077,27.0332367896,26.8367209583,26.7875930005,26.8203449724,27.6268802799,27.6268802799,27.4876803994,27.5327163608,27.5245283678,26.9800128353,27.4180804592,26.7179930603,26.8285329654,27.2829765752,27.8520520866,27.1274007088,27.2584125963,11.4798101436]) # Creating weights for histo: y3_PHI_1 y3_PHI_1_weights = numpy.array([1.15414565601,3.35357580488,2.89148601339,3.29232663113,3.17050077049,3.2924383785,3.36532289663,2.75821025293,3.08589719759,3.47501755898,3.2440269348,3.16009104242,2.96464969968,3.27958582891,3.51138111425,3.49917501718,3.2436548441,3.49914137281,3.14661967675,3.14712674546,3.23207557367,3.32847510276,3.14746038546,3.02544667708,3.03790350481,3.11011793925,3.24437819804,3.21917496069,3.12230160674,3.34193845787,3.74245905357,3.31741571794,2.86795458078,3.01273551395,3.54816522414,3.49912975749,3.02539981528,3.55978254474,3.34106690849,3.42701064877,3.25673249055,3.34144821134,3.46271453408,3.31704803305,3.51207242593,3.48772391578,3.3423834447,2.8070742935,3.25650018419,3.46255632544,3.17092132511,3.24476791198,3.36558724525,3.26837784813,3.28147231676,2.92910482406,3.6930639126,2.9280786708,3.11045999034,3.14726012135,3.34102204933,3.49802910598,3.0864042663,1.19062576499]) # Creating weights for histo: y3_PHI_2 y3_PHI_2_weights = numpy.array([6.23516406848,15.2112042187,15.2104067257,16.1042311196,15.8036464959,15.331249645,14.6376083958,15.1310417077,15.4523859425,15.5122640326,14.7982185319,14.4878863121,15.5110450666,15.0105624122,15.1399174332,14.7992432897,14.8194822577,14.7176593404,15.0105458838,14.6683428678,15.5817946807,14.6986930556,15.452687585,15.1807920496,15.1404050196,16.2349290693,14.8598899482,15.9433565299,15.9033827087,14.7278573341,14.8489564428,14.6887884402,15.6226321083,15.3621122117,14.8396675086,15.2805902437,15.5735015797,15.0297766223,15.2092580052,15.0708123902,14.7594140916,15.3410633545,14.7080728958,14.3168178608,14.909590705,15.090435677,15.5318336023,14.8896120586,14.9491926383,14.5593053245,14.979819676,15.3619675886,14.8283827757,15.3312661733,15.3713970139,14.3375196226,15.2206501723,15.1703337344,15.3510754041,15.2006260729,15.0692008758,15.0700603501,15.0103392794,6.6964290738]) # Creating weights for histo: y3_PHI_3 y3_PHI_3_weights = numpy.array([7.92073918815,18.277204508,18.239699173,18.5691830535,18.4971624102,18.4144572965,18.0140780952,18.5354599398,18.0081061668,18.1563968664,18.3379394255,17.7216607957,17.9196322515,18.3816441909,18.3282746517,18.1628766118,18.3658693625,17.9918153963,18.5358580684,18.2288481386,17.8664211512,18.3107448076,18.0304419913,17.9979579512,18.2946449763,18.3716584767,18.2112045435,17.6834323292,18.2564855729,18.3871489276,18.6287317105,18.1842577403,18.2894368048,18.0176043767,18.9206818182,18.2397113606,18.5968408006,18.0901937751,18.1235065726,18.2398372992,17.7547826541,18.1575506267,18.1895877879,19.1298008737,18.3044844392,18.4203520366,18.7514974945,18.3429647829,17.6015072224,18.3983452776,18.6355405213,18.0035805014,18.0633729105,18.1008335576,18.5632680007,18.1123670981,18.4552532859,18.5578404522,18.4268399071,18.3480998288,18.2830261225,18.0422924097,18.1399679697,7.73959069507]) # Creating weights for histo: y3_PHI_4 y3_PHI_4_weights = numpy.array([2.29250078658,5.44439661154,5.68425759565,5.55282928048,5.56774418367,5.66258469009,5.67063336669,5.57672679535,5.65365819469,5.63091907999,5.53830719119,5.59641558989,5.50356320278,5.61214818731,5.60333793275,5.55490558251,5.52632235901,5.54714149558,5.45143118695,5.47991019452,5.41980565989,5.55320606116,5.64672783521,5.52342034613,5.52443444731,5.56483415418,5.61319435494,5.48981872467,5.64187778607,5.57066623807,5.61121425223,5.60729012156,5.52231806223,5.65658425739,5.62095443357,5.58366116313,5.47106386522,5.58452294872,5.54902940727,5.66565505178,5.60639226122,5.60433600072,5.68120326718,5.63490333523,5.45529920135,5.38316173488,5.45821323914,5.50179153194,5.58649904313,5.38634833742,5.54998739218,5.51845405614,5.52746071765,5.63686740472,5.58755723567,5.51233337429,5.60340206563,5.61726278459,5.61621260866,5.55185526235,5.56481812096,5.42277581395,5.51871058766,2.26962418701]) # Creating weights for histo: y3_PHI_5 y3_PHI_5_weights = numpy.array([0.731780619511,1.75999199447,1.75163075359,1.77711097302,1.77588707428,1.75468189834,1.77437150435,1.74032679442,1.7738157687,1.77612793308,1.80188622039,1.76301113141,1.78067904395,1.73627980659,1.75599221817,1.79226547207,1.77486442467,1.7852001475,1.79977530514,1.78040657745,1.75346040018,1.76231296099,1.79078190995,1.7758846737,1.75795429709,1.82077483089,1.78921472742,1.76628673095,1.76576260301,1.76383733308,1.75143470573,1.75370846073,1.78247548244,1.77107630003,1.75874649046,1.78169489191,1.76662881445,1.77823324696,1.76702211045,1.73991189314,1.78343731722,1.74264335986,1.82175066908,1.74182516015,1.76477996316,1.76148835972,1.77788996317,1.72067959875,1.78237745852,1.7587556927,1.7698163925,1.79704383842,1.77991125654,1.75271621854,1.78628321187,1.77765270526,1.79855500728,1.76656439872,1.79298484766,1.76654119306,1.77438430748,1.75622467491,1.71843665128,0.750694436163]) # Creating weights for histo: y3_PHI_6 y3_PHI_6_weights = numpy.array([0.252234145541,0.666519367981,0.651030760104,0.658206754552,0.650574013216,0.62047840193,0.639304990841,0.605570399422,0.650421664287,0.667996272889,0.642609683035,0.639281898582,0.654114526358,0.648458322442,0.647344295888,0.651009567208,0.647256325378,0.64018539571,0.639929381532,0.655999494475,0.65191096504,0.639056574116,0.64797008611,0.634145020577,0.642088857627,0.659048072524,0.623637842815,0.626730506086,0.62931883842,0.639568302573,0.639602890978,0.647337098301,0.639349675862,0.617536388158,0.640673532076,0.638517154941,0.638713189226,0.640746907479,0.612336931131,0.633892305293,0.649403205696,0.6321435915,0.636178039064,0.651915163633,0.663703012085,0.661131674055,0.649021533641,0.631026166086,0.631865684661,0.65528353448,0.656803524946,0.62767738867,0.641041808621,0.670806530829,0.654738617149,0.644461862144,0.627821140481,0.633705367958,0.633887606868,0.667317600395,0.645312776898,0.616736456313,0.631233496584,0.263131892376]) # Creating weights for histo: y3_PHI_7 y3_PHI_7_weights = numpy.array([0.028180736618,0.0704422444063,0.0700721887924,0.0715392937612,0.0706827176919,0.0703092674569,0.0724095740418,0.0700666987261,0.0725361389289,0.0711653825283,0.0726533162218,0.0705064488457,0.0710365545603,0.0717284705495,0.0715120110653,0.0691425235962,0.0704213318637,0.071258420293,0.0707037140523,0.0734401977854,0.0715332169703,0.0714975105849,0.0717565495146,0.0711500857786,0.0714989773965,0.0699539637769,0.0728195269313,0.0729735002411,0.0719367577976,0.0753007854448,0.070978762183,0.0708242021486,0.0727018886405,0.0723955764681,0.0738055596021,0.0715660735502,0.0730410154839,0.0713477281654,0.0713621867369,0.0706019173269,0.072441885806,0.0714805374791,0.0723258819624,0.0729867015455,0.0717688288232,0.0735016781461,0.0723857278759,0.0716734022509,0.0718563765216,0.07240429352,0.0717130899821,0.0710006805393,0.0706966733566,0.0717803956804,0.0723596605382,0.0710502168627,0.071676377783,0.0737431991543,0.0710225150778,0.0714583257605,0.0721520857415,0.0702423389388,0.0713587921158,0.0302085785186]) # Creating weights for histo: y3_PHI_8 y3_PHI_8_weights = numpy.array([0.00589943415204,0.0134300731229,0.0129326875375,0.0129559473555,0.012360225443,0.0123297024078,0.0122799305849,0.012417523331,0.0123884585823,0.0132426966736,0.0145181271086,0.0126991627063,0.0122449005237,0.0123370309657,0.0129781676618,0.0123600145706,0.0120852567631,0.0129829464459,0.0128103949194,0.0122457440132,0.0127575624768,0.0126436616886,0.0126998175987,0.0126633648915,0.0123281906607,0.0130075264439,0.0127116977331,0.0122752913924,0.0115953348721,0.0126155859611,0.0123358355271,0.0134620158341,0.0115685615043,0.0122750151793,0.0121573855139,0.0129991687694,0.0138376864729,0.0127352218842,0.0128448918595,0.0121209550819,0.0131253031259,0.0127230328663,0.0134354473986,0.0125604220422,0.0139973153833,0.0127613136293,0.0131004528549,0.0125866756541,0.0127283878369,0.01317915726,0.0123396787506,0.0135507589528,0.0116400932784,0.0131525873395,0.012429283179,0.0125062471445,0.0136489839037,0.0132660411377,0.0125445561227,0.0113464668475,0.0129307050401,0.0126421143011,0.0134732559263,0.00458971616426]) # Creating weights for histo: y3_PHI_9 y3_PHI_9_weights = numpy.array([0.0,2.61802246854,2.60133245831,2.59814004154,5.23020691354,0.0,15.6477911358,2.60604494535,0.0,5.20757697778,10.4064480635,7.80670489196,5.21066480079,2.60351585296,2.60470714507,2.60135629953,2.61218252233,2.60470714507,2.60604494535,0.0,0.0,0.0,0.0,0.0,2.60701166852,7.81100784831,0.0,0.0,0.0,7.80410927485,2.60667135428,0.0,7.83303790812,2.61802246854,0.0,2.60604494535,10.4287049995,5.21164536725,7.82236319246,2.60667135428,13.0464098414,5.21241828434,0.0,5.21075324404,0.0,2.60874977064,2.60197540228,2.60399267743,7.82587785028,2.60133245831,2.59814004154,5.21457553055,2.60604494535,5.23106058317,2.60470714507,7.81999060616,7.82485113952,2.61044172846,2.6044372009,0.0,2.60351585296,7.82636236547,0.0,2.60300480479]) # Creating weights for histo: y3_PHI_10 y3_PHI_10_weights = numpy.array([10.5335910004,17.9040012762,23.176394945,12.6306880456,10.5294472014,11.5842268127,14.7584076502,12.6425538545,9.46950804093,13.6926740966,16.8492524452,11.5795751386,13.6923816837,13.6917276021,20.0110557511,17.9075564018,9.4749830883,16.8557932607,17.903435688,20.0082701332,14.73768096,14.7470304787,15.8020794176,11.5881551496,24.2072159337,22.1212536651,17.9044129628,17.9085259815,16.8582133625,12.6364324207,27.378738122,17.8999459705,12.649729514,22.1170790857,10.5394508017,18.9539599216,8.42599402255,20.0158459366,15.8019139735,15.7911331704,7.36884047998,14.7435907792,8.42418183189,17.9076025723,20.0077507155,14.7542946315,13.6905579504,12.6351358002,13.6940091925,11.5847192976,20.0214518003,13.6950595705,20.0204129649,21.0675590597,13.6900385327,22.1152476574,13.6914390367,12.6411110276,11.5789787701,13.6935474879,17.9041590252,26.3328040019,13.6906272061,2.10601948709]) # Creating weights for histo: y3_PHI_11 y3_PHI_11_weights = numpy.array([9.44674383257,29.9397340228,27.8731066755,28.1017085847,25.1099610684,26.9472564559,30.172408846,19.8076148085,25.106960176,26.0386085347,26.0258134366,25.341648402,24.6461906367,19.5785479724,27.4109692519,28.3264873339,27.6419572739,26.2546266762,22.575889982,29.2525719382,27.1843000558,23.9561967241,24.6429323055,28.5656711349,29.9387081096,29.7149629584,26.2613085607,21.4256260385,23.9587595861,28.0987845397,22.5725240643,28.1006557748,24.1812982325,26.9446244312,29.4851622292,23.7272221049,27.8719923877,27.8691067665,24.1858207041,27.4122910278,27.1809418229,24.8809672373,29.2567332268,24.8762449624,27.8613528603,26.4826675991,25.7946601927,26.0238230881,27.412344821,23.489909539,23.5014942899,27.4046062842,26.4849538103,27.8715005641,20.2693180441,24.4161824195,28.3299416261,27.1823058648,24.6431705325,27.8706129762,26.9499883822,25.3354122326,25.5614090137,11.0536006573]) # Creating weights for histo: y3_PHI_12 y3_PHI_12_weights = numpy.array([6.72726796428,17.4172678201,17.8886425817,16.7520971927,17.944810836,17.0301377455,17.1967112436,16.6431307795,17.1132244433,17.0310225879,16.366082789,17.0582949683,16.1445374974,16.8642105671,16.948012833,16.8629102335,16.9474434561,16.8086578553,16.1155569864,16.3103377202,17.9710714184,17.5575691944,16.7536398961,17.0851056919,17.3907340907,16.8077768601,17.305981581,17.5552301328,15.8948580658,17.2498056325,16.7804198426,18.0274820425,17.3061470081,17.2502595951,17.6123217008,17.1932911356,17.0015188658,17.527265267,16.0616970166,17.3628692506,17.278447595,16.9481051643,17.6663740277,17.0027999637,16.5592708065,16.6700761529,17.3076743229,17.308005177,17.1133667875,16.0051209655,16.8637412159,16.0596387963,17.9986823472,17.5282155108,16.7804429254,15.7844451276,18.0833463727,15.9778870564,17.5287541105,16.3085487998,16.2824267144,16.0612622897,16.449969692,7.11603307364]) # Creating weights for histo: y3_PHI_13 y3_PHI_13_weights = numpy.array([3.24574342161,8.94402484566,8.92249445894,8.57094475109,8.20642705101,8.59976318585,8.54957214059,9.0228947544,8.51954611086,7.7626753432,8.2272110348,8.60861685953,8.66034318884,8.26543536004,8.72174848287,9.10476847977,7.96491412511,9.16508147684,8.22753265558,8.30830801567,8.44772151751,8.78124225723,8.63001981161,8.52921293895,8.14717600931,8.51899389407,7.95474969508,8.26720730844,8.33709610885,8.68013803706,7.74251032768,8.31762288141,8.38875568669,8.43887391214,8.07621311689,8.6711083822,8.39851960783,7.99571689935,8.33746627616,8.56952476504,8.32710766,8.16581787741,8.14627789848,8.78159421958,8.61006111884,8.36829939198,8.74201059146,8.30747665632,8.66095002049,8.8520048952,8.62048041817,8.85185318729,8.41823556794,8.40863549133,8.70073390305,7.92425640498,8.62015879739,8.05551408952,8.53915890959,8.51847808717,8.01503841889,8.5283087598,8.62980742053,3.6698058699]) # Creating weights for histo: y3_PHI_14 y3_PHI_14_weights = numpy.array([1.20799430389,3.0725955575,2.91396359553,3.18006088322,3.10366758328,3.18840936687,3.10628920491,2.98475584358,2.98176602532,2.92835596735,2.86290968824,3.04702378159,3.2337475696,3.16864717219,2.99616609195,2.93102760523,3.18291142543,3.12329127139,2.98471236791,3.08111294221,3.18871138814,3.08651700697,2.96496094596,3.10636730722,3.19415354221,3.14293381178,3.16306612681,3.2366608245,3.04717036771,2.87450961367,2.90265915079,3.05251364348,2.96227045579,3.20555032467,3.20001775659,3.05240014504,3.14895692398,3.11494201827,2.93100836821,2.96208462614,3.13168515441,3.04143234822,3.06116722632,3.13215723098,2.79252795828,3.08382613207,3.21404500969,3.13751743533,3.14298575175,3.04707918422,3.18574273061,3.13764324546,3.10075125046,2.99617840365,2.95369651423,3.11775716435,3.17979271911,3.0556000316,3.15146312345,3.21107827586,3.10926863517,3.12893272103,3.05563889039,1.28151012979]) # Creating weights for histo: y3_PHI_15 y3_PHI_15_weights = numpy.array([0.153706755039,0.34279721466,0.355039102995,0.34277937227,0.367005556819,0.371466745144,0.399137928915,0.348665943055,0.362713812118,0.409741035079,0.353363099944,0.35486576004,0.316852488911,0.329050539321,0.310638847028,0.323042734812,0.34421716169,0.325806532851,0.333462808776,0.35667351319,0.380806468297,0.348776305918,0.358039696727,0.318318991581,0.359705537887,0.333650449275,0.336883348563,0.370093235593,0.354993847132,0.33059136559,0.347058355526,0.363850998622,0.384016916895,0.370417825299,0.315174831598,0.33498390207,0.350500637033,0.312385038025,0.318190313682,0.370069012481,0.338160083826,0.345785401432,0.357796047665,0.336712959646,0.349009674928,0.356814834373,0.36266512957,0.32742345514,0.343970322267,0.344343830843,0.341096279527,0.359537748524,0.348809863791,0.351774890904,0.359389928458,0.341038734865,0.330334836922,0.345925068353,0.338115064285,0.354786119173,0.325921031367,0.332092962232,0.312332810631,0.138718320248]) # Creating weights for histo: y3_PHI_16 y3_PHI_16_weights = numpy.array([0.0287080149553,0.0673545845564,0.0621131551273,0.0700586209649,0.0678915637002,0.066088680199,0.0705934434112,0.0626550253527,0.0635643429001,0.0680726877706,0.0673473827276,0.0534436551576,0.0606632767779,0.0630090318283,0.0608344646351,0.0653583300245,0.0646398031734,0.0644604121634,0.0588689815538,0.0628307191671,0.0716868890004,0.0691551573104,0.0653700763229,0.0626493255095,0.0677137517009,0.0686067784803,0.0653703073976,0.063737109768,0.0655417263297,0.0550786628726,0.0693325456728,0.0601222923389,0.0608450170475,0.0659000462001,0.0673442632188,0.0682489207593,0.0631939686316,0.0657346737233,0.0706028019375,0.0590490657879,0.0613778753587,0.058857119718,0.0659063622425,0.0585058091142,0.0734883090284,0.0655444607139,0.0641081772607,0.0615720166385,0.0707841185702,0.068979463496,0.0644614519997,0.0651866415053,0.0688019595963,0.0660875248254,0.0586813873912,0.0669897560813,0.0675264656379,0.0662739251019,0.0624796781504,0.0612147366043,0.0651733932212,0.0684232666378,0.0603113884872,0.0265366250396]) # Creating a new Canvas fig = plt.figure(figsize=(12,6),dpi=80) frame = gridspec.GridSpec(1,1,right=0.7) pad = fig.add_subplot(frame[0]) # Creating a new Stack pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights+y3_PHI_12_weights+y3_PHI_13_weights+y3_PHI_14_weights+y3_PHI_15_weights+y3_PHI_16_weights,\ label="$bg\_dip\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#e5e5e5", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights+y3_PHI_12_weights+y3_PHI_13_weights+y3_PHI_14_weights+y3_PHI_15_weights,\ label="$bg\_dip\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#f2f2f2", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights+y3_PHI_12_weights+y3_PHI_13_weights+y3_PHI_14_weights,\ label="$bg\_dip\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ccc6aa", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights+y3_PHI_12_weights+y3_PHI_13_weights,\ label="$bg\_dip\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ccc6aa", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights+y3_PHI_12_weights,\ label="$bg\_dip\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#c1bfa8", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights,\ label="$bg\_dip\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#bab5a3", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights,\ label="$bg\_dip\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b2a596", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights,\ label="$bg\_dip\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#b7a39b", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights,\ label="$bg\_vbf\_1600\_inf$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#ad998c", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights,\ label="$bg\_vbf\_1200\_1600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#9b8e82", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights,\ label="$bg\_vbf\_800\_1200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#876656", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights,\ label="$bg\_vbf\_600\_800$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#afcec6", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights,\ label="$bg\_vbf\_400\_600$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#84c1a3", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights,\ label="$bg\_vbf\_200\_400$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#89a8a0", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights,\ label="$bg\_vbf\_100\_200$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#829e8c", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights+y3_PHI_1_weights,\ label="$bg\_vbf\_0\_100$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#adbcc6", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") pad.hist(x=xData, bins=xBinning, weights=y3_PHI_0_weights,\ label="$signal$", histtype="step", rwidth=1.0,\ color=None, edgecolor="#7a8e99", linewidth=1, linestyle="solid",\ bottom=None, cumulative=False, normed=False, align="mid", orientation="vertical") # Axis plt.rc('text',usetex=False) plt.xlabel(r"\phi [ j_{1} ] ",\ fontsize=16,color="black") plt.ylabel(r"$\mathrm{Events}$ $(\mathcal{L}_{\mathrm{int}} = 40.0\ \mathrm{fb}^{-1})$ ",\ fontsize=16,color="black") # Boundary of y-axis ymax=(y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights+y3_PHI_12_weights+y3_PHI_13_weights+y3_PHI_14_weights+y3_PHI_15_weights+y3_PHI_16_weights).max()*1.1 ymin=0 # linear scale #ymin=min([x for x in (y3_PHI_0_weights+y3_PHI_1_weights+y3_PHI_2_weights+y3_PHI_3_weights+y3_PHI_4_weights+y3_PHI_5_weights+y3_PHI_6_weights+y3_PHI_7_weights+y3_PHI_8_weights+y3_PHI_9_weights+y3_PHI_10_weights+y3_PHI_11_weights+y3_PHI_12_weights+y3_PHI_13_weights+y3_PHI_14_weights+y3_PHI_15_weights+y3_PHI_16_weights) if x])/100. # log scale plt.gca().set_ylim(ymin,ymax) # Log/Linear scale for X-axis plt.gca().set_xscale("linear") #plt.gca().set_xscale("log",nonposx="clip") # Log/Linear scale for Y-axis plt.gca().set_yscale("linear") #plt.gca().set_yscale("log",nonposy="clip") # Legend plt.legend(bbox_to_anchor=(1.05,1), loc=2, borderaxespad=0.) # Saving the image plt.savefig('../../HTML/MadAnalysis5job_0/selection_2.png') plt.savefig('../../PDF/MadAnalysis5job_0/selection_2.png') plt.savefig('../../DVI/MadAnalysis5job_0/selection_2.eps') # Running! if __name__ == '__main__': selection_2()
139.561856
1,058
0.798633
4,091
27,075
5.107064
0.303593
0.052889
0.106256
0.012444
0.283157
0.278754
0.255684
0.25195
0.250132
0.249653
0
0.560079
0.060942
27,075
193
1,059
140.284974
0.261672
0.048643
0
0.185841
0
0.00885
0.039966
0.007775
0
0
0
0
0
1
0.00885
false
0
0.035398
0
0.044248
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
1
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
fe8f0e0ce74d6712def14370f9a9f8d8a96fdd3a
124
py
Python
semvermanager/__main__.py
jdrumgoole/semver_manager
55727989adbb6d8b74cbcec56206beef2c47417b
[ "Apache-2.0" ]
null
null
null
semvermanager/__main__.py
jdrumgoole/semver_manager
55727989adbb6d8b74cbcec56206beef2c47417b
[ "Apache-2.0" ]
6
2019-04-02T22:52:14.000Z
2021-03-21T11:53:50.000Z
semvermanager/__main__.py
jdrumgoole/semver_manager
55727989adbb6d8b74cbcec56206beef2c47417b
[ "Apache-2.0" ]
1
2020-01-08T22:29:36.000Z
2020-01-08T22:29:36.000Z
import sys from semvermanager import main if __name__ == "__main__": main(sys.argv[1:]) # clip off the program name
15.5
51
0.701613
18
124
4.388889
0.722222
0
0
0
0
0
0
0
0
0
0
0.010101
0.201613
124
7
52
17.714286
0.787879
0.201613
0
0
0
0
0.083333
0
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
fea23d9840333ad6fb446847ede7ef91e7a5eec4
50
py
Python
gsom/applications/zoo_experiment/gsmote/comparison_testing/__init__.py
AathmanT/self-learning-algorithm
64637a1b801d18b7648c575c84dad67bb3113e46
[ "Apache-2.0" ]
1
2020-01-28T04:11:52.000Z
2020-01-28T04:11:52.000Z
gsom/applications/zoo_experiment/gsmote/comparison_testing/__init__.py
AathmanT/self-learning-algorithm
64637a1b801d18b7648c575c84dad67bb3113e46
[ "Apache-2.0" ]
null
null
null
gsom/applications/zoo_experiment/gsmote/comparison_testing/__init__.py
AathmanT/self-learning-algorithm
64637a1b801d18b7648c575c84dad67bb3113e46
[ "Apache-2.0" ]
2
2020-02-15T01:25:30.000Z
2020-02-15T16:14:13.000Z
# from .linear_regression import linear_training
16.666667
48
0.84
6
50
6.666667
0.833333
0
0
0
0
0
0
0
0
0
0
0
0.12
50
2
49
25
0.909091
0.92
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
4
227fb8df5a9d87e1449653729b80ddf6cd8d45dc
2,320
py
Python
backEnd/app/api/wechat/wechat.py
HenryYDJ/flaskAPI
9947fbad1050d6ba29c29e365c561689ea3e22d8
[ "MIT" ]
null
null
null
backEnd/app/api/wechat/wechat.py
HenryYDJ/flaskAPI
9947fbad1050d6ba29c29e365c561689ea3e22d8
[ "MIT" ]
14
2022-03-27T13:34:58.000Z
2022-03-31T14:37:19.000Z
backEnd/app/api/wechat/wechat.py
HenryYDJ/flaskAPI
9947fbad1050d6ba29c29e365c561689ea3e22d8
[ "MIT" ]
null
null
null
# from flask import jsonify, request # from app.api import bluePrint # from app import db # from datetime import datetime # from app.models import User # import requests # from config import Config # # from WXBizDataCrypt import WXBizDataCrypt # @bluePrint.route('\wechat\updateuserinfo', methods=['POST']) # def wechat_update_userinfo(): # """ # This api receives the signature and raw data from the wechat applet. # And calculates the signature based on the session_key that is currently stored. # If the calculated signature is the same as the received signature, then the user info is correct and is stored. # Otherwise, an error message is sent to the wechat applet and the user info is not stored. # """ # appId = Config.WECHAT_APPID # session_key = 'tiihtNczf5v6AKRyjwEUhQ==' # encryptedData = 'CiyLU1Aw2KjvrjMdj8YKliAjtP4gsMZMQmRzooG2xrDcvSnxIMXFufNstNGTyaGS9uT5geRa0W4oTOb1WT7fJlAC+oNPdbB+3hVbJSRgv+4lGOETKUQz6OYStslQ142dNCuabNPGBzlooOmB231qMM85d2/fV6ChevvXvQP8Hkue1poOFtnEtpyxVLW1zAo6/1Xx1COxFvrc2d7UL/lmHInNlxuacJXwu0fjpXfz/YqYzBIBzD6WUfTIF9GRHpOn/Hz7saL8xz+W//FRAUid1OksQaQx4CMs8LOddcQhULW4ucetDf96JcR3g0gfRK4PC7E/r7Z6xNrXd2UIeorGj5Ef7b1pJAYB6Y5anaHqZ9J6nKEBvB4DnNLIVWSgARns/8wR2SiRS7MNACwTyrGvt9ts8p12PKFdlqYTopNHR1Vf7XjfhQlVsAJdNiKdYmYVoKlaRv85IfVunYzO0IKXsyl7JCUjCpoG20f0a04COwfneQAGGwd5oa+T8yO5hzuyDb/XcxxmK01EpqOyuxINew==' # iv = 'r7BXXKkLb8qrSNn05n0qiA==' # # pc = WXBizDataCrypt(appId, sessionKey) # # print pc.decrypt(encryptedData, iv) from flask import jsonify, request, current_app from app.api import bluePrint import requests @bluePrint.route('/wechat/test', methods=['POST']) def wechat_login(): """ This api logins a user through wechat. """ print(current_app.config.hi) current_app.config.hi="hello" print(current_app.config.hi) # code = request.json['code'] # wechat_code2session_url = 'https://api.weixin.qq.com/sns/jscode2session' # payload = { # 'appid': Config.WECHAT_APPID, # 'secret': Config.WECHAT_APP_SECRET, # 'js_code': code, # 'grant_type': 'authorization_code' # } # r = requests.get(wechat_code2session_url, params=payload) # print(r.url) # print(r.json()) # print('now text') # print(r.text) return jsonify(message="hi"), 201
40.701754
560
0.75
240
2,320
7.166667
0.458333
0.016279
0.027907
0.031395
0.089535
0
0
0
0
0
0
0.048057
0.156897
2,320
57
561
40.701754
0.831288
0.803017
0
0.222222
0
0
0.05679
0
0
0
0
0
0
1
0.111111
true
0
0.333333
0
0.555556
0.222222
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
1
0
0
4
228060ed7ec4f19ab6ba447ae1b72346c08c65bc
46
py
Python
cd_drive/__init__.py
josx/cd_drive
889932ee82f536ee72bc9ba4eed534c1ccf383b2
[ "MIT" ]
1
2020-10-07T20:11:38.000Z
2020-10-07T20:11:38.000Z
cd_drive/__init__.py
josx/cd_drive
889932ee82f536ee72bc9ba4eed534c1ccf383b2
[ "MIT" ]
null
null
null
cd_drive/__init__.py
josx/cd_drive
889932ee82f536ee72bc9ba4eed534c1ccf383b2
[ "MIT" ]
1
2020-10-07T21:21:48.000Z
2020-10-07T21:21:48.000Z
from .drive import Drive __version__ = "0.1"
11.5
24
0.717391
7
46
4.142857
0.857143
0
0
0
0
0
0
0
0
0
0
0.052632
0.173913
46
3
25
15.333333
0.710526
0
0
0
0
0
0.065217
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
4
2289b5e7dc9a50b6387b9676211e39e8ac079313
222
py
Python
src/meltano/core/logging/__init__.py
dotmesh-io/meltano
4616d44ded9dff4e9ad19a9004349e9baa16ddd5
[ "MIT" ]
4
2019-12-01T12:47:58.000Z
2021-02-09T00:42:52.000Z
src/meltano/core/logging/__init__.py
dotmesh-io/meltano
4616d44ded9dff4e9ad19a9004349e9baa16ddd5
[ "MIT" ]
38
2019-12-09T06:53:33.000Z
2022-03-29T22:29:19.000Z
src/meltano/core/logging/__init__.py
dotmesh-io/meltano
4616d44ded9dff4e9ad19a9004349e9baa16ddd5
[ "MIT" ]
1
2020-11-23T20:47:18.000Z
2020-11-23T20:47:18.000Z
from .utils import ( setup_logging, remove_ansi_escape_sequences, capture_subprocess_output, ) from .output_logger import OutputLogger from .job_logging_service import JobLoggingService, MissingJobLogException
27.75
74
0.828829
24
222
7.291667
0.75
0
0
0
0
0
0
0
0
0
0
0
0.130631
222
7
75
31.714286
0.906736
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.428571
0
0.428571
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
4
22bf101f8ac69cc6fd010255742e8755c35d9adc
290
py
Python
bchscript/errors.py
gandrewstone/bchscript
c73a69f259b4cfb71546903c736e4a94fd0680d7
[ "MIT" ]
7
2018-05-31T18:21:37.000Z
2020-07-13T05:20:05.000Z
bchscript/errors.py
gandrewstone/bchscript
c73a69f259b4cfb71546903c736e4a94fd0680d7
[ "MIT" ]
1
2018-06-19T18:14:48.000Z
2018-06-19T18:14:48.000Z
bchscript/errors.py
gandrewstone/bchscript
c73a69f259b4cfb71546903c736e4a94fd0680d7
[ "MIT" ]
4
2018-06-01T00:29:32.000Z
2020-07-13T05:19:30.000Z
class Error(Exception): """Base class for exceptions in this module.""" pass class Parse(Error): """ Error parsing the program""" pass class Output(Error): """ Error parsing the program""" pass class Symbol(Error): """ Error parsing the program""" pass
16.111111
51
0.627586
35
290
5.2
0.457143
0.148352
0.28022
0.32967
0.565934
0.565934
0.395604
0
0
0
0
0
0.244828
290
17
52
17.058824
0.83105
0.410345
0
0.5
0
0
0
0
0
0
0
0
0
1
0
true
0.5
0
0
0.5
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
1
0
0
0
0
0
4
22d5f238f725030ac6d37dca2278aafa5f220bd9
119
py
Python
tests/wasp1/AllAnswerSets/grounding_backjump_13.test.py
bernardocuteri/wasp
05c8f961776dbdbf7afbf905ee00fc262eba51ad
[ "Apache-2.0" ]
19
2015-12-03T08:53:45.000Z
2022-03-31T02:09:43.000Z
tests/wasp1/AllAnswerSets/grounding_backjump_13.test.py
bernardocuteri/wasp
05c8f961776dbdbf7afbf905ee00fc262eba51ad
[ "Apache-2.0" ]
80
2017-11-25T07:57:32.000Z
2018-06-10T19:03:30.000Z
tests/wasp1/AllAnswerSets/grounding_backjump_13.test.py
bernardocuteri/wasp
05c8f961776dbdbf7afbf905ee00fc262eba51ad
[ "Apache-2.0" ]
6
2015-01-15T07:51:48.000Z
2020-06-18T14:47:48.000Z
input = """ num(2). node(a). p(N) :- num(N), #count{Y:node(Y)} = N1, <=(N,N1). """ output = """ {node(a), num(2)} """
11.9
49
0.428571
21
119
2.428571
0.52381
0.156863
0
0
0
0
0
0
0
0
0
0.040404
0.168067
119
9
50
13.222222
0.474747
0
0
0.25
0
0.125
0.731092
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
1
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
4
22dce824e3f9ea1558bba3a7c011c8a1ea89cec9
582
py
Python
lib/JumpScale/sal/bind/base.py
Jumpscale/jumpscale_core8
f80ac9b1ab99b833ee7adb17700dcf4ef35f3734
[ "Apache-2.0" ]
8
2016-04-14T14:04:57.000Z
2020-06-09T00:24:34.000Z
lib/JumpScale/sal/bind/base.py
Jumpscale/jumpscale_core8
f80ac9b1ab99b833ee7adb17700dcf4ef35f3734
[ "Apache-2.0" ]
418
2016-01-25T10:30:00.000Z
2021-09-08T12:29:13.000Z
lib/JumpScale/sal/bind/base.py
Jumpscale/jumpscale_core8
f80ac9b1ab99b833ee7adb17700dcf4ef35f3734
[ "Apache-2.0" ]
9
2016-04-21T07:21:17.000Z
2022-01-24T10:35:54.000Z
class DNS: def start(self): raise NotImplemented() def stop(self): raise NotImplemented() def restart(self): raise NotImplemented() def cleanCache(self): raise NotImplemented() def addRecord(self): raise NotImplemented() def deleteHost(self, host): raise NotImplemented() def updateHostIp(self, host, ip): raise NotImplemented() def zones(self): raise NotImplemented() def map(self): raise NotImplemented() def reversemap(self): raise NotImplemented()
18.1875
37
0.606529
55
582
6.418182
0.327273
0.538244
0.560907
0.515581
0
0
0
0
0
0
0
0
0.300687
582
31
38
18.774194
0.867322
0
0
0.47619
0
0
0
0
0
0
0
0
0
1
0.47619
false
0
0
0
0.52381
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
4
fe0853de26d5d19e70276f09cc6aabbf4ccf4bdc
88
py
Python
src/projectone/oficina/apps.py
krixapolinario/django-project-one
621b7f91eef2f4da5e5096eb503b2f7dfe993295
[ "MIT" ]
1
2017-10-20T21:05:41.000Z
2017-10-20T21:05:41.000Z
src/projectone/oficina/apps.py
krixapolinario/django-project-one
621b7f91eef2f4da5e5096eb503b2f7dfe993295
[ "MIT" ]
null
null
null
src/projectone/oficina/apps.py
krixapolinario/django-project-one
621b7f91eef2f4da5e5096eb503b2f7dfe993295
[ "MIT" ]
null
null
null
from django.apps import AppConfig class OficinaConfig(AppConfig): name = 'oficina'
17.6
33
0.761364
10
88
6.7
0.9
0
0
0
0
0
0
0
0
0
0
0
0.159091
88
4
34
22
0.905405
0
0
0
0
0
0.079545
0
0
0
0
0
0
1
0
false
0
0.333333
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
4
a3ca3f5ecdafe6a54c1bfb6b7539f53f3eae8baf
1,678
py
Python
tests/test_views.py
cromulus/check-list
5e6d7f657ac14688dae181839d1bf38cedf6a232
[ "MIT" ]
null
null
null
tests/test_views.py
cromulus/check-list
5e6d7f657ac14688dae181839d1bf38cedf6a232
[ "MIT" ]
null
null
null
tests/test_views.py
cromulus/check-list
5e6d7f657ac14688dae181839d1bf38cedf6a232
[ "MIT" ]
null
null
null
from base import * class ViewsTestCase(BaseTestCase): def test_base(self): self.expect_view_200('/') def test_client_views(self): self.expect_view_200('/receipt/1') self.expect_view_200('/list/1/agreement') def test_no_user_views(self): """ For following views should redirect to /dashboard if user signed in, otherwise returns base /, /new, /sign-in, /reset-password """ # before logging in expect 200's self.expect_view_200('/') self.expect_view_200('/new') self.expect_view_200('/sign-in') self.expect_view_200('/reset-password') # after logging in expect 302 self.login() self.expect_redirect_302('/') self.expect_redirect_302('/new') self.expect_redirect_302('/sign-in') self.expect_redirect_302('/reset-password') def test_user_views(self): """ Redirect to '/' if no user signed in for following endpoints: /dashboard, /list/<id> """ self.expect_redirect_302('/dashboard') self.expect_redirect_302('/list/2') self.expect_redirect_302('/list/2/clean') # after logging in should get 200 self.login() self.expect_view_200('/dashboard') self.expect_view_200('/list/2/clean') def test_help_pages(self): self.expect_view_200('/help/') self.expect_view_200('/help/create-an-account/') self.expect_view_200('/help/use-menu/') self.expect_view_200('/help/create-a-new-list/') self.expect_view_200('/help/finished/') self.expect_view_200('/help/process-feedback/') self.expect_view_200('/help/delete-a-list/') self.expect_view_200('/help/sign-into-your-account/') self.expect_view_200('/help/reset-your-password/') def test_info_page(self): self.expect_view_200('/info/')
25.044776
75
0.716925
250
1,678
4.556
0.248
0.22827
0.233538
0.283582
0.337138
0.186128
0
0
0
0
0
0.06267
0.125149
1,678
66
76
25.424242
0.713215
0.187128
0
0.111111
0
0
0.243446
0.094382
0
0
0
0
0
1
0.166667
false
0.083333
0.027778
0
0.222222
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
4
a3dac44cf87e1d3aa37eaea055dde3d05f105fef
881
py
Python
roman_numerals/2021-11-29/test.py
rbuchmeier/kata
aefd50ca9c8dd0daa04dcf1b6f4ec4eef7dd8f2f
[ "MIT" ]
null
null
null
roman_numerals/2021-11-29/test.py
rbuchmeier/kata
aefd50ca9c8dd0daa04dcf1b6f4ec4eef7dd8f2f
[ "MIT" ]
null
null
null
roman_numerals/2021-11-29/test.py
rbuchmeier/kata
aefd50ca9c8dd0daa04dcf1b6f4ec4eef7dd8f2f
[ "MIT" ]
null
null
null
import unittest from main import * class Test(unittest.TestCase): def test_1(self): self.assertEqual(1, 1) class TestRomanNumerals(unittest.TestCase): def test_roman_numeral(self): self.assertEqual(roman_numeral(1), 'I') self.assertEqual(roman_numeral(2), 'II') self.assertEqual(roman_numeral(4), 'IV') self.assertEqual(roman_numeral(5), 'V') self.assertEqual(roman_numeral(9), 'IX') self.assertEqual(roman_numeral(49), 'XLIX') self.assertEqual(roman_numeral(99), 'XCIX') self.assertEqual(roman_numeral(3333), 'MMMCCCXXXIII') self.assertEqual(roman_numeral(3999), 'MMMCMXCIX') self.assertEqual(roman_numeral(4000), 'Invalid') self.assertEqual(roman_numeral(0), 'Invalid') self.assertEqual(roman_numeral(-1), 'Invalid') if __name__ == '__main__': unittest.main()
35.24
61
0.673099
103
881
5.533981
0.349515
0.342105
0.421053
0.568421
0.170175
0
0
0
0
0
0
0.036262
0.186152
881
24
62
36.708333
0.758717
0
0
0
0
0
0.074915
0
0
0
0
0
0.619048
1
0.095238
false
0
0.095238
0
0.285714
0
0
0
0
null
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
4