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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d1896860c8e8e07a37b69ec3bdf54827e8f0d6ab | 234 | py | Python | fiasco_api/colorizer/urls.py | xelnod/fiasco_backend | edeca8cac8c7b1a1cc53051d4443cc2996eba37c | [
"MIT"
] | null | null | null | fiasco_api/colorizer/urls.py | xelnod/fiasco_backend | edeca8cac8c7b1a1cc53051d4443cc2996eba37c | [
"MIT"
] | null | null | null | fiasco_api/colorizer/urls.py | xelnod/fiasco_backend | edeca8cac8c7b1a1cc53051d4443cc2996eba37c | [
"MIT"
] | null | null | null | from django.urls import path
from .views import ColourListCreateView, ColourRetrieveUpdateDestroyView
urlpatterns = [
path('', ColourListCreateView.as_view()),
path('<int:pk>/', ColourRetrieveUpdateDestroyView.as_view()),
]
| 26 | 72 | 0.764957 | 21 | 234 | 8.428571 | 0.619048 | 0.067797 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 234 | 8 | 73 | 29.25 | 0.855072 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d18b316f87acbcf08d392b0a7eb06a4654256c09 | 804 | py | Python | group_pitch.py | erikwii/sscode | f060493398a6a138fa2b0df01f7e06506d68fa32 | [
"MIT"
] | null | null | null | group_pitch.py | erikwii/sscode | f060493398a6a138fa2b0df01f7e06506d68fa32 | [
"MIT"
] | 4 | 2020-08-02T07:57:03.000Z | 2020-08-02T07:57:10.000Z | group_pitch.py | erikwii/sscode | f060493398a6a138fa2b0df01f7e06506d68fa32 | [
"MIT"
] | null | null | null | import glob
import os
path = os.path.dirname(os.path.abspath(__file__))
dataset_path = path + "/img/originals-resized/"
c1 = glob.glob1(dataset_path, "*c1*")
d1 = glob.glob1(dataset_path, "*d1*")
e1 = glob.glob1(dataset_path, "*e1*")
f1 = glob.glob1(dataset_path, "*f1*")
g1 = glob.glob1(dataset_path, "*g1*")
a1 = glob.glob1(dataset_path, "*a1*")
b1 = glob.glob1(dataset_path, "*h*")
c2 = glob.glob1(dataset_path, "*c2*")
d2 = glob.glob1(dataset_path, "*d2*")
e2 = glob.glob1(dataset_path, "*e2*")
f2 = glob.glob1(dataset_path, "*f2*")
g2 = glob.glob1(dataset_path, "*g2*")
a2 = glob.glob1(dataset_path, "*a2*")
b2 = glob.glob1(dataset_path, "*h1*")
c3 = glob.glob1(dataset_path, "*c3*")
pitch = [c1,d1,e1,f1,g1, a1,b1,c2,d2,e2,f2,g2, a2,b2,c3]
# do re mi fa sol la si do re mi fa sol la si do | 33.5 | 56 | 0.661692 | 139 | 804 | 3.683453 | 0.266187 | 0.34375 | 0.46875 | 0.585938 | 0.0625 | 0.0625 | 0.0625 | 0.0625 | 0 | 0 | 0 | 0.084046 | 0.126866 | 804 | 24 | 57 | 33.5 | 0.645299 | 0.057214 | 0 | 0 | 0 | 0 | 0.109333 | 0.030667 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.1 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d19740eb78e3cc10ac53fb630b797bba20b9e6a9 | 319 | py | Python | lib/move_avge.py | SCWhite/co2_compare | e0d54893e9e77af7bcb0cc6f111bd315dcdd799c | [
"MIT"
] | 1 | 2019-09-03T00:37:26.000Z | 2019-09-03T00:37:26.000Z | lib/move_avge.py | SCWhite/co2_compare | e0d54893e9e77af7bcb0cc6f111bd315dcdd799c | [
"MIT"
] | null | null | null | lib/move_avge.py | SCWhite/co2_compare | e0d54893e9e77af7bcb0cc6f111bd315dcdd799c | [
"MIT"
] | null | null | null | class move_avg:
def __init__(self, bufmax):
self.buf = []
self.bufmax = bufmax
def add(self, val):
self.buf.append(val)
if len(self.buf) > self.bufmax:
del self.buf[0]
def get(self):
if len(self.buf) > 0:
avg = sum(self.buf)/len(self.buf)
else:
avg = 0
return avg
| 15.95 | 36 | 0.570533 | 50 | 319 | 3.54 | 0.38 | 0.276836 | 0.169492 | 0.19209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013158 | 0.285266 | 319 | 19 | 37 | 16.789474 | 0.763158 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0 | 0 | 0.357143 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d1a6c9a7eb6628630fb1d7c48f13ea9ed13a4a3f | 10,689 | py | Python | plata/discount/migrations/0002_auto__del_field_discount_config_json__add_field_discount_config__del_f.py | stefanklug/plata | d0a1ff7f587bef8f8bbbdac8b8b7ed32c7e3ae41 | [
"BSD-3-Clause"
] | null | null | null | plata/discount/migrations/0002_auto__del_field_discount_config_json__add_field_discount_config__del_f.py | stefanklug/plata | d0a1ff7f587bef8f8bbbdac8b8b7ed32c7e3ae41 | [
"BSD-3-Clause"
] | null | null | null | plata/discount/migrations/0002_auto__del_field_discount_config_json__add_field_discount_config__del_f.py | stefanklug/plata | d0a1ff7f587bef8f8bbbdac8b8b7ed32c7e3ae41 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_column('discount_discount', 'config_json', 'config')
db.rename_column('discount_applieddiscount', 'config_json', 'config')
def backwards(self, orm):
db.rename_column('discount_discount', 'config', 'config_json')
db.rename_column('discount_applieddiscount', 'config', 'config_json')
models = {
'auth.group': {
'Meta': {'object_name': 'Group'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
},
'auth.permission': {
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
},
'auth.user': {
'Meta': {'object_name': 'User'},
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
},
'contenttypes.contenttype': {
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'discount.applieddiscount': {
'Meta': {'ordering': "['type', 'name']", 'object_name': 'AppliedDiscount'},
'code': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
'config': ('plata.fields.JSONField', [], {'blank': 'True'}),
'currency': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'applied_discounts'", 'to': "orm['shop.Order']"}),
'remaining': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '18', 'decimal_places': '10'}),
'tax_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shop.TaxClass']", 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.PositiveIntegerField', [], {}),
'value': ('django.db.models.fields.DecimalField', [], {'max_digits': '18', 'decimal_places': '10'})
},
'discount.discount': {
'Meta': {'object_name': 'Discount'},
'allowed_uses': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
'code': ('django.db.models.fields.CharField', [], {'default': "u'wTmLJcoag3'", 'unique': 'True', 'max_length': '30'}),
'config': ('plata.fields.JSONField', [], {'blank': 'True'}),
'currency': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'tax_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['shop.TaxClass']", 'null': 'True', 'blank': 'True'}),
'type': ('django.db.models.fields.PositiveIntegerField', [], {}),
'used': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
'valid_from': ('django.db.models.fields.DateField', [], {'default': 'datetime.date.today'}),
'valid_until': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
'value': ('django.db.models.fields.DecimalField', [], {'max_digits': '18', 'decimal_places': '10'})
},
'shop.order': {
'Meta': {'object_name': 'Order'},
'_order_id': ('django.db.models.fields.CharField', [], {'max_length': '20', 'blank': 'True'}),
'billing_address': ('django.db.models.fields.TextField', [], {}),
'billing_city': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'billing_company': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'billing_country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}),
'billing_first_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'billing_last_name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'billing_zip_code': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
'confirmed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'currency': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
'data': ('plata.fields.JSONField', [], {'blank': 'True'}),
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'items_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '18', 'decimal_places': '10'}),
'items_subtotal': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '18', 'decimal_places': '10'}),
'items_tax': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '18', 'decimal_places': '10'}),
'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'paid': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '18', 'decimal_places': '10'}),
'shipping_address': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'shipping_city': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_company': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_cost': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '10', 'blank': 'True'}),
'shipping_country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'blank': 'True'}),
'shipping_discount': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '18', 'decimal_places': '10', 'blank': 'True'}),
'shipping_first_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_last_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_method': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
'shipping_same_as_billing': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'shipping_tax': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '18', 'decimal_places': '10'}),
'shipping_zip_code': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
'status': ('django.db.models.fields.PositiveIntegerField', [], {'default': '10'}),
'total': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '18', 'decimal_places': '10'}),
'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'orders'", 'null': 'True', 'to': "orm['auth.User']"})
},
'shop.taxclass': {
'Meta': {'ordering': "['-priority']", 'object_name': 'TaxClass'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'priority': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
'rate': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'})
}
}
complete_apps = ['discount']
| 81.59542 | 182 | 0.565909 | 1,091 | 10,689 | 5.405133 | 0.133822 | 0.1126 | 0.194675 | 0.278108 | 0.785993 | 0.751738 | 0.688655 | 0.626929 | 0.57843 | 0.470917 | 0 | 0.017526 | 0.183273 | 10,689 | 130 | 183 | 82.223077 | 0.657961 | 0.001965 | 0 | 0.186992 | 0 | 0 | 0.588881 | 0.309957 | 0 | 0 | 0 | 0 | 0 | 1 | 0.01626 | false | 0.00813 | 0.03252 | 0 | 0.073171 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d1c56541321412e4afd9e1b32a69a3ec3080f873 | 1,420 | py | Python | models/school.py | DiegoDigo/ApiSchool | ce34e674e4154c41e91320956a578a0ec965e470 | [
"MIT"
] | null | null | null | models/school.py | DiegoDigo/ApiSchool | ce34e674e4154c41e91320956a578a0ec965e470 | [
"MIT"
] | null | null | null | models/school.py | DiegoDigo/ApiSchool | ce34e674e4154c41e91320956a578a0ec965e470 | [
"MIT"
] | null | null | null | import uuid
import mongoengine_goodjson as gj
import mongoengine as db
from datetime import datetime
class Address(gj.EmbeddedDocument):
address = db.StringField(required=True, max_length=200)
neighborhood = db.StringField(required=True, max_length=100)
zip_code = db.IntField(required=True)
county = db.StringField(required=True, max_length=200)
state = db.StringField(required=True, max_length=100)
meta = {
'indexes': [
{
'fields': ['+county']
},
{
'fields': ['#zip_code']
},
{
'fields': ['#state']
}]
}
class School(gj.Document):
id = db.UUIDField(primary_key=True, default=uuid.uuid4)
code_inep = db.StringField(required=True, max_length=10, unique=True)
address = db.EmbeddedDocumentField(Address)
nameSchool = db.StringField(required=True, unique=True, max_length=200)
admDependency = db.StringField(required=True, max_length=100)
locate = db.StringField(required=True, max_length=100)
create_at = db.DateTimeField(default=datetime.now)
update_at = db.DateTimeField(default=datetime.now)
meta = {
'indexes': [
{
'fields': ['+nameSchool']
},
{
'fields': ['#locate']
}]
}
def __str__(self):
return self.nameSchool
| 29.583333 | 75 | 0.59507 | 146 | 1,420 | 5.657534 | 0.356164 | 0.130751 | 0.20339 | 0.242131 | 0.394673 | 0.394673 | 0.268765 | 0 | 0 | 0 | 0 | 0.023645 | 0.285211 | 1,420 | 47 | 76 | 30.212766 | 0.790148 | 0 | 0 | 0.142857 | 0 | 0 | 0.059155 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.02381 | false | 0 | 0.095238 | 0.02381 | 0.547619 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
d1cfffd354bef6683bd695ab3313066689d11232 | 376 | py | Python | customs/utils/exceptions.py | fin09pcap/customs | 4a419cb2809bec0d186f416c410b849010b02f94 | [
"MIT"
] | null | null | null | customs/utils/exceptions.py | fin09pcap/customs | 4a419cb2809bec0d186f416c410b849010b02f94 | [
"MIT"
] | null | null | null | customs/utils/exceptions.py | fin09pcap/customs | 4a419cb2809bec0d186f416c410b849010b02f94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8; -*-
class ConsulSSLError(Exception):
"""
Error raised when https is defined in --host argument or
environmental variable and ssl certificates are not configured
or defined
"""
def __init__(self, msg):
self.msg = "https scheme defined without any ssl certificates provided"
def __str__(self):
return self.msg
| 25.066667 | 79 | 0.664894 | 46 | 376 | 5.26087 | 0.73913 | 0.086777 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003534 | 0.24734 | 376 | 14 | 80 | 26.857143 | 0.85159 | 0.409574 | 0 | 0 | 0 | 0 | 0.292929 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.2 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
06113c640a7a8b2165d2f56327ce192845b5ffb2 | 147 | py | Python | src/python/baekjoon/10871.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/10871.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | src/python/baekjoon/10871.py | Hyeon9mak/Baekjoon | 1595eeb260eaf41cc191bd4bbda5a9a2a817f1bd | [
"MIT"
] | null | null | null | N, X = input().split()
A = list(map(int, input().split()))
B = []
for i in range(0, int(N)) :
if(A[i] < int(X)) :
print(A[i], end=" ") | 21 | 35 | 0.462585 | 27 | 147 | 2.518519 | 0.62963 | 0.294118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009009 | 0.244898 | 147 | 7 | 36 | 21 | 0.603604 | 0 | 0 | 0 | 0 | 0 | 0.006757 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.166667 | 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 | 0 | 0 | 3 |
ae0dd842d3c9435a0c7d950a3efe3e136257934e | 269 | py | Python | generalinfo/admin.py | Dachckol/MichalDackoTutoring | 205654e7cdfd474400cf35a7015b213fa146a1e6 | [
"Apache-2.0"
] | null | null | null | generalinfo/admin.py | Dachckol/MichalDackoTutoring | 205654e7cdfd474400cf35a7015b213fa146a1e6 | [
"Apache-2.0"
] | 1 | 2021-06-10T18:43:43.000Z | 2021-06-10T18:43:43.000Z | generalinfo/admin.py | Dachckol/MichalDackoTutoring | 205654e7cdfd474400cf35a7015b213fa146a1e6 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from generalinfo.models import Profile
class ProfileAdmin(admin.ModelAdmin):
list_display = ("name","accepting","active")
list_editable = ("accepting","active")
# Register your models here.
admin.site.register(Profile, ProfileAdmin) | 29.888889 | 45 | 0.784387 | 32 | 269 | 6.53125 | 0.65625 | 0.143541 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096654 | 269 | 9 | 46 | 29.888889 | 0.860082 | 0.096654 | 0 | 0 | 0 | 0 | 0.140496 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
ae2a51efdbaec359350ba2dc138bf288769c5352 | 772 | py | Python | container/src/views/general.py | PowercoderJr/oonote | 619e7a0146c0239232b3d9a7effe597ab899b88e | [
"MIT"
] | null | null | null | container/src/views/general.py | PowercoderJr/oonote | 619e7a0146c0239232b3d9a7effe597ab899b88e | [
"MIT"
] | null | null | null | container/src/views/general.py | PowercoderJr/oonote | 619e7a0146c0239232b3d9a7effe597ab899b88e | [
"MIT"
] | null | null | null | from flask import request, render_template, redirect, url_for, session
from app import app
from handlers.note import create_note, hash_password
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST' and len(text := request.form['text'].strip()) > 0:
password = request.form['password']
password = hash_password(password) if len(password) > 0 else None
note = create_note(text[:500], password)
session['password'] = note.password
return redirect(url_for('.details', note_id=note.id_))
return render_template('index.html')
@app.route('/about/')
def about():
return render_template('about.html')
@app.errorhandler(404)
def handler_404(e):
return render_template('error/404.html'), 404
| 29.692308 | 82 | 0.683938 | 103 | 772 | 5 | 0.417476 | 0.108738 | 0.116505 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02648 | 0.168394 | 772 | 25 | 83 | 30.88 | 0.775701 | 0 | 0 | 0 | 0 | 0 | 0.104922 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0.277778 | 0.166667 | 0.111111 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 3 |
ae333e405a96e239a3f3b5ca1e2130083d6833ed | 1,024 | py | Python | kubedriver/kegd/scripting/ready_result_holder.py | manojn97/kubernetes-driver | 06f554e7e74927d528bce51807ed52b4a3a77aa4 | [
"Apache-2.0"
] | 2 | 2021-07-19T07:11:36.000Z | 2021-08-20T00:42:31.000Z | kubedriver/kegd/scripting/ready_result_holder.py | manojn97/kubernetes-driver | 06f554e7e74927d528bce51807ed52b4a3a77aa4 | [
"Apache-2.0"
] | 39 | 2020-08-21T07:39:31.000Z | 2022-03-21T09:26:08.000Z | kubedriver/kegd/scripting/ready_result_holder.py | manojn97/kubernetes-driver | 06f554e7e74927d528bce51807ed52b4a3a77aa4 | [
"Apache-2.0"
] | 11 | 2020-09-29T06:03:50.000Z | 2022-03-07T06:29:36.000Z |
#Duplicates of ReadyResult constants - keeps this class clean of imported modules leaking into the sandbox
NOT_READY = 'NotReady'
READY = 'Ready'
FAILED = 'Failed'
class ReadyResultHolder:
def __init__(self):
self.__readiness = READY
self.__reason = None
def ready(self):
self.__readiness = READY
return self
def not_ready(self):
self.__readiness = NOT_READY
return self
def notReady(self):
return self.not_ready()
def failed(self, reason):
self.__readiness = FAILED
self.__reason = str(reason)
return self
def is_ready(self):
return self.__readiness == READY
def has_failed(self):
return (self.__readiness == FAILED), self.__reason
def __str__(self):
return f'{self.__class__.__name__}(readiness: {self.__readiness}, reason: {self.__reason})'
def __repr__(self):
return f'{self.__class__.__name__}(readiness: {self.__readiness!r}, reason: {self.__reason!r}'
| 24.380952 | 106 | 0.650391 | 119 | 1,024 | 5.092437 | 0.277311 | 0.171617 | 0.084158 | 0.072607 | 0.247525 | 0.151815 | 0.151815 | 0.151815 | 0.151815 | 0 | 0 | 0 | 0.25 | 1,024 | 42 | 107 | 24.380952 | 0.789063 | 0.102539 | 0 | 0.185185 | 0 | 0.074074 | 0.200436 | 0.101307 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.185185 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ae36e4d27f1fc81ccecf0614a7eed5eafd409fa6 | 1,477 | py | Python | opnfv_testapi/common/message.py | opnfv/dovetail-webportal | 7a13dabbedff1184c12e3e4f5cf56545f1d01397 | [
"Apache-2.0"
] | 2 | 2018-09-05T15:00:25.000Z | 2019-02-25T14:11:47.000Z | opnfv_testapi/common/message.py | opnfv/dovetail-webportal | 7a13dabbedff1184c12e3e4f5cf56545f1d01397 | [
"Apache-2.0"
] | 5 | 2020-10-27T21:16:33.000Z | 2022-01-13T01:08:02.000Z | opnfv_testapi/common/message.py | opnfv/dovetail-webportal | 7a13dabbedff1184c12e3e4f5cf56545f1d01397 | [
"Apache-2.0"
] | 8 | 2018-07-27T03:09:34.000Z | 2019-11-07T06:57:17.000Z | ##############################################################################
# Copyright (c) 2017 ZTE Corp
# feng.xiaowei@zte.com.cn
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
not_found_base = 'Could Not Found'
exist_base = 'Already Exists'
def key_error(key):
return "KeyError: '{}'".format(key)
def no_file_uploaded():
return "Please upload a file."
def no_body():
return 'No Body'
def not_found(key, value):
return '{} {} [{}]'.format(not_found_base, key, value)
def missing(name):
return '{} Missing'.format(name)
def exist(key, value):
return '{} [{}] {}'.format(key, value, exist_base)
def bad_format(error):
return 'Bad Format [{}]'.format(error)
def unauthorized():
return 'No Authentication Header'
def invalid_token():
return 'Invalid Token'
def no_update():
return 'Nothing to update'
def must_int(name):
return '{} must be int'.format(name)
def no_auth():
return 'No permission to operate. Please ask Administrator for details.'
def invalid_credentials():
return 'Invalid UserName or Password'
def req_username():
return 'UserName is Required'
def req_password():
return 'Password is Required'
| 20.802817 | 78 | 0.619499 | 183 | 1,477 | 4.896175 | 0.469945 | 0.035714 | 0.026786 | 0.044643 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006488 | 0.1652 | 1,477 | 70 | 79 | 21.1 | 0.720195 | 0.193636 | 0 | 0 | 0 | 0 | 0.30642 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.46875 | false | 0.09375 | 0 | 0.46875 | 0.9375 | 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 | 0 | 0 | 0 | 3 |
ae727aefc089f165681ee19969f2512d8abc1517 | 896 | py | Python | src/activeledgerPythonSDK/classes/events.py | activeledger/SDK-Python | 2da93a5d6bd38965d24fce1ef18a7b18c93cdf6b | [
"MIT"
] | null | null | null | src/activeledgerPythonSDK/classes/events.py | activeledger/SDK-Python | 2da93a5d6bd38965d24fce1ef18a7b18c93cdf6b | [
"MIT"
] | null | null | null | src/activeledgerPythonSDK/classes/events.py | activeledger/SDK-Python | 2da93a5d6bd38965d24fce1ef18a7b18c93cdf6b | [
"MIT"
] | null | null | null | from sseclient import SSEClient
class Events(object):
def subscribe(self,host,port):
messages = SSEClient("http://"+host+":"+port+"/api/activity/subscribe")
print("msg")
for msg in messages:
print(msg)
return messages
def subscribeStream(self,host,port,stream):
messages = SSEClient("http://"+host+":"+port+"/api/activity/subscribe/"+stream)
return messages
def contractEventSubscribe(self,host,port,contract,event):
messages = SSEClient("http://"+host+":"+port+"/api/events/"+contract+"/"+event)
return messages
def contractSubscribe(self,host,port,contract):
messages = SSEClient("http://"+host+":"+port+"/api/events"+contract)
return messages
def eventsubscribe(self,host,port):
messages = SSEClient("http://"+host+":"+port+"/api/events")
return messages | 28.903226 | 87 | 0.63058 | 95 | 896 | 5.947368 | 0.284211 | 0.141593 | 0.106195 | 0.221239 | 0.446018 | 0.446018 | 0.446018 | 0.435398 | 0.155752 | 0 | 0 | 0 | 0.206473 | 896 | 31 | 88 | 28.903226 | 0.794655 | 0 | 0 | 0.25 | 0 | 0 | 0.139353 | 0.052397 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.05 | 0 | 0.6 | 0.1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
ae863bfab4d2e622062f0b9807226358ee9f4401 | 885 | py | Python | zombie/script.py | Vikas99Kr/Zombie | b94b3bc767d94d5a963ae0ccb7f82eb65e970a60 | [
"BSD-3-Clause"
] | null | null | null | zombie/script.py | Vikas99Kr/Zombie | b94b3bc767d94d5a963ae0ccb7f82eb65e970a60 | [
"BSD-3-Clause"
] | null | null | null | zombie/script.py | Vikas99Kr/Zombie | b94b3bc767d94d5a963ae0ccb7f82eb65e970a60 | [
"BSD-3-Clause"
] | null | null | null | class Zombie:
def __init__(self):
pass
def on_start(self):
pass
def on_update(self):
pass
def on_collide(self, other):
pass
class Script:
def __init__(self, name):
self.name = name
self.instance=None
def get_instance(self, game_object):
if not self.instance:
obj=self.name()
obj.__dict__.update({"game_object": game_object})
return obj
return self.instance
def __repr__(self):
return str(self.name)
class ScriptManager:
behaviours = {}
@staticmethod
def require_import(list_packages=[]):
for pkg in list_packages:
exec(f'import {pkg}')
pass
@staticmethod
def bind(name):
def myscript(scr):
ScriptManager.behaviours.update({name: Script(scr)})
return myscript
| 20.113636 | 64 | 0.577401 | 100 | 885 | 4.85 | 0.4 | 0.065979 | 0.068041 | 0.080412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.328814 | 885 | 43 | 65 | 20.581395 | 0.816498 | 0 | 0 | 0.212121 | 0 | 0 | 0.025989 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.30303 | false | 0.151515 | 0.060606 | 0.030303 | 0.606061 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
ae90995b57997bbe0a9b0ead14d5be7540d240c0 | 70 | py | Python | project/stuff/ascii.py | europ/VUTBR-FIT-ISA | 0e0340c272531dbe7690babf42f0589a6f7f067e | [
"Apache-2.0"
] | 1 | 2018-01-16T14:05:25.000Z | 2018-01-16T14:05:25.000Z | project/stuff/ascii.py | europ/VUTBR-FIT-ISA | 0e0340c272531dbe7690babf42f0589a6f7f067e | [
"Apache-2.0"
] | null | null | null | project/stuff/ascii.py | europ/VUTBR-FIT-ISA | 0e0340c272531dbe7690babf42f0589a6f7f067e | [
"Apache-2.0"
] | 1 | 2020-11-14T13:18:16.000Z | 2020-11-14T13:18:16.000Z | s = ""
for x in range(33,127): # <33; 126>
s += chr(x)
print(s)
| 10 | 35 | 0.471429 | 14 | 70 | 2.357143 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0.285714 | 70 | 6 | 36 | 11.666667 | 0.46 | 0.128571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
88485cefb9dbf5f52c2efebfef4d576fa36fefe0 | 1,109 | py | Python | setup.py | crowsonkb/partial-apply | de68d67202b3af74774572d0ac1e48770e6e897e | [
"MIT"
] | null | null | null | setup.py | crowsonkb/partial-apply | de68d67202b3af74774572d0ac1e48770e6e897e | [
"MIT"
] | null | null | null | setup.py | crowsonkb/partial-apply | de68d67202b3af74774572d0ac1e48770e6e897e | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='partial-apply',
version='1.0.0',
description='Partial application of functions and method names, supporting '
'placeholder values for positional arguments.',
long_description=open('README.rst').read(),
url='https://github.com/crowsonkb/partial-apply',
author='Katherine Crowson',
author_email='crowsonkb@gmail.com',
license='MIT',
packages=['partial_apply'],
include_package_data=True,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
],
keywords=['functional', 'higher-order', 'partial'],
)
| 36.966667 | 80 | 0.625789 | 112 | 1,109 | 6.151786 | 0.6875 | 0.137881 | 0.181422 | 0.150943 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016413 | 0.230839 | 1,109 | 29 | 81 | 38.241379 | 0.791325 | 0 | 0 | 0 | 0 | 0 | 0.600541 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.035714 | 0 | 0.035714 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
884defaf0251ef8e9033cc37b9a38fc85c7f4c69 | 427 | py | Python | c01/p030.py | HiAwesome/python-algorithm | eda61b52b4b25940caf58a40641122772b8c9203 | [
"Apache-2.0"
] | 1 | 2020-11-05T08:55:30.000Z | 2020-11-05T08:55:30.000Z | c01/p030.py | HiAwesome/python-algorithm | eda61b52b4b25940caf58a40641122772b8c9203 | [
"Apache-2.0"
] | null | null | null | c01/p030.py | HiAwesome/python-algorithm | eda61b52b4b25940caf58a40641122772b8c9203 | [
"Apache-2.0"
] | null | null | null | price = 24
item = 'banana'
print('The %s costs %d cents.' % (item, price))
print('The %+10s costs %5.2f cents.' % (item, price))
print('The %+10s costs %10.2f cents.' % (item, price))
itemdict = {'item': 'banana', 'cost': 24}
print('The %(item)s costs %(cost)7.1f cents.' % itemdict)
"""
The banana costs 24 cents.
The banana costs 24.00 cents.
The banana costs 24.00 cents.
The banana costs 24.0 cents.
"""
| 25.117647 | 57 | 0.618267 | 68 | 427 | 3.882353 | 0.294118 | 0.121212 | 0.212121 | 0.242424 | 0.481061 | 0.481061 | 0.481061 | 0.253788 | 0.253788 | 0.253788 | 0 | 0.081633 | 0.196721 | 427 | 16 | 58 | 26.6875 | 0.688047 | 0 | 0 | 0 | 0 | 0 | 0.472222 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.571429 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
88537ef2fa8c24ebca8ef386689fec310a15d7ac | 164 | py | Python | run.py | wilcarllopez/jobmonitorservice | ad833569af3bcc7b31acce714a2b26aad2623623 | [
"MIT"
] | null | null | null | run.py | wilcarllopez/jobmonitorservice | ad833569af3bcc7b31acce714a2b26aad2623623 | [
"MIT"
] | null | null | null | run.py | wilcarllopez/jobmonitorservice | ad833569af3bcc7b31acce714a2b26aad2623623 | [
"MIT"
] | null | null | null | import os
from app import create_app
if __name__ == '__main__':
env_name = os.getenv('FLASK_CONFIG') or 'default'
app = create_app(env_name)
app.run() | 20.5 | 53 | 0.689024 | 25 | 164 | 4 | 0.6 | 0.18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.195122 | 164 | 8 | 54 | 20.5 | 0.757576 | 0 | 0 | 0 | 0 | 0 | 0.163636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
88664a6aeda8f5da9460651e9d2722fdf17bfa68 | 370 | py | Python | categories/models.py | lenomosh/photo-gallery | b1a7edbea41fa792485e9c7c7729bf4d426cde46 | [
"Unlicense"
] | 1 | 2020-10-22T13:39:15.000Z | 2020-10-22T13:39:15.000Z | categories/models.py | lenomosh/photo-gallery | b1a7edbea41fa792485e9c7c7729bf4d426cde46 | [
"Unlicense"
] | null | null | null | categories/models.py | lenomosh/photo-gallery | b1a7edbea41fa792485e9c7c7729bf4d426cde46 | [
"Unlicense"
] | null | null | null | from django.db import models
class Category(models.Model):
name = models.CharField(max_length=100)
def save_category(self) -> None:
self.save()
def update_category(self, name) -> None:
self.name = name
self.save()
def delete_category(self) -> None:
self.delete()
def __str__(self):
return f"{self.name}"
| 19.473684 | 44 | 0.613514 | 47 | 370 | 4.659574 | 0.468085 | 0.164384 | 0.146119 | 0.182648 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011029 | 0.264865 | 370 | 18 | 45 | 20.555556 | 0.794118 | 0 | 0 | 0.166667 | 0 | 0 | 0.02973 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.083333 | 0.083333 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
886d9bc7d8a8ce2e37764ff9f7c416cf52e2944a | 505 | py | Python | webgo/config.py | 1xuan/webgo | 7b84eb49fb353448d2ecf133073ea2fd0f9807ba | [
"MIT"
] | null | null | null | webgo/config.py | 1xuan/webgo | 7b84eb49fb353448d2ecf133073ea2fd0f9807ba | [
"MIT"
] | null | null | null | webgo/config.py | 1xuan/webgo | 7b84eb49fb353448d2ecf133073ea2fd0f9807ba | [
"MIT"
] | null | null | null | import os
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(message)s',
)
DB_FILE = 'sqlite.db'
project = None
class ProjectParse:
def __init__(self, project_path):
self._project_path = project_path
@property
def path(self):
return self._project_path
@property
def name(self):
return os.path.basename(self._project_path)
@property
def pkg_name(self):
return self.name + '__main__'
| 16.833333 | 55 | 0.653465 | 62 | 505 | 5.032258 | 0.451613 | 0.176282 | 0.192308 | 0.211538 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.237624 | 505 | 29 | 56 | 17.413793 | 0.81039 | 0 | 0 | 0.15 | 0 | 0 | 0.114851 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.1 | 0.15 | 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 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
88707482f2a29ed829af085635b2f167c381c4a6 | 371 | py | Python | betrack/__init__.py | gvalentini85/betrack-cli | 981dc22baf0b60914816ac5965a1a9f171767e47 | [
"MIT"
] | null | null | null | betrack/__init__.py | gvalentini85/betrack-cli | 981dc22baf0b60914816ac5965a1a9f171767e47 | [
"MIT"
] | 10 | 2018-05-12T00:49:27.000Z | 2018-06-05T17:31:14.000Z | betrack/__init__.py | gvalentini85/betrack-cli | 981dc22baf0b60914816ac5965a1a9f171767e47 | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------#
# Copyright 2018 Gabriele Valentini. All rights reserved. Use of this source #
# code is governed by a MIT license that can be found in the LICENSE file. #
#------------------------------------------------------------------------------#
__cli__ = 'betrack'
__version__ = '0.1.1'
| 46.375 | 80 | 0.396226 | 32 | 371 | 4.34375 | 0.9375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021739 | 0.132075 | 371 | 7 | 81 | 53 | 0.409938 | 0.84097 | 0 | 0 | 0 | 0 | 0.235294 | 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 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8876ba97437cbb40d322f06ae070c55af15ba5a9 | 1,509 | py | Python | stentor/management/commands/sendnewsletter.py | alekosot/django-stentor | 5bcf3bf92680c87ae35c6794992c46846058fd7a | [
"BSD-3-Clause"
] | 7 | 2017-01-16T13:48:31.000Z | 2019-10-04T08:45:46.000Z | stentor/management/commands/sendnewsletter.py | alxs/django-stentor | 5bcf3bf92680c87ae35c6794992c46846058fd7a | [
"BSD-3-Clause"
] | 6 | 2017-04-12T09:40:18.000Z | 2020-06-05T18:06:32.000Z | stentor/management/commands/sendnewsletter.py | alekosot/django-stentor | 5bcf3bf92680c87ae35c6794992c46846058fd7a | [
"BSD-3-Clause"
] | 3 | 2017-01-17T10:13:47.000Z | 2018-02-24T20:08:21.000Z | # -*- coding: utf-8 -*-
# TODO: Check docstrings, add tests and add argument for custom batch size
from __future__ import unicode_literals
from django.core.management.base import BaseCommand, CommandError
from django.db import DatabaseError
from stentor import settings as stentor_conf
from stentor.models import ScheduledSending
class Command(BaseCommand):
"""
Fetches a number of Schedule instances from the database and sends the
Newsletter to the Subscriber, both as they are defined in the Schedule
instance. The number of Schedule instances fetched is the first argument
(a number) or else the defaulf is used, which is 250.
Examples:
``$ python manage.py newsletter_send 500``
``$ python manage.py newsletter_send 60 --verbosity=1``
Options:
--verbosity=[0]
Either 0 or any positive number. Default is zero. Any positive
number displays whether or not emails were successfully sent.
"""
def handle(self, *args, **options):
limit = stentor_conf.SCHEDULED_SENDING_BATCH_SIZE
schedules = ScheduledSending.objects.sendable()
if limit: # limit can be 0, which means no limit and thus this check
# We cannot do ``delete`` on a slice, so...
untouched_pks = schedules[limit:].values_list('id', flat=True)
schedules = schedules.exclude(pk__in=untouched_pks)
schedules.send_and_delete()
@property
def help(self):
return self.__doc__
| 35.093023 | 77 | 0.695162 | 197 | 1,509 | 5.208122 | 0.619289 | 0.017544 | 0.031189 | 0.048733 | 0.054581 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011226 | 0.232604 | 1,509 | 42 | 78 | 35.928571 | 0.874784 | 0.498343 | 0 | 0 | 0 | 0 | 0.002865 | 0 | 0 | 0 | 0 | 0.02381 | 0 | 1 | 0.125 | false | 0 | 0.3125 | 0.0625 | 0.5625 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
887b21cb1b7c40589e9fa7046b1da07e85773105 | 274 | py | Python | dataview/views.py | gloryvictory/udata | 1d58e68add7b2f26127360dddbeeb7d24eb6606c | [
"MIT"
] | null | null | null | dataview/views.py | gloryvictory/udata | 1d58e68add7b2f26127360dddbeeb7d24eb6606c | [
"MIT"
] | 6 | 2020-06-05T20:18:38.000Z | 2021-06-04T22:12:17.000Z | dataview/views.py | gloryvictory/udata | 1d58e68add7b2f26127360dddbeeb7d24eb6606c | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
def index(request):#создаем свою функцию
context = {}#с помощью словаря можем передать модель и форму в шаблон HTML
return render(request, 'dataview/index.html', context)#собственно вызываем шаблон HTML | 39.142857 | 90 | 0.773723 | 38 | 274 | 5.578947 | 0.815789 | 0.09434 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153285 | 274 | 7 | 90 | 39.142857 | 0.913793 | 0.492701 | 0 | 0 | 0 | 0 | 0.140741 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
888afb4ec8459042320c269920c1b70aa627755f | 5,662 | py | Python | temboo/core/Library/OneLogin/Accounts/CreateAccount.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/OneLogin/Accounts/CreateAccount.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/OneLogin/Accounts/CreateAccount.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# CreateAccount
# Creates a new account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
#
#
###############################################################################
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class CreateAccount(Choreography):
def __init__(self, temboo_session):
"""
Create a new instance of the CreateAccount Choreo. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied.
"""
super(CreateAccount, self).__init__(temboo_session, '/Library/OneLogin/Accounts/CreateAccount')
def new_input_set(self):
return CreateAccountInputSet()
def _make_result_set(self, result, path):
return CreateAccountResultSet(result, path)
def _make_execution(self, session, exec_id, path):
return CreateAccountChoreographyExecution(session, exec_id, path)
class CreateAccountInputSet(InputSet):
"""
An InputSet with methods appropriate for specifying the inputs to the CreateAccount
Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
"""
def set_APIKey(self, value):
"""
Set the value of the APIKey input for this Choreo. ((required, string) The API Key provided by OneLogin.)
"""
super(CreateAccountInputSet, self)._set_input('APIKey', value)
def set_AccountName(self, value):
"""
Set the value of the AccountName input for this Choreo. ((required, string) The account name.)
"""
super(CreateAccountInputSet, self)._set_input('AccountName', value)
def set_Address(self, value):
"""
Set the value of the Address input for this Choreo. ((optional, string) The street address for the new account.)
"""
super(CreateAccountInputSet, self)._set_input('Address', value)
def set_City(self, value):
"""
Set the value of the City input for this Choreo. ((optional, string) The city associated with the address.)
"""
super(CreateAccountInputSet, self)._set_input('City', value)
def set_Country(self, value):
"""
Set the value of the Country input for this Choreo. ((optional, string) The country associated with the address of the new account.)
"""
super(CreateAccountInputSet, self)._set_input('Country', value)
def set_Email(self, value):
"""
Set the value of the Email input for this Choreo. ((required, string) The email address for the new account.)
"""
super(CreateAccountInputSet, self)._set_input('Email', value)
def set_FirstName(self, value):
"""
Set the value of the FirstName input for this Choreo. ((required, string) The first name on the new account.)
"""
super(CreateAccountInputSet, self)._set_input('FirstName', value)
def set_LastName(self, value):
"""
Set the value of the LastName input for this Choreo. ((required, string) The last name on the new account.)
"""
super(CreateAccountInputSet, self)._set_input('LastName', value)
def set_Phone(self, value):
"""
Set the value of the Phone input for this Choreo. ((optional, string) The phone number for the new account.)
"""
super(CreateAccountInputSet, self)._set_input('Phone', value)
def set_Plan(self, value):
"""
Set the value of the Plan input for this Choreo. ((required, string) Indicates which plan the new account has (i.e. enterprise).)
"""
super(CreateAccountInputSet, self)._set_input('Plan', value)
def set_State(self, value):
"""
Set the value of the State input for this Choreo. ((optional, string) The state associated with the address of the new account.)
"""
super(CreateAccountInputSet, self)._set_input('State', value)
def set_Zip(self, value):
"""
Set the value of the Zip input for this Choreo. ((optional, string) The postal code associated with the address of the new account.)
"""
super(CreateAccountInputSet, self)._set_input('Zip', value)
class CreateAccountResultSet(ResultSet):
"""
A ResultSet with methods tailored to the values returned by the CreateAccount Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution.
"""
def getJSONFromString(self, str):
return json.loads(str)
def get_Response(self):
"""
Retrieve the value for the "Response" output from this Choreo execution. ((xml) The response from OneLogin.)
"""
return self._output.get('Response', None)
class CreateAccountChoreographyExecution(ChoreographyExecution):
def _make_result_set(self, response, path):
return CreateAccountResultSet(response, path)
| 41.028986 | 140 | 0.665136 | 688 | 5,662 | 5.386628 | 0.247093 | 0.022936 | 0.038856 | 0.04857 | 0.420399 | 0.334053 | 0.325418 | 0.140583 | 0.140583 | 0.126012 | 0 | 0.003162 | 0.218121 | 5,662 | 137 | 141 | 41.328467 | 0.833973 | 0.460085 | 0 | 0 | 0 | 0 | 0.048625 | 0.015943 | 0 | 0 | 0 | 0 | 0 | 1 | 0.404255 | false | 0 | 0.106383 | 0.106383 | 0.723404 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ee07652f8338566a705d7d1c32ecb7ee94a229b9 | 215 | py | Python | Les1/banana.py | ThiboVanderkam/Scripting-code | 2fe42f44db87a5287225d304e15d3985b20013d3 | [
"Apache-2.0"
] | null | null | null | Les1/banana.py | ThiboVanderkam/Scripting-code | 2fe42f44db87a5287225d304e15d3985b20013d3 | [
"Apache-2.0"
] | null | null | null | Les1/banana.py | ThiboVanderkam/Scripting-code | 2fe42f44db87a5287225d304e15d3985b20013d3 | [
"Apache-2.0"
] | null | null | null | word = input("Give me a word: ")
wrong = True
while wrong:
if word == "banana":
wrong = False
print("END GAME")
else:
print("WRONG")
word = input("Give me a word: ") | 21.5 | 40 | 0.497674 | 27 | 215 | 3.962963 | 0.555556 | 0.168224 | 0.242991 | 0.280374 | 0.373832 | 0.373832 | 0 | 0 | 0 | 0 | 0 | 0 | 0.367442 | 215 | 10 | 40 | 21.5 | 0.786765 | 0 | 0 | 0.222222 | 0 | 0 | 0.246377 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ee07a151eca2e8f897b7942da152ec3bed00cffa | 3,960 | py | Python | slavdict/dictionary/migrations/0023_squash.py | slavdict/slavdict | 893886b80de413cb2bb6c0af5adba9c55aa6a7af | [
"CC0-1.0"
] | 1 | 2022-01-17T17:26:25.000Z | 2022-01-17T17:26:25.000Z | slavdict/dictionary/migrations/0023_squash.py | slavdict/slavdict | 893886b80de413cb2bb6c0af5adba9c55aa6a7af | [
"CC0-1.0"
] | 8 | 2020-02-12T13:26:05.000Z | 2022-02-10T19:28:07.000Z | slavdict/dictionary/migrations/0023_squash.py | slavdict/slavdict | 893886b80de413cb2bb6c0af5adba9c55aa6a7af | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-20 16:19
from django.db import migrations, models
import django.db.models.deletion
import slavdict.dictionary.models
class Migration(migrations.Migration):
dependencies = [
('dictionary', '0022_auto_20180504_1201'),
]
operations = [
migrations.AlterField(
model_name='orthographicvariant',
name='questionable',
field=models.BooleanField(default=False, verbose_name='\u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043e\u043c\u043d\u0435\u043d\u0438\u044f'),
),
migrations.AlterField(
model_name='orthographicvariant',
name='reconstructed',
field=models.BooleanField(default=False, verbose_name='\u0440\u0435\u043a\u043e\u043d\u0441\u0442\u0440\u0443\u0438\u0440\u043e\u0432\u0430\u043d'),
),
migrations.CreateModel(
name='Translation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('position', models.SmallIntegerField(blank=True, default=1000, help_text='\u041d\u043e\u043c\u0435\u0440 \u0441\u043b\u043e\u0432\u0430, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434.', verbose_name='\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435')),
('order', models.SmallIntegerField(blank=True, default=345, verbose_name='\u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f')),
('hidden', models.BooleanField(default=True, help_text='\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u043e\u0432', verbose_name='\u0441\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434')),
('translation', models.TextField(verbose_name='\u043f\u0435\u0440\u0435\u0432\u043e\u0434')),
('for_example', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='translation_set', to='dictionary.Example')),
('additional_info', models.TextField(blank=True, verbose_name='\u043f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435')),
],
options={
'ordering': ('id',),
'verbose_name': '\u043f\u0435\u0440\u0435\u0432\u043e\u0434',
'verbose_name_plural': '\u041f\u0415\u0420\u0415\u0412\u041e\u0414\u042b',
},
bases=(models.Model, slavdict.dictionary.models.JSONSerializable),
),
migrations.AlterField(
model_name='greekequivalentforexample',
name='for_example',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='greq_set', to='dictionary.Example'),
),
migrations.AlterField(
model_name='greekequivalentforexample',
name='position',
field=models.SmallIntegerField(blank=True, default=1000, help_text='\u041d\u043e\u043c\u0435\u0440 \u0441\u043b\u043e\u0432\u0430, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434.', null=True, verbose_name='\u043f\u043e\u0437\u0438\u0446\u0438\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435'),
),
]
| 70.714286 | 488 | 0.694949 | 484 | 3,960 | 5.617769 | 0.233471 | 0.044502 | 0.044134 | 0.044134 | 0.563075 | 0.539537 | 0.458624 | 0.458624 | 0.458624 | 0.420743 | 0 | 0.311005 | 0.155556 | 3,960 | 55 | 489 | 72 | 0.502093 | 0.017424 | 0 | 0.276596 | 1 | 0.191489 | 0.520062 | 0.436471 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.06383 | 0 | 0.12766 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ee0a48541bcb748d7605d198ceb9f54457262fbf | 3,481 | py | Python | tes_reader/record_types.py | sinan-ozel/tes-reader | 87995285a0b656335aeeabf7459db79162782833 | [
"CC0-1.0"
] | null | null | null | tes_reader/record_types.py | sinan-ozel/tes-reader | 87995285a0b656335aeeabf7459db79162782833 | [
"CC0-1.0"
] | null | null | null | tes_reader/record_types.py | sinan-ozel/tes-reader | 87995285a0b656335aeeabf7459db79162782833 | [
"CC0-1.0"
] | null | null | null | import struct
from . import Record, FormId, debug_record_attribute
class NPC(Record):
"""A class to represent NPC_ type records.
These records contain information about non-player characters (NPCs)."""
def __init__(self, record):
self._pointer = record._pointer
self._header = record._header
self._content = record.content
@property
def class_id(self):
for class_field in self['CNAM']:
return FormId(class_field)
@property
def race_id(self):
for race_field in self['RNAM']:
return FormId(race_field)
@property
def acbs(self):
for acbs_field in self['ACBS']:
return acbs_field
@property
@debug_record_attribute
def is_female(self):
return self._get_bit(self.acbs, 0)
@property
@debug_record_attribute
def is_essential(self):
return self._get_bit(self.acbs, 1)
@property
def is_preset(self):
return self._get_bit(self.acbs, 2)
@property
def respawns(self):
return self._get_bit(self.acbs, 3)
@property
def auto_calculate_stats(self):
return self._get_bit(self.acbs, 4)
@property
def is_unique(self):
return self._get_bit(self.acbs, 5)
@property
def is_levelling_up_with_pc(self):
return self._get_bit(self.acbs, 7)
@property
def is_protected(self):
return self._get_bit(self.acbs, 11)
@property
def is_summonable(self):
return self._get_bit(self.acbs, 14)
@property
def has_opposite_gender_animations(self):
return self._get_bit(self.acbs, 19)
@property
def is_ghost(self):
return self._get_bit(self.acbs, 29)
@property
def is_invulnerable(self):
return self._get_bit(self.acbs, 31)
@property
def level(self):
if self.is_levelling_up_with_pc:
divider = 1000
else:
divider = 1
return int.from_bytes(self.acbs[8:10], 'little', signed=False) / divider
class Book(Record):
"""A class to represent BOOK type records.
These records contain information about books."""
def __init__(self, record):
self._pointer = record._pointer
self._header = record._header
self._content = record.content
class Race(Record):
"""A class to represent RACE type records.
These records contain information about character races."""
def __init__(self, record):
self._pointer = record._pointer
self._header = record._header
self._content = record.content
@property
def data(self):
for data_field in self['DATA']:
return data_field
@property
def male_height(self):
return struct.unpack('f', self.data[16:20])[0]
@property
def female_height(self):
return struct.unpack('f', self.data[20:24])[0]
@property
def male_weight(self):
return struct.unpack('f', self.data[24:28])[0]
@property
def female_weight(self):
return struct.unpack('f', self.data[28:32])[0]
@property
def is_playable(self):
return self._get_bit(self.data[32:36], 0)
class CharacterClass(Record):
"""A class to represent CLAS type records.
These records contain information about character classes."""
def __init__(self, record):
self._pointer = record._pointer
self._header = record._header
self._content = record.content
| 24.864286 | 80 | 0.640046 | 451 | 3,481 | 4.7051 | 0.232816 | 0.103676 | 0.085768 | 0.104147 | 0.60132 | 0.540057 | 0.497644 | 0.295947 | 0.174364 | 0.174364 | 0 | 0.019395 | 0.259408 | 3,481 | 139 | 81 | 25.043165 | 0.803724 | 0.11376 | 0 | 0.408163 | 0 | 0 | 0.008533 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.265306 | false | 0 | 0.020408 | 0.173469 | 0.55102 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ee356266c91cd968ceb3689dd1dcbdd73af777ff | 458 | py | Python | protobuf3/fields/sfixed32.py | Pr0Ger/protobuf3 | be47d387f873226561e78171adff73fd38712ae5 | [
"MIT"
] | 9 | 2015-11-08T14:32:01.000Z | 2017-11-14T04:27:51.000Z | protobuf3/fields/sfixed32.py | Pr0Ger/protobuf3 | be47d387f873226561e78171adff73fd38712ae5 | [
"MIT"
] | 9 | 2015-01-15T18:05:24.000Z | 2017-06-28T07:43:15.000Z | protobuf3/fields/sfixed32.py | Pr0Ger/protobuf3 | be47d387f873226561e78171adff73fd38712ae5 | [
"MIT"
] | 5 | 2015-11-08T14:32:03.000Z | 2020-01-27T17:09:23.000Z | from .base import BaseField
from protobuf3.wire_types import FIELD_FIXED32
from struct import pack, unpack
class SFixed32Field(BaseField):
DEFAULT_VALUE = 0
WIRE_TYPE = FIELD_FIXED32
def _convert_to_final_type(self, value):
return unpack('<l', value)[0]
def _convert_to_wire_type(self, value):
return pack('<l', value)
def _validate(self, value):
return isinstance(value, int) and -2 ** 31 <= value < 2 ** 31
| 25.444444 | 69 | 0.687773 | 63 | 458 | 4.777778 | 0.492063 | 0.089701 | 0.149502 | 0.126246 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.213974 | 458 | 17 | 70 | 26.941176 | 0.794444 | 0 | 0 | 0 | 0 | 0 | 0.008734 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
ee57a38947dffa12b01eb148fbfef901efa5b316 | 359 | py | Python | cove/context_processors.py | odscjames/lib-cove-web-alpha | 74d4d46e1b618432826685483bc370ca2044fc83 | [
"MIT"
] | null | null | null | cove/context_processors.py | odscjames/lib-cove-web-alpha | 74d4d46e1b618432826685483bc370ca2044fc83 | [
"MIT"
] | 1 | 2018-12-10T15:21:30.000Z | 2018-12-10T15:21:30.000Z | cove/context_processors.py | odscjames/lib-cove-web-alpha | 74d4d46e1b618432826685483bc370ca2044fc83 | [
"MIT"
] | 1 | 2019-02-11T10:53:10.000Z | 2019-02-11T10:53:10.000Z | from django.conf import settings
def analytics(request):
return {
'piwik': settings.PIWIK,
'google_analytics_id': settings.GOOGLE_ANALYTICS_ID
}
def input_methods(request):
return {'input_methods': settings.COVE_CONFIG.get('input_methods', []),
'app_verbose_name': settings.COVE_CONFIG.get('app_verbose_name', [])}
| 25.642857 | 81 | 0.690808 | 42 | 359 | 5.595238 | 0.47619 | 0.153191 | 0.144681 | 0.178723 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.183844 | 359 | 13 | 82 | 27.615385 | 0.802048 | 0 | 0 | 0 | 0 | 0 | 0.228412 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0.222222 | 0.555556 | 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 | 0 | 0 | 0 | 3 |
ee6ff4c012cb517a2fae2c098f0edabb13633cb3 | 503 | py | Python | eczema_profile/admin.py | KamaljeetSahoo/EczeCare | 38a9343936185dc010f9a3f6ea7c70f424adc145 | [
"MIT"
] | null | null | null | eczema_profile/admin.py | KamaljeetSahoo/EczeCare | 38a9343936185dc010f9a3f6ea7c70f424adc145 | [
"MIT"
] | null | null | null | eczema_profile/admin.py | KamaljeetSahoo/EczeCare | 38a9343936185dc010f9a3f6ea7c70f424adc145 | [
"MIT"
] | 1 | 2022-02-21T07:02:31.000Z | 2022-02-21T07:02:31.000Z | from django.contrib import admin
from .models import EczeImage, EczeProfile, PoemScore, Food, Allergies, ContactAllergens, Product, HealthEvent, Trigger, Activity
# Register your models here.
admin.site.register(EczeImage)
admin.site.register(EczeProfile)
admin.site.register(PoemScore)
admin.site.register(Food)
admin.site.register(Allergies)
admin.site.register(ContactAllergens)
admin.site.register(Product)
admin.site.register(HealthEvent)
admin.site.register(Trigger)
admin.site.register(Activity) | 35.928571 | 129 | 0.831014 | 62 | 503 | 6.741935 | 0.322581 | 0.215311 | 0.406699 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.063618 | 503 | 14 | 130 | 35.928571 | 0.887473 | 0.05169 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ee7d0b055640c1f2a27584d26fcb23d57d19ee33 | 57 | py | Python | opensimplex/__init__.py | AbdoKamel/opensimplex | dfc45b280b357df6cef99727c842142e8e14e88d | [
"MIT"
] | 145 | 2015-08-08T08:48:48.000Z | 2022-03-14T08:10:57.000Z | opensimplex/__init__.py | AbdoKamel/opensimplex | dfc45b280b357df6cef99727c842142e8e14e88d | [
"MIT"
] | 24 | 2015-08-11T20:28:50.000Z | 2022-03-08T15:06:30.000Z | opensimplex/__init__.py | AbdoKamel/opensimplex | dfc45b280b357df6cef99727c842142e8e14e88d | [
"MIT"
] | 30 | 2015-06-19T10:00:15.000Z | 2022-02-18T20:30:36.000Z |
__version__ = 0.3
from .opensimplex import OpenSimplex
| 11.4 | 36 | 0.789474 | 7 | 57 | 5.857143 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.157895 | 57 | 4 | 37 | 14.25 | 0.8125 | 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 | 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 | 3 |
ee917f79c90422b8fdd47fe090e88385f6821b46 | 109 | py | Python | main.py | xDiaym/7project | 27912f5a8626dffa38135c418a8ef19d0b6a7af3 | [
"MIT"
] | null | null | null | main.py | xDiaym/7project | 27912f5a8626dffa38135c418a8ef19d0b6a7af3 | [
"MIT"
] | null | null | null | main.py | xDiaym/7project | 27912f5a8626dffa38135c418a8ef19d0b6a7af3 | [
"MIT"
] | 1 | 2021-12-03T00:25:48.000Z | 2021-12-03T00:25:48.000Z | from sevenproject import create_bot
if __name__ == "__main__":
bot = create_bot()
bot.run_forever()
| 18.166667 | 35 | 0.706422 | 14 | 109 | 4.714286 | 0.714286 | 0.272727 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192661 | 109 | 5 | 36 | 21.8 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.073395 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c98954cccbbb840711910ac9995967901fa2362a | 333 | py | Python | static/predictors/predictor.py | yashpatel5400/neuropath | b995234030931a7b82b11c9ff8d3cb977907acd7 | [
"MIT"
] | 13 | 2017-07-07T04:44:06.000Z | 2021-04-13T23:31:13.000Z | static/predictors/predictor.py | yashpatel5400/neuropath | b995234030931a7b82b11c9ff8d3cb977907acd7 | [
"MIT"
] | 1 | 2019-12-31T07:16:49.000Z | 2019-12-31T07:18:19.000Z | static/predictors/predictor.py | yashpatel5400/neuropath | b995234030931a7b82b11c9ff8d3cb977907acd7 | [
"MIT"
] | 1 | 2019-02-26T00:35:21.000Z | 2019-02-26T00:35:21.000Z | """
__name__ = predictor.py
__author__ = Yash Patel
__description__ = Abstract predictor class used as the common
interface for all the implemented branch predictors
"""
from abc import ABC, abstractmethod
class Predictor(ABC):
def __init__(self):
pass
@abstractmethod
def predict(self, inst):
pass
| 20.8125 | 61 | 0.711712 | 39 | 333 | 5.666667 | 0.74359 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 333 | 15 | 62 | 22.2 | 0.853282 | 0.483483 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.285714 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
c98d9e2ed90f241b1931eccfa3a996885793246b | 416 | py | Python | apis/authorize/serializers.py | computablelabs/capi | 44e349fa3c71c8d2d390cdf2a5b7b8892807b40a | [
"MIT"
] | null | null | null | apis/authorize/serializers.py | computablelabs/capi | 44e349fa3c71c8d2d390cdf2a5b7b8892807b40a | [
"MIT"
] | 43 | 2019-09-03T14:50:23.000Z | 2019-12-18T17:30:11.000Z | apis/authorize/serializers.py | computablelabs/capi | 44e349fa3c71c8d2d390cdf2a5b7b8892807b40a | [
"MIT"
] | 1 | 2019-10-15T14:41:28.000Z | 2019-10-15T14:41:28.000Z | from flask_restplus import Model, fields
JWTToken = Model('JWTToken', {
'message': fields.String(required=True, description='Server response for a new Listing when POSTed'),
'access_token': fields.String(required=True, description='JWT token representing an authenticated client'),
'refresh_token': fields.String(required=True, description='Refresh token used to retrieve new token after expiration')
}) | 59.428571 | 122 | 0.771635 | 52 | 416 | 6.115385 | 0.634615 | 0.113208 | 0.188679 | 0.226415 | 0.361635 | 0.251572 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122596 | 416 | 7 | 123 | 59.428571 | 0.871233 | 0 | 0 | 0 | 0 | 0 | 0.450839 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c98fb2743d8d7db87f0493a5be010556e2349c2f | 313 | py | Python | auth_template/core/forms.py | rnbennett/django-with-auth | 3ffa8c1d917d67b2ec15f22536dc331ff9055f4a | [
"CC-BY-3.0",
"Apache-2.0"
] | 3 | 2016-03-03T04:50:41.000Z | 2017-01-24T21:27:16.000Z | auth_template/core/forms.py | rnbennett/django-with-auth | 3ffa8c1d917d67b2ec15f22536dc331ff9055f4a | [
"CC-BY-3.0",
"Apache-2.0"
] | null | null | null | auth_template/core/forms.py | rnbennett/django-with-auth | 3ffa8c1d917d67b2ec15f22536dc331ff9055f4a | [
"CC-BY-3.0",
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.localflavor.us.forms import USZipCodeField
class UserProfileCreationForm(UserCreationForm):
zip = USZipCodeField(required=True, label='Zip Code',
help_text='Required. Format as XXXXX or XXXXX-XXXX.')
| 39.125 | 62 | 0.798722 | 38 | 313 | 6.552632 | 0.631579 | 0.120482 | 0.136546 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121406 | 313 | 7 | 63 | 44.714286 | 0.905455 | 0 | 0 | 0 | 0 | 0 | 0.153355 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
c9a3265b08bb10e37e02d5b08e4f7450021b7fcc | 192 | py | Python | Estrutura_Decisao/the_biggest.py | M3nin0/supreme-broccoli | 186c1ea3b839ba3139f9301660dec8fbd27a162e | [
"Apache-2.0"
] | null | null | null | Estrutura_Decisao/the_biggest.py | M3nin0/supreme-broccoli | 186c1ea3b839ba3139f9301660dec8fbd27a162e | [
"Apache-2.0"
] | null | null | null | Estrutura_Decisao/the_biggest.py | M3nin0/supreme-broccoli | 186c1ea3b839ba3139f9301660dec8fbd27a162e | [
"Apache-2.0"
] | null | null | null | num1 = int(input("Insira o primeiro numero: "))
num2 = int(input("Insira o segundo numero: "))
if num1 > num2:
print ("O maior número é:",num1)
else:
print ("O maior número é:",num2)
| 24 | 47 | 0.640625 | 30 | 192 | 4.1 | 0.5 | 0.130081 | 0.227642 | 0.243902 | 0.292683 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038961 | 0.197917 | 192 | 7 | 48 | 27.428571 | 0.75974 | 0 | 0 | 0 | 0 | 0 | 0.442708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c9b2307aa8fbc77d718cd8d6e3653f3bf029ff37 | 189 | py | Python | app/main/serializer/feedback.py | by46/coffee | f12e1e95f12da7e322a432a6386a1147c5549c3b | [
"MIT"
] | null | null | null | app/main/serializer/feedback.py | by46/coffee | f12e1e95f12da7e322a432a6386a1147c5549c3b | [
"MIT"
] | null | null | null | app/main/serializer/feedback.py | by46/coffee | f12e1e95f12da7e322a432a6386a1147c5549c3b | [
"MIT"
] | null | null | null | from flask_restful import fields
FeedbackResource = {
'id': fields.Integer,
'coffee_id': fields.Integer,
'content': fields.String,
'create_time': fields.DateTime
}
| 21 | 35 | 0.666667 | 20 | 189 | 6.15 | 0.7 | 0.130081 | 0.243902 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216931 | 189 | 8 | 36 | 23.625 | 0.831081 | 0 | 0 | 0 | 0 | 0 | 0.160221 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c9d4088d380d6b2d9f061d29c6d3be9605f56146 | 255 | py | Python | drupal/drupalorg/tests/__init__.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | drupal/drupalorg/tests/__init__.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | drupal/drupalorg/tests/__init__.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | from gitexd.tests import _createDefaultConfigFile
def _createDrupalAuthConfigFile(repoPath='', allowAnon=False):
defaults = {
"allowAnonymous": allowAnon,
"authServiceProtocol": "dummy"
}
return _createDefaultConfigFile(repoPath, defaults) | 28.333333 | 62 | 0.776471 | 19 | 255 | 10.263158 | 0.789474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129412 | 255 | 9 | 63 | 28.333333 | 0.878378 | 0 | 0 | 0 | 0 | 0 | 0.148438 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.142857 | 0 | 0.428571 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c9dca12627f7cc62e74651fcd2f2540b6ca80fd8 | 192 | py | Python | marseille/custom_logging.py | vene/marseille | c86faf3d97fd9063a6fe0ee74b302f09250e36c5 | [
"BSD-3-Clause"
] | 65 | 2017-04-25T01:14:03.000Z | 2022-03-22T06:11:48.000Z | marseille/custom_logging.py | vene/marseille | c86faf3d97fd9063a6fe0ee74b302f09250e36c5 | [
"BSD-3-Clause"
] | 9 | 2017-07-18T16:47:51.000Z | 2021-03-15T20:25:27.000Z | marseille/custom_logging.py | vene/marseille | c86faf3d97fd9063a6fe0ee74b302f09250e36c5 | [
"BSD-3-Clause"
] | 34 | 2017-04-25T14:38:18.000Z | 2021-12-20T12:50:56.000Z | # Author: Vlad Niculae <vlad@vene.ro>
# License: BSD 3-clause
import logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
| 19.2 | 65 | 0.666667 | 26 | 192 | 4.923077 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006211 | 0.161458 | 192 | 9 | 66 | 21.333333 | 0.78882 | 0.296875 | 0 | 0 | 0 | 0 | 0.393939 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.2 | 0 | 0.2 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c9ff81b9d5a45bbf0dcc7808392889a033aac4bc | 667 | py | Python | spotifyApp/frontCode/migrations/0004_auto_20210209_0033.py | RackiSebastian/TeamSoftwareProjectUcc | 34e61b34ba11ab52c3d54a643aac8cbb8a16a171 | [
"bzip2-1.0.6"
] | null | null | null | spotifyApp/frontCode/migrations/0004_auto_20210209_0033.py | RackiSebastian/TeamSoftwareProjectUcc | 34e61b34ba11ab52c3d54a643aac8cbb8a16a171 | [
"bzip2-1.0.6"
] | null | null | null | spotifyApp/frontCode/migrations/0004_auto_20210209_0033.py | RackiSebastian/TeamSoftwareProjectUcc | 34e61b34ba11ab52c3d54a643aac8cbb8a16a171 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-09 00:33
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('frontCode', '0003_auto_20210209_0028'),
]
operations = [
migrations.RenameField(
model_name='room',
old_name='guest_can_pause',
new_name='can_pause',
),
migrations.RenameField(
model_name='room',
old_name='created_at',
new_name='date_time',
),
migrations.RenameField(
model_name='room',
old_name='votes_to_skip',
new_name='vote_to_skip',
),
]
| 23 | 49 | 0.554723 | 70 | 667 | 4.985714 | 0.6 | 0.180516 | 0.223496 | 0.25788 | 0.352436 | 0.352436 | 0.352436 | 0 | 0 | 0 | 0 | 0.069977 | 0.335832 | 667 | 28 | 50 | 23.821429 | 0.717833 | 0.067466 | 0 | 0.409091 | 1 | 0 | 0.180645 | 0.037097 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.045455 | 0 | 0.181818 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a021d59cdd814aa698fa7b3e7e6f9eff762089c5 | 18 | py | Python | config.py | BenedictThompson/Alexa-Cryptocurrency-Price | 9f6259d44e439a43c60fc9c21dd3bd1007126dd1 | [
"MIT"
] | null | null | null | config.py | BenedictThompson/Alexa-Cryptocurrency-Price | 9f6259d44e439a43c60fc9c21dd3bd1007126dd1 | [
"MIT"
] | null | null | null | config.py | BenedictThompson/Alexa-Cryptocurrency-Price | 9f6259d44e439a43c60fc9c21dd3bd1007126dd1 | [
"MIT"
] | null | null | null | crypto = 'bitcoin' | 18 | 18 | 0.722222 | 2 | 18 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 18 | 1 | 18 | 18 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0.368421 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4e4bed9e1c3ef91e87340390014604a8f3cae8fe | 28,762 | py | Python | tools/97_addons/demo-ui-python/demoui/demouiapp/views.py | niklaushirt/aiops-install-awx-33 | a062656b39ffa6c37b4aa510e79a811de2d0a3c0 | [
"IBM-pibs"
] | null | null | null | tools/97_addons/demo-ui-python/demoui/demouiapp/views.py | niklaushirt/aiops-install-awx-33 | a062656b39ffa6c37b4aa510e79a811de2d0a3c0 | [
"IBM-pibs"
] | null | null | null | tools/97_addons/demo-ui-python/demoui/demouiapp/views.py | niklaushirt/aiops-install-awx-33 | a062656b39ffa6c37b4aa510e79a811de2d0a3c0 | [
"IBM-pibs"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from django.template import loader
import os
import sys
import time
sys.path.append(os.path.abspath("demouiapp"))
from functions import *
print ('*************************************************************************************************')
print ('*************************************************************************************************')
print (' __________ __ ___ _____ ________ ')
print (' / ____/ __ \\/ // / | / / | / _/ __ \\____ _____')
print (' / / / /_/ / // /| | /| / / /| | / // / / / __ \\/ ___/')
print (' / /___/ ____/__ __/ |/ |/ / ___ |_/ // /_/ / /_/ (__ ) ')
print (' \\____/_/ /_/ |__/|__/_/ |_/___/\\____/ .___/____/ ')
print (' /_/ ')
print ('*************************************************************************************************')
print ('*************************************************************************************************')
print ('')
print (' 🛰️ DemoUI for CP4WAIOPS AI Manager')
print ('')
print (' Provided by:')
print (' 🇨🇭 Niklaus Hirt (nikh@ch.ibm.com)')
print ('')
print ('*************************************************************************************************')
print (' 🚀 Initializing')
print ('*************************************************************************************************')
#os.system('ls -l')
loggedin='false'
loginip='0.0.0.0'
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# GET NAMESPACES
# ----------------------------------------------------------------------------------------------------------------------------------------------------
print(' ❓ Getting AIManager Namespace')
stream = os.popen("oc get po -A|grep aiops-orchestrator-controller |awk '{print$1}'")
aimanagerns = stream.read().strip()
print(' ✅ AIManager Namespace: '+aimanagerns)
print(' ❓ Getting EventManager Namespace')
stream = os.popen("oc get po -A|grep noi-operator |awk '{print$1}'")
eventmanagerns = stream.read().strip()
print(' ✅ EventManager Namespace: '+eventmanagerns)
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# DEFAULT VALUES
# ----------------------------------------------------------------------------------------------------------------------------------------------------
LOG_ITERATIONS=5
TOKEN='test'
LOG_TIME_FORMAT="%Y-%m-%dT%H:%M:%S.000000"
LOG_TIME_STEPS=1000
LOG_TIME_SKEW=60
LOG_TIME_ZONE="-1"
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# GET CONNECTIONS
# ----------------------------------------------------------------------------------------------------------------------------------------------------
print(' ❓ Getting Details Kafka')
stream = os.popen("oc get kafkatopics -n "+aimanagerns+" | grep -v cp4waiopscp4waiops| grep cp4waiops-cartridge-logs-elk| awk '{print $1;}'")
KAFKA_TOPIC_LOGS = stream.read().strip()
stream = os.popen("oc get secret -n "+aimanagerns+" |grep 'aiops-kafka-secret'|awk '{print$1}'")
KAFKA_SECRET = stream.read().strip()
stream = os.popen("oc get secret "+KAFKA_SECRET+" -n "+aimanagerns+" --template={{.data.username}} | base64 --decode")
KAFKA_USER = stream.read().strip()
stream = os.popen("oc get secret "+KAFKA_SECRET+" -n "+aimanagerns+" --template={{.data.password}} | base64 --decode")
KAFKA_PWD = stream.read().strip()
stream = os.popen("oc get routes iaf-system-kafka-0 -n "+aimanagerns+" -o=jsonpath={.status.ingress[0].host}")
KAFKA_BROKER = stream.read().strip()
stream = os.popen("oc get secret -n "+aimanagerns+" kafka-secrets -o jsonpath='{.data.ca\.crt}'| base64 -d")
KAFKA_CERT = stream.read().strip()
print(' ❓ Getting Details Datalayer')
stream = os.popen("oc get route -n "+aimanagerns+" datalayer-api -o jsonpath='{.status.ingress[0].host}'")
DATALAYER_ROUTE = stream.read().strip()
stream = os.popen("oc get secret aiops-ir-core-ncodl-api-secret -o jsonpath='{.data.username}' | base64 --decode")
DATALAYER_USER = stream.read().strip()
stream = os.popen("oc get secret aiops-ir-core-ncodl-api-secret -o jsonpath='{.data.password}' | base64 --decode")
DATALAYER_PWD = stream.read().strip()
print(' ❓ Getting Details Metric Endpoint')
stream = os.popen("oc get route | grep ibm-nginx-svc | awk '{print $2}'")
METRIC_ROUTE = stream.read().strip()
stream = os.popen("oc get secret admin-user-details -o jsonpath='{.data.initial_admin_password}' | base64 -d")
tmppass = stream.read().strip()
stream = os.popen('curl -k -s -X POST https://'+METRIC_ROUTE+'/icp4d-api/v1/authorize -H "Content-Type: application/json" -d "{\\\"username\\\": \\\"admin\\\",\\\"password\\\": \\\"'+tmppass+'\\\"}" | jq .token | sed "s/\\\"//g"')
METRIC_TOKEN = stream.read().strip()
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# GET CONNECTION DETAILS
# ----------------------------------------------------------------------------------------------------------------------------------------------------
print(' ❓ Getting Details AIManager')
stream = os.popen('oc get route -n '+aimanagerns+' cpd -o jsonpath={.spec.host}')
aimanager_url = stream.read().strip()
stream = os.popen('oc -n ibm-common-services get secret platform-auth-idp-credentials -o jsonpath={.data.admin_username} | base64 --decode && echo')
aimanager_user = stream.read().strip()
stream = os.popen('oc -n ibm-common-services get secret platform-auth-idp-credentials -o jsonpath={.data.admin_password} | base64 --decode')
aimanager_pwd = stream.read().strip()
print(' ❓ Getting Details EventManager')
stream = os.popen('oc get route -n '+eventmanagerns+' evtmanager-ibm-hdm-common-ui -o jsonpath={.spec.host}')
eventmanager_url = stream.read().strip()
stream = os.popen('oc -n ibm-common-services get secret platform-auth-idp-credentials -o jsonpath={.data.admin_username} | base64 --decode && echo')
eventmanager_user = 'smadmin'
stream = os.popen('oc get secret -n '+eventmanagerns+' evtmanager-was-secret -o jsonpath={.data.WAS_PASSWORD}| base64 --decode ')
eventmanager_pwd = stream.read().strip()
print(' ❓ Getting AWX Connection Details')
stream = os.popen('oc get route -n awx awx -o jsonpath={.spec.host}')
awx_url = stream.read().strip()
awx_user = 'admin'
stream = os.popen('oc -n awx get secret awx-admin-password -o jsonpath={.data.password} | base64 --decode && echo')
awx_pwd = stream.read().strip()
print(' ❓ Getting Details ELK ')
stream = os.popen('oc get route -n openshift-logging elasticsearch -o jsonpath={.spec.host}')
elk_url = stream.read().strip()
print(' ❓ Getting Details Turbonomic Dashboard')
stream = os.popen('oc get route -n turbonomic api -o jsonpath={.spec.host}')
turonomic_url = stream.read().strip()
print(' ❓ Getting Details Openshift Console')
stream = os.popen('oc get route -n openshift-console console -o jsonpath={.spec.host}')
openshift_url = stream.read().strip()
stream = os.popen("oc -n default get secret $(oc get secret -n default |grep -m1 demo-admin-token|awk '{print$1}') -o jsonpath='{.data.token}'|base64 --decode")
openshift_token = stream.read().strip()
stream = os.popen("oc status|grep -m1 \"In project\"|awk '{print$6}'")
openshift_server = stream.read().strip()
print(' ❓ Getting Details Vault')
stream = os.popen('oc get route -n '+aimanagerns+' ibm-vault-deploy-vault-route -o jsonpath={.spec.host}')
vault_url = stream.read().strip()
stream = os.popen('oc get secret -n '+aimanagerns+' ibm-vault-deploy-vault-credential -o jsonpath={.data.token} | base64 --decode')
vault_token = stream.read().strip()
print(' ❓ Getting Details LDAP ')
stream = os.popen('oc get route -n default openldap-admin -o jsonpath={.spec.host}')
ladp_url = stream.read().strip()
ladp_user = 'cn=admin,dc=ibm,dc=com'
ladp_pwd = 'P4ssw0rd!'
print(' ❓ Getting Details Flink Task Manager')
stream = os.popen('oc get routes -n '+aimanagerns+' job-manager -o jsonpath={.spec.host}')
flink_url = stream.read().strip()
stream = os.popen('oc get routes -n '+aimanagerns+' job-manager-policy -o jsonpath={.spec.host}')
flink_url_policy = stream.read().strip()
print(' ❓ Getting Details Spark Master')
stream = os.popen('oc get routes -n '+aimanagerns+' spark -o jsonpath={.spec.host}')
spark_url = stream.read().strip()
print(' ❓ Getting Details RobotShop')
stream = os.popen('oc get routes -n robot-shop web -o jsonpath={.spec.host}')
robotshop_url = stream.read().strip()
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# GET ENVIRONMENT VALUES
# ----------------------------------------------------------------------------------------------------------------------------------------------------
TOKEN=os.environ.get('TOKEN')
print ('*************************************************************************************************')
print ('*************************************************************************************************')
print ('')
print (' **************************************************************************************************')
print (' 🔎 Demo Parameters')
print (' **************************************************************************************************')
print (' KafkaBroker: '+KAFKA_BROKER)
print (' KafkaUser: '+KAFKA_USER)
print (' KafkaPWD: '+KAFKA_PWD)
print (' KafkaTopic Logs: '+KAFKA_TOPIC_LOGS)
print (' Kafka Cert: '+KAFKA_CERT[:25]+'...')
print ('')
print ('')
print (' Datalayer Route: '+DATALAYER_ROUTE)
print (' Datalayer User: '+DATALAYER_USER)
print (' Datalayer Pwd: '+DATALAYER_PWD)
print ('')
print (' Metric Route: '+METRIC_ROUTE)
print (' Metric Token: '+METRIC_TOKEN[:25]+'...')
print ('')
print (' Token: '+TOKEN)
print ('')
print (' **************************************************************************************************')
print ('*************************************************************************************************')
print (' ✅ DEMOUI is READY')
print ('*************************************************************************************************')
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# REST ENDPOINTS
# ----------------------------------------------------------------------------------------------------------------------------------------------------
def injectAllREST(request):
print('🌏 injectAllREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/home.html')
injectEventsMem(DATALAYER_ROUTE,DATALAYER_USER,DATALAYER_PWD)
injectMetricsMem(METRIC_ROUTE,METRIC_TOKEN)
injectLogs(KAFKA_BROKER,KAFKA_USER,KAFKA_PWD,KAFKA_TOPIC_LOGS,KAFKA_CERT,LOG_TIME_FORMAT,DEMO_LOGS)
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def injectAllFanREST(request):
print('🌏 injectAllFanREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/home.html')
injectMetricsFanTemp(METRIC_ROUTE,METRIC_TOKEN)
time.sleep(10)
injectEventsFan(DATALAYER_ROUTE,DATALAYER_USER,DATALAYER_PWD)
injectMetricsFan(METRIC_ROUTE,METRIC_TOKEN)
injectLogs(KAFKA_BROKER,KAFKA_USER,KAFKA_PWD,KAFKA_TOPIC_LOGS,KAFKA_CERT,LOG_TIME_FORMAT,DEMO_LOGS)
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def injectLogsREST(request):
print('🌏 injectLogsREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/home.html')
injectLogs(KAFKA_BROKER,KAFKA_USER,KAFKA_PWD,KAFKA_TOPIC_LOGS,KAFKA_CERT,LOG_TIME_FORMAT,DEMO_LOGS)
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def injectEventsREST(request):
print('🌏 injectEventsREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
injectEventsMem(DATALAYER_ROUTE,DATALAYER_USER,DATALAYER_PWD)
template = loader.get_template('demouiapp/home.html')
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def injectMetricsREST(request):
print('🌏 injectMetricsREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
injectMetricsMem(METRIC_ROUTE,METRIC_TOKEN)
template = loader.get_template('demouiapp/home.html')
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def clearAllREST(request):
print('🌏 clearAllREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/home.html')
closeAlerts(DATALAYER_ROUTE,DATALAYER_USER,DATALAYER_PWD)
closeStories(DATALAYER_ROUTE,DATALAYER_USER,DATALAYER_PWD)
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def clearEventsREST(request):
print('🌏 clearEventsREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/home.html')
closeAlerts(DATALAYER_ROUTE,DATALAYER_USER,DATALAYER_PWD)
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def clearStoriesREST(request):
print('🌏 injectLogsREST')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/home.html')
closeStories(DATALAYER_ROUTE,DATALAYER_USER,DATALAYER_PWD)
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def login(request):
print('🌏 login')
global loggedin
global loginip
verifyLogin(request)
currenttoken=request.GET.get("token", "0")
token=os.environ.get('TOKEN')
print (' 🔐 Login attempt with Token: '+currenttoken)
if token==currenttoken:
loggedin='true'
template = loader.get_template('demouiapp/home.html')
print (' ✅ Login SUCCESSFUL')
else:
loggedin='false'
template = loader.get_template('demouiapp/loginui.html')
print (' ❗ Login NOT SUCCESSFUL')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
}
return HttpResponse(template.render(context, request))
#return HttpResponse("Hello, world. You're at the polls index.")
def verifyLogin(request):
actloginip=request.META.get('REMOTE_ADDR')
global loggedin
global loginip
if loginip!=actloginip:
loggedin='false'
loginip=request.META.get('REMOTE_ADDR')
#print(' ❌ LOGIN NOK: NEW IP')
print(' 🔎 Check IP : ❌ LOGIN NOK: ACT IP:'+str(actloginip)+' - SAVED IP:'+str(loginip))
else:
print(' 🔎 Check IP : ✅ LOGIN OK: '+str(loggedin))
#print(' ✅ LOGIN OK')
#loggedin='true'
loginip=request.META.get('REMOTE_ADDR')
# ----------------------------------------------------------------------------------------------------------------------------------------------------
# PAGE ENDPOINTS
# ----------------------------------------------------------------------------------------------------------------------------------------------------
def loginui(request):
print('🌏 loginui')
global loggedin
verifyLogin(request)
template = loader.get_template('demouiapp/login.html')
context = {
'loggedin': loggedin,
}
return HttpResponse(template.render(context, request))
def index(request):
print('🌏 index')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/home.html')
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
}
return HttpResponse(template.render(context, request))
def doc(request):
print('🌏 doc')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/doc.html')
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def apps(request):
print('🌏 apps')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/apps.html')
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def about(request):
print('🌏 about')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/about.html')
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
}
return HttpResponse(template.render(context, request))
def config(request):
print('🌏 config')
global loggedin
verifyLogin(request)
if loggedin=='true':
template = loader.get_template('demouiapp/config.html')
else:
template = loader.get_template('demouiapp/loginui.html')
context = {
'loggedin': loggedin,
'aimanager_url': aimanager_url,
'aimanager_user': aimanager_user,
'aimanager_pwd': aimanager_pwd,
'awx_url': awx_url,
'awx_user': awx_user,
'awx_pwd': awx_pwd,
'elk_url': elk_url,
'turonomic_url': turonomic_url,
'openshift_url': openshift_url,
'openshift_token': openshift_token,
'openshift_server': openshift_server,
'vault_url': vault_url,
'vault_token': vault_token,
'ladp_url': ladp_url,
'ladp_user': ladp_user,
'ladp_pwd': ladp_pwd,
'flink_url': flink_url,
'flink_url_policy': flink_url_policy,
'robotshop_url': robotshop_url,
'spark_url': spark_url,
'eventmanager_url': eventmanager_url,
'eventmanager_user': eventmanager_user,
'eventmanager_pwd': eventmanager_pwd
}
return HttpResponse(template.render(context, request))
def index1(request):
template = loader.get_template('demouiapp/index.html')
context = {
'loggedin': loggedin,
}
return HttpResponse(template.render(context, request))
def health(request):
return HttpResponse('healthy')
| 37.112258 | 230 | 0.569049 | 2,907 | 28,762 | 5.374613 | 0.095287 | 0.023554 | 0.02829 | 0.031682 | 0.760177 | 0.74744 | 0.712878 | 0.674987 | 0.646697 | 0.632873 | 0 | 0.003117 | 0.196961 | 28,762 | 774 | 231 | 37.160207 | 0.671213 | 0.082296 | 0 | 0.689984 | 0 | 0.020668 | 0.370549 | 0.103834 | 0 | 0 | 0 | 0 | 0 | 1 | 0.028617 | false | 0.012719 | 0.011129 | 0.00159 | 0.066773 | 0.143084 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
4e73f944df90e09504966ddbe6606d34b7952a2a | 273 | py | Python | Ch16/ex16-07.py | NoMan2000/sql_func_and_procs | 18673c4b914b92b7d0d790b4758038bb5110421f | [
"MIT"
] | null | null | null | Ch16/ex16-07.py | NoMan2000/sql_func_and_procs | 18673c4b914b92b7d0d790b4758038bb5110421f | [
"MIT"
] | null | null | null | Ch16/ex16-07.py | NoMan2000/sql_func_and_procs | 18673c4b914b92b7d0d790b4758038bb5110421f | [
"MIT"
] | null | null | null | cursor1=conn.cursor()
cursor1.execute("UPDATE employees "+
" SET manager_id=28"+
" WHERE manager_id=24")
print "%d rows updated" % cursor1.rowcount
cursor1.execute("COMMIT")
cursor1.close()
| 34.125 | 49 | 0.520147 | 26 | 273 | 5.384615 | 0.730769 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.052326 | 0.369963 | 273 | 7 | 50 | 39 | 0.761628 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.142857 | 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 | 0 | 0 | 3 |
4e8ca0183405b90aacd882176ae0a4663112b45a | 1,396 | py | Python | py/cidoc_crm_types/properties/p11_had_participant.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p11_had_participant.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p11_had_participant.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | from .p12_occurred_in_the_presence_of import P12OccurredInThePresenceOf
from dataclasses import dataclass
@dataclass
class P11HadParticipant(P12OccurredInThePresenceOf):
"""
Scope note:
This property describes the active or passive participation of instances of E39 Actors in an instance of E5 Event.
It documents known events in which an instance of E39 Actor has participated during the course of that actor’s life or history. The instances of E53 Place and E52 Time-Span where and when these events happened provide us with constraints about the presence of the related instances of E39 Actor in the past. Collective actors, i.e., instances of E74 Group, may physically participate in events via their representing instances of E21 Persons only. The participation of multiple actors in an event is most likely an indication of their acquaintance and interaction.
The property implies that the actor was involved in the event but does not imply any causal relationship. For instance, someone having been portrayed can be said to have participated in the creation of the portrait.
Examples:
- Napoleon (E21) participated in The Battle of Waterloo (E7)
- Maria (E21) participated in Photographing of Maria (E7)
In First Order Logic:
P11(x,y) ⊃ E5(x)
P11(x,y) ⊃ E39(y)
P11(x,y) ⊃ P12(x,y)
"""
URI = "http://erlangen-crm.org/current/P11_had_participant"
| 51.703704 | 570 | 0.790115 | 219 | 1,396 | 5.004566 | 0.575342 | 0.02281 | 0.013686 | 0.024635 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049194 | 0.155444 | 1,396 | 26 | 571 | 53.692308 | 0.880407 | 0.818052 | 0 | 0 | 0 | 0 | 0.210744 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4ea0b0f62ae903c97fd4e5a758db69a9030364e4 | 358 | py | Python | eridanus/test/plugin_working.py | mithrandi/eridanus | 11c80c7024548ce7c41800b077d3d0a738a04875 | [
"MIT"
] | null | null | null | eridanus/test/plugin_working.py | mithrandi/eridanus | 11c80c7024548ce7c41800b077d3d0a738a04875 | [
"MIT"
] | 5 | 2021-03-18T20:19:01.000Z | 2022-03-11T23:14:44.000Z | eridanus/test/plugin_working.py | mithrandi/eridanus | 11c80c7024548ce7c41800b077d3d0a738a04875 | [
"MIT"
] | 1 | 2018-01-10T15:15:15.000Z | 2018-01-10T15:15:15.000Z | """
This is a module used in a test, not a test itself.
"""
from zope.interface import classProvides
from twisted.plugin import IPlugin
from eridanus.ieridanus import IEridanusPluginProvider
from eridanus.plugin import Plugin
class UselessPlugin(Plugin):
"""
A plugin that does nothing.
"""
classProvides(IPlugin, IEridanusPluginProvider)
| 22.375 | 54 | 0.76257 | 43 | 358 | 6.348837 | 0.581395 | 0.03663 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.167598 | 358 | 15 | 55 | 23.866667 | 0.916107 | 0.22067 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4eb606eab787b4a7e6ad9829465743239c25eb09 | 355 | py | Python | odp/api2/models/__init__.py | SAEONData/Open-Data-Platform | cfd2a53e145ec86e187d7c4e1260df17ec6dcb03 | [
"MIT"
] | 2 | 2021-03-04T07:09:47.000Z | 2022-01-02T19:23:41.000Z | odp/api2/models/__init__.py | SAEONData/Open-Data-Platform | cfd2a53e145ec86e187d7c4e1260df17ec6dcb03 | [
"MIT"
] | 18 | 2020-09-16T09:16:45.000Z | 2022-01-25T14:17:42.000Z | odp/api2/models/__init__.py | SAEONData/Open-Data-Platform | cfd2a53e145ec86e187d7c4e1260df17ec6dcb03 | [
"MIT"
] | 1 | 2021-06-25T13:02:57.000Z | 2021-06-25T13:02:57.000Z | from .client import ClientModel, ClientSort
from .collection import CollectionIn, CollectionOut, CollectionSort
from .project import ProjectModel, ProjectSort
from .provider import ProviderIn, ProviderOut, ProviderSort
from .role import RoleIn, RoleOut, RoleSort
from .scope import ScopeIn, ScopeOut, ScopeSort
from .user import UserIn, UserOut, UserSort
| 44.375 | 67 | 0.833803 | 40 | 355 | 7.4 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112676 | 355 | 7 | 68 | 50.714286 | 0.939683 | 0 | 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 | 0 | 0 | 0 | 3 |
4ed36445e1322cffb27f8197031109def7c1b485 | 103 | py | Python | 2017.TensorFlow&Python/2.python_syntax/test4.py | primetong/LearningCollectionOfWitt | a15dc8ac80618a3995c2b930c634b87ed8f1f0af | [
"MIT"
] | null | null | null | 2017.TensorFlow&Python/2.python_syntax/test4.py | primetong/LearningCollectionOfWitt | a15dc8ac80618a3995c2b930c634b87ed8f1f0af | [
"MIT"
] | 14 | 2020-06-30T20:52:56.000Z | 2022-03-02T14:53:18.000Z | 2017.TensorFlow&Python/2.python_syntax/test4.py | primetong/LearningCollectionOfWitt | a15dc8ac80618a3995c2b930c634b87ed8f1f0af | [
"MIT"
] | null | null | null | animals = ['dog', 'cat', 'ant']
l = len(animals)
while l > 0:
print animals[l-1]
l -= 1 # l = l -1
| 14.714286 | 31 | 0.514563 | 19 | 103 | 2.789474 | 0.526316 | 0.113208 | 0.113208 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051948 | 0.252427 | 103 | 6 | 32 | 17.166667 | 0.636364 | 0.07767 | 0 | 0 | 0 | 0 | 0.097826 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
14d3995b19de334a531202fc69332971fb593555 | 358 | py | Python | PythonClub/club/forms.py | mmhansen137/itc172-redux | 155fffa57fc6b8db6a9b55c95d1a1458921b8aaa | [
"CC0-1.0"
] | null | null | null | PythonClub/club/forms.py | mmhansen137/itc172-redux | 155fffa57fc6b8db6a9b55c95d1a1458921b8aaa | [
"CC0-1.0"
] | null | null | null | PythonClub/club/forms.py | mmhansen137/itc172-redux | 155fffa57fc6b8db6a9b55c95d1a1458921b8aaa | [
"CC0-1.0"
] | null | null | null | from django import forms
from .models import Meeting, MeetingMinutes, Resource, Event
class MeetingForm(forms.ModelForm):
class Meta:
model = Meeting
fields='__all__'
class MeetingMinutesForm(forms.ModelForm):
class Meta:
model = MeetingMinutes
fields='__all__'
class EventForm(forms.ModelForm):
class Meta:
model = Event
fields='__all__'
| 18.842105 | 60 | 0.76257 | 41 | 358 | 6.365854 | 0.439024 | 0.16092 | 0.218391 | 0.264368 | 0.321839 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150838 | 358 | 18 | 61 | 19.888889 | 0.858553 | 0 | 0 | 0.428571 | 0 | 0 | 0.058659 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
0941f9c2ead55097f9da235fe283e0827b66ec32 | 799 | py | Python | LineNotifyBot/LineNotifyBot.py | cryptocat-miner/BitMexLineNotifyBot | 2388d5fbccd3e8b7110484a1c10bd490e4b13859 | [
"MIT"
] | 1 | 2019-09-23T12:34:18.000Z | 2019-09-23T12:34:18.000Z | LineNotifyBot/LineNotifyBot.py | cryptocat-miner/BitMexLineNotifyBot | 2388d5fbccd3e8b7110484a1c10bd490e4b13859 | [
"MIT"
] | null | null | null | LineNotifyBot/LineNotifyBot.py | cryptocat-miner/BitMexLineNotifyBot | 2388d5fbccd3e8b7110484a1c10bd490e4b13859 | [
"MIT"
] | null | null | null |
#!/usr/bin/python3
import time
from datetime import datetime
import calendar
import ccxt
import ccxtWrapper
import math
import io
import orderManager
import tradeHistory
import LineNotify
# ------------------------------------------------------------------------------------------------
# メインプログラム
# 初期化
# bitmex = ccxtWrapper.ccxtWrapper(ccxtWrapper.ccxtWrapper.EXCHANGE_TYPE_TESTNET) #テストネット
bitmex = ccxtWrapper.ccxtWrapper(ccxtWrapper.ccxtWrapper.EXCHANGE_TYPE_MAINNET)
mTradeHistory = tradeHistory.tradeHistory(bitmex)
mOrderManager = orderManager.orderManager(bitmex)
openOrders = bitmex.fetchOpenOrders()
while True:
currentTime = datetime.utcnow() # 現在時刻(UTC)
print(currentTime)
mTradeHistory.checkTradeHistory()
mOrderManager.switchState()
time.sleep(6)
| 23.5 | 98 | 0.697121 | 71 | 799 | 7.788732 | 0.535211 | 0.238698 | 0.238698 | 0.141049 | 0.224231 | 0.224231 | 0.224231 | 0 | 0 | 0 | 0 | 0.002833 | 0.116395 | 799 | 33 | 99 | 24.212121 | 0.780453 | 0.28035 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0.05 | 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 | 0 | 0 | 0 | 3 |
094582dc87e2e3cd9431c8c9b63c3633a0aea3b3 | 187 | py | Python | DataCollections/Twitter/Config.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | 7 | 2020-03-06T05:53:43.000Z | 2022-01-30T17:31:18.000Z | DataCollections/Twitter/Config.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | DataCollections/Twitter/Config.py | moasgh/BumbleBee | 2b0aae7970ab316c7b8b12dd4032b41ee1772aad | [
"MIT"
] | null | null | null | class Twitter():
Consumer_Key = ''
Consumer_Secret = ''
Access_Token = ''
Access_Token_Secret = ''
CONNECTION_STRING = "sqlite:///Twitter.db"
LANG = ["en"]
| 23.375 | 47 | 0.57754 | 18 | 187 | 5.666667 | 0.722222 | 0.215686 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 187 | 7 | 48 | 26.714286 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.122222 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0961c8f19add2af18c20917115fcfbf4e6a6f39c | 407 | py | Python | src/apps/shorter/serializers.py | 63phc/lks | 2d263cf528d5370a1ff480b323cfc8945765a152 | [
"MIT"
] | 4 | 2018-10-31T19:09:50.000Z | 2020-09-29T13:16:28.000Z | src/apps/shorter/serializers.py | 63phc/lks | 2d263cf528d5370a1ff480b323cfc8945765a152 | [
"MIT"
] | 70 | 2018-11-02T13:55:32.000Z | 2022-03-18T13:06:45.000Z | src/apps/shorter/serializers.py | 63phc/lks | 2d263cf528d5370a1ff480b323cfc8945765a152 | [
"MIT"
] | 2 | 2018-11-05T09:59:26.000Z | 2020-08-26T19:37:41.000Z | from rest_framework import serializers
import logging
from src.apps.shorter.models import UrlShorter
logger = logging.getLogger(__name__)
class UrlShorterSerializer(serializers.ModelSerializer):
url = serializers.URLField(required=False)
url_short = serializers.URLField(required=False, source="get_url_short")
class Meta:
model = UrlShorter
fields = ("url", "url_short")
| 22.611111 | 76 | 0.751843 | 45 | 407 | 6.6 | 0.6 | 0.080808 | 0.181818 | 0.215488 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162162 | 407 | 17 | 77 | 23.941176 | 0.870968 | 0 | 0 | 0 | 0 | 0 | 0.061425 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.3 | 0 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
0962ef8636b38c40d0526b2d393cccde5075cdba | 136 | py | Python | asm2vec/__init__.py | fossabot/asm2vec-pytorch | 3c4828d5ba80c55a36adb43e5016f4f1f3443041 | [
"MIT"
] | 32 | 2021-01-31T16:06:23.000Z | 2022-03-29T12:51:51.000Z | asm2vec/__init__.py | fossabot/asm2vec-pytorch | 3c4828d5ba80c55a36adb43e5016f4f1f3443041 | [
"MIT"
] | 11 | 2021-02-17T02:15:06.000Z | 2021-09-15T11:38:27.000Z | asm2vec/__init__.py | fossabot/asm2vec-pytorch | 3c4828d5ba80c55a36adb43e5016f4f1f3443041 | [
"MIT"
] | 8 | 2021-02-01T03:46:52.000Z | 2022-03-16T23:15:06.000Z | import importlib
__all__ = ['model', 'datatype', 'utils']
for module in __all__:
importlib.import_module(f'.{module}', 'asm2vec')
| 19.428571 | 52 | 0.691176 | 16 | 136 | 5.3125 | 0.6875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008547 | 0.139706 | 136 | 6 | 53 | 22.666667 | 0.717949 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1185ad48b4a2c9f0ec190d39504be63bcdbf47f3 | 627 | py | Python | app/converter/migrations/0002_custom.py | lis-space/currency-converter | e794d5c5148f106613a846840b857173eb2531a0 | [
"MIT"
] | null | null | null | app/converter/migrations/0002_custom.py | lis-space/currency-converter | e794d5c5148f106613a846840b857173eb2531a0 | [
"MIT"
] | null | null | null | app/converter/migrations/0002_custom.py | lis-space/currency-converter | e794d5c5148f106613a846840b857173eb2531a0 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-21 20:12
from django.db import migrations
def init_currencies(apps, schema_editor):
Currencies = apps.get_model('converter', 'Currencies')
Currencies.objects.create(code='CZK', name='Czech Republic Koruna')
Currencies.objects.create(code='EUR', name='Euro')
Currencies.objects.create(code='PLN', name='Polish Zloty')
Currencies.objects.create(code='USD', name='United States Dollar')
class Migration(migrations.Migration):
dependencies = [
('converter', '0001_initial'),
]
operations = [
migrations.RunPython(init_currencies),
]
| 27.26087 | 71 | 0.69697 | 75 | 627 | 5.76 | 0.64 | 0.157407 | 0.212963 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036329 | 0.165869 | 627 | 22 | 72 | 28.5 | 0.789675 | 0.07177 | 0 | 0 | 1 | 0 | 0.187931 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0.071429 | 0 | 0.357143 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
11997fb73c8f3cacad4f3ab2e52ff61e48c1d82a | 136 | py | Python | day9/square.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | day9/square.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | day9/square.py | nikhilsamninan/python-files | 15198459081097058a939b40b5e8ef754e578fe0 | [
"Apache-2.0"
] | null | null | null | def square(a):
return(a*a)
# a=int(input("enter the number"))
# square(a)
s=[2,3,4,5,6,7,8,9,10]
print(list(map(square,s)))
| 12.363636 | 34 | 0.573529 | 29 | 136 | 2.689655 | 0.758621 | 0.179487 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088496 | 0.169118 | 136 | 10 | 35 | 13.6 | 0.60177 | 0.308824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.25 | 0.25 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
11a17391f5e46a0b3cc82dd93d19f0f87b7a4fca | 491 | py | Python | tutoriales/clase10-05/TP3.py | pgentil/PC | 6ee4e79f4594f4c733fb07106ac179575370956d | [
"MIT"
] | null | null | null | tutoriales/clase10-05/TP3.py | pgentil/PC | 6ee4e79f4594f4c733fb07106ac179575370956d | [
"MIT"
] | null | null | null | tutoriales/clase10-05/TP3.py | pgentil/PC | 6ee4e79f4594f4c733fb07106ac179575370956d | [
"MIT"
] | null | null | null | #clases
#__init__ --> constructor
#self --> para identificar los metodos de la clase
#la clase es como un plano y el __init__ te lo construye
# metodos son las funciones dentro de la clase, y deben tener siempre el self
#getters y setters (metodos) --> para ver un atributo del objeto en cuestion, porque no es buena practica acceder a esos atributos directamente
#los setters son para setear un nuevo valor de algun atrubuto
#los getters son para acceder a atributos del objeto
#reificar
| 44.636364 | 144 | 0.780041 | 80 | 491 | 4.6875 | 0.625 | 0.056 | 0.048 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175153 | 491 | 10 | 145 | 49.1 | 0.925926 | 0.961303 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.1 | null | 1 | null | true | 0 | 0 | null | null | null | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
11a27fff7b2123c4f9d7f5771cb970842c7411eb | 1,002 | py | Python | Homework_4/H_Deciphering_the_Maya_Script/H_Deciphering_the_Maya_Script.py | dimk00z/summer_yandex_algorithmic_course | 36006bd7eea031764369becac84458427e3f848b | [
"MIT"
] | 8 | 2021-06-11T08:27:29.000Z | 2022-01-25T09:20:37.000Z | Homework_4/H_Deciphering_the_Maya_Script/H_Deciphering_the_Maya_Script.py | dimk00z/summer_yandex_algorithmic_course | 36006bd7eea031764369becac84458427e3f848b | [
"MIT"
] | null | null | null | Homework_4/H_Deciphering_the_Maya_Script/H_Deciphering_the_Maya_Script.py | dimk00z/summer_yandex_algorithmic_course | 36006bd7eea031764369becac84458427e3f848b | [
"MIT"
] | 3 | 2021-06-18T15:44:27.000Z | 2021-09-09T18:38:12.000Z | from collections import Counter
def decrypt(word, letter_sequence):
answer = 0
word_length, letter_sequence_length = len(word), len(letter_sequence)
if word_length < letter_sequence_length:
return answer
letter_sequence_counter = Counter(letter_sequence)
word_counter = Counter(word[:letter_sequence_length-1])
index = 0
for index in range(letter_sequence_length - 1,
word_length):
word_counter[word[index]] += 1
if word_counter == letter_sequence_counter:
answer += 1
word_counter[word[index - letter_sequence_length + 1]] -= 1
if word_counter[word[index - letter_sequence_length + 1]] == 0:
del word_counter[word[index - letter_sequence_length + 1]]
return answer
with open('input.txt') as file:
lines = file.readlines()
letter_sequence = lines[1].strip()
word = lines[2].strip()
with open('output.txt', 'w') as file:
file.write(str(decrypt(word, letter_sequence)))
| 31.3125 | 73 | 0.673653 | 130 | 1,002 | 4.946154 | 0.269231 | 0.304821 | 0.217729 | 0.163297 | 0.284603 | 0.191291 | 0.191291 | 0.191291 | 0 | 0 | 0 | 0.01671 | 0.223553 | 1,002 | 31 | 74 | 32.322581 | 0.809769 | 0 | 0 | 0.083333 | 0 | 0 | 0.01996 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | false | 0 | 0.041667 | 0 | 0.166667 | 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 | 0 | 0 | 0 | 3 |
11b59a14cce71211e66c2604405635539b13286f | 389 | py | Python | google_form_utils.py | kagihiro/discordpy-startup | 0e358d5eb594d0b7b50c51adac92497b82481f86 | [
"MIT"
] | null | null | null | google_form_utils.py | kagihiro/discordpy-startup | 0e358d5eb594d0b7b50c51adac92497b82481f86 | [
"MIT"
] | null | null | null | google_form_utils.py | kagihiro/discordpy-startup | 0e358d5eb594d0b7b50c51adac92497b82481f86 | [
"MIT"
] | null | null | null | import requests
url = "https://docs.google.com/forms/d/e/1FAIpQLScwuK8YoZsGFxVOuaQPa1rawwdBhEflgwomgd1-K7Pkwn_bYA/formResponse"
# 2107036936 = u_name
# 1837347428 = t_name
# 823897192 = d_main
# 923874105 = d_sub
# 524364112 = ken
# 70018937 = bp
def to_entry_id(params_id):
return f"entry.{params_id}"
def send_form(params):
r = requests.get(url, params=params)
return r
| 20.473684 | 111 | 0.74036 | 53 | 389 | 5.245283 | 0.716981 | 0.057554 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181269 | 0.1491 | 389 | 18 | 112 | 21.611111 | 0.65861 | 0.272494 | 0 | 0 | 0 | 0 | 0.434783 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.142857 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
11cc9ee574309291776dd5f2e49096d9dbdb5e3a | 306 | py | Python | Lab01/encuesta/urls.py | anacasas12/TECSUP-DAE-2021-2 | d12719c1b9a4679a5c9474d55631faa14d2d5a01 | [
"MIT"
] | null | null | null | Lab01/encuesta/urls.py | anacasas12/TECSUP-DAE-2021-2 | d12719c1b9a4679a5c9474d55631faa14d2d5a01 | [
"MIT"
] | null | null | null | Lab01/encuesta/urls.py | anacasas12/TECSUP-DAE-2021-2 | d12719c1b9a4679a5c9474d55631faa14d2d5a01 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('',views.index,name='index'),
path('<int:pregunta_id>/',views.detalle, name='detalle'),
path('<int:pregunta_id>/resultado', views.resultado,name='resultado'),
path('<int:pregunta_id>/votar', views.votar,name='votar')
]
| 30.6 | 74 | 0.686275 | 40 | 306 | 5.175 | 0.375 | 0.101449 | 0.217391 | 0.246377 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 306 | 9 | 75 | 34 | 0.766667 | 0 | 0 | 0 | 0 | 0 | 0.30719 | 0.163399 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
11fb255e7f39ccbb8feb4c2d8d38adc17a655c2a | 149 | py | Python | hash_table/tools.py | jayzane/leetcodePy | 27fbad4a4a94a60bed6cfa89cbef6ce17fa5e7d5 | [
"Apache-2.0"
] | null | null | null | hash_table/tools.py | jayzane/leetcodePy | 27fbad4a4a94a60bed6cfa89cbef6ce17fa5e7d5 | [
"Apache-2.0"
] | null | null | null | hash_table/tools.py | jayzane/leetcodePy | 27fbad4a4a94a60bed6cfa89cbef6ce17fa5e7d5 | [
"Apache-2.0"
] | null | null | null | import hashlib
def get_hash(key, m):
if key is None:
return 0
return int(hashlib.md5(str(key).encode()).hexdigest(), 16) % (m - 1)
| 18.625 | 72 | 0.604027 | 24 | 149 | 3.708333 | 0.791667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044248 | 0.241611 | 149 | 7 | 73 | 21.285714 | 0.743363 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
11fc1477465003a85c38d152c7a414f7f9365270 | 161 | py | Python | src/eops/eops/models.py | haltu/eca-eops | 2316af10ac08aabc23713a5065c8def79665f895 | [
"MIT"
] | null | null | null | src/eops/eops/models.py | haltu/eca-eops | 2316af10ac08aabc23713a5065c8def79665f895 | [
"MIT"
] | 11 | 2018-08-16T12:09:57.000Z | 2018-08-22T14:26:15.000Z | src/eops/eops/models.py | haltu/eca-eops | 2316af10ac08aabc23713a5065c8def79665f895 | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
import logging
from django.db import models
LOG = logging.getLogger(__name__)
# vim: tabstop=2 expandtab shiftwidth=2 softtabstop=2
| 14.636364 | 53 | 0.726708 | 22 | 161 | 5.136364 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029412 | 0.15528 | 161 | 10 | 54 | 16.1 | 0.801471 | 0.453416 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
ee97d87a30cb7bf92623381db9133d1180677f45 | 132 | py | Python | examples/atbash.py | CameronLonsdale/cckrusher | 3d9d99d27e56a78b0c4982c30f30818f13150e47 | [
"MIT"
] | 19 | 2017-04-08T08:03:40.000Z | 2022-02-23T03:06:33.000Z | examples/atbash.py | CameronLonsdale/cckrusher | 3d9d99d27e56a78b0c4982c30f30818f13150e47 | [
"MIT"
] | 21 | 2017-04-23T12:42:22.000Z | 2019-06-15T03:51:43.000Z | examples/atbash.py | CameronLonsdale/cckrypto | 3d9d99d27e56a78b0c4982c30f30818f13150e47 | [
"MIT"
] | 4 | 2017-06-28T06:10:05.000Z | 2019-11-19T04:23:46.000Z | #!/usr/bin/env python3
from lantern.modules import atbash
ciphertext = "uozt{Yzybolm}"
print(''.join(atbash.decrypt(ciphertext)))
| 18.857143 | 42 | 0.75 | 17 | 132 | 5.823529 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008333 | 0.090909 | 132 | 6 | 43 | 22 | 0.816667 | 0.159091 | 0 | 0 | 0 | 0 | 0.118182 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
eeb6b78689107923e01841edb834984590fb1991 | 261 | py | Python | Cura/Cura/plugins/CuraDrive/__init__.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/Cura/plugins/CuraDrive/__init__.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | Cura/Cura/plugins/CuraDrive/__init__.py | TIAO-JI-FU/3d-printing-with-moveo-1 | 100ecfd1208fe1890f8bada946145d716b2298eb | [
"MIT"
] | null | null | null | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from .src.DrivePluginExtension import DrivePluginExtension
def getMetaData():
return {}
def register(app):
return {"extension": DrivePluginExtension()}
| 20.076923 | 59 | 0.739464 | 31 | 261 | 6.225806 | 0.83871 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023041 | 0.168582 | 261 | 12 | 60 | 21.75 | 0.866359 | 0.348659 | 0 | 0 | 0 | 0 | 0.053892 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.2 | 0.4 | 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 | 0 | 1 | 1 | 0 | 0 | 3 |
eec73f9ca2fef49b48eb4a72fb9d37ddde6b43d1 | 701 | py | Python | pyautofinance/common/engine/components_assembly.py | webclinic017/PyAutoFinance | 532cb1c5418dd9eeb07f2f08646170cde1fe0303 | [
"MIT"
] | null | null | null | pyautofinance/common/engine/components_assembly.py | webclinic017/PyAutoFinance | 532cb1c5418dd9eeb07f2f08646170cde1fe0303 | [
"MIT"
] | null | null | null | pyautofinance/common/engine/components_assembly.py | webclinic017/PyAutoFinance | 532cb1c5418dd9eeb07f2f08646170cde1fe0303 | [
"MIT"
] | 1 | 2022-02-24T09:18:13.000Z | 2022-02-24T09:18:13.000Z |
class ComponentsAssembly:
def __init__(self, broker, strategy, datafeed, sizer, metrics_collection, *args):
self._components = [broker, strategy, datafeed, sizer, metrics_collection, *args]
def __iter__(self):
self.index = 0
return self
def __next__(self):
if self.index < len(self._components):
component = self._components[self.index]
self.index += 1
return component
raise StopIteration
def __getitem__(self, item):
return self._components[item]
def __setitem__(self, key, value):
self._components[key] = value
def append(self, item):
self._components.append(item)
| 25.035714 | 89 | 0.633381 | 75 | 701 | 5.546667 | 0.4 | 0.201923 | 0.105769 | 0.129808 | 0.230769 | 0.230769 | 0.230769 | 0 | 0 | 0 | 0 | 0.003914 | 0.271041 | 701 | 27 | 90 | 25.962963 | 0.810176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.055556 | 0.555556 | 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 | 0 | 1 | 0 | 0 | 3 |
eecc4aebca52e53d463aa21f415134d4d067f691 | 7,661 | py | Python | htk-lite/commandlist/banner.py | otherbeast/hackers-tool-kit | 12991889db1f6843dde82e7da4b4cdfb50740da5 | [
"Apache-2.0"
] | 393 | 2019-01-21T05:52:54.000Z | 2022-03-29T06:07:04.000Z | htk-lite/commandlist/banner.py | otherbeast/hackers-tool-kit | 12991889db1f6843dde82e7da4b4cdfb50740da5 | [
"Apache-2.0"
] | 19 | 2019-02-22T00:49:28.000Z | 2021-12-30T20:28:59.000Z | htk-lite/commandlist/banner.py | otherbeast/hackers-tool-kit | 12991889db1f6843dde82e7da4b4cdfb50740da5 | [
"Apache-2.0"
] | 138 | 2019-03-15T23:22:19.000Z | 2022-03-20T17:19:09.000Z | #!/usr/local/bin/python
# coding: latin-1
#if you use this code give me credit @tuf_unkn0wn
#i do not give you permission to show / edit this script without my credit
#to ask questions or report a problem message me on instagram @tuf_unkn0wn
"""
██░ ██ ▄▄▄ ▄████▄ ██ ▄█▀▓█████ ▓█████▄
▓██░ ██▒▒████▄ ▒██▀ ▀█ ██▄█▒ ▓█ ▀ ▒██▀ ██▌
▒██▀▀██░▒██ ▀█▄ ▒▓█ ▄ ▓███▄░ ▒███ ░██ █▌
░▓█ ░██ ░██▄▄▄▄██ ▒▓▓▄ ▄██▒▓██ █▄ ▒▓█ ▄ ░▓█▄ ▌
░▓█▒░██▓ ▓█ ▓██▒▒ ▓███▀ ░▒██▒ █▄░▒████▒░▒████▓
▒ ▒░▒ ▒▒ ▓▒█ ░▒ ▒ ░▒ ▒▒ ▓▒ ▒░ ░ ▒▒▓ ▒
▒ ░▒░ ░ ▒ ▒▒ ░ ░ ▒ ░ ░▒ ▒░ ░ ░ ░ ░ ▒ ▒
░ ░ ░ ▒ ░ ░ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░
░ ░
"""
import os
import sys
import random
lred = '\033[91m'
lblue = '\033[94m'
lgreen = '\033[92m'
yellow = '\033[93m'
cyan = '\033[1;36m'
purple = '\033[95m'
red = '\033[31m'
green = '\033[32m'
blue = '\033[34m'
orange = '\033[33m'
colorlist = [red, blue, green, yellow, lblue, purple, cyan, lred, lgreen, orange]
randomcolor = random.choice(colorlist)
banner3list = [red, blue, green, purple]
def mainbanner1():
print """\033[1;36m
┬ ┬┌┬┐┌─┐\033[0m
│ │ │ ├┤ \033[1;36m
┴─┘┴ ┴ └─┘ \033[0m
██╗ ██╗████████╗██╗ ██╗
██║ ██║╚══██╔══╝██║ ██╔╝\033[1;36m
███████║ ██║ █████╔╝ \033[0m
██╔══██║ ██║ ██╔═██╗
██║ ██║ ██║ ██║ ██╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝
\n""".decode('utf-8')
def mainbanner2():
print """
░░▒█████████
▒▓▓█████████████
░▓█████████████████████░ ░▒███▓
░▓██████████████████████████████████
░░▒▓▓▓███████████┬ ┬┌┬┐┌─┐████████████▓
░▓██████▓▓██████████│ │ │ ├┤ █████████████▓░
░▓██████▓███████▓██████┴─┘┴ ┴ └─┘████████████████░
░░▒░░░░▒▒▒▓▓░░▒███████████████████████████▓▓▓░
░░░▒░░░▒▓▓▒░▒▒░▒▓████████▓▓██▒▒░
░▒░░░░░░▒░░░░░░░
\n""".decode('utf-8')
def mainbanner3():
print """
╔═══════════════════════════════════════════════╗
║ ║
║ {0} ██░ ██ ▄▄▄█████▓ ██ ▄█▀ ██▓ \033[0m ║
║ {1} ▓██░ ██▒▓ ██▒ ▓▒ ██▄█▒ ▓██▒ \033[0m ║
║ {2} ▒██▀▀██░▒ ▓██░ ▒░▓███▄░ ▒██░ \033[0m ║
║ {3} ░▓█ ░██ ░ ▓██▓ ░ ▓██ █▄ ▒██░ \033[0m║
║ {4} ░▓█▒░██▓ ▒██▒ ░ ▒██▒ █▄░██████▒ \033[0m║
║ {5} ▒ ░░▒░▒ ▒ ░░ ▒ ▒▒ ▓▒░ ▒░▓ ░ \033[0m║
║ {6} ▒ ░▒░ ░ ░ ░ ░▒ ▒░░ ░ ▒ ░ \033[0m║
║ {7} ░ ░░ ░ ░ ░ ░░ ░ ░ ░ \033[0m║
║ {8} ░ ░ ░ ░ ░ ░ ░ \033[0m║
║ ║
║ ║
╚═══════════════════════════════════════════════╝
""".decode('utf-8').format(random.choice(banner3list), random.choice(banner3list), random.choice(banner3list), random.choice(banner3list), random.choice(banner3list), random.choice(banner3list), random.choice(banner3list), random.choice(banner3list), random.choice(banner3list))
def mainbanner4():
print """\033[0m
████████████████████████████████████████████████████████████████████████████\033[91m
███ ███████ ██ █ ███ ███████ ████████ ██ ████████████\033[33m
████ ███████ ██████ █████ ██ █████████ █ █ █████████ ██ ██ ██████ ███\033[93m
████ █████ ███████ ██████ █████████████ ████████ ███ █████ ████\033[92m
████ ██████ █████ █████████████ ██████ █ █ ██ ██ █ █████ ███\033[94m
████ █████ ███████ ██████ █████████████ █████████ ████ ███ ███\033[1;36m
████ ███████ ███████ ██████ ██ ███████████ █████ ███ ████ ██ █ █████████\033[95m
███ █████ █████ ████ ███ ████████ ██ ███ ████ ███\033[0m
████████████████████████████████████████████████████████████████████████████
\033[0m\n""".decode('utf-8')
def mainbanner5():
print """\033[92m
█ ▄ ▄ █ ▄███▄ ▄██ ▄███▀
███ ███ ▄█████████▄ ███▐██▀
███ ███ ██▀▀███▀▀██ █████▀
███▄▄▄▄███ ▀ ███ ▀ ██████▄
███▀▀▀▀███ ▄ ███ ▄ ███▐██▄
███ ███ \033[0m┌─┐┌─┐┬┌─┌─┐┬─┐┌─┐ \033[92m███ \033[0m┌─┐┌─┐┬ \033[92m███ ▀███▄ \033[0m┬┌┬┐\033[92m
███ ███ \033[0m├─┤│ ├┴┐├┤ ├┬┘└─┐ \033[92m███ \033[0m│ ││ ││ \033[92m███ ██ \033[0m│ │ \033[92m
█ █ \033[0m┴ ┴└─┘┴ ┴└─┘┴└─└─┘ \033[92m▀███▀ \033[0m└─┘└─┘┴─┘ \033[92m▀ ▀ \033[0m┴ ┴\033[92m
███
█ █
█ █ ██ ████████ ███████
█ █ ██ ██ ██
█ █ ██ ██ █████
█ █ ▄ ██ ██ ██
█████▄▄██ ██ ██ ███████
""".decode('utf-8')
def mainbanner6():
print """
• \033[35m▄█\033[0m . \033[35m█▄ \033[0m. \033[35m███ \033[0m. • \033[35m▄█ ▄█▄\033[0m. \033[35m▄█ \033[0m•
\033[35m█#█ █#█\033[0m• \033[35m▀████=████▄\033[0m. \033[35m███ ▄█ █▀ █⇣█ \033[0m.
. \033[35m█#█ \033[0m. •\033[35m█#█ \033[0m. \033[35m▀█-█▀▀██ \033[0m.\033[35m█ █▐ █▀ \033[0m• \033[35m█L█ \033[0m.
\033[35m▄███▄▄▄▄███▄▄ \033[0m. \033[35m█▪█ \033[0m. \033[35m▀ ▄█████▀ \033[0m.\033[35m█i█
▀▀█+█▀▀▀▀█+█▀ \033[0m• \033[35m█▪█ \033[0m. \033[35m▀▀█ █ █▄\033[0m. \033[35m█t█ \033[0m.
.\033[35m█•█ \033[0m. \033[35m█•█ \033[0m. \033[35m█▪█ \033[0m• \033[35m███▐ █▄ \033[0m. \033[35m█e█ \033[0m.
\033[35m█+█ █+█ \033[0m. \033[35m█▪█ \033[0m. \033[35m█ █\033[0m.\033[35m▀█ █▄ █⇡█▌ \033[0m• \033[35m▄
\033[0m• \033[35m███ \033[0m.\033[35m█▀ \033[0m. \033[35m ▄████▀ \033[0m. \033[35m███ \033[0m. \033[35m▀█▀ █████▄▄██
\033[0m . . . . \033[35m▀ \033[0m•\033[35m▀\033[0m]
""".decode('utf-8')
def mainbanner7():
print """\033[31m
██╗ ██╗████████╗██╗ ██╗ ██╗ ██╗████████╗███████╗
██║ ██║╚\033[91m══██╔══╝██║ ██╔╝ ██║ ██║╚══██╔══╝██╔════╝
███████║ ██║ █████╔╝████\033[33m█╗██║ ██║ ██║ █████╗
██╔══██║ ██║ ██╔═██╗╚════╝\033[93m██║ ██║ ██║ ██╔══╝
██║ ██║ ██║ ██║ ██╗ ███████╗██║ ██║ ███████╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚══════╝\033[0m
""".decode('utf-8')
def mainbanner8():
print """\033[34m
██╗ ██╗████████╗██╗ ██╗ ██╗ ██╗████████╗███████╗
██║ ██║╚══██╔══╝██║ ██╔╝ ██║ ██║╚══██╔══╝██╔════╝
███████║ ██║ █████╔╝█████╗█\033[94m█║ ██║ ██║ █████╗
██╔══██║ ██║ ██╔═██╗╚════╝██║ ██║ ██║ ██╔══╝
██║ ██║ █\033[1;36m█║ ██║ ██╗ ███████╗██║ ██║ ███████╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚══════╝
\033[0m""".decode('utf-8')
def mainbanner9():
print """\033[93m
██╗ ██╗████████╗██╗ ██╗ ██╗ ██╗████████╗███████╗
██║ ██║╚══██╔══╝██║ ██╔╝ ██║ ██║╚══██╔══╝██╔════╝
███\033[92m████║ ██║ █████╔╝█████╗██║ ██║ ██║ █████╗
██╔══██║ ██║ ██╔═██╗╚════╝\033[32m██║ ██║ ██║ ██╔══╝
██║ ██║ ██║ ██║ ██╗ ███████╗██║ ██║ ███████╗
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝ ╚══════╝
\033[0m""".decode('utf-8')
def mainbanner():
import random
for x in range(10):
num = random.randint(1,9)
if num == 1:
mainbanner1()
if num == 2:
mainbanner2()
if num == 3:
mainbanner3()
if num == 4:
mainbanner4()
if num == 5:
mainbanner5()
if num == 6:
mainbanner6()
if num == 7:
mainbanner7()
if num == 8:
mainbanner8()
if num == 9:
mainbanner9()
mainbanner()
| 40.534392 | 279 | 0.245529 | 1,110 | 7,661 | 4.11982 | 0.244144 | 0.069976 | 0.018369 | 0.062541 | 0.357971 | 0.261972 | 0.235513 | 0.190028 | 0.180625 | 0.153291 | 0 | 0.135512 | 0.31706 | 7,661 | 188 | 280 | 40.75 | 0.223624 | 0.030283 | 0 | 0.16 | 0 | 0.08 | 0.805921 | 0.095451 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.026667 | null | null | 0.06 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eed8ba482690df93879f966bf3886d31fb7aaae0 | 610 | py | Python | migrations/029_message_read.py | xphlawlessx/ceknito | 6cdadc94fbee5e544b39983aa93f933afe9664ab | [
"MIT"
] | 47 | 2020-05-24T01:19:17.000Z | 2022-03-18T23:42:12.000Z | migrations/029_message_read.py | FunConclusion2661/throat | c52afae5af41c8d5695df50494ec805a21293804 | [
"MIT"
] | 185 | 2020-05-01T18:50:39.000Z | 2022-03-18T14:13:14.000Z | migrations/029_message_read.py | FunConclusion2661/throat | c52afae5af41c8d5695df50494ec805a21293804 | [
"MIT"
] | 41 | 2020-05-01T20:32:26.000Z | 2022-03-13T13:00:15.000Z | """Peewee migrations -- 029_message_read.py
Remove an unused field from the Message model.
"""
import datetime as dt
from enum import IntEnum
import peewee as pw
from decimal import ROUND_HALF_EVEN
try:
import playhouse.postgres_ext as pw_pext
except ImportError:
pass
SQL = pw.SQL
def migrate(migrator, database, fake=False, **kwargs):
"""Write your migrations here."""
migrator.remove_fields("message", "read")
def rollback(migrator, database, fake=False, **kwargs):
"""Write your rollback migrations here."""
migrator.add_fields("message", read=pw.DateTimeField(null=True))
| 21.785714 | 68 | 0.734426 | 83 | 610 | 5.301205 | 0.590361 | 0.075 | 0.090909 | 0.113636 | 0.181818 | 0.181818 | 0.181818 | 0 | 0 | 0 | 0 | 0.005837 | 0.157377 | 610 | 27 | 69 | 22.592593 | 0.850195 | 0.25082 | 0 | 0 | 0 | 0 | 0.041002 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0.076923 | 0.461538 | 0 | 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 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
eedf75ba758051f705889ce26b3efb5b8052e3ff | 63 | py | Python | file.py | avanish001/HelloWorld | 367a16748bca85902901eaf9604376b6aa5b23e9 | [
"MIT"
] | null | null | null | file.py | avanish001/HelloWorld | 367a16748bca85902901eaf9604376b6aa5b23e9 | [
"MIT"
] | null | null | null | file.py | avanish001/HelloWorld | 367a16748bca85902901eaf9604376b6aa5b23e9 | [
"MIT"
] | null | null | null | N = int(raw_input())
for i in xrange(N):
print "hello world"
| 15.75 | 21 | 0.650794 | 12 | 63 | 3.333333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.190476 | 63 | 3 | 22 | 21 | 0.784314 | 0 | 0 | 0 | 0 | 0 | 0.174603 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eefabbd72b3541cd3d6daeab01811065a4c9bd82 | 64 | py | Python | Paddle_Industry_Practice_Sample_Library/Football_Action/PaddleVideo/paddlevideo/metrics/ActivityNet/__init__.py | linuxonly801/awesome-DeepLearning | b063757fa130c4d56aea5cce2e592610f1e169f9 | [
"Apache-2.0"
] | 883 | 2020-11-12T11:46:46.000Z | 2022-03-31T18:27:10.000Z | paddlevideo/metrics/ActivityNet/__init__.py | arkofgalaxy/PaddleVideo | 64251233c83b7eb681061b454da198a9082309a6 | [
"Apache-2.0"
] | 233 | 2020-12-09T06:04:59.000Z | 2022-03-28T08:16:51.000Z | paddlevideo/metrics/ActivityNet/__init__.py | arkofgalaxy/PaddleVideo | 64251233c83b7eb681061b454da198a9082309a6 | [
"Apache-2.0"
] | 225 | 2020-11-13T06:21:55.000Z | 2022-03-31T05:36:11.000Z | from .anet_prop import ANETproposal
__all__ = ['ANETproposal']
| 16 | 35 | 0.78125 | 7 | 64 | 6.428571 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125 | 64 | 3 | 36 | 21.333333 | 0.803571 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
e102b764ccf1618f2746b6790039db8402a4221b | 978 | py | Python | bludit/credentials.py | 74wny0wl/bluditcracker | 3d4e46d03cfb74948bb6219139e402602b32e66e | [
"MIT"
] | null | null | null | bludit/credentials.py | 74wny0wl/bluditcracker | 3d4e46d03cfb74948bb6219139e402602b32e66e | [
"MIT"
] | null | null | null | bludit/credentials.py | 74wny0wl/bluditcracker | 3d4e46d03cfb74948bb6219139e402602b32e66e | [
"MIT"
] | null | null | null | import itertools
import os
import logging
class BluditCredentialsFactory:
def __init__(self):
self.csrf_token = None
def use_csrf_token(self, csrf_token):
self.csrf_token = csrf_token
def create_credentials(self, username, password):
credentials = {'tokenCSRF': self.csrf_token, 'username': username, 'password': password, 'save': ''}
return credentials
def __load_file_lines__(filename):
lines = []
if not os.path.isfile(filename):
logging.getLogger().error('File path {} does not exist'.format(filename))
else:
with open(filename, 'r') as f:
lines = f.readlines()
lines = [line.strip() for line in lines]
return lines
def load_usernames(filename):
return __load_file_lines__(filename)
def load_passwords(filename):
return __load_file_lines__(filename)
def build_credentials_wordlist(usernames, passwords):
return list(itertools.product(usernames, passwords))
| 24.45 | 108 | 0.696319 | 116 | 978 | 5.577586 | 0.431034 | 0.083462 | 0.080371 | 0.097372 | 0.171561 | 0.117465 | 0.117465 | 0 | 0 | 0 | 0 | 0 | 0.202454 | 978 | 39 | 109 | 25.076923 | 0.829487 | 0 | 0 | 0.076923 | 0 | 0 | 0.058282 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0.192308 | 0.115385 | 0.115385 | 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 | 0 | 0 | 0 | 3 |
e10df0089a4fa7eb626917c077b576ce4ca7a244 | 1,455 | py | Python | clickfig/config/file/python.py | jackmaney/clickfig | 7f2bca47860470cc5b44b6c9139a59a360644bbe | [
"MIT"
] | null | null | null | clickfig/config/file/python.py | jackmaney/clickfig | 7f2bca47860470cc5b44b6c9139a59a360644bbe | [
"MIT"
] | null | null | null | clickfig/config/file/python.py | jackmaney/clickfig | 7f2bca47860470cc5b44b6c9139a59a360644bbe | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import imp
import inspect
import os
import re
from .base import BaseConfigFile, ConfigReadResult, flatten_dict
from ...base import return_key_value
# TODO: Python 3 compatibility
def import_module(module_file):
"""
Given a path to a Python file, this function imports it and returns the imported module.
:param str module_file: The filename of the module that you wish to include.
"""
module_name = re.sub("\.py$", "", os.path.split(module_file)[-1])
module_dir = os.path.abspath(os.path.dirname(module_file))
f, filename, description = imp.find_module(module_name, [module_dir])
return imp.load_module(module_name, f, filename, description)
class PythonConfigFile(BaseConfigFile):
def read(self, key=None, flatten=True):
if not self.exists():
return None
config_module = import_module(self.name)
data = {
k: v for k, v in inspect.getmembers(config_module) if
k not in ["__builtins__", "__doc__", "__name__", "__package__", "__file__"]
}
result = return_key_value(data, key=key)
if flatten and isinstance(result, dict):
result = flatten_dict(result, separator=self.separator)
result = ConfigReadResult(result, key=key, separator=self.separator)
return result
def write(self, key, value, read_existing_data=True):
raise NotImplementedError
| 28.529412 | 92 | 0.687285 | 188 | 1,455 | 5.06383 | 0.430851 | 0.042017 | 0.029412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001757 | 0.217869 | 1,455 | 50 | 93 | 29.1 | 0.834798 | 0.134708 | 0 | 0 | 0 | 0 | 0.041162 | 0 | 0 | 0 | 0 | 0.02 | 0 | 1 | 0.107143 | false | 0 | 0.321429 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
e10ffcceb5b531272f12e90560fcb43b14fecf06 | 289 | py | Python | users/tests/factories.py | Flict-dev/Boxes-api | a2aa76b2db6aaa5af1028138566dc3b2b251fcdb | [
"MIT"
] | 1 | 2021-12-13T22:03:58.000Z | 2021-12-13T22:03:58.000Z | users/tests/factories.py | Flict-dev/Boxes-api | a2aa76b2db6aaa5af1028138566dc3b2b251fcdb | [
"MIT"
] | null | null | null | users/tests/factories.py | Flict-dev/Boxes-api | a2aa76b2db6aaa5af1028138566dc3b2b251fcdb | [
"MIT"
] | null | null | null | import factory
from django.contrib.auth import get_user_model
class UserFactory(factory.django.DjangoModelFactory):
class Meta:
model = get_user_model()
username = factory.sequence(lambda n: f"Username - {n}")
password = factory.sequence(lambda n: f"Password{n}!@")
| 26.272727 | 60 | 0.723183 | 37 | 289 | 5.540541 | 0.513514 | 0.068293 | 0.117073 | 0.214634 | 0.22439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16609 | 289 | 10 | 61 | 28.9 | 0.850622 | 0 | 0 | 0 | 0 | 0 | 0.093426 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.142857 | 0.285714 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
e1128fd6f78f7b71ffdd15e935d0cb59b7c198eb | 903 | py | Python | example/gateway/python/magmaexample/hello/rpc_servicer.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 3 | 2019-08-16T17:03:09.000Z | 2019-08-23T21:57:48.000Z | example/gateway/python/magmaexample/hello/rpc_servicer.py | remo5000/magma | 1d1dd9a23800a8e07b1ce016776d93e12430ec15 | [
"BSD-3-Clause"
] | 14 | 2019-11-15T12:01:18.000Z | 2019-12-12T14:37:42.000Z | example/gateway/python/magmaexample/hello/rpc_servicer.py | 119Vik/magma-1 | 107a7b374466a837fc0a49b283ba9d6ff1d702e3 | [
"BSD-3-Clause"
] | 3 | 2019-11-15T15:56:25.000Z | 2019-11-21T10:34:59.000Z | """
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
from protos import hello_pb2, hello_pb2_grpc
from magmaexample.hello import metrics
class HelloRpcServicer(hello_pb2_grpc.HelloServicer):
"""
gRPC based server for Hello service
"""
def __init__(self):
pass
def add_to_server(self, server):
"""
Add the servicer to a gRPC server
"""
hello_pb2_grpc.add_HelloServicer_to_server(self, server)
def SayHello(self, request, context):
"""
Echo the message as the response
"""
metrics.NUM_REQUESTS.inc()
return hello_pb2.HelloReply(greeting=request.greeting)
| 25.8 | 75 | 0.693245 | 122 | 903 | 4.983607 | 0.565574 | 0.065789 | 0.059211 | 0.059211 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013025 | 0.234773 | 903 | 34 | 76 | 26.558824 | 0.86686 | 0.427464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0.1 | 0.2 | 0 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
011da0c63fa2d53bdf5e86f42b95a149b87dde3d | 783 | py | Python | src/lib/centipede/__init__.py | paulondc/centipede | 6000a6964c2ce4a1f9c5ba0fac1d5ab0fead1fbe | [
"MIT"
] | null | null | null | src/lib/centipede/__init__.py | paulondc/centipede | 6000a6964c2ce4a1f9c5ba0fac1d5ab0fead1fbe | [
"MIT"
] | null | null | null | src/lib/centipede/__init__.py | paulondc/centipede | 6000a6964c2ce4a1f9c5ba0fac1d5ab0fead1fbe | [
"MIT"
] | null | null | null | from .PathHolder import PathHolder
from . import Crawler
from .Template import Template, RequiredPathNotFoundError, VariableNotFoundError
from .CrawlerQuery import CrawlerQuery
from .ExpressionEvaluator import ExpressionEvaluator
from .CrawlerMatcher import CrawlerMatcher
from . import ExpressionBundle
from .Task import Task
from . import TaskWrapper
from .TaskHolder import TaskHolder, TaskHolderInvalidVarNameError
from . import TaskHolderLoader
from . import Dispatcher
# The Resource class needs to be imported as the last one, since it's going to
# initialize all the resources defined through the environment variable. These
# resources can be using the modules above (that's why it needs
# be imported as the last one).
from .Resource import Resource, InvalidResourceError
| 41.210526 | 80 | 0.832695 | 95 | 783 | 6.863158 | 0.484211 | 0.076687 | 0.03681 | 0.046012 | 0.067485 | 0.067485 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131545 | 783 | 18 | 81 | 43.5 | 0.958824 | 0.312899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
0121a1dcf306d784ef3745fe6a4ca6d3b91184ac | 103 | py | Python | searchFunction/apps.py | lrbrwnn1/HIVE | 3d5d83d09f91dbc14293b8f3b4a4a6bc8cd06e0b | [
"Apache-2.0"
] | 3 | 2019-03-06T02:17:08.000Z | 2020-04-21T21:58:01.000Z | searchFunction/apps.py | lrbrwnn1/HIVE | 3d5d83d09f91dbc14293b8f3b4a4a6bc8cd06e0b | [
"Apache-2.0"
] | null | null | null | searchFunction/apps.py | lrbrwnn1/HIVE | 3d5d83d09f91dbc14293b8f3b4a4a6bc8cd06e0b | [
"Apache-2.0"
] | 1 | 2020-04-21T21:58:04.000Z | 2020-04-21T21:58:04.000Z | from django.apps import AppConfig
class SearchfunctionConfig(AppConfig):
name = 'searchFunction'
| 17.166667 | 38 | 0.786408 | 10 | 103 | 8.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145631 | 103 | 5 | 39 | 20.6 | 0.920455 | 0 | 0 | 0 | 0 | 0 | 0.135922 | 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 | 0 | 0 | 0 | 3 |
01320999873c12867c3ff893f69b018f5359586a | 481 | py | Python | datastruct/set/BSTSet.py | LibertyDream/algorithm_data_structure | 5d143d04d001a9b8aef30334881d0af56d8c9850 | [
"MIT"
] | null | null | null | datastruct/set/BSTSet.py | LibertyDream/algorithm_data_structure | 5d143d04d001a9b8aef30334881d0af56d8c9850 | [
"MIT"
] | null | null | null | datastruct/set/BSTSet.py | LibertyDream/algorithm_data_structure | 5d143d04d001a9b8aef30334881d0af56d8c9850 | [
"MIT"
] | null | null | null | from BST import BST
from set import Set
class BSTSet(Set):
def __init__(self):
self.bst = BST()
# 判断集合是否为空
def is_empty(self):
return self.bst.is_empty()
# 添加 ele 至集合
def add(self, ele):
self.bst.add(ele)
# 是否包含元素 ele
def contains(self, ele):
return self.bst.contains(ele)
# 从集合内删除 ele
def remove(self, ele):
self.remove(ele)
# 获取集合大小
def get_size(self):
return self.bst.get_size() | 17.178571 | 37 | 0.582121 | 68 | 481 | 4 | 0.352941 | 0.128676 | 0.143382 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.309771 | 481 | 28 | 38 | 17.178571 | 0.819277 | 0.099792 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.133333 | 0.2 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
0152ff818cb624984afdca18d8b07f2366be445e | 290 | py | Python | demo/feedback/views.py | thibaudcolas/django-draftail | e347db9fa5feb3c03c2546f402380ef0730479cb | [
"MIT"
] | 7 | 2019-04-07T19:39:42.000Z | 2020-11-07T19:26:50.000Z | demo/feedback/views.py | thibaudcolas/django-draftail | e347db9fa5feb3c03c2546f402380ef0730479cb | [
"MIT"
] | null | null | null | demo/feedback/views.py | thibaudcolas/django-draftail | e347db9fa5feb3c03c2546f402380ef0730479cb | [
"MIT"
] | 3 | 2019-12-24T12:08:08.000Z | 2021-07-13T17:23:40.000Z | from django.urls import reverse
from django.views import generic
from .forms import FeedbackForm
class DemoFormView(generic.FormView):
form_class = FeedbackForm
template_name = "feedback/feedback_form.html"
def get_success_url(self):
return reverse("feedback-form")
| 22.307692 | 49 | 0.762069 | 36 | 290 | 6 | 0.638889 | 0.092593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165517 | 290 | 12 | 50 | 24.166667 | 0.892562 | 0 | 0 | 0 | 0 | 0 | 0.137931 | 0.093103 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0.125 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
0153db410752ee93a050d18b4db60925e1d05fdd | 98 | py | Python | utils/ConvertType.py | alexwoo1900/colorpalette | 92b05edc716a3d477ef77c3f2b1dd84184fd6df3 | [
"MIT"
] | 1 | 2019-05-08T07:52:38.000Z | 2019-05-08T07:52:38.000Z | utils/ConvertType.py | alexwoo1900/colorpalette | 92b05edc716a3d477ef77c3f2b1dd84184fd6df3 | [
"MIT"
] | null | null | null | utils/ConvertType.py | alexwoo1900/colorpalette | 92b05edc716a3d477ef77c3f2b1dd84184fd6df3 | [
"MIT"
] | null | null | null | RGB2HEX = 1
RGB2HSV = 2
RGB2HSL = 3
HEX2RGB = 4
HSV2RGB = 5
OPCV_RGB2HSV = 100
OPCV_HSV2RGB = 101 | 12.25 | 18 | 0.714286 | 16 | 98 | 4.25 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.233766 | 0.214286 | 98 | 8 | 19 | 12.25 | 0.649351 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 | 3 |
015881b707d3f78d4570c45578ffdec468e1b40d | 1,081 | py | Python | python/templating.py | tattlemuss/daily-bard | 3258568c23fb0e4f66b302afa1237f23cc27df36 | [
"MIT"
] | null | null | null | python/templating.py | tattlemuss/daily-bard | 3258568c23fb0e4f66b302afa1237f23cc27df36 | [
"MIT"
] | null | null | null | python/templating.py | tattlemuss/daily-bard | 3258568c23fb0e4f66b302afa1237f23cc27df36 | [
"MIT"
] | null | null | null | """
Wrapper functions round the Python standard templating lib
"""
import os, daily_bard_settings
def get_module_directory():
""" Return the full path to this very python file.
Used to load template/section data"""
# TODO: factor out
import inspect
module_fname = inspect.getfile(inspect.currentframe()) # script filename (usually with path)
return os.path.dirname(os.path.abspath(module_fname)) # script directory
def expand(tmpl_text, values):
""" Simplest template expander. """
from string import Template
tmpl = Template(tmpl_text)
return tmpl.substitute(values)
def load(fname):
""" Load a template in the TEMPLATE_PATH directory into a string """
mod_dir = get_module_directory()
abs_fname = os.path.join(mod_dir, daily_bard_settings.TEMPLATE_PATH, fname)
fh = open(abs_fname, "r")
lines = ''.join(fh.readlines())
fh.close()
return lines
def expand_file(fname, values):
""" Expand a template in the TEMPLATE_PATH directory """
lines = load(fname)
return expand(lines, values)
| 31.794118 | 97 | 0.699352 | 144 | 1,081 | 5.111111 | 0.444444 | 0.024457 | 0.046196 | 0.038043 | 0.095109 | 0.095109 | 0.095109 | 0 | 0 | 0 | 0 | 0 | 0.19889 | 1,081 | 33 | 98 | 32.757576 | 0.849885 | 0.326549 | 0 | 0 | 0 | 0 | 0.001466 | 0 | 0 | 0 | 0 | 0.030303 | 0 | 1 | 0.210526 | false | 0 | 0.157895 | 0 | 0.578947 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
015b2d7973bc201e3630e1cf442c138be15d92a4 | 2,341 | py | Python | python/origen/origen/pins.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | python/origen/origen/pins.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | 127 | 2019-11-23T17:09:35.000Z | 2021-09-02T11:06:20.000Z | python/origen/origen/pins.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | import origen, _origen
from origen.errors import *
PinActions = _origen.dut.pins.PinActions
class Proxy:
def __init__(self, controller):
self.controller = controller
@property
def pins(self):
return origen.dut.db.pins(self.controller.model_id)
@property
def physical_pins(self):
return origen.dut.db.physical_pins(self.controller.model_id)
def add_pin(self, name, **kwargs):
return origen.dut.db.add_pin(self.controller.model_id, name, **kwargs)
def pin(self, name):
return origen.dut.db.pin(self.controller.model_id, name)
def add_pin_alias(self, name, *aliases):
return origen.dut.db.add_pin_alias(self.controller.model_id, name,
*aliases)
def group_pins(self, name, *pin_names, **options):
return origen.dut.db.group_pins(self.controller.model_id, name,
*pin_names, **options)
def physical_pin(self, name):
return origen.dut.db.physical_pin(self.controller.model_id, name)
@property
def pin_headers(self):
return origen.dut.db.pin_headers(self.controller.model_id)
def add_pin_header(self, name, *pins):
return origen.dut.db.add_pin_header(self.controller.model_id, name,
*pins)
def pin_header(self, name):
return origen.dut.db.get_pin_header(self.controller.model_id, name)
@classmethod
def api(cls):
return [
'pins', 'add_pin', 'pin', 'add_pin_alias', 'group_pins',
'physical_pin', 'physical_pins', 'pin_headers', 'add_pin_header',
'pin_header'
]
class Loader:
def __init__(self, controller):
self.controller = controller
def Pin(self, name, **kwargs):
self.controller.add_pin(name, **kwargs)
def Alias(self, name, *aliases):
self.controller.add_pin_alias(name, *aliases)
def Group(self, name, *pins, **options):
self.controller.group_pins(name, *pins, **options)
def PinHeader(self, name, *pins):
self.controller.add_pin_header(name, *pins)
def api(self):
return {
"Pin": self.Pin,
"Alias": self.Alias,
"PinHeader": self.PinHeader,
"Group": self.Group,
}
| 29.632911 | 78 | 0.612986 | 289 | 2,341 | 4.761246 | 0.124567 | 0.18314 | 0.109012 | 0.123547 | 0.449855 | 0.360465 | 0.199128 | 0 | 0 | 0 | 0 | 0 | 0.268261 | 2,341 | 78 | 79 | 30.012821 | 0.803269 | 0 | 0 | 0.122807 | 0 | 0 | 0.050833 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.315789 | false | 0 | 0.035088 | 0.210526 | 0.596491 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
01664871ecb9d7e6ffa6082a2c8b5370af30535c | 158 | py | Python | Day01/P01.py | alexfeng/PythonPractis | 6ca0ca127fcaf834b61091f667d4dedbc81bbf10 | [
"MIT"
] | null | null | null | Day01/P01.py | alexfeng/PythonPractis | 6ca0ca127fcaf834b61091f667d4dedbc81bbf10 | [
"MIT"
] | null | null | null | Day01/P01.py | alexfeng/PythonPractis | 6ca0ca127fcaf834b61091f667d4dedbc81bbf10 | [
"MIT"
] | null | null | null | # coding=utf-8
import urllib2
#使用urllib2组件来抓取网页,以urlopen函数的形式提供了一个非常简单的接口。
response = urllib2.urlopen('http://baidu.com')
html = response.read()
print html | 19.75 | 46 | 0.778481 | 18 | 158 | 6.833333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027972 | 0.094937 | 158 | 8 | 47 | 19.75 | 0.832168 | 0.348101 | 0 | 0 | 0 | 0 | 0.158416 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.25 | null | null | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
018967e9752c615ab66b2626319d7ae796322caa | 271 | py | Python | Ex007.py | devwill77/Python | 585d6197ab561c9c8813fa87682b3ff4f141319e | [
"MIT"
] | null | null | null | Ex007.py | devwill77/Python | 585d6197ab561c9c8813fa87682b3ff4f141319e | [
"MIT"
] | null | null | null | Ex007.py | devwill77/Python | 585d6197ab561c9c8813fa87682b3ff4f141319e | [
"MIT"
] | null | null | null | '''
- DESAFIO 007
- Desenvolva um programa que leia as duas notas de um aluno, calcule e mostre a sua média.
'''
n1 = float(input('Informe a primeira nota: '))
n2 = float(input('Informe a segunda nota: '))
media = (n1 + n2)/2
print('A média é igual a {}'.format(media))
| 27.1 | 90 | 0.671587 | 45 | 271 | 4.044444 | 0.711111 | 0.10989 | 0.186813 | 0.197802 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.036036 | 0.180812 | 271 | 9 | 91 | 30.111111 | 0.783784 | 0.383764 | 0 | 0 | 0 | 0 | 0.436709 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
6da19fdbc2e422185e5a21e6b36c8c89d7edc318 | 392 | py | Python | src/server/textprocess/verb.py | Vnicius/fact-check | 3dc428e5e31a7c887291006e25058c01e6f23f06 | [
"MIT"
] | null | null | null | src/server/textprocess/verb.py | Vnicius/fact-check | 3dc428e5e31a7c887291006e25058c01e6f23f06 | [
"MIT"
] | null | null | null | src/server/textprocess/verb.py | Vnicius/fact-check | 3dc428e5e31a7c887291006e25058c01e6f23f06 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding:utf8 -*-
from textprocess.word import Word
class Verb(Word):
'''
Class with the information of the verb
'''
def __init__(self, word, word_class):
super(Verb, self).__init__(word, word_class)
self.infinitive = ""
def __str__(self):
return super(Verb, self).__str__() + "Infinitivo: " + self.infinitive + "\n"
| 24.5 | 84 | 0.612245 | 47 | 392 | 4.723404 | 0.510638 | 0.162162 | 0.117117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006711 | 0.239796 | 392 | 16 | 85 | 24.5 | 0.738255 | 0.193878 | 0 | 0 | 0 | 0 | 0.046667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.142857 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
6de3e44716d82218afcd8158233c278f3050aeb8 | 778 | py | Python | src/envs/discrete_env_wrapper.py | lewis-neal/rl-ee | e6388982997013df218a9b4667e3eef5f288ca1d | [
"MIT"
] | null | null | null | src/envs/discrete_env_wrapper.py | lewis-neal/rl-ee | e6388982997013df218a9b4667e3eef5f288ca1d | [
"MIT"
] | null | null | null | src/envs/discrete_env_wrapper.py | lewis-neal/rl-ee | e6388982997013df218a9b4667e3eef5f288ca1d | [
"MIT"
] | null | null | null | class DiscreteEnvWrapper:
def __init__(self, env):
self.__env = env
def reset(self):
return self.__env.reset()
def step(self, action):
next_state, reward, done, info = self.__env.step(action)
return next_state, reward, done, info
def render(self):
self.__env.render()
def close(self):
self.__env.close()
def get_random_action(self):
return self.__env.action_space.sample()
def get_total_actions(self):
return self.__env.action_space.n
def get_total_states(self):
return self.__env.observation_space.n
def seed(self, seed=None, set_action_seed=True):
if set_action_seed:
self.__env.action_space.seed(seed)
return self.__env.seed(seed)
| 25.096774 | 64 | 0.643959 | 104 | 778 | 4.432692 | 0.298077 | 0.167028 | 0.140998 | 0.147505 | 0.221258 | 0.121475 | 0 | 0 | 0 | 0 | 0 | 0 | 0.253213 | 778 | 30 | 65 | 25.933333 | 0.79346 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.409091 | false | 0 | 0 | 0.181818 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
6dff25f813ed4c861b3a093b961f52b6acba2fb5 | 11,026 | py | Python | tests/network/nano_node/data/http/state_pocketable_pending.py | Matoking/siliqua | b943822631ab18dde85e95d1731ebd7ffd7ef14a | [
"CC0-1.0"
] | 8 | 2019-10-31T19:16:08.000Z | 2021-12-04T00:09:24.000Z | tests/network/nano_node/data/http/state_pocketable_pending.py | Matoking/siliqua | b943822631ab18dde85e95d1731ebd7ffd7ef14a | [
"CC0-1.0"
] | null | null | null | tests/network/nano_node/data/http/state_pocketable_pending.py | Matoking/siliqua | b943822631ab18dde85e95d1731ebd7ffd7ef14a | [
"CC0-1.0"
] | 1 | 2019-11-01T19:27:48.000Z | 2019-11-01T19:27:48.000Z | from tests.network.nano_node.conftest import HTTPReplay
DATA = [
HTTPReplay(
{
"action": "account_history",
"account": "xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy",
"raw": True,
"reverse": True,
"count": 500
},
{
"account": "xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy",
"history": [
{
"account": "xrb_3jwrszth46rk1mu7rmb4rhm54us8yg1gw3ipodftqtikf5yqdyr7471nsg1k",
"amount": "1000000000000000000000000000000",
"hash": "A972FF5D6C00BFD18EDD70C74469204E640C81F0D30B62E0069A24209F1D82F9",
"local_timestamp": "1551151678",
"opened": "xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy",
"representative": "xrb_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs",
"signature": "0286E1CEEE126CF7A79AFE54FFF8DD214CA6F01C50022F23BC9D39EC16562E5713047F5D76B85BABF90C8FEE561297F6EE02E0EFC60913EB22037988536E0D0D",
"source": "4737430974086B6356ED4C888FC5CC44A728C0DC60019CFCA776DA4E7C1849C8",
"type": "open",
"work": "6a17e12c42ece9cf"
},
{
"account": "xrb_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3",
"balance": "1000000000000000000000000000000",
"hash": "D9917582FB96AF84C02250F62A5340DD1318C76B33EC3C421D15F6EFED1DFD55",
"link": "65706F636820763120626C6F636B000000000000000000000000000000000000",
"local_timestamp": "1551151678",
"previous": "A972FF5D6C00BFD18EDD70C74469204E640C81F0D30B62E0069A24209F1D82F9",
"representative": "xrb_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs",
"signature": "4C5D3D70621148324494E6BED751F168441919DBF722617EE913CB1418486E51052D711DCD9129C4D84144120F5903A3A840C61C4C5A4E31B57DFD5489E57E07",
"subtype": "epoch",
"type": "state",
"work": "0dad271fd745907c"
}
]
}
),
HTTPReplay(
{
"action": "account_history",
"account": "xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy",
"raw": True,
"reverse": True,
"head": "D9917582FB96AF84C02250F62A5340DD1318C76B33EC3C421D15F6EFED1DFD55",
"count": 500,
},
{
"account": "xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy",
"history": [
{
"account": "xrb_3t6k35gi95xu6tergt6p69ck76ogmitsa8mnijtpxm9fkcm736xtoncuohr3",
"balance": "1000000000000000000000000000000",
"hash": "D9917582FB96AF84C02250F62A5340DD1318C76B33EC3C421D15F6EFED1DFD55",
"link": "65706F636820763120626C6F636B000000000000000000000000000000000000",
"local_timestamp": "1551151678",
"previous": "A972FF5D6C00BFD18EDD70C74469204E640C81F0D30B62E0069A24209F1D82F9",
"representative": "xrb_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs",
"signature": "4C5D3D70621148324494E6BED751F168441919DBF722617EE913CB1418486E51052D711DCD9129C4D84144120F5903A3A840C61C4C5A4E31B57DFD5489E57E07",
"subtype": "epoch",
"type": "state",
"work": "0dad271fd745907c"
}
]
}
),
HTTPReplay(
{
"action": "blocks_info",
"hashes": [
"A972FF5D6C00BFD18EDD70C74469204E640C81F0D30B62E0069A24209F1D82F9",
"4737430974086B6356ED4C888FC5CC44A728C0DC60019CFCA776DA4E7C1849C8",
"D9917582FB96AF84C02250F62A5340DD1318C76B33EC3C421D15F6EFED1DFD55"
]
},
{
"blocks": {
"4737430974086B6356ED4C888FC5CC44A728C0DC60019CFCA776DA4E7C1849C8": {
"amount": "1000000000000000000000000000000",
"balance": "1188502559713844364307617738000000000",
"block_account": "xrb_3jwrszth46rk1mu7rmb4rhm54us8yg1gw3ipodftqtikf5yqdyr7471nsg1k",
"contents": "{\n \"type\": \"send\",\n \"previous\": \"59F09FED5508B3D8D631819AE67C3BA6CD766C1E0E462AAD8E1626412205CDC1\",\n \"destination\": \"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy\",\n \"balance\": \"00E4E5B34824F06B0A875B156AC96400\",\n \"work\": \"ff78d1f2cf012776\",\n \"signature\": \"988CDA336956C371E9A8C89A4A19D6FDEF0ABBFCAA05820FF61631A168D43E0BD755478586368CFE2924D15E82EC2FBFACCCCF9E337B76C2E92FA33A21CE710B\"\n}\n",
"height": "4497",
"confirmed": "true",
"local_timestamp": "1551151678"
},
"A972FF5D6C00BFD18EDD70C74469204E640C81F0D30B62E0069A24209F1D82F9": {
"amount": "1000000000000000000000000000000",
"balance": "1000000000000000000000000000000",
"block_account": "xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy",
"contents": "{\n \"type\": \"open\",\n \"source\": \"4737430974086B6356ED4C888FC5CC44A728C0DC60019CFCA776DA4E7C1849C8\",\n \"representative\": \"xrb_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs\",\n \"account\": \"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy\",\n \"work\": \"6a17e12c42ece9cf\",\n \"signature\": \"0286E1CEEE126CF7A79AFE54FFF8DD214CA6F01C50022F23BC9D39EC16562E5713047F5D76B85BABF90C8FEE561297F6EE02E0EFC60913EB22037988536E0D0D\"\n}\n",
"height": "1",
"confirmed": "true",
"local_timestamp": "1551151678"
},
"D9917582FB96AF84C02250F62A5340DD1318C76B33EC3C421D15F6EFED1DFD55": {
"amount": "0",
"balance": "1000000000000000000000000000000",
"block_account": "xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy",
"contents": "{\n \"type\": \"state\",\n \"account\": \"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy\",\n \"previous\": \"A972FF5D6C00BFD18EDD70C74469204E640C81F0D30B62E0069A24209F1D82F9\",\n \"representative\": \"xrb_1anrzcuwe64rwxzcco8dkhpyxpi8kd7zsjc1oeimpc3ppca4mrjtwnqposrs\",\n \"balance\": \"1000000000000000000000000000000\",\n \"link\": \"65706F636820763120626C6F636B000000000000000000000000000000000000\",\n \"link_as_account\": \"xrb_1sdifxjpia5p86i86u5hefoi1111111111111111111111111111g7jhnpfy\",\n \"signature\": \"4C5D3D70621148324494E6BED751F168441919DBF722617EE913CB1418486E51052D711DCD9129C4D84144120F5903A3A840C61C4C5A4E31B57DFD5489E57E07\",\n \"work\": \"0dad271fd745907c\"\n}\n",
"height": "2",
"confirmed": "true",
"local_timestamp": "1551151678"
}
}
}
),
HTTPReplay(
{
"action": "blocks_info",
"hashes": [
"C4BDB10778120F6748959EF7312C443BD0BFF4FE97F02A20B874694EB03DE0D0",
"D96D72919D6EEAA9B82FE8046EBE70E20886E4D6C3BA218AD5340DD63AEE09C6"
]
},
{
"blocks": {
"C4BDB10778120F6748959EF7312C443BD0BFF4FE97F02A20B874694EB03DE0D0": {
"amount": "1000000000000000000000000000000",
"balance": "0",
"block_account": "xrb_3qbettndeemurhst593izae7j6x746bdzktmr16qfh9oa9uizxnuxkxgaiqd",
"contents": "{\n \"type\": \"state\",\n \"account\": \"xrb_3qbettndeemurhst593izae7j6x746bdzktmr16qfh9oa9uizxnuxkxgaiqd\",\n \"previous\": \"2B64510C860CA6A5CA962CAD70DA1D14EB325B40CD11858D85F64DC595C825D6\",\n \"representative\": \"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy\",\n \"balance\": \"0\",\n \"link\": \"70A5422D4846931CEA02603DD5AFB2D0433E0806DECA5E832EB67F33B5777D35\",\n \"link_as_account\": \"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy\",\n \"signature\": \"1CEACEC7E1CD95BC5977149FA8A6D858626A620E87AB2F003A1352B6CB4EB1AD0F4F200D47563AA6A8C29D6FD017AEBC6A7936DD075001CDFE36697E279E0F06\",\n \"work\": \"26c1462244a50eca\"\n}\n",
"height": "4",
"confirmed": "true",
"local_timestamp": "1556238404"
},
"D96D72919D6EEAA9B82FE8046EBE70E20886E4D6C3BA218AD5340DD63AEE09C6": {
"amount": "1000000000000000000000000000",
"balance": "0",
"block_account": "xrb_36gijoeijuazu7d9urtxm1jqgejw43bi3tcfjx4i98q9mxuqhrsjs5dk1d9i",
"contents": "{\n \"type\": \"state\",\n \"account\": \"xrb_36gijoeijuazu7d9urtxm1jqgejw43bi3tcfjx4i98q9mxuqhrsjs5dk1d9i\",\n \"previous\": \"0E603599652E42541297DEF21A7B4A7ADFB005D79F7310A3D52FBC040E158AE2\",\n \"representative\": \"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy\",\n \"balance\": \"0\",\n \"link\": \"70A5422D4846931CEA02603DD5AFB2D0433E0806DECA5E832EB67F33B5777D35\",\n \"link_as_account\": \"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy\",\n \"signature\": \"0D0AB50DC183D5816D3F0F7ABD0F8E4754E3D0B7FF872B9BFC959B2C64310138C9929EA66C6D8AB8F5E42D8C5816D7145F981CB0E8713AA3949786A7A5CEFB0F\",\n \"work\": \"f12c73ebb90da6d4\"\n}\n",
"height": "2",
"confirmed": "true",
"local_timestamp": "1551151665"
}
}
}
),
HTTPReplay(
{
"action": "accounts_pending",
"accounts": ["xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy"],
"threshold": "100000000000000000000000000",
"source": True
},
{
"blocks": {
"xrb_1w77aapnijnm5mo16r3xtpqu7n459r61fqpcdt3kxfmz8gtqgzbozswxmduy": {
"C4BDB10778120F6748959EF7312C443BD0BFF4FE97F02A20B874694EB03DE0D0": {
"amount": "1000000000000000000000000000000",
"source": "xrb_3qbettndeemurhst593izae7j6x746bdzktmr16qfh9oa9uizxnuxkxgaiqd"
},
"D96D72919D6EEAA9B82FE8046EBE70E20886E4D6C3BA218AD5340DD63AEE09C6": {
"amount": "1000000000000000000000000000",
"source": "xrb_36gijoeijuazu7d9urtxm1jqgejw43bi3tcfjx4i98q9mxuqhrsjs5dk1d9i"
}
}
}
}
)
]
| 66.023952 | 765 | 0.632233 | 392 | 11,026 | 17.637755 | 0.229592 | 0.02748 | 0.101244 | 0.019526 | 0.432601 | 0.362453 | 0.362453 | 0.35175 | 0.315302 | 0.278855 | 0 | 0.37226 | 0.26764 | 11,026 | 166 | 766 | 66.421687 | 0.483963 | 0 | 0 | 0.481707 | 0 | 0 | 0.440414 | 0.308997 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.006098 | 0 | 0.006098 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a305e543aaea0b900fca95ec28846580c800d14b | 162 | py | Python | test.py | ThomasShih/geograpy3 | 98d056bcc54e10979c894d1f134311ecabf53e47 | [
"MIT"
] | 2 | 2020-05-02T07:02:30.000Z | 2020-05-19T21:46:06.000Z | test.py | ThomasShih/geograpy3 | 98d056bcc54e10979c894d1f134311ecabf53e47 | [
"MIT"
] | null | null | null | test.py | ThomasShih/geograpy3 | 98d056bcc54e10979c894d1f134311ecabf53e47 | [
"MIT"
] | null | null | null | s = """I know that St George Square in London, United Kingdom is a very beautify place"""
import geograpy4
print(geograpy4.get_place_context(s,addressOnly=True)) | 40.5 | 89 | 0.783951 | 26 | 162 | 4.807692 | 0.884615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014085 | 0.123457 | 162 | 4 | 90 | 40.5 | 0.866197 | 0 | 0 | 0 | 0 | 0 | 0.484663 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
09885b89164ee20576a8166aa74a38292b3d9aee | 713 | py | Python | pages/BaseApp.py | novdima1/TAU-intro-selenium-1 | 772fb9e80999391ebbca4f9f0bc44834429b1a0c | [
"MIT"
] | null | null | null | pages/BaseApp.py | novdima1/TAU-intro-selenium-1 | 772fb9e80999391ebbca4f9f0bc44834429b1a0c | [
"MIT"
] | null | null | null | pages/BaseApp.py | novdima1/TAU-intro-selenium-1 | 772fb9e80999391ebbca4f9f0bc44834429b1a0c | [
"MIT"
] | null | null | null | import pytest
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# @pytest.mark.usefixtures("driver_init")
class BasePage:
def __init__(self, driv):
self.driver = driv
def find_element(self, locator, time=10):
return WebDriverWait(self.driver, time).\
until(EC.presence_of_element_located(locator),
message=f"Can't find element by locator {locator}")
def find_elements(self, locator, time=10):
return WebDriverWait(self.driver, time).\
until(EC.presence_of_all_elements_located(locator),
message=f"Can't find elements by locator {locator}") | 35.65 | 70 | 0.69425 | 89 | 713 | 5.393258 | 0.426966 | 0.0625 | 0.0875 | 0.116667 | 0.404167 | 0.404167 | 0.404167 | 0.279167 | 0.279167 | 0.279167 | 0 | 0.007105 | 0.210379 | 713 | 20 | 70 | 35.65 | 0.845471 | 0.054698 | 0 | 0.142857 | 0 | 0 | 0.117385 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.214286 | 0.142857 | 0.642857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
099b6033ce3455a1c3c58b82eb9644a43e72426e | 992 | py | Python | pyleaves/train/metrics.py | JacobARose/pyleaves | 27b4016c850148981f3d021028c9272f18df121d | [
"MIT"
] | 3 | 2019-11-25T14:50:54.000Z | 2020-05-27T06:54:46.000Z | pyleaves/train/metrics.py | JacobARose/pyleaves | 27b4016c850148981f3d021028c9272f18df121d | [
"MIT"
] | 6 | 2019-11-21T06:24:37.000Z | 2019-12-19T14:49:14.000Z | pyleaves/train/metrics.py | JacobARose/pyleaves | 27b4016c850148981f3d021028c9272f18df121d | [
"MIT"
] | null | null | null | # @Author: Jacob A Rose
# @Date: Tue, March 31st 2020, 12:36 am
# @Email: jacobrose@brown.edu
# @Filename: metrics.py
'''
Metrics for use in training keras models
'''
from tensorflow.keras import metrics
METRICS = []
# metrics.CategoricalAccuracy(name='accuracy'),
# metrics.Precision(name='precision'),
# metrics.Recall(name='recall'),
# metrics.TopKCategoricalAccuracy(name='top_3_categorical_accuracy', k=3),
# metrics.TopKCategoricalAccuracy(name='top_5_categorical_accuracy', k=5)]
# METRICS = [
# metrics.TruePositives(name='tp'),
# metrics.FalsePositives(name='fp'),
# metrics.TrueNegatives(name='tn'),
# metrics.FalseNegatives(name='fn'),
# metrics.CategoricalAccuracy(name='accuracy'),
# metrics.Precision(name='precision'),
# metrics.Recall(name='recall'),
# metrics.TopKCategoricalAccuracy(name='top_k_categorical_accuracy', k=5),
# metrics.AUC(name='auc')
# ]
| 30.060606 | 84 | 0.655242 | 104 | 992 | 6.163462 | 0.461538 | 0.065523 | 0.159126 | 0.173167 | 0.483619 | 0.396256 | 0.396256 | 0.396256 | 0.396256 | 0.396256 | 0 | 0.01875 | 0.193548 | 992 | 32 | 85 | 31 | 0.7825 | 0.873992 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
09a23fb70a46bc40261c58574b90545389555ecb | 280 | py | Python | src/asset/management/commands/sync.py | bluesnailstw/flamingos | e13bf4ac4caa5fa50e45d7285877c64218c49723 | [
"Apache-2.0"
] | null | null | null | src/asset/management/commands/sync.py | bluesnailstw/flamingos | e13bf4ac4caa5fa50e45d7285877c64218c49723 | [
"Apache-2.0"
] | null | null | null | src/asset/management/commands/sync.py | bluesnailstw/flamingos | e13bf4ac4caa5fa50e45d7285877c64218c49723 | [
"Apache-2.0"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from asset.tasks import sync_all_host_info
class Command(BaseCommand):
def handle(self, *args, **options):
async_task = sync_all_host_info.delay()
print('celery async id: %s' % async_task.id)
| 31.111111 | 65 | 0.735714 | 39 | 280 | 5.076923 | 0.717949 | 0.070707 | 0.111111 | 0.151515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164286 | 280 | 8 | 66 | 35 | 0.846154 | 0 | 0 | 0 | 0 | 0 | 0.067857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0.166667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
09b2fa04d5e50a4aa11b36990369782145fbc832 | 514 | py | Python | JAIN.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | JAIN.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | JAIN.py | akashsuper2000/codechef-archive | e0e4a7daf66812ab7aa3fe42132c3d067a72457b | [
"bzip2-1.0.6"
] | null | null | null | for i in range(int(input())):
n = int(input())
a = [0 for j in range(32)]
for j in range(n):
s = input()
p = 0
if('a' in s):
p|=1
if('e' in s):
p|=2
if('i' in s):
p|=4
if('o' in s):
p|=8
if('u' in s):
p|=16
a[p]+=1
c = 0
for j in range(32):
for k in range(j+1,32):
if(j|k==31):
c+=a[j]*a[k]
c+=int(a[31]*(a[31]-1)/2)
print(c)
| 20.56 | 31 | 0.322957 | 91 | 514 | 1.824176 | 0.285714 | 0.210843 | 0.120482 | 0.198795 | 0.204819 | 0.204819 | 0.204819 | 0 | 0 | 0 | 0 | 0.093985 | 0.48249 | 514 | 24 | 32 | 21.416667 | 0.530075 | 0 | 0 | 0 | 0 | 0 | 0.009728 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.041667 | 0 | 0 | 1 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
09cc71fd9ef3bb686834e4d8cca0ef3c519c225d | 386 | py | Python | kamyroll_gui/data_types/stream_type.py | KorigamiK/kamyroll-gui | 7c151c2d02a53a11d9f0a17e9bdfa400f707a201 | [
"MIT"
] | 13 | 2022-01-31T20:55:47.000Z | 2022-03-31T11:00:24.000Z | kamyroll_gui/data_types/stream_type.py | KorigamiK/kamyroll-gui | 7c151c2d02a53a11d9f0a17e9bdfa400f707a201 | [
"MIT"
] | 2 | 2022-01-31T23:44:38.000Z | 2022-02-03T07:24:12.000Z | kamyroll_gui/data_types/stream_type.py | KorigamiK/kamyroll-gui | 7c151c2d02a53a11d9f0a17e9bdfa400f707a201 | [
"MIT"
] | 2 | 2022-02-01T07:07:01.000Z | 2022-02-15T05:22:05.000Z | from enum import Enum
class StreamType(Enum):
ADAPTIVE_HLS = "adaptive_hls"
MOBILE_MP4 = "mobile_mp4"
def __str__(self, /):
return _CLEAR_NAME_LOOKUP[self]
def __repr__(self, /):
return f'<{self.__class__.__name__}.{self.name}>'
_CLEAR_NAME_LOOKUP = {
StreamType.ADAPTIVE_HLS: "Adaptive, HLS",
StreamType.MOBILE_MP4: "Mobile, mp4, HLS",
}
| 19.3 | 57 | 0.665803 | 47 | 386 | 4.87234 | 0.382979 | 0.19214 | 0.165939 | 0.19214 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013072 | 0.207254 | 386 | 19 | 58 | 20.315789 | 0.735294 | 0 | 0 | 0 | 0 | 0 | 0.233161 | 0.101036 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.083333 | 0.166667 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
09e06c2d9921326e0a7a9c593fbd2fbb4229b692 | 495 | py | Python | tests/design_patterns/metaclass2.py | tvatter/dsa | e5ae217e38441d90914a55103e23d86f5821dc2f | [
"MIT"
] | null | null | null | tests/design_patterns/metaclass2.py | tvatter/dsa | e5ae217e38441d90914a55103e23d86f5821dc2f | [
"MIT"
] | null | null | null | tests/design_patterns/metaclass2.py | tvatter/dsa | e5ae217e38441d90914a55103e23d86f5821dc2f | [
"MIT"
] | null | null | null | ## https://blog.ionelmc.ro/2015/02/09/understanding-python-metaclasses/
## Restrictions with multiple metaclasses
# class Meta1(type):
# pass
# class Meta2(type):
# pass
# class Base1(metaclass=Meta1):
# pass
# class Base2(metaclass=Meta2):
# pass
# class Foobar(Base1, Base2):
# pass
# class Meta(type):
# pass
# class SubMeta(Meta):
# pass
class Base1(metaclass=Meta):
pass
class Base2(metaclass=SubMeta):
pass
class Foobar(Base1, Base2):
pass
type(Foobar)
| 12.375 | 71 | 0.680808 | 62 | 495 | 5.435484 | 0.387097 | 0.240356 | 0.115727 | 0.136499 | 0.172107 | 0.172107 | 0 | 0 | 0 | 0 | 0 | 0.049383 | 0.181818 | 495 | 39 | 72 | 12.692308 | 0.782716 | 0.648485 | 0 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.428571 | 0 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
61ce41390c14757b1625a0999f0d01a061e8c388 | 269 | py | Python | rfidstation/views.py | Samurai-XHe/rfidstation | 0115290376a5b75a1c7da922df31942c351887e8 | [
"MIT"
] | null | null | null | rfidstation/views.py | Samurai-XHe/rfidstation | 0115290376a5b75a1c7da922df31942c351887e8 | [
"MIT"
] | null | null | null | rfidstation/views.py | Samurai-XHe/rfidstation | 0115290376a5b75a1c7da922df31942c351887e8 | [
"MIT"
] | null | null | null | from django.shortcuts import render,redirect
from django.contrib import auth
from django.urls import reverse
def index(request):
if request.user.is_authenticated:
return render(request, 'index.html')
else:
return redirect(reverse('user:login')) | 29.888889 | 46 | 0.739777 | 35 | 269 | 5.657143 | 0.6 | 0.151515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171004 | 269 | 9 | 46 | 29.888889 | 0.887892 | 0 | 0 | 0 | 0 | 0 | 0.074074 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
61e3f0efbd508dff763f4d92207c2289608b637d | 38 | py | Python | iabot/constants.py | satheesh1997/iaBot | 0af35c5f32fc8b2b01911db468148799d41b7d5e | [
"MIT"
] | 2 | 2020-04-17T03:59:09.000Z | 2020-04-19T14:02:02.000Z | iabot/constants.py | satheesh1997/iaBot | 0af35c5f32fc8b2b01911db468148799d41b7d5e | [
"MIT"
] | 4 | 2020-04-16T13:37:58.000Z | 2020-04-17T16:52:30.000Z | iabot/constants.py | satheesh1997/iaBot | 0af35c5f32fc8b2b01911db468148799d41b7d5e | [
"MIT"
] | 1 | 2020-04-20T06:55:23.000Z | 2020-04-20T06:55:23.000Z | ACTION_OK = "OK"
ACTION_ERROR = "NOK"
| 12.666667 | 20 | 0.684211 | 6 | 38 | 4 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157895 | 38 | 2 | 21 | 19 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.131579 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
61e5e28dd6f40a51c287e4b6469b6ad6eb769555 | 484 | py | Python | python/ql/src/Functions/OverlyComplexDelMethod.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 4,036 | 2020-04-29T00:09:57.000Z | 2022-03-31T14:16:38.000Z | python/ql/src/Functions/OverlyComplexDelMethod.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 2,970 | 2020-04-28T17:24:18.000Z | 2022-03-31T22:40:46.000Z | python/ql/src/Functions/OverlyComplexDelMethod.py | ScriptBox99/github-codeql | 2ecf0d3264db8fb4904b2056964da469372a235c | [
"MIT"
] | 794 | 2020-04-29T00:28:25.000Z | 2022-03-30T08:21:46.000Z |
#Relies on __del__ being called by the garbage collector.
class CachedPreferencesFile
...
def __del__(self):
for key, value in self.preferences.items():
self.write_pair(key, value)
self.backing.close()
#Better version
class CachedPreferencesFile
...
def close(self):
for key, value in self.preferences.items():
self.write_pair(key, value)
self.backing.close()
def __del__(self):
self.close()
| 19.36 | 57 | 0.626033 | 56 | 484 | 5.160714 | 0.446429 | 0.110727 | 0.200692 | 0.103806 | 0.512111 | 0.512111 | 0.512111 | 0.512111 | 0.512111 | 0.512111 | 0 | 0 | 0.272727 | 484 | 24 | 58 | 20.166667 | 0.821023 | 0.144628 | 0 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 1 | 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 | 0 | 0 | 3 |
113efb70eb410d423f9fdd33a04e0301f58658d2 | 817 | py | Python | solutions/005.py | XeLiatH/daily-coding-problem | 9d454c426d4676de88c313b2de755c5f6adb88c8 | [
"MIT"
] | null | null | null | solutions/005.py | XeLiatH/daily-coding-problem | 9d454c426d4676de88c313b2de755c5f6adb88c8 | [
"MIT"
] | null | null | null | solutions/005.py | XeLiatH/daily-coding-problem | 9d454c426d4676de88c313b2de755c5f6adb88c8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
> 005 @ Jane Street
~~~~~~~~~~~~~~~~~~~
```cons(a, b)``` constructs a pair, and ```car(pair)``` and ```cdr(pair)``` returns
the first and last element of that pair. For example, ```car(cons(3, 4))``` returns
```3```, and ```cdr(cons(3, 4))``` returns ```4```.
Given this implementation of cons:
```Python
def cons(a, b):
def pair(f):
return f(a, b)
return pair
```
Implement ```car``` and ```cdr```.
"""
def cons(a, b):
def pair(f):
return f(a, b)
return pair
def car(f):
def left(a, b):
return a
return f(left)
def cdr(f):
def right(a, b):
return b
return f(right)
if __name__ == "__main__":
assert car(cons(3, 4)) == 3
assert cdr(cons(3, 4)) == 4
| 17.020833 | 87 | 0.483476 | 117 | 817 | 3.307692 | 0.333333 | 0.036176 | 0.062016 | 0.046512 | 0.186047 | 0.186047 | 0.186047 | 0.186047 | 0.186047 | 0.186047 | 0 | 0.027972 | 0.299878 | 817 | 47 | 88 | 17.382979 | 0.648601 | 0.53978 | 0 | 0 | 0 | 0 | 0.025397 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 1 | 0.4 | false | 0 | 0 | 0.2 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
114701e40dea9e118405fc578cc7ea6b85fdff72 | 2,064 | py | Python | tests/test_utils.py | rzzzwilson/morse_trainer | 59578f5e3cf5d139834dad09def0f0e886cbca49 | [
"MIT"
] | null | null | null | tests/test_utils.py | rzzzwilson/morse_trainer | 59578f5e3cf5d139834dad09def0f0e886cbca49 | [
"MIT"
] | 40 | 2017-01-16T10:20:34.000Z | 2017-03-23T09:43:35.000Z | tests/test_utils.py | rzzzwilson/morse_trainer | 59578f5e3cf5d139834dad09def0f0e886cbca49 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Test the 'utils.py' code.
"""
import sys
import os
import getopt
sys.path.append('..')
import utils
import unittest
class TestUtils(unittest.TestCase):
def test_make_multiple(self):
"""A simple test for the make_multiple() function."""
# easy smoke test
given = 4.3
multiple = 5
expected = 5
actual = utils.make_multiple(given, multiple)
msg = ('Given %s, using multiple %s, expected %s, got %s'
% (str(given), str(multiple), str(expected), str(actual)))
self.assertEqual(actual, expected, msg)
# just below and very close to a multiple
given = 9.99
multiple = 5
expected = 10
actual = utils.make_multiple(given, multiple)
msg = ('Given %s, using multiple %s, expected %s, got %s'
% (str(given), str(multiple), str(expected), str(actual)))
self.assertEqual(actual, expected, msg)
# just above and very close to a multiple
given = 15.001
multiple = 5
expected = 15
actual = utils.make_multiple(given, multiple)
msg = ('Given %s, using multiple %s, expected %s, got %s'
% (str(given), str(multiple), str(expected), str(actual)))
self.assertEqual(actual, expected, msg)
# just above midway between two multiples
given = 12.5001
multiple = 5
expected = 15
actual = utils.make_multiple(given, multiple)
msg = ('Given %s, using multiple %s, expected %s, got %s'
% (str(given), str(multiple), str(expected), str(actual)))
self.assertEqual(actual, expected, msg)
# just below midway between two multiples
given = 12.499
multiple = 5
expected = 10
actual = utils.make_multiple(given, multiple)
msg = ('Given %s, using multiple %s, expected %s, got %s'
% (str(given), str(multiple), str(expected), str(actual)))
self.assertEqual(actual, expected, msg)
unittest.main()
| 30.80597 | 73 | 0.586725 | 252 | 2,064 | 4.77381 | 0.242063 | 0.069825 | 0.070657 | 0.095594 | 0.787199 | 0.787199 | 0.733998 | 0.687448 | 0.687448 | 0.687448 | 0 | 0.024691 | 0.293605 | 2,064 | 66 | 74 | 31.272727 | 0.800412 | 0.131298 | 0 | 0.659091 | 0 | 0 | 0.136338 | 0 | 0 | 0 | 0 | 0 | 0.113636 | 1 | 0.022727 | false | 0 | 0.113636 | 0 | 0.159091 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1149c2712503b17b3190ccb0006a1ec143e7e88b | 78 | py | Python | src/resellerclub/api/urls/__init__.py | Ahuahuachi/resellerclub-api-client | 44b78b7567c41fbaa2e15e8e93f956e6c1ffbbf2 | [
"MIT"
] | null | null | null | src/resellerclub/api/urls/__init__.py | Ahuahuachi/resellerclub-api-client | 44b78b7567c41fbaa2e15e8e93f956e6c1ffbbf2 | [
"MIT"
] | null | null | null | src/resellerclub/api/urls/__init__.py | Ahuahuachi/resellerclub-api-client | 44b78b7567c41fbaa2e15e8e93f956e6c1ffbbf2 | [
"MIT"
] | null | null | null | """ResellerClub API URLs module"""
from .urls import URLs
__all__ = ["URLs"]
| 15.6 | 34 | 0.692308 | 10 | 78 | 5 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 78 | 4 | 35 | 19.5 | 0.757576 | 0.358974 | 0 | 0 | 0 | 0 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 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 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
1151faa8814505c2cde209c7f523227ac0f6a544 | 426 | py | Python | utils/collapse-lines-that-share-a-name.py | refinery-platform/get-reference-genomes | b39c9241d1b4747e502fa4e48f9113805ca72f8e | [
"MIT"
] | 2 | 2019-07-03T06:17:50.000Z | 2021-03-07T11:30:59.000Z | utils/collapse-lines-that-share-a-name.py | refinery-platform/get-reference-genomes | b39c9241d1b4747e502fa4e48f9113805ca72f8e | [
"MIT"
] | 7 | 2016-11-10T18:55:17.000Z | 2021-05-25T08:42:07.000Z | utils/collapse-lines-that-share-a-name.py | refinery-platform/get-reference-genomes | b39c9241d1b4747e502fa4e48f9113805ca72f8e | [
"MIT"
] | null | null | null | import fileinput
from bed import Record
# Given a BED file, collapses sequential lines which match on the "name" field.
merged_record = None
for line in fileinput.input():
record = Record(line)
if not merged_record:
merged_record = record
elif record.name == merged_record.name:
merged_record.merge(record)
else:
print merged_record
merged_record = record
print merged_record | 25.058824 | 79 | 0.70892 | 57 | 426 | 5.157895 | 0.508772 | 0.326531 | 0.122449 | 0.163265 | 0.204082 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.232394 | 426 | 17 | 80 | 25.058824 | 0.899083 | 0.180751 | 0 | 0.307692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.153846 | null | null | 0.153846 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
febefcb2b50e557cf366d739db16b43ed7bdd0d7 | 726 | py | Python | announcements/feeds.py | TechFrederick/ship | 5af0af05e3f949a529b9eaa84e7a9a24ec410985 | [
"MIT"
] | 14 | 2020-09-09T01:21:34.000Z | 2022-01-09T05:35:19.000Z | announcements/feeds.py | TechFrederick/ship | 5af0af05e3f949a529b9eaa84e7a9a24ec410985 | [
"MIT"
] | null | null | null | announcements/feeds.py | TechFrederick/ship | 5af0af05e3f949a529b9eaa84e7a9a24ec410985 | [
"MIT"
] | 1 | 2021-09-20T09:04:12.000Z | 2021-09-20T09:04:12.000Z | from django.contrib.syndication.views import Feed
from django.urls import reverse
from .models import Announcement
class AnnouncementFeed(Feed):
"""Generate an RSS feed that Mailchimp (or any feed reader) can import."""
title = "Announcement from SHIP"
description = "Announcements for homeless in Frederick County, Maryland"
@property
def link(self):
return reverse("announcements:list")
def items(self):
return Announcement.objects.all()[:5]
def item_title(self, item):
return item.title
def item_description(self, item):
return item.description
def item_link(self, item):
return reverse("announcements:list") + f"#announcement-{item.id}"
| 25.928571 | 78 | 0.695592 | 88 | 726 | 5.704545 | 0.511364 | 0.041833 | 0.083665 | 0.119522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001739 | 0.207989 | 726 | 27 | 79 | 26.888889 | 0.871304 | 0.093664 | 0 | 0 | 1 | 0 | 0.210123 | 0.035276 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.176471 | 0.294118 | 0.941176 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
fec208346fcf93e8d28b54021c4bbbba69e4a2ba | 141 | py | Python | build/lib/build/lib/build/lib/magLabUtilities/signalutilities/internal/exceptions.py | MarkTravers/magLabUtilities | e116c8cb627cd82c3b8ba651dd6979b66e568632 | [
"MIT"
] | null | null | null | build/lib/build/lib/build/lib/magLabUtilities/signalutilities/internal/exceptions.py | MarkTravers/magLabUtilities | e116c8cb627cd82c3b8ba651dd6979b66e568632 | [
"MIT"
] | null | null | null | build/lib/build/lib/build/lib/magLabUtilities/signalutilities/internal/exceptions.py | MarkTravers/magLabUtilities | e116c8cb627cd82c3b8ba651dd6979b66e568632 | [
"MIT"
] | null | null | null | #!python3
class Error(Exception):
pass
class IncompatibleArgumentError(Error):
pass
class DataShapeError(Error):
pass | 14.1 | 40 | 0.687943 | 13 | 141 | 7.461538 | 0.538462 | 0.185567 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009259 | 0.234043 | 141 | 10 | 41 | 14.1 | 0.888889 | 0.056738 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 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 | 0 | 0 | 0 | 0 | 0 | 3 |
fed0150033bd445f3d89dfdc4226b353ed855080 | 23 | py | Python | RoboGym_training/animalai_train/animalai_train/__init__.py | AIX2/RoboGym | c7b4b076f0b3859ea71df6ef5b4ba1b50f294d79 | [
"MIT"
] | 2 | 2019-10-13T01:55:56.000Z | 2019-11-01T22:34:50.000Z | RoboGym_training/animalai_train/animalai_train/__init__.py | ahassanzadeh/RoboGym | c7b4b076f0b3859ea71df6ef5b4ba1b50f294d79 | [
"MIT"
] | 6 | 2019-10-27T18:11:32.000Z | 2022-02-10T00:31:04.000Z | RoboGym_training/animalai_train/animalai_train/__init__.py | AIX2/RoboGym | c7b4b076f0b3859ea71df6ef5b4ba1b50f294d79 | [
"MIT"
] | 3 | 2019-11-18T05:27:31.000Z | 2020-09-10T06:35:47.000Z | name = "animalai_train" | 23 | 23 | 0.782609 | 3 | 23 | 5.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 23 | 1 | 23 | 23 | 0.809524 | 0 | 0 | 0 | 0 | 0 | 0.583333 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3a04106bae6b3e12b88b6b4cd9a839cedfeec75c | 2,043 | py | Python | script/testing/artifact_stats/base_artifact_stats_collector.py | pmenon/noisepage | 73d50cdfa2e15b5d45e61b51e34672d10a851e14 | [
"MIT"
] | 971 | 2020-09-13T10:24:02.000Z | 2022-03-31T07:02:51.000Z | script/testing/artifact_stats/base_artifact_stats_collector.py | pmenon/noisepage | 73d50cdfa2e15b5d45e61b51e34672d10a851e14 | [
"MIT"
] | 1,019 | 2018-07-20T23:11:10.000Z | 2020-09-10T06:41:42.000Z | script/testing/artifact_stats/base_artifact_stats_collector.py | pmenon/noisepage | 73d50cdfa2e15b5d45e61b51e34672d10a851e14 | [
"MIT"
] | 318 | 2018-07-23T16:48:16.000Z | 2020-09-07T09:46:31.000Z | from abc import ABC, ABCMeta, abstractmethod
class BaseArtifactStatsCollector(ABC):
"""
This is the base class to use if you want to collect a new artifact metric.
You can override the setup, run_collector, and teardown methods for your
specific collector implementation.
Use the with context-manager to handle the calling of setup and teardown.
Attributes
----------
is_debug : bool
This determines whether debug output from the collector will be printed
in stdout. In many cases this will be the stdout of a spawned process.
metrics : dict
The metrics collected during the execution of the collector.
"""
__metaclass__ = ABCMeta
def __init__(self, is_debug=False):
"""
Initialize the artifact stats collector.
Parameters
----------
is_debug : bool
True iff the debug output should be printed to stdout.
"""
self.is_debug = is_debug
self.metrics = {}
def __enter__(self):
self.setup()
return self
def __exit__(self, exc_type, exc_val, exc_tb):
self.teardown()
def setup(self):
"""
This function is guaranteed to be called ONCE before run_collector().
Override this to perform any setup steps required.
"""
pass
@abstractmethod
def run_collector(self):
"""
This function must be overridden by all collectors.
It should directly mutate self.metrics and perform any steps necessary
to capture the artifact stats for the collector.
Returns
-------
exit_code : int
0 on success, and anything else on failure.
"""
pass
def teardown(self):
"""
This function is guaranteed to always be called ONCE at the end.
The end might mean after setup(), after run_collector(),
or after an exception happened.
Override this to perform any teardown steps required.
"""
pass
| 29.185714 | 79 | 0.625551 | 251 | 2,043 | 4.976096 | 0.462151 | 0.028022 | 0.038431 | 0.028823 | 0.086469 | 0.048038 | 0 | 0 | 0 | 0 | 0 | 0.000709 | 0.309838 | 2,043 | 69 | 80 | 29.608696 | 0.885106 | 0.611356 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.166667 | 0.055556 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.