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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
03da40ca52b18498d3bb6d386faee2f3052292fa | 20,665 | py | Python | flask_user/forms.py | brunoresende1991/mult | e62e949a021db92ca74a9023423724ab26b583d7 | [
"BSD-2-Clause"
] | 5 | 2019-07-09T13:48:18.000Z | 2021-05-04T19:19:25.000Z | flask_user/forms.py | brunoresende1991/mult | e62e949a021db92ca74a9023423724ab26b583d7 | [
"BSD-2-Clause"
] | null | null | null | flask_user/forms.py | brunoresende1991/mult | e62e949a021db92ca74a9023423724ab26b583d7 | [
"BSD-2-Clause"
] | 2 | 2020-07-10T15:06:05.000Z | 2020-09-08T15:52:51.000Z | """ This file defines and validates Flask-User forms. Forms are
based on the WTForms module.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE.txt for more details."""
import string
from flask import current_app
from flask_login import current_user
# Flask-WTF v0.13 renamed Flask to FlaskForm
try:
from flask_wtf import FlaskForm # Try Flask-WTF v0.13+
except ImportError:
from flask_wtf import Form as FlaskForm # Fallback to Flask-WTF v0.12 or older # noqa
from wtforms import BooleanField, HiddenField, PasswordField, SubmitField
from wtforms import validators, ValidationError, StringField
from .translations import lazy_gettext as _
# **************************
# ** Validation Functions **
# **************************
def password_validator(form, field):
""" Password must have one lowercase letter,
one uppercase letter and one digit. """
# Convert string to list of characters
password = list(field.data)
password_length = len(password)
# Count lowercase, uppercase and numbers
lowers = uppers = digits = 0
for ch in password:
if ch.islower():
lowers += 1
if ch.isupper():
uppers += 1
if ch.isdigit():
digits += 1
# Password must have one lowercase letter,
# one uppercase letter and one digit
is_valid = password_length >= 6 and lowers and uppers and digits
if not is_valid:
raise ValidationError(_('Password must have at least 6 characters'
' with one lowercase letter, one uppercase'
' letter and one number'))
def theme_validator(form, field):
theme = field.data
if theme not in ['red', 'blue', 'green']:
raise ValidationError(_("Theme must be red, blue or green. "
"Please choose one of these."))
def username_validator(form, field):
""" Username must cont at least 3 alphanumeric characters long"""
username = field.data
if len(username) < 3:
raise ValidationError(_('Username must be at least 3 characters long'))
valid_chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._' # noqa
chars = list(username)
for char in chars:
if char not in valid_chars:
raise ValidationError(_("Username may only contain letters, "
"numbers, '-', '.' and '_'"))
def unique_username_validator(form, field):
""" Username must be unique"""
user_manager = current_app.user_manager
if not user_manager.username_is_available(field.data):
raise ValidationError(_('This Username is already in use. '
'Please try another one.'))
def unique_tenant_validator(form, field):
""" Tenant must be unique"""
user_manager = current_app.user_manager
if not user_manager.tenant_is_available(field.data):
raise ValidationError(_('This Tenant is already in use.'
' Please try another one.'))
def unique_email_validator(form, field):
""" Username must be unique"""
user_manager = current_app.user_manager
if not user_manager.email_is_available(field.data):
raise ValidationError(_('This Email is already in use. '
'Please try another one.'))
# ***********
# ** Forms **
# ***********
class AddEmailForm(FlaskForm):
email = StringField(_('Email'), validators=[
validators.DataRequired(_('Email is required')),
validators.Email(_('Invalid Email')),
unique_email_validator])
submit = SubmitField(_('Add Email'))
class ChangePasswordForm(FlaskForm):
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
new_password = PasswordField(_('New Password'), validators=[
validators.DataRequired(_('New Password is required')),
])
retype_password = PasswordField(_('Retype New Password'), validators=[
validators.EqualTo('new_password', message=_('New Password and Retype '
'Password did not match'))
])
next = HiddenField()
submit = SubmitField(_('Change password'))
def validate(self):
# Use feature config to remove unused form fields
user_manager = current_app.user_manager
if not user_manager.enable_retype_password:
delattr(self, 'retype_password')
# Add custom password validator if needed
has_been_added = False
for v in self.new_password.validators:
if v == user_manager.password_validator:
has_been_added = True
if not has_been_added:
self.new_password.validators.append(
user_manager.password_validator)
# Validate field-validators
if not super(ChangePasswordForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class ChangeThemeForm(FlaskForm):
new_theme = StringField(_('New Theme'), validators=[
validators.DataRequired(_('Theme is required')),
theme_validator,
])
old_tenant = StringField(_('Old Tenant'), validators=[
validators.DataRequired(_('Tenant is required')),
])
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
next = HiddenField()
submit = SubmitField(_('Change theme'))
def validate(self):
user_manager = current_app.user_manager
# Validate field-validators
if not super(ChangeThemeForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class AddTenantForm(FlaskForm):
new_tenant = StringField(_('New Tenant'), validators=[
validators.DataRequired(_('Tenant is required')),
unique_tenant_validator,
])
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
next = HiddenField()
submit = SubmitField(_('Add tenant'))
def validate(self):
user_manager = current_app.user_manager
# Validate field-validators
if not super(AddTenantForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class EditTenantForm(FlaskForm):
old_tenant = StringField(_('Old Tenant'), validators=[
validators.DataRequired(_('Tenant is required')),
])
new_alias = StringField(_('New Alias'), validators=[
validators.DataRequired(_('Alias is required')),
unique_tenant_validator,
])
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
next = HiddenField()
submit = SubmitField(_('Edit tenant'))
def validate(self):
user_manager = current_app.user_manager
# Validate field-validators
if not super(EditTenantForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class AddTenantUserForm(FlaskForm):
old_tenant = StringField(_('Old Tenant'), validators=[
validators.DataRequired(_('Tenant is required')),
])
new_user = StringField(_('New User'), validators=[
validators.DataRequired(_('User is required')),
])
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
next = HiddenField()
submit = SubmitField(_('Add tenant user'))
def validate(self):
user_manager = current_app.user_manager
# Validate field-validators
if not super(AddTenantUserForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class RemoveTenantUserForm(FlaskForm):
old_tenant = StringField(_('Old Tenant'), validators=[
validators.DataRequired(_('Tenant is required')),
])
old_user = StringField(_('Old User'), validators=[
validators.DataRequired(_('User is required')),
])
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
next = HiddenField()
submit = SubmitField(_('Remove tenant user'))
def validate(self):
user_manager = current_app.user_manager
# Validate field-validators
if not super(RemoveTenantUserForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class DeleteTenantForm(FlaskForm):
old_tenant = StringField(_('Old Tenant'), validators=[
validators.DataRequired(_('Tenant is required')),
])
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
next = HiddenField()
submit = SubmitField(_('Delete tenant'))
def validate(self):
user_manager = current_app.user_manager
# Validate field-validators
if not super(DeleteTenantForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class ChangeUsernameForm(FlaskForm):
new_username = StringField(_('New Username'), validators=[
validators.DataRequired(_('Username is required')),
unique_username_validator,
])
old_password = PasswordField(_('Old Password'), validators=[
validators.DataRequired(_('Old Password is required')),
])
next = HiddenField()
submit = SubmitField(_('Change username'))
def validate(self):
user_manager = current_app.user_manager
# Add custom username validator if needed
has_been_added = False
for v in self.new_username.validators:
if v == user_manager.username_validator:
has_been_added = True
if not has_been_added:
self.new_username.validators.append(
user_manager.username_validator)
# Validate field-validators
if not super(ChangeUsernameForm, self).validate():
return False
# Verify current_user and current_password
if not current_user or not user_manager.verify_password(
self.old_password.data, current_user):
self.old_password.errors.append(_('Old Password is incorrect'))
return False
# All is well
return True
class ForgotPasswordForm(FlaskForm):
email = StringField(_('Your email address'), validators=[
validators.DataRequired(_('Email address is required')),
validators.Email(_('Invalid Email address')),
])
submit = SubmitField(_('Send reset password email'))
def validate_email(form, field):
user_manager = current_app.user_manager
if user_manager.show_username_email_does_not_exist:
user, user_email = user_manager.find_user_by_email(field.data)
if not user:
raise ValidationError(_('%(username_or_email)s does not exist',
username_or_email=_('Email')))
class LoginForm(FlaskForm):
next = HiddenField() # for login.html
reg_next = HiddenField() # for login_or_register.html
username = StringField(_('Username'), validators=[
validators.DataRequired(_('Username is required')),
])
email = StringField(_('Email'), validators=[
validators.DataRequired(_('Email is required')),
validators.Email(_('Invalid Email'))
])
password = PasswordField(_('Password'), validators=[
validators.DataRequired(_('Password is required')),
])
remember_me = BooleanField(_('Remember me'))
submit = SubmitField(_('Sign in'))
def __init__(self, *args, **kwargs):
super(LoginForm, self).__init__(*args, **kwargs)
user_manager = current_app.user_manager
if user_manager.enable_username and user_manager.enable_email:
# Renamed 'Username' label to 'Username or Email'
self.username.label.text = _('Username or Email')
def validate(self):
# Remove fields depending on configuration
user_manager = current_app.user_manager
if user_manager.enable_username:
delattr(self, 'email')
else:
delattr(self, 'username')
# Validate field-validators
if not super(LoginForm, self).validate():
return False
# Find user by username and/or email
user = None
user_email = None
if user_manager.enable_username:
# Find user by username
user = user_manager.find_user_by_username(self.username.data)
# Find user by email address (username field)
if not user and user_manager.enable_email:
user, user_email = user_manager.find_user_by_email(
self.username.data)
else:
# Find user by email address (email field)
user, user_email = user_manager.find_user_by_email(self.email.data)
# Handle successful authentication
if user and user_manager.get_password(user) and \
user_manager.verify_password(self.password.data, user):
return True # Successful authentication
# Handle unsuccessful authentication
# Email, Username or Email/Username depending on settings
if user_manager.enable_username and user_manager.enable_email:
username_or_email_field = self.username
username_or_email_text = (_('Username/Email'))
elif user_manager.enable_username:
username_or_email_field = self.username
username_or_email_text = (_('Username'))
else:
username_or_email_field = self.email
username_or_email_text = (_('Email'))
# Show 'username/email does not exist error message
if user_manager.show_username_email_does_not_exist:
if not user:
message = _('%(username_or_email)s does not exist',
username_or_email=username_or_email_text)
username_or_email_field.errors.append(message)
else:
self.password.errors.append(_('Incorrect Password'))
# Hide 'username/email does not exist error message for additional security # noqa
else:
message = _('Incorrect %(username_or_email)s and/or Password',
username_or_email=username_or_email_text)
username_or_email_field.errors.append(message)
self.password.errors.append(message)
return False # Unsuccessful authentication
class RegisterForm(FlaskForm):
password_validator_added = False
next = HiddenField() # for login_or_register.html
reg_next = HiddenField() # for register.html
username = StringField(_('Username'), validators=[
validators.DataRequired(_('Username is required')),
unique_username_validator])
email = StringField(_('Email'), validators=[
validators.DataRequired(_('Email is required')),
validators.Email(_('Invalid Email')),
unique_email_validator])
password = PasswordField(_('Password'), validators=[
validators.DataRequired(_('Password is required'))])
retype_password = PasswordField(_('Retype Password'), validators=[
validators.EqualTo('password', message=_(
'Password and Retype Password did not match'))])
invite_token = HiddenField(_('Token'))
submit = SubmitField(_('Register'))
def validate(self):
# remove certain form fields depending on user manager config
user_manager = current_app.user_manager
if not user_manager.enable_username:
delattr(self, 'username')
if not user_manager.enable_email:
delattr(self, 'email')
if not user_manager.enable_retype_password:
delattr(self, 'retype_password')
# Add custom username validator if needed
if user_manager.enable_username:
has_been_added = False
for v in self.username.validators:
if v == user_manager.username_validator:
has_been_added = True
if not has_been_added:
self.username.validators.append(
user_manager.username_validator)
# Add custom password validator if needed
has_been_added = False
for v in self.password.validators:
if v == user_manager.password_validator:
has_been_added = True
if not has_been_added:
self.password.validators.append(user_manager.password_validator)
# Validate field-validators
if not super(RegisterForm, self).validate():
return False
# All is well
return True
class ResendConfirmEmailForm(FlaskForm):
email = StringField(_('Your email address'), validators=[
validators.DataRequired(_('Email address is required')),
validators.Email(_('Invalid Email address')),
])
submit = SubmitField(_('Resend email confirmation email'))
class ResetPasswordForm(FlaskForm):
new_password = PasswordField(_('New Password'), validators=[
validators.DataRequired(_('New Password is required'))])
retype_password = PasswordField(_('Retype New Password'), validators=[
validators.EqualTo('new_password', message=_(
'New Password and Retype Password did not match'))])
next = HiddenField()
submit = SubmitField(_('Change password'))
def validate(self):
# Use feature config to remove unused form fields
user_manager = current_app.user_manager
if not user_manager.enable_retype_password:
delattr(self, 'retype_password')
# Add custom password validator if needed
has_been_added = False
for v in self.new_password.validators:
if v == user_manager.password_validator:
has_been_added = True
if not has_been_added:
self.new_password.validators.append(
user_manager.password_validator)
# Validate field-validators
if not super(ResetPasswordForm, self).validate():
return False
# All is well
return True
class InviteForm(FlaskForm):
email = StringField(_('Email'), validators=[
validators.DataRequired(_('Email is required')),
validators.Email(_('Invalid Email'))])
next = HiddenField()
submit = SubmitField(_('Invite!'))
| 36.127622 | 93 | 0.641519 | 2,198 | 20,665 | 5.810282 | 0.105096 | 0.065461 | 0.077676 | 0.02631 | 0.723827 | 0.702607 | 0.690471 | 0.64991 | 0.641923 | 0.613734 | 0 | 0.002108 | 0.265376 | 20,665 | 571 | 94 | 36.190893 | 0.839141 | 0.123349 | 0 | 0.621827 | 0 | 0 | 0.136066 | 0.007109 | 0 | 0 | 0 | 0 | 0 | 1 | 0.048223 | false | 0.241117 | 0.022843 | 0 | 0.35533 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 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 |
03dc45f941533f8e081a0dc457d1fac3c8825c6f | 133 | py | Python | kattis/lastfactorialdigit.py | anouard24/problem-solving | 8f3e3551bf9080f8e7305a09519fe7c638c42021 | [
"MIT"
] | null | null | null | kattis/lastfactorialdigit.py | anouard24/problem-solving | 8f3e3551bf9080f8e7305a09519fe7c638c42021 | [
"MIT"
] | null | null | null | kattis/lastfactorialdigit.py | anouard24/problem-solving | 8f3e3551bf9080f8e7305a09519fe7c638c42021 | [
"MIT"
] | null | null | null | f = [1, 1, 2, 6, 4]
for _ in range(int(input())):
n = int(input())
if n <= 4:
print(f[n])
else:
print(0)
| 16.625 | 29 | 0.413534 | 23 | 133 | 2.347826 | 0.652174 | 0.296296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.083333 | 0.368421 | 133 | 7 | 30 | 19 | 0.559524 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.285714 | 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 |
03ef31eb9736d7447fb9fb3179dd511da5a1fc2c | 21,543 | py | Python | pysnmp-with-texts/AGENTX-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/AGENTX-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/AGENTX-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module AGENTX-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AGENTX-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:15:42 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ConstraintsUnion")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup")
Counter64, mib_2, NotificationType, Bits, iso, Unsigned32, MibIdentifier, TimeTicks, ObjectIdentity, Integer32, ModuleIdentity, Gauge32, IpAddress, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "mib-2", "NotificationType", "Bits", "iso", "Unsigned32", "MibIdentifier", "TimeTicks", "ObjectIdentity", "Integer32", "ModuleIdentity", "Gauge32", "IpAddress", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TimeStamp, DisplayString, TextualConvention, TDomain, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TimeStamp", "DisplayString", "TextualConvention", "TDomain", "TruthValue")
agentxMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 74))
agentxMIB.setRevisions(('2000-01-10 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: agentxMIB.setRevisionsDescriptions(('Initial version published as RFC 2742.',))
if mibBuilder.loadTexts: agentxMIB.setLastUpdated('200001100000Z')
if mibBuilder.loadTexts: agentxMIB.setOrganization('AgentX Working Group')
if mibBuilder.loadTexts: agentxMIB.setContactInfo('WG-email: agentx@dorothy.bmc.com Subscribe: agentx-request@dorothy.bmc.com WG-email Archive: ftp://ftp.peer.com/pub/agentx/archives FTP repository: ftp://ftp.peer.com/pub/agentx http://www.ietf.org/html.charters/agentx-charter.html Chair: Bob Natale ACE*COMM Corporation Email: bnatale@acecomm.com WG editor: Mark Ellison Ellison Software Consulting, Inc. Email: ellison@world.std.com Co-author: Lauren Heintz Cisco Systems, EMail: lheintz@cisco.com Co-author: Smitha Gudur Independent Consultant Email: sgudur@hotmail.com ')
if mibBuilder.loadTexts: agentxMIB.setDescription('This is the MIB module for the SNMP Agent Extensibility Protocol (AgentX). This MIB module will be implemented by the master agent. ')
class AgentxTAddress(TextualConvention, OctetString):
description = 'Denotes a transport service address. This is identical to the TAddress textual convention (SNMPv2-SMI) except that zero-length values are permitted. '
status = 'current'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 255)
agentxObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 1))
agentxGeneral = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 1, 1))
agentxConnection = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 1, 2))
agentxSession = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 1, 3))
agentxRegistration = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 1, 4))
agentxDefaultTimeout = MibScalar((1, 3, 6, 1, 2, 1, 74, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(5)).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxDefaultTimeout.setStatus('current')
if mibBuilder.loadTexts: agentxDefaultTimeout.setDescription('The default length of time, in seconds, that the master agent should allow to elapse after dispatching a message to a session before it regards the subagent as not responding. This is a system-wide value that may override the timeout value associated with a particular session (agentxSessionTimeout) or a particular registered MIB region (agentxRegTimeout). If the associated value of agentxSessionTimeout and agentxRegTimeout are zero, or impractical in accordance with implementation-specific procedure of the master agent, the value represented by this object will be the effective timeout value for the master agent to await a response to a dispatch from a given subagent. ')
agentxMasterAgentXVer = MibScalar((1, 3, 6, 1, 2, 1, 74, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxMasterAgentXVer.setStatus('current')
if mibBuilder.loadTexts: agentxMasterAgentXVer.setDescription('The AgentX protocol version supported by this master agent. The current protocol version is 1. Note that the master agent must also allow interaction with earlier version subagents. ')
agentxConnTableLastChange = MibScalar((1, 3, 6, 1, 2, 1, 74, 1, 2, 1), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxConnTableLastChange.setStatus('current')
if mibBuilder.loadTexts: agentxConnTableLastChange.setDescription('The value of sysUpTime when the last row creation or deletion occurred in the agentxConnectionTable. ')
agentxConnectionTable = MibTable((1, 3, 6, 1, 2, 1, 74, 1, 2, 2), )
if mibBuilder.loadTexts: agentxConnectionTable.setStatus('current')
if mibBuilder.loadTexts: agentxConnectionTable.setDescription('The agentxConnectionTable tracks all current AgentX transport connections. There may be zero, one, or more AgentX sessions carried on a given AgentX connection. ')
agentxConnectionEntry = MibTableRow((1, 3, 6, 1, 2, 1, 74, 1, 2, 2, 1), ).setIndexNames((0, "AGENTX-MIB", "agentxConnIndex"))
if mibBuilder.loadTexts: agentxConnectionEntry.setStatus('current')
if mibBuilder.loadTexts: agentxConnectionEntry.setDescription('An agentxConnectionEntry contains information describing a single AgentX transport connection. A connection may be used to support zero or more AgentX sessions. An entry is created when a new transport connection is established, and is destroyed when the transport connection is terminated. ')
agentxConnIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 2, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: agentxConnIndex.setStatus('current')
if mibBuilder.loadTexts: agentxConnIndex.setDescription('agentxConnIndex contains the value that uniquely identifies an open transport connection used by this master agent to provide AgentX service. Values of this index should not be re-used. The value assigned to a given transport connection is constant for the lifetime of that connection. ')
agentxConnOpenTime = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 2, 2, 1, 2), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxConnOpenTime.setStatus('current')
if mibBuilder.loadTexts: agentxConnOpenTime.setDescription('The value of sysUpTime when this connection was established and, therefore, its value when this entry was added to the table. ')
agentxConnTransportDomain = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 2, 2, 1, 3), TDomain()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxConnTransportDomain.setStatus('current')
if mibBuilder.loadTexts: agentxConnTransportDomain.setDescription('The transport protocol in use for this connection to the subagent. ')
agentxConnTransportAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 2, 2, 1, 4), AgentxTAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxConnTransportAddress.setStatus('current')
if mibBuilder.loadTexts: agentxConnTransportAddress.setDescription('The transport address of the remote (subagent) end of this connection to the master agent. This object may be zero-length for unix-domain sockets (and possibly other types of transport addresses) since the subagent need not bind a filename to its local socket. ')
agentxSessionTableLastChange = MibScalar((1, 3, 6, 1, 2, 1, 74, 1, 3, 1), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxSessionTableLastChange.setStatus('current')
if mibBuilder.loadTexts: agentxSessionTableLastChange.setDescription('The value of sysUpTime when the last row creation or deletion occurred in the agentxSessionTable. ')
agentxSessionTable = MibTable((1, 3, 6, 1, 2, 1, 74, 1, 3, 2), )
if mibBuilder.loadTexts: agentxSessionTable.setStatus('current')
if mibBuilder.loadTexts: agentxSessionTable.setDescription('A table of AgentX subagent sessions currently in effect. ')
agentxSessionEntry = MibTableRow((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1), ).setIndexNames((0, "AGENTX-MIB", "agentxConnIndex"), (0, "AGENTX-MIB", "agentxSessionIndex"))
if mibBuilder.loadTexts: agentxSessionEntry.setStatus('current')
if mibBuilder.loadTexts: agentxSessionEntry.setDescription('Information about a single open session between the AgentX master agent and a subagent is contained in this entry. An entry is created when a new session is successfully established and is destroyed either when the subagent transport connection has terminated or when the subagent session is closed. ')
agentxSessionIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295)))
if mibBuilder.loadTexts: agentxSessionIndex.setStatus('current')
if mibBuilder.loadTexts: agentxSessionIndex.setDescription("A unique index for the subagent session. It is the same as h.sessionID defined in the agentx header. Note that if a subagent's session with the master agent is closed for any reason its index should not be re-used. A value of zero(0) is specifically allowed in order to be compatible with the definition of h.sessionId. ")
agentxSessionObjectID = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1, 2), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxSessionObjectID.setStatus('current')
if mibBuilder.loadTexts: agentxSessionObjectID.setDescription("This is taken from the o.id field of the agentx-Open-PDU. This attribute will report a value of '0.0' for subagents not supporting the notion of an AgentX session object identifier. ")
agentxSessionDescr = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1, 3), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxSessionDescr.setStatus('current')
if mibBuilder.loadTexts: agentxSessionDescr.setDescription('A textual description of the session. This is analogous to sysDescr defined in the SNMPv2-MIB in RFC 1907 [19] and is taken from the o.descr field of the agentx-Open-PDU. This attribute will report a zero-length string value for subagents not supporting the notion of a session description. ')
agentxSessionAdminStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("up", 1), ("down", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: agentxSessionAdminStatus.setStatus('current')
if mibBuilder.loadTexts: agentxSessionAdminStatus.setDescription("The administrative (desired) status of the session. Setting the value to 'down(2)' closes the subagent session (with c.reason set to 'reasonByManager'). ")
agentxSessionOpenTime = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1, 5), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxSessionOpenTime.setStatus('current')
if mibBuilder.loadTexts: agentxSessionOpenTime.setDescription('The value of sysUpTime when this session was opened and, therefore, its value when this entry was added to the table. ')
agentxSessionAgentXVer = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxSessionAgentXVer.setStatus('current')
if mibBuilder.loadTexts: agentxSessionAgentXVer.setDescription('The version of the AgentX protocol supported by the session. This must be less than or equal to the value of agentxMasterAgentXVer. ')
agentxSessionTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 3, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxSessionTimeout.setStatus('current')
if mibBuilder.loadTexts: agentxSessionTimeout.setDescription("The length of time, in seconds, that a master agent should allow to elapse after dispatching a message to this session before it regards the subagent as not responding. This value is taken from the o.timeout field of the agentx-Open-PDU. This is a session-specific value that may be overridden by values associated with the specific registered MIB regions (see agentxRegTimeout). A value of zero(0) indicates that the master agent's default timeout value should be used (see agentxDefaultTimeout). ")
agentxRegistrationTableLastChange = MibScalar((1, 3, 6, 1, 2, 1, 74, 1, 4, 1), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegistrationTableLastChange.setStatus('current')
if mibBuilder.loadTexts: agentxRegistrationTableLastChange.setDescription('The value of sysUpTime when the last row creation or deletion occurred in the agentxRegistrationTable. ')
agentxRegistrationTable = MibTable((1, 3, 6, 1, 2, 1, 74, 1, 4, 2), )
if mibBuilder.loadTexts: agentxRegistrationTable.setStatus('current')
if mibBuilder.loadTexts: agentxRegistrationTable.setDescription('A table of registered regions. ')
agentxRegistrationEntry = MibTableRow((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1), ).setIndexNames((0, "AGENTX-MIB", "agentxConnIndex"), (0, "AGENTX-MIB", "agentxSessionIndex"), (0, "AGENTX-MIB", "agentxRegIndex"))
if mibBuilder.loadTexts: agentxRegistrationEntry.setStatus('current')
if mibBuilder.loadTexts: agentxRegistrationEntry.setDescription('Contains information for a single registered region. An entry is created when a session successfully registers a region and is destroyed for any of three reasons: this region is unregistered by the session, the session is closed, or the subagent connection is closed. ')
agentxRegIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)))
if mibBuilder.loadTexts: agentxRegIndex.setStatus('current')
if mibBuilder.loadTexts: agentxRegIndex.setDescription('agentxRegIndex uniquely identifies a registration entry. This value is constant for the lifetime of an entry. ')
agentxRegContext = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 2), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegContext.setStatus('current')
if mibBuilder.loadTexts: agentxRegContext.setDescription('The context in which the session supports the objects in this region. A zero-length context indicates the default context. ')
agentxRegStart = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 3), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegStart.setStatus('current')
if mibBuilder.loadTexts: agentxRegStart.setDescription('The starting OBJECT IDENTIFIER of this registration entry. The session identified by agentxSessionIndex implements objects starting at this value (inclusive). Note that this value could identify an object type, an object instance, or a partial object instance. ')
agentxRegRangeSubId = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 4), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegRangeSubId.setStatus('current')
if mibBuilder.loadTexts: agentxRegRangeSubId.setDescription("agentxRegRangeSubId is used to specify the range. This is taken from r.region_subid in the registration PDU. If the value of this object is zero, no range is specified. If it is non-zero, it identifies the `nth' sub-identifier in r.region for which this entry's agentxRegUpperBound value is substituted in the OID for purposes of defining the region's upper bound. ")
agentxRegUpperBound = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 5), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegUpperBound.setStatus('current')
if mibBuilder.loadTexts: agentxRegUpperBound.setDescription('agentxRegUpperBound represents the upper-bound sub-identifier in a registration. This is taken from the r.upper_bound in the registration PDU. If agentxRegRangeSubid (r.region_subid) is zero, this value is also zero and is not used to define an upper bound for this registration. ')
agentxRegPriority = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 6), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegPriority.setStatus('current')
if mibBuilder.loadTexts: agentxRegPriority.setDescription('The registration priority. Lower values have higher priority. This value is taken from r.priority in the register PDU. Sessions should use the value of 127 for r.priority if a default value is desired. ')
agentxRegTimeout = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegTimeout.setStatus('current')
if mibBuilder.loadTexts: agentxRegTimeout.setDescription('The timeout value, in seconds, for responses to requests associated with this registered MIB region. A value of zero(0) indicates the default value (indicated by by agentxSessionTimeout or agentxDefaultTimeout) is to be used. This value is taken from the r.timeout field of the agentx-Register-PDU. ')
agentxRegInstance = MibTableColumn((1, 3, 6, 1, 2, 1, 74, 1, 4, 2, 1, 8), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: agentxRegInstance.setStatus('current')
if mibBuilder.loadTexts: agentxRegInstance.setDescription("The value of agentxRegInstance is `true' for registrations for which the INSTANCE_REGISTRATION was set, and is `false' for all other registrations. ")
agentxConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 2))
agentxMIBGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 2, 1))
agentxMIBCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 74, 2, 2))
agentxMIBCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 74, 2, 2, 1)).setObjects(("AGENTX-MIB", "agentxMIBGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
agentxMIBCompliance = agentxMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: agentxMIBCompliance.setDescription('The compliance statement for SNMP entities that implement the AgentX protocol. Note that a compliant agent can implement all objects in this MIB module as read-only. ')
agentxMIBGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 74, 2, 1, 1)).setObjects(("AGENTX-MIB", "agentxDefaultTimeout"), ("AGENTX-MIB", "agentxMasterAgentXVer"), ("AGENTX-MIB", "agentxConnTableLastChange"), ("AGENTX-MIB", "agentxConnOpenTime"), ("AGENTX-MIB", "agentxConnTransportDomain"), ("AGENTX-MIB", "agentxConnTransportAddress"), ("AGENTX-MIB", "agentxSessionTableLastChange"), ("AGENTX-MIB", "agentxSessionTimeout"), ("AGENTX-MIB", "agentxSessionObjectID"), ("AGENTX-MIB", "agentxSessionDescr"), ("AGENTX-MIB", "agentxSessionAdminStatus"), ("AGENTX-MIB", "agentxSessionOpenTime"), ("AGENTX-MIB", "agentxSessionAgentXVer"), ("AGENTX-MIB", "agentxRegistrationTableLastChange"), ("AGENTX-MIB", "agentxRegContext"), ("AGENTX-MIB", "agentxRegStart"), ("AGENTX-MIB", "agentxRegRangeSubId"), ("AGENTX-MIB", "agentxRegUpperBound"), ("AGENTX-MIB", "agentxRegPriority"), ("AGENTX-MIB", "agentxRegTimeout"), ("AGENTX-MIB", "agentxRegInstance"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
agentxMIBGroup = agentxMIBGroup.setStatus('current')
if mibBuilder.loadTexts: agentxMIBGroup.setDescription('All accessible objects in the AgentX MIB. ')
mibBuilder.exportSymbols("AGENTX-MIB", agentxConnTransportAddress=agentxConnTransportAddress, agentxRegistrationTable=agentxRegistrationTable, agentxMIBGroups=agentxMIBGroups, agentxSession=agentxSession, agentxDefaultTimeout=agentxDefaultTimeout, agentxConformance=agentxConformance, agentxGeneral=agentxGeneral, PYSNMP_MODULE_ID=agentxMIB, agentxConnTransportDomain=agentxConnTransportDomain, agentxSessionTableLastChange=agentxSessionTableLastChange, AgentxTAddress=AgentxTAddress, agentxRegInstance=agentxRegInstance, agentxMIBCompliances=agentxMIBCompliances, agentxRegistration=agentxRegistration, agentxConnIndex=agentxConnIndex, agentxConnOpenTime=agentxConnOpenTime, agentxRegIndex=agentxRegIndex, agentxMIB=agentxMIB, agentxSessionIndex=agentxSessionIndex, agentxRegistrationTableLastChange=agentxRegistrationTableLastChange, agentxSessionEntry=agentxSessionEntry, agentxRegRangeSubId=agentxRegRangeSubId, agentxConnTableLastChange=agentxConnTableLastChange, agentxSessionAgentXVer=agentxSessionAgentXVer, agentxSessionOpenTime=agentxSessionOpenTime, agentxRegTimeout=agentxRegTimeout, agentxMIBGroup=agentxMIBGroup, agentxSessionTable=agentxSessionTable, agentxSessionObjectID=agentxSessionObjectID, agentxRegStart=agentxRegStart, agentxSessionTimeout=agentxSessionTimeout, agentxConnectionTable=agentxConnectionTable, agentxConnectionEntry=agentxConnectionEntry, agentxRegPriority=agentxRegPriority, agentxMIBCompliance=agentxMIBCompliance, agentxRegistrationEntry=agentxRegistrationEntry, agentxRegUpperBound=agentxRegUpperBound, agentxConnection=agentxConnection, agentxObjects=agentxObjects, agentxSessionAdminStatus=agentxSessionAdminStatus, agentxMasterAgentXVer=agentxMasterAgentXVer, agentxRegContext=agentxRegContext, agentxSessionDescr=agentxSessionDescr)
| 157.248175 | 1,776 | 0.79144 | 2,645 | 21,543 | 6.443478 | 0.178072 | 0.007862 | 0.082556 | 0.009623 | 0.340668 | 0.231473 | 0.189521 | 0.158247 | 0.158247 | 0.139705 | 0 | 0.036455 | 0.102307 | 21,543 | 136 | 1,777 | 158.404412 | 0.844821 | 0.014576 | 0 | 0.02381 | 0 | 0.214286 | 0.442601 | 0.030584 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.055556 | 0 | 0.087302 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
03f920e736f6c895b4937de9aa15935766a3a142 | 1,747 | py | Python | test/test_modify_contact.py | RobertRedford/python_training | 3b73588c86faaee26cc3cbd105d32d190721ee13 | [
"Apache-2.0"
] | null | null | null | test/test_modify_contact.py | RobertRedford/python_training | 3b73588c86faaee26cc3cbd105d32d190721ee13 | [
"Apache-2.0"
] | null | null | null | test/test_modify_contact.py | RobertRedford/python_training | 3b73588c86faaee26cc3cbd105d32d190721ee13 | [
"Apache-2.0"
] | null | null | null | from model.contact import Contact
from random import randrange
def test_modify_contact_firstname(app):
if app.contact.count_contacts() == 0:
app.contact.fill_the_field_of_credentials(Contact(firstname="Modify test firstname"))
old_contacts = app.contact.get_contact_list()
index = randrange(len(old_contacts))
contact = Contact(firstname="Modify test firstname")
contact.id = old_contacts[index].id
app.contact.modify_contact_by_index(index, contact)
new_contacts = app.contact.get_contact_list()
assert len(old_contacts) == len(new_contacts)
old_contacts[index] = contact
assert sorted(old_contacts, key=Contact.id_or_max) == sorted(new_contacts, key=Contact.id_or_max)
def test_modify_contact_lastname(app):
if app.contact.count_contacts() == 0:
app.contact.fill_the_field_of_credentials(Contact(lastname="Modify test lastname"))
old_contacts = app.contact.get_contact_list()
index = randrange(len(old_contacts))
contact = Contact(lastname="Modify test lastname")
contact.id = old_contacts[index].id
app.contact.modify_contact_by_index(index, contact)
new_contacts = app.contact.get_contact_list()
assert len(old_contacts) == len(new_contacts)
def test_modify_contact_address(app):
if app.contact.count_contacts() == 0:
app.contact.fill_the_field_of_credentials(Contact(address="Modify test address"))
old_contacts = app.contact.get_contact_list()
index = randrange(len(old_contacts))
contact = Contact(address="Modify test address")
contact.id = old_contacts[index].id
app.contact.modify_contact_by_index(index, contact)
new_contacts = app.contact.get_contact_list()
assert len(old_contacts) == len(new_contacts) | 45.973684 | 101 | 0.755009 | 240 | 1,747 | 5.204167 | 0.145833 | 0.120096 | 0.086469 | 0.100881 | 0.851882 | 0.726982 | 0.68695 | 0.68695 | 0.68695 | 0.68695 | 0 | 0.001996 | 0.139668 | 1,747 | 38 | 102 | 45.973684 | 0.829009 | 0 | 0 | 0.617647 | 0 | 0 | 0.06865 | 0 | 0 | 0 | 0 | 0 | 0.117647 | 1 | 0.088235 | false | 0 | 0.058824 | 0 | 0.147059 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ff009577b576f3733fa6b8d627627e1f9312312e | 239 | py | Python | src/shopheroes/__init__.py | koadjunky/item-production-helper | c95c02e6b0512714e79791e358cf1e74481827b4 | [
"MIT"
] | null | null | null | src/shopheroes/__init__.py | koadjunky/item-production-helper | c95c02e6b0512714e79791e358cf1e74481827b4 | [
"MIT"
] | 3 | 2021-02-08T20:39:49.000Z | 2021-06-02T00:52:00.000Z | src/shopheroes/__init__.py | koadjunky/item-production-helper | c95c02e6b0512714e79791e358cf1e74481827b4 | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M',
handlers=[logging.StreamHandler()])
| 26.555556 | 81 | 0.527197 | 24 | 239 | 5.25 | 0.791667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018072 | 0.305439 | 239 | 8 | 82 | 29.875 | 0.740964 | 0 | 0 | 0 | 0 | 0 | 0.261603 | 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 |
ff06c5b7b14f4571a3b4f49f068f67710ffeec78 | 139 | py | Python | teams_app/urls.py | oOMIKANOo/Hackathon_0619 | da37bef8352bb914bffbefc9a5a4a97a1207a66e | [
"MIT"
] | null | null | null | teams_app/urls.py | oOMIKANOo/Hackathon_0619 | da37bef8352bb914bffbefc9a5a4a97a1207a66e | [
"MIT"
] | null | null | null | teams_app/urls.py | oOMIKANOo/Hackathon_0619 | da37bef8352bb914bffbefc9a5a4a97a1207a66e | [
"MIT"
] | null | null | null | from rest_framework import routers
from .views import TeamViewSet
router = routers.DefaultRouter()
router.register(r'teams', TeamViewSet) | 23.166667 | 38 | 0.820144 | 17 | 139 | 6.647059 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.100719 | 139 | 6 | 38 | 23.166667 | 0.904 | 0 | 0 | 0 | 0 | 0 | 0.035714 | 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 |
ff086ff2474439d0c8c5afa079f3e63b5c6e08c1 | 2,314 | py | Python | plugins/module_utils/fleetmanager.py | maxamillion/maxamillion.fleetmanagement | 115a4e31d61a9bd8322e63dd3898b445bf3e87bf | [
"MIT"
] | null | null | null | plugins/module_utils/fleetmanager.py | maxamillion/maxamillion.fleetmanagement | 115a4e31d61a9bd8322e63dd3898b445bf3e87bf | [
"MIT"
] | null | null | null | plugins/module_utils/fleetmanager.py | maxamillion/maxamillion.fleetmanagement | 115a4e31d61a9bd8322e63dd3898b445bf3e87bf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) 2022, Adam Miller (maxamillion@gmail.com)
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.urls import CertificateError
from ansible.module_utils.six.moves.urllib.parse import urlencode, quote_plus
from ansible.module_utils.connection import ConnectionError
from ansible.module_utils.six.moves.urllib.error import HTTPError
from ansible.module_utils.connection import Connection
from ansible.module_utils._text import to_text
import json
BASE_HEADERS = {"Content-Type": "application/json"}
class ConsoleDotRequest(object):
def __init__(self, module, headers=None, not_rest_data_keys=None):
self.module = module
self.connection = Connection(self.module._socket_path)
self.headers = headers if headers else BASE_HEADERS
def _httpapi_error_handle(self, method, path, data=None):
# FIXME - make use of handle_httperror(self, exception) where applicable
# https://docs.ansible.com/ansible/latest/network/dev_guide/developing_plugins_network.html#developing-plugins-httpapi
try:
code, response = self.connection.send_request(
method, path, data=data, headers=self.headers
)
except ConnectionError as e:
self.module.fail_json(msg=f"connection error occurred: {e}")
except CertificateError as e:
self.module.fail_json(msg=f"certificate error occurred: {e}")
except ValueError as e:
self.module.fail_json(msg=f"certificate not found: {e}")
if code == 500:
self.module.fail_json(msg=f"Error-500: {response}")
return response
def get(self, path, **kwargs):
return self._httpapi_error_handle("GET", path, **kwargs)
def put(self, path, **kwargs):
return self._httpapi_error_handle("PUT", path, **kwargs)
def post(self, path, **kwargs):
return self._httpapi_error_handle("POST", path, **kwargs)
def patch(self, path, **kwargs):
return self._httpapi_error_handle("PATCH", path, **kwargs)
def delete(self, path, **kwargs):
return self._httpapi_error_handle("DELETE", path, **kwargs)
| 35.6 | 128 | 0.699654 | 295 | 2,314 | 5.294915 | 0.372881 | 0.06402 | 0.065301 | 0.084507 | 0.305378 | 0.305378 | 0.242638 | 0.196543 | 0.046095 | 0 | 0 | 0.005882 | 0.191876 | 2,314 | 64 | 129 | 36.15625 | 0.829412 | 0.147796 | 0 | 0 | 0 | 0 | 0.079898 | 0 | 0 | 0 | 0 | 0.015625 | 0 | 1 | 0.179487 | false | 0 | 0.205128 | 0.128205 | 0.564103 | 0.025641 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ff176cfa0d81d21f27918d6a7ac6cc398c1664d5 | 1,416 | py | Python | evaluation/average_precision/results.py | martinGalajdaSchool/object-detection | 2c72b643464a89b91daac520a862ebaad2b3f9f0 | [
"Apache-2.0"
] | 2 | 2019-12-11T05:50:39.000Z | 2021-12-06T12:28:40.000Z | evaluation/average_precision/results.py | martinGalajdaSchool/object-detection | 2c72b643464a89b91daac520a862ebaad2b3f9f0 | [
"Apache-2.0"
] | 19 | 2019-12-16T21:23:00.000Z | 2022-03-02T14:59:12.000Z | evaluation/average_precision/results.py | martin-galajda/object-detection | 2c72b643464a89b91daac520a862ebaad2b3f9f0 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from typing import Dict, List
class EvaluationResults:
"""
Aggregates and stores evaluation results
for average precision metric.
Metrics stored:
- AP for each class
- Recalls for each class
- Interpolated precisions for each class
- Number of TP for each class
- Number of FP for each class
- Mean average precision (AP averaged across all classes)
"""
mAP: float
AP_per_class: Dict[str, float]
recalls_per_class: Dict[str, List[float]]
interp_precisions_per_class: Dict[str, List[float]]
TP_per_class: Dict[str, int]
FP_per_class: Dict[str, int]
def __init__(
self,
*,
AP_per_class: Dict[str, float],
recalls_per_class: Dict[str, List[float]],
interp_precisions_per_class: Dict[str, List[float]],
TP_per_class: Dict[str, int],
FP_per_class: Dict[str, int]
):
self.mAP = np.sum(list(AP_per_class.values())) / len(AP_per_class)
self.AP_per_class = dict(AP_per_class)
self.recalls_per_class = dict(recalls_per_class)
self.interp_precisions_per_class = dict(interp_precisions_per_class)
self.TP_per_class = TP_per_class
self.FP_per_class = FP_per_class
| 33.714286 | 76 | 0.596045 | 179 | 1,416 | 4.424581 | 0.26257 | 0.222222 | 0.19697 | 0.189394 | 0.449495 | 0.335859 | 0.335859 | 0.335859 | 0.335859 | 0.335859 | 0 | 0 | 0.329096 | 1,416 | 41 | 77 | 34.536585 | 0.833684 | 0.211158 | 0 | 0.083333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | false | 0 | 0.083333 | 0 | 0.416667 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ff1a67dfe1f8287039575123b5f79f7ebfa74804 | 148 | py | Python | django_httpbin/urls.py | csparpa/django-httpbin | cd833027f607d284491c5e83d459ea28e14d0a0e | [
"MIT"
] | 1 | 2021-03-18T22:33:26.000Z | 2021-03-18T22:33:26.000Z | django_httpbin/urls.py | csparpa/django-httpbin | cd833027f607d284491c5e83d459ea28e14d0a0e | [
"MIT"
] | null | null | null | django_httpbin/urls.py | csparpa/django-httpbin | cd833027f607d284491c5e83d459ea28e14d0a0e | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include
urlpatterns = patterns('',
(r'^django-httpbin', include('django_httpbin.httpbin.endpoints')),
)
| 24.666667 | 70 | 0.736486 | 17 | 148 | 6.352941 | 0.647059 | 0.240741 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.108108 | 148 | 5 | 71 | 29.6 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0.317568 | 0.216216 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
205ea798b7c637309e7e52f6ef8a5b0e61b51b45 | 253 | py | Python | modeling/extension/__init__.py | mukaman84/pytorch-template | 03c24724e084fab99a859202d4c98f2a34cdba22 | [
"MIT"
] | null | null | null | modeling/extension/__init__.py | mukaman84/pytorch-template | 03c24724e084fab99a859202d4c98f2a34cdba22 | [
"MIT"
] | null | null | null | modeling/extension/__init__.py | mukaman84/pytorch-template | 03c24724e084fab99a859202d4c98f2a34cdba22 | [
"MIT"
] | null | null | null | from modeling.extension import unet
def build_extension(ext, out_channels,kernel_size,padding,n_resblocks):
if ext == 'unet':
return unet.UnetDecoder(out_channels,kernel_size,padding,n_resblocks)
else:
raise NotImplementedError
| 31.625 | 77 | 0.758893 | 32 | 253 | 5.78125 | 0.65625 | 0.118919 | 0.183784 | 0.227027 | 0.410811 | 0.410811 | 0.410811 | 0 | 0 | 0 | 0 | 0 | 0.162055 | 253 | 7 | 78 | 36.142857 | 0.872642 | 0 | 0 | 0 | 0 | 0 | 0.01581 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.5 | 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 |
2067079d5e9d9e5402ba3bea48b693c56453c571 | 175 | py | Python | qiling/qiling/extensions/windows_sdk/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:01.000Z | 2021-06-04T14:27:15.000Z | qiling/qiling/extensions/windows_sdk/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | null | null | null | qiling/qiling/extensions/windows_sdk/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:09.000Z | 2021-06-04T14:27:21.000Z | #!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
from os import path
winsdk_path = path.dirname(path.abspath(__file__))
| 21.875 | 75 | 0.788571 | 24 | 175 | 5.541667 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006579 | 0.131429 | 175 | 7 | 76 | 25 | 0.868421 | 0.548571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
206a06e01fdea468c0e77bd3d86bc58eaea87592 | 164 | py | Python | examples/land-generation/small-area.py | oubiwann/myriad-worlds | bfbbab713e35c5700e37158a892c3a66a8c9f37a | [
"MIT"
] | 3 | 2015-01-29T05:24:32.000Z | 2021-05-10T01:47:36.000Z | examples/land-generation/small-area.py | oubiwann/myriad-worlds | bfbbab713e35c5700e37158a892c3a66a8c9f37a | [
"MIT"
] | null | null | null | examples/land-generation/small-area.py | oubiwann/myriad-worlds | bfbbab713e35c5700e37158a892c3a66a8c9f37a | [
"MIT"
] | 2 | 2015-11-13T00:23:49.000Z | 2020-03-24T22:35:25.000Z | from myriad.game import Game
from myriad.story import Story
story = Story("examples/land-generation/small-area.yaml")
game = Game("save game 1")
game.play(story)
| 20.5 | 57 | 0.762195 | 26 | 164 | 4.807692 | 0.538462 | 0.16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006897 | 0.115854 | 164 | 7 | 58 | 23.428571 | 0.855172 | 0 | 0 | 0 | 0 | 0 | 0.310976 | 0.243902 | 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 |
20abc1af31e260b8620d7c9b70bc3405136b6047 | 185 | py | Python | setup.py | bchidest/CFNet | d8e73bd33cfd62edf76abed99efb9e4bdd7dbc48 | [
"Apache-2.0"
] | 26 | 2019-06-02T06:18:21.000Z | 2022-02-03T07:32:49.000Z | setup.py | JaspreetSinghMaan/CFNet | d8e73bd33cfd62edf76abed99efb9e4bdd7dbc48 | [
"Apache-2.0"
] | null | null | null | setup.py | JaspreetSinghMaan/CFNet | d8e73bd33cfd62edf76abed99efb9e4bdd7dbc48 | [
"Apache-2.0"
] | 5 | 2019-03-11T08:22:47.000Z | 2021-07-10T15:59:56.000Z | from distutils.core import setup
setup(name='cfnet',
version='0.1',
author='Benjamin Chidester',
author_email='bchidest@cs.cmu.edu',
packages=['cfnet'],
)
| 23.125 | 41 | 0.621622 | 22 | 185 | 5.181818 | 0.863636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013889 | 0.221622 | 185 | 7 | 42 | 26.428571 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0.27027 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.142857 | 0 | 0.142857 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
20b2151194f542c5b5e2244d3e086c3a3ee230f7 | 6,110 | py | Python | stubs.min/System/Windows/__init___parts/NameScope.py | denfromufa/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2017-07-07T11:15:45.000Z | 2017-07-07T11:15:45.000Z | stubs.min/System/Windows/__init___parts/NameScope.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/__init___parts/NameScope.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class NameScope(object,INameScopeDictionary,INameScope,IDictionary[str,object],ICollection[KeyValuePair[str,object]],IEnumerable[KeyValuePair[str,object]],IEnumerable):
"""
Implements base WPF support for the System.Windows.Markup.INameScope methods that store or retrieve name-object mappings into a particular XAML namescope. Adds attached property support to make it simpler to get or set XAML namescope names dynamically at the element level..
NameScope()
"""
def Add(self,*__args):
"""
Add(self: NameScope,key: str,value: object)
Adds an item to the collection.
key: The string key,which is the name of the XAML namescope mapping to add.
value: The object value,which is the object reference of the XAML namescope mapping
to add.
Add(self: NameScope,item: KeyValuePair[str,object])
"""
pass
def Clear(self):
"""
Clear(self: NameScope)
Removes all items from the collection.
"""
pass
def Contains(self,item):
""" Contains(self: NameScope,item: KeyValuePair[str,object]) -> bool """
pass
def ContainsKey(self,key):
"""
ContainsKey(self: NameScope,key: str) -> bool
Returns whether a provided name already exists in this System.Windows.NameScope.
key: The string key to find.
Returns: true if the specified key identifies a name for an existing mapping in this
System.Windows.NameScope. false if the specified key does not exist in the
current System.Windows.NameScope.
"""
pass
def CopyTo(self,array,arrayIndex):
""" CopyTo(self: NameScope,array: Array[KeyValuePair[str,object]],arrayIndex: int) """
pass
def FindName(self,name):
"""
FindName(self: NameScope,name: str) -> object
Returns the corresponding object in the XAML namescope maintained by this
System.Windows.NameScope,based on a provided name string.
name: Name portion of an existing mapping to retrieve the object portion for.
Returns: The requested object that is mapped with name. Can return null if name was
provided as null or empty string,or if no matching object was found.
"""
pass
@staticmethod
def GetNameScope(dependencyObject):
"""
GetNameScope(dependencyObject: DependencyObject) -> INameScope
Provides the attached property get accessor for the
System.Windows.NameScope.NameScope attached property.
dependencyObject: The object to get the XAML namescope from.
Returns: A XAML namescope,as an System.Windows.Markup.INameScope instance.
"""
pass
def RegisterName(self,name,scopedElement):
"""
RegisterName(self: NameScope,name: str,scopedElement: object)
Registers a new name-object pair into the current XAML namescope.
name: The name to use for mapping the given object.
scopedElement: The object to be mapped to the provided name.
"""
pass
def Remove(self,*__args):
"""
Remove(self: NameScope,key: str) -> bool
Removes a mapping for a specified name from the collection.
key: The string key,which is the name of the XAML namescope mapping to remove.
Returns: true if item was successfully removed from the collection,otherwise false.
Also returns false if the item was not found in the collection.
Remove(self: NameScope,item: KeyValuePair[str,object]) -> bool
"""
pass
@staticmethod
def SetNameScope(dependencyObject,value):
"""
SetNameScope(dependencyObject: DependencyObject,value: INameScope)
Provides the attached property set accessor for the
System.Windows.NameScope.NameScope attached property.
dependencyObject: Object to change XAML namescope for.
value: The new XAML namescope,using an interface cast.
"""
pass
def TryGetValue(self,key,value):
"""
TryGetValue(self: NameScope,key: str) -> (bool,object)
Gets the value associated with the specified key.
key: The key of the value to get.
Returns: true if the System.Windows.NameScope contains a mapping for the name provided
as key. Otherwise,false.
"""
pass
def UnregisterName(self,name):
"""
UnregisterName(self: NameScope,name: str)
Removes a name-object mapping from the XAML namescope.
name: The name of the mapping to remove.
"""
pass
def __add__(self,*args):
""" x.__add__(y) <==> x+yx.__add__(y) <==> x+y """
pass
def __contains__(self,*args):
""" __contains__(self: IDictionary[str,object],key: str) -> bool """
pass
def __getitem__(self,*args):
""" x.__getitem__(y) <==> x[y] """
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 __iter__(self,*args):
""" __iter__(self: IEnumerable) -> object """
pass
def __len__(self,*args):
""" x.__len__() <==> len(x) """
pass
def __repr__(self,*args):
""" __repr__(self: object) -> str """
pass
def __setitem__(self,*args):
""" x.__setitem__(i,y) <==> x[i]= """
pass
Count=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Returns the number of items in the collection of mapped names in this System.Windows.NameScope.
Get: Count(self: NameScope) -> int
"""
IsReadOnly=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a value indicating whether the collection is read-only.
Get: IsReadOnly(self: NameScope) -> bool
"""
Keys=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a collection of the keys in the System.Windows.NameScope dictionary.
Get: Keys(self: NameScope) -> ICollection[str]
"""
Values=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets a collection of the values in the System.Windows.NameScope dictionary.
Get: Values(self: NameScope) -> ICollection[object]
"""
NameScopeProperty=None
| 34.519774 | 277 | 0.68838 | 792 | 6,110 | 5.179293 | 0.208333 | 0.02901 | 0.053632 | 0.030473 | 0.29254 | 0.220624 | 0.21136 | 0.183813 | 0.161385 | 0.161385 | 0 | 0 | 0.208347 | 6,110 | 176 | 278 | 34.715909 | 0.848046 | 0.61473 | 0 | 0.458333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.416667 | false | 0.416667 | 0 | 0 | 0.541667 | 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 |
20c003f730249654cdff557bbda0c19c7aacc703 | 15,608 | py | Python | furnace/utils/ply_utils.py | denyingmxd/Torchssc | 9080c8aadd15d6ae6f7698ba64c6c2bae7393a24 | [
"MIT"
] | null | null | null | furnace/utils/ply_utils.py | denyingmxd/Torchssc | 9080c8aadd15d6ae6f7698ba64c6c2bae7393a24 | [
"MIT"
] | null | null | null | furnace/utils/ply_utils.py | denyingmxd/Torchssc | 9080c8aadd15d6ae6f7698ba64c6c2bae7393a24 | [
"MIT"
] | null | null | null | import numpy as np
import os
colorMap = np.array([[22, 191, 206], # 0 empty, free space
[214, 38, 40], # 1 ceiling red tp
[43, 160, 4], # 2 floor green fp
[158, 216, 229], # 3 wall blue fn
[114, 158, 206], # 4 window
[204, 204, 91], # 5 chair new: 180, 220, 90
[255, 186, 119], # 6 bed
[147, 102, 188], # 7 sofa
[30, 119, 181], # 8 table
[188, 188, 33], # 9 tvs
[255, 127, 12], # 10 furn
[196, 175, 214], # 11 objects
[153, 153, 153], # 12 Accessible area, or label==255, ignore
]).astype(np.int32)
def _get_xyz(size):
####attention
####sometimes you need to change the z dierction by multiply -1
"""x 姘村钩 y楂樹綆 z娣卞害"""
_x = np.zeros(size, dtype=np.int32)
_y = np.zeros(size, dtype=np.int32)
_z = np.zeros(size, dtype=np.int32)
for i_h in range(size[0]): # x, y, z
_x[i_h, :, :] = i_h # x, left-right flip
for i_w in range(size[1]):
_y[:, i_w, :] = i_w # y, up-down flip
for i_d in range(size[2]):
_z[:, :, i_d] = i_d # z, front-back flip
return _x, _y, _z
def voxel_complete_ply(vox_labeled, ply_filename):
if type(vox_labeled) is not np.ndarray:
raise Exception("Oops! Type of vox_labeled should be 'numpy.ndarray', not {}.".format(type(vox_labeled)))
# ---- Check data validation
if np.amax(vox_labeled) == 0:
print('Oops! All voxel is labeled empty.')
return
# ---- get size
new_vertices=[]
num_vertices=0
new_faces = []
num_faces = 0
size = vox_labeled.shape
vox_labeled = vox_labeled.flatten()
_x, _y, _z = _get_xyz(size)
_x = _x.flatten()
_y = _y.flatten()
_z = _z.flatten()
vox_labeled[vox_labeled == 255] = 0
_rgb = colorMap[vox_labeled[:]]
xyz_rgb = np.stack((_x,_y,_z,_rgb[:, 0], _rgb[:, 1], _rgb[:, 2]),axis=-1)
xyz_rgb = np.array(xyz_rgb)
ply_data = xyz_rgb[np.where(vox_labeled > 0)]
# bb=time.time()
for i in range(len(ply_data)):
num_of_line=i
z = float(ply_data[i][0])
y = float(ply_data[i][1])
x = float(ply_data[i][2])
r = ply_data[i][3]
g = ply_data[i][4]
b = ply_data[i][5]
vertice_one = [x, y, z, r, g, b]
vertice_two = [x, y, z + 1, r, g, b]
vertice_three = [x, y + 1, z + 1, r, g, b]
vertice_four = [x, y + 1, z, r, g, b]
vertice_five = [x + 1, y, z, r, g, b]
vertice_six = [x + 1, y, z + 1, r, g, b]
vertice_seven = [x + 1, y + 1, z + 1, r, g, b]
vertice_eight = [x + 1, y + 1, z, r, g, b]
vertices = [vertice_one, vertice_two, vertice_three, vertice_four,
vertice_five, vertice_six, vertice_seven, vertice_eight]
new_vertices.append(vertices)
num_vertices += len(vertices)
base = 8 * num_of_line
face_one = [4, 0 + base, 1 + base, 2 + base, 3 + base]
face_two = [4, 7 + base, 6 + base, 5 + base, 4 + base]
face_three = [4, 0 + base, 4 + base, 5 + base, 1 + base]
face_four = [4, 1 + base, 5 + base, 6 + base, 2 + base]
face_five = [4, 2 + base, 6 + base, 7 + base, 3 + base]
face_six = [4, 3 + base, 7 + base, 4 + base, 0 + base]
faces = [face_one, face_two, face_three, face_four,
face_five, face_six]
new_faces.append(faces)
num_faces += len(faces)
# print(time.time()-bb)
# cc = time.time()
new_vertices = np.array(new_vertices).reshape(-1,6)
new_faces = np.array(new_faces).reshape(-1,5)
if len(ply_data) == 0:
raise Exception("Oops! That was no valid ply data.")
ply_head = 'ply\n' \
'format ascii 1.0\n' \
'element vertex {}\n' \
'property float x\n' \
'property float y\n' \
'property float z\n' \
'property uchar red\n' \
'property uchar green\n' \
'property uchar blue\n' \
'element face {}\n' \
'property list uint8 int32 vertex_indices\n'\
'end_header'.format(num_vertices, num_faces)
# ---- Save ply data to disk
# if not os.path.exists('/'.join(ply_filename.split('/')[:-1])):
# os.mkdir('/'.join(ply_filename.split('/')[:-1]))
np.savetxt(ply_filename, new_vertices, fmt="%d %d %d %d %d %d", header=ply_head, comments='') # It takes 20s
with open(ply_filename,'ab') as f:
np.savetxt(f, new_faces, fmt="%d %d %d %d %d", comments='') # It takes 20s
del vox_labeled, _x, _y, _z, _rgb, xyz_rgb, ply_data, ply_head
def voxel_complete_ply_all_class2(vox_labeled, ply_filename,out_path):
if type(vox_labeled) is not np.ndarray:
raise Exception("Oops! Type of vox_labeled should be 'numpy.ndarray', not {}.".format(type(vox_labeled)))
# ---- Check data validation
if np.amax(vox_labeled) == 0:
print('Oops! All voxel is labeled empty.')
return
# ---- get size
size = vox_labeled.shape
# vox_labeled = vox_labeled.flatten()
for i in range(1,12):
cls_voxel=np.zeros_like(vox_labeled)
cls_voxel[vox_labeled==i]=i
if np.max(cls_voxel)==0:
# print('none')
continue
name = out_path + ply_filename[0].split('/')[-1][3:7] + '_{}.ply'.format(i)
voxel_complete_ply(cls_voxel,name)
def voxel_complete_ply_no_color(vox_labeled, ply_filename,color):
if type(vox_labeled) is not np.ndarray:
raise Exception("Oops! Type of vox_labeled should be 'numpy.ndarray', not {}.".format(type(vox_labeled)))
# ---- Check data validation
if np.amax(vox_labeled) == 0:
print('Oops! All voxel is labeled empty.')
return
# ---- get size
new_vertices=[]
num_vertices=0
new_faces = []
num_faces = 0
size = vox_labeled.shape
vox_labeled = vox_labeled.flatten()
_x, _y, _z = _get_xyz(size)
_x = _x.flatten()
_y = _y.flatten()
_z = _z.flatten()
vox_labeled[vox_labeled == 255] = 0
vox_labeled[vox_labeled == 1] = color
_rgb = colorMap[vox_labeled[:]]
###attention here, define color here
xyz_rgb = np.stack((_x,_y,_z,_rgb[:, 0], _rgb[:, 1], _rgb[:, 2]),axis=-1)
xyz_rgb = np.array(xyz_rgb)
ply_data = xyz_rgb[np.where(vox_labeled > 0)]
# bb=time.time()
for i in range(len(ply_data)):
num_of_line=i
z = float(ply_data[i][0])
y = float(ply_data[i][1])
x = float(ply_data[i][2])
r = ply_data[i][3]
g = ply_data[i][4]
b = ply_data[i][5]
vertice_one = [x, y, z, r, g, b]
vertice_two = [x, y, z + 1, r, g, b]
vertice_three = [x, y + 1, z + 1, r, g, b]
vertice_four = [x, y + 1, z, r, g, b]
vertice_five = [x + 1, y, z, r, g, b]
vertice_six = [x + 1, y, z + 1, r, g, b]
vertice_seven = [x + 1, y + 1, z + 1, r, g, b]
vertice_eight = [x + 1, y + 1, z, r, g, b]
vertices = [vertice_one, vertice_two, vertice_three, vertice_four,
vertice_five, vertice_six, vertice_seven, vertice_eight]
new_vertices.append(vertices)
num_vertices += len(vertices)
base = 8 * num_of_line
face_one = [4, 0 + base, 1 + base, 2 + base, 3 + base]
face_two = [4, 7 + base, 6 + base, 5 + base, 4 + base]
face_three = [4, 0 + base, 4 + base, 5 + base, 1 + base]
face_four = [4, 1 + base, 5 + base, 6 + base, 2 + base]
face_five = [4, 2 + base, 6 + base, 7 + base, 3 + base]
face_six = [4, 3 + base, 7 + base, 4 + base, 0 + base]
faces = [face_one, face_two, face_three, face_four,
face_five, face_six]
new_faces.append(faces)
num_faces += len(faces)
# print(time.time()-bb)
# cc = time.time()
new_vertices = np.array(new_vertices).reshape(-1,6)
new_faces = np.array(new_faces).reshape(-1,5)
if len(ply_data) == 0:
raise Exception("Oops! That was no valid ply data.")
ply_head = 'ply\n' \
'format ascii 1.0\n' \
'element vertex {}\n' \
'property float x\n' \
'property float y\n' \
'property float z\n' \
'property uchar red\n' \
'property uchar green\n' \
'property uchar blue\n' \
'element face {}\n' \
'property list uint8 int32 vertex_indices\n'\
'end_header'.format(num_vertices, num_faces)
# ---- Save ply data to disk
# if not os.path.exists('/'.join(ply_filename.split('/')[:-1])):
# os.mkdir('/'.join(ply_filename.split('/')[:-1]))
np.savetxt(ply_filename, new_vertices, fmt="%d %d %d %d %d %d", header=ply_head, comments='') # It takes 20s
with open(ply_filename,'ab') as f:
np.savetxt(f, new_faces, fmt="%d %d %d %d %d", comments='') # It takes 20s
del vox_labeled, _x, _y, _z, _rgb, xyz_rgb, ply_data, ply_head
def _downsample_label(label, voxel_size=(240, 144, 240), downscale=4):
r"""downsample the labeled data,
Shape:
label, (240, 144, 240)
label_downscale, if downsample==4, then (60, 36, 60)
"""
if downscale == 1:
return label
ds = downscale
small_size = (voxel_size[0] // ds, voxel_size[1] // ds, voxel_size[2] // ds) # small size
label_downscale = np.zeros(small_size, dtype=np.uint8)
empty_t = 0.95 * ds * ds * ds # threshold
s01 = small_size[0] * small_size[1]
label_i = np.zeros((ds, ds, ds), dtype=np.int32)
for i in range(small_size[0] * small_size[1] * small_size[2]):
z = int(i / s01)
y = int((i - z * s01) / small_size[0])
x = int(i - z * s01 - y * small_size[0])
# z, y, x = np.unravel_index(i, small_size) # 閫熷害鏇存參浜?
# print(x, y, z)
label_i[:, :, :] = label[x * ds:(x + 1) * ds, y * ds:(y + 1) * ds, z * ds:(z + 1) * ds]
label_bin = label_i.flatten() # faltten 杩斿洖鐨勬槸鐪熷疄鐨勬暟缁勶紝闇€瑕佸垎閰嶆柊鐨勫唴瀛樼┖闂?
# label_bin = label_i.ravel() # 灏嗗缁存暟缁勫彉鎴?1缁存暟缁勶紝鑰宺avel 杩斿洖鐨勬槸鏁扮粍鐨勮鍥?
# zero_count_0 = np.sum(label_bin == 0)
# zero_count_255 = np.sum(label_bin == 255)
zero_count_0 = np.array(np.where(label_bin == 0)).size # 瑕佹瘮sum鏇村揩
zero_count_255 = np.array(np.where(label_bin == 255)).size
zero_count = zero_count_0 + zero_count_255
if zero_count > empty_t:
label_downscale[x, y, z] = 0 if zero_count_0 > zero_count_255 else 255
else:
# label_i_s = label_bin[np.nonzero(label_bin)] # get the none empty class labels
label_i_s = label_bin[np.where(np.logical_and(label_bin > 0, label_bin < 255))]
label_downscale[x, y, z] = np.argmax(np.bincount(label_i_s))
return label_downscale
def from_npz_to_ply(npz_file,ply_file,tsdf_file, target_file):
print(npz_file)
if 'npy' in npz_file:
data = np.load(npz_file).astype(int)
elif 'npz' in npz_file:
data = np.load(npz_file)['arr_0'] ### be careful here
else:
print('not supported')
exit()
# print(data.files)
tsdf = np.load(tsdf_file)['arr_1']
target = np.load(target_file)['arr_0']
data = np.ravel(data)
data *= target != 255
data *= tsdf == 1
data = data.reshape(60, 36, 60)
print(ply_file)
if '_sketch' in npz_file:
color=np.array([[22, 191, 206],
[0,128,255]])
voxel_complete_ply(data,ply_file)
else:
voxel_complete_ply(data, ply_file)
pass
# print('aaa',npz_file,ply_file)
return 0
def voxel_complete_ply_torchssc(vox_labeled, ply_filename,label_weight,target):
vox_labeled = vox_labeled
vox_labeled = np.ravel(vox_labeled)
vox_labeled *= target != 255
vox_labeled *= label_weight == 1
vox_labeled = vox_labeled.reshape(60, 36, 60)
if type(vox_labeled) is not np.ndarray:
raise Exception("Oops! Type of vox_labeled should be 'numpy.ndarray', not {}.".format(type(vox_labeled)))
# ---- Check data validation
if np.amax(vox_labeled) == 0:
print('Oops! All voxel is labeled empty.')
return
# ---- get size
new_vertices=[]
num_vertices=0
new_faces = []
num_faces = 0
size = vox_labeled.shape
vox_labeled = vox_labeled.flatten()
_x, _y, _z = _get_xyz(size)
_x = _x.flatten()
_y = _y.flatten()
_z = _z.flatten()
vox_labeled[vox_labeled == 255] = 0
_rgb = colorMap[vox_labeled[:]]
xyz_rgb = np.stack((_x,_y,_z,_rgb[:, 0], _rgb[:, 1], _rgb[:, 2]),axis=-1)
xyz_rgb = np.array(xyz_rgb)
ply_data = xyz_rgb[np.where(vox_labeled > 0)]
# bb=time.time()
for i in range(len(ply_data)):
num_of_line=i
z = float(ply_data[i][0])
y = float(ply_data[i][1])
x = float(ply_data[i][2])
r = ply_data[i][3]
g = ply_data[i][4]
b = ply_data[i][5]
vertice_one = [x, y, z, r, g, b]
vertice_two = [x, y, z + 1, r, g, b]
vertice_three = [x, y + 1, z + 1, r, g, b]
vertice_four = [x, y + 1, z, r, g, b]
vertice_five = [x + 1, y, z, r, g, b]
vertice_six = [x + 1, y, z + 1, r, g, b]
vertice_seven = [x + 1, y + 1, z + 1, r, g, b]
vertice_eight = [x + 1, y + 1, z, r, g, b]
vertices = [vertice_one, vertice_two, vertice_three, vertice_four,
vertice_five, vertice_six, vertice_seven, vertice_eight]
new_vertices.append(vertices)
num_vertices += len(vertices)
base = 8 * num_of_line
face_one = [4, 0 + base, 1 + base, 2 + base, 3 + base]
face_two = [4, 7 + base, 6 + base, 5 + base, 4 + base]
face_three = [4, 0 + base, 4 + base, 5 + base, 1 + base]
face_four = [4, 1 + base, 5 + base, 6 + base, 2 + base]
face_five = [4, 2 + base, 6 + base, 7 + base, 3 + base]
face_six = [4, 3 + base, 7 + base, 4 + base, 0 + base]
faces = [face_one, face_two, face_three, face_four,
face_five, face_six]
new_faces.append(faces)
num_faces += len(faces)
# print(time.time()-bb)
# cc = time.time()
new_vertices = np.array(new_vertices).reshape(-1,6)
new_faces = np.array(new_faces).reshape(-1,5)
if len(ply_data) == 0:
raise Exception("Oops! That was no valid ply data.")
ply_head = 'ply\n' \
'format ascii 1.0\n' \
'element vertex {}\n' \
'property float x\n' \
'property float y\n' \
'property float z\n' \
'property uchar red\n' \
'property uchar green\n' \
'property uchar blue\n' \
'element face {}\n' \
'property list uint8 int32 vertex_indices\n'\
'end_header'.format(num_vertices, num_faces)
# ---- Save ply data to disk
# if not os.path.exists('/'.join(ply_filename.split('/')[:-1])):
# os.mkdir('/'.join(ply_filename.split('/')[:-1]))
np.savetxt(ply_filename, new_vertices, fmt="%d %d %d %d %d %d", header=ply_head, comments='') # It takes 20s
with open(ply_filename,'ab') as f:
np.savetxt(f, new_faces, fmt="%d %d %d %d %d", comments='') # It takes 20s
del vox_labeled, _x, _y, _z, _rgb, xyz_rgb, ply_data, ply_head
| 40.435233 | 113 | 0.548309 | 2,358 | 15,608 | 3.426209 | 0.118321 | 0.073029 | 0.008912 | 0.025993 | 0.729422 | 0.722738 | 0.6835 | 0.6835 | 0.677064 | 0.67137 | 0 | 0.047221 | 0.302601 | 15,608 | 385 | 114 | 40.54026 | 0.694626 | 0.115902 | 0 | 0.717949 | 0 | 0 | 0.098021 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.022436 | false | 0.003205 | 0.00641 | 0 | 0.054487 | 0.022436 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
20c8975031efbb39bfe4341b11f38e3e5f0cd9a6 | 402 | py | Python | History/models.py | mangonihao/MovieRecommendWeb | b612fcda68bf5f8b1f2734c138e3204119a78596 | [
"Apache-2.0"
] | 2 | 2021-11-04T01:51:11.000Z | 2021-11-23T13:21:01.000Z | History/models.py | mangonihao/MovieRecommendWeb | b612fcda68bf5f8b1f2734c138e3204119a78596 | [
"Apache-2.0"
] | null | null | null | History/models.py | mangonihao/MovieRecommendWeb | b612fcda68bf5f8b1f2734c138e3204119a78596 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from baseModel.BaseModel import BaseModel
from Users.models import User
from Movies.models import Movie
# Create your models here.
class BrowseHistory(models.Model):#存放用户浏览历史
history_id = models.AutoField(primary_key=True, verbose_name='用户浏览记录id')
user = models.ForeignKey(User,on_delete=models.CASCADE)
movie = models.ForeignKey(Movie,on_delete=models.CASCADE) | 44.666667 | 76 | 0.80597 | 55 | 402 | 5.8 | 0.545455 | 0.075235 | 0.087774 | 0.131661 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109453 | 402 | 9 | 77 | 44.666667 | 0.891061 | 0.079602 | 0 | 0 | 0 | 0 | 0.021739 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
20dbbb236a181c53ff65c04fa10d5f4f478a4a4a | 197 | py | Python | data/scripts/loadtransferfunction.py | ImagiaViz/inviwo | a00bb6b0551bc1cf26dc0366c827c1a557a9603d | [
"BSD-2-Clause"
] | 349 | 2015-01-30T09:21:52.000Z | 2022-03-25T03:10:02.000Z | data/scripts/loadtransferfunction.py | liu3xing3long/inviwo | 69cca9b6ecd58037bda0ed9e6f53d02f189f19a7 | [
"BSD-2-Clause"
] | 641 | 2015-09-23T08:54:06.000Z | 2022-03-23T09:50:55.000Z | data/scripts/loadtransferfunction.py | liu3xing3long/inviwo | 69cca9b6ecd58037bda0ed9e6f53d02f189f19a7 | [
"BSD-2-Clause"
] | 124 | 2015-02-27T23:45:02.000Z | 2022-02-21T09:37:14.000Z | # Inviwo Python script
import inviwopy
tf = inviwopy.app.network.VolumeRaycaster.transferFunction
tf.load( inviwopy.app.getPath( inviwopy.PathType.TransferFunctions) + "/transferfunction.itf" )
| 28.142857 | 95 | 0.807107 | 21 | 197 | 7.571429 | 0.714286 | 0.138365 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.091371 | 197 | 6 | 96 | 32.833333 | 0.888268 | 0.101523 | 0 | 0 | 0 | 0 | 0.121387 | 0.121387 | 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 |
20dcaee977e66054a76b67c68e422c844bffa372 | 286 | py | Python | PManager/services/service_queue.py | srisankethu/opengift.io | fc490332bd0252610b55a68c1fff1c4f704fcbd4 | [
"Apache-2.0"
] | 1 | 2020-08-30T23:12:08.000Z | 2020-08-30T23:12:08.000Z | PManager/services/service_queue.py | lenarhus/opengift.io | db37494eac141e795c8d9d5b262d54cd6f20fb15 | [
"Apache-2.0"
] | null | null | null | PManager/services/service_queue.py | lenarhus/opengift.io | db37494eac141e795c8d9d5b262d54cd6f20fb15 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
__author__ = 'Rayleigh'
import redis
from tracker import settings
service_queue = redis.StrictRedis(
host=settings.ORDERS_REDIS_HOST,
port=settings.ORDERS_REDIS_PORT,
db=settings.ORDERS_REDIS_DB,
password=settings.ORDERS_REDIS_PASSWORD
).publish
| 23.833333 | 43 | 0.769231 | 36 | 286 | 5.75 | 0.527778 | 0.270531 | 0.36715 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004032 | 0.132867 | 286 | 11 | 44 | 26 | 0.830645 | 0.06993 | 0 | 0 | 0 | 0 | 0.030303 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.111111 | 0.222222 | 0 | 0.222222 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
45532635d1d4a4c4f1bf66249de6896aef8b887f | 4,328 | py | Python | cisca_admin/results.py | codeballet/cisca-admin | 362974faaa892d1afd138796a1e634aa300e90e9 | [
"MIT"
] | 1 | 2021-09-16T12:27:54.000Z | 2021-09-16T12:27:54.000Z | cisca_admin/results.py | codeballet/cisca-admin | 362974faaa892d1afd138796a1e634aa300e90e9 | [
"MIT"
] | null | null | null | cisca_admin/results.py | codeballet/cisca-admin | 362974faaa892d1afd138796a1e634aa300e90e9 | [
"MIT"
] | null | null | null | from flask import (
Blueprint, flash, redirect, render_template, request, send_file, session, url_for
)
from sqlalchemy import and_
from sqlalchemy.orm import selectinload
from flask_paginate import Pagination, get_page_args
from cisca_admin.auth import login_required
from cisca_admin.db import db_session
from cisca_admin.models import Birth, Country, Image, IstdNumber, ChName, Passport, Person, RadNumber, User
bp = Blueprint('results', __name__, url_prefix='/results')
@ bp.route('/table', methods=('GET',))
@ login_required
def table():
message = None
if request.args.get('first_name') and request.args.get('family_name'):
query = Person.query.\
order_by(Person.person_id.asc()).\
options(selectinload(Person.birth)).\
options(selectinload(Person.image)).\
options(selectinload(Person.ch_name)).\
options(selectinload(Person.passport)).\
options(selectinload(Person.rad_number)).\
options(selectinload(Person.istd_number)).\
filter(and_(
Person.first_name == request.args.get('first_name'),
Person.family_name == request.args.get('family_name')
))
elif request.args.get('nickname'):
query = Person.query.\
order_by(Person.family_name.asc()).\
options(selectinload(Person.birth)).\
options(selectinload(Person.image)).\
options(selectinload(Person.ch_name)).\
options(selectinload(Person.passport)).\
options(selectinload(Person.rad_number)).\
options(selectinload(Person.istd_number)).\
filter(Person.nickname == request.args.get('nickname'))
elif request.args.get('first_name'):
name = request.args.get('first_name')
query = Person.query.\
order_by(Person.family_name.asc()).\
options(selectinload(Person.birth)).\
options(selectinload(Person.image)).\
options(selectinload(Person.ch_name)).\
options(selectinload(Person.passport)).\
options(selectinload(Person.rad_number)).\
options(selectinload(Person.istd_number)).\
filter(Person.first_name == name)
elif request.args.get('family_name'):
query = Person.query.\
order_by(Person.first_name.asc()).\
options(selectinload(Person.birth)).\
options(selectinload(Person.image)).\
options(selectinload(Person.ch_name)).\
options(selectinload(Person.passport)).\
options(selectinload(Person.rad_number)).\
options(selectinload(Person.istd_number)).\
filter(Person.family_name == request.args.get('family_name'))
elif request.args.get('everyone'):
query = Person.query.\
order_by(
Person.family_name.asc(),
Person.first_name.asc()
).\
options(selectinload(Person.birth)).\
options(selectinload(Person.image)).\
options(selectinload(Person.ch_name)).\
options(selectinload(Person.passport)).\
options(selectinload(Person.rad_number)).\
options(selectinload(Person.istd_number)).\
options(selectinload(Person.countries))
else:
# No form fields completed
message = 'Please fill in all the search fields.'
# Check query for result
if query.first() is None:
message = 'I could not find anyone matching your search terms.'
# Query is successful, redirect
if message is None:
# Pagination
page = int(request.args.get('page', 1))
per_page = 10
offset = (page - 1) * per_page
query_for_render = query.limit(per_page).offset(offset)
search = False
q = request.args.get('q')
if q:
search = True
pagination = Pagination(
page=page,
per_page=per_page,
offset=offset,
total=query.count(),
css_framework='bootstrap4',
search=search
)
return render_template('people/results.html', query=query_for_render, pagination=pagination)
# No successful query
flash(message)
return redirect(url_for('index.index'))
| 37.310345 | 107 | 0.618762 | 461 | 4,328 | 5.659436 | 0.234273 | 0.225757 | 0.297049 | 0.071292 | 0.5711 | 0.550402 | 0.531238 | 0.529705 | 0.529705 | 0.513607 | 0 | 0.001563 | 0.26086 | 4,328 | 115 | 108 | 37.634783 | 0.814004 | 0.024954 | 0 | 0.389474 | 0 | 0 | 0.062886 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.010526 | false | 0.063158 | 0.073684 | 0 | 0.105263 | 0.021053 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
4553f97487bd57175073597d26fa75efc13a4600 | 1,023 | py | Python | tests/cryptol_eval/test_basics.py | GaloisInc/galois-py-toolk | 101cc00e02c27b9f115d5ea1f6b8af6f0dcea856 | [
"BSD-3-Clause"
] | null | null | null | tests/cryptol_eval/test_basics.py | GaloisInc/galois-py-toolk | 101cc00e02c27b9f115d5ea1f6b8af6f0dcea856 | [
"BSD-3-Clause"
] | 10 | 2021-02-15T16:41:42.000Z | 2021-03-12T19:36:41.000Z | tests/cryptol_eval/test_basics.py | GaloisInc/galois-py-toolk | 101cc00e02c27b9f115d5ea1f6b8af6f0dcea856 | [
"BSD-3-Clause"
] | 2 | 2021-02-15T14:35:43.000Z | 2021-02-18T19:08:22.000Z | import os
from pathlib import Path
import signal
import subprocess
import time
import unittest
from distutils.spawn import find_executable
import cryptol
from cryptol.bitvector import BV
class CryptolEvalServerTests(unittest.TestCase):
# Connection to cryptol
c = None
@classmethod
def setUpClass(self):
dir_path = Path(os.path.dirname(os.path.realpath(__file__)))
if command := os.getenv('CRYPTOL_SERVER'):
self.c = cryptol.connect(f'{command} socket --module M', cryptol_path=dir_path)
else:
raise ValueError('CRYPTOL_SERVER environment variable not set (eval server tests currently only work with a local executable)')
def test_evaluation(self):
if self.c:
c = self.c
res = c.call('f', BV(size=8,value=0xff)).result()
self.assertEqual(res, [BV(size=8,value=0xff), BV(size=8,value=0xff)])
# def test_disallowed_ops(self):
# pass # TODO/FIXME
if __name__ == "__main__":
unittest.main()
| 27.648649 | 139 | 0.673509 | 134 | 1,023 | 4.985075 | 0.537313 | 0.022455 | 0.031437 | 0.053892 | 0.071856 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007557 | 0.223851 | 1,023 | 36 | 140 | 28.416667 | 0.833753 | 0.071359 | 0 | 0 | 0 | 0 | 0.166138 | 0 | 0 | 0 | 0.012698 | 0.027778 | 0.04 | 1 | 0.08 | false | 0 | 0.36 | 0 | 0.52 | 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 |
457ddc1f591d2012ccec6970d0a013f5e9d0c736 | 215 | py | Python | alpyro_msgs/std_msgs/float64.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | 1 | 2020-12-13T13:07:10.000Z | 2020-12-13T13:07:10.000Z | alpyro_msgs/std_msgs/float64.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | alpyro_msgs/std_msgs/float64.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | from alpyro_msgs import RosMessage, float64
class Float64(RosMessage):
__msg_typ__ = "std_msgs/Float64"
__msg_def__ = "ZmxvYXQ2NCBkYXRhCgo="
__md5_sum__ = "fdb28210bfa9d7c91146260178d9a584"
data: float64
| 21.5 | 50 | 0.790698 | 22 | 215 | 6.954545 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172043 | 0.134884 | 215 | 9 | 51 | 23.888889 | 0.650538 | 0 | 0 | 0 | 0 | 0 | 0.316279 | 0.148837 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 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 |
4582bfac59a5e934a6945d5899e90751a1b93c9b | 324 | py | Python | Python/FromUniversity/finalwork/quadratic.py | programmer-666/Codes | fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b | [
"MIT"
] | null | null | null | Python/FromUniversity/finalwork/quadratic.py | programmer-666/Codes | fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b | [
"MIT"
] | null | null | null | Python/FromUniversity/finalwork/quadratic.py | programmer-666/Codes | fdffe38a789ba3636dff7ceaa9f1b4113ae17c2b | [
"MIT"
] | 1 | 2021-09-16T14:24:29.000Z | 2021-09-16T14:24:29.000Z | # -*- coding: utf-8 -*-
# Quaratik denklem
import math
x, y, z = 10, 1, -30
def deltaf(a,b,c):
return b**2-4*a*c
def x1(a, b, delta):
return (-b+math.sqrt(delta))/(2*a)
def x2(a, b, delta):
return (-b-math.sqrt(delta))/(2*a)
if deltaf(x,y,z) > 0:
print(x1(x, y, deltaf(x, y, z)), x2(x, y, deltaf(x, y, z))) | 23.142857 | 63 | 0.546296 | 69 | 324 | 2.565217 | 0.405797 | 0.067797 | 0.067797 | 0.152542 | 0.451977 | 0.451977 | 0.327684 | 0.327684 | 0.327684 | 0.327684 | 0 | 0.057692 | 0.197531 | 324 | 14 | 63 | 23.142857 | 0.623077 | 0.117284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.1 | 0.3 | 0.7 | 0.1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
459187e8b7f8c04bfdb24e1b7e0f3c31aeb97743 | 980 | py | Python | src/openprocurement/framework/electroniccatalogue/tests/periods.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 10 | 2020-02-18T01:56:21.000Z | 2022-03-28T00:32:57.000Z | src/openprocurement/framework/electroniccatalogue/tests/periods.py | quintagroup/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 26 | 2018-07-16T09:30:44.000Z | 2021-02-02T17:51:30.000Z | src/openprocurement/framework/electroniccatalogue/tests/periods.py | ProzorroUKR/openprocurement.api | 2855a99aa8738fb832ee0dbad4e9590bd3643511 | [
"Apache-2.0"
] | 15 | 2019-08-08T10:50:47.000Z | 2022-02-05T14:13:36.000Z | from datetime import timedelta
PERIODS = {
"active": {
"start": {
"enquiryPeriod": {
"startDate": timedelta(),
"endDate": timedelta(days=10),
},
"period": {
"startDate": timedelta(),
"endDate": timedelta(days=30)
},
"qualificationPeriod": {
"startDate": timedelta(days=10),
"endDate": timedelta(days=61)
},
}
},
"complete": {
"start": {
"enquiryPeriod": {
"startDate": -timedelta(days=61),
"endDate": -timedelta(days=51),
},
"period": {
"startDate": -timedelta(days=61),
"endDate": -timedelta(days=30)
},
"qualificationPeriod": {
"startDate": -timedelta(days=51),
"endDate": timedelta()
}
}
}
}
| 26.486486 | 49 | 0.4 | 57 | 980 | 6.877193 | 0.315789 | 0.298469 | 0.255102 | 0.183673 | 0.637755 | 0.494898 | 0.494898 | 0.321429 | 0 | 0 | 0 | 0.033771 | 0.456122 | 980 | 36 | 50 | 27.222222 | 0.701689 | 0 | 0 | 0.342857 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.028571 | 0 | 0.028571 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
45b561fc2efb92b15d6ff7dddfe858020412f68a | 2,318 | py | Python | RLPython/distribution.py | snumrl/DistributedDeepMimic | 364d07dbdd5378b6d46d944e472e1632712ef5f6 | [
"MIT"
] | null | null | null | RLPython/distribution.py | snumrl/DistributedDeepMimic | 364d07dbdd5378b6d46d944e472e1632712ef5f6 | [
"MIT"
] | null | null | null | RLPython/distribution.py | snumrl/DistributedDeepMimic | 364d07dbdd5378b6d46d944e472e1632712ef5f6 | [
"MIT"
] | null | null | null | import torch
import torch.distributions as tdist
import math
class DistributionInterface():
def get_scale(self, state):
assert(False)
def sample(self, mu, state):
assert(False)
def log_density(self, act, mu, state):
assert(False)
def train(self):
pass
def eval(self):
pass
def zero_grad(self):
pass
def step(self):
pass
def set_ckpt(self, ckpt):
pass
def get_ckpt(self):
return {}
class FixedGaussianDistribution(DistributionInterface):
def __init__(self, dist, scale):
self.dist = dist
self.scale = scale
def get_scale(self, state):
return self.scale
def sample(self, mu, state):
return self.dist(mu, self.scale).sample()
def log_prob(self, act, mu, state):
return self.dist(mu, self.scale).log_prob(act)
def entropy(self, mu, state):
return self.dist(mu, self.scale).entropy()
def set_ckpt(self, ckpt):
assert('scale' in ckpt)
self.scale = ckpt['scale']
#if 'scale' in ckpt: self.scale = ckpt['scale']
def get_ckpt(self):
return {'scale' : self.scale}
class NetGaussianDistribution(DistributionInterface):
def __init__(self, dist, network, opt, scale):
self.dist = dist
self.network = network
self.opt = opt
self.scale = scale
def get_scale(self, state):
res = torch.exp(self.network(state.cuda()).cpu()) * self.scale
return res
def sample(self, mu, state):
return self.dist(mu, self.get_scale(state)).sample()
def log_prob(self, act, mu, state):
return self.dist(mu, self.get_scale(state)).log_prob(act)
def entropy(self, mu, state):
return self.dist(mu, self.get_scale(state)).entropy()
def train(self):
self.network.train()
def eval(self):
self.network.eval()
def zero_grad(self):
self.opt.zero_grad()
def step(self):
self.opt.step()
def set_ckpt(self, ckpt):
assert('netdist' and 'scale' in ckpt)
self.network.load_state_dict(ckpt['netdist'])
self.scale = ckpt['scale']
def get_ckpt(self):
return {'netdist' : self.network.state_dict(), \
'scale' : self.scale}
| 23.653061 | 70 | 0.597929 | 299 | 2,318 | 4.531773 | 0.157191 | 0.079705 | 0.077491 | 0.075277 | 0.583764 | 0.419188 | 0.383764 | 0.354244 | 0.300369 | 0.2369 | 0 | 0 | 0.277394 | 2,318 | 97 | 71 | 23.896907 | 0.808955 | 0.019845 | 0 | 0.550725 | 0 | 0 | 0.022457 | 0 | 0 | 0 | 0 | 0 | 0.072464 | 1 | 0.391304 | false | 0.072464 | 0.043478 | 0.144928 | 0.637681 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 3 |
45c16348200f556342f744685214a4e124a21835 | 74 | py | Python | exercicios/exe025/exe025.py | tiagolsouza/exercicios-Curso-em-video-PYTHON | e4e6975fac7e4883aeab58b970c6ca72895564e4 | [
"MIT"
] | null | null | null | exercicios/exe025/exe025.py | tiagolsouza/exercicios-Curso-em-video-PYTHON | e4e6975fac7e4883aeab58b970c6ca72895564e4 | [
"MIT"
] | null | null | null | exercicios/exe025/exe025.py | tiagolsouza/exercicios-Curso-em-video-PYTHON | e4e6975fac7e4883aeab58b970c6ca72895564e4 | [
"MIT"
] | null | null | null | nome = input('Digite seu nome completo: ')
print('SILVA' in nome.upper())
| 24.666667 | 42 | 0.689189 | 11 | 74 | 4.636364 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.135135 | 74 | 2 | 43 | 37 | 0.796875 | 0 | 0 | 0 | 0 | 0 | 0.418919 | 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 |
afdf6851204dcc96a54b3fa8c492dbcd5f5f6ba0 | 102 | py | Python | API e JSON/archive_teste.py | DouglasCarvalhoPereira/Especializaco-Python | 7dface66ef0c86e183e5a5f1a2c9e6f753647d69 | [
"MIT"
] | null | null | null | API e JSON/archive_teste.py | DouglasCarvalhoPereira/Especializaco-Python | 7dface66ef0c86e183e5a5f1a2c9e6f753647d69 | [
"MIT"
] | null | null | null | API e JSON/archive_teste.py | DouglasCarvalhoPereira/Especializaco-Python | 7dface66ef0c86e183e5a5f1a2c9e6f753647d69 | [
"MIT"
] | null | null | null | valor = 12
def teste_git(testes):
result = testes ** 33
return result
print(teste_git(valor))
| 12.75 | 23 | 0.686275 | 15 | 102 | 4.533333 | 0.666667 | 0.235294 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049383 | 0.205882 | 102 | 7 | 24 | 14.571429 | 0.790123 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.4 | 0.2 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
aff07a2d9e33e1fe95456de73dedf3c4d0182fb7 | 192 | py | Python | utils/cmd.py | tiennguyen1510/Android-Pentest-Suite | 33b34476da33e3528d573a8ca102e2b91aabc3f8 | [
"MIT"
] | 11 | 2019-10-07T08:08:53.000Z | 2022-01-27T05:13:55.000Z | utils/cmd.py | tiennguyen1510/Android-Pentest-Suite | 33b34476da33e3528d573a8ca102e2b91aabc3f8 | [
"MIT"
] | null | null | null | utils/cmd.py | tiennguyen1510/Android-Pentest-Suite | 33b34476da33e3528d573a8ca102e2b91aabc3f8 | [
"MIT"
] | 9 | 2019-10-02T03:28:47.000Z | 2021-02-07T13:37:18.000Z | import subprocess
def do_cmd(list_cmd):
cmd_result = None
try:
cmd_result = subprocess.check_output(list_cmd)
except Exception as e:
print e
return cmd_result | 19.2 | 54 | 0.677083 | 27 | 192 | 4.555556 | 0.62963 | 0.219512 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.270833 | 192 | 10 | 55 | 19.2 | 0.878571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.125 | null | null | 0.125 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b3034e35c7e44b2219e9644b8fa5ddad0c644daa | 128 | py | Python | elephantblog/__init__.py | sbaechler/feincms-elephantblog | d3d1824d1781cfa0f81d6cf16577f8e540fc1441 | [
"BSD-3-Clause"
] | null | null | null | elephantblog/__init__.py | sbaechler/feincms-elephantblog | d3d1824d1781cfa0f81d6cf16577f8e540fc1441 | [
"BSD-3-Clause"
] | null | null | null | elephantblog/__init__.py | sbaechler/feincms-elephantblog | d3d1824d1781cfa0f81d6cf16577f8e540fc1441 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
VERSION = (1, 0, 2, 'beta')
__version__ = '.'.join(map(str, VERSION))
| 25.6 | 56 | 0.726563 | 17 | 128 | 4.882353 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026786 | 0.125 | 128 | 4 | 57 | 32 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0.039063 | 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 |
b307c99a53dff8aa58d3bdc56ba0ec9b17ce7a00 | 448 | py | Python | HW7/HOhorodnyk/CW_7_1.py | kolyasalubov/Lv-677.PythonCore | c9f9107c734a61e398154a90b8a3e249276c2704 | [
"MIT"
] | null | null | null | HW7/HOhorodnyk/CW_7_1.py | kolyasalubov/Lv-677.PythonCore | c9f9107c734a61e398154a90b8a3e249276c2704 | [
"MIT"
] | null | null | null | HW7/HOhorodnyk/CW_7_1.py | kolyasalubov/Lv-677.PythonCore | c9f9107c734a61e398154a90b8a3e249276c2704 | [
"MIT"
] | 6 | 2022-02-22T22:30:49.000Z | 2022-03-28T12:51:19.000Z | def count_positives_sum_negatives(arr):
if not arr:
return []
positive_array_count = 0
negative_array_count = 0
neither_array = 0
for i in arr:
if i > 0:
positive_array_count = positive_array_count + 1
elif i == 0:
neither_array = neither_array + i
else:
negative_array_count = negative_array_count + i
return [positive_array_count, negative_array_count] | 29.866667 | 60 | 0.631696 | 58 | 448 | 4.5 | 0.344828 | 0.306513 | 0.275862 | 0.183908 | 0.214559 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019481 | 0.3125 | 448 | 15 | 61 | 29.866667 | 0.827922 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | false | 0 | 0 | 0 | 0.214286 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
b33e524fc63f4db5427f52713f52b42dd3ba1adb | 3,834 | py | Python | open_discussions_api/users/client_test.py | mitodl/open-discussions-client | e2da9b751eebcfbfb20d081baf46299fbfea38b9 | [
"BSD-3-Clause"
] | null | null | null | open_discussions_api/users/client_test.py | mitodl/open-discussions-client | e2da9b751eebcfbfb20d081baf46299fbfea38b9 | [
"BSD-3-Clause"
] | 20 | 2017-08-28T18:12:33.000Z | 2018-07-30T17:26:27.000Z | open_discussions_api/users/client_test.py | mitodl/open-discussions-client | e2da9b751eebcfbfb20d081baf46299fbfea38b9 | [
"BSD-3-Clause"
] | null | null | null | """Tests for user client API"""
# pylint: disable=unused-argument
import json
import pytest
def test_list_users(api_client):
"""Test list users for correct request"""
resp = api_client.users.list()
assert resp.status_code == 200
assert resp.json() == [{
"id": 39,
"username": "01BQRHXRDP1J63DF8QQB6B8TKA",
"profile": {
"name": "name",
"image": "test1.jpg",
"image_small": "test2.jpg",
"image_medium": "test3.jpg"
}
}]
def test_create_user(api_client):
"""Test create user"""
resp = api_client.users.create(
'user1',
email='user@example.com',
profile=dict(
name="my name",
image="image1.jpg",
image_small="image2.jpg",
image_medium="image3.jpg",
email_optin=True
)
)
assert json.loads(resp.request.body) == {
"uid": "user1",
"email": "user@example.com",
"profile": {
"name": "my name",
"image": "image1.jpg",
"image_small": "image2.jpg",
"image_medium": "image3.jpg",
"email_optin": True,
}
}
assert resp.status_code == 201
assert resp.json() == {
"id": 127,
"username": "01C53XW2FCHQE1PAPHZMH036HF",
"profile": {
"name": "my name",
"image": "image1.jpg",
"image_small": "image2.jpg",
"image_medium": "image3.jpg"
}
}
def test_create_user_no_profile_props(api_client):
"""Updating with no args raises error"""
with pytest.raises(AttributeError) as err:
api_client.users.create('user1')
assert str(err.value) == "No fields provided to create"
def test_create_user_invalid_profile_props(api_client):
"""Updating with invalid arg raises error"""
with pytest.raises(AttributeError) as err:
api_client.users.create('user1', profile=dict(bad_arg=2))
assert str(err.value) == "Profile attribute bad_arg is not supported"
def test_get_user(api_client, use_betamax):
"""Test get user"""
resp = api_client.users.get("01BRMT958T3DW02ZAYDG7N6QCB")
assert resp.status_code == 200
assert resp.json() == {
"id": 41,
"username": "01BRMT958T3DW02ZAYDG7N6QCB",
"profile": {
"name": "my name",
"image": "image1.jpg",
"image_small": "image4.jpg",
"image_medium": "image3.jpg",
}
}
def test_update_user(api_client):
"""Test patch user"""
resp = api_client.users.update(
"01BRMT958T3DW02ZAYDG7N6QCB",
uid='user1',
email='user@example.com',
profile=dict(image_small="image4.jpg")
)
assert json.loads(resp.request.body) == {
"uid": "user1",
"email": "user@example.com",
"profile": {
"image_small": "image4.jpg",
}
}
assert resp.status_code == 200
assert resp.json() == {
"id": 41,
"username": "01BRMT958T3DW02ZAYDG7N6QCB",
"profile": {
"name": "my name",
"image": "image1.jpg",
"image_small": "image4.jpg",
"image_medium": "image3.jpg"
}
}
def test_update_user_no_profile_props(api_client):
"""Updating with no args raises error"""
with pytest.raises(AttributeError) as err:
api_client.users.update("01BRMT958T3DW02ZAYDG7N6QCB")
assert str(err.value) == "No fields provided to update"
def test_update_user_invalid_profile_props(api_client):
"""Updating with invalid arg raises error"""
with pytest.raises(AttributeError) as err:
api_client.users.update("01BRMT958T3DW02ZAYDG7N6QCB", profile=dict(bad_arg=2))
assert str(err.value) == "Profile attribute bad_arg is not supported"
| 29.267176 | 86 | 0.581377 | 420 | 3,834 | 5.142857 | 0.202381 | 0.066667 | 0.051852 | 0.034722 | 0.7875 | 0.709722 | 0.709722 | 0.672685 | 0.640278 | 0.622222 | 0 | 0.04557 | 0.278821 | 3,834 | 130 | 87 | 29.492308 | 0.735624 | 0.075378 | 0 | 0.456311 | 0 | 0 | 0.273793 | 0.059446 | 0 | 0 | 0 | 0 | 0.135922 | 1 | 0.07767 | false | 0 | 0.019417 | 0 | 0.097087 | 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 |
b342d7a258555039d5bb6ec6c4d457addb008d7c | 415 | py | Python | tests/conftest.py | audacious-io/aiomeasures | 5c7c54da0f481ec82892ac77d4fc20ae81c41d58 | [
"MIT"
] | 6 | 2017-08-26T09:51:29.000Z | 2019-05-05T23:32:00.000Z | tests/conftest.py | audacious-io/aiomeasures | 5c7c54da0f481ec82892ac77d4fc20ae81c41d58 | [
"MIT"
] | 3 | 2018-04-11T16:43:16.000Z | 2019-01-05T17:52:38.000Z | tests/conftest.py | audacious-io/aiomeasures | 5c7c54da0f481ec82892ac77d4fc20ae81c41d58 | [
"MIT"
] | 7 | 2017-08-26T09:51:32.000Z | 2022-01-26T12:05:20.000Z | # debug asyncio
import os
import os.path
import sys
import logging
import warnings
from pytest import fixture
from subprocess import Popen, PIPE
from time import sleep
os.environ['PYTHONASYNCIODEBUG'] = '1'
# logging.basicConfig(level=logging.DEBUG)
warnings.simplefilter("always")
warnings.filterwarnings('ignore', '.*sys.meta_path is empty.*')
warnings.filterwarnings('ignore', '.*deprecated.*', module='site')
| 24.411765 | 66 | 0.778313 | 52 | 415 | 6.192308 | 0.596154 | 0.049689 | 0.173913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002674 | 0.098795 | 415 | 16 | 67 | 25.9375 | 0.858289 | 0.13012 | 0 | 0 | 0 | 0 | 0.226257 | 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 |
b3642863d3607917dd28041210682c33bef82c9b | 53 | py | Python | alphad3m/alphad3m/__init__.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | alphad3m/alphad3m/__init__.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | alphad3m/alphad3m/__init__.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | __version__ = '0.23.0.dev0'
from .api import AutoML
| 13.25 | 27 | 0.716981 | 9 | 53 | 3.777778 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 0.150943 | 53 | 3 | 28 | 17.666667 | 0.644444 | 0 | 0 | 0 | 0 | 0 | 0.207547 | 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 |
2fb13fae4825a42b3db4d2d45d893ef57bf59586 | 1,536 | py | Python | others/regularizers.py | booleangabs/Machine-Learning-With-Numpy | 6a493c67979290e0a1d03cc8fb97f78448bd2156 | [
"MIT"
] | null | null | null | others/regularizers.py | booleangabs/Machine-Learning-With-Numpy | 6a493c67979290e0a1d03cc8fb97f78448bd2156 | [
"MIT"
] | null | null | null | others/regularizers.py | booleangabs/Machine-Learning-With-Numpy | 6a493c67979290e0a1d03cc8fb97f78448bd2156 | [
"MIT"
] | null | null | null | # Native
# Site-packages
import numpy as np
# Locals
class Regularizer:
def __init__(self):
pass
def __call__(self):
raise NotImplementedError()
def grad(self):
raise NotImplementedError()
class Placeholder(Regularizer):
def __call__(self, X: np.array) -> float:
return 0
def grad(self, X: np.array) -> np.array:
return np.zeros(X.shape[0])
class L1(Regularizer):
def __init__(self, lambda_: float):
self.lambda_ = lambda_
def __call__(self, X: np.array) -> float:
X_norm = np.abs(X).sum()
return self.lambda_ * X_norm
def grad(self, X: np.array) -> np.array:
return self.lambda_ * np.sign(X)
class L2(Regularizer):
def __init__(self, omega_: float):
self.omega_ = omega_
def __call__(self, X: np.array) -> float:
X_norm_squared = np.linalg.norm(X) ** 2
return self.omega_ * X_norm_squared
def grad(self, X: np.array) -> np.array:
return 2 * self.omega_ * X
class ElasticNet(Regularizer):
def __init__(self, lambda_1: float, lambda_2: float):
self.l1 = L1(1)
self.l2 = L2(1)
self.alpha = lambda_2 / (lambda_1 + lambda_2)
def __call__(self, X: np.array) -> float:
return self.alpha * self.l2(X) + (1 - self.alpha) * self.l1(X)
def grad(self, X: np.array) -> np.array:
return self.alpha * self.l2.grad(X) + (1 - self.alpha) * self.l1.grad(X) | 26.482759 | 80 | 0.57487 | 207 | 1,536 | 3.990338 | 0.193237 | 0.101695 | 0.067797 | 0.116223 | 0.447942 | 0.348668 | 0.307506 | 0.307506 | 0.234867 | 0.087167 | 0 | 0.021336 | 0.298177 | 1,536 | 58 | 80 | 26.482759 | 0.744898 | 0.017578 | 0 | 0.263158 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.368421 | false | 0.026316 | 0.026316 | 0.157895 | 0.736842 | 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 |
2fbf35e3c1e0032485bd78d2d595e16bd8cf42d7 | 241 | py | Python | randThought/main.py | anokata/pythonPetProjects | 245c3ff11ae560b17830970061d8d60013948fd7 | [
"MIT"
] | 3 | 2017-04-30T17:44:53.000Z | 2018-02-03T06:02:11.000Z | randThought/main.py | anokata/pythonPetProjects | 245c3ff11ae560b17830970061d8d60013948fd7 | [
"MIT"
] | 10 | 2021-03-18T20:17:19.000Z | 2022-03-11T23:14:19.000Z | randThought/main.py | anokata/pythonPetProjects | 245c3ff11ae560b17830970061d8d60013948fd7 | [
"MIT"
] | null | null | null | from google_images_download import google_images_download
response = google_images_download.googleimagesdownload()
arguments = {"keywords":"Cat,pussy,beatch","limit":1,"print_urls":False}
paths = response.download(arguments)
print(paths)
| 30.125 | 72 | 0.813278 | 29 | 241 | 6.517241 | 0.62069 | 0.190476 | 0.31746 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004464 | 0.070539 | 241 | 7 | 73 | 34.428571 | 0.839286 | 0 | 0 | 0 | 0 | 0 | 0.161826 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0.4 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2fe277fb0f96e1a38f17edf9d8154996798a69a0 | 89 | py | Python | contests/atcoder/abc042/a.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | contests/atcoder/abc042/a.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | contests/atcoder/abc042/a.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | lst = sorted(list(map(int, input().split())))
print('YES' if lst == [5, 5, 7] else 'NO')
| 29.666667 | 45 | 0.573034 | 16 | 89 | 3.1875 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.039474 | 0.146067 | 89 | 2 | 46 | 44.5 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0.05618 | 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 |
2fea835d79d521e2232665ab25e998ec866c8470 | 450 | py | Python | markdown_it/common/entities.py | wna-se/markdown-it-py | a7e3d3b436a00f3303aab03f81ba32de53a3ba71 | [
"MIT"
] | null | null | null | markdown_it/common/entities.py | wna-se/markdown-it-py | a7e3d3b436a00f3303aab03f81ba32de53a3ba71 | [
"MIT"
] | null | null | null | markdown_it/common/entities.py | wna-se/markdown-it-py | a7e3d3b436a00f3303aab03f81ba32de53a3ba71 | [
"MIT"
] | null | null | null | """HTML5 entities map: { name -> characters }."""
import html
class _Entities:
def __getattr__(self, name):
try:
return DATA[name]
except KeyError:
raise AttributeError(name)
def __getitem__(self, name):
return DATA[name]
def __contains__(self, name):
return name in DATA
entities = _Entities()
DATA = {name.rstrip(";"): chars for name, chars in html.entities.html5.items()}
| 20.454545 | 79 | 0.615556 | 51 | 450 | 5.156863 | 0.490196 | 0.091255 | 0.106464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006079 | 0.268889 | 450 | 21 | 80 | 21.428571 | 0.793313 | 0.095556 | 0 | 0.153846 | 0 | 0 | 0.002494 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0 | 0.076923 | 0.153846 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
2feb058436344716b8bb46a22dc94e1408d44abd | 86 | py | Python | scrape_commodities.py | kominetz/elite-tools | 5cefef9b45027b10479ccef8bdcdc94914245c43 | [
"Apache-2.0"
] | 2 | 2020-08-17T17:23:58.000Z | 2020-08-17T17:38:48.000Z | scrape_commodities.py | kominetz/elite-tools | 5cefef9b45027b10479ccef8bdcdc94914245c43 | [
"Apache-2.0"
] | 30 | 2020-05-06T16:25:10.000Z | 2021-12-25T15:08:31.000Z | scrape_commodities.py | kominetz/elite-tools | 5cefef9b45027b10479ccef8bdcdc94914245c43 | [
"Apache-2.0"
] | null | null | null | from elitetools import eddb
x = eddb.load_rt_listings()
print(x)
print('---', len(x)) | 17.2 | 27 | 0.697674 | 14 | 86 | 4.142857 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.116279 | 86 | 5 | 28 | 17.2 | 0.763158 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 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 |
64174c3e6e5bafd652bd08a0daf2e438ba2e462e | 487 | py | Python | ays_api/Repository.py | Jumpscale/g8cockpit | 5e9ede183f77fec4adff9cd038567173b68677f0 | [
"Apache-2.0"
] | null | null | null | ays_api/Repository.py | Jumpscale/g8cockpit | 5e9ede183f77fec4adff9cd038567173b68677f0 | [
"Apache-2.0"
] | 332 | 2016-05-24T10:51:45.000Z | 2021-09-08T12:28:50.000Z | ays_api/Repository.py | Jumpscale/g8cockpit | 5e9ede183f77fec4adff9cd038567173b68677f0 | [
"Apache-2.0"
] | 1 | 2016-08-02T07:52:49.000Z | 2016-08-02T07:52:49.000Z |
from flask_wtf import Form
from wtforms.validators import DataRequired, Length, Regexp, NumberRange, required
from wtforms import TextField, FormField, IntegerField, FloatField, FileField, BooleanField, DateField, FieldList
from .input_validators import multiple_of
class Repository(Form):
name = TextField(validators=[DataRequired(message="Name must be specified")])
path = TextField()
git_url = TextField(validators=[DataRequired(message="Git URL must be specified")])
| 37.461538 | 113 | 0.790554 | 56 | 487 | 6.803571 | 0.589286 | 0.057743 | 0.16273 | 0.199475 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.125257 | 487 | 12 | 114 | 40.583333 | 0.894366 | 0 | 0 | 0 | 0 | 0 | 0.096708 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 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 | 1 | 0 | 1 | 0 | 0 | 3 |
641dc9588152402a1d2dae4bae6721487ed98a49 | 295 | py | Python | tests/urls.py | narnikgamarnikus/django-url-shorter | dcea9f77af951ec3cfc41fbbc4bab951ccab7f41 | [
"MIT"
] | null | null | null | tests/urls.py | narnikgamarnikus/django-url-shorter | dcea9f77af951ec3cfc41fbbc4bab951ccab7f41 | [
"MIT"
] | null | null | null | tests/urls.py | narnikgamarnikus/django-url-shorter | dcea9f77af951ec3cfc41fbbc4bab951ccab7f41 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from url_shorter.urls import urlpatterns as url_shorter_urls
urlpatterns = [
url(r'^shorter/', include((url_shorter_urls, 'url_shorter'), namespace='url_shorter'))
] | 29.5 | 90 | 0.762712 | 40 | 295 | 5.3 | 0.475 | 0.235849 | 0.198113 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003846 | 0.118644 | 295 | 10 | 91 | 29.5 | 0.811538 | 0.071186 | 0 | 0 | 0 | 0 | 0.113553 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
642198b13f402b986497d99f0bb0f3f9e3e5c71b | 80 | py | Python | xclim/testing/tests/data.py | aaronspring/xclim | 393797308a581428c229920a3b0933c8243cd03a | [
"Apache-2.0"
] | 169 | 2018-09-14T21:14:40.000Z | 2022-03-29T14:27:06.000Z | xclim/testing/tests/data.py | raquel-ucl/xclim | 6102e542e6e08072a60879d6200f9340207cd50e | [
"Apache-2.0"
] | 950 | 2018-08-23T16:13:17.000Z | 2022-03-28T19:30:59.000Z | xclim/testing/tests/data.py | raquel-ucl/xclim | 6102e542e6e08072a60879d6200f9340207cd50e | [
"Apache-2.0"
] | 35 | 2018-12-04T21:12:10.000Z | 2022-03-04T20:38:07.000Z | from pathlib import Path
__all__ = ["TD"]
TD = Path(__file__).parent / "data"
| 13.333333 | 35 | 0.675 | 11 | 80 | 4.181818 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175 | 80 | 5 | 36 | 16 | 0.69697 | 0 | 0 | 0 | 0 | 0 | 0.075 | 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 |
642555d2c65adac3ad8474fb7d84758a34753cb0 | 309 | py | Python | tests/plugins/test_auftanken.py | nickersk/streamlink-27 | 95c47866a741d32f6c4ca153b6eff908abadfbe4 | [
"BSD-2-Clause"
] | 5 | 2020-12-26T18:57:59.000Z | 2022-03-09T15:10:39.000Z | tests/plugins/test_auftanken.py | nickersk/streamlink-27 | 95c47866a741d32f6c4ca153b6eff908abadfbe4 | [
"BSD-2-Clause"
] | 2 | 2021-06-09T14:13:58.000Z | 2021-09-27T19:14:46.000Z | tests/plugins/test_auftanken.py | nickersk/streamlink-27 | 95c47866a741d32f6c4ca153b6eff908abadfbe4 | [
"BSD-2-Clause"
] | 6 | 2021-02-12T10:24:25.000Z | 2022-01-01T13:08:49.000Z | from streamlink.plugins.auftanken import AuftankenTV
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlAuftankenTV(PluginCanHandleUrl):
__plugin__ = AuftankenTV
should_match = [
"https://www.auftanken.tv/livestream/",
"https://auftanken.tv/livestream",
]
| 25.75 | 60 | 0.747573 | 27 | 309 | 8.37037 | 0.62963 | 0.097345 | 0.185841 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.161812 | 309 | 11 | 61 | 28.090909 | 0.872587 | 0 | 0 | 0 | 0 | 0 | 0.216828 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.625 | 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 | 0 | 0 | 1 | 0 | 0 | 3 |
642c7e0390ec256795c7b91abb5837944f1462ad | 265 | py | Python | setup.py | eliasz-1/currencyConverter | 3202a9821af1e8493d395c75e2646e2b70304f61 | [
"MIT"
] | 4 | 2019-10-05T12:27:26.000Z | 2021-06-11T12:19:11.000Z | setup.py | eliasz-1/currencyConverter | 3202a9821af1e8493d395c75e2646e2b70304f61 | [
"MIT"
] | 5 | 2019-10-05T06:25:54.000Z | 2021-06-29T05:06:34.000Z | setup.py | eliasz-1/currencyConverter | 3202a9821af1e8493d395c75e2646e2b70304f61 | [
"MIT"
] | 13 | 2019-10-05T07:04:54.000Z | 2021-12-17T14:42:57.000Z | from distutils.core import setup
setup(name='currencyConverter',
version='1.0',
description='Convert between currencies',
author='Sachin Tripathi',
url='https://github.com/snifhex/currencyConverter',
py_modules=['converter'],
)
| 26.5 | 57 | 0.671698 | 27 | 265 | 6.555556 | 0.925926 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009346 | 0.192453 | 265 | 9 | 58 | 29.444444 | 0.817757 | 0 | 0 | 0 | 0 | 0 | 0.430189 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.125 | 0 | 0.125 | 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 |
643bc1f8e3707c7746cf42d0440b7fe939c695b3 | 27 | py | Python | katas/beta/how_many_times_does_it_contain.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | katas/beta/how_many_times_does_it_contain.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | katas/beta/how_many_times_does_it_contain.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | string_counter = str.count
| 13.5 | 26 | 0.814815 | 4 | 27 | 5.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 27 | 1 | 27 | 27 | 0.875 | 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 |
ff37f1bece99c8c7ffef981b275267931aff9802 | 213 | py | Python | Chapter10/default_dict_example.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | 12 | 2018-07-09T16:20:31.000Z | 2022-03-21T22:52:15.000Z | Chapter10/default_dict_example.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | null | null | null | Chapter10/default_dict_example.py | kaushalkumarshah/Learn-Python-in-7-Days | 2663656767c8959ace836f0c0e272f3e501bbe6e | [
"MIT"
] | 19 | 2018-01-09T12:49:06.000Z | 2021-11-23T08:05:55.000Z | from collections import defaultdict
def func():
return "Cricket"
game = defaultdict(func)
game["A"]= "Football"
game["B"] = "Badminton"
print game
print game["A"]
print game["B"]
print game["C"] | 15.214286 | 36 | 0.643192 | 28 | 213 | 4.892857 | 0.535714 | 0.262774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.197183 | 213 | 14 | 37 | 15.214286 | 0.80117 | 0 | 0 | 0 | 0 | 0 | 0.144279 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.1 | null | null | 0.4 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ff726a3c0e7466e6dcfe89ee04c9486d7d92e286 | 457 | py | Python | model/gif_info.py | smwsk/gif-python | 29e606ee28d22049f34ff0cddb9f4ef1f6edc676 | [
"Apache-2.0"
] | 2 | 2020-03-16T13:28:28.000Z | 2020-03-17T13:47:58.000Z | model/gif_info.py | smwsk/gif-python | 29e606ee28d22049f34ff0cddb9f4ef1f6edc676 | [
"Apache-2.0"
] | null | null | null | model/gif_info.py | smwsk/gif-python | 29e606ee28d22049f34ff0cddb9f4ef1f6edc676 | [
"Apache-2.0"
] | null | null | null | from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from model.base_model import BaseModel
Base = declarative_base()
class gifInfo(Base, BaseModel):
__tablename__ = 'gif_info'
_db_name = 'gif'
tid = Column(BigInteger, primary_key=True)
name = Column(String(128))
description = Column(String(255))
home_url = Column(String(128))
video_url = Column(String(128))
template_url = Column(String(128))
| 30.466667 | 55 | 0.730853 | 58 | 457 | 5.517241 | 0.5 | 0.1875 | 0.1875 | 0.16875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03937 | 0.166302 | 457 | 14 | 56 | 32.642857 | 0.800525 | 0 | 0 | 0 | 0 | 0 | 0.024123 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.230769 | 0 | 0.923077 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
ff8521c26fc34007f9642340c26ab4ca9e0fb794 | 1,159 | py | Python | api/beers/migrations/0006_auto_20201208_1931.py | haavardnk/Vinmonopolet-x-Untappd | 950db7201593d7b94daf091884949aed4377d4ca | [
"MIT"
] | null | null | null | api/beers/migrations/0006_auto_20201208_1931.py | haavardnk/Vinmonopolet-x-Untappd | 950db7201593d7b94daf091884949aed4377d4ca | [
"MIT"
] | null | null | null | api/beers/migrations/0006_auto_20201208_1931.py | haavardnk/Vinmonopolet-x-Untappd | 950db7201593d7b94daf091884949aed4377d4ca | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-08 18:31
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beers', '0005_auto_20201208_1856'),
]
operations = [
migrations.AlterField(
model_name='beer',
name='picture',
field=models.TextField(blank=True, null=True, validators=[django.core.validators.URLValidator()]),
),
migrations.AlterField(
model_name='beer',
name='undappd_url',
field=models.TextField(blank=True, null=True, validators=[django.core.validators.URLValidator()]),
),
migrations.AlterField(
model_name='beer',
name='vinmonopolet_url',
field=models.TextField(blank=True, null=True, validators=[django.core.validators.URLValidator()]),
),
migrations.AlterField(
model_name='sitesetting',
name='url',
field=models.TextField(blank=True, null=True, validators=[django.core.validators.URLValidator()]),
),
]
| 33.114286 | 111 | 0.594478 | 111 | 1,159 | 6.126126 | 0.387387 | 0.073529 | 0.147059 | 0.170588 | 0.683824 | 0.683824 | 0.629412 | 0.629412 | 0.629412 | 0.629412 | 0 | 0.037215 | 0.281277 | 1,159 | 34 | 112 | 34.088235 | 0.779112 | 0.038827 | 0 | 0.535714 | 1 | 0 | 0.081633 | 0.021336 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.071429 | 0 | 0.178571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 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 |
4418df428a253871184bf3c05d21d02761f463d1 | 275 | py | Python | batch/batch/__main__.py | zietzm/hail | 6c5d5379472a47b27b860151996f0067dbad2610 | [
"MIT"
] | null | null | null | batch/batch/__main__.py | zietzm/hail | 6c5d5379472a47b27b860151996f0067dbad2610 | [
"MIT"
] | null | null | null | batch/batch/__main__.py | zietzm/hail | 6c5d5379472a47b27b860151996f0067dbad2610 | [
"MIT"
] | null | null | null | from aiohttp import web
from hailtop.config import get_deploy_config
from gear import configure_logging
from .batch import app
configure_logging()
deploy_config = get_deploy_config()
web.run_app(deploy_config.prefix_application(app, 'batch'), host='0.0.0.0', port=5000)
| 21.153846 | 86 | 0.803636 | 43 | 275 | 4.906977 | 0.465116 | 0.227488 | 0.14218 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03252 | 0.105455 | 275 | 12 | 87 | 22.916667 | 0.825203 | 0 | 0 | 0 | 0 | 0 | 0.043636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.571429 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
4422c12ffa5c333f33e3ae90327a1eba3f298163 | 3,679 | py | Python | fastccd_support_ioc/utils/python2-version/getFClkStatus.py | lbl-camera/fastccd_support_ioc | 80b3820744e9aec7923af6adec0a66a0c51b2c21 | [
"BSD-3-Clause"
] | null | null | null | fastccd_support_ioc/utils/python2-version/getFClkStatus.py | lbl-camera/fastccd_support_ioc | 80b3820744e9aec7923af6adec0a66a0c51b2c21 | [
"BSD-3-Clause"
] | 1 | 2020-08-07T22:22:25.000Z | 2020-08-07T22:22:25.000Z | fastccd_support_ioc/utils/python2-version/getFClkStatus.py | lbl-camera/fastccd_support_ioc | 80b3820744e9aec7923af6adec0a66a0c51b2c21 | [
"BSD-3-Clause"
] | 1 | 2021-02-08T22:06:05.000Z | 2021-02-08T22:06:05.000Z | #! /usr/bin/python
# -*- coding: utf-8 -*-
import cin_constants
import cin_register_map
import cin_functions
import time
# def getFCLK():
print
" "
print
"**** CIN FCLK Configuration ****\n"
regval = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_WR)
print
" FCLK OSC MUX SELECT : 0x" + regval[4:]
if (regval[4:5] == "F"):
# Freeze DCO
cin_functions.WriteReg(cin_register_map.REG_FCLK_I2C_ADDRESS, "B189", 0)
cin_functions.WriteReg(cin_register_map.REG_FRM_COMMAND, cin_register_map.CMD_FCLK_COMMIT, 0)
reg_val = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_RD)
if (reg_val[6:] != "08"): print
" Status Reg : 0x" + reg_val[6:]
cin_functions.WriteReg(cin_register_map.REG_FCLK_I2C_ADDRESS, "B107", 0)
cin_functions.WriteReg(cin_register_map.REG_FRM_COMMAND, cin_register_map.CMD_FCLK_COMMIT, 0)
reg_val7 = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_RD)
cin_functions.WriteReg(cin_register_map.REG_FCLK_I2C_ADDRESS, "B108", 0)
cin_functions.WriteReg(cin_register_map.REG_FRM_COMMAND, cin_register_map.CMD_FCLK_COMMIT, 0)
reg_val8 = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_RD)
cin_functions.WriteReg(cin_register_map.REG_FCLK_I2C_ADDRESS, "B109", 0)
cin_functions.WriteReg(cin_register_map.REG_FRM_COMMAND, cin_register_map.CMD_FCLK_COMMIT, 0)
reg_val9 = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_RD)
cin_functions.WriteReg(cin_register_map.REG_FCLK_I2C_ADDRESS, "B10A", 0)
cin_functions.WriteReg(cin_register_map.REG_FRM_COMMAND, cin_register_map.CMD_FCLK_COMMIT, 0)
reg_val10 = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_RD)
cin_functions.WriteReg(cin_register_map.REG_FCLK_I2C_ADDRESS, "B10B", 0)
cin_functions.WriteReg(cin_register_map.REG_FRM_COMMAND, cin_register_map.CMD_FCLK_COMMIT, 0)
reg_val11 = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_RD)
cin_functions.WriteReg(cin_register_map.REG_FCLK_I2C_ADDRESS, "B10C", 0)
cin_functions.WriteReg(cin_register_map.REG_FRM_COMMAND, cin_register_map.CMD_FCLK_COMMIT, 0)
reg_val12 = cin_functions.ReadReg(cin_register_map.REG_FCLK_I2C_DATA_RD)
bin_reg7 = bin(int(reg_val7[6:], 16))[2:].zfill(8)
bin_reg8 = bin(int(reg_val8[6:], 16))[2:].zfill(8)
# print bin_reg7[0:3]
if (bin_reg7[0:3] == "000"): print
" FCLK HS Divider = 4"
if (bin_reg7[0:3] == "001"): print
" FCLK HS Divider = 5"
if (bin_reg7[0:3] == "010"): print
" FCLK HS Divider = 6"
if (bin_reg7[0:3] == "011"): print
" FCLK HS Divider = 7"
bin_n1 = bin_reg7[3:8] + bin_reg8[0:2]
dec_n1 = int(bin_n1, 2)
if (dec_n1 % 2 != 0): dec_n1 = dec_n1 + 1
print
" FCLK N1 Divider = " + str(dec_n1)
print
" FCLK RFREQ = " + reg_val8[7:] + reg_val9[6:7] + "." + reg_val9[7:] + reg_val10[6:] + reg_val11[6:] + reg_val12[
6:]
if (bin_reg7[0:3] == "000" and dec_n1 == 8): print
" FCLK Frequency = 156 MHz"
elif (bin_reg7[0:3] == "000" and dec_n1 == 10): print
" FCLK Frequency = 125 MHz"
elif (bin_reg7[0:3] == "001" and dec_n1 == 4): print
" FCLK Frequency = 250 MHz"
elif (bin_reg7[0:3] == "011" and dec_n1 == 4): print
" FCLK Frequency = 200 MHz"
else: print
" FCLK Frequency UNKNOWN "
elif (str(int(regval[4:5]) & 1110) == "2"):
print
" FCLK Frequency = 250 MHz"
elif (str(int(regval[4:5]) & 1110) == "6"): print
" FCLK Frequency = 200 MHz"
elif (str(int(regval[4:5]) & 1110) == "A"): print
" FCLK Frequency = 125 MHz"
time.sleep(0.1)
| 39.138298 | 118 | 0.683881 | 586 | 3,679 | 3.94198 | 0.158703 | 0.142857 | 0.181818 | 0.161905 | 0.729004 | 0.674459 | 0.634632 | 0.601732 | 0.562771 | 0.562771 | 0 | 0.073888 | 0.187007 | 3,679 | 93 | 119 | 39.55914 | 0.698429 | 0.023104 | 0 | 0.267606 | 0 | 0 | 0.129284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.056338 | null | null | 0.253521 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
443d3433902f90f40401caa6e1c496e6e14d4356 | 136 | py | Python | python/27-find_nemo.py | kevinbeirne1/udemy_master_coding_interview | 44f082d4bb5e65a5f39347b82df97859b79cf8cc | [
"MIT"
] | null | null | null | python/27-find_nemo.py | kevinbeirne1/udemy_master_coding_interview | 44f082d4bb5e65a5f39347b82df97859b79cf8cc | [
"MIT"
] | null | null | null | python/27-find_nemo.py | kevinbeirne1/udemy_master_coding_interview | 44f082d4bb5e65a5f39347b82df97859b79cf8cc | [
"MIT"
] | null | null | null | def find_nemo(array):
for item in array:
if item == 'nemo':
print('found NEMO')
nemo = ['nemo']
find_nemo(nemo) | 19.428571 | 31 | 0.558824 | 19 | 136 | 3.894737 | 0.526316 | 0.324324 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.294118 | 136 | 7 | 32 | 19.428571 | 0.770833 | 0 | 0 | 0 | 0 | 0 | 0.131387 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.166667 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
444c03128f0e92e8e47449187a196f3078f0a27e | 139 | py | Python | ospbackend/loco/locohook/urls.py | sammacorpy/News-analysis | 31b6ef790889ae43e7e0f64b11c64739b135377b | [
"BSD-3-Clause"
] | 3 | 2019-07-17T15:25:36.000Z | 2019-07-17T17:14:34.000Z | ospbackend/loco/locohook/urls.py | sammacorpy/News-analysis | 31b6ef790889ae43e7e0f64b11c64739b135377b | [
"BSD-3-Clause"
] | 8 | 2020-09-04T19:33:03.000Z | 2022-03-02T03:43:50.000Z | ospbackend/loco/locohook/urls.py | sammacorpy/News-analysis | 31b6ef790889ae43e7e0f64b11c64739b135377b | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('postnews', views.postnews),
]
| 17.375 | 37 | 0.741007 | 18 | 139 | 5.722222 | 0.555556 | 0.194175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.165468 | 139 | 7 | 38 | 19.857143 | 0.887931 | 0 | 0 | 0 | 0 | 0 | 0.057554 | 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 |
4458e2ee58d9a67351e5fe3092749475ed76f18f | 82 | py | Python | examples/3/echonl.0.py | ekohilas/comp2041_plpy | 54ab21eaba1b11814cd683ba4a5b18f329561cff | [
"MIT"
] | 2 | 2018-05-28T06:19:37.000Z | 2019-02-28T19:48:18.000Z | examples/3/echonl.0.py | ekohilas/comp2041_plpy | 54ab21eaba1b11814cd683ba4a5b18f329561cff | [
"MIT"
] | null | null | null | examples/3/echonl.0.py | ekohilas/comp2041_plpy | 54ab21eaba1b11814cd683ba4a5b18f329561cff | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3.5 -u
import sys
for arg in sys.argv[1:]:
print(arg)
| 13.666667 | 29 | 0.646341 | 16 | 82 | 3.3125 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044118 | 0.170732 | 82 | 5 | 30 | 16.4 | 0.735294 | 0.341463 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
4459ae086c95dfa244cb8f9183879540ef3fa5f4 | 26,907 | py | Python | src/mbed_cloud/_backends/statistics/models/metric.py | GQMai/mbed-cloud-sdk-python | 76ef009903415f37f69dcc5778be8f5fb14c08fe | [
"Apache-2.0"
] | 12 | 2017-12-28T11:18:43.000Z | 2020-10-04T12:11:15.000Z | src/mbed_cloud/_backends/statistics/models/metric.py | GQMai/mbed-cloud-sdk-python | 76ef009903415f37f69dcc5778be8f5fb14c08fe | [
"Apache-2.0"
] | 50 | 2017-12-21T12:50:41.000Z | 2020-01-13T16:07:08.000Z | src/mbed_cloud/_backends/statistics/models/metric.py | GQMai/mbed-cloud-sdk-python | 76ef009903415f37f69dcc5778be8f5fb14c08fe | [
"Apache-2.0"
] | 8 | 2018-04-25T17:47:29.000Z | 2019-08-29T06:38:27.000Z | # coding: utf-8
"""
Connect Statistics API
Connect Statistics API provides statistics about other cloud services through defined counters.
OpenAPI spec version: 3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class Metric(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'bootstraps_failed': 'int',
'bootstraps_pending': 'int',
'bootstraps_successful': 'int',
'connect_rest_api_error': 'int',
'connect_rest_api_success': 'int',
'deleted_registrations': 'int',
'device_observations': 'int',
'device_proxy_request_error': 'int',
'device_proxy_request_success': 'int',
'device_subscription_request_error': 'int',
'device_subscription_request_success': 'int',
'expired_registrations': 'int',
'full_registrations': 'int',
'handshakes_successful': 'int',
'id': 'str',
'registration_updates': 'int',
'timestamp': 'datetime',
'transactions': 'int'
}
attribute_map = {
'bootstraps_failed': 'bootstraps_failed',
'bootstraps_pending': 'bootstraps_pending',
'bootstraps_successful': 'bootstraps_successful',
'connect_rest_api_error': 'connect_rest_api_error',
'connect_rest_api_success': 'connect_rest_api_success',
'deleted_registrations': 'deleted_registrations',
'device_observations': 'device_observations',
'device_proxy_request_error': 'device_proxy_request_error',
'device_proxy_request_success': 'device_proxy_request_success',
'device_subscription_request_error': 'device_subscription_request_error',
'device_subscription_request_success': 'device_subscription_request_success',
'expired_registrations': 'expired_registrations',
'full_registrations': 'full_registrations',
'handshakes_successful': 'handshakes_successful',
'id': 'id',
'registration_updates': 'registration_updates',
'timestamp': 'timestamp',
'transactions': 'transactions'
}
def __init__(self, bootstraps_failed=None, bootstraps_pending=None, bootstraps_successful=None, connect_rest_api_error=None, connect_rest_api_success=None, deleted_registrations=None, device_observations=None, device_proxy_request_error=None, device_proxy_request_success=None, device_subscription_request_error=None, device_subscription_request_success=None, expired_registrations=None, full_registrations=None, handshakes_successful=None, id=None, registration_updates=None, timestamp=None, transactions=None):
"""
Metric - a model defined in Swagger
"""
self._bootstraps_failed = bootstraps_failed
self._bootstraps_pending = bootstraps_pending
self._bootstraps_successful = bootstraps_successful
self._connect_rest_api_error = connect_rest_api_error
self._connect_rest_api_success = connect_rest_api_success
self._deleted_registrations = deleted_registrations
self._device_observations = device_observations
self._device_proxy_request_error = device_proxy_request_error
self._device_proxy_request_success = device_proxy_request_success
self._device_subscription_request_error = device_subscription_request_error
self._device_subscription_request_success = device_subscription_request_success
self._expired_registrations = expired_registrations
self._full_registrations = full_registrations
self._handshakes_successful = handshakes_successful
self._id = id
self._registration_updates = registration_updates
self._timestamp = timestamp
self._transactions = transactions
self.discriminator = None
@property
def bootstraps_failed(self):
"""
Gets the bootstraps_failed of this Metric.
The number of failed bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_failed of this Metric.
:rtype: int
"""
return self._bootstraps_failed
@bootstraps_failed.setter
def bootstraps_failed(self, bootstraps_failed):
"""
Sets the bootstraps_failed of this Metric.
The number of failed bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_failed: The bootstraps_failed of this Metric.
:type: int
"""
self._bootstraps_failed = bootstraps_failed
@property
def bootstraps_pending(self):
"""
Gets the bootstraps_pending of this Metric.
The number of pending bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_pending of this Metric.
:rtype: int
"""
return self._bootstraps_pending
@bootstraps_pending.setter
def bootstraps_pending(self, bootstraps_pending):
"""
Sets the bootstraps_pending of this Metric.
The number of pending bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_pending: The bootstraps_pending of this Metric.
:type: int
"""
self._bootstraps_pending = bootstraps_pending
@property
def bootstraps_successful(self):
"""
Gets the bootstraps_successful of this Metric.
The number of successful bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:return: The bootstraps_successful of this Metric.
:rtype: int
"""
return self._bootstraps_successful
@bootstraps_successful.setter
def bootstraps_successful(self, bootstraps_successful):
"""
Sets the bootstraps_successful of this Metric.
The number of successful bootstraps the account has performed. Bootstrap is the process of provisioning a Lightweight Machine to Machine Client to a state where it can initiate a management session to a new Lightweight Machine to Machine Server.
:param bootstraps_successful: The bootstraps_successful of this Metric.
:type: int
"""
self._bootstraps_successful = bootstraps_successful
@property
def connect_rest_api_error(self):
"""
Gets the connect_rest_api_error of this Metric.
The number of failed [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed.The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:return: The connect_rest_api_error of this Metric.
:rtype: int
"""
return self._connect_rest_api_error
@connect_rest_api_error.setter
def connect_rest_api_error(self, connect_rest_api_error):
"""
Sets the connect_rest_api_error of this Metric.
The number of failed [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed.The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:param connect_rest_api_error: The connect_rest_api_error of this Metric.
:type: int
"""
self._connect_rest_api_error = connect_rest_api_error
@property
def connect_rest_api_success(self):
"""
Gets the connect_rest_api_success of this Metric.
The number of successful [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed. The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:return: The connect_rest_api_success of this Metric.
:rtype: int
"""
return self._connect_rest_api_success
@connect_rest_api_success.setter
def connect_rest_api_success(self, connect_rest_api_success):
"""
Sets the connect_rest_api_success of this Metric.
The number of successful [Connect API](/docs/current/service-api-references/connect-api.html) requests the account has performed. The metric do not consider the actual response from the device and it includes only the result of the HTTP request used to subscibe to the device resources.
:param connect_rest_api_success: The connect_rest_api_success of this Metric.
:type: int
"""
self._connect_rest_api_success = connect_rest_api_success
@property
def deleted_registrations(self):
"""
Gets the deleted_registrations of this Metric.
The number of deleted registrations (deregistrations) linked to the account. Deregistration is the process of removing the device registration from the Device Management Connect registry. The deregistration is usually initiated by the device. Device Management Connect no longer handles requests for a deregistered device.
:return: The deleted_registrations of this Metric.
:rtype: int
"""
return self._deleted_registrations
@deleted_registrations.setter
def deleted_registrations(self, deleted_registrations):
"""
Sets the deleted_registrations of this Metric.
The number of deleted registrations (deregistrations) linked to the account. Deregistration is the process of removing the device registration from the Device Management Connect registry. The deregistration is usually initiated by the device. Device Management Connect no longer handles requests for a deregistered device.
:param deleted_registrations: The deleted_registrations of this Metric.
:type: int
"""
self._deleted_registrations = deleted_registrations
@property
def device_observations(self):
"""
Gets the device_observations of this Metric.
**(Beta)** The number of observations received by Device Management Connect from the devices linked to the account. The observations are pushed from the device to Device Management Connect when you have successfully subscribed to the device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_observations of this Metric.
:rtype: int
"""
return self._device_observations
@device_observations.setter
def device_observations(self, device_observations):
"""
Sets the device_observations of this Metric.
**(Beta)** The number of observations received by Device Management Connect from the devices linked to the account. The observations are pushed from the device to Device Management Connect when you have successfully subscribed to the device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_observations: The device_observations of this Metric.
:type: int
"""
self._device_observations = device_observations
@property
def device_proxy_request_error(self):
"""
Gets the device_proxy_request_error of this Metric.
**(Beta)** The number of failed proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_proxy_request_error of this Metric.
:rtype: int
"""
return self._device_proxy_request_error
@device_proxy_request_error.setter
def device_proxy_request_error(self, device_proxy_request_error):
"""
Sets the device_proxy_request_error of this Metric.
**(Beta)** The number of failed proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_proxy_request_error: The device_proxy_request_error of this Metric.
:type: int
"""
self._device_proxy_request_error = device_proxy_request_error
@property
def device_proxy_request_success(self):
"""
Gets the device_proxy_request_success of this Metric.
**(Beta)** The number of successful proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_proxy_request_success of this Metric.
:rtype: int
"""
return self._device_proxy_request_success
@device_proxy_request_success.setter
def device_proxy_request_success(self, device_proxy_request_success):
"""
Sets the device_proxy_request_success of this Metric.
**(Beta)** The number of successful proxy requests from Device Management Connect to devices linked to the account. The proxy requests are made from Mbed Cloud Connect to devices when you try to read or write values to device resources using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_proxy_request_success: The device_proxy_request_success of this Metric.
:type: int
"""
self._device_proxy_request_success = device_proxy_request_success
@property
def device_subscription_request_error(self):
"""
Gets the device_subscription_request_error of this Metric.
**(Beta)** The number of failed subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_subscription_request_error of this Metric.
:rtype: int
"""
return self._device_subscription_request_error
@device_subscription_request_error.setter
def device_subscription_request_error(self, device_subscription_request_error):
"""
Sets the device_subscription_request_error of this Metric.
**(Beta)** The number of failed subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_subscription_request_error: The device_subscription_request_error of this Metric.
:type: int
"""
self._device_subscription_request_error = device_subscription_request_error
@property
def device_subscription_request_success(self):
"""
Gets the device_subscription_request_success of this Metric.
**(Beta)** The number of successful subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:return: The device_subscription_request_success of this Metric.
:rtype: int
"""
return self._device_subscription_request_success
@device_subscription_request_success.setter
def device_subscription_request_success(self, device_subscription_request_success):
"""
Sets the device_subscription_request_success of this Metric.
**(Beta)** The number of successful subscription requests from Device Management Connect to devices linked to the account. The subscription requests are made from Device Management Connect to devices when you try to subscribe to a resource path using [Connect API](/docs/current/service-api-references/mbed-cloud-connect.html) endpoints.
:param device_subscription_request_success: The device_subscription_request_success of this Metric.
:type: int
"""
self._device_subscription_request_success = device_subscription_request_success
@property
def expired_registrations(self):
"""
Gets the expired_registrations of this Metric.
The number of expired registrations linked to the account. Device Management Connect removes the device registrations when the devices cannot update their registration before the expiry of the lifetime. Device Management Connect no longer handles requests for a device whose registration has expired already.
:return: The expired_registrations of this Metric.
:rtype: int
"""
return self._expired_registrations
@expired_registrations.setter
def expired_registrations(self, expired_registrations):
"""
Sets the expired_registrations of this Metric.
The number of expired registrations linked to the account. Device Management Connect removes the device registrations when the devices cannot update their registration before the expiry of the lifetime. Device Management Connect no longer handles requests for a device whose registration has expired already.
:param expired_registrations: The expired_registrations of this Metric.
:type: int
"""
self._expired_registrations = expired_registrations
@property
def full_registrations(self):
"""
Gets the full_registrations of this Metric.
The number of full registrations linked to the account. Full registration is the process of registering a device with Device Management Connect by providing its lifetime and capabilities such as the resource structure.The registered status of the device does not guarantee that the device is active and accessible from Device Management Connect at any point of time.
:return: The full_registrations of this Metric.
:rtype: int
"""
return self._full_registrations
@full_registrations.setter
def full_registrations(self, full_registrations):
"""
Sets the full_registrations of this Metric.
The number of full registrations linked to the account. Full registration is the process of registering a device with Device Management Connect by providing its lifetime and capabilities such as the resource structure.The registered status of the device does not guarantee that the device is active and accessible from Device Management Connect at any point of time.
:param full_registrations: The full_registrations of this Metric.
:type: int
"""
self._full_registrations = full_registrations
@property
def handshakes_successful(self):
"""
Gets the handshakes_successful of this Metric.
The number of successful TLS handshakes the account has performed. The SSL or TLS handshake enables the SSL or TLS client and server to establish the secret keys with which they communicate. A successful TLS handshake is required for establishing a connection with Device Management Connect for any operaton such as registration, registration update and deregistration.
:return: The handshakes_successful of this Metric.
:rtype: int
"""
return self._handshakes_successful
@handshakes_successful.setter
def handshakes_successful(self, handshakes_successful):
"""
Sets the handshakes_successful of this Metric.
The number of successful TLS handshakes the account has performed. The SSL or TLS handshake enables the SSL or TLS client and server to establish the secret keys with which they communicate. A successful TLS handshake is required for establishing a connection with Device Management Connect for any operaton such as registration, registration update and deregistration.
:param handshakes_successful: The handshakes_successful of this Metric.
:type: int
"""
self._handshakes_successful = handshakes_successful
@property
def id(self):
"""
Gets the id of this Metric.
A unique metric ID.
:return: The id of this Metric.
:rtype: str
"""
return self._id
@id.setter
def id(self, id):
"""
Sets the id of this Metric.
A unique metric ID.
:param id: The id of this Metric.
:type: str
"""
self._id = id
@property
def registration_updates(self):
"""
Gets the registration_updates of this Metric.
The number of registration updates linked to the account. Registration update is the process of updating the registration status with Device Management Connect to update or extend the lifetime of the device.
:return: The registration_updates of this Metric.
:rtype: int
"""
return self._registration_updates
@registration_updates.setter
def registration_updates(self, registration_updates):
"""
Sets the registration_updates of this Metric.
The number of registration updates linked to the account. Registration update is the process of updating the registration status with Device Management Connect to update or extend the lifetime of the device.
:param registration_updates: The registration_updates of this Metric.
:type: int
"""
self._registration_updates = registration_updates
@property
def timestamp(self):
"""
Gets the timestamp of this Metric.
UTC time in RFC3339 format. The timestamp is the starting point of the interval for which the data is aggregated. Each interval includes data for the time greater than or equal to the timestamp and less than the next interval's starting point.
:return: The timestamp of this Metric.
:rtype: datetime
"""
return self._timestamp
@timestamp.setter
def timestamp(self, timestamp):
"""
Sets the timestamp of this Metric.
UTC time in RFC3339 format. The timestamp is the starting point of the interval for which the data is aggregated. Each interval includes data for the time greater than or equal to the timestamp and less than the next interval's starting point.
:param timestamp: The timestamp of this Metric.
:type: datetime
"""
self._timestamp = timestamp
@property
def transactions(self):
"""
Gets the transactions of this Metric.
The number of transaction events from or to devices linked to the account. A transaction is a 512-byte block of data processed by Device Management. It can be either sent by the device (device --> mbed cloud) or received by the device (Device Management --> device). A transaction does not include IP, TCP or UDP, TLS or DTLS packet overhead. It only contains the packet payload (full CoAP packet including CoAP headers).
:return: The transactions of this Metric.
:rtype: int
"""
return self._transactions
@transactions.setter
def transactions(self, transactions):
"""
Sets the transactions of this Metric.
The number of transaction events from or to devices linked to the account. A transaction is a 512-byte block of data processed by Device Management. It can be either sent by the device (device --> mbed cloud) or received by the device (Device Management --> device). A transaction does not include IP, TCP or UDP, TLS or DTLS packet overhead. It only contains the packet payload (full CoAP packet including CoAP headers).
:param transactions: The transactions of this Metric.
:type: int
"""
self._transactions = transactions
def to_dict(self):
"""
Returns the model properties as a dict
"""
result = {}
for attr, _ in iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
return result
def to_str(self):
"""
Returns the string representation of the model
"""
return pformat(self.to_dict())
def __repr__(self):
"""
For `print` and `pprint`
"""
return self.to_str()
def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Metric):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""
Returns true if both objects are not equal
"""
return not self == other
| 47.538869 | 516 | 0.712528 | 3,354 | 26,907 | 5.543232 | 0.082588 | 0.023236 | 0.046472 | 0.01775 | 0.79787 | 0.730744 | 0.697235 | 0.679002 | 0.626506 | 0.569277 | 0 | 0.000918 | 0.230498 | 26,907 | 565 | 517 | 47.623009 | 0.89703 | 0.570372 | 0 | 0.277228 | 1 | 0 | 0.125398 | 0.080272 | 0 | 0 | 0 | 0 | 0 | 1 | 0.207921 | false | 0 | 0.014851 | 0 | 0.356436 | 0.004951 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 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 | 0 | 0 | 0 | 3 |
4466720b5dbe42fd45f61cb31cceee9fd6eeb3c3 | 92 | py | Python | classes/main.py | karan1276/learning-python | 9f0791370fbdf9e1d5b94ef874f8eb403d34c22c | [
"MIT"
] | null | null | null | classes/main.py | karan1276/learning-python | 9f0791370fbdf9e1d5b94ef874f8eb403d34c22c | [
"MIT"
] | null | null | null | classes/main.py | karan1276/learning-python | 9f0791370fbdf9e1d5b94ef874f8eb403d34c22c | [
"MIT"
] | null | null | null | from rationalFolder import rationalFile
ra = rationalFile.rational("karan")
ra.printName()
| 18.4 | 39 | 0.804348 | 10 | 92 | 7.4 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097826 | 92 | 4 | 40 | 23 | 0.891566 | 0 | 0 | 0 | 0 | 0 | 0.054348 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
9220ae8329563a8d5d3a501e362783adedb503d4 | 956 | py | Python | katas/kata10.py | cesarau04/metodosnumericos | 9670c91d5c659d2bfb1b95e85c437e6deed9ec28 | [
"MIT"
] | null | null | null | katas/kata10.py | cesarau04/metodosnumericos | 9670c91d5c659d2bfb1b95e85c437e6deed9ec28 | [
"MIT"
] | null | null | null | katas/kata10.py | cesarau04/metodosnumericos | 9670c91d5c659d2bfb1b95e85c437e6deed9ec28 | [
"MIT"
] | null | null | null | # 7x^1 - 2x^2 + 1x^3 + 2x^4 = 3
# 2x^1 + 8x^2 + 3x^3 + 1x^4 = -2
# -1x^1 + 0x^2 + 5x^3 + 2x^4 = 5
# 0x^1 + 2x^2 - 1x^3 + 4x^4 = 4
def getX1(x2,x3,x4):
return (3+2*x2-x3-2*x4)/7
def getX2(x1,x3,x4):
return (-2-2*x1-3*x3-x4)/8
def getX3(x1,x2,x4):
return (5+x1-2*x4)/5
def getX4(x1,x2,x3):
return (4-2*x2+x3)/4
x1=0
x2=0
x3=0
x4=0
#error=0.00001
x1a = 0.00001
x2a = 0.00001
x3a = 0.00001
x4a = 0.00001
for i in range(5):
x1 = getX1(x2,x3, x4)
x2 = getX2(x1,x3, x4)
x3 = getX3(x1,x2, x4)
x4 = getX4(x1,x2, x3)
#print("VALUES {0}{1}{2}{3}".format(x1,x2,x3,x4))
ex1 = abs((x1a-x1)/x1a)
ex2 = abs((x2a-x2)/x2a)
ex3 = abs((x3a-x3)/x3a)
ex4 = abs((x4a-x4)/x4a)
#if ex1 < error and ex2 < error and ex3 < error:
#break
x1a = x1
x2a = x2
x3a = x3
x4a = x4
print("FINAL: {0}\t{1}\t{2}\t{3}".format(x1,x2,x3,x4))
print("Errores: {0}\t{1}\t{2}\t{3}".format(ex1,ex2,ex3,ex4))
| 19.510204 | 60 | 0.521967 | 209 | 956 | 2.38756 | 0.239234 | 0.064128 | 0.048096 | 0.024048 | 0.126253 | 0.098196 | 0.052104 | 0.052104 | 0 | 0 | 0 | 0.262069 | 0.241632 | 956 | 48 | 61 | 19.916667 | 0.426207 | 0.25 | 0 | 0 | 0 | 0 | 0.07355 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.129032 | false | 0 | 0 | 0.129032 | 0.258065 | 0.064516 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
9230a452e0a9c8a0f7ab9f045e08c05edac942e6 | 2,838 | py | Python | python/apsis/host_group.py | alexhsamuel/apsis | 7a038a39e5002637b60f73147728b4cc53692da3 | [
"BSD-3-Clause"
] | 1 | 2021-06-03T15:35:31.000Z | 2021-06-03T15:35:31.000Z | python/apsis/host_group.py | alexhsamuel/apsis | 7a038a39e5002637b60f73147728b4cc53692da3 | [
"BSD-3-Clause"
] | 93 | 2018-08-17T20:32:09.000Z | 2022-03-23T17:34:37.000Z | python/apsis/host_group.py | alexhsamuel/apsis | 7a038a39e5002637b60f73147728b4cc53692da3 | [
"BSD-3-Clause"
] | null | null | null | """
Designation of host(s) to run on.
"""
import random
from .lib.json import TypedJso
from .runs import template_expand
#-------------------------------------------------------------------------------
class HostGroup(TypedJso):
TYPE_NAMES = TypedJso.TypeNames()
def __init__(self, hosts):
self.__hosts = tuple(hosts)
assert all( isinstance(h, str) for h in self.__hosts )
@classmethod
def from_jso(cls, jso):
# Accept a single host or a list of hosts.
return (
SingleHost(jso) if isinstance(jso, str)
else RandomHostGroup(jso) if isinstance(jso, list)
else TypedJso.from_jso.__func__(cls, jso)
)
@property
def hosts(self):
return self.__hosts
def bind(self, args):
hosts = tuple( template_expand(a, args) for a in self.__hosts )
return type(self)(hosts)
class SingleHost(HostGroup):
"""
Single fixed host.
"""
def __init__(self, host):
super().__init__([host])
@property
def host(self):
return self.hosts[0]
@classmethod
def from_jso(cls, jso):
# Special case: just use the host.
return cls(jso.pop("host"))
def to_jso(self):
return self.host
def choose(self):
return self.host
class RoundRobinHostGroup(HostGroup):
"""
A round-robin cycle of hosts.
"""
def __init__(self, hosts):
super().__init__(hosts)
self.__index = 0
@classmethod
def from_jso(cls, jso):
return cls(jso.pop("hosts"))
def to_jso(self):
return {
**super().to_jso(),
"hosts": self.hosts,
}
def choose(self):
host = self.hosts[self.__index]
self.__index = (self.__index + 1) % len(self.hosts)
return host
class RandomHostGroup(HostGroup):
"""
A list of hosts to choose from at random with replacement.
"""
@classmethod
def from_jso(cls, jso):
return cls(jso.pop("hosts"))
def to_jso(self):
return {
**super().to_jso(),
"hosts": self.hosts,
}
def choose(self):
return random.choice(self.hosts)
# Aliases.
HostGroup.TYPE_NAMES.set(SingleHost, "single")
HostGroup.TYPE_NAMES.set(RoundRobinHostGroup, "round-robin")
HostGroup.TYPE_NAMES.set(RandomHostGroup, "random")
#-------------------------------------------------------------------------------
def config_host_groups(cfg):
cfg["host_groups"] = {
n: HostGroup.from_jso(g)
for n, g in cfg.get("host_groups", {}).items()
}
def expand_host(host, cfg):
host_groups = cfg["host_groups"]
try:
host_group = host_groups[host]
except KeyError:
return host
else:
return host_group.choose()
| 19.306122 | 80 | 0.557787 | 327 | 2,838 | 4.636086 | 0.256881 | 0.077177 | 0.047493 | 0.055409 | 0.183377 | 0.171504 | 0.153694 | 0.134565 | 0.134565 | 0.134565 | 0 | 0.001459 | 0.275546 | 2,838 | 146 | 81 | 19.438356 | 0.735895 | 0.134954 | 0 | 0.38961 | 0 | 0 | 0.033389 | 0 | 0 | 0 | 0 | 0 | 0.012987 | 1 | 0.233766 | false | 0 | 0.038961 | 0.142857 | 0.532468 | 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 |
92324cfe7c0da23724efef34085eeb3bd4591406 | 690 | py | Python | problems/p0029/s29.py | ahrarmonsur/euler | 4174790637806521a4ea2973abeb76c96c64a782 | [
"MIT"
] | 1 | 2017-12-19T21:18:48.000Z | 2017-12-19T21:18:48.000Z | problems/p0029/s29.py | ahrarmonsur/euler | 4174790637806521a4ea2973abeb76c96c64a782 | [
"MIT"
] | null | null | null | problems/p0029/s29.py | ahrarmonsur/euler | 4174790637806521a4ea2973abeb76c96c64a782 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Project Euler Problem 29
Distinct powers
Solved by Ahrar Monsur
Consider all integer combinations of a^b for 2 ≤ a ≤ 5 and 2 ≤ b ≤ 5:
2^2=4, 2^3=8, 2^4=16, 2^5=32
3^2=9, 3^3=27, 3^4=81, 3^5=243
4^2=16, 4^3=64, 4^4=256, 4^5=1024
5^2=25, 5^3=125, 5^4=625, 5^5=3125
If they are then placed in numerical order, with any repeats removed, we get the following sequence of 15 distinct terms:
4, 8, 9, 16, 25, 27, 32, 64, 81, 125, 243, 256, 625, 1024, 3125
How many distinct terms are in the sequence generated by ab for 2 ≤ a ≤ 100 and 2 ≤ b ≤ 100?
"""
import itertools as its
val_range = xrange(2, 101)
print len(set([a**b for a, b in its.product(val_range, repeat=2)]))
| 28.75 | 121 | 0.669565 | 163 | 690 | 2.871166 | 0.472393 | 0.017094 | 0.021368 | 0.025641 | 0.059829 | 0 | 0 | 0 | 0 | 0 | 0 | 0.224599 | 0.186957 | 690 | 23 | 122 | 30 | 0.595365 | 0.017391 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.333333 | null | null | 0.333333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 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 |
92357a159e001e20d841fcf8883ac9f524b3e5d3 | 84 | py | Python | 21.funcoes_python/10.sem_print_e_sem_return.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | 21.funcoes_python/10.sem_print_e_sem_return.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | 21.funcoes_python/10.sem_print_e_sem_return.py | robinson-1985/python-zero-dnc | df510d67e453611fcd320df1397cdb9ca47fecb8 | [
"MIT"
] | null | null | null | # criando função sem print e sem return
def erro(x=10, y=10):
x+y
print(erro()) | 16.8 | 39 | 0.654762 | 17 | 84 | 3.235294 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.059701 | 0.202381 | 84 | 5 | 40 | 16.8 | 0.761194 | 0.440476 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
923eac3a18ee39aa7b944e920f8455c6693406fe | 904 | py | Python | Python/PYHTON/IF/UDM1 - IF.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | Python/PYHTON/IF/UDM1 - IF.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | Python/PYHTON/IF/UDM1 - IF.py | ccpn1988/Python | 94c84aa6f3ef9d05d64c3d87212dfd67694f4544 | [
"MIT"
] | null | null | null | idade = int(input('Digite sua idade: '))
sexo = str(input('Digite o sexo M ou F: ')).upper()
#if idade > 18:
# print('Você já tem que pagar suas contas')
#elif idade == 18:
# print('Vai começar a se fuder agora')
#else:
# print('Pode deixar que os seus Pais pagam a conta.')
if sexo == 'M':
if idade >= 18:
print('Homem maior de idade')
else:
print('Homem menor de idade')
elif sexo == 'F':
if idade >= 18:
print('Mulher maior de idade')
else:
print('Mulher menor de idade')
else:
print('Sexo não definido')
print()
print('Testando IF de outra forma')
if idade >= 18:
if sexo == 'M':
print('Homem maior de idade')
else:
print('Mulher maior de idade')
elif idade < 18:
if sexo == 'M':
print('Homem menor de idade')
else:
print('Mulher menor de idade')
else:
print('Sexo não definido')
| 22.04878 | 57 | 0.581858 | 133 | 904 | 3.954887 | 0.353383 | 0.106464 | 0.125475 | 0.18251 | 0.51711 | 0.431559 | 0.410646 | 0.220532 | 0.220532 | 0.220532 | 0 | 0.018377 | 0.277655 | 904 | 40 | 58 | 22.6 | 0.787136 | 0.198009 | 0 | 0.785714 | 0 | 0 | 0.374652 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.428571 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
927031ee72cf10236ecb33e0663cdaee0863f1d2 | 605 | py | Python | src/common_utils_data/data_statistic_func.py | Mi524/common_utils_data | 400baf3be1bc96a06bd1f3d70abaf8dd749cfb85 | [
"MIT"
] | null | null | null | src/common_utils_data/data_statistic_func.py | Mi524/common_utils_data | 400baf3be1bc96a06bd1f3d70abaf8dd749cfb85 | [
"MIT"
] | null | null | null | src/common_utils_data/data_statistic_func.py | Mi524/common_utils_data | 400baf3be1bc96a06bd1f3d70abaf8dd749cfb85 | [
"MIT"
] | null | null | null | import gc
import re
import sys
import warnings
import os
import time
from datetime import datetime
import warnings
import pandas as pd
import numpy as np
import hashlib
from collections import defaultdict,Counter
from .sequence_functions import list_diff_outer_join, lcs, filter_lcs
from .os_functions import *
from .df_functions import *
from .config_table import ConfigReader
from .excel_functions import write_format_columns
from .regex_functions import replace_re_special, replace_punctuations
from .decorator_functions import *
from .data_handle_func import *
| 25.208333 | 70 | 0.796694 | 82 | 605 | 5.658537 | 0.512195 | 0.193966 | 0.122845 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.17686 | 605 | 23 | 71 | 26.304348 | 0.931727 | 0 | 0 | 0.1 | 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 |
927d7dbf6c5059614301b6d0f23a246e77753d3a | 270 | py | Python | Macros/Fixture Setup/Unload fixtures from selected channels.py | rec/dmxis | 540baa59df6f4ae39990e5888f90b95caa362279 | [
"Artistic-2.0"
] | 2 | 2019-05-26T15:11:18.000Z | 2021-12-27T21:05:32.000Z | Macros/Fixture Setup/Unload fixtures from selected channels.py | rec/DMXIS | 540baa59df6f4ae39990e5888f90b95caa362279 | [
"Artistic-2.0"
] | null | null | null | Macros/Fixture Setup/Unload fixtures from selected channels.py | rec/DMXIS | 540baa59df6f4ae39990e5888f90b95caa362279 | [
"Artistic-2.0"
] | null | null | null | #===============================================================
# DMXIS Macro (c) 2010 db audioware limited
#===============================================================
sel = GetAllSelCh(False)
if len(sel)>0:
for ch in sel:
RemoveFixture(ch) | 33.75 | 65 | 0.318519 | 20 | 270 | 4.3 | 0.85 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022026 | 0.159259 | 270 | 8 | 66 | 33.75 | 0.356828 | 0.622222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
92a25eccde9134bd2559c4e823c6d451102dda4b | 6,983 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/vertex_shader.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/vertex_shader.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/vertex_shader.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_ARB_vertex_shader'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.GL,'GL_ARB_vertex_shader',error_checker=_errors._error_checker)
GL_CURRENT_VERTEX_ATTRIB_ARB=_C('GL_CURRENT_VERTEX_ATTRIB_ARB',0x8626)
GL_FLOAT=_C('GL_FLOAT',0x1406)
GL_FLOAT_MAT2_ARB=_C('GL_FLOAT_MAT2_ARB',0x8B5A)
GL_FLOAT_MAT3_ARB=_C('GL_FLOAT_MAT3_ARB',0x8B5B)
GL_FLOAT_MAT4_ARB=_C('GL_FLOAT_MAT4_ARB',0x8B5C)
GL_FLOAT_VEC2_ARB=_C('GL_FLOAT_VEC2_ARB',0x8B50)
GL_FLOAT_VEC3_ARB=_C('GL_FLOAT_VEC3_ARB',0x8B51)
GL_FLOAT_VEC4_ARB=_C('GL_FLOAT_VEC4_ARB',0x8B52)
GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB=_C('GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB',0x8B4D)
GL_MAX_TEXTURE_COORDS_ARB=_C('GL_MAX_TEXTURE_COORDS_ARB',0x8871)
GL_MAX_TEXTURE_IMAGE_UNITS_ARB=_C('GL_MAX_TEXTURE_IMAGE_UNITS_ARB',0x8872)
GL_MAX_VARYING_FLOATS_ARB=_C('GL_MAX_VARYING_FLOATS_ARB',0x8B4B)
GL_MAX_VERTEX_ATTRIBS_ARB=_C('GL_MAX_VERTEX_ATTRIBS_ARB',0x8869)
GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB=_C('GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB',0x8B4C)
GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB=_C('GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB',0x8B4A)
GL_OBJECT_ACTIVE_ATTRIBUTES_ARB=_C('GL_OBJECT_ACTIVE_ATTRIBUTES_ARB',0x8B89)
GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB=_C('GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB',0x8B8A)
GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB=_C('GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB',0x8622)
GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB=_C('GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB',0x886A)
GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB=_C('GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB',0x8645)
GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB=_C('GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB',0x8623)
GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB=_C('GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB',0x8624)
GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB=_C('GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB',0x8625)
GL_VERTEX_PROGRAM_POINT_SIZE_ARB=_C('GL_VERTEX_PROGRAM_POINT_SIZE_ARB',0x8642)
GL_VERTEX_PROGRAM_TWO_SIDE_ARB=_C('GL_VERTEX_PROGRAM_TWO_SIDE_ARB',0x8643)
GL_VERTEX_SHADER_ARB=_C('GL_VERTEX_SHADER_ARB',0x8B31)
@_f
@_p.types(None,_cs.GLhandleARB,_cs.GLuint,arrays.GLcharARBArray)
def glBindAttribLocationARB(programObj,index,name):pass
@_f
@_p.types(None,_cs.GLuint)
def glDisableVertexAttribArrayARB(index):pass
@_f
@_p.types(None,_cs.GLuint)
def glEnableVertexAttribArrayARB(index):pass
@_f
@_p.types(None,_cs.GLhandleARB,_cs.GLuint,_cs.GLsizei,arrays.GLsizeiArray,arrays.GLintArray,arrays.GLuintArray,arrays.GLcharARBArray)
def glGetActiveAttribARB(programObj,index,maxLength,length,size,type,name):pass
@_f
@_p.types(_cs.GLint,_cs.GLhandleARB,arrays.GLcharARBArray)
def glGetAttribLocationARB(programObj,name):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLvoidpArray)
def glGetVertexAttribPointervARB(index,pname,pointer):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLdoubleArray)
def glGetVertexAttribdvARB(index,pname,params):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLfloatArray)
def glGetVertexAttribfvARB(index,pname,params):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLenum,arrays.GLintArray)
def glGetVertexAttribivARB(index,pname,params):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLdouble)
def glVertexAttrib1dARB(index,x):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLdoubleArray)
def glVertexAttrib1dvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat)
def glVertexAttrib1fARB(index,x):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLfloatArray)
def glVertexAttrib1fvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLshort)
def glVertexAttrib1sARB(index,x):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLshortArray)
def glVertexAttrib1svARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLdouble,_cs.GLdouble)
def glVertexAttrib2dARB(index,x,y):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLdoubleArray)
def glVertexAttrib2dvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat)
def glVertexAttrib2fARB(index,x,y):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLfloatArray)
def glVertexAttrib2fvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLshort,_cs.GLshort)
def glVertexAttrib2sARB(index,x,y):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLshortArray)
def glVertexAttrib2svARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLdouble,_cs.GLdouble,_cs.GLdouble)
def glVertexAttrib3dARB(index,x,y,z):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLdoubleArray)
def glVertexAttrib3dvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glVertexAttrib3fARB(index,x,y,z):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLfloatArray)
def glVertexAttrib3fvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLshort,_cs.GLshort,_cs.GLshort)
def glVertexAttrib3sARB(index,x,y,z):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLshortArray)
def glVertexAttrib3svARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLbyteArray)
def glVertexAttrib4NbvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLintArray)
def glVertexAttrib4NivARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLshortArray)
def glVertexAttrib4NsvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte,_cs.GLubyte)
def glVertexAttrib4NubARB(index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLubyteArray)
def glVertexAttrib4NubvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLuintArray)
def glVertexAttrib4NuivARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLushortArray)
def glVertexAttrib4NusvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLbyteArray)
def glVertexAttrib4bvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLdouble,_cs.GLdouble,_cs.GLdouble,_cs.GLdouble)
def glVertexAttrib4dARB(index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLdoubleArray)
def glVertexAttrib4dvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glVertexAttrib4fARB(index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLfloatArray)
def glVertexAttrib4fvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLintArray)
def glVertexAttrib4ivARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLshort,_cs.GLshort,_cs.GLshort,_cs.GLshort)
def glVertexAttrib4sARB(index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLshortArray)
def glVertexAttrib4svARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLubyteArray)
def glVertexAttrib4ubvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLuintArray)
def glVertexAttrib4uivARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,arrays.GLushortArray)
def glVertexAttrib4usvARB(index,v):pass
@_f
@_p.types(None,_cs.GLuint,_cs.GLint,_cs.GLenum,_cs.GLboolean,_cs.GLsizei,ctypes.c_void_p)
def glVertexAttribPointerARB(index,size,type,normalized,stride,pointer):pass
| 39.230337 | 133 | 0.833023 | 1,101 | 6,983 | 4.871026 | 0.167121 | 0.017155 | 0.060041 | 0.092299 | 0.620175 | 0.559761 | 0.453291 | 0.399963 | 0.376841 | 0.37535 | 0 | 0.023242 | 0.038809 | 6,983 | 177 | 134 | 39.451977 | 0.775775 | 0.01432 | 0 | 0.410405 | 1 | 0 | 0.10893 | 0.084206 | 0 | 0 | 0.022688 | 0 | 0 | 1 | 0.271676 | false | 0.265896 | 0.034682 | 0.00578 | 0.312139 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
2b9026f52d56ee1150ffbd663898c834f45a1e8c | 81 | py | Python | v_2.0/lib/util/SlaveMaster.py | benalcazardiego/RFCV | fa50be8ed82d43c6e197deab1cfb67fa6d0dfdb1 | [
"MIT"
] | null | null | null | v_2.0/lib/util/SlaveMaster.py | benalcazardiego/RFCV | fa50be8ed82d43c6e197deab1cfb67fa6d0dfdb1 | [
"MIT"
] | null | null | null | v_2.0/lib/util/SlaveMaster.py | benalcazardiego/RFCV | fa50be8ed82d43c6e197deab1cfb67fa6d0dfdb1 | [
"MIT"
] | null | null | null | #Called when SMU is in List mode
class SlaveMaster:
SLAVE = 0
MASTER = 1
| 16.2 | 32 | 0.666667 | 13 | 81 | 4.153846 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 0.283951 | 81 | 4 | 33 | 20.25 | 0.896552 | 0.382716 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
2bc960c971550a2937b1bf20140df412b67493d6 | 71 | py | Python | scratch/pybox/inspect.py | quejebo/pyflow | 99718942f9ea4ac0ceacde17c8006068ef19f2c8 | [
"BSD-2-Clause"
] | 3 | 2019-05-29T23:01:51.000Z | 2020-02-20T21:36:55.000Z | scratch/pybox/inspect.py | quejebo/pyflow | 99718942f9ea4ac0ceacde17c8006068ef19f2c8 | [
"BSD-2-Clause"
] | null | null | null | scratch/pybox/inspect.py | quejebo/pyflow | 99718942f9ea4ac0ceacde17c8006068ef19f2c8 | [
"BSD-2-Clause"
] | 2 | 2020-10-31T00:49:40.000Z | 2021-04-28T18:56:40.000Z |
def f(x) :
return x + 2
import inspect
print inspect.getsource(f)
| 8.875 | 26 | 0.676056 | 12 | 71 | 4 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018182 | 0.225352 | 71 | 7 | 27 | 10.142857 | 0.854545 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.25 | null | null | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2bebed874723ac9e361eaaac465a8a0025089349 | 973 | py | Python | mgsa/tests/test_bio_distance.py | supernifty/mgsa | 5f950f8c9c2bf0439a100a2348f1aef478e32934 | [
"MIT"
] | 2 | 2016-11-02T20:27:00.000Z | 2019-10-23T08:14:44.000Z | mgsa/tests/test_bio_distance.py | supernifty/mgsa | 5f950f8c9c2bf0439a100a2348f1aef478e32934 | [
"MIT"
] | null | null | null | mgsa/tests/test_bio_distance.py | supernifty/mgsa | 5f950f8c9c2bf0439a100a2348f1aef478e32934 | [
"MIT"
] | null | null | null |
import unittest
import StringIO
import bio
class TestDistance( unittest.TestCase ):
def test_hamming( self ):
self.assertEqual( 0, bio.Distance( 'aa', 'aa' ).hamming() )
self.assertEqual( 1, bio.Distance( 'ba', 'aa' ).hamming() )
self.assertEqual( 1, bio.Distance( 'ba', 'bb' ).hamming() )
self.assertEqual( 2, bio.Distance( 'ba', 'ab' ).hamming() )
self.assertRaises(Exception, lambda: bio.Distance( 'b', 'ab' ).hamming() )
def test_simple_indel( self ):
self.assertEqual( 0, bio.Distance( 'aa', 'aa' ).simple_indel() )
self.assertEqual( -1, bio.Distance( 'aba', 'aa' ).simple_indel() )
self.assertEqual( 1, bio.Distance( 'ba', 'bab' ).simple_indel() )
self.assertEqual( -2, bio.Distance( 'baa', 'b' ).simple_indel() )
self.assertEqual( 1, bio.Distance( 'b', 'ab' ).simple_indel() )
self.assertEqual( 2, bio.Distance( 'b', 'aab' ).simple_indel() )
self.assertEqual( -1, bio.Distance( 'cca', 'ca' ).simple_indel() )
| 40.541667 | 78 | 0.637205 | 123 | 973 | 4.95935 | 0.260163 | 0.216393 | 0.172131 | 0.186885 | 0.660656 | 0.616393 | 0.613115 | 0.363934 | 0 | 0 | 0 | 0.013514 | 0.163412 | 973 | 23 | 79 | 42.304348 | 0.735872 | 0 | 0 | 0 | 0 | 0 | 0.050412 | 0 | 0 | 0 | 0 | 0 | 0.666667 | 1 | 0.111111 | false | 0 | 0.166667 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
920255dffe9e5543d68902b9a6e1b7362e22c067 | 191 | py | Python | coders/curso_python/estruturas_controle_projetos/exemplo_recursao.py | flaviogf/Cursos | 2b120dbcd24a907121f58482fdcdfa01b164872c | [
"MIT"
] | 2 | 2021-02-20T23:50:07.000Z | 2021-08-15T03:04:35.000Z | coders/curso_python/estruturas_controle_projetos/exemplo_recursao.py | flaviogf/Cursos | 2b120dbcd24a907121f58482fdcdfa01b164872c | [
"MIT"
] | 18 | 2019-08-07T02:33:00.000Z | 2021-03-18T22:52:38.000Z | coders/curso_python/estruturas_controle_projetos/exemplo_recursao.py | flaviogf/Cursos | 2b120dbcd24a907121f58482fdcdfa01b164872c | [
"MIT"
] | 2 | 2020-09-28T13:00:09.000Z | 2021-12-30T12:21:08.000Z | #!/usr/local/bin/python3
def imprime(maximo, atual):
if atual >= maximo:
return
print(atual)
imprime(maximo, atual + 1)
if __name__ == '__main__':
imprime(100, 1)
| 14.692308 | 30 | 0.60733 | 24 | 191 | 4.5 | 0.625 | 0.240741 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041958 | 0.251309 | 191 | 12 | 31 | 15.916667 | 0.713287 | 0.120419 | 0 | 0 | 0 | 0 | 0.047904 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.285714 | 0.142857 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
92074f0f885fa71aff752c1f4f9eee7ced8b4e7c | 726 | py | Python | backend/server/task/migrations/0002_auto_20210624_2110.py | munteanugabriel25/Javascript-Django-TodoList- | e3cb8d4a573dfbb84960839b7a01a24a195c7755 | [
"Unlicense"
] | null | null | null | backend/server/task/migrations/0002_auto_20210624_2110.py | munteanugabriel25/Javascript-Django-TodoList- | e3cb8d4a573dfbb84960839b7a01a24a195c7755 | [
"Unlicense"
] | null | null | null | backend/server/task/migrations/0002_auto_20210624_2110.py | munteanugabriel25/Javascript-Django-TodoList- | e3cb8d4a573dfbb84960839b7a01a24a195c7755 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-24 18:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('task', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='task',
name='deadline_time',
field=models.TimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='task',
name='details',
field=models.CharField(max_length=250, null=True),
),
migrations.AlterField(
model_name='task',
name='location',
field=models.CharField(blank=True, max_length=100, null=True),
),
]
| 25.034483 | 74 | 0.563361 | 74 | 726 | 5.432432 | 0.554054 | 0.149254 | 0.186567 | 0.216418 | 0.31592 | 0.31592 | 0.223881 | 0.223881 | 0 | 0 | 0 | 0.050302 | 0.315427 | 726 | 28 | 75 | 25.928571 | 0.758551 | 0.061983 | 0 | 0.409091 | 1 | 0 | 0.082474 | 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 |
ecf524722b2e8ba8a21541d8be9ea473fc8e8612 | 2,016 | py | Python | fold-1Script.py | tiffanyle/facedetection | 219f2137c8b6239bb31d8cd6f2ea9254c964a54b | [
"MIT"
] | null | null | null | fold-1Script.py | tiffanyle/facedetection | 219f2137c8b6239bb31d8cd6f2ea9254c964a54b | [
"MIT"
] | null | null | null | fold-1Script.py | tiffanyle/facedetection | 219f2137c8b6239bb31d8cd6f2ea9254c964a54b | [
"MIT"
] | null | null | null | count = 0
with open('fold_2_data.txt','r') as f:
content = f.readlines()
'''
print 'length', len(content)
for i in range(0,len(content)+1):
print "content", type(content[i])
arr = content[i].split()
#print "arr", arr
with open("facePaths-Test1.txt", "a") as myfile:
string = 'faces/'
string+=arr[0]
#print arr[0]
string+='/'
string+='coarse_tilt_aligned_face.'
string+=arr[2]
string+='.'
string+=arr[1]
string+='\n'
#print string
myfile.write(string)
'''
print 'length', len(content)
for i in range(0,len(content)+1):
print "content", type(content[i])
arr = content[i].split()
count = 0
#print "arr", arr
with open("facePaths-TrainLabels2.txt", "a") as myfile:
string = ''
if arr[5]=='m' or arr[4] == 'm':
label='1'+'\n'
myfile.write(label)
with open("facePaths-Train2.txt", "a") as myfile2:
string = 'faces/'
string+=arr[0]
#print arr[0]
string+='/'
string+='coarse_tilt_aligned_face.'
string+=arr[2]
string+='.'
string+=arr[1]
string+='\n'
#print string
myfile2.write(string)
elif arr[5] == 'f' or arr[4] == 'f':
label='2'+'\n'
myfile.write(label)
with open("facePaths-Train2.txt", "a") as myfile2:
string = 'faces/'
string+=arr[0]
#print arr[0]
string+='/'
string+='coarse_tilt_aligned_face.'
string+=arr[2]
string+='.'
string+=arr[1]
string+='\n'
#print string
myfile2.write(string)
else:
count+=1
print "COUNT**", count
pass
#print string
print "UNACCOUNTED FOR", count
| 28.394366 | 62 | 0.456845 | 222 | 2,016 | 4.099099 | 0.220721 | 0.089011 | 0.074725 | 0.065934 | 0.787912 | 0.754945 | 0.693407 | 0.693407 | 0.693407 | 0.693407 | 0 | 0.027642 | 0.389881 | 2,016 | 70 | 63 | 28.8 | 0.712195 | 0.037698 | 0 | 0.585366 | 0 | 0 | 0.138026 | 0.05245 | 0.04878 | 0 | 0 | 0 | 0 | 0 | null | null | 0.02439 | 0 | null | null | 0.097561 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ecf533bb8aa1e2125d02ca255560a8ea000a6f34 | 8,063 | py | Python | pyxus/pyxus/resources/entity.py | k-dominik/pyxus | 39fd9d51fafdcac05c46f143417f9790985c0e38 | [
"Apache-2.0"
] | null | null | null | pyxus/pyxus/resources/entity.py | k-dominik/pyxus | 39fd9d51fafdcac05c46f143417f9790985c0e38 | [
"Apache-2.0"
] | null | null | null | pyxus/pyxus/resources/entity.py | k-dominik/pyxus | 39fd9d51fafdcac05c46f143417f9790985c0e38 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018, EPFL/Human Brain Project PCO
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import hashlib
import json
import re
from pyld import jsonld
from pyxus.utils.turtle_schema_transformer import transform_turtle_to_jsonld_schema, transform_turtle_to_jsonld
class Entity(object):
def __init__(self, identifier, data, root_path):
self.id = identifier
self.data = data
self.root_path = root_path
self.path = None
self.build_path()
def build_path(self):
self.path = "{}/{}".format(self.root_path, self.id)
@staticmethod
def fully_qualify(data):
data = jsonld.expand(data)
data = jsonld.compact(data, {})
return data
def to_json(self):
return json.dumps(self.data, indent=4)
def get_checksum(self):
return hashlib.md5(json.dumps(self.data).encode("utf-8")).hexdigest()
def get_simplified_data(self):
return self._get_simplified_data(self.data)
def get_data(self, key, simplified=True):
if key in self.data:
return self._get_simplified_data(self.data[key]) if simplified else self.data[key]
elif simplified:
for k in self.data:
if re.match(".*?:" + key, k):
return self._get_simplified_data(self.data[k])
return None
@staticmethod
def _get_simplified_data(data):
if not isinstance(data, dict):
return data
simple = {}
for key in data:
if not key.startswith("@"):
new_key = re.sub(".*?:", "", key)
if isinstance(data[key], dict):
simple[new_key] = Entity._get_simplified_data(data[key])
else:
simple[new_key] = data[key]
return simple
def get_revision(self):
return self.data["nxv:rev"] if "nxv:rev" in self.data else None
def __str__(self):
return "{classname}: id={id}, path={path}, revision={revision}\ndata={data}".format(
classname=self.__class__.__name__,
id=self.id,
path=self.path,
revision=self.get_revision(),
data=self.data
)
extract_info = r"(?P<org>.*)/(?P<domain>.*)/(?P<schema>.*)/(?P<version>.*)/(?P<id>.*)"
def get_type(self):
return self.data["@type"]
def get_organization(self):
return re.match(r"(?P<org>.*?)(/.*)?$", self.id).group("org")
def get_domain(self):
return re.match(r".*?/(?P<domain>.*?)(/.*)?$", self.id).group("domain")
def get_schema(self):
return re.match(r".*?/.*?/(?P<schema>.*?)(/.*)?$", self.id).group("schema")
def get_version(self):
return re.match(r".*?/.*?/.*?/(?P<version>.*?)(/.*)?$", self.id).group("version")
def get_id(self):
return Entity.get_uuid_from_id(self.id)
@staticmethod
def get_uuid_from_id(identifier):
return re.match(r".*?/.*?/.*?/.*?/(?P<id>.*?)(/.*)?$", identifier).group("id")
@staticmethod
def extract_id_from_url(url, root_path):
regex = r"(?<={root_path}/).*?(?=(\?|$|#))".format(root_path=root_path)
r = re.search(regex, url)
if r is not None:
result = r.group(0)
if result.endswith('/'):
return result[:-1]
return result
raise ValueError("\"{url}\" is not applicable to {root_path}!".format(url=url, root_path=root_path))
def is_deprecated(self):
return self.data.get("nxv:deprecated") != False
def get_identifier(self):
if "http://schema.org/identifier" in self.data:
return self.data.get("http://schema.org/identifier")
return None
def get_self_link(self):
return self.data["@id"]
class Organization(Entity):
path = "/organizations"
@classmethod
def create_new(cls, name, description):
data = {
"@context": {
"schema2": "http://schema.org/"
},
"schema:name": name,
"schema:description": description
}
return Organization(name, data, Organization.path)
class Domain(Entity):
path = "/domains"
@staticmethod
def create_id(organization, domain):
return "{}/{}".format(organization, domain)
@classmethod
def create_new(cls, organization, domain, description):
data = {
'description': description
}
identifier = Domain.create_id(organization, domain)
return Domain(identifier, data, Domain.path)
class Schema(Entity):
path = "/schemas"
@staticmethod
def create_id(organization, domain, schema, version):
return "{}/{}/{}/{}".format(organization, domain, schema, version)
@classmethod
def create_new(cls, organization, domain, schema, version, content, is_turtle=False):
if is_turtle:
content = transform_turtle_to_jsonld_schema(content)
identifier = Schema.create_id(organization, domain, schema, version)
return Schema(identifier, content, Schema.path)
def is_published(self):
return self.data["nxv:published"] if "nxv:published" in self.data else False
class Instance(Entity):
path = "/data"
@staticmethod
def create_id(organization, domain, schema, version):
return "{}/{}/{}/{}".format(organization, domain, schema, version)
@classmethod
def create_new(cls, organization, domain, schema, version, content, is_turtle=False):
if is_turtle:
content = transform_turtle_to_jsonld(content)
if isinstance(content, list) and len(content) == 1:
content = content[0]
else:
raise ValueError("Can't handle multiple instances in same file!")
identifier = Instance.create_id(organization, domain, schema, version)
return Instance(identifier, content, Instance.path)
class Context(Entity):
path = "/contexts"
@staticmethod
def create_id(organization, domain, context, version):
return "{}/{}/{}/{}".format(organization, domain, context, version)
@classmethod
def create_new(cls, organization, domain, context, version, content):
identifier = Context.create_id(organization, domain, context, version)
return Context(identifier, content, Context.path)
def is_published(self):
return self.data["nxv:published"] if "nxv:published" in self.data else False
class SearchResultList(object):
def __init__(self, total, results, links):
self.total = total
self.results = results
self.links = links
def __str__(self):
return "{classname}: total={total}, first_entry=({first_entry})".format(
classname=self.__class__.__name__,
total=self.total,
first_entry=self.results[0] if self.results is not None and self.results else "no results"
)
def get_next_link(self):
return self.links["next"] if "next" in self.links else None
def get_previous_link(self):
return self.links["previous"] if "previous" in self.links else None
class SearchResult(object):
result_id = None
self_link = None
data = None
def __init__(self, result_dict):
self.data = result_dict
self.result_id = result_dict['resultId']
self.self_link = result_dict['source']['links']['self']
def __str__(self):
return 'result_id:{}, link:{}, data:{}'.format(self.result_id, self.self_link, self.data)
| 32.381526 | 111 | 0.61714 | 975 | 8,063 | 4.947692 | 0.188718 | 0.038143 | 0.026119 | 0.043118 | 0.309494 | 0.230929 | 0.203566 | 0.13495 | 0.124378 | 0.124378 | 0 | 0.002805 | 0.248295 | 8,063 | 248 | 112 | 32.512097 | 0.793103 | 0.072926 | 0 | 0.213483 | 0 | 0.005618 | 0.117442 | 0.038075 | 0 | 0 | 0 | 0 | 0 | 1 | 0.213483 | false | 0 | 0.02809 | 0.134831 | 0.55618 | 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 |
ecfca9897721ddb964f75b88453f10dd906ec876 | 162 | py | Python | health.getLiveness.py | moreati/ava-python | 4baa4c21dec7d31d0b6e3fcbe44ff5587cb85706 | [
"MIT"
] | null | null | null | health.getLiveness.py | moreati/ava-python | 4baa4c21dec7d31d0b6e3fcbe44ff5587cb85706 | [
"MIT"
] | null | null | null | health.getLiveness.py | moreati/ava-python | 4baa4c21dec7d31d0b6e3fcbe44ff5587cb85706 | [
"MIT"
] | null | null | null | # ava-python : A Python implementation of the AVA API
# Author: https://github.com/zefonseca/
# License MIT
import health
stt = health.getLiveness()
print(stt)
| 18 | 53 | 0.740741 | 23 | 162 | 5.217391 | 0.826087 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 162 | 8 | 54 | 20.25 | 0.869565 | 0.623457 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
a616342369aa0a56c3084a828aed9ef159b953f7 | 164 | py | Python | 2020-11-07/bobo.py | pufe/programa | 7f79566597446e9e39222e6c15fa636c3dd472bb | [
"MIT"
] | 2 | 2020-12-12T00:02:40.000Z | 2021-04-21T19:49:59.000Z | 2020-11-07/bobo.py | pufe/programa | 7f79566597446e9e39222e6c15fa636c3dd472bb | [
"MIT"
] | null | null | null | 2020-11-07/bobo.py | pufe/programa | 7f79566597446e9e39222e6c15fa636c3dd472bb | [
"MIT"
] | null | null | null | n = int(input())
votos = []
for i in range(n):
x = int(input())
votos.append(x)
if votos[0] >= max(votos):
print("S")
else:
print("N")
| 13.666667 | 27 | 0.481707 | 25 | 164 | 3.16 | 0.64 | 0.202532 | 0.329114 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008772 | 0.304878 | 164 | 11 | 28 | 14.909091 | 0.684211 | 0 | 0 | 0 | 0 | 0 | 0.013072 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a6266c52c1824b254d2d71b771cdeb5e0ec78536 | 134 | py | Python | LABORATORIO 4/dwd.py | msolivera/Phyton | 1322fa2ff4bb06a17350fefa7e5268c0969e5b53 | [
"bzip2-1.0.6"
] | null | null | null | LABORATORIO 4/dwd.py | msolivera/Phyton | 1322fa2ff4bb06a17350fefa7e5268c0969e5b53 | [
"bzip2-1.0.6"
] | null | null | null | LABORATORIO 4/dwd.py | msolivera/Phyton | 1322fa2ff4bb06a17350fefa7e5268c0969e5b53 | [
"bzip2-1.0.6"
] | null | null | null | def ejercicio_1(cadena):
i=0
while cadena[i]== " ":
i+=1
return cadena[i:]
print (ejercicio_1("programacion_1"))
| 16.75 | 37 | 0.589552 | 19 | 134 | 4 | 0.526316 | 0.276316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049505 | 0.246269 | 134 | 7 | 38 | 19.142857 | 0.70297 | 0 | 0 | 0 | 0 | 0 | 0.112782 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.333333 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a6521238e7d28f8e844927f6999b3f825ce7734c | 382 | py | Python | 2018/aoc/d23/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | 1 | 2018-12-12T22:59:44.000Z | 2018-12-12T22:59:44.000Z | 2018/aoc/d23/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | null | null | null | 2018/aoc/d23/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | null | null | null | import unittest
from aoc.d23.main import best_position_distance, nanobots_in_radius
class TestCase(unittest.TestCase):
def test_nanobots_in_radius(self):
self.assertEqual(nanobots_in_radius("example-part-1"), 7)
def test_best_position(self):
self.assertEqual(best_position_distance("example-part-2"), 36)
if __name__ == "__main__":
unittest.main()
| 23.875 | 70 | 0.746073 | 51 | 382 | 5.176471 | 0.509804 | 0.136364 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021472 | 0.146597 | 382 | 15 | 71 | 25.466667 | 0.788344 | 0 | 0 | 0 | 0 | 0 | 0.094241 | 0 | 0 | 0 | 0 | 0 | 0.222222 | 1 | 0.222222 | false | 0 | 0.222222 | 0 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a68cd7a4c0f3a98651c0317ccb39bd008ee4bc0e | 58,105 | py | Python | source/CorotationalBeamElement3D.py | Xinrui/CorotationalBeamSolver | 1f5341d533bb28520fc11968ac2bc3f4e9828583 | [
"MIT"
] | null | null | null | source/CorotationalBeamElement3D.py | Xinrui/CorotationalBeamSolver | 1f5341d533bb28520fc11968ac2bc3f4e9828583 | [
"MIT"
] | null | null | null | source/CorotationalBeamElement3D.py | Xinrui/CorotationalBeamSolver | 1f5341d533bb28520fc11968ac2bc3f4e9828583 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: Xinrui Zhou
"""
from math import sin, cos
import numpy as np
import source.Utilities as util
class CorotationalBeamElement3D():
"""It is a class formulating three-dimensional corotational beam elements."""
def __init__(self, beamtype, youngs_modulus, poisson_ratio, width, height, initial_coordinate_node_1, initial_coordinate_node_2, element_id, e_2o, e_3o):
""" Initialize a 3D co-rotational beam element.
Parameters
----------
beamtype: str
the type of beam element, which can be Bernoulli or Timoshenko.
youngs_modulus: int/float
Young's modulus.
poisson_ratio: float
Poisson ratio, not interesting for Bernoulli elements.
width: int/float
width of the beam, perpendicular to local z-axis.
height: int/float
height of the beam, perpendicular to local y-axis.
initial_coordinate_node_1: numpy.ndarray
initial coordinate of the 1st node: [X1, Y1, Z1].T.
initial_coordinate_node_2: numpy.ndarray
initial coordinate of the 2nd node: [X2, Y2, Z2].T.
element_id: int
The number of the element in the system.
Returns
-------
None.
"""
self.initial_coordinate_node_1 = initial_coordinate_node_1
self.initial_coordinate_node_2 = initial_coordinate_node_2
self.beamtype = beamtype
self.youngs_modulus = youngs_modulus
self.poisson_ratio = poisson_ratio
self.width = width
self.height = height
self.e_2o = e_2o
self.e_3o = e_3o
self.initial_length = self.calculate_initial_length()
self.initial_local_frame = self.calculate_initial_local_frame()
self.first_lame_constant = self.calculate_first_lame_constant()
self.second_lame_constant = self.calculate_second_lame_constant()
self.bulk_modulus = self.calculate_bulk_modulus()
self.area = self.calculate_area()
self.moment_of_inertia_y = self.calculate_moment_of_inertia_y()
self.moment_of_inertia_z = self.calculate_moment_of_inertia_z()
self.polar_moment_of_inertia = self.calculate_polar_moment_of_inertia()
self.fourth_order_polar_moment_of_inertia = self.calculate_fourth_order_polar_moment_of_inertia()
self.current_orientation_node_1 = np.eye(3)
self.current_orientation_node_2 = np.eye(3)
self.analysis = "elastic"
self.global_displacement = np.zeros((12, 1), dtype=float)
self.element_freedom_table = np.linspace(
6 * element_id, 6 * element_id + 11, num=12, dtype=int)
def calculate_first_lame_constant(self):
""" Calculate the first lame constant λ.
Parameters
----------
None.
Returns
-------
the first lame constant: float
"""
return self.youngs_modulus * self.poisson_ratio / ((1 + self.poisson_ratio) * (1 - 2 * self.poisson_ratio))
def calculate_second_lame_constant(self):
""" Calculate the second lame constant μ.
Parameters
----------
None.
Returns
-------
the second lame constant: float
"""
return self.youngs_modulus / (2 * (1 + self.poisson_ratio))
def calculate_bulk_modulus(self):
""" Calculate the bulk modulus κ.
Parameters
----------
None.
Returns
-------
the bulk modulus: float
"""
return self.first_lame_constant + 2/3 * self.second_lame_constant
def calculate_area(self):
"""Calculate the cross-sectional area of the beam element.
Parameters
----------
None.
Returns
-------
the cross-sectional area: float
A = b * h
"""
return self.width * self.height
def calculate_moment_of_inertia_y(self):
"""Calculate the moment of inertia Iy / I33 of the beam element.
Parameters
----------
None.
Returns
-------
the moment of inertia Iy: float
I_y = 1/12 * b * h^3
"""
return 1/12 * self.width * (self.height) ** 3
def calculate_moment_of_inertia_z(self):
"""Calculate the moment of inertia Iz / I22 of the beam element.
Parameters
----------
None.
Returns
-------
the moment of inertia Iz: float
I_z = 1/12 * h * b^3
"""
return 1/12 * (self.width) ** 3 * self.height
def calculate_polar_moment_of_inertia(self):
"""Calculate the polar moment of inertia Io of the beam element.
Parameters
----------
None.
Returns
-------
the polar moment of inertia Io: float
I_o = 1/12 * (b^3 * h + b * h^3)
"""
return 1/12 * (self.width * (self.height) ** 3 + (self.width) ** 3 * self.height)
def calculate_fourth_order_polar_moment_of_inertia(self):
"""Calculate the 4th polar moment of inertia Irr of the beam element.
Parameters
----------
None.
Returns
-------
the 4th polar moment of inertia Irr: float
I_rr = b^5 * h / 80 + b^3 * h^3 / 72 + b * h^5 / 80
"""
return 1/80 * (self.width * (self.height) ** 5 + (self.width) ** 5 * self.height) + 1/72 * (self.width) ** 3 * (self.height) ** 3
def calculate_initial_local_frame(self):
"""Calculate the initial local frame Ro with defined e_2o / e_3o.
Parameters
----------
None.
Returns
-------
the initial local frame Ro.
"""
e_1o = (self.initial_coordinate_node_2 -
self.initial_coordinate_node_1) / self.initial_length
if type(self.e_3o) == np.ndarray:
e_2o = np.cross(self.e_3o, e_1o, axisa=0, axisb=0, axisc=0)
return np.c_[e_1o, e_2o, self.e_3o]
elif type(self.e_2o) == np.ndarray:
e_3o = np.cross(e_1o, self.e_2o, axisa=0, axisb=0, axisc=0)
return np.c_[e_1o, self.e_2o, e_3o]
else:
raise ValueError("Check the input of e2o and e3o!")
def calculate_initial_length(self):
"""Calculate the initial length of the beam element.
Parameters
----------
None.
Returns
-------
L: float
"""
return np.linalg.norm(self.initial_coordinate_node_2 -
self.initial_coordinate_node_1)
def apply_hardening_model(self, hardening_model, gauss_number, yield_stress, kinematic_hardening_modulus, plastic_modulus, saturation_stress,
modified_modulus, exponent):
"""Apply hardening model on the beam element.
Parameters
----------
hardening_model: str
hardening model. only linear hardening is implemented.
gauss_number: tuple
Number of Gauss points on xi-axis, eta-axis, mu-axis. Set as a tuple with 3 numbers, such as (1, 2, 2)
yield_stress: int/float
Value of yield stress.
kinematic_hardening_modulus: int/float
Value of kinematic hardening modulus.
plastic_modulus: int/float
Value of plastic modulus.
saturation_stress: int/float
Value of saturation stress.
modified_modulus: int/float
Value of modified modulus.
exponent: int/float
Value of exponent.
Returns
-------
None.
"""
self.num_of_gauss_locations_xi = gauss_number[0] # x-axis
self.num_of_gauss_locations_eta = gauss_number[1] # y-axis
self.num_of_gauss_locations_mu = gauss_number[2] # z-axis
self.num_of_gauss_locations = self.num_of_gauss_locations_xi * \
self.num_of_gauss_locations_eta * self.num_of_gauss_locations_mu
[gauss_locations_xi, weights_xi] = np.polynomial.legendre.leggauss(
self.num_of_gauss_locations_xi)
[gauss_locations_eta, weights_eta] = np.polynomial.legendre.leggauss(
self.num_of_gauss_locations_eta)
[gauss_locations_mu, weights_mu] = np.polynomial.legendre.leggauss(
self.num_of_gauss_locations_mu)
global_gauss_locations_mat = np.zeros(
(3, self.num_of_gauss_locations), dtype=float)
weights_mat = np.zeros(self.num_of_gauss_locations, dtype=float)
for ixi in range(self.num_of_gauss_locations_xi):
for jeta in range(self.num_of_gauss_locations_eta):
for kmu in range(self.num_of_gauss_locations_mu):
x, y, z = self.map_local_coordinate_to_global_coordinate(
gauss_locations_xi[ixi], gauss_locations_eta[jeta], gauss_locations_mu[kmu])
global_gauss_locations_mat[0, ixi * self.num_of_gauss_locations_eta *
self.num_of_gauss_locations_mu + jeta * self.num_of_gauss_locations_mu + kmu] = x
global_gauss_locations_mat[1, ixi * self.num_of_gauss_locations_eta *
self.num_of_gauss_locations_mu + jeta * self.num_of_gauss_locations_mu + kmu] = y
global_gauss_locations_mat[2, ixi * self.num_of_gauss_locations_eta *
self.num_of_gauss_locations_mu + jeta * self.num_of_gauss_locations_mu + kmu] = z
weights_mat[ixi * self.num_of_gauss_locations_eta *
self.num_of_gauss_locations_mu + jeta *
self.num_of_gauss_locations_mu + kmu] = weights_xi[ixi] * weights_eta[jeta] * weights_mu[kmu]
self.global_gauss_locations_mat = global_gauss_locations_mat
self.weights_mat = weights_mat
if hardening_model == "linear hardening":
self.analysis = hardening_model
self.yield_stress = yield_stress
self.plastic_modulus = plastic_modulus
self.stress = np.zeros(
(6, 1, self.num_of_gauss_locations), dtype=float)
self.plastic_strain = np.zeros(
(6, 1, self.num_of_gauss_locations), dtype=float)
self.tangent_moduli = np.zeros(
(6, 6, self.num_of_gauss_locations), dtype=float)
self.internal_hardening_variable = np.zeros(
self.num_of_gauss_locations, dtype=float)
# initialize tangent moduli
elastic_tangent_moduli = self.first_lame_constant * util.unit_tensor() @ util.unit_tensor().T + \
2 * self.second_lame_constant * np.eye(6)
for n in range(self.num_of_gauss_locations):
self.tangent_moduli[:, :, n] = elastic_tangent_moduli
else:
print("In 3D, only linear hardening is implemented.")
raise ValueError("Wrong hardening model!")
def local_displacement(self):
"""Calculate local displacement vector at current state.
Parameters
----------
None.
Returns
-------
p_l: numpy.ndarray
local displacement.
"""
p_l = np.zeros((7, 1), dtype=float)
R_g = self.current_local_frame()
R1_bar = (
R_g.T) @ self.current_orientation_node_1 @ self.initial_local_frame
R2_bar = (
R_g.T) @ self.current_orientation_node_2 @ self.initial_local_frame
theta1_bar_skew_symmetric = util.log(R1_bar)
theta2_bar_skew_symmetric = util.log(R2_bar)
p_l[0] = self.current_length() - self.initial_length
p_l[1: 4] = util.get_rotational_vector(theta1_bar_skew_symmetric)
p_l[4: 7] = util.get_rotational_vector(theta2_bar_skew_symmetric)
return p_l
def current_local_frame(self):
"""Calculate local frame Rr at current state.
Parameters
----------
None.
Returns
-------
Rr: numpy.ndarray
local frame at current state.
"""
r_1 = (self.current_coordinate_node_2() -
self.current_coordinate_node_1()) / self.current_length()
_, _, q = self.auxiliary_vector()
r_3 = np.cross(r_1, q, axisa=0, axisb=0, axisc=0)
r_3 = r_3 / np.linalg.norm(r_3)
r_2 = np.cross(r_3, r_1, axisa=0, axisb=0, axisc=0)
return np.c_[r_1, r_2, r_3]
def current_coordinate_node_1(self):
"""Calculate the coodinate of node 1 in current configuration.
Parameters
----------
None.
Returns
-------
current coordinate of the 1st node: x1 = X1 + u1.
"""
return self.initial_coordinate_node_1 + self.global_displacement[0: 3]
def current_coordinate_node_2(self):
"""Calculate the coodinate of node 2 in current configuration.
Parameters
----------
None.
Returns
-------
current coordinate of the 2nd node: x2 = X2 + u2.
"""
return self.initial_coordinate_node_2 + self.global_displacement[6: 9]
def current_length(self):
"""Calculate the current length of the beam element.
Parameters
----------
None.
Returns
-------
l: float
"""
return np.linalg.norm(self.current_coordinate_node_2() -
self.current_coordinate_node_1())
def auxiliary_vector(self):
"""Calculate the auxiliary vectors.
Parameters
----------
None.
Returns
-------
q_1, q_2, q: numpy.ndarray
"""
q_1 = self.current_orientation_node_1 @ self.initial_local_frame @ np.array([
[0., 1., 0.]]).T
q_2 = self.current_orientation_node_2 @ self.initial_local_frame @ np.array([
[0., 1., 0.]]).T
q = (q_1 + q_2) / 2
return q_1, q_2, q
def elastic_local_stiffness_force(self):
"""Calculate the local stiffness matrix kl and local force vector fl of the beam element.
Parameters
----------
None.
Returns
-------
kl: np.ndarray
local stiffness matrix.
fl: np.ndarray
local force vector
"""
u, t11, t21, t31, t12, t22, t32 = self.local_displacement().reshape(7)
E, G, A, L, I22, I33, Irr = self.youngs_modulus, self.second_lame_constant, self.area, self.initial_length, self.moment_of_inertia_z, self.moment_of_inertia_y, self.fourth_order_polar_moment_of_inertia
if self.beamtype == "Bernoulli":
kl = np.array([[1.0*A*E/L, 1.0*E*(I22*t11 - I22*t12 + I33*t11 - I33*t12)/L**2, A*E*(0.133333333333333*t21 - 0.0333333333333333*t22), A*E*(0.133333333333333*t31 - 0.0333333333333333*t32), 1.0*E*(-I22*t11 + I22*t12 - I33*t11 + I33*t12)/L**2, A*E*(-0.0333333333333333*t21 + 0.133333333333333*t22), A*E*(-0.0333333333333333*t31 + 0.133333333333333*t32)], [1.0*E*(I22*t11 - I22*t12 + I33*t11 - I33*t12)/L**2, 0.0666666666666667*E*I22*t21**2/L - 0.0333333333333333*E*I22*t21*t22/L + 0.0666666666666667*E*I22*t22**2/L + 0.0666666666666667*E*I22*t31**2/L - 0.0333333333333333*E*I22*t31*t32/L + 0.0666666666666667*E*I22*t32**2/L + 1.0*E*I22*u/L**2 + 0.0666666666666667*E*I33*t21**2/L - 0.0333333333333333*E*I33*t21*t22/L + 0.0666666666666667*E*I33*t22**2/L + 0.0666666666666667*E*I33*t31**2/L - 0.0333333333333333*E*I33*t31*t32/L + 0.0666666666666667*E*I33*t32**2/L + 1.0*E*I33*u/L**2 + 1.5*E*Irr*t11**2/L**3 - 3.0*E*Irr*t11*t12/L**3 + 1.5*E*Irr*t12**2/L**3 + 1.0*G*I22/L + 1.0*G*I33/L, E*(0.133333333333333*I22*t11*t21 - 0.0333333333333333*I22*t11*t22 - 0.133333333333333*I22*t12*t21 + 0.0333333333333333*I22*t12*t22 + 0.133333333333333*I33*t11*t21 - 0.0333333333333333*I33*t11*t22 - 0.133333333333333*I33*t12*t21 + 0.0333333333333333*I33*t12*t22)/L, E*(0.133333333333333*I22*t11*t31 - 0.0333333333333333*I22*t11*t32 - 0.133333333333333*I22*t12*t31 + 0.0333333333333333*I22*t12*t32 + 0.133333333333333*I33*t11*t31 - 0.0333333333333333*I33*t11*t32 - 0.133333333333333*I33*t12*t31 + 0.0333333333333333*I33*t12*t32)/L, -0.0666666666666667*E*I22*t21**2/L + 0.0333333333333333*E*I22*t21*t22/L - 0.0666666666666667*E*I22*t22**2/L - 0.0666666666666667*E*I22*t31**2/L + 0.0333333333333333*E*I22*t31*t32/L - 0.0666666666666667*E*I22*t32**2/L - 1.0*E*I22*u/L**2 - 0.0666666666666667*E*I33*t21**2/L + 0.0333333333333333*E*I33*t21*t22/L - 0.0666666666666667*E*I33*t22**2/L - 0.0666666666666667*E*I33*t31**2/L + 0.0333333333333333*E*I33*t31*t32/L - 0.0666666666666667*E*I33*t32**2/L - 1.0*E*I33*u/L**2 - 1.5*E*Irr*t11**2/L**3 + 3.0*E*Irr*t11*t12/L**3 - 1.5*E*Irr*t12**2/L**3 - 1.0*G*I22/L - 1.0*G*I33/L, E*(-0.0333333333333333*I22*t11*t21 + 0.133333333333333*I22*t11*t22 + 0.0333333333333333*I22*t12*t21 - 0.133333333333333*I22*t12*t22 - 0.0333333333333333*I33*t11*t21 + 0.133333333333333*I33*t11*t22 + 0.0333333333333333*I33*t12*t21 - 0.133333333333333*I33*t12*t22)/L, E*(-0.0333333333333333*I22*t11*t31 + 0.133333333333333*I22*t11*t32 + 0.0333333333333333*I22*t12*t31 - 0.133333333333333*I22*t12*t32 - 0.0333333333333333*I33*t11*t31 + 0.133333333333333*I33*t11*t32 + 0.0333333333333333*I33*t12*t31 - 0.133333333333333*I33*t12*t32)/L], [A*E*(0.133333333333333*t21 - 0.0333333333333333*t22), E*(0.133333333333333*I22*t11*t21 - 0.0333333333333333*I22*t11*t22 - 0.133333333333333*I22*t12*t21 + 0.0333333333333333*I22*t12*t22 + 0.133333333333333*I33*t11*t21 - 0.0333333333333333*I33*t11*t22 - 0.133333333333333*I33*t12*t21 + 0.0333333333333333*I33*t12*t22)/L, E*(0.0266666666666667*A*L**2*t21**2 - 0.0133333333333333*A*L**2*t21*t22 + 0.01*A*L**2*t22**2 + 0.00888888888888889*A*L**2*t31**2 - 0.00444444444444444*A*L**2*t31*t32 + 0.00888888888888889*A*L**2*t32**2 + 0.133333333333333*A*L*u + 0.0666666666666667*I22*t11**2 - 0.133333333333333*I22*t11*t12 + 0.0666666666666667*I22*t12**2 + 0.0666666666666667*I33*t11**2 - 0.133333333333333*I33*t11*t12 + 0.0666666666666667*I33*t12**2 + 4.0*I33)/L, A*E*L*(0.0177777777777778*t21*t31 - 0.00444444444444444*t21*t32 - 0.00444444444444444*t22*t31 + 0.00111111111111111*t22*t32), E*(-0.133333333333333*I22*t11*t21 + 0.0333333333333333*I22*t11*t22 + 0.133333333333333*I22*t12*t21 - 0.0333333333333333*I22*t12*t22 - 0.133333333333333*I33*t11*t21 + 0.0333333333333333*I33*t11*t22 + 0.133333333333333*I33*t12*t21 - 0.0333333333333333*I33*t12*t22)/L, E*(-0.00666666666666667*A*L**2*t21**2 + 0.02*A*L**2*t21*t22 - 0.00666666666666667*A*L**2*t22**2 - 0.00222222222222222*A*L**2*t31**2 + 0.00111111111111111*A*L**2*t31*t32 - 0.00222222222222222*A*L**2*t32**2 - 0.0333333333333333*A*L*u - 0.0166666666666667*I22*t11**2 + 0.0333333333333333*I22*t11*t12 - 0.0166666666666667*I22*t12**2 - 0.0166666666666667*I33*t11**2 + 0.0333333333333333*I33*t11*t12 - 0.0166666666666667*I33*t12**2 + 2.0*I33)/L, A*E*L*(-0.00444444444444444*t21*t31 + 0.0177777777777778*t21*t32 + 0.00111111111111111*t22*t31 - 0.00444444444444444*t22*t32)], [A*E*(0.133333333333333*t31 - 0.0333333333333333*t32), E*(0.133333333333333*I22*t11*t31 - 0.0333333333333333*I22*t11*t32 - 0.133333333333333*I22*t12*t31 + 0.0333333333333333*I22*t12*t32 + 0.133333333333333*I33*t11*t31 - 0.0333333333333333*I33*t11*t32 - 0.133333333333333*I33*t12*t31 + 0.0333333333333333*I33*t12*t32)/L, A*E*L*(0.0177777777777778*t21*t31 - 0.00444444444444444*t21*t32 - 0.00444444444444444*t22*t31 + 0.00111111111111111*t22*t32), E*(0.00888888888888889*A*L**2*t21**2 - 0.00444444444444444*A*L**2*t21*t22 + 0.00888888888888889*A*L**2*t22**2 + 0.0266666666666667*A*L**2*t31**2 - 0.0133333333333333*A*L**2*t31*t32 + 0.01*A*L**2*t32**2 + 0.133333333333333*A*L*u + 0.0666666666666667*I22*t11**2 - 0.133333333333333*I22*t11*t12 + 0.0666666666666667*I22*t12**2 + 4.0*I22 + 0.0666666666666667*I33*t11**2 - 0.133333333333333*I33*t11*t12 + 0.0666666666666667*I33*t12**2)/L, E*(-0.133333333333333*I22*t11*t31 + 0.0333333333333333*I22*t11*t32 + 0.133333333333333*I22*t12*t31 - 0.0333333333333333*I22*t12*t32 - 0.133333333333333*I33*t11*t31 + 0.0333333333333333*I33*t11*t32 + 0.133333333333333*I33*t12*t31 - 0.0333333333333333*I33*t12*t32)/L, A*E*L*(-0.00444444444444444*t21*t31 + 0.00111111111111111*t21*t32 + 0.0177777777777778*t22*t31 - 0.00444444444444444*t22*t32), E*(-0.00222222222222222*A*L**2*t21**2 + 0.00111111111111111*A*L**2*t21*t22 - 0.00222222222222222*A*L**2*t22**2 - 0.00666666666666667*A*L**2*t31**2 + 0.02*A*L**2*t31*t32 - 0.00666666666666667*A*L**2*t32**2 - 0.0333333333333333*A*L*u - 0.0166666666666667*I22*t11**2 +
0.0333333333333333*I22*t11*t12 - 0.0166666666666667*I22*t12**2 + 2.0*I22 - 0.0166666666666667*I33*t11**2 + 0.0333333333333333*I33*t11*t12 - 0.0166666666666667*I33*t12**2)/L], [1.0*E*(-I22*t11 + I22*t12 - I33*t11 + I33*t12)/L**2, -0.0666666666666667*E*I22*t21**2/L + 0.0333333333333333*E*I22*t21*t22/L - 0.0666666666666667*E*I22*t22**2/L - 0.0666666666666667*E*I22*t31**2/L + 0.0333333333333333*E*I22*t31*t32/L - 0.0666666666666667*E*I22*t32**2/L - 1.0*E*I22*u/L**2 - 0.0666666666666667*E*I33*t21**2/L + 0.0333333333333333*E*I33*t21*t22/L - 0.0666666666666667*E*I33*t22**2/L - 0.0666666666666667*E*I33*t31**2/L + 0.0333333333333333*E*I33*t31*t32/L - 0.0666666666666667*E*I33*t32**2/L - 1.0*E*I33*u/L**2 - 1.5*E*Irr*t11**2/L**3 + 3.0*E*Irr*t11*t12/L**3 - 1.5*E*Irr*t12**2/L**3 - 1.0*G*I22/L - 1.0*G*I33/L, E*(-0.133333333333333*I22*t11*t21 + 0.0333333333333333*I22*t11*t22 + 0.133333333333333*I22*t12*t21 - 0.0333333333333333*I22*t12*t22 - 0.133333333333333*I33*t11*t21 + 0.0333333333333333*I33*t11*t22 + 0.133333333333333*I33*t12*t21 - 0.0333333333333333*I33*t12*t22)/L, E*(-0.133333333333333*I22*t11*t31 + 0.0333333333333333*I22*t11*t32 + 0.133333333333333*I22*t12*t31 - 0.0333333333333333*I22*t12*t32 - 0.133333333333333*I33*t11*t31 + 0.0333333333333333*I33*t11*t32 + 0.133333333333333*I33*t12*t31 - 0.0333333333333333*I33*t12*t32)/L, 0.0666666666666667*E*I22*t21**2/L - 0.0333333333333333*E*I22*t21*t22/L + 0.0666666666666667*E*I22*t22**2/L + 0.0666666666666667*E*I22*t31**2/L - 0.0333333333333333*E*I22*t31*t32/L + 0.0666666666666667*E*I22*t32**2/L + 1.0*E*I22*u/L**2 + 0.0666666666666667*E*I33*t21**2/L - 0.0333333333333333*E*I33*t21*t22/L + 0.0666666666666667*E*I33*t22**2/L + 0.0666666666666667*E*I33*t31**2/L - 0.0333333333333333*E*I33*t31*t32/L + 0.0666666666666667*E*I33*t32**2/L + 1.0*E*I33*u/L**2 + 1.5*E*Irr*t11**2/L**3 - 3.0*E*Irr*t11*t12/L**3 + 1.5*E*Irr*t12**2/L**3 + 1.0*G*I22/L + 1.0*G*I33/L, E*(0.0333333333333333*I22*t11*t21 - 0.133333333333333*I22*t11*t22 - 0.0333333333333333*I22*t12*t21 + 0.133333333333333*I22*t12*t22 + 0.0333333333333333*I33*t11*t21 - 0.133333333333333*I33*t11*t22 - 0.0333333333333333*I33*t12*t21 + 0.133333333333333*I33*t12*t22)/L, E*(0.0333333333333333*I22*t11*t31 - 0.133333333333333*I22*t11*t32 - 0.0333333333333333*I22*t12*t31 + 0.133333333333333*I22*t12*t32 + 0.0333333333333333*I33*t11*t31 - 0.133333333333333*I33*t11*t32 - 0.0333333333333333*I33*t12*t31 + 0.133333333333333*I33*t12*t32)/L], [A*E*(-0.0333333333333333*t21 + 0.133333333333333*t22), E*(-0.0333333333333333*I22*t11*t21 + 0.133333333333333*I22*t11*t22 + 0.0333333333333333*I22*t12*t21 - 0.133333333333333*I22*t12*t22 - 0.0333333333333333*I33*t11*t21 + 0.133333333333333*I33*t11*t22 + 0.0333333333333333*I33*t12*t21 - 0.133333333333333*I33*t12*t22)/L, E*(-0.00666666666666667*A*L**2*t21**2 + 0.02*A*L**2*t21*t22 - 0.00666666666666667*A*L**2*t22**2 - 0.00222222222222222*A*L**2*t31**2 + 0.00111111111111111*A*L**2*t31*t32 - 0.00222222222222222*A*L**2*t32**2 - 0.0333333333333333*A*L*u - 0.0166666666666667*I22*t11**2 + 0.0333333333333333*I22*t11*t12 - 0.0166666666666667*I22*t12**2 - 0.0166666666666667*I33*t11**2 + 0.0333333333333333*I33*t11*t12 - 0.0166666666666667*I33*t12**2 + 2.0*I33)/L, A*E*L*(-0.00444444444444444*t21*t31 + 0.00111111111111111*t21*t32 + 0.0177777777777778*t22*t31 - 0.00444444444444444*t22*t32), E*(0.0333333333333333*I22*t11*t21 - 0.133333333333333*I22*t11*t22 - 0.0333333333333333*I22*t12*t21 + 0.133333333333333*I22*t12*t22 + 0.0333333333333333*I33*t11*t21 - 0.133333333333333*I33*t11*t22 - 0.0333333333333333*I33*t12*t21 + 0.133333333333333*I33*t12*t22)/L, E*(0.01*A*L**2*t21**2 - 0.0133333333333333*A*L**2*t21*t22 + 0.0266666666666667*A*L**2*t22**2 + 0.00888888888888889*A*L**2*t31**2 - 0.00444444444444444*A*L**2*t31*t32 + 0.00888888888888889*A*L**2*t32**2 + 0.133333333333333*A*L*u + 0.0666666666666667*I22*t11**2 - 0.133333333333333*I22*t11*t12 + 0.0666666666666667*I22*t12**2 + 0.0666666666666667*I33*t11**2 - 0.133333333333333*I33*t11*t12 + 0.0666666666666667*I33*t12**2 + 4.0*I33)/L, A*E*L*(0.00111111111111111*t21*t31 - 0.00444444444444444*t21*t32 - 0.00444444444444444*t22*t31 + 0.0177777777777778*t22*t32)], [A*E*(-0.0333333333333333*t31 + 0.133333333333333*t32), E*(-0.0333333333333333*I22*t11*t31 + 0.133333333333333*I22*t11*t32 + 0.0333333333333333*I22*t12*t31 - 0.133333333333333*I22*t12*t32 - 0.0333333333333333*I33*t11*t31 + 0.133333333333333*I33*t11*t32 + 0.0333333333333333*I33*t12*t31 - 0.133333333333333*I33*t12*t32)/L, A*E*L*(-0.00444444444444444*t21*t31 + 0.0177777777777778*t21*t32 + 0.00111111111111111*t22*t31 - 0.00444444444444444*t22*t32), E*(-0.00222222222222222*A*L**2*t21**2 + 0.00111111111111111*A*L**2*t21*t22 - 0.00222222222222222*A*L**2*t22**2 - 0.00666666666666667*A*L**2*t31**2 + 0.02*A*L**2*t31*t32 - 0.00666666666666667*A*L**2*t32**2 - 0.0333333333333333*A*L*u - 0.0166666666666667*I22*t11**2 + 0.0333333333333333*I22*t11*t12 - 0.0166666666666667*I22*t12**2 + 2.0*I22 - 0.0166666666666667*I33*t11**2 + 0.0333333333333333*I33*t11*t12 - 0.0166666666666667*I33*t12**2)/L, E*(0.0333333333333333*I22*t11*t31 - 0.133333333333333*I22*t11*t32 - 0.0333333333333333*I22*t12*t31 + 0.133333333333333*I22*t12*t32 + 0.0333333333333333*I33*t11*t31 - 0.133333333333333*I33*t11*t32 - 0.0333333333333333*I33*t12*t31 + 0.133333333333333*I33*t12*t32)/L, A*E*L*(0.00111111111111111*t21*t31 - 0.00444444444444444*t21*t32 - 0.00444444444444444*t22*t31 + 0.0177777777777778*t22*t32), E*(0.00888888888888889*A*L**2*t21**2 - 0.00444444444444444*A*L**2*t21*t22 + 0.00888888888888889*A*L**2*t22**2 + 0.01*A*L**2*t31**2 - 0.0133333333333333*A*L**2*t31*t32 + 0.0266666666666667*A*L**2*t32**2 + 0.133333333333333*A*L*u + 0.0666666666666667*I22*t11**2 - 0.133333333333333*I22*t11*t12 + 0.0666666666666667*I22*t12**2 + 4.0*I22 + 0.0666666666666667*I33*t11**2 - 0.133333333333333*I33*t11*t12 + 0.0666666666666667*I33*t12**2)/L]])
fl = np.array([[E*(0.0666666666666667*A*L**2*t21**2 - 0.0333333333333333*A*L**2*t21*t22 + 0.0666666666666667*A*L**2*t22**2 + 0.0666666666666667*A*L**2*t31**2 - 0.0333333333333333*A*L**2*t31*t32 + 0.0666666666666667*A*L**2*t32**2 + 1.0*A*L*u + 0.5*I22*t11**2 - 1.0*I22*t11*t12 + 0.5*I22*t12**2 + 0.5*I33*t11**2 - 1.0*I33*t11*t12 + 0.5*I33*t12**2)/L**2, 0.0666666666666667*E*I22*t11*t21**2/L - 0.0333333333333333*E*I22*t11*t21*t22/L + 0.0666666666666667*E*I22*t11*t22**2/L + 0.0666666666666667*E*I22*t11*t31**2/L - 0.0333333333333333*E*I22*t11*t31*t32/L + 0.0666666666666667*E*I22*t11*t32**2/L - 0.0666666666666667*E*I22*t12*t21**2/L + 0.0333333333333333*E*I22*t12*t21*t22/L - 0.0666666666666667*E*I22*t12*t22**2/L - 0.0666666666666667*E*I22*t12*t31**2/L + 0.0333333333333333*E*I22*t12*t31*t32/L - 0.0666666666666667*E*I22*t12*t32**2/L + 1.0*E*I22*t11*u/L**2 - 1.0*E*I22*t12*u/L**2 + 0.0666666666666667*E*I33*t11*t21**2/L - 0.0333333333333333*E*I33*t11*t21*t22/L + 0.0666666666666667*E*I33*t11*t22**2/L + 0.0666666666666667*E*I33*t11*t31**2/L - 0.0333333333333333*E*I33*t11*t31*t32/L + 0.0666666666666667*E*I33*t11*t32**2/L - 0.0666666666666667*E*I33*t12*t21**2/L + 0.0333333333333333*E*I33*t12*t21*t22/L - 0.0666666666666667*E*I33*t12*t22**2/L - 0.0666666666666667*E*I33*t12*t31**2/L + 0.0333333333333333*E*I33*t12*t31*t32/L - 0.0666666666666667*E*I33*t12*t32**2/L + 1.0*E*I33*t11*u/L**2 - 1.0*E*I33*t12*u/L**2 + 0.5*E*Irr*t11**3/L**3 - 1.5*E*Irr*t11**2*t12/L**3 + 1.5*E*Irr*t11*t12**2/L**3 - 0.5*E*Irr*t12**3/L**3 + 1.0*G*I22*t11/L - 1.0*G*I22*t12/L + 1.0*G*I33*t11/L - 1.0*G*I33*t12/L, 1.0*E*(0.00888888888888889*A*L**2*t21**3 - 0.00666666666666667*A*L**2*t21**2*t22 + 0.01*A*L**2*t21*t22**2 + 0.00888888888888889*A*L**2*t21*t31**2 - 0.00444444444444444*A*L**2*t21*t31*t32 + 0.00888888888888889*A*L**2*t21*t32**2 - 0.00222222222222222*A*L**2*t22**3 - 0.00222222222222222*A*L**2*t22*t31**2 + 0.00111111111111111*A*L**2*t22*t31*t32 - 0.00222222222222222*A*L**2*t22*t32**2 + 0.133333333333333*A*L*t21*u - 0.0333333333333333*A*L*t22*u + 0.0666666666666667*I22*t11**2*t21 - 0.0166666666666667*I22*t11**2*t22 - 0.133333333333333*I22*t11*t12*t21 + 0.0333333333333333*I22*t11*t12*t22 + 0.0666666666666667*I22*t12**2*t21 - 0.0166666666666667*I22*t12**2*t22 + 0.0666666666666667*I33*t11**2*t21 - 0.0166666666666667*I33*t11**2*t22 - 0.133333333333333*I33*t11*t12*t21 + 0.0333333333333333*I33*t11*t12*t22 + 0.0666666666666667*I33*t12**2*t21 - 0.0166666666666667*I33*t12**2*t22 + 4.0*I33*t21 + 2.0*I33*t22)/L, 1.0*E*(0.00888888888888889*A*L**2*t21**2*t31 - 0.00222222222222222*A*L**2*t21**2*t32 - 0.00444444444444444*A*L**2*t21*t22*t31 + 0.00111111111111111*A*L**2*t21*t22*t32 + 0.00888888888888889*A*L**2*t22**2*t31 - 0.00222222222222222*A*L**2*t22**2*t32 + 0.00888888888888889*A*L**2*t31**3 - 0.00666666666666667*A*L**2*t31**2*t32 + 0.01*A*L**2*t31*t32**2 - 0.00222222222222222*A*L**2*t32**3 + 0.133333333333333*A*L*t31*u - 0.0333333333333333*A*L*t32*u + 0.0666666666666667*I22*t11**2*t31 - 0.0166666666666667*I22*t11**2*t32 - 0.133333333333333*I22*t11*t12*t31 + 0.0333333333333333*I22*t11*t12*t32 + 0.0666666666666667*I22*t12**2*t31 - 0.0166666666666667*I22*t12**2*t32 + 4.0*I22*t31 + 2.0*I22*t32 + 0.0666666666666667*I33*t11**2*t31 -
0.0166666666666667*I33*t11**2*t32 - 0.133333333333333*I33*t11*t12*t31 + 0.0333333333333333*I33*t11*t12*t32 + 0.0666666666666667*I33*t12**2*t31 - 0.0166666666666667*I33*t12**2*t32)/L, -0.0666666666666667*E*I22*t11*t21**2/L + 0.0333333333333333*E*I22*t11*t21*t22/L - 0.0666666666666667*E*I22*t11*t22**2/L - 0.0666666666666667*E*I22*t11*t31**2/L + 0.0333333333333333*E*I22*t11*t31*t32/L - 0.0666666666666667*E*I22*t11*t32**2/L + 0.0666666666666667*E*I22*t12*t21**2/L - 0.0333333333333333*E*I22*t12*t21*t22/L + 0.0666666666666667*E*I22*t12*t22**2/L + 0.0666666666666667*E*I22*t12*t31**2/L - 0.0333333333333333*E*I22*t12*t31*t32/L + 0.0666666666666667*E*I22*t12*t32**2/L - 1.0*E*I22*t11*u/L**2 + 1.0*E*I22*t12*u/L**2 - 0.0666666666666667*E*I33*t11*t21**2/L + 0.0333333333333333*E*I33*t11*t21*t22/L - 0.0666666666666667*E*I33*t11*t22**2/L - 0.0666666666666667*E*I33*t11*t31**2/L + 0.0333333333333333*E*I33*t11*t31*t32/L - 0.0666666666666667*E*I33*t11*t32**2/L + 0.0666666666666667*E*I33*t12*t21**2/L - 0.0333333333333333*E*I33*t12*t21*t22/L + 0.0666666666666667*E*I33*t12*t22**2/L + 0.0666666666666667*E*I33*t12*t31**2/L - 0.0333333333333333*E*I33*t12*t31*t32/L + 0.0666666666666667*E*I33*t12*t32**2/L - 1.0*E*I33*t11*u/L**2 + 1.0*E*I33*t12*u/L**2 - 0.5*E*Irr*t11**3/L**3 + 1.5*E*Irr*t11**2*t12/L**3 - 1.5*E*Irr*t11*t12**2/L**3 + 0.5*E*Irr*t12**3/L**3 - 1.0*G*I22*t11/L + 1.0*G*I22*t12/L - 1.0*G*I33*t11/L + 1.0*G*I33*t12/L, E*(-0.00222222222222222*A*L**2*t21**3 + 0.01*A*L**2*t21**2*t22 - 0.00666666666666667*A*L**2*t21*t22**2 - 0.00222222222222222*A*L**2*t21*t31**2 + 0.00111111111111111*A*L**2*t21*t31*t32 - 0.00222222222222222*A*L**2*t21*t32**2 + 0.00888888888888889*A*L**2*t22**3 + 0.00888888888888889*A*L**2*t22*t31**2 - 0.00444444444444444*A*L**2*t22*t31*t32 + 0.00888888888888889*A*L**2*t22*t32**2 - 0.0333333333333333*A*L*t21*u + 0.133333333333333*A*L*t22*u - 0.0166666666666667*I22*t11**2*t21 + 0.0666666666666667*I22*t11**2*t22 + 0.0333333333333333*I22*t11*t12*t21 - 0.133333333333333*I22*t11*t12*t22 - 0.0166666666666667*I22*t12**2*t21 + 0.0666666666666667*I22*t12**2*t22 - 0.0166666666666667*I33*t11**2*t21 + 0.0666666666666667*I33*t11**2*t22 + 0.0333333333333333*I33*t11*t12*t21 - 0.133333333333333*I33*t11*t12*t22 - 0.0166666666666667*I33*t12**2*t21 + 0.0666666666666667*I33*t12**2*t22 + 2.0*I33*t21 + 4.0*I33*t22)/L, E*(-0.00222222222222222*A*L**2*t21**2*t31 + 0.00888888888888889*A*L**2*t21**2*t32 + 0.00111111111111111*A*L**2*t21*t22*t31 - 0.00444444444444444*A*L**2*t21*t22*t32 - 0.00222222222222222*A*L**2*t22**2*t31 + 0.00888888888888889*A*L**2*t22**2*t32 - 0.00222222222222222*A*L**2*t31**3 + 0.01*A*L**2*t31**2*t32 - 0.00666666666666667*A*L**2*t31*t32**2 + 0.00888888888888889*A*L**2*t32**3 - 0.0333333333333333*A*L*t31*u + 0.133333333333333*A*L*t32*u - 0.0166666666666667*I22*t11**2*t31 + 0.0666666666666667*I22*t11**2*t32 + 0.0333333333333333*I22*t11*t12*t31 - 0.133333333333333*I22*t11*t12*t32 - 0.0166666666666667*I22*t12**2*t31 + 0.0666666666666667*I22*t12**2*t32 + 2.0*I22*t31 + 4.0*I22*t32 - 0.0166666666666667*I33*t11**2*t31 + 0.0666666666666667*I33*t11**2*t32 + 0.0333333333333333*I33*t11*t12*t31 - 0.133333333333333*I33*t11*t12*t32 - 0.0166666666666667*I33*t12**2*t31 + 0.0666666666666667*I33*t12**2*t32)/L]]).T
elif self.beamtype == "Timoshenko":
kl = np.array([[1.0*A*E/L, 0.75*E*Irr*(I22 + I33)*(t11 - t12)**5/L**6, 0, 0, -0.75*E*Irr*(I22 + I33)*(t11 - t12)**5/L**6, 0, 0], [0.75*E*Irr*(I22 + I33)*(t11 - t12)**5/L**6, (I22 + I33)*(3.75*E*Irr*u*(t11 - t12)**4 + 1.0*G*L**5)/L**6, 0, 0, -(I22 + I33)*(3.75*E*Irr*u*(t11 - t12)**4 + 1.0*G*L**5)/L**6, 0, 0], [0, 0, 0.25*A*G*L + 1.0*E*I33/L, 0, 0, 0.25*A*G*L - 1.0*E*I33/L, 0], [
0, 0, 0, 0.25*A*G*L + 1.0*E*I22/L, 0, 0, 0.25*A*G*L - 1.0*E*I22/L], [-0.75*E*Irr*(I22 + I33)*(t11 - t12)**5/L**6, -(I22 + I33)*(3.75*E*Irr*u*(t11 - t12)**4 + 1.0*G*L**5)/L**6, 0, 0, (I22 + I33)*(3.75*E*Irr*u*(t11 - t12)**4 + 1.0*G*L**5)/L**6, 0, 0], [0, 0, 0.25*A*G*L - 1.0*E*I33/L, 0, 0, 0.25*A*G*L + 1.0*E*I33/L, 0], [0, 0, 0, 0.25*A*G*L - 1.0*E*I22/L, 0, 0, 0.25*A*G*L + 1.0*E*I22/L]])
fl = np.array([[0.125*E*(8*A*L**5*u + Irr*(I22 + I33)*(t11 - t12)**6)/L**6, (I22 + I33)*(t11 - t12)*(0.75*E*Irr*u*(t11 - t12)**4 + G*L**5)/L**6, (0.25*A*G*L**2*(t21 + t22) + E*I33*(t21 - t22))/L, (0.25*A*G*L**2*(
t31 + t32) + E*I22*(t31 - t32))/L, -(I22 + I33)*(t11 - t12)*(0.75*E*Irr*u*(t11 - t12)**4 + 1.0*G*L**5)/L**6, (0.25*A*G*L**2*(t21 + t22) - 1.0*E*I33*(t21 - t22))/L, (0.25*A*G*L**2*(t31 + t32) - 1.0*E*I22*(t31 - t32))/L]]).T
return kl, fl
def strain(self, x, y, z):
"""Calculate the strain at a point expressed in local coordinate.
Parameters
----------
x: float
the 1st local coordinate.
y: float
the 2nd local coordinate.
z: float
the 3rd local coordinate.
Returns
-------
strain: numpy.ndarray
the strain vector with six components.
"""
u, t11, t21, t31, t12, t22, t32 = self.local_displacement().reshape(7)
L = self.initial_length
# Shape functions and their derivatives
# def f1(x): return 1 - 3 * (x/L) ** 2 + 2 * (x/L) ** 3
# def f2(x): return x * (1 - x/L) ** 2
# def f3(x): return 1 - f1(x)
# def f4(x): return (x ** 2) * (x/L - 1) / L
def f5(x): return 1 - x/L
def f6(x): return x/L
# def df1(x): return -6*x/L**2 + 6*x**2/L**3
def df2(x): return (1 - x/L)**2 - 2*x*(1 - x/L)/L
# def df3(x): return 6*x/L**2 - 6*x**2/L**3
def df4(x): return 2*x*(-1 + x/L)/L + x**2/L**2
def df5(x): return -1/L
def df6(x): return 1/L
# def ddf1(x): return -6/L**2 + 12*x/L**3
def ddf2(x): return -4*(1 - x/L)/L + 2*x/L**2
# def ddf3(x): return 6/L**2 - 12*x/L**3
def ddf4(x): return 2*(-1 + x/L)/L + 4*x/L**2
# def ddf5(x): return 0
# def ddf6(x): return 0
if self.beamtype == "Bernoulli":
# u1 = f6(x) * u
# u2 = f2(x) * t31 + f4(x) * t32
# u3 = -f2(x) * t21 - f4(x) * t22
du1 = df6(x) * u
du2 = df2(x) * t31 + df4(x) * t32
du3 = -df2(x) * t21 - df4(x) * t22
# ddu1 = ddf6(x)
ddu2 = ddf2(x) * t31 + ddf4(x) * t32
ddu3 = -ddf2(x) * t21 - ddf4(x) * t22
# t1 = f5(x) * t11 + f6(x) * t12
t2 = -du3
t3 = du2
dt1 = df5(x) * t11 + df6(x) * t12
dt2 = -ddu3
dt3 = ddu2
elif self.beamtype == "Timoshenko":
du1 = u / L
du2 = 0.0
du3 = 0.0
ddu2 = 0.0
ddu3 = 0.0
t1 = f5(x) * t11 + f6(x) * t12
t2 = f5(x) * t21 + f6(x) * t22
t3 = f5(x) * t31 + f6(x) * t32
dt1 = (t12 - t11) / L
dt2 = (t22 - t21) / L
dt3 = (t32 - t31) / L
eps_11 = du1 + (du2 ** 2 + du3 ** 2) / 2 - y * dt3 + \
z * dt2 + (y ** 2 + z ** 2) * dt1 ** 2 / 2
eps_22 = -self.first_lame_constant * eps_11 / \
(2 * (self.first_lame_constant + self.second_lame_constant))
eps_33 = eps_22
gamma_12 = du2 - t3 - z * dt1
gamma_13 = du3 + t2 + y * dt1
return np.array([[eps_11, eps_22, eps_33, gamma_12, 0., gamma_13]]).T
def map_local_coordinate_to_global_coordinate(self, xi, eta, mu):
"""Define the linear map between Gaussian space and local space.
Parameters
----------
xi: float
the 1st Gaussian coordinate.
eta: float
the 2nd Gaussian coordinate.
mu: float
the 3rd Gaussian coordinate.
Returns
-------
x: float
the 1st local coordinate.
y: float
the 2nd local coordinate.
z: float
the 3rd local coordinate.
"""
x = self.initial_length / 2 * (xi + 1)
y = self.width / 2 * eta
z = self.height / 2 * mu
return x, y, z
def perform_linear_hardening(self):
"""Update state variables using return-mapping algorithm for linear hardening model.
Parameters
----------
None.
Returns
-------
None.
"""
def yield_stress_function(
alpha): return self.yield_stress + self.plastic_modulus * alpha
elastic_tangent_moduli = self.first_lame_constant * util.unit_tensor() @ util.unit_tensor().T + \
2 * self.second_lame_constant * np.eye(6)
for n in range(self.num_of_gauss_locations):
x, y, z = self.global_gauss_locations_mat[0,
n], self.global_gauss_locations_mat[1, n], self.global_gauss_locations_mat[2, n]
strain_trial = self.strain(x, y, z) - self.plastic_strain[:, :, n]
volumetric_strain_trial, deviatoric_strain_trial = util.decompose_strain(
strain_trial)
p_trial = self.bulk_modulus * volumetric_strain_trial
s_trial = 2 * self.second_lame_constant * deviatoric_strain_trial
q_trial = np.sqrt(3/2) * util.stress_norm(s_trial)
f_trial = q_trial - \
yield_stress_function(self.internal_hardening_variable[n])
if f_trial <= 0:
self.stress[:, :, n] = s_trial + p_trial * util.unit_tensor()
self.tangent_moduli[:, :, n] = elastic_tangent_moduli
else:
deltagamma = f_trial / \
(self.plastic_modulus + 3 * self.second_lame_constant)
s = (1 - deltagamma * 3 *
self.second_lame_constant / q_trial) * s_trial
self.stress[:, :, n] = s + p_trial * util.unit_tensor()
self.plastic_strain[:, :, n] += deltagamma * \
np.sqrt(3/2) * s / util.stress_norm(s)
self.internal_hardening_variable[n] += deltagamma
# flow_vec = np.sqrt(3/2) * s / util.stress_norm(s)
# self.tangent_moduli[:, :, n] = elastic_tangent_moduli - float(((elastic_tangent_moduli @ flow_vec).T @ (elastic_tangent_moduli @ flow_vec)) / (flow_vec.T @ elastic_tangent_moduli @ flow_vec - self.plastic_modulus))
unit_flow_vec = s_trial / util.stress_norm(s_trial)
self.tangent_moduli[:, :, n] = 2 * self.second_lame_constant * (1 - deltagamma * 3 * self.second_lame_constant / q_trial) * util.deviatoric_projection_tensor() + 6 * self.second_lame_constant ** 2 * (
deltagamma / q_trial - 1 / (3 * self.second_lame_constant + self.plastic_modulus)) * unit_flow_vec @ unit_flow_vec.T + self.bulk_modulus * util.unit_tensor() @ util.unit_tensor().T
# def L_matrix(self):
# L = np.zeros((6, 6, self.num_of_gauss_locations), dtype=float)
# eta = -self.first_lame_constant / \
# (2 * (self.first_lame_constant +
# self.second_lame_constant))
# for n in range(self.num_of_gauss_locations):
# y, z = self.global_gauss_locations_mat[1: 3, n]
# L[3, 3, n] = (y ** 2 + z ** 2) * self.stress[0, 0, n] + eta * (y ** 2 + z ** 2) * \
# self.stress[1, 0, n] + eta * \
# (y ** 2 + z ** 2) * self.stress[2, 0, n]
# return L
def A_matrix(self, y, z):
p_l = self.local_displacement()
t12, t11 = p_l[4, 0], p_l[1, 0]
L = self.initial_length
# def df1(x): return -6*x/L**2 + 6*x**2/L**3
# def df3(x): return 6*x/L**2 - 6*x**2/L**3
# def dt1(x): return -1/L * t11 + 1/L * t12
A = np.array([[1., 0., 0., (y ** 2 + z ** 2) * (t12 - t11)/L, z, -y],
[0., 0., 0., 0., 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., -1., 0., -z, 0., 0.],
[0., 0., 0., 0., 0., 0.],
[0., 0., 1., y, 0., 0.]])
A[1, :] = -self.first_lame_constant / \
(2 * (self.first_lame_constant +
self.second_lame_constant)) * A[0, :]
A[2, :] = A[1, :]
return A
def G_mat(self, x):
L = self.initial_length
# def f1(x): return 1 - 3 * (x/L) ** 2 + 2 * (x/L) ** 3
# def f2(x): return x * (1 - x/L) ** 2
# def f3(x): return 1 - f1(x)
# def f4(x): return (x ** 2) * (x/L - 1) / L
def f5(x): return 1 - x/L
def f6(x): return x/L
# def df1(x): return -6*x/L**2 + 6*x**2/L**3
def df2(x): return (1 - x/L)**2 - 2*x*(1 - x/L)/L
# def df3(x): return 6*x/L**2 - 6*x**2/L**3
def df4(x): return 2*x*(-1 + x/L)/L + x**2/L**2
def df5(x): return -1/L
def df6(x): return 1/L
# def ddf1(x): return -6/L**2 + 12*x/L**3
def ddf2(x): return -4*(1 - x/L)/L + 2*x/L**2
# def ddf3(x): return 6/L**2 - 12*x/L**3
def ddf4(x): return 2*(-1 + x/L)/L + 4*x/L**2
# def ddf5(x): return 0
# def ddf6(x): return 0
if self.beamtype == "Bernoulli":
G = np.zeros((6, 7), dtype=float)
G[0, 0] = 1/L
G[1, 3], G[2, 2] = df2(x), df2(x)
G[1, 6], G[2, 5] = df4(x), df4(x)
G[3, 1], G[4, 2], G[5, 3] = df5(x), ddf2(x), ddf2(x)
G[3, 4], G[4, 5], G[5, 6] = df6(x), ddf4(x), ddf4(x)
elif self.beamtype == "Timoshenko":
G = np.zeros((6, 7), dtype=float)
G[0, 0] = 1/L
G[1, 3], G[2, 2] = f5(x), f5(x)
G[1, 6], G[2, 5] = f6(x), f6(x)
G[3, 1], G[4, 2], G[5, 3] = -1/L, -1/L, -1/L
G[3, 4], G[4, 5], G[5, 6] = 1/L, 1/L, 1/L
return G
def elasto_plastic_local_stiffness_force(self):
k_l = np.zeros((7, 7), dtype=float)
f_l = np.zeros((7, 1), dtype=float)
# L = self.L_matrix()
L = np.zeros((6, 6, self.num_of_gauss_locations), dtype=float)
eta = -self.first_lame_constant / \
(2 * (self.first_lame_constant +
self.second_lame_constant))
for n in range(self.num_of_gauss_locations):
x, y, z = self.global_gauss_locations_mat[0: 3, n]
G = self.G_mat(x)
A = self.A_matrix(y, z)
L[3, 3, n] = (y ** 2 + z ** 2) * self.stress[0, 0, n] + eta * (y ** 2 + z ** 2) * \
self.stress[1, 0, n] + eta * \
(y ** 2 + z ** 2) * self.stress[2, 0, n]
fac = self.initial_length * self.width * self.height / 8
k_l += G.T @ (A.T @ self.tangent_moduli[:, :, n] @ A + L[
:, :, n]) @ G * fac * self.weights_mat[n]
f_l += G.T @ A.T @ self.stress[:, :, n] * fac * self.weights_mat[n]
return k_l, f_l
def Ba_matrix(self):
p_l = self.local_displacement()
T_s_inv_theta_1bar = util.get_transformation_inv(p_l[1: 4])
T_s_inv_theta_2bar = util.get_transformation_inv(p_l[4: 7])
B_a = np.zeros((7, 7), dtype=float)
B_a[0, 0] = 1.
B_a[1: 4, 1: 4] = T_s_inv_theta_1bar
B_a[4: 7, 4: 7] = T_s_inv_theta_2bar
return B_a
def a_stiffness_force(self):
B_a = self.Ba_matrix()
if self.analysis == "elastic":
k_l, f_l = self.elastic_local_stiffness_force()
else:
k_l, f_l = self.elasto_plastic_local_stiffness_force()
p_l = self.local_displacement()
theta_bar_1 = p_l[1: 4]
theta_bar_2 = p_l[4: 7]
v_1 = f_l[1: 4]
v_2 = f_l[4: 7]
alpha_1, theta_bar_tilde_1 = util.decompose_rotational_vector(
theta_bar_1)
eta_1, mu_1 = util.get_eta_and_mu(alpha_1)
v_tilde_1 = util.get_skew_symmetric(v_1)
T_s_inv_1 = util.get_transformation_inv(theta_bar_1)
K_h1 = (eta_1 * (theta_bar_1 @ v_1.T - 2 * v_1 @ theta_bar_1.T + float(theta_bar_1.T @ v_1) * np.eye(3))
+ mu_1 * theta_bar_tilde_1 @ theta_bar_tilde_1 @ (v_1 @ theta_bar_1.T) - 1/2 * v_tilde_1) @ T_s_inv_1
alpha_2, theta_bar_tilde_2 = util.decompose_rotational_vector(
theta_bar_2)
eta_2, mu_2 = util.get_eta_and_mu(alpha_2)
v_tilde_2 = util.get_skew_symmetric(v_2)
T_s_inv_2 = util.get_transformation_inv(theta_bar_2)
K_h2 = (eta_2 * (theta_bar_2 @ v_2.T - 2 * v_2 @ theta_bar_2.T + float(theta_bar_2.T @ v_2) * np.eye(3))
+ mu_2 * theta_bar_tilde_2 @ theta_bar_tilde_2 @ (v_2 @ theta_bar_2.T) - 1/2 * v_tilde_2) @ T_s_inv_2
K_h = np.zeros((7, 7), dtype=float)
K_h[1: 4, 1: 4] = K_h1
K_h[4: 7, 4: 7] = K_h2
K_a = B_a.T @ k_l @ B_a + K_h
f_a = B_a.T @ f_l
return K_a, f_a
def G_matrix(self):
q_1, q_2, q = self.auxiliary_vector()
R_g = self.current_local_frame()
q1, q2 = (R_g.T @ q)[0: 2]
q11, q12 = (R_g.T @ q_1)[0: 2]
q21, q22 = (R_g.T @ q_2)[0: 2]
eta = q1 / q2
eta_11 = q11 / q2
eta_12 = q12 / q2
eta_21 = q21 / q2
eta_22 = q22 / q2
l = self.current_length()
G = np.array([
[0, 0, eta/l, eta_12/2, -eta_11/2, 0, 0,
0, -eta/l, eta_22/2, -eta_21/2, 0],
[0, 0, 1/l, 0, 0, 0,
0, 0, -1/l, 0, 0, 0],
[0, -1/l, 0, 0, 0, 0,
0, 1/l, 0, 0, 0, 0]], dtype=float).T
return G
def r_vector(self):
r_1 = (self.current_coordinate_node_2() -
self.current_coordinate_node_1()) / self.current_length()
r = np.zeros((1, 12), dtype=float)
r[:, 0: 3], r[:, 6: 9] = -r_1.T, r_1.T
return r
def P_matrix(self):
G = self.G_matrix()
temp1, temp2 = np.zeros((6, 12), dtype=float), np.zeros(
(6, 12), dtype=float)
temp1[0: 3, 3: 6], temp1[3: 6, 9: 12] = np.eye(3), np.eye(3)
temp2[0: 3, :], temp2[3: 6, :] = G.T, G.T
return temp1 - temp2
def E_matrix(self):
E = np.zeros((12, 12), dtype=float)
R_g = self.current_local_frame()
E[0: 3, 0: 3] = R_g
E[3: 6, 3: 6] = R_g
E[6: 9, 6: 9] = R_g
E[9: 12, 9: 12] = R_g
return E
def Bg_matrix(self):
return np.r_[self.r_vector(), self.P_matrix() @ self.E_matrix().T]
def global_stiffness_force(self):
B_g = self.Bg_matrix()
K_a, f_a = self.a_stiffness_force()
l = self.current_length()
r_1 = (self.current_coordinate_node_2() -
self.current_coordinate_node_1()) / l
G = self.G_matrix()
r = self.r_vector()
E = self.E_matrix()
# -----------------------------------------
# D_mat
D_3 = 1/l * (np.eye(3) - r_1 @ r_1.T)
D = np.zeros((12, 12), dtype=float)
D[0: 3, 0: 3] = D_3
D[0: 3, 6: 9] = -D_3
D[6: 9, 0: 3] = -D_3
D[6: 9, 6: 9] = D_3
# -----------------------------------------
# Q_mat
P = self.P_matrix()
temp = P.T @ f_a[1: 7]
n_1, m_1, n_2, m_2 = temp[0: 3], temp[3: 6], temp[6: 9], temp[9: 12]
Q = np.zeros((12, 3), dtype=float)
Q[0: 3, 0: 3] = util.get_skew_symmetric(n_1)
Q[3: 6, 0: 3] = util.get_skew_symmetric(m_1)
Q[6: 9, 0: 3] = util.get_skew_symmetric(n_2)
Q[9: 12, 0: 3] = util.get_skew_symmetric(m_2)
# -----------------------------------------
# a_vec
eta = float(G[2, 0]) * l
a = np.array([[0.0, float(eta/l * (f_a[1] + f_a[4]) - 1 /
l * (f_a[2] + f_a[5])), float(1/l * (f_a[3] + f_a[6]))]]).T
# -----------------------------------------
# K_mmat
K_m = D * f_a[0] - E @ Q @ G.T @ E.T + E @ G @ a @ r
# -----------------------------------------
K_g = B_g.T @ K_a @ B_g + K_m
f_g = B_g.T @ f_a
return K_g, f_g
| 64.346622 | 11,489 | 0.513742 | 8,119 | 58,105 | 3.551792 | 0.044464 | 0.009918 | 0.009779 | 0.036238 | 0.775844 | 0.65839 | 0.593335 | 0.53303 | 0.501508 | 0.482366 | 0 | 0.326069 | 0.339024 | 58,105 | 902 | 11,490 | 64.41796 | 0.424777 | 0.117064 | 0 | 0.170732 | 0 | 0 | 0.003725 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.121951 | false | 0 | 0.007317 | 0.043902 | 0.207317 | 0.002439 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a6905164b6b14b94548e1e5c13eeef0d9a9934c3 | 740 | py | Python | test/test_0_loggers.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | test/test_0_loggers.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | test/test_0_loggers.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | import logging
import os
import pytest
# import subprocess
from smartva.utils import status_notifier
from smartva.loggers import status_logger, warning_logger
from test_utils.status_handler import StatusHandler
@pytest.fixture
def warning_file(tmpdir):
return os.path.abspath(tmpdir.join('warnings.txt').strpath)
@pytest.fixture
def status_file(tmpdir):
return os.path.abspath(tmpdir.join('status.txt').strpath)
def test_loggers(warning_file, status_file, tmpdir):
# subprocess.call(['open', tmpdir.strpath])
status_logger.addHandler(logging.FileHandler(status_file, mode='w'))
status_notifier.register(StatusHandler(status_logger.info))
warning_logger.addHandler(logging.FileHandler(warning_file, mode='w'))
| 28.461538 | 74 | 0.793243 | 97 | 740 | 5.886598 | 0.360825 | 0.063047 | 0.056042 | 0.063047 | 0.136602 | 0.136602 | 0.136602 | 0.136602 | 0 | 0 | 0 | 0 | 0.101351 | 740 | 25 | 75 | 29.6 | 0.858647 | 0.07973 | 0 | 0.125 | 0 | 0 | 0.035398 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1875 | false | 0 | 0.375 | 0.125 | 0.6875 | 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 |
a6928eb0d8555573daf7d2956495020a6d0c5e3d | 1,932 | py | Python | mid_software/Honeywell_UDC3500_Interface.py | bluthen/isadore_electronics | c207be3bacd1fe360d70753410896610e23f216b | [
"Apache-2.0"
] | null | null | null | mid_software/Honeywell_UDC3500_Interface.py | bluthen/isadore_electronics | c207be3bacd1fe360d70753410896610e23f216b | [
"Apache-2.0"
] | null | null | null | mid_software/Honeywell_UDC3500_Interface.py | bluthen/isadore_electronics | c207be3bacd1fe360d70753410896610e23f216b | [
"Apache-2.0"
] | null | null | null | # Copyright 2010-2019 Dan Elliott, Russell Valentine
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import math
from pymodbus.client.sync import ModbusTcpClient
class TCP_connection(object):
""" Handles opening and closing connections to a UDC3500 """
# TODO: add exceptions
def __init__(self,slaveAddy):
""" blah blah blah """
""" param slaveAddy: a string representation of the UDC's IP address"""
self.client = ModbusTcpClient(host=slaveAddy)
def getClient(self):
self.client.close() # kinda a POS
if not self.client.connect(): # make sure it can be re-opened
# TODO: throw exception
pass
return self.client
def __del__(self):
self.client.close() # kill it once and for all, i suppose
def getPV(conn):
# TODO: add exception handling
rsp = conn.getClient().read_holding_registers(0x0000,1)
return rsp.getRegister(0) / 10.
def getSP(conn):
# TODO: add exception handling
rsp = conn.getClient().read_input_registers(0x0002,1)
return rsp.getRegister(0) / 10.
def setSP(conn,newSP):
# TODO: add exception handling
intSP = int(math.floor(newSP * 10.))
rsp = conn.getClient().write_register(0x0002,intSP)
return True
def getOutput(conn):
# TODO: add exception handling
rsp = conn.getClient().read_input_registers(0x0003,1)
return rsp.getRegister(0)/2.
| 36.45283 | 79 | 0.689441 | 264 | 1,932 | 4.984848 | 0.549242 | 0.045593 | 0.048632 | 0.072948 | 0.18845 | 0.171733 | 0.171733 | 0.130699 | 0.130699 | 0.094225 | 0 | 0.03245 | 0.218427 | 1,932 | 52 | 80 | 37.153846 | 0.839073 | 0.465839 | 0 | 0.16 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02589 | 0.019231 | 0 | 1 | 0.28 | false | 0.04 | 0.08 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a696c97f6d40070921213e14ab5780b1ff444501 | 887 | py | Python | app/mongo/data/collect/images/mongo.py | jgphilpott/polyMaker | 33ab5ecdba277d1765ffdaebb77f0bab2480dc46 | [
"MIT"
] | null | null | null | app/mongo/data/collect/images/mongo.py | jgphilpott/polyMaker | 33ab5ecdba277d1765ffdaebb77f0bab2480dc46 | [
"MIT"
] | null | null | null | app/mongo/data/collect/images/mongo.py | jgphilpott/polyMaker | 33ab5ecdba277d1765ffdaebb77f0bab2480dc46 | [
"MIT"
] | null | null | null | from mongo.data.collect.ions import mongo_collection
collection = mongo_collection("images")
def new_image(image):
return str(collection.insert_one(image).inserted_id)
def new_images(images):
return str(collection.insert_many(images).inserted_ids)
def find_image(query={}, filter={"_id": 0}):
return dict(collection.find_one(query, filter))
def find_images(query={}, filter={"_id": 0}, sort=[("id", 1)], limit=0):
collection.create_index(sort)
return list(collection.find(query, filter).sort(sort).limit(limit))
def update_image(image):
return collection.update_one({"id": image["id"]}, {"$set": image})
def update_images(images):
for image in images:
update_image(image)
def delete_image(image):
return collection.delete_one({"id": image["id"]})
def delete_images(images):
for image in images:
delete_image(image)
| 21.119048 | 72 | 0.702368 | 122 | 887 | 4.92623 | 0.286885 | 0.083195 | 0.079867 | 0.083195 | 0.093178 | 0.093178 | 0 | 0 | 0 | 0 | 0 | 0.005291 | 0.147689 | 887 | 41 | 73 | 21.634146 | 0.789683 | 0 | 0 | 0.095238 | 0 | 0 | 0.029312 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.380952 | false | 0 | 0.047619 | 0.238095 | 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 |
a6a1cc493653cb9c32fc98a3e3034f8d633c3abe | 37,109 | py | Python | easyocr/config.py | tsis-mobile-technology/EasyOCR | 981102f2910b1c6e8feacdc5f9575ebc80a4caec | [
"Apache-2.0"
] | null | null | null | easyocr/config.py | tsis-mobile-technology/EasyOCR | 981102f2910b1c6e8feacdc5f9575ebc80a4caec | [
"Apache-2.0"
] | null | null | null | easyocr/config.py | tsis-mobile-technology/EasyOCR | 981102f2910b1c6e8feacdc5f9575ebc80a4caec | [
"Apache-2.0"
] | null | null | null | import os
os.environ["LRU_CACHE_CAPACITY"] = "1"
BASE_PATH = os.path.dirname(__file__)
MODULE_PATH = os.environ.get("EASYOCR_MODULE_PATH") or \
os.environ.get("MODULE_PATH") or \
os.path.expanduser("~/.EasyOCR/")
# detector parameters
detection_models = {
'craft' : {
'filename': 'craft_mlt_25k.pth',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/craft_mlt_25k.zip',
'filesize': '2f8227d2def4037cdb3b34389dcf9ec1'
}
}
# recognizer parameters
latin_lang_list = ['af','az','bs','cs','cy','da','de','en','es','et','fr','ga',\
'hr','hu','id','is','it','ku','la','lt','lv','mi','ms','mt',\
'nl','no','oc','pi','pl','pt','ro','rs_latin','sk','sl','sq',\
'sv','sw','tl','tr','uz','vi']
arabic_lang_list = ['ar','fa','ug','ur']
bengali_lang_list = ['bn','as','mni']
cyrillic_lang_list = ['ru','rs_cyrillic','be','bg','uk','mn','abq','ady','kbd',\
'ava','dar','inh','che','lbe','lez','tab','tjk']
devanagari_lang_list = ['hi','mr','ne','bh','mai','ang','bho','mah','sck','new',\
'gom','sa','bgc']
other_lang_list = ['th','ch_sim','ch_tra','ja','ko','ta','te','kn']
all_lang_list = latin_lang_list + arabic_lang_list+ cyrillic_lang_list +\
devanagari_lang_list + bengali_lang_list + other_lang_list
imgH = 64
separator_list = {
'th': ['\xa2', '\xa3'],
'en': ['\xa4', '\xa5']
}
separator_char = []
for lang, sep in separator_list.items():
separator_char += sep
recognition_models = {
'gen1' : {
'latin_g1':{
'filename': 'latin.pth',
'model_script': 'latin',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/latin.zip',
'filesize': 'fb91b9abf65aeeac95a172291b4a6176',
'characters': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÀÁÂÃÄÅÆÇÈÉÊËÍÎÑÒÓÔÕÖØÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿąęĮįıŁłŒœŠšųŽž",
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ "
},
'zh_tra_g1':{
'filename': 'chinese.pth',
'model_script': 'chinese_tra',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/chinese.zip',
'filesize': 'dfba8e364cd98ed4fed7ad54d71e3965',
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ一丁七丈三上下不丑且丕世丘丙丞丟並丫中丰串丸丹主乃久么之乍乎乏乒乓乖乘乙九乞也乳乾亂了予事二于云互五井些亞亟亡亢交亥亦亨享京亭亮亳亶人什仁仃仄仆仇今介仍仔仕他仗付仙仞仡代令以仰仲件价任份仿企伉伊伍伎伏伐休伕伙伯估伴伶伸伺似伽佃但佈位低住佐佑佔何佗佘余佚佛作佝佞佟你佣佤佩佬佯佰佳併佻佼使侃侄來侈例侍侏侑侖侗供依侮侯侵侶侷便係促俄俊俏俐俑俗俘俚保俞俟俠信俬修俯俱俳俵俸俺俾倀倆倉個倍們倒倔倖倘候倚倜借倡倣倦倨倩倪倫倬倭值偃假偈偉偌偏偕做停健側偵偶偷偽傀傅傌傍傑傘備傚傢傣催傭傲傳債傷傻傾僂僅僉像僑僕僖僚僥僧僭僮僰僱僳僵價僻儀儂億儆儉儋儐儒儘償儡優儲儸儻儼儿兀允元兄充兆兇先光克兌免兒兔兕兗兜入內全兩八公六兮共兵其具典兼冀冉冊再冑冒冕冗冠冢冤冥冬冰冶冷冼准凋凌凍凜凝几凡凰凱凳凶凸凹出函刀刁刃分切刈刊刎刑划列初判別刨利刪刮到制刷券刺刻剁剃則削剌前剎剔剖剛剝剡剩剪副割創剷剽剿劃劇劈劉劍劑力功加劣助努劫劭劾勁勃勇勉勒動勖勗勘務勛勝勞募勢勤勦勰勳勵勸勺勻勾勿包匆匈匍匐匕化北匙匝匠匡匣匪匯匱匹匾匿區十千卅升午卉半卑卒卓協南博卜卞占卡卦卯印危即卵卷卸卹卻卿厄厘厚厝原厥厭厲去參又叉及友反叔取受叛叟叡叢口古句另叨叩只叫召叭叮可台叱史右司叻叼吁吃各合吉吊吋同名后吏吐向吒君吝吞吟吠否吧吩含听吳吵吶吸吹吻吼吾呀呂呃呆呈告呎呢呤周味呵呸呻呼命咀咁咄咆和咎咐咒咕咖咚咧咨咩咪咫咬咭咯咱咳咸咽哀品哄哆哇哈哉員哥哦哨哩哪哭哮哲哺哼哿唁唄唆唇唉唐唑唔唧唬售唯唱唸唾啃啄商啊問啕啞啟啡啣啤啥啦啶啼啾喀喂喃善喇喉喊喋喔喘喙喚喜喝喟喧喪喫喬單喱喻嗅嗎嗓嗔嗜嗟嗡嗣嗦嗩嗯嗲嗶嗽嘆嘈嘉嘌嘎嘔嘖嘗嘛嘧嘩嘮嘯嘲嘴嘸嘻嘿噁噎器噩噪噬噴噶噸噹嚇嚎嚏嚐嚥嚨嚮嚴嚼囂囉囊囍囑囚四回因囤困囹固圃圄圈國圍園圓圖團圜土在圩圭圮地圳圻圾址均坊坌坍坎坏坐坑坡坤坦坨坪坭坳坷坻垂垃型垓垚垛垠垢垣垮埂埃埋城埏埒埔埕域埠埤埭執埸培基埼堀堂堅堆堇堉堊堍堠堡堤堪堯堰報場堵塊塌塑塔塗塘塚塞塢塤填塵塾墀境墅墉墊墓墘墜增墟墨墩墮墳墾壁壅壇壑壓壕壘壙壞壟壢壤壩士壬壯壹壺壼壽夏夔夕外夙多夜夠夢夥大天太夫夭央夯失夷夸夾奄奇奈奉奎奏奐契奔奕套奘奚奠奢奧奪奭奮女奴奶奸她好如妃妄妊妍妒妓妖妙妝妞妣妤妥妨妮妲妳妹妻妾姆姊始姐姑姒姓委姚姜姝姣姥姦姨姪姬姮姻姿威娃娑娘娛娜娟娠娣娥娩娶娼婁婆婉婕婚婢婦婧婪婭婷婺婿媒媚媛媧媲媳媽嫁嫂嫉嫌嫖嫚嫡嫣嫦嫩嫻嬉嬋嬌嬗嬛嬤嬪嬬嬰嬴嬸嬿孀孃孌子孔孕孖字存孚孛孜孝孟孢季孤孩孫孱孵學孺孽孿宁它宅宇守安宋完宏宓宕宗官宙定宛宜客宣室宥宦宮宰害宴宵家宸容宿寂寄寅密寇富寐寒寓寞察寡寢寥實寧寨審寫寬寮寰寵寶寸寺封射將專尉尊尋對導小少尕尖尚尤尪尬就尷尸尹尺尻尼尾尿局屁居屆屈屋屍屎屏屑展屜屠屢層履屬屯山岌岐岑岔岡岩岫岬岱岳岷岸峇峋峒峙峨峪峭峰島峻峽崁崆崇崎崑崔崖崗崙崚崛崞崢崤崧崩崮崴崽嵊嵌嵎嵐嵩嵬嵯嶄嶇嶙嶲嶷嶺嶼嶽巍巒巔巖川州巡巢工左巧巨巫差巰己已巳巴巷巽巾市布帆希帑帕帖帘帚帛帝帥師席帳帶帷常帽幄幅幌幕幗幘幟幡幢幣幫干平年并幸幹幻幼幽幾庄庇床庋序底庖店庚府庠度座庫庭庵庶康庸庹庾廁廂廈廉廊廒廓廕廖廚廝廟廠廡廢廣廩廬廳延廷建廿弁弄弈弊弋式弒弓弔引弗弘弛弟弢弦弧弩弱張強弼彆彈彊彌彎彗彘彙形彤彥彧彩彪彬彭彰影彷役彼彿往征待徇很徊律後徐徑徒得徘徙從徠御徨復循徬徭微徵德徹徽心必忌忍忐忑忒忖志忘忙忠忡忤快忭忱念忸忻忽忿怎怒怕怖思怠怡急性怨怩怪怯恁恂恃恆恉恍恐恕恙恢恣恤恥恨恩恪恫恬恭息恰恿悄悅悉悌悍悔悖悚悝悟悠患您悱悲悵悶悸悼悽情惆惇惊惋惑惕惚惜惟惠惡惦惰惱想惶惹惺惻愁愆愈愉愍意愕愚愛感愧愫愷愿慄慈態慌慎慕慘慚慟慢慣慧慨慫慮慰慵慶慷慾憂憊憎憐憑憚憤憧憨憩憫憬憲憶憾懂懃懇懈應懊懋懣懦懲懶懷懸懺懼懾懿戀戇戈戊戌戍戎成我戒戕或戚戛戟戡截戮戰戲戳戴戶戾房所扁扇扈手才扎扑扒打扔托扛扣扦扭扮扯扳扶批扼找承技抃抄抉把抑抒抓投抖抗折抨披抬抱抵抹押抽拂拄拆拇拈拉拋拌拍拎拐拒拓拔拖拗拘拙拚招拜括拭拮拯拱拳拴拷拼拽拾拿持挂指按挑挖挨挪挫振挹挺挽挾捂捅捆捉捍捎捏捐捕捧捨捩捫据捱捲捶捷捺捻掀掃掄授掉掌掎掏掐排掖掘掙掛掟掠採探掣接控推掩措掰掾揀揆揉揍描提插揖揚換握揣揩揪揭揮援揹損搏搐搓搖搗搜搞搡搥搪搬搭搶摒摔摘摧摩摭摯摶摸摹摺摻摽撂撇撈撐撒撓撕撞撤撥撩撫撬播撮撰撲撻撼撾撿擁擂擄擅擇擊擋操擎擒擔擘據擠擢擦擬擭擱擲擴擺擾攀攄攏攔攘攙攜攝攣攤攪攫攬支收攸改攻放政故效敏救敔敕敖敗敘教敝敞敢散敦敬敲整敵敷數斂斃文斌斐斑斗料斛斜斟斡斤斥斧斫斬斯新斷方於施旁旃旄旅旋旌族旒旗既日旦旨早旬旭旱旺旻昀昂昃昆昇昊昌明昏易昔昕昝星映昤春昧昨昭是昱昴昵昶時晃晉晏晒晙晚晝晞晟晤晦晨普景晰晴晶晸智晾暄暇暈暉暌暐暑暖暗暝暠暢暨暫暮暱暴暹曄曆曉曖曙曜曝曠曦曩曬曰曲曳更書曹曼曾替最會月有朋服朔朕朗望朝期木未末本札朱朴朵朽杆杉李杏材村杖杜杞束杠杭杯杰東杲杳杵杷杻杼松板枇枉枋析枕林枚果枝枯架枷枸柁柄柏某柑染柔柘柚柜柝柞柢查柩柬柯柰柱柳柴柵柿栓栖栗栝校栩株栲核根格栽桀桂桃桅框案桉桌桎桐桑桓桴桶桿梁梅梆梏梓梗條梟梢梧梨梭梯械梳梵棄棉棋棍棐棒棕棗棘棚棟棠棣棧棨棪棫森棱棲棵棹棺棻棼椅椋植椎椏椒椰椴椿楊楓楔楙楚楞楠楢楣楨楫業極楷楹概榆榎榔榕榛榜榨榭榮榴榷榻榿槃槊構槍槎槐槓槙槤槭槳槻槽槿樁樂樊樑樓樗標樞樟模樣樵樸樹樺樽橄橇橈橋橘橙機橡橢橫橿檀檄檎檐檔檗檜檢檬檯檳檸檻櫃櫓櫚櫛櫟櫥櫧櫨櫬櫸櫻欄權欒欖欠次欣欲欹欺欽款歃歆歇歉歌歎歐歙歜歟歡止正此步武歧歪歲歷歸歹死殂殃殆殉殊殖殘殫殭殮殯殲段殷殺殼殿毀毅毆毋母每毒毓比毖毗毘毛毫毬毯毽氏氐民氓气氘氙氚氛氟氣氦氧氨氫氬氮氯氰水永氾汀汁求汊汎汐汕汗汙汛汜汝汞江池污汨汪汰汲汴汶決汽汾沁沂沃沅沈沉沌沐沒沓沔沖沙沚沛沫沭沮沱河沸油治沼沽沾沿況泄泅泉泊泌泓法泖泗泚泛泡波泣泥注泫泮泰泳泵洄洋洌洒洗洙洛洞津洩洪洮洱洲洵洶洸洹活洽派流浙浚浦浩浪浮浴海浸涂涅涇消涉涌涕涪涮涯液涵涼涿淀淄淅淆淇淋淌淑淒淖淘淙淚淞淡淤淦淨淪淫淮淯深淳淵混淹淺添淼清渚減渝渠渡渣渤渥渦測渭港渲渴游渺渾湃湄湊湍湖湘湛湜湟湣湧湮湯溉源準溘溜溝溟溢溥溧溪溫溯溲溴溶溺溼溽滁滂滄滅滇滋滌滎滑滓滔滕滘滬滯滲滴滷滸滾滿漁漂漆漏漓演漕漠漢漣漩漪漫漬漱漲漳漶漸漾漿潁潑潔潘潛潞潟潢潤潭潮潯潰潸潼澀澂澄澆澈澍澎澔澗澡澤澧澮澱澳澹激濁濂濃濉濕濘濛濟濠濡濤濫濬濮濰濱濺濾瀆瀉瀋瀏瀑瀕瀘瀚瀛瀝瀟瀦瀧瀨瀾灌灑灘灝灞灣火灰灶灸灼災炅炊炎炒炕炖炙炤炫炬炭炮炯炳炸為烜烤烯烴烷烹烽焉焊焙焚焜無焦焯焰然煃煇煉煌煎煒煙煜煞煤煥照煩煬煮煲煽熄熊熏熒熔熙熟熨熬熱熵熹熾燁燃燄燈燉燊燎燒燕燙營燥燦燧燬燭燮燹燼燾爆爇爍爐爛爪爬爭爰爵父爸爹爺爽爾牂牆片版牌牒牘牙牛牟牠牡牢牧物牲特牽犀犁犍犒犛犢犧犬犯狀狂狄狌狐狗狙狠狡狩狸狹狼狽猁猖猗猛猜猝猞猥猩猴猶猷猾猿獄獅獎獗獠獨獲獵獷獸獻獼獾玄率玉王玕玖玟玠玥玦玩玫玲玳玷玻珀珂珈珊珍珙珞珠珩珪班珮珽現球琅理琇琉琊琍琚琛琢琥琦琨琪琮琯琰琳琴琵琶瑁瑋瑕瑙瑚瑛瑜瑞瑟瑣瑤瑩瑪瑭瑯瑰瑾璀璃璆璇璉璋璐璘璜璞璟璦璧璨璫環璽璿瓊瓏瓚瓜瓢瓣瓦瓮瓶瓷甄甕甘甚甜生產甥甦用甩甫甬甯田由甲申男甸町甾畀畈畋界畏畔留畜畝畢畤略畦番畫異當畸畿疆疇疊疏疑疙疚疝疣疤疥疫疲疳疵疹疼疾病症痊痍痔痕痘痙痛痞痢痣痰痲痳痴痹痺痿瘀瘁瘉瘋瘍瘓瘟瘠瘡瘤瘦瘧瘩瘳瘴療癆癌癒癘癟癡癢癬癮癱癸登發白百皂的皆皇皈皋皎皓皖皚皮皰皺皿盂盃盅盆盈益盎盒盔盛盜盞盟盡監盤盥盧盪目盯盱盲直相盼盾省眈眉看眙真眠眨眩眭眯眶眷眸眺眼眾睇睛睜睞睡睢督睦睪睫睬睹睽睾睿瞄瞇瞋瞎瞑瞞瞢瞧瞪瞬瞭瞰瞳瞻瞿矗矚矛矜矢矣知矩短矮矯石矻矽砂砆砌砍研砝砟砢砦砧砭砲破砵砸硃硅硒硝硤硨硫硬确硯硼硿碇碌碎碑碓碗碘碚碟碣碧碩碭碰碳碴確碻碼碾磁磅磊磋磐磔磚磡磧磨磬磯磲磷磺礁礎礑礙礦礪礫示礽社祀祁祂祇祈祉祊祐祕祖祗祚祛祜祝神祟祠祥祧票祭祺祿禁禍禎福禕禦禧禪禮禱禳禹禺禽禾禿秀私秉秋科秒秕秘租秣秤秦秧秩秫秸移稀稃稅程稍稔稗稙稚稜稞稟稠種稱稷稻稼稽稿穀穆穌積穎穗穢穩穫穴究穹空穿突窄窆窈窒窕窖窗窘窟窠窨窩窪窮窯窺窿竄竅竇竊立竑站竟章竣童竭端競竹竺竽竿笈笏笑笘笙笛笞笠符笨第笭筅筆等筊筋筍筏筐筑筒答策筠筩筮筱筲筵筷箇箋箍箏箔箕算管箬箭箱箴箸節範篆篇築篙篚篠篡篤篦篩篷篾簇簋簑簡簧簪簷簸簽簾簿籀籃籌籍籙籠籤籬籲米籽粉粑粒粕粗粘粟粥粱粲粵粹粽精粿糊糌糕糖糙糜糞糟糠糧糯糰糴糸系糾紀約紅紆紉紊紋納紐紓純紗紘紙級紛紜素紡索紫紮累細紳紹紺絀終絃組結絕絛絜絞絡絢給絨絮統絲絳絹綁綏綑經綜綠綢綦綬維綱網綴綵綸綺綻綽綾綿緊緋緒線緝緞締緣編緩緬緯練緻縉縊縑縛縝縞縣縫縮縯縱縷總績繁繃繆織繕繖繞繡繩繪繫繭繳繹繼纂纇纈續纏纓纖纘纛纜缶缸缺缽罄罌罐罔罕罘罟罩罪置罰署罵罷罹羅羆羈羊羌美羔羚羞群羥羧羨義羯羰羲羸羹羽羿翁翅翊翌翎習翔翟翠翡翥翦翩翮翰翱老考耄者耆耋而耍耐耒耕耖耗耘耙耜耦耳耶耽耿聆聊聒聖聘聚聞聯聰聲聳聶職聽聾聿肄肅肆肇肉肋肌肖肘肚肛肜肝股肢肥肩肪肫肯肱育肺胂胃胄背胎胖胚胛胞胡胤胥胭胯胰胱胸胺能脂脅脆脈脊脖脛脣脩脫脹脾腆腊腋腌腎腐腑腓腔腕腥腦腧腫腰腱腳腴腸腹腺腿膀膂膈膊膏膚膛膜膝膠膨膩膳膺膽膾膿臀臂臃臆臉臊臘臚臞臟臣臥臧臨自臬臭至致臺臻臼臾舀舂舅與興舉舊舌舍舒舔舖舜舞舟航般舵舶舷舸船舺艇艮良艱色艷艾芊芋芍芎芒芙芝芡芥芩芫芬芭芮芯花芳芷芸芹芽芾苑苒苓苔苕苗苛苜苞苟苡苣若苦苧苯英苳苹苻苾茁茂范茄茅茆茉茌茗茛茜茨茫茯茱茲茴茵茶茸茹荀荃荅草荊荏荐荒荔荖荷荸荻荼荽莆莉莊莎莒莓莖莘莞莢莪莫莽菀菁菅菇菊菌菏菑菘菜菠菡菩華菱菲菴菸萁萃萄萇萊萌萍萎萩萬萱萸萼落葆葉著葛葡董葦葫葬葳葵葶葺蒂蒐蒔蒙蒜蒞蒡蒨蒯蒲蒴蒸蒺蒼蒿蓀蓄蓆蓉蓋蓑蓓蓬蓮蓼蔑蔓蔗蔚蔡蔣蔥蔬蔭蔻蔽蕃蕈蕉蕊蕙蕞蕨蕩蕪蕭蕾薄薇薈薊薑薙薛薜薦薨薩薪薯薰薹薺藉藍藏藐藕藜藝藤藥藨藩藪藻蘄蘅蘆蘇蘊蘋蘑蘚蘧蘭蘸蘼蘿虎虐虔處虖虛虜虞號虧虫虱虹蚊蚌蚓蚕蚜蚣蚤蚨蚩蚪蚵蚺蛄蛆蛇蛉蛋蛐蛔蛙蛛蛟蛤蛩蛭蛹蛺蛻蛾蜀蜂蜆蜈蜊蜑蜒蜓蜘蜚蜜蜡蜥蜱蜴蜷蜻蜿蝌蝕蝗蝘蝙蝠蝦蝮蝴蝶蝸螂螃螈融螞螟螢螭螯螳螺螽蟀蟄蟆蟈蟋蟑蟠蟬蟲蟹蟻蟾蠃蠅蠆蠍蠑蠓蠔蠕蠟蠡蠢蠣蠱蠲蠶蠻血行衍術街衙衛衝衡衢衣表衫衰衷衹袁袋袍袒袖袛袞袪被袱裁裂裔裕裘裙補裝裡裨裱裲裳裴裸裹製裾褂複褐褒褚褡褥褪褫褲褶褸褻襄襖襟襠襤襦襪襬襯襲西要覃覆見規覓視覘親覲覺覽觀角觔觚觝解觴觸觿言訂訃訇計訊訌討訐訓訕訖託記訛訝訟訢訣訥訪設許訴訶診註証詐詒詔評詗詛詞詠詢試詩詫詬詭詮詰話該詳詹詼誅誇誌認誓誕誘語誠誡誣誤誥誦誨說誰課誼調諂談請諍諏諒論諛諜諡諤諦諧諫諭諮諱諳諷諸諺諾謀謁謂謄謇謊謎謗謙謚講謝謠謨謫謬謳謹謾譁證譏識譙譚譜警譬譯議譴護譽讀變讓讖讙讚讞谷谿豁豆豈豉豊豌豎豐豔豚象豢豹豺貂貉貊貌貍貓貝貞負財貢貧貨販貪貫責貴貶買貸費貼貽貿賀賁賂賃賄資賈賊賑賓賚賜賞賠賡賢賣賤賦質賬賭賴賸賺購賽贇贈贊贏贓贖贛赤赦赫赭走赴赶起趁超越趕趙趟趣趨足趴趵趾跆跋跌跑跖跗跛距跟跡跣跤跨跪路跳踊踏踐踝踞踢踩踰踴踵踹蹂蹄蹇蹈蹊蹋蹔蹟蹠蹤蹦蹬蹭蹯蹲蹴蹶蹼躁身躬躲躺軀車軋軌軍軒軔軛軟軫軸軾較輅載輒輓輔輕輛輜輝輟輩輪輯輸輻輾輿轂轄轅轉轍轎轟辛辜辟辣辦辨辭辯辰辱農迂迄迅迎近返迢迤迥迦迨迪迫迭述迴迷迺追退送适逃逄逅逆逋逍透逐逑途逕逗這通逛逝逞速造逢連逮逯週進逵逶逸逼逾遁遂遇遊運遍過遏遐遑遒道達違遘遙遜遞遠遣遨適遭遮遲遴遵遶遷選遺遼遽避邀邁邂還邇邈邊邏邑邕邛邠邢那邦邪邯邰邱邳邴邵邸邽邾郁郃郅郇郊郎郛郜郝郡郢部郭郯郴郵都郾鄂鄉鄒鄔鄙鄞鄧鄭鄯鄰鄱鄴鄺酆酉酊酋酌配酐酒酗酚酣酥酩酪酬酮酯酴酵酷酸醅醇醉醋醍醐醒醚醛醜醞醣醫醬醮醯醴釀釁采釉釋里重野量釐金釗釘釜針釣釦釧釵釷鈉鈍鈔鈕鈞鈣鈴鈷鈸鈺鈾鉀鉅鉉鉑鉗鉚鉛鉞鉤鉬鉸鉻銀銃銅銓銖銘銜銥銨銫銳銷銼鋁鋅鋆鋒鋤鋪鋰鋸鋼錄錐錒錕錘錚錠錡錢錦錨錫錮錯錳錶鍊鍋鍍鍛鍥鍬鍰鍱鍵鍶鍼鍾鎂鎊鎌鎖鎗鎚鎡鎧鎩鎬鎮鎳鏈鏖鏗鏘鏞鏟鏡鏢鏤鏽鐘鐙鐮鐵鐸鑄鑊鑑鑒鑣鑫鑰鑱鑲鑷鑼鑽鑾鑿長門閂閃閉開閏閑閒間閔閘閡閣閤閥閨閩閫閭閱閹閻閼閾闆闇闈闊闌闓闔闕闖關闞闡闢阜阡阪阮阱防阻阽阿陀陂附陋陌降限陛陝陞陟陡院陣除陪陰陲陳陵陶陷陸陽隄隅隆隈隊隋隍階隔隕隗隘隙際障隧隨險隱隴隸隹隻隼雀雁雄雅集雇雉雋雌雍雎雒雕雖雘雙雛雜雞離難雨雪雯雰雲零雷雹電需霄霆震霉霍霎霏霑霓霖霙霜霞霧霨霰露霸霹霽霾靂靄靈青靖靚靛靜非靠靡面靨革靳靴靶靼鞅鞋鞍鞏鞘鞠鞣鞭韁韃韋韌韓韜韞韭音韶韻響頁頂頃項順須頊頌頏預頑頒頓頗領頜頡頤頦頭頰頷頸頹頻顆題額顎顏顒顓願顙顛類顥顧顫顯顱風颯颱颶飄飆飛食飢飩飪飭飯飲飴飼飽飾餅餉養餌餐餒餓餘餚餛餞餡館餬餵餽餾饅饈饋饌饑饒饕饗首馗香馥馨馬馭馮馳馴駁駐駒駕駙駛駝駭駱駿騁騎騏騑騙騧騫騰騷騾驁驃驄驅驊驍驕驗驚驛驟驢驤驩驪骨骰骷骸骼髀髏髒髓體髖高髦髮髯髻鬃鬆鬍鬘鬚鬟鬣鬥鬧鬩鬯鬱鬲鬻鬼魁魂魄魅魋魏魔魚魨魯魴魷鮆鮑鮚鮠鮨鮪鮫鮭鮮鮸鯁鯉鯊鯔鯖鯛鯡鯧鯨鯰鯽鰈鰍鰓鰨鰭鰲鰻鱄鱈鱔鱗鱘鱠鱧鱨鱷鱸鱺鳥鳩鳳鳴鳶鴉鴒鴛鴞鴦鴨鴻鴿鵝鵠鵡鵪鵬鵰鵲鶉鶩鶯鶴鶿鷗鷳鷸鷹鷺鸕鸚鸛鸞鹵鹹鹼鹽鹿麂麇麋麒麓麗麝麟麥麩麴麵麻麼麾黃黎黏黑黔默黛黜點黠黧黨黯黴黷黼鼎鼐鼓鼠鼬鼻齊齋齒齡齣齦齧龍龐龔龕龜龢',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ "
},
'zh_sim_g1':{
'filename': 'chinese_sim.pth',
'model_script': 'chinese_sim',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/chinese_sim.zip',
'filesize': '0e19a9d5902572e5237b04ee29bdb636',
'characters': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ一丁七万丈三上下不与丐丑专且丕世丘丙业丛东丝丞丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乒乓乔乖乘乙乜九乞也习乡书乩买乱乳乾了予争事二亍于亏云互亓五井亘亚些亟亡亢交亥亦产亨亩享京亭亮亲亳亵人亿什仁仂仃仄仅仆仇仉今介仍从仑仓仔仕他仗付仙仞仟仡代令以仨仪仫们仰仲仳仵件价任份仿企伉伊伍伎伏伐休众优伙会伛伞伟传伢伤伦伧伪伫伯估伴伶伸伺似伽佃但位低住佐佑体何佗佘余佚佛作佝佞佟你佣佤佥佩佬佯佰佳佴佶佻佼佾使侃侄侈侉例侍侏侑侔侗供依侠侣侥侦侧侨侩侪侬侮侯侵便促俄俅俊俎俏俐俑俗俘俚俜保俞俟信俣俦俨俩俪俭修俯俱俳俸俺俾倌倍倏倒倔倘候倚倜借倡倥倦倨倩倪倬倭债值倾偃假偈偌偎偏偕做停健偬偶偷偻偾偿傀傅傈傍傣傥傧储傩催傲傻像僖僚僦僧僬僭僮僳僵僻儆儇儋儒儡儿兀允元兄充兆先光克免兑兔兕兖党兜兢入全八公六兮兰共关兴兵其具典兹养兼兽冀冁内冈冉册再冒冕冗写军农冠冢冤冥冬冯冰冱冲决况冶冷冻冼冽净凄准凇凉凋凌减凑凛凝几凡凤凫凭凯凰凳凶凸凹出击凼函凿刀刁刃分切刈刊刍刎刑划刖列刘则刚创初删判刨利别刭刮到刳制刷券刹刺刻刽刿剀剁剂剃削剌前剐剑剔剖剜剞剡剥剧剩剪副割剽剿劁劂劈劐劓力劝办功加务劢劣动助努劫劬劭励劲劳劾势勃勇勉勋勐勒勖勘募勤勰勺勾勿匀包匆匈匍匏匐匕化北匙匝匠匡匣匦匪匮匹区医匾匿十千卅升午卉半华协卑卒卓单卖南博卜卞卟占卡卢卣卤卦卧卫卮卯印危即却卵卷卸卺卿厂厄厅历厉压厌厍厕厘厚厝原厢厣厥厦厨厩厮去县叁参又叉及友双反发叔取受变叙叛叟叠口古句另叨叩只叫召叭叮可台叱史右叵叶号司叹叻叼叽吁吃各吆合吉吊同名后吏吐向吒吓吕吗君吝吞吟吠吡吣否吧吨吩含听吭吮启吱吲吴吵吸吹吻吼吾呀呃呆呈告呋呐呓呔呕呖呗员呙呛呜呢呤呦周呱呲味呵呶呷呸呻呼命咀咂咄咆咋和咎咏咐咒咔咕咖咙咚咛咝咣咤咦咧咨咩咪咫咬咭咯咱咳咴咸咻咽咿哀品哂哄哆哇哈哉哌响哎哏哐哑哓哔哕哗哙哚哝哞哟哥哦哧哨哩哪哭哮哲哳哺哼哽哿唁唆唇唉唏唐唑唔唛唠唢唣唤唧唪唬售唯唱唳唷唼唾唿啁啃啄商啉啊啐啕啖啜啡啤啥啦啧啪啬啭啮啵啶啷啸啻啼啾喀喁喂喃善喇喈喉喊喋喏喑喔喘喙喜喝喟喧喱喳喵喷喹喻喽喾嗄嗅嗉嗌嗍嗑嗒嗓嗔嗖嗜嗝嗟嗡嗣嗤嗥嗦嗨嗪嗫嗬嗯嗲嗳嗵嗷嗽嗾嘀嘁嘈嘉嘌嘎嘏嘘嘛嘞嘟嘣嘤嘧嘬嘭嘱嘲嘴嘶嘹嘻嘿噌噍噎噔噗噙噜噢噤器噩噪噫噬噱噶噻噼嚅嚆嚎嚏嚓嚣嚯嚷嚼囊囔囚四囝回囟因囡团囤囫园困囱围囵囹固国图囿圃圄圆圈圉圊圜土圣在圩圪圬圭圮圯地圳圹场圻圾址坂均坊坌坍坎坏坐坑块坚坛坜坝坞坟坠坡坤坦坨坩坪坫坭坯坳坷坻坼垂垃垄垅垆型垌垒垓垛垠垡垢垣垤垦垧垩垫垭垮垲垸埂埃埋城埏埒埔埕埘埙埚埝域埠埤埭埯埴埸培基埽堂堆堇堋堍堑堕堙堞堠堡堤堪堰堵塄塌塍塑塔塘塞塥填塬塾墀墁境墅墉墒墓墙增墟墨墩墼壁壅壑壕壤士壬壮声壳壶壹处备复夏夔夕外夙多夜够夤夥大天太夫夭央夯失头夷夸夹夺夼奁奂奄奇奈奉奋奎奏契奔奕奖套奘奚奠奢奥女奴奶奸她好妁如妃妄妆妇妈妊妍妒妓妖妗妙妞妣妤妥妨妩妪妫妮妯妲妹妻妾姆姊始姐姑姒姓委姗姘姚姜姝姣姥姨姬姹姻姿威娃娄娅娆娇娈娉娌娑娓娘娜娟娠娣娥娩娱娲娴娶娼婀婆婉婊婕婚婢婧婪婴婵婶婷婺婿媒媚媛媪媲媳媵媸媾嫁嫂嫉嫌嫒嫔嫖嫘嫜嫠嫡嫣嫦嫩嫫嫱嬉嬖嬗嬴嬷孀子孑孓孔孕字存孙孚孛孜孝孟孢季孤孥学孩孪孬孰孱孳孵孺孽宁它宄宅宇守安宋完宏宓宕宗官宙定宛宜宝实宠审客宣室宥宦宪宫宰害宴宵家宸容宽宾宿寂寄寅密寇富寐寒寓寝寞察寡寤寥寨寮寰寸对寺寻导寿封射将尉尊小少尔尕尖尘尚尜尝尤尥尧尬就尴尸尹尺尻尼尽尾尿局屁层居屈屉届屋屎屏屐屑展屙属屠屡屣履屦屯山屹屺屿岁岂岈岌岍岐岑岔岖岗岘岙岚岛岢岣岩岫岬岭岱岳岵岷岸岿峁峄峋峒峙峡峤峥峦峨峪峭峰峻崂崃崆崇崎崔崖崛崞崤崦崧崩崭崮崴崽嵇嵊嵋嵌嵘嵛嵝嵩嵫嵬嵯嵴嶂嶙嶝嶷巅巍川州巡巢工左巧巨巩巫差巯己已巳巴巷巽巾币市布帅帆师希帏帐帑帔帕帖帘帙帚帛帜帝带帧席帮帱帷常帻帼帽幂幄幅幌幔幕幛幞幡幢干平年并幸幺幻幼幽广庀庄庆庇床庋序庐庑库应底庖店庙庚府庞废庠庥度座庭庳庵庶康庸庹庾廉廊廒廓廖廛廨廪延廷建廿开弁异弃弄弈弊弋式弑弓引弗弘弛弟张弥弦弧弩弭弯弱弹强弼彀归当录彖彗彘彝形彤彦彩彪彬彭彰影彳彷役彻彼往征徂径待徇很徉徊律後徐徒徕得徘徙徜御徨循徭微徵德徼徽心必忆忉忌忍忏忐忑忒忖志忘忙忝忠忡忤忧忪快忭忮忱念忸忻忽忾忿怀态怂怃怄怅怆怊怍怎怏怒怔怕怖怙怛怜思怠怡急怦性怨怩怪怫怯怵总怼怿恁恂恃恋恍恐恒恕恙恚恝恢恣恤恧恨恩恪恫恬恭息恰恳恶恸恹恺恻恼恽恿悃悄悉悌悍悒悔悖悚悛悝悟悠患悦您悫悬悭悯悱悲悴悸悻悼情惆惊惋惑惕惘惚惜惝惟惠惦惧惨惩惫惬惭惮惯惰想惴惶惹惺愀愁愆愈愉愍愎意愕愚感愠愣愤愦愧愫愿慈慊慌慎慑慕慝慢慧慨慰慵慷憋憎憔憝憧憨憩憬憷憾懂懈懊懋懑懒懦懵懿戆戈戊戋戌戍戎戏成我戒戕或戗战戚戛戟戡戢戥截戬戮戳戴户戽戾房所扁扃扇扈扉手扌才扎扑扒打扔托扛扣扦执扩扪扫扬扭扮扯扰扳扶批扼找承技抄抉把抑抒抓投抖抗折抚抛抟抠抡抢护报抨披抬抱抵抹抻押抽抿拂拄担拆拇拈拉拊拌拍拎拐拒拓拔拖拗拘拙拚招拜拟拢拣拥拦拧拨择括拭拮拯拱拳拴拶拷拼拽拾拿持挂指挈按挎挑挖挚挛挝挞挟挠挡挢挣挤挥挨挪挫振挲挹挺挽捂捃捅捆捉捋捌捍捎捏捐捕捞损捡换捣捧捩捭据捱捶捷捺捻掀掂掇授掉掊掌掎掏掐排掖掘掠探掣接控推掩措掬掭掮掰掳掴掷掸掺掼掾揄揆揉揍揎描提插揖揞揠握揣揩揪揭援揶揸揽揿搀搁搂搅搋搌搏搐搓搔搛搜搞搠搡搦搪搬搭搴携搽摁摄摅摆摇摈摊摒摔摘摞摧摩摭摸摹摺撂撄撅撇撑撒撕撖撙撞撤撩撬播撮撰撵撷撸撺撼擀擂擅操擎擐擒擘擞擢擤擦攀攉攒攘攥攫攮支收攸改攻放政故效敉敌敏救敕敖教敛敝敞敢散敦敫敬数敲整敷文斋斌斐斑斓斗料斛斜斟斡斤斥斧斩斫断斯新方於施旁旃旄旅旆旋旌旎族旒旖旗无既日旦旧旨早旬旭旮旯旰旱时旷旺昀昂昃昆昊昌明昏易昔昕昙昝星映春昧昨昭是昱昴昵昶昼显晁晃晋晌晏晒晓晔晕晖晗晚晟晡晤晦晨普景晰晴晶晷智晾暂暄暇暌暑暖暗暝暧暨暮暴暹暾曙曛曜曝曦曩曰曲曳更曷曹曼曾替最月有朊朋服朐朔朕朗望朝期朦木未末本札术朱朴朵机朽杀杂权杆杈杉杌李杏材村杓杖杜杞束杠条来杨杪杭杯杰杲杳杵杷杼松板极构枇枉枋析枕林枘枚果枝枞枢枣枥枧枨枪枫枭枯枰枳枵架枷枸柁柃柄柏某柑柒染柔柘柙柚柜柝柞柠柢查柩柬柯柰柱柳柴柽柿栀栅标栈栉栊栋栌栎栏树栓栖栗栝校栩株栲栳样核根格栽栾桀桁桂桃桄桅框案桉桊桌桎桐桑桓桔桕桠桡桢档桤桥桦桧桨桩桫桴桶桷梁梃梅梆梏梓梗梢梦梧梨梭梯械梳梵检棂棉棋棍棒棕棘棚棠棣森棰棱棵棹棺棼椁椅椋植椎椐椒椟椠椤椭椰椴椹椽椿楂楔楗楚楝楞楠楣楦楫楮楷楸楹楼榀概榄榆榇榈榉榍榔榕榛榜榧榨榫榭榱榴榷榻槁槊槌槎槐槔槛槟槠槭槲槽槿樊樗樘樟模樨横樯樱樵樽樾橄橇橐橘橙橛橡橥橱橹橼檀檄檎檐檑檗檠檩檫檬欠次欢欣欤欧欲欷欺款歃歆歇歉歌歙止正此步武歧歪歹死歼殁殂殃殄殆殇殉殊残殍殒殓殖殚殛殡殪殳殴段殷殿毁毂毅毋母每毒毓比毕毖毗毙毛毡毪毫毯毳毵毹毽氅氆氇氍氏氐民氓气氕氖氘氙氚氛氟氡氢氤氦氧氨氩氪氮氯氰氲水永氽汀汁求汆汇汉汊汐汔汕汗汛汜汝汞江池污汤汨汩汪汰汲汴汶汹汽汾沁沂沃沅沆沈沉沌沏沐沓沔沙沛沟没沣沤沥沦沧沩沪沫沭沮沱河沸油治沼沽沾沿泄泅泉泊泌泐泓泔法泖泗泛泞泠泡波泣泥注泪泫泮泯泰泱泳泵泷泸泺泻泼泽泾洁洄洇洋洌洎洒洗洙洚洛洞津洧洪洫洮洱洲洳洵洹活洼洽派流浃浅浆浇浈浊测浍济浏浑浒浓浔浙浚浜浞浠浣浦浩浪浮浯浴海浸浼涂涅消涉涌涎涑涓涔涕涛涝涞涟涠涡涣涤润涧涨涩涪涫涮涯液涵涸涿淀淄淅淆淇淋淌淑淖淘淙淝淞淠淡淤淦淫淬淮深淳混淹添淼清渊渌渍渎渐渑渔渖渗渚渝渠渡渣渤渥温渫渭港渲渴游渺湃湄湍湎湔湖湘湛湟湫湮湾湿溃溅溆溉溏源溘溜溟溢溥溧溪溯溱溲溴溶溷溺溻溽滁滂滇滋滏滑滓滔滕滗滚滞滟滠满滢滤滥滦滨滩滴滹漂漆漉漏漓演漕漠漤漩漪漫漭漯漱漳漶漾潆潇潋潍潘潜潞潢潦潭潮潲潴潸潺潼澄澈澉澌澍澎澜澡澧澳澶澹激濂濉濑濒濞濠濡濮濯瀑瀚瀛瀣瀵瀹灌灏灞火灭灯灰灵灶灸灼灾灿炀炅炉炊炎炒炔炕炖炙炜炝炫炬炭炮炯炱炳炷炸点炻炼炽烀烁烂烃烈烊烘烙烛烟烤烦烧烨烩烫烬热烯烷烹烽焉焊焐焓焕焖焘焙焚焦焯焰焱然煅煊煌煎煜煞煤煦照煨煮煲煳煸煺煽熄熊熏熔熘熙熟熠熨熬熵熹燃燎燔燕燠燥燧燮燹爆爝爨爪爬爰爱爵父爷爸爹爻爽爿片版牌牍牒牖牙牛牝牟牡牢牦牧物牮牯牲牵特牺牾犀犁犄犊犋犍犏犒犟犬犯犰犴状犷犸犹狁狂狃狄狈狍狎狐狒狗狙狞狠狡狨狩独狭狮狯狰狱狲狳狴狷狸狺狻狼猁猃猊猎猕猖猗猛猜猝猞猡猢猥猩猪猫猬献猱猴猷猸猹猾猿獍獐獒獗獠獬獭獯獾玄率玉王玎玑玖玛玢玩玫玮环现玲玳玷玺玻珀珂珈珉珊珍珏珐珑珙珞珠珥珧珩班珲球琅理琉琏琐琚琛琢琥琦琨琪琬琮琰琳琴琵琶琼瑁瑕瑗瑙瑚瑛瑜瑞瑟瑭瑰瑶瑾璀璁璃璇璋璎璐璜璞璧璨璩瓒瓜瓞瓠瓢瓣瓤瓦瓮瓯瓴瓶瓷瓿甄甏甑甓甘甙甚甜生甥用甩甫甬甭田由甲申电男甸町画甾畀畅畈畋界畎畏畔留畚畛畜略畦番畲畴畸畹畿疃疆疋疏疑疔疖疗疙疚疝疟疠疡疣疤疥疫疬疮疯疰疱疲疳疴疵疸疹疼疽疾痂痃痄病症痈痉痊痍痒痔痕痘痛痞痢痣痤痦痧痨痪痫痰痱痴痹痼痿瘀瘁瘃瘅瘊瘌瘐瘗瘘瘙瘛瘟瘠瘢瘤瘥瘦瘩瘪瘫瘭瘰瘳瘴瘵瘸瘼瘾瘿癀癃癌癍癔癖癜癞癣癫癯癸登白百皂的皆皇皈皋皎皑皓皖皙皤皮皱皲皴皿盂盅盆盈益盍盎盏盐监盒盔盖盗盘盛盟盥目盯盱盲直相盹盼盾省眄眇眈眉看眍眙眚真眠眢眦眨眩眭眯眵眶眷眸眺眼着睁睃睇睐睑睚睛睡睢督睥睦睨睫睬睹睽睾睿瞀瞄瞅瞌瞍瞎瞑瞒瞟瞠瞢瞥瞧瞩瞪瞬瞰瞳瞵瞻瞽瞿矍矗矛矜矢矣知矧矩矫矬短矮石矶矸矽矾矿砀码砂砉砌砍砑砒研砖砗砘砚砜砝砟砣砥砧砭砰破砷砸砹砺砻砼砾础硅硇硌硎硐硒硕硖硗硝硪硫硬硭确硷硼碇碉碌碍碎碑碓碗碘碚碛碜碟碡碣碥碧碰碱碲碳碴碹碾磁磅磉磊磋磐磔磕磙磨磬磲磴磷磺礁礅礓礞礤礴示礻礼社祀祁祆祈祉祓祖祗祚祛祜祝神祟祠祢祥祧票祭祯祷祸祺禀禁禄禅禊福禚禧禳禹禺离禽禾秀私秃秆秉秋种科秒秕秘租秣秤秦秧秩秫秭积称秸移秽稀稂稆程稍税稔稗稚稞稠稣稳稷稻稼稽稿穆穑穗穰穴究穷穸穹空穿窀突窃窄窈窍窑窒窕窖窗窘窜窝窟窠窥窦窨窬窭窳窿立竖站竞竟章竣童竦竭端竹竺竽竿笃笄笆笈笊笋笏笑笔笕笙笛笞笠笤笥符笨笪笫第笮笱笳笸笺笼笾筅筇等筋筌筏筐筑筒答策筘筚筛筝筠筢筮筱筲筵筷筹筻签简箅箍箐箔箕算箜管箢箦箧箨箩箪箫箬箭箱箴箸篁篆篇篌篑篓篙篚篝篡篥篦篪篮篱篷篼篾簇簋簌簏簖簟簦簧簪簸簿籀籁籍米籴类籼籽粉粑粒粕粗粘粜粝粞粟粤粥粪粮粱粲粳粹粼粽精糁糅糇糈糊糌糍糕糖糗糙糜糟糠糨糯系紊素索紧紫累絮絷綦綮縻繁繇纂纛纠纡红纣纤纥约级纨纩纪纫纬纭纯纰纱纲纳纵纶纷纸纹纺纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绗绘给绚绛络绝绞统绠绡绢绣绥绦继绨绩绪绫续绮绯绰绲绳维绵绶绷绸绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缌缎缏缑缒缓缔缕编缗缘缙缚缛缜缝缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵缶缸缺罂罄罅罐网罔罕罗罘罚罟罡罢罨罩罪置罱署罴罹罾羁羊羌美羔羚羝羞羟羡群羧羯羰羲羸羹羼羽羿翁翅翊翌翎翔翕翘翟翠翡翥翦翩翮翰翱翳翻翼耀老考耄者耆耋而耍耐耒耔耕耖耗耘耙耜耠耢耥耦耧耨耩耪耱耳耵耶耷耸耻耽耿聂聃聆聊聋职聍聒联聘聚聩聪聱聿肃肄肆肇肉肋肌肓肖肘肚肛肝肟肠股肢肤肥肩肪肫肭肮肯肱育肴肷肺肼肽肾肿胀胁胂胃胄胆背胍胎胖胗胙胚胛胜胝胞胡胤胥胧胨胩胪胫胬胭胯胰胱胲胳胴胶胸胺胼能脂脆脉脊脍脎脏脐脑脒脓脔脖脘脚脞脬脯脱脲脶脸脾腆腈腊腋腌腐腑腓腔腕腙腚腠腥腧腩腭腮腰腱腴腹腺腻腼腽腾腿膀膂膈膊膏膑膘膛膜膝膦膨膪膳膺膻臀臁臂臃臆臊臌臣臧自臬臭至致臻臼臾舀舁舂舄舅舆舌舍舐舒舔舛舜舞舟舡舢舣舨航舫般舰舱舳舴舵舶舷舸船舻舾艄艇艋艘艚艟艨艮良艰色艳艴艺艽艾艿节芄芈芊芋芍芎芏芑芒芗芘芙芜芝芟芡芥芦芨芩芪芫芬芭芮芯芰花芳芴芷芸芹芽芾苁苄苇苈苊苋苌苍苎苏苑苒苓苔苕苗苘苛苜苞苟苠苡苣苤若苦苫苯英苴苷苹苻茁茂范茄茅茆茈茉茌茎茏茑茔茕茗茚茛茜茧茨茫茬茭茯茱茳茴茵茶茸茹茼荀荃荆荇草荏荐荑荒荔荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭药荷荸荻荼荽莅莆莉莎莒莓莘莛莜莞莠莨莩莪莫莰莱莲莳莴莶获莸莹莺莼莽菀菁菅菇菊菌菏菔菖菘菜菝菟菠菡菥菩菪菰菱菲菹菽萁萃萄萋萌萍萎萏萑萘萜萝萤营萦萧萨萱萸萼落葆葑著葚葛葜葡董葩葫葬葭葱葳葵葶葸葺蒂蒇蒈蒉蒋蒌蒎蒗蒙蒜蒡蒯蒲蒴蒸蒹蒺蒽蒿蓁蓄蓉蓊蓍蓐蓑蓓蓖蓝蓟蓠蓣蓥蓦蓬蓰蓼蓿蔌蔑蔓蔗蔚蔟蔡蔫蔬蔷蔸蔹蔺蔻蔼蔽蕃蕈蕉蕊蕖蕙蕞蕤蕨蕲蕴蕹蕺蕻蕾薄薅薇薏薛薜薤薨薪薮薯薰薷薹藁藉藏藐藓藕藜藤藩藻藿蘅蘑蘖蘧蘩蘸蘼虎虏虐虑虔虚虞虢虫虬虮虱虹虺虻虼虽虾虿蚀蚁蚂蚊蚋蚌蚍蚓蚕蚜蚝蚣蚤蚧蚨蚩蚬蚯蚰蚱蚴蚶蚺蛀蛄蛆蛇蛉蛊蛋蛎蛏蛐蛑蛔蛘蛙蛛蛞蛟蛤蛩蛭蛮蛰蛱蛲蛳蛴蛸蛹蛾蜀蜂蜃蜇蜈蜉蜊蜍蜒蜓蜕蜗蜘蜚蜜蜞蜡蜢蜣蜥蜩蜮蜱蜴蜷蜻蜾蜿蝇蝈蝉蝌蝎蝓蝗蝙蝠蝣蝤蝥蝮蝰蝴蝶蝻蝼蝽蝾螂螃螅螈螋融螗螟螨螫螬螭螯螳螵螺螽蟀蟆蟊蟋蟑蟒蟛蟠蟥蟪蟮蟹蟾蠃蠊蠓蠕蠖蠡蠢蠲蠹蠼血衄衅行衍衔街衙衡衢衣补表衩衫衬衮衰衲衷衽衾衿袁袂袄袅袈袋袍袒袖袜袢袤被袭袱袼裁裂装裆裉裎裒裔裕裘裙裟裢裣裤裥裨裰裱裳裴裸裹裼裾褂褊褐褒褓褙褚褛褡褥褪褫褰褴褶襁襄襞襟襦襻西要覃覆见观规觅视觇览觉觊觋觌觎觏觐觑角觖觚觜觞解觥触觫觯觳言訇訾詈詹誉誊誓謇警譬计订讣认讥讦讧讨让讪讫训议讯记讲讳讴讵讶讷许讹论讼讽设访诀证诂诃评诅识诈诉诊诋诌词诎诏译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诫诬语诮误诰诱诲诳说诵请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谙谚谛谜谝谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豁豆豇豉豌豕豚象豢豪豫豳豸豹豺貂貅貉貊貌貔貘贝贞负贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赓赔赖赘赙赚赛赜赝赞赠赡赢赣赤赦赧赫赭走赳赴赵赶起趁趄超越趋趑趔趟趣趱足趴趵趸趺趼趾趿跃跄跆跋跌跎跏跑跖跗跚跛距跞跟跣跤跨跪跬路跳践跷跸跹跺跻跽踅踉踊踌踏踔踝踞踟踢踣踩踪踬踮踯踱踵踹踺踽蹀蹁蹂蹄蹇蹈蹉蹊蹋蹑蹒蹙蹦蹩蹬蹭蹯蹰蹲蹴蹶蹼蹿躁躅躇躏躐躔躜躞身躬躯躲躺车轧轨轩轫转轭轮软轰轱轲轳轴轵轶轷轸轺轻轼载轾轿辁辂较辄辅辆辇辈辉辊辋辍辎辏辐辑输辔辕辖辗辘辙辚辛辜辞辟辣辨辩辫辰辱边辽达迁迂迄迅过迈迎运近迓返迕还这进远违连迟迢迤迥迦迨迩迪迫迭迮述迷迸迹追退送适逃逄逅逆选逊逋逍透逐逑递途逖逗通逛逝逞速造逡逢逦逭逮逯逵逶逸逻逼逾遁遂遄遇遍遏遐遑遒道遗遘遛遢遣遥遨遭遮遴遵遽避邀邂邃邈邋邑邓邕邗邙邛邝邡邢那邦邪邬邮邯邰邱邳邴邵邶邸邹邺邻邾郁郄郅郇郊郎郏郐郑郓郗郛郜郝郡郢郦郧部郫郭郯郴郸都郾鄂鄄鄙鄞鄢鄣鄯鄱鄹酃酆酉酊酋酌配酎酏酐酒酗酚酝酞酡酢酣酤酥酩酪酬酮酯酰酱酲酴酵酶酷酸酹酽酾酿醅醇醉醋醌醍醐醑醒醚醛醢醪醭醮醯醴醵醺采釉释里重野量金釜鉴銎銮鋈錾鍪鎏鏊鏖鐾鑫钆钇针钉钊钋钌钍钎钏钐钒钓钔钕钗钙钚钛钜钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钷钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铌铍铎铐铑铒铕铗铘铙铛铜铝铞铟铠铡铢铣铤铥铧铨铩铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锎锏锐锑锒锓锔锕锖锗锘错锚锛锝锞锟锡锢锣锤锥锦锨锩锪锫锬锭键锯锰锱锲锴锵锶锷锸锹锺锻锾锿镀镁镂镄镅镆镇镉镊镌镍镎镏镐镑镒镓镔镖镗镘镛镜镝镞镡镢镣镤镥镦镧镨镩镪镫镬镭镯镰镱镲镳镶长门闩闪闫闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾阀阁阂阃阄阅阆阈阉阊阋阌阍阎阏阐阑阒阔阕阖阗阙阚阜队阡阢阪阮阱防阳阴阵阶阻阼阽阿陀陂附际陆陇陈陉陋陌降限陔陕陛陟陡院除陧陨险陪陬陲陴陵陶陷隅隆隈隋隍随隐隔隗隘隙障隧隰隳隶隼隽难雀雁雄雅集雇雉雌雍雎雏雒雕雠雨雩雪雯雳零雷雹雾需霁霄霆震霈霉霍霎霏霓霖霜霞霪霭霰露霸霹霾青靓靖静靛非靠靡面靥革靳靴靶靼鞅鞋鞍鞑鞒鞘鞠鞣鞫鞭鞯鞲鞴韦韧韩韪韫韬韭音韵韶页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颌颍颏颐频颓颔颖颗题颚颛颜额颞颟颠颡颢颤颥颦颧风飑飒飓飕飘飙飚飞食飧飨餍餐餮饔饕饥饧饨饩饪饫饬饭饮饯饰饱饲饴饵饶饷饺饼饽饿馀馁馄馅馆馇馈馊馋馍馏馐馑馒馓馔馕首馗馘香馥馨马驭驮驯驰驱驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骄骅骆骇骈骊骋验骏骐骑骒骓骖骗骘骚骛骜骝骞骟骠骡骢骣骤骥骧骨骰骶骷骸骺骼髀髁髂髅髋髌髑髓高髡髦髫髭髯髹髻鬃鬈鬏鬓鬟鬣鬯鬲鬻鬼魁魂魃魄魅魇魈魉魍魏魑魔鱼鱿鲁鲂鲅鲆鲇鲈鲋鲍鲎鲐鲑鲔鲚鲛鲜鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲷鲸鲺鲻鲼鲽鳃鳄鳅鳆鳇鳊鳌鳍鳎鳏鳐鳓鳔鳕鳖鳗鳘鳙鳜鳝鳞鳟鳢鸟鸠鸡鸢鸣鸥鸦鸨鸩鸪鸫鸬鸭鸯鸱鸲鸳鸵鸶鸷鸸鸹鸺鸽鸾鸿鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹎鹏鹑鹕鹗鹘鹚鹛鹜鹞鹣鹤鹦鹧鹨鹩鹪鹫鹬鹭鹰鹱鹳鹿麂麇麈麋麒麓麝麟麦麸麻麽麾黄黉黍黎黏黑黔默黛黜黝黟黠黢黥黧黩黯黹黻黼黾鼋鼍鼎鼐鼓鼗鼙鼠鼢鼬鼯鼷鼹鼻鼾齐齑齿龀龃龄龅龆龇龈龉龊龋龌龙龚龛龟龠",
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ "
},
'japanese_g1':{
'filename': 'japanese.pth',
'model_script': 'japanese',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/japanese.zip',
'filesize': '6d891a4aad9cb7f492809515e4e9fd2e',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろわゐをんゝゞァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶ・ー一丁七万丈三上下不与丑且世丘丙丞両並中串丸丹主乃久之乍乎乏乗乙九乞也乱乳乾亀了予争事二云互五井亘亙亜亡交亥亦亨享京亭亮人什仁仇今介仏仔仕他付仙代令以仮仰仲件任企伊伍伎伏伐休会伝伯伴伶伸伺似伽佃但位低住佐佑体何余作佳併佼使侃例侍供依侠価侮侯侵侶便係促俄俊俗保信俣修俳俵俸俺倉個倍倒倖候借倣値倦倫倭倶倹偉偏停健偲側偵偶偽傍傑傘備催傭債傷傾僅働像僑僕僚僧僻儀億儒償優儲允元兄充兆兇先光克免兎児党兜入全八公六共兵其具典兼内円冊再冒冗写冠冥冨冬冴冶冷凄准凋凌凍凝凡処凪凱凶凸凹出函刀刃分切刈刊刑列初判別利到制刷券刺刻剃則削前剖剛剣剤剥副剰割創劃劇劉力功加劣助努励労効劾勃勅勇勉動勘務勝募勢勤勧勲勾勿匁匂包化北匝匠匡匹区医匿十千升午半卑卒卓協南単博卜占卯印危即却卵卸卿厄厘厚原厨厩厭厳去参又叉及友双反収叔取受叙叛叡叢口古句叩只叫召可台叱史右叶号司吃各合吉吊同名后吏吐向君吟吠否含吸吹吻吾呂呆呈呉告呑周呪味呼命咋和咲咳咽哀品哉員哨哲唄唆唇唐唯唱唾商問啓善喉喋喚喜喝喧喪喫喬喰営嗣嘆嘉嘗嘘嘩嘱噂噌噛器噴嚇嚢囚四回因団困囲図固国圃圏園土圧在圭地坂均坊坐坑坦坪垂型垢垣埋城埜域埠埴執培基埼堀堂堅堆堕堤堪堰報場堵堺塀塁塊塑塔塗塘塚塞塩填塵塾境墓増墜墨墳墾壁壇壊壌壕士壬壮声壱売壷変夏夕外多夜夢大天太夫央失夷奄奇奈奉奏契奔套奥奨奪奮女奴好如妃妄妊妓妖妙妥妨妬妹妻妾姉始姐姑姓委姥姦姪姫姶姻姿威娃娘娠娩娯娼婁婆婚婦婿媒媛嫁嫉嫌嫡嬉嬢嬰子孔字存孜孝孟季孤学孫宅宇守安宋完宍宏宕宗官宙定宛宜宝実客宣室宥宮宰害宴宵家容宿寂寄寅密富寒寓寛寝察寡寧審寮寵寸寺対寿封専射将尉尊尋導小少尖尚尤尭就尺尻尼尽尾尿局居屈届屋屍屑展属屠層履屯山岐岡岩岬岱岳岸峠峡峨峯峰島峻崇崎崖崩嵐嵩嵯嶋嶺巌川州巡巣工左巧巨差己巳巴巷巻巽巾市布帆希帖帝帥師席帯帰帳常帽幅幌幕幡幣干平年幸幹幻幼幽幾庁広庄庇床序底店庚府度座庫庭庵庶康庸廃廉廊廓廟廠延廷建廻廼廿弁弄弊式弐弓弔引弘弛弟弥弦弧弱張強弼弾彊当形彦彩彪彫彬彰影役彼往征径待律後徐徒従得御復循微徳徴徹徽心必忌忍志忘忙応忠快念忽怒怖怜思怠急性怨怪怯恋恐恒恕恢恥恨恩恭息恰恵悉悌悔悟悠患悦悩悪悲悶悼情惇惑惚惜惟惣惨惰想惹愁愉意愚愛感慈態慌慎慕慢慣慧慨慮慰慶憂憎憐憤憧憩憲憶憾懇懐懲懸戊戎成我戒或戚戟戦戯戴戸戻房所扇扉手才打払托扮扱扶批承技抄把抑投抗折抜択披抱抵抹押抽担拍拐拒拓拘拙招拝拠拡括拭拳拶拷拾持指按挑挙挟挨挫振挺挽挿捉捌捕捗捜捧捨据捲捷捻掃授掌排掘掛掠採探接控推掩措掲掴掻揃描提揖揚換握揮援揺損搬搭携搾摂摘摩摸摺撃撒撤撫播撮撰撲撹擁操擢擦擬擾支改攻放政故敏救敗教敢散敦敬数整敵敷文斉斌斎斐斑斗料斜斡斤斥斧斬断斯新方於施旅旋族旗既日旦旧旨早旬旭旺昂昆昇昌明昏易昔星映春昧昨昭是昼時晃晋晒晦晩普景晴晶智暁暇暑暖暗暢暦暫暮暴曇曙曜曝曲曳更書曹曽曾替最月有朋服朔朕朗望朝期木未末本札朱朴机朽杉李杏材村杖杜束条来杭杯東杵松板析枕林枚果枝枠枢枯架柄柊柏某柑染柔柘柚柱柳柴柵査柿栂栃栄栓栖栗校栢株核根格栽桁桂桃案桐桑桓桔桜桝桟桧桶梁梅梓梗梢梧梨梯械梱梶梼棄棋棒棚棟森棲棺椀椅椋植椎椙検椿楊楓楕楚楠楢業楯極楼楽概榊榎榛構槌槍様槙槻槽樋標樟模権横樫樵樹樺樽橋橘機橡橿檀檎櫓櫛欄欠次欣欧欲欺欽款歌歓止正此武歩歪歯歳歴死殆殉殊残殖殴段殺殻殿毅母毎毒比毘毛氏民気水氷永氾汀汁求汎汐汗汚汝江池汰汲決汽沃沈沌沓沖沙没沢沫河沸油治沼沿況泉泊泌法泡波泣泥注泰泳洋洗洛洞津洩洪洲活派流浄浅浜浦浩浪浬浮浴海浸消涌涙涛涜涯液涼淀淑淘淡淫深淳淵混添清渇済渉渋渓渚減渠渡渥渦温測港湊湖湘湛湧湯湾湿満源準溜溝溢溶溺滅滋滑滝滞滴漁漂漆漉漏演漕漠漢漣漫漬漸潔潜潟潤潮潰澄澗澱激濁濃濠濡濫濯瀕瀞瀧瀬灘火灯灰灸灼災炉炊炎炭点為烈烏焔焚無焦然焼煉煎煙煤照煩煮煽熊熟熱燃燈燐燕燥燦燭爆爪爵父爺爽爾片版牌牒牙牛牝牟牡牢牧物牲特牽犀犠犬犯状狂狐狗狙狛狩独狭狸狼猛猟猪猫献猶猷猿獄獅獣獲玄率玉王玖玩玲珂珊珍珠珪班現球理琉琢琳琴琵琶瑚瑛瑞瑠瑳璃環璽瓜瓢瓦瓶甘甚甜生産甥用甫田由甲申男町画界畏畑畔留畜畝畠畢略番異畳畷畿疋疎疏疑疫疲疹疾病症痕痘痛痢痩痴療癌癒癖発登白百的皆皇皐皮皿盃盆盈益盗盛盟監盤目盲直相盾省眉看県真眠眺眼着睡督睦瞬瞭瞳矛矢知矩短矯石砂研砕砦砧砲破砺硝硫硬碁碍碑碓碕碗碧碩確磁磐磨磯礁礎示礼社祁祇祈祉祐祖祝神祢祥票祭祷禁禄禅禍禎福禰禽禾禿秀私秋科秒秘租秤秦秩称移稀程税稔稗稚稜種稲稼稽稿穀穂穆積穏穣穫穴究空穿突窃窄窒窓窟窪窮窯窺立竜章竣童竪端競竹竺竿笈笑笛笠符第笹筆筈等筋筑筒答策箇箕算管箪箭箱箸節範篇築篠篤篭簡簾簿籍米粉粋粒粕粗粘粛粟粥粧精糊糖糞糟糠糧糸系糾紀約紅紋納紐純紗紘紙級紛素紡索紫累細紳紹紺終組経結絞絡絢給統絵絶絹継続綜綬維綱網綴綻綾綿緊緋総緑緒線締編緩緯練縁縄縛縞縦縫縮績繁繊繋繍織繕繭繰纂纏缶罪置罰署罵罷羅羊美群羨義羽翁翌習翠翰翻翼耀老考者而耐耕耗耳耶耽聖聞聡聯聴職聾肇肉肋肌肖肘肝股肢肥肩肪肯育肴肺胃胆背胎胞胡胤胴胸能脂脅脆脇脈脊脚脱脳脹腎腐腔腕腫腰腸腹腺腿膏膚膜膝膨膳膿臆臓臣臥臨自臭至致臼興舌舎舗舘舛舜舞舟航般舵舶舷船艇艦良色艶芋芙芝芥芦芭芯花芳芸芹芽苅苑苔苗苛若苦苫英茂茄茅茎茜茨茶草荊荏荒荘荷荻莞莫莱菅菊菌菓菖菜菟菩華菰菱萄萌萎萩萱落葉葎著葛葡董葦葬葱葵葺蒋蒐蒔蒙蒜蒲蒸蒼蓄蓉蓋蓑蓬蓮蔑蔓蔚蔦蔭蔵蔽蕃蕉蕊蕗蕨蕩蕪薄薙薦薩薪薫薬薮藁藍藤藩藻蘇蘭虎虐虚虜虞虫虹虻蚊蚕蛇蛋蛍蛭蛮蛸蜂蜘蜜蝉蝋蝕蝦蝶融螺蟹蟻血衆行術街衛衝衡衣表衰衷衿袈袋袖被袴裁裂装裏裕補裟裡裳裸製裾複褐褒襖襟襲西要覆覇見規視覗覚覧親観角解触言訂計訊討訓託記訟訣訪設許訳訴診註証詐詔評詞詠詣試詩詫詮詰話該詳誇誉誌認誓誕誘語誠誤説読誰課誹誼調談請諌諏諒論諜諦諭諮諸諺諾謀謁謂謎謙講謝謡謬謹識譜警議譲護讃讐谷豆豊豚象豪豹貌貝貞負財貢貧貨販貫責貯貰貴買貸費貼貿賀賂賃賄資賊賑賓賛賜賞賠賢賦質賭購贈贋赤赦赫走赴起超越趣趨足距跡跨路跳践踊踏蹄蹟蹴躍身躯車軌軍軒軟転軸軽較載輔輝輩輪輯輸輿轄轍轟辛辞辰辱農辺辻込辿迂迄迅迎近返迦迫迭述迷追退送逃逆透逐逓途逗這通逝速造逢連逮週進逸逼遁遂遅遇遊運遍過道達違遜遠遡遣遥適遭遮遵遷選遺遼避還邑那邦邪邸郁郊郎郡部郭郵郷都鄭酉酋酌配酎酒酔酢酪酬酵酷酸醇醍醐醒醜醤醸采釈里重野量金釘釜針釣釧鈍鈴鈷鉄鉛鉢鉱鉾銀銃銅銑銘銚銭鋒鋪鋭鋲鋳鋸鋼錆錐錘錠錦錨錫錬錯録鍋鍔鍛鍬鍵鍾鎌鎖鎗鎚鎧鎮鏑鏡鐘鐸鑑鑓長門閃閉開閏閑間関閣閤閥閲闇闘阜阪防阻阿陀附降限陛院陣除陥陪陰陳陵陶陸険陽隅隆隈隊階随隔隙際障隠隣隷隻隼雀雁雄雅集雇雌雑雛離難雨雪雫雰雲零雷電需震霊霜霞霧露青靖静非面革靭靴鞄鞍鞘鞠鞭韓韮音韻響頁頂頃項順須預頑頒頓頗領頚頬頭頴頻頼題額顎顔顕願顛類顧風飛食飢飯飲飴飼飽飾餅養餌餐餓館饗首香馨馬馳馴駁駄駅駆駈駐駒駕駿騎騒験騨騰驚骨骸髄高髪髭鬼魁魂魅魔魚魯鮎鮒鮫鮭鮮鯉鯖鯨鰐鰭鰻鱒鱗鳥鳩鳳鳴鳶鴎鴛鴨鴻鵜鵠鵡鵬鶏鶴鷲鷹鷺鹸鹿麓麗麟麦麹麺麻麿黄黒黙黛鼎鼓鼠鼻齢龍'
},
'korean_g1':{
'filename': 'korean.pth',
'model_script': 'korean',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/korean.zip',
'filesize': '45b3300e0f04ce4d03dda9913b20c336',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZㆍ가각간갇갈갉감갑값갓갔강갖같갚개객갤갭갯갱갸걀거걱건걷걸검겁것겉게겐겔겟겠겨격겪견결겸겹겼경곁계고곡곤곧골곰곱곳공곶과곽관괄괌광괘괜괭괴괼굉교굘구국군굳굴굵굶굽굿궁궂궈권궐궤귀귄귈규균귤그극근글긁금급긋긍기긴길김깁깃깊까깍깎깐깔깜깝깡깥깨깬꺼꺾껄껌껍껏껐껑께껴꼈꼬꼭꼴꼼꼽꽁꽂꽃꽈꽉꽝꽤꾀꾸꾼꿀꿇꿈꿔꿨꿰뀌뀐뀔끄끈끊끌끓끔끗끝끼낀낄낌나낙낚난날낡남납낫났낭낮낯낱낳내낸낼냄냅냇냈냉냐냥너넉넌널넓넘넛넣네넥넨넬넵넷녀녁년념녔녕녘녜녠노녹논놀놈놉농높놓놔놨뇌뇨뇰뇽누눅눈눌눔눕눙눠뉘뉜뉴늄느늑는늘늙늠능늦늪늬니닉닌닐님닙닛닝다닥닦단닫달닭닮닳담답닷당닻닿대댁댄댈댐댑댓더덕던덜덟덤덥덧덩덫덮데덱덴델뎀뎅뎌뎬도독돈돋돌돔돕돗동돛돼됐되된될됨됩두둑둔둘둠둡둥둬뒀뒤뒷듀듈듐드득든듣들듬듭듯등디딕딘딛딜딥딧딩딪따딱딴딸땀땃땄땅때땐땡떠떡떤떨떻떼또똑똔똘똥뚜뚝뚫뚱뛰뛴뛸뜀뜨뜩뜬뜯뜰뜸뜻띄띈띠띤라락란랄람랍랏랐랑랗래랙랜랠램랩랫랬랭랴략랸량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄로록론롤롬롭롯롱롸뢰룀료룡루룩룬룰룸룹룻룽뤄뤘뤼뤽륀륄류륙륜률륨륭르륵른를름릅릇릉릎리릭린릴림립릿링마막만많맏말맑맘맙맛망맞맡맣매맥맨맬맴맵맷맹맺먀머먹먼멀멈멋멍메멕멘멜멤멧멩며멱면멸몄명몇모목몫몬몰몸몹못몽뫼묀묘무묵묶문묻물뭄뭇뭉뭐뭔뭘뮌뮐뮤뮬므믈믐미믹민믿밀밈밋밍및밑바박밖반받발밝밟밤밥밧방밭배백밴밸뱀뱃뱅뱉뱌버벅번벌범법벗벙벚베벡벤벨벰벳벵벼벽변별볍병볕보복볶본볼봄봅봇봉봐봤뵈뵙뵤부북분불붉붐붓붕붙뷔뷘뷰브븐블비빅빈빌빔빕빗빙빚빛빠빡빤빨빵빼빽뺀뺏뺑뺨뻐뻔뻗뻘뻤뼈뽀뽑뾰뿌뿐뿔뿜쁘쁜쁨삐사삭산살삶삼삽삿샀상새색샌샐샘샛생샤샨샬샴샵샷샹섀서석섞선섣설섬섭섯섰성세섹센셀셈셉셋셍셔션셜셤셨셰셴셸소속손솔솜솟송솽쇄쇠쇼숀숄숍숏숑수숙순술숨숫숭숱숲숴쉐쉬쉴쉼쉽슈슐슘슛슝스슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싼쌀쌈쌌쌍쌓써썩썬썰썸썹썼썽쎄쏘쏙쏜쏟쏠쏴쐈쐐쑈쑤쑥쑨쑹쓰쓴쓸씀씌씨씩씬씹씻씽아악안앉않알앓암압앗았앙앞애액앤앨앰앱앳앴앵야약얀얄얇얌얏양얕얘어억언얹얻얼얽엄업없엇었엉엌엎에엑엔엘엠엡엣엥여역엮연열엷염엽엿였영옅옆예옌옐옙옛오옥온올옭옮옳옴옵옷옹옻와왁완왈왓왔왕왜외왼요욕욘욜용우욱운울움웁웃웅워웍원월웜웠웨웬웰웸웹위윅윈윌윔윗윙유육윤율윳융으은을음읍응의이익인일읽잃임입잇있잉잊잎자작잔잖잘잠잡잣장잦재잭잼잿쟁쟈쟝저적전절젊점접젓정젖제젝젠젤젭젯젱져젼졌조족존졸좀좁종좇좋좌좡죄죠주죽준줄줌줍중줘줬쥐쥔쥘쥬즈즉즌즐즘즙증지직진질짊짐집짓징짖짙짚짜짝짠짤짧짱째쨌쩌쩍쩐쩔쩡쪼쪽쫓쬐쭈쭉쭝쭤쯔쯤찌찍찐찔찢차착찬찮찰참찹찻창찾채책챈챌챔챗챙챠처척천철첨첩첫청체첸첼쳇쳐쳤초촉촌촐촘촛총촨촬최쵸추축춘출춤춥춧충춰췄췌취츄츠측츨츰츳층치칙친칠침칩칭카칸칼캄캅캇캉캐캔캘캠캡캣캥캬커컨컫컬컴컵컷컸컹케켁켄켈켐켓켜켰코콕콘콜콤콥콧콩콰콴콸쾌쾨쾰쿄쿠쿡쿤쿨쿰쿼퀀퀄퀘퀴퀸퀼큐큘크큰클큼키킥킨킬킴킵킷킹타탁탄탈탐탑탓탔탕태택탠탤탬탭탱탸터턱턴털텀텁텃텅테텍텐텔템텝텟텡톈토톡톤톨톰톱통퇴투툭툰툴툼퉁튀튕튜튠튬트특튼튿틀틈티틱틴틸팀팁팅파팍팎판팔팜팝팟팡팥패팩팬팰팹팻팽퍼퍽펀펄펌펑페펙펜펠펨펩펫펴편펼폄폈평폐포폭폰폴폼퐁푀표푸푹푼풀품풋풍퓌퓨퓰프픈플픔피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햇했행햐향허헉헌헐험헛헝헤헥헨헬헴헵혀혁현혈혐협혔형혜호혹혼홀홈홉홋홍화확환활황홰횃회획횟횡효후훅훈훌훑훔훗훙훤훨훼휘휜휠휩휴흉흐흑흔흘흙흠흡흥흩희흰히힉힌힐힘힙'
},
'thai_g1':{
'filename': 'thai.pth',
'model_script': 'thai',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/thai.zip',
'filesize': '40a06b563a2b3d7897e2d19df20dc709',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
'characters': ''.join(separator_char)+'!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZกขคฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮฤเแโใไะาุูิีืึั่้๊๋็์ำํฺฯๆ0123456789๑๒๓๔๕๖๗๘๙'
},
'devanagari_g1':{
'filename': 'devanagari.pth',
'model_script': 'devanagari',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/devanagari.zip',
'filesize': 'db6b1f074fae3070f561675db908ac08',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.ँंःअअंअःआइईउऊऋएऐऑओऔकखगघङचछजझञटठडढणतथदधनऩपफबभमयरऱलळवशषसह़ािीुूृॅेैॉोौ्ॐ॒क़ख़ग़ज़ड़ढ़फ़ॠ।०१२३४५६७८९॰'
},
'cyrillic_g1':{
'filename': 'cyrillic.pth',
'model_script': 'cyrillic',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/cyrillic.zip',
'filesize': '5a046f7be2a4f7da6ed50740f487efa8',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZЁЂЄІЇЈЉЊЋЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяёђєіїјљњћўџҐґҮүө'
},
'arabic_g1':{
'filename': 'arabic.pth',
'model_script': 'arabic',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/pre-v1.1.6/arabic.zip',
'filesize': '993074555550e4e06a6077d55ff0449a',
'symbols': '«»؟،؛٠١٢٣٤٥٦٧٨٩' + '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ ',
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ٠١٢٣٤٥٦٧٨٩«»؟،؛ءآأؤإئااًبةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰٓٔٱٹپچڈڑژکڭگںھۀہۂۃۆۇۈۋیېےۓە'
},
'tamil_g1':{
'filename': 'tamil.pth',
'model_script': 'tamil',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.1.7/tamil.zip',
'filesize': '4b93972fdacdcdabe6d57097025d4dc2',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZஃஅஆஇஈஉஊஎஏஐஒஓஔகஙசஜஞடணதநனபமயரறலளழவஷஸஹாிீுூெேைொோௌ்'
},
'bengali_g1':{
'filename': 'bengali.pth',
'model_script': 'bengali',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.1.8/bengali.zip',
'filesize': 'cea9e897e2c0576b62cbb1554997ce1c',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ।ঁংঃঅআইঈউঊঋঌএঐওঔকখগঘঙচছজঝঞটঠডঢণতথদধনপফবভমযরলশষসহ়ািীুূৃেৈোৌ্ৎড়ঢ়য়০১২৩৪৫৬৭৮৯'
},
},
'gen2' : {
'english_g2':{
'filename': 'english_g2.pth',
'model_script': 'english',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/english_g2.zip',
'filesize': '5864788e1821be9e454ec108d61b887d',
'symbols': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ €",
'characters': "0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ €ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
},
'latin_g2':{
'filename': 'latin_g2.pth',
'model_script': 'latin',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/latin_g2.zip',
'filesize': '469869130aad1a34e8f9086f4262bc59',
'symbols': " !\"#$%&'()*+,-./0123456789:;<=>?@[\\]^_`{|}~ €",
'characters': " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ªÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿĀāĂ㥹ĆćČčĎďĐđĒēĖėĘęĚěĞğĨĩĪīĮįİıĶķĹĺĻļĽľŁłŃńŅņŇňŒœŔŕŘřŚśŞşŠšŤťŨũŪūŮůŲųŸŹźŻżŽžƏƠơƯưȘșȚțə̇ḌḍḶḷṀṁṂṃṄṅṆṇṬṭẠạẢảẤấẦầẨẩẪẫẬậẮắẰằẲẳẴẵẶặẸẹẺẻẼẽẾếỀềỂểỄễỆệỈỉỊịỌọỎỏỐốỒồỔổỖỗỘộỚớỜờỞởỠỡỢợỤụỦủỨứỪừỬửỮữỰựỲỳỴỵỶỷỸỹ€"
},
'zh_sim_g2':{
'filename': 'zh_sim_g2.pth',
'model_script': 'chinese_sim',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/zh_sim_g2.zip',
'filesize': 'b601ce7143293387d3ec4f41a66edc07',
'symbols': " !\"#$%&'()*+,-./0123456789:;<=>?@[\\]^_`{|}~。〈〉《》「」『』",
'characters': " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~。〈〉《》「」『』一丁七万丈三上下不与丐丑专且丕世丘丙业丛东丝丞丢两严丧个丫中丰串临丸丹为主丽举乃久么义之乌乍乎乏乐乒乓乔乖乘乙乜九乞也习乡书乩买乱乳乾了予争事二亍于亏云互亓五井亘亚些亟亡亢交亥亦产亨亩享京亭亮亲亳亵人亿什仁仂仃仄仅仆仇仉今介仍从仑仓仔仕他仗付仙仞仟仡代令以仨仪仫们仰仲仳仵件价任份仿企伉伊伍伎伏伐休众优伙会伛伞伟传伢伤伦伧伪伫伯估伴伶伸伺似伽佃但位低住佐佑体何佗佘余佚佛作佝佞佟你佣佤佥佩佬佯佰佳佴佶佻佼佾使侃侄侈侉例侍侏侑侔侗供依侠侣侥侦侧侨侩侪侬侮侯侵便促俄俅俊俎俏俐俑俗俘俚俜保俞俟信俣俦俨俩俪俭修俯俱俳俸俺俾倌倍倏倒倔倘候倚倜借倡倥倦倨倩倪倬倭债值倾偃假偈偌偎偏偕做停健偬偶偷偻偾偿傀傅傈傍傣傥傧储傩催傲傻像僖僚僦僧僬僭僮僳僵僻儆儇儋儒儡儿兀允元兄充兆先光克免兑兔兕兖党兜兢入全八公六兮兰共关兴兵其具典兹养兼兽冀冁内冈冉册再冒冕冗写军农冠冢冤冥冬冯冰冱冲决况冶冷冻冼冽净凄准凇凉凋凌减凑凛凝几凡凤凫凭凯凰凳凶凸凹出击凼函凿刀刁刃分切刈刊刍刎刑划刖列刘则刚创初删判刨利别刭刮到刳制刷券刹刺刻刽刿剀剁剂剃削剌前剐剑剔剖剜剞剡剥剧剩剪副割剽剿劁劂劈劐劓力劝办功加务劢劣动助努劫劬劭励劲劳劾势勃勇勉勋勐勒勖勘募勤勰勺勾勿匀包匆匈匍匏匐匕化北匙匝匠匡匣匦匪匮匹区医匾匿十千卅升午卉半华协卑卒卓单卖南博卜卞卟占卡卢卣卤卦卧卫卮卯印危即却卵卷卸卺卿厂厄厅历厉压厌厍厕厘厚厝原厢厣厥厦厨厩厮去县叁参又叉及友双反发叔取受变叙叛叟叠口古句另叨叩只叫召叭叮可台叱史右叵叶号司叹叻叼叽吁吃各吆合吉吊同名后吏吐向吒吓吕吗君吝吞吟吠吡吣否吧吨吩含听吭吮启吱吲吴吵吸吹吻吼吾呀呃呆呈告呋呐呓呔呕呖呗员呙呛呜呢呤呦周呱呲味呵呶呷呸呻呼命咀咂咄咆咋和咎咏咐咒咔咕咖咙咚咛咝咣咤咦咧咨咩咪咫咬咭咯咱咳咴咸咻咽咿哀品哂哄哆哇哈哉哌响哎哏哐哑哓哔哕哗哙哚哝哞哟哥哦哧哨哩哪哭哮哲哳哺哼哽哿唁唆唇唉唏唐唑唔唛唠唢唣唤唧唪唬售唯唱唳唷唼唾唿啁啃啄商啉啊啐啕啖啜啡啤啥啦啧啪啬啭啮啵啶啷啸啻啼啾喀喁喂喃善喇喈喉喊喋喏喑喔喘喙喜喝喟喧喱喳喵喷喹喻喽喾嗄嗅嗉嗌嗍嗑嗒嗓嗔嗖嗜嗝嗟嗡嗣嗤嗥嗦嗨嗪嗫嗬嗯嗲嗳嗵嗷嗽嗾嘀嘁嘈嘉嘌嘎嘏嘘嘛嘞嘟嘣嘤嘧嘬嘭嘱嘲嘴嘶嘹嘻嘿噌噍噎噔噗噙噜噢噤器噩噪噫噬噱噶噻噼嚅嚆嚎嚏嚓嚣嚯嚷嚼囊囔囚四囝回囟因囡团囤囫园困囱围囵囹固国图囿圃圄圆圈圉圊圜土圣在圩圪圬圭圮圯地圳圹场圻圾址坂均坊坌坍坎坏坐坑块坚坛坜坝坞坟坠坡坤坦坨坩坪坫坭坯坳坷坻坼垂垃垄垅垆型垌垒垓垛垠垡垢垣垤垦垧垩垫垭垮垲垸埂埃埋城埏埒埔埕埘埙埚埝域埠埤埭埯埴埸培基埽堂堆堇堋堍堑堕堙堞堠堡堤堪堰堵塄塌塍塑塔塘塞塥填塬塾墀墁境墅墉墒墓墙增墟墨墩墼壁壅壑壕壤士壬壮声壳壶壹处备复夏夔夕外夙多夜够夤夥大天太夫夭央夯失头夷夸夹夺夼奁奂奄奇奈奉奋奎奏契奔奕奖套奘奚奠奢奥女奴奶奸她好妁如妃妄妆妇妈妊妍妒妓妖妗妙妞妣妤妥妨妩妪妫妮妯妲妹妻妾姆姊始姐姑姒姓委姗姘姚姜姝姣姥姨姬姹姻姿威娃娄娅娆娇娈娉娌娑娓娘娜娟娠娣娥娩娱娲娴娶娼婀婆婉婊婕婚婢婧婪婴婵婶婷婺婿媒媚媛媪媲媳媵媸媾嫁嫂嫉嫌嫒嫔嫖嫘嫜嫠嫡嫣嫦嫩嫫嫱嬉嬖嬗嬴嬷孀子孑孓孔孕字存孙孚孛孜孝孟孢季孤孥学孩孪孬孰孱孳孵孺孽宁它宄宅宇守安宋完宏宓宕宗官宙定宛宜宝实宠审客宣室宥宦宪宫宰害宴宵家宸容宽宾宿寂寄寅密寇富寐寒寓寝寞察寡寤寥寨寮寰寸对寺寻导寿封射将尉尊小少尔尕尖尘尚尜尝尤尥尧尬就尴尸尹尺尻尼尽尾尿局屁层居屈屉届屋屎屏屐屑展屙属屠屡屣履屦屯山屹屺屿岁岂岈岌岍岐岑岔岖岗岘岙岚岛岢岣岩岫岬岭岱岳岵岷岸岿峁峄峋峒峙峡峤峥峦峨峪峭峰峻崂崃崆崇崎崔崖崛崞崤崦崧崩崭崮崴崽嵇嵊嵋嵌嵘嵛嵝嵩嵫嵬嵯嵴嶂嶙嶝嶷巅巍川州巡巢工左巧巨巩巫差巯己已巳巴巷巽巾币市布帅帆师希帏帐帑帔帕帖帘帙帚帛帜帝带帧席帮帱帷常帻帼帽幂幄幅幌幔幕幛幞幡幢干平年并幸幺幻幼幽广庀庄庆庇床庋序庐庑库应底庖店庙庚府庞废庠庥度座庭庳庵庶康庸庹庾廉廊廒廓廖廛廨廪延廷建廿开弁异弃弄弈弊弋式弑弓引弗弘弛弟张弥弦弧弩弭弯弱弹强弼彀归当录彖彗彘彝形彤彦彩彪彬彭彰影彳彷役彻彼往征徂径待徇很徉徊律後徐徒徕得徘徙徜御徨循徭微徵德徼徽心必忆忉忌忍忏忐忑忒忖志忘忙忝忠忡忤忧忪快忭忮忱念忸忻忽忾忿怀态怂怃怄怅怆怊怍怎怏怒怔怕怖怙怛怜思怠怡急怦性怨怩怪怫怯怵总怼怿恁恂恃恋恍恐恒恕恙恚恝恢恣恤恧恨恩恪恫恬恭息恰恳恶恸恹恺恻恼恽恿悃悄悉悌悍悒悔悖悚悛悝悟悠患悦您悫悬悭悯悱悲悴悸悻悼情惆惊惋惑惕惘惚惜惝惟惠惦惧惨惩惫惬惭惮惯惰想惴惶惹惺愀愁愆愈愉愍愎意愕愚感愠愣愤愦愧愫愿慈慊慌慎慑慕慝慢慧慨慰慵慷憋憎憔憝憧憨憩憬憷憾懂懈懊懋懑懒懦懵懿戆戈戊戋戌戍戎戏成我戒戕或戗战戚戛戟戡戢戥截戬戮戳戴户戽戾房所扁扃扇扈扉手扌才扎扑扒打扔托扛扣扦执扩扪扫扬扭扮扯扰扳扶批扼找承技抄抉把抑抒抓投抖抗折抚抛抟抠抡抢护报抨披抬抱抵抹抻押抽抿拂拄担拆拇拈拉拊拌拍拎拐拒拓拔拖拗拘拙拚招拜拟拢拣拥拦拧拨择括拭拮拯拱拳拴拶拷拼拽拾拿持挂指挈按挎挑挖挚挛挝挞挟挠挡挢挣挤挥挨挪挫振挲挹挺挽捂捃捅捆捉捋捌捍捎捏捐捕捞损捡换捣捧捩捭据捱捶捷捺捻掀掂掇授掉掊掌掎掏掐排掖掘掠探掣接控推掩措掬掭掮掰掳掴掷掸掺掼掾揄揆揉揍揎描提插揖揞揠握揣揩揪揭援揶揸揽揿搀搁搂搅搋搌搏搐搓搔搛搜搞搠搡搦搪搬搭搴携搽摁摄摅摆摇摈摊摒摔摘摞摧摩摭摸摹摺撂撄撅撇撑撒撕撖撙撞撤撩撬播撮撰撵撷撸撺撼擀擂擅操擎擐擒擘擞擢擤擦攀攉攒攘攥攫攮支收攸改攻放政故效敉敌敏救敕敖教敛敝敞敢散敦敫敬数敲整敷文斋斌斐斑斓斗料斛斜斟斡斤斥斧斩斫断斯新方於施旁旃旄旅旆旋旌旎族旒旖旗无既日旦旧旨早旬旭旮旯旰旱时旷旺昀昂昃昆昊昌明昏易昔昕昙昝星映春昧昨昭是昱昴昵昶昼显晁晃晋晌晏晒晓晔晕晖晗晚晟晡晤晦晨普景晰晴晶晷智晾暂暄暇暌暑暖暗暝暧暨暮暴暹暾曙曛曜曝曦曩曰曲曳更曷曹曼曾替最月有朊朋服朐朔朕朗望朝期朦木未末本札术朱朴朵机朽杀杂权杆杈杉杌李杏材村杓杖杜杞束杠条来杨杪杭杯杰杲杳杵杷杼松板极构枇枉枋析枕林枘枚果枝枞枢枣枥枧枨枪枫枭枯枰枳枵架枷枸柁柃柄柏某柑柒染柔柘柙柚柜柝柞柠柢查柩柬柯柰柱柳柴柽柿栀栅标栈栉栊栋栌栎栏树栓栖栗栝校栩株栲栳样核根格栽栾桀桁桂桃桄桅框案桉桊桌桎桐桑桓桔桕桠桡桢档桤桥桦桧桨桩桫桴桶桷梁梃梅梆梏梓梗梢梦梧梨梭梯械梳梵检棂棉棋棍棒棕棘棚棠棣森棰棱棵棹棺棼椁椅椋植椎椐椒椟椠椤椭椰椴椹椽椿楂楔楗楚楝楞楠楣楦楫楮楷楸楹楼榀概榄榆榇榈榉榍榔榕榛榜榧榨榫榭榱榴榷榻槁槊槌槎槐槔槛槟槠槭槲槽槿樊樗樘樟模樨横樯樱樵樽樾橄橇橐橘橙橛橡橥橱橹橼檀檄檎檐檑檗檠檩檫檬欠次欢欣欤欧欲欷欺款歃歆歇歉歌歙止正此步武歧歪歹死歼殁殂殃殄殆殇殉殊残殍殒殓殖殚殛殡殪殳殴段殷殿毁毂毅毋母每毒毓比毕毖毗毙毛毡毪毫毯毳毵毹毽氅氆氇氍氏氐民氓气氕氖氘氙氚氛氟氡氢氤氦氧氨氩氪氮氯氰氲水永氽汀汁求汆汇汉汊汐汔汕汗汛汜汝汞江池污汤汨汩汪汰汲汴汶汹汽汾沁沂沃沅沆沈沉沌沏沐沓沔沙沛沟没沣沤沥沦沧沩沪沫沭沮沱河沸油治沼沽沾沿泄泅泉泊泌泐泓泔法泖泗泛泞泠泡波泣泥注泪泫泮泯泰泱泳泵泷泸泺泻泼泽泾洁洄洇洋洌洎洒洗洙洚洛洞津洧洪洫洮洱洲洳洵洹活洼洽派流浃浅浆浇浈浊测浍济浏浑浒浓浔浙浚浜浞浠浣浦浩浪浮浯浴海浸浼涂涅消涉涌涎涑涓涔涕涛涝涞涟涠涡涣涤润涧涨涩涪涫涮涯液涵涸涿淀淄淅淆淇淋淌淑淖淘淙淝淞淠淡淤淦淫淬淮深淳混淹添淼清渊渌渍渎渐渑渔渖渗渚渝渠渡渣渤渥温渫渭港渲渴游渺湃湄湍湎湔湖湘湛湟湫湮湾湿溃溅溆溉溏源溘溜溟溢溥溧溪溯溱溲溴溶溷溺溻溽滁滂滇滋滏滑滓滔滕滗滚滞滟滠满滢滤滥滦滨滩滴滹漂漆漉漏漓演漕漠漤漩漪漫漭漯漱漳漶漾潆潇潋潍潘潜潞潢潦潭潮潲潴潸潺潼澄澈澉澌澍澎澜澡澧澳澶澹激濂濉濑濒濞濠濡濮濯瀑瀚瀛瀣瀵瀹灌灏灞火灭灯灰灵灶灸灼灾灿炀炅炉炊炎炒炔炕炖炙炜炝炫炬炭炮炯炱炳炷炸点炻炼炽烀烁烂烃烈烊烘烙烛烟烤烦烧烨烩烫烬热烯烷烹烽焉焊焐焓焕焖焘焙焚焦焯焰焱然煅煊煌煎煜煞煤煦照煨煮煲煳煸煺煽熄熊熏熔熘熙熟熠熨熬熵熹燃燎燔燕燠燥燧燮燹爆爝爨爪爬爰爱爵父爷爸爹爻爽爿片版牌牍牒牖牙牛牝牟牡牢牦牧物牮牯牲牵特牺牾犀犁犄犊犋犍犏犒犟犬犯犰犴状犷犸犹狁狂狃狄狈狍狎狐狒狗狙狞狠狡狨狩独狭狮狯狰狱狲狳狴狷狸狺狻狼猁猃猊猎猕猖猗猛猜猝猞猡猢猥猩猪猫猬献猱猴猷猸猹猾猿獍獐獒獗獠獬獭獯獾玄率玉王玎玑玖玛玢玩玫玮环现玲玳玷玺玻珀珂珈珉珊珍珏珐珑珙珞珠珥珧珩班珲球琅理琉琏琐琚琛琢琥琦琨琪琬琮琰琳琴琵琶琼瑁瑕瑗瑙瑚瑛瑜瑞瑟瑭瑰瑶瑾璀璁璃璇璋璎璐璜璞璧璨璩瓒瓜瓞瓠瓢瓣瓤瓦瓮瓯瓴瓶瓷瓿甄甏甑甓甘甙甚甜生甥用甩甫甬甭田由甲申电男甸町画甾畀畅畈畋界畎畏畔留畚畛畜略畦番畲畴畸畹畿疃疆疋疏疑疔疖疗疙疚疝疟疠疡疣疤疥疫疬疮疯疰疱疲疳疴疵疸疹疼疽疾痂痃痄病症痈痉痊痍痒痔痕痘痛痞痢痣痤痦痧痨痪痫痰痱痴痹痼痿瘀瘁瘃瘅瘊瘌瘐瘗瘘瘙瘛瘟瘠瘢瘤瘥瘦瘩瘪瘫瘭瘰瘳瘴瘵瘸瘼瘾瘿癀癃癌癍癔癖癜癞癣癫癯癸登白百皂的皆皇皈皋皎皑皓皖皙皤皮皱皲皴皿盂盅盆盈益盍盎盏盐监盒盔盖盗盘盛盟盥目盯盱盲直相盹盼盾省眄眇眈眉看眍眙眚真眠眢眦眨眩眭眯眵眶眷眸眺眼着睁睃睇睐睑睚睛睡睢督睥睦睨睫睬睹睽睾睿瞀瞄瞅瞌瞍瞎瞑瞒瞟瞠瞢瞥瞧瞩瞪瞬瞰瞳瞵瞻瞽瞿矍矗矛矜矢矣知矧矩矫矬短矮石矶矸矽矾矿砀码砂砉砌砍砑砒研砖砗砘砚砜砝砟砣砥砧砭砰破砷砸砹砺砻砼砾础硅硇硌硎硐硒硕硖硗硝硪硫硬硭确硷硼碇碉碌碍碎碑碓碗碘碚碛碜碟碡碣碥碧碰碱碲碳碴碹碾磁磅磉磊磋磐磔磕磙磨磬磲磴磷磺礁礅礓礞礤礴示礻礼社祀祁祆祈祉祓祖祗祚祛祜祝神祟祠祢祥祧票祭祯祷祸祺禀禁禄禅禊福禚禧禳禹禺离禽禾秀私秃秆秉秋种科秒秕秘租秣秤秦秧秩秫秭积称秸移秽稀稂稆程稍税稔稗稚稞稠稣稳稷稻稼稽稿穆穑穗穰穴究穷穸穹空穿窀突窃窄窈窍窑窒窕窖窗窘窜窝窟窠窥窦窨窬窭窳窿立竖站竞竟章竣童竦竭端竹竺竽竿笃笄笆笈笊笋笏笑笔笕笙笛笞笠笤笥符笨笪笫第笮笱笳笸笺笼笾筅筇等筋筌筏筐筑筒答策筘筚筛筝筠筢筮筱筲筵筷筹筻签简箅箍箐箔箕算箜管箢箦箧箨箩箪箫箬箭箱箴箸篁篆篇篌篑篓篙篚篝篡篥篦篪篮篱篷篼篾簇簋簌簏簖簟簦簧簪簸簿籀籁籍米籴类籼籽粉粑粒粕粗粘粜粝粞粟粤粥粪粮粱粲粳粹粼粽精糁糅糇糈糊糌糍糕糖糗糙糜糟糠糨糯系紊素索紧紫累絮絷綦綮縻繁繇纂纛纠纡红纣纤纥约级纨纩纪纫纬纭纯纰纱纲纳纵纶纷纸纹纺纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绗绘给绚绛络绝绞统绠绡绢绣绥绦继绨绩绪绫续绮绯绰绲绳维绵绶绷绸绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缌缎缏缑缒缓缔缕编缗缘缙缚缛缜缝缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵缶缸缺罂罄罅罐网罔罕罗罘罚罟罡罢罨罩罪置罱署罴罹罾羁羊羌美羔羚羝羞羟羡群羧羯羰羲羸羹羼羽羿翁翅翊翌翎翔翕翘翟翠翡翥翦翩翮翰翱翳翻翼耀老考耄者耆耋而耍耐耒耔耕耖耗耘耙耜耠耢耥耦耧耨耩耪耱耳耵耶耷耸耻耽耿聂聃聆聊聋职聍聒联聘聚聩聪聱聿肃肄肆肇肉肋肌肓肖肘肚肛肝肟肠股肢肤肥肩肪肫肭肮肯肱育肴肷肺肼肽肾肿胀胁胂胃胄胆背胍胎胖胗胙胚胛胜胝胞胡胤胥胧胨胩胪胫胬胭胯胰胱胲胳胴胶胸胺胼能脂脆脉脊脍脎脏脐脑脒脓脔脖脘脚脞脬脯脱脲脶脸脾腆腈腊腋腌腐腑腓腔腕腙腚腠腥腧腩腭腮腰腱腴腹腺腻腼腽腾腿膀膂膈膊膏膑膘膛膜膝膦膨膪膳膺膻臀臁臂臃臆臊臌臣臧自臬臭至致臻臼臾舀舁舂舄舅舆舌舍舐舒舔舛舜舞舟舡舢舣舨航舫般舰舱舳舴舵舶舷舸船舻舾艄艇艋艘艚艟艨艮良艰色艳艴艺艽艾艿节芄芈芊芋芍芎芏芑芒芗芘芙芜芝芟芡芥芦芨芩芪芫芬芭芮芯芰花芳芴芷芸芹芽芾苁苄苇苈苊苋苌苍苎苏苑苒苓苔苕苗苘苛苜苞苟苠苡苣苤若苦苫苯英苴苷苹苻茁茂范茄茅茆茈茉茌茎茏茑茔茕茗茚茛茜茧茨茫茬茭茯茱茳茴茵茶茸茹茼荀荃荆荇草荏荐荑荒荔荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭药荷荸荻荼荽莅莆莉莎莒莓莘莛莜莞莠莨莩莪莫莰莱莲莳莴莶获莸莹莺莼莽菀菁菅菇菊菌菏菔菖菘菜菝菟菠菡菥菩菪菰菱菲菹菽萁萃萄萋萌萍萎萏萑萘萜萝萤营萦萧萨萱萸萼落葆葑著葚葛葜葡董葩葫葬葭葱葳葵葶葸葺蒂蒇蒈蒉蒋蒌蒎蒗蒙蒜蒡蒯蒲蒴蒸蒹蒺蒽蒿蓁蓄蓉蓊蓍蓐蓑蓓蓖蓝蓟蓠蓣蓥蓦蓬蓰蓼蓿蔌蔑蔓蔗蔚蔟蔡蔫蔬蔷蔸蔹蔺蔻蔼蔽蕃蕈蕉蕊蕖蕙蕞蕤蕨蕲蕴蕹蕺蕻蕾薄薅薇薏薛薜薤薨薪薮薯薰薷薹藁藉藏藐藓藕藜藤藩藻藿蘅蘑蘖蘧蘩蘸蘼虎虏虐虑虔虚虞虢虫虬虮虱虹虺虻虼虽虾虿蚀蚁蚂蚊蚋蚌蚍蚓蚕蚜蚝蚣蚤蚧蚨蚩蚬蚯蚰蚱蚴蚶蚺蛀蛄蛆蛇蛉蛊蛋蛎蛏蛐蛑蛔蛘蛙蛛蛞蛟蛤蛩蛭蛮蛰蛱蛲蛳蛴蛸蛹蛾蜀蜂蜃蜇蜈蜉蜊蜍蜒蜓蜕蜗蜘蜚蜜蜞蜡蜢蜣蜥蜩蜮蜱蜴蜷蜻蜾蜿蝇蝈蝉蝌蝎蝓蝗蝙蝠蝣蝤蝥蝮蝰蝴蝶蝻蝼蝽蝾螂螃螅螈螋融螗螟螨螫螬螭螯螳螵螺螽蟀蟆蟊蟋蟑蟒蟛蟠蟥蟪蟮蟹蟾蠃蠊蠓蠕蠖蠡蠢蠲蠹蠼血衄衅行衍衔街衙衡衢衣补表衩衫衬衮衰衲衷衽衾衿袁袂袄袅袈袋袍袒袖袜袢袤被袭袱袼裁裂装裆裉裎裒裔裕裘裙裟裢裣裤裥裨裰裱裳裴裸裹裼裾褂褊褐褒褓褙褚褛褡褥褪褫褰褴褶襁襄襞襟襦襻西要覃覆见观规觅视觇览觉觊觋觌觎觏觐觑角觖觚觜觞解觥触觫觯觳言訇訾詈詹誉誊誓謇警譬计订讣认讥讦讧讨让讪讫训议讯记讲讳讴讵讶讷许讹论讼讽设访诀证诂诃评诅识诈诉诊诋诌词诎诏译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诫诬语诮误诰诱诲诳说诵请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谙谚谛谜谝谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豁豆豇豉豌豕豚象豢豪豫豳豸豹豺貂貅貉貊貌貔貘贝贞负贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赓赔赖赘赙赚赛赜赝赞赠赡赢赣赤赦赧赫赭走赳赴赵赶起趁趄超越趋趑趔趟趣趱足趴趵趸趺趼趾趿跃跄跆跋跌跎跏跑跖跗跚跛距跞跟跣跤跨跪跬路跳践跷跸跹跺跻跽踅踉踊踌踏踔踝踞踟踢踣踩踪踬踮踯踱踵踹踺踽蹀蹁蹂蹄蹇蹈蹉蹊蹋蹑蹒蹙蹦蹩蹬蹭蹯蹰蹲蹴蹶蹼蹿躁躅躇躏躐躔躜躞身躬躯躲躺车轧轨轩轫转轭轮软轰轱轲轳轴轵轶轷轸轺轻轼载轾轿辁辂较辄辅辆辇辈辉辊辋辍辎辏辐辑输辔辕辖辗辘辙辚辛辜辞辟辣辨辩辫辰辱边辽达迁迂迄迅过迈迎运近迓返迕还这进远违连迟迢迤迥迦迨迩迪迫迭迮述迷迸迹追退送适逃逄逅逆选逊逋逍透逐逑递途逖逗通逛逝逞速造逡逢逦逭逮逯逵逶逸逻逼逾遁遂遄遇遍遏遐遑遒道遗遘遛遢遣遥遨遭遮遴遵遽避邀邂邃邈邋邑邓邕邗邙邛邝邡邢那邦邪邬邮邯邰邱邳邴邵邶邸邹邺邻邾郁郄郅郇郊郎郏郐郑郓郗郛郜郝郡郢郦郧部郫郭郯郴郸都郾鄂鄄鄙鄞鄢鄣鄯鄱鄹酃酆酉酊酋酌配酎酏酐酒酗酚酝酞酡酢酣酤酥酩酪酬酮酯酰酱酲酴酵酶酷酸酹酽酾酿醅醇醉醋醌醍醐醑醒醚醛醢醪醭醮醯醴醵醺采釉释里重野量金釜鉴銎銮鋈錾鍪鎏鏊鏖鐾鑫钆钇针钉钊钋钌钍钎钏钐钒钓钔钕钗钙钚钛钜钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钷钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铌铍铎铐铑铒铕铗铘铙铛铜铝铞铟铠铡铢铣铤铥铧铨铩铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锎锏锐锑锒锓锔锕锖锗锘错锚锛锝锞锟锡锢锣锤锥锦锨锩锪锫锬锭键锯锰锱锲锴锵锶锷锸锹锺锻锾锿镀镁镂镄镅镆镇镉镊镌镍镎镏镐镑镒镓镔镖镗镘镛镜镝镞镡镢镣镤镥镦镧镨镩镪镫镬镭镯镰镱镲镳镶长门闩闪闫闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾阀阁阂阃阄阅阆阈阉阊阋阌阍阎阏阐阑阒阔阕阖阗阙阚阜队阡阢阪阮阱防阳阴阵阶阻阼阽阿陀陂附际陆陇陈陉陋陌降限陔陕陛陟陡院除陧陨险陪陬陲陴陵陶陷隅隆隈隋隍随隐隔隗隘隙障隧隰隳隶隼隽难雀雁雄雅集雇雉雌雍雎雏雒雕雠雨雩雪雯雳零雷雹雾需霁霄霆震霈霉霍霎霏霓霖霜霞霪霭霰露霸霹霾青靓靖静靛非靠靡面靥革靳靴靶靼鞅鞋鞍鞑鞒鞘鞠鞣鞫鞭鞯鞲鞴韦韧韩韪韫韬韭音韵韶页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颌颍颏颐频颓颔颖颗题颚颛颜额颞颟颠颡颢颤颥颦颧风飑飒飓飕飘飙飚飞食飧飨餍餐餮饔饕饥饧饨饩饪饫饬饭饮饯饰饱饲饴饵饶饷饺饼饽饿馀馁馄馅馆馇馈馊馋馍馏馐馑馒馓馔馕首馗馘香馥馨马驭驮驯驰驱驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骄骅骆骇骈骊骋验骏骐骑骒骓骖骗骘骚骛骜骝骞骟骠骡骢骣骤骥骧骨骰骶骷骸骺骼髀髁髂髅髋髌髑髓高髡髦髫髭髯髹髻鬃鬈鬏鬓鬟鬣鬯鬲鬻鬼魁魂魃魄魅魇魈魉魍魏魑魔鱼鱿鲁鲂鲅鲆鲇鲈鲋鲍鲎鲐鲑鲔鲚鲛鲜鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲫鲭鲮鲰鲱鲲鲳鲴鲵鲷鲸鲺鲻鲼鲽鳃鳄鳅鳆鳇鳊鳌鳍鳎鳏鳐鳓鳔鳕鳖鳗鳘鳙鳜鳝鳞鳟鳢鸟鸠鸡鸢鸣鸥鸦鸨鸩鸪鸫鸬鸭鸯鸱鸲鸳鸵鸶鸷鸸鸹鸺鸽鸾鸿鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹎鹏鹑鹕鹗鹘鹚鹛鹜鹞鹣鹤鹦鹧鹨鹩鹪鹫鹬鹭鹰鹱鹳鹿麂麇麈麋麒麓麝麟麦麸麻麽麾黄黉黍黎黏黑黔默黛黜黝黟黠黢黥黧黩黯黹黻黼黾鼋鼍鼎鼐鼓鼗鼙鼠鼢鼬鼯鼷鼹鼻鼾齐齑齿龀龃龄龅龆龇龈龉龊龋龌龙龚龛龟龠"
},
'japanese_g2':{
'filename': 'japanese_g2.pth',
'model_script': 'japanese',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/japanese_g2.zip',
'filesize': 'bad5146990ccb1272cb0908440fbe15e',
'symbols': " !\"#$%&'()*+,-./0123456789:;<=>?@[\\]^_`{|}~‥…※♪、。々〈〉《》「」『』【】〔〕",
'characters': " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~‥…※♪、。々〈〉《》「」『』【】〔〕あぃいうぇえおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろわをんァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロワヱヲンヴヶ・ー一丁七万丈三上下不与丑世丘丙丞両並中串丸丹主乃久之乗乙九也乱乳乾亀了予争事二互五井亘亜亡交亥亨享京亭亮人仁今介仏仕他付仙代令以仮仰仲件任企伊伍伎伏休会伝伯伴伶伸似伽位低住佐佑体何余作佳使例侍侑供依価便係俊俗保信俣修俵倉個倍倒倖候借値倫倭倶偉偏健側偵偽傍傑備債傷働像僧儀優允元兄充先光克免兎児党入全八公六共兵其具典兼内円再写冠冨冬冴冶冷凍凡処凪出刀刃分切刈刑列初判別利制刷券刺刻則削前剛剣剤剥副割創劇力功加助労効勅勇勉動勘務勝勢勤勧勲包化北匠匡区医十千升午半卒卓協南単博占卯印危即卵卸厚原厨厳去参又叉及友双反収取受叡口古句只叫召可台史右叶号司各合吉同名后吏吐向君吟否吸吹吾呂呉告呑周味呼命和咲哀品哉員哲唄唐唯唱商問啓善喜喬喰営嗣嘉噌器四回因団囲図固国國園土圧在圭地坂均坊坐坪垂型垢垣埋城埜域執基埼堀堂堅堤堰報場堺塔塗塚塩塵境墓増墨墳壁壇壊士壬壮声壱売壷変夏夕外多夜夢大天太夫央失夷奇奈奉奏契奥奨女奴好如妃妙妹妻姉始姓委姥姫姿威娘婆婚婦嫌嬉子孔字存孝孟季孤学孫宅宇守安完宏宗官宙定宜宝実客宣室宥宮宰害家容宿寂寄寅密富寒寛寝察寧審寸寺対寿封専射将尊尋導小少尚尭就尺尻尼尽尾尿局居屈屋展属層屯山岐岡岩岬岱岳岸峠峡峨峯峰島峻崇崎崩嵐嵩嵯嶋嶺巌川州巡巣工左巧巨差己巳巴巻巾市布帆希帝師席帯帰帳常帽幅幌幕幡幣干平年幸幹幽幾庁広庄床序底店府度座庫庭庵康庸廃廉廣延建廻弁式弐弓引弘弟弥弦弱張強弾当形彦彩彪彫彬彰影役彼往征径待律後徒従得御復微徳徹心必忌忍志応忠快念怒怜思急性恋恐恒恩恭息恵悌悟悠患悦悪悲情惇惑惟惣想意愚愛感慈態慎慣慧慶憂憲憶懐懸戎成我戒戦戯戸戻房所扇手才打払扶承技投抗折抜抱押担拓拝拡拳拾持指挙振捕捨捷掃排掘掛採探接推掻提揖揚換揮援揺損摂摘摩摺撃撫播撮操擦擬支改攻放政故敏救敗教敢散敦敬数整敵敷文斉斎斐斑斗料斜斤断斯新方於施旅旋族旗日旦旧旨早旬旭旺昂昆昇昌明易星映春昭是昼時晃晋晩普景晴晶智暁暖暗暢暦暮暴曇曙曜曲曳更書曹曽曾替最月有朋服朔朗望朝期木未末本札朱朴杉李杏材村杖杜束条来杭東杵松板析枕林枚果枝枯架柄柊柏柑染柔柚柱柳柴査柿栃栄栖栗校株核根格桂桃案桐桑桜桝桧桶梁梅梓梢梨梯械梶棄棒棚棟森椋植椎検椿楊楓楠楢業楯極楼楽榊榎榛構槌様槙槻樋標模権横樫樹樺樽橋橘機檀櫛欠次欣欧欲欽歌歓止正此武歩歯歳歴死殊残殖段殺殻殿毅母毎毒比毛氏民気水氷永汀汁求汐汗汚江池汰汲決沈沓沖沙沢河油治沼泉泊法波泣泥注泰洋洗洞津洪洲活派流浄浅浜浦浩浪浮浴海消涌涙液涼淀淑淡深淳淵混添清済渉渋渓渕渚減渡渥温測港湊湖湧湯湾湿満源準溜溝溶滅滋滑滝漁漆漏演漢漬潔潜潟潤潮潰澄澤激濃濱瀧瀬灘火灯灰災炉炎炭点為烈烏無焦然焼煙照煮熊熟熱燃燈燕燦燭爆爪父爽爾片版牛牟牧物特犬犯状狂狐狗狩独狭狼猛猪猫献猿獄獅獣玄率玉王玖玲珍珠現球理琉琢琳琴瑚瑛瑞瑠瑳璃環瓜瓦瓶甘甚生産用甫田由甲申男町画界畑畔留畜畝畠略番異畳疾病症痛療発登白百的皆皇皮皿盆益盗盛盟監盤目盲直相省眉看県眞真眠眼着督睦瞬瞳矢知矩短石砂研砲破硫硬碑碧碩確磁磐磨磯礁示礼社祇祈祉祐祖祝神祢祥票祭禁禄禅禎福禰秀私秋科秘秦秩称移稀程税稔稗稚種稲穂積穏穴究空突窓窪立竜章童竪端競竹笑笛笠符第笹筆等筋筑筒答策箇箕算管箱箸節範築篠篤篭簡簾籍米粉粒粕粗粟粥精糖糞糠糸系紀約紅紋納純紗紘紙級素紡索紫細紳紹紺終組経結絡絢給統絵絶絹継続綜維綱網綾綿緋総緑緒線締編緩練縁縄縦縫縮績繁織繰罪置羅羊美群義羽翁習翔翠翼耀老考者耐耕耳耶聖聞聡聴職肇肉肌肝股肥肩育肺背胞胡胤胸能脂脇脈脚脱脳腐腕腫腰腸腹膜膳臣臥臨自臭至致臼興舌舎舘舛舜舞舟航般船艦良色艶芋芙芝芥芦花芳芸芹芽苅苑苔苗若苦苫英茂茄茅茉茜茨茶草荒荘荷荻莉菅菊菌菓菖菜華菱萌萩萱落葉葛葦葵蒔蒲蒸蒼蓋蓑蓬蓮蔦蔭蔵蕗薄薩薫薬薮藁藍藤藻蘇蘭虎虚虫虹虻蚊蛇蛍蛭蜂蜜蝦蝶融螺蟹蟻血衆行術街衛衝衡衣表袋袖被裁裂装裏裕補裟裸製複西要覆覇見規視覚覧親観角解触言計訓託記訪設許訳訴診証評詞詠試詩詰話誉誌認誓誘語誠誤説読課調談請諏論諭諸謙講謝謹識警議譲護讃谷豆豊豚象豪貝貞負財貢貧貨販貫責貯貴買貸費賀賃資賞賢質赤赦走起超越足跡路跳踏身車軌軍軒軟転軸軽載輔輝輪輸辛辞辰農辺辻込迎近返迦迫述迷追退送逃逆透途通速造逢連週進逸遅遊運過道達違遠遣遥適選遺遼避邑那邦邪郁郎郡部郭郵郷都配酒酔酢酸醍醐采釈里重野量金釘釜針釣鈴鉄鉛鉢鉱鉾銀銃銅銘銭鋭鋼錦録鍋鍛鍬鍵鎌鎖鎮鏡鐘鑑長門閉開閑間関閣闇闘阪防阿陀附降限院陣除陰陳陵陶陸険陽隅隆隈隊階随隔際障隠隣隼雀雁雄雅集雑雛離難雨雪雲零雷電震霊霜霞霧露青靖静非面革鞍鞠韓音響頂頃項順須預頓領頭頼題額顔顕願類風飛食飯飲飼飽飾餅養館首香馨馬駄駅駆駐駒駿騎験骨高髪鬼魁魂魅魔魚鮎鮫鮮鯉鯨鳥鳩鳳鳴鴨鴻鵜鶏鶴鷲鷹鷺鹿麓麗麦麻麿黄黒黙鼓鼠鼻齢龍*"
},
'korean_g2':{
'filename': 'korean_g2.pth',
'model_script': 'korean',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.3/korean_g2.zip',
'filesize': 'befecf7b1ca2fffb5af814a51443682d',
'symbols': " !\"#$%&'()*+,-./0123456789:;<=>?@[\\]^_`{|}~",
'characters': " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~가각간갇갈감갑값강갖같갚갛개객걀거걱건걷걸검겁것겉게겨격겪견결겹경곁계고곡곤곧골곰곱곳공과관광괜괴굉교구국군굳굴굵굶굽궁권귀규균그극근글긁금급긋긍기긴길김깅깊까깎깐깔깜깝깥깨꺼꺾껍껏껑께껴꼬꼭꼴꼼꼽꽂꽃꽉꽤꾸꿀꿈뀌끄끈끊끌끓끔끗끝끼낌나낙낚난날낡남납낫낭낮낯낱낳내냄냉냐냥너넉널넓넘넣네넥넷녀녁년념녕노녹논놀놈농높놓놔뇌뇨누눈눕뉘뉴늄느늑는늘늙능늦늬니닐님다닥닦단닫달닭닮담답닷당닿대댁댐더덕던덜덤덥덧덩덮데델도독돈돌돕동돼되된두둑둘둠둡둥뒤뒷드득든듣들듬듭듯등디딩딪따딱딴딸땀땅때땜떠떡떤떨떻떼또똑뚜뚫뚱뛰뜨뜩뜯뜰뜻띄라락란람랍랑랗래랜램랫략량러럭런럴럼럽럿렁렇레렉렌려력련렬렵령례로록론롬롭롯료루룩룹룻뤄류륙률륭르른름릇릎리릭린림립릿마막만많말맑맘맙맛망맞맡맣매맥맨맵맺머먹먼멀멈멋멍멎메멘멩며면멸명몇모목몰몸몹못몽묘무묵묶문묻물뭄뭇뭐뭣므미민믿밀밉밌및밑바박밖반받발밝밟밤밥방밭배백뱀뱃뱉버번벌범법벗베벤벼벽변별볍병볕보복볶본볼봄봇봉뵈뵙부북분불붉붐붓붕붙뷰브블비빌빗빚빛빠빨빵빼뺨뻐뻔뻗뼈뽑뿌뿐쁘쁨사삭산살삶삼상새색샌생서석섞선설섬섭섯성세센셈셋션소속손솔솜솟송솥쇄쇠쇼수숙순술숨숫숲쉬쉽슈스슨슬슴습슷승시식신싣실싫심십싱싶싸싹쌀쌍쌓써썩썰썹쎄쏘쏟쑤쓰쓸씀씌씨씩씬씹씻아악안앉않알앓암압앗앙앞애액야약얇양얗얘어억언얹얻얼엄업없엇엉엌엎에엔엘여역연열엷염엽엿영옆예옛오옥온올옮옳옷와완왕왜왠외왼요욕용우욱운울움웃웅워원월웨웬위윗유육율으윽은을음응의이익인일읽잃임입잇있잊잎자작잔잖잘잠잡장잦재쟁저적전절젊점접젓정젖제젠젯져조족존졸좀좁종좋좌죄주죽준줄줌줍중쥐즈즉즌즐즘증지직진질짐집짓징짙짚짜짝짧째쨌쩌쩍쩐쪽쫓쭈쭉찌찍찢차착찬찮찰참창찾채책챔챙처척천철첫청체쳐초촉촌총촬최추축춘출춤춥춧충취츠측츰층치칙친칠침칭카칸칼캐캠커컨컬컴컵컷켓켜코콜콤콩쾌쿠퀴크큰클큼키킬타탁탄탈탑탓탕태택탤터턱털텅테텍텔템토톤톱통퇴투툼퉁튀튜트특튼튿틀틈티틱팀팅파팎판팔패팩팬퍼퍽페펴편펼평폐포폭표푸푹풀품풍퓨프플픔피픽필핏핑하학한할함합항해핵핸햄햇행향허헌험헤헬혀현혈협형혜호혹혼홀홍화확환활황회획횟효후훈훌훔훨휘휴흉흐흑흔흘흙흡흥흩희흰히힘"
},
'telugu_g2':{
'filename': 'telugu.pth',
'model_script': 'telugu',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.2/telugu.zip',
'filesize': 'f7576012a3abe593950c47bfa1bd8ddc',
'symbols': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ ',
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZఁంఃఅఆఇఈఉఊఋఌఎఏఐఒఓఔకఖగఘఙచఛజఝఞటఠడఢణతథదధనపఫబభమయరఱలళవశషసహాిీుూృౄెేైొోౌ్ౠౡౢౣ'
},
'kannada_g2':{
'filename': 'kannada.pth',
'model_script': 'kannada',
'url': 'https://github.com/JaidedAI/EasyOCR/releases/download/v1.2/kannada.zip',
'filesize': 'c240c97e4adb8773b53b3b3dec728627',
'symbols': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ ',
'characters': '0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZಂಃಅಆಇಈಉಊಋಎಏಐಒಓಔಕಖಗಘಙಚಛಜಝಞಟಠಡಢಣತಥದಧನಪಫಬಭಮಯರಲಳವಶಷಸಹಾಿೀುೂೃೆೇೈೊೋೌ್೦೧೨೩೪೫೬೭೮೯'
},
}
}
| 192.274611 | 6,748 | 0.865666 | 839 | 37,109 | 38.324195 | 0.315852 | 0.004727 | 0.008273 | 0.010045 | 0.051409 | 0.037103 | 0.037103 | 0.037103 | 0.037103 | 0.037103 | 0 | 0.025321 | 0.059204 | 37,109 | 192 | 6,749 | 193.276042 | 0.890697 | 0.001105 | 0 | 0.108696 | 0 | 0.070652 | 0.112559 | 0.016404 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.005435 | 0 | 0.005435 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a6c0be94fe9ccb56867f06ea36598ab7f38acb77 | 219 | py | Python | teamcat_service/docker_build/target/one_step_build/teamcat/unitest/doraemon/exception_test/TestException.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 6 | 2018-11-26T08:42:52.000Z | 2020-06-01T08:33:48.000Z | teamcat_service/docker_build/target/one_step_build/teamcat/unitest/doraemon/exception_test/TestException.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | null | null | null | teamcat_service/docker_build/target/one_step_build/teamcat/unitest/doraemon/exception_test/TestException.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 1 | 2019-01-22T06:45:36.000Z | 2019-01-22T06:45:36.000Z | #coding=utf-8
'''
Created on 2016-10-28
@author: Administrator
'''
class TestException(object):
'''
classdocs
'''
@staticmethod
def exception_1():
raise Exception("fdsfdsfsd")
| 13.6875 | 36 | 0.584475 | 21 | 219 | 6.047619 | 0.952381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.063291 | 0.278539 | 219 | 16 | 37 | 13.6875 | 0.740506 | 0.310502 | 0 | 0 | 0 | 0 | 0.069767 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | true | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a6d1ef08f9c172128af4162d2d1f4cc9684cd613 | 87 | py | Python | jaqs/research/__init__.py | WestXu/JAQS | 3c9389afab518f188b8628af72297d750c07dfb1 | [
"Apache-2.0"
] | 602 | 2017-11-21T00:39:40.000Z | 2022-03-16T06:13:08.000Z | jaqs/research/__init__.py | WestXu/JAQS | 3c9389afab518f188b8628af72297d750c07dfb1 | [
"Apache-2.0"
] | 63 | 2017-12-08T08:21:16.000Z | 2020-03-07T13:57:35.000Z | jaqs/research/__init__.py | WestXu/JAQS | 3c9389afab518f188b8628af72297d750c07dfb1 | [
"Apache-2.0"
] | 365 | 2017-11-21T01:38:36.000Z | 2022-03-30T15:55:30.000Z | # encoding: utf-8
from .signaldigger import SignalDigger
__all__ = ['SignalDigger']
| 12.428571 | 38 | 0.747126 | 9 | 87 | 6.777778 | 0.777778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013514 | 0.149425 | 87 | 6 | 39 | 14.5 | 0.810811 | 0.172414 | 0 | 0 | 0 | 0 | 0.171429 | 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 |
a6e70f719a0f188bba46506e6d0454a4ab26892b | 122 | py | Python | beta/src/FieldReach.py | Odusseus/python | 98380cfab0f147fa0b3ac652006e11f482ebbcfc | [
"MIT"
] | null | null | null | beta/src/FieldReach.py | Odusseus/python | 98380cfab0f147fa0b3ac652006e11f482ebbcfc | [
"MIT"
] | null | null | null | beta/src/FieldReach.py | Odusseus/python | 98380cfab0f147fa0b3ac652006e11f482ebbcfc | [
"MIT"
] | null | null | null | class FieldReach():
def __init__(self, fieldId, isReached = False):
self.id = fieldId
self.isReached = isReached | 30.5 | 49 | 0.704918 | 14 | 122 | 5.857143 | 0.642857 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.188525 | 122 | 4 | 50 | 30.5 | 0.828283 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a6f4a671f9f11abd27582b5ef4cf89d5100a4417 | 302 | py | Python | core/util.py | jepret/jepret-backend | 2a892e1a7141da09d286b14f47769c3e6f4c0979 | [
"MIT"
] | null | null | null | core/util.py | jepret/jepret-backend | 2a892e1a7141da09d286b14f47769c3e6f4c0979 | [
"MIT"
] | 6 | 2021-03-19T01:58:42.000Z | 2022-03-11T23:52:43.000Z | core/util.py | jepret/jepret-backend | 2a892e1a7141da09d286b14f47769c3e6f4c0979 | [
"MIT"
] | null | null | null | from string import ascii_letters
from flask import jsonify
from random import choice
def respond_data(data, status_code=200):
return jsonify({"data": data, "code": status_code}), status_code
def generate_random_str(length=30):
return "".join([choice(ascii_letters) for _ in range(length)])
| 25.166667 | 68 | 0.758278 | 44 | 302 | 5 | 0.545455 | 0.136364 | 0.127273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.019157 | 0.135762 | 302 | 11 | 69 | 27.454545 | 0.823755 | 0 | 0 | 0 | 0 | 0 | 0.02649 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.428571 | 0.285714 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 3 |
5b275eeadcf1bdb6b8226782f91d78138b370c5e | 18,847 | py | Python | training/Tuning_SVM.py | bateman/twitpersonality | 0d25ecf617f414f55f472144e8f57026b5cca1c3 | [
"Apache-2.0"
] | 21 | 2018-08-05T15:13:00.000Z | 2021-09-29T04:42:30.000Z | training/Tuning_SVM.py | bateman/twitpersonality | 0d25ecf617f414f55f472144e8f57026b5cca1c3 | [
"Apache-2.0"
] | 5 | 2019-02-10T12:48:32.000Z | 2021-06-16T10:30:22.000Z | training/Tuning_SVM.py | bateman/twitpersonality | 0d25ecf617f414f55f472144e8f57026b5cca1c3 | [
"Apache-2.0"
] | 7 | 2019-07-12T12:41:43.000Z | 2022-03-24T14:27:04.000Z | from sklearn.model_selection import KFold, cross_val_score
from sklearn.metrics import mean_squared_error
from scipy.stats.stats import pearsonr
import numpy as np
from sklearn.svm import SVR
import datasetUtils as dsu
import embeddings
import sys
import os
def pccMean(arr):
pcc_only = np.array(list(scor[0] for scor in arr))
pcc_only = pcc_only[np.where(~np.isnan(pcc_only))]
if len(pcc_only) != 0:
mean_score = np.mean(pcc_only)
else: #all elements are nan
mean_score = "nan"
return mean_score
#configs
post_threshold = 3
#parse cmd arguments
if len(sys.argv) != 5 or sys.argv[1] not in ['O','C','E','A','N','o','c','e','a','n'] or sys.argv[2] not in ['fasttext', 'dataset9'] or not os.path.exists(sys.argv[3]) or sys.argv[4] not in ['True', 'False', 'yes', 'no']:
print("Usage:", sys.argv[0], "<BIG5_trait> <embeddings_dataset> <dataset_path> <shuffle_data>")
print("\tBIG5_trait: [O, C, E, A, N, o, c, e, a, n]")
print("\tembeddings_dataset: [fasttext, dataset9]")
print("\tdataset_path: [path/to/the/file]")
print("\tshuffle_data: [yes, no], [True, False]")
sys.exit(1)
else:
big5 = sys.argv[1].upper()
dataset = sys.argv[2]
dataset_path = sys.argv[3]
shuffle = sys.argv[4]
posts = []
yO = []
yC = []
yE = []
yA = []
yN = []
print("Loading myPersonality...")
[posts, yO, yC, yE, yA, yN] = dsu.readMyPersonality()
print("Loading embeddings dataset...")
if dataset == 'fasttext':
transform = True
wordDictionary = dsu.parseFastText(dataset_path)
else:
transform = False
wordDictionary = dsu.loadEmbeddingsDataset(dataset_path)
print("Data successfully loaded.")
filename = "tuning_SVM_"+big5+"_"+dataset
if shuffle == 'True' or shuffle == 'yes' or shuffle == 'true':
s = np.arange(posts.shape[0])
np.random.shuffle(s)
posts = posts[s]
yO = yO[s]
yC = yC[s]
yE = yE[s]
yA = yA[s]
yN = yN[s]
filename = filename + "_shuffle"
print("Data shuffled.")
else:
filename = filename + "_noShuffle"
pcc_filename = filename + "_pcc.txt"
filename = filename + ".csv"
#only for test
#subsetSize = len(sumE)
subsetSize = 100
posts = posts[0:subsetSize]
yO = yO[0:subsetSize]
yC = yC[0:subsetSize]
yE = yE[0:subsetSize]
yA = yA[0:subsetSize]
yN = yN[0:subsetSize]
#save lists because transformTextForTraining() changes them
old_yO = yO
old_yC = yC
old_yE = yE
old_yA = yA
old_yN = yN
[sumE, yO, yC, yE, yA, yN] = embeddings.transformTextForTraining(wordDictionary, post_threshold, posts, old_yO, old_yC, old_yE, old_yA, old_yN, "sum", transform)
maxE = embeddings.transformTextForTraining(wordDictionary, post_threshold, posts, old_yO, old_yC, old_yE, old_yA, old_yN, "max", transform)[0]
minE = embeddings.transformTextForTraining(wordDictionary, post_threshold, posts, old_yO, old_yC, old_yE, old_yA, old_yN, "min", transform)[0]
avgE = embeddings.transformTextForTraining(wordDictionary, post_threshold, posts, old_yO, old_yC, old_yE, old_yA, old_yN, "avg", transform)[0]
conE = embeddings.transformTextForTraining(wordDictionary, post_threshold, posts, old_yO, old_yC, old_yE, old_yA, old_yN, "conc", transform)[0]
if big5 == 'O':
labels = yO
elif big5 == 'C':
labels = yC
elif big5 == 'E':
labels = yE
elif big5 == 'A':
labels = yA
elif big5 == 'N':
labels = yN
if not os.path.exists("Results"):
os.makedirs("Results")
try:
os.remove("Results/"+filename)
except FileNotFoundError:
pass
try:
os.remove("Results/"+pcc_filename)
except FileNotFoundError:
pass
j = 1
k_fold = KFold(n_splits=10)
for data in [sumE, maxE, minE, avgE, conE]:
if j==1:
method = "sum"
print("computing results for sum...")
elif j==2:
method = "max"
print("computing results for max...")
elif j==3:
method = "min"
print("computing results for min...")
elif j==4:
method = "avg"
print("computing results for avg...")
elif j==5:
method = "conc"
print("computing results for concat...")
j += 1
linear = np.zeros([3,10,2], dtype=np.float)
poly_c1_d2 = np.zeros([3,10,2], dtype=np.float)
poly_c10_d2 = np.zeros([3,10,2], dtype=np.float)
poly_c100_d2 = np.zeros([3,10,2], dtype=np.float)
poly_c1_d3 = np.zeros([3,10,2], dtype=np.float)
poly_c10_d3 = np.zeros([3,10,2], dtype=np.float)
poly_c100_d3 = np.zeros([3,10,2], dtype=np.float)
rbf_g001_c1 = np.zeros([3,10,2], dtype=np.float)
rbf_g001_c10 = np.zeros([3,10,2], dtype=np.float)
rbf_g001_c100 = np.zeros([3,10,2], dtype=np.float)
rbf_g01_c1 = np.zeros([3,10,2], dtype=np.float)
rbf_g01_c10 = np.zeros([3,10,2], dtype=np.float)
rbf_g01_c100 = np.zeros([3,10,2], dtype=np.float)
rbf_g1_c1 = np.zeros([3,10,2], dtype=np.float)
rbf_g1_c10 = np.zeros([3,10,2], dtype=np.float)
rbf_g1_c100 = np.zeros([3,10,2], dtype=np.float)
rbf_g10_c1 = np.zeros([3,10,2], dtype=np.float)
rbf_g10_c10 = np.zeros([3,10,2], dtype=np.float)
rbf_g10_c100 = np.zeros([3,10,2], dtype=np.float)
i=1
for train, test in k_fold.split(data):
print("[CV iteration %d]"%i)
model = SVR(kernel='linear', C=1).fit(data[train],labels[train])
res = model.predict(data[test])
linear[0][i-1] = (mean_squared_error(labels[test],res))
linear[1][i-1] = (model.score(data[test], labels[test]))
linear[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
#print(pearsonr(res, labels[test]))
model = SVR(kernel='poly', degree=2, C=1).fit(data[train],labels[train])
res = model.predict(data[test])
poly_c1_d2[0][i-1] = (mean_squared_error(labels[test],res))
poly_c1_d2[1][i-1] = (model.score(data[test], labels[test]))
poly_c1_d2[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='poly', degree=2, C=10).fit(data[train],labels[train])
res = model.predict(data[test])
poly_c10_d2[0][i-1] = (mean_squared_error(labels[test],res))
poly_c10_d2[1][i-1] = (model.score(data[test], labels[test]))
poly_c10_d2[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='poly', degree=2, C=100).fit(data[train],labels[train])
res = model.predict(data[test])
poly_c100_d2[0][i-1] = (mean_squared_error(labels[test],res))
poly_c100_d2[1][i-1] = (model.score(data[test], labels[test]))
poly_c100_d2[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='poly', degree=3, C=1).fit(data[train],labels[train])
res = model.predict(data[test])
poly_c1_d3[0][i-1] = (mean_squared_error(labels[test],res))
poly_c1_d3[1][i-1] = (model.score(data[test], labels[test]))
poly_c1_d3[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='poly', degree=3, C=10).fit(data[train],labels[train])
res = model.predict(data[test])
poly_c10_d3[0][i-1] = (mean_squared_error(labels[test],res))
poly_c10_d3[1][i-1] = (model.score(data[test], labels[test]))
poly_c10_d3[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='poly', degree=3, C=100).fit(data[train],labels[train])
res = model.predict(data[test])
poly_c100_d3[0][i-1] = (mean_squared_error(labels[test],res))
poly_c100_d3[1][i-1] = (model.score(data[test], labels[test]))
poly_c100_d3[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=0.01, C=1).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g001_c1[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g001_c1[1][i-1] = (model.score(data[test], labels[test]))
rbf_g001_c1[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=0.01, C=10).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g001_c10[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g001_c10[1][i-1] = (model.score(data[test], labels[test]))
rbf_g001_c10[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=0.01, C=100).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g001_c100[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g001_c100[1][i-1] = (model.score(data[test], labels[test]))
rbf_g001_c100[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=0.1, C=1).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g01_c1[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g01_c1[1][i-1] = (model.score(data[test], labels[test]))
rbf_g01_c1[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=0.1, C=10).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g01_c10[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g01_c10[1][i-1] = (model.score(data[test], labels[test]))
rbf_g01_c10[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=0.1, C=100).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g01_c100[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g01_c100[1][i-1] = (model.score(data[test], labels[test]))
rbf_g01_c100[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=1, C=1).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g1_c1[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g1_c1[1][i-1] = (model.score(data[test], labels[test]))
rbf_g1_c1[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=1, C=10).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g1_c10[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g1_c10[1][i-1] = (model.score(data[test], labels[test]))
rbf_g1_c10[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=1, C=100).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g1_c100[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g1_c100[1][i-1] = (model.score(data[test], labels[test]))
rbf_g1_c100[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=10, C=1).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g10_c1[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g10_c1[1][i-1] = (model.score(data[test], labels[test]))
rbf_g10_c1[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=10, C=10).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g10_c10[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g10_c10[1][i-1] = (model.score(data[test], labels[test]))
rbf_g10_c10[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
model = SVR(kernel='rbf', gamma=10, C=100).fit(data[train],labels[train])
res = model.predict(data[test])
rbf_g10_c100[0][i-1] = (mean_squared_error(labels[test],res))
rbf_g10_c100[1][i-1] = (model.score(data[test], labels[test]))
rbf_g10_c100[2][i-1] = (pearsonr(model.predict(data[test]), labels[test]))
i += 1
fp = open("Results/"+filename, "a+")
fp.write(method+",mse,linear,1,,,"+str(np.mean(linear[0]))+"\n")
fp.write(method+",r2,linear,1,,,"+str(np.mean(linear[1]))+"\n")
fp.write(method+",pcc,linear,1,,,"+str(pccMean(linear[2]))+"\n")
fp.write(method+",mse,poly,1,,2,"+str(np.mean(poly_c1_d2[0]))+"\n")
fp.write(method+",r2,poly,1,,2,"+str(np.mean(poly_c1_d2[1]))+"\n")
fp.write(method+",pcc,poly,1,,2,"+str(pccMean(poly_c1_d2[2]))+"\n")
fp.write(method+",mse,poly,10,,2,"+str(np.mean(poly_c10_d2[0]))+"\n")
fp.write(method+",r2,poly,10,,2,"+str(np.mean(poly_c10_d2[1]))+"\n")
fp.write(method+",pcc,poly,10,,2,"+str(pccMean(poly_c10_d2[2]))+"\n")
fp.write(method+",mse,poly,100,,2,"+str(np.mean(poly_c100_d2[0]))+"\n")
fp.write(method+",r2,poly,100,,2,"+str(np.mean(poly_c100_d2[1]))+"\n")
fp.write(method+",pcc,poly,100,,2,"+str(pccMean(poly_c100_d2[2]))+"\n")
fp.write(method+",mse,poly,1,,3,"+str(np.mean(poly_c1_d3[0]))+"\n")
fp.write(method+",r2,poly,1,,3,"+str(np.mean(poly_c1_d3[1]))+"\n")
fp.write(method+",pcc,poly,1,,3,"+str(pccMean(poly_c1_d3[2]))+"\n")
fp.write(method+",mse,poly,10,,3,"+str(np.mean(poly_c10_d3[0]))+"\n")
fp.write(method+",r2,poly,10,,3,"+str(np.mean(poly_c10_d3[1]))+"\n")
fp.write(method+",pcc,poly,10,,3,"+str(pccMean(poly_c10_d3[2]))+"\n")
fp.write(method+",mse,poly,100,,3,"+str(np.mean(poly_c100_d3[0]))+"\n")
fp.write(method+",r2,poly,100,,3,"+str(np.mean(poly_c100_d3[1]))+"\n")
fp.write(method+",pcc,poly,100,,3,"+str(pccMean(poly_c100_d3[2]))+"\n")
fp.write(method+",mse,rbf,1,0.01,,"+str(np.mean(rbf_g001_c1[0]))+"\n")
fp.write(method+",r2,rbf,1,0.01,,"+str(np.mean(rbf_g001_c1[1]))+"\n")
fp.write(method+",pcc,rbf,1,0.01,,"+str(pccMean(rbf_g001_c1[2]))+"\n")
fp.write(method+",mse,rbf,10,0.01,,"+str(np.mean(rbf_g001_c10[0]))+"\n")
fp.write(method+",r2,rbf,10,0.01,,"+str(np.mean(rbf_g001_c10[1]))+"\n")
fp.write(method+",pcc,rbf,10,0.01,,"+str(pccMean(rbf_g001_c10[2]))+"\n")
fp.write(method+",mse,rbf,100,0.01,,"+str(np.mean(rbf_g001_c100[0]))+"\n")
fp.write(method+",r2,rbf,100,0.01,,"+str(np.mean(rbf_g001_c100[1]))+"\n")
fp.write(method+",pcc,rbf,100,0.01,,"+str(pccMean(rbf_g001_c100[2]))+"\n")
fp.write(method+",mse,rbf,1,0.1,,"+str(np.mean(rbf_g01_c1[0]))+"\n")
fp.write(method+",r2,rbf,1,0.1,,"+str(np.mean(rbf_g01_c1[1]))+"\n")
fp.write(method+",pcc,rbf,1,0.1,,"+str(pccMean(rbf_g01_c1[2]))+"\n")
fp.write(method+",mse,rbf,10,0.1,,"+str(np.mean(rbf_g01_c10[0]))+"\n")
fp.write(method+",r2,rbf,10,0.1,,"+str(np.mean(rbf_g01_c10[1]))+"\n")
fp.write(method+",pcc,rbf,10,0.1,,"+str(pccMean(rbf_g01_c10[2]))+"\n")
fp.write(method+",mse,rbf,100,0.1,,"+str(np.mean(rbf_g01_c100[0]))+"\n")
fp.write(method+",r2,rbf,100,0.1,,"+str(np.mean(rbf_g01_c100[1]))+"\n")
fp.write(method+",pcc,rbf,100,0.1,,"+str(pccMean(rbf_g01_c100[2]))+"\n")
fp.write(method+",mse,rbf,1,1,,"+str(np.mean(rbf_g1_c1[0]))+"\n")
fp.write(method+",r2,rbf,1,1,,"+str(np.mean(rbf_g1_c1[1]))+"\n")
fp.write(method+",pcc,rbf,1,1,,"+str(pccMean(rbf_g1_c1[2]))+"\n")
fp.write(method+",mse,rbf,10,1,,"+str(np.mean(rbf_g1_c10[0]))+"\n")
fp.write(method+",r2,rbf,10,1,,"+str(np.mean(rbf_g1_c10[1]))+"\n")
fp.write(method+",pcc,rbf,10,1,,"+str(pccMean(rbf_g1_c10[2]))+"\n")
fp.write(method+",mse,rbf,100,1,,"+str(np.mean(rbf_g1_c100[0]))+"\n")
fp.write(method+",r2,rbf,100,1,,"+str(np.mean(rbf_g1_c100[1]))+"\n")
fp.write(method+",pcc,rbf,100,1,,"+str(pccMean(rbf_g1_c100[2]))+"\n")
fp.write(method+",mse,rbf,1,10,,"+str(np.mean(rbf_g10_c1[0]))+"\n")
fp.write(method+",r2,rbf,1,10,,"+str(np.mean(rbf_g10_c1[1]))+"\n")
fp.write(method+",pcc,rbf,1,10,,"+str(pccMean(rbf_g10_c1[2]))+"\n")
fp.write(method+",mse,rbf,10,10,,"+str(np.mean(rbf_g10_c10[0]))+"\n")
fp.write(method+",r2,rbf,10,10,,"+str(np.mean(rbf_g10_c10[1]))+"\n")
fp.write(method+",pcc,rbf,10,10,,"+str(pccMean(rbf_g10_c10[2]))+"\n")
fp.write(method+",mse,rbf,100,10,,"+str(np.mean(rbf_g10_c100[0]))+"\n")
fp.write(method+",r2,rbf,100,10,,"+str(np.mean(rbf_g10_c100[1]))+"\n")
fp.write(method+",pcc,rbf,100,10,,"+str(pccMean(rbf_g10_c100[2]))+"\n")
fp.close()
#print (linear[2])
#input()
fp = open("Results/"+pcc_filename, "a+")
fp.write(method+",pcc,linear,1,,\n")
for elem in linear[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,poly,1,,2\n")
for elem in poly_c1_d2[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,poly,10,,2\n")
for elem in poly_c10_d2[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,poly,100,,2\n")
for elem in poly_c100_d2[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,poly,1,,3\n")
for elem in poly_c1_d3[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,poly,10,,3\n")
for elem in poly_c10_d3[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,poly,100,,3\n")
for elem in poly_c100_d3[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,1,0.01,\n")
for elem in rbf_g001_c1[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,10,0.01,\n")
for elem in rbf_g001_c10[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,100,0.01,\n")
for elem in rbf_g001_c100[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,1,0.1,\n")
for elem in rbf_g01_c1[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,10,0.1,\n")
for elem in rbf_g01_c10[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,100,0.1,\n")
for elem in rbf_g01_c100[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,1,1,\n")
for elem in rbf_g1_c1[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,10,1,\n")
for elem in rbf_g1_c10[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,100,1,\n")
for elem in rbf_g1_c100[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,1,10,\n")
for elem in rbf_g10_c1[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,10,10,\n")
for elem in rbf_g10_c10[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.write(method+",pcc,rbf,100,10,\n")
for elem in rbf_g10_c100[2]:
fp.write(str(elem[0])+"\t"+str(elem[1])+"\n")
fp.write("\n")
fp.close()
| 44.241784 | 221 | 0.61076 | 3,258 | 18,847 | 3.410681 | 0.058318 | 0.071814 | 0.066955 | 0.093233 | 0.785097 | 0.772138 | 0.741541 | 0.732991 | 0.688625 | 0.586123 | 0 | 0.077799 | 0.156364 | 18,847 | 425 | 222 | 44.345882 | 0.621069 | 0.010453 | 0 | 0.184987 | 0 | 0.002681 | 0.118341 | 0.001127 | 0 | 0 | 0 | 0 | 0 | 1 | 0.002681 | false | 0.005362 | 0.024129 | 0 | 0.029491 | 0.040214 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5b3a07e7c03bc79816ee75698b38741b046bc206 | 1,249 | py | Python | atrope/opts.py | enolfc/atrope | 0a7f46e221efd98762221a649a4c723fa1f311bf | [
"Apache-2.0"
] | 1 | 2016-05-18T11:46:14.000Z | 2016-05-18T11:46:14.000Z | atrope/opts.py | enolfc/atrope | 0a7f46e221efd98762221a649a4c723fa1f311bf | [
"Apache-2.0"
] | 7 | 2015-01-28T10:07:55.000Z | 2018-06-11T15:37:00.000Z | atrope/opts.py | enolfc/atrope | 0a7f46e221efd98762221a649a4c723fa1f311bf | [
"Apache-2.0"
] | 3 | 2016-12-01T13:57:38.000Z | 2021-07-13T08:10:12.000Z | # -*- coding: utf-8 -*-
# Copyright 2015 Spanish National Research Council (CSIC)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import itertools
import atrope.cache
import atrope.dispatcher.glance
import atrope.dispatcher.manager
import atrope.image_list.hepix
import atrope.image_list.manager
import atrope.paths
import atrope.smime
def list_opts():
return [
('DEFAULT', itertools.chain(atrope.image.opts,
atrope.paths.opts,
atrope.smime.opts)
),
('cache', atrope.cache.opts),
('sources', atrope.image_list.hepix.opts),
('dispatcher', atrope.dispatcher.manager.opts),
('glance', atrope.dispatcher.glance.opts),
]
| 32.025641 | 75 | 0.686149 | 161 | 1,249 | 5.298137 | 0.540373 | 0.098476 | 0.052755 | 0.037515 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00925 | 0.220977 | 1,249 | 38 | 76 | 32.868421 | 0.86742 | 0.480384 | 0 | 0 | 0 | 0 | 0.055205 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.052632 | true | 0 | 0.421053 | 0.052632 | 0.526316 | 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 |
5b4cdb0931ffe3ccbe3b17c3b3ce8cd32047e859 | 2,337 | py | Python | app/models/user.py | esirK/ShoppingListAPI | a3b3147360f75ade3782ea248b5c9e0b76675f78 | [
"Apache-2.0"
] | null | null | null | app/models/user.py | esirK/ShoppingListAPI | a3b3147360f75ade3782ea248b5c9e0b76675f78 | [
"Apache-2.0"
] | 2 | 2017-10-03T14:26:51.000Z | 2018-01-07T03:30:11.000Z | app/models/user.py | esirK/ShoppingListAPI | a3b3147360f75ade3782ea248b5c9e0b76675f78 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from time import time
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer, SignatureExpired, BadSignature
from werkzeug.security import generate_password_hash, check_password_hash
from app import config
from app.init_db import db
from app.models.item import Item
from app.models.shoppinglist import ShoppingList
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(64))
email = db.Column(db.String(64), unique=True, index=True)
password = db.Column(db.String(104))
shopping_lists = db.relationship(ShoppingList, backref='owner', lazy='dynamic')
items = db.relationship(Item, backref='items_owner', lazy='dynamic')
joined_on = db.Column(db.DateTime, default=datetime.utcnow)
date_modified = db.Column(db.DateTime, default=datetime.utcnow,
onupdate=datetime.utcnow)
def __init__(self, username, email, password):
self.username = username
self.email = email
self.set_password(password)
def __repr__(self):
"""
string representation that can be used for debugging
and testing purposes.
"""
return '<User %r>' % self.email
def set_password(self, password):
"""
Sets current users password as a password hash
"""
self.password = generate_password_hash(password)
def check_password(self, password):
return check_password_hash(self.password, password)
def generate_auth_token(self, expiration=600, configurations=""):
s = Serializer(config[configurations].SECRET_KEY, expires_in=expiration)
return s.dumps({'id': self.id, 'username': self.username, 'expires_at': int((time())*1000) + expiration*1000})
@staticmethod
def verify_auth_token(token, configuration):
s = Serializer(config[configuration].SECRET_KEY)
try:
data = s.loads(token)
except SignatureExpired:
from app.exceptions import TokenExpired
raise TokenExpired # valid token, but expired
except BadSignature:
from app.exceptions import InvalidToken
raise InvalidToken # invalid token
user = User.query.get(data['id'])
return user
| 37.095238 | 118 | 0.682071 | 272 | 2,337 | 5.724265 | 0.386029 | 0.026975 | 0.038536 | 0.030829 | 0.073218 | 0.050096 | 0.050096 | 0 | 0 | 0 | 0 | 0.009928 | 0.224219 | 2,337 | 62 | 119 | 37.693548 | 0.848869 | 0.06932 | 0 | 0 | 1 | 0 | 0.031176 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0.177778 | 0.222222 | 0.022222 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
5ba6b428a904314035a8d3534008128175cad5cc | 3,567 | py | Python | pythonScripts/synthesize_file.py | FuckBrains/videoAutoProduction | e6988c1d2debd511b63968a55e29c4d2373c5ab6 | [
"MIT"
] | 18 | 2019-10-02T13:04:25.000Z | 2022-03-01T03:24:10.000Z | pythonScripts/synthesize_file.py | JDuggal760/videoAutoProduction | e6988c1d2debd511b63968a55e29c4d2373c5ab6 | [
"MIT"
] | 1 | 2021-04-28T14:33:36.000Z | 2022-01-28T09:43:21.000Z | pythonScripts/synthesize_file.py | JDuggal760/videoAutoProduction | e6988c1d2debd511b63968a55e29c4d2373c5ab6 | [
"MIT"
] | 7 | 2020-01-02T14:48:51.000Z | 2021-11-15T17:05:50.000Z | import argparse
# [START tts_synthesize_text_file]
def synthesize_text_file(text_file):
"""Synthesizes speech from the input file of text."""
from google.cloud import texttospeech
client = texttospeech.TextToSpeechClient()
with open(text_file, 'r') as f:
text = f.read()
input_text = texttospeech.types.SynthesisInput(text=text)
# Note: the voice can also be specified by name.
# Names of voices can be retrieved with client.list_voices().
voice = texttospeech.types.VoiceSelectionParams(
language_code='en-AU',
name='en-AU-Wavenet-C',
ssml_gender=texttospeech.enums.SsmlVoiceGender.NEUTRAL)
audio_config = texttospeech.types.AudioConfig(
audio_encoding=texttospeech.enums.AudioEncoding.MP3,
speaking_rate=0.80)
response = client.synthesize_speech(input_text, voice, audio_config)
# The response's audio_content is binary.
filename = text_file
try:
filename = filename.replace('.txt', '.mp3')
filename = filename.replace('../Articles/', '')
filename = filename.replace(';', ' ')
filename = filename.replace("'", " ")
except Exception as e:
print(e)
print('Check replace command in synthesize_file.py file')
with open(filename, 'wb') as out:
out.write(response.audio_content)
print(f'Audio content written to file: \n{filename}\n')
# [END tts_synthesize_text_file]
# [START tts_synthesize_ssml_file]
def synthesize_ssml_file(ssml_file):
"""Synthesizes speech from the input file of ssml.
Note: ssml must be well-formed according to:
https://www.w3.org/TR/speech-synthesis/
"""
from google.cloud import texttospeech
client = texttospeech.TextToSpeechClient()
with open(ssml_file, 'r') as f:
ssml = f.read()
input_text = texttospeech.types.SynthesisInput(ssml=ssml)
# Note: the voice can also be specified by name.
# Names of voices can be retrieved with client.list_voices().
voice = texttospeech.types.VoiceSelectionParams(
language_code='en-AU',
name='en-AU-Wavenet-D',
ssml_gender=texttospeech.enums.SsmlVoiceGender.NEUTRAL)
audio_config = texttospeech.types.AudioConfig(
audio_encoding=texttospeech.enums.AudioEncoding.MP3,
speaking_rate=0.80)
response = client.synthesize_speech(input_text, voice, audio_config)
# The response's audio_content is binary.
filename = ssml_file
try:
filename = filename.replace('.txt', '.mp3')
filename = filename.replace('../Articles/', '')
filename = filename.replace(';', ' ')
filename = filename.replace("'", " ")
except Exception as e:
print(e)
print('Check replace command in synthesize_file.py file')
with open(filename, 'wb') as out:
out.write(response.audio_content)
print(f'Audio content written to file: \n{filename}\n')
# [END tts_synthesize_ssml_file]
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument('--text',
help='The text file from which to synthesize speech.')
group.add_argument('--ssml',
help='The ssml file from which to synthesize speech.')
args = parser.parse_args()
if args.text:
synthesize_text_file(args.text)
else:
synthesize_ssml_file(args.ssml)
| 34.298077 | 77 | 0.671713 | 427 | 3,567 | 5.444965 | 0.276347 | 0.027527 | 0.07914 | 0.018065 | 0.75957 | 0.75957 | 0.732903 | 0.694194 | 0.660645 | 0.660645 | 0 | 0.003953 | 0.219793 | 3,567 | 103 | 78 | 34.631068 | 0.831477 | 0.170451 | 0 | 0.597015 | 0 | 0 | 0.133971 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.029851 | false | 0 | 0.044776 | 0 | 0.074627 | 0.089552 | 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 |
5baea419ef710018686ca69fb18a6299df97c06b | 67 | py | Python | coda/coda_mdstore/tests/__init__.py | unt-libraries/coda | 959abc220f49bb9f5b19e13b61714b8be0615412 | [
"BSD-3-Clause"
] | 2 | 2015-06-30T04:20:47.000Z | 2021-03-31T16:35:35.000Z | coda/coda_mdstore/tests/__init__.py | unt-libraries/coda | 959abc220f49bb9f5b19e13b61714b8be0615412 | [
"BSD-3-Clause"
] | 141 | 2015-06-16T20:33:49.000Z | 2021-07-12T16:35:06.000Z | coda/coda_mdstore/tests/__init__.py | unt-libraries/coda | 959abc220f49bb9f5b19e13b61714b8be0615412 | [
"BSD-3-Clause"
] | 1 | 2017-01-23T19:17:29.000Z | 2017-01-23T19:17:29.000Z | CODA_XML = '{http://digital2.library.unt.edu/coda/bagxml/}codaXML'
| 33.5 | 66 | 0.746269 | 10 | 67 | 4.9 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015625 | 0.044776 | 67 | 1 | 67 | 67 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0.791045 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5bbc0f70dd0c9c74433d6406d8f5b59763ab6610 | 685 | py | Python | Support/Fuego/Pythia/pythia-0.4/packages/fuego/fuego/serialization/chemkin/unpickle/tokens/ReactionSection.py | marient/PelePhysics | e6ad1839d77b194e09ab44ff850c9489652e5d81 | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-04-24T13:32:23.000Z | 2019-04-24T13:32:23.000Z | Support/Fuego/Pythia/pythia-0.4/packages/fuego/fuego/serialization/chemkin/unpickle/tokens/ReactionSection.py | marient/PelePhysics | e6ad1839d77b194e09ab44ff850c9489652e5d81 | [
"BSD-3-Clause-LBNL"
] | null | null | null | Support/Fuego/Pythia/pythia-0.4/packages/fuego/fuego/serialization/chemkin/unpickle/tokens/ReactionSection.py | marient/PelePhysics | e6ad1839d77b194e09ab44ff850c9489652e5d81 | [
"BSD-3-Clause-LBNL"
] | null | null | null | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2003 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
from Token import Token
class ReactionSection(Token):
pattern = r"[Rr][Ee][Aa][Cc]([Tt][Ii][Oo][Nn][Ss])?"
def identify(self, auth):
return auth.aReactionSection(self)
def __str__(self):
return "{Reaction section}"
# version
__id__ = "$Id$"
#
# End of file
| 19.027778 | 82 | 0.405839 | 57 | 685 | 4.736842 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015686 | 0.255474 | 685 | 35 | 83 | 19.571429 | 0.513725 | 0.559124 | 0 | 0 | 0 | 0 | 0.212544 | 0.135889 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.25 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
5bd534155868c02c2ec0d3e45d9dbd0f9718f577 | 104 | py | Python | 02_If/Step03/gamjapark.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | 02_If/Step03/gamjapark.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | 3 | 2020-11-04T05:38:53.000Z | 2021-03-02T02:15:19.000Z | 02_If/Step03/gamjapark.py | StudyForCoding/BEAKJOON | 84e1c5e463255e919ccf6b6a782978c205420dbf | [
"MIT"
] | null | null | null | year = int(input())
print("1") if year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) else print("0") | 52 | 84 | 0.548077 | 20 | 104 | 2.85 | 0.65 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.148148 | 0.221154 | 104 | 2 | 84 | 52 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0.019048 | 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 |
751b1f98669a8f53f90553d3b38d44ac1b2489f7 | 1,597 | py | Python | Lab2_test/tests/test_func_1.py | WinterInside1/ISP | 75e9a622d720c5e3e09f34c623ec99346273c842 | [
"MIT"
] | null | null | null | Lab2_test/tests/test_func_1.py | WinterInside1/ISP | 75e9a622d720c5e3e09f34c623ec99346273c842 | [
"MIT"
] | null | null | null | Lab2_test/tests/test_func_1.py | WinterInside1/ISP | 75e9a622d720c5e3e09f34c623ec99346273c842 | [
"MIT"
] | null | null | null | from CustomSerializer.task import func_serializer
CUR_PATH = ""
CODE_NAME = "Serialized_function.txt"
lol = 42
def SaveFunction(f):
func_serializer.function_dump(f, CUR_PATH + CODE_NAME)
def LoadFunction():
fc = func_serializer.function_load(CUR_PATH + CODE_NAME)
return {fc}
def f_consts_answer(x: int) -> int:
return 5542 + x
def f_consts(x: int) -> int:
return x + lol + 5500
def f_recursion_answer(x: int) -> int:
if x < 0: x = 0
return (x * (x + 1)) // 2
def f_recursion(x: int) -> int:
if x < 1: return 0
return x + f_recursion(x - 1)
def f_connections_answer(s: str) -> str:
return "Hello, Test! " + s
def f_connections_also(s: str) -> str:
def f_connections_sub(): return "Test! "
return f_connections_sub() + str(s)
def f_connections(s: str) -> str:
return "Hello, " + f_connections_also(s)
def f_closures_answer(a, x):
return a + x
def f_closures(a):
def f_closures_sub(x):
return a + x
return f_closures_sub
def test_f_consts():
SaveFunction(f_consts)
x = 13
for f in LoadFunction():
assert f(x) == f_consts_answer(x)
def test_f_recursion():
SaveFunction(f_recursion)
x = 42
for f in LoadFunction():
assert f(x) == f_recursion_answer(x)
def test_f_connections():
SaveFunction(f_connections)
x = "Success!"
for f in LoadFunction():
assert f(x) == f_connections_answer(x)
def test_f_closures():
SaveFunction(f_closures)
a, b = 13, 42
for f in LoadFunction():
assert f(a)(b) == f_closures_answer(a, b)
| 18.147727 | 60 | 0.640576 | 245 | 1,597 | 3.942857 | 0.2 | 0.045549 | 0.028986 | 0.074534 | 0.218427 | 0.113872 | 0.113872 | 0.083851 | 0 | 0 | 0 | 0.020593 | 0.239825 | 1,597 | 87 | 61 | 18.356322 | 0.775124 | 0 | 0 | 0.115385 | 0 | 0 | 0.035692 | 0.014402 | 0 | 0 | 0 | 0 | 0.076923 | 1 | 0.326923 | false | 0 | 0.019231 | 0.134615 | 0.557692 | 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 |
f342f7ce505e7928c7492cb9f499236c0bfc61bc | 1,808 | py | Python | tests/test_email.py | chandrakantap/kanpai | 7ebd49c23c6bb96dbba94421ad9f4999ba21e841 | [
"MIT"
] | 3 | 2020-04-03T03:19:01.000Z | 2021-03-13T11:56:16.000Z | tests/test_email.py | chandrakantap/kanpai | 7ebd49c23c6bb96dbba94421ad9f4999ba21e841 | [
"MIT"
] | 4 | 2020-02-13T22:50:35.000Z | 2021-06-18T06:54:34.000Z | tests/test_email.py | chandrakantap/kanpai | 7ebd49c23c6bb96dbba94421ad9f4999ba21e841 | [
"MIT"
] | 5 | 2020-06-07T01:16:42.000Z | 2021-03-15T20:51:39.000Z | import kanpai.email as email
# test non string data
def test_validate_string():
schema = email.Email()
result = schema.validate({'name': 'kanpai'})
assert result['success'] is False
assert result['error'] is not None
# test 'None' string data
def test_validate_string_on_None_data():
schema = email.Email()
result = schema.validate(None)
assert result['success'] is True
assert result['error'] is None
# test string data and valid email pattern
def test_validate_stringandpattern_success():
schema = email.Email()
result = schema.validate('a@b.com')
assert result['success'] is True
assert result['error'] is None
# test string data and invalid email pattern
def test_validate_stringandpattern_failure():
schema = email.Email(error="Please provide a valid email")
result = schema.validate('a@bcom')
assert result['success'] is False
assert result['error'] is not None
assert result['error'] == "Please provide a valid email"
# test email as required with data provided
def test_validate_email_required_success():
schema = (email.Email().trim().required('Email is required'))
result = schema.validate(' a@b.com')
assert result['success'] is True
assert result['error'] is None
# test email as required with blank data provided
def test_error_email_required_blank():
schema = (email.Email().trim().required('Email is required'))
result = schema.validate(' ')
assert result['success'] is False
assert result['error'] is not None
# test email as required with 'None' data provided
def test_error_email_required_None():
schema = (email.Email().trim().required('Email is required'))
result = schema.validate(None)
assert result['success'] is False
assert result['error'] is not None
| 30.133333 | 65 | 0.706858 | 246 | 1,808 | 5.093496 | 0.158537 | 0.143655 | 0.10854 | 0.117318 | 0.857941 | 0.822825 | 0.573823 | 0.514765 | 0.492418 | 0.492418 | 0 | 0 | 0.179204 | 1,808 | 59 | 66 | 30.644068 | 0.84434 | 0.147677 | 0 | 0.648649 | 0 | 0 | 0.148728 | 0 | 0 | 0 | 0 | 0 | 0.405405 | 1 | 0.189189 | false | 0 | 0.027027 | 0 | 0.216216 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f348ad3317b30652d8a41390d9aecad010dceaab | 412 | py | Python | app/grandchallenge/notifications/serializers.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 101 | 2018-04-11T14:48:04.000Z | 2022-03-28T00:29:48.000Z | app/grandchallenge/notifications/serializers.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 1,733 | 2018-03-21T11:56:16.000Z | 2022-03-31T14:58:30.000Z | app/grandchallenge/notifications/serializers.py | kaczmarj/grand-challenge.org | 8dc8a2170e51072354f7e94f2a22578805a67b94 | [
"Apache-2.0"
] | 42 | 2018-06-08T05:49:07.000Z | 2022-03-29T08:43:01.000Z | from actstream.models import Follow
from rest_framework import serializers
from grandchallenge.notifications.models import Notification
class NotificationSerializer(serializers.ModelSerializer):
class Meta:
model = Notification
fields = ("read",)
class FollowSerializer(serializers.ModelSerializer):
class Meta:
model = Follow
fields = ("pk", "flag")
| 24.235294 | 61 | 0.701456 | 37 | 412 | 7.783784 | 0.567568 | 0.083333 | 0.215278 | 0.243056 | 0.277778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.228155 | 412 | 16 | 62 | 25.75 | 0.90566 | 0 | 0 | 0.181818 | 0 | 0 | 0.025253 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.272727 | 0 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f34fb3d2f62f5bcb218b1a5dada34f2181d283e9 | 5,247 | py | Python | pysal/contrib/gwr/tests/test_sel_bw.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/contrib/gwr/tests/test_sel_bw.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/contrib/gwr/tests/test_sel_bw.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-07-19T01:46:17.000Z | 2021-07-19T01:46:17.000Z |
"""
GWR is tested against results from GWR4
"""
import unittest
import pickle as pk
from pysal.contrib.glm.family import Gaussian, Poisson, Binomial
from pysal.contrib.gwr.sel_bw import Sel_BW
import numpy as np
import pysal
class TestSelBW(unittest.TestCase):
def setUp(self):
data = pysal.open(pysal.examples.get_path('GData_utm.csv'))
self.coords = zip(data.by_col('X'), data.by_col('Y'))
self.y = np.array(data.by_col('PctBach')).reshape((-1,1))
rural = np.array(data.by_col('PctRural')).reshape((-1,1))
pov = np.array(data.by_col('PctPov')).reshape((-1,1))
black = np.array(data.by_col('PctBlack')).reshape((-1,1))
self.X = np.hstack([rural, pov, black])
self.XB = pk.load(open(pysal.examples.get_path('XB.p'), 'r'))
self.err = pk.load(open(pysal.examples.get_path('err.p'), 'r'))
def test_golden_fixed_AICc(self):
bw1 = 211027.34
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='bisquare',
fixed=True).search(criterion='AICc')
self.assertAlmostEqual(bw1, bw2)
def test_golden_adapt_AICc(self):
bw1 = 93.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='bisquare',
fixed=False).search(criterion='AICc')
self.assertAlmostEqual(bw1, bw2)
def test_golden_fixed_AIC(self):
bw1 = 76169.15
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=True).search(criterion='AIC')
self.assertAlmostEqual(bw1, bw2)
def test_golden_adapt_AIC(self):
bw1 = 50.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=False).search(criterion='AIC')
self.assertAlmostEqual(bw1, bw2)
def test_golden_fixed_BIC(self):
bw1 = 279451.43
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=True).search(criterion='BIC')
self.assertAlmostEqual(bw1, bw2)
def test_golden_adapt_BIC(self):
bw1 = 62.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=False).search(criterion='BIC')
self.assertAlmostEqual(bw1, bw2)
def test_golden_fixed_CV(self):
bw1 = 130406.67
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=True).search(criterion='CV')
self.assertAlmostEqual(bw1, bw2)
def test_golden_adapt_CV(self):
bw1 = 68.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=False).search(criterion='CV')
self.assertAlmostEqual(bw1, bw2)
def test_interval_fixed_AICc(self):
bw1 = 211025.0#211027.00
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='bisquare',
fixed=True).search(criterion='AICc', search='interval',
bw_min=211001.0, bw_max=211035.0, interval=2)
self.assertAlmostEqual(bw1, bw2)
def test_interval_adapt_AICc(self):
bw1 = 93.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='bisquare',
fixed=False).search(criterion='AICc', search='interval',
bw_min=90.0, bw_max=95.0, interval=1)
self.assertAlmostEqual(bw1, bw2)
def test_interval_fixed_AIC(self):
bw1 = 76175.0#76169.00
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=True).search(criterion='AIC', search='interval',
bw_min=76161.0, bw_max=76175.0, interval=1)
self.assertAlmostEqual(bw1, bw2)
def test_interval_adapt_AIC(self):
bw1 = 40.0#50.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=False).search(criterion='AIC', search='interval', bw_min=40.0,
bw_max=60.0, interval=2)
self.assertAlmostEqual(bw1, bw2)
def test_interval_fixed_BIC(self):
bw1 = 279461.0#279451.00
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=True).search(criterion='BIC', search='interval', bw_min=279441.0,
bw_max=279461.0, interval=2)
self.assertAlmostEqual(bw1, bw2)
def test_interval_adapt_BIC(self):
bw1 = 62.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=False).search(criterion='BIC', search='interval',
bw_min=52.0, bw_max=72.0, interval=2)
self.assertAlmostEqual(bw1, bw2)
def test_interval_fixed_CV(self):
bw1 = 130400.0#130406.00
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=True).search(criterion='CV', search='interval', bw_min=130400.0,
bw_max=130410.0, interval=1)
self.assertAlmostEqual(bw1, bw2)
def test_interval_adapt_CV(self):
bw1 = 62.0#68.0
bw2 = Sel_BW(self.coords, self.y, self.X, kernel='gaussian',
fixed=False).search(criterion='CV', search='interval', bw_min=60.0,
bw_max=76.0 , interval=2)
self.assertAlmostEqual(bw1, bw2)
if __name__ == '__main__':
unittest.main()
| 40.053435 | 87 | 0.599009 | 714 | 5,247 | 4.261905 | 0.158263 | 0.029576 | 0.042064 | 0.063096 | 0.750575 | 0.721656 | 0.721656 | 0.639829 | 0.623727 | 0.60138 | 0 | 0.071686 | 0.260911 | 5,247 | 130 | 88 | 40.361538 | 0.712996 | 0.015819 | 0 | 0.345794 | 0 | 0 | 0.058835 | 0 | 0 | 0 | 0 | 0 | 0.149533 | 1 | 0.158879 | false | 0 | 0.056075 | 0 | 0.224299 | 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 |
f35733e7cc32f730fdaaa7a4b5d07404a23b96a7 | 41 | py | Python | txsched/__init__.py | mutalisk999/txsched | 657f00388b054d34ce7502a209416dba1701e3c3 | [
"MIT"
] | null | null | null | txsched/__init__.py | mutalisk999/txsched | 657f00388b054d34ce7502a209416dba1701e3c3 | [
"MIT"
] | null | null | null | txsched/__init__.py | mutalisk999/txsched | 657f00388b054d34ce7502a209416dba1701e3c3 | [
"MIT"
] | null | null | null | #!encoding=utf8
__author__ = 'mutalisk'
| 10.25 | 23 | 0.731707 | 4 | 41 | 6.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.027778 | 0.121951 | 41 | 3 | 24 | 13.666667 | 0.694444 | 0.341463 | 0 | 0 | 0 | 0 | 0.307692 | 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 |
f3910ed9bd79f4ecfd34cb77c4ceef6c3e86e0b9 | 325 | py | Python | classifier_CoAtNet.py | Eren-Corn0712/CV_DL-Contrastive-Learning | c59ba5e2ae31c14ef4e175c79e3575e2cc7c439c | [
"MIT"
] | null | null | null | classifier_CoAtNet.py | Eren-Corn0712/CV_DL-Contrastive-Learning | c59ba5e2ae31c14ef4e175c79e3575e2cc7c439c | [
"MIT"
] | null | null | null | classifier_CoAtNet.py | Eren-Corn0712/CV_DL-Contrastive-Learning | c59ba5e2ae31c14ef4e175c79e3575e2cc7c439c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn #n
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import datasets, transforms
from tqdm.autonotebook import tqdm
import time
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
| 19.117647 | 49 | 0.772308 | 50 | 325 | 5.02 | 0.54 | 0.131474 | 0.103586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.196923 | 325 | 16 | 50 | 20.3125 | 0.961686 | 0.003077 | 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 |
45eaecf1e7de3ab87aca696da569241f5296d849 | 219 | py | Python | webproxy.py | TheJema/webproxy | 8944d258b0995a3d524bea995e36bfbf9e104646 | [
"CC0-1.0"
] | null | null | null | webproxy.py | TheJema/webproxy | 8944d258b0995a3d524bea995e36bfbf9e104646 | [
"CC0-1.0"
] | null | null | null | webproxy.py | TheJema/webproxy | 8944d258b0995a3d524bea995e36bfbf9e104646 | [
"CC0-1.0"
] | null | null | null | import requests
import os
proxies = {
"http": os.environ['QUOTAGUARDSHIELD_URL'],
"https": os.environ['QUOTAGUARDSHIELD_URL']
}
res = requests.get("https://www.google.com/", proxies=proxies)
print(res.text)
| 19.909091 | 63 | 0.69863 | 27 | 219 | 5.592593 | 0.592593 | 0.119205 | 0.331126 | 0.370861 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13242 | 219 | 10 | 64 | 21.9 | 0.794737 | 0 | 0 | 0 | 0 | 0 | 0.344498 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0.125 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
45eb3b0eb5e5a207959d159a8f96356c3aee0fc1 | 188 | py | Python | tilematrix/_types.py | StefanBrand/tilematrix | 6f8cd3b85f61434a7ce5d7b635c3ad8f18ccb268 | [
"MIT"
] | 16 | 2016-07-27T22:21:12.000Z | 2022-01-15T18:13:43.000Z | tilematrix/_types.py | StefanBrand/tilematrix | 6f8cd3b85f61434a7ce5d7b635c3ad8f18ccb268 | [
"MIT"
] | 30 | 2015-10-09T18:10:13.000Z | 2022-03-15T16:56:54.000Z | tilematrix/_types.py | StefanBrand/tilematrix | 6f8cd3b85f61434a7ce5d7b635c3ad8f18ccb268 | [
"MIT"
] | 2 | 2021-07-30T07:23:13.000Z | 2021-09-13T12:24:11.000Z | from collections import namedtuple
Bounds = namedtuple("Bounds", "left bottom right top")
Shape = namedtuple("Shape", "height width")
TileIndex = namedtuple("TileIndex", "zoom row col")
| 26.857143 | 54 | 0.744681 | 22 | 188 | 6.363636 | 0.727273 | 0.228571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12766 | 188 | 6 | 55 | 31.333333 | 0.853659 | 0 | 0 | 0 | 0 | 0 | 0.345745 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
45eebd4479eeee6118e2391061c5b36f1b13620a | 1,318 | py | Python | components/Tile.py | jawaff/oecs | 1ebc4ed59ba91866c2abcad3a8b286555fe3a640 | [
"MIT"
] | null | null | null | components/Tile.py | jawaff/oecs | 1ebc4ed59ba91866c2abcad3a8b286555fe3a640 | [
"MIT"
] | null | null | null | components/Tile.py | jawaff/oecs | 1ebc4ed59ba91866c2abcad3a8b286555fe3a640 | [
"MIT"
] | null | null | null | from component import Component
class Tile(Component):
"""Denotes a single tile within a chunk."""
def __init__( self, dData ):
Component.__init__(self, "TILE:%s"%(dData['componentID']), False, 0)
#Tells whether or not the tile is visible or not
self._is_Active = False
#Identifies the type of tile that is drawn (denotes tile IDs on the tile_atlas.)
self._tileID = 0
self._isTransparanent = True
def _Get_TileID(self):
return self._tileID
def _Set_TileID(self, iTileID):
self._tileID = iTileID
self._Set_Is_Active()
def _Get_Tile_AtlasID(self):
return self._tile_AtlasID
def _Set_Is_Active( self ):
"""Automatically determines if the tile is active or not depending on the tile's type."""
if self._tileID != 0:
self._is_Active = True
else:
self._is_Active = False
def _Get_Is_Active( self ):
return self._is_Active
def _Get_Is_Transparent(self):
return self._isTransparanent
def __str__( self ):
"""This is the tile's string representation for when it is saved to a file."""
offset = self._tileID%10 #This will get the first digit for our tileID
return str((self._tileID-offset)/10) + str(offset)
| 29.954545 | 97 | 0.639605 | 179 | 1,318 | 4.430168 | 0.357542 | 0.080706 | 0.06053 | 0.042875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00733 | 0.275417 | 1,318 | 43 | 98 | 30.651163 | 0.823037 | 0.276935 | 0 | 0.076923 | 0 | 0 | 0.019251 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0.038462 | 0.153846 | 0.576923 | 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 |
45efe88174a72d549e0207e6aa7c603a49c53843 | 886 | py | Python | canaro/__init__.py | MichalPitr/canaro | 7331ff718c6230173e9dac1c57c71b1ad3bd1000 | [
"MIT"
] | 9 | 2020-10-03T06:40:09.000Z | 2022-01-16T23:28:43.000Z | canaro/__init__.py | jasmcaus/caer-models | 5a4d2110491674897c14fd4bddd91f44478b10dc | [
"MIT"
] | null | null | null | canaro/__init__.py | jasmcaus/caer-models | 5a4d2110491674897c14fd4bddd91f44478b10dc | [
"MIT"
] | 2 | 2020-12-21T14:44:23.000Z | 2021-08-24T01:13:41.000Z | # Copyright (c) 2020 Jason Dsouza <jasmcaus@gmail.com>
# Protected under the MIT License (see LICENSE)
from ._meta import version as v
from ._meta import author as a
from ._meta import release as r
from ._meta import contributors as c
__author__ = a
__version__ = v
__contributors__ = c
__license__ = 'MIT License'
__copyright__ = 'Copyright (c) 2020 Jason Dsouza'
version = v
release = r
contributors = c
from .models import *
from .generators import *
from .utils import *
from .model import saveModel
from .model import testModel
from .train import lr_schedule
from .train import train
from .tools import expand
from .tools import random_distortion
from .tools import random_patch
from .tools import random_resize
from .tools import resize_image_fixed
from .tools import resize_image
from .tools import clip_boxes
from .tools import flip_image
from .tools import patch_image | 23.945946 | 54 | 0.788939 | 131 | 886 | 5.076336 | 0.343511 | 0.121805 | 0.203008 | 0.094737 | 0.153383 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010724 | 0.158014 | 886 | 37 | 55 | 23.945946 | 0.880697 | 0.110609 | 0 | 0 | 0 | 0 | 0.053435 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.714286 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
45f72f978458220e7e7f5eaf3dfe8e2dd973d1cc | 111 | py | Python | nexus/core/interfaces/runner.py | epicosy/nexus | a6342283592aec4dfe8ff02d47721edde829d38d | [
"MIT"
] | null | null | null | nexus/core/interfaces/runner.py | epicosy/nexus | a6342283592aec4dfe8ff02d47721edde829d38d | [
"MIT"
] | null | null | null | nexus/core/interfaces/runner.py | epicosy/nexus | a6342283592aec4dfe8ff02d47721edde829d38d | [
"MIT"
] | null | null | null | from cement import Interface
class RunnerInterface(Interface):
class Meta:
interface = 'runner'
| 13.875 | 33 | 0.702703 | 11 | 111 | 7.090909 | 0.727273 | 0.358974 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.234234 | 111 | 7 | 34 | 15.857143 | 0.917647 | 0 | 0 | 0 | 0 | 0 | 0.054545 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.75 | 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 |
34057f06828e99a1ea22beebf4036a015bec0c5d | 1,292 | py | Python | resources/dot_PyCharm/system/python_stubs/-762174762/win32uiole.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | 1 | 2020-04-20T02:27:20.000Z | 2020-04-20T02:27:20.000Z | resources/dot_PyCharm/system/python_stubs/cache/95df2ee6e9ac0f65d683793bba07f7a965eae0b286181e7fc2ca61d4a8417950/win32uiole.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | resources/dot_PyCharm/system/python_stubs/cache/95df2ee6e9ac0f65d683793bba07f7a965eae0b286181e7fc2ca61d4a8417950/win32uiole.py | basepipe/developer_onboarding | 05b6a776f8974c89517868131b201f11c6c2a5ad | [
"MIT"
] | null | null | null | # encoding: utf-8
# module win32uiole
# from C:\Python27\lib\site-packages\Pythonwin\win32uiole.pyd
# by generator 1.147
# no doc
# no imports
# Variables with simple values
COleClientItem_activeState = 3
COleClientItem_activeUIState = 4
COleClientItem_emptyState = 0
COleClientItem_loadedState = 1
COleClientItem_openState = 2
OLE_CHANGED = 0
OLE_CHANGED_ASPECT = 5
OLE_CHANGED_STATE = 4
OLE_CLOSED = 2
OLE_RENAMED = 3
OLE_SAVED = 1
# functions
def AfxOleInit(*args, **kwargs): # real signature unknown
pass
def CreateInsertDialog(*args, **kwargs): # real signature unknown
pass
def CreateOleClientItem(*args, **kwargs): # real signature unknown
pass
def CreateOleDocument(*args, **kwargs): # real signature unknown
pass
def DaoGetEngine(*args, **kwargs): # real signature unknown
pass
def EnableBusyDialog(*args, **kwargs): # real signature unknown
pass
def EnableNotRespondingDialog(*args, **kwargs): # real signature unknown
pass
def GetIDispatchForWindow(*args, **kwargs): # real signature unknown
pass
def OleGetUserCtrl(*args, **kwargs): # real signature unknown
pass
def OleSetUserCtrl(*args, **kwargs): # real signature unknown
pass
def SetMessagePendingDelay(*args, **kwargs): # real signature unknown
pass
# no classes
| 21.180328 | 72 | 0.743808 | 152 | 1,292 | 6.236842 | 0.407895 | 0.116034 | 0.162447 | 0.266878 | 0.42616 | 0.42616 | 0.390295 | 0 | 0 | 0 | 0 | 0.02037 | 0.164087 | 1,292 | 60 | 73 | 21.533333 | 0.857407 | 0.335139 | 0 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0.333333 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 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.