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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8dcef86aa8287856e10a453698de6d0f45be68cd | 78 | py | Python | odl_details.py | vaibhgupta157/PathCompute | 44109176dc3770f7742e4e70225083ffe8eccad7 | [
"MIT"
] | 5 | 2019-08-05T20:00:03.000Z | 2021-11-24T07:39:06.000Z | odl_details.py | vaibhgupta157/PathCompute | 44109176dc3770f7742e4e70225083ffe8eccad7 | [
"MIT"
] | 1 | 2019-07-15T13:04:45.000Z | 2019-10-10T02:21:51.000Z | odl_details.py | vaibhgupta157/PathCompute | 44109176dc3770f7742e4e70225083ffe8eccad7 | [
"MIT"
] | 2 | 2019-08-01T21:17:15.000Z | 2020-09-30T20:19:49.000Z | ODL_IP = "127.0.0.1"
ODL_PORT = "8181"
ODL_USER = "admin"
ODL_PASS = "admin"
| 13 | 20 | 0.641026 | 15 | 78 | 3.066667 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 0.166667 | 78 | 5 | 21 | 15.6 | 0.553846 | 0 | 0 | 0 | 0 | 0 | 0.298701 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.25 | 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 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
8dd4e7effffedb1f7f0b78d8d5b8dcb0e5add470 | 41 | py | Python | tests/__init__.py | jlramalheira/sudoku | cace4c34b44e1a500d69721ddefa75ae8b2637ce | [
"MIT"
] | null | null | null | tests/__init__.py | jlramalheira/sudoku | cace4c34b44e1a500d69721ddefa75ae8b2637ce | [
"MIT"
] | null | null | null | tests/__init__.py | jlramalheira/sudoku | cace4c34b44e1a500d69721ddefa75ae8b2637ce | [
"MIT"
] | null | null | null | __all__ = ['io_tests', 'coloring_tests']
| 20.5 | 40 | 0.707317 | 5 | 41 | 4.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.097561 | 41 | 1 | 41 | 41 | 0.621622 | 0 | 0 | 0 | 0 | 0 | 0.536585 | 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 |
8de4c33b262829ba104b057ba200cad0e91b665f | 516 | py | Python | PlantAnalysis/sharpen_image.py | godzmaru/PlantAnalysis | fc929b3288553097a86a69c49e06f2ebb53f6eed | [
"MIT"
] | null | null | null | PlantAnalysis/sharpen_image.py | godzmaru/PlantAnalysis | fc929b3288553097a86a69c49e06f2ebb53f6eed | [
"MIT"
] | null | null | null | PlantAnalysis/sharpen_image.py | godzmaru/PlantAnalysis | fc929b3288553097a86a69c49e06f2ebb53f6eed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 14 13:06:40 2018
@author: hendrawahyu
"""
import cv2
import numpy as np
# =============================================================================
# This function is used to sharpen the image using a simple kernel
# =============================================================================
def sharpen_image(image):
kernel = np.array([[-1,-1,-1], [-1,9,-1], [-1,-1,-1]])
image = cv2.filter2D(image, -1, kernel)
return image | 30.352941 | 79 | 0.443798 | 60 | 516 | 3.8 | 0.683333 | 0.052632 | 0.052632 | 0.035088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.060268 | 0.131783 | 516 | 17 | 80 | 30.352941 | 0.448661 | 0.624031 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
8de6dfc0e20db5ec3db4dafb0443f9b665630576 | 479 | py | Python | IP_Obj.py | occamrazor1492/ssh-brute-force-detector | 5d9dd23cc3229e500bb7dccce57391cbee14d293 | [
"MIT"
] | null | null | null | IP_Obj.py | occamrazor1492/ssh-brute-force-detector | 5d9dd23cc3229e500bb7dccce57391cbee14d293 | [
"MIT"
] | null | null | null | IP_Obj.py | occamrazor1492/ssh-brute-force-detector | 5d9dd23cc3229e500bb7dccce57391cbee14d293 | [
"MIT"
] | 1 | 2019-12-25T19:37:10.000Z | 2019-12-25T19:37:10.000Z | class IPGroup():
def __init__(self, key, packet_count, total_packet_size, process_number):
self.packet_count = packet_count
self.total_packet_size = total_packet_size
self.process_number = process_number
self.groupname = key
@property
def averagePacketSize(self):
return self.total_packet_size / self.packet_count
@property
def averagePacketCountPerProcess(self):
return self.packet_count / self.process_number | 36.846154 | 77 | 0.720251 | 56 | 479 | 5.785714 | 0.303571 | 0.169753 | 0.185185 | 0.117284 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.212944 | 479 | 13 | 78 | 36.846154 | 0.859416 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0.166667 | 0.5 | 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 |
5c08b7431623c7136923835202f79fe17c9d2aaa | 441 | py | Python | main.py | pearsonk27/billpay | 2be4c34a5ba0bd8c29fcd15857207f5907f069d7 | [
"MIT"
] | null | null | null | main.py | pearsonk27/billpay | 2be4c34a5ba0bd8c29fcd15857207f5907f069d7 | [
"MIT"
] | null | null | null | main.py | pearsonk27/billpay | 2be4c34a5ba0bd8c29fcd15857207f5907f069d7 | [
"MIT"
] | null | null | null | import web.test as test
import web.water_bill as water_bill
import web.cable_bill as cable_bill
import web.gas_bill as gas_bill
import web.electric_bill as electric_bill
import sys
if sys.argv[1] == "test":
test.run()
elif sys.argv[1] == "waterBill":
water_bill.run()
elif sys.argv[1] == "cableBill":
cable_bill.run()
elif sys.argv[1] == "gasBill":
gas_bill.run()
elif sys.argv[1] == "electricBill":
electric_bill.run()
| 24.5 | 41 | 0.709751 | 74 | 441 | 4.067568 | 0.256757 | 0.149502 | 0.13289 | 0.186047 | 0.239203 | 0.189369 | 0 | 0 | 0 | 0 | 0 | 0.013405 | 0.154195 | 441 | 17 | 42 | 25.941176 | 0.793566 | 0 | 0 | 0 | 0 | 0 | 0.092971 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.375 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
5c1665774d0a1f5c7fd69a2e2aee4842383cc472 | 185 | py | Python | I_Know_Birds/ikb/urls.py | MakeItPossible-MJT/Birds_Identification | 9f6e40041bd9641151b12ac66a94877c34a6533f | [
"Apache-2.0"
] | 6 | 2020-11-21T01:35:27.000Z | 2020-11-25T12:13:22.000Z | I_Know_Birds/ikb/urls.py | MakeItPossible-MJT/Birds_Identification | 9f6e40041bd9641151b12ac66a94877c34a6533f | [
"Apache-2.0"
] | 11 | 2020-11-18T01:57:17.000Z | 2020-12-31T03:36:10.000Z | I_Know_Birds/ikb/urls.py | MakeItPossible-MJT/Birds_Identification | 9f6e40041bd9641151b12ac66a94877c34a6533f | [
"Apache-2.0"
] | null | null | null | # ikb/urls.py
from django.conf.urls import url
# from django.urls import path
from . import views
app_name = 'ikb'
urlpatterns = [
url(r'^$', views.ikb_index, name='ikb_index'),
]
| 18.5 | 50 | 0.691892 | 29 | 185 | 4.310345 | 0.517241 | 0.16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162162 | 185 | 9 | 51 | 20.555556 | 0.806452 | 0.216216 | 0 | 0 | 0 | 0 | 0.098592 | 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 |
5c2e545c2d734e1cf17fff4bedfd743b6aa418c9 | 203 | py | Python | core/urls.py | MinisterioPublicoRJ/apilabcontas | c01d5c0f1e6705eb8470ba7ba5078c0c172a9570 | [
"MIT"
] | 2 | 2019-06-10T18:34:15.000Z | 2020-04-29T14:23:34.000Z | core/urls.py | MinisterioPublicoRJ/datalakecadg | c01d5c0f1e6705eb8470ba7ba5078c0c172a9570 | [
"MIT"
] | 5 | 2020-01-09T15:59:16.000Z | 2021-06-10T21:06:13.000Z | core/urls.py | MinisterioPublicoRJ/datalakecadg | c01d5c0f1e6705eb8470ba7ba5078c0c172a9570 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import home, upload_manual
app_name = 'core'
urlpatterns = [
path('', home, name='home'),
path("upload-manual", upload_manual, name="upload-manual"),
]
| 20.3 | 63 | 0.689655 | 27 | 203 | 5.074074 | 0.481481 | 0.350365 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157635 | 203 | 9 | 64 | 22.555556 | 0.80117 | 0 | 0 | 0 | 0 | 0 | 0.167488 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
5c4c5b44eefb763f2aafaa92e0223e87966b9607 | 433 | py | Python | asyncalchemy/utils.py | claroty/asyncalchemy | ae9c73b1d02ceabf4e625c0be5fcc9e65759ed28 | [
"Apache-2.0"
] | 9 | 2020-12-29T17:44:27.000Z | 2021-07-15T15:48:21.000Z | asyncalchemy/utils.py | claroty/asyncalchemy | ae9c73b1d02ceabf4e625c0be5fcc9e65759ed28 | [
"Apache-2.0"
] | null | null | null | asyncalchemy/utils.py | claroty/asyncalchemy | ae9c73b1d02ceabf4e625c0be5fcc9e65759ed28 | [
"Apache-2.0"
] | 4 | 2021-01-03T15:39:54.000Z | 2021-08-08T17:49:06.000Z | from __future__ import absolute_import
from functools import partial
from asyncio import get_event_loop
from typing import Callable, Any, Dict
from .global_executor import executor
async def run_sync(function: Callable, *args: Any, **kwargs: Dict[Any, Any]) -> Any:
"""
Run non-asynchronous as async using executor.
"""
return await get_event_loop().run_in_executor(executor, partial(function, *args, **kwargs))
| 27.0625 | 95 | 0.750577 | 59 | 433 | 5.288136 | 0.508475 | 0.051282 | 0.076923 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157044 | 433 | 15 | 96 | 28.866667 | 0.854795 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.714286 | 0 | 0.857143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
30859cb68011aee11e3085f2828ed93ad66fcc88 | 418 | py | Python | powertoken/errors.py | jazzij/powertoken | 806c52ea16d00a28972c9ba4c7590e48c8636786 | [
"MIT"
] | null | null | null | powertoken/errors.py | jazzij/powertoken | 806c52ea16d00a28972c9ba4c7590e48c8636786 | [
"MIT"
] | 2 | 2020-01-05T22:40:38.000Z | 2021-06-02T00:53:21.000Z | powertoken/errors.py | jazzij/powertoken | 806c52ea16d00a28972c9ba4c7590e48c8636786 | [
"MIT"
] | 3 | 2017-10-12T15:57:51.000Z | 2019-04-15T22:02:46.000Z | """
Handles errors encountered by the PowerToken Flask app.\n
Created by Abigail Franz on 3/12/2018.\n
Last modified by Abigail Franz on 3/26/2018.
"""
from flask import render_template
from app import app, db
@app.errorhandler(404)
def not_found_error(error):
return render_template("404.html"), 404
@app.errorhandler(500)
def internal_error(error):
db.session.rollback()
return render_template("500.html"), 500 | 24.588235 | 57 | 0.770335 | 67 | 418 | 4.716418 | 0.537313 | 0.132911 | 0.088608 | 0.101266 | 0.107595 | 0 | 0 | 0 | 0 | 0 | 0 | 0.086957 | 0.119617 | 418 | 17 | 58 | 24.588235 | 0.771739 | 0.337321 | 0 | 0 | 0 | 0 | 0.059701 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0.222222 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3090f7b76718b25373f545abdb9fda087962d21f | 8,741 | py | Python | Gathered CTF writeups/ptr-yudai-writeups/2019/Cyber_Mimic_Defence_2019/pwn2/v2/disas.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:00:41.000Z | 2022-03-27T06:00:41.000Z | Gathered CTF writeups/ptr-yudai-writeups/2019/Cyber_Mimic_Defence_2019/pwn2/v2/disas.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | null | null | null | Gathered CTF writeups/ptr-yudai-writeups/2019/Cyber_Mimic_Defence_2019/pwn2/v2/disas.py | mihaid-b/CyberSakura | f60e6b6bfd6898c69b84424b080090ae98f8076c | [
"MIT"
] | 1 | 2022-03-27T06:01:42.000Z | 2022-03-27T06:01:42.000Z | import struct
#"""
mem = [0x42, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x01, 0x01, 0x00,
0x00, 0x00, 0x42, 0x02, 0x00, 0x00, 0x00, 0x00, 0x48, 0x02,
0x64, 0x00, 0x00, 0x00, 0x92, 0x30, 0x00, 0x00, 0x00, 0x02,
0x03, 0x01, 0x03, 0x03, 0x00, 0x02, 0x00, 0x01, 0x02, 0x01,
0x03, 0x13, 0x02, 0x90, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00]
"""
mem = []
mem += [10, 0, 0xde, 0xad, 0xbe, 0xef]
mem += [11, 0, 11, 12, 13, 14]
#"""
eip = 0
def p32():
global mem, eip
eip += 4
l = ''.join(map(chr, mem[eip-4:eip]))
return struct.unpack("<I", l)[0]
def disas():
ans = []
global mem, eip
targets = [eip]
visited = {}
while targets:
eip = targets.pop(0)
if eip in visited:
continue
visited[eip] = 1
try:
eip -= 1
while eip < len(mem):
eip += 1
b = mem[eip]
op, hi = b & 0x3f, b >> 6
if op == 0:
ans.append([eip, "ret"])
elif op == 1:
ans.append([eip, "nop"])
elif op == 2:
eip += 1
a = mem[eip] & 0xf
eip += 1
if hi == 0:
b = mem[eip] & 0xf
ans.append([eip-2, "mov r%d, r%d", a, b])
else:
w = p32()
ans.append([eip-6, "mov r%d, %#x", a, w])
eip -= 1
elif op == 3:
eip += 1
a = mem[eip] & 0xf
eip += 1
if hi == 0:
b = mem[eip] & 0xf
ans.append([eip-2, "add r%d, r%d", a, b])
else:
w = p32()
ans.append([eip-6, "add r%d, %#x", a, w])
eip -= 1
elif op == 4:
eip += 1
a = mem[eip] & 0xf
eip += 1
if hi == 0:
b = mem[eip] & 0xf
ans.append([eip-2, "sub r%d, r%d", a, b])
else:
w = p32()
ans.append([eip-6, "sub r%d, %#x", a, w])
eip -= 1
elif op == 5:
eip += 1
a = mem[eip] & 0xf
eip += 1
if hi == 0:
b = mem[eip] & 0xf
ans.append([eip-2, "and r%d, r%d", a, b])
else:
w = p32()
ans.append([eip-6, "and r%d, %#x", a, w])
eip -= 1
elif op == 6:
eip += 1
a = mem[eip] & 0xf
eip += 1
if hi == 0:
b = mem[eip] & 0xf
ans.append([eip-2, "or r%d, r%d", a, b])
else:
w = p32()
ans.append([eip-6, "or r%d, %#x", a, w])
eip -= 1
elif op == 7:
eip += 1
a = mem[eip] & 0xf
eip += 1
if hi == 0:
b = mem[eip] & 0xf
ans.append([eip-2, "xor r%d, r%d", a, b])
else:
w = p32()
ans.append([eip-6, "xor r%d, %#x", a, w])
eip -= 1
elif op == 8:
if hi == 0:
eip += 1
a = mem[eip] & 0xf
eip += 1
b = mem[eip] & 0xf
ans.append([eip-2, "cmp r%d, r%d", a, b])
elif hi == 1:
eip += 1
a = mem[eip] & 0xf
eip += 1
imm = p32()
ans.append([eip-6, "cmp r%d, %#x", a, imm])
eip -= 1
else:
eip += 1
imm_a = p32()
imm_b = p32()
ans.append([eip-8, "cmp %#x, %#x", imm_a, imm_b])
eip -= 1
elif op == 9:
if hi == 0:
eip += 1
a = mem[eip] & 0xf
eip += 1
b = mem[eip] & 0xf
ans.append([eip-2, "test r%d, r%d", a, b])
elif hi == 1:
eip += 1
a = mem[eip] & 0xf
eip += 1
imm = p32()
ans.append([eip-6, "test r%d, %#x", a, imm])
eip -= 1
else:
eip += 1
imm_a = p32()
imm_b = p32()
ans.append([eip-8, "test %#x, %#x", imm_a, imm_b])
eip -= 1
elif op == 10:
eip += 1
a = mem[eip] & 0xf
eip += 1
imm = p32()
ans.append([eip-6, "mov r%d, [%#x]", a, imm])
eip -= 1
elif op == 11:
eip += 1
a = mem[eip] & 0xf
eip += 1
imm = p32()
ans.append([eip-6, "mov [%#x], r%d", imm, a])
eip -= 1
elif op == 12:
eip += 1
if hi == 0:
a = mem[eip] & 0xf
ans.append([eip-1, "call r%d", a])
eip -= 1
else:
imm = p32()
ans.append([eip-5, "call %#x", imm])
targets.append(imm)
eip -= 1
elif op == 13:
# if stack is empty, return to last eip
ans.append([eip, "chk.ret"])
elif op == 14:
# if stack is empty, return to last eip
eip += 1
if hi == 0:
a = mem[eip] & 0xf
ans.append([eip-1, "push r%d", a])
else:
imm = p32()
ans.append([eip-5, "push %#x", imm])
eip -= 1
elif op == 15:
# if stack is empty, return to last eip
eip += 1
a = mem[eip] & 0xf
ans.append([eip-1, "pop r%d", a])
elif op == 16:
eip += 1
if hi == 0:
a = mem[eip] & 0xf
ans.append([eip-1, "jmp r%d", a])
else:
imm = p32()
ans.append([eip-5, "jmp %#x", imm])
targets.append(imm)
eip -= 1
elif op == 17:
eip += 1
if hi == 0:
a = mem[eip] & 0xf
ans.append([eip-1, "jz r%d", a])
else:
imm = p32()
ans.append([eip-5, "jz %#x", imm])
eip -= 1
elif op == 18:
eip += 1
if hi == 0:
a = mem[eip] & 0xf
ans.append([eip-1, "jle r%d", a])
else:
imm = p32()
ans.append([eip-5, "jle %#x", imm])
targets.append(imm)
eip -= 1
elif op == 19:
eip += 1
a = mem[eip] & 0xf
ans.append([eip-1, "inc r%d", a])
elif op == 20:
eip += 1
a = mem[eip] & 0xf
ans.append([eip-1, "dec r%d", a])
else:
""" return 5 """
pass
except Exception, e:
print(e)
ans.sort(key=lambda i: i[0])
visited = {}
for i in ans:
if i[0] in visited:
continue
visited[i[0]] = 1
print "%02x" % i[0], "\t",
print i[1] % tuple(i[2:])
print(disas())
| 35.971193 | 74 | 0.271708 | 910 | 8,741 | 2.601099 | 0.121978 | 0.106464 | 0.18251 | 0.084495 | 0.673426 | 0.641741 | 0.629911 | 0.617237 | 0.604985 | 0.530629 | 0 | 0.112395 | 0.60405 | 8,741 | 242 | 75 | 36.119835 | 0.571511 | 0.013385 | 0 | 0.609649 | 0 | 0 | 0.042151 | 0 | 0 | 0 | 0.033815 | 0 | 0 | 0 | null | null | 0.004386 | 0.004386 | null | null | 0.017544 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
309276b73a2f4d012e73d8dd0d05cf41b540f5f7 | 5,088 | py | Python | parameter_prediction/models/mlp.py | mdenil/parameter_prediction | 19eab7390100ae6986587c26194158e80df0f106 | [
"MIT"
] | 7 | 2016-04-10T15:39:35.000Z | 2020-08-03T10:07:09.000Z | parameter_prediction/models/mlp.py | mdenil/parameter_prediction | 19eab7390100ae6986587c26194158e80df0f106 | [
"MIT"
] | null | null | null | parameter_prediction/models/mlp.py | mdenil/parameter_prediction | 19eab7390100ae6986587c26194158e80df0f106 | [
"MIT"
] | 4 | 2017-11-14T04:58:35.000Z | 2020-07-02T12:59:35.000Z | import theano.tensor as T
from pylearn2.models import mlp
from pylearn2.space import VectorSpace
from pylearn2.utils import sharedX
from pylearn2.utils import safe_zip
from pylearn2.linear.matrixmul import MatrixMul
from collections import OrderedDict
class MLP(mlp.MLP):
def inv_prop(self, state_above):
self.layers[-1].output_space.validate(state_above)
state_from_above = self.layers[-1].inv_prop(state_above)
layer_above = self.layers[-1]
for layer in reversed(self.layers[:-1]):
desired_space = layer_above.input_space
state_from_above = layer.inv_prop(
desired_space.format_as(state_from_above, layer.output_space))
layer_above = layer
return state_from_above
@property
def output_space(self):
return self.layers[-1].output_space
def get_weight_decay(self, coeff):
return sum(layer.get_weight_decay(coeff) for layer in self.layers)
def get_l1_weight_decay(self, coeff):
return sum(layer.get_l1_weight_decay(coeff) for layer in self.layers)
class VectorSpaceConverter(mlp.Layer):
def __init__(self, layer_name):
self.layer_name = layer_name
self._params = []
def set_input_space(self, space):
self.input_space = space
self.output_space = VectorSpace(space.get_total_dimension())
def fprop(self, state_below):
return self.input_space.format_as(state_below, self.output_space)
def inv_prop(self, state_above):
return self.output_space.format_as(state_above, self.input_space)
def get_weight_decay(self, coeff):
return 0.0
def get_l1_weight_decay(self, coeff):
return 0.0
class CompositeLayer(mlp.CompositeLayer):
@property
def dim(self):
return sum(layer.dim for layer in self.layers)
def get_input_space(self):
input_space = self.layers[0].get_input_space()
assert all(input_space == layer.get_input_space() for layer in self.layers)
return input_space
def inv_prop(self, state_above):
if not isinstance(state_above, tuple):
expected_space = VectorSpace(self.output_space.get_total_dimension())
state_above = expected_space.format_as(state_above, self.output_space)
self.output_space.validate(state_above)
return tuple(layer.inv_prop(state) for layer,state in safe_zip(self.layers, state_above))
class PretrainedLayer(mlp.PretrainedLayer):
def fprop(self, *args, **kwargs):
return self.layer_content.fprop(*args, **kwargs)
def inv_prop(self, state_above):
return self.layer_content.inv_prop(state_above)
def get_weight_decay(self, coeff):
return self.layer_content.get_weight_decay(coeff)
def get_l1_weight_decay(self, coeff):
return self.layer_content.get_weight_decay(coeff)
class ReversableLayerMixin(object):
def inv_prop(self, state_above):
self.output_space.validate(state_above)
return self.transformer.lmul_T(state_above)
class Sigmoid(mlp.Sigmoid, ReversableLayerMixin):
pass
class RectifiedLinear(mlp.RectifiedLinear, ReversableLayerMixin):
pass
class SubsampledDictionaryLayer(mlp.Layer, ReversableLayerMixin):
def __init__(self, dim, layer_name, dictionary):
self.dim = dim
self.layer_name = layer_name
self.dictionary = dictionary
def fprop(self, state_below):
self.input_space.validate(state_below)
if self.requires_reformat:
state_below = self.input_space.format_as(state_below, self.desired_space)
z = self.transformer.lmul(state_below)
return z
def set_input_space(self, space):
self.input_space = space
if isinstance(space, VectorSpace):
self.requires_reformat = False
self.input_dim = space.dim
else:
self.requires_reformat = True
self.input_dim = space.get_total_dimension()
self.desired_space = VectorSpace(self.input_dim)
self.output_space = VectorSpace(self.dim)
self.rng = self.mlp.rng
# sanity checking
assert self.dictionary.input_dim == self.input_dim
assert self.dictionary.size >= self.dim
indices = self.rng.permutation(self.dictionary.size)
indices = indices[:self.dim]
indices.sort()
W = self.dictionary.get_subdictionary(indices)
# dictionary atoms are stored in rows but transformers expect them to
# be in columns.
W = sharedX(W.T)
W.name = self.layer_name + "_W"
self.transformer = MatrixMul(W)
# This is a static layer, there is no cost, no parameters, no updates, etc, etc
def get_params(self):
return []
def cost(self, Y, Y_hat):
return 0.0
def cost_from_cost_matrix(self, cost_matrix):
return 0.0
def cost_matrix(self, Y, Y_hat):
return T.zeros_like(Y)
def get_weight_decay(self, coeff):
return 0.0
def get_l1_weight_decay(self, coeff):
return 0.0
| 31.214724 | 97 | 0.684748 | 678 | 5,088 | 4.89823 | 0.174041 | 0.048178 | 0.036134 | 0.048178 | 0.35411 | 0.292081 | 0.260163 | 0.201144 | 0.10539 | 0.10539 | 0 | 0.007136 | 0.228774 | 5,088 | 162 | 98 | 31.407407 | 0.839195 | 0.034591 | 0 | 0.307018 | 0 | 0 | 0.000408 | 0 | 0 | 0 | 0 | 0 | 0.026316 | 1 | 0.236842 | false | 0.017544 | 0.061404 | 0.157895 | 0.570175 | 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 |
30966146082ebbb0b9604c2ecc6cc3788a26fe5a | 433 | py | Python | solution.py | GabielFemi/Numerical-Computation | ed8ee5addf7465880b826c87b3ea4fe813fea87d | [
"MIT"
] | null | null | null | solution.py | GabielFemi/Numerical-Computation | ed8ee5addf7465880b826c87b3ea4fe813fea87d | [
"MIT"
] | null | null | null | solution.py | GabielFemi/Numerical-Computation | ed8ee5addf7465880b826c87b3ea4fe813fea87d | [
"MIT"
] | null | null | null | print("Numerical Computation Algorithms by github.com/GabielFemi")
print("/n")
#Runge-Kutta Method of order 4
a = int(input("Enter the value of Xm: "))
b = int(input("Enter the value of Ym: "))
x0 = int(input("Enter the value of Xo: "))
y0 = int(input("Enter the value of Yo: "))
h = int(input("Enter the value of h: "))
n = int(input("Enter the value of n: '))
def Rk(a,b,x0,y0,h,n):
#Calculation goes here!
| 24.055556 | 66 | 0.632794 | 75 | 433 | 3.653333 | 0.453333 | 0.175182 | 0.284672 | 0.350365 | 0.50365 | 0.50365 | 0 | 0 | 0 | 0 | 0 | 0.014493 | 0.203233 | 433 | 17 | 67 | 25.470588 | 0.77971 | 0.117783 | 0 | 0 | 0 | 0 | 0.455263 | 0.055263 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.222222 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
30b115c10f0600b4edb7a04c1ee5980332c98616 | 506 | py | Python | meshroombot/__init__.py | JesseLeeuwen/meshroombot | daaba54d74df79930cd056937deffc7b6d5659b3 | [
"Unlicense"
] | null | null | null | meshroombot/__init__.py | JesseLeeuwen/meshroombot | daaba54d74df79930cd056937deffc7b6d5659b3 | [
"Unlicense"
] | null | null | null | meshroombot/__init__.py | JesseLeeuwen/meshroombot | daaba54d74df79930cd056937deffc7b6d5659b3 | [
"Unlicense"
] | null | null | null | from .core import GetJob
# program Design
# get available meshroombot Job
# search in scan directory for the first available folder
# check with rename
# folder name indicated status
# available
# [-] busy
# [#] done
# search in [#] scans for Meshroom/mesh.obj
# (texture phase)
# process Job
# new scans
# create meshroom room .mg file
# run toNode MeshFiltering
# Texturing
# set mesh.obj as Texture inputMesh
| 25.3 | 61 | 0.606719 | 57 | 506 | 5.385965 | 0.789474 | 0.052117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.33004 | 506 | 19 | 62 | 26.631579 | 0.905605 | 0.703557 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
30b6e82d3270abf43047ddd786d203ec5bf21e52 | 1,160 | py | Python | src/app/mod_vote/models.py | talsperre/Flask-Stackoverflow-App | f77501c00e7d5982c2216ff58cbca6857feb0af4 | [
"MIT"
] | 15 | 2018-07-20T08:38:42.000Z | 2021-12-06T08:25:47.000Z | src/app/mod_vote/models.py | talsperre/Flask-Stackoverflow-App | f77501c00e7d5982c2216ff58cbca6857feb0af4 | [
"MIT"
] | null | null | null | src/app/mod_vote/models.py | talsperre/Flask-Stackoverflow-App | f77501c00e7d5982c2216ff58cbca6857feb0af4 | [
"MIT"
] | 12 | 2018-03-02T02:36:20.000Z | 2022-02-12T16:08:52.000Z | from app import db, login_manager
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from hashlib import md5
"""This is the model for Upvote class"""
class Upvote(db.Model):
__tablename__ = "upvotes"
vote_id = db.Column(db.Integer, primary_key = True)
user_id = db.Column(db.Integer, db.ForeignKey('users.user_id'))
question_id = db.Column(db.Integer,db.ForeignKey('questions.question_id'))
answer_id = db.Column(db.Integer,db.ForeignKey('answers.answer_id'))
comment_id = db.Column(db.Integer, db.ForeignKey('comments.comment_id'))
def __repr__(self):
return '<Upvote %r>' % (self.vote_id)
"""This is the model for Downvote class"""
class Downvote(db.Model):
__tablename__ = "downvotes"
vote_id = db.Column(db.Integer, primary_key = True)
user_id = db.Column(db.Integer, db.ForeignKey('users.user_id'))
question_id = db.Column(db.Integer,db.ForeignKey('questions.question_id'))
answer_id = db.Column(db.Integer,db.ForeignKey('answers.answer_id'))
comment_id = db.Column(db.Integer, db.ForeignKey('comments.comment_id'))
def __repr__(self):
return '<downVote %r>' % (self.vote_id)
| 40 | 75 | 0.757759 | 175 | 1,160 | 4.771429 | 0.274286 | 0.047904 | 0.11976 | 0.143713 | 0.675449 | 0.634731 | 0.634731 | 0.634731 | 0.634731 | 0.634731 | 0 | 0.00096 | 0.101724 | 1,160 | 28 | 76 | 41.428571 | 0.800384 | 0 | 0 | 0.545455 | 1 | 0 | 0.166976 | 0.038961 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0.045455 | 0.181818 | 0.090909 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
30d73162e0a4cc57613c083e052f9a137b5eb815 | 342 | py | Python | sharpy/plans/acts/terran/morph_planetary.py | MadManSC2/sharpy-sc2 | 13950357df2db58033daab24f076e3ae83f0b2a8 | [
"MIT"
] | 1 | 2020-03-05T19:21:56.000Z | 2020-03-05T19:21:56.000Z | sharpy/plans/acts/terran/morph_planetary.py | MadManSC2/sharpy-sc2 | 13950357df2db58033daab24f076e3ae83f0b2a8 | [
"MIT"
] | null | null | null | sharpy/plans/acts/terran/morph_planetary.py | MadManSC2/sharpy-sc2 | 13950357df2db58033daab24f076e3ae83f0b2a8 | [
"MIT"
] | null | null | null | from sharpy.plans.acts.morph_building import MorphBuilding
from sc2 import UnitTypeId, AbilityId
class MorphPlanetary(MorphBuilding):
def __init__(self, target_count: int = 99):
super().__init__(UnitTypeId.COMMANDCENTER, AbilityId.UPGRADETOPLANETARYFORTRESS_PLANETARYFORTRESS, UnitTypeId.PLANETARYFORTRESS, target_count)
| 42.75 | 151 | 0.807018 | 34 | 342 | 7.764706 | 0.705882 | 0.083333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01 | 0.122807 | 342 | 7 | 152 | 48.857143 | 0.87 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
30d89fe28b3e511abccfee54fe9ca8bfbacff691 | 346 | py | Python | python_lifecycle_training/calculator/simple.py | sp-95/python-lifecycle-training | e78a5daf570740ac60ba8e883d50c9a659356950 | [
"MIT"
] | 1 | 2020-10-09T03:45:39.000Z | 2020-10-09T03:45:39.000Z | python_lifecycle_training/calculator/simple.py | sp-95/python-lifecycle-training | e78a5daf570740ac60ba8e883d50c9a659356950 | [
"MIT"
] | null | null | null | python_lifecycle_training/calculator/simple.py | sp-95/python-lifecycle-training | e78a5daf570740ac60ba8e883d50c9a659356950 | [
"MIT"
] | 2 | 2021-01-31T08:28:10.000Z | 2021-03-02T08:15:59.000Z | from numbers import Real
import fire
from loguru import logger
def add(a: Real, b: Real) -> Real:
"""Add two numbers
Args:
a (Real): The first number
b (Real): The second number
Returns:
Real: Sum of two numbers
"""
logger.info(f"Adding {a} to {b}")
return a + b
def main():
fire.Fire(add)
| 15.043478 | 37 | 0.583815 | 52 | 346 | 3.884615 | 0.5 | 0.049505 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.303468 | 346 | 22 | 38 | 15.727273 | 0.838174 | 0.349711 | 0 | 0 | 0 | 0 | 0.087629 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.375 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
30f834040d8bf6f3f9f16cb5e9face35c7908bae | 873 | py | Python | src/imdb_trailer.py | polzbit/imdb_scraper | 78e8b03e7b141604cc8ce410d9ff615ef8451d03 | [
"MIT"
] | null | null | null | src/imdb_trailer.py | polzbit/imdb_scraper | 78e8b03e7b141604cc8ce410d9ff615ef8451d03 | [
"MIT"
] | null | null | null | src/imdb_trailer.py | polzbit/imdb_scraper | 78e8b03e7b141604cc8ce410d9ff615ef8451d03 | [
"MIT"
] | null | null | null | ##################################################################################
# scrape imdb.com for information about a title trailer
##################################################################################
from selenium.webdriver.common.by import By
from src.imdb_locators import ImdbLocators
class ImdbTrailer:
def __init__(self, driver):
self.driver = driver
self.duration = self.driver.find_element(By.XPATH, ImdbLocators.trailer_duration)
self.fullscreen_btn = self.driver.find_element(By.XPATH, ImdbLocators.fullscreen_button)
self.play_btn = self.driver.find_element(By.XPATH, ImdbLocators.play_button)
def get_duration(self):
return self.duration
def get_fullscreen_btn(self):
return self.fullscreen_btn
def get_play_btn(self):
return self.play_btn
| 37.956522 | 97 | 0.578465 | 91 | 873 | 5.32967 | 0.373626 | 0.103093 | 0.086598 | 0.129897 | 0.259794 | 0.259794 | 0.259794 | 0.17732 | 0 | 0 | 0 | 0 | 0.174112 | 873 | 22 | 98 | 39.681818 | 0.672677 | 0.06071 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.214286 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
a507f0e7eba43e37ff6eb318f1b9272539f15687 | 106 | py | Python | BOJ/1712.py | Jaesin22/TIL | d0aa137af79c22ea9eb0ff1c7a0264c086ebe1b2 | [
"MIT"
] | null | null | null | BOJ/1712.py | Jaesin22/TIL | d0aa137af79c22ea9eb0ff1c7a0264c086ebe1b2 | [
"MIT"
] | null | null | null | BOJ/1712.py | Jaesin22/TIL | d0aa137af79c22ea9eb0ff1c7a0264c086ebe1b2 | [
"MIT"
] | null | null | null | A, B, C = list(map(int, input().split()))
if C <= B:
print('-1')
else:
print(int(A / (C-B) + 1))
| 15.142857 | 41 | 0.462264 | 20 | 106 | 2.45 | 0.6 | 0.081633 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025 | 0.245283 | 106 | 6 | 42 | 17.666667 | 0.5875 | 0 | 0 | 0 | 0 | 0 | 0.018868 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.4 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a51247779cc74347a01d57200e3de1c55b8298a2 | 151 | py | Python | wallet/apps.py | saczuac/bbdd2 | 08436c3db08fbb39349fead50609ec9d2c78ca57 | [
"MIT"
] | null | null | null | wallet/apps.py | saczuac/bbdd2 | 08436c3db08fbb39349fead50609ec9d2c78ca57 | [
"MIT"
] | null | null | null | wallet/apps.py | saczuac/bbdd2 | 08436c3db08fbb39349fead50609ec9d2c78ca57 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class WalletConfig(AppConfig):
name = 'wallet'
def ready(self):
super(WalletConfig, self).ready()
| 16.777778 | 41 | 0.682119 | 17 | 151 | 6.058824 | 0.764706 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211921 | 151 | 8 | 42 | 18.875 | 0.865546 | 0 | 0 | 0 | 0 | 0 | 0.039735 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
a51bfe0f130f4ea16d50054a527f48adfe833a86 | 152 | py | Python | jotter/__init__.py | Figglewatts/jotter | 9e8f01eaefc9c5039e38a24bb9a1874ab49e6414 | [
"MIT"
] | null | null | null | jotter/__init__.py | Figglewatts/jotter | 9e8f01eaefc9c5039e38a24bb9a1874ab49e6414 | [
"MIT"
] | 3 | 2020-07-28T08:49:23.000Z | 2020-08-04T08:23:23.000Z | jotter/__init__.py | Figglewatts/jotter | 9e8f01eaefc9c5039e38a24bb9a1874ab49e6414 | [
"MIT"
] | null | null | null | """jotter
The main functionality of jotter, including CLI and other modules.
Author:
Figglewatts <me@figglewatts.co.uk>
"""
__version__ = "0.1.3" | 16.888889 | 66 | 0.717105 | 21 | 152 | 5 | 0.904762 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023438 | 0.157895 | 152 | 9 | 67 | 16.888889 | 0.796875 | 0.802632 | 0 | 0 | 0 | 0 | 0.208333 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eb4f7238f8b0f6bbf684a2a88ccf89e7e48fc9c5 | 1,282 | py | Python | user/serialiszer.py | Himself65/VueWeb-Backend | cff21fcc1cff9d4432783dedc05620347787ee1b | [
"MIT"
] | 1 | 2018-06-25T15:20:38.000Z | 2018-06-25T15:20:38.000Z | user/serialiszer.py | Himself65/VueWeb-Backend | cff21fcc1cff9d4432783dedc05620347787ee1b | [
"MIT"
] | null | null | null | user/serialiszer.py | Himself65/VueWeb-Backend | cff21fcc1cff9d4432783dedc05620347787ee1b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
有关User的序列器
"""
from rest_framework import serializers
from django.db import models
from django.contrib.auth.models import User
# local
from .models import UserProfile
class UserSerializers(serializers.ModelSerializer):
"""
User数据序列化器
适用于各种ForeignKey查找
"""
class Meta:
model = User
fields = ('username', 'is_staff', 'is_superuser')
class UserProfileSerializers(serializers.ModelSerializer):
"""
UserProfile数据序列化器
"""
user = UserSerializers(many=False, read_only=True)
class Meta:
model = UserProfile
fields = ('user', 'github')
class UserRegisterSerializer(serializers.ModelSerializer):
"""用于用户注册"""
# TODO
# 验证码问题
username = serializers.CharField(required=True, allow_blank=False)
password = serializers.CharField(
required=True, allow_blank=False, write_only=True, min_length=8)
def create(self, validated_data):
"""重载create"""
user = super(UserRegisterSerializer,
self).create(validated_data=validated_data)
user.set_password(validated_data['password'])
user.save()
return user
class Meta:
model = User
fields = ('username', 'password')
| 22.892857 | 72 | 0.656786 | 125 | 1,282 | 6.632 | 0.496 | 0.062726 | 0.050663 | 0.043426 | 0.190591 | 0.190591 | 0.11339 | 0 | 0 | 0 | 0 | 0.00203 | 0.231669 | 1,282 | 55 | 73 | 23.309091 | 0.839594 | 0.100624 | 0 | 0.192308 | 0 | 0 | 0.056518 | 0 | 0 | 0 | 0 | 0.018182 | 0 | 1 | 0.038462 | false | 0.115385 | 0.153846 | 0 | 0.576923 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
eb739078d2f4e3816bea273b9266c415057f0104 | 387 | py | Python | limitedstack.py | anthonycurtisadler/ARCADES | 3ca061776ef7c43d0ce29f2759df00738c8f9e82 | [
"MIT"
] | 7 | 2019-05-30T22:21:48.000Z | 2021-02-11T12:25:31.000Z | limitedstack.py | anthonycurtisadler/ARCADES | 3ca061776ef7c43d0ce29f2759df00738c8f9e82 | [
"MIT"
] | 4 | 2020-06-22T22:36:43.000Z | 2020-07-10T13:11:10.000Z | limitedstack.py | anthonycurtisadler/ARCADES | 3ca061776ef7c43d0ce29f2759df00738c8f9e82 | [
"MIT"
] | null | null | null | class LimitedStack:
def __init__ (self,max_size=200):
self.stack = []
self.max_size = max_size
def add (self,item=None):
self.stack.append(item)
if len(self.stack) > self.max_size:
self.stack = self.stack[1:]
def get (self):
if self.stack:
return self.stack.pop()
| 19.35 | 46 | 0.498708 | 46 | 387 | 4.021739 | 0.413043 | 0.340541 | 0.178378 | 0.172973 | 0.216216 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017021 | 0.392765 | 387 | 19 | 47 | 20.368421 | 0.770213 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0 | 0 | 0.454545 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eb8d947b2c6bec49ed5e06c50f0d5b94bbdbfd2f | 136 | py | Python | spotibox/__init__.py | MartinHanewald/spotibox | 756aee5ade649a85e7973fbc375211e214db72ca | [
"MIT"
] | 1 | 2020-12-21T21:31:39.000Z | 2020-12-21T21:31:39.000Z | spotibox/__init__.py | MartinHanewald/spotibox | 756aee5ade649a85e7973fbc375211e214db72ca | [
"MIT"
] | null | null | null | spotibox/__init__.py | MartinHanewald/spotibox | 756aee5ade649a85e7973fbc375211e214db72ca | [
"MIT"
] | null | null | null | """Top-level package for spotibox."""
__author__ = """Martin Hanewald"""
__email__ = 'martin.hanewald@gmail.com'
__version__ = '0.2.0'
| 22.666667 | 39 | 0.698529 | 17 | 136 | 4.882353 | 0.823529 | 0.337349 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024793 | 0.110294 | 136 | 5 | 40 | 27.2 | 0.661157 | 0.227941 | 0 | 0 | 0 | 0 | 0.454545 | 0.252525 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eb92c44a302e08ce2b414ef8bc849e523dd8c61b | 2,444 | py | Python | pyretrommo/gen/class_info.py | snwhd/pyretrommo | fabb523d9b4385ed8a1ff0b2ac787cc5d88a23b7 | [
"blessing"
] | 1 | 2021-11-25T09:33:30.000Z | 2021-11-25T09:33:30.000Z | pyretrommo/gen/class_info.py | snwhd/pyretrommo | fabb523d9b4385ed8a1ff0b2ac787cc5d88a23b7 | [
"blessing"
] | null | null | null | pyretrommo/gen/class_info.py | snwhd/pyretrommo | fabb523d9b4385ed8a1ff0b2ac787cc5d88a23b7 | [
"blessing"
] | null | null | null | #!/usr/bin/env python3
# this file is auto-generated by gen_from_wiki.py
from __future__ import annotations
from typing import (
Dict,
Tuple,
)
from ..item import EquipmentItem
from .ability import Ability
from .equipment import find_equipment
from .player_class import PlayerClass
CLASS_ABILITIES: Dict[PlayerClass, Dict[Ability, int]] = {
PlayerClass.Cleric: {
Ability.Attack: 1,
Ability.Heal: 1,
Ability.HealWave: 10,
Ability.Smite: 2,
Ability.Pass: 1,
Ability.Escape: 1,
},
PlayerClass.Warrior: {
Ability.Attack: 1,
Ability.Guard: 1,
Ability.Pass: 1,
Ability.Escape: 1,
},
PlayerClass.Wizard: {
Ability.Attack: 1,
Ability.Fireball: 1,
Ability.Firewall: 4,
Ability.Vitality: 5,
Ability.Teleport: 7,
Ability.Pass: 1,
Ability.Escape: 1,
},
}
CLASS_EQUIPMENT: Dict[PlayerClass, Dict['EquipmentItem', int]] = {
PlayerClass.Cleric: {
find_equipment('TrainingWand'): 4,
find_equipment('BoneBracelet'): 8,
find_equipment('JaggedCrown'): 8,
find_equipment('CrookedWand'): 6,
find_equipment('CypressStick'): 1,
find_equipment('LeatherCap'): 1,
find_equipment('OakenClub'): 1,
find_equipment('PaddedGarb'): 2,
find_equipment('PlainClothes'): 1,
find_equipment('RustyDagger'): 6,
find_equipment('TatteredCloak'): 2,
find_equipment('SimpleBracelet'): 1,
},
PlayerClass.Warrior: {
find_equipment('CypressStick'): 1,
find_equipment('DentedHelm'): 6,
find_equipment('LeatherArmor'): 2,
find_equipment('LeatherCap'): 1,
find_equipment('OakenClub'): 1,
find_equipment('PlainClothes'): 1,
find_equipment('StuddedShield'): 6,
find_equipment('TheTenderizer'): 8,
find_equipment('TrainingSword'): 4,
find_equipment('WoodenShield'): 1,
},
PlayerClass.Wizard: {
find_equipment('BoneBracelet'): 8,
find_equipment('CrookedWand'): 6,
find_equipment('CypressStick'): 1,
find_equipment('JaggedCrown'): 8,
find_equipment('LeatherCap'): 1,
find_equipment('MageHat'): 6,
find_equipment('PlainClothes'): 1,
find_equipment('SimpleBracelet'): 1,
find_equipment('TatteredCloak'): 2,
find_equipment('TrainingWand'): 4,
},
}
| 29.804878 | 66 | 0.619067 | 246 | 2,444 | 5.979675 | 0.288618 | 0.291638 | 0.114208 | 0.042828 | 0.46499 | 0.46499 | 0.211421 | 0.161115 | 0.161115 | 0.161115 | 0 | 0.027945 | 0.253273 | 2,444 | 81 | 67 | 30.17284 | 0.778082 | 0.028232 | 0 | 0.513514 | 1 | 0 | 0.160202 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.040541 | 0.081081 | 0 | 0.081081 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
eb9e75bb2b71053b91ce942a3294c5f513d8dd37 | 867 | py | Python | src/xia2/Experts/test_LatticeExpert.py | graeme-winter/xia2 | e00d688137d4ddb4b125be9a3f37ae00265886c2 | [
"BSD-3-Clause"
] | 10 | 2015-10-30T06:36:55.000Z | 2021-12-10T20:06:22.000Z | src/xia2/Experts/test_LatticeExpert.py | graeme-winter/xia2 | e00d688137d4ddb4b125be9a3f37ae00265886c2 | [
"BSD-3-Clause"
] | 528 | 2015-11-24T08:20:12.000Z | 2022-03-21T21:47:29.000Z | src/xia2/Experts/test_LatticeExpert.py | graeme-winter/xia2 | e00d688137d4ddb4b125be9a3f37ae00265886c2 | [
"BSD-3-Clause"
] | 14 | 2016-03-15T22:07:03.000Z | 2020-12-14T07:13:35.000Z | import pytest
import xia2.Experts.LatticeExpert
def test_lattice_expert():
cell, dist = xia2.Experts.LatticeExpert.ApplyLattice(
"oP", (23.0, 24.0, 25.0, 88.9, 90.0, 90.1)
)
assert cell == (23.0, 24.0, 25.0, 90.0, 90.0, 90.0)
assert dist == pytest.approx(1.2)
def test_SortLattices():
lattices_cells = [
("aP", (57.70, 57.70, 149.80, 90.00, 90.00, 90.00)),
("tP", (57.70, 57.70, 149.80, 90.00, 90.00, 90.00)),
("mC", (81.60, 81.60, 149.80, 90.00, 90.00, 90.00)),
("mP", (57.70, 57.70, 149.80, 90.00, 90.00, 90.00)),
("oC", (81.60, 81.60, 149.80, 90.00, 90.00, 90.00)),
("oP", (57.70, 57.70, 149.80, 90.00, 90.00, 90.00)),
]
result = xia2.Experts.LatticeExpert.SortLattices(lattices_cells)
r0 = [r[0] for r in result]
assert r0 == ["tP", "oC", "oP", "mC", "mP", "aP"]
| 29.896552 | 68 | 0.539792 | 154 | 867 | 3.006494 | 0.285714 | 0.155508 | 0.155508 | 0.207343 | 0.382289 | 0.362851 | 0.323974 | 0.323974 | 0.323974 | 0.323974 | 0 | 0.289985 | 0.228374 | 867 | 28 | 69 | 30.964286 | 0.402093 | 0 | 0 | 0 | 0 | 0 | 0.029988 | 0 | 0 | 0 | 0 | 0 | 0.15 | 1 | 0.1 | false | 0 | 0.1 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ebbc0a669aebf4267fd3237368e5bf50392a93da | 1,298 | py | Python | WEB21-1-12/WEB2/power/migrations/0001_initial.py | coderdq/vuetest | 28ea4f36e2c4e7e80d1ba1777ef312733ef84048 | [
"MIT"
] | null | null | null | WEB21-1-12/WEB2/power/migrations/0001_initial.py | coderdq/vuetest | 28ea4f36e2c4e7e80d1ba1777ef312733ef84048 | [
"MIT"
] | null | null | null | WEB21-1-12/WEB2/power/migrations/0001_initial.py | coderdq/vuetest | 28ea4f36e2c4e7e80d1ba1777ef312733ef84048 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-10-15 01:02
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='POWER',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('fsvip', models.CharField(max_length=20)),
('fsvoffset', models.CharField(max_length=3)),
('zvlip', models.CharField(max_length=20)),
('zvloffset', models.CharField(max_length=3)),
('smbvip', models.CharField(max_length=20)),
('powerdir', models.CharField(max_length=255)),
('band', models.CharField(max_length=3)),
('zvlused', models.CharField(max_length=2)),
('dl', models.CharField(max_length=20)),
('lowtemp', models.SmallIntegerField(null=True)),
('normtemp', models.SmallIntegerField(null=True)),
('hightemp', models.SmallIntegerField(null=True)),
('port', models.SmallIntegerField(null=True)),
('period', models.SmallIntegerField(null=True)),
],
),
]
| 37.085714 | 114 | 0.560863 | 123 | 1,298 | 5.821138 | 0.455285 | 0.188547 | 0.226257 | 0.301676 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031659 | 0.294299 | 1,298 | 34 | 115 | 38.176471 | 0.75 | 0.033128 | 0 | 0 | 1 | 0 | 0.077414 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.037037 | 0 | 0.185185 | 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 |
ebbe9efe85c553eb1570aa662fc476a5a2a7a1d1 | 457 | py | Python | apps/count/migrations/0009_auto_20200114_1844.py | lianxiaopang/camel-store-api | b8021250bf3d8cf7adc566deebdba55225148316 | [
"Apache-2.0"
] | 12 | 2020-02-01T01:52:01.000Z | 2021-04-28T15:06:43.000Z | apps/count/migrations/0009_auto_20200114_1844.py | lianxiaopang/camel-store-api | b8021250bf3d8cf7adc566deebdba55225148316 | [
"Apache-2.0"
] | 5 | 2020-02-06T08:07:58.000Z | 2020-06-02T13:03:45.000Z | apps/count/migrations/0009_auto_20200114_1844.py | lianxiaopang/camel-store-api | b8021250bf3d8cf7adc566deebdba55225148316 | [
"Apache-2.0"
] | 11 | 2020-02-03T13:07:46.000Z | 2020-11-29T01:44:06.000Z | # Generated by Django 2.2 on 2020-01-14 10:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('count', '0008_auto_20190326_1600'),
]
operations = [
migrations.RemoveField(
model_name='orderstatistics',
name='sub_num',
),
migrations.RemoveField(
model_name='turnoversstatistics',
name='sub_turnovers',
),
]
| 20.772727 | 45 | 0.586433 | 43 | 457 | 6.069767 | 0.72093 | 0.16092 | 0.199234 | 0.229885 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094937 | 0.308534 | 457 | 21 | 46 | 21.761905 | 0.731013 | 0.094092 | 0 | 0.266667 | 1 | 0 | 0.199029 | 0.055825 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.066667 | 0 | 0.266667 | 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 |
ebcb259d74cef5aa6962ad75c710446dac57d582 | 62 | py | Python | app/app/routes/webhooks/__init__.py | finalsa/base-fastapi-api | 134a14c7bb7ec3d9f9c32beecae2ab8c51e820a3 | [
"MIT"
] | null | null | null | app/app/routes/webhooks/__init__.py | finalsa/base-fastapi-api | 134a14c7bb7ec3d9f9c32beecae2ab8c51e820a3 | [
"MIT"
] | null | null | null | app/app/routes/webhooks/__init__.py | finalsa/base-fastapi-api | 134a14c7bb7ec3d9f9c32beecae2ab8c51e820a3 | [
"MIT"
] | null | null | null | from fastapi import APIRouter
router_webhooks = APIRouter()
| 12.4 | 29 | 0.806452 | 7 | 62 | 7 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.145161 | 62 | 4 | 30 | 15.5 | 0.924528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
ebdf5e323b78f3001ab0699758b1dbda4d19e1d6 | 958 | py | Python | mini_keras/activations.py | Deep-Alchemy/Mini-Keras | 07aeb129c2530d39dc4dcea139c6fba72268d535 | [
"MIT"
] | 12 | 2021-04-20T09:55:46.000Z | 2022-01-18T13:12:54.000Z | mini_keras/activations.py | Deep-Alchemy/Mini-Keras | 07aeb129c2530d39dc4dcea139c6fba72268d535 | [
"MIT"
] | null | null | null | mini_keras/activations.py | Deep-Alchemy/Mini-Keras | 07aeb129c2530d39dc4dcea139c6fba72268d535 | [
"MIT"
] | 2 | 2021-04-18T14:05:20.000Z | 2021-10-06T14:13:44.000Z | import numpy as np
from .base import BaseActivation
class Identity(BaseActivation):
def f(self, x):
return x
def df(self, x, cached_y=None):
return np.full(x.shape, 1)
class Sigmoid(BaseActivation):
def f(self, x):
return np.where(x >= 0, 1 / (1 + np.exp(-x)), np.exp(x) / (1 + np.exp(x)))
def df(self, x, cached_y=None):
y = cached_y if cached_y is not None else self.f(x)
return y * (1 - y)
class ReLU(BaseActivation):
def f(self, x):
return np.maximum(0, x)
def df(self, x, cached_y=None):
return np.where(x <= 0, 0, 1)
class SoftMax(BaseActivation):
def f(self, x):
y = np.exp(x - np.max(x, axis=1, keepdims=True))
return y / np.sum(y, axis=1, keepdims=True)
def df(self, x, cached_y=None):
raise NotImplementedError
# -- Assign to the short forms --
identity = Identity()
sigmoid = Sigmoid()
relu = ReLU()
softmax = SoftMax()
| 21.288889 | 82 | 0.593946 | 153 | 958 | 3.679739 | 0.287582 | 0.071048 | 0.127886 | 0.156306 | 0.410302 | 0.344583 | 0.293073 | 0.145648 | 0.106572 | 0.106572 | 0 | 0.016949 | 0.26096 | 958 | 44 | 83 | 21.772727 | 0.778249 | 0.032359 | 0 | 0.285714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.071429 | 0.178571 | 0.75 | 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 |
cce3334b483232a6077d9b5f323d097dbeea24f9 | 138 | py | Python | tock/projects/templatetags/project_tags.py | mikiec84/tock | 15318a45b2b144360e4d7e15db655467a45c2ab9 | [
"CC0-1.0"
] | 134 | 2015-02-02T18:42:03.000Z | 2022-01-20T04:27:06.000Z | tock/projects/templatetags/project_tags.py | mikiec84/tock | 15318a45b2b144360e4d7e15db655467a45c2ab9 | [
"CC0-1.0"
] | 1,220 | 2015-03-19T01:57:30.000Z | 2022-03-23T21:52:15.000Z | tock/projects/templatetags/project_tags.py | mikiec84/tock | 15318a45b2b144360e4d7e15db655467a45c2ab9 | [
"CC0-1.0"
] | 49 | 2015-03-09T15:44:33.000Z | 2022-01-19T02:02:37.000Z | from django import template
register = template.Library()
def get(value, key):
return value.get(key)
register.filter('get', get)
| 12.545455 | 29 | 0.710145 | 19 | 138 | 5.157895 | 0.631579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 138 | 10 | 30 | 13.8 | 0.852174 | 0 | 0 | 0 | 0 | 0 | 0.021739 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0.2 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ccf3f77a46e4b6ec933c7706b2096f1126fec18e | 15 | py | Python | syncli/api/filters.py | comodit/synapse-client | 9bc7fcc09367bc1f6ac7baff6f38fde9cbcdbf39 | [
"MIT"
] | 2 | 2016-06-23T05:57:37.000Z | 2021-02-02T06:47:35.000Z | syncli/api/filters.py | comodit/synapse-client | 9bc7fcc09367bc1f6ac7baff6f38fde9cbcdbf39 | [
"MIT"
] | null | null | null | syncli/api/filters.py | comodit/synapse-client | 9bc7fcc09367bc1f6ac7baff6f38fde9cbcdbf39 | [
"MIT"
] | 2 | 2017-09-23T00:05:51.000Z | 2019-05-13T15:43:48.000Z |
filters = {}
| 3.75 | 12 | 0.466667 | 1 | 15 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | 15 | 3 | 13 | 5 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ccf6172227b1e14f311ee6b831829a6b218e7209 | 421 | py | Python | finial/admin.py | gmcquillan/django-finial | c760001d3c7b02014fc9a928d451dc6b972a2e5e | [
"BSD-3-Clause"
] | 1 | 2015-09-28T20:52:30.000Z | 2015-09-28T20:52:30.000Z | finial/admin.py | gmcquillan/django-finial | c760001d3c7b02014fc9a928d451dc6b972a2e5e | [
"BSD-3-Clause"
] | null | null | null | finial/admin.py | gmcquillan/django-finial | c760001d3c7b02014fc9a928d451dc6b972a2e5e | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from finial import models
class UserTemplateOverrideAdmin(admin.ModelAdmin):
search_fields = ('user', 'override_name', 'override_dir')
raw_id_fields = ('user',)
list_display = ('user', 'override_name', 'override_dir', 'priority', )
list_filter = ('override_name', 'override_dir', )
admin.site.register(
models.UserTemplateOverride,
UserTemplateOverrideAdmin
)
| 26.3125 | 74 | 0.729216 | 44 | 421 | 6.727273 | 0.568182 | 0.121622 | 0.202703 | 0.233108 | 0.182432 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147268 | 421 | 15 | 75 | 28.066667 | 0.824513 | 0 | 0 | 0 | 0 | 0 | 0.225653 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.181818 | 0 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
ccf8da6f166e9c8409014824e7ef7897b6684049 | 141 | py | Python | src/library/apps.py | klown/clusive | 3c89dae967dfe190c2cdf269915c6ace968d1bfb | [
"bzip2-1.0.6"
] | null | null | null | src/library/apps.py | klown/clusive | 3c89dae967dfe190c2cdf269915c6ace968d1bfb | [
"bzip2-1.0.6"
] | null | null | null | src/library/apps.py | klown/clusive | 3c89dae967dfe190c2cdf269915c6ace968d1bfb | [
"bzip2-1.0.6"
] | null | null | null | from django.apps import AppConfig
class LibraryConfig(AppConfig):
name = 'library'
def ready(self):
import library.signals | 17.625 | 33 | 0.702128 | 16 | 141 | 6.1875 | 0.8125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.219858 | 141 | 8 | 34 | 17.625 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0.049296 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 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 |
69166bf17250ad4034c7d068894c86bc2b30698e | 261 | py | Python | setup.py | boborot/python-screwdrivercd | c4f1165741c8af7a47c126ee4abc5504c350a77f | [
"Apache-2.0"
] | 6 | 2019-12-31T21:49:07.000Z | 2021-06-22T21:50:32.000Z | setup.py | boborot/python-screwdrivercd | c4f1165741c8af7a47c126ee4abc5504c350a77f | [
"Apache-2.0"
] | 24 | 2019-11-19T00:35:14.000Z | 2021-03-27T16:55:37.000Z | setup.py | boborot/python-screwdrivercd | c4f1165741c8af7a47c126ee4abc5504c350a77f | [
"Apache-2.0"
] | 10 | 2019-12-09T19:14:54.000Z | 2021-10-03T06:17:52.000Z | #!/usr/bin/env python
# Copyright 2019, Oath Inc.
# Licensed under the terms of the Apache 2.0 license. See the LICENSE file in the project root for terms
"""
Package setup file for python module screwdrivercd
"""
import setuptools
setuptools.setup()
| 26.1 | 105 | 0.735632 | 39 | 261 | 4.923077 | 0.74359 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.028302 | 0.187739 | 261 | 9 | 106 | 29 | 0.877358 | 0.770115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 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 |
69264820ccee0834ed64e27ebb3850dca3b8dc52 | 418 | py | Python | pymodbus3/datastore/__init__.py | phygitalism/pymodbus3 | 28edc8d6455af880b5d86651eda66a3563ed67e8 | [
"BSD-3-Clause"
] | 40 | 2015-12-01T09:10:20.000Z | 2021-07-10T17:30:32.000Z | pymodbus3/datastore/__init__.py | phygitalism/pymodbus3 | 28edc8d6455af880b5d86651eda66a3563ed67e8 | [
"BSD-3-Clause"
] | 12 | 2016-06-03T03:06:43.000Z | 2019-09-06T06:35:06.000Z | pymodbus3/datastore/__init__.py | phygitalism/pymodbus3 | 28edc8d6455af880b5d86651eda66a3563ed67e8 | [
"BSD-3-Clause"
] | 17 | 2015-09-02T07:25:46.000Z | 2021-08-10T13:07:55.000Z | # -*- coding: utf-8 -*-
from pymodbus3.datastore.store import ModbusSequentialDataBlock
from pymodbus3.datastore.store import ModbusSparseDataBlock
from pymodbus3.datastore.context import ModbusSlaveContext
from pymodbus3.datastore.context import ModbusServerContext
# Exported symbols
__all__ = [
'ModbusSequentialDataBlock',
'ModbusSparseDataBlock',
'ModbusSlaveContext',
'ModbusServerContext',
]
| 26.125 | 63 | 0.799043 | 34 | 418 | 9.705882 | 0.470588 | 0.157576 | 0.266667 | 0.163636 | 0.412121 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013624 | 0.12201 | 418 | 15 | 64 | 27.866667 | 0.885559 | 0.090909 | 0 | 0 | 0 | 0 | 0.220159 | 0.122016 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
6929a8830076e7270c1c02d1b984289f58a53b69 | 1,078 | py | Python | django-budget/category/models.py | eliostvs/django-budget | c3b181e0dd259f14de6cb6f537508190e1344ec3 | [
"MIT"
] | null | null | null | django-budget/category/models.py | eliostvs/django-budget | c3b181e0dd259f14de6cb6f537508190e1344ec3 | [
"MIT"
] | null | null | null | django-budget/category/models.py | eliostvs/django-budget | c3b181e0dd259f14de6cb6f537508190e1344ec3 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from base.models import ActiveManager, StandardMetadata
@python_2_unicode_compatible
class Category(StandardMetadata):
"""
Categories are the means to loosely tie together the transactions and
estimates.
They are used to aggregate transactions together and compare them to the
appropriate budget estimate. For the reasoning behind this, the docstring
on the Transaction object explains this.
"""
name = models.CharField(_('Name'), max_length=100)
slug = models.SlugField(_('Slug'), unique=True)
objects = models.Manager()
active = ActiveManager()
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('category:category_edit', args=[self.slug])
class Meta:
verbose_name = _('Category')
verbose_name_plural = _('Categories')
| 29.944444 | 77 | 0.742115 | 132 | 1,078 | 5.848485 | 0.583333 | 0.051813 | 0.03886 | 0.062176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005695 | 0.185529 | 1,078 | 35 | 78 | 30.8 | 0.873576 | 0.249536 | 0 | 0 | 0 | 0 | 0.061776 | 0.028314 | 0 | 0 | 0 | 0 | 0 | 1 | 0.105263 | false | 0 | 0.315789 | 0.105263 | 0.842105 | 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 |
693a012df7e9aa7022e7b73a754eb05d2d84144a | 653 | py | Python | hysds_commons/net_utils.py | hysds/hysds_commons | c6b983ba39fe0a1cd8389492420097b6c68388bb | [
"Apache-2.0"
] | 1 | 2019-10-18T21:30:26.000Z | 2019-10-18T21:30:26.000Z | hysds_commons/net_utils.py | hysds/hysds_commons | c6b983ba39fe0a1cd8389492420097b6c68388bb | [
"Apache-2.0"
] | 11 | 2019-07-11T22:32:17.000Z | 2021-03-29T23:42:49.000Z | hysds_commons/net_utils.py | hysds/hysds_commons | c6b983ba39fe0a1cd8389492420097b6c68388bb | [
"Apache-2.0"
] | 1 | 2019-02-07T19:56:53.000Z | 2019-02-07T19:56:53.000Z | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import os
import sys
import hysds_commons.linux_utils
def get_container_host_ip():
"""Return the IP address of the container host if caller is running in a
container. Otherwise, returns the default localhost IP address."""
if sys.platform.startswith('linux'):
return hysds_commons.linux_utils.get_container_host_ip()
else:
raise NotImplementedError("Platform %s not supported." % sys.platform)
| 31.095238 | 78 | 0.788668 | 87 | 653 | 5.551724 | 0.528736 | 0.10352 | 0.165631 | 0.091097 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.156202 | 653 | 20 | 79 | 32.65 | 0.876588 | 0.203675 | 0 | 0 | 0 | 0 | 0.061144 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.071429 | true | 0 | 0.571429 | 0 | 0.714286 | 0.071429 | 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 |
694c3ecf45c70bd0dcf33d70f62a1c6f14ef5959 | 460 | py | Python | base_kivy.py | Perceu/tkinter-examples | cc3f10c49de409f75e261b06938d2258696eb08e | [
"MIT"
] | null | null | null | base_kivy.py | Perceu/tkinter-examples | cc3f10c49de409f75e261b06938d2258696eb08e | [
"MIT"
] | null | null | null | base_kivy.py | Perceu/tkinter-examples | cc3f10c49de409f75e261b06938d2258696eb08e | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.popup import Popup
class Screen(GridLayout):
def __init__(self) -> None:
super().__init__()
self.add_widget(Label(text = 'Tela Base'))
class MyApp(App):
def build(self):
return Screen()
if __name__ == '__main__':
MyApp().run() | 20.909091 | 50 | 0.7 | 64 | 460 | 4.765625 | 0.453125 | 0.157377 | 0.180328 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.191304 | 460 | 22 | 51 | 20.909091 | 0.819892 | 0 | 0 | 0 | 0 | 0 | 0.036876 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.133333 | false | 0 | 0.4 | 0.066667 | 0.733333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
15dd57ce83fd7a8598e1bc998d3e31808cbcd109 | 218 | py | Python | scripts/loadings.py | daniele21/Financial_Sentiment_Analysis | 3734733f2d1d291c81a6239de121edcce861b463 | [
"MIT"
] | null | null | null | scripts/loadings.py | daniele21/Financial_Sentiment_Analysis | 3734733f2d1d291c81a6239de121edcce861b463 | [
"MIT"
] | null | null | null | scripts/loadings.py | daniele21/Financial_Sentiment_Analysis | 3734733f2d1d291c81a6239de121edcce861b463 | [
"MIT"
] | 1 | 2021-08-18T01:40:56.000Z | 2021-08-18T01:40:56.000Z | import json
from constants.paths import CONTRACTION_DICT_PATH
def load_contractions_dict():
with open(CONTRACTION_DICT_PATH, 'r') as f:
contr_dict = json.load(f)
f.close()
return contr_dict
| 18.166667 | 49 | 0.706422 | 31 | 218 | 4.709677 | 0.612903 | 0.205479 | 0.260274 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.215596 | 218 | 11 | 50 | 19.818182 | 0.853801 | 0 | 0 | 0 | 0 | 0 | 0.004587 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
15e24d5c358539f49327b12d0803591a5e5155be | 2,713 | py | Python | blog/models.py | giranezafiacre/django-blog | 40fd0d7c775f54c4e55a342476e0857e67279e1b | [
"MIT"
] | null | null | null | blog/models.py | giranezafiacre/django-blog | 40fd0d7c775f54c4e55a342476e0857e67279e1b | [
"MIT"
] | null | null | null | blog/models.py | giranezafiacre/django-blog | 40fd0d7c775f54c4e55a342476e0857e67279e1b | [
"MIT"
] | null | null | null | from django.conf import settings
from django.db import models
# Create your models here.
from django.urls import reverse # Used to generate URLs by reversing the URL patterns
import datetime
class Post(models.Model):
title = models.CharField(max_length=200,null=False)
content = models.TextField(max_length=3000, help_text='Enter a content of the a post')
image = models.ImageField(upload_to='uploads', default='../../static/img/3.jpg')
author = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True,verbose_name='created_by')
created_on = models.DateField(default=datetime.date.today)
class Meta:
ordering = ['-id']
def __str__(self):
"""String for representing the Model object."""
return self.title
def get_absolute_url(self):
return reverse('post-detail', args=[str(self.id)])
class Comment(models.Model):
content = models.TextField(max_length=2000, help_text='Enter your comment', verbose_name='Put your comment here')
post = models.ForeignKey('Post', on_delete=models.SET_NULL, null=True,verbose_name='commented_on')
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True,verbose_name='commented_by')
class Meta:
ordering = ['-id']
def __str__(self):
"""String for representing the Model object."""
return f'{self.id} ({self.content})'
class Like(models.Model):
post = models.ForeignKey('Post', on_delete=models.SET_NULL, null=True,verbose_name='Liked_on')
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True,verbose_name='Liked_by')
def __str__(self):
"""String for representing the Model object."""
return f'{self.id}'
class CommentLike(models.Model):
comment=models.ForeignKey('Comment', on_delete=models.SET_NULL, null=True,verbose_name='Liked on comment')
user= models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True,verbose_name='Liked_by')
def __str__(self):
"""String for representing the Model object."""
return f'{self.id}'
class CommentReply(models.Model):
content = models.TextField(max_length=2000, help_text='Enter your comment', verbose_name='Enter your reply here')
comment = models.ForeignKey('Comment', on_delete=models.SET_NULL, null=True,verbose_name='replied_on')
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True,verbose_name='commented_by')
class Meta:
ordering = ['id']
def __str__(self):
"""String for representing the Model object."""
return f'{self.id} ({self.content})'
| 43.758065 | 120 | 0.710652 | 370 | 2,713 | 5 | 0.237838 | 0.065405 | 0.068108 | 0.082703 | 0.701081 | 0.684324 | 0.684324 | 0.684324 | 0.684324 | 0.684324 | 0 | 0.007052 | 0.163656 | 2,713 | 61 | 121 | 44.47541 | 0.808286 | 0.105787 | 0 | 0.428571 | 1 | 0 | 0.142976 | 0.00917 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.095238 | 0.02381 | 0.928571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c62b278d58b800b21bbf054e0ad683004c1377c5 | 256 | py | Python | rocket/a_car_rental/b_car_rental/admin.py | t444ov/django-carrental | 64d2071468a311d000ea307e213b980818f6bff6 | [
"BSD-3-Clause"
] | null | null | null | rocket/a_car_rental/b_car_rental/admin.py | t444ov/django-carrental | 64d2071468a311d000ea307e213b980818f6bff6 | [
"BSD-3-Clause"
] | null | null | null | rocket/a_car_rental/b_car_rental/admin.py | t444ov/django-carrental | 64d2071468a311d000ea307e213b980818f6bff6 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from .models import Car, RentCar
@admin.register(Car)
class Car(admin.ModelAdmin):
class Meta:
model = Car
@admin.register(RentCar)
class RentCar(admin.ModelAdmin):
class Meta:
model = RentCar
| 15.058824 | 32 | 0.695313 | 32 | 256 | 5.5625 | 0.40625 | 0.134831 | 0.224719 | 0.269663 | 0.325843 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.214844 | 256 | 16 | 33 | 16 | 0.885572 | 0 | 0 | 0.2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c640339d8576dd40a80324fc735cb9f75d083c95 | 4,887 | py | Python | tests/test_theme.py | LukeMS/pyglet-gui | 20ec4b335c9af3698dfa8328894544d4d0417973 | [
"BSD-3-Clause"
] | 52 | 2015-04-18T20:45:52.000Z | 2021-11-21T14:50:10.000Z | tests/test_theme.py | LukeMS/pyglet-gui | 20ec4b335c9af3698dfa8328894544d4d0417973 | [
"BSD-3-Clause"
] | 8 | 2015-06-14T19:35:55.000Z | 2018-06-29T13:52:28.000Z | tests/test_theme.py | jorgecarleitao/pyglet-gui | 20ec4b335c9af3698dfa8328894544d4d0417973 | [
"BSD-3-Clause"
] | 21 | 2015-07-22T16:21:11.000Z | 2021-09-23T09:37:43.000Z | import unittest
import pyglet
from pyglet_gui.theme import Theme
class TestTheme(unittest.TestCase):
"""
Tests basic functionality of theme such as
initializing a theme and generating graphical elements.
"""
def test_access(self):
theme = Theme({'first depth': {
'second depth': [0, 0, 0, 0]
}}, 'some_path')
# test access by dict of dicts
self.assertEqual(theme['first depth']['second depth'], [0, 0, 0, 0])
# test access by path
path = ['first depth', 'second depth']
self.assertEqual(theme[path], [0, 0, 0, 0])
def test_update(self):
theme = Theme({'first depth': {
'second depth': [0, 0, 0, 0]
}}, 'some_path')
update = {'first depth': {'second depth': [1, 1, 1, 1]}}
theme.update(update)
# test the theme was updated
path = ['first depth', 'second depth']
self.assertEqual(theme[path], [1, 1, 1, 1])
def test_update_depth(self):
theme = Theme({'first depth': {
'second depth': [0, 0, 0, 0]
}}, 'some_path')
update = {'first depth': {'other second depth': [1, 1, 1, 1]}}
theme.update(update)
# test that theme was updated
path = ['first depth', 'other second depth']
self.assertEqual(theme[path], [1, 1, 1, 1])
def test_load_texture(self):
theme = Theme({'first depth': {'image': 'panel.png'}}, 'theme')
# panel is an 32x32 image.
self.assertEqual(theme['first depth']['image'].width, 32)
self.assertEqual(theme['first depth']['image'].height, 32)
def test_load_texture_with_dictionary(self):
theme = Theme({'first depth': {'image': {'source': 'panel.png'}}}, 'theme')
# panel is a 32x32 image.
self.assertEqual(theme['first depth']['image'].width, 32)
self.assertEqual(theme['first depth']['image'].height, 32)
def test_load_texture_with_region(self):
theme = Theme(
{'first depth':
{'image':
{'source': 'panel.png', 'region': [0, 0, 16, 16]}
}
}, 'theme')
# region is a 16x16 image.
self.assertEqual(theme['first depth']['image'].width, 16)
self.assertEqual(theme['first depth']['image'].height, 16)
def test_load_frame(self):
theme = Theme(
{'first depth':
{'image':
{'source': 'panel.png', 'frame': [8, 8, 16, 16]}
}
}, 'theme')
# panel is an 32x32 image.
self.assertEqual(theme['first depth']['image'].width, 32)
self.assertEqual(theme['first depth']['image'].height, 32)
def test_update_with_texture(self):
theme = Theme({'first depth': {'image': 'panel.png'}}, 'theme')
update = {'first depth':
{'image':
{'source': 'panel.png', 'region': [0, 0, 16, 16]}
}
}
theme.update(update)
# update is to a 16x16 image.
self.assertEqual(theme['first depth']['image'].width, 16)
self.assertEqual(theme['first depth']['image'].height, 16)
class TestLoadGraphics(unittest.TestCase):
def setUp(self):
self.batch = pyglet.graphics.Batch()
self.group = pyglet.graphics.OrderedGroup(1)
self.texture_theme = Theme({'image': 'panel.png'}, 'theme')
self.texture_region_theme = Theme({'image': {'source': 'panel.png', 'region': [0, 0, 16, 16]}}, 'theme')
self.frame_theme = Theme({'image': {'source': 'panel.png', 'frame': [8, 8, 16, 16]}}, 'theme')
def test_load_texture(self):
texture = self.texture_theme['image'].generate(color=[255, 255, 255, 255],
batch=self.batch,
group=self.group)
self.batch.draw()
self.assertEqual(texture.width, 32)
self.assertEqual(texture.height, 32)
def test_load_texture_region(self):
texture = self.texture_region_theme['image'].generate(color=[255, 255, 255, 255],
batch=self.batch,
group=self.group)
self.batch.draw()
self.assertEqual(texture.width, 16)
self.assertEqual(texture.height, 16)
def test_load_frame(self):
texture = self.frame_theme['image'].generate(color=[255, 255, 255, 255],
batch=self.batch,
group=self.group)
self.batch.draw()
self.assertEqual(texture.width, 32)
self.assertEqual(texture.height, 32)
if __name__ == "__main__":
unittest.main()
| 33.703448 | 112 | 0.526294 | 544 | 4,887 | 4.643382 | 0.137868 | 0.098971 | 0.112827 | 0.118765 | 0.758116 | 0.733175 | 0.700713 | 0.683294 | 0.683294 | 0.61441 | 0 | 0.04697 | 0.324739 | 4,887 | 144 | 113 | 33.9375 | 0.718485 | 0.067526 | 0 | 0.602151 | 0 | 0 | 0.160079 | 0 | 0 | 0 | 0 | 0 | 0.215054 | 1 | 0.129032 | false | 0 | 0.032258 | 0 | 0.182796 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d67b3df3e39047245d408df7c537579d39529dc0 | 1,493 | py | Python | src/eduid_webapp/email/tests/test_msgs.py | SUNET/eduid-webapp | 8e531f288d50d18a5c9182003fff2ab6670a44c3 | [
"BSD-3-Clause"
] | null | null | null | src/eduid_webapp/email/tests/test_msgs.py | SUNET/eduid-webapp | 8e531f288d50d18a5c9182003fff2ab6670a44c3 | [
"BSD-3-Clause"
] | 161 | 2017-04-13T07:56:38.000Z | 2021-03-12T13:46:38.000Z | src/eduid_webapp/email/tests/test_msgs.py | SUNET/eduid-webapp | 8e531f288d50d18a5c9182003fff2ab6670a44c3 | [
"BSD-3-Clause"
] | 3 | 2016-05-16T20:25:49.000Z | 2018-07-27T12:10:58.000Z | # -*- coding: utf-8 -*-
import unittest
from eduid_webapp.email.helpers import EmailMsg
class MessagesTests(unittest.TestCase):
def test_messages(self):
""""""
self.assertEqual(EmailMsg.missing.value, 'emails.missing')
self.assertEqual(EmailMsg.dupe.value, 'emails.duplicated')
self.assertEqual(EmailMsg.get_success.value, 'emails.get-success')
self.assertEqual(EmailMsg.throttled.value, 'emails.throttled')
self.assertEqual(EmailMsg.still_valid_code.value, 'still-valid-code')
self.assertEqual(EmailMsg.added_and_throttled.value, 'emails.added-and-throttled')
self.assertEqual(EmailMsg.saved.value, 'emails.save-success')
self.assertEqual(EmailMsg.unconfirmed_not_primary.value, 'emails.unconfirmed_address_not_primary')
self.assertEqual(EmailMsg.success_primary.value, 'emails.primary-success')
self.assertEqual(EmailMsg.invalid_code.value, 'emails.code_invalid_or_expired')
self.assertEqual(EmailMsg.unknown_email.value, 'emails.unknown_email')
self.assertEqual(EmailMsg.verify_success.value, 'emails.verification-success')
self.assertEqual(EmailMsg.cannot_remove_last.value, 'emails.cannot_remove_unique')
self.assertEqual(EmailMsg.cannot_remove_last_verified.value, 'emails.cannot_remove_unique_verified')
self.assertEqual(EmailMsg.removal_success.value, 'emails.removal-success')
self.assertEqual(EmailMsg.code_sent.value, 'emails.code-sent')
| 55.296296 | 108 | 0.752847 | 171 | 1,493 | 6.385965 | 0.298246 | 0.21978 | 0.336996 | 0.137363 | 0.124542 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0.000769 | 0.1286 | 1,493 | 26 | 109 | 57.423077 | 0.838586 | 0.014066 | 0 | 0 | 0 | 0 | 0.248634 | 0.155738 | 0 | 0 | 0 | 0 | 0.8 | 1 | 0.05 | false | 0 | 0.1 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
d6827d53a57a53b1ec64a21a653d40c5fb972bff | 7,255 | py | Python | modules/test_print.py | bq666/Simnigma | b2f59fff24b33eb97077ad50a5376cf3a24b8911 | [
"Unlicense"
] | null | null | null | modules/test_print.py | bq666/Simnigma | b2f59fff24b33eb97077ad50a5376cf3a24b8911 | [
"Unlicense"
] | null | null | null | modules/test_print.py | bq666/Simnigma | b2f59fff24b33eb97077ad50a5376cf3a24b8911 | [
"Unlicense"
] | null | null | null | import decimal
from math import log
from modules.__tools_single import bcolors, generate_from_64b_inter_key
from modules.tools import check_text_const, check_rand_rotors, check_patterns, \
check_all_patterns, calc_number_comb, print_long, key_from_64b_to_dec
def test_print(rotors, key_enc = [], key_dec = [], text_before = [], text_encrypt = [], text_decrypt = [],
show_all=False, show_first=False, show_short=False, show_calc=False, show_uni=False, max_print_length = 110,
min_print_length=15, space = 47):
key_enc_before = key_enc[:]
key_dec_before = key_dec[:]
if isinstance(key_enc, str):
key_enc = generate_from_64b_inter_key(key_enc, rotors)
if isinstance(key_dec, str):
key_dec = generate_from_64b_inter_key(key_dec, rotors)
# Checked length of the pattern
key = key_enc if key_enc else key_dec
cal_pattern_length = calc_number_comb(rotors, key)
if show_all or show_first:
# Print rotors
print_long("Rotor", rotors, min_print_length, max_print_length)
# Print keys
if key_enc_before and isinstance(key_enc_before, list): print_long("Encrypt key", key_enc, min_print_length, max_print_length, False)
if key_enc_before and isinstance(key_enc_before, str): print_long("Enc. key in Uni", '[' + key_enc_before + ']', min_print_length, max_print_length, False)
if key_dec_before and isinstance(key_dec_before, list): print_long("Decrypt key", key_dec, min_print_length, max_print_length, False)
if key_dec_before and isinstance(key_dec_before, str): print_long("Dec. key in Uni", '[' + key_dec_before + ']', min_print_length, max_print_length, False)
if key_enc_before: print_long("Enc. int. key", key_enc, min_print_length, max_print_length, False)
if key_dec_before: print_long("Dec. int. key", key_dec, min_print_length, max_print_length, False)
# Print texts before, encrypt and decrypt
if text_before:
if (show_uni == False): print_long("Text before", text_before, min_print_length, max_print_length, False)
if (show_uni == True): print_long("Text be. in Uni", [chr(a) for a in text_before ], 15, max_print_length, False)
if text_encrypt:
if (show_uni == False): print_long("Text encrypt", text_encrypt, min_print_length, max_print_length, False)
if (show_uni == True): print_long("Text en. in Uni", [chr(a) for a in text_encrypt], 15, max_print_length, False)
if text_decrypt:
if (show_uni == False): print_long("Text decrypt", text_decrypt, min_print_length, max_print_length, False)
if (show_uni == True): print_long("Text de. in Uni", [chr(a) for a in text_decrypt], 15, max_print_length, False)
if show_all or show_short:
# Print short rotors info
print("Rotors size in bit:" + " " * (space - 19), "[" + str(int(log(len(rotors[0]), 2))) + " bit]")
print("Rotors, number existing:" + " " * (space - 24), "[" + str(len(rotors)) + " rotors]")
key_len = len(key_enc) if key_enc else len(key_dec)
for i in range(len(rotors), 0, -1):
if key_len % i == 0:
print("Rotors, number used:" + " " * (space - 20), "[" + str(i) + " rotors]")
print("Number of passes:" + " " * (space - 17), "[" + str(key_len // i) + " passes]")
break
print("Rotors, number of key-val:" + " " * (space - 26), "[" + format(decimal.Decimal(len(rotors[0])), '.2E') + "]")
if check_rand_rotors(rotors):
print("Minimum value in rotor:" + " " * (space - 22) + "[" + str(min(rotors[0])) + " min]")
print("Maximum value in rotor:" + " " * (space - 22) + "[" + str(max(rotors[0])) + " max]")
print("Equality test of rotors:" + " " * (space - 23) + "[" + bcolors.BOLD + "PASS" + bcolors.ENDC + "]")
if check_rand_rotors(rotors):
print("Randomness and integrity rotor test:" + " " * (space - 35) + "[" + bcolors.BOLD + "PASS" + bcolors.ENDC + "]")
else:
print("Randomness and integrity rotor test:" + " " * (space - 35) + "[" + bcolors.WARNING + bcolors.BOLD + "FAIL" + bcolors.ENDC + "]")
else:
print("Minimum value in rotor:" + " " * (space - 22) + "[" + str(min(rotors[0])) + " min]")
print("Maximum value in rotor:" + " " * (space - 22) + "[" + str(max(rotors[0])) + " max]")
print("Equality test of rotors:" + " " * (space - 23) + "[" + bcolors.BOLD + bcolors.ORANGE + "FAIL" + bcolors.ENDC + "[")
# Print short keys info
key_len_before = len(key_enc_before) if key_enc_before else len(key_dec_before)
key = key_enc_before if key_enc_before else key_dec_before
print("Key len. in bit:" + " " * (space - 15) + "[" + str(int(log(key_from_64b_to_dec(key), 2))) + " bit]")
print("Key len. in num. el.:" + " " * (space - 20) + "[" + format(decimal.Decimal(key_len_before), '.2E') + "]")
print("Key int. len. in num. el.:" + " " * (space - 25) + "[" + format(decimal.Decimal(key_len), '.2E') + "]")
if (key_enc) and (key_dec):
print("Key the same:" + " " * (space - 12) + "[" + bcolors.BOLD + "PASS" + bcolors.ENDC + "]") if (key_enc == key_dec) else \
print("Key the same:" + " " * (space - 12) + "[" + bcolors.ORANGE + "FAIL" + bcolors.ENDC + "]")
# Print short text info
print("Text before length:" + " " * (space - 18) + "[" + format(decimal.Decimal(len(text_before or text_encrypt)), '.2E') + "]")
print("Text before constant:" + " " * (space - 20) + "[{}]".format("Yes" if check_text_const(text_before or text_encrypt) else "No"))
if show_all or show_calc:
if text_before != [] and check_text_const(text_before):
if len(text_encrypt) > cal_pattern_length * 3:
patterns_over = check_patterns(text_encrypt, cal_pattern_length // 2, 1, True)
check_all_patterns(text_encrypt, 4, patterns_over[0][0] -1 , 3, 2, patterns_over, True)
name = "Calculated and checked pattern test:"
if cal_pattern_length == patterns_over[0][0]:
print(name + " " * (space - 35) + "[" + bcolors.BOLD + "PASS" + bcolors.ENDC + "]")
else:
print(name + " " * (space - 35) + "[" + bcolors.BOLD + bcolors.WARNING + "FAIL" + bcolors.ENDC + "]")
else:
print("Patterns over:" + " " * (space - 13) + "[Text to short]")
# Calculated number of combination
cal_name_length = "Calculated number of combination:" + " " * (space - 32)
print(cal_name_length + "[" + format(decimal.Decimal(cal_pattern_length), '.2E') + "]")
# Encrypt and decrypt tests
if text_before and text_decrypt:
if ((text_before != text_encrypt) and (text_before == text_decrypt) and (key_enc == key_dec)) or \
((text_before != text_encrypt) and (text_before != text_decrypt) and (key_enc != key_dec)):
print("Encrypt, decrypt and keys test:" + " " * (space - 30) + "[" +bcolors.BOLD + "PASS" + bcolors.ENDC + "]")
else:
if ((text_before != text_encrypt) and (text_before != text_decrypt) and (key_enc == key_dec)):
print("Decrypt test:" + " " * (
space - 12) + "[" + bcolors.WARNING + bcolors.BOLD + "FAIL" + bcolors.ENDC + "]")
else:
if ((text_before != text_encrypt) and (text_before == text_decrypt) and (key_enc != key_dec)):
print("Keys test:" + " " * (
space - 9) + '[' + bcolors.WARNING + bcolors.BOLD + "FAIL" + bcolors.ENDC + "]")
else:
if (text_before == text_encrypt):
print("Encrypt test:" + " " * (
space - 12) + '[' + bcolors.WARNING + bcolors.BOLD + "FAIL" + bcolors.ENDC + "]")
print("-" * max_print_length)
| 59.467213 | 157 | 0.647553 | 1,042 | 7,255 | 4.25144 | 0.119962 | 0.037923 | 0.047404 | 0.051467 | 0.569752 | 0.493905 | 0.432731 | 0.373589 | 0.338826 | 0.285779 | 0 | 0.017707 | 0.182633 | 7,255 | 121 | 158 | 59.958678 | 0.729342 | 0.030324 | 0 | 0.135417 | 1 | 0 | 0.139075 | 0 | 0.010417 | 0 | 0 | 0 | 0 | 1 | 0.010417 | false | 0.0625 | 0.041667 | 0 | 0.052083 | 0.479167 | 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 | 0 | 1 | 0 | 3 |
d6b46a10bec4cd6109fb16dd3ac3f3ddcff81ed0 | 729 | py | Python | src/config/security.py | mmozos/eguraldia | a815c681b5cf73827e3576b1e10cf10bf148fe8a | [
"MIT"
] | null | null | null | src/config/security.py | mmozos/eguraldia | a815c681b5cf73827e3576b1e10cf10bf148fe8a | [
"MIT"
] | null | null | null | src/config/security.py | mmozos/eguraldia | a815c681b5cf73827e3576b1e10cf10bf148fe8a | [
"MIT"
] | 1 | 2020-11-02T13:04:49.000Z | 2020-11-02T13:04:49.000Z |
from os import getenv
class Config:
SECURITY_PASSWORD_HASH = getenv(key='SECURITY_PASSWORD_HASH', default='bcrypt')
# Bcrypt is set as default SECURITY_PASSWORD_HASH, which requires a salt
SECURITY_PASSWORD_SALT = getenv(key='SECURITY_PASSWORD_SALT',
default='246157207206506313353540320087937723641')
SECURITY_CHANGEABLE = getenv(key='SECURITY_CHANGEABLE', default=True)
SECURITY_CONFIRMABLE = getenv(key='SECURITY_CONFIRMABLE', default=True)
SECURITY_REGISTERABLE = getenv(key='SECURITY_REGISTERABLE', default=True)
SECURITY_RECOVERABLE = getenv(key='SECURITY_RECOVERABLE', default=True)
SECURITY_TRACKABLE = getenv(key='SECURITY_TRACKABLE', default=True)
| 48.6 | 86 | 0.754458 | 78 | 729 | 6.794872 | 0.333333 | 0.118868 | 0.224528 | 0.09434 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.063622 | 0.159122 | 729 | 14 | 87 | 52.071429 | 0.800979 | 0.096022 | 0 | 0 | 0 | 0 | 0.285061 | 0.158537 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.2 | 0.1 | 0 | 0.9 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
d6b5dae25349a6ef2ba50209569450072b8a0722 | 106 | py | Python | lambdata_maxim371/df_utils.py | maxim371/lambdata | 9ce0e01761ade03599ddaa1a4dd7b362e1d6f914 | [
"MIT"
] | null | null | null | lambdata_maxim371/df_utils.py | maxim371/lambdata | 9ce0e01761ade03599ddaa1a4dd7b362e1d6f914 | [
"MIT"
] | 3 | 2020-03-24T18:11:14.000Z | 2021-02-02T22:44:31.000Z | lambdata_maxim371/df_utils.py | maxim371/lambdata | 9ce0e01761ade03599ddaa1a4dd7b362e1d6f914 | [
"MIT"
] | null | null | null | '''
utility functions for working with Dataframes
'''
import pandas
TEST_DF = pandas.DataFrame([1,2,3])
| 13.25 | 45 | 0.726415 | 15 | 106 | 5.066667 | 0.933333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032967 | 0.141509 | 106 | 7 | 46 | 15.142857 | 0.802198 | 0.424528 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
d6b6bb85de8c20eb5a2ae542aa1c390eb465b07b | 3,583 | py | Python | LDSReplicate/lds/ESRIDataStore.py | josephramsay/LDS | 8ee2bafc5fa69d47a9460d5920fc39cd2514a97f | [
"PostgreSQL"
] | 1 | 2018-09-08T02:04:17.000Z | 2018-09-08T02:04:17.000Z | LDSReplicate/lds/ESRIDataStore.py | linz/lds_replicate | 38fb97b075a5c5b97c69a640241d7b8d01f015c5 | [
"PostgreSQL"
] | null | null | null | LDSReplicate/lds/ESRIDataStore.py | linz/lds_replicate | 38fb97b075a5c5b97c69a640241d7b8d01f015c5 | [
"PostgreSQL"
] | null | null | null | '''
v.0.0.9
LDSReplicate - ESRIDataStore
Copyright 2011 Crown copyright (c)
Land Information New Zealand and the New Zealand Government.
All rights reserved
This program is released under the terms of the new BSD license. See the
LICENSE file for more information.
ESRI specific DS class super classing ESRI based data formats including FileGDB, ShapeFile and ArcSDE wrapping calls to DS to intercept
cases requiring special handling
Created on 9/08/2012
@author: jramsay
'''
from lds.DataStore import DataStore
from lds.ProjectionReference import Projection
from lds.LDSUtilities import LDSUtilities
#from osr import SpatialReference
from abc import ABCMeta, abstractmethod
ldslog = LDSUtilities.setupLogging()
class ESRIDataStore(DataStore):
'''
ESRI Specific superclass primarily used to do OSGEO to ESRI SpatialReference transformations
'''
__metaclass__ = ABCMeta
def __init__(self,conn_str=None,user_config=None):
super(ESRIDataStore,self).__init__(conn_str,user_config)
def sourceURI(self,layer):
'''URI method for returning source calls private subclass common URI method'''
return self._commonURI(layer)
def destinationURI(self,layer):
'''URI method for returning destination calls private subclass common URI method'''
return self._commonURI(layer)
@abstractmethod
def _commonURI(self,layer):
'''Use common uri for src and dst'''
#raise NotImplementedError("No common URI method for ESRI stack, implement at type level")
def write(self,src_ds,dsn,layername,sixtyfour):
'''ESRI specific write method used as entry point for convertDataSourceESRI'''
'''TODO. No need to do the poly to multi conversion but incremental __change__ removal still reqd'''
#naive implementation? change SR per layer in place. Conversion not needed with latest GDAL
#self.convertDataSourceESRI(src_ds.ds)
super(ESRIDataStore,self).write(src_ds,dsn,layername,sixtyfour)
#self.ds = self.driver.CopyDataSource(src_ds, dsn)
def convertDataSourceESRI(self,datasource):
#TODO layer by name fetching
#bypassed when using gdal 1.9.2 since FileGDB SREF handling, its supposed to be fixed now
'''Spatial Reference method to "Morph" datasource layer by layer, in place'''
for li in range(0,datasource.GetLayerCount()):
layer = datasource.GetLayer(li)
sref = layer.GetSpatialRef()
ldslog.debug("Original DS SR ::\nname={}\nlayerdefn={}\ngeocolumn={}\nspatialref={}".format(layer.GetName(),layer.GetLayerDefn(),layer.GetGeometryColumn(),sref))
#Method 1 + repaste authority + rename to an esri spec
ac = sref.GetAuthorityCode('GEOGCS')
sref.MorphToESRI()
sref.SetAuthority("GEOGCS","EPSG",int(ac))
sref = Projection.modifyMorphedSpatialReference(sref)
##Method 2
#sref = Projection.downloadESRISpatialReference(sref.GetAuthorityCode('GEOGCS'))
ldslog.debug("Converted DS SR ::\n"+str(sref))
return datasource
def getLayerOptions(self,layer_id):
'''Direct push through to super since no pan-ESRI specific options'''
return super(ESRIDataStore,self).getLayerOptions(layer_id)
def getConfigOptions(self):
'''Direct push through to super'''
return super(ESRIDataStore,self).getConfigOptions()
| 36.561224 | 173 | 0.683505 | 415 | 3,583 | 5.831325 | 0.486747 | 0.018595 | 0.036364 | 0.014876 | 0.114876 | 0.073554 | 0.04876 | 0.04876 | 0.04876 | 0.04876 | 0 | 0.007291 | 0.23444 | 3,583 | 98 | 174 | 36.561224 | 0.874954 | 0.430366 | 0 | 0.0625 | 0 | 0 | 0.05606 | 0.028831 | 0 | 0 | 0 | 0.010204 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0 | 0.59375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
d6d89818aca7151e360186e7f012f6313b5b66c0 | 1,063 | py | Python | src/main/python/storage/var/jsonpath.py | ettoreleandrotognoli/py-storage | d19a0ccbbb23aed818461775a9fc3cd7c5cc25fa | [
"Apache-2.0"
] | null | null | null | src/main/python/storage/var/jsonpath.py | ettoreleandrotognoli/py-storage | d19a0ccbbb23aed818461775a9fc3cd7c5cc25fa | [
"Apache-2.0"
] | 4 | 2021-04-13T20:43:11.000Z | 2021-04-13T22:47:56.000Z | src/main/python/storage/var/jsonpath.py | ettoreleandrotognoli/py-storage | d19a0ccbbb23aed818461775a9fc3cd7c5cc25fa | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import abc
from typing import Any, Iterable
import jsonpath_ng
from storage.var import BaseVar
class JsonPath(BaseVar[Any, Any]):
json_path: Any
def __init__(self, json_path):
self.json_path = json_path
@classmethod
def from_str(cls, json_path: str):
return cls(jsonpath_ng.parse(json_path))
def find(self, item):
return [match.value for match in self.json_path.find(item)]
@abc.abstractmethod
def __call__(self, item: Any) -> Any:
raise NotImplementedError()
@staticmethod
def array(json_path: str) -> JsonPath:
return ArrayJsonPath.from_str(json_path)
@staticmethod
def single(json_path: str) -> JsonPath:
return SingleJsonPath.from_str(json_path)
class ArrayJsonPath(JsonPath):
def __call__(self, item: Any) -> Iterable[Any]:
return self.find(item)
class SingleJsonPath(JsonPath):
def __call__(self, item: Any) -> Any:
for item in self.find(item):
return item
return None
| 21.693878 | 67 | 0.675447 | 136 | 1,063 | 5.014706 | 0.294118 | 0.129032 | 0.052786 | 0.065982 | 0.184751 | 0.111437 | 0 | 0 | 0 | 0 | 0 | 0 | 0.233302 | 1,063 | 48 | 68 | 22.145833 | 0.83681 | 0 | 0 | 0.129032 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.258065 | false | 0 | 0.16129 | 0.16129 | 0.774194 | 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 |
ba77f17fcec374b24e127286f25faac3b2e0ab43 | 257 | py | Python | source/inter.py | PangPangPangPangPang/webapp | fa8d8b55071acaa65ee07f0be201173e2aaf6584 | [
"MIT"
] | null | null | null | source/inter.py | PangPangPangPangPang/webapp | fa8d8b55071acaa65ee07f0be201173e2aaf6584 | [
"MIT"
] | null | null | null | source/inter.py | PangPangPangPangPang/webapp | fa8d8b55071acaa65ee07f0be201173e2aaf6584 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 11/10/2016 6:32 PM
# @Author : Max
# @File : inter.py
from flask import Blueprint
main = Blueprint('inter', __name__)
from . import error, refresh, md, list, article, chat, register, update
| 19.769231 | 71 | 0.642023 | 37 | 257 | 4.351351 | 0.891892 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.058252 | 0.198444 | 257 | 12 | 72 | 21.416667 | 0.723301 | 0.416342 | 0 | 0 | 0 | 0 | 0.034483 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0.666667 | 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 | 0 | 1 | 1 | 0 | 3 |
ba82cb11f98fee13020c1dbf5e30885cf15d5451 | 2,219 | py | Python | napari_imc/models/imc_file_panorama.py | neuromusic/napari-imc | ce2ff998b33b49f19a786585cc2cb8e59db74c24 | [
"MIT"
] | 4 | 2021-01-29T15:11:37.000Z | 2021-03-01T02:04:24.000Z | napari_imc/models/imc_file_panorama.py | neuromusic/napari-imc | ce2ff998b33b49f19a786585cc2cb8e59db74c24 | [
"MIT"
] | 25 | 2021-01-19T01:49:13.000Z | 2022-02-09T10:46:41.000Z | napari_imc/models/imc_file_panorama.py | neuromusic/napari-imc | ce2ff998b33b49f19a786585cc2cb8e59db74c24 | [
"MIT"
] | 3 | 2021-01-29T17:31:05.000Z | 2022-03-25T10:23:32.000Z | from napari.layers import Image
from typing import Any, List, Optional, TYPE_CHECKING
from napari_imc.models.base import IMCFileTreeItem, ModelBase
if TYPE_CHECKING:
from napari_imc.models.imc_file import IMCFileModel
class IMCFilePanoramaModel(ModelBase, IMCFileTreeItem):
imc_file_tree_is_checkable = True
def __init__(self, imc_file: 'IMCFileModel', id_: int, image_type: Optional[str],
description: str):
ModelBase.__init__(self)
IMCFileTreeItem.__init__(self)
self._imc_file = imc_file
self._id = id_
self._image_type = image_type
self._description = description
self._shown_layer: Optional[Image] = None
self._is_shown = False
@property
def imc_file(self) -> 'IMCFileModel':
return self._imc_file
@property
def id(self) -> int:
return self._id
@property
def image_type(self):
return self._image_type
@property
def description(self) -> str:
return self._description
@property
def shown_layer(self) -> Optional[Image]:
return self._shown_layer
@property
def is_shown(self) -> bool:
return self._is_shown
@property
def _imc_file_tree_data(self) -> List[Any]:
return [self.is_shown, f'P{self.id:02d}', self.description]
@property
def _imc_file_tree_parent(self) -> Optional[IMCFileTreeItem]:
return self._imc_file.imc_file_tree_panorama_root_item
@property
def _imc_file_tree_children(self) -> List[IMCFileTreeItem]:
return []
@property
def imc_file_tree_is_checked(self) -> bool:
return self.is_shown
def set_shown(self, layer: Image):
self._shown_layer = layer
self._is_shown = True
def set_hidden(self):
self._shown_layer = None
self._is_shown = False
def __eq__(self, other):
if other is None or not isinstance(other, IMCFilePanoramaModel):
return False
return other._imc_file == self._imc_file and other._id == self._id
def __hash__(self):
return hash((self._imc_file, self._id))
def __repr__(self):
return f'{self._imc_file} P{self._id:02d}'
| 27.060976 | 85 | 0.665164 | 281 | 2,219 | 4.86121 | 0.209964 | 0.087116 | 0.056369 | 0.065886 | 0.20205 | 0.081991 | 0 | 0 | 0 | 0 | 0 | 0.002392 | 0.246507 | 2,219 | 81 | 86 | 27.395062 | 0.814593 | 0 | 0 | 0.196721 | 0 | 0 | 0.031546 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.262295 | false | 0 | 0.065574 | 0.196721 | 0.590164 | 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 |
ba8439e5b769bbff8d801b340d75f885ef2ac752 | 53 | py | Python | labfunctions/__version__.py | dymaxionlabs/nb_workflows | 336e4d83dd5f8a7edfbaacfa426b23a42c0a68a9 | [
"Apache-2.0"
] | null | null | null | labfunctions/__version__.py | dymaxionlabs/nb_workflows | 336e4d83dd5f8a7edfbaacfa426b23a42c0a68a9 | [
"Apache-2.0"
] | null | null | null | labfunctions/__version__.py | dymaxionlabs/nb_workflows | 336e4d83dd5f8a7edfbaacfa426b23a42c0a68a9 | [
"Apache-2.0"
] | null | null | null | __version__ = "0.8.0-alpha.8"
__api_version__ = "v1"
| 17.666667 | 29 | 0.698113 | 9 | 53 | 3.111111 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.106383 | 0.113208 | 53 | 2 | 30 | 26.5 | 0.489362 | 0 | 0 | 0 | 0 | 0 | 0.283019 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ba8739f296428df529df12b6dceaf84bea70fa82 | 309 | py | Python | source_code/day017/question.py | Zapdos26-Forks/100daysofcode | 2220985abc1c6aeca3a89a19a84813f1a7a816a8 | [
"MIT"
] | null | null | null | source_code/day017/question.py | Zapdos26-Forks/100daysofcode | 2220985abc1c6aeca3a89a19a84813f1a7a816a8 | [
"MIT"
] | null | null | null | source_code/day017/question.py | Zapdos26-Forks/100daysofcode | 2220985abc1c6aeca3a89a19a84813f1a7a816a8 | [
"MIT"
] | null | null | null | class Question:
def __init__(self, q_text, q_answer):
self._text = q_text
self._answer = q_answer
@property
def text(self):
return self._text
@text.setter
def text(self, d):
self._text = d
@property
def answer(self):
return self._answer
| 17.166667 | 41 | 0.582524 | 40 | 309 | 4.175 | 0.3 | 0.143713 | 0.131737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.326861 | 309 | 17 | 42 | 18.176471 | 0.802885 | 0 | 0 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.307692 | false | 0 | 0 | 0.153846 | 0.538462 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
ba9012b01e84a28169721921f9f5712ced85362d | 7,749 | py | Python | EZChannel/EZChannel.py | KeltontheConqueror/EZChannel | 4378697edd1520056e87589a5d93e0943307b4e2 | [
"MIT"
] | null | null | null | EZChannel/EZChannel.py | KeltontheConqueror/EZChannel | 4378697edd1520056e87589a5d93e0943307b4e2 | [
"MIT"
] | null | null | null | EZChannel/EZChannel.py | KeltontheConqueror/EZChannel | 4378697edd1520056e87589a5d93e0943307b4e2 | [
"MIT"
] | null | null | null | import discord
import urllib.parse
import random
from datetime import datetime
from discord.ext import commands
############################################Case_insensitive MASSIVELY REDUCES PERFORMANCE ||| line 5
client = commands.Bot(command_prefix = 'ez-', case_insensitive=True)
modeenabled = 0
textts = False
f=open("Files/Bot_key.txt", "r")#API Key Referencing
if f.mode == 'r':
key =f.read()
print(key)
@client.event
async def on_ready(): #Sets status as well as notifies user of bot activity
print('We have logged in as {0.user}'.format(client))
await client.change_presence(status=discord.Status.online, activity=discord.Game('ez-help')) #Set status
now = datetime.now().time() # time object
print("now =", now,)
@client.event #Server join message
async def on_guild_join(guild): #Thanks to the GitHub user 0xicl33n for this code!
for channel in guild.text_channels:
if channel.permissions_for(guild.me).send_messages:
await channel.send('Hey there! For a list of commands please type ez-help. \nPlease remember that this bot is a work in progress and some commands may not work properly yet! \nTo enable Text-to-Speech mode type ez-tts')
break
@client.command()
async def Register(ctx): #Allows registration for the economy aspect of the bot
"""Work in progress"""
author = ctx.message.author
print (author)
registry= open('author', "w+")#I TXT FILE IS IN NORMAL AREA FIX ASAP.
registry.write('Test')
registry.close()
@client.command()
async def code(ctx): #Github link to the Github repository or user
"""Shows a Github link to code"""
global textts
if textts == True:
await ctx.send('I am coded by Kelton the Conqueror. Here is his GitHub!', tts=True)
await ctx.send ('https://github.com/KeltontheConqueror/')
else:
await ctx.send('I am coded by Kelton the Conqueror. Here is his GitHub!')
await ctx.send ('https://github.com/KeltontheConqueror/')
@client.command()
async def tts(ctx): #Bot will read out most responses
"""Makes bot respond with text-to-speech messages"""
print ("TTS On")
global textts
if textts == False:
textts = True
await ctx.send('TTS mode enabled')
elif textts == True:
textts = False
await ctx.send('TTS mode disabled')
else:
await ctx.send('Error code 1 see (readme for details)')
@client.command()
async def breakfast(ctx): #Pretty self explanitory
"""Shows you what to eat for breakfast"""
eat = ['Waffels','Panckakes','Toast', 'Eggs','Cereal','Yogurt','Oatmeal/Poridge',]
await ctx.send ('Eat some'); await ctx.send (random.choice(eat))
@client.command()
async def search(ctx, *, searchquery: str): #Shows a tutorial on how to use google
'''Google anything. (Big thanks to the GitHub user AlexApps99 for this awesome and funny script!)'''
await ctx.send('<https://lmgtfy.com/?iie=1&q={}>'
.format(urllib.parse.quote_plus(searchquery)))
@client.command()
async def devmode(ctx): #Allows commands that require Dev Mode to be True
"""Enables Dev Mode"""
global modeenabled
if (modeenabled == 0):
modeenabled = 1
await ctx.send('Dev Mode On')
else:
modeenabled = 0
await ctx.send('Dev Mode Off')
@client.command() # Pings the console for troubleshooting
async def consoleping(ctx):
"""Pings developer console"""
global modeenabled
if (modeenabled == 1):
print (f'Pong! {round(client.latency * 1000)}ms')
await ctx.send ('Console Pinged')
else:
await ctx.send ('Enable Dev Mode with ez-devmode')
@client.command() #Simple code with arrays/lists to give a drop spot in Fortnite Battle Royale
async def fortniteroulette(ctx):
"""Gives a random drop spot and weapon"""
location = ['Pleasent_Park','Steamy_Stacks','Sweaty_Sands','Salty_Springs','The_Authority','Frenzy_Farm','Holly_Hedges','Lazy_Lake','Retail_Row','The_Yacht','The_Fortilla','Rickety_Rig','Misty_Meadows','Catty_Corner','A_Random_House_In_The_Middle_Of_Nowhere']
weapon = ['AR','Shotgun','SMG','Sniper','Harpoon','Pistol','Pickaxe_Only']
await ctx.send('Land at '); await ctx.send (random.choice(location))
await ctx.send('\nYou can only use '); await ctx.send(random.choice(weapon))
@client.command()
async def pi(ctx): #Pretty self explanitory
"""Shows pi in 17 digits. because why not?"""
await ctx.send(3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148086513282306647093844609550582231725359408128481117450284102701938521105559644622948954930381964428810975665933446128475648233786783165271201909145648566923460348610454326648213393607260249141273724587006606315588174881520920962829254091715364367892590360011330530548820466521384146951941511609433057270365759591953092186117381932611793105118548074462379962749567351885752724891227938183011949129833673362440656643086021394946395224737190702179860943702770539217176293176752384674818467669405132000568127145263560827785771342757789609173637178721468440901224953430146549585371050792279689258923542019956112129021960864034418159813629774771309960518707211349999998372978049951059731732816096318595024459455346908302642522308253344685035261931188171010003137838752886587533208381420617177669147303598253490428755468731159562863882353787593751957781857780532171226806613001927876611195909216420198938095257201065485863278865936153381827968230301952035301852968995773622599413891249721775283479131515574857242454150695950829533116861727855889075098381754637464939319255060400927701671139009848824012858361603563707660104710181942955596198946767837449448255379774726847104047534646208046684259069491293313677028989152104752162056966024058038150193511253382430035587640247496473263914199272604269922796782354781636009341721641219924586315030286182974555706749838505494588586926995690927210797509302955321165344987202755960236480665499119881834797753566369807426542527862551818417574672890977772793800081647060016145249192173217214772350141441973568548161361157352552133475741849468438523323907394143334547762416862518983569485562099219222184272550254256887671790494601653466804988627232791786085784383827967976681454100953883786360950680064225125205117392984896084128488626945604241965285022210661186306744278622039194945047123713786960956364371917287467764657573962413890865832645995813390478027590)
@client.command() #Unfair Russian Roulette
async def roulette(ctx):
"""Good ol' Russian Roulette"""
outcomes=['Death','Coma','Lost Limbs','Winner']
await ctx.send(random.choice(outcomes))
@client.command() #Sends the latency to the discord chat and provides a way to test bot activity
async def ping(ctx):
"""Shows latency in Miliseconds"""
await ctx.send(f'Pong! {round(client.latency * 1000)}ms')
@client.command() #Purges a text channel of messages
async def purge(ctx, amount=500000000000000000000000000000000000000000000000):
"""Purges channel of messages. examples|| ez-purge, ez-purge 5"""
global textts
await ctx.channel.purge(limit=amount)
if textts == False:
await ctx.send ('Channel purged. (use the command ez-tts to turn on voice notifications for this event)')
elif textts == True:
await ctx.send ('Channel purged.',tts=True)
else:
await ctx.send ('Error code 2 (See readme for details)')
#Code that I got from tutorials and am keeping for reference.
#region
#Code for creating an alias
# @client.command(aliases=['8ball'])
# async def _8ball(ctx, *, question):
# responses = []
#endregion
client.run(key)
| 47.833333 | 2,020 | 0.757775 | 799 | 7,749 | 7.305382 | 0.386733 | 0.034264 | 0.04934 | 0.025184 | 0.116498 | 0.052424 | 0.043858 | 0.018845 | 0.018845 | 0.018845 | 0 | 0.313349 | 0.145438 | 7,749 | 161 | 2,021 | 48.130435 | 0.568106 | 0.123371 | 0 | 0.326923 | 0 | 0.009615 | 0.194136 | 0.01305 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.048077 | 0 | 0.048077 | 0.057692 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ba97bfd299b14c0ffbc1830e2d6b43d302fa30f2 | 88 | py | Python | venv/Lib/site-packages/threading_sched/version.py | jhonniel/Queuing-python | 1b117dc7e4b3274b2f8fe72cce4beea363f563ef | [
"MIT"
] | null | null | null | venv/Lib/site-packages/threading_sched/version.py | jhonniel/Queuing-python | 1b117dc7e4b3274b2f8fe72cce4beea363f563ef | [
"MIT"
] | null | null | null | venv/Lib/site-packages/threading_sched/version.py | jhonniel/Queuing-python | 1b117dc7e4b3274b2f8fe72cce4beea363f563ef | [
"MIT"
] | null | null | null | __version_info__ = ( 1, 0, 0 )
__version__ = '.'.join( map( str, __version_info__ ))
| 29.333333 | 55 | 0.636364 | 11 | 88 | 3.818182 | 0.636364 | 0.52381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042254 | 0.193182 | 88 | 2 | 56 | 44 | 0.549296 | 0 | 0 | 0 | 0 | 0 | 0.011364 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
ba9890a5566b5edf4981cab5bd5a2b3dc59a2b7b | 179 | py | Python | stardust_xr/utils.py | technobaboo/stardust-py | 65239711832367dea4163f7535fcd8bc5bdb3123 | [
"MIT"
] | null | null | null | stardust_xr/utils.py | technobaboo/stardust-py | 65239711832367dea4163f7535fcd8bc5bdb3123 | [
"MIT"
] | null | null | null | stardust_xr/utils.py | technobaboo/stardust-py | 65239711832367dea4163f7535fcd8bc5bdb3123 | [
"MIT"
] | 1 | 2020-07-08T16:33:25.000Z | 2020-07-08T16:33:25.000Z | import time
def benchmark(func):
def wrapper(*arg):
t = time.time()
res = func(*arg)
print("Function took",(time.time()-t),"seconds to run")
return res
return wrapper
| 16.272727 | 57 | 0.659218 | 27 | 179 | 4.37037 | 0.592593 | 0.135593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178771 | 179 | 10 | 58 | 17.9 | 0.802721 | 0 | 0 | 0 | 0 | 0 | 0.150838 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.125 | 0 | 0.625 | 0.125 | 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 |
baa2e98208045b602bdc5b218e376180aec24a82 | 110 | py | Python | tworaven_apps/datamart_endpoints/apps.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 20 | 2017-12-11T07:26:06.000Z | 2021-11-22T16:16:20.000Z | tworaven_apps/datamart_endpoints/apps.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 849 | 2017-10-20T18:21:18.000Z | 2022-02-18T02:45:44.000Z | tworaven_apps/datamart_endpoints/apps.py | TwoRavens/TwoRavens | e5f820557d6646df525ceed15e17d79f4159cf0a | [
"Apache-2.0"
] | 1 | 2020-05-18T06:02:13.000Z | 2020-05-18T06:02:13.000Z | from django.apps import AppConfig
class DatamartEndpointsConfig(AppConfig):
name = 'datamart_endpoints'
| 18.333333 | 41 | 0.8 | 11 | 110 | 7.909091 | 0.909091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.136364 | 110 | 5 | 42 | 22 | 0.915789 | 0 | 0 | 0 | 0 | 0 | 0.163636 | 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 |
bad35f66e84809bc27c4e013f7fe36d0b2166e7b | 110 | py | Python | NoteBooks/Curso de Python/Python/Core/Funciones de orden superior/H_Order_function.py | Alejandro-sin/Learning_Notebooks | 161d6bed4c7b1d171b45f61c0cc6fa91e9894aad | [
"MIT"
] | 1 | 2021-02-26T13:12:22.000Z | 2021-02-26T13:12:22.000Z | NoteBooks/Curso de Python/Python/Core/Funciones de orden superior/H_Order_function.py | Alejandro-sin/Learning_Notebooks | 161d6bed4c7b1d171b45f61c0cc6fa91e9894aad | [
"MIT"
] | null | null | null | NoteBooks/Curso de Python/Python/Core/Funciones de orden superior/H_Order_function.py | Alejandro-sin/Learning_Notebooks | 161d6bed4c7b1d171b45f61c0cc6fa91e9894aad | [
"MIT"
] | null | null | null | def say_(func):
func()
def hi():
print("Hello")
# Estoy pasando hi como argumento de say_
say_(hi)
| 11 | 41 | 0.627273 | 17 | 110 | 3.882353 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.236364 | 110 | 9 | 42 | 12.222222 | 0.785714 | 0.354545 | 0 | 0 | 0 | 0 | 0.072464 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0 | 0.4 | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
baec52bcb8062eda0e345ce20953171e06698036 | 264 | py | Python | testbed_module/setup.py | Suyi32/George-private | 1a7b3a20da309318dc0b5415547fa6a5f6c331d3 | [
"Apache-2.0"
] | null | null | null | testbed_module/setup.py | Suyi32/George-private | 1a7b3a20da309318dc0b5415547fa6a5f6c331d3 | [
"Apache-2.0"
] | null | null | null | testbed_module/setup.py | Suyi32/George-private | 1a7b3a20da309318dc0b5415547fa6a5f6c331d3 | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="testbedlib",
packages=find_packages(include=["testbedlib", "testbedlib.simulator", "testbedlib.util"]),
version="0.1.0",
description="Testbed library",
author="Suyi",
license="MIT",
) | 29.333333 | 94 | 0.693182 | 29 | 264 | 6.241379 | 0.724138 | 0.132597 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013333 | 0.147727 | 264 | 9 | 95 | 29.333333 | 0.791111 | 0 | 0 | 0 | 0 | 0 | 0.309434 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.111111 | 0 | 0.111111 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
baf17cfcc687221af116bb04bf0a4df83be4363b | 505 | py | Python | online_news/online_newsapp/admin.py | parthapaulpartha/Online_NEWS | 6e1bb620aa809371ea04fc5d8c4a81ec2fcdbb78 | [
"bzip2-1.0.6"
] | 1 | 2020-02-18T16:21:49.000Z | 2020-02-18T16:21:49.000Z | online_news/online_newsapp/admin.py | parthapaulpartha/Online_NEWS | 6e1bb620aa809371ea04fc5d8c4a81ec2fcdbb78 | [
"bzip2-1.0.6"
] | null | null | null | online_news/online_newsapp/admin.py | parthapaulpartha/Online_NEWS | 6e1bb620aa809371ea04fc5d8c4a81ec2fcdbb78 | [
"bzip2-1.0.6"
] | null | null | null | from django.contrib import admin
from .models import (
bangla_newspaper,
english_newspaper,
job_website,
magazines,
indian_bangla_newspaper,
news_channel,
note
)
# Register your models here.
admin.site.site_header = 'Online NEWS'
admin.site.register(bangla_newspaper)
admin.site.register(english_newspaper)
admin.site.register(job_website)
admin.site.register(magazines)
admin.site.register(indian_bangla_newspaper)
admin.site.register(news_channel)
admin.site.register(note) | 24.047619 | 44 | 0.790099 | 65 | 505 | 5.938462 | 0.338462 | 0.186529 | 0.30829 | 0.202073 | 0.165803 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.120792 | 505 | 21 | 45 | 24.047619 | 0.869369 | 0.051485 | 0 | 0 | 0 | 0 | 0.023013 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.111111 | 0 | 0.111111 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0305b39f1f8b6df84256a2c4f181322e25eb2960 | 188 | py | Python | vscode/themes.py | SkullCrusher0003/vscode-ext | b258416738bb7102abc38587a2fc3521596c63aa | [
"MIT"
] | 1 | 2021-07-29T15:07:12.000Z | 2021-07-29T15:07:12.000Z | vscode/themes.py | SohamGhugare/vscode-ext | 90d9a1bcfbdad98f07a52ea06149064af91aa9d7 | [
"MIT"
] | null | null | null | vscode/themes.py | SohamGhugare/vscode-ext | 90d9a1bcfbdad98f07a52ea06149064af91aa9d7 | [
"MIT"
] | null | null | null | class ColorTheme:
def __init__(self, name: str, display_name: str, version: str):
self.name = name
self.display_name = display_name
self.version = version
| 31.333333 | 68 | 0.638298 | 23 | 188 | 4.913043 | 0.391304 | 0.292035 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.276596 | 188 | 5 | 69 | 37.6 | 0.830882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0 | 0.4 | 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 |
030d37a16fce289d9ce3c6fd696b897ec9ff3e04 | 114 | py | Python | lib/vitals.py | underc0de/reaper | ec74c8de08a57edfd4df745aad9c8c216c57f9d8 | [
"MIT"
] | null | null | null | lib/vitals.py | underc0de/reaper | ec74c8de08a57edfd4df745aad9c8c216c57f9d8 | [
"MIT"
] | null | null | null | lib/vitals.py | underc0de/reaper | ec74c8de08a57edfd4df745aad9c8c216c57f9d8 | [
"MIT"
] | null | null | null | class Vitals:
LEARNING_RATE = 0.1
MOMENTUM_RATE = 0.8
FIRST_LAYER = 5 * 7
SECOND_LAYER = 14
OUTPUT_LAYER = 3 | 16.285714 | 20 | 0.710526 | 20 | 114 | 3.8 | 0.8 | 0.131579 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 0.210526 | 114 | 7 | 21 | 16.285714 | 0.744444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
030d54f033ccfcb59d30da67a9724e0289928dc4 | 295 | py | Python | EX./ex019.py | CamposRodrigo/Python | 0c9a2214f710b76e012abbf8ea082a302f3f11f3 | [
"MIT"
] | null | null | null | EX./ex019.py | CamposRodrigo/Python | 0c9a2214f710b76e012abbf8ea082a302f3f11f3 | [
"MIT"
] | null | null | null | EX./ex019.py | CamposRodrigo/Python | 0c9a2214f710b76e012abbf8ea082a302f3f11f3 | [
"MIT"
] | null | null | null | import random
n1 = str(input('Nome do primeiro Aluno: '))
n2 = str(input('Nome do segundo Aluno: '))
n3 = str(input('Nome do terceiro Aluno: '))
n4 = str(input('Nome do quarto Aluno: '))
lista = [n1,n2,n3,n4]
escolhido = random.choice(lista)
print('O Aluno escolhido foi {} .'.format(escolhido)) | 36.875 | 53 | 0.684746 | 46 | 295 | 4.391304 | 0.478261 | 0.158416 | 0.237624 | 0.277228 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031496 | 0.138983 | 295 | 8 | 53 | 36.875 | 0.76378 | 0 | 0 | 0 | 0 | 0 | 0.402027 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0.125 | 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 |
030db12ae0d37eae77cc91e52a6e0f792431ca90 | 619 | py | Python | tests/test_models.py | istrategylabs/django-flashbriefing | aa446393bc0045b03a6f56cf6550c3ba6372f926 | [
"MIT"
] | null | null | null | tests/test_models.py | istrategylabs/django-flashbriefing | aa446393bc0045b03a6f56cf6550c3ba6372f926 | [
"MIT"
] | 3 | 2021-03-18T20:41:13.000Z | 2021-06-10T17:25:44.000Z | tests/test_models.py | tortillagroup/django-flashbriefing | aa446393bc0045b03a6f56cf6550c3ba6372f926 | [
"MIT"
] | 1 | 2019-10-07T20:53:22.000Z | 2019-10-07T20:53:22.000Z | import datetime
import pytest
from flashbriefing.models import Feed, Item, ItemType
@pytest.mark.django_db
def test_item_type_audio():
feed = Feed.objects.create(title='FEED')
item = Item.objects.create(
feed=feed, title='ITEM', audio_content='/audio.mp3',
published_date=datetime.datetime.utcnow())
assert item.item_type == ItemType.AUDIO
@pytest.mark.django_db
def test_item_type_text():
feed = Feed.objects.create(title='FEED')
item = Item.objects.create(
feed=feed, title='ITEM', published_date=datetime.datetime.utcnow())
assert item.item_type == ItemType.TEXT
| 28.136364 | 75 | 0.720517 | 83 | 619 | 5.216867 | 0.313253 | 0.073903 | 0.073903 | 0.083141 | 0.748268 | 0.748268 | 0.748268 | 0.748268 | 0.595843 | 0.595843 | 0 | 0.001912 | 0.155089 | 619 | 21 | 76 | 29.47619 | 0.826004 | 0 | 0 | 0.375 | 0 | 0 | 0.042003 | 0 | 0 | 0 | 0 | 0 | 0.125 | 1 | 0.125 | false | 0 | 0.1875 | 0 | 0.3125 | 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 |
030ef0f92fdcae92ef41829011796fcd9b2bfa3e | 305 | py | Python | src/aleph/vms/register.py | olethanh/pyaleph | 3a64fb89c54e74187679872d559fb00be0dfde43 | [
"MIT"
] | null | null | null | src/aleph/vms/register.py | olethanh/pyaleph | 3a64fb89c54e74187679872d559fb00be0dfde43 | [
"MIT"
] | null | null | null | src/aleph/vms/register.py | olethanh/pyaleph | 3a64fb89c54e74187679872d559fb00be0dfde43 | [
"MIT"
] | null | null | null | # We will register here processors for the message types by name
VM_ENGINE_REGISTER = dict()
def register_vm_engine(engine_name, engine_class):
""" Verifies a message is valid before forwarding it,
handling it (should it be different?).
"""
VM_ENGINE_REGISTER[engine_name] = engine_class | 33.888889 | 64 | 0.75082 | 44 | 305 | 4.977273 | 0.613636 | 0.109589 | 0.146119 | 0.191781 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.177049 | 305 | 9 | 65 | 33.888889 | 0.87251 | 0.498361 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
03157f8f37176b764a56f1b77f4436069ef2eec9 | 1,117 | py | Python | CorbanDallas1982/Home_work_5/HW_5_1.py | kolyasalubov/Lv-639.pythonCore | 06f10669a188318884adb00723127465ebdf2907 | [
"MIT"
] | null | null | null | CorbanDallas1982/Home_work_5/HW_5_1.py | kolyasalubov/Lv-639.pythonCore | 06f10669a188318884adb00723127465ebdf2907 | [
"MIT"
] | null | null | null | CorbanDallas1982/Home_work_5/HW_5_1.py | kolyasalubov/Lv-639.pythonCore | 06f10669a188318884adb00723127465ebdf2907 | [
"MIT"
] | null | null | null | print('C L A S S I C S O L U T I O N')
range_of_numbers = []
div_by_2 = []
div_by_3 = []
other_numbers = []
for i in range(1,11):
range_of_numbers.append(i)
if i%2 == 0:
div_by_2.append(i)
elif i%3 == 0:
div_by_3.append(i)
else:
other_numbers.append(i)
print('The range of numbers is: ', range_of_numbers)
print('')
print('The even numbers that are divisible by 2: ',div_by_2)
print('The odd numbers, which are divisible by 3: ', div_by_3)
print('The numbers, that are not divisible by 2 and 3: ', other_numbers)
print('')
print('')
print('L I S T C O M P R E H E N S I O N')
range_of_numbers = [i for i in range (1, 11)]
div_by_2 = [i for i in range (1, 11) if i % 2 == 0 ]
div_by_3 = [i for i in range (1, 11) if i % 2 == 1 and i % 3 == 0]
other_numbers = [i for i in range (1, 11) if i % 2 == 1 and i % 3 == 1]
print('The range of numbers is: ', range_of_numbers)
print('')
print('The even numbers that are divisible by 2: ',div_by_2)
print('The odd numbers, which are divisible by 3: ', div_by_3)
print('The numbers, that are not divisible by 2 and 3: ', other_numbers) | 37.233333 | 72 | 0.639212 | 234 | 1,117 | 2.901709 | 0.179487 | 0.073638 | 0.14433 | 0.081001 | 0.77025 | 0.77025 | 0.686303 | 0.686303 | 0.643594 | 0.643594 | 0 | 0.054273 | 0.224709 | 1,117 | 30 | 73 | 37.233333 | 0.729792 | 0 | 0 | 0.4 | 0 | 0 | 0.341682 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.466667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
03248661a61e374ad91904ea10b15947df4ba5da | 353 | py | Python | convert_eprime/__init__.py | PAmcconnell/convert-eprime | 620f46bba42474c471595d5d4a56e7c755359800 | [
"MIT"
] | 34 | 2015-01-23T20:48:31.000Z | 2022-01-25T15:54:33.000Z | convert_eprime/__init__.py | PAmcconnell/convert-eprime | 620f46bba42474c471595d5d4a56e7c755359800 | [
"MIT"
] | 7 | 2016-04-11T21:39:12.000Z | 2020-05-18T13:46:31.000Z | convert_eprime/__init__.py | PAmcconnell/convert-eprime | 620f46bba42474c471595d5d4a56e7c755359800 | [
"MIT"
] | 18 | 2015-01-23T20:48:18.000Z | 2022-03-11T14:50:43.000Z | # emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
"""
convert_eprime: A Python package for converting and cleaning up E-Prime output files.
"""
from .convert import etext_to_rcsv, text_to_csv, text_to_rcsv
from .version import __version__
__all__ = ['convert', 'utils']
| 35.3 | 93 | 0.70255 | 57 | 353 | 4.087719 | 0.701754 | 0.051502 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016892 | 0.161473 | 353 | 9 | 94 | 39.222222 | 0.77027 | 0.580737 | 0 | 0 | 0 | 0 | 0.092308 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 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 |
032588d229048b1d209738283c2518d0fe131994 | 163 | py | Python | exe025.py | libaniaraujo/Python-Curso-em-Video | 593ddbbbdf1e83101f535228fa05351f35b8817f | [
"MIT"
] | null | null | null | exe025.py | libaniaraujo/Python-Curso-em-Video | 593ddbbbdf1e83101f535228fa05351f35b8817f | [
"MIT"
] | null | null | null | exe025.py | libaniaraujo/Python-Curso-em-Video | 593ddbbbdf1e83101f535228fa05351f35b8817f | [
"MIT"
] | null | null | null | # Procurando uma string dentro de outra
nome = str(input('Qual é o seu nome completo? ')).strip()
print('Seu nome tem Silva? {}'.format('silva' in nome.lower())) | 40.75 | 63 | 0.687117 | 26 | 163 | 4.307692 | 0.807692 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147239 | 163 | 4 | 63 | 40.75 | 0.805755 | 0.226994 | 0 | 0 | 0 | 0 | 0.448 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
035c8f49e4213f64f129836af02d4bd7fa55b659 | 174 | py | Python | swe/numerics/LaxFriedrichs.py | VTrappler/SWE1D | ed19be4c0d37441f0f312baa403f368bb2c3afba | [
"MIT"
] | null | null | null | swe/numerics/LaxFriedrichs.py | VTrappler/SWE1D | ed19be4c0d37441f0f312baa403f368bb2c3afba | [
"MIT"
] | null | null | null | swe/numerics/LaxFriedrichs.py | VTrappler/SWE1D | ed19be4c0d37441f0f312baa403f368bb2c3afba | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def LF_flux(FL, FR, lmax, lmin, UR, UL, dt, dx):
ctilde = dx / dt
return 0.5 * (FL + FR) - 0.5 * ctilde * (UR - UL)
| 17.4 | 53 | 0.511494 | 31 | 174 | 2.83871 | 0.709677 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03937 | 0.270115 | 174 | 9 | 54 | 19.333333 | 0.653543 | 0.241379 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 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 |
0373642685a010e54d70484159e45e1edf2c54f9 | 92 | py | Python | turtle_maze/maze_test.py | ehabosaleh/random-maze | 8aa5e8c447a5707ad41e44e141be7e9e931c6da4 | [
"MIT"
] | null | null | null | turtle_maze/maze_test.py | ehabosaleh/random-maze | 8aa5e8c447a5707ad41e44e141be7e9e931c6da4 | [
"MIT"
] | null | null | null | turtle_maze/maze_test.py | ehabosaleh/random-maze | 8aa5e8c447a5707ad41e44e141be7e9e931c6da4 | [
"MIT"
] | null | null | null | from maze import Maze
m=Maze(10,500,500,"green","Black",2.5)
print("Press any key to exit")
| 23 | 38 | 0.706522 | 19 | 92 | 3.421053 | 0.842105 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121951 | 0.108696 | 92 | 3 | 39 | 30.666667 | 0.670732 | 0 | 0 | 0 | 0 | 0 | 0.336957 | 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 |
0378136b90eceb75708747531943798ac3c3ef75 | 427 | py | Python | fastats/maths/__init__.py | AaronCritchley/fastats | 3c8e50fffc08ee0dd44c615f4ed93adc47c08ffe | [
"MIT"
] | 26 | 2017-07-17T09:19:53.000Z | 2021-11-30T01:36:56.000Z | fastats/maths/__init__.py | AaronCritchley/fastats | 3c8e50fffc08ee0dd44c615f4ed93adc47c08ffe | [
"MIT"
] | 320 | 2017-09-02T16:26:25.000Z | 2021-07-28T05:19:49.000Z | fastats/maths/__init__.py | AaronCritchley/fastats | 3c8e50fffc08ee0dd44c615f4ed93adc47c08ffe | [
"MIT"
] | 13 | 2017-07-06T19:02:29.000Z | 2020-01-22T11:36:34.000Z |
from fastats.maths.activations import relu, softplus
from fastats.maths.deriv import deriv
from fastats.maths.erf import erf
from fastats.maths.ewma import ewma
from fastats.maths.logistic import logistic
from fastats.maths.norm_pdf import norm_pdf
from fastats.maths.sum_sq_dev import sum_sq_dev
__all__ = [
'deriv',
'erf',
'ewma',
'logistic',
'norm_pdf',
'sum_sq_dev',
'relu',
'softplus',
]
| 21.35 | 52 | 0.725995 | 61 | 427 | 4.868852 | 0.278689 | 0.259259 | 0.377104 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175644 | 427 | 19 | 53 | 22.473684 | 0.84375 | 0 | 0 | 0 | 0 | 0 | 0.117371 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.411765 | 0 | 0.411765 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
30004c4cf42235b14fe0b487f19797ab65d32df3 | 923 | py | Python | ulang/parser/expression.py | nint8835/ulang | 8ab74c79d104490a46c76f879374b3128b4b61d7 | [
"MIT"
] | null | null | null | ulang/parser/expression.py | nint8835/ulang | 8ab74c79d104490a46c76f879374b3128b4b61d7 | [
"MIT"
] | null | null | null | ulang/parser/expression.py | nint8835/ulang | 8ab74c79d104490a46c76f879374b3128b4b61d7 | [
"MIT"
] | null | null | null | from typing import List
class Expression:
def evaluate(self):
raise NotImplementedError()
class LiteralExpression(Expression):
def __init__(self, value):
self.value = value
def evaluate(self):
return self.value
class FunctionExpression(Expression):
def __init__(self, name: str, parameters: List[str], children: List[Expression]):
self.name = name
self.parameters = parameters
self.children = children
def evaluate(self):
raise NotImplementedError()
def __str__(self) -> str:
return f"""Function {self.name}
Parameters: {self.parameters}
Body: {self.children}"""
class VariableExpression(Expression):
def __init__(self, name: str):
self.name = name
def evaluate(self):
raise NotImplementedError()
def __str__(self) -> str:
return f"Variable {self.name}"
__repr__ = __str__
| 21.465116 | 85 | 0.650054 | 97 | 923 | 5.896907 | 0.268041 | 0.083916 | 0.104895 | 0.104895 | 0.372378 | 0.304196 | 0.206294 | 0.206294 | 0.206294 | 0.206294 | 0 | 0 | 0.248104 | 923 | 42 | 86 | 21.97619 | 0.824207 | 0 | 0 | 0.392857 | 0 | 0 | 0.108342 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.321429 | false | 0 | 0.035714 | 0.107143 | 0.642857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3049df22c14ab821ddbbf8c94b66a6a728e08a01 | 306 | py | Python | ConditionalStatement/BonusScore.py | Rohitm619/Softuni-Python-Basic | 03c9d0b44f5652c99db3b0e42014dd5af50205a2 | [
"MIT"
] | 1 | 2020-09-22T13:25:34.000Z | 2020-09-22T13:25:34.000Z | ConditionalStatement/BonusScore.py | Rohitm619/Softuni-Python-Basic | 03c9d0b44f5652c99db3b0e42014dd5af50205a2 | [
"MIT"
] | null | null | null | ConditionalStatement/BonusScore.py | Rohitm619/Softuni-Python-Basic | 03c9d0b44f5652c99db3b0e42014dd5af50205a2 | [
"MIT"
] | 1 | 2020-10-17T09:27:46.000Z | 2020-10-17T09:27:46.000Z | number = int(input())
bonus_points = 0
if number <= 100:
bonus_points += 5
elif number > 1000:
bonus_points += number * 0.10
else:
bonus_points += number * 0.20
if number % 2 == 0:
bonus_points += 1
if number % 10 == 5:
bonus_points += 2
print(bonus_points)
print(bonus_points + number) | 21.857143 | 33 | 0.647059 | 47 | 306 | 4.042553 | 0.361702 | 0.463158 | 0.268421 | 0.189474 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.092827 | 0.22549 | 306 | 14 | 34 | 21.857143 | 0.708861 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 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 |
30679faeb02c7f4d5a0cd40a5229289fd6c4e411 | 1,008 | py | Python | src/handler.py | huynonstop/pokemon-index | d7a983f640f8b17d7d752814db15ec16afe096c4 | [
"MIT"
] | null | null | null | src/handler.py | huynonstop/pokemon-index | d7a983f640f8b17d7d752814db15ec16afe096c4 | [
"MIT"
] | null | null | null | src/handler.py | huynonstop/pokemon-index | d7a983f640f8b17d7d752814db15ec16afe096c4 | [
"MIT"
] | null | null | null | from pandas import DataFrame
class Handler:
@staticmethod
def pkdex(pokedex_df: DataFrame, name):
return pokedex_df[pokedex_df['name'].str.startswith(name)]
@staticmethod
def type(types_df: DataFrame, *t):
rs = types_df.loc[:, list(t)]
rs.loc[:, 'total'] = rs.prod(axis=1)
return rs.sort_index().sort_values(by=['total'], ascending=False)
@staticmethod
def move(moves_df: DataFrame, t):
return moves_df[moves_df['type'] == t].sort_values(by=['type_damage'])
@staticmethod
def item(item_df: DataFrame, name):
return item_df[item_df['name'].str.startswith(name)].sort_values(by=['cat', 'name'])
@staticmethod
def ability(pokedex_df: DataFrame, name):
return pokedex_df[pokedex_df['ability_1'].str.startswith(name) | pokedex_df['ability_2'].str.startswith(name)]
@staticmethod
def ability_name(ab_df: DataFrame, name):
return ab_df[ab_df['name'].str.startswith(name)].sort_values(by=['gen'])
| 33.6 | 118 | 0.666667 | 137 | 1,008 | 4.708029 | 0.291971 | 0.097674 | 0.131783 | 0.130233 | 0.356589 | 0.251163 | 0.251163 | 0.251163 | 0.142636 | 0 | 0 | 0.003628 | 0.179563 | 1,008 | 29 | 119 | 34.758621 | 0.7763 | 0 | 0 | 0.272727 | 0 | 0 | 0.064484 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0 | 0.045455 | 0.227273 | 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 |
306d76ac5978de92ef0f14f794b88d8d9f05aacd | 9,265 | py | Python | SEAGeneratorExampleKafkaStreamingAPI/src/python/sea_generator_rpcdesign_pb2_grpc.py | PenHsuanWang/IncrementalLearningE2EPlayground | c22708bdf4dd4ba8770dafe6e85f0481b34030fd | [
"Apache-2.0"
] | null | null | null | SEAGeneratorExampleKafkaStreamingAPI/src/python/sea_generator_rpcdesign_pb2_grpc.py | PenHsuanWang/IncrementalLearningE2EPlayground | c22708bdf4dd4ba8770dafe6e85f0481b34030fd | [
"Apache-2.0"
] | null | null | null | SEAGeneratorExampleKafkaStreamingAPI/src/python/sea_generator_rpcdesign_pb2_grpc.py | PenHsuanWang/IncrementalLearningE2EPlayground | c22708bdf4dd4ba8770dafe6e85f0481b34030fd | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
import sea_generator_rpcdesign_pb2 as sea__generator__rpcdesign__pb2
class SEAOnlineTrainingStub(object):
"""Missing associated documentation comment in .proto file."""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.test_connection = channel.unary_unary(
'/seagenerator.SEAOnlineTraining/test_connection',
request_serializer=sea__generator__rpcdesign__pb2.testConnectString.SerializeToString,
response_deserializer=sea__generator__rpcdesign__pb2.testConnectString.FromString,
)
self.learn_one = channel.unary_unary(
'/seagenerator.SEAOnlineTraining/learn_one',
request_serializer=sea__generator__rpcdesign__pb2.learnOneRequest.SerializeToString,
response_deserializer=sea__generator__rpcdesign__pb2.learnOneReply.FromString,
)
self.predict_one = channel.unary_unary(
'/seagenerator.SEAOnlineTraining/predict_one',
request_serializer=sea__generator__rpcdesign__pb2.predictOneRequest.SerializeToString,
response_deserializer=sea__generator__rpcdesign__pb2.predictOneReply.FromString,
)
self.flush_model = channel.unary_unary(
'/seagenerator.SEAOnlineTraining/flush_model',
request_serializer=sea__generator__rpcdesign__pb2.flushModelRequest.SerializeToString,
response_deserializer=sea__generator__rpcdesign__pb2.flushModelReply.FromString,
)
self.extract_model = channel.unary_unary(
'/seagenerator.SEAOnlineTraining/extract_model',
request_serializer=sea__generator__rpcdesign__pb2.extractModelRequest.SerializeToString,
response_deserializer=sea__generator__rpcdesign__pb2.extractModelReply.FromString,
)
class SEAOnlineTrainingServicer(object):
"""Missing associated documentation comment in .proto file."""
def test_connection(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def learn_one(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def predict_one(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def flush_model(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def extract_model(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_SEAOnlineTrainingServicer_to_server(servicer, server):
rpc_method_handlers = {
'test_connection': grpc.unary_unary_rpc_method_handler(
servicer.test_connection,
request_deserializer=sea__generator__rpcdesign__pb2.testConnectString.FromString,
response_serializer=sea__generator__rpcdesign__pb2.testConnectString.SerializeToString,
),
'learn_one': grpc.unary_unary_rpc_method_handler(
servicer.learn_one,
request_deserializer=sea__generator__rpcdesign__pb2.learnOneRequest.FromString,
response_serializer=sea__generator__rpcdesign__pb2.learnOneReply.SerializeToString,
),
'predict_one': grpc.unary_unary_rpc_method_handler(
servicer.predict_one,
request_deserializer=sea__generator__rpcdesign__pb2.predictOneRequest.FromString,
response_serializer=sea__generator__rpcdesign__pb2.predictOneReply.SerializeToString,
),
'flush_model': grpc.unary_unary_rpc_method_handler(
servicer.flush_model,
request_deserializer=sea__generator__rpcdesign__pb2.flushModelRequest.FromString,
response_serializer=sea__generator__rpcdesign__pb2.flushModelReply.SerializeToString,
),
'extract_model': grpc.unary_unary_rpc_method_handler(
servicer.extract_model,
request_deserializer=sea__generator__rpcdesign__pb2.extractModelRequest.FromString,
response_serializer=sea__generator__rpcdesign__pb2.extractModelReply.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'seagenerator.SEAOnlineTraining', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class SEAOnlineTraining(object):
"""Missing associated documentation comment in .proto file."""
@staticmethod
def test_connection(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/seagenerator.SEAOnlineTraining/test_connection',
sea__generator__rpcdesign__pb2.testConnectString.SerializeToString,
sea__generator__rpcdesign__pb2.testConnectString.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def learn_one(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/seagenerator.SEAOnlineTraining/learn_one',
sea__generator__rpcdesign__pb2.learnOneRequest.SerializeToString,
sea__generator__rpcdesign__pb2.learnOneReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def predict_one(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/seagenerator.SEAOnlineTraining/predict_one',
sea__generator__rpcdesign__pb2.predictOneRequest.SerializeToString,
sea__generator__rpcdesign__pb2.predictOneReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def flush_model(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/seagenerator.SEAOnlineTraining/flush_model',
sea__generator__rpcdesign__pb2.flushModelRequest.SerializeToString,
sea__generator__rpcdesign__pb2.flushModelReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def extract_model(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/seagenerator.SEAOnlineTraining/extract_model',
sea__generator__rpcdesign__pb2.extractModelRequest.SerializeToString,
sea__generator__rpcdesign__pb2.extractModelReply.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
| 46.557789 | 112 | 0.682353 | 824 | 9,265 | 7.256068 | 0.131068 | 0.064225 | 0.112393 | 0.12845 | 0.847633 | 0.815855 | 0.670513 | 0.480515 | 0.443385 | 0.424318 | 0 | 0.004592 | 0.247814 | 9,265 | 198 | 113 | 46.792929 | 0.853351 | 0.074042 | 0 | 0.493827 | 1 | 0 | 0.089038 | 0.055046 | 0 | 0 | 0 | 0 | 0 | 1 | 0.074074 | false | 0 | 0.012346 | 0.030864 | 0.135802 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
30757d9f92f99ac68a0213312704eae898a738bb | 2,043 | py | Python | paddles/paddle_0402/config/paddle_configurator.py | dkeefe3773/pong-rl | e0d548267d7e0ca1b8690224cfd827af8ff571ab | [
"MIT"
] | null | null | null | paddles/paddle_0402/config/paddle_configurator.py | dkeefe3773/pong-rl | e0d548267d7e0ca1b8690224cfd827af8ff571ab | [
"MIT"
] | null | null | null | paddles/paddle_0402/config/paddle_configurator.py | dkeefe3773/pong-rl | e0d548267d7e0ca1b8690224cfd827af8ff571ab | [
"MIT"
] | null | null | null | from configparser import ConfigParser
from pathlib import Path
from typing import List, Any
true_path = Path(__file__).parent / 'config.ini'
_parser = ConfigParser()
_parser.read(str(true_path.resolve()), encoding='utf-8')
class Config(object):
@staticmethod
def get_property_string(section_name: str, property_name: str) -> Any:
return _parser.get(section_name, property_name)
@staticmethod
def get_property_int(section_name: str, property_name: str) -> Any:
return _parser.getint(section_name, property_name)
@staticmethod
def get_property_float(section_name: str, property_name: str) -> Any:
return _parser.getfloat(section_name, property_name)
@staticmethod
def get_property_bool(section_name: str, property_name: str) -> Any:
return _parser.getboolean(section_name, property_name)
class NmistRawAnnConfig(Config):
@property
def network_size(self) -> List[int]:
layer_size_string = Config.get_property_string('nmist_raw_ann', 'layer_sizes')
return eval(layer_size_string)
@property
def gradient_step_size(self) -> float:
return Config.get_property_float('nmist_raw_ann', 'gradient_step_size')
@property
def regularization_lambda(self) -> float:
return Config.get_property_float('nmist_raw_ann', 'regularization_lambda')
@property
def training_iterations(self) -> int:
return Config.get_property_int('nmist_raw_ann', 'num_training_iterations')
@property
def mini_batch_size(self) -> int:
return Config.get_property_int('nmist_raw_ann', 'mini_batch_size')
class TorchNMist(Config):
@property
def epochs(self) -> int:
return Config.get_property_int('torch_nmist', 'epochs')
@property
def batch_size(self) -> int:
return Config.get_property_int('torch_nmist', 'batch_size')
@property
def learning_rate(self) -> float:
return Config.get_property_float('torch_nmist', 'learning_rate')
nmist_raw_ann_config = NmistRawAnnConfig() | 31.430769 | 86 | 0.722956 | 257 | 2,043 | 5.392996 | 0.233463 | 0.095238 | 0.098124 | 0.116162 | 0.467532 | 0.467532 | 0.467532 | 0.440837 | 0.334776 | 0.132756 | 0 | 0.000594 | 0.176211 | 2,043 | 65 | 87 | 31.430769 | 0.822935 | 0 | 0 | 0.255319 | 0 | 0 | 0.112524 | 0.021526 | 0 | 0 | 0 | 0 | 0 | 1 | 0.255319 | false | 0 | 0.06383 | 0.234043 | 0.638298 | 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 |
307709a1b945d0fee23a51f07cec853768efc56e | 2,631 | py | Python | data_pipeline/stream/schema.py | iagcl/data_pipeline | b9b965d43a4261357e417f4eeee5d8b7d2dfd858 | [
"Apache-2.0"
] | 16 | 2017-10-31T21:43:26.000Z | 2019-08-11T08:49:06.000Z | data_pipeline/stream/schema.py | iagcl/data_pipeline | b9b965d43a4261357e417f4eeee5d8b7d2dfd858 | [
"Apache-2.0"
] | 1 | 2017-11-01T06:25:56.000Z | 2017-11-01T06:25:56.000Z | data_pipeline/stream/schema.py | iagcl/data_pipeline | b9b965d43a4261357e417f4eeee5d8b7d2dfd858 | [
"Apache-2.0"
] | 9 | 2017-10-30T05:23:15.000Z | 2022-02-17T03:53:09.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
import json
import avro
import requests
class SchemaRegistry:
def __init__(self, schema_registry_url):
self.schema_registry_url = schema_registry_url
def _url(self, path):
return "http://{}{}".format(self.schema_registry_url, path)
def get_schema(self, id=None, subject=None, version=None):
if id:
return requests.get(self._url('/schemas/ids/{}'.format(id)))
if subject and version:
return requests.get(self._url('/subjects/{}/versions/{}'
.format(subject, version)))
def get_subjects(self):
return requests.get(self._url('/subjects/'))
def get_versions(self, subject):
return requests.get(self._url('/subjects/{}/versions'.format(subject)))
def create_schema(self, subject, schema):
return requests.post(self._url('/subjects/{}/versions'
.format(subject)), json=schema)
def schema_exists(self, subject, schema):
return requests.post(self._url('/subjects/{}'
.format(subject)), json=schema)
def schema_compatible(self, subject, version, schema):
return requests.post(self._url(
'/compatibility/subjects/{}/versions/{}'
.format(subject, version)), json=schema)
def update_config(self, subject=None, config=None):
if subject:
return requests.put(self._url('/config/{}'
.format(subject)), json=config)
return requests.put(self._url('/config'), json=config)
def get_config(self, subject=None):
if subject:
url = self._url('/config/{}'.format(subject))
print(url)
return requests.get(url)
return requests.get(self._url('/config'))
| 37.585714 | 79 | 0.640821 | 319 | 2,631 | 5.184953 | 0.329154 | 0.093108 | 0.061669 | 0.063482 | 0.32104 | 0.242443 | 0.124547 | 0.124547 | 0.124547 | 0 | 0 | 0.002021 | 0.247815 | 2,631 | 69 | 80 | 38.130435 | 0.833754 | 0.286583 | 0 | 0.102564 | 0 | 0 | 0.100108 | 0.055974 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25641 | false | 0 | 0.076923 | 0.153846 | 0.666667 | 0.025641 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
0618bbf6069bd213b620fb4e894ba5c121c5517c | 52 | py | Python | python/testData/codeInsight/smartEnter/afterFunctionDecoratedWithExpressionContainingCollectionLiteral_after.py | alexey-anufriev/intellij-community | ffcd46f14e630acdefcc76e2bfc7c43d2449013a | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/codeInsight/smartEnter/afterFunctionDecoratedWithExpressionContainingCollectionLiteral_after.py | alexey-anufriev/intellij-community | ffcd46f14e630acdefcc76e2bfc7c43d2449013a | [
"Apache-2.0"
] | 1 | 2020-07-30T19:04:47.000Z | 2020-07-30T19:04:47.000Z | python/testData/codeInsight/smartEnter/afterFunctionDecoratedWithExpressionContainingCollectionLiteral_after.py | bradleesand/intellij-community | 750ff9c10333c9c1278c00dbe8d88c877b1b9749 | [
"Apache-2.0"
] | 1 | 2020-10-15T05:56:42.000Z | 2020-10-15T05:56:42.000Z | @(lambda: [lambda x: x][0])()
def foo():
<caret> | 17.333333 | 29 | 0.5 | 8 | 52 | 3.25 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02381 | 0.192308 | 52 | 3 | 30 | 17.333333 | 0.595238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
0625559250fa13a5e42c692ac0e5920fa3100ca9 | 34 | py | Python | athanor_info/__init__.py | volundmush/athanor_info | 32a5150b8ada311d498b1b0971e7f74ca1d98542 | [
"BSD-3-Clause"
] | null | null | null | athanor_info/__init__.py | volundmush/athanor_info | 32a5150b8ada311d498b1b0971e7f74ca1d98542 | [
"BSD-3-Clause"
] | null | null | null | athanor_info/__init__.py | volundmush/athanor_info | 32a5150b8ada311d498b1b0971e7f74ca1d98542 | [
"BSD-3-Clause"
] | null | null | null | INSTALLED_APPS = ["athanor_info"]
| 17 | 33 | 0.764706 | 4 | 34 | 6 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088235 | 34 | 1 | 34 | 34 | 0.774194 | 0 | 0 | 0 | 0 | 0 | 0.352941 | 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 |
062e91a059e6a771088a3208d7f8057f4620fd57 | 160 | py | Python | Implementations/Kattis/Impl-08/W8/3/C.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | Implementations/Kattis/Impl-08/W8/3/C.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | Implementations/Kattis/Impl-08/W8/3/C.py | MilladMuhammadi/Competitive-Programming | 9f84a2d2734a5efe0e1fde0062e51782cd5af2c6 | [
"MIT"
] | null | null | null | n,v = map(int,input().split())
mx = -1
for i in range(n):
l,w,h = map(int,input().split())
vo = l*w*h
#print(vo)
if vo>mx: mx = vo
print(mx - v) | 20 | 36 | 0.5125 | 34 | 160 | 2.411765 | 0.529412 | 0.146341 | 0.268293 | 0.390244 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008333 | 0.25 | 160 | 8 | 37 | 20 | 0.675 | 0.05625 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.142857 | 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 |
063f0f7111cd856c0a2d5158f8d297af410ead88 | 10,400 | py | Python | dsn/form_analysis/structure.py | expressionsofchange/nerf0 | 788203619fc89c92e8c7301d62bbc4f1f4ee66e1 | [
"MIT"
] | 2 | 2019-04-30T05:42:05.000Z | 2019-08-11T19:17:20.000Z | dsn/form_analysis/structure.py | expressionsofchange/nerf0 | 788203619fc89c92e8c7301d62bbc4f1f4ee66e1 | [
"MIT"
] | null | null | null | dsn/form_analysis/structure.py | expressionsofchange/nerf0 | 788203619fc89c92e8c7301d62bbc4f1f4ee66e1 | [
"MIT"
] | null | null | null | """
The structure described in the present file is the result of the very first phase of static analysis of an s-expression.
Staying true to the nature of this project, this analysis is done in terms of expressions of change on a given
s-expression. For simplicity's sake, let's however first consider what the analysis is in terms of a given (unchanging)
s-expression.
Given an s-expression which represents the whole program, we proceed in a top-down fashion and turn this s-expression
into a tree of lisp forms. In other words: we assign to the s-expression the meaning of a Lisp program. This must be
done in a top down fashion, because the meaning of lower s-expressions is fully determined by the meaning of their
ancestors. I.e. a list expression can be either the list of formal parameters of a lambda definition a list or a
function application, depending on whether it respectively appears as the first child of a lambda, inside a quote
expression or elsewhere.
As an example, consider how to evaulate the following s-expression, as it appears in a program:
(....... (a b) .........)
What is the meaning of (a b) in this expression? It depends on what's on the dots. Examples:
(lambda (a b) (* a b)) - it's the parameter-list part of a lambda-form
(quote (a b)) - it's a list of symbols
(a b) - it's the application of the procedure which is referenced by the symbol a on the symbol b.
So far we've talked about analysing given a given fixed s-expression. However, in actuality (and staying true to the
nature of the current project) this analysis is done in terms of changes to s-expressions. More precisely: in terms of
the result of a previous analysis and a change to an s-expression.
The change to a s-expression (the input to the present analysis) is described in the usual way: as an Insert / Delete /
Replace with relevant information about effects on children recursively expressed.
We note that a change to our children may affect the present form; as a particular example: the first child of a list
expression determines the form. If it's "lambda", "define", or "if" this affects the currently examined form. For such
form-changing changes, we do a full structural analysis of the subtree inasmuch as required.
E.g. if the first child becomes the symbol "lambda" we become a Lambda and consider the second child as a parameter list
and the third as a procedure body. If the change to the currently considered s-expression's does not change the
associated form, we simply recurse.
In principle this means that a single change can result in a full reanalysis of the program, e.g. by adding "quote" as
the first symbol of the root node program. In practice, most changes will result in a single traversal from the top of
the tree down to the affected leaf.
Finally, a few words about the chosen terminlogy.
In Lisp Forms are "any Lisp object that is intended to be evaluated". In the present set of files we additionally mean
"containing the relevant information on how this evaluation may take place given the object's position in the full
program tree".
We specifically did not choose "Abstract Syntax Tree", because that phrase does not tell us whether it's the abstract
syntax of s-expressions (the previous step of analysis) or the abstract syntax of forms (the current step). The phrase
"Intermediate Representation" was rejected as being too general.
Some people mean "Lisp Form" to be an implication of static correctness of the form. We don't do that, and instead say
that incorrect forms are a subset of forms. In other words: "those lisp objects that are intended to be evaluated, but
malformed".
We call the present phase "Static Form Analysis". This is more precise than the considered alternatives: "static
analysis" or "semantic analysis", of which the present phase is a part.
"""
from utils import pmts
from dsn.s_expr.structure import TreeText, TreeNode
class Form(object):
def __init__(self):
pass
def __repr__(self):
return repr(self.as_s_expr())
def as_s_expr(self):
"""(At least for now): for debugging purposes, i.e. not thoroughly implemented.
Prime example: The returned s_expr has no historic awareness (no nout_hash in the metadata).
"""
raise NotImplemented()
# TODO Open question: will we store any history in these Forms too? In the end: Probably we will. Compare what's done
# with the s-expressions themselves (which also do this)
class MalformedForm(Form):
# Potentially: also add various _specific_ malformednesses, like "Lambda with non-3 params", or "Lambda of which the
# parameter list is not a list of symbols.
# For now, the only actual malformed s-expression I can think of is: the empty list. One could also say: that's
# simply a case of an application without either a procedure nor any arguments. I.e. a non-3-lambda.
def as_s_expr(self):
# Note: the introduction of the `as_s_expr` method raises the following question: should the MalformedForm know
# what the underlying (malformed) s_expr is, so that it may reproduce that when asked? If we want Malformed
# s_expressions to be returned unchanged from as_s_expr(to_form(...)) we indeed need to store. For now, this
# isn't done.
return TreeText("MALFORMED", None)
def __eq__(self, other):
return isinstance(other, MalformedForm)
class VariableForm(Form):
def __init__(self, symbol):
pmts(symbol, Symbol)
self.symbol = symbol
def as_s_expr(self):
return TreeText(self.symbol.symbol, metadata=None)
def __eq__(self, other):
return isinstance(other, VariableForm) and self.symbol == other.symbol
class ValueForm(Form):
def __init__(self, type_, value):
self.type_ = type_
self.value = value
def as_s_expr(self):
return TreeText(repr(self.value), metadata=None)
def __eq__(self, other):
return isinstance(other, ValueForm) and self.type_ == other.type_ and self.value == other.value
class QuoteForm(Form):
def __init__(self, data):
self.data = data # :: SExpr
def as_s_expr(self):
return TreeNode([TreeText("quote", None), self.data])
def __eq__(self, other):
return isinstance(other, QuoteForm) and self.data == other.data
class IfForm(Form):
def __init__(self, predicate, consequent, alternative):
self.predicate = predicate # :: Form
self.consequent = consequent # :: Form
self.alternative = alternative # :: Form
def as_s_expr(self):
return TreeNode([
TreeText("if", None),
self.predicate.as_s_expr(),
self.consequent.as_s_expr(),
self.alternative.as_s_expr(), ])
def __eq__(self, other):
return isinstance(other, IfForm) and (
self.predicate == other.predicate and
self.consequent == other.consequent and
self.alternative == other.alternative)
class DefineForm(Form):
def __init__(self, symbol, definition):
self.symbol = symbol # :: Symbol
self.definition = definition # :: Form
def as_s_expr(self):
return TreeNode([
TreeText("define", None),
TreeText(self.symbol.symbol, None),
self.definition.as_s_expr(),
])
def __eq__(self, other):
return isinstance(other, DefineForm) and (
self.symbol == other.symbol and
self.definition == other.definition)
class LambdaForm(Form):
def __init__(self, parameters, body):
self.parameters = parameters # :: AtomList
self.body = body # :: FormList
def as_s_expr(self):
return TreeNode([
TreeText("lambda", None),
TreeNode([TreeText(s.symbol, None) for s in self.parameters]),
] + [f.as_s_expr() for f in self.body])
def __eq__(self, other):
return isinstance(other, LambdaForm) and (
self.parameters == other.parameters and
self.body == other.body)
class ApplicationForm(Form):
def __init__(self, procedure, arguments):
self.procedure = procedure # :: Form
self.arguments = arguments # :: FormList
def as_s_expr(self):
return TreeNode([
self.procedure.as_s_expr(),
] + [a.as_s_expr() for a in self.arguments])
def __eq__(self, other):
return isinstance(other, ApplicationForm) and (
self.procedure == other.procedure and
self.arguments == other.arguments)
class SequenceForm(Form):
def __init__(self, sequence):
self.sequence = sequence # :: FormList
def as_s_expr(self):
return TreeNode([
TreeText("begin", None),
] + [e.as_s_expr() for e in self.sequence])
def __eq__(self, other):
return isinstance(other, SequenceForm) and self.sequence == other.sequence
# Below this line: _not_ Form, but used as a part of a Form. May still have its own independent history.
class FormList(object):
def __init__(self, the_list, metadata=None):
pmts(the_list, list)
self.the_list = the_list
self.metadata = metadata
def __iter__(self):
return self.the_list.__iter__()
def __eq__(self, other):
return isinstance(other, FormList) and len(self.the_list) == len(other.the_list) and all(
a == b for (a, b) in zip(self.the_list, other.the_list))
class Symbol(object):
def __init__(self, symbol):
self.symbol = symbol # :: string (or None, which has the special meaning "a malformed symbol")
def __repr__(self):
if self.symbol is None:
return "<Symbol of malformed type>"
return "<Symbol %s>" % self.symbol
def __eq__(self, other):
return isinstance(other, Symbol) and self.symbol == other.symbol
class SymbolList(object):
def __init__(self, the_list, metadata=None):
pmts(the_list, list)
self.the_list = the_list
self.metadata = metadata
def __iter__(self):
return self.the_list.__iter__()
def __eq__(self, other):
# TBD: should metadata be part of equality-test?
return isinstance(other, SymbolList) and len(self.the_list) == len(other.the_list) and all(
a == b for (a, b) in zip(self.the_list, other.the_list))
| 38.951311 | 120 | 0.69 | 1,520 | 10,400 | 4.592763 | 0.227632 | 0.01719 | 0.021057 | 0.018908 | 0.211288 | 0.186076 | 0.170892 | 0.134794 | 0.109153 | 0.071623 | 0 | 0.000249 | 0.228558 | 10,400 | 266 | 121 | 39.097744 | 0.869874 | 0.499904 | 0 | 0.369231 | 0 | 0 | 0.013598 | 0 | 0 | 0 | 0 | 0.003759 | 0 | 1 | 0.292308 | false | 0.007692 | 0.015385 | 0.184615 | 0.607692 | 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 |
065bd1366036955c31de5ae3c6e443b00f605d23 | 1,858 | py | Python | scans/http.py | Tuutaans/lazy_enumerator | 91eb059d6c173e60aff590b78f723168cd4264e3 | [
"MIT"
] | null | null | null | scans/http.py | Tuutaans/lazy_enumerator | 91eb059d6c173e60aff590b78f723168cd4264e3 | [
"MIT"
] | 6 | 2022-02-09T15:44:34.000Z | 2022-02-10T03:48:54.000Z | scans/http.py | Tuutaans/lazy_enumerator | 91eb059d6c173e60aff590b78f723168cd4264e3 | [
"MIT"
] | 2 | 2022-02-09T14:49:25.000Z | 2022-02-09T16:26:11.000Z | import subprocess
def http(ip, tool, wordlist):
try:
with open('80.txt', 'a') as file:
file.write('\n\n WhatWeb Result \n\n')
command = f"whatweb -a 1 -v http://{ip} -U 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:77.0) Gecko/20100101 Firefox/77.0' >> 80.txt"
subprocess.call(command, shell=True)
except:
print("an error occured please check manually wheter the port is open or not or verify the service")
with open('80.txt', 'a') as file:
file.write(f'\n\n {tool} Result \n\n')
if tool == 'ffuf':
try:
command = f"ffuf -u http://{ip}/FUZZ -w {wordlist} -e .php,.txt,.html -c -t 100 >> 80.txt"
subprocess.call(command, shell=True)
except:
print("an error occured please check manually wheter the port is open or not or verify the service")
elif tool == 'dirsearch':
if wordlist == '/usr/share/dirb/wordlists/common.txt':
try:
command = f"dirsearch -u http://{ip} -r -t 100 >> 80.txt"
subprocess.call(command, shell=True)
except:
print("an error occured please check manually wheter the port is open or not or verify the service")
else:
try:
command = f"dirsearch -u http://{ip} -w {wordlist} -r -t 100 >> 80.txt"
subprocess.call(command, shell=True)
except:
print("an error occured please check manually wheter the port is open or not or verify the service")
else:
try:
command = f"gobuster dir -u http://{ip} -w {wordlist} -x .php,.txt,.html -t 100 -q >> 80.txt"
subprocess.call(command, shell=True)
except:
print("an error occured please check manually wheter the port is open or not or verify the service")
| 43.209302 | 138 | 0.574273 | 266 | 1,858 | 4.011278 | 0.293233 | 0.032802 | 0.070291 | 0.089035 | 0.726336 | 0.702905 | 0.702905 | 0.662605 | 0.662605 | 0.608247 | 0 | 0.037094 | 0.303552 | 1,858 | 42 | 139 | 44.238095 | 0.787481 | 0 | 0 | 0.666667 | 0 | 0.111111 | 0.506997 | 0.019376 | 0 | 0 | 0 | 0 | 0 | 1 | 0.027778 | false | 0 | 0.027778 | 0 | 0.055556 | 0.138889 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
065f3881947415087691fd22e4ea6662ba1c49d5 | 1,424 | py | Python | bnpy/allocmodel/__init__.py | raphael-group/bnpy | b11dc6f5689b06fc967bab6dffe7e01551d84667 | [
"BSD-3-Clause"
] | 184 | 2016-12-13T21:05:48.000Z | 2022-02-28T11:47:23.000Z | bnpy/allocmodel/__init__.py | raphael-group/bnpy | b11dc6f5689b06fc967bab6dffe7e01551d84667 | [
"BSD-3-Clause"
] | 37 | 2016-12-18T14:07:53.000Z | 2022-03-13T10:58:14.000Z | bnpy/allocmodel/__init__.py | raphael-group/bnpy | b11dc6f5689b06fc967bab6dffe7e01551d84667 | [
"BSD-3-Clause"
] | 50 | 2017-01-25T19:44:34.000Z | 2022-03-15T10:22:01.000Z | from bnpy.allocmodel.AllocModel import AllocModel
from bnpy.allocmodel.mix.FiniteMixtureModel import FiniteMixtureModel
from bnpy.allocmodel.mix.DPMixtureModel import DPMixtureModel
from bnpy.allocmodel.mix.DPMixtureRestrictedLocalStep import make_xPiVec_and_emptyPi
from bnpy.allocmodel.topics.FiniteTopicModel import FiniteTopicModel
from bnpy.allocmodel.topics.HDPTopicModel import HDPTopicModel
from bnpy.allocmodel.hmm.FiniteHMM import FiniteHMM
from bnpy.allocmodel.hmm.HDPHMM import HDPHMM
from bnpy.allocmodel.relational.FiniteSMSB import FiniteSMSB
from bnpy.allocmodel.relational.FiniteMMSB import FiniteMMSB
from bnpy.allocmodel.relational.FiniteAssortativeMMSB import FiniteAssortativeMMSB
from bnpy.allocmodel.relational.HDPMMSB import HDPMMSB
from bnpy.allocmodel.relational.HDPAssortativeMMSB import HDPAssortativeMMSB
AllocModelConstructorsByName = {
'FiniteMixtureModel': FiniteMixtureModel,
'DPMixtureModel': DPMixtureModel,
'FiniteTopicModel': FiniteTopicModel,
'HDPTopicModel': HDPTopicModel,
'FiniteHMM': FiniteHMM,
'HDPHMM': HDPHMM,
'FiniteSMSB': FiniteSMSB,
'FiniteMMSB': FiniteMMSB,
'FiniteAssortativeMMSB': FiniteAssortativeMMSB,
'HDPMMSB': HDPMMSB,
'HDPAssortativeMMSB': HDPAssortativeMMSB,
}
AllocModelNameSet = set(AllocModelConstructorsByName.keys())
__all__ = ['AllocModel']
for name in AllocModelConstructorsByName:
__all__.append(name)
| 36.512821 | 84 | 0.827949 | 129 | 1,424 | 9.054264 | 0.255814 | 0.089041 | 0.200342 | 0.119863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.101826 | 1,424 | 38 | 85 | 37.473684 | 0.913213 | 0 | 0 | 0 | 0 | 0 | 0.106742 | 0.014747 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.066667 | 0.433333 | 0 | 0.433333 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 3 |
0673eba8bc0fe2f7d3ed47fa90eb80b983acaf85 | 109 | py | Python | test.py | timlyrics/hppuml | 5d6ef9aacd234b6c76a8e5743ade5fefbcbfbb16 | [
"MIT"
] | 2 | 2018-06-18T19:27:35.000Z | 2018-06-19T15:51:32.000Z | test.py | bettercallshao/hppuml | 5d6ef9aacd234b6c76a8e5743ade5fefbcbfbb16 | [
"MIT"
] | null | null | null | test.py | bettercallshao/hppuml | 5d6ef9aacd234b6c76a8e5743ade5fefbcbfbb16 | [
"MIT"
] | null | null | null | import hppuml
import sys
with open(sys.argv[1], 'rb') as f:
data = f.read()
print(hppuml.run(data))
| 15.571429 | 34 | 0.633028 | 19 | 109 | 3.631579 | 0.736842 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011494 | 0.201835 | 109 | 6 | 35 | 18.166667 | 0.781609 | 0 | 0 | 0 | 0 | 0 | 0.018349 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.2 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
068ec8f1f5688a0d96d892a86e91de3345828f82 | 22 | py | Python | dlkit/records/repository/vcb/__init__.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 2 | 2018-02-23T12:16:11.000Z | 2020-10-08T17:54:24.000Z | dlkit/records/repository/vcb/__init__.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 87 | 2017-04-21T18:57:15.000Z | 2021-12-13T19:43:57.000Z | dlkit/records/repository/vcb/__init__.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 1 | 2018-03-01T16:44:25.000Z | 2018-03-01T16:44:25.000Z | __author__ = 'cjshaw'
| 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 |
ebf311ac8e516628f9a5e0ceec88346eaa75b79f | 1,005 | py | Python | user.py | robajillo/Python-IP1 | c90ce82c3c7d8461dea5f4ba7b3dee7e7f1d5073 | [
"MIT"
] | null | null | null | user.py | robajillo/Python-IP1 | c90ce82c3c7d8461dea5f4ba7b3dee7e7f1d5073 | [
"MIT"
] | null | null | null | user.py | robajillo/Python-IP1 | c90ce82c3c7d8461dea5f4ba7b3dee7e7f1d5073 | [
"MIT"
] | null | null | null | class User:
'''
class that generates new instance of user
'''
user_list = []
def __init__ (self, user_name, password):
self.user_name = user_name
self.password = password
def save_user(self):
User.user_list.append(self)
def delete_user(self):
'''
delete user account
'''
User.user_list.remove(self)
@classmethod
def find_user(cls,user_name):
'''
finding username
'''
for user in cls.user_list:
if user.user_name == user_name:
return user
@classmethod
def log_in(cls,user_name, password):
'''
login to password locker
'''
for user in cls.user_list:
if user.user_name == user_name and user.password == user_password:
return user
@classmethod
def display_user(cls):
'''
Method that returns the user list
'''
return cls.user_list | 22.333333 | 78 | 0.545274 | 115 | 1,005 | 4.547826 | 0.313043 | 0.137667 | 0.068834 | 0.091778 | 0.160612 | 0.160612 | 0.160612 | 0.160612 | 0.160612 | 0.160612 | 0 | 0 | 0.367164 | 1,005 | 45 | 79 | 22.333333 | 0.822327 | 0.136318 | 0 | 0.318182 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.272727 | false | 0.181818 | 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 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
ebfac1c8f2467907c23b47d5c17156bea64adc33 | 191 | py | Python | python/tutorial/basic/loop_example_05.py | victor-cleber/personal_studies | 6786562d2d1d2340304b1257cd727cbc2653dcde | [
"MIT"
] | 1 | 2020-04-19T10:46:01.000Z | 2020-04-19T10:46:01.000Z | python/tutorial/basic/loop_example_05.py | victor-cleber/personal_studies | 6786562d2d1d2340304b1257cd727cbc2653dcde | [
"MIT"
] | null | null | null | python/tutorial/basic/loop_example_05.py | victor-cleber/personal_studies | 6786562d2d1d2340304b1257cd727cbc2653dcde | [
"MIT"
] | 1 | 2021-08-07T04:53:12.000Z | 2021-08-07T04:53:12.000Z | print("Example 05: [The else Statement] \n"
" Print a message once the condition is false")
i = 1
while i < 6:
print(i)
i += 1
else:
print("The condition is false")
| 17.363636 | 64 | 0.586387 | 30 | 191 | 3.733333 | 0.566667 | 0.214286 | 0.25 | 0.339286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.037313 | 0.298429 | 191 | 10 | 65 | 19.1 | 0.798507 | 0 | 0 | 0 | 0 | 0 | 0.594737 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.375 | 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 |
ebfbdfcfdff57e57fb9626d358e58781d74ee7a7 | 140 | py | Python | ImageDeleter.py | warifp/InstagramPostAndDelete | d22577325eccf42e629cef076ab43f7788587bc4 | [
"MIT"
] | 4 | 2019-06-03T04:00:51.000Z | 2021-11-09T21:34:38.000Z | ImageDeleter.py | nittaya1990/InstagramPostAndDelete | d22577325eccf42e629cef076ab43f7788587bc4 | [
"MIT"
] | null | null | null | ImageDeleter.py | nittaya1990/InstagramPostAndDelete | d22577325eccf42e629cef076ab43f7788587bc4 | [
"MIT"
] | 4 | 2019-10-30T19:44:08.000Z | 2021-09-07T16:30:09.000Z | import os
def delete_png():
list = os.listdir()
images = [x for x in list if ".png" in x]
for x in images:
os.remove(x)
| 20 | 45 | 0.571429 | 25 | 140 | 3.16 | 0.52 | 0.101266 | 0.126582 | 0.177215 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.307143 | 140 | 6 | 46 | 23.333333 | 0.814433 | 0 | 0 | 0 | 0 | 0 | 0.028571 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2318f93e1dbbfd3944ecc62850897cb02a31c46b | 253 | py | Python | python/intermediate/mutations_fredbaa.py | saumyasingh048/hacktoberithms | 6eb5472e846650b73e75e04f717bdf500d171052 | [
"MIT"
] | 16 | 2018-10-05T07:35:06.000Z | 2021-10-02T12:12:52.000Z | python/intermediate/mutations_fredbaa.py | saumyasingh048/hacktoberithms | 6eb5472e846650b73e75e04f717bdf500d171052 | [
"MIT"
] | 50 | 2018-10-04T00:04:24.000Z | 2019-10-25T16:29:58.000Z | python/intermediate/mutations_fredbaa.py | saumyasingh048/hacktoberithms | 6eb5472e846650b73e75e04f717bdf500d171052 | [
"MIT"
] | 115 | 2018-10-04T02:42:18.000Z | 2021-01-27T17:34:21.000Z | def mutations(inputs):
item_a = set(inputs[0].lower())
item_b = set(inputs[1].lower())
return item_b.intersection(item_a) == item_b
print(mutations(["hello", "Hello"]))
print(mutations(["hello", "hey"]))
print(mutations(["Alien", "line"])) | 28.111111 | 48 | 0.652174 | 35 | 253 | 4.571429 | 0.485714 | 0.09375 | 0.2375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009009 | 0.12253 | 253 | 9 | 49 | 28.111111 | 0.711712 | 0 | 0 | 0 | 0 | 0 | 0.106299 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0 | 0 | 0.285714 | 0.428571 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
23242d12535d7866d656babb7f0647408b6da6f2 | 211 | py | Python | alpyro_msgs/std_msgs/string.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | 1 | 2020-12-13T13:07:10.000Z | 2020-12-13T13:07:10.000Z | alpyro_msgs/std_msgs/string.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | alpyro_msgs/std_msgs/string.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | from alpyro_msgs import RosMessage, string
class String(RosMessage):
__msg_typ__ = "std_msgs/String"
__msg_def__ = "c3RyaW5nIGRhdGEKCg=="
__md5_sum__ = "992ce8a1687cec8c8bd883ec73ca41d1"
data: string
| 21.1 | 50 | 0.781991 | 22 | 211 | 6.727273 | 0.727273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115385 | 0.137441 | 211 | 9 | 51 | 23.444444 | 0.697802 | 0 | 0 | 0 | 0 | 0 | 0.317536 | 0.151659 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
23303987c4bbf5cc2feca31682866e312e9559a3 | 217 | py | Python | djmailer/api/models.py | taoteg/restful-python-tutorials | 530cfdd7fc8b1b06310f098400dae487512f9c0a | [
"BSD-3-Clause"
] | 1 | 2020-12-01T11:21:19.000Z | 2020-12-01T11:21:19.000Z | djmailer/api/models.py | taoteg/restful-python-tutorials | 530cfdd7fc8b1b06310f098400dae487512f9c0a | [
"BSD-3-Clause"
] | null | null | null | djmailer/api/models.py | taoteg/restful-python-tutorials | 530cfdd7fc8b1b06310f098400dae487512f9c0a | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
# Create your models here.
class Subscriber(models.Model):
name = models.CharField("Name", max_length=50)
age = models.IntegerField("Age")
email = models.EmailField("Email")
| 24.111111 | 50 | 0.714286 | 28 | 217 | 5.5 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010989 | 0.16129 | 217 | 8 | 51 | 27.125 | 0.835165 | 0.110599 | 0 | 0 | 0 | 0 | 0.062827 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
234866a2f57ef94a43651ce557990ad96e6bfccb | 2,245 | py | Python | app.py | annieweng/twitter-app | 55543b20de52e1748fbd55848c325b3d5a3c9b26 | [
"Apache-2.0"
] | null | null | null | app.py | annieweng/twitter-app | 55543b20de52e1748fbd55848c325b3d5a3c9b26 | [
"Apache-2.0"
] | null | null | null | app.py | annieweng/twitter-app | 55543b20de52e1748fbd55848c325b3d5a3c9b26 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, make_response, send_file, session, request, redirect, jsonify
import api
import json
import os
import logging
import twitter
from werkzeug import secure_filename
app = Flask(__name__)
app.config['SECRET_KEY'] = '24KJSF98325KJLSDF972saf29832LFjasf87FZKFJL78f7ds98FSDKLF'
login = False
@app.route("/")
def index():
return send_file("static/index.html")
def _convert_to_JSON(result):
"""Convert result object to a JSON web request."""
response = make_response(json.dumps(result))
response.headers['Access-Control-Allow-Origin'] = "*"
response.mimetype = "application/json"
return response
@app.route("/api/twitterStreamingFilter/", methods=['POST'])
def updateSearchFilter():
search_info = json.loads(request.data)
#twitter.getTwritterStreaming(search_info.keywords, search_info.users, search_info.hashtags, search_info.boundingBox)
#TODO: sent it to kafka topic
return "Success"
@app.route("/api/userLogin/", methods=['GET'])
def getloggedInUserName():
print "getLoggedInUserName"
first_name = ''
print login
if login:
first_name=api.get_username(session['user'])
print "first_name is "+first_name
return jsonify({"firstName":first_name})
@app.route("/api/signup/", methods=['POST'])
def add_user():
new_user = json.loads(request.data)
first_name = new_user.get("first_name")
last_name = new_user.get("last_name")
email = new_user.get("email")
password = new_user.get("password")
api.create_user( email, password, first_name, last_name)
logging.info(" called api/signup with user "+first_name);
return "Success"
@app.route("/api/login/", methods=['POST'])
def login_user():
user_to_login = json.loads(request.data)
logging.info(" called api/in with user");
email = user_to_login.get("email")
password = user_to_login.get("password")
user_id = api.get_user(email, password)
session['user'] = user_id
login = True
print login
return "Success"
@app.route("/api/logout/", methods=['POST'])
def process_logout():
session['user']=-1
api.logout()
login = False
return "Success"
if __name__ == "__main__":
port = int(os.environ.get('PORT',5000))
app.run(host='0.0.0.0', port=port)
| 27.716049 | 121 | 0.709577 | 296 | 2,245 | 5.189189 | 0.334459 | 0.052734 | 0.035807 | 0.039063 | 0.046875 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016196 | 0.147439 | 2,245 | 80 | 122 | 28.0625 | 0.786311 | 0.064143 | 0 | 0.131148 | 0 | 0 | 0.20693 | 0.054173 | 0 | 0 | 0 | 0.0125 | 0 | 0 | null | null | 0.065574 | 0.114754 | null | null | 0.065574 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
235b1e17f4a64b0554f182d2de9c2e21220781b6 | 188 | py | Python | tests/urls.py | ainmosni/django-snooze | d160d7dbdc744b717ac534e815b2a543f18ade16 | [
"BSD-3-Clause"
] | null | null | null | tests/urls.py | ainmosni/django-snooze | d160d7dbdc744b717ac534e815b2a543f18ade16 | [
"BSD-3-Clause"
] | null | null | null | tests/urls.py | ainmosni/django-snooze | d160d7dbdc744b717ac534e815b2a543f18ade16 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import patterns, include, url
import django_snooze
django_snooze.autodiscover()
urlpatterns = patterns(
'',
url(r'^api/', include(django_snooze.urls())),
)
| 18.8 | 51 | 0.723404 | 23 | 188 | 5.782609 | 0.565217 | 0.270677 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138298 | 188 | 9 | 52 | 20.888889 | 0.820988 | 0 | 0 | 0 | 0 | 0 | 0.026596 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
2374a2bbed71dc2af6b42cf1ed34092daed677f1 | 50 | py | Python | atpthings/util/__init__.py | atp-things/pkg-python-util | 7ce464e38b43a84b6c8bf176b882d71e55edc4fb | [
"MIT"
] | null | null | null | atpthings/util/__init__.py | atp-things/pkg-python-util | 7ce464e38b43a84b6c8bf176b882d71e55edc4fb | [
"MIT"
] | null | null | null | atpthings/util/__init__.py | atp-things/pkg-python-util | 7ce464e38b43a84b6c8bf176b882d71e55edc4fb | [
"MIT"
] | null | null | null | """
atpthings.util
--------------
Utilities
"""
| 6.25 | 14 | 0.44 | 3 | 50 | 7.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14 | 50 | 7 | 15 | 7.142857 | 0.511628 | 0.78 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
88dbbfa9ec5237c987aeffce4825fb8466ba89a6 | 3,112 | py | Python | pyne/tests/test_particle.py | AllSafeCyberSecur1ty/Nuclear-Engineering | 302d6dcc7c0a85a9191098366b076cf9cb5a9f6e | [
"MIT"
] | 1 | 2022-03-26T20:01:13.000Z | 2022-03-26T20:01:13.000Z | pyne/tests/test_particle.py | AllSafeCyberSecur1ty/Nuclear-Engineering | 302d6dcc7c0a85a9191098366b076cf9cb5a9f6e | [
"MIT"
] | null | null | null | pyne/tests/test_particle.py | AllSafeCyberSecur1ty/Nuclear-Engineering | 302d6dcc7c0a85a9191098366b076cf9cb5a9f6e | [
"MIT"
] | 1 | 2022-03-26T19:59:13.000Z | 2022-03-26T19:59:13.000Z | """Tally tests"""
import os
import warnings
from unittest import TestCase
import nose
from nose.tools import (
assert_equal,
assert_not_equal,
assert_raises,
raises,
assert_almost_equal,
assert_true,
assert_false,
assert_in,
)
from pyne.utils import QAWarning
warnings.simplefilter("ignore", QAWarning)
from pyne.particle import is_valid, name, is_heavy_ion, id, mcnp, mcnp6, fluka, geant4
def test_is_valid():
assert_equal(is_valid("Proton"), True)
assert_equal(is_valid("Protium"), True)
assert_equal(is_valid("Hydrogen"), True)
assert_equal(is_valid(2212), True)
assert_equal(is_valid(-2212), True)
assert_equal(is_valid("Neutron"), True)
assert_equal(is_valid("AntiProton"), True)
assert_equal(is_valid("AntiNeutron"), True)
def test_name():
assert_equal(name("Proton"), "Proton")
assert_equal(name("Neutron"), "Neutron")
assert_equal(name(2112), "Neutron")
assert_equal(name("Hydrogen"), "Proton")
assert_equal(name("Protium"), "Proton")
assert_equal(name(10010000), "Proton")
assert_equal(name("10010000"), "Proton")
def test_is_heavy_ion():
assert_equal(is_heavy_ion("Proton"), False)
assert_equal(is_heavy_ion("Hydrogen"), False)
assert_equal(is_heavy_ion("1H"), False)
assert_equal(is_heavy_ion(10010000), False)
assert_equal(is_heavy_ion("10010000"), False)
assert_equal(is_heavy_ion("2H"), True)
assert_equal(is_heavy_ion("3He"), True)
assert_equal(is_heavy_ion("22Na"), True)
def test_id_number():
assert_equal(id("Proton"), 2212)
assert_not_equal(id("AntiProton"), 2212)
assert_equal(id("AntiProton"), -2212)
assert_not_equal(id("Proton"), -2212)
assert_equal(id("Hydrogen"), 2212)
assert_equal(id("22Na"), 0)
def test_mcnp_id():
assert_equal(mcnp("Neutron"), "n")
assert_equal(mcnp(2112), "n")
assert_equal(mcnp("Photon"), "p")
assert_equal(mcnp("Gamma"), "p")
assert_equal(mcnp("Electron"), "e")
def test_mcnp6_id():
assert_equal(mcnp6("Neutron"), "n")
assert_equal(mcnp6(2112), "n")
assert_equal(mcnp6("Photon"), "p")
assert_equal(mcnp6("Gamma"), "p")
assert_equal(mcnp6("Electron"), "e")
assert_equal(mcnp6("Proton"), "h")
assert_equal(mcnp6("Hydrogen"), "h")
def test_fluka_id():
assert_equal(fluka("Neutron"), "NEUTRON")
assert_equal(fluka(2112), "NEUTRON")
assert_equal(fluka("Photon"), "PHOTON")
assert_equal(fluka("Gamma"), "PHOTON")
assert_equal(fluka("Electron"), "ELECTRON")
assert_equal(fluka("Beta-"), "ELECTRON")
assert_equal(fluka("Proton"), "PROTON")
assert_equal(fluka("Hydrogen"), "PROTON")
def test_geant4_id():
assert_equal(geant4("Neutron"), "neutron")
assert_equal(geant4(2112), "neutron")
assert_equal(geant4("Photon"), "gamma")
assert_equal(geant4("Gamma"), "gamma")
assert_equal(geant4("Electron"), "e-")
assert_equal(geant4("Beta-"), "e-")
assert_equal(geant4("Proton"), "proton")
assert_equal(geant4("Hydrogen"), "proton")
# Run as script
#
if __name__ == "__main__":
nose.runmodule()
| 28.290909 | 86 | 0.681234 | 408 | 3,112 | 4.904412 | 0.159314 | 0.307846 | 0.103948 | 0.076462 | 0.274363 | 0.166917 | 0.083958 | 0.083958 | 0.083958 | 0.083958 | 0 | 0.040469 | 0.150386 | 3,112 | 109 | 87 | 28.550459 | 0.716339 | 0.008355 | 0 | 0 | 0 | 0 | 0.156544 | 0 | 0 | 0 | 0 | 0 | 0.761905 | 1 | 0.095238 | true | 0 | 0.083333 | 0 | 0.178571 | 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 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
88dccce37050a8add07328df48f1e481cb78e044 | 1,053 | py | Python | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/OperationStaResult.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 128 | 2018-10-29T04:11:47.000Z | 2022-03-07T02:19:14.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/OperationStaResult.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 40 | 2018-11-02T00:40:48.000Z | 2021-12-07T09:33:56.000Z | test/hlt/pytest/python/com/huawei/iotplatform/client/dto/OperationStaResult.py | yuanyi-thu/AIOT- | 27f67d98324593c4c6c66bbd5e2a4aa7b9a4ac1e | [
"BSD-3-Clause"
] | 118 | 2018-10-29T08:43:57.000Z | 2022-01-07T06:49:25.000Z | class OperationStaResult(object):
def __init__(self):
self.total = None
self.wait = None
self.processing = None
self.success = None
self.fail = None
self.stop = None
self.timeout = None
def getTotal(self):
return self.total
def setTotal(self, total):
self.total = total
def getWait(self):
return self.wait
def setWait(self, wait):
self.wait = wait
def getProcessing(self):
return self.processing
def setProcessing(self, processing):
self.processing = processing
def getSuccess(self):
return self.success
def setSuccess(self, success):
self.success = success
def getFail(self):
return self.fail
def setFail(self, fail):
self.fail = fail
def getStop(self):
return self.stop
def setStop(self, stop):
self.stop = stop
def getTimeout(self):
return self.timeout
def setTimeout(self, timeout):
self.timeout = timeout
| 19.867925 | 40 | 0.593542 | 118 | 1,053 | 5.262712 | 0.245763 | 0.112721 | 0.15781 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.320988 | 1,053 | 52 | 41 | 20.25 | 0.868531 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.405405 | false | 0 | 0 | 0.189189 | 0.621622 | 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 |
00050b66c402a1ad0a7523da93c250f1e2437806 | 330 | py | Python | fpiweb/tests/utility.py | HarlandWHansen/Food-Pantry-Inventory | 21cf34fcc6bac36b5fd18a6090dcda3fa08ae261 | [
"MIT"
] | null | null | null | fpiweb/tests/utility.py | HarlandWHansen/Food-Pantry-Inventory | 21cf34fcc6bac36b5fd18a6090dcda3fa08ae261 | [
"MIT"
] | null | null | null | fpiweb/tests/utility.py | HarlandWHansen/Food-Pantry-Inventory | 21cf34fcc6bac36b5fd18a6090dcda3fa08ae261 | [
"MIT"
] | null | null | null |
from django.contrib.auth.models import User
default_password = 'abc123'
def create_user(first_name, last_name):
first_name = first_name.lower()
last_name = last_name.lower()
return User.objects.create_user(
first_name[0] + last_name,
f"{first_name}.{last_name}",
default_password,
)
| 18.333333 | 43 | 0.678788 | 44 | 330 | 4.772727 | 0.454545 | 0.214286 | 0.171429 | 0.180952 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015444 | 0.215152 | 330 | 17 | 44 | 19.411765 | 0.795367 | 0 | 0 | 0 | 0 | 0 | 0.091463 | 0.073171 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0.2 | 0.1 | 0 | 0.3 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
000f5b55d940bcf7171dd1eca849338d0076cc47 | 2,562 | py | Python | Python OOP/7. SOLID/Lab/03. Ducks (Liskov Substitution).py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | Python OOP/7. SOLID/Lab/03. Ducks (Liskov Substitution).py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | Python OOP/7. SOLID/Lab/03. Ducks (Liskov Substitution).py | a-shiro/SoftUni-Courses | 7d0ca6401017a28b5ff7e7fa3e5df8bba8ddbe77 | [
"MIT"
] | null | null | null | # Original Code:
# from abc import abstractmethod, ABC
#
#
# class Duck(ABC):
# pass
#
#
# class RubberDuck(Duck):
# @staticmethod
# def quack():
# return "Squeek"
#
# @staticmethod
# def walk():
# """Rubber duck can walk only if you move it"""
# raise Exception('I cannot walk by myself')
#
# @staticmethod
# def fly():
# """Rubber duck can fly only if you throw it"""
# raise Exception('I cannot fly by myself')
#
#
# class RobotDuck(Duck):
# HEIGHT = 50
#
# def __init__(self):
# self.height = 0
#
# @staticmethod
# def quack():
# return 'Robotic quacking'
#
# @staticmethod
# def walk():
# return 'Robotic walking'
#
# def fly(self):
# """can only fly to specific height but
# when it reaches it starts landing automatically"""
# if self.height == RobotDuck.HEIGHT:
# self.land()
# else:
# self.height += 1
#
# def land(self):
# self.height = 0
# Refactored Code:
from abc import abstractmethod, ABC
class Duck(ABC):
@staticmethod
@abstractmethod
def quack():
pass
class LiveDuck(Duck):
@staticmethod
@abstractmethod
def eat():
pass
class NotLiveDuck(Duck):
@staticmethod
@abstractmethod
def stay_still():
pass
class RubberDuck(NotLiveDuck):
@staticmethod
def quack():
return "Squeek"
@staticmethod
def stay_still():
return 'Im still...'
class RobotDuck(NotLiveDuck):
@staticmethod
def quack():
return 'Robotic quacking'
@staticmethod
def stay_still():
return 'Im still...'
@staticmethod
def walk():
return 'Robotic walking'
class PondDuck(LiveDuck):
def __init__(self, species):
self.species = species
@staticmethod
def quack():
return 'Quack Quack'
@staticmethod
def eat():
return 'Im eating...'
@staticmethod
def walk():
return 'Walking...'
green_duck = PondDuck('greenhead')
print(green_duck.quack())
print(green_duck.walk())
print(green_duck.eat()) # Live ducks can eat
robot_duck = RobotDuck()
print(robot_duck.quack())
print(robot_duck.walk())
print(robot_duck.eat()) # Ducks that are not alive do not need to eat
rubber_duck = RubberDuck()
print(rubber_duck.quack())
print(rubber_duck.walk()) # Robot ducks can walk but rubber can't so you
# create a walk method in RobotDuck class but not in RubberDuck
| 18.977778 | 90 | 0.595628 | 287 | 2,562 | 5.240418 | 0.275261 | 0.129654 | 0.066489 | 0.086436 | 0.314495 | 0.269282 | 0.227394 | 0.135638 | 0.06117 | 0 | 0 | 0.002746 | 0.289227 | 2,562 | 134 | 91 | 19.119403 | 0.823174 | 0.439891 | 0 | 0.535714 | 0 | 0 | 0.073188 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.214286 | false | 0.053571 | 0.017857 | 0.142857 | 0.482143 | 0.142857 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 3 |
00169ac8917bc71ea2d6a8fba9ab47b43bce2fae | 4,038 | py | Python | great_expectations/data_context/store/data_snapshot_store.py | williamjr/great_expectations | 7e3af56476ea9966045172696af316b8537ff4c6 | [
"Apache-2.0"
] | 2 | 2020-03-04T19:35:57.000Z | 2020-04-13T21:06:02.000Z | great_expectations/data_context/store/data_snapshot_store.py | noncomposmentis/great_expectations | 8155b1f20a88aa186745698792856f84d82f33ef | [
"Apache-2.0"
] | null | null | null | great_expectations/data_context/store/data_snapshot_store.py | noncomposmentis/great_expectations | 8155b1f20a88aa186745698792856f84d82f33ef | [
"Apache-2.0"
] | null | null | null | # NOTE: Deprecated. Retain until DataSnapshotStore is implemented
# class NamespacedReadWriteStoreConfig(ReadWriteStoreConfig):
# _allowed_keys = set({
# "serialization_type",
# "resource_identifier_class_name",
# "store_backend",
# })
# _required_keys = set({
# "resource_identifier_class_name",
# "store_backend",
# })
# class DataSnapshotStore(WriteOnlyStore):
# config_class = NamespacedReadWriteStoreConfig
# def __init__(self, config, root_directory):
# # super(NamespacedReadWriteStore, self).__init__(config, root_directory)
# # TODO: This method was copied and modified from the base class.
# # We need to refactor later to inherit sensibly.
# assert hasattr(self, 'config_class')
# assert isinstance(config, self.config_class)
# self.config = config
# self.root_directory = root_directory
# # NOTE: hm. This is tricky.
# # At this point, we need to add some keys to the store_backend config.
# # The config from THIS class should be typed by this point.
# # But if we insist that it's recursively typed, it will have failed before arriving at this point.
# if self.config["store_backend"]["class_name"] == "FilesystemStoreBackend":
# self.config["store_backend"]["key_length"] = self.resource_identifier_class._recursively_get_key_length()#+1 #Only add one if we prepend the identifier type
# self.store_backend = self._configure_store_backend(self.config["store_backend"])
# self.store_backend.verify_that_key_to_filepath_operation_is_reversible()
# else:
# self.store_backend = self._configure_store_backend(self.config["store_backend"])
# self._setup()
# def _get(self, key):
# key_tuple = self._convert_resource_identifier_to_tuple(key)
# return self.store_backend.get(key_tuple)
# def _set(self, key, serialized_value):
# key_tuple = self._convert_resource_identifier_to_tuple(key)
# return self.store_backend.set(key_tuple, serialized_value)
# def list_keys(self):
# return [self._convert_tuple_to_resource_identifier(key) for key in self.store_backend.list_keys()]
# def _convert_resource_identifier_to_tuple(self, key):
# # TODO : Optionally prepend a source_id (the frontend Store name) to the tuple.
# # TODO : Optionally prepend a resource_identifier_type to the tuple.
# # list_ = [self.config.resource_identifier_class_name]
# list_ = []
# list_ += self._convert_resource_identifier_to_list(key)
# return tuple(list_)
# def _convert_resource_identifier_to_list(self, key):
# # The logic in this function is recursive, so it can't return a tuple
# list_ = []
# #Fetch keys in _key_order to guarantee tuple ordering in both python 2 and 3
# for key_name in key._key_order:
# key_element = key[key_name]
# if isinstance( key_element, DataContextResourceIdentifier ):
# list_ += self._convert_resource_identifier_to_list(key_element)
# else:
# list_.append(key_element)
# return list_
# def _convert_tuple_to_resource_identifier(self, tuple_):
# new_identifier = self.resource_identifier_class(*tuple_)#[1:]) #Only truncate one if we prepended the identifier type
# return new_identifier
# @property
# def resource_identifier_class(self):
# module = importlib.import_module("great_expectations.data_context.types.resource_identifiers")
# class_ = getattr(module, self.config.resource_identifier_class_name)
# return class_
# def _validate_key(self, key):
# if not isinstance(key, self.resource_identifier_class):
# raise TypeError("key: {!r} must be a DataContextResourceIdentifier, not {!r}".format(
# key,
# type(key),
# ))
| 41.628866 | 170 | 0.668153 | 471 | 4,038 | 5.397028 | 0.292994 | 0.120378 | 0.072384 | 0.063729 | 0.252164 | 0.199843 | 0.140047 | 0.140047 | 0.107002 | 0.107002 | 0 | 0.001305 | 0.241209 | 4,038 | 96 | 171 | 42.0625 | 0.828329 | 0.952204 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0.010417 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
004961d40953069e372d36a2b083a7a2c7263f7e | 624 | py | Python | agendamentos/migrations/0012_auto_20211129_0304.py | afnmachado/univesp_pi_1 | e6f2b545faaf53d14d17f751d2fb32e6618885b7 | [
"MIT"
] | null | null | null | agendamentos/migrations/0012_auto_20211129_0304.py | afnmachado/univesp_pi_1 | e6f2b545faaf53d14d17f751d2fb32e6618885b7 | [
"MIT"
] | null | null | null | agendamentos/migrations/0012_auto_20211129_0304.py | afnmachado/univesp_pi_1 | e6f2b545faaf53d14d17f751d2fb32e6618885b7 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-11-29 06:04
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('agendamentos', '0011_alter_agendamentosfuncionarios_table'),
]
operations = [
migrations.RemoveField(
model_name='agendamentosfuncionarios',
name='funcionario_cpf',
),
migrations.RemoveField(
model_name='agendamentosfuncionarios',
name='unique_together',
),
migrations.AlterModelTable(
name='agendamentosfuncionarios',
table=None,
),
]
| 24 | 70 | 0.608974 | 50 | 624 | 7.46 | 0.68 | 0.225201 | 0.13941 | 0.160858 | 0.310992 | 0.310992 | 0 | 0 | 0 | 0 | 0 | 0.04328 | 0.296474 | 624 | 25 | 71 | 24.96 | 0.806378 | 0.072115 | 0 | 0.368421 | 1 | 0 | 0.268631 | 0.195841 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.052632 | 0 | 0.210526 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
004ad78b199e5cbf7fd04ab5effebfe69b888e0f | 194 | py | Python | src/main.py | sudosubin/bins | 821385f005180c9bbff803f819a498e59fbe27c8 | [
"MIT"
] | null | null | null | src/main.py | sudosubin/bins | 821385f005180c9bbff803f819a498e59fbe27c8 | [
"MIT"
] | null | null | null | src/main.py | sudosubin/bins | 821385f005180c9bbff803f819a498e59fbe27c8 | [
"MIT"
] | null | null | null | import asyncio
import uvloop
from rich import traceback
from command import Command
if __name__ == '__main__':
traceback.install()
uvloop.install()
asyncio.run(Command.execute())
| 16.166667 | 34 | 0.737113 | 23 | 194 | 5.869565 | 0.565217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.175258 | 194 | 11 | 35 | 17.636364 | 0.84375 | 0 | 0 | 0 | 0 | 0 | 0.041237 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.