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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ea2bb80a4845b58954c6062cd938e68d554b3abd | 169 | py | Python | www/aeki/cgi/aeki_config.py | otuk/aeki | 6de9629a74698737e07ae86650925e3051ead5ee | [
"MIT"
] | null | null | null | www/aeki/cgi/aeki_config.py | otuk/aeki | 6de9629a74698737e07ae86650925e3051ead5ee | [
"MIT"
] | null | null | null | www/aeki/cgi/aeki_config.py | otuk/aeki | 6de9629a74698737e07ae86650925e3051ead5ee | [
"MIT"
] | null | null | null | aeki_config = {
"AEKI_HOST": "localhost", # rename to hostname for cgi if you like
"IOT_HOST":"localhost" # assumes iot test device is also on local host
}
| 24.142857 | 75 | 0.674556 | 25 | 169 | 4.44 | 0.8 | 0.234234 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.230769 | 169 | 6 | 76 | 28.166667 | 0.853846 | 0.502959 | 0 | 0 | 0 | 0 | 0.443038 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
ea2d0db0e5013c516e20cfd3f224e6f24b6a4de8 | 9,331 | py | Python | gateway/settings.py | 42cc/dashr-gw | 45ec8f99a730b97b80a4068a0e9ae8991904038e | [
"MIT"
] | 2 | 2018-02-06T12:18:49.000Z | 2018-02-08T08:26:56.000Z | gateway/settings.py | 42cc/dashr-gw | 45ec8f99a730b97b80a4068a0e9ae8991904038e | [
"MIT"
] | null | null | null | gateway/settings.py | 42cc/dashr-gw | 45ec8f99a730b97b80a4068a0e9ae8991904038e | [
"MIT"
] | 3 | 2018-02-12T02:14:11.000Z | 2020-05-21T19:25:41.000Z | """
Django settings for gateway project.
Generated by 'django-admin startproject' using Django 1.11.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
import sys
import dj_database_url
import django_cache_url
from kombu import Exchange, Queue
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'jksd@$=t_y2_epxck%_^%6mk$l8e6&mq)*++s%q6%yyk3!1v&x'
DASHD_RPCUSER = 'rpcuser'
DASHD_RPCPASSWORD = 'rpcpassword'
DASHD_ACCOUNT_NAME = 'gateway'
DASHD_URL = os.environ.get(
'DASHD_URL',
'http://{}:{}@127.0.0.1:19998'.format(DASHD_RPCUSER, DASHD_RPCPASSWORD),
)
RIPPLE_API_DATA = [
{
'RIPPLE_API_URL': os.environ.get(
'RIPPLED_URL',
'https://s1.ripple.com:51234',
),
},
]
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
ALLOWED_HOSTS = ['localhost', '127.0.0.1', '0.0.0.0']
# Application definition
sys.path.append(os.path.join(BASE_DIR, 'apps'))
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'ripple_api',
'compressor',
'webpack_loader',
'ckeditor',
'solo',
'apps.core',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'gateway.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
'apps.core.context_processors.minimal_amounts',
],
'string_if_invalid': '<< MISSING VARIABLE "%s" >>' if DEBUG else ''
},
},
]
WSGI_APPLICATION = 'gateway.wsgi.application'
CACHES = {'default': django_cache_url.config()}
if os.environ.get('REDIS_URL'):
CACHES['default'] = {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': os.environ.get('REDIS_URL')}
# Database
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
DATABASES = {
'default': dj_database_url.config(
default='postgres://gw_user:gw_pass@localhost:5432/gateway',
conn_max_age=600,
),
}
if 'test' in sys.argv:
DATABASES['default'] = {'ENGINE': 'django.db.backends.sqlite3'}
# Password validation
# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.'
'UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.'
'MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.'
'CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.'
'NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/1.11/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
DATETIME_FORMAT = 'N j, Y, P e'
USE_I18N = False
USE_L10N = False
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'assets'),
)
# DJANGO COMPRESS
COMPRESS_ENABLED = True
COMPRESS_PRECOMPILERS = (
('text/less', 'lessc {infile} {outfile} --autoprefix=">0%"'),
)
COMPRESS_CSS_FILTERS = (
'compressor.filters.css_default.CssAbsoluteFilter',
'compressor.filters.cssmin.CSSMinFilter'
)
# MEDIA
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# WEBPACK LOADER
WEBPACK_LOADER = {
'DEFAULT': {
'BUNDLE_DIR_NAME': 'bundles/',
'STATS_FILE': os.path.join(BASE_DIR, 'webpack-stats.json'),
}
}
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
)
# LOGGING
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s '
'%(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
'file': {
'level': 'INFO',
'class': 'logging.handlers.RotatingFileHandler',
'filename': os.path.join(BASE_DIR, 'logs/gateway.log'),
'maxBytes': 10 * 1024 * 1024,
'backupCount': 100,
'formatter': 'simple',
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
'filters': ['require_debug_true'],
'formatter': 'simple'
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins', 'file'],
'level': 'ERROR',
'propagate': True
},
'gateway': {
'handlers': ['mail_admins', 'file', 'console'],
'level': 'INFO',
'propagate': True
},
'celery': {
'handlers': ['mail_admins', 'file', 'console'],
'level': 'INFO',
'propagate': True
},
'ripple': {
'handlers': ['mail_admins', 'file', 'console'],
'level': 'INFO',
'propagate': True
},
}
}
ENCRYPTED_FIELDS_KEYDIR = os.path.join(BASE_DIR, 'fieldkeys')
SOLO_CACHE = 'default'
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL')
# Redis
REDIS_PORT = 6379
REDIS_DB = 0
REDIS_HOST = os.environ.get('REDIS_PORT_6379_TCP_ADDR', 'redis')
RABBIT_HOSTNAME = os.environ.get('RABBIT_PORT_5672_TCP', 'rabbit')
if RABBIT_HOSTNAME.startswith('tcp://'):
RABBIT_HOSTNAME = RABBIT_HOSTNAME.split('//')[1]
BROKER_URL = os.environ.get('BROKER_URL', '')
if not BROKER_URL:
BROKER_URL = 'amqp://{user}:{password}@{hostname}/{vhost}/'.format(
user=os.environ.get('RABBIT_ENV_USER', 'admin'),
password=os.environ.get('RABBIT_ENV_RABBITMQ_PASS', 'mypass'),
hostname=RABBIT_HOSTNAME,
vhost=os.environ.get('RABBIT_ENV_VHOST', ''))
# We don't want to have dead connections stored on rabbitmq,
# so we have to negotiate using heartbeats
BROKER_HEARTBEAT = '?heartbeat=30'
if not BROKER_URL.endswith(BROKER_HEARTBEAT):
BROKER_URL += BROKER_HEARTBEAT
BROKER_POOL_LIMIT = 1
BROKER_CONNECTION_TIMEOUT = 10
# Celery configuration
# configure queues, currently we have only one
CELERY_DEFAULT_QUEUE = 'default'
CELERY_QUEUES = (
Queue('default', Exchange('default'), routing_key='default'),
)
# Sensible settings for celery
CELERY_ALWAYS_EAGER = False
CELERY_ACKS_LATE = True
CELERY_TASK_PUBLISH_RETRY = True
CELERY_DISABLE_RATE_LIMITS = False
# By default we will ignore result
# If you want to see results and try out tasks interactively,
# change it to False
# Or change this setting on tasks level
CELERY_IGNORE_RESULT = True
CELERY_SEND_TASK_ERROR_EMAILS = False
CELERY_TASK_RESULT_EXPIRES = 600
# Set redis as celery result backend
CELERY_RESULT_BACKEND = 'redis://%s:%d/%d' % (REDIS_HOST, REDIS_PORT, REDIS_DB)
CELERY_REDIS_MAX_CONNECTIONS = 1
# Don't use pickle as serializer, json is much safer
CELERY_TASK_SERIALIZER = "json"
CELERY_ACCEPT_CONTENT = ['application/json']
CELERYD_HIJACK_ROOT_LOGGER = False
CELERYD_PREFETCH_MULTIPLIER = 1
CELERYD_MAX_TASKS_PER_CHILD = 1000
# Try to load settings from ``settings_local.py`` file
try:
from settings_local import * # NOQA
except ImportError, e:
sys.stderr.write('settings_local.py not found. Using default settings\n')
sys.stderr.write('%s: %s\n\n' % (e.__class__.__name__, e))
| 27.606509 | 79 | 0.647305 | 1,058 | 9,331 | 5.518904 | 0.350662 | 0.037849 | 0.022607 | 0.021579 | 0.15191 | 0.114232 | 0.073129 | 0.073129 | 0.047268 | 0 | 0 | 0.015735 | 0.209945 | 9,331 | 337 | 80 | 27.688427 | 0.776316 | 0.132033 | 0 | 0.079832 | 1 | 0.004202 | 0.401805 | 0.21225 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.05042 | 0.029412 | null | null | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
ea442c2de4ff492dd4374c04a850d9f728259783 | 343 | py | Python | packages/pyright-internal/src/tests/samples/genericTypes1.py | sransara/pyright | 4e117682c946b60f2b24fd75a07736954b21f158 | [
"MIT"
] | 1 | 2020-12-28T16:58:24.000Z | 2020-12-28T16:58:24.000Z | packages/pyright-internal/src/tests/samples/genericTypes1.py | sransara/pyright | 4e117682c946b60f2b24fd75a07736954b21f158 | [
"MIT"
] | 1 | 2021-08-31T20:37:43.000Z | 2021-08-31T20:37:43.000Z | packages/pyright-internal/src/tests/samples/genericTypes1.py | sransara/pyright | 4e117682c946b60f2b24fd75a07736954b21f158 | [
"MIT"
] | null | null | null | # This sample tests that the type analyzer flags as an error
# an attempt to assign to or delete a generic type.
from typing import Dict
# This should generate an error because assignment
# of generic types isn't allowed.
Dict[str, int] = {}
# This should generate an error because deletion
# of generic types isn't allowed.
del Dict[str]
| 24.5 | 60 | 0.755102 | 57 | 343 | 4.54386 | 0.614035 | 0.081081 | 0.138996 | 0.15444 | 0.440154 | 0.440154 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189504 | 343 | 13 | 61 | 26.384615 | 0.931655 | 0.781341 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ea4f5bbe5c9fe40d0892aa0b04a02c7abbbc8a2d | 64 | py | Python | src/dump1090exporter/__init__.py | bgulla/dump1090-exporter | 147f23451a0607b72a320e2901160f3f747b3a56 | [
"MIT"
] | 60 | 2016-10-26T11:11:40.000Z | 2022-03-06T14:32:44.000Z | src/dump1090exporter/__init__.py | bgulla/dump1090-exporter | 147f23451a0607b72a320e2901160f3f747b3a56 | [
"MIT"
] | 20 | 2017-06-14T06:09:17.000Z | 2022-03-16T01:20:59.000Z | src/dump1090exporter/__init__.py | bgulla/dump1090-exporter | 147f23451a0607b72a320e2901160f3f747b3a56 | [
"MIT"
] | 14 | 2017-07-03T19:18:38.000Z | 2022-02-04T14:38:54.000Z | from .exporter import Dump1090Exporter
__version__ = "21.10.0"
| 16 | 38 | 0.78125 | 8 | 64 | 5.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.160714 | 0.125 | 64 | 3 | 39 | 21.333333 | 0.660714 | 0 | 0 | 0 | 0 | 0 | 0.109375 | 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 |
ea5ac3ac50c918deeb7f8f4138b0c8ba4507a1ff | 138 | py | Python | app/recipe/models.py | shivam230697/recipe-api | 3b614a591577b75d48eb2d9d458ddd3abd81644c | [
"MIT"
] | null | null | null | app/recipe/models.py | shivam230697/recipe-api | 3b614a591577b75d48eb2d9d458ddd3abd81644c | [
"MIT"
] | null | null | null | app/recipe/models.py | shivam230697/recipe-api | 3b614a591577b75d48eb2d9d458ddd3abd81644c | [
"MIT"
] | null | null | null | from django.db import models
# Create your models here.
class TestModel(models.Model):
test_field = models.IntegerField(default=0)
| 17.25 | 47 | 0.76087 | 19 | 138 | 5.473684 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008547 | 0.152174 | 138 | 7 | 48 | 19.714286 | 0.880342 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ea5ce034937183164e81a955f75fc682707059c6 | 131 | py | Python | python-opencv/blog2-pixel/demo7.py | meteor1993/python-learning | 4ee574c9360caf6e63bb6ee2ef31fa6a9918fa40 | [
"MIT"
] | 83 | 2019-10-15T06:54:06.000Z | 2022-03-28T14:08:21.000Z | python-opencv/blog2-pixel/demo7.py | wenxuefeng3930/python-learning | 4ee574c9360caf6e63bb6ee2ef31fa6a9918fa40 | [
"MIT"
] | 1 | 2020-04-16T08:13:19.000Z | 2020-07-14T01:52:46.000Z | python-opencv/blog2-pixel/demo7.py | wenxuefeng3930/python-learning | 4ee574c9360caf6e63bb6ee2ef31fa6a9918fa40 | [
"MIT"
] | 74 | 2019-11-02T08:10:36.000Z | 2022-02-19T12:23:36.000Z | import cv2 as cv
from matplotlib import pyplot as plt
img=cv.imread('maliao.jpg', cv.IMREAD_COLOR)
plt.imshow(img)
plt.show() | 21.833333 | 45 | 0.740458 | 23 | 131 | 4.173913 | 0.652174 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008929 | 0.145038 | 131 | 6 | 46 | 21.833333 | 0.848214 | 0 | 0 | 0 | 0 | 0 | 0.07874 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ea5f6a8299056823901669f8b2e31fd53aa748a1 | 1,094 | py | Python | web_info.py | B4t33n/web_info | a0f8d5be160c96e6e949140a7e3c8982bfce4ab5 | [
"Apache-2.0"
] | 1 | 2021-05-16T13:29:17.000Z | 2021-05-16T13:29:17.000Z | web_info.py | B4t33n/web_info | a0f8d5be160c96e6e949140a7e3c8982bfce4ab5 | [
"Apache-2.0"
] | null | null | null | web_info.py | B4t33n/web_info | a0f8d5be160c96e6e949140a7e3c8982bfce4ab5 | [
"Apache-2.0"
] | null | null | null | print("\033[92m")
import os
import urllib2
import sys
print("---------------------------------------------")
os.system("figlet web info")
print("----------------------------------------------")
print("\033[91m")
print("#############################################")
print(" Coded by B4t33n ")
print("#############################################")
print("\033[93m")
print(" INFORMATION ")
print(".............................................")
print("")
print(" FB PAGE : https://www.facebook.com/B4t33n/")
print(" CODER : B4t33n")
print(" VERSION : 1.0")
print(" TEAM : BWHH")
print(" EMAIL : gamilniyakikorbu@gmail.com")
print("\033[92m")
print(">>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<")
print("\033[91m")
print(" Enter CTRL+Z To Exit Tool ")
print("")
print("\033[94m")
url = raw_input(">>>>ENTER YOUR WEBSITE LINK :")
print("\033[95m")
print("")
url.rstrip ( )
print("")
header = urllib2.urlopen (url) .info ( )
print("")
print(str (header) ) | 23.782609 | 60 | 0.399452 | 96 | 1,094 | 4.541667 | 0.520833 | 0.183486 | 0.119266 | 0.073395 | 0.09633 | 0 | 0 | 0 | 0 | 0 | 0 | 0.05492 | 0.201097 | 1,094 | 46 | 61 | 23.782609 | 0.443936 | 0 | 0 | 0.323529 | 0 | 0 | 0.617352 | 0.273973 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.088235 | 0 | 0.088235 | 0.794118 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
ea79a3dbc9f8a91f2ad34706bc154dae9826035f | 302 | py | Python | docker/app/app/backend/apps/_archive/accounts_new/profiles/serializers.py | JTarball/tetherbox | cae7a4bb6e29da0f34670f8c8d228faf5f909f3a | [
"0BSD"
] | 1 | 2018-02-26T07:26:30.000Z | 2018-02-26T07:26:30.000Z | docker/app/app/backend/apps/_archive/accounts_new/profiles/serializers.py | JTarball/docker-django-polymer-starter-kit | b5250030b1646e29567c15d01ba4668c6ad535c9 | [
"0BSD"
] | null | null | null | docker/app/app/backend/apps/_archive/accounts_new/profiles/serializers.py | JTarball/docker-django-polymer-starter-kit | b5250030b1646e29567c15d01ba4668c6ad535c9 | [
"0BSD"
] | null | null | null | """
accounts.profile.serializers
============================
Serializers file for a basic Accounts App
"""
from rest_framework import serializers
from .models import AccountsUser
class AccountsUserSerializer(serializers.ModelSerializer):
class Meta:
model = AccountsUser
| 17.764706 | 58 | 0.672185 | 27 | 302 | 7.481481 | 0.703704 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.18543 | 302 | 16 | 59 | 18.875 | 0.821138 | 0.331126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.8 | 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 |
ea84710a91e9ce1a19dd0a2f68da27eda2cd6074 | 835 | bzl | Python | ml_metadata/workspace.bzl | zijianjoy/ml-metadata | 2fe02bc234408c49c3df37c7c5b276a85990da7d | [
"Apache-2.0"
] | 458 | 2019-01-18T18:11:00.000Z | 2022-03-28T15:27:33.000Z | ml_metadata/workspace.bzl | DrStarkXavier/ml-metadata | 3434ebaf36db54a7e67dbb0793980a74ec0c5d50 | [
"Apache-2.0"
] | 108 | 2019-01-24T02:17:46.000Z | 2022-03-30T18:36:46.000Z | ml_metadata/workspace.bzl | DrStarkXavier/ml-metadata | 3434ebaf36db54a7e67dbb0793980a74ec0c5d50 | [
"Apache-2.0"
] | 128 | 2019-01-24T05:42:43.000Z | 2022-03-25T11:11:44.000Z | # Copyright 2018 Google LLC
#
# 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.
"""ML METADATA Data Validation external dependencies that can be loaded in WORKSPACE files.
"""
load("//ml_metadata:mysql_configure.bzl", "mysql_configure")
def ml_metadata_workspace():
"""All ML Metadata external dependencies."""
mysql_configure()
| 36.304348 | 91 | 0.758084 | 122 | 835 | 5.139344 | 0.663934 | 0.095694 | 0.041467 | 0.051037 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011429 | 0.161677 | 835 | 22 | 92 | 37.954545 | 0.884286 | 0.810778 | 0 | 0 | 0 | 0 | 0.358209 | 0.246269 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | true | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ea8fe32f856495dc2c83b201fa1c4de92c36e8f3 | 1,964 | py | Python | .vim/bundle-deactivated/python-mode/pylibs/ropemode/environment.py | chrislaskey/.dot-files | 44be2364f2824a2c70300f7c0f2963a592c7083e | [
"MIT"
] | null | null | null | .vim/bundle-deactivated/python-mode/pylibs/ropemode/environment.py | chrislaskey/.dot-files | 44be2364f2824a2c70300f7c0f2963a592c7083e | [
"MIT"
] | null | null | null | .vim/bundle-deactivated/python-mode/pylibs/ropemode/environment.py | chrislaskey/.dot-files | 44be2364f2824a2c70300f7c0f2963a592c7083e | [
"MIT"
] | null | null | null | class Environment(object):
def ask(self, prompt, default=None, starting=None):
pass
def ask_values(self, prompt, values, default=None, starting=None):
pass
def ask_directory(self, prompt, default=None, starting=None):
pass
def ask_completion(self, prompt, values, starting=None):
pass
def message(self, message):
pass
def yes_or_no(self, prompt):
pass
def y_or_n(self, prompt):
pass
def get(self, name, default=None):
pass
def get_offset(self):
pass
def get_text(self):
pass
def get_region(self):
pass
def filename(self):
pass
def is_modified(self):
pass
def goto_line(self, lineno):
pass
def insert_line(self, line, lineno):
pass
def insert(self, text):
pass
def delete(self, start, end):
pass
def filenames(self):
pass
def save_files(self, filenames):
pass
def reload_files(self, filenames, moves=None):
pass
def find_file(self, filename, readonly=False, other=False):
pass
def create_progress(self, name):
pass
def current_word(self):
pass
def push_mark(self):
pass
def pop_mark(self):
pass
def prefix_value(self, prefix):
pass
def show_occurrences(self, locations):
pass
def show_doc(self, docs, altview=False):
pass
def preview_changes(self, diffs):
pass
def local_command(self, name, callback, key=None, prefix=False):
pass
def global_command(self, name, callback, key=None, prefix=False):
pass
def add_hook(self, name, callback, hook):
pass
@staticmethod
def _completion_text(proposal):
return proposal.name.partition(':')[0].strip()
def _completion_data(self, proposal):
return self._completion_text(proposal)
| 18.704762 | 70 | 0.599796 | 242 | 1,964 | 4.731405 | 0.318182 | 0.18952 | 0.086463 | 0.066376 | 0.187773 | 0.187773 | 0.187773 | 0.158952 | 0.158952 | 0.083843 | 0 | 0.000734 | 0.306008 | 1,964 | 104 | 71 | 18.884615 | 0.839325 | 0 | 0 | 0.457143 | 0 | 0 | 0.000509 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.485714 | false | 0.457143 | 0 | 0.028571 | 0.528571 | 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 |
576046bf13a9a9a373df939e68641affef31278c | 498 | py | Python | myApp/views.py | geniyong/oauth_practice | c62b461a59299a28538472d9955c57c86c61cad3 | [
"MIT"
] | null | null | null | myApp/views.py | geniyong/oauth_practice | c62b461a59299a28538472d9955c57c86c61cad3 | [
"MIT"
] | null | null | null | myApp/views.py | geniyong/oauth_practice | c62b461a59299a28538472d9955c57c86c61cad3 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.shortcuts import render,redirect, render_to_response
from .models import *
from django.views.generic import TemplateView, ListView, DetailView, CreateView, UpdateView, DeleteView
from django.urls import reverse
from django.http import HttpResponseRedirect
def loginView(request):
if request.method =="GET":
pass
elif request.method == 'POST':
pass
return render(request, 'myApp/login.html')
| 26.210526 | 103 | 0.757028 | 61 | 498 | 6.147541 | 0.606557 | 0.133333 | 0.101333 | 0.133333 | 0.165333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.164659 | 498 | 18 | 104 | 27.666667 | 0.901442 | 0.046185 | 0 | 0.166667 | 0 | 0 | 0.048729 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | false | 0.166667 | 0.5 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
5762429b1b1dd01cf1b9389178f64cf1b092cca8 | 2,095 | py | Python | apps/establishment_system/search_indexes.py | camilortte/RecomendadorUD | ebf9ee4482c4093d4751a27c90f56637a9c692a4 | [
"MIT"
] | 4 | 2015-01-29T17:17:26.000Z | 2021-03-03T08:17:03.000Z | apps/establishment_system/search_indexes.py | camilortte/RecomendadorUD | ebf9ee4482c4093d4751a27c90f56637a9c692a4 | [
"MIT"
] | null | null | null | apps/establishment_system/search_indexes.py | camilortte/RecomendadorUD | ebf9ee4482c4093d4751a27c90f56637a9c692a4 | [
"MIT"
] | 1 | 2015-09-22T08:35:26.000Z | 2015-09-22T08:35:26.000Z | # -*- encoding: utf-8 -*-
"""
search_indexex.py: Creacion de los indices de busqueda.
@author Camilo Ramírez
@contact camilolinchis@gmail.com
camilortte@hotmail.com
@camilortte on Twitter
@copyright Copyright 2014-2015, RecomendadorUD
@license GPL
@date 2014-10-10
@satus Pre-Alpha
@version= 0..215
"""
#import datetime
from haystack import indexes
from .models import Establecimiento, Categoria
class EstablecimientoIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True)
nombre = indexes.EdgeNgramField(model_attr='nombre')
#nombre_auto = indexes.EdgeNgramField(model_attr='nombre')
email = indexes.EdgeNgramField(model_attr='email')
web_page = indexes.EdgeNgramField(model_attr='web_page')
address= indexes.EdgeNgramField(model_attr='address')
sub_categorias = indexes.EdgeNgramField(model_attr='sub_categorias')
# content_auto = indexes.EdgeNgramField(model_attr='nombre')
def get_model(self):
return Establecimiento
def index_queryset(self, using=None):
# using select_related here should avoid an extra query for getting
# the manufacturer when indexing
return self.get_model().objects.all().select_related('sub_categorias')
# def search(self):
# if hasattr(self,'cleaned_data') and self.cleaned_data['q']:
# self.cleaned_data['q']=self.cleaned_data['q'].encode('translit/one/ascii', 'replace')
# sqs = super(RtSearchForm, self).search()
# return sqs
class CategoriaIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
nombre_categoria= indexes.EdgeNgramField(model_attr='nombre')
def get_model(self):
return Categoria
def index_queryset(self, using=None):
"""Used when the entire index for model is updated."""
#return self.get_model().objects.filter(pub_date__lte=datetime.datetime.now())
return self.get_model().objects.all() | 35.508475 | 99 | 0.690215 | 242 | 2,095 | 5.834711 | 0.466942 | 0.11898 | 0.147309 | 0.169972 | 0.363314 | 0.320113 | 0.208215 | 0.208215 | 0.174221 | 0.080737 | 0 | 0.012552 | 0.201432 | 2,095 | 59 | 100 | 35.508475 | 0.831441 | 0.447255 | 0 | 0.2 | 0 | 0 | 0.055147 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.1 | 0.15 | 1 | 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 |
5771a8c9a11c0b65fd2a5981efe83e45f9b456e5 | 14,669 | py | Python | fth.py | anonymous-sys19/fth | cbde3030f43d048970e1471dc9c4fafba50fedb8 | [
"Apache-2.0"
] | 2 | 2021-02-01T18:31:19.000Z | 2021-05-28T19:14:51.000Z | fth.py | anonymous-sys19/fth | cbde3030f43d048970e1471dc9c4fafba50fedb8 | [
"Apache-2.0"
] | null | null | null | fth.py | anonymous-sys19/fth | cbde3030f43d048970e1471dc9c4fafba50fedb8 | [
"Apache-2.0"
] | null | null | null | import os
import time
import sys
import random
user_pass = ('''admin
admi
admin
universo
html
veggeta
Admin
bados
free-fire
royale
clang
free
fire
anonimo
anonimous
anoni
bills
anonymous
Aanonimous
pass
password
wordlist
kali
linux
kali-linux
start
Hacker
parrot
ubuntu
blacken
redhat
deepin
lubuntu
depin
gogeta
hacker
tor
2000
error
2001
2002
1999
root
home
space
2003
2004
2005
red-tor
redtor
enero
2006
2007
2008
home
2009
2010
2020
goku
febrero
user
usuario
xmr7
marzo
administrador
abril
mayo
junio
administrativo
2011
homme
2013
2012
security
2014
wine
seguridad
2015
2016
2017
2018
2019
hack
black
hackblack
julio
anonsurf
decsec
agosto
metasploit
supersu
super
user-root
septiembre
octubre
october
novienbre
juan
adrian
diciembre
cuarenta
curentena
1234
4321
0000
docker
python
aaaa
dead
deat
muerte
sudo
sudosu
sudo su
we are hacker
2222
1010
wearehacker
123456
1111
12345
mexico
peru
amor
123
vida
love
loveyou
you
live
5678
scan
56789
mylife
estudio
mrhacker
mr hacker
jhom
jhon
fores
benjamin
mr-rebot
mr robot
mr-roboth
mr roboth
roboth
scryp
1010
tool
nombre
anom''')
def colores ():
listas = ['\033[1;36m','\033[1;31m','\033[1;34m','\033[1;30m','\033[1;37m','\033[1;35m','\033[1;32m','\033[1;33m']
indice=random.randrange(len(listas))
lista=listas[indice]
print(lista)
user_user = ('''admin
admi
admin
Admin
anonimo
anonimous
anoni
anonymous
benjamin
mr-rebot
mr robot
mr-roboth
mr roboth
roboth
Aanonimous
pass
password
wordlist
kali
linux
kali-linux
start
Hacker
parrot
ubuntu
redhat
deepin
depin
gogeta
hacker
tor
2000
2001
2002
1999
root
home
space
2003
2004
2005
red-tor
redtor
enero
2006
2007
2008
2009
2010
2020
goku
febrero
user
usuario
marzo
administrador
abril
mayo
junio
administrativo
2011
2013
2012
2014
2015
2016
2017
2018
2019
hack
black
hackblack
julio
anonsurf
agosto
metasploit
supersu
super
user-root
septiembre
octubre
october
novienbre
juan
diciembre
cuarenta
curentena
1234
4321
0000
docker
aaaa
dead
deat
muerte
sudo
sudosu
sudo su
we are hacker
2222
1010
wearehacker
123456
1111
12345
mexico
peru
amor
123
vida
love
loveyou
you
live
5678
scan
56789
mylife
estudio
mrhacker
mr hacker
jhom
jhon
fores
scryp
1010
tool
anom
''')
#print (user)
def slowprint(s):
for c in s + '\n':
sys.stdout.write(c)
sys.stdout.flush()
time.sleep(1./70)
def fth ():
colores()
listalinuxs = ['''
██████ █████ █████
███░░███ ░░███ ░░███
░███ ░░░ ███████ ░███████
███████ ░░░███░ ░███░░███
░░░███░ ░███ ░███ ░███
░███ ░███ ███ ░███ ░███
█████ ██ ░░█████ ██ ████ █████
░░░░░ ░░ ░░░░░ ░░ ░░░░ ░░░░░
''','''
'########::::::'########::::::'##::::'##:
##.....:::::::... ##..::::::: ##:::: ##:
##::::::::::::::: ##::::::::: ##:::: ##:
######::::::::::: ##::::::::: #########:
##...:::::::::::: ##::::::::: ##.... ##:
##:::::::'###:::: ##::::'###: ##:::: ##:
##::::::: ###:::: ##:::: ###: ##:::: ##:
..::::::::...:::::..:::::...::..:::::..::
''','''
███████╗████████╗██╗ ██╗
██╔════╝╚══██╔══╝██║ ██║
█████╗ ██║ ███████║
██╔══╝ ██║ ██╔══██║
██║██╗ ██║██╗██║ ██║
╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝
''','''
O)) O)) O))
O) O)) O)) O)) O)
O)O) O)O)O) O)O)) O)) O)) O)) O)) O))O)) O))
O)) O)) O) O) O))O)) O)) O))O)) O)) O) O))
O)) O)) O)) O)) O))O)) O)) O))O)) O)) O)
O)) O)) O) O)) O))O)) O)) O))O)) O)) O) O))
O)) O)) O)) O))O)))O))O))) O)) O))O))O)) O))
''','''
.%%%%%%..%%%%%%..%%..%%..%%......%%%%%%..%%..%%..%%..%%..%%..%%.
.%%........%%....%%..%%..%%........%%....%%%.%%..%%..%%...%%%%..
.%%%%......%%....%%%%%%..%%........%%....%%.%%%..%%..%%....%%...
.%%........%%....%%..%%..%%........%%....%%..%%..%%..%%...%%%%..
.%%........%%....%%..%%..%%%%%%..%%%%%%..%%..%%...%%%%...%%..%%.
................................................................
''','''
@@@@@@@@ @@@@@@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@ @@@
@@@@@@@@ @@@@@@@ @@@ @@@ @@@ @@@ @@@@ @@@ @@@ @@@ @@@ @@@
@@! @@! @@! @@@ @@! @@! @@!@!@@@ @@! @@@ @@! !@@
!@! !@! !@! @!@ !@! !@! !@!!@!@! !@! @!@ !@! @!!
@!!!:! @!! @!@!@!@! @!@!@!@!@ @!! !!@ @!@ !!@! @!@ !@! !@@!@!
!!!!!: !!! !!!@!!!! !!!@!@!!! !!! !!! !@! !!! !@! !!! @!!!
!!: !!: !!: !!! !!: !!: !!: !!! !!: !!! !: :!!
:!: :!: :!: !:! :!: :!: :!: !:! :!: !:! :!: !:!
:: :: :: ::: :: :::: :: :: :: ::::: :: :: :::
: : : : : : :: : : : :: : : : : : ::
''']
indice=random.randrange(len(listalinuxs))
listalinux=listalinuxs[indice]
slowprint(listalinux)
fth()
def clear ():
os.system('clear')
def help ():
print ('\n ------Menu_de ayuda_------\n')
ayuda = '''
Creacion de usuario = use user [ no son util ]
Creacion de password = use pass [ no son util ]\n
create_new_pass [Crea una nueva lista de deccionario manual]\n\n
create_new_user [Crea una nueva lista de diccionario manual ]\n
create pass list [crea la lista de diccionario creada por el usuario]\n
create user list [crea la lista de diccionario creada por el usuario]\n
clear [LIMPIA LA PANTALLA ]\n
use force_brute [con este comando podra hacer fuerza bruta a ftp,ssh.etc]
open msfconsole [podras tambien ejecutar metasploit desde la misma scryp]
\n
use hacker_git [como instancia con solo este comando se instalara una tools]
creada por el usuario disponible en github
\n
create automated payload [ crearas un payload ya automatizado [windows/android][1]]
\n
Tambien podras llamar cualquier herramienta del sistema..
escribiendo el nombre de la herramienta
Ejemplo [ nmap 127.0.0.1 ] etc
\n\n
------Nota------
\n\n
Para ahorrarte trabajo el mismo creador del scrypt a creado un diccionario
con posibles password y user puedes crearlos y darles usos en el apartado
de contraseña y usuario --------------- tambien el creador de contraseña
te generara y podras guardar cada [user y pass] en la lista de diccionarios
del scrypt para darle uso en otra ocacion --------------------------------\n\n
Tambien tendra el privilejio de editar sus diccionarios desde el directorio
de la herramienta.. ya que automaticamente el scrypt le heredara privilegios
--------------------------------super-user----------------------------------
'''
print (ayuda)
def create_new_Pass ():
print('Creando .txt ....')
time.sleep(2)
os.system ('nano New_Pass.txt')
print('Creado con exito ....')
def create_new_user ():
print('Creando .txt ....\n')
time.sleep(2)
os.system ('nano New_user.txt')
print('Creado con exito ....')
def password ():
diccionaripass = open('user_pass.txt', 'a')
diccionaripass.write(user_pass)
def usuarios ():
diccionariuser = open('user_user.txt', 'a')
diccionariuser.write(user_user)
def menu ():
colores()
Menu_de_inicio = ('''
[Escribe [help] para ver modo de uso ]
\n
Generar diccionario\n
Crear nuevo diccionario\n
Editar diccionario existente
''')
print('\n -----------------------------------welcome------------------------------\n')
print(Menu_de_inicio)
menu()
def chmod ():
os.system('chmod 777 -R *')
def creacion ():
chmod()
usr_pas = input('menu $ ')
if usr_pas == 'use user' :
print('''\n\n
para agregar tus propias palabras\n
debes crear generar el diccionario user-pas \n\n
espera
\n\n''')
print ('\nSi ya lo isiste antes preciona [n]\n\n')
dic = input('[y/n] $ ')
if dic == 'y' :
usuarios()
password()
print('Listo quieres agregar palabras de [use](pass/user) escribe ')
pausr = input('[pass/user] $ ')
if pausr == 'pass' :
os.system ('nano user_pass.txt')
creacion()
elif pausr == 'user' :
os.system('nano user_user.txt')
creacion()
elif pausr == 'create_new pass' :
os.system('nano New_Pass.txt')
creacion()
elif pausr == 'create_new user' :
os.system('nano New_user.txt')
creacion()
else:
print('ERROR OPCION INVALIDA ... ')
elif dic == 'n' :
pausr = input('[pass/user] $ ')
if pausr == 'pass' :
os.system ('nano user_pass.txt')
creacion()
elif pausr == 'user' :
os.system('nano user_user.txt')
creacion()
elif pausr == 'create_new pass' :
os.system('nano New_Pass.txt')
creacion()
elif pausr == 'create_new user' :
os.system('nano New_user.txt')
creacion()
elif pausr == 'clear' :
clear()
creacion()
else:
print('ERROR OPCION INVALIDA ... ')
elif usr_pas == 'use pass' :
print('''\n\n
para agregar tus propias palabras\n
debes crear generar el diccionario user-pas \n\n
espera
\n\n''')
print ('\nSi ya lo isiste antes preciona [n]\n\n')
dic = input('[y/n] $ ')
if dic == 'y' :
usuarios()
password()
print('Listo quieres agregar palabras de [use](pass/user) escribe \n\n')
pausr = input('[pass/user] $ ')
if pausr == 'pass' :
os.system ('nano user_pass.txt')
creacion()
elif pausr == 'user' :
os.system('nano user_user.txt')
creacion()
elif pausr == 'create_new pass' :
os.system('nano New_Pass.txt')
creacion()
elif pausr == 'create_new user' :
os.system('nano New_user.txt')
creacion()
elif pausr == 'help' :
help()
creacion()
elif pausr == 'exit' :
print ('Saludes un gusto adios')
os.system('exit')
elif pausr == 'clear' :
clear()
creacion()
else:
print('ERROR OPCION INVALIDA ... ')
elif dic == 'n' :
pausr = input('[pass/user] $ ')
if pausr == 'pass' :
os.system ('nano user_pass.txt')
creacion()
elif pausr == 'user' :
os.system('nano user_user.txt')
creacion()
elif pausr == 'create_new pass' :
os.system('nano New_Pass.txt')
creacion()
elif pausr == 'create_new user' :
os.system('nano New_user.txt')
creacion()
elif pausr == 'help' :
help()
creacion()
elif pausr == 'exit' :
print ('Saludes un gusto adios')
os.system('exit')
elif pausr == 'clear' :
clear()
creacion()
else:
print('ERROR OPCION INVALIDA ... ')
elif usr_pas == 'help' :
clear()
colores()
help()
colores()
creacion()
elif usr_pas == 'use hacker_git' :
colores()
print (' Instalando ')
time.sleep(1)
print('Instalacion..escribe la ruta a guardar la herramienta .. \n')
instalacion = input('$rute $ ')
os.system ('git clone https://github.com/anonymous-sys19/Hacker.git')
os.system ("mv Hacker " + instalacion)
print('\n listo se instalo con exito\n')
creacion()
elif usr_pas == 'create_new_pass' :
create_new_Pass()
elif usr_pas == 'create_new_user' :
create_new_user()
elif usr_pas == 'exit' :
clear()
colores()
print ('\n--------Saludes un gusto adios-----\n\n')
os.system('exit')
elif usr_pas == 'clear' :
clear()
colores()
creacion()
elif usr_pas == 'use force_brute' :
colores()
print ('..........')
time.sleep(0.50)
print (' ..........' )
time.sleep(0.50)
print ('-----abriendo modulo-----')
colores()
time.sleep(0.50)
print ('..........')
time.sleep(0.50)
print ('..........')
time.sleep(0.50)
clear()
os.system('python3 modulos/mod_force.py')
colores()
creacion()
elif usr_pas == 'create user list' :
usuarios()
print('Creado con exito ....')
time.sleep(2)
chmod()
clear()
creacion()
elif usr_pas == 'create pass list' :
password()
print('Creado con exito .... ')
time.sleep(2)
chmod()
clear()
creacion()
elif usr_pas == 'open msfconsole' :
print('pleace wait ... execute msfconsole \n\n')
os.system('msfconsole')
creacion()
elif usr_pas == 'create automated payload' :
os.system('bash modulos/modsh/modulo_payload.sh')
colores()
creacion()
elif usr_pas == usr_pas :
os.system(usr_pas)
colores()
creacion()
else:
clear()
print('\n\n error ')
creacion()
creacion() | 23.247227 | 118 | 0.439703 | 1,478 | 14,669 | 4.50203 | 0.263194 | 0.020439 | 0.030207 | 0.039675 | 0.536519 | 0.503757 | 0.486625 | 0.440637 | 0.440637 | 0.440637 | 0 | 0.038749 | 0.361374 | 14,669 | 631 | 119 | 23.247227 | 0.641546 | 0.000818 | 0 | 0.704132 | 0 | 0.008264 | 0.624821 | 0.048032 | 0 | 0 | 0 | 0 | 0 | 1 | 0.019835 | false | 0.072727 | 0.006612 | 0 | 0.026446 | 0.059504 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
5782dd6002965788cc0b91a4b76d21a40b2045ce | 279 | py | Python | airflow-materials/demo/mnt/dags/pipeline/process.py | reginold/airflow-handson | 2ac150955f3191f2acaa88643484bb0a7e4f10ea | [
"Apache-2.0"
] | null | null | null | airflow-materials/demo/mnt/dags/pipeline/process.py | reginold/airflow-handson | 2ac150955f3191f2acaa88643484bb0a7e4f10ea | [
"Apache-2.0"
] | null | null | null | airflow-materials/demo/mnt/dags/pipeline/process.py | reginold/airflow-handson | 2ac150955f3191f2acaa88643484bb0a7e4f10ea | [
"Apache-2.0"
] | null | null | null | def second_task(**context):
print("This is ----------- task 2")
return "hoge======"
def third_task(**context):
output = context["task_instance"].xcom_pull(task_ids="python_task_2")
print("This is ----------- task 3")
return "This is the result : " + output
| 27.9 | 73 | 0.594982 | 37 | 279 | 4.297297 | 0.540541 | 0.113208 | 0.138365 | 0.188679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0131 | 0.179211 | 279 | 9 | 74 | 31 | 0.681223 | 0 | 0 | 0 | 0 | 0 | 0.390681 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0 | 0 | 0.571429 | 0.285714 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
579c287002d5865b908cece88e2dc77b99abf245 | 4,392 | py | Python | src/the_tale/the_tale/linguistics/migrations/0009_remove_quotes_from_diary.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 85 | 2017-11-21T12:22:02.000Z | 2022-03-27T23:07:17.000Z | src/the_tale/the_tale/linguistics/migrations/0009_remove_quotes_from_diary.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 545 | 2017-11-04T14:15:04.000Z | 2022-03-27T14:19:27.000Z | src/the_tale/the_tale/linguistics/migrations/0009_remove_quotes_from_diary.py | al-arz/the-tale | 542770257eb6ebd56a5ac44ea1ef93ff4ab19eb5 | [
"BSD-3-Clause"
] | 45 | 2017-11-11T12:36:30.000Z | 2022-02-25T06:10:44.000Z | # -*- coding: utf-8 -*-
import json
from django.db import models, migrations
DIARY_KEYS = (0,
3,
4,
17,
20001,
20002,
20003,
40000,
40001,
40002,
40003,
40004,
40005,
40006,
40007,
40008,
40009,
40010,
40011,
40012,
40013,
40014,
40015,
40016,
40017,
40018,
40019,
40020,
40021,
40022,
40023,
40024,
40025,
40026,
40027,
40028,
40029,
40030,
40031,
80001,
80002,
80003,
80004,
80005,
80006,
80007,
80008,
80009,
80010,
80011,
80012,
80013,
80014,
80015,
80016,
80017,
80018,
80019,
80020,
80021,
80022,
80023,
80024,
80027,
80028,
80034,
80035,
300000,
360019,
360020,
360021,
360022,
360023,
360024,
360025,
360026,
360027,
380013,
380014,
380015,
380016,
380017,
380018,
380019,
380020,
380021,
400017,
400018,
400019,
400020,
400021,
400022,
400023,
400024,
400025,
400026,
400027,
400028,
400029,
420004,
420005,
420006,
420007,
420008,
440004,
440005,
440006,
460007,
460008,
460009,
480006,
480007,
480008,
500004,
500005,
500006,
520004,
520005,
520006,
540002,
540003,
540004,
540005,
540006,
540007,
540008,
540009,
540010,
540011,
540012,
540013,
540014,
540015,
560019,
560020,
560021,
560022,
560023,
560024,
560025,
560026,
560027,
560028,
560029,
560030,
560031,
560032,
560033,
580000,
580001,
580002,
580005 )
def remove_quotes(apps, schema_editor):
Template = apps.get_model("linguistics", "Template")
for template in Template.objects.filter(key__in=DIARY_KEYS):
if template.raw_template[0] != '«':
continue
if template.raw_template[-1] == '»':
processor = lambda text: text[1:-1]
elif template.raw_template[-2:] == '».':
processor = lambda text: text[1:-2] + '.'
else:
continue
data = json.loads(template.data)
template.raw_template = processor(template.raw_template)
for verificator in data['verificators']:
verificator['text'] = processor(verificator['text'])
data['template']['template'] = processor(data['template']['template'])
template.data = json.dumps(data)
template.save()
class Migration(migrations.Migration):
dependencies = [
('linguistics', '0008_auto_20150727_1600'),
]
operations = [
migrations.RunPython(
remove_quotes,
),
]
| 21.742574 | 78 | 0.344035 | 271 | 4,392 | 5.527675 | 0.760148 | 0.036716 | 0.063418 | 0.028037 | 0.033378 | 0.033378 | 0 | 0 | 0 | 0 | 0 | 0.469489 | 0.585838 | 4,392 | 201 | 79 | 21.850746 | 0.352391 | 0.004781 | 0 | 0.01105 | 0 | 0 | 0.025177 | 0.005264 | 0 | 0 | 0 | 0 | 0 | 1 | 0.005525 | false | 0 | 0.01105 | 0 | 0.033149 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 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 |
57a76c0acd0cd0c7f74ee94b222ad2aad279c1a0 | 160 | py | Python | users/roles.py | Zimodra/yamdb_final | b6bb7e5b92a09604b441e9111bd52ecb459ffaba | [
"MIT"
] | null | null | null | users/roles.py | Zimodra/yamdb_final | b6bb7e5b92a09604b441e9111bd52ecb459ffaba | [
"MIT"
] | null | null | null | users/roles.py | Zimodra/yamdb_final | b6bb7e5b92a09604b441e9111bd52ecb459ffaba | [
"MIT"
] | null | null | null | from django.db import models
class Roles(models.TextChoices):
USER = 'user', 'User'
MODERATOR = 'moderator', 'Moderator'
ADMIN = 'admin', 'Admin'
| 20 | 40 | 0.65625 | 18 | 160 | 5.833333 | 0.611111 | 0.152381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 160 | 7 | 41 | 22.857143 | 0.820313 | 0 | 0 | 0 | 0 | 0 | 0.225 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
57cfdc5a603f9e7b2137dd0276b55ce9493be7c5 | 16 | py | Python | external/netdef_models/netdef_slim/evolutions/__init__.py | zhuhu00/MOTSFusion_modify | 190224a7c3fbded69fedf9645a0ebbf08227fb6d | [
"MIT"
] | null | null | null | external/netdef_models/netdef_slim/evolutions/__init__.py | zhuhu00/MOTSFusion_modify | 190224a7c3fbded69fedf9645a0ebbf08227fb6d | [
"MIT"
] | null | null | null | external/netdef_models/netdef_slim/evolutions/__init__.py | zhuhu00/MOTSFusion_modify | 190224a7c3fbded69fedf9645a0ebbf08227fb6d | [
"MIT"
] | null | null | null | nothing = None
| 5.333333 | 14 | 0.6875 | 2 | 16 | 5.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 16 | 2 | 15 | 8 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
57f2007543d3878ef0bed9620dac66d11e435984 | 178 | py | Python | eyed/rpc/bacnetd/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | null | null | null | eyed/rpc/bacnetd/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | 55 | 2017-12-21T15:20:36.000Z | 2019-01-20T02:49:41.000Z | eyed/rpc/bacnetd/__init__.py | ThousandMileEye/Eye | b0eca371fed5e01353ebddf7e4c400927decf0d2 | [
"Apache-2.0"
] | 3 | 2018-05-18T09:02:36.000Z | 2019-12-29T10:27:44.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bacnetd import SingleBACnetdService
from bacnetd import BACnetdService
__all__ = [
SingleBACnetdService,
BACnetdService,
]
| 16.181818 | 40 | 0.752809 | 18 | 178 | 7.222222 | 0.722222 | 0.169231 | 0.261538 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006536 | 0.140449 | 178 | 10 | 41 | 17.8 | 0.843137 | 0.235955 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
17c67804477d49c14190bfb741a72b7035d9286c | 767 | py | Python | docs/source/renderers/chart_renderer_example.py | steveblamey/django-report-tools | e12fe737a372925c7ce4969ed6e754d51cd9853b | [
"BSD-2-Clause"
] | 33 | 2015-01-30T18:02:10.000Z | 2020-06-11T18:45:08.000Z | docs/source/renderers/chart_renderer_example.py | steveblamey/django-report-tools | e12fe737a372925c7ce4969ed6e754d51cd9853b | [
"BSD-2-Clause"
] | 4 | 2015-01-29T21:00:22.000Z | 2021-06-10T17:40:08.000Z | docs/source/renderers/chart_renderer_example.py | steveblamey/django-report-tools | e12fe737a372925c7ce4969ed6e754d51cd9853b | [
"BSD-2-Clause"
] | 14 | 2015-04-13T10:34:35.000Z | 2020-08-16T18:02:04.000Z | from report_tools.renderers import ChartRenderer
class MyChartRenderer(ChartRenderer):
@classmethod
def render_piechart(cls, chart_id, options, data, renderer_options):
return "<div id='%s' class='placeholder'>Pie Chart</div>" % chart_id
@classmethod
def render_columnchart(cls, chart_id, options, data, renderer_options):
return "<div id='%s' class='placeholder'>Column Chart</div>" % chart_id
@classmethod
def render_barchart(cls, chart_id, options, data, renderer_options):
return "<div id='%s' class='placeholder'>Bar Chart</div>" % chart_id
@classmethod
def render_linechart(cls, chart_id, options, data, renderer_options):
return "<div id='%s' class='placeholder'>Line Chart</div>" % chart_id | 40.368421 | 79 | 0.705346 | 97 | 767 | 5.402062 | 0.298969 | 0.10687 | 0.152672 | 0.129771 | 0.688931 | 0.688931 | 0.688931 | 0.48855 | 0.48855 | 0.48855 | 0 | 0 | 0.169492 | 767 | 19 | 80 | 40.368421 | 0.822606 | 0 | 0 | 0.285714 | 0 | 0 | 0.255208 | 0.125 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.285714 | 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 |
17c9aa0e7487d9e67e8f56273b862ff651c5d62b | 233 | py | Python | test/test_children_tree.py | kisliakovsky/structures | 19969470a7e9b150b077082cc8ca0c2fc9be279e | [
"MIT"
] | null | null | null | test/test_children_tree.py | kisliakovsky/structures | 19969470a7e9b150b077082cc8ca0c2fc9be279e | [
"MIT"
] | null | null | null | test/test_children_tree.py | kisliakovsky/structures | 19969470a7e9b150b077082cc8ca0c2fc9be279e | [
"MIT"
] | null | null | null | from unittest import TestCase
from src.tree import ChildrenTree
class TestChildrenTree(TestCase):
def test_height(self):
tree = ChildrenTree(1, [[], [3, 4], [], [], [0, 2]])
self.assertEqual(3, tree.height())
| 21.181818 | 60 | 0.639485 | 28 | 233 | 5.285714 | 0.678571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032432 | 0.206009 | 233 | 10 | 61 | 23.3 | 0.767568 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
17d0f29d3c45101f706a5d553869a8adc551e247 | 217 | py | Python | InformationSecurity/phone-number.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | InformationSecurity/phone-number.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | InformationSecurity/phone-number.py | eduardormonteiro/PythonPersonalLibrary | 561733bb8305c4e25a08f99c28b60ec77251ad67 | [
"MIT"
] | null | null | null | import phonenumbers
from phonenumbers import geocoder
phone = input('type phone number format(+551100000000): ')
phone_number = phonenumbers.parse(phone)
print(geocoder.description_for_number(phone_number, 'pt'))
| 21.7 | 58 | 0.801843 | 26 | 217 | 6.538462 | 0.576923 | 0.194118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061538 | 0.101382 | 217 | 9 | 59 | 24.111111 | 0.810256 | 0 | 0 | 0 | 0 | 0 | 0.199074 | 0.101852 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
aa2c05b3df99db71aa37cd2cc5fcd8d03b928ba5 | 628 | py | Python | katena_chain_sdk_py/serializer/bytes_field.py | katena-chain/sdk-py | 9e1344c6cf2b73680a39c533be58d668b172304f | [
"Apache-2.0"
] | null | null | null | katena_chain_sdk_py/serializer/bytes_field.py | katena-chain/sdk-py | 9e1344c6cf2b73680a39c533be58d668b172304f | [
"Apache-2.0"
] | null | null | null | katena_chain_sdk_py/serializer/bytes_field.py | katena-chain/sdk-py | 9e1344c6cf2b73680a39c533be58d668b172304f | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2019, TransChain.
This source code is licensed under the Apache 2.0 license found in the
LICENSE file in the root directory of this source tree.
"""
from marshmallow import fields
from base64 import b64encode, b64decode
class BytesField(fields.Field):
# BytesField allows to serialize and deserialize a bytes object.
def _serialize(self, value: bytes, attr, obj, **kwargs) -> str:
if value is None:
return ""
return b64encode(value).decode("utf-8")
def _deserialize(self, value: str, attr, data, **kwargs) -> bytes:
return b64decode(value.encode("utf-8"))
| 28.545455 | 70 | 0.691083 | 85 | 628 | 5.082353 | 0.647059 | 0.046296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03629 | 0.210191 | 628 | 21 | 71 | 29.904762 | 0.834677 | 0.355096 | 0 | 0 | 0 | 0 | 0.025189 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.888889 | 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 |
aa2fcb5d798f5d19c8f670fc3a91f498e60643c5 | 225 | py | Python | tests/engine/dice_test.py | slalom/slaloms-and-dragons | 3ae6a6ec3feb188d767983ab9277668baab18533 | [
"MIT"
] | 7 | 2019-03-28T15:56:21.000Z | 2021-11-08T09:02:05.000Z | tests/engine/dice_test.py | slalom/slaloms-and-dragons | 3ae6a6ec3feb188d767983ab9277668baab18533 | [
"MIT"
] | 2 | 2019-05-16T02:00:22.000Z | 2021-06-08T19:49:46.000Z | tests/engine/dice_test.py | slalom/slaloms-and-dragons | 3ae6a6ec3feb188d767983ab9277668baab18533 | [
"MIT"
] | 4 | 2019-04-02T17:49:30.000Z | 2019-04-04T00:38:54.000Z | import unittest
import game.engine.dice as dice
class DiceRollTest(unittest.TestCase):
def test_dice_roll(self):
roll = dice.roll()
self.assertGreaterEqual(roll, 1)
self.assertLessEqual(roll, 6)
| 22.5 | 40 | 0.697778 | 28 | 225 | 5.535714 | 0.607143 | 0.103226 | 0.154839 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011236 | 0.208889 | 225 | 9 | 41 | 25 | 0.859551 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
aa400985ee38a6b0cabe3da8dcfdcdcd42b9662d | 2,943 | py | Python | pyboretum/tree/list_tree.py | picwell/pyboretum | dd2af812ea2156ddec57aa252c79333f3bd81b0d | [
"MIT"
] | 1 | 2019-04-05T01:57:12.000Z | 2019-04-05T01:57:12.000Z | pyboretum/tree/list_tree.py | picwell/pyboretum | dd2af812ea2156ddec57aa252c79333f3bd81b0d | [
"MIT"
] | null | null | null | pyboretum/tree/list_tree.py | picwell/pyboretum | dd2af812ea2156ddec57aa252c79333f3bd81b0d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import math
from .base import (
Tree,
TreeIterator,
)
def _get_left_index(node_index):
return 2 * node_index + 1
def _get_right_index(node_index):
return 2 * node_index + 2
def _get_depth(node_index):
"""
The indices in depth d is
(# of nodes up to depths d - 1) <= indices <= (# of nodes up to depth d) - 1
where
(# of nodes up to depth d) = 2^(d + 1) - 1
:param node_index:
:return: int for depth
"""
return int(math.log(node_index + 1, 2))
class ListTree(Tree):
def __init__(self, node):
self._array = [node]
def get_root_id(self):
# Root is always the first entry in the list.
return 0
def get_iterator(self):
return _ListTreeIterator(self)
def _is_memory_allocated(self, node_id):
return node_id < len(self._array)
def _does_node_exist(self, node_id):
return (self._is_memory_allocated(node_id) and
self._array[node_id] is not None)
def get_node(self, node_id):
if self._does_node_exist(node_id):
return self._array[node_id], _get_depth(node_id)
else:
return None, None
def get_children_ids(self, node_id):
right_id = _get_right_index(node_id)
if self._does_node_exist(right_id):
return _get_left_index(node_id), right_id
else:
return None, None
def insert_children(self, node_id, left_node, right_node):
assert self._does_node_exist(node_id), 'Node {} does not exist.'.format(node_id)
left_id, right_id = _get_left_index(node_id), _get_right_index(node_id)
assert not self._does_node_exist(left_id) and not self._does_node_exist(right_id), \
'Children nodes of {} already exist.'.format(node_id)
if not self._is_memory_allocated(right_id):
self._array += [None] * (right_id - len(self._array) + 1)
self._array[left_id] = left_node
self._array[right_id] = right_node
return left_id, right_id
class _ListTreeIterator(TreeIterator):
def __init__(self, tree, index=0):
# This assumes that the Tree is not updating during traversal.
self._tree = tree
self._index = index
def left_child(self):
left_index = _get_left_index(self._index)
assert self._tree._does_node_exist(left_index), 'This is a leaf node.'
self._index = left_index
def right_child(self):
right_index = _get_right_index(self._index)
assert self._tree._does_node_exist(right_index), 'This is a leaf node.'
self._index = right_index
def is_leaf(self):
left_id = _get_left_index(self._index)
return not self._tree._does_node_exist(left_id)
def get_node(self):
return self._tree._array[self._index], _get_depth(self._index)
def get_id(self):
return self._index | 28.298077 | 92 | 0.650357 | 431 | 2,943 | 4.048724 | 0.167053 | 0.061891 | 0.067049 | 0.048711 | 0.31404 | 0.260745 | 0.143266 | 0.080229 | 0.046991 | 0 | 0 | 0.006404 | 0.257221 | 2,943 | 104 | 93 | 28.298077 | 0.791857 | 0.104995 | 0 | 0.0625 | 0 | 0 | 0.037721 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 1 | 0.265625 | false | 0 | 0.046875 | 0.125 | 0.578125 | 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 |
aa47d21c6ff69f1572502674f4acbedbda768571 | 2,371 | py | Python | ex1/gerador.py | renzon/oo-inpe | 1b33939974f998badbeebd7bfe182070e77ef98f | [
"MIT"
] | null | null | null | ex1/gerador.py | renzon/oo-inpe | 1b33939974f998badbeebd7bfe182070e77ef98f | [
"MIT"
] | null | null | null | ex1/gerador.py | renzon/oo-inpe | 1b33939974f998badbeebd7bfe182070e77ef98f | [
"MIT"
] | null | null | null | from random import randint
from ex1.evento import Evento
class Gerador():
def __init__(self, msg):
self.msg = msg
def gerar_evento(self, tempo):
"""
Método que gera evento levando em conta tempo de execução.
:return: Instancia de Evento ou Nulo se não for para gerar envento
"""
raise NotImplementedError()
class GeradorDecorator(Gerador):
def __init__(self, msg, gerador, despachador):
super().__init__(msg)
self._despachador = despachador
self._gerador = gerador
def gerar_evento(self, tempo):
evento = self._gerador.gerar_evento(tempo)
if evento:
self._despachador.despachar(evento)
class TempoEstrategia():
def deve_gerar_evento(self, tempo):
"""
Método abstrato que returna verdadeiro se evento deve ser gerado e falso caso contrário
:return: bool
"""
raise NotImplementedError('Deve definir estratégia de tempo')
class Tempo5Segundos(TempoEstrategia):
def deve_gerar_evento(self, tempo):
return tempo % 5 == 0
class TempoAleatorio(TempoEstrategia):
def __init__(self):
self._proximo_tempo = randint(1, 10)
def deve_gerar_evento(self, tempo):
flag = self._proximo_tempo <= tempo
if flag:
self._proximo_tempo += randint(1, 10)
return flag
class TransformadorString():
def transformar(self, s, tempo):
"""
Recebe string e transforma de acordo com estratégia
:param s: string a ser transformada
:param tempo: Tempo que string foi transformada
:return: string transformada
"""
raise NotImplementedError('Deve ser implementado')
class TransformadorNulo(TransformadorString):
def transformar(self, s, tempo):
return s
class TransformadorComTempo(TransformadorString):
def transformar(self, s, tempo):
return '{}. Tempo={}'.format(s, tempo)
class GeradorBridge(Gerador):
def __init__(self, msg, tempo_strategia, transformador):
super().__init__(msg)
self._transformador = transformador
self._tempo_strategia = tempo_strategia
def gerar_evento(self, tempo):
if self._tempo_strategia.deve_gerar_evento(tempo):
s = self._transformador.transformar(self.msg, tempo)
return Evento(s)
| 27.569767 | 95 | 0.660059 | 262 | 2,371 | 5.767176 | 0.301527 | 0.05824 | 0.059563 | 0.079418 | 0.296492 | 0.201191 | 0.12045 | 0 | 0 | 0 | 0 | 0.005666 | 0.255588 | 2,371 | 85 | 96 | 27.894118 | 0.850425 | 0.165331 | 0 | 0.229167 | 0 | 0 | 0.034778 | 0 | 0 | 0 | 0 | 0.023529 | 0 | 1 | 0.270833 | false | 0 | 0.041667 | 0.0625 | 0.604167 | 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 |
a4ba8f00534df85c91df0dc9eef6fe48f92deb79 | 3,777 | py | Python | qcloudsdkvod/ApplyUploadRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkvod/ApplyUploadRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | qcloudsdkvod/ApplyUploadRequest.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from qcloudsdkcore.request import Request
class ApplyUploadRequest(Request):
def __init__(self):
super(ApplyUploadRequest, self).__init__(
'vod', 'qcloudcliV1', 'ApplyUpload', 'vod.api.qcloud.com')
def get_SubAppId(self):
return self.get_params().get('SubAppId')
def set_SubAppId(self, SubAppId):
self.add_param('SubAppId', SubAppId)
def get_classId(self):
return self.get_params().get('classId')
def set_classId(self, classId):
self.add_param('classId', classId)
def get_coverName(self):
return self.get_params().get('coverName')
def set_coverName(self, coverName):
self.add_param('coverName', coverName)
def get_coverSize(self):
return self.get_params().get('coverSize')
def set_coverSize(self, coverSize):
self.add_param('coverSize', coverSize)
def get_coverType(self):
return self.get_params().get('coverType')
def set_coverType(self, coverType):
self.add_param('coverType', coverType)
def get_expireTime(self):
return self.get_params().get('expireTime')
def set_expireTime(self, expireTime):
self.add_param('expireTime', expireTime)
def get_isCdnPusher(self):
return self.get_params().get('isCdnPusher')
def set_isCdnPusher(self, isCdnPusher):
self.add_param('isCdnPusher', isCdnPusher)
def get_isScreenshot(self):
return self.get_params().get('isScreenshot')
def set_isScreenshot(self, isScreenshot):
self.add_param('isScreenshot', isScreenshot)
def get_isTranscode(self):
return self.get_params().get('isTranscode')
def set_isTranscode(self, isTranscode):
self.add_param('isTranscode', isTranscode)
def get_isWatermark(self):
return self.get_params().get('isWatermark')
def set_isWatermark(self, isWatermark):
self.add_param('isWatermark', isWatermark)
def get_procedure(self):
return self.get_params().get('procedure')
def set_procedure(self, procedure):
self.add_param('procedure', procedure)
def get_procedure(self):
return self.get_params().get('procedure')
def set_procedure(self, procedure):
self.add_param('procedure', procedure)
def get_sourceContext(self):
return self.get_params().get('sourceContext')
def set_sourceContext(self, sourceContext):
self.add_param('sourceContext', sourceContext)
def get_storageRegion(self):
return self.get_params().get('storageRegion')
def set_storageRegion(self, storageRegion):
self.add_param('storageRegion', storageRegion)
def get_videoFileId(self):
return self.get_params().get('videoFileId')
def set_videoFileId(self, videoFileId):
self.add_param('videoFileId', videoFileId)
def get_videoName(self):
return self.get_params().get('videoName')
def set_videoName(self, videoName):
self.add_param('videoName', videoName)
def get_videoSize(self):
return self.get_params().get('videoSize')
def set_videoSize(self, videoSize):
self.add_param('videoSize', videoSize)
def get_videoStoragePath(self):
return self.get_params().get('videoStoragePath')
def set_videoStoragePath(self, videoStoragePath):
self.add_param('videoStoragePath', videoStoragePath)
def get_videoType(self):
return self.get_params().get('videoType')
def set_videoType(self, videoType):
self.add_param('videoType', videoType)
def get_vodSessionKey(self):
return self.get_params().get('vodSessionKey')
def set_vodSessionKey(self, vodSessionKey):
self.add_param('vodSessionKey', vodSessionKey)
| 29.053846 | 70 | 0.681758 | 425 | 3,777 | 5.851765 | 0.103529 | 0.048251 | 0.112585 | 0.136711 | 0.277443 | 0.277443 | 0.089264 | 0.089264 | 0.089264 | 0.089264 | 0 | 0.00066 | 0.197511 | 3,777 | 129 | 71 | 29.27907 | 0.819861 | 0.00556 | 0 | 0.094118 | 0 | 0 | 0.12227 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.482353 | false | 0 | 0.011765 | 0.235294 | 0.741176 | 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 |
a4d968f989a285cf96c27baed01da6b65175ba59 | 615 | py | Python | core/views.py | koshasrepus/app_my_place | 8be9e9062247c177375162b943fb842752807553 | [
"Unlicense"
] | null | null | null | core/views.py | koshasrepus/app_my_place | 8be9e9062247c177375162b943fb842752807553 | [
"Unlicense"
] | null | null | null | core/views.py | koshasrepus/app_my_place | 8be9e9062247c177375162b943fb842752807553 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render
from django.http import JsonResponse
from django.views import View
from core.handlers.dispatcher import process_telegram_event
from app_my_places.settings import TELEGRAM_TOKEN
import json
# Create your views here.
def index(request):
return JsonResponse({"error": "forbidden"})
class TelegramBotWebhookView(View):
def post(self, request, *args, **kwargs):
process_telegram_event(json.loads(request.body))
return JsonResponse({"post": "work!"})
def get(self, request, *args, **kwargs):
return JsonResponse({"ok": "Get response work!"})
| 26.73913 | 59 | 0.734959 | 76 | 615 | 5.855263 | 0.552632 | 0.067416 | 0.089888 | 0.094382 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156098 | 615 | 22 | 60 | 27.954545 | 0.857418 | 0.037398 | 0 | 0 | 0 | 0 | 0.073129 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.428571 | 0.142857 | 0.928571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 3 |
a4ea3d61587577e8897b867e636a3cccaeb49674 | 1,657 | py | Python | abstract_model.py | mandt-lab/adversarial-negative-sampling | a71a9bd8e814b132ec094bd2c5d080edcb1bccad | [
"MIT"
] | 15 | 2020-03-27T20:48:07.000Z | 2022-01-21T09:47:14.000Z | abstract_model.py | mandt-lab/adversarial-negative-sampling | a71a9bd8e814b132ec094bd2c5d080edcb1bccad | [
"MIT"
] | 1 | 2020-11-13T16:04:56.000Z | 2020-11-13T16:04:56.000Z | abstract_model.py | mandt-lab/adversarial-negative-sampling | a71a9bd8e814b132ec094bd2c5d080edcb1bccad | [
"MIT"
] | 4 | 2020-02-23T02:21:45.000Z | 2020-09-29T03:07:54.000Z | import sys
import abc
import tensorflow as tf
import numpy as np
import optimizer
class AbstractModel(abc.ABC):
'''Abstract base class for knowledge graph embedding models.
You won't usually want to derive directly from this class. In most cases, you'll
want to derive from either `AbstractMainModel` or from `AbstractAuxModel`.
'''
@abc.abstractmethod
def unnormalized_score(self, emb_in_e, emb_r, emb_all_e, args):
'''Define a tensorflow op that calculates the prediction scores (logits).
This is also sometimes called `logits`.
Arguments:
emb_in_e -- Embedding vectors of the input entities, i.e., the entities on which
we condition. A dict that maps labels (strings) to tensors of shape
`(minibatch_size, num_samples, embedding_dimensions...)`.
emb_r -- Embedding vectors of the relations. If reciprocal relations are used
then the caller should pass in different embedding vectors for head or tail
prediction. A dict that maps labels (strings) to tensors of shape
`(minibatch_size, num_samples, embedding_dimensions...)`.
emb_all_e -- Embedding vectors of all entities. A dict that maps labels (strings)
to tensors of shape `(range_e, num_samples, embedding_dimensions...)`.
args -- Namespace holding command line arguments.
Returns:
A tensor of shape `(num_samples, minibatch_size, range_e)` that holds the
unnormalized represents the negative log likelihood of the data.
Should *not* be normalized to the batch size or sample size.
'''
pass
| 40.414634 | 89 | 0.689801 | 223 | 1,657 | 5.022422 | 0.493274 | 0.057143 | 0.048214 | 0.034821 | 0.192857 | 0.192857 | 0.192857 | 0.192857 | 0.192857 | 0.192857 | 0 | 0 | 0.246228 | 1,657 | 40 | 90 | 41.425 | 0.896717 | 0.76041 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.111111 | 0.555556 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
a4fa0f6854a007037641edd2c76faef321c93748 | 413 | py | Python | danceschool/stats/cms_apps.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 1 | 2019-02-04T02:11:32.000Z | 2019-02-04T02:11:32.000Z | danceschool/stats/cms_apps.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 2 | 2019-03-26T22:37:49.000Z | 2019-12-02T15:39:35.000Z | danceschool/stats/cms_apps.py | benjwrdill/django-danceschool | 9ecb2754502e62d0f49aa23d08ca6de6cae3c99a | [
"BSD-3-Clause"
] | 1 | 2019-03-19T22:49:01.000Z | 2019-03-19T22:49:01.000Z | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class StatsApphook(CMSApp):
name = _("Stats Apphook")
def get_urls(self, page=None, language=None, **kwargs):
return ["danceschool.stats.urls"] # replace this with the path to your application's URLs module
apphook_pool.register(StatsApphook)
| 29.5 | 111 | 0.728814 | 55 | 413 | 5.327273 | 0.709091 | 0.112628 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.191283 | 413 | 13 | 112 | 31.769231 | 0.877246 | 0.145278 | 0 | 0 | 0 | 0 | 0.10355 | 0.065089 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.375 | 0.125 | 0.875 | 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 |
35238db428c720694c3ee3ace0a023636d8019be | 539 | py | Python | tests/thalesians/filtering/algs/test_kalman.py | thalesians/bayestsa | d54ea04ffa9903473b11c906545e95b2666afb88 | [
"Apache-2.0"
] | 18 | 2017-03-07T19:13:18.000Z | 2021-01-05T00:35:30.000Z | tests/thalesians/filtering/algs/test_kalman.py | HanMeh/bayestsa | d54ea04ffa9903473b11c906545e95b2666afb88 | [
"Apache-2.0"
] | null | null | null | tests/thalesians/filtering/algs/test_kalman.py | HanMeh/bayestsa | d54ea04ffa9903473b11c906545e95b2666afb88 | [
"Apache-2.0"
] | 14 | 2016-12-27T00:09:40.000Z | 2020-12-27T19:23:53.000Z | import datetime
import unittest
class KalmanFilterTest(unittest.TestCase):
def test_kalman_filter_with_prior_predict(self):
t0 = datetime.datetime(2014, 2, 12, 16, 18, 25, 204000)
print(t0)
self.assertEqual(1., 1.)
def test_kalman_filter_without_prior_predict(self):
pass
def test_kalman_filter_with_low_variance_observation(self):
pass
def test_kalman_filter_multidim(self):
pass
if __name__ == '__main__':
unittest.main()
| 23.434783 | 63 | 0.64564 | 63 | 539 | 5.095238 | 0.539683 | 0.087227 | 0.161994 | 0.23676 | 0.252336 | 0.168224 | 0 | 0 | 0 | 0 | 0 | 0.058974 | 0.276438 | 539 | 23 | 64 | 23.434783 | 0.764103 | 0 | 0 | 0.2 | 0 | 0 | 0.014815 | 0 | 0 | 0 | 0 | 0 | 0.066667 | 1 | 0.266667 | false | 0.2 | 0.133333 | 0 | 0.466667 | 0.066667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
35276376126b8d62c338db73e2e88ec964f2ee31 | 147 | py | Python | fetch_embed/__init__.py | ffreemt/fetch-embed | 95b97806d2becd3606989dd270c90453433b8546 | [
"MIT"
] | null | null | null | fetch_embed/__init__.py | ffreemt/fetch-embed | 95b97806d2becd3606989dd270c90453433b8546 | [
"MIT"
] | null | null | null | fetch_embed/__init__.py | ffreemt/fetch-embed | 95b97806d2becd3606989dd270c90453433b8546 | [
"MIT"
] | null | null | null | __version__ = "0.1.6"
from .fetch_embed import fetch_embed
from .embed_text import embed_text
__all__ = (
"fetch_embed",
"embed_text",
)
| 14.7 | 36 | 0.707483 | 21 | 147 | 4.285714 | 0.47619 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0.183673 | 147 | 9 | 37 | 16.333333 | 0.725 | 0 | 0 | 0 | 0 | 0 | 0.176871 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 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 |
3533347e3f6dd109c1cd29acee7a5024f75c5d7b | 329 | py | Python | data_sets/config.py | davidp94/data-sets | 5db986de4ff0e2656cce142541a46e66ca6f02db | [
"MIT"
] | null | null | null | data_sets/config.py | davidp94/data-sets | 5db986de4ff0e2656cce142541a46e66ca6f02db | [
"MIT"
] | null | null | null | data_sets/config.py | davidp94/data-sets | 5db986de4ff0e2656cce142541a46e66ca6f02db | [
"MIT"
] | null | null | null | """Definition and configuration of data sets"""
import functools
from data_sets import data_set
@functools.lru_cache(maxsize=None)
def data_sets() -> ['data_set.DataSet']:
"""All available data sets"""
return []
def charts_color() -> str:
"""The color (rgb hex code) to be used in charts"""
return '#008000' | 20.5625 | 55 | 0.680851 | 46 | 329 | 4.73913 | 0.673913 | 0.146789 | 0.12844 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022305 | 0.182371 | 329 | 16 | 56 | 20.5625 | 0.788104 | 0.337386 | 0 | 0 | 0 | 0 | 0.1133 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | true | 0 | 0.285714 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
35481960fa84aa0d7d74f4ec46b633eb060d28fb | 1,282 | py | Python | easy/836-Rectangle Overlap.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | 2 | 2020-05-08T02:17:17.000Z | 2020-05-17T04:55:56.000Z | easy/836-Rectangle Overlap.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | null | null | null | easy/836-Rectangle Overlap.py | Davidxswang/leetcode | d554b7f5228f14c646f726ddb91014a612673e06 | [
"Apache-2.0"
] | null | null | null | """
https://leetcode.com/problems/rectangle-overlap/
A rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) are the coordinates of its bottom-left corner, and (x2, y2) are the coordinates of its top-right corner.
Two rectangles overlap if the area of their intersection is positive. To be clear, two rectangles that only touch at the corner or edges do not overlap.
Given two (axis-aligned) rectangles, return whether they overlap.
Example 1:
Input: rec1 = [0,0,2,2], rec2 = [1,1,3,3]
Output: true
Example 2:
Input: rec1 = [0,0,1,1], rec2 = [1,0,2,1]
Output: false
Notes:
Both rectangles rec1 and rec2 are lists of 4 integers.
All coordinates in rectangles will be between -10^9 and 10^9.
"""
# time complexity: O(1), space complexity: O(1)
# The two solutions are both interesting.
class Solution:
def isRectangleOverlap(self, rec1: List[int], rec2: List[int]) -> bool:
# solution 1
# return not (rec1[0] >= rec2[2] or rec1[2] <= rec2[0] or rec1[1] >= rec2[3] or rec1[3] <= rec2[1])
# solution 2
def intersect(p_left, p_right, q_left, q_right):
return min(p_right, q_right) > max(q_left, p_left)
return intersect(rec1[0], rec1[2], rec2[0], rec2[2]) and intersect(rec1[1], rec1[3], rec2[1], rec2[3]) | 35.611111 | 174 | 0.675507 | 220 | 1,282 | 3.9 | 0.413636 | 0.02331 | 0.039627 | 0.044289 | 0.051282 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074468 | 0.193448 | 1,282 | 36 | 175 | 35.611111 | 0.755319 | 0.712168 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.2 | 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 |
1024a19ea737a54eb4b1646afd282457a464d5aa | 1,027 | py | Python | src/query_planner/storage_plan.py | alilakda/Eva | e3d447f81e1e47172e21758c059ad6f5ee21ffa4 | [
"Apache-2.0"
] | null | null | null | src/query_planner/storage_plan.py | alilakda/Eva | e3d447f81e1e47172e21758c059ad6f5ee21ffa4 | [
"Apache-2.0"
] | null | null | null | src/query_planner/storage_plan.py | alilakda/Eva | e3d447f81e1e47172e21758c059ad6f5ee21ffa4 | [
"Apache-2.0"
] | 1 | 2020-02-19T02:11:39.000Z | 2020-02-19T02:11:39.000Z | from src.models.catalog.video_info import VideoMetaInfo
from src.query_planner.abstract_plan import AbstractPlan
from src.query_planner.types import PlanNodeType
class StoragePlan(AbstractPlan):
"""
This is the plan used for retrieving the frames from the storage and
and returning to the higher levels.
"""
def __init__(self, video: VideoMetaInfo, batch_size: int = 1,
skip_frames: int = 0, offset: int = None, limit: int = None):
super().__init__(PlanNodeType.STORAGE_PLAN)
self._video = video
self._batch_size = batch_size
self._skip_frames = skip_frames
self._offset = offset
self._limit = limit
@property
def video(self):
return self._video
@property
def batch_size(self):
return self._batch_size
@property
def skip_frames(self):
return self._skip_frames
@property
def offset(self):
return self._offset
@property
def limit(self):
return self._limit
| 25.675 | 78 | 0.665044 | 127 | 1,027 | 5.11811 | 0.354331 | 0.069231 | 0.107692 | 0.058462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002639 | 0.261928 | 1,027 | 39 | 79 | 26.333333 | 0.854881 | 0.101266 | 0 | 0.185185 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.111111 | 0.185185 | 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 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
102d40488d0cca4d36fca9f9b896d9f118df7173 | 393 | py | Python | 4/state/ResultState.py | ytyaru/Pygame.GameState.201707251432 | c2a67c9f0c6ff9ee5c495be02d8c775b897f16d2 | [
"CC0-1.0"
] | null | null | null | 4/state/ResultState.py | ytyaru/Pygame.GameState.201707251432 | c2a67c9f0c6ff9ee5c495be02d8c775b897f16d2 | [
"CC0-1.0"
] | null | null | null | 4/state/ResultState.py | ytyaru/Pygame.GameState.201707251432 | c2a67c9f0c6ff9ee5c495be02d8c775b897f16d2 | [
"CC0-1.0"
] | null | null | null | import pygame
from pygame.locals import *
from .GameState import GameState
class ResultState(GameState):
def __init__(self, stateSwitcher): super().__init__(stateSwitcher)
def Event(self, event):
if event.type == KEYDOWN:
if event.key == K_RETURN or event.key == K_SPACE or event.key == K_z: self.Switcher.Next()
def Draw(self, screen): screen.fill((0,0,255))
| 35.727273 | 102 | 0.692112 | 55 | 393 | 4.745455 | 0.527273 | 0.091954 | 0.103448 | 0.084291 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015625 | 0.185751 | 393 | 10 | 103 | 39.3 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.333333 | 0 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
10318f66a573c70a9037cd72320a499bd6bc01f7 | 1,129 | py | Python | setup.py | iomintz/sql-remove-comma | 503bb90c1fd3346ea783ef826247a5e44dc7c743 | [
"BSD-2-Clause-Patent"
] | null | null | null | setup.py | iomintz/sql-remove-comma | 503bb90c1fd3346ea783ef826247a5e44dc7c743 | [
"BSD-2-Clause-Patent"
] | null | null | null | setup.py | iomintz/sql-remove-comma | 503bb90c1fd3346ea783ef826247a5e44dc7c743 | [
"BSD-2-Clause-Patent"
] | null | null | null | #!/usr/bin/env python3
import setuptools
setuptools.setup(
name='sql-remove-comma',
description='remove illegal trailing commas from your SQL code',
use_scm_version=True,
author='Io Mintz',
author_email='io@mintz.cc',
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
license='BSD-2-Clause-Patent',
packages=['sql_remove_comma'],
setup_requires=['setuptools_scm'],
install_requires=['sqlparse>=0.3.0,<0.4.0'],
extras_require={
'test': [
'pytest',
'pytest-cov',
],
},
entry_points={
'console_scripts': [
'sql-remove-comma = sql_remove_comma.__main__:main',
],
},
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Database',
'Topic :: Software Development :: Pre-processors',
'Topic :: Utilities',
],
)
| 26.255814 | 65 | 0.672276 | 136 | 1,129 | 5.426471 | 0.573529 | 0.180217 | 0.237127 | 0.246612 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022869 | 0.147919 | 1,129 | 42 | 66 | 26.880952 | 0.744283 | 0.018601 | 0 | 0.076923 | 0 | 0 | 0.597109 | 0.046974 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.025641 | 0 | 0.025641 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
10387d5bca747ed2fb01a238f98496c602127cb4 | 293 | py | Python | remotelogin/oper_sys/busybox/__init__.py | filintod/pyremotelogin | e2a4df7fd69d21eccdf1aec55c33a839de9157f1 | [
"MIT"
] | 1 | 2018-11-20T17:45:20.000Z | 2018-11-20T17:45:20.000Z | remotelogin/oper_sys/busybox/__init__.py | filintod/pyremotelogin | e2a4df7fd69d21eccdf1aec55c33a839de9157f1 | [
"MIT"
] | 3 | 2018-10-16T18:07:50.000Z | 2018-10-16T18:10:06.000Z | remotelogin/oper_sys/busybox/__init__.py | filintod/pyremotelogin | e2a4df7fd69d21eccdf1aec55c33a839de9157f1 | [
"MIT"
] | null | null | null | from . import shellcommands
from ..linux import LinuxOS
__author__ = 'Filinto Duran (duranto@gmail.com)'
# TODO: break unix/linux to a bare and expand from there
class BusyBoxOS(LinuxOS):
"""
Embedded Linux device
"""
name = 'busybox'
cmd = shellcommands.get_instance()
| 20.928571 | 56 | 0.696246 | 36 | 293 | 5.527778 | 0.805556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.204778 | 293 | 13 | 57 | 22.538462 | 0.854077 | 0.262799 | 0 | 0 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0.076923 | 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 | 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 |
1039b022c5fb3fa4258162d12d3e7a230a204279 | 282 | py | Python | 2. Conditional and Repetitive Execution/2.2. Even or Odd.py | ahmetutkuozkan/my_ceng240_exercises_solutions | 167bb9938515870ec1f01853933edc3b55937bff | [
"MIT"
] | null | null | null | 2. Conditional and Repetitive Execution/2.2. Even or Odd.py | ahmetutkuozkan/my_ceng240_exercises_solutions | 167bb9938515870ec1f01853933edc3b55937bff | [
"MIT"
] | null | null | null | 2. Conditional and Repetitive Execution/2.2. Even or Odd.py | ahmetutkuozkan/my_ceng240_exercises_solutions | 167bb9938515870ec1f01853933edc3b55937bff | [
"MIT"
] | null | null | null | value1 = int(input()); value2 = value1//100
if value1 % 2==0 and value2 % 2==0:
print("Even")
elif value1 % 2==0 and value2 % 2==1:
print("Even Odd")
elif value1 % 2==1 and value2 % 2==1:
print("Odd")
elif value1 % 2==1 and value2 % 2==0:
print("Odd Even")
| 28.2 | 44 | 0.567376 | 48 | 282 | 3.333333 | 0.291667 | 0.175 | 0.25 | 0.1375 | 0.6875 | 0.5375 | 0.3125 | 0.3125 | 0 | 0 | 0 | 0.140845 | 0.244681 | 282 | 9 | 45 | 31.333333 | 0.610329 | 0 | 0 | 0 | 0 | 0 | 0.084249 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.444444 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
103c0a4ba3c0768fdcf0d8428f050d11782bc6b9 | 511 | py | Python | serendipity/set_and_map/singly_linked_list_set.py | globotree/serendipity | 8380635a4760a5393330460bb625834ffe02967c | [
"Unlicense"
] | 3 | 2019-03-12T10:00:53.000Z | 2019-05-29T10:40:28.000Z | serendipity/set_and_map/singly_linked_list_set.py | globotree/serendipity | 8380635a4760a5393330460bb625834ffe02967c | [
"Unlicense"
] | 12 | 2018-12-17T13:31:19.000Z | 2019-02-13T10:25:01.000Z | serendipity/set_and_map/singly_linked_list_set.py | globotree/serendipity | 8380635a4760a5393330460bb625834ffe02967c | [
"Unlicense"
] | 1 | 2020-01-24T00:48:57.000Z | 2020-01-24T00:48:57.000Z | from serendipity.linear_structures.singly_linked_list import LinkedList
class Set:
def __init__(self):
self._list = LinkedList()
def get_size(self):
return self._list.get_size()
def is_empty(self):
return self._list.is_empty()
def contains(self, e):
return self._list.contains(e)
def add(self, e):
if not self._list.contains(e):
self._list.add_first(e)
# def remove(self, e):
# """借助于链表的移出元素实现即可,此处不实现"""
# pass
| 21.291667 | 71 | 0.614481 | 66 | 511 | 4.484848 | 0.439394 | 0.162162 | 0.141892 | 0.121622 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.270059 | 511 | 23 | 72 | 22.217391 | 0.793566 | 0.117417 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.384615 | false | 0 | 0.076923 | 0.230769 | 0.769231 | 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 |
10425f3043aed2d9ee265e0c0950ea8c8e237a9e | 6,374 | py | Python | src/py_dss_tools/secondary/Circuit.py | eniovianna/py_dss_tools | 3057fb0b74facd05a362e4e4a588f79f70aa9dd7 | [
"MIT"
] | 3 | 2021-05-29T00:40:10.000Z | 2021-09-30T17:56:14.000Z | src/py_dss_tools/secondary/Circuit.py | eniovianna/py_dss_tools | 3057fb0b74facd05a362e4e4a588f79f70aa9dd7 | [
"MIT"
] | null | null | null | src/py_dss_tools/secondary/Circuit.py | eniovianna/py_dss_tools | 3057fb0b74facd05a362e4e4a588f79f70aa9dd7 | [
"MIT"
] | 3 | 2021-05-29T00:40:46.000Z | 2022-01-13T22:04:49.000Z | # -*- encoding: utf-8 -*-
"""
Created by Ênio Viana at 01/09/2021 at 19:51:44
Project: py_dss_tools [set, 2021]
"""
import attr
import pandas as pd
from py_dss_tools.model.other import VSource
from py_dss_tools.utils import Utils
@attr.s
class Circuit(VSource):
_name = attr.ib(validator=attr.validators.instance_of(str), default='')
_basekv = attr.ib(validator=attr.validators.instance_of((int, float)), default=115)
_pu = attr.ib(validator=attr.validators.instance_of((int, float)), default=1.001)
_phases = attr.ib(validator=attr.validators.instance_of(int), default=3)
_bus1 = attr.ib(validator=attr.validators.instance_of(str), default='')
_angle = attr.ib(validator=attr.validators.instance_of((int, float)), default=0)
# TODO Rever default values
_mvasc3 = attr.ib(validator=attr.validators.instance_of((int, float)), default=21000)
_mvasc1 = attr.ib(validator=attr.validators.instance_of((int, float)), default=24000)
# TODO: checar existência de mais de um Circuit no momento da criação
def __attrs_post_init__(self):
if self._name != '':
self._name = Utils.remove_blank_spaces(self._name)
else:
self._name = 'my_circuit_' + Utils.generate_random_string()
def to_dataframe(self):
return pd.DataFrame.from_records([self.__dict__])
def to_dict(self) -> dict:
return self.__dict__
def to_list(self) -> list:
return list(self.__dict__)
@property
def name(self) -> str:
return self._name
@name.setter
def name(self, value: str) -> None:
Utils.check_instance(value, 'name', ['str'], )
self._name = Utils.remove_blank_spaces(value)
@property
def basekv(self):
return self._basekv
@basekv.setter
def basekv(self, value):
self._basekv = value
@property
def phases(self):
return self._phases
@phases.setter
def phases(self, value):
self._phases = value
# @property
# def df_lines(self):
# return self._df_lines
# @df_lines.setter
# def df_lines(self, value):
# a_series = pd.Series(value, index=self._df_lines.columns)
# self._df_lines = self._df_lines.append(a_series, ignore_index=True)
# def create_circuit(self, dss_file):
# self.dss.text("compile [{}]".format(dss_file))
#
# def get_all_buses(self):
# buses = Bus(self.dss)
# return buses.get_buses()
# def get_all_lines(self):
# self.dss.lines_first()
# while self.dss.lines_next() != 0:
# print(self.dss.lines_read_phases())
# print(self.dss.lines_read_units())
#
# def reset(self):
# """
# Resets all Monitors, Energymeters, etc. If no argument specified, resets all options listed.
# :return:
# """
# self.dss.text("reset")
#
# def sample(self):
# """
# Force all monitors and meters to take a sample for the most recent solution. Keep in mind that meters will
# perform integration.
# :return:
# """
# self.dss.text("sample")
#
# def seq_currents(self):
# """
# Returns the sequence currents into all terminals of the active circuit element (see Select command) in Result
# string. Returned as comma-separated magnitude only values.Order of returned values: 0, 1, 2 (for each
# terminal).
# :return:
# """
# aux = self.dss.text("seqcurrents").strip().replace(" ", "").split(sep=",")
# seq_currents = list()
# for n in range(len(aux)):
# if aux[n] != '':
# seq_currents.append(float(aux[n]))
# return seq_currents
#
# def seq_powers(self):
# """
# Returns the sequence powers into all terminals of the active circuit element (see Select command) in Result
# string. Returned as comma-separated kw, kvar pairs.Order of returned values: 0, 1, 2 (for each terminal).
# :return:
# """
# aux = self.dss.text("seqpowers").strip().replace(" ", "").split(sep=",")
# seq_powers = list()
# for n in range(len(aux)):
# if aux[n] != '':
# seq_powers.append(float(aux[n]))
# return seq_powers
#
# def seq_voltages(self):
# """
# Returns the sequence voltages at all terminals of the active circuit element (see Select command) in Result
# string. Returned as comma-separated magnitude only values.Order of returned values: 0, 1, 2 (for each
# terminal).
# :return:
# """
# aux = self.dss.text("seqvoltages").strip().replace(" ", "").split(sep=",")
# seq_voltages = list()
# for n in range(len(aux)):
# if aux[n] != '':
# seq_voltages.append(float(aux[n]))
# return seq_voltages
#
# def get_voltages(self):
# return self.dss.circuit_allbusvmagpu()
#
# def get_voltage_min(self):
# v = Circuit.get_voltages(self.dss)
# return min(v)
#
# def get_voltage_max(self):
# v = Circuit.get_voltages(self.dss)
# return max(v)
#
# def get_active_power(self):
# return self.dss.circuit_total_power()[0]
#
# def get_reactive_power(self):
# return self.dss.circuit_total_power()[1]
#
# def create_load(self, **kwargs):
# pass
#
# def create_transformer(self, **kwargs):
# pass
#
# def create_line_code(self, **kwargs):
# pass
#
# def create_line(self, **kwargs):
# pass
#
# def create_pv_system(self, **kwargs):
# pass
#
# def create_fuse(self, **kwargs):
# pass
"""
new circuit.5Leg
~ bus1=MainBus basekV=230 pu=1.0 isc3=15000 isc1=17000 phases=3 z0=[10, 10] z1=[10, 10] angle=0 mvasc3=200000
mvasc1=200000
"""
# def _str_(self):
# output = ""
# for _, var in vars(self).items():
# output += str(var)
# return output
# def _str_(self):
# return "".join(
# f"{attrib_name} = {attrib_value}\n"
# for attrib_name, attrib_value in self._dict_.items()
# if '_Circuit_df' not in attrib_name and 'dss' not in attrib_name
# )
| 32.191919 | 119 | 0.588798 | 797 | 6,374 | 4.53074 | 0.272271 | 0.032955 | 0.033232 | 0.042094 | 0.425367 | 0.368873 | 0.317364 | 0.317364 | 0.264193 | 0.237053 | 0 | 0.021304 | 0.278318 | 6,374 | 197 | 120 | 32.35533 | 0.763696 | 0.578287 | 0 | 0.068182 | 0 | 0 | 0.007525 | 0 | 0 | 0 | 0 | 0.005076 | 0 | 1 | 0.227273 | false | 0 | 0.090909 | 0.136364 | 0.659091 | 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 |
104fe8a69a8815914b9402756fc0c531d5a4a9ad | 846 | py | Python | code/GC_mass_evolv.py | EnthalpyBill/GC-formation | 143a8cb464bd621e77092a010c9011ef056da400 | [
"MIT"
] | null | null | null | code/GC_mass_evolv.py | EnthalpyBill/GC-formation | 143a8cb464bd621e77092a010c9011ef056da400 | [
"MIT"
] | null | null | null | code/GC_mass_evolv.py | EnthalpyBill/GC-formation | 143a8cb464bd621e77092a010c9011ef056da400 | [
"MIT"
] | null | null | null | '''
Mass evolution of GC
Created Apr. 2020
Last Edit Apr. 2020
By Bill Chen
'''
import numpy as np
# Note: all times in [Gyr]
# ***** Dynamic evolution of GC in Choksi & Gnedin (2018) *****
def t_tid_cg18(m):
# Tidally-limited disruption timescale in Choksi & Gnedin (2018)
P = 0.5
return 5 * ((m/2e5)**(2/3)) * (P/0.5)
def GC_dyn_evolv_cg18(m0, t):
# Dynamic evolution of GC in Choksi & Gnedin (2018)
return (1 - (2/3)*(t/t_tid_cg18(m0)))**(2/3) # m(t)/m0
# ***** Stellar evolution of GC in Prieto & Gnedin (2008) *****
def GC_star_evolv_pg08(m0, t):
# Simple version!
return 0.6 # m(t)/m0
# ***** Mass evolution of GC in Choksi & Gnedin (2018) *****
def GC_mass_evolv_cg18(m0, t):
# Mass evolution of GC in Choksi & Gnedin (2018)
return m0 * GC_dyn_evolv_cg18(m0, t) * GC_star_evolv_pg08(m0, t)
| 22.263158 | 68 | 0.625296 | 145 | 846 | 3.517241 | 0.365517 | 0.129412 | 0.152941 | 0.147059 | 0.458824 | 0.458824 | 0.321569 | 0.321569 | 0 | 0 | 0 | 0.106767 | 0.213948 | 846 | 37 | 69 | 22.864865 | 0.66015 | 0.560284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0.1 | 0.3 | 0.9 | 0 | 0 | 0 | 0 | null | 0 | 0 | 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 |
105f6e89e6b0c9427d9b4f9d438c31c6041b503d | 414 | py | Python | letra_m/extensions.py | frotacaio/tutorial_flask | 6b454bddfc32e384b765d831025fc54a22fc79c7 | [
"MIT"
] | null | null | null | letra_m/extensions.py | frotacaio/tutorial_flask | 6b454bddfc32e384b765d831025fc54a22fc79c7 | [
"MIT"
] | null | null | null | letra_m/extensions.py | frotacaio/tutorial_flask | 6b454bddfc32e384b765d831025fc54a22fc79c7 | [
"MIT"
] | null | null | null | """
Extensões populares
Flask Mail - Fornece uma interface SMTP para o aplicativo Flask
Flask WTF - Adicione renderização e validação de WTForms
Flask SQLAlchemy - Adicionando suporte SQLAlchemy para o aplicativo Flask
Flask Sijax-Sijax - biblioteca de interface-Python/jQuery para tornar o AJAX fácil de usar em aplicações web
"""
import flaskext_compat
flaskext_compat.activate()
from flask.ext import foo
| 24.352941 | 108 | 0.806763 | 58 | 414 | 5.724138 | 0.672414 | 0.03012 | 0.090361 | 0.120482 | 0.150602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152174 | 414 | 16 | 109 | 25.875 | 0.945869 | 0.789855 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1070116f31c79416da1322b497edf3dc3c3e1f16 | 158 | py | Python | 18.py | christi-john/codechef-practice | 2f52cb72cbc5df4f4978fdd1cf77b1f01bc583b0 | [
"MIT"
] | null | null | null | 18.py | christi-john/codechef-practice | 2f52cb72cbc5df4f4978fdd1cf77b1f01bc583b0 | [
"MIT"
] | null | null | null | 18.py | christi-john/codechef-practice | 2f52cb72cbc5df4f4978fdd1cf77b1f01bc583b0 | [
"MIT"
] | null | null | null | # REMISS
for i in range(int(input())):
A,B = map(int,input().split())
if A>B: print(str(A) + " " + str(A+B))
else: print(str(B) + " " + str(A+B)) | 26.333333 | 42 | 0.5 | 29 | 158 | 2.724138 | 0.517241 | 0.101266 | 0.126582 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.227848 | 158 | 6 | 43 | 26.333333 | 0.647541 | 0.037975 | 0 | 0 | 0 | 0 | 0.013245 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
1077e543e91d42e1a23cc4585cc1adc1e252701a | 984 | py | Python | Python/3 kyu/Calculator/test_evaluate.py | newtonsspawn/codewars_challenges | 62b20d4e729c8ba79eac7cae6a179af57abd45d4 | [
"MIT"
] | 3 | 2020-05-29T23:29:35.000Z | 2021-08-12T03:16:44.000Z | Python/3 kyu/Calculator/test_evaluate.py | newtonsspawn/codewars_challenges | 62b20d4e729c8ba79eac7cae6a179af57abd45d4 | [
"MIT"
] | null | null | null | Python/3 kyu/Calculator/test_evaluate.py | newtonsspawn/codewars_challenges | 62b20d4e729c8ba79eac7cae6a179af57abd45d4 | [
"MIT"
] | 3 | 2020-05-22T12:14:55.000Z | 2021-04-15T12:52:42.000Z | from unittest import TestCase
from evaluate import Calculator
calc = Calculator()
class TestCalculator(TestCase):
def test_evaluate_01(self):
self.assertEqual(calc.evaluate(string='127'), 127)
def test_evaluate_02(self):
self.assertEqual(calc.evaluate(string='2 + 3'), 5)
def test_evaluate_03(self):
self.assertEqual(calc.evaluate(string='2 - 3 - 4'), -5)
def test_evaluate_04(self):
self.assertEqual(calc.evaluate(string='10 * 5 / 2'), 25)
def test_evaluate_05(self):
self.assertEqual(calc.evaluate(string='2 / 2 + 3 * 4 - 6'), 7)
def test_evaluate_06(self):
self.assertEqual(calc.evaluate(string='2 + 3 * 4 / 3 - 6 / 3 * 3 + 8'),
8)
def test_evaluate_07(self):
self.assertEqual(calc.evaluate(string='1.1 + 2.2 + 3.3'), 6.6)
def test_evaluate_08(self):
self.assertEqual(calc.evaluate(string='1.1 * 2.2 * 3.3'), 7.986)
| 28.941176 | 79 | 0.604675 | 137 | 984 | 4.226277 | 0.248175 | 0.096718 | 0.207254 | 0.317789 | 0.547496 | 0.547496 | 0.419689 | 0.354059 | 0.286701 | 0.148532 | 0 | 0.092643 | 0.254065 | 984 | 33 | 80 | 29.818182 | 0.696185 | 0 | 0 | 0 | 0 | 0 | 0.104675 | 0 | 0 | 0 | 0 | 0 | 0.380952 | 1 | 0.380952 | false | 0 | 0.095238 | 0 | 0.52381 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
1078131895be80dd05cd641cc3a84d9d01ba5a0a | 272 | py | Python | gfapy/line/__init__.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 44 | 2017-03-18T08:08:04.000Z | 2021-11-10T16:11:15.000Z | gfapy/line/__init__.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 22 | 2017-04-04T21:20:31.000Z | 2022-03-09T19:05:30.000Z | gfapy/line/__init__.py | ujjwalsh/gfapy | 891ef3df695f20c67809e5a54549c876d90690b4 | [
"ISC"
] | 5 | 2017-07-07T02:56:56.000Z | 2020-09-30T20:10:49.000Z | from .comment import Comment
from .line import Line
from .unknown import Unknown
from .edge import Edge
from .gap import Gap
from .custom_record import CustomRecord
from .fragment import Fragment
from .header import Header
from .segment import Segment
from . import group
| 24.727273 | 39 | 0.816176 | 40 | 272 | 5.525 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147059 | 272 | 10 | 40 | 27.2 | 0.952586 | 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 | 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 |
1085fa70c9dbc377238e6a8020eb054c9de9d0f5 | 382 | py | Python | herokuapp/project_template/manage.py | urkonn/django-herokuapp | 1d3ec10f6e83b7556a443150aa0658bbf341f6d1 | [
"BSD-3-Clause"
] | 262 | 2015-01-03T18:34:11.000Z | 2021-12-25T21:16:31.000Z | herokuapp/project_template/manage.py | urkonn/django-herokuapp | 1d3ec10f6e83b7556a443150aa0658bbf341f6d1 | [
"BSD-3-Clause"
] | 13 | 2015-01-14T04:02:34.000Z | 2021-10-05T13:59:46.000Z | herokuapp/project_template/manage.py | urkonn/django-herokuapp | 1d3ec10f6e83b7556a443150aa0658bbf341f6d1 | [
"BSD-3-Clause"
] | 52 | 2015-01-28T20:16:01.000Z | 2022-02-11T20:22:39.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
# Load the Heroku environment.
from herokuapp.env import load_env
load_env(__file__, "{{ app_name }}")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.875 | 82 | 0.722513 | 50 | 382 | 5.04 | 0.6 | 0.055556 | 0.142857 | 0.174603 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.170157 | 382 | 15 | 83 | 25.466667 | 0.794953 | 0.128272 | 0 | 0 | 0 | 0 | 0.214502 | 0.066465 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
10a97bd58b8abf9c9e02efdadaee1fda99449912 | 549 | py | Python | trinitee/manage.py | chaosk/trinitee | 30190c7e8ff2164c1127e26e733e0b65a9cd1f57 | [
"BSD-3-Clause"
] | 1 | 2017-04-20T18:39:48.000Z | 2017-04-20T18:39:48.000Z | trinitee/manage.py | chaosk/trinitee | 30190c7e8ff2164c1127e26e733e0b65a9cd1f57 | [
"BSD-3-Clause"
] | null | null | null | trinitee/manage.py | chaosk/trinitee | 30190c7e8ff2164c1127e26e733e0b65a9cd1f57 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory"
" containing %r. It appears you've customized things.\n"
"You'll have to run django-admin.py, passing it your settings module.\n"
"(If the file settings.py does indeed exist,"
"it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
if __name__ == "__main__":
execute_manager(settings) | 36.6 | 77 | 0.744991 | 87 | 549 | 4.54023 | 0.678161 | 0.070886 | 0.075949 | 0.086076 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002137 | 0.147541 | 549 | 15 | 78 | 36.6 | 0.84188 | 0.103825 | 0 | 0 | 0 | 0 | 0.551935 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.076923 | 0.384615 | 0 | 0.384615 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
10b32ad162c00e0088fd2085f0ff60ca3be39e4b | 67 | py | Python | loudblog_just_for_git_purposes/yatraWebPageAutomation.py | hodlerfolyf/MobileSatyagraha_Backend_aws | 3a82689ae44867f93073581a27c22cd5d8390c52 | [
"MIT"
] | 2 | 2020-01-27T03:25:37.000Z | 2020-03-30T21:48:07.000Z | loudblog_just_for_git_purposes/yatraWebPageAutomation.py | hodlerfolyf/MobileSatyagraha_Backend_aws | 3a82689ae44867f93073581a27c22cd5d8390c52 | [
"MIT"
] | 3 | 2021-03-25T23:33:50.000Z | 2021-06-01T23:24:21.000Z | loudblog_just_for_git_purposes/yatraWebPageAutomation.py | hodlerfolyf/MobileSatyagraha_Backend_aws | 3a82689ae44867f93073581a27c22cd5d8390c52 | [
"MIT"
] | 3 | 2021-12-07T11:50:26.000Z | 2022-01-22T09:21:05.000Z | from db_repo import *
mydb=database_flaskr()
rows=mydb.yatraWPA() | 22.333333 | 23 | 0.776119 | 10 | 67 | 5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104478 | 67 | 3 | 24 | 22.333333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
10b59feccd43ac230e025390e6b432e7a9694f66 | 261 | py | Python | easy/calculate_distance.py | Amin-Abouee/code_eval | 8f0d53d2af128d7b57dd3fc8ff16616252f18a52 | [
"MIT"
] | null | null | null | easy/calculate_distance.py | Amin-Abouee/code_eval | 8f0d53d2af128d7b57dd3fc8ff16616252f18a52 | [
"MIT"
] | null | null | null | easy/calculate_distance.py | Amin-Abouee/code_eval | 8f0d53d2af128d7b57dd3fc8ff16616252f18a52 | [
"MIT"
] | null | null | null | import sys
import re
import math
with open(sys.argv[1]) as test_cases:
for test in test_cases:
t = re.findall("[+-]?\d+", test)
nums = [int(x) for x in t]
print int(math.sqrt((nums[0]-nums[2]) * (nums[0]-nums[2]) + (nums[1]-nums[3]) * (nums[1]-nums[3]))) | 32.625 | 101 | 0.613027 | 51 | 261 | 3.098039 | 0.470588 | 0.113924 | 0.113924 | 0.126582 | 0.151899 | 0 | 0 | 0 | 0 | 0 | 0 | 0.040541 | 0.149425 | 261 | 8 | 101 | 32.625 | 0.671171 | 0 | 0 | 0 | 0 | 0 | 0.030534 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.375 | null | null | 0.125 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
52c51b70ee280d26ac396fd1baa601910de8efa3 | 343 | py | Python | good_spot/common/views.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | null | null | null | good_spot/common/views.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | 5 | 2020-02-12T03:13:11.000Z | 2022-01-13T01:41:14.000Z | good_spot/common/views.py | jasmine92122/NightClubBackend | 7f59129b78baaba0e0c25de2b493033b858f1b00 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.conf import settings
from django.http.response import HttpResponse
from django.views.generic import View
class HealthCheckView(View):
def get(self, request, *args, **kwargs):
return HttpResponse(settings.HEALTH_CHECK_BODY, status=200)
| 28.583333 | 67 | 0.769679 | 44 | 343 | 5.818182 | 0.727273 | 0.117188 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013514 | 0.137026 | 343 | 11 | 68 | 31.181818 | 0.851351 | 0.061224 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.571429 | 0.142857 | 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 |
52e897895ea9d9c314ef07443d9e4d0cc03615ec | 1,225 | py | Python | scaffold/iam/cf_builder.py | mccormickmichael/laurel | 6222d8d2dea6fa18cfe3b031434154003e8a125b | [
"Unlicense"
] | 1 | 2018-08-20T13:49:46.000Z | 2018-08-20T13:49:46.000Z | scaffold/iam/cf_builder.py | mccormickmichael/laurel | 6222d8d2dea6fa18cfe3b031434154003e8a125b | [
"Unlicense"
] | null | null | null | scaffold/iam/cf_builder.py | mccormickmichael/laurel | 6222d8d2dea6fa18cfe3b031434154003e8a125b | [
"Unlicense"
] | null | null | null | from datetime import datetime
from .cf_template import IAMTemplate
from scaffold.cf.stack.builder import StackBuilder
class IAMBuilder(StackBuilder):
def __init__(self, args, session, is_update):
super(IAMBuilder, self).__init__(args.stack_name, session, is_update)
self.args = args
def get_s3_bucket(self):
return self.args.deploy_s3_bucket
def create_s3_key_prefix(self):
return '{}/iam-{}'.format(self.args.deploy_s3_key_prefix, datetime.utcnow().strftime('%Y%m%d-%H%M%S'))
def get_build_parameter_names(self):
return list(IAMTemplate.BUILD_PARM_NAMES)
def get_capabilities(self):
# The iam stack contains inline policy resources. Explicitly acknowledge it here.
return ['CAPABILITY_IAM']
def create_template(self, dependencies, build_parameters):
return IAMTemplate(
self.stack_name,
description=build_parameters.description if self.args.desc is None else self.args.desc,
s3_bucket_name=build_parameters.bucket_name if self.args.bucket is None else self.args.bucket,
logging_enabled=build_parameters.logging_enabled if self.args.enable is None else self.args.enable,
)
| 38.28125 | 111 | 0.72 | 163 | 1,225 | 5.165644 | 0.392638 | 0.095012 | 0.035629 | 0.049881 | 0.064133 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005056 | 0.192653 | 1,225 | 31 | 112 | 39.516129 | 0.846309 | 0.06449 | 0 | 0 | 0 | 0 | 0.031469 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.136364 | 0.227273 | 0.681818 | 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 |
52e9d1812195fe5ed4ea6b6573203c34b1a66a6e | 175 | py | Python | editor/scheduler/__init__.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | editor/scheduler/__init__.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | editor/scheduler/__init__.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | """
Created by Sayem on 14 March, 2021
All rights reserved. Copyright © 2020.
"""
from .celery import app as celery_app
__author__ = "Sayem"
__all__ = ["celery_app"]
| 19.444444 | 42 | 0.685714 | 25 | 175 | 4.44 | 0.76 | 0.162162 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071942 | 0.205714 | 175 | 8 | 43 | 21.875 | 0.719424 | 0.417143 | 0 | 0 | 0 | 0 | 0.174419 | 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 |
52efbce325d7ba01d3a81e4caaaade2bb5824322 | 25 | py | Python | examples/basic/src/events/__init__.py | boosterl/rabbitmq-pika-flask | 45b98624c49c800c4e2bdaa9e1c04f1aa5863369 | [
"MIT"
] | 17 | 2021-04-04T17:24:06.000Z | 2022-03-11T13:22:01.000Z | examples/basic/src/events/__init__.py | boosterl/rabbitmq-pika-flask | 45b98624c49c800c4e2bdaa9e1c04f1aa5863369 | [
"MIT"
] | 10 | 2021-02-11T18:13:11.000Z | 2022-03-10T17:53:08.000Z | examples/basic/src/events/__init__.py | boosterl/rabbitmq-pika-flask | 45b98624c49c800c4e2bdaa9e1c04f1aa5863369 | [
"MIT"
] | 5 | 2021-04-04T17:23:46.000Z | 2021-12-11T07:49:10.000Z | __all__ = ['PingEvents']
| 12.5 | 24 | 0.68 | 2 | 25 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 25 | 1 | 25 | 25 | 0.590909 | 0 | 0 | 0 | 0 | 0 | 0.4 | 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 |
52fe443d7fc6fa4d7f3a127a6ec1ae62d3297059 | 302 | py | Python | instance/config.py | Alexotieno1717/News-API | 81ff1224862fdc74cbca6bf4a381916be382df83 | [
"MIT"
] | null | null | null | instance/config.py | Alexotieno1717/News-API | 81ff1224862fdc74cbca6bf4a381916be382df83 | [
"MIT"
] | null | null | null | instance/config.py | Alexotieno1717/News-API | 81ff1224862fdc74cbca6bf4a381916be382df83 | [
"MIT"
] | null | null | null | class Config:
"""
General configuration parent class
"""
pass
api_key = 'a493e30f11b147d0ba67b15ca60c5e4c'
SECRET_KEY = '1234567890'
class ProdConfig(Config):
"""
Production
"""
pass
class DevConfig(Config):
"""
development
"""
DEBUG = True
| 13.130435 | 48 | 0.596026 | 24 | 302 | 7.416667 | 0.708333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136792 | 0.298013 | 302 | 22 | 49 | 13.727273 | 0.70283 | 0.188742 | 0 | 0.25 | 0 | 0 | 0.211055 | 0.160804 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 0 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
5e15921eff92f5c9d6be850512491ee049db1643 | 188 | py | Python | Exercicios/010.py | sleepinhoo/Python | d8ac7f3297f3a99b27b07d7341a16503a64124b0 | [
"MIT"
] | null | null | null | Exercicios/010.py | sleepinhoo/Python | d8ac7f3297f3a99b27b07d7341a16503a64124b0 | [
"MIT"
] | null | null | null | Exercicios/010.py | sleepinhoo/Python | d8ac7f3297f3a99b27b07d7341a16503a64124b0 | [
"MIT"
] | null | null | null | grana = float(input("Informe a quantidade de dinherio: R$"))
dolar = 5.4
print(f" Dá pra comprar USS${grana / dolar} com o valor atual na sua carteira")
print(f"Cotação usada: {dolar}")
| 26.857143 | 79 | 0.702128 | 32 | 188 | 4.125 | 0.84375 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012658 | 0.159574 | 188 | 6 | 80 | 31.333333 | 0.822785 | 0 | 0 | 0 | 0 | 0 | 0.675532 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
5e16f149874edd109b6f8b910bb8ac81d76a5978 | 239 | py | Python | src/ast/socps/__init__.py | cvxgrp/qcml | ff5e378cfeeebcf3f85a6e30c3449585f9af869f | [
"BSD-2-Clause-FreeBSD"
] | 26 | 2015-02-06T02:59:17.000Z | 2021-11-15T18:13:27.000Z | src/ast/socps/__init__.py | cvxgrp/qcml | ff5e378cfeeebcf3f85a6e30c3449585f9af869f | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2015-06-14T04:43:43.000Z | 2019-10-27T11:03:30.000Z | src/ast/socps/__init__.py | cvxgrp/qcml | ff5e378cfeeebcf3f85a6e30c3449585f9af869f | [
"BSD-2-Clause-FreeBSD"
] | 6 | 2015-03-14T07:40:56.000Z | 2019-12-30T23:11:36.000Z | """ Technically, a every problem is a program; but not every program is a
problem.
This distinction only really matters if we introduce nodes for For loops
and whatnot.
Then the problem has 'program-like' constructs.
"""
| 26.555556 | 76 | 0.715481 | 35 | 239 | 4.885714 | 0.742857 | 0.035088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225941 | 239 | 8 | 77 | 29.875 | 0.924324 | 0.895397 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eaa6140f555dcb9999992526db8818c254ad7559 | 84 | py | Python | main.py | bzsam/password_generator | 4690e2ed361d3eee4f06cc404f737f904cc3294c | [
"MIT"
] | null | null | null | main.py | bzsam/password_generator | 4690e2ed361d3eee4f06cc404f737f904cc3294c | [
"MIT"
] | null | null | null | main.py | bzsam/password_generator | 4690e2ed361d3eee4f06cc404f737f904cc3294c | [
"MIT"
] | null | null | null | import tkinter as tk
import gui
wd = tk.Tk()
gui = gui.GUI(wd)
wd.mainloop() | 12 | 21 | 0.630952 | 15 | 84 | 3.533333 | 0.466667 | 0.188679 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 84 | 7 | 22 | 12 | 0.828125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
eaaee56b527744c35b0a2e71b0cf37879102767a | 208 | py | Python | python/course/leetcode/leetcode.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 1 | 2019-05-22T07:12:34.000Z | 2019-05-22T07:12:34.000Z | python/course/leetcode/leetcode.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | 3 | 2021-12-10T01:13:54.000Z | 2021-12-14T21:18:42.000Z | python/course/leetcode/leetcode.py | TimVan1596/ACM-ICPC | 07f7d728db1ecd09c5a3d0f05521930b14eb9883 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# @Time:2020/6/15 11:38
# @Author:TimVan
# @File:leetcode.py
# @Software:PyCharm
# Definition for singly-linked list.
# for j in range(10, 5, -1):
# print(j)
print('a'.find(' '))
| 17.333333 | 36 | 0.605769 | 33 | 208 | 3.818182 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.092486 | 0.168269 | 208 | 11 | 37 | 18.909091 | 0.635838 | 0.807692 | 0 | 0 | 0 | 0 | 0.064516 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
eab304e0038f9d90c7298134d0344c832dc999c1 | 226 | py | Python | authapp/models.py | MSFC-NASA/NasaPD | 5851b63f57d2820f48f579bf71ffa040c23b755e | [
"MIT"
] | null | null | null | authapp/models.py | MSFC-NASA/NasaPD | 5851b63f57d2820f48f579bf71ffa040c23b755e | [
"MIT"
] | null | null | null | authapp/models.py | MSFC-NASA/NasaPD | 5851b63f57d2820f48f579bf71ffa040c23b755e | [
"MIT"
] | 2 | 2021-03-19T16:40:52.000Z | 2021-03-20T13:01:41.000Z | from django.db import models
from django.conf import settings
# Create your models here.
class UserRegistrationModel(models.Model):
user = models.OneToOneField(
settings.AUTH_USER_MODEL, on_delete=models.CASCADE) | 28.25 | 59 | 0.783186 | 29 | 226 | 6 | 0.655172 | 0.114943 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.146018 | 226 | 8 | 59 | 28.25 | 0.901554 | 0.106195 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 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 | 1 | 0 | 0 | 0 | 0 | 3 |
d802143b8c4b9b5183911d466a1c2053a64055aa | 650 | py | Python | sporting_webapp/nfl_package/migrations/0002_auto_20190807_1445.py | plopez9/chipy_sports_app_2.0 | 39b337238d0a55bfe842cb60ea9fe4724426fbf0 | [
"MIT"
] | null | null | null | sporting_webapp/nfl_package/migrations/0002_auto_20190807_1445.py | plopez9/chipy_sports_app_2.0 | 39b337238d0a55bfe842cb60ea9fe4724426fbf0 | [
"MIT"
] | null | null | null | sporting_webapp/nfl_package/migrations/0002_auto_20190807_1445.py | plopez9/chipy_sports_app_2.0 | 39b337238d0a55bfe842cb60ea9fe4724426fbf0 | [
"MIT"
] | 1 | 2019-10-08T17:39:08.000Z | 2019-10-08T17:39:08.000Z | # Generated by Django 2.1.7 on 2019-08-07 19:45
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('nfl_package', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='nflplayersummary',
old_name='player',
new_name='Name',
),
migrations.RenameField(
model_name='nflplayersummary',
old_name='pos',
new_name='Pos',
),
migrations.RenameField(
model_name='nflplayersummary',
old_name='year',
new_name='Year',
),
]
| 22.413793 | 47 | 0.543077 | 60 | 650 | 5.7 | 0.55 | 0.184211 | 0.22807 | 0.263158 | 0.464912 | 0.464912 | 0.464912 | 0 | 0 | 0 | 0 | 0.044601 | 0.344615 | 650 | 28 | 48 | 23.214286 | 0.758216 | 0.069231 | 0 | 0.409091 | 1 | 0 | 0.157546 | 0 | 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 |
d80324dc01f020d815e622c10604165f52290b3e | 75 | py | Python | dummypy/packageA/__init__.py | brett-hosking/dummypy | 07931382d55ffb9875fb0edab01ff5b33a6fa8a3 | [
"MIT"
] | null | null | null | dummypy/packageA/__init__.py | brett-hosking/dummypy | 07931382d55ffb9875fb0edab01ff5b33a6fa8a3 | [
"MIT"
] | null | null | null | dummypy/packageA/__init__.py | brett-hosking/dummypy | 07931382d55ffb9875fb0edab01ff5b33a6fa8a3 | [
"MIT"
] | null | null | null | # Nested package modules
from . import Atest
__packageAname__ = 'packageA' | 18.75 | 29 | 0.786667 | 8 | 75 | 6.875 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.146667 | 75 | 4 | 29 | 18.75 | 0.859375 | 0.293333 | 0 | 0 | 0 | 0 | 0.153846 | 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 |
d81352042fe28274d48c972342192e4cd5a7987b | 120 | py | Python | net/gan/loss/__init__.py | bacTlink/caffe_tmpname | 14f713ec782ec9d6757a55fa1bda0151fe6c0e33 | [
"Intel",
"BSD-2-Clause"
] | 2 | 2018-02-02T07:35:08.000Z | 2018-02-05T09:25:10.000Z | net/gan/loss/__init__.py | bacTlink/caffe_tmpname | 14f713ec782ec9d6757a55fa1bda0151fe6c0e33 | [
"Intel",
"BSD-2-Clause"
] | null | null | null | net/gan/loss/__init__.py | bacTlink/caffe_tmpname | 14f713ec782ec9d6757a55fa1bda0151fe6c0e33 | [
"Intel",
"BSD-2-Clause"
] | null | null | null | all = ['GeneratorLoss',
'ClassfierLoss']
from generator import GeneratorLoss
from classfier import ClassfierLoss
| 24 | 35 | 0.775 | 11 | 120 | 8.454545 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.158333 | 120 | 4 | 36 | 30 | 0.920792 | 0 | 0 | 0 | 0 | 0 | 0.216667 | 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 |
d81a9d62719f07472e189017fffe17520e8b2f77 | 150 | py | Python | mfsapiapp/apps.py | lupamo3/django-points | 7dc943521c73de1728c5f96d529b16ae51de98e5 | [
"MIT"
] | null | null | null | mfsapiapp/apps.py | lupamo3/django-points | 7dc943521c73de1728c5f96d529b16ae51de98e5 | [
"MIT"
] | null | null | null | mfsapiapp/apps.py | lupamo3/django-points | 7dc943521c73de1728c5f96d529b16ae51de98e5 | [
"MIT"
] | 1 | 2021-09-21T06:20:28.000Z | 2021-09-21T06:20:28.000Z | from django.apps import AppConfig
class MfsapiappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'mfsapiapp'
| 21.428571 | 56 | 0.766667 | 17 | 150 | 6.647059 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.146667 | 150 | 6 | 57 | 25 | 0.882813 | 0 | 0 | 0 | 0 | 0 | 0.253333 | 0.193333 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
d81f6f0578f05c3ef2f5009ba322576a6f13de5b | 220 | py | Python | src/dht11.py | Brumawen/temperature | e8743c641961a5e5c512f24239ec4c7755db55be | [
"MIT"
] | null | null | null | src/dht11.py | Brumawen/temperature | e8743c641961a5e5c512f24239ec4c7755db55be | [
"MIT"
] | null | null | null | src/dht11.py | Brumawen/temperature | e8743c641961a5e5c512f24239ec4c7755db55be | [
"MIT"
] | null | null | null | import Adafruit_DHT
humidity, temperature = Adafruit_DHT.read_retry(Adafruit_DHT.DHT11, 17)
if humidity is not None and temperature is not None:
print(str(temperature) + "," + str(humidity))
else:
print('-1,-1') | 31.428571 | 71 | 0.731818 | 32 | 220 | 4.90625 | 0.5625 | 0.210191 | 0.11465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031915 | 0.145455 | 220 | 7 | 72 | 31.428571 | 0.803191 | 0 | 0 | 0 | 0 | 0 | 0.027149 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.166667 | 0 | 0.166667 | 0.333333 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d821891ab4fa48d558099ae464e5ae75e623dfe7 | 271 | py | Python | src/pyNonin/pynonin/__init__.py | Hammit/wais-pop | fdf1a7da38759d5d082b95c82dd883aa56df6816 | [
"MIT"
] | 1 | 2020-12-30T03:25:13.000Z | 2020-12-30T03:25:13.000Z | src/pyNonin/pynonin/__init__.py | Hammit/wais-pop | fdf1a7da38759d5d082b95c82dd883aa56df6816 | [
"MIT"
] | null | null | null | src/pyNonin/pynonin/__init__.py | Hammit/wais-pop | fdf1a7da38759d5d082b95c82dd883aa56df6816 | [
"MIT"
] | null | null | null | """
pyNonin package initalization file
(c) Charles Fracchia 2013
charlesfracchia@gmail.com
Permission granted for experimental and personal use;
license for commercial sale available from the author.
"""
#Import main Device base class
from pynonin.packet import Packet
| 22.583333 | 54 | 0.811808 | 36 | 271 | 6.111111 | 0.861111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017094 | 0.136531 | 271 | 11 | 55 | 24.636364 | 0.923077 | 0.837638 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
dc1d61af75ba3b0bf8f5b6092c2e0716f461d910 | 105 | py | Python | main.py | YunPC/branch-practice | c8977397c9e548b20d05d6edd8c20c3905a89f7c | [
"MIT"
] | null | null | null | main.py | YunPC/branch-practice | c8977397c9e548b20d05d6edd8c20c3905a89f7c | [
"MIT"
] | 1 | 2021-04-01T06:22:09.000Z | 2021-04-01T06:24:37.000Z | main.py | YunPC/branch-practice | c8977397c9e548b20d05d6edd8c20c3905a89f7c | [
"MIT"
] | null | null | null | # print function on main branch
result = ['main' if i%5==0 else i for i in range(1, 10+1)]
print(result)
| 26.25 | 58 | 0.67619 | 22 | 105 | 3.227273 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.069767 | 0.180952 | 105 | 3 | 59 | 35 | 0.755814 | 0.27619 | 0 | 0 | 0 | 0 | 0.054054 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
dc31324d3932732b9cf6cec61f3b7fc77261b755 | 335 | py | Python | nvchecker/api.py | ypsilik/nvchecker | 9d2d47ed15929c0698f4c9d34fa018d52413d3b3 | [
"MIT"
] | null | null | null | nvchecker/api.py | ypsilik/nvchecker | 9d2d47ed15929c0698f4c9d34fa018d52413d3b3 | [
"MIT"
] | null | null | null | nvchecker/api.py | ypsilik/nvchecker | 9d2d47ed15929c0698f4c9d34fa018d52413d3b3 | [
"MIT"
] | null | null | null | # MIT licensed
# Copyright (c) 2020 lilydjwg <lilydjwg@gmail.com>, et al.
from .httpclient import session, TemporaryError, HTTPError
from .util import (
Entry, BaseWorker, RawResult, VersionResult,
AsyncCache, KeyManager, GetVersionError,
)
from .sortversion import sort_version_keys
from .ctxvars import tries, proxy, user_agent
| 30.454545 | 58 | 0.78806 | 40 | 335 | 6.525 | 0.825 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013746 | 0.131343 | 335 | 10 | 59 | 33.5 | 0.883162 | 0.20597 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.571429 | 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 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
dc4bf0a06281c947e4e62456a19c478fe9e93906 | 223 | py | Python | asva/restoring_force/Elastic.py | adc21/asva | b94db4aa41ee10ef1991ed4f042c91d9e310a1e1 | [
"MIT"
] | 4 | 2020-10-07T10:47:07.000Z | 2020-12-23T10:07:12.000Z | asva/restoring_force/Elastic.py | adc21/asva | b94db4aa41ee10ef1991ed4f042c91d9e310a1e1 | [
"MIT"
] | 2 | 2021-06-11T12:41:23.000Z | 2021-08-04T03:05:31.000Z | asva/restoring_force/Elastic.py | adc21/asva | b94db4aa41ee10ef1991ed4f042c91d9e310a1e1 | [
"MIT"
] | null | null | null | from asva.restoring_force.RestoringForce import RestoringForce
class Elastic(RestoringForce):
def step(self, dis: float) -> None:
# init
self.init_step(dis)
# end
self.end_step(self.k0)
| 24.777778 | 62 | 0.659193 | 27 | 223 | 5.333333 | 0.62963 | 0.111111 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005952 | 0.246637 | 223 | 8 | 63 | 27.875 | 0.85119 | 0.035874 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
dc4fefe1808974939cccf075125250d15a87b8f6 | 871 | py | Python | IslandGIS/feedback/forms.py | eRestin/MezzGIS | 984341fa5361433cf9b6f30b113358c19d3cd05c | [
"BSD-2-Clause"
] | null | null | null | IslandGIS/feedback/forms.py | eRestin/MezzGIS | 984341fa5361433cf9b6f30b113358c19d3cd05c | [
"BSD-2-Clause"
] | null | null | null | IslandGIS/feedback/forms.py | eRestin/MezzGIS | 984341fa5361433cf9b6f30b113358c19d3cd05c | [
"BSD-2-Clause"
] | null | null | null | from flexipage.forms import FlexiModelForm
from mezzanine.core.forms import Html5Mixin
from django import forms
from models import Feedback
class FeedbackForm(FlexiModelForm, Html5Mixin):
class Meta:
model = Feedback
name = forms.CharField(widget=forms.TextInput(attrs = {'placeholder': 'Name', 'class': 'namesclass'}), label='')
email = forms.CharField(widget=forms.TextInput(attrs = {'placeholder': 'E-Mail', 'class': 'emailclass'}), label='')
telephone = forms.CharField(widget=forms.TextInput(attrs = {'placeholder': 'Telephone', 'class': 'telephoneclass'}), label='')
address = forms.CharField(widget=forms.TextInput(attrs = {'placeholder': 'Address', 'class': 'addressclass'}), label='')
content = forms.CharField(widget=forms.Textarea(attrs = {'placeholder': 'Enquiry', 'rows': 4, 'cols': 40, 'class': 'contentsclass'}), label='') | 62.214286 | 147 | 0.708381 | 92 | 871 | 6.706522 | 0.423913 | 0.113452 | 0.162075 | 0.202593 | 0.324149 | 0.324149 | 0.324149 | 0 | 0 | 0 | 0 | 0.006536 | 0.121699 | 871 | 14 | 147 | 62.214286 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.206422 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.916667 | 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 | 1 | 0 | 1 | 0 | 0 | 3 |
dc5b9dc07c1239f392e41d7198be67b491f60afc | 210 | py | Python | Language_Proficiency/Python/06_Itertools/04_itertools-combinations-with-replacement-English.py | canbecerik/HackerRank_solutions | 7f90a145fed29103401be94adc069a2731926d26 | [
"MIT"
] | 1 | 2020-04-20T10:27:37.000Z | 2020-04-20T10:27:37.000Z | Language_Proficiency/Python/06_Itertools/04_itertools-combinations-with-replacement-English.py | canbecerik/HackerRank_solutions | 7f90a145fed29103401be94adc069a2731926d26 | [
"MIT"
] | null | null | null | Language_Proficiency/Python/06_Itertools/04_itertools-combinations-with-replacement-English.py | canbecerik/HackerRank_solutions | 7f90a145fed29103401be94adc069a2731926d26 | [
"MIT"
] | null | null | null | from itertools import combinations_with_replacement
S, k = [i for i in input().split(" ")]
k = int(k)
combs = list(combinations_with_replacement(sorted(S), k))
combs.sort()
[print("".join(i)) for i in combs] | 23.333333 | 57 | 0.704762 | 34 | 210 | 4.235294 | 0.588235 | 0.222222 | 0.375 | 0.097222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 210 | 9 | 58 | 23.333333 | 0.791209 | 0 | 0 | 0 | 0 | 0 | 0.004739 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.166667 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
dc68739da52483fd2292c811c9370f529610773a | 1,985 | py | Python | snekcord/objects/base.py | asleep-cult/snekcord | 04302b0c65bad01c00fb047df3040d3234773689 | [
"MIT"
] | 9 | 2021-07-26T00:25:51.000Z | 2022-02-23T16:00:10.000Z | snekcord/objects/base.py | asleep-cult/snekcord | 04302b0c65bad01c00fb047df3040d3234773689 | [
"MIT"
] | 37 | 2021-05-29T16:16:22.000Z | 2022-02-13T13:57:25.000Z | snekcord/objects/base.py | asleep-cult/snekcord | 04302b0c65bad01c00fb047df3040d3234773689 | [
"MIT"
] | 4 | 2021-06-02T16:45:41.000Z | 2022-02-10T14:57:16.000Z | from .. import json
from ..exceptions import UnknownObjectError
from ..snowflake import Snowflake
__all__ = ('BaseObject', 'ObjectWrapper')
class _IDField(json.JSONField):
def __init__(self) -> None:
super().__init__('id', repr=True)
def construct(self, value: str) -> Snowflake:
return Snowflake(value)
def deconstruct(self, value: Snowflake) -> str:
return str(value)
class _ObjectMixin:
__slots__ = ()
def __init__(self, *, state) -> None:
self.state = state
def _get_id(self):
raise NotImplementedError
@property
def client(self):
return self.state.client
def is_cached(self) -> bool:
return self.id in self.state.keys()
async def fetch(self):
return await self.state.fetch(self.id)
class BaseObject(json.JSONObject, _ObjectMixin):
__slots__ = ('__weakref__', 'state')
id = _IDField()
def __init__(self, *, state) -> None:
super().__init__(state=state)
self.state.cache[self.id] = self
def _get_id(self):
return self.id
class ObjectWrapper(_ObjectMixin):
"""A wrapper for an object that might not be cached.
state:
The state that the wrapped object belongs to.
id:
The id of the wrapped object.
"""
__slots__ = ('__weakref__', 'state', 'id')
def __init__(self, *, state, id) -> None:
super().__init__(state=state)
self.set_id(id)
def __repr__(self) -> str:
return f'<ObjectWrapper id={self.id}>'
def _get_id(self):
return self.id
def set_id(self, id):
"""Changes the id of the wrapper."""
if id is not None:
self.id = self.state.unwrap_id(id)
else:
self.id = None
def unwrap(self):
"""Eqivalent to `self.state.get(self.id)`."""
object = self.state.get(self.id)
if object is None:
raise UnknownObjectError(self.id)
return object
| 22.303371 | 56 | 0.605038 | 242 | 1,985 | 4.669421 | 0.268595 | 0.063717 | 0.038938 | 0.042478 | 0.153982 | 0.090265 | 0.042478 | 0 | 0 | 0 | 0 | 0 | 0.274559 | 1,985 | 88 | 57 | 22.556818 | 0.784722 | 0.10932 | 0 | 0.176471 | 0 | 0 | 0.05026 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.27451 | false | 0 | 0.058824 | 0.137255 | 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 |
dc8c2777bf74705cf12f2debe29527c9ee43e568 | 1,015 | py | Python | tests/pyre/components/protocol.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/components/protocol.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | tests/pyre/components/protocol.py | BryanRiel/pyre | 179359634a7091979cced427b6133dd0ec4726ea | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2018 all rights reserved
#
"""
Check that declarations of trivial protocols produce the expected layout
"""
def test():
import pyre
# declare
class protocol(pyre.protocol):
"""a trivial protocol"""
# check the basics
assert protocol.__name__ == "protocol"
assert protocol.__bases__ == (pyre.protocol,)
# did I get a key
assert protocol.pyre_key is None # since i didn't specify my family name
# check the layout
assert protocol.pyre_namemap == {}
assert protocol.pyre_localTraits == ()
assert protocol.pyre_inheritedTraits == ()
assert protocol.pyre_pedigree == (protocol, pyre.protocol)
assert protocol.pyre_internal == False
# exercise the configurable interface
assert list(protocol.pyre_traits()) == []
assert protocol.pyre_isCompatible(protocol)
return protocol
# main
if __name__ == "__main__":
test()
# end of file
| 21.145833 | 76 | 0.675862 | 122 | 1,015 | 5.42623 | 0.557377 | 0.181269 | 0.190332 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012579 | 0.216749 | 1,015 | 47 | 77 | 21.595745 | 0.820126 | 0.344828 | 0 | 0 | 0 | 0 | 0.025078 | 0 | 0 | 0 | 0 | 0 | 0.625 | 1 | 0.0625 | true | 0 | 0.0625 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
dc9494ac835fbdd17583721bdefffc09c468c9f3 | 248 | py | Python | app/main/__init__.py | sundayliu/flask-tutorial | 8621441b429020ea884b4bf090efa8dd15133af8 | [
"MIT"
] | null | null | null | app/main/__init__.py | sundayliu/flask-tutorial | 8621441b429020ea884b4bf090efa8dd15133af8 | [
"MIT"
] | null | null | null | app/main/__init__.py | sundayliu/flask-tutorial | 8621441b429020ea884b4bf090efa8dd15133af8 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
from flask import Blueprint
main = Blueprint('main',__name__)
from . import views,errors
from ..models import Permission
@main.app_context_processor
def inject_permissions():
return dict(Permission=Permission) | 20.666667 | 35 | 0.733871 | 30 | 248 | 5.833333 | 0.7 | 0.148571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004785 | 0.157258 | 248 | 12 | 35 | 20.666667 | 0.832536 | 0.080645 | 0 | 0 | 0 | 0 | 0.018519 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0.142857 | 0.714286 | 0.285714 | 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 |
dc9f09cf9ee2ea2c23e057814412e9cccf50d425 | 5,389 | py | Python | space_api/db/update.py | AliabbasMerchant/space-api-python | e5f047d567540d503be7fe72e82f2b198e48b5f9 | [
"Apache-2.0"
] | 8 | 2019-04-02T06:06:45.000Z | 2019-11-12T16:53:26.000Z | space_api/db/update.py | SaiprasadDuduka/space-api-python | 278ad650fa5579089a7ff465dbe74ec5469940ae | [
"Apache-2.0"
] | 28 | 2019-03-25T11:35:07.000Z | 2020-05-11T05:10:00.000Z | space_api/db/update.py | SaiprasadDuduka/space-api-python | 278ad650fa5579089a7ff465dbe74ec5469940ae | [
"Apache-2.0"
] | 4 | 2019-03-22T17:09:22.000Z | 2019-10-24T17:10:43.000Z | from space_api.utils import generate_find, AND
from space_api.transport import Transport
from space_api.response import Response
class Update:
"""
The DB Update Class
::
from space_api import API, AND, OR, COND
api = API("My-Project", "localhost:4124")
db = api.mongo() # For a MongoDB interface
response = db.update('posts').where(AND(COND('title', '==', 'Title1'))).set({'title':'Title2'}).apply()
:param transport: (Transport) The API's transport instance
:param collection: (str) The collection name
:param db_type: (str) The database type
:param operation: (str) The (optional) operation (one/all/upsert) (Defaults to 'all')
"""
def __init__(self, transport: Transport, collection: str, db_type: str, operation: str = 'all'):
self.transport = transport
self.collection = collection
self.db_type = db_type
self.operation = operation
self.params = {'find': {}, 'update': {}}
def where(self, *conditions) -> 'Update':
"""
Prepares the find parameters
:param conditions: (*) The conditions to find by
"""
self.params['find'] = generate_find(AND(*conditions))
return self
def set(self, obj) -> 'Update':
"""
Prepares the updated values
::
response = db.update('posts').set({'author': 'Drake'}).apply()
:param obj: An object containing the fields to set
"""
self.params['update']['$set'] = obj
return self
def push(self, obj) -> 'Update':
"""
Adds an item to an list
::
response = db.update('posts').push({'author': 'Drake'}).apply()
:param obj: An object containing the fields to set
"""
self.params['update']['$push'] = obj
return self
def remove(self, *fields) -> 'Update':
"""
Removes the specified fields from a document
::
response = db.update('posts').remove('age', 'likes').apply()
:param fields: (*) The fields to be removed
"""
self.params['update']['$unset'] = {x: '' for x in fields}
return self
def rename(self, obj) -> 'Update':
"""
Renames the specified fields
::
response = db.update('posts').rename({'mobile': 'contact'}).apply()
:param obj: An object containing the fields to rename
"""
self.params['update']['$rename'] = obj
return self
def inc(self, obj) -> 'Update':
"""
Increments the value of a field by a specified amount
::
response = db.update('posts').inc({'views': 1}).apply()
:param obj: An object containing the fields to increment, along with the increment value
"""
self.params['update']['$inc'] = obj
return self
def mul(self, obj) -> 'Update':
"""
Multiplies the value of a field by a specified amount
::
response = db.update('posts').mul({'amount': 4}).apply()
:param obj: An object containing the fields to multiply, along with the multiplier value
"""
self.params['update']['$mul'] = obj
return self
def max(self, obj) -> 'Update':
"""
Updates the field if the specified value is greater than the existing field value
::
response = db.update('posts').max({'highScore': 1200}).apply()
:param obj: An object containing the fields to set
"""
self.params['update']['$max'] = obj
return self
def min(self, obj) -> 'Update':
"""
Updates the field if the specified value is lesser than the existing field value
::
response = db.update('posts').min({'lowestScore': 300}).apply()
:param obj: An object containing the fields to set
"""
self.params['update']['$min'] = obj
return self
def current_timestamp(self, *values) -> 'Update':
"""
Sets the value of a field(s) to the current timestamp
::
response = db.update('posts').current_timestamp('lastModified').apply()
:param values: (*) A list containing the fields to set
"""
if self.params['update'].get('$currentDate') is None:
self.params['update']['$currentDate'] = {}
self.params['update']['$currentDate'].update({x: {'$type': 'timestamp'} for x in values})
return self
def current_date(self, *values) -> 'Update':
"""
Sets the value of a field(s) to the date
::
response = db.update('posts').current_date('lastModified').apply()
:param values: (*) A list containing the fields to set
"""
if self.params['update'].get('$currentDate') is None:
self.params['update']['$currentDate'] = {}
self.params['update']['$currentDate'].update({x: {'$type': 'date'} for x in values})
return self
def apply(self) -> Response:
"""
Triggers the update request
:return: (Response) The response object containing values corresponding to the request
"""
return self.transport.update(self.params['find'], self.operation, self.params['update'], self.db_type,
self.collection)
__all__ = ['Update']
| 33.265432 | 111 | 0.566339 | 619 | 5,389 | 4.893376 | 0.200323 | 0.059426 | 0.079234 | 0.076263 | 0.396831 | 0.378343 | 0.378343 | 0.361836 | 0.361836 | 0.289865 | 0 | 0.003933 | 0.292262 | 5,389 | 161 | 112 | 33.47205 | 0.790246 | 0.462423 | 0 | 0.294118 | 1 | 0 | 0.136619 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.254902 | false | 0 | 0.058824 | 0 | 0.568627 | 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 | 0 | 1 | 0 | 0 | 3 |
dcb2185b1d562b118d9365afacb1c2b0f388cace | 144 | py | Python | python/testData/resolve/SuperPy3k.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/resolve/SuperPy3k.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/resolve/SuperPy3k.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | class A(object):
def foo(self):
print "foo"
class B(A):
def foo(self):
super().foo()
# <ref>
B().foo()
| 13.090909 | 22 | 0.430556 | 19 | 144 | 3.263158 | 0.526316 | 0.193548 | 0.322581 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.381944 | 144 | 10 | 23 | 14.4 | 0.696629 | 0.034722 | 0 | 0.285714 | 0 | 0 | 0.02459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.142857 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f495558b425c19c7f688ca7077b87a76ada1cbf2 | 92 | py | Python | unittest/scripts/py_dev_api_examples/working_with_collections/Working_with_Existing_Collections.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 119 | 2016-04-14T14:16:22.000Z | 2022-03-08T20:24:38.000Z | unittest/scripts/py_dev_api_examples/working_with_collections/Working_with_Existing_Collections.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 9 | 2017-04-26T20:48:42.000Z | 2021-09-07T01:52:44.000Z | unittest/scripts/py_dev_api_examples/working_with_collections/Working_with_Existing_Collections.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 51 | 2016-07-20T05:06:48.000Z | 2022-03-09T01:20:53.000Z | # Get a collection object for 'my_collection'
myColl = db.get_collection('my_collection')
| 30.666667 | 46 | 0.771739 | 13 | 92 | 5.230769 | 0.615385 | 0.352941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 92 | 2 | 47 | 46 | 0.85 | 0.467391 | 0 | 0 | 0 | 0 | 0.288889 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
f4abb17f526e4601a14901c49f09e55bab004ea9 | 847 | py | Python | commands/playbackjoystick.py | randbrown/robotpy_recordplayback | b36f794b141809578acd25975fb961bfe17c8285 | [
"MIT"
] | null | null | null | commands/playbackjoystick.py | randbrown/robotpy_recordplayback | b36f794b141809578acd25975fb961bfe17c8285 | [
"MIT"
] | null | null | null | commands/playbackjoystick.py | randbrown/robotpy_recordplayback | b36f794b141809578acd25975fb961bfe17c8285 | [
"MIT"
] | null | null | null |
'''
Psuedo-joystick object for playback of recorded macros
'''
class PlaybackJoystick():
def __init__(self, playback_data):
self.playback_data = playback_data
self.t = 0
def setTime(self, t=0):
self.t = t
def getRawAxis(self, axis):
#TODO fix me, get correct index for time t
# in the simulator it's called multiple times per millisecond, but the recorder only stores one per millisecond,
# so in the simulator index is usually the same as t.... but in the real bot it would be like every 50 ms or so
index = self.t
if(index < len(self.playback_data)):
return float(self.playback_data[index][axis + 2])
return 0
def getX(self, hand=None):
return self.getRawAxis(0)
def getY(self, hand=None):
return self.getRawAxis(1)
| 31.37037 | 120 | 0.638725 | 124 | 847 | 4.290323 | 0.524194 | 0.112782 | 0.120301 | 0.067669 | 0.120301 | 0.120301 | 0 | 0 | 0 | 0 | 0 | 0.013029 | 0.275089 | 847 | 26 | 121 | 32.576923 | 0.85342 | 0.374262 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.038462 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.133333 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
f4be1ae12ce6a24db3379525a913d9920ff8ef2d | 1,680 | py | Python | aiovault/client.py | johnnoone/aiovault | 03e1bfb6f0404dcf97ce87a98c539027c4e78a37 | [
"BSD-3-Clause"
] | 1 | 2022-01-31T22:37:57.000Z | 2022-01-31T22:37:57.000Z | aiovault/client.py | johnnoone/aiovault | 03e1bfb6f0404dcf97ce87a98c539027c4e78a37 | [
"BSD-3-Clause"
] | null | null | null | aiovault/client.py | johnnoone/aiovault | 03e1bfb6f0404dcf97ce87a98c539027c4e78a37 | [
"BSD-3-Clause"
] | null | null | null | from . import v1
from .request import Request
from .util import task, extract_id
class Vault(v1.SysEndpoint):
def __init__(self, addr, token=None, cert=None, verify=True):
token = extract_id(token)
self.req_handler = Request(addr, 'v1', token=token,
cert=cert, verify=verify)
@property
def audit(self):
return v1.AuditEndpoint(self.req_handler)
@property
def auth(self):
return v1.AuthEndpoint(self.req_handler)
@property
def lease(self):
return v1.LeaseEndpoint(self.req_handler)
@property
def policy(self):
return v1.PolicyEndpoint(self.req_handler)
@property
def raw(self):
return v1.RawEndpoint(self.req_handler)
@property
def seal(self):
return v1.SealEndpoint(self.req_handler)
@property
def secret(self):
return v1.SecretEndpoint(self.req_handler)
@task
def login(self, *args, **kwargs):
return self.auth.login(*args, **kwargs)
@task
def read(self, path, **kwargs):
method = kwargs.pop('method', 'GET')
response = yield from self.req_handler(method, path, **kwargs)
return response
@task
def write(self, path, **kwargs):
method = kwargs.pop('method', 'POST')
response = yield from self.req_handler(method, path, **kwargs)
return response
@task
def delete(self, path, **kwargs):
method = kwargs.pop('method', 'DELETE')
response = yield from self.req_handler(method, path, **kwargs)
return response
def __repr__(self):
return '<Vault(addr=%r)>' % self.req_handler.addr
| 25.846154 | 70 | 0.621429 | 202 | 1,680 | 5.059406 | 0.262376 | 0.082192 | 0.164384 | 0.129159 | 0.44227 | 0.295499 | 0.295499 | 0.192759 | 0.192759 | 0.192759 | 0 | 0.008065 | 0.261905 | 1,680 | 64 | 71 | 26.25 | 0.816129 | 0 | 0 | 0.346939 | 0 | 0 | 0.029167 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.265306 | false | 0 | 0.061224 | 0.183673 | 0.591837 | 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 |
f4bf1220f5c2ae8aefe49cfbdd4d189a426ccba9 | 121 | py | Python | wsgi.py | pointerish/Brevis | 0cf32b964ad151456bd73ed510ebe41cbbbfbdb7 | [
"MIT"
] | 3 | 2020-10-28T23:16:33.000Z | 2021-10-10T03:53:57.000Z | wsgi.py | pointerish/Brevis | 0cf32b964ad151456bd73ed510ebe41cbbbfbdb7 | [
"MIT"
] | null | null | null | wsgi.py | pointerish/Brevis | 0cf32b964ad151456bd73ed510ebe41cbbbfbdb7 | [
"MIT"
] | null | null | null | from api import app
if __name__ == '__main__':
with open('urls.json', 'w') as fj:
fj.write('')
app.run() | 20.166667 | 38 | 0.561983 | 18 | 121 | 3.333333 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.256198 | 121 | 6 | 39 | 20.166667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0.147541 | 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 |
f4c05a42ec953c452d55a44c9ab74a2e629db782 | 259 | py | Python | Python 2/code/json1.py | gabrielwolf/5-python-kurse | cabc2b6706f6f384963c026749fd39eb042736c6 | [
"MIT"
] | null | null | null | Python 2/code/json1.py | gabrielwolf/5-python-kurse | cabc2b6706f6f384963c026749fd39eb042736c6 | [
"MIT"
] | null | null | null | Python 2/code/json1.py | gabrielwolf/5-python-kurse | cabc2b6706f6f384963c026749fd39eb042736c6 | [
"MIT"
] | null | null | null | import json
data = '''
{
"name" : "Chuck",
"phone" : {
"type" : "intl",
"number" : "+1 734 303 4456"
},
"email" : {
"hide" : "yes"
}
}'''
info = json.loads(data)
print 'Phone:',info["phone"]
print 'Number:',info["phone"]["number"]
| 14.388889 | 39 | 0.490347 | 29 | 259 | 4.37931 | 0.655172 | 0.141732 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.056701 | 0.250965 | 259 | 17 | 40 | 15.235294 | 0.597938 | 0 | 0 | 0 | 0 | 0 | 0.644788 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.066667 | null | null | 0.133333 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f4c98af364b66028736488dbda6874b1d12ba9a4 | 83 | py | Python | str/regex_example.py | gitdummyac/Python | 5bd4acaaa707877822bef5d2b2c0a6f62b19ad8a | [
"MIT"
] | null | null | null | str/regex_example.py | gitdummyac/Python | 5bd4acaaa707877822bef5d2b2c0a6f62b19ad8a | [
"MIT"
] | null | null | null | str/regex_example.py | gitdummyac/Python | 5bd4acaaa707877822bef5d2b2c0a6f62b19ad8a | [
"MIT"
] | null | null | null | import re
txt = "Hello welcome to hacktober fest"
x = re.search("hacktober", txt)
| 16.6 | 39 | 0.710843 | 13 | 83 | 4.538462 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.168675 | 83 | 4 | 40 | 20.75 | 0.855072 | 0 | 0 | 0 | 0 | 0 | 0.481928 | 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 |
f4f6dd9ec34601f8c73911a269e4b2611744f766 | 1,095 | py | Python | week_2/ex1a.py | scodes1/pyneta | 73012860b49488b882898ddf0060e3f662212ed7 | [
"Apache-2.0"
] | null | null | null | week_2/ex1a.py | scodes1/pyneta | 73012860b49488b882898ddf0060e3f662212ed7 | [
"Apache-2.0"
] | null | null | null | week_2/ex1a.py | scodes1/pyneta | 73012860b49488b882898ddf0060e3f662212ed7 | [
"Apache-2.0"
] | null | null | null | from netmiko import ConnectHandler
from getpass import getpass
device1 = {
'host' : 'cisco4.lasthop.io',
'username' : 'pyclass',
'password' : getpass(),
'device_type' : 'cisco_ios',
'global_delay_factor' : 2,
}
net_connect = ConnectHandler(**device1)
print(net_connect.find_prompt())
output = net_connect.send_command_timing(
"ping", strip_prompt=False, strip_command=False
)
output += net_connect.send_command_timing("\n", strip_prompt=False, strip_command=False)
output += net_connect.send_command_timing(
"8.8.8.8", strip_prompt=False, strip_command=False
)
output += net_connect.send_command_timing("\n", strip_prompt=False, strip_command=False)
output += net_connect.send_command_timing("\n", strip_prompt=False, strip_command=False)
output += net_connect.send_command_timing("\n", strip_prompt=False, strip_command=False)
output += net_connect.send_command_timing("\n", strip_prompt=False, strip_command=False)
output += net_connect.send_command_timing("\n", strip_prompt=False, strip_command=False)
net_connect.disconnect()
print()
print(output)
print()
| 32.205882 | 88 | 0.761644 | 148 | 1,095 | 5.310811 | 0.243243 | 0.139949 | 0.16285 | 0.203562 | 0.679389 | 0.679389 | 0.637405 | 0.637405 | 0.637405 | 0.637405 | 0 | 0.008147 | 0.103196 | 1,095 | 33 | 89 | 33.181818 | 0.792261 | 0 | 0 | 0.296296 | 0 | 0 | 0.096981 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.074074 | 0.074074 | 0 | 0.074074 | 0.148148 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
7619f9011026e05240115c2ac1df6ac827fae015 | 187 | py | Python | neodroidagent/utilities/signal/experimental/__init__.py | gitter-badger/agent | 3f53eaa7ebdee3ab423c7b58785d584fe1a6ae11 | [
"Apache-2.0"
] | 8 | 2017-09-13T08:28:44.000Z | 2022-01-21T15:59:19.000Z | neodroidagent/utilities/signal/experimental/__init__.py | gitter-badger/agent | 3f53eaa7ebdee3ab423c7b58785d584fe1a6ae11 | [
"Apache-2.0"
] | 4 | 2019-03-22T13:49:16.000Z | 2019-03-25T13:49:39.000Z | neodroidagent/utilities/signal/experimental/__init__.py | gitter-badger/agent | 3f53eaa7ebdee3ab423c7b58785d584fe1a6ae11 | [
"Apache-2.0"
] | 3 | 2017-09-13T08:31:38.000Z | 2021-11-09T11:22:27.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Christian Heider Nielsen"
__doc__ = ""
from .discounting import *
from .generalised_advantage import *
from .nstep import *
| 18.7 | 39 | 0.705882 | 22 | 187 | 5.590909 | 0.818182 | 0.162602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012658 | 0.15508 | 187 | 9 | 40 | 20.777778 | 0.765823 | 0.229947 | 0 | 0 | 0 | 0 | 0.169014 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
762657929c6d46d8a16c4ce28a8f5a45ac78e34b | 265 | py | Python | forms.py | tecoholic/student_score_graph | d95d40953c1a93c3948db4d4f54591833e259daf | [
"MIT"
] | null | null | null | forms.py | tecoholic/student_score_graph | d95d40953c1a93c3948db4d4f54591833e259daf | [
"MIT"
] | null | null | null | forms.py | tecoholic/student_score_graph | d95d40953c1a93c3948db4d4f54591833e259daf | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
class CSVUploadForm(FlaskForm):
csvfile = FileField(
"CSV Mark Sheet",
validators=[FileRequired(), FileAllowed(["csv"], "CSV Files only!")],
)
| 26.5 | 77 | 0.701887 | 28 | 265 | 6.571429 | 0.642857 | 0.097826 | 0.130435 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.188679 | 265 | 9 | 78 | 29.444444 | 0.855814 | 0 | 0 | 0 | 0 | 0 | 0.120755 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
52018879c474772597c77f6c11266040f80f9146 | 43,183 | py | Python | tests/extension/thread_/mutex_try_lock/test_thread_mutex_try_lock.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/mutex_try_lock/test_thread_mutex_try_lock.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/mutex_try_lock/test_thread_mutex_try_lock.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import thread_mutex_try_lock
expected_verilog = """
module test;
reg CLK;
reg RST;
blinkled
uut
(
.CLK(CLK),
.RST(RST)
);
initial begin
$dumpfile("uut.vcd");
$dumpvars(0, uut);
end
initial begin
CLK = 0;
forever begin
#5 CLK = !CLK;
end
end
initial begin
RST = 0;
#100;
RST = 1;
#100;
RST = 0;
#10000;
$finish;
end
endmodule
module blinkled
(
input CLK,
input RST
);
reg _mymutex_lock_reg;
reg [32-1:0] _mymutex_lock_id;
reg [8-1:0] _th_myfunc_start;
reg [32-1:0] th_blink;
localparam th_blink_init = 0;
reg signed [32-1:0] _th_blink_tid_0;
reg [32-1:0] th_myfunc_0;
localparam th_myfunc_0_init = 0;
reg [32-1:0] th_myfunc_1;
localparam th_myfunc_1_init = 0;
reg [32-1:0] th_myfunc_2;
localparam th_myfunc_2_init = 0;
reg [32-1:0] th_myfunc_3;
localparam th_myfunc_3_init = 0;
reg [32-1:0] th_myfunc_4;
localparam th_myfunc_4_init = 0;
reg [32-1:0] th_myfunc_5;
localparam th_myfunc_5_init = 0;
reg [32-1:0] th_myfunc_6;
localparam th_myfunc_6_init = 0;
reg [32-1:0] th_myfunc_7;
localparam th_myfunc_7_init = 0;
reg _th_myfunc_0_called;
reg signed [32-1:0] _th_myfunc_0_tid_1;
reg signed [32-1:0] _th_myfunc_0_tid_2;
reg _tmp_0;
reg signed [32-1:0] _th_myfunc_0_lock_3;
reg signed [32-1:0] _th_myfunc_0_waitcount_4;
reg _tmp_1;
reg signed [32-1:0] _th_myfunc_0_i_5;
reg _th_myfunc_1_called;
reg signed [32-1:0] _th_myfunc_1_tid_6;
reg signed [32-1:0] _th_myfunc_1_tid_7;
reg _tmp_2;
reg signed [32-1:0] _th_myfunc_1_lock_8;
reg signed [32-1:0] _th_myfunc_1_waitcount_9;
reg _tmp_3;
reg signed [32-1:0] _th_myfunc_1_i_10;
reg _th_myfunc_2_called;
reg signed [32-1:0] _th_myfunc_2_tid_11;
reg signed [32-1:0] _th_myfunc_2_tid_12;
reg _tmp_4;
reg signed [32-1:0] _th_myfunc_2_lock_13;
reg signed [32-1:0] _th_myfunc_2_waitcount_14;
reg _tmp_5;
reg signed [32-1:0] _th_myfunc_2_i_15;
reg _th_myfunc_3_called;
reg signed [32-1:0] _th_myfunc_3_tid_16;
reg signed [32-1:0] _th_myfunc_3_tid_17;
reg _tmp_6;
reg signed [32-1:0] _th_myfunc_3_lock_18;
reg signed [32-1:0] _th_myfunc_3_waitcount_19;
reg _tmp_7;
reg signed [32-1:0] _th_myfunc_3_i_20;
reg _th_myfunc_4_called;
reg signed [32-1:0] _th_myfunc_4_tid_21;
reg signed [32-1:0] _th_myfunc_4_tid_22;
reg _tmp_8;
reg signed [32-1:0] _th_myfunc_4_lock_23;
reg signed [32-1:0] _th_myfunc_4_waitcount_24;
reg _tmp_9;
reg signed [32-1:0] _th_myfunc_4_i_25;
reg _th_myfunc_5_called;
reg signed [32-1:0] _th_myfunc_5_tid_26;
reg signed [32-1:0] _th_myfunc_5_tid_27;
reg _tmp_10;
reg signed [32-1:0] _th_myfunc_5_lock_28;
reg signed [32-1:0] _th_myfunc_5_waitcount_29;
reg _tmp_11;
reg signed [32-1:0] _th_myfunc_5_i_30;
reg _th_myfunc_6_called;
reg signed [32-1:0] _th_myfunc_6_tid_31;
reg signed [32-1:0] _th_myfunc_6_tid_32;
reg _tmp_12;
reg signed [32-1:0] _th_myfunc_6_lock_33;
reg signed [32-1:0] _th_myfunc_6_waitcount_34;
reg _tmp_13;
reg signed [32-1:0] _th_myfunc_6_i_35;
reg _th_myfunc_7_called;
reg signed [32-1:0] _th_myfunc_7_tid_36;
reg signed [32-1:0] _th_myfunc_7_tid_37;
reg _tmp_14;
reg signed [32-1:0] _th_myfunc_7_lock_38;
reg signed [32-1:0] _th_myfunc_7_waitcount_39;
reg _tmp_15;
reg signed [32-1:0] _th_myfunc_7_i_40;
always @(posedge CLK) begin
if(RST) begin
_mymutex_lock_reg <= 0;
_mymutex_lock_id <= 0;
end else begin
if((th_myfunc_0 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 0;
end
if((th_myfunc_0 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 0;
end
if((th_myfunc_0 == 19) && (_mymutex_lock_id == 0)) begin
_mymutex_lock_reg <= 0;
end
if((th_myfunc_1 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 1;
end
if((th_myfunc_1 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 1;
end
if((th_myfunc_1 == 19) && (_mymutex_lock_id == 1)) begin
_mymutex_lock_reg <= 0;
end
if((th_myfunc_2 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 2;
end
if((th_myfunc_2 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 2;
end
if((th_myfunc_2 == 19) && (_mymutex_lock_id == 2)) begin
_mymutex_lock_reg <= 0;
end
if((th_myfunc_3 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 3;
end
if((th_myfunc_3 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 3;
end
if((th_myfunc_3 == 19) && (_mymutex_lock_id == 3)) begin
_mymutex_lock_reg <= 0;
end
if((th_myfunc_4 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 4;
end
if((th_myfunc_4 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 4;
end
if((th_myfunc_4 == 19) && (_mymutex_lock_id == 4)) begin
_mymutex_lock_reg <= 0;
end
if((th_myfunc_5 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 5;
end
if((th_myfunc_5 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 5;
end
if((th_myfunc_5 == 19) && (_mymutex_lock_id == 5)) begin
_mymutex_lock_reg <= 0;
end
if((th_myfunc_6 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 6;
end
if((th_myfunc_6 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 6;
end
if((th_myfunc_6 == 19) && (_mymutex_lock_id == 6)) begin
_mymutex_lock_reg <= 0;
end
if((th_myfunc_7 == 3) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 7;
end
if((th_myfunc_7 == 10) && !_mymutex_lock_reg) begin
_mymutex_lock_reg <= 1;
_mymutex_lock_id <= 7;
end
if((th_myfunc_7 == 19) && (_mymutex_lock_id == 7)) begin
_mymutex_lock_reg <= 0;
end
end
end
localparam th_blink_1 = 1;
localparam th_blink_2 = 2;
localparam th_blink_3 = 3;
localparam th_blink_4 = 4;
localparam th_blink_5 = 5;
localparam th_blink_6 = 6;
localparam th_blink_7 = 7;
localparam th_blink_8 = 8;
localparam th_blink_9 = 9;
localparam th_blink_10 = 10;
localparam th_blink_11 = 11;
always @(posedge CLK) begin
if(RST) begin
th_blink <= th_blink_init;
_th_blink_tid_0 <= 0;
_th_myfunc_start[_th_blink_tid_0] <= (0 >> _th_blink_tid_0) & 1'd1;
end else begin
case(th_blink)
th_blink_init: begin
th_blink <= th_blink_1;
end
th_blink_1: begin
_th_blink_tid_0 <= 0;
th_blink <= th_blink_2;
end
th_blink_2: begin
if(_th_blink_tid_0 < 8) begin
th_blink <= th_blink_3;
end else begin
th_blink <= th_blink_7;
end
end
th_blink_3: begin
_th_myfunc_start[_th_blink_tid_0] <= 1;
th_blink <= th_blink_4;
end
th_blink_4: begin
th_blink <= th_blink_5;
th_blink <= th_blink_5;
th_blink <= th_blink_5;
th_blink <= th_blink_5;
th_blink <= th_blink_5;
th_blink <= th_blink_5;
th_blink <= th_blink_5;
th_blink <= th_blink_5;
end
th_blink_5: begin
_th_myfunc_start[_th_blink_tid_0] <= 0;
th_blink <= th_blink_6;
end
th_blink_6: begin
_th_blink_tid_0 <= _th_blink_tid_0 + 1;
th_blink <= th_blink_2;
end
th_blink_7: begin
_th_blink_tid_0 <= 0;
th_blink <= th_blink_8;
end
th_blink_8: begin
if(_th_blink_tid_0 < 8) begin
th_blink <= th_blink_9;
end else begin
th_blink <= th_blink_11;
end
end
th_blink_9: begin
if((_th_blink_tid_0 == 0)? th_myfunc_0 == 21 :
(_th_blink_tid_0 == 1)? th_myfunc_1 == 21 :
(_th_blink_tid_0 == 2)? th_myfunc_2 == 21 :
(_th_blink_tid_0 == 3)? th_myfunc_3 == 21 :
(_th_blink_tid_0 == 4)? th_myfunc_4 == 21 :
(_th_blink_tid_0 == 5)? th_myfunc_5 == 21 :
(_th_blink_tid_0 == 6)? th_myfunc_6 == 21 :
(_th_blink_tid_0 == 7)? th_myfunc_7 == 21 : 0) begin
th_blink <= th_blink_10;
end
end
th_blink_10: begin
_th_blink_tid_0 <= _th_blink_tid_0 + 1;
th_blink <= th_blink_8;
end
endcase
end
end
localparam th_myfunc_0_1 = 1;
localparam th_myfunc_0_2 = 2;
localparam th_myfunc_0_3 = 3;
localparam th_myfunc_0_4 = 4;
localparam th_myfunc_0_5 = 5;
localparam th_myfunc_0_6 = 6;
localparam th_myfunc_0_7 = 7;
localparam th_myfunc_0_8 = 8;
localparam th_myfunc_0_9 = 9;
localparam th_myfunc_0_10 = 10;
localparam th_myfunc_0_11 = 11;
localparam th_myfunc_0_12 = 12;
localparam th_myfunc_0_13 = 13;
localparam th_myfunc_0_14 = 14;
localparam th_myfunc_0_15 = 15;
localparam th_myfunc_0_16 = 16;
localparam th_myfunc_0_17 = 17;
localparam th_myfunc_0_18 = 18;
localparam th_myfunc_0_19 = 19;
localparam th_myfunc_0_20 = 20;
localparam th_myfunc_0_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_0 <= th_myfunc_0_init;
_th_myfunc_0_called <= 0;
_th_myfunc_0_tid_1 <= 0;
_th_myfunc_0_tid_2 <= 0;
_tmp_0 <= 0;
_th_myfunc_0_lock_3 <= 0;
_th_myfunc_0_waitcount_4 <= 0;
_tmp_1 <= 0;
_th_myfunc_0_i_5 <= 0;
end else begin
case(th_myfunc_0)
th_myfunc_0_init: begin
if(_th_myfunc_start[0] && (th_blink == 4)) begin
_th_myfunc_0_called <= 1;
end
if(_th_myfunc_start[0] && (th_blink == 4)) begin
_th_myfunc_0_tid_1 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[0]) begin
th_myfunc_0 <= th_myfunc_0_1;
end
end
th_myfunc_0_1: begin
_th_myfunc_0_tid_2 <= _th_myfunc_0_tid_1;
th_myfunc_0 <= th_myfunc_0_2;
end
th_myfunc_0_2: begin
$display("-- Thread %d TryLock", _th_myfunc_0_tid_2);
th_myfunc_0 <= th_myfunc_0_3;
end
th_myfunc_0_3: begin
th_myfunc_0 <= th_myfunc_0_4;
end
th_myfunc_0_4: begin
_tmp_0 <= _mymutex_lock_reg & (_mymutex_lock_id == 0);
th_myfunc_0 <= th_myfunc_0_5;
end
th_myfunc_0_5: begin
_th_myfunc_0_lock_3 <= _tmp_0;
th_myfunc_0 <= th_myfunc_0_6;
end
th_myfunc_0_6: begin
_th_myfunc_0_waitcount_4 <= 0;
th_myfunc_0 <= th_myfunc_0_7;
end
th_myfunc_0_7: begin
if(!_th_myfunc_0_lock_3) begin
th_myfunc_0 <= th_myfunc_0_8;
end else begin
th_myfunc_0 <= th_myfunc_0_14;
end
end
th_myfunc_0_8: begin
$display("-- Thread %d TryLock", _th_myfunc_0_tid_2);
th_myfunc_0 <= th_myfunc_0_9;
end
th_myfunc_0_9: begin
_th_myfunc_0_waitcount_4 <= _th_myfunc_0_waitcount_4 + 1;
th_myfunc_0 <= th_myfunc_0_10;
end
th_myfunc_0_10: begin
th_myfunc_0 <= th_myfunc_0_11;
end
th_myfunc_0_11: begin
_tmp_1 <= _mymutex_lock_reg & (_mymutex_lock_id == 0);
th_myfunc_0 <= th_myfunc_0_12;
end
th_myfunc_0_12: begin
_th_myfunc_0_lock_3 <= _tmp_1;
th_myfunc_0 <= th_myfunc_0_13;
end
th_myfunc_0_13: begin
th_myfunc_0 <= th_myfunc_0_7;
end
th_myfunc_0_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_0_tid_2, _th_myfunc_0_waitcount_4);
th_myfunc_0 <= th_myfunc_0_15;
end
th_myfunc_0_15: begin
_th_myfunc_0_i_5 <= 0;
th_myfunc_0 <= th_myfunc_0_16;
end
th_myfunc_0_16: begin
if(_th_myfunc_0_i_5 < 20) begin
th_myfunc_0 <= th_myfunc_0_17;
end else begin
th_myfunc_0 <= th_myfunc_0_18;
end
end
th_myfunc_0_17: begin
_th_myfunc_0_i_5 <= _th_myfunc_0_i_5 + 1;
th_myfunc_0 <= th_myfunc_0_16;
end
th_myfunc_0_18: begin
$display("Thread %d Hello", _th_myfunc_0_tid_2);
th_myfunc_0 <= th_myfunc_0_19;
end
th_myfunc_0_19: begin
th_myfunc_0 <= th_myfunc_0_20;
end
th_myfunc_0_20: begin
$display("Thread %d Unlock", _th_myfunc_0_tid_2);
th_myfunc_0 <= th_myfunc_0_21;
end
endcase
end
end
localparam th_myfunc_1_1 = 1;
localparam th_myfunc_1_2 = 2;
localparam th_myfunc_1_3 = 3;
localparam th_myfunc_1_4 = 4;
localparam th_myfunc_1_5 = 5;
localparam th_myfunc_1_6 = 6;
localparam th_myfunc_1_7 = 7;
localparam th_myfunc_1_8 = 8;
localparam th_myfunc_1_9 = 9;
localparam th_myfunc_1_10 = 10;
localparam th_myfunc_1_11 = 11;
localparam th_myfunc_1_12 = 12;
localparam th_myfunc_1_13 = 13;
localparam th_myfunc_1_14 = 14;
localparam th_myfunc_1_15 = 15;
localparam th_myfunc_1_16 = 16;
localparam th_myfunc_1_17 = 17;
localparam th_myfunc_1_18 = 18;
localparam th_myfunc_1_19 = 19;
localparam th_myfunc_1_20 = 20;
localparam th_myfunc_1_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_1 <= th_myfunc_1_init;
_th_myfunc_1_called <= 0;
_th_myfunc_1_tid_6 <= 0;
_th_myfunc_1_tid_7 <= 0;
_tmp_2 <= 0;
_th_myfunc_1_lock_8 <= 0;
_th_myfunc_1_waitcount_9 <= 0;
_tmp_3 <= 0;
_th_myfunc_1_i_10 <= 0;
end else begin
case(th_myfunc_1)
th_myfunc_1_init: begin
if(_th_myfunc_start[1] && (th_blink == 4)) begin
_th_myfunc_1_called <= 1;
end
if(_th_myfunc_start[1] && (th_blink == 4)) begin
_th_myfunc_1_tid_6 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[1]) begin
th_myfunc_1 <= th_myfunc_1_1;
end
end
th_myfunc_1_1: begin
_th_myfunc_1_tid_7 <= _th_myfunc_1_tid_6;
th_myfunc_1 <= th_myfunc_1_2;
end
th_myfunc_1_2: begin
$display("-- Thread %d TryLock", _th_myfunc_1_tid_7);
th_myfunc_1 <= th_myfunc_1_3;
end
th_myfunc_1_3: begin
th_myfunc_1 <= th_myfunc_1_4;
end
th_myfunc_1_4: begin
_tmp_2 <= _mymutex_lock_reg & (_mymutex_lock_id == 1);
th_myfunc_1 <= th_myfunc_1_5;
end
th_myfunc_1_5: begin
_th_myfunc_1_lock_8 <= _tmp_2;
th_myfunc_1 <= th_myfunc_1_6;
end
th_myfunc_1_6: begin
_th_myfunc_1_waitcount_9 <= 0;
th_myfunc_1 <= th_myfunc_1_7;
end
th_myfunc_1_7: begin
if(!_th_myfunc_1_lock_8) begin
th_myfunc_1 <= th_myfunc_1_8;
end else begin
th_myfunc_1 <= th_myfunc_1_14;
end
end
th_myfunc_1_8: begin
$display("-- Thread %d TryLock", _th_myfunc_1_tid_7);
th_myfunc_1 <= th_myfunc_1_9;
end
th_myfunc_1_9: begin
_th_myfunc_1_waitcount_9 <= _th_myfunc_1_waitcount_9 + 1;
th_myfunc_1 <= th_myfunc_1_10;
end
th_myfunc_1_10: begin
th_myfunc_1 <= th_myfunc_1_11;
end
th_myfunc_1_11: begin
_tmp_3 <= _mymutex_lock_reg & (_mymutex_lock_id == 1);
th_myfunc_1 <= th_myfunc_1_12;
end
th_myfunc_1_12: begin
_th_myfunc_1_lock_8 <= _tmp_3;
th_myfunc_1 <= th_myfunc_1_13;
end
th_myfunc_1_13: begin
th_myfunc_1 <= th_myfunc_1_7;
end
th_myfunc_1_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_1_tid_7, _th_myfunc_1_waitcount_9);
th_myfunc_1 <= th_myfunc_1_15;
end
th_myfunc_1_15: begin
_th_myfunc_1_i_10 <= 0;
th_myfunc_1 <= th_myfunc_1_16;
end
th_myfunc_1_16: begin
if(_th_myfunc_1_i_10 < 20) begin
th_myfunc_1 <= th_myfunc_1_17;
end else begin
th_myfunc_1 <= th_myfunc_1_18;
end
end
th_myfunc_1_17: begin
_th_myfunc_1_i_10 <= _th_myfunc_1_i_10 + 1;
th_myfunc_1 <= th_myfunc_1_16;
end
th_myfunc_1_18: begin
$display("Thread %d Hello", _th_myfunc_1_tid_7);
th_myfunc_1 <= th_myfunc_1_19;
end
th_myfunc_1_19: begin
th_myfunc_1 <= th_myfunc_1_20;
end
th_myfunc_1_20: begin
$display("Thread %d Unlock", _th_myfunc_1_tid_7);
th_myfunc_1 <= th_myfunc_1_21;
end
endcase
end
end
localparam th_myfunc_2_1 = 1;
localparam th_myfunc_2_2 = 2;
localparam th_myfunc_2_3 = 3;
localparam th_myfunc_2_4 = 4;
localparam th_myfunc_2_5 = 5;
localparam th_myfunc_2_6 = 6;
localparam th_myfunc_2_7 = 7;
localparam th_myfunc_2_8 = 8;
localparam th_myfunc_2_9 = 9;
localparam th_myfunc_2_10 = 10;
localparam th_myfunc_2_11 = 11;
localparam th_myfunc_2_12 = 12;
localparam th_myfunc_2_13 = 13;
localparam th_myfunc_2_14 = 14;
localparam th_myfunc_2_15 = 15;
localparam th_myfunc_2_16 = 16;
localparam th_myfunc_2_17 = 17;
localparam th_myfunc_2_18 = 18;
localparam th_myfunc_2_19 = 19;
localparam th_myfunc_2_20 = 20;
localparam th_myfunc_2_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_2 <= th_myfunc_2_init;
_th_myfunc_2_called <= 0;
_th_myfunc_2_tid_11 <= 0;
_th_myfunc_2_tid_12 <= 0;
_tmp_4 <= 0;
_th_myfunc_2_lock_13 <= 0;
_th_myfunc_2_waitcount_14 <= 0;
_tmp_5 <= 0;
_th_myfunc_2_i_15 <= 0;
end else begin
case(th_myfunc_2)
th_myfunc_2_init: begin
if(_th_myfunc_start[2] && (th_blink == 4)) begin
_th_myfunc_2_called <= 1;
end
if(_th_myfunc_start[2] && (th_blink == 4)) begin
_th_myfunc_2_tid_11 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[2]) begin
th_myfunc_2 <= th_myfunc_2_1;
end
end
th_myfunc_2_1: begin
_th_myfunc_2_tid_12 <= _th_myfunc_2_tid_11;
th_myfunc_2 <= th_myfunc_2_2;
end
th_myfunc_2_2: begin
$display("-- Thread %d TryLock", _th_myfunc_2_tid_12);
th_myfunc_2 <= th_myfunc_2_3;
end
th_myfunc_2_3: begin
th_myfunc_2 <= th_myfunc_2_4;
end
th_myfunc_2_4: begin
_tmp_4 <= _mymutex_lock_reg & (_mymutex_lock_id == 2);
th_myfunc_2 <= th_myfunc_2_5;
end
th_myfunc_2_5: begin
_th_myfunc_2_lock_13 <= _tmp_4;
th_myfunc_2 <= th_myfunc_2_6;
end
th_myfunc_2_6: begin
_th_myfunc_2_waitcount_14 <= 0;
th_myfunc_2 <= th_myfunc_2_7;
end
th_myfunc_2_7: begin
if(!_th_myfunc_2_lock_13) begin
th_myfunc_2 <= th_myfunc_2_8;
end else begin
th_myfunc_2 <= th_myfunc_2_14;
end
end
th_myfunc_2_8: begin
$display("-- Thread %d TryLock", _th_myfunc_2_tid_12);
th_myfunc_2 <= th_myfunc_2_9;
end
th_myfunc_2_9: begin
_th_myfunc_2_waitcount_14 <= _th_myfunc_2_waitcount_14 + 1;
th_myfunc_2 <= th_myfunc_2_10;
end
th_myfunc_2_10: begin
th_myfunc_2 <= th_myfunc_2_11;
end
th_myfunc_2_11: begin
_tmp_5 <= _mymutex_lock_reg & (_mymutex_lock_id == 2);
th_myfunc_2 <= th_myfunc_2_12;
end
th_myfunc_2_12: begin
_th_myfunc_2_lock_13 <= _tmp_5;
th_myfunc_2 <= th_myfunc_2_13;
end
th_myfunc_2_13: begin
th_myfunc_2 <= th_myfunc_2_7;
end
th_myfunc_2_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_2_tid_12, _th_myfunc_2_waitcount_14);
th_myfunc_2 <= th_myfunc_2_15;
end
th_myfunc_2_15: begin
_th_myfunc_2_i_15 <= 0;
th_myfunc_2 <= th_myfunc_2_16;
end
th_myfunc_2_16: begin
if(_th_myfunc_2_i_15 < 20) begin
th_myfunc_2 <= th_myfunc_2_17;
end else begin
th_myfunc_2 <= th_myfunc_2_18;
end
end
th_myfunc_2_17: begin
_th_myfunc_2_i_15 <= _th_myfunc_2_i_15 + 1;
th_myfunc_2 <= th_myfunc_2_16;
end
th_myfunc_2_18: begin
$display("Thread %d Hello", _th_myfunc_2_tid_12);
th_myfunc_2 <= th_myfunc_2_19;
end
th_myfunc_2_19: begin
th_myfunc_2 <= th_myfunc_2_20;
end
th_myfunc_2_20: begin
$display("Thread %d Unlock", _th_myfunc_2_tid_12);
th_myfunc_2 <= th_myfunc_2_21;
end
endcase
end
end
localparam th_myfunc_3_1 = 1;
localparam th_myfunc_3_2 = 2;
localparam th_myfunc_3_3 = 3;
localparam th_myfunc_3_4 = 4;
localparam th_myfunc_3_5 = 5;
localparam th_myfunc_3_6 = 6;
localparam th_myfunc_3_7 = 7;
localparam th_myfunc_3_8 = 8;
localparam th_myfunc_3_9 = 9;
localparam th_myfunc_3_10 = 10;
localparam th_myfunc_3_11 = 11;
localparam th_myfunc_3_12 = 12;
localparam th_myfunc_3_13 = 13;
localparam th_myfunc_3_14 = 14;
localparam th_myfunc_3_15 = 15;
localparam th_myfunc_3_16 = 16;
localparam th_myfunc_3_17 = 17;
localparam th_myfunc_3_18 = 18;
localparam th_myfunc_3_19 = 19;
localparam th_myfunc_3_20 = 20;
localparam th_myfunc_3_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_3 <= th_myfunc_3_init;
_th_myfunc_3_called <= 0;
_th_myfunc_3_tid_16 <= 0;
_th_myfunc_3_tid_17 <= 0;
_tmp_6 <= 0;
_th_myfunc_3_lock_18 <= 0;
_th_myfunc_3_waitcount_19 <= 0;
_tmp_7 <= 0;
_th_myfunc_3_i_20 <= 0;
end else begin
case(th_myfunc_3)
th_myfunc_3_init: begin
if(_th_myfunc_start[3] && (th_blink == 4)) begin
_th_myfunc_3_called <= 1;
end
if(_th_myfunc_start[3] && (th_blink == 4)) begin
_th_myfunc_3_tid_16 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[3]) begin
th_myfunc_3 <= th_myfunc_3_1;
end
end
th_myfunc_3_1: begin
_th_myfunc_3_tid_17 <= _th_myfunc_3_tid_16;
th_myfunc_3 <= th_myfunc_3_2;
end
th_myfunc_3_2: begin
$display("-- Thread %d TryLock", _th_myfunc_3_tid_17);
th_myfunc_3 <= th_myfunc_3_3;
end
th_myfunc_3_3: begin
th_myfunc_3 <= th_myfunc_3_4;
end
th_myfunc_3_4: begin
_tmp_6 <= _mymutex_lock_reg & (_mymutex_lock_id == 3);
th_myfunc_3 <= th_myfunc_3_5;
end
th_myfunc_3_5: begin
_th_myfunc_3_lock_18 <= _tmp_6;
th_myfunc_3 <= th_myfunc_3_6;
end
th_myfunc_3_6: begin
_th_myfunc_3_waitcount_19 <= 0;
th_myfunc_3 <= th_myfunc_3_7;
end
th_myfunc_3_7: begin
if(!_th_myfunc_3_lock_18) begin
th_myfunc_3 <= th_myfunc_3_8;
end else begin
th_myfunc_3 <= th_myfunc_3_14;
end
end
th_myfunc_3_8: begin
$display("-- Thread %d TryLock", _th_myfunc_3_tid_17);
th_myfunc_3 <= th_myfunc_3_9;
end
th_myfunc_3_9: begin
_th_myfunc_3_waitcount_19 <= _th_myfunc_3_waitcount_19 + 1;
th_myfunc_3 <= th_myfunc_3_10;
end
th_myfunc_3_10: begin
th_myfunc_3 <= th_myfunc_3_11;
end
th_myfunc_3_11: begin
_tmp_7 <= _mymutex_lock_reg & (_mymutex_lock_id == 3);
th_myfunc_3 <= th_myfunc_3_12;
end
th_myfunc_3_12: begin
_th_myfunc_3_lock_18 <= _tmp_7;
th_myfunc_3 <= th_myfunc_3_13;
end
th_myfunc_3_13: begin
th_myfunc_3 <= th_myfunc_3_7;
end
th_myfunc_3_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_3_tid_17, _th_myfunc_3_waitcount_19);
th_myfunc_3 <= th_myfunc_3_15;
end
th_myfunc_3_15: begin
_th_myfunc_3_i_20 <= 0;
th_myfunc_3 <= th_myfunc_3_16;
end
th_myfunc_3_16: begin
if(_th_myfunc_3_i_20 < 20) begin
th_myfunc_3 <= th_myfunc_3_17;
end else begin
th_myfunc_3 <= th_myfunc_3_18;
end
end
th_myfunc_3_17: begin
_th_myfunc_3_i_20 <= _th_myfunc_3_i_20 + 1;
th_myfunc_3 <= th_myfunc_3_16;
end
th_myfunc_3_18: begin
$display("Thread %d Hello", _th_myfunc_3_tid_17);
th_myfunc_3 <= th_myfunc_3_19;
end
th_myfunc_3_19: begin
th_myfunc_3 <= th_myfunc_3_20;
end
th_myfunc_3_20: begin
$display("Thread %d Unlock", _th_myfunc_3_tid_17);
th_myfunc_3 <= th_myfunc_3_21;
end
endcase
end
end
localparam th_myfunc_4_1 = 1;
localparam th_myfunc_4_2 = 2;
localparam th_myfunc_4_3 = 3;
localparam th_myfunc_4_4 = 4;
localparam th_myfunc_4_5 = 5;
localparam th_myfunc_4_6 = 6;
localparam th_myfunc_4_7 = 7;
localparam th_myfunc_4_8 = 8;
localparam th_myfunc_4_9 = 9;
localparam th_myfunc_4_10 = 10;
localparam th_myfunc_4_11 = 11;
localparam th_myfunc_4_12 = 12;
localparam th_myfunc_4_13 = 13;
localparam th_myfunc_4_14 = 14;
localparam th_myfunc_4_15 = 15;
localparam th_myfunc_4_16 = 16;
localparam th_myfunc_4_17 = 17;
localparam th_myfunc_4_18 = 18;
localparam th_myfunc_4_19 = 19;
localparam th_myfunc_4_20 = 20;
localparam th_myfunc_4_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_4 <= th_myfunc_4_init;
_th_myfunc_4_called <= 0;
_th_myfunc_4_tid_21 <= 0;
_th_myfunc_4_tid_22 <= 0;
_tmp_8 <= 0;
_th_myfunc_4_lock_23 <= 0;
_th_myfunc_4_waitcount_24 <= 0;
_tmp_9 <= 0;
_th_myfunc_4_i_25 <= 0;
end else begin
case(th_myfunc_4)
th_myfunc_4_init: begin
if(_th_myfunc_start[4] && (th_blink == 4)) begin
_th_myfunc_4_called <= 1;
end
if(_th_myfunc_start[4] && (th_blink == 4)) begin
_th_myfunc_4_tid_21 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[4]) begin
th_myfunc_4 <= th_myfunc_4_1;
end
end
th_myfunc_4_1: begin
_th_myfunc_4_tid_22 <= _th_myfunc_4_tid_21;
th_myfunc_4 <= th_myfunc_4_2;
end
th_myfunc_4_2: begin
$display("-- Thread %d TryLock", _th_myfunc_4_tid_22);
th_myfunc_4 <= th_myfunc_4_3;
end
th_myfunc_4_3: begin
th_myfunc_4 <= th_myfunc_4_4;
end
th_myfunc_4_4: begin
_tmp_8 <= _mymutex_lock_reg & (_mymutex_lock_id == 4);
th_myfunc_4 <= th_myfunc_4_5;
end
th_myfunc_4_5: begin
_th_myfunc_4_lock_23 <= _tmp_8;
th_myfunc_4 <= th_myfunc_4_6;
end
th_myfunc_4_6: begin
_th_myfunc_4_waitcount_24 <= 0;
th_myfunc_4 <= th_myfunc_4_7;
end
th_myfunc_4_7: begin
if(!_th_myfunc_4_lock_23) begin
th_myfunc_4 <= th_myfunc_4_8;
end else begin
th_myfunc_4 <= th_myfunc_4_14;
end
end
th_myfunc_4_8: begin
$display("-- Thread %d TryLock", _th_myfunc_4_tid_22);
th_myfunc_4 <= th_myfunc_4_9;
end
th_myfunc_4_9: begin
_th_myfunc_4_waitcount_24 <= _th_myfunc_4_waitcount_24 + 1;
th_myfunc_4 <= th_myfunc_4_10;
end
th_myfunc_4_10: begin
th_myfunc_4 <= th_myfunc_4_11;
end
th_myfunc_4_11: begin
_tmp_9 <= _mymutex_lock_reg & (_mymutex_lock_id == 4);
th_myfunc_4 <= th_myfunc_4_12;
end
th_myfunc_4_12: begin
_th_myfunc_4_lock_23 <= _tmp_9;
th_myfunc_4 <= th_myfunc_4_13;
end
th_myfunc_4_13: begin
th_myfunc_4 <= th_myfunc_4_7;
end
th_myfunc_4_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_4_tid_22, _th_myfunc_4_waitcount_24);
th_myfunc_4 <= th_myfunc_4_15;
end
th_myfunc_4_15: begin
_th_myfunc_4_i_25 <= 0;
th_myfunc_4 <= th_myfunc_4_16;
end
th_myfunc_4_16: begin
if(_th_myfunc_4_i_25 < 20) begin
th_myfunc_4 <= th_myfunc_4_17;
end else begin
th_myfunc_4 <= th_myfunc_4_18;
end
end
th_myfunc_4_17: begin
_th_myfunc_4_i_25 <= _th_myfunc_4_i_25 + 1;
th_myfunc_4 <= th_myfunc_4_16;
end
th_myfunc_4_18: begin
$display("Thread %d Hello", _th_myfunc_4_tid_22);
th_myfunc_4 <= th_myfunc_4_19;
end
th_myfunc_4_19: begin
th_myfunc_4 <= th_myfunc_4_20;
end
th_myfunc_4_20: begin
$display("Thread %d Unlock", _th_myfunc_4_tid_22);
th_myfunc_4 <= th_myfunc_4_21;
end
endcase
end
end
localparam th_myfunc_5_1 = 1;
localparam th_myfunc_5_2 = 2;
localparam th_myfunc_5_3 = 3;
localparam th_myfunc_5_4 = 4;
localparam th_myfunc_5_5 = 5;
localparam th_myfunc_5_6 = 6;
localparam th_myfunc_5_7 = 7;
localparam th_myfunc_5_8 = 8;
localparam th_myfunc_5_9 = 9;
localparam th_myfunc_5_10 = 10;
localparam th_myfunc_5_11 = 11;
localparam th_myfunc_5_12 = 12;
localparam th_myfunc_5_13 = 13;
localparam th_myfunc_5_14 = 14;
localparam th_myfunc_5_15 = 15;
localparam th_myfunc_5_16 = 16;
localparam th_myfunc_5_17 = 17;
localparam th_myfunc_5_18 = 18;
localparam th_myfunc_5_19 = 19;
localparam th_myfunc_5_20 = 20;
localparam th_myfunc_5_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_5 <= th_myfunc_5_init;
_th_myfunc_5_called <= 0;
_th_myfunc_5_tid_26 <= 0;
_th_myfunc_5_tid_27 <= 0;
_tmp_10 <= 0;
_th_myfunc_5_lock_28 <= 0;
_th_myfunc_5_waitcount_29 <= 0;
_tmp_11 <= 0;
_th_myfunc_5_i_30 <= 0;
end else begin
case(th_myfunc_5)
th_myfunc_5_init: begin
if(_th_myfunc_start[5] && (th_blink == 4)) begin
_th_myfunc_5_called <= 1;
end
if(_th_myfunc_start[5] && (th_blink == 4)) begin
_th_myfunc_5_tid_26 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[5]) begin
th_myfunc_5 <= th_myfunc_5_1;
end
end
th_myfunc_5_1: begin
_th_myfunc_5_tid_27 <= _th_myfunc_5_tid_26;
th_myfunc_5 <= th_myfunc_5_2;
end
th_myfunc_5_2: begin
$display("-- Thread %d TryLock", _th_myfunc_5_tid_27);
th_myfunc_5 <= th_myfunc_5_3;
end
th_myfunc_5_3: begin
th_myfunc_5 <= th_myfunc_5_4;
end
th_myfunc_5_4: begin
_tmp_10 <= _mymutex_lock_reg & (_mymutex_lock_id == 5);
th_myfunc_5 <= th_myfunc_5_5;
end
th_myfunc_5_5: begin
_th_myfunc_5_lock_28 <= _tmp_10;
th_myfunc_5 <= th_myfunc_5_6;
end
th_myfunc_5_6: begin
_th_myfunc_5_waitcount_29 <= 0;
th_myfunc_5 <= th_myfunc_5_7;
end
th_myfunc_5_7: begin
if(!_th_myfunc_5_lock_28) begin
th_myfunc_5 <= th_myfunc_5_8;
end else begin
th_myfunc_5 <= th_myfunc_5_14;
end
end
th_myfunc_5_8: begin
$display("-- Thread %d TryLock", _th_myfunc_5_tid_27);
th_myfunc_5 <= th_myfunc_5_9;
end
th_myfunc_5_9: begin
_th_myfunc_5_waitcount_29 <= _th_myfunc_5_waitcount_29 + 1;
th_myfunc_5 <= th_myfunc_5_10;
end
th_myfunc_5_10: begin
th_myfunc_5 <= th_myfunc_5_11;
end
th_myfunc_5_11: begin
_tmp_11 <= _mymutex_lock_reg & (_mymutex_lock_id == 5);
th_myfunc_5 <= th_myfunc_5_12;
end
th_myfunc_5_12: begin
_th_myfunc_5_lock_28 <= _tmp_11;
th_myfunc_5 <= th_myfunc_5_13;
end
th_myfunc_5_13: begin
th_myfunc_5 <= th_myfunc_5_7;
end
th_myfunc_5_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_5_tid_27, _th_myfunc_5_waitcount_29);
th_myfunc_5 <= th_myfunc_5_15;
end
th_myfunc_5_15: begin
_th_myfunc_5_i_30 <= 0;
th_myfunc_5 <= th_myfunc_5_16;
end
th_myfunc_5_16: begin
if(_th_myfunc_5_i_30 < 20) begin
th_myfunc_5 <= th_myfunc_5_17;
end else begin
th_myfunc_5 <= th_myfunc_5_18;
end
end
th_myfunc_5_17: begin
_th_myfunc_5_i_30 <= _th_myfunc_5_i_30 + 1;
th_myfunc_5 <= th_myfunc_5_16;
end
th_myfunc_5_18: begin
$display("Thread %d Hello", _th_myfunc_5_tid_27);
th_myfunc_5 <= th_myfunc_5_19;
end
th_myfunc_5_19: begin
th_myfunc_5 <= th_myfunc_5_20;
end
th_myfunc_5_20: begin
$display("Thread %d Unlock", _th_myfunc_5_tid_27);
th_myfunc_5 <= th_myfunc_5_21;
end
endcase
end
end
localparam th_myfunc_6_1 = 1;
localparam th_myfunc_6_2 = 2;
localparam th_myfunc_6_3 = 3;
localparam th_myfunc_6_4 = 4;
localparam th_myfunc_6_5 = 5;
localparam th_myfunc_6_6 = 6;
localparam th_myfunc_6_7 = 7;
localparam th_myfunc_6_8 = 8;
localparam th_myfunc_6_9 = 9;
localparam th_myfunc_6_10 = 10;
localparam th_myfunc_6_11 = 11;
localparam th_myfunc_6_12 = 12;
localparam th_myfunc_6_13 = 13;
localparam th_myfunc_6_14 = 14;
localparam th_myfunc_6_15 = 15;
localparam th_myfunc_6_16 = 16;
localparam th_myfunc_6_17 = 17;
localparam th_myfunc_6_18 = 18;
localparam th_myfunc_6_19 = 19;
localparam th_myfunc_6_20 = 20;
localparam th_myfunc_6_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_6 <= th_myfunc_6_init;
_th_myfunc_6_called <= 0;
_th_myfunc_6_tid_31 <= 0;
_th_myfunc_6_tid_32 <= 0;
_tmp_12 <= 0;
_th_myfunc_6_lock_33 <= 0;
_th_myfunc_6_waitcount_34 <= 0;
_tmp_13 <= 0;
_th_myfunc_6_i_35 <= 0;
end else begin
case(th_myfunc_6)
th_myfunc_6_init: begin
if(_th_myfunc_start[6] && (th_blink == 4)) begin
_th_myfunc_6_called <= 1;
end
if(_th_myfunc_start[6] && (th_blink == 4)) begin
_th_myfunc_6_tid_31 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[6]) begin
th_myfunc_6 <= th_myfunc_6_1;
end
end
th_myfunc_6_1: begin
_th_myfunc_6_tid_32 <= _th_myfunc_6_tid_31;
th_myfunc_6 <= th_myfunc_6_2;
end
th_myfunc_6_2: begin
$display("-- Thread %d TryLock", _th_myfunc_6_tid_32);
th_myfunc_6 <= th_myfunc_6_3;
end
th_myfunc_6_3: begin
th_myfunc_6 <= th_myfunc_6_4;
end
th_myfunc_6_4: begin
_tmp_12 <= _mymutex_lock_reg & (_mymutex_lock_id == 6);
th_myfunc_6 <= th_myfunc_6_5;
end
th_myfunc_6_5: begin
_th_myfunc_6_lock_33 <= _tmp_12;
th_myfunc_6 <= th_myfunc_6_6;
end
th_myfunc_6_6: begin
_th_myfunc_6_waitcount_34 <= 0;
th_myfunc_6 <= th_myfunc_6_7;
end
th_myfunc_6_7: begin
if(!_th_myfunc_6_lock_33) begin
th_myfunc_6 <= th_myfunc_6_8;
end else begin
th_myfunc_6 <= th_myfunc_6_14;
end
end
th_myfunc_6_8: begin
$display("-- Thread %d TryLock", _th_myfunc_6_tid_32);
th_myfunc_6 <= th_myfunc_6_9;
end
th_myfunc_6_9: begin
_th_myfunc_6_waitcount_34 <= _th_myfunc_6_waitcount_34 + 1;
th_myfunc_6 <= th_myfunc_6_10;
end
th_myfunc_6_10: begin
th_myfunc_6 <= th_myfunc_6_11;
end
th_myfunc_6_11: begin
_tmp_13 <= _mymutex_lock_reg & (_mymutex_lock_id == 6);
th_myfunc_6 <= th_myfunc_6_12;
end
th_myfunc_6_12: begin
_th_myfunc_6_lock_33 <= _tmp_13;
th_myfunc_6 <= th_myfunc_6_13;
end
th_myfunc_6_13: begin
th_myfunc_6 <= th_myfunc_6_7;
end
th_myfunc_6_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_6_tid_32, _th_myfunc_6_waitcount_34);
th_myfunc_6 <= th_myfunc_6_15;
end
th_myfunc_6_15: begin
_th_myfunc_6_i_35 <= 0;
th_myfunc_6 <= th_myfunc_6_16;
end
th_myfunc_6_16: begin
if(_th_myfunc_6_i_35 < 20) begin
th_myfunc_6 <= th_myfunc_6_17;
end else begin
th_myfunc_6 <= th_myfunc_6_18;
end
end
th_myfunc_6_17: begin
_th_myfunc_6_i_35 <= _th_myfunc_6_i_35 + 1;
th_myfunc_6 <= th_myfunc_6_16;
end
th_myfunc_6_18: begin
$display("Thread %d Hello", _th_myfunc_6_tid_32);
th_myfunc_6 <= th_myfunc_6_19;
end
th_myfunc_6_19: begin
th_myfunc_6 <= th_myfunc_6_20;
end
th_myfunc_6_20: begin
$display("Thread %d Unlock", _th_myfunc_6_tid_32);
th_myfunc_6 <= th_myfunc_6_21;
end
endcase
end
end
localparam th_myfunc_7_1 = 1;
localparam th_myfunc_7_2 = 2;
localparam th_myfunc_7_3 = 3;
localparam th_myfunc_7_4 = 4;
localparam th_myfunc_7_5 = 5;
localparam th_myfunc_7_6 = 6;
localparam th_myfunc_7_7 = 7;
localparam th_myfunc_7_8 = 8;
localparam th_myfunc_7_9 = 9;
localparam th_myfunc_7_10 = 10;
localparam th_myfunc_7_11 = 11;
localparam th_myfunc_7_12 = 12;
localparam th_myfunc_7_13 = 13;
localparam th_myfunc_7_14 = 14;
localparam th_myfunc_7_15 = 15;
localparam th_myfunc_7_16 = 16;
localparam th_myfunc_7_17 = 17;
localparam th_myfunc_7_18 = 18;
localparam th_myfunc_7_19 = 19;
localparam th_myfunc_7_20 = 20;
localparam th_myfunc_7_21 = 21;
always @(posedge CLK) begin
if(RST) begin
th_myfunc_7 <= th_myfunc_7_init;
_th_myfunc_7_called <= 0;
_th_myfunc_7_tid_36 <= 0;
_th_myfunc_7_tid_37 <= 0;
_tmp_14 <= 0;
_th_myfunc_7_lock_38 <= 0;
_th_myfunc_7_waitcount_39 <= 0;
_tmp_15 <= 0;
_th_myfunc_7_i_40 <= 0;
end else begin
case(th_myfunc_7)
th_myfunc_7_init: begin
if(_th_myfunc_start[7] && (th_blink == 4)) begin
_th_myfunc_7_called <= 1;
end
if(_th_myfunc_start[7] && (th_blink == 4)) begin
_th_myfunc_7_tid_36 <= _th_blink_tid_0;
end
if((th_blink == 4) && _th_myfunc_start[7]) begin
th_myfunc_7 <= th_myfunc_7_1;
end
end
th_myfunc_7_1: begin
_th_myfunc_7_tid_37 <= _th_myfunc_7_tid_36;
th_myfunc_7 <= th_myfunc_7_2;
end
th_myfunc_7_2: begin
$display("-- Thread %d TryLock", _th_myfunc_7_tid_37);
th_myfunc_7 <= th_myfunc_7_3;
end
th_myfunc_7_3: begin
th_myfunc_7 <= th_myfunc_7_4;
end
th_myfunc_7_4: begin
_tmp_14 <= _mymutex_lock_reg & (_mymutex_lock_id == 7);
th_myfunc_7 <= th_myfunc_7_5;
end
th_myfunc_7_5: begin
_th_myfunc_7_lock_38 <= _tmp_14;
th_myfunc_7 <= th_myfunc_7_6;
end
th_myfunc_7_6: begin
_th_myfunc_7_waitcount_39 <= 0;
th_myfunc_7 <= th_myfunc_7_7;
end
th_myfunc_7_7: begin
if(!_th_myfunc_7_lock_38) begin
th_myfunc_7 <= th_myfunc_7_8;
end else begin
th_myfunc_7 <= th_myfunc_7_14;
end
end
th_myfunc_7_8: begin
$display("-- Thread %d TryLock", _th_myfunc_7_tid_37);
th_myfunc_7 <= th_myfunc_7_9;
end
th_myfunc_7_9: begin
_th_myfunc_7_waitcount_39 <= _th_myfunc_7_waitcount_39 + 1;
th_myfunc_7 <= th_myfunc_7_10;
end
th_myfunc_7_10: begin
th_myfunc_7 <= th_myfunc_7_11;
end
th_myfunc_7_11: begin
_tmp_15 <= _mymutex_lock_reg & (_mymutex_lock_id == 7);
th_myfunc_7 <= th_myfunc_7_12;
end
th_myfunc_7_12: begin
_th_myfunc_7_lock_38 <= _tmp_15;
th_myfunc_7 <= th_myfunc_7_13;
end
th_myfunc_7_13: begin
th_myfunc_7 <= th_myfunc_7_7;
end
th_myfunc_7_14: begin
$display("Thread %d Lock: waitcount=%d", _th_myfunc_7_tid_37, _th_myfunc_7_waitcount_39);
th_myfunc_7 <= th_myfunc_7_15;
end
th_myfunc_7_15: begin
_th_myfunc_7_i_40 <= 0;
th_myfunc_7 <= th_myfunc_7_16;
end
th_myfunc_7_16: begin
if(_th_myfunc_7_i_40 < 20) begin
th_myfunc_7 <= th_myfunc_7_17;
end else begin
th_myfunc_7 <= th_myfunc_7_18;
end
end
th_myfunc_7_17: begin
_th_myfunc_7_i_40 <= _th_myfunc_7_i_40 + 1;
th_myfunc_7 <= th_myfunc_7_16;
end
th_myfunc_7_18: begin
$display("Thread %d Hello", _th_myfunc_7_tid_37);
th_myfunc_7 <= th_myfunc_7_19;
end
th_myfunc_7_19: begin
th_myfunc_7 <= th_myfunc_7_20;
end
th_myfunc_7_20: begin
$display("Thread %d Unlock", _th_myfunc_7_tid_37);
th_myfunc_7 <= th_myfunc_7_21;
end
endcase
end
end
endmodule
"""
def test():
veriloggen.reset()
test_module = thread_mutex_try_lock.mkTest()
code = test_module.to_verilog()
from pyverilog.vparser.parser import VerilogParser
from pyverilog.ast_code_generator.codegen import ASTCodeGenerator
parser = VerilogParser()
expected_ast = parser.parse(expected_verilog)
codegen = ASTCodeGenerator()
expected_code = codegen.visit(expected_ast)
assert(expected_code == code)
| 30.889127 | 99 | 0.611931 | 6,956 | 43,183 | 3.203997 | 0.016532 | 0.380491 | 0.142146 | 0.022883 | 0.842195 | 0.625163 | 0.537982 | 0.433078 | 0.330148 | 0.27774 | 0 | 0.108487 | 0.310747 | 43,183 | 1,397 | 100 | 30.911238 | 0.640304 | 0 | 0 | 0.364775 | 0 | 0 | 0.986245 | 0.058171 | 0 | 0 | 0 | 0 | 0.000737 | 1 | 0.000737 | false | 0 | 0.004422 | 0 | 0.005158 | 0.000737 | 0 | 0 | 0 | null | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5232c89174d7545d58073dde916fe3b501931f46 | 277 | py | Python | rsa_demo/stubs/pyasn1/type/univ.py | jlinoff/rsa_demo | 8babffab271bf58ca944ab9ff8743af26dc3c9b1 | [
"MIT"
] | 2 | 2019-12-04T22:38:44.000Z | 2020-04-11T06:47:06.000Z | rsa_demo/stubs/pyasn1/type/univ.py | jlinoff/rsa_demo | 8babffab271bf58ca944ab9ff8743af26dc3c9b1 | [
"MIT"
] | null | null | null | rsa_demo/stubs/pyasn1/type/univ.py | jlinoff/rsa_demo | 8babffab271bf58ca944ab9ff8743af26dc3c9b1 | [
"MIT"
] | null | null | null | # Really hackey stubs, not suitable for typeshed.
from typing import Any
class Integer():
def __init__(self, value: Any = None) -> None: ...
class Sequence():
def __init__(self) -> None: ...
def setComponentByPosition(self, idx: int, value: Any) -> None: ...
| 27.7 | 71 | 0.649819 | 34 | 277 | 5.058824 | 0.647059 | 0.081395 | 0.127907 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.205776 | 277 | 9 | 72 | 30.777778 | 0.781818 | 0.169675 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0.166667 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
5256f8c0d04ee6af4a341be08c61fb9e7dcd7730 | 165 | py | Python | study_notes/proga_mod.py | chicolucio/python_useful_tips | 3a17a77f0f89923ba087188d4acfaadd1d1bfeea | [
"MIT"
] | null | null | null | study_notes/proga_mod.py | chicolucio/python_useful_tips | 3a17a77f0f89923ba087188d4acfaadd1d1bfeea | [
"MIT"
] | null | null | null | study_notes/proga_mod.py | chicolucio/python_useful_tips | 3a17a77f0f89923ba087188d4acfaadd1d1bfeea | [
"MIT"
] | null | null | null | print('Begin', __name__)
print('Defines fA')
def fA():
print('Inside fA')
if __name__ == "__main__":
print('Calls fA')
fA()
print('End', __name__)
| 11 | 26 | 0.593939 | 21 | 165 | 3.904762 | 0.52381 | 0.170732 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212121 | 165 | 14 | 27 | 11.785714 | 0.630769 | 0 | 0 | 0 | 0 | 0 | 0.260606 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | true | 0 | 0 | 0 | 0.125 | 0.625 | 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 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
526d4d40cd6f4c695d138adad233c6be53e5ca14 | 359 | py | Python | tutorials/W1D3_MultiLayerPerceptrons/solutions/W1D3_Tutorial1_Solution_d58d2933.py | amita-kapoor/course-content-dl | bba5c8f6fa38a83c4e452be30791f3a6399d5b83 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 473 | 2021-04-13T18:27:42.000Z | 2022-03-28T14:14:35.000Z | tutorials/W1D3_MultiLayerPerceptrons/solutions/W1D3_Tutorial1_Solution_d58d2933.py | amita-kapoor/course-content-dl | bba5c8f6fa38a83c4e452be30791f3a6399d5b83 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 399 | 2021-06-07T20:56:59.000Z | 2022-01-26T23:05:06.000Z | tutorials/W1D3_MultiLayerPerceptrons/solutions/W1D3_Tutorial1_Solution_d58d2933.py | amita-kapoor/course-content-dl | bba5c8f6fa38a83c4e452be30791f3a6399d5b83 | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 170 | 2021-04-16T11:09:32.000Z | 2022-03-31T12:13:52.000Z |
"""
At infinite membrane resistance, the Neuron does not leak any current out,
and hence it starts firing with the slightest input current,
This shifts the transfer function towards 0, similar to ReLU activation (centered at 0).
Also, when there is minimal refractory time, the neuron can keep firing
at a high input current which avoids the saturation.
"""; | 44.875 | 88 | 0.788301 | 57 | 359 | 4.964912 | 0.789474 | 0.063604 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006667 | 0.164345 | 359 | 8 | 89 | 44.875 | 0.936667 | 0.972145 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
527a60539e80aabfa5ad82b97a6806b4bb9a6026 | 3,546 | py | Python | tests/test_benchmark_config.py | chayim/redisbench-admin | 11ca257c8d3f3af3cd1cd95ee2b2dedf366a807f | [
"Apache-2.0"
] | null | null | null | tests/test_benchmark_config.py | chayim/redisbench-admin | 11ca257c8d3f3af3cd1cd95ee2b2dedf366a807f | [
"Apache-2.0"
] | null | null | null | tests/test_benchmark_config.py | chayim/redisbench-admin | 11ca257c8d3f3af3cd1cd95ee2b2dedf366a807f | [
"Apache-2.0"
] | null | null | null | import json
import yaml
from redisbench_admin.utils.benchmark_config import (
results_dict_kpi_check,
check_required_modules,
extract_redis_dbconfig_parameters,
)
def test_results_dict_kpi_check():
return_code = results_dict_kpi_check({}, {}, 0)
assert return_code == 0
return_code = results_dict_kpi_check({}, {}, 1)
assert return_code == 1
with open(
"./tests/test_data/redisgraph-benchmark-go-result.json", "r"
) as result_fd:
results_dict = json.load(result_fd)
with open(
"./tests/test_data/redisgraph-benchmark-go-defaults.yml", "r"
) as config_fd:
benchmark_config = yaml.safe_load(config_fd)
return_code = results_dict_kpi_check(benchmark_config, results_dict, 0)
assert return_code == 0
with open(
"./tests/test_data/redisgraph-benchmark-go-bad-kpis.yml", "r"
) as config_fd:
benchmark_config = yaml.safe_load(config_fd)
return_code = results_dict_kpi_check(benchmark_config, results_dict, 0)
assert return_code == 1
def test_check_required_modules():
check_required_modules([], [])
try:
check_required_modules(["s"], ["search"])
except Exception as e:
assert "Unable to detect required module" in e.__str__()
try:
check_required_modules([], ["search"])
except Exception as e:
assert "Unable to detect required module" in e.__str__()
check_required_modules(["search", "ReJSON", "TimeSeries"], ["search"])
check_required_modules(["search", "ReJSON", "TimeSeries"], ["search", "TimeSeries"])
def test_extract_redis_configuration_parameters():
with open(
"./tests/test_data/redisgraph-benchmark-go-defaults.yml", "r"
) as config_fd:
benchmark_config = yaml.safe_load(config_fd)
(
redis_configuration_parameters,
dataset_load_timeout_secs,
) = extract_redis_dbconfig_parameters(benchmark_config, "dbconfig")
assert redis_configuration_parameters == {}
assert dataset_load_timeout_secs == 120
with open(
"./tests/test_data/tsbs-devops-ingestion-scale100-4days-keyspace.yml", "r"
) as config_fd:
benchmark_config = yaml.safe_load(config_fd)
(
redis_configuration_parameters,
dataset_load_timeout_secs,
) = extract_redis_dbconfig_parameters(benchmark_config, "dbconfig")
assert dataset_load_timeout_secs == 120
assert redis_configuration_parameters == {
"notify-keyspace-events": "KEA",
"timeout": 0,
}
with open(
"./tests/test_data/redisgraph-benchmark-go-defaults.yml", "r"
) as config_fd:
benchmark_config = yaml.safe_load(config_fd)
(
redis_configuration_parameters,
dataset_load_timeout_secs,
) = extract_redis_dbconfig_parameters(benchmark_config, "dbconfig")
assert redis_configuration_parameters == {}
assert dataset_load_timeout_secs == 120
with open(
"./tests/test_data/redisgraph-benchmark-go-dataset-timeout.yml", "r"
) as config_fd:
benchmark_config = yaml.safe_load(config_fd)
(
redis_configuration_parameters,
dataset_load_timeout_secs,
) = extract_redis_dbconfig_parameters(benchmark_config, "dbconfig")
assert dataset_load_timeout_secs == 1200
| 37.326316 | 88 | 0.64608 | 394 | 3,546 | 5.431472 | 0.180203 | 0.091122 | 0.104673 | 0.082243 | 0.765421 | 0.757009 | 0.728505 | 0.683645 | 0.654206 | 0.633645 | 0 | 0.00986 | 0.256345 | 3,546 | 94 | 89 | 37.723404 | 0.801669 | 0 | 0 | 0.614458 | 0 | 0 | 0.172307 | 0.118161 | 0 | 0 | 0 | 0 | 0.156627 | 1 | 0.036145 | false | 0 | 0.036145 | 0 | 0.072289 | 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 |
5287530feaff051b883de6c50b928b9265f12103 | 1,664 | py | Python | tests/test_static_maze.py | agarwalishika/two-d-nav-gym | 7b16d16d6944f1ac7b832137096ab56cc5228b2f | [
"MIT"
] | 2 | 2021-09-09T15:59:32.000Z | 2021-09-09T16:03:48.000Z | tests/test_static_maze.py | agarwalishika/two-d-nav-gym | 7b16d16d6944f1ac7b832137096ab56cc5228b2f | [
"MIT"
] | null | null | null | tests/test_static_maze.py | agarwalishika/two-d-nav-gym | 7b16d16d6944f1ac7b832137096ab56cc5228b2f | [
"MIT"
] | null | null | null | import numpy as np
from two_d_nav.envs.static_maze import StaticMazeNavigation
def test_goal():
env = StaticMazeNavigation()
for i in range(60):
obs, reward, done, _ = env.step(np.array([1.0, -0.1]))
env.render()
for i in range(30):
obs, reward, done, _ = env.step(np.array([-1.0, -0.5]))
env.render()
for i in range(5):
obs, reward, done, _ = env.step(np.array([0.0, -1.0]))
env.render()
for i in range(15):
obs, reward, done, _ = env.step(np.array([-1.0, 0.0]))
env.render()
for i in range(30):
obs, reward, done, _ = env.step(np.array([0.0, -1.0]))
env.render()
for i in range(18):
obs, reward, done, _ = env.step(np.array([-1.0, -0.6]))
env.render()
if done:
print(f"Reach goal: {obs}")
print(f"Reward: {reward}")
def test_obstacle():
env = StaticMazeNavigation()
for i in range(60):
obs, reward, done, _ = env.step(np.array([1.0, -0.1]))
env.render()
for i in range(5):
obs, reward, done, _ = env.step(np.array([0.0, -1.0]))
env.render()
for i in range(30):
obs, reward, done, _ = env.step(np.array([-1.0, 0.0]))
env.render()
if done:
print(f"Hit obstacle: {obs}")
print(f"Reward: {reward}")
def test_wall():
env = StaticMazeNavigation()
reward = 0.0
for i in range(20):
obs, reward, done, _ = env.step(np.array([-1.0, 0.0]))
env.render()
print(f"Hit wall reward {reward}")
if __name__ == '__main__':
test_goal()
test_obstacle()
test_wall()
| 22.794521 | 63 | 0.53125 | 248 | 1,664 | 3.455645 | 0.177419 | 0.032672 | 0.070012 | 0.128355 | 0.740957 | 0.740957 | 0.70245 | 0.637106 | 0.637106 | 0.637106 | 0 | 0.051064 | 0.29387 | 1,664 | 72 | 64 | 23.111111 | 0.678298 | 0 | 0 | 0.64 | 0 | 0 | 0.060096 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.06 | false | 0 | 0.04 | 0 | 0.1 | 0.1 | 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 |
bfecc16ed4f1a523424ef2baa4157fca46f28b44 | 259 | py | Python | servicelayerdms/exceptions.py | DimensionDataCBUSydney/servicelayer-dms-python | 9fd28223fb7a2a2bfb144d5047d3c505b5175ae4 | [
"Apache-2.0"
] | null | null | null | servicelayerdms/exceptions.py | DimensionDataCBUSydney/servicelayer-dms-python | 9fd28223fb7a2a2bfb144d5047d3c505b5175ae4 | [
"Apache-2.0"
] | null | null | null | servicelayerdms/exceptions.py | DimensionDataCBUSydney/servicelayer-dms-python | 9fd28223fb7a2a2bfb144d5047d3c505b5175ae4 | [
"Apache-2.0"
] | null | null | null | class DmsRequestError(Exception):
def __init__(self, error_message, status_code):
self.message = "Error requesting DMS API %s with code %s" \
% (error_message, status_code)
super(DmsRequestError, self).__init__(self.message)
| 43.166667 | 67 | 0.683398 | 30 | 259 | 5.5 | 0.533333 | 0.09697 | 0.218182 | 0.266667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.216216 | 259 | 5 | 68 | 51.8 | 0.812808 | 0 | 0 | 0 | 0 | 0 | 0.15444 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.4 | 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 |
bfef9d0f02f12a417622fbc30f923a0fe176cb9c | 166 | py | Python | scripts/src/keyword.py | Artie18/goto | b31ad5044a894e33ad330fb0d01fa9e116cfddeb | [
"Apache-2.0"
] | null | null | null | scripts/src/keyword.py | Artie18/goto | b31ad5044a894e33ad330fb0d01fa9e116cfddeb | [
"Apache-2.0"
] | null | null | null | scripts/src/keyword.py | Artie18/goto | b31ad5044a894e33ad330fb0d01fa9e116cfddeb | [
"Apache-2.0"
] | null | null | null | class Keyword:
def __init__(self, keyword):
if keyword in ['add', 'find']:
self.value = keyword
else:
self.value = 'find'
| 23.714286 | 38 | 0.512048 | 18 | 166 | 4.5 | 0.611111 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.36747 | 166 | 6 | 39 | 27.666667 | 0.771429 | 0 | 0 | 0 | 0 | 0 | 0.066265 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
bffa85e9bedbc5efa7cc9534442416b01817938b | 95 | py | Python | sourcecode/pathwaysearch/fingerprint/__init__.py | CC-SXF/PyMiner | d103d54eeaa5653c8f8bc03f78fd4a96e0acefe7 | [
"MIT"
] | 2 | 2022-01-20T07:38:00.000Z | 2022-01-20T07:56:39.000Z | sourcecode/pathwaysearch/fingerprint/__init__.py | CC-SXF/PyMiner | d103d54eeaa5653c8f8bc03f78fd4a96e0acefe7 | [
"MIT"
] | null | null | null | sourcecode/pathwaysearch/fingerprint/__init__.py | CC-SXF/PyMiner | d103d54eeaa5653c8f8bc03f78fd4a96e0acefe7 | [
"MIT"
] | 1 | 2022-01-11T14:29:48.000Z | 2022-01-11T14:29:48.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 28 10:15:21 2021
@author: CC-SXF
"""
| 10.555556 | 36 | 0.505263 | 15 | 95 | 3.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.191176 | 0.284211 | 95 | 8 | 37 | 11.875 | 0.514706 | 0.789474 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
870a18d23ecfa11d93e662286c89a4d7d8fe6f2e | 328 | py | Python | python_handler.py | toddcooke/aws-lambda-function-cold-start-time | a5abced3718aaa73c0cc42f827647549a72fda71 | [
"MIT"
] | null | null | null | python_handler.py | toddcooke/aws-lambda-function-cold-start-time | a5abced3718aaa73c0cc42f827647549a72fda71 | [
"MIT"
] | null | null | null | python_handler.py | toddcooke/aws-lambda-function-cold-start-time | a5abced3718aaa73c0cc42f827647549a72fda71 | [
"MIT"
] | null | null | null | # import datetime
# import logging
# logger = logging.getLogger(__name__)
# logger.setLevel(logging.INFO)
def run(event, context):
# current_time = datetime.datetime.now().time()
# name = context.function_name
# logger.info("Your cron function " + name + " ran at " + str(current_time))
return "hello world!"
| 25.230769 | 80 | 0.685976 | 40 | 328 | 5.45 | 0.6 | 0.091743 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179878 | 328 | 12 | 81 | 27.333333 | 0.810409 | 0.753049 | 0 | 0 | 0 | 0 | 0.164384 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 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 |
870dbc44ca3ddd2e95df266b346d82599c7bb3ea | 1,069 | py | Python | lib/geovista/__init__.py | trexfeathers/geovista | f11a7a54ef11d8542be632c29f9fe6653572879e | [
"BSD-3-Clause"
] | 11 | 2021-05-12T08:45:51.000Z | 2022-03-15T11:45:22.000Z | lib/geovista/__init__.py | trexfeathers/geovista | f11a7a54ef11d8542be632c29f9fe6653572879e | [
"BSD-3-Clause"
] | 13 | 2021-11-22T17:10:20.000Z | 2022-03-29T08:10:51.000Z | lib/geovista/__init__.py | trexfeathers/geovista | f11a7a54ef11d8542be632c29f9fe6653572879e | [
"BSD-3-Clause"
] | 5 | 2021-05-14T13:36:00.000Z | 2022-03-08T11:49:20.000Z | from os import environ
from pathlib import Path
from appdirs import user_cache_dir
from ._version import version as __version__ # noqa: F401
from .bridge import Transform # noqa: F401
from .core import combine # noqa: F401
from .geodesic import BBox, line, panel, wedge # noqa: F401
from .geometry import get_coastlines # noqa: F401
from .geoplotter import GeoBackgroundPlotter, GeoMultiPlotter, GeoPlotter # noqa: F401
from .log import get_logger
# Configure the top-level logger.
logger = get_logger(__name__)
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
_cache_dir = Path(environ.get("XDG_CACHE_HOME", user_cache_dir())) / __package__
#: GeoVista configuration dictionary.
config = dict(cache_dir=_cache_dir)
try:
from .siteconfig import update_config as _update_config
_update_config(config)
del _update_config
except ImportError:
pass
try:
from geovista_config import update_config as _update_config
_update_config(config)
del _update_config
except ImportError:
pass
del _cache_dir
| 26.725 | 87 | 0.781104 | 143 | 1,069 | 5.531469 | 0.412587 | 0.121365 | 0.091024 | 0.050569 | 0.217446 | 0.217446 | 0.217446 | 0.217446 | 0.217446 | 0.217446 | 0 | 0.01989 | 0.153414 | 1,069 | 39 | 88 | 27.410256 | 0.854144 | 0.196445 | 0 | 0.384615 | 0 | 0 | 0.01649 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.076923 | 0.538462 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
871332137eb3d17fcc5d980cab9a1e1de4de3d41 | 1,657 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/ControlStyles.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/Windows/Forms/__init___parts/ControlStyles.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/Windows/Forms/__init___parts/ControlStyles.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class ControlStyles(Enum,IComparable,IFormattable,IConvertible):
"""
Specifies the style and behavior of a control.
enum (flags) ControlStyles,values: AllPaintingInWmPaint (8192),CacheText (16384),ContainerControl (1),DoubleBuffer (65536),EnableNotifyMessage (32768),FixedHeight (64),FixedWidth (32),Opaque (4),OptimizedDoubleBuffer (131072),ResizeRedraw (16),Selectable (512),StandardClick (256),StandardDoubleClick (4096),SupportsTransparentBackColor (2048),UserMouse (1024),UserPaint (2),UseTextForAccessibility (262144)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
def __format__(self,*args):
""" __format__(formattable: IFormattable,format: str) -> str """
pass
def __ge__(self,*args):
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __le__(self,*args):
pass
def __lt__(self,*args):
pass
def __ne__(self,*args):
pass
def __reduce_ex__(self,*args):
pass
def __str__(self,*args):
pass
AllPaintingInWmPaint=None
CacheText=None
ContainerControl=None
DoubleBuffer=None
EnableNotifyMessage=None
FixedHeight=None
FixedWidth=None
Opaque=None
OptimizedDoubleBuffer=None
ResizeRedraw=None
Selectable=None
StandardClick=None
StandardDoubleClick=None
SupportsTransparentBackColor=None
UserMouse=None
UserPaint=None
UseTextForAccessibility=None
value__=None
| 32.490196 | 409 | 0.731442 | 186 | 1,657 | 6.005376 | 0.413978 | 0.07162 | 0.075201 | 0.080573 | 0.115488 | 0.115488 | 0.115488 | 0.101164 | 0.101164 | 0.101164 | 0 | 0.040673 | 0.139409 | 1,657 | 50 | 410 | 33.14 | 0.742637 | 0.473748 | 0 | 0.25641 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25641 | false | 0.25641 | 0 | 0 | 0.74359 | 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 |
8719077594c4ee561b05b1f90d93c6bca7fc1d70 | 23 | py | Python | vpc_hyp2/ansible/roles/vm_create/files/variables.py | dhanraj-vedanth/IaaS_VPC_CDN | 262dbc7db63d5e76398dadc8015256fb37986e36 | [
"MIT"
] | null | null | null | vpc_hyp2/ansible/roles/vm_create/files/variables.py | dhanraj-vedanth/IaaS_VPC_CDN | 262dbc7db63d5e76398dadc8015256fb37986e36 | [
"MIT"
] | null | null | null | vpc_hyp2/ansible/roles/vm_create/files/variables.py | dhanraj-vedanth/IaaS_VPC_CDN | 262dbc7db63d5e76398dadc8015256fb37986e36 | [
"MIT"
] | null | null | null |
dom_list = ['an_h1']
| 5.75 | 20 | 0.565217 | 4 | 23 | 2.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.055556 | 0.217391 | 23 | 3 | 21 | 7.666667 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0.238095 | 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 |
8726ffb07f7ca1189ea73517ad7af10fd540bf6c | 58 | py | Python | todo/__init__.py | maxios/gtd.py | afe91405c8f5ba7fc6cdd46e1818559b2a6079d3 | [
"BSD-3-Clause"
] | null | null | null | todo/__init__.py | maxios/gtd.py | afe91405c8f5ba7fc6cdd46e1818559b2a6079d3 | [
"BSD-3-Clause"
] | null | null | null | todo/__init__.py | maxios/gtd.py | afe91405c8f5ba7fc6cdd46e1818559b2a6079d3 | [
"BSD-3-Clause"
] | null | null | null | '''gtd.py'''
__version__ = '0.7.0'
__author__ = 'delucks'
| 14.5 | 22 | 0.62069 | 8 | 58 | 3.5 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 0.12069 | 58 | 3 | 23 | 19.333333 | 0.490196 | 0.103448 | 0 | 0 | 0 | 0 | 0.26087 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8747368931826c6a70cd078a736cf5cc4deabb4f | 175 | py | Python | problem0116.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0116.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | problem0116.py | kmarcini/Project-Euler-Python | d644e8e1ec4fac70a9ab407ad5e1f0a75547c8d3 | [
"BSD-3-Clause"
] | null | null | null | ###########################
#
# #116 Red, green or blue tiles - Project Euler
# https://projecteuler.net/problem=116
#
# Code by Kevin Marciniak
#
###########################
| 19.444444 | 47 | 0.48 | 17 | 175 | 4.941176 | 0.941176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.039216 | 0.125714 | 175 | 8 | 48 | 21.875 | 0.509804 | 0.6 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
8749210b10b6c1b7dc00fe6d7d2356679b07cd0f | 7,569 | py | Python | src_adsabs/ads_dataviz.py | mlares/iate_audit | 3ae8aff2b3de853d43619c592ac8cedf0ff35591 | [
"MIT"
] | null | null | null | src_adsabs/ads_dataviz.py | mlares/iate_audit | 3ae8aff2b3de853d43619c592ac8cedf0ff35591 | [
"MIT"
] | null | null | null | src_adsabs/ads_dataviz.py | mlares/iate_audit | 3ae8aff2b3de853d43619c592ac8cedf0ff35591 | [
"MIT"
] | null | null | null | import numpy as np
import pickle
import pandas as pd
import random
from matplotlib import pyplot as plt
from plot_styles import *
# #################################################################
# Load data
# #################################################################
df_papers_auth = pickle.load(open('../dat/df_papers_auth.pk', 'rb'))
df_papers_auth_top = pickle.load(open('../dat/df_papers_auth_top.pk', 'rb'))
df_papers_inst = pickle.load(open('../dat/df_papers_inst.pk', 'rb'))
df_papers_inst_top = pickle.load(open('../dat/df_papers_inst_top.pk', 'rb'))
# #################################################################
# Visualization of metrics
# #################################################################
# Number of papers and proceedings per year ··························
y = df_papers_inst.year.values
y = [int(a) for a in y]
t = np.arange(int(min(y))-0.5, int(max(y))+0.5, 1)
fig = plt.figure(figsize=(8, 5))
ax = fig.add_subplot()
H = ax.hist(y, bins=t)
ymax = max(H[0])
ax.set_xlabel('year')
ax.set_ylabel('published works')
ax.set_title('works published by IATE')
ax.set_ylim(0, ymax)
ax.grid()
fout = ("../plt/papers_per_year.png")
fig.savefig(fout)
plt.close()
# Number of papers in top journals per year ·································
y = df_papers_inst_top.year.values
y = [int(a) for a in y]
t = np.arange(int(min(y))-0.5, int(max(y))+0.5, 1)
fig = plt.figure(figsize=(8, 5))
ax = fig.add_subplot()
ax.hist(y, bins=t)
ax.set_xlabel('year')
ax.set_ylabel('published papers')
ax.set_title('Papers published by IATE in top journals')
ax.set_ylim(0, ymax)
ax.grid()
fout = ("../plt/papers_top_per_year.png")
fig.savefig(fout)
plt.close()
# cumulative number of papers per author ··························
# including proceedings, normalized to the first paper
tedges = np.arange(-0.5, 20.5, 1)
tmeans = np.arange(0, 20, 1)
fig = plt.figure(figsize=(14, 7))
ax = fig.add_subplot()
cycling_attrs()
y_max = 0
auth_names = list(df_papers_inst.author1.unique())
for a in auth_names:
df = df_papers_inst[df_papers_inst['author1'].isin([a])]
y = [int(i) for i in df.year.values]
if len(y)==0:
continue
y = np.array(y)
y = y - min(y)
H = np.histogram(y, bins=tedges)
ac = H[0].cumsum()
y_max = max(y_max, max(ac))
aesthetics = aes_attrs()
ax.plot(tmeans, ac, label=a, **aesthetics)
ax.set_title('Cumulative works published by IATE researchers')
ax.set_xlabel('years since first publication')
ax.set_ylabel('cumulative number of papers')
ax.set_ylim(0, y_max)
ax.legend(loc=2, ncol=2, fontsize='small', frameon=False,
handlelength=6)
fout = ("../plt/papers_by_author_zero.png")
fig.savefig(fout)
plt.close()
# cumulative number of papers per author ··························
# excluding proceedings, normalized to the first paper
tedges = np.arange(-0.5, 20.5, 1)
tmeans = np.arange(0, 20, 1)
fig = plt.figure(figsize=(14, 7))
ax = fig.add_subplot()
cycling_attrs()
auth_names = list(df_papers_inst.author1.unique())
for a in auth_names:
df = df_papers_inst_top[df_papers_inst_top['author1'].isin([a])]
y = [int(i) for i in df.year.values]
if len(y)==0:
continue
y = np.array(y)
y = y - min(y)
H = np.histogram(y, bins=tedges)
ac = H[0].cumsum()
aesthetics = aes_attrs()
ax.plot(tmeans, ac, label=a, **aesthetics)
ax.set_title('Cumulative papers published by IATE researchers')
ax.set_xlabel('years since first publication')
ax.set_ylabel('cumulative number of papers in journals')
ax.set_ylim(0, y_max)
ax.legend(loc=2, ncol=2, fontsize='small', frameon=False,
handlelength=6)
fout = ("../plt/papers_by_author_top_zero.png")
fig.savefig(fout)
plt.close()
# cumulative number of papers per author ··························
# including proceedings
tedges = np.arange(1995, 2021, 1)
tmeans = np.arange(1995, 2020, 1)
fig = plt.figure(figsize=(14, 7))
ax = fig.add_subplot()
cycling_attrs()
y_max = 0
auth_names = list(df_papers_inst.author1.unique())
for a in auth_names:
df = df_papers_inst[df_papers_inst['author1'].isin([a])]
y = [int(i) for i in df.year.values]
if len(y)==0:
continue
y = np.array(y)
H = np.histogram(y, bins=tedges)
ac = H[0].cumsum()
y_max = max(y_max, max(ac))
aesthetics = aes_attrs()
ax.plot(tmeans, ac, label=a, **aesthetics)
ax.set_title('Cumulative works published by IATE researchers')
ax.set_xlabel('year')
ax.set_ylabel('cumulative number of papers')
ax.set_ylim(0, y_max)
ax.legend(loc=2, ncol=2, fontsize='small', frameon=False,
handlelength=6)
fout = ("../plt/papers_by_author.png")
fig.savefig(fout)
plt.close()
# cumulative number of papers per author ··························
# excluding proceedings
tedges = np.arange(1995, 2021, 1)
tmeans = np.arange(1995, 2020, 1)
fig = plt.figure(figsize=(14, 7))
ax = fig.add_subplot()
cycling_attrs()
auth_names = list(df_papers_inst.author1.unique())
for a in auth_names:
df = df_papers_inst_top[df_papers_inst_top['author1'].isin([a])]
y = [int(i) for i in df.year.values]
if len(y)==0:
continue
y = np.array(y)
H = np.histogram(y, bins=tedges)
ac = H[0].cumsum()
aesthetics = aes_attrs()
ax.plot(tmeans, ac, label=a, **aesthetics)
ax.set_title('Cumulative papers published by IATE researchers')
ax.set_xlabel('year')
ax.set_ylabel('cumulative number of papers in journals')
ax.set_ylim(0, y_max)
ax.legend(loc=2, ncol=2, fontsize='small', frameon=False,
handlelength=6)
fout = ("../plt/papers_by_author_top.png")
fig.savefig(fout)
plt.close()
# number of authors vs citations vs years ·······················
npapers = df_papers_inst_top.shape[0]
na = []
nc = []
ye = []
for i in range(npapers):
df = df_papers_inst_top.iloc[i]
nauths = len(df.authors)
ncitas = df.citation_count
year = df.year
r = random.random()*0.6 - 0.3
na.append(nauths+r)
r = random.random()*0.6 - 0.3
nc.append(ncitas+1+r)
ye.append(int(year))
y = ((np.array(ye)-1980)*0.2)**2.6
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot()
ax.scatter(na, nc, s=y, color=(0, 0, 1, 0.3))
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_xlabel('Number of authors')
ax.set_ylabel('Number of citations + 1')
ax.legend(loc='center left', bbox_to_anchor=(1.1, 0.5), labelspacing=3)
fout = ("../plt/nauth_ncitas_year.png")
fig.savefig(fout)
plt.close()
# publications top and total ·······················
tod = []
top = []
auth_names = list(df_papers_inst.author1.unique())
for a in auth_names:
dfa = df_papers_inst[df_papers_inst['author1'].isin([a])]
dft = df_papers_inst_top[df_papers_inst_top['author1'].isin([a])]
tod.append(dfa.shape[0])
top.append(dft.shape[0])
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot()
ax.scatter(tod, top)
m = max(tod)
ax.plot([0,m],[0,m])
ax.set_title('all works vs. top papers')
ax.set_xlabel('all works')
ax.set_ylabel('papers top')
fout = ("../plt/top_vs_all.png")
fig.savefig(fout)
plt.close()
# Violin plot for number of authors vs. year ························
nauth = []
for i, p in df_papers_inst.iterrows():
nauth.append(len(p.authors))
fig = plt.figure(figsize=(10, 5))
ax = fig.add_subplot()
years = [int(y) for y in df_papers_inst.year.values]
ax.scatter(years, nauth)
ax.set_yscale('log')
ax.set_title('number of authors per year')
ax.set_xlabel('year')
ax.set_ylabel('N authors')
fout = ("../plt/year_nauth.png")
fig.savefig(fout)
plt.close()
| 24.105096 | 77 | 0.631788 | 1,218 | 7,569 | 3.975369 | 0.137931 | 0.036142 | 0.066915 | 0.034077 | 0.759603 | 0.736266 | 0.717679 | 0.674102 | 0.643123 | 0.635688 | 0 | 0.025498 | 0.150218 | 7,569 | 313 | 78 | 24.182109 | 0.691076 | 0.10292 | 0 | 0.681373 | 0 | 0 | 0.162029 | 0.054727 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.029412 | 0 | 0.029412 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.