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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d5244a8f6b9f5d1a17060a82dc6f6b6bb0686ffb | 63 | py | Python | dash/__init__.py | unicefindia/dash | 8b3d16501a596f0ff5abc5395eea993420149a4e | [
"BSD-3-Clause"
] | null | null | null | dash/__init__.py | unicefindia/dash | 8b3d16501a596f0ff5abc5395eea993420149a4e | [
"BSD-3-Clause"
] | null | null | null | dash/__init__.py | unicefindia/dash | 8b3d16501a596f0ff5abc5395eea993420149a4e | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
__version__ = "1.3.2"
| 15.75 | 39 | 0.793651 | 9 | 63 | 4.555556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.054545 | 0.126984 | 63 | 3 | 40 | 21 | 0.690909 | 0 | 0 | 0 | 0 | 0 | 0.079365 | 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 |
d542aea7cc2080bbd5728a3a07c19ccec3a7f220 | 295 | py | Python | src/Vectors/vectors.py | vtarale/Perceptron | 6c38be5aa722943fdfa1f0904785a5e61c4ebe03 | [
"MIT"
] | 1 | 2022-03-04T12:31:23.000Z | 2022-03-04T12:31:23.000Z | src/Vectors/vectors.py | vtarale/Perceptron | 6c38be5aa722943fdfa1f0904785a5e61c4ebe03 | [
"MIT"
] | null | null | null | src/Vectors/vectors.py | vtarale/Perceptron | 6c38be5aa722943fdfa1f0904785a5e61c4ebe03 | [
"MIT"
] | null | null | null | class Vector:
def __init__(self, inputs: list):
self.inputs = inputs
def dot(self, weigths):
dot_product = 0
for index in range(len(self.inputs)):
dot_product = dot_product + (self.inputs[index] * weigths.inputs[index])
return dot_product | 32.777778 | 84 | 0.613559 | 37 | 295 | 4.675676 | 0.459459 | 0.231214 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004739 | 0.284746 | 295 | 9 | 85 | 32.777778 | 0.815166 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d54f78bc3e4909abd22eddaddbfd4d388945840d | 854 | py | Python | users/models.py | revaxl/library | 62ad57cd849eea92a0bb1344c32373cdd858db01 | [
"MIT"
] | 1 | 2021-02-25T14:45:42.000Z | 2021-02-25T14:45:42.000Z | users/models.py | revaxl/library | 62ad57cd849eea92a0bb1344c32373cdd858db01 | [
"MIT"
] | null | null | null | users/models.py | revaxl/library | 62ad57cd849eea92a0bb1344c32373cdd858db01 | [
"MIT"
] | 1 | 2020-02-12T17:36:22.000Z | 2020-02-12T17:36:22.000Z | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.urlresolvers import reverse
# Create your models here.
class Visitor(models.Model):
"""docstring for Visitor"""
user = models.OneToOneField(User, on_delete=models.CASCADE)
cin = models.IntegerField(null=True, blank=True)
def __str__(self):
return str(self.cin)
def __unicode__(self):
return str(self.cin)
def get_absolute_url(self):
return reverse("users:profile", kwargs={"id" : self.id})
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
Visitor.objects.create(user=instance)
@receiver(post_save, sender=User)
def save_user_profile(sender, instance, **kwargs):
instance.visitor.save() | 28.466667 | 61 | 0.761124 | 119 | 854 | 5.310924 | 0.420168 | 0.079114 | 0.037975 | 0.053797 | 0.164557 | 0.164557 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122951 | 854 | 30 | 62 | 28.466667 | 0.843792 | 0.055035 | 0 | 0.190476 | 0 | 0 | 0.018703 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.238095 | false | 0 | 0.238095 | 0.142857 | 0.761905 | 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 |
d5515935a7b5b0fc037efa376a03bc5c45913227 | 549 | py | Python | tests/test_strings/test_is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | tests/test_strings/test_is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | tests/test_strings/test_is_anagram.py | ueg1990/aids | bb543c6f53983d59edbc6a522ca10d64efd9c42e | [
"MIT"
] | null | null | null | import unittest
from aids.strings.is_anagram import *
class IsAnagramTestCase(unittest.TestCase):
'''
Unit tests for determine anagrams
'''
def setUp(self):
pass
def test_is_anagram_sort(self):
self.assertTrue(is_anagram_sort('listen', 'silent'))
def test_is_anagram(self):
self.assertTrue(is_anagram('listen', 'silent'))
def test_is_anagram_false(self):
self.assertFalse(is_anagram('cookie', 'kookie'))
def tearDown(self):
pass
if __name__ == '__main__':
unittest.main()
| 19.607143 | 57 | 0.67031 | 66 | 549 | 5.257576 | 0.484848 | 0.181556 | 0.07781 | 0.138329 | 0.317003 | 0.161383 | 0 | 0 | 0 | 0 | 0 | 0 | 0.209472 | 549 | 27 | 58 | 20.333333 | 0.799539 | 0.061931 | 0 | 0.133333 | 0 | 0 | 0.088353 | 0 | 0 | 0 | 0 | 0 | 0.2 | 1 | 0.333333 | false | 0.133333 | 0.133333 | 0 | 0.533333 | 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 |
d564d37c7d6d5bccdd0237d901fe0d4bc0905d4e | 569 | py | Python | dionysus/games/cah/player.py | ethanharstad/dionysus | 31d9595a0a26bb2d68673c636755b8c3dd6f80f9 | [
"MIT"
] | 1 | 2021-06-22T06:22:42.000Z | 2021-06-22T06:22:42.000Z | dionysus/games/cah/player.py | ethanharstad/dionysus | 31d9595a0a26bb2d68673c636755b8c3dd6f80f9 | [
"MIT"
] | 12 | 2021-05-20T22:03:45.000Z | 2021-06-09T05:12:14.000Z | dionysus/games/cah/player.py | ethanharstad/dionysus | 31d9595a0a26bb2d68673c636755b8c3dd6f80f9 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
class Player:
id: int
name: str
score: int
hand: list
def __init__(self, id, name="Anonymous"):
self.id = id
self.name = name
self.score = 0
self.hand = []
def __eq__(self, other):
if isinstance(other, Player):
return self.id == other.id
return False
def __hash__(self):
return self.id
def __str__(self):
return self.name
def __repr__(self):
return "Player({0.id}, {0.name})".format(self)
| 18.354839 | 54 | 0.564148 | 71 | 569 | 4.183099 | 0.380282 | 0.080808 | 0.080808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007792 | 0.323374 | 569 | 30 | 55 | 18.966667 | 0.763636 | 0 | 0 | 0 | 0 | 0 | 0.057996 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.227273 | false | 0 | 0.045455 | 0.136364 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
d5848671406594d72821c67ade0988620f8aac26 | 212 | py | Python | grads/forms.py | ofnlut/tiy-reverse-board | 6255e8f6cf255bf9e5cbd98d1ce736179e8b514a | [
"MIT"
] | 1 | 2017-07-01T04:07:40.000Z | 2017-07-01T04:07:40.000Z | grads/forms.py | ofnlut/tiy-reverse-board | 6255e8f6cf255bf9e5cbd98d1ce736179e8b514a | [
"MIT"
] | 6 | 2020-02-11T23:58:13.000Z | 2021-09-07T23:47:58.000Z | grads/forms.py | ofnlut/tiy-reverse-board | 6255e8f6cf255bf9e5cbd98d1ce736179e8b514a | [
"MIT"
] | 1 | 2020-12-21T11:35:19.000Z | 2020-12-21T11:35:19.000Z | from django import forms
from .models import Graduate
class EditProfileForm(forms.ModelForm):
class Meta:
model = Graduate
fields = ('first_name','last_name','job_title','Email','Linkedin')
| 23.555556 | 74 | 0.698113 | 25 | 212 | 5.8 | 0.76 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.188679 | 212 | 8 | 75 | 26.5 | 0.843023 | 0 | 0 | 0 | 0 | 0 | 0.193396 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
d592033262dc1a137fc6e2479e45e9551258cc03 | 1,745 | py | Python | app/blog_helpers.py | Jsinclairisto/flask-blog | d32776e6744d1c4f5b77f0f9c430287ea9661ccd | [
"MIT"
] | null | null | null | app/blog_helpers.py | Jsinclairisto/flask-blog | d32776e6744d1c4f5b77f0f9c430287ea9661ccd | [
"MIT"
] | null | null | null | app/blog_helpers.py | Jsinclairisto/flask-blog | d32776e6744d1c4f5b77f0f9c430287ea9661ccd | [
"MIT"
] | null | null | null | from markdown import markdown
from flask_wtf import FlaskForm
from flask import render_template
from flask_user import login_required, UserManager, UserMixin, SQLAlchemyAdapter
from wtforms import StringField, PasswordField, BooleanField, SubmitField
from wtforms.validators import DataRequired
from wtforms.validators import Length
from flask_sqlalchemy import SQLAlchemy
from app import app, db
import os
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(50), nullable=False, unique=True)
password = db.Column(db.String(255), nullable=False, server_default='')
active = db.Column(db.Boolean(), nullable=False, server_default='0')
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(min=6, max=25)])
password = PasswordField('Password', validators=[DataRequired(), Length(min=6, max=25)])
remember_me = BooleanField('Remember Me')
submit = SubmitField('Sign in')
class SignInForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(min=6, max=25)])
password = PasswordField('Password', validators=[DataRequired(), Length(min=6, max=25)])
emailAddress = StringField('Email', validators=[DataRequired(),Length(min=6, max=25)])
db_adapter = SQLAlchemyAdapter(db, User)
user_manager = UserManager(db_adapter, app)
def render_markdown(file_name, dir_path = 'app/templates'):
"""Takes the specified file path and
returns it as HTML
"""
html = ""
#os.path.join creates an OS-valid path
path = os.path.join(dir_path, file_name)
with open(path) as html_file:
html = html_file.read()
html = markdown(html)
return html
| 37.934783 | 93 | 0.735817 | 222 | 1,745 | 5.698198 | 0.378378 | 0.086957 | 0.110672 | 0.12253 | 0.249012 | 0.249012 | 0.249012 | 0.219763 | 0.219763 | 0.219763 | 0 | 0.014113 | 0.147278 | 1,745 | 45 | 94 | 38.777778 | 0.836022 | 0.051576 | 0 | 0.121212 | 0 | 0 | 0.042125 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.030303 | false | 0.121212 | 0.30303 | 0 | 0.787879 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
d5987f17b2cd512a072ceb62c4231af08bb154d5 | 844 | py | Python | bindings/python/cconfigspace/__init__.py | deephyper/CCS | dd8c976eca2a510c995862cc5c871e81932f3ff4 | [
"BSD-3-Clause"
] | 1 | 2021-11-29T16:31:28.000Z | 2021-11-29T16:31:28.000Z | bindings/python/cconfigspace/__init__.py | deephyper/CCS | dd8c976eca2a510c995862cc5c871e81932f3ff4 | [
"BSD-3-Clause"
] | 1 | 2021-12-15T10:37:41.000Z | 2021-12-15T10:48:24.000Z | bindings/python/cconfigspace/__init__.py | deephyper/CCS | dd8c976eca2a510c995862cc5c871e81932f3ff4 | [
"BSD-3-Clause"
] | 2 | 2021-09-16T18:20:47.000Z | 2021-12-07T17:54:11.000Z | import platform
import ctypes as ct
import os
if os.environ.get('LIBCCONFIGSPACE_SO_'):
libcconfigspace = ct.cdll.LoadLibrary(os.environ.get('LIBCCONFIGSPACE_SO_'))
else:
if platform.uname()[0] == "Linux":
libcconfigspace = ct.cdll.LoadLibrary('libcconfigspace.so.0.0.0')
else:
libcconfigspace = ct.cdll.LoadLibrary('libcconfigspace.dylib')
from .base import *
from .rng import *
from .interval import *
from .distribution import *
from .hyperparameter import *
from .expression import *
from .expression_parser import *
from .context import *
from .configuration_space import *
from .binding import *
from .configuration import *
from .features_space import *
from .features import *
from .objective_space import *
from .evaluation import *
from .features_evaluation import *
from .tuner import *
from .features_tuner import *
| 27.225806 | 78 | 0.765403 | 105 | 844 | 6.057143 | 0.32381 | 0.267296 | 0.113208 | 0.150943 | 0.238994 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005472 | 0.133886 | 844 | 30 | 79 | 28.133333 | 0.864569 | 0 | 0 | 0.071429 | 0 | 0 | 0.104265 | 0.053318 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.75 | 0 | 0.75 | 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 |
63363a3f65389bbaeca6e2d885a5d844d4b3746f | 3,271 | py | Python | experiment/arrays/pyramic_tetrahedron.py | LCAV/FRIDA | ff5d51e498805b862c342dd216ccfffb22444b7f | [
"MIT"
] | 73 | 2017-03-21T09:00:49.000Z | 2022-03-28T06:15:17.000Z | experiment/arrays/pyramic_tetrahedron.py | JaviMaciasG/FRIDA | ff5d51e498805b862c342dd216ccfffb22444b7f | [
"MIT"
] | 7 | 2018-09-13T11:11:16.000Z | 2022-03-29T02:38:03.000Z | experiment/arrays/pyramic_tetrahedron.py | JaviMaciasG/FRIDA | ff5d51e498805b862c342dd216ccfffb22444b7f | [
"MIT"
] | 36 | 2017-03-09T18:56:58.000Z | 2021-11-13T02:37:44.000Z | import numpy as np
import scipy.linalg as la
# As 'measured' by Juan
'''
R_pyramic = np.array([
[-1.756492069, -3.042333507, 1.139761726], # 0
[-2.91789798, -5.053947553, 4.396223799],
[-4.079303892, -7.0655616, 7.652685873],
[-4.543866256, -7.870207219, 8.955270702],
[-4.776147439, -8.272530028, 9.606563117],
[-5.240709803, -9.077175647, 10.90914795],
[-6.402115715, -11.08878969, 14.16561002],
[-7.563521626, -13.10040374, 17.42207209], # 7
[-6.4, -10, 21.3], # 8
[-6.4, -6, 21.3],
[-6.4, -2, 21.3],
[-6.4, -0.4, 21.3],
[-6.4, 0.4, 21.3],
[-6.4, 2, 21.3],
[-6.4, 6, 21.3],
[-6.4, 10, 21.3], # 15
[3.512984138, 0, 1.139761726], # 16
[5.835795961, 0, 4.396223799],
[8.158607784, 0, 7.652685873],
[9.087732513, 0, 8.955270702],
[9.552294877, 0, 9.606563117],
[10.48141961, 0, 10.90914795],
[12.80423143, 0, 14.16561002],
[15.12704325, 0, 17.42207209], # 23
[13.70043101, -2.5, 21.3], # 24
[10.2363294, -4.5, 21.3],
[6.772227782, -6.5, 21.3],
[5.386587136, -7.3, 21.3],
[4.693766812, -7.7, 21.3],
[3.308126166, -8.5, 21.3],
[-0.155975449, -10.5, 21.3],
[-3.620077064, -12.5, 21.3], # 31
[-1.756492069, 3.042333507, 1.139761726], # 32
[-2.91789798, 5.053947553, 4.396223799],
[-4.079303892, 7.0655616, 7.652685873],
[-4.543866256, 7.870207219, 8.955270702],
[-4.776147439, 8.272530028, 9.606563117],
[-5.240709803, 9.077175647, 10.90914795],
[-6.402115715, 11.08878969, 14.16561002],
[-7.563521626, 13.10040374, 17.42207209], # 39
[-3.620077064, 12.5, 21.3], # 40
[-0.155975449, 10.5, 21.3],
[3.308126166, 8.5, 21.3],
[4.693766812, 7.7, 21.3],
[5.386587136, 7.3, 21.3],
[6.772227782, 6.5, 21.3],
[10.2363294, 4.5, 21.3],
[13.70043101, 2.5, 21.3], # 47
]).T / 100.
'''
x = 0.27 + 2*0.015 # length of one side
c1 = 1./np.sqrt(3.)
c2 = np.sqrt(2./3.)
c3 = np.sqrt(3.)/6.
c4 = 0.5
corners = np.array( [
[ 0, x*c1, -x*c3, -x*c3,],
[ 0, 0., x*c4, -x*c4,],
[ 0, x*c2, x*c2, x*c2,],
])
# relative placement of microphones on one pcb
pcb = np.array([-0.100, -0.060, -0.020, -0.004, 0.004, 0.020, 0.060, 0.100])
def line(p1, p2, dist):
# Places points at given distance on the line joining p1 -> p2, starting at the midpoint
o = (p1 + p2) / 2.
u = (p2 - p1) / la.norm(p2 - p1)
pts = []
for d in dist:
pts.append(o + d*u)
return pts
R_pyramic = np.array(
line(corners[:,0], corners[:,3], pcb) +
line(corners[:,3], corners[:,2], pcb) +
line(corners[:,0], corners[:,1], pcb) +
line(corners[:,1], corners[:,3], pcb) +
line(corners[:,0], corners[:,2], pcb) +
line(corners[:,2], corners[:,1], pcb)
).T
# Reference point is 1cm below zero'th mic
R_pyramic[2,:] += 0.01 - R_pyramic[2,0]
if __name__ == "__main__":
from experiment import PointCloud
pyramic = PointCloud(X=R_pyramic)
D = np.sqrt(pyramic.EDM())
print D[0,16]
pyramic.plot()
| 29.205357 | 92 | 0.510853 | 506 | 3,271 | 3.27668 | 0.282609 | 0.043426 | 0.028951 | 0.018094 | 0.521713 | 0.455971 | 0.367913 | 0.344391 | 0.268396 | 0.261158 | 0 | 0.447124 | 0.277285 | 3,271 | 111 | 93 | 29.468468 | 0.25423 | 0.065118 | 0 | 0 | 0 | 0 | 0.007619 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.085714 | null | null | 0.028571 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
634323d88ffdf297b1d71534f988f20cd1f2b53e | 150 | py | Python | py_rpb/__init__.py | refugee-phrasebook/py_rpb | 678e6658ecb3088e1a5f535c9c82d1dc96f3d0dc | [
"MIT"
] | 2 | 2015-09-19T11:17:51.000Z | 2016-01-27T15:16:13.000Z | py_rpb/__init__.py | refugee-phrasebook/py_rpb | 678e6658ecb3088e1a5f535c9c82d1dc96f3d0dc | [
"MIT"
] | null | null | null | py_rpb/__init__.py | refugee-phrasebook/py_rpb | 678e6658ecb3088e1a5f535c9c82d1dc96f3d0dc | [
"MIT"
] | null | null | null | import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger(__name__).addHandler(NullHandler())
| 15 | 53 | 0.726667 | 16 | 150 | 6.5625 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 150 | 9 | 54 | 16.666667 | 0.84 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.2 | 0.2 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
6348fc90127ff8dc8806021d87b2f43069177def | 564 | py | Python | beginners/list_modification.py | TahirIqbalGit/100-Python-Programs | ba80072c674c1b0d704e4bbbe403e720ffb98973 | [
"MIT"
] | 2 | 2021-08-25T07:58:40.000Z | 2021-10-14T19:46:36.000Z | beginners/list_modification.py | TahirIqbalGit/100-Python-Programs | ba80072c674c1b0d704e4bbbe403e720ffb98973 | [
"MIT"
] | null | null | null | beginners/list_modification.py | TahirIqbalGit/100-Python-Programs | ba80072c674c1b0d704e4bbbe403e720ffb98973 | [
"MIT"
] | null | null | null | """ This file is create and managed by Tahir Iqbal
----------------------------------------------
It can be use only for education purpose
"""
# List Modification
mix_list = [1, 'Programmer', 5.0, True]
print(mix_list)
# Mutable : Because re-assign value
mix_list[0] = 2
print(mix_list)
# Adding item in list
mix_list.append('Python')
print(mix_list)
# Shortcut version of adding item
mix_list += ['Solo']
print(mix_list)
# Adding item at order place
mix_list.insert(1, 'I am')
print(mix_list)
# Delete a list item
del mix_list[0]
print(mix_list)
| 19.448276 | 50 | 0.654255 | 88 | 564 | 4.056818 | 0.568182 | 0.235294 | 0.201681 | 0.10084 | 0.123249 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014831 | 0.163121 | 564 | 28 | 51 | 20.142857 | 0.741525 | 0.510638 | 0 | 0.5 | 0 | 0 | 0.094118 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
634a6a54b77082cd8b5668d2c6ec321fe01a51f9 | 437 | py | Python | hero_db_utils/datamodels/exceptions.py | AIO2020/hero-db-utils | 037ace24a0934ca4df5354b6e90972a8b089e861 | [
"Apache-2.0"
] | null | null | null | hero_db_utils/datamodels/exceptions.py | AIO2020/hero-db-utils | 037ace24a0934ca4df5354b6e90972a8b089e861 | [
"Apache-2.0"
] | null | null | null | hero_db_utils/datamodels/exceptions.py | AIO2020/hero-db-utils | 037ace24a0934ca4df5354b6e90972a8b089e861 | [
"Apache-2.0"
] | null | null | null | """
ED Data imports exception types
"""
class FieldsValidationError(Exception):
"""
Exception type for validation errors related to
DataModel instances.
"""
pass
class UnexpectedQueryResult(Exception):
"""
Exception for unexpected database results.
"""
pass
class NoResultsError(UnexpectedQueryResult):
"""
Exception when results from a query were expected
but none were found.
"""
| 19 | 53 | 0.684211 | 42 | 437 | 7.119048 | 0.714286 | 0.120401 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.23341 | 437 | 22 | 54 | 19.863636 | 0.892537 | 0.489703 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.4 | 0 | 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 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
635ff2fa7fd22a3133a915b2c29d4a8c86f95ae5 | 2,095 | py | Python | app/models.py | Daniel6996-arch/tweek | de36ace7af21af46b3b96b35623eb3433fa1a851 | [
"MIT"
] | null | null | null | app/models.py | Daniel6996-arch/tweek | de36ace7af21af46b3b96b35623eb3433fa1a851 | [
"MIT"
] | null | null | null | app/models.py | Daniel6996-arch/tweek | de36ace7af21af46b3b96b35623eb3433fa1a851 | [
"MIT"
] | null | null | null | from . import db
from werkzeug.security import generate_password_hash,check_password_hash
from flask_login import UserMixin
from . import login_manager
from sqlalchemy.sql import func
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(UserMixin,db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer,primary_key = True)
username = db.Column(db.String(255),index = True)
email = db.Column(db.String(255),unique = True,index = True)
# role_id = db.Column(db.Integer,db.ForeignKey('roles.id'))
bio = db.Column(db.String(255))
profile_pic_path = db.Column(db.String())
password_secure = db.Column(db.String(255))
blogs = db.relationship('Blog')
@property
def password(self):
raise AttributeError('You cannnot read the password attribute')
@password.setter
def password(self, password):
self.password_secure = generate_password_hash(password)
def verify_password(self,password):
return check_password_hash(self.password_secure,password)
def __repr__(self):
return f'User {self.username}'
#class Role(db.Model):
# __tablename__ = 'roles'
#
# id = db.Column(db.Integer,primary_key = True)
# name = db.Column(db.String(255))
# users = db.relationship('User',backref = 'role',lazy="dynamic")
#
#
#
# def __repr__(self):
# return f'User {self.username}'
class Blog(db.Model):
__tablename__ = 'blogs'
id = db.Column(db.Integer,primary_key = True)
topic = db.Column(db.String(200))
data = db.Column(db.String())
date = db.Column(db.DateTime(timezone = True), default = func.now(), index = True)
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
comments = db.relationship('Comment')
class Comment(db.Model):
__tablename__ = 'comments'
id = db.Column(db.Integer,primary_key = True)
comment = db.Column(db.String(500))
date = db.Column(db.DateTime(timezone = True), default = func.now(), index = True)
blog_id = db.Column(db.Integer, db.ForeignKey('blogs.id'))
| 29.507042 | 86 | 0.685919 | 285 | 2,095 | 4.859649 | 0.277193 | 0.103971 | 0.129964 | 0.103971 | 0.369675 | 0.301083 | 0.301083 | 0.233935 | 0.138628 | 0.08231 | 0 | 0.012174 | 0.176611 | 2,095 | 71 | 87 | 29.507042 | 0.790725 | 0.15179 | 0 | 0.121951 | 1 | 0 | 0.059024 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.121951 | false | 0.219512 | 0.121951 | 0.073171 | 0.878049 | 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 |
6362061a3e0afe4919012602116e7358ba3d43d0 | 1,929 | pyp | Python | generate_yarnmodels/pyp/stocktiny.pyp | kamleshbhalui/MADYPG | b91c7af0b7a1382fed0a5fb3147f13594ddec71e | [
"MIT"
] | null | null | null | generate_yarnmodels/pyp/stocktiny.pyp | kamleshbhalui/MADYPG | b91c7af0b7a1382fed0a5fb3147f13594ddec71e | [
"MIT"
] | null | null | null | generate_yarnmodels/pyp/stocktiny.pyp | kamleshbhalui/MADYPG | b91c7af0b7a1382fed0a5fb3147f13594ddec71e | [
"MIT"
] | null | null | null | *pattern # px py radius num_vertedges
0.00144 0.00088000001 0.00019999999 13
*Q # dofs: x y z t
-0.00032959311 -0.00038851173 0.00023495984 0.051622108
-0.0004543592 -0.00018749384 0.00019560196 0.045176728
-0.00049820439 0.00013583127 -6.7560225e-05 -0.27891638
-0.00020425905 0.00030101745 -0.00030620915 -0.39826018
0.00030243123 0.00028595522 -0.0002675143 -0.29036372
0.0005916757 0.00011745615 -1.0958537e-05 0.042982007
0.00059686821 -0.00016744742 0.00023100262 0.024267196
0.00046499347 0.00047700428 0.00030390454 0.038862187
0.00022466079 0.00010441612 0.00021001482 0.097287338
0.00028966658 -0.00022881541 -6.6552349e-05 0.17572765
-0.00068518918 -0.00036500902 -0.00025754463 0.21538557
-0.00018700466 -0.00020699007 -0.00015506808 0.18720174
-9.6997807e-05 0.00013153544 0.00010319479 0.098022747
*E # edges: v0 v1 dx dy
0 1 0 0
1 2 0 0
2 3 0 0
3 4 0 0
4 5 0 0
5 6 0 0
6 7 0 -1
7 8 0 0
8 9 0 0
9 10 1 0
10 11 0 0
11 12 0 0
12 0 0 1
*RL # rest lengths
0.00023085441
0.00041266151
0.00041073086
0.0004985887
0.00041297019
0.00036717137
0.0002699727
0.0004357192
0.00043251732
0.00050083667
0.00051337189
0.00042922316
0.00043050707
*RK # rest kappas
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
*RT # rest twists
0
0
0
0
0
0
0
0
0
0
0
0
0
*RefD1 # reference directors
-0.85265363 -0.49872483 0.15574123
-0.98851496 -0.14986813 -0.019434796
-0.67027405 0.63291418 -0.38749495
0.065020094 0.85178302 -0.51984427
0.68971003 0.6235753 -0.36804065
0.99051921 -0.077990839 -0.11308902
0.88145454 -0.45866916 0.11251885
0.82608254 -0.5560076 0.091886746
0.95770964 -0.04855631 0.28360983
0.45023017 0.53171277 0.71733836
-0.33385151 0.56153567 0.75711351
-0.93813333 -0.014512291 0.34597
-0.81473014 -0.56840716 0.11457791
*RefT # reference twists
0.037137623
-0.0032591267
0.30841237
0.10328626
-0.12247905
-0.34627835
0.009109113
-0.024522851
-0.073314171
-0.097135773
-0.056863164
0.008530129
0.074668926
| 17.697248 | 55 | 0.765682 | 369 | 1,929 | 4 | 0.444444 | 0.065041 | 0.071138 | 0.089431 | 0.026423 | 0.026423 | 0.026423 | 0.026423 | 0.026423 | 0.026423 | 0 | 0.805273 | 0.134785 | 1,929 | 108 | 56 | 17.861111 | 0.079089 | 0.068948 | 0 | 0.13 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
637f9dc6ac48f1c83e4f5449a6d39db433652912 | 298 | py | Python | paraphase/data/tokenizer/word_tokenizer.py | tingkai-zhang/Paraphase | ed57430a76781c17c41c265e51e41abeb8d83a48 | [
"Apache-2.0"
] | null | null | null | paraphase/data/tokenizer/word_tokenizer.py | tingkai-zhang/Paraphase | ed57430a76781c17c41c265e51e41abeb8d83a48 | [
"Apache-2.0"
] | null | null | null | paraphase/data/tokenizer/word_tokenizer.py | tingkai-zhang/Paraphase | ed57430a76781c17c41c265e51e41abeb8d83a48 | [
"Apache-2.0"
] | null | null | null | import nltk
class NLTKWordTokenizer():
def tokenize(self, sentence):
return nltk.word_tokenize(sentence.lower())
def tokenize_for_indexer(self, sentence):
word = nltk.word_tokenize(sentence)
char = list(map(list, word))
return {'word':word, 'char':char}
| 24.833333 | 51 | 0.657718 | 35 | 298 | 5.485714 | 0.457143 | 0.114583 | 0.166667 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.221477 | 298 | 11 | 52 | 27.090909 | 0.827586 | 0 | 0 | 0 | 0 | 0 | 0.026936 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0.125 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
6399953bab5a96f1c568e26278f85743f4690439 | 186 | py | Python | src/code_katas/count_by_x.py | MiM0ulay/code-katas | 5a4b7b9e4c7ae257ddd89f95f28e9df23cdd3e88 | [
"MIT"
] | 5 | 2019-03-31T16:28:19.000Z | 2021-02-19T09:33:04.000Z | src/code_katas/count_by_x.py | MiM0ulay/code-katas | 5a4b7b9e4c7ae257ddd89f95f28e9df23cdd3e88 | [
"MIT"
] | 2 | 2017-06-14T23:57:48.000Z | 2017-06-22T20:21:32.000Z | src/code_katas/count_by_x.py | MiM0ulay/code-katas | 5a4b7b9e4c7ae257ddd89f95f28e9df23cdd3e88 | [
"MIT"
] | 6 | 2020-02-02T02:10:27.000Z | 2022-01-27T16:34:13.000Z | """Return list of values that are multiplies of x."""
def count_by(x, n):
"""Return a sequence of numbers counting by `x` `n` times."""
return [i * x for i in range(1, n + 1)]
| 26.571429 | 65 | 0.612903 | 34 | 186 | 3.323529 | 0.647059 | 0.053097 | 0.070796 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013986 | 0.231183 | 186 | 6 | 66 | 31 | 0.776224 | 0.553763 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
63aaa596f0d7cc8a670e697305a8990874d625bf | 565 | py | Python | gitty/config.py | slaveofcode/gitty | 3782f1b40e9fefc4635c5c4dee3be31418bde891 | [
"MIT"
] | null | null | null | gitty/config.py | slaveofcode/gitty | 3782f1b40e9fefc4635c5c4dee3be31418bde891 | [
"MIT"
] | null | null | null | gitty/config.py | slaveofcode/gitty | 3782f1b40e9fefc4635c5c4dee3be31418bde891 | [
"MIT"
] | null | null | null |
class Config:
@staticmethod
def get(repo, config_key):
splitted_keys = config_key.split('.')
splitted_keys_in_byte = [key.encode() for key in splitted_keys]
if splitted_keys.__len__() > 2:
section = tuple(splitted_keys_in_byte[:-1])
arg = splitted_keys_in_byte[-1]
else:
section = splitted_keys_in_byte[0]
arg = splitted_keys_in_byte[1]
config = repo.get_config()
try:
value = config.get(section, arg)
except KeyError:
value = None
return value.decode() if value else value
| 21.730769 | 67 | 0.646018 | 76 | 565 | 4.473684 | 0.394737 | 0.282353 | 0.205882 | 0.264706 | 0.185294 | 0.129412 | 0 | 0 | 0 | 0 | 0 | 0.011848 | 0.253097 | 565 | 25 | 68 | 22.6 | 0.793839 | 0 | 0 | 0 | 0 | 0 | 0.001776 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.058824 | false | 0 | 0 | 0 | 0.176471 | 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 |
63bcc341f0e9f9f96f99a25d0e7f9a7c559970e2 | 329 | py | Python | 9. Um pouco mais sobre strings/hora_de_acordar.py | andrebrito16/python-academy | 544516048c0a2f8cea42ef0f252b9c40e8f5b141 | [
"MIT"
] | 1 | 2021-08-19T19:40:14.000Z | 2021-08-19T19:40:14.000Z | 9. Um pouco mais sobre strings/hora_de_acordar.py | andrebrito16/python-academy | 544516048c0a2f8cea42ef0f252b9c40e8f5b141 | [
"MIT"
] | null | null | null | 9. Um pouco mais sobre strings/hora_de_acordar.py | andrebrito16/python-academy | 544516048c0a2f8cea42ef0f252b9c40e8f5b141 | [
"MIT"
] | null | null | null | def converteHora(hora):
# Se a hora for 00:
if int(hora[:2]) == 0:
return f"12{hora[2:]} AM"
# Se for 12
if int(hora[:2]) == 12:
return f"12{hora[2:]} PM"
# Se for de tarde
if int(hora[:2]) > 12:
return f"0{int(hora[:2]) - 12 }{hora[2:]} PM"
return f"{hora} AM"
print(converteHora("09:39")) | 18.277778 | 49 | 0.534954 | 60 | 329 | 2.933333 | 0.35 | 0.198864 | 0.181818 | 0.170455 | 0.335227 | 0.215909 | 0.215909 | 0 | 0 | 0 | 0 | 0.109756 | 0.25228 | 329 | 18 | 50 | 18.277778 | 0.605691 | 0.130699 | 0 | 0 | 0 | 0 | 0.279152 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0 | 0 | 0.555556 | 0.111111 | 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 |
894804f9fbbc658833b3c6f4713e2d9653973eb6 | 2,654 | py | Python | omicexperiment/tests/test_taxonomy.py | bassio/omicexperiment | 323de49bb528e91658b38ed748a47c062e371048 | [
"BSD-3-Clause"
] | 7 | 2016-06-16T14:30:43.000Z | 2021-11-09T10:15:03.000Z | omicexperiment/tests/test_taxonomy.py | bassio/omicexperiment | 323de49bb528e91658b38ed748a47c062e371048 | [
"BSD-3-Clause"
] | 1 | 2019-03-18T21:32:06.000Z | 2019-03-18T22:16:19.000Z | omicexperiment/tests/test_taxonomy.py | bassio/omicexperiment | 323de49bb528e91658b38ed748a47c062e371048 | [
"BSD-3-Clause"
] | 2 | 2019-08-23T09:11:58.000Z | 2022-03-26T10:05:55.000Z | from unittest import TestCase
from omicexperiment.taxonomy import GreenGenesProcessedTaxonomy
class GreenGenesProcessedTaxonomyTestCase(TestCase):
def setUp(self):
pass
def test_highest_res_rank_tax_string_full(self):
test_str = "k__Fungi;p__Ascomycota;c__Eurotiomycetes;o__Eurotiales;f__Trichocomaceae;g__Aspergillus;s__Aspergillus bombycis"
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank, 'species')
def test_highest_res_rank_tax_string_short(self):
test_str = "k__Fungi;p__Ascomycota;c__Dothideomycetes;o__Pleosporales;f__Pleosporaceae"
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank, 'family')
test_str = "k__Fungi;p__Ascomycota;c__Eurotiomycetes;o__Eurotiales;f__Trichocomaceae;g__Aspergillus"
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank, 'genus')
def test_highest_res_rank_tax_string_contains_unidentified(self):
test_str = "k__Fungi;p__Ascomycota;c__Dothideomycetes;o__unidentified;f__Pleosporaceae"
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank, 'class')
test_str = "k__Fungi;p__Ascomycota;c__unidentified;o__unidentified"
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank, 'phylum')
def test_highest_res_rank_tax_string_contains_emptystr(self):
test_str = "k__Fungi;p__Ascomycota;c__;o__;f__"
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank, 'phylum')
test_str = "k__Fungi;p__Ascomycota;c__;o__unidentified"
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank, 'phylum')
def test_highest_res_rank_tax_string_unassigned(self):
unassigned_test_strings = []
unassigned_test_strings.append("No blast hit")
unassigned_test_strings.append("unassigned")
unassigned_test_strings.append("Unassigned")
unassigned_test_strings.append("k__")
unassigned_test_strings.append("k__unidentified")
unassigned_test_strings.append("k__Unidentified")
unassigned_test_strings.append("k__unidentified;")
for test_str in unassigned_test_strings:
tax = GreenGenesProcessedTaxonomy(test_str)
self.assertEqual(tax.highest_res_rank_index, -1)
self.assertEqual(tax.highest_res_rank, 'unassigned')
if __name__ == "__main__":
from unittest import main
main()
| 44.983051 | 132 | 0.738508 | 300 | 2,654 | 5.956667 | 0.2 | 0.062675 | 0.109681 | 0.125909 | 0.767767 | 0.767208 | 0.749301 | 0.701735 | 0.642977 | 0.586458 | 0 | 0.000462 | 0.18425 | 2,654 | 59 | 133 | 44.983051 | 0.824942 | 0 | 0 | 0.23913 | 0 | 0 | 0.232015 | 0.175895 | 0 | 0 | 0 | 0 | 0.195652 | 1 | 0.130435 | false | 0.021739 | 0.065217 | 0 | 0.217391 | 0 | 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 |
896dbc11a304784dec09784bd7a2621492c448ea | 109 | py | Python | assets/autodoc/help.py | baconpaul/BespokeSynthDocs | b83dafab4d4b2a3ce0586c8934c26dea89ff837a | [
"CC0-1.0"
] | null | null | null | assets/autodoc/help.py | baconpaul/BespokeSynthDocs | b83dafab4d4b2a3ce0586c8934c26dea89ff837a | [
"CC0-1.0"
] | null | null | null | assets/autodoc/help.py | baconpaul/BespokeSynthDocs | b83dafab4d4b2a3ce0586c8934c26dea89ff837a | [
"CC0-1.0"
] | null | null | null | import json
html = open("../../_includes/help.md", "w")
html.write(open("../resource/help.txt","r").read()) | 21.8 | 51 | 0.614679 | 16 | 109 | 4.125 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.073395 | 109 | 5 | 51 | 21.8 | 0.653465 | 0 | 0 | 0 | 0 | 0 | 0.409091 | 0.209091 | 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 |
89744351b2f1d47789b5b84b50769321a1aa297a | 15,584 | py | Python | 2021/04.py | almazkun/advent | bcc18f83e7eaf6579a7b6b47fa9f0f6f0d2b31b4 | [
"MIT"
] | null | null | null | 2021/04.py | almazkun/advent | bcc18f83e7eaf6579a7b6b47fa9f0f6f0d2b31b4 | [
"MIT"
] | null | null | null | 2021/04.py | almazkun/advent | bcc18f83e7eaf6579a7b6b47fa9f0f6f0d2b31b4 | [
"MIT"
] | null | null | null | from solution import Solution
class Board:
def __init__(self, rows_):
self.rows_ = rows_
self.draws = []
self.all = self.rows + self.columns
self.won = False
@property
def rows(self):
return self.rows_
@property
def columns(self):
return [list(col) for col in zip(*self.rows_)]
def draw(self, draw):
self.draws.append(draw)
win = self.is_win()
if win:
score = self.score(draw)
print(f"#####\t{self} is a win, {draw}, {score}")
return score
@property
def sum_all_unmarked_numbers(self):
return sum(
[
number
for sublist in self.rows
for number in sublist
if number not in self.draws
]
)
def score(self, draw):
return self.sum_all_unmarked_numbers * draw
def is_win(self):
for row in self.all:
win = all([elem in self.draws for elem in row])
if win:
self.won = True
return win
def __repr__(self):
return f"""
{self.draws}
{self.rows[0]}
{self.rows[1]}
{self.rows[2]}
{self.rows[3]}
{self.rows[4]}\n\n
"""
class Sol(Solution):
"""--- Day 4: Giant Squid ---
You're already almost 1.5km (almost a mile) below the surface of the ocean,
already so deep that you can't see any sunlight. What you can see, however,
is a giant squid that has attached itself to the outside of your submarine.
Maybe it wants to play bingo?
Bingo is played on a set of boards each consisting of a 5x5 grid of numbers.
Numbers are chosen at random, and the chosen number is marked on all boards
on which it appears. (Numbers may not appear on all boards.) If all numbers
in any row or any column of a board are marked, that board wins.
(Diagonals don't count.)
The submarine has a bingo subsystem to help passengers (currently, you and
the giant squid) pass the time. It automatically generates a random order
in which to draw numbers and a random set of boards (your puzzle input).
For example:
7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 12 6
14 21 17 24 4
10 16 15 9 19
18 8 23 26 20
22 11 13 6 5
2 0 12 3 7
After the first five numbers are drawn (7, 4, 9, 5, and 11), there are no
winners, but the boards are marked as follows (shown here adjacent to
each other to save space):
22 13 17 11 0 3 15 0 2 22 14 21 17 24 4
8 2 23 4 24 9 18 13 17 5 10 16 15 9 19
21 9 14 16 7 19 8 7 25 23 18 8 23 26 20
6 10 3 18 5 20 11 10 24 4 22 11 13 6 5
1 12 20 15 19 14 21 16 12 6 2 0 12 3 7
After the next six numbers are drawn (17, 23, 2, 0, 14, and 21),
there are still no winners:
22 13 17 11 0 3 15 0 2 22 14 21 17 24 4
8 2 23 4 24 9 18 13 17 5 10 16 15 9 19
21 9 14 16 7 19 8 7 25 23 18 8 23 26 20
6 10 3 18 5 20 11 10 24 4 22 11 13 6 5
1 12 20 15 19 14 21 16 12 6 2 0 12 3 7
Finally, 24 is drawn:
22 13 17 11 0 3 15 0 2 22 14 21 17 24 4
8 2 23 4 24 9 18 13 17 5 10 16 15 9 19
21 9 14 16 7 19 8 7 25 23 18 8 23 26 20
6 10 3 18 5 20 11 10 24 4 22 11 13 6 5
1 12 20 15 19 14 21 16 12 6 2 0 12 3 7
At this point, the third board wins because it has at least one
complete row or column of marked numbers (in this case, the entire
top row is marked: 14 21 17 24 4).
The score of the winning board can now be calculated. Start by
finding the sum of all unmarked numbers on that board; in this
case, the sum is 188. Then, multiply that sum by the number that
was just called when the board won, 24, to get the final score,
188 * 24 = 4512.
To guarantee victory against the giant squid, figure out which
board will win first. What will your final score be if you
choose that board?
--- Part Two ---
On the other hand, it might be wise to try a different strategy:
let the giant squid win.
You aren't sure how many bingo boards a giant squid could play at once,
so rather than waste time counting its arms, the safe thing to do is to
figure out which board will win last and choose that one. That way,
no matter which boards it picks, it will win for sure.
In the above example, the second board is the last to win, which happens
after 13 is eventually called and its middle column is completely marked.
If you were to keep playing until this point, the second board would have a
sum of unmarked numbers equal to 148 for a final score of 148 * 13 = 1924.
Figure out which board will win last. Once it wins, what would its
final score be?
"""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.order = None
self.boards = None
self.clean()
self.winners = {}
def clean(self):
order, *boards = [x for x in self.input.split("\n\n") if x]
self.order = [int(x) for x in order.split(",") if x]
dirty_boards = [x.split("\n") for x in boards if x]
clean_boards = []
for dirty_board in dirty_boards:
clean_board = []
for dirty_row in dirty_board:
clean_row = []
row = [x for x in dirty_row.split(" ") if x]
for item in row:
if item:
clean_row.append(int(item))
if clean_row:
clean_board.append(clean_row)
clean_boards.append(clean_board)
self.boards = [Board(board) for board in clean_boards]
def make_draw(self):
for draw in self.order:
for board in self.boards:
score = board.draw(draw)
if score is not None:
return score
def p1(self):
pass # return self.make_draw()
def p2(self):
return self.last_to_win()
def last_to_win(self):
boards = self.boards.copy()
draws = self.order.copy()
while draws:
draw = draws.pop(0)
print("+++++", draw, "+++++")
for board in self.boards:
if board.won:
continue
else:
score = board.draw(draw)
print("!!!!!!!boards:", boards)
if score is not None:
lats_to_win = board, score, draw
boards.remove(board)
if not boards:
return lats_to_win
@property
def solution(self):
return f"p1: {self.p1()}\np2: {self.p2()}\n"
test_ = """7,4,9,5,11,17,23,2,0,14,21,24,10,16,13,6,15,25,12,22,18,20,8,19,3,26,1
22 13 17 11 0
8 2 23 4 24
21 9 14 16 7
6 10 3 18 5
1 12 20 15 19
3 15 0 2 22
9 18 13 17 5
19 8 7 25 23
20 11 10 24 4
14 21 16 12 6
14 21 17 24 4
10 16 15 9 19
18 8 23 26 20
22 11 13 6 5
2 0 12 3 7"""
input_ = """13,47,64,52,60,69,80,85,57,1,2,6,30,81,86,40,27,26,97,77,70,92,43,94,8,78,3,88,93,17,55,49,32,59,51,28,33,41,83,67,11,91,53,36,96,7,34,79,98,72,39,56,31,75,82,62,99,66,29,58,9,50,54,12,45,68,4,46,38,21,24,18,44,48,16,61,19,0,90,35,65,37,73,20,22,89,42,23,15,87,74,10,71,25,14,76,84,5,63,95
88 67 20 19 15
22 76 86 44 73
7 42 6 69 25
12 68 92 21 75
97 45 13 52 70
75 98 24 18 77
17 93 46 49 13
92 56 97 57 66
44 0 65 54 74
23 6 53 42 20
92 94 9 27 41
73 28 62 90 40
78 3 12 37 32
8 86 91 16 30
84 38 68 11 19
51 5 12 76 97
72 31 15 61 71
38 32 55 87 10
91 4 85 84 53
59 79 28 69 23
35 48 10 81 60
25 86 24 43 15
44 55 12 54 62
94 89 95 2 23
64 63 45 50 66
80 87 49 88 39
33 81 95 68 55
83 46 36 41 54
90 74 3 52 7
71 40 35 8 77
34 21 24 8 97
99 23 94 70 9
14 98 2 11 10
16 38 92 13 35
82 25 76 42 39
52 76 98 25 3
24 41 13 39 56
11 72 77 47 86
50 32 26 88 48
18 99 22 78 58
22 24 53 84 80
26 97 42 95 11
1 59 81 7 35
47 14 40 63 30
37 31 10 50 43
26 86 85 69 45
81 43 96 12 42
7 36 5 28 95
55 90 54 4 46
52 30 79 59 87
76 87 62 13 38
40 44 75 2 37
51 22 58 84 57
1 29 82 67 35
39 20 31 77 32
53 62 61 26 95
78 44 9 5 97
83 11 18 69 2
94 66 8 14 27
1 6 7 73 76
87 34 62 93 43
49 20 63 29 22
30 94 11 5 69
74 9 89 41 37
98 38 72 13 97
69 39 15 59 14
42 84 56 23 1
99 16 62 83 89
32 36 33 24 3
22 31 55 10 13
22 44 75 3 17
51 79 37 59 19
98 4 86 35 34
36 20 85 5 23
62 92 43 7 90
3 68 95 51 71
20 62 47 4 30
60 91 27 86 73
14 76 66 97 85
79 65 8 11 36
38 63 1 64 14
10 52 17 90 98
28 61 29 20 55
49 58 43 3 7
88 81 67 32 68
63 65 15 61 57
47 94 6 14 49
42 3 83 96 31
23 77 1 70 18
45 36 64 48 35
8 92 88 32 95
26 41 34 11 48
81 35 36 62 28
64 33 52 97 82
7 37 78 0 86
75 64 84 80 60
17 5 55 95 70
0 90 68 53 93
8 50 38 9 65
97 35 26 30 6
76 87 36 5 74
79 94 82 48 20
24 88 90 62 45
9 40 78 22 68
73 71 35 42 66
52 11 17 9 72
45 13 90 0 80
93 77 37 51 96
3 68 94 61 1
26 78 12 29 66
49 14 74 11 48
73 58 54 3 40
90 38 62 18 26
53 93 19 41 94
35 63 7 80 68
13 19 92 38 1
63 69 4 99 36
53 57 54 21 80
97 17 2 44 29
0 3 89 45 58
9 26 45 57 67
72 10 59 79 88
32 2 87 42 60
62 98 1 93 28
24 99 41 44 29
57 60 54 36 84
28 5 32 66 77
13 19 42 39 37
56 89 74 50 55
8 71 78 0 80
62 38 24 44 4
17 8 70 77 86
98 6 9 88 23
85 63 78 60 72
71 48 36 69 81
84 19 8 20 17
40 88 33 52 81
29 83 11 36 92
66 6 73 32 82
44 39 26 60 63
13 73 45 32 42
69 20 83 8 84
82 61 11 89 25
6 92 99 52 57
88 22 46 26 86
74 65 17 64 94
19 34 40 69 80
43 83 45 77 87
41 49 13 51 89
91 72 54 1 60
38 10 16 51 46
80 60 64 62 70
89 71 58 49 39
37 5 35 88 40
93 72 98 42 13
9 47 91 69 68
27 1 49 60 13
6 17 95 59 35
26 14 75 57 11
15 18 19 46 74
88 66 25 89 6
63 4 56 73 8
57 0 51 5 36
68 96 84 67 53
49 82 7 32 9
81 75 92 1 62
0 96 27 63 46
76 31 93 67 12
74 78 59 5 60
69 33 25 94 43
40 72 79 58 22
16 24 99 96 44
69 4 87 90 26
34 43 56 15 35
63 88 89 52 54
43 7 44 31 24
71 18 84 17 64
8 47 93 85 36
72 29 22 67 74
69 41 58 98 61
55 21 72 14 3
75 12 69 91 54
80 40 78 39 4
44 88 84 76 25
96 57 49 52 28
54 74 32 40 64
5 94 71 80 22
82 92 79 93 16
53 33 98 85 14
29 49 9 47 12
98 67 8 10 6
58 13 77 99 81
5 55 21 19 1
0 26 44 70 93
41 96 31 91 27
50 28 48 13 18
96 43 25 2 78
88 60 0 16 73
12 32 15 68 22
95 74 10 80 21
18 49 85 55 21
11 68 80 59 41
56 94 14 62 60
32 20 40 6 2
42 66 98 71 17
13 38 1 63 82
33 55 54 53 92
36 20 39 84 83
67 43 70 73 75
94 77 76 29 16
82 27 25 18 86
73 3 36 28 1
11 96 40 23 93
58 90 88 35 64
9 38 69 8 43
87 90 16 56 67
41 75 89 1 80
22 62 5 45 69
28 36 19 96 71
26 63 88 76 31
68 80 83 95 20
75 0 16 38 21
34 89 87 36 14
94 47 53 73 71
63 8 61 96 50
81 23 6 14 26
86 42 82 95 85
77 52 38 2 33
69 98 54 37 4
78 39 3 75 80
92 99 93 28 44
5 8 67 45 10
61 79 63 85 81
2 87 76 68 18
69 52 22 16 12
95 50 21 82 60
5 8 6 28 26
52 3 38 70 74
75 0 53 51 44
10 30 34 47 71
71 44 65 48 51
78 57 75 6 86
95 58 66 12 92
22 61 68 88 50
4 36 45 28 54
37 17 5 2 52
57 47 4 53 39
11 72 66 81 46
27 0 67 40 83
98 19 10 35 84
43 59 30 72 17
66 50 12 84 65
49 60 14 1 29
89 75 62 82 47
33 5 9 58 45
14 9 3 47 74
69 29 57 62 22
4 90 40 64 15
21 27 30 2 63
97 96 99 55 41
75 73 3 59 80
65 34 52 20 72
50 84 81 69 41
97 77 19 85 39
88 46 15 35 87
96 42 74 38 78
58 73 67 70 10
62 8 82 64 16
65 25 13 3 89
40 30 53 95 51
7 16 92 88 38
14 52 46 93 64
49 48 8 76 51
97 67 89 75 19
69 9 29 43 82
81 51 24 57 9
46 43 77 11 35
83 5 14 25 84
70 99 47 37 16
3 39 75 97 80
18 74 64 6 94
12 59 46 48 31
73 77 33 1 39
0 69 10 24 56
83 66 5 76 58
40 48 72 65 2
19 28 93 53 44
75 85 42 68 66
99 49 55 31 41
94 35 78 13 61
4 20 54 33 21
50 61 17 53 64
69 30 24 90 95
82 51 39 52 67
43 73 44 62 83
31 32 63 42 60
39 41 28 51 53
15 20 24 54 5
9 65 70 57 99
50 29 35 4 47
40 99 95 72 35
10 14 52 83 19
5 51 87 49 16
60 66 13 63 93
68 57 31 6 78
58 96 49 87 28
95 50 54 53 52
24 16 64 9 5
7 63 8 4 17
59 98 3 31 25
31 83 61 58 93
94 52 97 30 98
99 2 13 66 73
69 71 68 40 19
74 84 45 25 77
58 85 45 64 74
18 88 91 53 2
93 0 92 55 39
75 49 87 80 4
89 97 57 14 54
20 92 64 50 25
52 90 80 31 38
55 54 10 76 21
95 97 4 77 19
30 26 12 39 11
71 10 84 68 77
48 82 69 75 3
93 24 16 42 60
15 62 76 36 20
21 18 94 22 45
10 91 66 56 75
6 8 45 59 83
52 93 48 81 87
99 78 43 64 84
21 12 61 71 9
98 77 95 63 15
30 14 39 12 20
13 32 27 0 5
86 80 51 40 99
68 44 26 29 91
92 79 49 44 33
88 4 34 3 90
51 46 31 50 47
61 11 94 6 24
72 18 98 65 57
88 94 93 11 33
75 77 53 54 51
97 15 89 38 76
47 64 55 22 0
40 56 34 19 3
36 55 51 86 91
49 21 78 6 58
90 1 88 45 33
37 69 75 41 50
81 24 34 38 93
21 73 99 50 65
72 77 86 7 68
24 63 71 26 25
9 12 29 93 87
81 23 22 94 67
37 47 66 89 73
49 23 79 31 86
58 52 21 39 15
60 38 82 50 36
74 30 25 35 99
6 18 53 36 87
3 59 50 2 75
69 61 57 19 63
44 77 42 22 7
89 29 45 35 71
28 26 53 47 21
31 71 27 58 85
10 20 74 59 42
89 44 12 91 54
32 87 36 22 7
62 17 61 75 51
44 60 37 14 76
96 0 1 52 5
57 42 97 66 90
12 23 50 98 25
42 30 86 89 66
41 98 39 29 23
75 73 20 79 90
38 60 45 16 18
17 10 47 5 13
4 10 26 74 38
66 84 60 23 57
30 59 58 2 49
83 82 70 64 43
71 31 35 90 0
27 99 33 56 3
41 97 1 68 88
43 63 81 89 22
30 32 59 64 12
84 58 10 39 76
98 16 75 27 57
0 9 3 79 50
5 34 93 6 21
52 70 87 31 49
58 46 24 20 45
78 24 19 13 30
83 59 79 37 72
84 81 99 17 77
10 93 3 33 70
29 35 49 6 5
47 6 82 94 53
83 19 25 54 64
9 56 39 31 96
1 81 66 41 5
55 48 43 12 14
47 55 86 31 17
89 45 65 34 56
99 88 18 97 3
52 21 14 68 13
9 26 22 7 32
75 27 62 19 72
20 49 7 21 85
53 46 1 59 99
61 71 87 24 83
5 77 41 51 73
57 59 82 77 52
99 49 81 37 54
70 89 23 20 90
31 1 21 98 66
86 35 46 36 18
37 39 70 76 27
68 84 25 1 33
50 82 77 20 44
18 11 51 62 54
80 67 35 89 30
85 96 1 3 73
25 47 10 46 98
2 33 91 71 35
0 32 11 55 67
14 81 17 5 94
68 84 46 43 81
42 35 48 89 30
4 17 65 77 6
49 97 85 12 66
75 25 13 90 51
94 42 46 58 56
97 50 86 84 15
52 9 28 32 59
26 96 91 57 83
29 99 18 31 43
2 19 31 10 32
81 16 50 59 7
76 30 63 44 95
82 54 61 75 36
85 78 12 67 9
92 1 72 27 37
22 13 91 4 34
53 82 76 70 19
99 38 59 33 52
0 61 36 67 75
94 41 5 57 1
37 36 99 34 47
40 93 62 32 76
61 75 48 42 73
35 69 54 13 50
76 12 51 11 74
30 83 73 33 78
95 77 15 14 80
86 37 91 50 10
52 67 3 60 17
68 7 42 81 15
46 58 9 31 18
91 1 28 34 37
17 57 6 2 70
97 54 20 27 44
44 80 45 28 14
94 47 29 50 54
64 67 96 95 93
76 36 82 39 43
30 55 97 3 2
43 2 15 99 34
97 75 26 9 67
30 63 74 12 82
18 6 49 48 55
47 36 41 56 83
26 70 87 80 89
17 50 61 21 96
43 83 85 46 64
66 75 23 47 69
22 72 55 52 8
67 54 11 29 42
16 45 56 86 66
4 80 43 72 91
90 87 63 39 50
32 6 59 27 89
14 92 78 47 59
98 0 63 85 31
52 8 84 70 91
43 3 76 65 57
87 22 99 94 58
26 53 58 52 1
82 57 32 40 20
72 21 74 46 43
41 15 98 2 11
5 96 22 18 55"""
if __name__ == "__main__":
try:
Sol(test_).solve()
except:
pass
Sol(input_).solve()
| 18.420804 | 301 | 0.588039 | 3,906 | 15,584 | 2.328981 | 0.086278 | 0.005716 | 0.003957 | 0.005276 | 0.097725 | 0.087941 | 0.085083 | 0.076729 | 0.076729 | 0.076729 | 0 | 0.580336 | 0.370187 | 15,584 | 845 | 302 | 18.442604 | 0.34651 | 0.235305 | 0 | 0.025641 | 0 | 0.003205 | 0.728917 | 0.030924 | 0 | 0 | 0 | 0 | 0 | 1 | 0.024038 | false | 0.003205 | 0.001603 | 0.011218 | 0.046474 | 0.004808 | 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 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
89772e98ccb180d52c595f945e5dfd9d3c6140fa | 566 | py | Python | contactform/models.py | Ascensiony/Software-Dev-Project | 85513737ae4a4b76fa0cfdab579b037d33b72faf | [
"MIT"
] | 2 | 2021-03-05T01:38:24.000Z | 2021-03-19T21:11:14.000Z | contactform/models.py | yabhi0807/Software-Dev-Project | 85513737ae4a4b76fa0cfdab579b037d33b72faf | [
"MIT"
] | 7 | 2021-04-08T21:12:42.000Z | 2022-03-12T00:13:59.000Z | contactform/models.py | venky012/ase-1-site | 877e36344c82567d3ebc7b0f29a2757da2a7f071 | [
"MIT"
] | 4 | 2020-02-17T09:47:39.000Z | 2020-02-22T12:11:18.000Z | from django.db import models
# Create your models here.
class ContactForm_queries(models.Model):
name=models.CharField(max_length=50)
email=models.EmailField(max_length=54)
subject=models.CharField(max_length=54)
message = models.CharField(max_length=1154)
def __str__(self):
return str(self.email)
class ReplyForm_queries(models.Model):
query_user = models.ForeignKey(ContactForm_queries, on_delete=models.CASCADE)
reply_message = models.CharField(max_length=1154)
def __str__(self):
return self.query_user.email
| 29.789474 | 81 | 0.75265 | 75 | 566 | 5.413333 | 0.466667 | 0.110837 | 0.17734 | 0.236453 | 0.251232 | 0.251232 | 0.251232 | 0.251232 | 0.251232 | 0.251232 | 0 | 0.029167 | 0.151943 | 566 | 18 | 82 | 31.444444 | 0.816667 | 0.042403 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.153846 | false | 0 | 0.076923 | 0.153846 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
898367a7bf274c611e36bbd2637e7603ddc41f48 | 700 | py | Python | mmdet/models/utils/gelu.py | chandlerbing65nm/Thesis | 73c3b54d7e353741883a8fe823a15b100f7b76a7 | [
"Apache-2.0"
] | null | null | null | mmdet/models/utils/gelu.py | chandlerbing65nm/Thesis | 73c3b54d7e353741883a8fe823a15b100f7b76a7 | [
"Apache-2.0"
] | null | null | null | mmdet/models/utils/gelu.py | chandlerbing65nm/Thesis | 73c3b54d7e353741883a8fe823a15b100f7b76a7 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch import Tensor
class GELU(nn.Module):
r"""Applies the Gaussian Error Linear Units function:
.. math:: \text{GELU}(x) = x * \Phi(x)
where :math:`\Phi(x)` is the Cumulative Distribution Function for Gaussian Distribution.
Shape:
- Input: :math:`(*)`, where :math:`*` means any number of dimensions.
- Output: :math:`(*)`, same shape as the input.
.. image:: ../scripts/activation_images/GELU.png
Examples::
>>> m = nn.GELU()
>>> input = torch.randn(2)
>>> output = m(input)
"""
def forward(self, input: Tensor) -> Tensor:
return F.gelu(input)
| 31.818182 | 92 | 0.611429 | 92 | 700 | 4.641304 | 0.543478 | 0.077283 | 0.06089 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.001873 | 0.237143 | 700 | 21 | 93 | 33.333333 | 0.797753 | 0.641429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.5 | 0.125 | 0.875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
89965114099b64646229faf63fa9d349fba608b7 | 1,466 | py | Python | Rota_System/Reporting/LinkedBulkReport/Abstract.py | ergoregion/Rota-Program | 44dab4cb11add184619d88aa0fcab61532d128e6 | [
"MIT"
] | null | null | null | Rota_System/Reporting/LinkedBulkReport/Abstract.py | ergoregion/Rota-Program | 44dab4cb11add184619d88aa0fcab61532d128e6 | [
"MIT"
] | null | null | null | Rota_System/Reporting/LinkedBulkReport/Abstract.py | ergoregion/Rota-Program | 44dab4cb11add184619d88aa0fcab61532d128e6 | [
"MIT"
] | null | null | null | __author__ = 'Neil Butcher'
from Rota_System.Reporting.HTMLObjects import HTMLObjects
from Rota_System.StandardTimes import date_string, time_string
def date(an_object):
return an_object.date
def time(an_object):
return an_object.time
def role(an_object):
return an_object.role
def event_title(event):
title = ''
title += date_string(event.date)
title += ' '
title += time_string(event.time)
title += ' '
title += event.title
return title
class AbstractMultiAppointmentReporter(object):
def events(self, events):
self._events = events
self._all_appointments = set()
def html(self):
html = HTMLObjects.HTMLGroup()
html.add(self._html_preheader())
html.add(self._html_header())
if len(self._all_appointments) > 0:
html.add(self._html_table())
html.add(self._html_footer())
return html
def _html_preheader(self):
return None
def _html_header(self):
return None
def _html_table(self):
return None
def _html_footer(self):
return None
def _dates(self):
return sorted(set(map(date, self._events)))
def _times(self):
return sorted(set(map(time, self._all_appointments)))
def first_2_letters(word):
return word[:2]
def person_code(aPerson):
words = aPerson.name.split()
return ''.join(map(first_2_letters, words))
| 21.558824 | 62 | 0.641883 | 181 | 1,466 | 4.933702 | 0.292818 | 0.053751 | 0.049272 | 0.067189 | 0.193729 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003663 | 0.255116 | 1,466 | 67 | 63 | 21.880597 | 0.814103 | 0 | 0 | 0.130435 | 0 | 0 | 0.012287 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.304348 | false | 0 | 0.043478 | 0.217391 | 0.652174 | 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 |
89b257eae1720e92d4bd3b578e9b8497b68c367f | 307 | py | Python | src/algorithms/rad.py | kristery/dmcontrol-generalization-benchmark | c732d3292e23ef70b9a5e1a9f573b51a5195d28d | [
"MIT"
] | 75 | 2020-11-30T07:59:09.000Z | 2022-03-30T21:26:53.000Z | src/algorithms/rad.py | kristery/dmcontrol-generalization-benchmark | c732d3292e23ef70b9a5e1a9f573b51a5195d28d | [
"MIT"
] | 12 | 2021-02-02T09:03:44.000Z | 2022-03-29T19:17:39.000Z | src/algorithms/rad.py | kristery/dmcontrol-generalization-benchmark | c732d3292e23ef70b9a5e1a9f573b51a5195d28d | [
"MIT"
] | 18 | 2020-12-04T03:48:34.000Z | 2022-03-21T15:10:08.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from copy import deepcopy
import utils
import algorithms.modules as m
from algorithms.sac import SAC
class RAD(SAC):
def __init__(self, obs_shape, action_shape, args):
super().__init__(obs_shape, action_shape, args)
| 21.928571 | 51 | 0.791531 | 51 | 307 | 4.529412 | 0.509804 | 0.142857 | 0.112554 | 0.164502 | 0.199134 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.140065 | 307 | 13 | 52 | 23.615385 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.727273 | 0 | 0.909091 | 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 |
89be39f0a233645442afb86cefae07e74838d685 | 653 | py | Python | test/test_algs.py | mepittma/bmi203-final | ef60d91cafbd3372f13917aa67102ec8f19e7ee8 | [
"Apache-2.0"
] | null | null | null | test/test_algs.py | mepittma/bmi203-final | ef60d91cafbd3372f13917aa67102ec8f19e7ee8 | [
"Apache-2.0"
] | null | null | null | test/test_algs.py | mepittma/bmi203-final | ef60d91cafbd3372f13917aa67102ec8f19e7ee8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from nets import filter_negs
from nets import neural_net
import train_nets as tn
def test_filtering():
assert filter_negs.remove_strings_w_subs(['hello','lets','find','some','substrings'], ['ll','so']) == ['lets','find','substrings']
def test_listcomp():
testvec = [[0],[1],[0],[1],[0],[1]]
assert [ i for i, response in enumerate(testvec) if response == [1] ] == [1,3,5]
def test_dna():
assert tn.get_kmers('ATCG',2) == ['AT','TC','CG']
assert (tn.encode('ACTGCT') == [[1,0,0,0], [0,1,0,0], [0,0,1,0], [0,0,0,1], [0,1,0,0], [0,0,1,0]]).all()
assert filter_negs.reverse_complement("TCGGGCCC") == "GGGCCCGA"
| 38.411765 | 134 | 0.620214 | 111 | 653 | 3.531532 | 0.486486 | 0.061224 | 0.061224 | 0.040816 | 0.07398 | 0.061224 | 0.061224 | 0.061224 | 0.043367 | 0.043367 | 0 | 0.062057 | 0.136294 | 653 | 16 | 135 | 40.8125 | 0.632979 | 0 | 0 | 0 | 0 | 0 | 0.124043 | 0 | 0 | 0 | 0 | 0 | 0.384615 | 1 | 0.230769 | false | 0 | 0.307692 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
98246faaf753588c33ca51ee85c6caa70138d14b | 269 | py | Python | app/main/util/dto.py | tharindukumara/bert-sentiment-analysis | 3b7c814151caa3617e7ccfdc1a0db196fae376c5 | [
"MIT"
] | 1 | 2021-08-02T13:12:39.000Z | 2021-08-02T13:12:39.000Z | app/main/util/dto.py | tharindukumara/olie-chat-sentiment-analysis-bot | 3b7c814151caa3617e7ccfdc1a0db196fae376c5 | [
"MIT"
] | 1 | 2020-06-23T14:58:39.000Z | 2020-06-23T14:58:39.000Z | app/main/util/dto.py | tharindukumara/bert-sentiment-analysis | 3b7c814151caa3617e7ccfdc1a0db196fae376c5 | [
"MIT"
] | null | null | null | from flask_restplus import Namespace, fields
class SentimentDto:
api = Namespace('sentiment', description='sentiment prediction')
sentiment = api.model('sentiment', {
'sentence': fields.String(required=True, description='sentence to predict'),
})
| 29.888889 | 84 | 0.717472 | 27 | 269 | 7.111111 | 0.703704 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.163569 | 269 | 8 | 85 | 33.625 | 0.853333 | 0 | 0 | 0 | 0 | 0 | 0.241636 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
9835f48a35ddb566dc7e36790bf97b02fa1bf894 | 211 | py | Python | examples/basic_workflow_client.py | DigitalGlobe/gbdxtools | 8ddef9f8822a49126e059b56e465da7447e33244 | [
"MIT"
] | 81 | 2016-04-05T23:32:46.000Z | 2022-01-02T21:21:09.000Z | examples/basic_workflow_client.py | DigitalGlobe/gbdxtools | 8ddef9f8822a49126e059b56e465da7447e33244 | [
"MIT"
] | 624 | 2016-04-06T22:22:01.000Z | 2022-01-03T17:48:50.000Z | examples/basic_workflow_client.py | DigitalGlobe/gbdxtools | 8ddef9f8822a49126e059b56e465da7447e33244 | [
"MIT"
] | 66 | 2016-04-13T22:45:37.000Z | 2022-01-03T18:03:26.000Z | from gbdxtools import Interface
gbdx = None
def go():
print(gbdx.task_registry.list())
print(gbdx.task_registry.get_definition('HelloGBDX'))
if __name__ == "__main__":
gbdx = Interface()
go()
| 17.583333 | 57 | 0.687204 | 26 | 211 | 5.153846 | 0.692308 | 0.134328 | 0.19403 | 0.313433 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180095 | 211 | 11 | 58 | 19.181818 | 0.774566 | 0 | 0 | 0 | 0 | 0 | 0.080569 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.125 | 0 | 0.25 | 0.25 | 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 |
985288ba719c4f365fb8ed06b7eb61a9146ede53 | 2,477 | py | Python | commercialoperator/migrations/0089_auto_20200901_1750.py | shibaken/commercialoperator | 1e0adfe683288626d9d3113e9efb44e0eba78adb | [
"Apache-2.0"
] | null | null | null | commercialoperator/migrations/0089_auto_20200901_1750.py | shibaken/commercialoperator | 1e0adfe683288626d9d3113e9efb44e0eba78adb | [
"Apache-2.0"
] | 12 | 2020-02-12T06:26:55.000Z | 2022-02-13T05:52:54.000Z | commercialoperator/migrations/0089_auto_20200901_1750.py | shibaken/commercialoperator | 1e0adfe683288626d9d3113e9efb44e0eba78adb | [
"Apache-2.0"
] | 8 | 2020-02-24T05:11:18.000Z | 2021-02-26T07:54:24.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2020-09-01 09:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('commercialoperator', '0088_auto_20200828_1343'),
]
operations = [
migrations.RemoveField(
model_name='applicationtype',
name='filming_fee_4days',
),
migrations.RemoveField(
model_name='applicationtype',
name='filming_fee_subsequent_day',
),
migrations.RemoveField(
model_name='applicationtype',
name='photography_fee_4days',
),
migrations.RemoveField(
model_name='applicationtype',
name='photography_fee_subsequent_day',
),
migrations.RemoveField(
model_name='proposalfilmingactivity',
name='half_day',
),
migrations.AddField(
model_name='applicationtype',
name='filming_fee_2days',
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=6, verbose_name='Filming two days fee'),
),
migrations.AddField(
model_name='applicationtype',
name='filming_fee_3days',
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=6, verbose_name='Filming 3 days or more fee'),
),
migrations.AddField(
model_name='applicationtype',
name='photography_fee_2days',
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=6, verbose_name='Photography two days fee'),
),
migrations.AddField(
model_name='applicationtype',
name='photography_fee_3days',
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=6, verbose_name='Photography 3 days or more fee'),
),
migrations.AlterField(
model_name='applicationtype',
name='photography_fee_full_day',
field=models.DecimalField(decimal_places=2, default=0.0, max_digits=6, verbose_name='Photography full day fee'),
),
migrations.AlterField(
model_name='proposaltype',
name='name',
field=models.CharField(choices=[('T Class', 'T Class')], default='T Class', max_length=64, verbose_name='Application name (eg. T Class, Filming, Event, E Class)'),
),
]
| 37.530303 | 175 | 0.617683 | 255 | 2,477 | 5.772549 | 0.286275 | 0.067255 | 0.146739 | 0.171196 | 0.737772 | 0.709239 | 0.656929 | 0.618886 | 0.405571 | 0.28125 | 0 | 0.034942 | 0.272103 | 2,477 | 65 | 176 | 38.107692 | 0.781475 | 0.027453 | 0 | 0.534483 | 1 | 0 | 0.256442 | 0.078554 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.034483 | 0 | 0.086207 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
985c88244525e5e85c30180e32c6316f8f664703 | 843 | py | Python | modulo/cach.py | kali-linux-sh/4METHOD | e587de020973640745a025dec74ead2cae2866d1 | [
"Apache-2.0"
] | null | null | null | modulo/cach.py | kali-linux-sh/4METHOD | e587de020973640745a025dec74ead2cae2866d1 | [
"Apache-2.0"
] | null | null | null | modulo/cach.py | kali-linux-sh/4METHOD | e587de020973640745a025dec74ead2cae2866d1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from random import choice
capchat = """
xD��&������U5����X
&�h[`��ڧ��Ie]�1�M
��bU�!���l��8G|�ohpy����]'n��|bM�� �����/接�=�bN���l�n�Xk����6w�wA����W�GN$�<�
��[�Y1F�� ��8G|�ohpy����]'n��|bM�� �����/接�=�bN���l�n�Xk����6w�wA����W�GN$�<�
��[�Y1F�� |�ohpy����]'n��|bM�� �����/接�=�bN���l�n�Xk����6w�wA����W�GN$�<�
��[�Y1F�� jljcjdnnjdcnjdncjdncjdncsjcnpeihihfrfibrfrfkjdbfjbdkjbfjbjkdfbvjdbjdfbvjfdf
"""
archivo = raw_input("Ingresa la ruta del archivo: ")
ciclos = int(raw_input("Cuantas veces quiere que se sobreescriba?: "))
contador = 1
while contador <= ciclos:
p = capchat.join([choice(capchat) for i in range(20)])
f = open(archivo, 'w')
f.write(str(capchat + p))
f.close()
contador += 1
print "---- El archivo no se puede volver a recuperar ----"
| 35.125 | 88 | 0.546856 | 195 | 843 | 3.133333 | 0.410256 | 0.01964 | 0.02455 | 0.02946 | 0.332242 | 0.332242 | 0.332242 | 0.332242 | 0.332242 | 0.332242 | 0.169632 | 0.019973 | 0.109134 | 843 | 23 | 89 | 36.652174 | 0.591212 | 0.049822 | 0 | 0 | 0 | 0.157895 | 0.64831 | 0.374218 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.052632 | null | null | 0.052632 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
988766f99e9ceccec229ad026e0ee97cee17645a | 1,012 | py | Python | test/warning_test.py | evanofslack/samila | 7c39ac32d7837dfa964c1060a3f04432969c5ec4 | [
"MIT"
] | 1 | 2022-02-28T17:27:46.000Z | 2022-02-28T17:27:46.000Z | test/warning_test.py | evanofslack/samila | 7c39ac32d7837dfa964c1060a3f04432969c5ec4 | [
"MIT"
] | null | null | null | test/warning_test.py | evanofslack/samila | 7c39ac32d7837dfa964c1060a3f04432969c5ec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
>>> import os
>>> import json
>>> from samila import *
>>> from pytest import warns
>>> g = GenerativeImage(lambda x,y: 0, lambda x,y: 0)
>>> g.generate(step=0.1)
>>> result = g.save_data()
>>> g_ = GenerativeImage(data=open('data.json', 'r'))
>>> g_.data1 == g.data1
True
>>> g_.data2 == g.data2
True
>>> with open('data.json', 'w') as fp:
... json.dump({'data1': [0], 'data2': [0], 'matplotlib_version': '0'}, fp)
>>> with warns(RuntimeWarning, match=r"Source matplotlib version(.*) is different from yours, plots may be different."):
... g = GenerativeImage(lambda x,y: 0, lambda x,y: 0, data=open('data.json', 'r'))
>>> with open('config.json', 'w') as fp:
... json.dump({'f1': 'x', 'f2': 'y', 'matplotlib_version': '0'}, fp)
>>> with warns(RuntimeWarning, match=r"Source matplotlib version(.*) is different from yours, plots may be different."):
... g = GenerativeImage(config=open('config.json', 'r'))
>>> os.remove('data.json')
>>> os.remove('config.json')
"""
| 38.923077 | 120 | 0.614625 | 146 | 1,012 | 4.219178 | 0.321918 | 0.103896 | 0.051948 | 0.058442 | 0.607143 | 0.551948 | 0.496753 | 0.496753 | 0.496753 | 0.496753 | 0 | 0.021915 | 0.143281 | 1,012 | 25 | 121 | 40.48 | 0.688581 | 0.990119 | 0 | null | 1 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
98a038537bb9823542b0bd348500554c9a4a4765 | 2,823 | py | Python | napari/util/tests/test_misc.py | ctrueden/napari | 4096e71b7e1fa041a62f4ac2f6853fba60c93e52 | [
"BSD-3-Clause"
] | null | null | null | napari/util/tests/test_misc.py | ctrueden/napari | 4096e71b7e1fa041a62f4ac2f6853fba60c93e52 | [
"BSD-3-Clause"
] | null | null | null | napari/util/tests/test_misc.py | ctrueden/napari | 4096e71b7e1fa041a62f4ac2f6853fba60c93e52 | [
"BSD-3-Clause"
] | null | null | null | from enum import auto
import pytest
from napari.util.misc import callsignature, StringEnum
def test_callsignature():
# no arguments
assert str(callsignature(lambda: None)) == '()'
# one arg
assert str(callsignature(lambda a: None)) == '(a)'
# multiple args
assert str(callsignature(lambda a, b: None)) == '(a, b)'
# arbitrary args
assert str(callsignature(lambda *args: None)) == '(*args)'
# arg + arbitrary args
assert str(callsignature(lambda a, *az: None)) == '(a, *az)'
# default arg
assert str(callsignature(lambda a=42: None)) == '(a=a)'
# multiple default args
assert str(callsignature(lambda a=0, b=1: None)) == '(a=a, b=b)'
# arg + default arg
assert str(callsignature(lambda a, b=42: None)) == '(a, b=b)'
# arbitrary kwargs
assert str(callsignature(lambda **kwargs: None)) == '(**kwargs)'
# default arg + arbitrary kwargs
assert str(callsignature(lambda a=42, **kwargs: None)) == '(a=a, **kwargs)'
# arg + default arg + arbitrary kwargs
assert str(callsignature(lambda a, b=42, **kw: None)) == '(a, b=b, **kw)'
# arbitary args + arbitrary kwargs
assert str(callsignature(lambda *args, **kw: None)) == '(*args, **kw)'
# arg + default arg + arbitrary kwargs
assert (
str(callsignature(lambda a, b=42, *args, **kwargs: None))
== '(a, b=b, *args, **kwargs)'
)
# kwonly arg
assert str(callsignature(lambda *, a: None)) == '(a=a)'
# arg + kwonly arg
assert str(callsignature(lambda a, *, b: None)) == '(a, b=b)'
# default arg + kwonly arg
assert str(callsignature(lambda a=42, *, b: None)) == '(a=a, b=b)'
# kwonly args + everything
assert (
str(callsignature(lambda a, b=42, *, c, d=5, **kwargs: None))
== '(a, b=b, c=c, d=d, **kwargs)'
)
def test_string_enum():
# Make a test StringEnum
class TestEnum(StringEnum):
THING = auto()
OTHERTHING = auto()
# test setting by value, correct case
assert TestEnum('thing') == TestEnum.THING
# test setting by value mixed case
assert TestEnum('thInG') == TestEnum.THING
# test setting by name correct case
assert TestEnum['THING'] == TestEnum.THING
# test setting by name mixed case
assert TestEnum['tHiNg'] == TestEnum.THING
# test setting by value with incorrect value
with pytest.raises(ValueError):
TestEnum('NotAThing')
# test setting by name with incorrect name
with pytest.raises(KeyError):
TestEnum['NotAThing']
# test creating a StringEnum with the functional API
animals = StringEnum('Animal', 'AARDVARK BUFFALO CAT DOG')
assert str(animals.AARDVARK) == 'aardvark'
assert animals('BUffALO') == animals.BUFFALO
assert animals['BUffALO'] == animals.BUFFALO
| 29.103093 | 79 | 0.619554 | 357 | 2,823 | 4.890756 | 0.187675 | 0.092784 | 0.214204 | 0.272623 | 0.607102 | 0.539519 | 0.420389 | 0.349943 | 0.277205 | 0.20504 | 0 | 0.007849 | 0.232731 | 2,823 | 96 | 80 | 29.40625 | 0.798246 | 0.229897 | 0 | 0.046512 | 0 | 0 | 0.124302 | 0 | 0 | 0 | 0 | 0 | 0.55814 | 1 | 0.046512 | false | 0 | 0.069767 | 0 | 0.186047 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
98a5ef2f4f3d201bc4341a191b2b8e3b696e743e | 1,826 | py | Python | classification/models/__init__.py | anonymous2submit/Pointsformer | 0eaa141b3d79d45cd925976bde6097b51e0d3819 | [
"MIT"
] | null | null | null | classification/models/__init__.py | anonymous2submit/Pointsformer | 0eaa141b3d79d45cd925976bde6097b51e0d3819 | [
"MIT"
] | null | null | null | classification/models/__init__.py | anonymous2submit/Pointsformer | 0eaa141b3d79d45cd925976bde6097b51e0d3819 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .model10 import model10A, model10B, model10C, model10D, model10E, model10F, model10G, model10H, model10I
from .model11 import model11A, model11B, model11C, model11D, model11E, model11F, model11G
from .model12 import model12A_64, model12A_128, model12B_64, model12B_128, model12C_64, model12C_128, \
model12D_64, model12D_128, model12E_64
from .model13 import model13A
from .model14 import model14A, model14B, model14C, model14D, model14E, model14Lite_A, model14Lite_B,\
model14Lite_C, model14Lite_D, model14Lite_E, model14Lite_F, model14Lite_G, model14Lite_H
from .model15 import model15A, model15B, model15C, model15D, model15E, model15Lite_A, model15Lite_B,\
model15Lite_C, model15Lite_D, model15Lite_E, model15Lite_F, model15Lite_G, model15Lite_H
from .model16 import model16A, model16B, model16C, model16D, model16E, model16Lite_A, model16Lite_B,\
model16Lite_C, model16Lite_D, model16Lite_E, model16Lite_F, model16Lite_G, model16Lite_H, \
model16Light_A, model16Light_B, model16Light_C, model16Light_D, model16Light_E, model16Light_F,\
model16Light_G, model16Light_H
from .model17 import model17A, model17F
from .model18 import model18A1, model18A2, model18A3
from .model19 import model19A, model19B
from .model20 import model20A, model20B
from .model21 import model21A, model21B, model21C, model21D, model21G, model21H
from .plot21 import plot21H
from .model22 import model22A,model22B, model22C, model22D, model22G, model22H
from .model23 import model23A, model23B, model23C, model23D, model23E, model23F, model23G, model23I, model23J, model23K
from .model24 import model24A, model24B, model24C, model24D, model24E, model24F, model24G, model24H
| 65.214286 | 119 | 0.772727 | 207 | 1,826 | 6.594203 | 0.536232 | 0.010989 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.184967 | 0.162103 | 1,826 | 27 | 120 | 67.62963 | 0.70719 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.73913 | 0 | 0.73913 | 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 |
98b69e6bec123ae7a8029afa30c2a67b2bb09ec3 | 1,294 | py | Python | pycipher2/affine.py | Malmosmo/pycipher2 | 9460cd4028dfe520f7bd4cc20f45116df3551495 | [
"MIT"
] | null | null | null | pycipher2/affine.py | Malmosmo/pycipher2 | 9460cd4028dfe520f7bd4cc20f45116df3551495 | [
"MIT"
] | null | null | null | pycipher2/affine.py | Malmosmo/pycipher2 | 9460cd4028dfe520f7bd4cc20f45116df3551495 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: Hannes Nikulski
import math
from typing import Tuple, Union
class Affine:
"""
The Affine Cipher is a substitution cipher that maps the index of every letter of the text using an affine function.
encryption:
- `x -> a * x + b`
decryption:
- `x -> a^-1 * x - b`
Where `a^-1` is the modular multiplicative inverse of `a`.
For more information see https://en.wikipedia.org/wiki/Affine_cipher.
"""
def __init__(self, key: Tuple[int, int], alphabet: Union[list, str]) -> None:
self.a, self.b = key
self.alphabet = alphabet
self.length = len(self.alphabet)
assert math.gcd(self.a, self.length) == 1, ValueError(f"First element of key ({self.a}) has to be coprime with the length of the alphabet ({self.length})")
# Note: modular multiplicative inverse, works only in Python 3.8+
self.inv_a = pow(self.a, -1, self.length)
def decrypt(self, ciphertext: str) -> str:
return "".join([self.alphabet[(self.inv_a * (self.alphabet.index(char) - self.b)) % self.length] for char in ciphertext])
def encrypt(self, plaintext: str) -> str:
return "".join([self.alphabet[(self.a * self.alphabet.index(char) + self.b) % self.length] for char in plaintext])
| 34.052632 | 163 | 0.640649 | 189 | 1,294 | 4.349206 | 0.444444 | 0.087591 | 0.032847 | 0.038929 | 0.189781 | 0.189781 | 0.189781 | 0.111922 | 0.111922 | 0.111922 | 0 | 0.006965 | 0.223338 | 1,294 | 37 | 164 | 34.972973 | 0.810945 | 0.328439 | 0 | 0 | 0 | 0.076923 | 0.117291 | 0 | 0 | 0 | 0 | 0 | 0.076923 | 1 | 0.230769 | false | 0 | 0.153846 | 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 |
7f284b3879d2e32ed40cc1b7a2eb2a8399a989cf | 185 | py | Python | pyutilib/component/loader/tests/eggsrc/pkg6/package6/main.py | PyUtilib/PyUtilib | d99406f2af1fb62268c34453a2fbe6bd4a7348f0 | [
"BSD-3-Clause"
] | 24 | 2016-04-02T10:00:02.000Z | 2021-03-02T16:40:18.000Z | pyutilib/component/loader/tests/eggsrc/pkg6/package6/main.py | PyUtilib/PyUtilib | d99406f2af1fb62268c34453a2fbe6bd4a7348f0 | [
"BSD-3-Clause"
] | 105 | 2015-10-29T03:29:58.000Z | 2021-12-30T22:00:45.000Z | pyutilib/component/loader/tests/eggsrc/pkg6/package6/main.py | PyUtilib/PyUtilib | d99406f2af1fb62268c34453a2fbe6bd4a7348f0 | [
"BSD-3-Clause"
] | 22 | 2016-01-21T15:35:25.000Z | 2021-05-15T20:17:44.000Z | from pyutilib.component.core import *
class IPackage6Util(Interface):
"""Interface for Package6 utilities"""
class Package6Util(SingletonPlugin):
implements(IPackage6Util)
| 16.818182 | 42 | 0.767568 | 17 | 185 | 8.352941 | 0.823529 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025157 | 0.140541 | 185 | 10 | 43 | 18.5 | 0.867925 | 0.172973 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
7f5a4ff761bc0af58b3850b606edee2fdfc7255b | 4,901 | py | Python | Zombie_Dice.py | joseguilhermee/Jogo_em_Python | c22f66cac03a20baa23aa80ced5796ad38eecdba | [
"MIT"
] | null | null | null | Zombie_Dice.py | joseguilhermee/Jogo_em_Python | c22f66cac03a20baa23aa80ced5796ad38eecdba | [
"MIT"
] | null | null | null | Zombie_Dice.py | joseguilhermee/Jogo_em_Python | c22f66cac03a20baa23aa80ced5796ad38eecdba | [
"MIT"
] | null | null | null | #Nome: JOSÉ GUILHERME NETO
#Curso: ANÁLISE E DESENVOLVIMENTO DE SISTEMAS
# Importanto biblioteca random
import random
import time
#Tela inicial
#Desenho de zumbi que criei
print ("\33[1;32m ______________________ \n| /.:::::::: :::||| ::..\ \n| /::::::::#:\: ::: : ::.\ \n| | ____ \________:::::::| ______________________________________________ \n| ||o | | o | ::||| Devore cérebros. Não leve um tiro na cabeça. \n| |\___/ * * \_______/||||| Nome: José Guilherme Neto \n| ''''\/''''W''''\ ::: ''/ Professor: Galbas Milleo Filho \n| __M_____/\/: ::'/ '''''''''''''''''''''''''''''''''''''''''''''' \n| \_________''''/ \33[1;32m")
print("|")
regras = input ("Quer ler as regras? [ sim / nao ] ")
if regras == 'sim':
print("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=")
print("Olá jogador!, vamos ver as regras antes de caçar cérebros? \n - O jogo necessita de pelo menos 2 jogadores; \n - A cada rodada será jogado três dados virtuais que podem cair C / P / T; \n - C = Cérebros / P = Passos / T = Tiros; \n - Você precisa pegar 13 cérebros para vencer; \n - Passos significa que sua presa fugiu; \n - Tiros significa que revidaram, 3 tiros e nem você sobrevive \n - Você pode jogar de novo quantas vezes quiser, mas \n terá que jogar de novo os dados que estão em passos, e sempre deverá jogar 3 dados (Contanto com os Passos;")
print("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=")
# Check para ter no mínimo 2 jogadores
numberPlayers = int(input("Numero de players "))
while numberPlayers < 2:
print("Não podemos começar a caçada com menos de dois ZuMbIs!!")
numberPlayers = int(input("Numero de players "))
# Chave para ENTRADA de jogadores:
entrada_de_jogadores = 0
while entrada_de_jogadores == 0:
print("QUE COMECE A CAÇADA!!!")
listPlayers = []
# Rotina para receber qualquer quantia de jogadores
for ind in range(0, numberPlayers):
nome = input("Nome do Zumbi:\n")
cerebros = 0
tiros = 0
passos = 0
#Para contabilizar pontos
player = [nome, cerebros, tiros]
listPlayers.append(player)
# Chave para fechar seleção de jogadores
entrada_de_jogadores = 1
# Desenho de Zumbi
print ("\33[1;32m ______________________ \n| /.:::::::: :::||| ::..\ \n| /::::::::#:\: ::: : ::.\ \n| | ____ \________:::::::| ______________________________________________ \n| ||o | | o | ::||| Devore cérebros. Não leve um tiro na cabeça. \n| |\___/ * * \_______/||||| BOA SORTE JOGADOR! \n| ''''\/''''W''''\ ::: ''/ \n| __M_____/\/: ::'/ '''''''''''''''''''''''''''''''''''''''''''''' \n| \_________''''/ \33[1;32m")
# Criando copo para conter dados
copo = ["CPCTPC", "CPCTPC", "CPCTPC", "CPCTPC", "CPCTPC", "CPCTPC", "TPCTPC", "TPCTPC", "TPCTPC", "TPCTPC", 'TPTCPT', 'TPTCPT', 'TPTCPT']
# Chave de ativação do laço de repetição
chave_de_ativacao = False
# Ficar rodando os players
for player in listPlayers:
chave_de_ativacao = False
# Laço para jogar os dados de todos os jogadores, 1 por 1
while not chave_de_ativacao:
print(f"É a vez do zumbi {player}")
time.sleep(2)
print("Se preparando para jogar os dados... \n \n")
# pegando os 3 dados
for i in range(0,3):
time.sleep(1)
dados = random.choice(copo)
copo.remove(dados)
#Escolhendo a face e mostrando ao jogador
face = random.choice(dados)
if face == "C":
print("|VOCÊ DEVOROU UM CERÉBRO")
cerebros = cerebros + 1
elif face == "P":
print("|EXISTE MAIS UM SOBREVIVENTE... DROGA, ESCAPOU")
passos = passos + 1
elif face == "T":
print("|VOCÊ LEVOU UM TIRO!!!")
tiros = tiros + 1
# mostrando mais especifico
print(f"|Seu dado foi { dados }, e caiu: { face } \n")
time.sleep(2)
decisao = input("Tem coragem de arriscar de novo? [ s / n ]: ")
print(f"\33[1;32m ______________________ \n| /.:::::::: :::||| ::..\ \n| /::::::::#:\: ::: : ::.\ \n| | ____ \________:::::::| ______________________________________________ \n| ||o | | o | ::||| QUE CAÇADA!! Você comeu {cerebros} CEREBROS \n| |\___/ * * \_______/||||| ÉÉé... {passos} pessoas fugiram, vai tentar pegar?! \n| ''''\/''''W''''\ ::: ''/ UI! levou {tiros} tiros \n| __M_____/\/: ::'/ '''''''''''''''''''''''''''''''''''''''''''''' \n| \_________''''/ ")
if decisao == "n":
# chava para fechar o laço
chave_de_ativacao = True
| 52.138298 | 574 | 0.52071 | 521 | 4,901 | 4.261036 | 0.383877 | 0.009009 | 0.008108 | 0.009459 | 0.136036 | 0.093694 | 0.053153 | 0.053153 | 0.053153 | 0.047748 | 0 | 0.014104 | 0.276678 | 4,901 | 93 | 575 | 52.698925 | 0.61213 | 0.121812 | 0 | 0.148148 | 0 | 0.074074 | 0.634454 | 0.109711 | 0 | 0 | 0 | 0.010753 | 0 | 1 | 0 | false | 0.074074 | 0.037037 | 0 | 0.037037 | 0.277778 | 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 | 1 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
7f6012b294b347b4ffa2ca2efc722c158ba7843d | 149 | py | Python | 001146StepikPyBegin/Stepik001146PyBeginсh07p02st10С04__20200420.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001146StepikPyBegin/Stepik001146PyBeginсh07p02st10С04__20200420.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001146StepikPyBegin/Stepik001146PyBeginсh07p02st10С04__20200420.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | m = int(input())
n = int(input()) + 1
for i in range(m, n, ):
if (i % 17 == 0) or (i % 10 == 9) or (i % 3 == 0 and i % 5 == 0):
print(i)
| 24.833333 | 69 | 0.409396 | 31 | 149 | 1.967742 | 0.612903 | 0.262295 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.112245 | 0.342282 | 149 | 5 | 70 | 29.8 | 0.510204 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.2 | 0 | 0 | 1 | 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 |
7f6f814d06139501aa2cb7be458467dba0abaa5f | 1,150 | py | Python | src/tarski/syntax/symrefs.py | phoeft670/tarski | 7d955e535fbbca012bfd1a12402b97febc6b35b9 | [
"Apache-2.0"
] | 29 | 2018-11-26T20:31:04.000Z | 2021-12-29T11:08:40.000Z | src/tarski/syntax/symrefs.py | phoeft670/tarski | 7d955e535fbbca012bfd1a12402b97febc6b35b9 | [
"Apache-2.0"
] | 101 | 2018-06-07T13:10:01.000Z | 2022-03-11T11:54:00.000Z | src/tarski/syntax/symrefs.py | phoeft670/tarski | 7d955e535fbbca012bfd1a12402b97febc6b35b9 | [
"Apache-2.0"
] | 18 | 2018-11-01T22:44:39.000Z | 2022-02-28T04:57:15.000Z |
from .formulas import Formula
from .terms import Term
def symref(sym):
""" Create a reference of a logical expression, formula or term """
if isinstance(sym, Term):
return TermReference(sym)
if isinstance(sym, Formula):
# Formulas are hashable and indexable by themselves, but we wrap them in a Ref object for uniformity reasons
return TermReference(sym)
raise RuntimeError(f'Unexpected symbol type "{type(sym)}"')
class TermReference:
""" A simple wrapper to provide a purely syntactic __eq__ operator for terms.
To be used whenever equality and hashing is required, e.g. in dictionaries, etc.,
since the __eq__ operator in the Term hierarchy is used for other purposes,
namely, to construct equality atoms in a user-readable manner. """
def __init__(self, expression):
self.expr = expression
def __hash__(self):
return self.expr.hash()
def __eq__(self, other):
return self.__class__ is other.__class__ and self.expr.is_syntactically_equal(other.expr)
def __str__(self):
return "symref[{}]".format(self.expr)
__repr__ = __str__
| 32.857143 | 116 | 0.69913 | 154 | 1,150 | 4.948052 | 0.532468 | 0.041995 | 0.03937 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.22087 | 1,150 | 34 | 117 | 33.823529 | 0.850446 | 0.403478 | 0 | 0.111111 | 0 | 0 | 0.070015 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.277778 | false | 0 | 0.111111 | 0.166667 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
7f78addb486f4a22dea3f6e24f7649761dfa8240 | 22 | py | Python | kenja/detection/__init__.py | umr00/kenja | 28d816a2a96f6391df5148a207e8eaa253600eeb | [
"MIT"
] | 14 | 2016-02-25T04:00:41.000Z | 2020-04-28T06:05:05.000Z | kenja/detection/__init__.py | umr00/kenja | 28d816a2a96f6391df5148a207e8eaa253600eeb | [
"MIT"
] | 9 | 2015-01-09T23:38:45.000Z | 2019-12-31T07:27:08.000Z | kenja/detection/__init__.py | umr00/kenja | 28d816a2a96f6391df5148a207e8eaa253600eeb | [
"MIT"
] | 10 | 2015-06-25T07:44:43.000Z | 2019-07-23T03:20:25.000Z | __author__ = 'kenjif'
| 11 | 21 | 0.727273 | 2 | 22 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 22 | 1 | 22 | 22 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0.272727 | 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 |
7f8e1848b93b13875b3826d1bbbb5eb923307ef5 | 358 | py | Python | aquests/protocols/http/base_request_handler.py | hansroh/aquests | 9de84cfff84ff5d5179d16c5c1f7be3487516843 | [
"MIT"
] | 8 | 2017-02-23T19:24:43.000Z | 2018-07-10T20:58:52.000Z | aquests/protocols/http/base_request_handler.py | hansroh/aquests | 9de84cfff84ff5d5179d16c5c1f7be3487516843 | [
"MIT"
] | 1 | 2017-02-23T19:52:51.000Z | 2017-02-25T04:05:34.000Z | aquests/protocols/http/base_request_handler.py | hansroh/aquests | 9de84cfff84ff5d5179d16c5c1f7be3487516843 | [
"MIT"
] | null | null | null |
class RequestHandler:
def __init__ (self, logger):
self.logger = logger
def log (self, message, type = "info"):
self.logger.log ("%s - %s" % (self.request.uri, message), type)
def log_info (self, message, type='info'):
self.log (message, type)
def trace (self):
self.logger.trace (self.request.uri)
def working (self):
return False
| 19.888889 | 65 | 0.656425 | 50 | 358 | 4.6 | 0.34 | 0.173913 | 0.130435 | 0.165217 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.189944 | 358 | 17 | 66 | 21.058824 | 0.793103 | 0 | 0 | 0 | 0 | 0 | 0.042017 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.454545 | false | 0 | 0 | 0.090909 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
7fa6dd880cc82dbd7d5a0f0a8f4259c21179fc82 | 121 | py | Python | django_selectel_storage/__init__.py | idealatom/django-selectel-storage | fa1d52a58a3d1b9ebc5337ac9c19ead986e8b53b | [
"MIT"
] | null | null | null | django_selectel_storage/__init__.py | idealatom/django-selectel-storage | fa1d52a58a3d1b9ebc5337ac9c19ead986e8b53b | [
"MIT"
] | null | null | null | django_selectel_storage/__init__.py | idealatom/django-selectel-storage | fa1d52a58a3d1b9ebc5337ac9c19ead986e8b53b | [
"MIT"
] | null | null | null | __version__ = '1.0.1'
default_app_config = (
'django_selectel_storage.apps.'
'DjangoSelectelStorageAppConfig'
)
| 17.285714 | 36 | 0.735537 | 12 | 121 | 6.75 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029126 | 0.14876 | 121 | 6 | 37 | 20.166667 | 0.757282 | 0 | 0 | 0 | 0 | 0 | 0.528926 | 0.487603 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f695749a5681f116405ec86a86108abe3c09a551 | 197 | py | Python | examples/stringnames.py | whuji/daiquiri | 650de3da95221fc6dfad9aee2f8818fb208a39a9 | [
"Apache-2.0"
] | null | null | null | examples/stringnames.py | whuji/daiquiri | 650de3da95221fc6dfad9aee2f8818fb208a39a9 | [
"Apache-2.0"
] | null | null | null | examples/stringnames.py | whuji/daiquiri | 650de3da95221fc6dfad9aee2f8818fb208a39a9 | [
"Apache-2.0"
] | null | null | null | import logging
import daiquiri
daiquiri.setup(level=logging.INFO, outputs=('stdout', 'stderr'))
logger = daiquiri.getLogger(__name__)
logger.info("It works and logs to both stdout and stderr!")
| 21.888889 | 64 | 0.766497 | 27 | 197 | 5.444444 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.111675 | 197 | 8 | 65 | 24.625 | 0.84 | 0 | 0 | 0 | 0 | 0 | 0.284264 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f6968853e8d3102310f8afde7ef68f9596371c82 | 745 | py | Python | tests/command_line/test_command_line.py | glennmusa/mypypackage | 2a4f4b3e4157d74ea12c1fc376ade07239172be5 | [
"MIT"
] | null | null | null | tests/command_line/test_command_line.py | glennmusa/mypypackage | 2a4f4b3e4157d74ea12c1fc376ade07239172be5 | [
"MIT"
] | null | null | null | tests/command_line/test_command_line.py | glennmusa/mypypackage | 2a4f4b3e4157d74ea12c1fc376ade07239172be5 | [
"MIT"
] | null | null | null | import unittest
from glennscli import command_line
from knack.testsdk import ScenarioTest, JMESPathCheck
class TestJokeScenarios(ScenarioTest):
def __init__(self, method_name):
mycli = command_line.my_cli()
super(TestJokeScenarios, self).__init__(mycli, method_name)
def test_tellmeajoke_cat(self):
self.cmd('tellmeajoke cat')
def test_tellmeajoke_cat_with_numjokes(self):
self.cmd('tellmeajoke cat --numjokes 3', JMESPathCheck('length(@)', 3))
def test_tellmeajoke_dog(self):
self.cmd('tellmeajoke dog')
def test_tellmeajoke_dog_with_numjokes(self):
self.cmd('tellmeajoke dog --numjokes 3', JMESPathCheck('length(@)', 3))
if __name__ == '__main__':
unittest.main()
| 29.8 | 79 | 0.715436 | 88 | 745 | 5.681818 | 0.363636 | 0.056 | 0.144 | 0.176 | 0.364 | 0.136 | 0 | 0 | 0 | 0 | 0 | 0.006504 | 0.174497 | 745 | 24 | 80 | 31.041667 | 0.806504 | 0 | 0 | 0 | 0 | 0 | 0.150336 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.294118 | false | 0 | 0.176471 | 0 | 0.529412 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f69dee378471f076fed4747c418fc795dbe6ff10 | 378 | py | Python | core/liteflow/core/models/workflow.py | zhangmx/liteflow | 021dc0423be2a4f7999fe1830fb655ce5db095e4 | [
"MIT"
] | 26 | 2018-11-13T01:27:15.000Z | 2022-02-10T09:42:23.000Z | core/liteflow/core/models/workflow.py | zhangmx/liteflow | 021dc0423be2a4f7999fe1830fb655ce5db095e4 | [
"MIT"
] | 1 | 2021-08-11T09:55:43.000Z | 2021-08-11T09:55:43.000Z | core/liteflow/core/models/workflow.py | zhangmx/liteflow | 021dc0423be2a4f7999fe1830fb655ce5db095e4 | [
"MIT"
] | 11 | 2019-05-22T13:04:52.000Z | 2022-03-31T06:09:04.000Z | from abc import ABCMeta, abstractmethod
from liteflow.core.builders import WorkflowBuilder
class Workflow(metaclass=ABCMeta):
@property
@abstractmethod
def id(self):
return None
@property
@abstractmethod
def version(self):
return 1
@abstractmethod
def build(self, builder: WorkflowBuilder):
raise NotImplementedError
| 18.9 | 50 | 0.698413 | 37 | 378 | 7.135135 | 0.648649 | 0.193182 | 0.189394 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003484 | 0.240741 | 378 | 19 | 51 | 19.894737 | 0.916376 | 0 | 0 | 0.357143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0 | 0.142857 | 0.142857 | 0.571429 | 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 | 1 | 0 | 0 | 0 | 3 |
f6d80e5c8882a5df5bec95e0ba8b630f03ab5f99 | 1,641 | py | Python | spyder_screencast/container.py | steff456/spyder-screencast | c9d16bd68aed556fdf5097d1012dc748c8018bae | [
"MIT"
] | null | null | null | spyder_screencast/container.py | steff456/spyder-screencast | c9d16bd68aed556fdf5097d1012dc748c8018bae | [
"MIT"
] | null | null | null | spyder_screencast/container.py | steff456/spyder-screencast | c9d16bd68aed556fdf5097d1012dc748c8018bae | [
"MIT"
] | 1 | 2021-04-17T04:37:25.000Z | 2021-04-17T04:37:25.000Z | # -*- coding: utf-8 -*-
# Third party imports
from qtpy.QtCore import QSize, QPoint, Signal
from spyder.api.translations import get_translation
from spyder.api.widgets.main_container import PluginMainContainer
# Local imports
from spyder_screencast.api import ScreenResolutions
from spyder_screencast.widgets import ScreenCastStatusWidget
# Localization
_ = get_translation('spyder_screencast')
class ScreenCastContainer(PluginMainContainer):
DEFAULT_OPTIONS = {
'resolution': ScreenResolutions.Screen1080x1020
}
# Signals
sig_resize_main_window_requested = Signal(QSize)
sig_move_main_window_requested = Signal(QPoint)
def __init__(self, name, plugin, parent=None):
super().__init__(name, plugin, parent)
def init_screen_cast_widget(self, main):
self.status_widget = ScreenCastStatusWidget(parent=self, main_window=main)
# --- PluginMainContainer API
# ------------------------------------------------------------------------
def setup(self, options=DEFAULT_OPTIONS):
self.create_action(
'screencast_action',
text=_("Start recording..."),
icon=self.create_icon("python"),
triggered=self.start_recording,
)
def on_option_update(self, option, value):
pass
def update_actions(self):
pass
# --- Public API
# ------------------------------------------------------------------------
def start_recording(self):
pass
def stop_recording(self):
pass
def update_size(self, size):
pass
def update_position(self, position):
pass
| 26.901639 | 82 | 0.626447 | 160 | 1,641 | 6.1625 | 0.4375 | 0.040568 | 0.039554 | 0.05071 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006907 | 0.205972 | 1,641 | 60 | 83 | 27.35 | 0.749808 | 0.161487 | 0 | 0.171429 | 0 | 0 | 0.04978 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.257143 | false | 0.171429 | 0.142857 | 0 | 0.514286 | 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 |
f6df877c1e651cdad4a19a9d3239e6e7f153467a | 255 | py | Python | stubs/ev3_pybricks_1_0_0/functools.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 38 | 2020-10-18T21:59:44.000Z | 2022-03-17T03:03:28.000Z | stubs/ev3_pybricks_1_0_0/functools.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 176 | 2020-10-18T14:31:03.000Z | 2022-03-30T23:22:39.000Z | stubs/ev3_pybricks_1_0_0/functools.py | RonaldHiemstra/micropython-stubs | d97f879b01f6687baaebef1c7e26a80909c3cff3 | [
"MIT"
] | 6 | 2020-12-28T21:11:12.000Z | 2022-02-06T04:07:50.000Z | """
Module: 'functools' on LEGO EV3 v1.0.0
"""
# MCU: sysname=ev3, nodename=ev3, release=('v1.0.0',), version=('0.0.0',), machine=ev3
# Stubber: 1.3.2
def partial():
pass
def reduce():
pass
def update_wrapper():
pass
def wraps():
pass
| 14.166667 | 86 | 0.6 | 40 | 255 | 3.8 | 0.6 | 0.052632 | 0.052632 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078049 | 0.196078 | 255 | 17 | 87 | 15 | 0.663415 | 0.545098 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
100dffd40c7c00ddc5e5eb36de98154ca276c2c2 | 116 | py | Python | Test/test_model.py | janol77/pyfhir-resources | eea6322f0be3857f07997abc720138e2ba616ac3 | [
"Apache-2.0"
] | null | null | null | Test/test_model.py | janol77/pyfhir-resources | eea6322f0be3857f07997abc720138e2ba616ac3 | [
"Apache-2.0"
] | null | null | null | Test/test_model.py | janol77/pyfhir-resources | eea6322f0be3857f07997abc720138e2ba616ac3 | [
"Apache-2.0"
] | null | null | null | from db import db
class Test(db.Document):
title = db.StringField(max_length=60)
text = db.StringField()
| 14.5 | 41 | 0.689655 | 17 | 116 | 4.647059 | 0.705882 | 0.329114 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.021505 | 0.198276 | 116 | 7 | 42 | 16.571429 | 0.827957 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
63d9731bb72b13ea3ed10f3da612d9a4f6550549 | 193 | py | Python | midterm1/misspelled.py | williamtrang/DSC20 | eb72c1003ee98e30f63040568e82eedcb8d3af52 | [
"Apache-2.0"
] | null | null | null | midterm1/misspelled.py | williamtrang/DSC20 | eb72c1003ee98e30f63040568e82eedcb8d3af52 | [
"Apache-2.0"
] | null | null | null | midterm1/misspelled.py | williamtrang/DSC20 | eb72c1003ee98e30f63040568e82eedcb8d3af52 | [
"Apache-2.0"
] | null | null | null | def misspelled(words):
misspelled_words = []
for keys, values in words.items():
if ''.join(values) != keys:
misspelled_words.append(keys)
return misspelled_words | 32.166667 | 41 | 0.637306 | 22 | 193 | 5.454545 | 0.545455 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.248705 | 193 | 6 | 42 | 32.166667 | 0.827586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
63f527bd2724ad07a375271eb260d585a44d04a7 | 274 | py | Python | src/onegov/org/views/person_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/person_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/org/views/person_move.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.security import Private
from onegov.org import OrgApp
from onegov.org.models import PersonMove
@OrgApp.view(model=PersonMove, permission=Private, request_method='PUT')
def move_page(self, request):
request.assert_valid_csrf_token()
self.execute()
| 27.4 | 72 | 0.79562 | 38 | 274 | 5.605263 | 0.657895 | 0.140845 | 0.122066 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.109489 | 274 | 9 | 73 | 30.444444 | 0.872951 | 0 | 0 | 0 | 0 | 0 | 0.010949 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
121647c940e2455ed26f2ea1269a59514091bc2b | 55 | py | Python | venv/lib/python2.7/site-packages/pychart/tick_mark_doc.py | Christian-Castro/castro_odoo8 | 8247fdb20aa39e043b6fa0c4d0af509462ab3e00 | [
"Unlicense"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | venv/lib/python2.7/site-packages/pychart/tick_mark_doc.py | Christian-Castro/castro_odoo8 | 8247fdb20aa39e043b6fa0c4d0af509462ab3e00 | [
"Unlicense"
] | null | null | null | venv/lib/python2.7/site-packages/pychart/tick_mark_doc.py | Christian-Castro/castro_odoo8 | 8247fdb20aa39e043b6fa0c4d0af509462ab3e00 | [
"Unlicense"
] | null | null | null | # automatically generated by generate_docs.py.
doc=" "
| 18.333333 | 46 | 0.763636 | 7 | 55 | 5.857143 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.127273 | 55 | 2 | 47 | 27.5 | 0.854167 | 0.8 | 0 | 0 | 1 | 0 | 0.111111 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
122399158406bde208e8d09d7510194dc7e61476 | 874 | py | Python | mltrace/entities/component.py | ariG23498/mltrace | 9fe53a6bf9e1d737f4367650aa8dd956e09f33d5 | [
"Apache-2.0"
] | null | null | null | mltrace/entities/component.py | ariG23498/mltrace | 9fe53a6bf9e1d737f4367650aa8dd956e09f33d5 | [
"Apache-2.0"
] | null | null | null | mltrace/entities/component.py | ariG23498/mltrace | 9fe53a6bf9e1d737f4367650aa8dd956e09f33d5 | [
"Apache-2.0"
] | null | null | null | from mltrace.entities.base import Base
import json
import pprint
import typing
class Component(Base):
"""Component abstraction."""
def __init__(
self, name: str, description: str, owner: str, tags: typing.List[str] = []
):
"""Components should have a name, description, and owner.
Optionally they will have tags."""
self._name = name
self._description = description
self._owner = owner
self._tags = tags
@property
def name(self) -> str:
return self._name
@property
def description(self) -> str:
return self._description
@property
def owner(self) -> str:
return self._owner
@property
def tags(self) -> typing.List[str]:
return self._tags
def __repr__(self):
params = self.to_dictionary()
return json.dumps(params)
| 21.85 | 82 | 0.614416 | 100 | 874 | 5.2 | 0.35 | 0.084615 | 0.1 | 0.098077 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.284897 | 874 | 39 | 83 | 22.410256 | 0.832 | 0.124714 | 0 | 0.148148 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.148148 | 0.148148 | 0.592593 | 0.037037 | 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 |
12272f5093344004e4906328fb1ceb0c0f647f35 | 116 | py | Python | extra_tests/cffi_tests/conftest.py | ctrl-shift-make/pypy | 6d2f7a78baa8d4d2f94f5fb709f697a560b45f4e | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | extra_tests/cffi_tests/conftest.py | ctrl-shift-make/pypy | 6d2f7a78baa8d4d2f94f5fb709f697a560b45f4e | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | extra_tests/cffi_tests/conftest.py | ctrl-shift-make/pypy | 6d2f7a78baa8d4d2f94f5fb709f697a560b45f4e | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | import sys
def pytest_ignore_collect(path):
if '__pypy__' not in sys.builtin_module_names:
return True
| 19.333333 | 50 | 0.732759 | 17 | 116 | 4.529412 | 0.941176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.206897 | 116 | 5 | 51 | 23.2 | 0.836957 | 0 | 0 | 0 | 0 | 0 | 0.068966 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
123a0c5a28bd7bcf4801bb2a4a07ccc7d25a9e57 | 144 | py | Python | subnet_src/config.py | vs666/Sentinel | 8849d1bc25e3aaa56f2fb1cd3c58bddd2ec47608 | [
"BSD-3-Clause"
] | null | null | null | subnet_src/config.py | vs666/Sentinel | 8849d1bc25e3aaa56f2fb1cd3c58bddd2ec47608 | [
"BSD-3-Clause"
] | null | null | null | subnet_src/config.py | vs666/Sentinel | 8849d1bc25e3aaa56f2fb1cd3c58bddd2ec47608 | [
"BSD-3-Clause"
] | null | null | null | MAX_SPLIT_A = (1<<31)
MAX_SPLIT_B = (1<<31)
PRIME_GOD = 313353373353313 # a new prime number, also expressible as sum of 2 squares
PORT = 9000 | 36 | 88 | 0.729167 | 26 | 144 | 3.846154 | 0.769231 | 0.16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.218487 | 0.173611 | 144 | 4 | 89 | 36 | 0.621849 | 0.388889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
12644d11d7936831df0269754e60d1c08cdbdbc2 | 182 | py | Python | src/send.py | druzy/python-protocol | 8915df633e2756c44c9c2a65085863c8143cdf1f | [
"MIT"
] | null | null | null | src/send.py | druzy/python-protocol | 8915df633e2756c44c9c2a65085863c8143cdf1f | [
"MIT"
] | null | null | null | src/send.py | druzy/python-protocol | 8915df633e2756c44c9c2a65085863c8143cdf1f | [
"MIT"
] | null | null | null | from pychromecast import Chromecast
from wait_init import wait_init
import sys
cast=Chromecast(sys.argv[1])
wait_init(cast)
cast.media_controller.play_media(sys.argv[2],sys.argv[3]) | 26 | 57 | 0.824176 | 31 | 182 | 4.677419 | 0.483871 | 0.165517 | 0.193103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017751 | 0.071429 | 182 | 7 | 57 | 26 | 0.840237 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
126722c9d0b6b7cd7e5ceb10d6a134c1d6ce9431 | 309 | py | Python | Pycharm/pratica/ex036.2.py | Augustos697/Python | 4d8f27c39b359fa34c0f770a4229b456a0b45e62 | [
"MIT"
] | null | null | null | Pycharm/pratica/ex036.2.py | Augustos697/Python | 4d8f27c39b359fa34c0f770a4229b456a0b45e62 | [
"MIT"
] | null | null | null | Pycharm/pratica/ex036.2.py | Augustos697/Python | 4d8f27c39b359fa34c0f770a4229b456a0b45e62 | [
"MIT"
] | null | null | null | """Escrevam um programa para aprovar o empréstimo bancário para a compra de uma casa. O programa
vai perguntar o valor da casa, o salário do comprador e em quantos anos ele vai pagar.
Calucule o valor da prestação mensal, sabendo que ela não pode excerder 30% do
salário ou então o emprétismo será negado"""
| 51.5 | 96 | 0.786408 | 54 | 309 | 4.5 | 0.759259 | 0.041152 | 0.065844 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007874 | 0.177994 | 309 | 5 | 97 | 61.8 | 0.948819 | 0.977346 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
89bfb5f316f623d0f80070d52887877a7ce5d0e0 | 109 | py | Python | example.py | skysense/CRAFT-pytorch | 94e7cd3dc9187fb558c516f184343a067e845191 | [
"MIT"
] | null | null | null | example.py | skysense/CRAFT-pytorch | 94e7cd3dc9187fb558c516f184343a067e845191 | [
"MIT"
] | null | null | null | example.py | skysense/CRAFT-pytorch | 94e7cd3dc9187fb558c516f184343a067e845191 | [
"MIT"
] | null | null | null | from craft import TextInWildModel
tiwm = TextInWildModel()
print(tiwm.image_contains_text('path/to/image'))
| 21.8 | 48 | 0.807339 | 14 | 109 | 6.142857 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.082569 | 109 | 4 | 49 | 27.25 | 0.86 | 0 | 0 | 0 | 0 | 0 | 0.119266 | 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 |
89d6cab5304f48b8d5145ab1476c7b209f85d595 | 1,769 | py | Python | welcome/migrations/0005_auto_20161123_1108.py | akshaybabloo/Abies | fd7e2b926b4ae3c9089bc6b433747e67f8157472 | [
"MIT"
] | null | null | null | welcome/migrations/0005_auto_20161123_1108.py | akshaybabloo/Abies | fd7e2b926b4ae3c9089bc6b433747e67f8157472 | [
"MIT"
] | null | null | null | welcome/migrations/0005_auto_20161123_1108.py | akshaybabloo/Abies | fd7e2b926b4ae3c9089bc6b433747e67f8157472 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-11-23 11:08
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('welcome', '0004_auto_20161123_0916'),
]
operations = [
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_city',
new_name='city',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_company_logo_location',
new_name='company_logo_location',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_company_name',
new_name='company_name',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_country',
new_name='country',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_first_name',
new_name='first_name',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_last_name',
new_name='last_name',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_password',
new_name='password',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_profile_image_location',
new_name='profile_image_location',
),
migrations.RenameField(
model_name='welcometoabies',
old_name='welcome_username',
new_name='username',
),
]
| 29 | 54 | 0.574336 | 158 | 1,769 | 6.063291 | 0.297468 | 0.197286 | 0.244259 | 0.281837 | 0.588727 | 0.588727 | 0.588727 | 0.588727 | 0.407098 | 0 | 0 | 0.026801 | 0.325042 | 1,769 | 60 | 55 | 29.483333 | 0.775544 | 0.037875 | 0 | 0.509434 | 1 | 0 | 0.25309 | 0.073573 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.037736 | 0.037736 | 0 | 0.09434 | 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 |
89ea7122e5c8ac85ec3e0fe0a2bc54b5dc84b7b8 | 364 | py | Python | testData/mock/pydanticv18/types.py | alek-sun/pydantic-pycharm-plugin | 6b07519aadf0ff8b8a644c1f9ede88e09c687c80 | [
"Apache-2.0",
"MIT"
] | 238 | 2019-08-05T12:46:09.000Z | 2022-03-25T08:53:25.000Z | testData/mock/pydanticv18/types.py | alek-sun/pydantic-pycharm-plugin | 6b07519aadf0ff8b8a644c1f9ede88e09c687c80 | [
"Apache-2.0",
"MIT"
] | 415 | 2019-07-15T17:39:35.000Z | 2022-03-31T01:18:38.000Z | testData/mock/pydanticv18/types.py | collerek/pydantic-pycharm-plugin | 7068ece42334cc9fbe927d779d199c86d5139888 | [
"Apache-2.0",
"MIT"
] | 7 | 2019-08-09T01:03:16.000Z | 2022-02-08T03:28:19.000Z |
def conlist(item_type, *, min_items = None, max_items = None) Type[List[T]]:
pass
def constr(
*,
strip_whitespace: bool = False,
to_lower: bool = False,
strict: bool = False,
min_length: int = None,
max_length: int = None,
curtail_length: int = None,
regex: str = None,
) -> Type[str]:
pass | 24.266667 | 76 | 0.554945 | 45 | 364 | 4.311111 | 0.533333 | 0.139175 | 0.201031 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.326923 | 364 | 15 | 77 | 24.266667 | 0.791837 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.153846 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
89f99d6b54f023399cf27bc3419342c52a8fdce4 | 173 | py | Python | get_resnet_50.py | tmyapple/TRT_Benchmark | a278f19f7fbe80fbf54d4976414c6ac495dacaf7 | [
"Apache-2.0"
] | null | null | null | get_resnet_50.py | tmyapple/TRT_Benchmark | a278f19f7fbe80fbf54d4976414c6ac495dacaf7 | [
"Apache-2.0"
] | null | null | null | get_resnet_50.py | tmyapple/TRT_Benchmark | a278f19f7fbe80fbf54d4976414c6ac495dacaf7 | [
"Apache-2.0"
] | null | null | null | from tensorflow.keras.applications.resnet50 import ResNet50
model = ResNet50(weights='imagenet')
# Save the entire model as a SavedModel.
model.save('resnet50_saved_model') | 34.6 | 59 | 0.815029 | 23 | 173 | 6.043478 | 0.695652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.050955 | 0.092486 | 173 | 5 | 60 | 34.6 | 0.834395 | 0.219653 | 0 | 0 | 0 | 0 | 0.208955 | 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 |
89fee3b145615c6059ce8be3ea1f5360dea36f9c | 190 | py | Python | mmdet/oltr/__init__.py | 13952522076/mmdet1 | dc3a674382963058e3caaad47abb4c941f4e6dc5 | [
"Apache-2.0"
] | 1 | 2020-09-09T23:23:49.000Z | 2020-09-09T23:23:49.000Z | mmdet/oltr/__init__.py | 13952522076/mmdet1 | dc3a674382963058e3caaad47abb4c941f4e6dc5 | [
"Apache-2.0"
] | null | null | null | mmdet/oltr/__init__.py | 13952522076/mmdet1 | dc3a674382963058e3caaad47abb4c941f4e6dc5 | [
"Apache-2.0"
] | null | null | null | from .CosNormClassifier import *
from .DiscCentroidsLoss import *
from .MetaEmbeddingClassifier import *
__all__=[
'CosNorm_Classifier', 'DiscCentroidsLoss','MetaEmbedding_Classifier'
] | 27.142857 | 72 | 0.805263 | 15 | 190 | 9.8 | 0.6 | 0.136054 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105263 | 190 | 7 | 73 | 27.142857 | 0.864706 | 0 | 0 | 0 | 0 | 0 | 0.308901 | 0.125654 | 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 |
d617b193a692413378dfa718fdb8db16a323e2da | 465 | py | Python | common/base_admin.py | healthdesk-hackathon/backend | 93c43ff1aeff493a6b4d0034807f0434507ab05d | [
"MIT"
] | null | null | null | common/base_admin.py | healthdesk-hackathon/backend | 93c43ff1aeff493a6b4d0034807f0434507ab05d | [
"MIT"
] | 32 | 2020-03-27T23:50:02.000Z | 2021-09-08T01:54:55.000Z | common/base_admin.py | healthdesk-hackathon/backend | 93c43ff1aeff493a6b4d0034807f0434507ab05d | [
"MIT"
] | null | null | null | class SaveCurrentUser():
def save_model(self, request, obj, form, change):
obj.current_user = request.user
super().save_model(request, obj, form, change)
class SaveCurrentUserAdmin():
def save_model(self, request, obj, form, change):
obj.current_user = request.user
super().save_model(request, obj, form, change)
readonly_fields = [
'creator',
'created',
'modifier',
'modified'
]
| 23.25 | 54 | 0.615054 | 50 | 465 | 5.58 | 0.4 | 0.129032 | 0.200717 | 0.286738 | 0.681004 | 0.681004 | 0.681004 | 0.681004 | 0.681004 | 0.681004 | 0 | 0 | 0.264516 | 465 | 19 | 55 | 24.473684 | 0.815789 | 0 | 0 | 0.428571 | 0 | 0 | 0.064516 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.357143 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d6251743d92f90f3726bc584506e8549b8ed9ba2 | 195 | py | Python | insert_DataBase_robot.py | ramondata/Codigos-python-pyspark-treino | 3b54f92ae2575f219d46155451a134fc38500411 | [
"MIT"
] | null | null | null | insert_DataBase_robot.py | ramondata/Codigos-python-pyspark-treino | 3b54f92ae2575f219d46155451a134fc38500411 | [
"MIT"
] | null | null | null | insert_DataBase_robot.py | ramondata/Codigos-python-pyspark-treino | 3b54f92ae2575f219d46155451a134fc38500411 | [
"MIT"
] | null | null | null | import pyautogui
import time
import pyperclip
# Fazer o código para cada tipo de bd;
pyautogui.PAUSE = 2.0
pyautogui.press('win')
pyautogui.write('pgadmin4')
pyautogui.press('enter')
| 17.727273 | 39 | 0.728205 | 27 | 195 | 5.259259 | 0.740741 | 0.197183 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.018519 | 0.169231 | 195 | 10 | 40 | 19.5 | 0.858025 | 0.184615 | 0 | 0 | 0 | 0 | 0.109589 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.428571 | 0 | 0.428571 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d642f77693fd0c8e26de0a4c034ed5464a1c4918 | 6,166 | py | Python | code/debugger.py | Autofire/knausj_talon | d3b3d5f2cb39fa105cf2b5a432f55cd3016b9f75 | [
"MIT"
] | 1 | 2020-12-30T00:18:18.000Z | 2020-12-30T00:18:18.000Z | code/debugger.py | Autofire/knausj_talon | d3b3d5f2cb39fa105cf2b5a432f55cd3016b9f75 | [
"MIT"
] | null | null | null | code/debugger.py | Autofire/knausj_talon | d3b3d5f2cb39fa105cf2b5a432f55cd3016b9f75 | [
"MIT"
] | null | null | null | # XXX - execute until line number/cursor
# XXX - more memory printing
# XXX - need a way to disable the architecture modes, maybe be on context
# destruction
from talon import Context, Module, actions, app
mod = Module()
mod.tag("debugger", desc="Tag for enabling generic debugger commands")
# this list is updated by architecture specific python files
mod.list("registers", desc="A list of architecture registers")
ctx = Context()
ctx.matches = r"""
tag: user.debugger
"""
ctx.lists["user.registers"] = {}
@mod.capture(rule="{self.registers}")
def registers(m) -> str:
"Returns a register"
return m.registers
class Debugger:
def __init__(self, mod):
self.arch_index = 0
self.architectures = ["x86", "x64"]
for arch in self.architectures:
mod.tag(arch, desc="Tag for enabling {arch} architecture")
self.architecture = self.architectures[self.arch_index]
def cycle_architecture(self):
"""Switch between supported architectures"""
# actions.mode.disable(f"user.{self.architecture}")
self.arch_index += 1
if self.arch_index == len(self.architectures):
self.arch_index = 0
self.architecture = self.architectures[self.arch_index]
# XXX - debugger ever has more tags, this will be a problem
ctx.tags = [f"user.{self.architecture}"]
# XXX - modes don't work for dynamic context loading it seems,
# as a:
# ```
# ctx.matches = r"""
# mode: user.x64
# """
# ```
# won't activate...
# actions.mode.disable(f"user.{self.architecture}")
app.notify(subtitle=f"Debug architecture: {self.architecture}")
def current_architecture(self):
"""Display the current architecture"""
app.notify(subtitle=f"Debug architecture: {self.architecture}")
debugger = Debugger(mod)
# XXX - pass by windbg to dump
windows_x64_register_parameters = ["rcx", "rdx", "r8", "r9"]
@mod.action_class
class Actions:
def debugger_step_into():
"""Step into an instruction in the debugger"""
def debugger_step_over():
"""Step over an instruction in the debugger"""
def debugger_step_line():
"""Step into a source line in the debugger"""
def debugger_step_over_line():
"""Step over a source line in the debugger"""
def debugger_step_out():
"""Step until function exit in the debugger"""
def debugger_continue():
"""Continue execution in the debugger"""
def debugger_restart():
"""Restart execution in the debugger"""
def debugger_start():
"""Start debugging"""
def debugger_stop():
"""Stop the debugger"""
def debugger_exit():
"""Exit the debugger"""
def debugger_exit_force():
"""Force exit the debugger"""
def debugger_detach():
"""Detach the debugger"""
def debugger_backtrace():
"""Print a back trace in the debugger"""
def debugger_get_register():
"""Print specific register in the debugger"""
def debugger_set_register():
"""Set specific register in the debugger"""
def debugger_show_registers():
"""Print the current registers in the debugger"""
def debugger_break_now():
"""Break into the debugger"""
def debugger_break_here():
"""Set a break on the current line"""
def debugger_show_breakpoints():
"""Print the current breakpoints in the debugger"""
def debugger_add_sw_breakpoint():
"""Add one software breakpoint in the debugger"""
def debugger_add_hw_breakpoint():
"""Add one hardware breakpoint in the debugger"""
def debugger_clear_all_breakpoints():
"""Clear all breakpoints in the debugger"""
def debugger_clear_breakpoint():
"""Clear one breakpoint in the debugger"""
def debugger_clear_breakpoint_id(number_small: int):
"""Clear one breakpoint id in the debugger"""
def debugger_disable_breakpoint_id(number_small: int):
"""Disable one breakpoint id in the debugger"""
def debugger_disable_breakpoint():
"""Disable one breakpoint in the debugger"""
def debugger_disable_all_breakpoints():
"""Disable all breakpoints in the debugger"""
def debugger_enable_breakpoint():
"""Enable one breakpoint in the debugger"""
def debugger_enable_breakpoint_id(number_small: int):
"""Enable one breakpoint id in the debugger"""
def debugger_enable_all_breakpoints():
"""Enable all breakpoints in the debugger"""
def debugger_disassemble():
"""Preps the disassemble command in the debugger"""
def debugger_disassemble_here():
"""Disassembles instructions at the current instruction pointer"""
def debugger_disassemble_clipboard():
"""Disassemble instructions at an address in the clipboard"""
def debugger_goto_address():
"""Jump to a specific address in the debugger"""
def debugger_goto_clipboard():
"""Jump to a specific address stored in the clipboard"""
def debugger_goto_highlighted():
"""Jump to a specific highlighted address in the debugger"""
def debugger_dump_ascii_string():
"""Display as specific address as an ascii string in the debugger"""
def debugger_dump_unicode_string():
"""Display as specific address as an unicode string in the debugger"""
def debugger_dump_pointers():
"""Display as specific address as a list of pointers in the debugger"""
def debugger_inspect_type():
"""Inspect a specific data type in the debugger"""
def debugger_clear_line():
"""Clear unwanted data from the command line"""
def debugger_list_modules():
"""List the loaded modules in the debuggee memory space"""
def debugger_cycle_architecture():
"""Switch to the next architecture mode"""
global debugger
debugger.cycle_architecture()
def debugger_current_architecture():
"""displayed the current architecture mode"""
global debugger
debugger.current_architecture()
| 30.374384 | 79 | 0.65845 | 744 | 6,166 | 5.306452 | 0.237903 | 0.122594 | 0.124113 | 0.195035 | 0.492401 | 0.379433 | 0.29002 | 0.110689 | 0.080041 | 0.028369 | 0 | 0.002756 | 0.234998 | 6,166 | 202 | 80 | 30.524752 | 0.834217 | 0.390853 | 0 | 0.098765 | 0 | 0 | 0.088719 | 0.006803 | 0 | 0 | 0 | 0 | 0 | 1 | 0.592593 | false | 0 | 0.012346 | 0 | 0.641975 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c3bb0b64903ad71b133c7dfe60eca0f425b7a089 | 116 | py | Python | docs/api-examples-source/widget.time_input.py | amitness/streamlit | e00dfd491f7dc4cddfa92714f5a28adabd1deff4 | [
"Apache-2.0"
] | 4 | 2019-11-10T13:50:56.000Z | 2020-01-07T21:02:29.000Z | docs/api-examples-source/widget.time_input.py | umairnsr87/streamlit | edd17c4cca86a92becb1b693c2581ca2086b3de2 | [
"Apache-2.0"
] | null | null | null | docs/api-examples-source/widget.time_input.py | umairnsr87/streamlit | edd17c4cca86a92becb1b693c2581ca2086b3de2 | [
"Apache-2.0"
] | 1 | 2019-11-26T09:37:57.000Z | 2019-11-26T09:37:57.000Z | import streamlit as st
t = st.time_input("Set an alarm for", datetime.time(8, 45))
st.write("Alarm is set for", t)
| 23.2 | 59 | 0.698276 | 23 | 116 | 3.478261 | 0.695652 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.030612 | 0.155172 | 116 | 4 | 60 | 29 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0.275862 | 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 |
c3bf1eb7192bd28acd0ceb65ae2bae1993bcef43 | 295 | py | Python | BE/src/utils/memory.py | HananKavitz/ArtTransfer | fe3cd9d0ac4b8bc2ac418fd8ef47434790054ad0 | [
"MIT"
] | null | null | null | BE/src/utils/memory.py | HananKavitz/ArtTransfer | fe3cd9d0ac4b8bc2ac418fd8ef47434790054ad0 | [
"MIT"
] | null | null | null | BE/src/utils/memory.py | HananKavitz/ArtTransfer | fe3cd9d0ac4b8bc2ac418fd8ef47434790054ad0 | [
"MIT"
] | null | null | null | import tensorflow as tf
def limit_memory(limit=5000):
gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
tf.config.experimental.set_virtual_device_configuration(gpu, [
tf.config.experimental.VirtualDeviceConfiguration(memory_limit=limit)])
| 32.777778 | 83 | 0.752542 | 36 | 295 | 5.972222 | 0.611111 | 0.111628 | 0.27907 | 0.223256 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016064 | 0.155932 | 295 | 8 | 84 | 36.875 | 0.84739 | 0 | 0 | 0 | 0 | 0 | 0.010169 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.333333 | 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 |
c3c7aa93d92ff6a36dd8ef189d0460448fafe69e | 8,938 | py | Python | SandBox/Geometry/ReadFieldsHDF.py | srichers/thornado | bc6666cbf9ae8b39b1ba5feffac80303c2b1f9a8 | [
"BSD-3-Clause"
] | 6 | 2019-12-08T16:16:55.000Z | 2020-07-24T19:31:21.000Z | SandBox/Geometry/ReadFieldsHDF.py | srichers/thornado | bc6666cbf9ae8b39b1ba5feffac80303c2b1f9a8 | [
"BSD-3-Clause"
] | 9 | 2019-07-10T20:13:15.000Z | 2021-11-11T13:21:00.000Z | SandBox/Geometry/ReadFieldsHDF.py | srichers/thornado | bc6666cbf9ae8b39b1ba5feffac80303c2b1f9a8 | [
"BSD-3-Clause"
] | 8 | 2018-11-14T01:13:40.000Z | 2022-01-24T02:08:20.000Z | #!/usr/local/bin/python3
# --- Import libraries ---
import warnings
warnings.simplefilter( action = 'ignore' , category = FutureWarning )
# --- Get rid of "Too many open files" error ---
import numpy as np
import h5py as h5
def ReadFields( PathToData, Snapshots ):
GF_root = PathToData + 'thornado_Christoffel_000000'
nFiles = len( Snapshots )
DataFileNames_Geometry = np.empty( nFiles, object )
# Arrays to hold data
Data_GF = np.empty( nFiles, object )
GF = np.empty( nFiles, object )
for i in range( nFiles ):
DataFileNames_Geometry[i] = GF_root + '.h5'
Data_GF[i] = h5.File( DataFileNames_Geometry[i], 'r' )
# Get the spatial grid
X = Data_GF[0][ 'Spatial Grid' ]
X1 = np.array( X[ 'X1' ] )
X2 = np.array( X[ 'X2' ] )
X3 = np.array( X[ 'X3' ] )
# Geometry fields
GF_000=np.empty( nFiles, object )
GF_001=np.empty( nFiles, object )
GF_002=np.empty( nFiles, object )
GF_003=np.empty( nFiles, object )
GF_010=np.empty( nFiles, object )
GF_011=np.empty( nFiles, object )
GF_012=np.empty( nFiles, object )
GF_013=np.empty( nFiles, object )
GF_020=np.empty( nFiles, object )
GF_021=np.empty( nFiles, object )
GF_022=np.empty( nFiles, object )
GF_023=np.empty( nFiles, object )
GF_030=np.empty( nFiles, object )
GF_031=np.empty( nFiles, object )
GF_032=np.empty( nFiles, object )
GF_033=np.empty( nFiles, object )
GF_100=np.empty( nFiles, object )
GF_101=np.empty( nFiles, object )
GF_102=np.empty( nFiles, object )
GF_103=np.empty( nFiles, object )
GF_110=np.empty( nFiles, object )
GF_111=np.empty( nFiles, object )
GF_112=np.empty( nFiles, object )
GF_113=np.empty( nFiles, object )
GF_120=np.empty( nFiles, object )
GF_121=np.empty( nFiles, object )
GF_122=np.empty( nFiles, object )
GF_123=np.empty( nFiles, object )
GF_130=np.empty( nFiles, object )
GF_131=np.empty( nFiles, object )
GF_132=np.empty( nFiles, object )
GF_133=np.empty( nFiles, object )
GF_200=np.empty( nFiles, object )
GF_201=np.empty( nFiles, object )
GF_202=np.empty( nFiles, object )
GF_203=np.empty( nFiles, object )
GF_210=np.empty( nFiles, object )
GF_211=np.empty( nFiles, object )
GF_212=np.empty( nFiles, object )
GF_213=np.empty( nFiles, object )
GF_220=np.empty( nFiles, object )
GF_221=np.empty( nFiles, object )
GF_222=np.empty( nFiles, object )
GF_223=np.empty( nFiles, object )
GF_230=np.empty( nFiles, object )
GF_231=np.empty( nFiles, object )
GF_232=np.empty( nFiles, object )
GF_233=np.empty( nFiles, object )
GF_300=np.empty( nFiles, object )
GF_301=np.empty( nFiles, object )
GF_302=np.empty( nFiles, object )
GF_303=np.empty( nFiles, object )
GF_310=np.empty( nFiles, object )
GF_311=np.empty( nFiles, object )
GF_312=np.empty( nFiles, object )
GF_313=np.empty( nFiles, object )
GF_320=np.empty( nFiles, object )
GF_321=np.empty( nFiles, object )
GF_322=np.empty( nFiles, object )
GF_323=np.empty( nFiles, object )
GF_330=np.empty( nFiles, object )
GF_331=np.empty( nFiles, object )
GF_332=np.empty( nFiles, object )
GF_333=np.empty( nFiles, object )
for i in range( nFiles ):
# First level groups
GF[i] = Data_GF[i][ 'Geometry Fields' ]
GF_000=GF[i]['000'][:][:][:]
GF_001=GF[i]['001'][:][:][:]
GF_002=GF[i]['002'][:][:][:]
GF_003=GF[i]['003'][:][:][:]
GF_010=GF[i]['010'][:][:][:]
GF_011=GF[i]['011'][:][:][:]
GF_012=GF[i]['012'][:][:][:]
GF_013=GF[i]['013'][:][:][:]
GF_020=GF[i]['020'][:][:][:]
GF_021=GF[i]['021'][:][:][:]
GF_022=GF[i]['022'][:][:][:]
GF_023=GF[i]['023'][:][:][:]
GF_030=GF[i]['030'][:][:][:]
GF_031=GF[i]['031'][:][:][:]
GF_032=GF[i]['032'][:][:][:]
GF_033=GF[i]['033'][:][:][:]
GF_100=GF[i]['100'][:][:][:]
GF_101=GF[i]['101'][:][:][:]
GF_102=GF[i]['102'][:][:][:]
GF_103=GF[i]['103'][:][:][:]
GF_110=GF[i]['110'][:][:][:]
GF_111=GF[i]['111'][:][:][:]
GF_112=GF[i]['112'][:][:][:]
GF_113=GF[i]['113'][:][:][:]
GF_120=GF[i]['120'][:][:][:]
GF_121=GF[i]['121'][:][:][:]
GF_122=GF[i]['122'][:][:][:]
GF_123=GF[i]['123'][:][:][:]
GF_130=GF[i]['130'][:][:][:]
GF_131=GF[i]['131'][:][:][:]
GF_132=GF[i]['132'][:][:][:]
GF_133=GF[i]['133'][:][:][:]
GF_200=GF[i]['200'][:][:][:]
GF_201=GF[i]['201'][:][:][:]
GF_202=GF[i]['202'][:][:][:]
GF_203=GF[i]['203'][:][:][:]
GF_210=GF[i]['210'][:][:][:]
GF_211=GF[i]['211'][:][:][:]
GF_212=GF[i]['212'][:][:][:]
GF_213=GF[i]['213'][:][:][:]
GF_220=GF[i]['220'][:][:][:]
GF_221=GF[i]['221'][:][:][:]
GF_222=GF[i]['222'][:][:][:]
GF_223=GF[i]['223'][:][:][:]
GF_230=GF[i]['230'][:][:][:]
GF_231=GF[i]['231'][:][:][:]
GF_232=GF[i]['232'][:][:][:]
GF_233=GF[i]['233'][:][:][:]
GF_300=GF[i]['300'][:][:][:]
GF_301=GF[i]['301'][:][:][:]
GF_302=GF[i]['302'][:][:][:]
GF_303=GF[i]['303'][:][:][:]
GF_310=GF[i]['310'][:][:][:]
GF_311=GF[i]['311'][:][:][:]
GF_312=GF[i]['312'][:][:][:]
GF_313=GF[i]['313'][:][:][:]
GF_320=GF[i]['320'][:][:][:]
GF_321=GF[i]['321'][:][:][:]
GF_322=GF[i]['322'][:][:][:]
GF_323=GF[i]['323'][:][:][:]
GF_330=GF[i]['330'][:][:][:]
GF_331=GF[i]['331'][:][:][:]
GF_332=GF[i]['332'][:][:][:]
GF_333=GF[i]['333'][:][:][:]
names = \
{ \
'X1' : X1 , \
'X2' : X2 , \
'X3' : X3 , \
'GF_000' : GF_000 , \
'GF_001' :GF_001 , \
'GF_002' :GF_002 , \
'GF_003' :GF_003 , \
'GF_010' :GF_010 , \
'GF_011' :GF_011 , \
'GF_012' :GF_012 , \
'GF_013' :GF_013 , \
'GF_020' :GF_020 , \
'GF_021' :GF_021 , \
'GF_022' :GF_022 , \
'GF_023' :GF_023 , \
'GF_030' :GF_030 , \
'GF_031' :GF_031 , \
'GF_032' :GF_032 , \
'GF_033' :GF_033 , \
'GF_100' :GF_100 , \
'GF_101' :GF_101 , \
'GF_102' :GF_102 , \
'GF_103' :GF_103 , \
'GF_110' :GF_110 , \
'GF_111' :GF_111 , \
'GF_112' :GF_112 , \
'GF_113' :GF_113 , \
'GF_120' :GF_120 , \
'GF_121' :GF_121 , \
'GF_122' :GF_122 , \
'GF_123' :GF_123 , \
'GF_130' :GF_130 , \
'GF_131' :GF_131 , \
'GF_132' :GF_132 , \
'GF_133' :GF_133 , \
'GF_200' :GF_200 , \
'GF_201' :GF_201 , \
'GF_202' :GF_202 , \
'GF_203' :GF_203 , \
'GF_210' :GF_210 , \
'GF_211' :GF_211 , \
'GF_212' :GF_212 , \
'GF_213' :GF_213 , \
'GF_220' :GF_220 , \
'GF_221' :GF_221 , \
'GF_222' :GF_222 , \
'GF_223' :GF_223 , \
'GF_230' :GF_230 , \
'GF_231' :GF_231 , \
'GF_232' :GF_232 , \
'GF_233' :GF_233 , \
'GF_300' :GF_300 , \
'GF_301' :GF_301 , \
'GF_302' :GF_302 , \
'GF_303' :GF_303 , \
'GF_310' :GF_310 , \
'GF_311' :GF_311 , \
'GF_312' :GF_312 , \
'GF_313' :GF_313 , \
'GF_320' :GF_320 , \
'GF_321' :GF_321 , \
'GF_322' :GF_322 , \
'GF_323' :GF_323 , \
'GF_330' :GF_330 , \
'GF_331' :GF_331 , \
'GF_332' :GF_332 , \
'GF_333' :GF_333
}
return names
| 35.188976 | 77 | 0.419781 | 1,095 | 8,938 | 3.182648 | 0.117808 | 0.134577 | 0.249928 | 0.36528 | 0.406887 | 0.02066 | 0.02066 | 0.02066 | 0.02066 | 0 | 0 | 0.177042 | 0.378161 | 8,938 | 253 | 78 | 35.328063 | 0.449982 | 0.019132 | 0 | 0.009174 | 0 | 0 | 0.074429 | 0.003082 | 0 | 0 | 0 | 0 | 0 | 1 | 0.004587 | false | 0 | 0.013761 | 0 | 0.022936 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c3de64f090c94b8e058b63a5c61e421f39a71552 | 2,839 | py | Python | noise_analysis/src/analysis_data.py | scottwedge/python_scripts | bd85d262fd5dcc015f2c00edcd69cf30a93647cd | [
"MIT"
] | null | null | null | noise_analysis/src/analysis_data.py | scottwedge/python_scripts | bd85d262fd5dcc015f2c00edcd69cf30a93647cd | [
"MIT"
] | 1 | 2020-07-29T16:34:38.000Z | 2020-07-29T16:34:38.000Z | noise_analysis/src/analysis_data.py | scottwedge/python_scripts | bd85d262fd5dcc015f2c00edcd69cf30a93647cd | [
"MIT"
] | 1 | 2020-07-29T16:31:03.000Z | 2020-07-29T16:31:03.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from math import sqrt
def generate_base_map(read_data_list):
"""
generate data base map
"""
tx_len = len(read_data_list[0])
rx_len = len(read_data_list[0][0])
sum_list = [([0.0] * rx_len) for i in range(tx_len)]
for i in range(len(read_data_list)):
for j in range(len(read_data_list[i])):
for k in range(len(read_data_list[i][j])):
sum_list[j][k] += (float(read_data_list[i][j][k]))
for i in range(len(sum_list)):
for j in range(len(sum_list[i])):
sum_list[i][j] /= len(read_data_list)
return sum_list
def generate_max_delta_map(read_data_list, base_map):
"""
generate max delta map: delta = data - base
"""
tx_len = len(read_data_list[0])
rx_len = len(read_data_list[0][0])
max_list = [([0.0] * rx_len) for i in range(tx_len)]
for i in range(len(read_data_list)):
for j in range(len(read_data_list[i])):
for k in range(len(read_data_list[i][j])):
delta = abs(float(read_data_list[i][j][k]) - base_map[j][k])
if delta > max_list[j][k]:
max_list[j][k] = delta
return max_list
def find_max_value(max_list, exclude_tx_list = [], exclude_rx_list = []):
"""
find max val
"""
max_val = -10000
tx_index = 0
rx_index = 0
for i in range(len(max_list)):
if i not in exclude_tx_list:
for j in range(len(max_list[i])):
if j not in exclude_rx_list:
if max_list[i][j] > max_val:
max_val = max_list[i][j]
tx_index = i
rx_index = j
return max_val, tx_index, rx_index
def get_sqrt_square_average(read_data_list):
"""
sqrt(x1^2 + x2^2 + ... + xn^2)
"""
tx_len = len(read_data_list[0])
rx_len = len(read_data_list[0][0])
sqrt_square_average = [([0.0] * rx_len) for i in range(tx_len)]
for i in range(len(read_data_list)):
for j in range(len(read_data_list[i])):
for k in range(len(read_data_list[i][j])):
sqrt_square_average[j][k] += ((float(read_data_list[i][j][k])) * read_data_list[i][j][k])
for i in range(len(sqrt_square_average)):
for j in range(len(sqrt_square_average[i])):
sqrt_square_average[i][j] = sqrt(sqrt_square_average[i][j] / len(read_data_list))
return sqrt_square_average
if __name__ == "__main__":
"""
this is for test purpose
"""
read_data_list = [ \
[[1, 2, 3], [4, 5, 6]], \
[[1, 2, 3], [4, 5, 6]], \
[[1, 2, 3], [4, 5, 6]]
]
max_val, base_map, delta_max_map = analysis_data(read_data_list)
print(max_val)
print(base_map)
print(delta_max_map)
| 30.202128 | 105 | 0.564635 | 465 | 2,839 | 3.146237 | 0.133333 | 0.142174 | 0.21326 | 0.174299 | 0.531784 | 0.478469 | 0.423787 | 0.378674 | 0.378674 | 0.358852 | 0 | 0.02329 | 0.289186 | 2,839 | 93 | 106 | 30.526882 | 0.701685 | 0.054244 | 0 | 0.288136 | 1 | 0 | 0.003097 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.067797 | false | 0 | 0.016949 | 0 | 0.152542 | 0.050847 | 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 |
c3eac1386a30de388d39e6ef7565465aabea3e52 | 122 | py | Python | tests/sample_plugin/sample_plugin/__init__.py | pgajdos/lml | 047bad491a25192d0d3816103b6b47e7374cc5a1 | [
"BSD-3-Clause"
] | 3 | 2020-05-14T06:33:39.000Z | 2021-08-16T21:20:56.000Z | tests/sample_plugin/sample_plugin/__init__.py | pgajdos/lml | 047bad491a25192d0d3816103b6b47e7374cc5a1 | [
"BSD-3-Clause"
] | 11 | 2019-08-01T18:49:46.000Z | 2022-03-27T10:28:05.000Z | tests/sample_plugin/sample_plugin/__init__.py | pgajdos/lml | 047bad491a25192d0d3816103b6b47e7374cc5a1 | [
"BSD-3-Clause"
] | 4 | 2020-04-14T12:13:38.000Z | 2022-03-25T06:12:04.000Z | from lml.registry import PluginInfoChain
__test_plugins__ = PluginInfoChain(__name__).add_a_plugin("test_io2", "reader")
| 30.5 | 79 | 0.827869 | 15 | 122 | 5.933333 | 0.866667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00885 | 0.07377 | 122 | 3 | 80 | 40.666667 | 0.778761 | 0 | 0 | 0 | 0 | 0 | 0.114754 | 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 |
c3ed0ff413cb66fc51356a7f1c4d561a8a45fa88 | 3,294 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/gpu_program4.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/gpu_program4.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/NV/gpu_program4.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.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_NV_gpu_program4'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.GL,'GL_NV_gpu_program4',error_checker=_errors._error_checker)
GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV=_C('GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV',0x8908)
GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV=_C('GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV',0x8DA5)
GL_MAX_PROGRAM_GENERIC_RESULTS_NV=_C('GL_MAX_PROGRAM_GENERIC_RESULTS_NV',0x8DA6)
GL_MAX_PROGRAM_RESULT_COMPONENTS_NV=_C('GL_MAX_PROGRAM_RESULT_COMPONENTS_NV',0x8909)
GL_MAX_PROGRAM_TEXEL_OFFSET_NV=_C('GL_MAX_PROGRAM_TEXEL_OFFSET_NV',0x8905)
GL_MIN_PROGRAM_TEXEL_OFFSET_NV=_C('GL_MIN_PROGRAM_TEXEL_OFFSET_NV',0x8904)
GL_PROGRAM_ATTRIB_COMPONENTS_NV=_C('GL_PROGRAM_ATTRIB_COMPONENTS_NV',0x8906)
GL_PROGRAM_RESULT_COMPONENTS_NV=_C('GL_PROGRAM_RESULT_COMPONENTS_NV',0x8907)
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLintArray)
def glGetProgramEnvParameterIivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLuintArray)
def glGetProgramEnvParameterIuivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLintArray)
def glGetProgramLocalParameterIivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLuintArray)
def glGetProgramLocalParameterIuivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLint,_cs.GLint,_cs.GLint,_cs.GLint)
def glProgramEnvParameterI4iNV(target,index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLintArray)
def glProgramEnvParameterI4ivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLuint,_cs.GLuint,_cs.GLuint,_cs.GLuint)
def glProgramEnvParameterI4uiNV(target,index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLuintArray)
def glProgramEnvParameterI4uivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLsizei,arrays.GLintArray)
def glProgramEnvParametersI4ivNV(target,index,count,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLsizei,arrays.GLuintArray)
def glProgramEnvParametersI4uivNV(target,index,count,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLint,_cs.GLint,_cs.GLint,_cs.GLint)
def glProgramLocalParameterI4iNV(target,index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLintArray)
def glProgramLocalParameterI4ivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLuint,_cs.GLuint,_cs.GLuint,_cs.GLuint)
def glProgramLocalParameterI4uiNV(target,index,x,y,z,w):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,arrays.GLuintArray)
def glProgramLocalParameterI4uivNV(target,index,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLsizei,arrays.GLintArray)
def glProgramLocalParametersI4ivNV(target,index,count,params):pass
@_f
@_p.types(None,_cs.GLenum,_cs.GLuint,_cs.GLsizei,arrays.GLuintArray)
def glProgramLocalParametersI4uivNV(target,index,count,params):pass
| 47.057143 | 113 | 0.819369 | 489 | 3,294 | 5.130879 | 0.190184 | 0.076525 | 0.044639 | 0.070147 | 0.675568 | 0.617776 | 0.460741 | 0.460741 | 0.460741 | 0.460741 | 0 | 0.016171 | 0.061324 | 3,294 | 69 | 114 | 47.73913 | 0.795278 | 0.030358 | 0 | 0.492308 | 1 | 0 | 0.094291 | 0.082745 | 0 | 0 | 0.015394 | 0 | 0 | 1 | 0.261538 | false | 0.246154 | 0.092308 | 0.015385 | 0.369231 | 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 |
c3f719468fd9edb5819c584cb1a0873022558755 | 629 | py | Python | unittests/components/test_component.py | MoyTW/7DRL2016_Rewrite | 99e092dcb8797a25caa3c8a989a574efae19e4d4 | [
"MIT"
] | 2 | 2020-05-10T02:16:28.000Z | 2021-04-05T21:54:10.000Z | unittests/components/test_component.py | MoyTW/7DRL2016_Rewrite | 99e092dcb8797a25caa3c8a989a574efae19e4d4 | [
"MIT"
] | null | null | null | unittests/components/test_component.py | MoyTW/7DRL2016_Rewrite | 99e092dcb8797a25caa3c8a989a574efae19e4d4 | [
"MIT"
] | null | null | null | import unittest
from dodge.constants import EventType, EventParam
from dodge.components.component import Component
from dodge.event import Event
class TestComponent(unittest.TestCase):
def setUp(self):
self.c = Component('damage test', [EventType.DAMAGE], [])
def tests_runs_fn_if_listening_for_event(self):
with self.assertRaises(NotImplementedError):
self.c.handle_event(Event(EventType.DAMAGE, {EventParam.QUANTITY: 5}))
def tests_returns_false_if_not_listening_for_event(self):
event = Event(EventType.ATTACK, {}, None)
self.assertFalse(self.c.handle_event(event))
| 34.944444 | 82 | 0.742448 | 78 | 629 | 5.794872 | 0.474359 | 0.059735 | 0.075221 | 0.09292 | 0.09292 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00189 | 0.158983 | 629 | 17 | 83 | 37 | 0.852552 | 0 | 0 | 0 | 0 | 0 | 0.017488 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 1 | 0.230769 | false | 0 | 0.307692 | 0 | 0.615385 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
c3fe1c5c86a17c54517f7fe98405ce15d78ef01e | 1,190 | py | Python | constants/html_constants.py | ORC-RIS/beiwe-backend | af2c43f79350bf0fc1ce8efafab1ac9c40008c40 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T16:25:50.000Z | 2022-03-12T16:25:50.000Z | constants/html_constants.py | ORC-RIS/beiwe-backend | af2c43f79350bf0fc1ce8efafab1ac9c40008c40 | [
"BSD-3-Clause"
] | null | null | null | constants/html_constants.py | ORC-RIS/beiwe-backend | af2c43f79350bf0fc1ce8efafab1ac9c40008c40 | [
"BSD-3-Clause"
] | null | null | null | ## HTML lists ##
CHECKBOX_TOGGLES = [
"accelerometer",
"gps",
"calls",
"texts",
"wifi",
"bluetooth",
"power_state",
"proximity",
"gyro",
"magnetometer",
"devicemotion",
"ambient_audio",
"reachability",
"allow_upload_over_cellular_data",
"use_anonymized_hashing",
"use_gps_fuzzing",
"call_clinician_button_enabled",
"call_research_assistant_button_enabled"
]
TIMER_VALUES = [
"accelerometer_off_duration_seconds",
"accelerometer_on_duration_seconds",
"bluetooth_on_duration_seconds",
"bluetooth_total_duration_seconds",
"bluetooth_global_offset_seconds",
"check_for_new_surveys_frequency_seconds",
"create_new_data_files_frequency_seconds",
"gps_off_duration_seconds",
"gps_on_duration_seconds",
"seconds_before_auto_logout",
"upload_data_files_frequency_seconds",
"voice_recording_max_time_length_seconds",
"wifi_log_frequency_seconds",
"gyro_off_duration_seconds",
"gyro_on_duration_seconds",
"magnetometer_off_duration_seconds",
"magnetometer_on_duration_seconds",
"devicemotion_off_duration_seconds",
"devicemotion_on_duration_seconds"
]
| 27.045455 | 46 | 0.733613 | 124 | 1,190 | 6.370968 | 0.475806 | 0.227848 | 0.129114 | 0.065823 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166387 | 1,190 | 43 | 47 | 27.674419 | 0.796371 | 0.008403 | 0 | 0 | 0 | 0 | 0.712095 | 0.603918 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7f0e89557e9707545b24a215ebb270b77b680d8a | 189 | py | Python | warn_dict.py | CrEaTiiOn187/tg-management-bot | 554dbdd2134c14466baff3f3d448ac66f54ced03 | [
"MIT"
] | 3 | 2021-10-21T18:16:37.000Z | 2022-03-10T18:24:55.000Z | warn_dict.py | NoodleSoup/tg-management-bot | 554dbdd2134c14466baff3f3d448ac66f54ced03 | [
"MIT"
] | null | null | null | warn_dict.py | NoodleSoup/tg-management-bot | 554dbdd2134c14466baff3f3d448ac66f54ced03 | [
"MIT"
] | 1 | 2020-07-15T07:43:55.000Z | 2020-07-15T07:43:55.000Z | def load():
from pickle import load
warn_dict = {}
warn_db = open('warn.db', 'rb')
try:
warn_dict = load(warn_db)
return warn_dict
except:
return {}
warn_dict = load() | 17.181818 | 33 | 0.624339 | 28 | 189 | 4 | 0.464286 | 0.285714 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.243386 | 189 | 11 | 34 | 17.181818 | 0.783217 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.1 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7f1e7b581fcd169cfcc25340c9386ccc9c5d9fd5 | 914 | py | Python | 2018/aoc/d11/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | 1 | 2018-12-12T22:59:44.000Z | 2018-12-12T22:59:44.000Z | 2018/aoc/d11/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | null | null | null | 2018/aoc/d11/test.py | lukaselmer/adventofcode | b96ffc9040b63b338bca653830ba4ff7e90a8b2a | [
"MIT"
] | null | null | null | import unittest
from aoc.d11.main import _calculate_value, largest_grid_value_coords, largest_grid_value_coords_of_3x3
class TestCase(unittest.TestCase):
def test_cell_value(self):
self.assertEqual(4, _calculate_value(8, (3, 5)))
self.assertEqual(-5, _calculate_value(57, (122, 79)))
self.assertEqual(0, _calculate_value(39, (217, 196)))
self.assertEqual(4, _calculate_value(71, (101, 153)))
def test_max_grid_value_of_3x3(self):
self.assertEqual((33, 45), largest_grid_value_coords_of_3x3(18))
self.assertEqual((21, 61), largest_grid_value_coords_of_3x3(42))
def test_max_grid_value_of_any_size_18(self):
self.assertEqual((90, 269, 16), largest_grid_value_coords(18))
def test_max_grid_value_of_any_size_42(self):
self.assertEqual((232, 251, 12), largest_grid_value_coords(42))
if __name__ == "__main__":
unittest.main()
| 35.153846 | 102 | 0.724289 | 135 | 914 | 4.437037 | 0.377778 | 0.135225 | 0.160267 | 0.220367 | 0.36394 | 0.263773 | 0.093489 | 0.093489 | 0 | 0 | 0 | 0.097529 | 0.158643 | 914 | 25 | 103 | 36.56 | 0.681404 | 0 | 0 | 0 | 0 | 0 | 0.008753 | 0 | 0 | 0 | 0 | 0 | 0.470588 | 1 | 0.235294 | false | 0 | 0.117647 | 0 | 0.411765 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
6157ba598f56919b15e0ae29dab09c3019dc558b | 2,412 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/MESA/window_pos.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/MESA/window_pos.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/MESA/window_pos.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_MESA_window_pos'
def _f( function ):
return _p.createFunction( function,_p.PLATFORM.GL,'GL_MESA_window_pos',error_checker=_errors._error_checker)
@_f
@_p.types(None,_cs.GLdouble,_cs.GLdouble)
def glWindowPos2dMESA(x,y):pass
@_f
@_p.types(None,arrays.GLdoubleArray)
def glWindowPos2dvMESA(v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat)
def glWindowPos2fMESA(x,y):pass
@_f
@_p.types(None,arrays.GLfloatArray)
def glWindowPos2fvMESA(v):pass
@_f
@_p.types(None,_cs.GLint,_cs.GLint)
def glWindowPos2iMESA(x,y):pass
@_f
@_p.types(None,arrays.GLintArray)
def glWindowPos2ivMESA(v):pass
@_f
@_p.types(None,_cs.GLshort,_cs.GLshort)
def glWindowPos2sMESA(x,y):pass
@_f
@_p.types(None,arrays.GLshortArray)
def glWindowPos2svMESA(v):pass
@_f
@_p.types(None,_cs.GLdouble,_cs.GLdouble,_cs.GLdouble)
def glWindowPos3dMESA(x,y,z):pass
@_f
@_p.types(None,arrays.GLdoubleArray)
def glWindowPos3dvMESA(v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glWindowPos3fMESA(x,y,z):pass
@_f
@_p.types(None,arrays.GLfloatArray)
def glWindowPos3fvMESA(v):pass
@_f
@_p.types(None,_cs.GLint,_cs.GLint,_cs.GLint)
def glWindowPos3iMESA(x,y,z):pass
@_f
@_p.types(None,arrays.GLintArray)
def glWindowPos3ivMESA(v):pass
@_f
@_p.types(None,_cs.GLshort,_cs.GLshort,_cs.GLshort)
def glWindowPos3sMESA(x,y,z):pass
@_f
@_p.types(None,arrays.GLshortArray)
def glWindowPos3svMESA(v):pass
@_f
@_p.types(None,_cs.GLdouble,_cs.GLdouble,_cs.GLdouble,_cs.GLdouble)
def glWindowPos4dMESA(x,y,z,w):pass
@_f
@_p.types(None,arrays.GLdoubleArray)
def glWindowPos4dvMESA(v):pass
@_f
@_p.types(None,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat,_cs.GLfloat)
def glWindowPos4fMESA(x,y,z,w):pass
@_f
@_p.types(None,arrays.GLfloatArray)
def glWindowPos4fvMESA(v):pass
@_f
@_p.types(None,_cs.GLint,_cs.GLint,_cs.GLint,_cs.GLint)
def glWindowPos4iMESA(x,y,z,w):pass
@_f
@_p.types(None,arrays.GLintArray)
def glWindowPos4ivMESA(v):pass
@_f
@_p.types(None,_cs.GLshort,_cs.GLshort,_cs.GLshort,_cs.GLshort)
def glWindowPos4sMESA(x,y,z,w):pass
@_f
@_p.types(None,arrays.GLshortArray)
def glWindowPos4svMESA(v):pass
| 27.724138 | 112 | 0.788143 | 389 | 2,412 | 4.614396 | 0.208226 | 0.026741 | 0.093593 | 0.147075 | 0.594986 | 0.552089 | 0.552089 | 0.51922 | 0.352089 | 0.298607 | 0 | 0.010648 | 0.065506 | 2,412 | 86 | 113 | 28.046512 | 0.785714 | 0.041459 | 0 | 0.444444 | 1 | 0 | 0.015618 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.308642 | false | 0.296296 | 0.074074 | 0.012346 | 0.395062 | 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 |
6157fd982930d40d3215fe8f47dfb480364e2e86 | 1,118 | py | Python | cortado/cachedfactor.py | Statfactory/ColdBrew | ee16eee73e8dc89646abd6ee3e19858e49c6ffb7 | [
"MIT"
] | 8 | 2020-04-26T09:42:29.000Z | 2021-04-27T21:55:49.000Z | cortado/cachedfactor.py | pm390/cortado | ee16eee73e8dc89646abd6ee3e19858e49c6ffb7 | [
"MIT"
] | 2 | 2020-03-24T23:37:45.000Z | 2021-08-23T20:49:01.000Z | cortado/cachedfactor.py | pm390/cortado | ee16eee73e8dc89646abd6ee3e19858e49c6ffb7 | [
"MIT"
] | 4 | 2020-06-10T06:49:43.000Z | 2021-09-17T14:04:20.000Z | import cortado.chunk as ch
from cortado.seq import Seq
import numpy as np
from cortado.abstractfactor import AbstractFactor
from cortado.funcslicer import FuncSlicer
from cortado.vectorslicer import VectorSlicer
from cortado.consts import HEADLENGTH, SLICELEN, MISSINGLEVEL
class CachedFactor(AbstractFactor):
def __init__(self, factor):
self.factor = factor
self.cache = None
@property
def name(self):
return self.factor.name
def __len__(self):
return len(self.factor)
@property
def levels(self):
return self.factor.levels
@property
def isordinal(self):
return self.factor.isordinal
@property
def slicer(self):
if self.cache is None:
self.cache = np.empty(len(self), dtype=self.factor.slicer.dtype)
slices = self.factor.slicer(0, len(self.factor), SLICELEN)
def f(offset, slice):
n = len(slice)
self.cache[offset:(offset + n)] = slice
return offset + n
Seq.reduce(f, 0, slices)
return VectorSlicer(self.cache) | 27.268293 | 76 | 0.644007 | 134 | 1,118 | 5.313433 | 0.313433 | 0.126404 | 0.058989 | 0.08427 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002454 | 0.27102 | 1,118 | 41 | 77 | 27.268293 | 0.871166 | 0 | 0 | 0.121212 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.212121 | false | 0 | 0.212121 | 0.121212 | 0.636364 | 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 |
615895b53c26ddb59e0d86d3f30ed544f77b4b91 | 83 | py | Python | gait/apps.py | hstrey/stepbystep | f57fe8a76ddab6e1464f480642deebf51c4aaf4f | [
"MIT"
] | null | null | null | gait/apps.py | hstrey/stepbystep | f57fe8a76ddab6e1464f480642deebf51c4aaf4f | [
"MIT"
] | null | null | null | gait/apps.py | hstrey/stepbystep | f57fe8a76ddab6e1464f480642deebf51c4aaf4f | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class GaitConfig(AppConfig):
name = 'gait'
| 13.833333 | 33 | 0.73494 | 10 | 83 | 6.1 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180723 | 83 | 5 | 34 | 16.6 | 0.897059 | 0 | 0 | 0 | 0 | 0 | 0.048193 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
61683f5daf70d6eaf6a6ab80052b053b509dd3ea | 3,583 | py | Python | waterbutler/providers/s3compat/metadata.py | KakeruMizuno/RDM-waterbutler | 58ecd801385a7572d1ed56568a31f701291c4e3e | [
"Apache-2.0"
] | null | null | null | waterbutler/providers/s3compat/metadata.py | KakeruMizuno/RDM-waterbutler | 58ecd801385a7572d1ed56568a31f701291c4e3e | [
"Apache-2.0"
] | null | null | null | waterbutler/providers/s3compat/metadata.py | KakeruMizuno/RDM-waterbutler | 58ecd801385a7572d1ed56568a31f701291c4e3e | [
"Apache-2.0"
] | null | null | null | import os
from waterbutler.core import metadata
class S3CompatMetadata(metadata.BaseMetadata):
@property
def provider(self):
return self.raw['provider']
@property
def name(self):
return os.path.split(self.path)[1]
@staticmethod
def convert_prefix(provider, raw, key):
raw['provider'] = provider.NAME
raw[key] = raw[key][len(provider.prefix):].lstrip('/')
class S3CompatFileMetadataHeaders(S3CompatMetadata, metadata.BaseFileMetadata):
def __init__(self, provider, path, headers):
# Cast to dict to clone as the headers will
# be destroyed when the request leaves scope
new_headers = dict(headers)
new_headers['Key'] = path
self.convert_prefix(provider, new_headers, 'Key')
super().__init__(new_headers)
@property
def path(self):
return '/' + self.raw['Key'].lstrip('/')
@property
def size(self):
return self.raw['CONTENT-LENGTH']
@property
def content_type(self):
return self.raw['CONTENT-TYPE']
@property
def modified(self):
return self.raw['LAST-MODIFIED']
@property
def created_utc(self):
return None
@property
def etag(self):
return self.raw['ETAG'].replace('"', '')
@property
def extra(self):
return {
'md5': self.raw['ETAG'].replace('"', ''),
'encryption': self.raw.get('X-AMZ-SERVER-SIDE-ENCRYPTION', '')
}
class S3CompatFileMetadata(S3CompatMetadata, metadata.BaseFileMetadata):
def __init__(self, provider, raw):
new_raw = dict(raw)
self.convert_prefix(provider, new_raw, 'Key')
super().__init__(new_raw)
@property
def path(self):
return '/' + self.raw['Key'].lstrip('/')
@property
def size(self):
return int(self.raw['Size'])
@property
def modified(self):
return self.raw['LastModified']
@property
def created_utc(self):
return None
@property
def content_type(self):
return None # TODO
@property
def etag(self):
return self.raw['ETag'].replace('"', '')
@property
def extra(self):
return {
'md5': self.raw['ETag'].replace('"', '')
}
class S3CompatFolderKeyMetadata(S3CompatMetadata, metadata.BaseFolderMetadata):
def __init__(self, provider, raw):
new_raw = dict(raw)
self.convert_prefix(provider, new_raw, 'Key')
super().__init__(new_raw)
@property
def name(self):
return self.raw['Key'].split('/')[-2]
@property
def path(self):
return '/' + self.raw['Key'].lstrip('/')
class S3CompatFolderMetadata(S3CompatMetadata, metadata.BaseFolderMetadata):
def __init__(self, provider, raw):
new_raw = dict(raw)
self.convert_prefix(provider, new_raw, 'Prefix')
super().__init__(new_raw)
@property
def name(self):
return self.raw['Prefix'].split('/')[-2]
@property
def path(self):
return '/' + self.raw['Prefix'].lstrip('/')
# TODO dates!
class S3CompatRevision(metadata.BaseFileRevisionMetadata):
@property
def version_identifier(self):
return 'version'
@property
def version(self):
if self.raw['IsLatest'] == 'true':
return 'Latest'
return self.raw['VersionId']
@property
def modified(self):
return self.raw['LastModified']
@property
def extra(self):
return {
'md5': self.raw['ETag'].replace('"', '')
}
| 22.967949 | 79 | 0.599498 | 386 | 3,583 | 5.42228 | 0.209845 | 0.126135 | 0.093168 | 0.113712 | 0.622074 | 0.576206 | 0.550884 | 0.486383 | 0.486383 | 0.412327 | 0 | 0.00604 | 0.260675 | 3,583 | 155 | 80 | 23.116129 | 0.784069 | 0.028189 | 0 | 0.627273 | 0 | 0 | 0.0696 | 0.008053 | 0 | 0 | 0 | 0.006452 | 0 | 1 | 0.263636 | false | 0 | 0.018182 | 0.209091 | 0.563636 | 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 |
617b6b689fb981b73f2a1672745cf89d61bfa82a | 1,113 | py | Python | nvim/dotfiles/rplugin/python3/dotfiles/utils.py | dmitmel/dotfiles | f1396d08785213556f146afe7ab0195b52313228 | [
"MIT"
] | 83 | 2018-08-23T17:47:55.000Z | 2022-01-12T19:11:50.000Z | nvim/dotfiles/rplugin/python3/dotfiles/utils.py | dmitmel/dotfiles | f1396d08785213556f146afe7ab0195b52313228 | [
"MIT"
] | 4 | 2019-05-18T20:21:05.000Z | 2021-11-30T18:10:32.000Z | nvim/dotfiles/rplugin/python3/dotfiles/utils.py | dmitmel/dotfiles | f1396d08785213556f146afe7ab0195b52313228 | [
"MIT"
] | 16 | 2019-04-21T20:58:20.000Z | 2021-11-22T00:41:58.000Z | from typing import List, Tuple
def simple_line_diff(
old_lines: List[str],
new_lines: List[str],
search_from_start_offset: int = 0,
search_from_end_offset: int = 0,
) -> Tuple[bool, int, int]:
"""
Re-implementation of `dotfiles.lsp.utils.simple_line_diff` from the Lua side.
"""
min_lines_len = min(len(old_lines), len(new_lines))
common_lines_from_start, common_lines_from_end = 0, 0
for i in range(search_from_start_offset, min_lines_len):
if old_lines[i] != new_lines[i]:
break
common_lines_from_start += 1
if len(old_lines) == len(new_lines) and common_lines_from_start == len(old_lines):
return False, common_lines_from_start, common_lines_from_end
for i in range(search_from_end_offset, min_lines_len - common_lines_from_start):
if old_lines[-i - 1] != new_lines[-i - 1]:
break
common_lines_from_end += 1
assert len(old_lines) >= common_lines_from_start + common_lines_from_end, 'sanity check'
assert len(new_lines) >= common_lines_from_start + common_lines_from_end, 'sanity check'
return True, common_lines_from_start, common_lines_from_end
| 39.75 | 90 | 0.748428 | 183 | 1,113 | 4.131148 | 0.251366 | 0.203704 | 0.277778 | 0.21164 | 0.415344 | 0.415344 | 0.316138 | 0.316138 | 0.215608 | 0.215608 | 0 | 0.008484 | 0.15274 | 1,113 | 27 | 91 | 41.222222 | 0.793213 | 0.069182 | 0 | 0.090909 | 0 | 0 | 0.023438 | 0 | 0 | 0 | 0 | 0 | 0.090909 | 1 | 0.045455 | false | 0 | 0.045455 | 0 | 0.181818 | 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 |
617f009fb82dcb0164e21b035741ff04e9cd74ee | 204 | py | Python | src/Match_Mobile_Robotics/net_box_hardware_helper/scripts/driver.py | Grossbier/simulation_multirobots | 1fe00bf81932ad6de20709ad85f677f4cf196333 | [
"BSD-2-Clause"
] | null | null | null | src/Match_Mobile_Robotics/net_box_hardware_helper/scripts/driver.py | Grossbier/simulation_multirobots | 1fe00bf81932ad6de20709ad85f677f4cf196333 | [
"BSD-2-Clause"
] | null | null | null | src/Match_Mobile_Robotics/net_box_hardware_helper/scripts/driver.py | Grossbier/simulation_multirobots | 1fe00bf81932ad6de20709ad85f677f4cf196333 | [
"BSD-2-Clause"
] | 1 | 2022-01-04T09:16:28.000Z | 2022-01-04T09:16:28.000Z | #!/usr/bin/env python
import rospy
from net_box_hardware_helper import NetBoxRosWrapper
if __name__== "__main__":
rospy.init_node("force_torque_sensor")
sensor=NetBoxRosWrapper()
rospy.spin() | 25.5 | 52 | 0.769608 | 26 | 204 | 5.5 | 0.807692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.127451 | 204 | 8 | 53 | 25.5 | 0.803371 | 0.098039 | 0 | 0 | 0 | 0 | 0.146739 | 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 |
61814c5848a9d562c2b583c6359301cbe0daf2c4 | 1,038 | py | Python | Beginers/stdlib/datetime/solution/weekdays.py | arunkgupta/PythonTrainingExercises | d260cf71298e34b2a18bd11a76f1764ef28677c7 | [
"BSD-3-Clause"
] | 150 | 2015-11-27T14:19:15.000Z | 2019-11-03T18:34:21.000Z | Beginners/stdlib/datetime/solution/weekdays.py | prmohanty/PythonTrainingExercises | 00a2435649fcf53fdafede2d10b40f08463728fe | [
"BSD-3-Clause"
] | 1 | 2015-12-30T11:41:30.000Z | 2015-12-30T11:41:30.000Z | Beginners/stdlib/datetime/solution/weekdays.py | prmohanty/PythonTrainingExercises | 00a2435649fcf53fdafede2d10b40f08463728fe | [
"BSD-3-Clause"
] | 95 | 2015-12-01T18:44:13.000Z | 2019-10-28T16:25:08.000Z | """Create a function that returns a list of a given size of date objects
that correspond to week days starting at a given date.
Created on 17 Feb 2016
@author: paulross
"""
import datetime
import pytest
def business_days(start_date, num):
result = []
while len(result) < num:
if start_date.weekday() < 5:
result.append(start_date)
start_date += datetime.timedelta(1)
return result
def test_business_days():
start_date = datetime.date(2016, 1, 1)
result = business_days(start_date, 10)
expected = [
datetime.date(2016, 1, 1),
datetime.date(2016, 1, 4),
datetime.date(2016, 1, 5),
datetime.date(2016, 1, 6),
datetime.date(2016, 1, 7),
datetime.date(2016, 1, 8),
datetime.date(2016, 1, 11),
datetime.date(2016, 1, 12),
datetime.date(2016, 1, 13),
datetime.date(2016, 1, 14),
]
assert result == expected
def main():
return pytest.main(__file__)
if __name__ == '__main__':
main()
| 22.565217 | 72 | 0.61368 | 143 | 1,038 | 4.300699 | 0.391608 | 0.214634 | 0.286179 | 0.304065 | 0.058537 | 0 | 0 | 0 | 0 | 0 | 0 | 0.105125 | 0.266859 | 1,038 | 45 | 73 | 23.066667 | 0.703022 | 0.160886 | 0 | 0 | 0 | 0 | 0.009259 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 1 | 0.103448 | false | 0 | 0.068966 | 0.034483 | 0.241379 | 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 |
61c5685f0f30f2317379452a0961d15bbc009739 | 122 | py | Python | app/__init__.py | umluizlima/task-manager | 0c397d3b42c82d3affdfbbf0b28c0d46071b4699 | [
"MIT"
] | null | null | null | app/__init__.py | umluizlima/task-manager | 0c397d3b42c82d3affdfbbf0b28c0d46071b4699 | [
"MIT"
] | null | null | null | app/__init__.py | umluizlima/task-manager | 0c397d3b42c82d3affdfbbf0b28c0d46071b4699 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from .routers import tasks
app = FastAPI()
app.include_router(tasks.router, tags=["tasks"])
| 17.428571 | 48 | 0.762295 | 17 | 122 | 5.411765 | 0.529412 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122951 | 122 | 6 | 49 | 20.333333 | 0.859813 | 0 | 0 | 0 | 0 | 0 | 0.040984 | 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 |
f622a95d96e34a30923fdf4eda988d7ec52882c2 | 839 | py | Python | pclib/cl/pipelines.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 206 | 2015-01-05T21:53:56.000Z | 2022-03-14T08:04:49.000Z | pclib/cl/pipelines.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 84 | 2015-01-25T19:57:33.000Z | 2021-05-11T15:46:56.000Z | pclib/cl/pipelines.py | belang/pymtl | 4a96738724b007cbd684753aed0ac3de5b5dbebb | [
"BSD-3-Clause"
] | 99 | 2015-02-17T17:43:44.000Z | 2022-02-14T17:58:18.000Z | #=======================================================================
# pipelines.py
#=======================================================================
# Collection of pipelines for cycle-level modeling.
from pymtl import *
from collections import deque
#-----------------------------------------------------------------------
# Pipeline
#-----------------------------------------------------------------------
class Pipeline( object ):
def __init__( self, stages=1 ):
assert stages > 0
self.stages = stages
self.data = deque( [None]*stages, maxlen = stages )
def insert( self, item ):
self.data[0] = item
def remove( self ):
item = self.data[-1]
self.data[-1] = None
return item
def ready( self ):
return self.data[-1] != None
def advance( self ):
self.data.rotate()
| 25.424242 | 72 | 0.411204 | 73 | 839 | 4.671233 | 0.452055 | 0.140762 | 0.079179 | 0.093842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008608 | 0.169249 | 839 | 32 | 73 | 26.21875 | 0.480631 | 0.424315 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058824 | 1 | 0.294118 | false | 0 | 0.117647 | 0.058824 | 0.588235 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f62f3cda1eecad6cfe278d9e746cfb5095728baa | 139 | py | Python | myblog/myblog/admin_config.py | 610yilingliu/blog_for_fun | a4e7b93ec1bbdd4722ea1178910b8c967832b6ec | [
"MIT"
] | null | null | null | myblog/myblog/admin_config.py | 610yilingliu/blog_for_fun | a4e7b93ec1bbdd4722ea1178910b8c967832b6ec | [
"MIT"
] | 7 | 2021-03-18T22:47:42.000Z | 2022-03-12T00:12:00.000Z | myblog/myblog/admin_config.py | 610yilingliu/blog_for_fun | a4e7b93ec1bbdd4722ea1178910b8c967832b6ec | [
"MIT"
] | null | null | null | # Admin view config
from django.apps import AppConfig
class BlogConfig(AppConfig):
name = 'myblog'
verbose_name = 'yiling_blog' | 19.857143 | 33 | 0.726619 | 17 | 139 | 5.823529 | 0.882353 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.194245 | 139 | 7 | 34 | 19.857143 | 0.883929 | 0.122302 | 0 | 0 | 0 | 0 | 0.140496 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
f6504be1b578361d14440877fd6d590a61024765 | 273 | wsgi | Python | _old/IATISimpleTester.wsgi | pwyf/data-quality-tester | d7674849c64d4d41ff4e4b6b12631994c7ce0a92 | [
"MIT"
] | null | null | null | _old/IATISimpleTester.wsgi | pwyf/data-quality-tester | d7674849c64d4d41ff4e4b6b12631994c7ce0a92 | [
"MIT"
] | 53 | 2017-04-07T09:41:38.000Z | 2022-02-11T14:26:46.000Z | _old/IATISimpleTester.wsgi | pwyf/iati-simple-tester | ef7f06ebbd4dd45e6ca76d93a3f624abc33d961c | [
"MIT"
] | 3 | 2017-07-19T13:43:14.000Z | 2019-10-29T15:25:49.000Z | #!/usr/bin/env python
import logging, sys
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0, '/home/tracker/iati-simple-tester/pyenv/lib/python2.7/site-packages')
sys.path.insert(0, '/home/tracker/iati-simple-tester')
from IATISimpleTester import app as application
| 39 | 88 | 0.791209 | 42 | 273 | 5.142857 | 0.690476 | 0.064815 | 0.12037 | 0.12963 | 0.37963 | 0.37963 | 0.37963 | 0.37963 | 0.37963 | 0 | 0 | 0.015564 | 0.058608 | 273 | 6 | 89 | 45.5 | 0.824903 | 0.07326 | 0 | 0 | 0 | 0.2 | 0.388889 | 0.388889 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
f65c3b26844c78db07bfca6624edc7e1e0325375 | 59 | py | Python | archivo.py | miguel2848/git_comands | c52ae8584d481ea685dbd999846c970929496b09 | [
"Unlicense"
] | null | null | null | archivo.py | miguel2848/git_comands | c52ae8584d481ea685dbd999846c970929496b09 | [
"Unlicense"
] | null | null | null | archivo.py | miguel2848/git_comands | c52ae8584d481ea685dbd999846c970929496b09 | [
"Unlicense"
] | null | null | null | print("hello world")
for a in range(10):
print("peru") | 14.75 | 20 | 0.627119 | 10 | 59 | 3.7 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.186441 | 59 | 4 | 21 | 14.75 | 0.729167 | 0 | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.666667 | 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 |
f65c67144671d6708fc9067553ecef1e1e405a22 | 210 | py | Python | run.py | joway/net_scripts | 0464f346cc2ef07f5f816d7b18c14f99232ba254 | [
"Apache-2.0"
] | null | null | null | run.py | joway/net_scripts | 0464f346cc2ef07f5f816d7b18c14f99232ba254 | [
"Apache-2.0"
] | null | null | null | run.py | joway/net_scripts | 0464f346cc2ef07f5f816d7b18c14f99232ba254 | [
"Apache-2.0"
] | null | null | null | from hack_hznu_teacher import hack_teacher
with open('teacher.txt') as file:
line = file.readline()
while line:
stu_num = line[:-1]
hack_teacher(stu_num)
line = file.readline()
| 23.333333 | 42 | 0.642857 | 29 | 210 | 4.448276 | 0.551724 | 0.170543 | 0.248062 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.006369 | 0.252381 | 210 | 8 | 43 | 26.25 | 0.815287 | 0 | 0 | 0.285714 | 0 | 0 | 0.052381 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
f6694af63890d82290975680b66771bd9b5ed94b | 214 | py | Python | tests/test_easy_problems/test_1_to_50/sample_test.py | ivan1016017/LeetCodeAlgorithmProblems | f617f30201fb1cd53e32de35084fdeb88ef36023 | [
"MIT"
] | null | null | null | tests/test_easy_problems/test_1_to_50/sample_test.py | ivan1016017/LeetCodeAlgorithmProblems | f617f30201fb1cd53e32de35084fdeb88ef36023 | [
"MIT"
] | 1 | 2021-09-22T12:26:14.000Z | 2021-09-22T12:26:14.000Z | tests/test_easy_problems/test_1_to_50/sample_test.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | null | null | null | import unittest
# from my_project.src.my_project.easy_problems.from1to50.single_number import Solution
class TestSingleNumber(unittest.TestCase):
def test_unique_number(self):
self.assertEqual(1,1) | 21.4 | 86 | 0.78972 | 28 | 214 | 5.821429 | 0.75 | 0.110429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026882 | 0.130841 | 214 | 10 | 87 | 21.4 | 0.849462 | 0.392523 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
f6709099fda6ddc00fc05be7600e43fc916bcb5e | 1,117 | py | Python | manga_py/base_classes/callbacks.py | paulolimac/manga-py | 3d180846750a4e770b5024eb8cd15629362875b1 | [
"MIT"
] | 1 | 2020-11-19T00:40:49.000Z | 2020-11-19T00:40:49.000Z | manga_py/base_classes/callbacks.py | paulolimac/manga-py | 3d180846750a4e770b5024eb8cd15629362875b1 | [
"MIT"
] | null | null | null | manga_py/base_classes/callbacks.py | paulolimac/manga-py | 3d180846750a4e770b5024eb8cd15629362875b1 | [
"MIT"
] | null | null | null | from typing import Callable
class Callbacks:
def _call_files_progress_callback(self):
if callable(self.progress):
_max, _current = len(self._storage['files']), self._storage['current_file']
self.progress(_max, _current, _current < 1)
def set_quest_callback(self, callback: Callable): # Required call from initiator (CLI, GUI)
setattr(self, 'quest', callback)
def set_progress_callback(self, callback: Callable): # Required call from initiator (CLI, GUI)
setattr(self, 'progress', callback)
def set_log_callback(self, callback: Callable): # Required call from initiator (CLI, GUI)
setattr(self, 'log', callback)
def set_quest_password_callback(self, callback: Callable): # Required call from iterator (CLI, GUI)
setattr(self, 'quest_password', callback)
def quest(self, *args, **kwargs):
pass
def quest_password(self, *args, **kwargs):
pass
def progress(self, *args, **kwargs):
pass
def log(self, *args, **kwargs):
pass
def book_meta(self) -> dict:
return {}
| 31.027778 | 104 | 0.651746 | 133 | 1,117 | 5.293233 | 0.270677 | 0.085227 | 0.113636 | 0.159091 | 0.518466 | 0.360795 | 0.360795 | 0.298295 | 0.298295 | 0.298295 | 0 | 0.001168 | 0.233662 | 1,117 | 35 | 105 | 31.914286 | 0.821262 | 0.14145 | 0 | 0.166667 | 0 | 0 | 0.049266 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.416667 | false | 0.291667 | 0.041667 | 0.041667 | 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 |
f6732ffb826eefcc68ee3bfb720530f0420a1ced | 164 | py | Python | Lecture 2 Uncertainity/src2/bayesnet/likelihood.py | samratpodder/CS50AI-Projects | 3e6805f8b3848b78a586e746fe86f01b8ed0f6df | [
"MIT"
] | 1 | 2020-08-18T11:48:57.000Z | 2020-08-18T11:48:57.000Z | Lecture 2 Uncertainity/src2/bayesnet/likelihood.py | samratpodder/CS50AI-Projects | 3e6805f8b3848b78a586e746fe86f01b8ed0f6df | [
"MIT"
] | null | null | null | Lecture 2 Uncertainity/src2/bayesnet/likelihood.py | samratpodder/CS50AI-Projects | 3e6805f8b3848b78a586e746fe86f01b8ed0f6df | [
"MIT"
] | 1 | 2021-06-11T15:16:33.000Z | 2021-06-11T15:16:33.000Z | from model import model
# Calculate probability for a given observation
probability = model.probability([["none", "no", "on time", "attend"]])
print(probability)
| 23.428571 | 70 | 0.737805 | 20 | 164 | 6.05 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.128049 | 164 | 6 | 71 | 27.333333 | 0.846154 | 0.27439 | 0 | 0 | 0 | 0 | 0.162393 | 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 |
f675c3f2c0bd4ae24e52a828291c74c08ccb5457 | 2,590 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
try:
from ._models_py3 import NetworkProfile
from ._models_py3 import OpenShiftManagedCluster
from ._models_py3 import OpenShiftManagedClusterAADIdentityProvider
from ._models_py3 import OpenShiftManagedClusterAgentPoolProfile
from ._models_py3 import OpenShiftManagedClusterAuthProfile
from ._models_py3 import OpenShiftManagedClusterBaseIdentityProvider
from ._models_py3 import OpenShiftManagedClusterIdentityProvider
from ._models_py3 import OpenShiftManagedClusterMasterPoolProfile
from ._models_py3 import OpenShiftRouterProfile
from ._models_py3 import PurchasePlan
from ._models_py3 import Resource
from ._models_py3 import TagsObject
except (SyntaxError, ImportError):
from ._models import NetworkProfile
from ._models import OpenShiftManagedCluster
from ._models import OpenShiftManagedClusterAADIdentityProvider
from ._models import OpenShiftManagedClusterAgentPoolProfile
from ._models import OpenShiftManagedClusterAuthProfile
from ._models import OpenShiftManagedClusterBaseIdentityProvider
from ._models import OpenShiftManagedClusterIdentityProvider
from ._models import OpenShiftManagedClusterMasterPoolProfile
from ._models import OpenShiftRouterProfile
from ._models import PurchasePlan
from ._models import Resource
from ._models import TagsObject
from ._paged_models import OpenShiftManagedClusterPaged
from ._container_service_client_enums import (
OSType,
OpenShiftContainerServiceVMSize,
OpenShiftAgentPoolProfileRole,
)
__all__ = [
'NetworkProfile',
'OpenShiftManagedCluster',
'OpenShiftManagedClusterAADIdentityProvider',
'OpenShiftManagedClusterAgentPoolProfile',
'OpenShiftManagedClusterAuthProfile',
'OpenShiftManagedClusterBaseIdentityProvider',
'OpenShiftManagedClusterIdentityProvider',
'OpenShiftManagedClusterMasterPoolProfile',
'OpenShiftRouterProfile',
'PurchasePlan',
'Resource',
'TagsObject',
'OpenShiftManagedClusterPaged',
'OSType',
'OpenShiftContainerServiceVMSize',
'OpenShiftAgentPoolProfileRole',
]
| 41.111111 | 76 | 0.760618 | 190 | 2,590 | 10.126316 | 0.363158 | 0.12474 | 0.081081 | 0.118503 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005835 | 0.139768 | 2,590 | 62 | 77 | 41.774194 | 0.85772 | 0.174517 | 0 | 0 | 0 | 0 | 0.197461 | 0.173954 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.54 | 0 | 0.54 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9c9107c302ae147250f0313597ab78900bdf3c43 | 17,886 | py | Python | unprotect.py | hugmyndakassi/unprotect | d51cb16d18e545d1f38ed4c4e8bff91942626795 | [
"Apache-2.0"
] | null | null | null | unprotect.py | hugmyndakassi/unprotect | d51cb16d18e545d1f38ed4c4e8bff91942626795 | [
"Apache-2.0"
] | null | null | null | unprotect.py | hugmyndakassi/unprotect | d51cb16d18e545d1f38ed4c4e8bff91942626795 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Unprotect Malware - main file - unprotect.py version 1.0
This module is the main file of Unprotect. This file will call every module of the project for the analysis.
"""
import sys
import pefile
import re
import module.config
from module.pe_info import get_info
from module.pe_info import get_hash
from module.pe_info import get_meta
from module.pe_info import get_antidebug
from module.pe_info import get_procinj
from module.pe_info import get_sec
from module.pe_info import get_impfuzzy
from module.pe_info import get_mmh
from module.pe_info import get_richhash
from module.pe_info import check_tls
from module.pe_info import display_resources
from module.strings import get_strings
from module.packer import get_peid
from module.packer import possible_packing
from module.antivm import get_vm
from module.antivm import antivm_inst
from module.antiav import get_av_evasion
from module.antiav import get_pesize
from module.antiav import get_crt
from module.antiav import get_av_strings
from module.disas import garbage_byte
from module.disas import fake_jump
from module.disas import flow_redirect
from module.disas import nop_seq
from module.disas import check_iat
from module.network_evasion import get_url, get_ip
from prettytable import PrettyTable
from module.utils import yarascan
from module.virusapi import get_vt
from tabulate import tabulate
def help():
print module.config.__asciiart__
print "\t\t" + module.config.__copyright__ + " | " + module.config.__author__
print "\t\t\tUnprotect malware for the mass"
print module.config.C + "\n[*] Usage: python unprotect.py malware.exe\n"
def main(exefile):
if len(sys.argv) == 1 or len(sys.argv) >= 3:
help()
exit(0)
if len(sys.argv) == 2 and sys.argv[1] == "-h" or sys.argv[1] == "--help":
help()
exit(0)
if len(sys.argv) == 2:
print module.config.__asciiart__
print "\t\t" + module.config.__copyright__ + " | " + module.config.__author__
print "\t\t\tUnprotect malware for the mass"
try:
exe = pefile.PE(exefile)
except OSError as e:
print(e)
sys.exit()
except pefile.PEFormatError as e:
print module.config.R + "[-] PEFormatError: %s" % e.value
print module.config.R + "[!] The file is not a valid PE"
sys.exit()
strings_list, decoded_strings = get_strings(exefile)
concatenate_strings = strings_list + decoded_strings
print "\nPE Summary"
print "-" * 80
ftype, fname, fsize, tsdate, dll, nsec = get_info(exe, exefile)
print module.config.C + "File type:\t " + module.config.W + "%s" % ftype
print module.config.C + "File name:\t " + module.config.W + "%s" % fname
print module.config.C + "File size:\t " + module.config.W + "%s Bytes" % fsize
print module.config.C + "Compile time:\t " + module.config.W + "%s" % tsdate
print module.config.C + "Entry point:\t " + module.config.W + "0x%.8x" % exe.OPTIONAL_HEADER.AddressOfEntryPoint
print module.config.C + "Image base:\t " + module.config.W + "0x%.8x" % exe.OPTIONAL_HEADER.ImageBase
md5, sha1, ih, hashdeep, sha2, sha5 = get_hash(exe, exefile)
print module.config.C + "Hash MD5:\t " + module.config.W + "%s" % md5
# print module.config.C + "Hash SHA1:\t " + module.config.W + "%s" % sha1
print module.config.C + "Hash SHA2:\t " + module.config.W + "%s" % sha2
# print module.config.C + "Hash SHA5:\t " + module.config.W + "%s" % sha5
print module.config.C + "Import hash:\t " + module.config.W + "%s" % ih
print module.config.C + "Ssdeep:\t\t " + module.config.W + "%s" % hashdeep
impfuzzy = get_impfuzzy(exefile)
print module.config.C + "ImpFuzzy:\t " + module.config.W + "%s" % impfuzzy
mmh = get_mmh(exefile)
print module.config.C + "MinHash:\t " + module.config.W + "%s" % mmh
xored_richhash, clear_richhash = get_richhash(exe, exefile)
print module.config.C + "Xored RicHash:\t " + module.config.W + "%s" % xored_richhash
print module.config.C + "Clear RicHash:\t " + module.config.W + "%s" % clear_richhash
print "\nVirus Total Report"
print "-" * 80
try:
resp_code, scan_date, permalink, positives, total = get_vt(module.config.APIKEY, exefile)
if resp_code == 1:
print "Scan date:\t %s" % scan_date
print("Detection:\t %s/%s" % (positives, total))
print "Permalink:\t %s" % permalink
else:
print module.config.R + "[-]" + module.config.W + " No Virus Total report available!"
except IOError:
print module.config.R + "[-]" + module.config.W + " Virus Total not available or no connexion found!"
pass
print "\nExploit Mitigation"
print "-" * 80
aslr_check, dep_check, seh_check, cfg_check = get_sec(exe)
if aslr_check:
print module.config.G + "[+]" + module.config.W + " ASLR enabled"
else:
print module.config.R + "[-]" + module.config.W + " ASLR not enabled"
if dep_check:
print module.config.G + "[+]" + module.config.W + " DEP enabled"
else:
print module.config.R + "[-]" + module.config.W + " DEP not enabled"
if seh_check:
print module.config.G + "[+]" + module.config.W + " SEH enabled"
else:
print module.config.R + "[-]" + module.config.W + " SEH not enabled"
if cfg_check:
print module.config.G + "[+]" + module.config.W + " CFG enabled"
else:
print module.config.R + "[-]" + module.config.W + " CFG not enabled"
print "\nFile Metadata"
print "-" * 80
result = get_meta(exe)
if not bool(result):
print module.config.R + "[-]" + module.config.W + " PE file has no metadata available!"
print "\nPacker Detection"
print "-" * 75
peid_detect = get_peid(exe)
if peid_detect:
print module.config.G + "[+]" + module.config.W + " PEiD detection: %s " % peid_detect
else:
print module.config.R + "[-]" + module.config.W + " No PEiD detection!"
pepack, emptysec, enaddr, vbsecaddr, ensecaddr, entaddr = possible_packing(exe)
if bool(pepack):
print module.config.G + "[+]" + module.config.W + " Sections entropy is high, the binary is possibly packed!"
if bool(emptysec):
print module.config.G + "[+]" + module.config.W + " Non-ascii or empty section names detected"
if enaddr > entaddr:
print module.config.G + "[+]" + module.config.W + " Entry point is outside the .code section, the binary is possibly packed!"
print module.config.G + "[+]" + module.config.W + " PE Sections:"
x = PrettyTable()
x.field_names = ["Section Name", "Virtual Address", "Size", "Entropy"]
for section in exe.sections:
x.add_row([section.Name.strip(), "0x" + str(section.VirtualAddress), "0x" + str(section.Misc_VirtualSize), section.get_entropy()])
print x
matches = yarascan(exefile, module.config.rule_packer)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
print "\nAnti-Sandboxing Tricks"
print "-" * 80
trk = get_vm(exefile)
if trk:
print module.config.G + "[+]" + module.config.W + " Anti-sandboxing tricks detected: %s " % str(trk)
else:
print module.config.R + "[-]" + module.config.W + " No anti-sandboxing tricks detected!"
count = antivm_inst(exe)
if count == 0:
print module.config.R + "[-]" + module.config.W + " No antivm instruction detected!"
else:
print module.config.G + "[+]" + module.config.W + " Number of antivm instruction detected (SIDT, SLDT, CPUID, STR): %s" % count
matches = yarascan(exefile, module.config.rule_antisb)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
print "\nAnti-Debugging Tricks"
print "-" * 80
try:
tlscallback = check_tls(exe)
if tlscallback:
print(module.config.G + "[+]" + module.config.W + " TLS Callback found at: 0x%x" % tlscallback)
except:
pass
dbgmatches = get_antidebug(exe, module.config.antidbg_api)
if dbgmatches:
print module.config.G + "[+]" + module.config.W + " Anti-debugging API detected: "
print tabulate(dbgmatches, headers=['Address', 'API']) + "\n"
else:
print module.config.R + "[-]" + module.config.W + " No Anti-debugging API detected!"
matches = yarascan(exefile, module.config.rule_antidbg)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
print "\nAnti-Virus Evasion Tricks"
print "-" * 80
try:
errorlog, result1, result2, originalname = get_av_evasion(exe, module.config.lolbin)
except(AttributeError, RuntimeError, TypeError, NameError):
errorlog = False
result1 = False
result2 = False
originalname = False
avdetected = get_av_strings(strings_list, module.config.antiav)
if not bool(errorlog):
if result1 is True:
print module.config.G + "[+]" + module.config.W + " The filename extension is not valid. It might be used to trick the AV!"
print module.config.G + "[+]" + module.config.W + " Original filename: %s " % originalname
else:
print module.config.R + "[-]" + module.config.W + " No trick with the extension!"
if result2 is True:
print module.config.G + "[+]" + module.config.W + " Lolbin filename detected! Possible AV evasion trick!"
print module.config.G + "[+]" + module.config.W + " Original filename: %s " % originalname
else:
print module.config.R + "[-]" + module.config.W + " No Lolbin detected!"
else:
print module.config.R + "[-]" + module.config.W + " No AV evasion tricks detected!"
if avdetected:
print module.config.G + "[+]" + module.config.W + " Potential AV targeted by the sample:"
for av in avdetected:
print "\t" + av
else:
print module.config.R + "[-]" + module.config.W + " No strings related to AV detected!"
bigfile = get_pesize(exefile)
if bigfile:
print module.config.G + "[+]" + module.config.W + " The PE file is bigger than 5MB! Possible AV evasion trick!"
try:
get_crt(exefile)
except:
pass
matches = yarascan(exefile, module.config.rule_antiav)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
print "\nAnti-Disassembling Tricks"
print "-" * 80
count = garbage_byte(exe)
if count == 0:
print module.config.R + "[-]" + module.config.W + " No garbage byte detected!"
else:
print module.config.G + "[+]" + module.config.W + " Number of potential garbage byte detected: " + module.config.R + "%s" % count
count = fake_jump(exe)
if count == 0:
print module.config.R + "[-]" + module.config.W + " No fake jump detected!"
else:
print module.config.G + "[+]" + module.config.W + " Number of potential fake jump detected: " + module.config.R + "%s" % count
count = flow_redirect(exe)
if count == 0:
print module.config.R + "[-]" + module.config.W + " No flow redirection detected"
else:
print module.config.G + "[+]" + module.config.W + " Number of potential flow redirection detected: " + module.config.R + "%s" % count
count = nop_seq(exe)
if count == 0:
print module.config.R + "[-]" + module.config.W + " No nop sequence detected"
else:
print module.config.G + "[+]" + module.config.W + " Nop sequence detected: " + module.config.R + "%s" % count
iatcount, iatlow = check_iat(exe)
# print iatcount
if iatcount < 5:
print module.config.G + "[+]" + module.config.W + " IAT contains less than 5 imports. Possibly packed or dynamically called!"
if iatcount == 0:
print module.config.G + "[+]" + module.config.W + " IAT is empty! Stealth import of Windows API detected!"
try:
if "loadlibrarya" in iatlow or "loadlibraryw" in iatlow or "loadlibraryexa" in iatlow or "loadlibraryexw" in iatlow and "getprocaddress":
print module.config.G + "[+]" + module.config.W + " Possible function call obfuscation! LoadLibrary and GetProcAddress found in IAT!"
except TypeError:
pass
print "\nProcess Injection Tricks"
print "-" * 80
dbgmatches = get_procinj(exe, module.config.procinj_api)
if dbgmatches:
print module.config.G + "[+]" + module.config.W + " Process injection API detected: "
print tabulate(dbgmatches, headers=['Address', 'API']) + "\n"
else:
print module.config.R + "[-]" + module.config.W + " No process injection API detected!"
matches = yarascan(exefile, module.config.rule_procinject)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
print "\nObfuscation, Data Encoding"
print "-" * 80
matches = yarascan(exefile, module.config.rule_findcrypt)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
else:
print module.config.R + "[-] " + module.config.W + "No obfuscation detected!"
if decoded_strings:
print module.config.R + "[+] " + module.config.W + "FLOSS decoded strings:"
# print decoded_strings
for i in decoded_strings:
print "\t" + i
print "\nAnti-Monitoring Tricks"
print "-" * 80
matches = yarascan(exefile, module.config.rule_antimonitoring)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
else:
print module.config.R + "[-] " + module.config.W + "No anti-monitoring tricks detected!"
print "\nNetwork Evasion Tricks"
print "-" * 80
uniq_iplist = get_ip(str(concatenate_strings))
uniq_urllist = get_url(str(concatenate_strings))
if uniq_iplist:
print module.config.G + "[+] " + module.config.W + "IP addresses found!"
print tabulate(uniq_iplist, headers=['IP', 'Status', 'Location'])
print "\n"
else:
print module.config.R + "[-] " + module.config.W + "No IP address found"
if uniq_urllist:
print module.config.G + "[+] " + module.config.W + "Urls found!"
print tabulate(uniq_urllist, headers=['URLs', 'Fast Flux', 'DGA'])
print "\n"
else:
print module.config.R + "[-] " + module.config.W + "No urls found"
matches = yarascan(exefile, module.config.rule_network_evasion)
if matches is not None:
print module.config.G + "[+] " + module.config.W + "Yara detection: %s" % matches
print "\nAdditional Information"
print "-" * 80
res = display_resources(exe)
if res:
print module.config.G + "[+] " + module.config.W + "Resources: "
print tabulate(res, headers=['Id', 'Name', 'Size', 'Lang', 'Sublang', 'Type', 'MD5'])
else:
print module.config.R + "[-] " + module.config.W + "No resources available"
BTC = []
MNR = []
ETH = []
email = []
for line in concatenate_strings:
if re.match(r'^[13][a-km-zA-HJ-NP-Z0-9]{26,33}$', line):
BTC.append(line)
elif re.match(r'^4([0-9]|[A-B])(.){93}', line):
MNR.append(line)
elif re.match(r'^0x[a-fA-F0-9]{40}$', line):
ETH.append(line)
elif re.match(r'(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)', line):
email.append(line)
if BTC:
print module.config.G + "\n[+] " + module.config.W + "Bitcoin regex matching: "
for i in BTC:
print i
if MNR:
print module.config.G + "\n[+] " + module.config.W + "Monero regex matching: "
for i in MNR:
print i
if ETH:
print module.config.G + "\n[+] " + module.config.W + "Ethereum regex matching: "
for i in ETH:
print i
if email:
print module.config.G + "\n[+] " + module.config.W + "Email regex matching: "
for i in email:
print i
matches = yarascan(exefile, module.config.rules_user)
if matches is not None:
print module.config.G + "\n[+] " + module.config.W + "Matching from user's Yara rules: %s" % matches
print "\n"
print module.config.C + "All done!\n"
if __name__ == "__main__":
try:
exefile = sys.argv[1]
main(exefile)
except IndexError:
print "[!] You must supply a PE file kiddo! Or --help!"
| 39.570796 | 149 | 0.580454 | 2,209 | 17,886 | 4.627433 | 0.163875 | 0.233614 | 0.15134 | 0.075719 | 0.488358 | 0.428683 | 0.364899 | 0.31305 | 0.246527 | 0.190178 | 0 | 0.00788 | 0.290451 | 17,886 | 451 | 150 | 39.658537 | 0.797573 | 0.012468 | 0 | 0.281525 | 0 | 0.005865 | 0.201453 | 0.006006 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.01173 | 0.108504 | null | null | 0.41349 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
9c913f448a4f4acbf7bfc48f2c48041daab863a8 | 268 | py | Python | pythonlearn/personalMessage.py | kuljotbiring/Python | 743c93b91c5e4a4bf5066cf50e72e5a51d98d1ad | [
"MIT"
] | null | null | null | pythonlearn/personalMessage.py | kuljotbiring/Python | 743c93b91c5e4a4bf5066cf50e72e5a51d98d1ad | [
"MIT"
] | null | null | null | pythonlearn/personalMessage.py | kuljotbiring/Python | 743c93b91c5e4a4bf5066cf50e72e5a51d98d1ad | [
"MIT"
] | null | null | null | # Use a variable to represent a person’s name, and print
# a message to that person. Your message should be simple, such as, “Hello Eric,
# would you like to learn some Python today?”
name = "Kuljot"
print(f"Hello {name}, would you like to learn some Python today?")
| 38.285714 | 80 | 0.731343 | 47 | 268 | 4.170213 | 0.617021 | 0.081633 | 0.122449 | 0.142857 | 0.346939 | 0.346939 | 0.346939 | 0.346939 | 0 | 0 | 0 | 0 | 0.182836 | 268 | 6 | 81 | 44.666667 | 0.894977 | 0.660448 | 0 | 0 | 0 | 0 | 0.712644 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
9ccddba53be9a983670f1a7b56e0aca99800d8f5 | 67 | py | Python | factory/source/api/shop/exceptions/__init__.py | icYFTL/RTULAB_Service | a16d0fc2ac9ac103f0a14e90824caded7156bf11 | [
"Apache-2.0"
] | null | null | null | factory/source/api/shop/exceptions/__init__.py | icYFTL/RTULAB_Service | a16d0fc2ac9ac103f0a14e90824caded7156bf11 | [
"Apache-2.0"
] | null | null | null | factory/source/api/shop/exceptions/__init__.py | icYFTL/RTULAB_Service | a16d0fc2ac9ac103f0a14e90824caded7156bf11 | [
"Apache-2.0"
] | null | null | null | from .not_available import NotAvailable
__all__ = ['NotAvailable'] | 22.333333 | 39 | 0.80597 | 7 | 67 | 7 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.104478 | 67 | 3 | 40 | 22.333333 | 0.816667 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 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 |
9ce6f24ee2aeb8040b204f109ef47f4f602460ce | 297 | py | Python | python-sanic/classifier/dataset.py | yonatanMedan/ui_classifier | 18e6947fa06b97d07c99e17a8de2c632536614f2 | [
"MIT"
] | null | null | null | python-sanic/classifier/dataset.py | yonatanMedan/ui_classifier | 18e6947fa06b97d07c99e17a8de2c632536614f2 | [
"MIT"
] | null | null | null | python-sanic/classifier/dataset.py | yonatanMedan/ui_classifier | 18e6947fa06b97d07c99e17a8de2c632536614f2 | [
"MIT"
] | null | null | null | from fastai.vision import ImageDataBunch,get_transforms,imagenet_stats
import numpy as np
import pdb
def create_data_bunch(path):
np.random.seed(42)
return ImageDataBunch.from_folder(path,train=".",valid_pct=0.2,ds_tfms=get_transforms(), size=224, num_workers=4).normalize(imagenet_stats)
| 42.428571 | 143 | 0.808081 | 46 | 297 | 5 | 0.782609 | 0.113043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.029412 | 0.084175 | 297 | 6 | 144 | 49.5 | 0.816176 | 0 | 0 | 0 | 0 | 0 | 0.003367 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.5 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
9cefb7c60a96f695b78143264827de0650f6fb4f | 4,327 | py | Python | marshmallow_pyspark/converters.py | ashwin153/marshmallow-pyspark | 7ab6229ef6aa05184a15a8ee574eef9ceb8f54e9 | [
"Apache-2.0"
] | 7 | 2020-02-10T23:36:28.000Z | 2021-07-21T07:22:33.000Z | marshmallow_pyspark/converters.py | ashwin153/marshmallow-pyspark | 7ab6229ef6aa05184a15a8ee574eef9ceb8f54e9 | [
"Apache-2.0"
] | 5 | 2020-02-13T20:34:39.000Z | 2021-05-05T16:59:31.000Z | marshmallow_pyspark/converters.py | ashwin153/marshmallow-pyspark | 7ab6229ef6aa05184a15a8ee574eef9ceb8f54e9 | [
"Apache-2.0"
] | 4 | 2020-09-18T16:19:44.000Z | 2021-05-04T20:56:49.000Z | """
Marshmallow fields to pyspark sql type converter
"""
from abc import ABCMeta, abstractmethod
from typing import Mapping, Type
from marshmallow import fields as ma_fields
from pyspark.sql.types import (DataType, StringType, BooleanType,
TimestampType, DateType, IntegerType,
FloatType, DoubleType, ArrayType,
StructType, StructField, MapType)
from .fields import Raw
class ConverterABC(metaclass=ABCMeta):
"""
Abstract base class for converter
:param converter_map: mapping between marshmallow field and
corresponding converter. Primarily used by nested composite
fields like list, mapping, etc.
"""
def __init__(self, converter_map: Mapping[Type[ma_fields.Field], Type["ConverterABC"]]):
self._converter_map = converter_map
@property
def converter_map(self) -> Mapping[Type[ma_fields.Field], Type["ConverterABC"]]:
"""
Map between marshmallow field and corresponding converter.
"""
return self._converter_map
@abstractmethod
def convert(self, ma_field: ma_fields.Field) -> DataType:
"""
Convert marshmallow field to spark data type.
:param ma_field: marshmallow field instance
:return: spark SQL data type instance
"""
raise NotImplementedError()
class RawConverter(ConverterABC):
"""
Raw field converter
"""
def convert(self, field: Raw) -> DataType:
return field.spark_type
class StringConverter(ConverterABC):
"""
String field converter
"""
def convert(self, ma_field: ma_fields.Field) -> DataType:
return StringType()
class DateTimeConverter(ConverterABC):
"""
DateTime field converter
"""
def convert(self, ma_field: ma_fields.Field) -> DataType:
return TimestampType()
class DateConverter(ConverterABC):
"""
Date field converter
"""
def convert(self, ma_field: ma_fields.Field) -> DataType:
return DateType()
class BooleanConverter(ConverterABC):
"""
Boolean field converter
"""
def convert(self, ma_field: ma_fields.Field) -> DataType:
return BooleanType()
class IntegerConverter(ConverterABC):
"""
Integer field converter
"""
def convert(self, ma_field: ma_fields.Field) -> DataType:
return IntegerType()
class FloatConverter(ConverterABC):
"""
Float field converter
"""
def convert(self, ma_field: ma_fields.Field) -> DataType:
return FloatType()
class NumberConverter(ConverterABC):
"""
Number field converter
"""
def convert(self, ma_field: ma_fields.Field) -> DataType:
return DoubleType()
class ListConverter(ConverterABC):
"""
List field converter
"""
def convert(self, ma_field: ma_fields.List) -> DataType:
inner_converter = self.converter_map.get(type(ma_field.inner), StringConverter)
return ArrayType(inner_converter(self.converter_map).convert(ma_field.inner))
class DictConverter(ConverterABC):
"""
Dict field converter
"""
def convert(self, ma_field: ma_fields.Dict) -> DataType:
key_field_converter = self.converter_map.get(type(ma_field.key_field), StringConverter)
value_field_converter = self.converter_map.get(type(ma_field.value_field), StringConverter)
return MapType(
key_field_converter(self.converter_map).convert(ma_field.key_field),
value_field_converter(self.converter_map).convert(ma_field.value_field)
)
class NestedConverter(ConverterABC):
"""
Nested field converter
"""
def convert(self, ma_field: ma_fields.Nested) -> DataType:
_fields = []
for field_name, nested_field in ma_field.schema._declared_fields.items(): # pylint: disable=W0212
field_converter = self.converter_map.get(type(nested_field), StringConverter)
_fields.append(
StructField(
field_name,
field_converter(self.converter_map).convert(nested_field),
nullable=True
)
)
return StructType(_fields)
| 27.04375 | 106 | 0.643402 | 441 | 4,327 | 6.131519 | 0.21542 | 0.049186 | 0.06213 | 0.065089 | 0.430104 | 0.41605 | 0.360947 | 0.303254 | 0.256287 | 0.160503 | 0 | 0.001259 | 0.265542 | 4,327 | 159 | 107 | 27.213836 | 0.849591 | 0.162006 | 0 | 0.121212 | 0 | 0 | 0.007308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.212121 | false | 0 | 0.075758 | 0.121212 | 0.651515 | 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 |
1418d1543b7b281c48c2e8a078b3ef3723eab895 | 215 | py | Python | [Python][AVG]Sinners/src/Layer.py | JasonQSong/Sinners | ddffcd2e883d00ec5a9741f26789645dfca14228 | [
"MIT"
] | 1 | 2020-08-27T08:28:05.000Z | 2020-08-27T08:28:05.000Z | [Python][AVG]Sinners/src/Layer.py | JasonQSong/Sinners | ddffcd2e883d00ec5a9741f26789645dfca14228 | [
"MIT"
] | null | null | null | [Python][AVG]Sinners/src/Layer.py | JasonQSong/Sinners | ddffcd2e883d00ec5a9741f26789645dfca14228 | [
"MIT"
] | null | null | null | import pygame
pygame.init()
Closed=True
onbutton=None
def preHandle():
pass
def eventHandler(event):
return False
def afterHandle():
pass
def init():
pass
def show():
pass
def remove():
pass
| 12.647059 | 24 | 0.669767 | 28 | 215 | 5.142857 | 0.607143 | 0.194444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.223256 | 215 | 16 | 25 | 13.4375 | 0.862275 | 0 | 0 | 0.3125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0.3125 | 0.0625 | 0.0625 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
144654425da123515056650840a87ef52e37d700 | 201 | py | Python | programmers/lv2_review/lv_2_14.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/lv2_review/lv_2_14.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | programmers/lv2_review/lv_2_14.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # 가장 큰 수
def solution(numbers):
str_numbers = list(map(str, numbers))
str_numbers.sort(key=lambda x: x * 3, reverse=True)
return str(int("".join(str_numbers)))
print(solution([6, 10, 2])) | 25.125 | 55 | 0.656716 | 33 | 201 | 3.909091 | 0.69697 | 0.310078 | 0.263566 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02994 | 0.169154 | 201 | 8 | 56 | 25.125 | 0.742515 | 0.029851 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.4 | 0.2 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
144d4c702da03d47731cfcbcab420562754ffca3 | 6,093 | py | Python | psdaq/psdaq/configdb/opaltt_config_store.py | slactjohnson/lcls2 | 87fb7a7a9b5030ed7a2a472fecfca6575e233889 | [
"BSD-3-Clause-LBNL"
] | null | null | null | psdaq/psdaq/configdb/opaltt_config_store.py | slactjohnson/lcls2 | 87fb7a7a9b5030ed7a2a472fecfca6575e233889 | [
"BSD-3-Clause-LBNL"
] | null | null | null | psdaq/psdaq/configdb/opaltt_config_store.py | slactjohnson/lcls2 | 87fb7a7a9b5030ed7a2a472fecfca6575e233889 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from psdaq.configdb.typed_json import cdict
import psdaq.configdb.configdb as cdb
import psdaq.configdb.opal_config_store as opal
import sys
import IPython
import argparse
def opaltt_cdict(args):
top = opal.opal_cdict(args)
# append to the help string
help_str = top.get("help:RO")
help_str += "\nfex.eventcodes.beam : beam present = AND(.incl) and not OR(.excl)"
help_str += "\nfex.eventcodes.laser : laser present = AND(.incl) and not OR(.excl)"
help_str += "\nfex.roi : inclusive columns (x) and rows (y)"
help_str += "\nfex.signal.minvalue : minimum signal (ADU) to report valid value"
help_str += "\nfex..convergence : rolling average timescale (1/N); 0 to disable correction"
help_str += "\nfex.prescale.. : record 1/N events; 0 to disable recording"
help_str += "\nfex.fir_weights : edge-finding FIR constants"
help_str += "\nfex.calib_poly : poly coefficients for edge to time(ps)"
top.set("help:RO", help_str, 'CHARSTR')
# append new fields
top.set("fex.enable", 1, 'UINT8')
# assume mode is nobeam on separate events (vs nobeam in separate roi)
top.set("fex.eventcodes.beam.incl" , [140], 'UINT8') # beam present = AND beam.incl NOR beam.excl
top.set("fex.eventcodes.beam.excl" , [162], 'UINT8')
top.set("fex.eventcodes.laser.incl", [40], 'UINT8') # laser present = AND laser.incl NOR laser.excl
top.set("fex.eventcodes.laser.excl", [91], 'UINT8')
top.set("fex.sig.roi.x0", 0, 'UINT32')
top.set("fex.sig.roi.y0", 300, 'UINT32')
top.set("fex.sig.roi.x1", 1023, 'UINT32')
top.set("fex.sig.roi.y1", 449, 'UINT32')
top.set("fex.ref.enable", 0, 'UINT8')
top.set("fex.ref.roi.x0", 0, 'UINT32')
top.set("fex.ref.roi.y0", 0, 'UINT32')
top.set("fex.ref.roi.x1", 1023, 'UINT32')
top.set("fex.ref.roi.y1", 149, 'UINT32')
top.set("fex.sb.enable" , 1, 'UINT8')
top.set("fex.sb.roi.x0", 0, 'UINT32')
top.set("fex.sb.roi.y0", 0, 'UINT32')
top.set("fex.sb.roi.x1", 1023, 'UINT32')
top.set("fex.sb.roi.y1", 149, 'UINT32')
top.define_enum('axisEnum', {'X':0, 'Y':1})
top.set("fex.project.axis" , 0, 'axisEnum')
top.set("fex.project.minvalue" , 0, 'UINT32')
top.set("fex.ref.convergence" , 1.00, 'DOUBLE') # IIR with timescale = 1/N, 0 to disable
top.set("fex.sb.convergence" , 0.05, 'DOUBLE') # IIR with timescale = 1/N, 0 to disable
top.set("fex.prescale.image" , 1, 'UINT32') # 0=disable
top.set("fex.prescale.projections", 1, 'UINT32') # 0=disable
top.define_enum('recordEnum', {'None':0, 'Projection':1, 'Image':2})
top.set("fex.ref.record" , 0, 'recordEnum')
weights = [-0.007792, -0.009892, -0.010962, -0.011497, -0.012112, -0.012101, -0.012494, -0.011907, -0.012426, -0.012944, -0.014263, -0.015331, -0.015915, -0.016482, -0.017422, -0.017410, -0.017621, -0.017650, -0.018294, -0.017623, -0.017679, -0.018247, -0.019228, -0.018376, -0.017517, -0.017561, -0.018248, -0.018338, -0.019200, -0.020193, -0.020105, -0.019915, -0.019945, -0.019453, -0.019106, -0.019508, -0.019146, -0.019066, -0.018466, -0.018704, -0.017437, -0.017540, -0.017206, -0.017021, -0.015948, -0.015219, -0.015937, -0.017049, -0.017161, -0.017260, -0.017805, -0.017646, -0.017477, -0.017698, -0.017459, -0.016523, -0.016152, -0.016095, -0.016825, -0.016119, -0.015348, -0.014191, -0.013250, -0.012839, -0.013568, -0.013127, -0.012936, -0.012412, -0.010400, -0.009663, -0.009195, -0.007919, -0.007892, -0.007097, -0.006648, -0.007520, -0.007855, -0.006912, -0.006410, -0.006255, -0.006033, -0.005148, -0.005202, -0.005424, -0.005026, -0.004917, -0.004676, -0.004847, -0.003644, -0.003399, -0.003085, -0.002936, -0.001964, -0.002192, -0.001741, -0.001722, -0.001276, -0.001391, -0.001434, -0.000984, -0.000178, 0.000372, 0.000876, 0.001563, 0.002183, 0.001668, 0.002241, 0.002896, 0.003262, 0.004451, 0.004892, 0.005819, 0.007591, 0.008409, 0.008896, 0.009513, 0.009288, 0.010103, 0.011191, 0.012232, 0.013822, 0.014685, 0.014454, 0.014597, 0.015290, 0.016948, 0.017363, 0.017374, 0.017347, 0.017966, 0.018080, 0.017962, 0.017797, 0.016955, 0.016971, 0.017602, 0.018404, 0.018555, 0.019103, 0.018996, 0.020581, 0.020389, 0.020994, 0.021038, 0.021340, 0.021512, 0.021724, 0.022064, 0.022348, 0.022657, 0.022909, 0.021844, 0.021123, 0.021566, 0.020816, 0.020502, 0.021025, 0.022016, 0.021695, 0.021063, 0.020254, 0.020797, 0.020017, 0.019454, 0.019175, 0.019282, 0.018357, 0.017892, 0.017803, 0.016783, 0.015552, 0.015116, 0.014447, 0.014949, 0.015110, 0.015786, 0.015646, 0.016084, 0.015854, 0.014134, ]
top.set("fex.fir_weights", weights, 'DOUBLE')
calib = [1.138000, -0.002390, 0.000000, ]
top.set("fex.calib_poly" , calib, 'DOUBLE') # time(ps) = sum( calib_poly[i]*edge^i )
return top
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Write a new TimeTool configuration into the database')
parser.add_argument('--inst', help='instrument', type=str, default='tst')
parser.add_argument('--alias', help='alias name', type=str, default='BEAM')
parser.add_argument('--name', help='detector name', type=str, default='tsttt')
parser.add_argument('--segm', help='detector segment', type=int, default=0)
parser.add_argument('--id', help='device id/serial num', type=str, default='serial1234')
parser.add_argument('--user', help='user for HTTP authentication', type=str, default='xppopr')
parser.add_argument('--password', help='password for HTTP authentication', type=str, default='pcds')
args = parser.parse_args()
create = True
dbname = 'configDB' #this is the name of the database running on the server. Only client care about this name.
mycdb = cdb.configdb('https://pswww.slac.stanford.edu/ws-auth/devconfigdb/ws/', args.inst, create,
root=dbname, user=args.user, password=args.password)
mycdb.add_alias(args.alias)
mycdb.add_device_config('opal')
top = opaltt_cdict(args)
mycdb.modify_device(args.alias, top)
| 68.460674 | 1,917 | 0.648613 | 973 | 6,093 | 4.017472 | 0.377184 | 0.044513 | 0.064467 | 0.046048 | 0.191097 | 0.127398 | 0.08877 | 0.040931 | 0.040931 | 0.040931 | 0 | 0.273329 | 0.157558 | 6,093 | 88 | 1,918 | 69.238636 | 0.488214 | 0.070737 | 0 | 0 | 0 | 0 | 0.272969 | 0.032926 | 0 | 0 | 0 | 0 | 0 | 1 | 0.014493 | false | 0.028986 | 0.086957 | 0 | 0.115942 | 0 | 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 |
1457a9f909ce55c5891bf29281794e92043c8f3d | 16 | py | Python | bin/qtfaststart/qtfaststart/__init__.py | ebhoren/html5-media-tools | bedee1a6149aa6872873df246bc4ddda9dd9400f | [
"MIT"
] | 20 | 2017-10-03T15:26:43.000Z | 2021-07-08T15:14:36.000Z | bin/qtfaststart/qtfaststart/__init__.py | ebhoren/html5-media-tools | bedee1a6149aa6872873df246bc4ddda9dd9400f | [
"MIT"
] | null | null | null | bin/qtfaststart/qtfaststart/__init__.py | ebhoren/html5-media-tools | bedee1a6149aa6872873df246bc4ddda9dd9400f | [
"MIT"
] | 4 | 2018-09-07T18:42:41.000Z | 2022-03-28T19:49:37.000Z | VERSION = "1.8"
| 8 | 15 | 0.5625 | 3 | 16 | 3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0.1875 | 16 | 1 | 16 | 16 | 0.538462 | 0 | 0 | 0 | 0 | 0 | 0.1875 | 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 |
1466f06b9c396d607c2abe4d8bed1776b78bfc85 | 447 | py | Python | sevenbridges/models/compound/jobs/job_docker.py | damirkrstanovic/sevenbridges-python | 94b5cda5d6aacc9a331d96aba86e07ac492ee5c0 | [
"Apache-2.0"
] | null | null | null | sevenbridges/models/compound/jobs/job_docker.py | damirkrstanovic/sevenbridges-python | 94b5cda5d6aacc9a331d96aba86e07ac492ee5c0 | [
"Apache-2.0"
] | null | null | null | sevenbridges/models/compound/jobs/job_docker.py | damirkrstanovic/sevenbridges-python | 94b5cda5d6aacc9a331d96aba86e07ac492ee5c0 | [
"Apache-2.0"
] | null | null | null | import six
from sevenbridges.meta.resource import Resource
from sevenbridges.meta.fields import StringField
class JobDocker(Resource):
"""
JobDocker resource contains information for a docker image that was
used for execution of a single job.
"""
checksum = StringField(read_only=True)
def __str__(self):
return six.text_type(
'<Docker: checksum={checksum}'.format(checksum=self.checksum)
)
| 24.833333 | 73 | 0.702461 | 53 | 447 | 5.811321 | 0.641509 | 0.103896 | 0.12987 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.217002 | 447 | 17 | 74 | 26.294118 | 0.88 | 0.230425 | 0 | 0 | 0 | 0 | 0.08642 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0.111111 | 0.777778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.