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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
58fe7c59617003e63f83f0e5ba2776f1614c8359 | 179 | py | Python | tools/context_processors.py | jcrocholl/nxdom | 16e93561a0cc5b5aa5be88d60c2d19d018d92dfa | [
"MIT"
] | 14 | 2015-02-25T18:03:32.000Z | 2021-11-16T11:10:44.000Z | tools/context_processors.py | jcrocholl/nxdom | 16e93561a0cc5b5aa5be88d60c2d19d018d92dfa | [
"MIT"
] | null | null | null | tools/context_processors.py | jcrocholl/nxdom | 16e93561a0cc5b5aa5be88d60c2d19d018d92dfa | [
"MIT"
] | null | null | null | def settings(request):
from django.conf import settings
return {
'media_version': settings.MEDIA_VERSION,
'json_version': settings.JSON_VERSION,
}
| 25.571429 | 48 | 0.659218 | 19 | 179 | 6 | 0.578947 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.251397 | 179 | 6 | 49 | 29.833333 | 0.850746 | 0 | 0 | 0 | 0 | 0 | 0.139665 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.5 | 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 |
45068310b15b41b8ba4f81b0ea4169d7fbe165e4 | 222 | py | Python | gammapy/tests/__init__.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 155 | 2015-02-25T12:38:02.000Z | 2022-03-13T17:54:30.000Z | gammapy/tests/__init__.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 3,131 | 2015-01-06T15:36:23.000Z | 2022-03-31T17:30:57.000Z | gammapy/tests/__init__.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 158 | 2015-03-16T20:36:44.000Z | 2022-03-30T16:05:37.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Gammapy integration and system tests.
This package can be used for tests that involved several
Gammapy sub-packages, or that don't fit anywhere else.
"""
| 31.714286 | 63 | 0.77027 | 36 | 222 | 4.75 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005376 | 0.162162 | 222 | 6 | 64 | 37 | 0.913978 | 0.959459 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
451e32a845bc020572ac85570967f0c9c5ecc53b | 1,017 | py | Python | plico/rpc/zmq_ports.py | lbusoni/plico | e4bab48fcc7767a50dcac13644b5e1d6175ca5f0 | [
"MIT"
] | null | null | null | plico/rpc/zmq_ports.py | lbusoni/plico | e4bab48fcc7767a50dcac13644b5e1d6175ca5f0 | [
"MIT"
] | 7 | 2021-08-30T17:18:34.000Z | 2022-03-25T22:42:20.000Z | plico/rpc/zmq_ports.py | lbusoni/plico | e4bab48fcc7767a50dcac13644b5e1d6175ca5f0 | [
"MIT"
] | null | null | null | from plico.utils.constants import Constants
__version__= "$Id: zmq_ports.py 56 2018-09-14 16:42:15Z lbusoni $"
class ZmqPorts(object):
def __init__(self, hostname, basePort):
self._hostname= hostname
self._basePort= basePort
@staticmethod
def fromConfiguration(configuration, configSection):
hostname= configuration.networkHostName(configSection)
basePort= configuration.basePort(configSection)
return ZmqPorts(hostname, basePort)
@property
def SERVER_REPLY_PORT(self):
return self._basePort + Constants.PORT_REPLY_OFFSET
@property
def SERVER_STATUS_PORT(self):
return self._basePort + Constants.PORT_STATUS_OFFSET
@property
def SERVER_PUBLISHER_PORT(self):
return self._basePort + Constants.PORT_PUBLISHER_OFFSET
@property
def SERVER_DISPLAY_PORT(self):
return self._basePort + Constants.PORT_DISPLAY_OFFSET
@property
def SERVER_HOSTNAME(self):
return self._hostname
| 23.113636 | 66 | 0.715831 | 110 | 1,017 | 6.318182 | 0.363636 | 0.086331 | 0.122302 | 0.103597 | 0.22446 | 0.22446 | 0.22446 | 0 | 0 | 0 | 0 | 0.01995 | 0.211406 | 1,017 | 43 | 67 | 23.651163 | 0.846633 | 0 | 0 | 0.192308 | 0 | 0 | 0.050147 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0 | 0.038462 | 0.192308 | 0.576923 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
4532c1cbc4694e0f5e8a622c561226d787e469ab | 45 | py | Python | homeassistant/components/mailgun/const.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/mailgun/const.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/mailgun/const.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Const for Mailgun."""
DOMAIN = "mailgun"
| 11.25 | 24 | 0.622222 | 5 | 45 | 5.6 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.155556 | 45 | 3 | 25 | 15 | 0.736842 | 0.4 | 0 | 0 | 0 | 0 | 0.333333 | 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 |
453c9942988adb8ad07e854618e1c7a2ef921c60 | 171 | py | Python | meetings/urls.py | alexaldr/django_meeting_planner | c5f0f871ea0e583f42b4dfbdc9d6ceff3b766b8a | [
"MIT"
] | null | null | null | meetings/urls.py | alexaldr/django_meeting_planner | c5f0f871ea0e583f42b4dfbdc9d6ceff3b766b8a | [
"MIT"
] | 6 | 2021-03-19T02:45:18.000Z | 2021-09-22T19:04:02.000Z | meetings/urls.py | alexaldr/django_meeting_planner | c5f0f871ea0e583f42b4dfbdc9d6ceff3b766b8a | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('<int:id>/', views.detail, name='detail'),
path('rooms/', views.rooms_list, name='rooms'),
] | 24.428571 | 51 | 0.660819 | 23 | 171 | 4.869565 | 0.565217 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152047 | 171 | 7 | 52 | 24.428571 | 0.772414 | 0 | 0 | 0 | 0 | 0 | 0.151163 | 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 |
18a0c89dd6cf66015c7a523c859a5751858ec2fb | 733 | py | Python | swigbullet/python/examples/bulletdemo/vector3.py | ousttrue/swigbullet | 02bd714ee1b9908f3abdd939a98a1512c444eac5 | [
"MIT"
] | 1 | 2015-07-19T13:07:38.000Z | 2015-07-19T13:07:38.000Z | swigbullet/python/examples/bulletdemo/vector3.py | ousttrue/swigbullet | 02bd714ee1b9908f3abdd939a98a1512c444eac5 | [
"MIT"
] | null | null | null | swigbullet/python/examples/bulletdemo/vector3.py | ousttrue/swigbullet | 02bd714ee1b9908f3abdd939a98a1512c444eac5 | [
"MIT"
] | null | null | null | import math
class Vector3(tuple):
def __new__(cls, x, y, z):
return tuple.__new__(cls, (x, y, z))
def __add__(self, rhs):
return Vector3(*[l+r for l, r in zip(self, rhs)])
def __sub__(self, rhs):
return Vector3(*[l-r for l, r in zip(self, rhs)])
def __mul__(self, s):
return Vector3(*(self[0]*s, self[1]*s, self[2]*s))
def cross(l, r):
return Vector3(*(l[1]*r[2]-l[2]*r[1], l[2]*r[0]-l[0]*r[2], l[0]*r[1]-l[1]*r[0]))
def dot(l, r):
return l[0]*r[0]+l[1]*r[1]+l[2]*r[2]
def length2(self):
return self.dot(self)
def length(self):
return math.sqrt(self.length2())
def normalize(self):
return self*(1.0/self.length())
| 22.90625 | 88 | 0.533424 | 134 | 733 | 2.768657 | 0.238806 | 0.032345 | 0.113208 | 0.043127 | 0.301887 | 0.226415 | 0.226415 | 0.226415 | 0.226415 | 0.226415 | 0 | 0.054845 | 0.253752 | 733 | 31 | 89 | 23.645161 | 0.6234 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.45 | false | 0 | 0.05 | 0.45 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
18b888788b9cd0a0a99ec327d131fcf3ee9367fc | 133 | py | Python | bot/urls.py | openkawasaki/brownbag-django | ecdd4d2233a77922ead14afcaec289d4a0f43a1b | [
"MIT"
] | 2 | 2020-04-18T12:36:00.000Z | 2020-07-06T03:32:42.000Z | bot/urls.py | openkawasaki/brownbag-django | ecdd4d2233a77922ead14afcaec289d4a0f43a1b | [
"MIT"
] | 16 | 2020-04-12T13:24:26.000Z | 2020-04-12T15:54:40.000Z | bot/urls.py | openkawasaki/brownbag-django | ecdd4d2233a77922ead14afcaec289d4a0f43a1b | [
"MIT"
] | 3 | 2020-04-13T13:56:02.000Z | 2020-07-06T03:32:51.000Z | from . import views
from django.urls import path
app_name = 'bot'
urlpatterns = [
path('', views.callback, name='callback'),
]
| 14.777778 | 46 | 0.676692 | 17 | 133 | 5.235294 | 0.647059 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.180451 | 133 | 8 | 47 | 16.625 | 0.816514 | 0 | 0 | 0 | 0 | 0 | 0.082707 | 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 |
18cad7858bd8a880c672bcd971d180d9d2d690cc | 317 | py | Python | src/pipeline_oriented_analytics/dataframe/csv_data_frame.py | bbiletskyy/pipeline-oriented-analytics | 35ece0907a0792e9b7d13a7759c9a32045819842 | [
"MIT"
] | 8 | 2020-02-19T12:35:32.000Z | 2022-03-24T13:16:04.000Z | src/pipeline_oriented_analytics/dataframe/csv_data_frame.py | bbiletskyy/pipeline-oriented-analytics | 35ece0907a0792e9b7d13a7759c9a32045819842 | [
"MIT"
] | null | null | null | src/pipeline_oriented_analytics/dataframe/csv_data_frame.py | bbiletskyy/pipeline-oriented-analytics | 35ece0907a0792e9b7d13a7759c9a32045819842 | [
"MIT"
] | 1 | 2020-02-27T09:22:55.000Z | 2020-02-27T09:22:55.000Z | from pyspark.sql import DataFrame, SparkSession
class CsvDataFrame(DataFrame):
"""DataFrame related to a csv file."""
def __init__(self, path: str, spark: SparkSession, header: bool = True):
super(CsvDataFrame, self).__init__(spark.read.option('header', str(header).lower()).csv(path)._jdf, spark)
| 35.222222 | 114 | 0.712934 | 40 | 317 | 5.425 | 0.675 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14511 | 317 | 8 | 115 | 39.625 | 0.800738 | 0.100946 | 0 | 0 | 0 | 0 | 0.021505 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
18d0b61b213eb12c41b2735c9d30b5699da0d47c | 208 | py | Python | excel/schedule/daily_schedule.py | MADTeacher/MADPythonCourse | f3bd38dcd30dc220bd691d301b2845401cc70b2e | [
"MIT"
] | 5 | 2021-05-11T14:27:11.000Z | 2022-02-09T08:55:06.000Z | excel/schedule/daily_schedule.py | MADTeacher/MADPythonCourse | f3bd38dcd30dc220bd691d301b2845401cc70b2e | [
"MIT"
] | null | null | null | excel/schedule/daily_schedule.py | MADTeacher/MADPythonCourse | f3bd38dcd30dc220bd691d301b2845401cc70b2e | [
"MIT"
] | 8 | 2020-09-21T21:52:30.000Z | 2022-03-05T12:31:10.000Z |
class DailySchedule:
def __init__(self, day_number: int, day_off: bool = False):
self.day_number = day_number
self.day_off = day_off
self.lessons: list[tuple[str, str, str]] = [] | 29.714286 | 63 | 0.639423 | 29 | 208 | 4.241379 | 0.517241 | 0.170732 | 0.211382 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.245192 | 208 | 7 | 64 | 29.714286 | 0.783439 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7a0908c40f484e92f4a24f180b84518d20442984 | 1,799 | py | Python | src/lostpetfinder/pets/migrations/0004_auto_20170820_1230.py | hhtek/aip-assessment-03 | 262b21648b6ba0a2df6004956d66019b481a2f2e | [
"ADSL"
] | null | null | null | src/lostpetfinder/pets/migrations/0004_auto_20170820_1230.py | hhtek/aip-assessment-03 | 262b21648b6ba0a2df6004956d66019b481a2f2e | [
"ADSL"
] | 9 | 2020-02-11T23:30:23.000Z | 2022-03-11T23:15:41.000Z | src/lostpetfinder/pets/migrations/0004_auto_20170820_1230.py | henrydho/aip-assessment-03 | 262b21648b6ba0a2df6004956d66019b481a2f2e | [
"ADSL"
] | 1 | 2017-08-22T09:38:48.000Z | 2017-08-22T09:38:48.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-20 02:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pets', '0003_auto_20170820_1200'),
]
operations = [
migrations.AddField(
model_name='lostpet',
name='collar',
field=models.CharField(blank=True, max_length=120, null=True),
),
migrations.AddField(
model_name='lostpet',
name='desexed',
field=models.CharField(blank=True, choices=[('Yes', 'Yes'), ('No', 'No'), ('Unknown', 'Unknown')], max_length=20, null=True),
),
migrations.AddField(
model_name='lostpet',
name='microchipped',
field=models.CharField(blank=True, choices=[('Yes', 'Yes'), ('No', 'No'), ('Unknown', 'Unknown')], max_length=20, null=True),
),
migrations.AddField(
model_name='lostpet',
name='microchipped_no',
field=models.CharField(blank=True, max_length=120, null=True),
),
migrations.AddField(
model_name='lostpet',
name='missing_date',
field=models.DateTimeField(null=True),
),
migrations.AddField(
model_name='lostpet',
name='slug',
field=models.SlugField(blank=True, null=True),
),
migrations.AddField(
model_name='lostpet',
name='timestamp',
field=models.DateTimeField(auto_now_add=True, null=True),
),
migrations.AddField(
model_name='lostpet',
name='updated',
field=models.DateTimeField(auto_now=True, null=True),
),
]
| 32.125 | 137 | 0.556976 | 178 | 1,799 | 5.488764 | 0.337079 | 0.14739 | 0.188332 | 0.221085 | 0.693961 | 0.630502 | 0.591607 | 0.591607 | 0.544524 | 0.44217 | 0 | 0.034208 | 0.301278 | 1,799 | 55 | 138 | 32.709091 | 0.743039 | 0.037799 | 0 | 0.583333 | 1 | 0 | 0.117477 | 0.01331 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.041667 | 0 | 0.104167 | 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 |
7a09a6cb60d5da237181791ed864222da8fcee58 | 826 | py | Python | examples/zillow_api_challenge/zillow/api/views.py | ztroop/djangorestframework-discovery | a040eec861ff752e2981bc162ad7a18aa271f17a | [
"BSD-3-Clause"
] | 1 | 2018-04-23T22:40:58.000Z | 2018-04-23T22:40:58.000Z | examples/zillow_api_challenge/zillow/api/views.py | ztroop/djangorestframework-discovery | a040eec861ff752e2981bc162ad7a18aa271f17a | [
"BSD-3-Clause"
] | 6 | 2021-04-08T21:58:45.000Z | 2022-02-10T12:55:06.000Z | examples/zillow_api_challenge/zillow/api/views.py | ztroop/djangorestframework-discovery | a040eec861ff752e2981bc162ad7a18aa271f17a | [
"BSD-3-Clause"
] | null | null | null | from rest_framework import viewsets
from api import models, serializers
class PropertyViewSet(viewsets.ModelViewSet):
queryset = models.Property.objects.all()
serializer_class = serializers.PropertySerializer
class PropertyDetailViewSet(viewsets.ModelViewSet):
queryset = models.PropertyDetail.objects.all()
serializer_class = serializers.PropertyDetailSerializer
class ZillowViewSet(viewsets.ModelViewSet):
queryset = models.Zillow.objects.all()
serializer_class = serializers.ZillowSerializer
class LocationViewSet(viewsets.ModelViewSet):
queryset = models.Location.objects.all()
serializer_class = serializers.LocationSerializer
class EvaluationViewSet(viewsets.ModelViewSet):
queryset = models.Evaluation.objects.all()
serializer_class = serializers.EvaluationSerializer
| 28.482759 | 59 | 0.805085 | 75 | 826 | 8.786667 | 0.386667 | 0.151745 | 0.212443 | 0.257967 | 0.273141 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121065 | 826 | 28 | 60 | 29.5 | 0.907714 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.117647 | 0 | 1 | 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 |
7a1538e39def7e912a523fd2bb41f428ef23ba9c | 1,290 | py | Python | tests/test_extension.py | Konubinix/click_project | be0d52e8babb2df4bcf58208d067609ed3bf20d6 | [
"MIT"
] | null | null | null | tests/test_extension.py | Konubinix/click_project | be0d52e8babb2df4bcf58208d067609ed3bf20d6 | [
"MIT"
] | null | null | null | tests/test_extension.py | Konubinix/click_project | be0d52e8babb2df4bcf58208d067609ed3bf20d6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def test_install_extension(lib):
lib.cmd('extension install hello')
lib.cmd('hello')
def test_install_extension_with_github_syntax(lib):
lib.cmd('extension install clk-project/hello')
lib.cmd('hello')
def test_update_extension(lib):
lib.cmd('extension install hello')
lib.cmd('extension update hello')
lib.cmd('hello --update-extension')
def test_copy_extension(lib):
lib.cmd('extension create someext')
lib.cmd('parameter --global-someext set echo test')
assert lib.cmd('echo') == 'test'
lib.cmd('extension disable someext')
assert lib.cmd('echo') == ''
lib.cmd('extension copy someext someext2')
assert lib.cmd('echo') == 'test'
lib.cmd('extension disable someext2')
assert lib.cmd('echo') == ''
def test_move_extension(lib):
lib.cmd('extension create someext')
lib.cmd('parameter --global-someext set echo test')
assert lib.cmd('echo') == 'test'
lib.cmd('extension disable someext')
assert lib.cmd('echo') == ''
lib.cmd('extension rename someext someext2')
assert lib.cmd('echo') == 'test'
lib.cmd('extension disable someext2')
assert lib.cmd('echo') == ''
lib.cmd('extension enable someext')
assert lib.cmd('echo') == ''
| 28.666667 | 55 | 0.66124 | 171 | 1,290 | 4.912281 | 0.192982 | 0.192857 | 0.232143 | 0.171429 | 0.795238 | 0.738095 | 0.696429 | 0.678571 | 0.678571 | 0.571429 | 0 | 0.005639 | 0.175194 | 1,290 | 44 | 56 | 29.318182 | 0.783835 | 0.033333 | 0 | 0.65625 | 0 | 0 | 0.407229 | 0 | 0 | 0 | 0 | 0 | 0.28125 | 1 | 0.15625 | false | 0 | 0 | 0 | 0.15625 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7a170214c8b756444ea014baef642037d95307d5 | 344 | py | Python | tests/workbook/test_wc_utils_workbook_api.py | KarrLab/wc_utilities | a4c0e2e8b9bd88356729e38faf5c0d09d61ff921 | [
"MIT"
] | 1 | 2019-12-12T15:49:32.000Z | 2019-12-12T15:49:32.000Z | tests/workbook/test_wc_utils_workbook_api.py | KarrLab/wc_utilities | a4c0e2e8b9bd88356729e38faf5c0d09d61ff921 | [
"MIT"
] | 36 | 2017-03-14T18:59:21.000Z | 2019-12-18T04:08:43.000Z | tests/workbook/test_wc_utils_workbook_api.py | KarrLab/wc_utilities | a4c0e2e8b9bd88356729e38faf5c0d09d61ff921 | [
"MIT"
] | 1 | 2019-10-16T10:30:42.000Z | 2019-10-16T10:30:42.000Z | """
:Author: Jonathan Karr <karr@mssm.edu>
:Date: 2018-03-12
:Copyright: 2018, Karr Lab
:License: MIT
"""
import types
import unittest
import wc_utils
class ApiTestCase(unittest.TestCase):
def test(self):
self.assertIsInstance(wc_utils.workbook, types.ModuleType)
self.assertIsInstance(wc_utils.workbook.Workbook, type)
| 20.235294 | 66 | 0.732558 | 44 | 344 | 5.659091 | 0.636364 | 0.084337 | 0.176707 | 0.216867 | 0.281125 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041096 | 0.151163 | 344 | 16 | 67 | 21.5 | 0.811644 | 0.281977 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.142857 | false | 0 | 0.428571 | 0 | 0.714286 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
e12fa9cf74c55be1401e6971eeda83112cf7a3c6 | 3,485 | py | Python | src/models/loaders/efficientnet.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | 3 | 2022-02-03T13:25:12.000Z | 2022-02-04T16:12:23.000Z | src/models/loaders/efficientnet.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | null | null | null | src/models/loaders/efficientnet.py | takedarts/skipresnet | d6f1e16042f8433a287355009e17e4e5768ad319 | [
"MIT"
] | 1 | 2022-02-04T12:28:02.000Z | 2022-02-04T12:28:02.000Z | from typing import Any
def load_efficientnet_parameters(model: Any, timm_model: Any) -> None:
model.stem.conv.load_state_dict(timm_model.conv_stem.state_dict())
model.stem.norm.load_state_dict(timm_model.bn1.state_dict())
index = 0
for timm_blocks in timm_model.blocks:
for timm_block in timm_blocks:
block = model.blocks[index]
index += 1
if hasattr(timm_block, 'conv_exp'):
_load_edge_block_parameters(block, timm_block)
elif hasattr(timm_block, 'conv_pwl'):
_load_inverted_block_parameters(block, timm_block)
elif hasattr(timm_block, 'conv_pw'):
_load_depthwise_block_parameters(block, timm_block)
else:
_load_conv_block_parameters(block, timm_block)
model.head.conv.load_state_dict(timm_model.conv_head.state_dict())
model.head.norm.load_state_dict(timm_model.bn2.state_dict())
if model.classifier.conv.weight.shape[:2] == timm_model.classifier.weight.shape:
model.classifier.conv.weight.data[:] = timm_model.classifier.weight[:, :, None, None].data
model.classifier.conv.bias.data[:] = timm_model.classifier.bias.data
def _load_inverted_block_parameters(block: Any, timm_block: Any) -> None:
block.operation.conv1.load_state_dict(timm_block.conv_pw.state_dict())
block.operation.norm1.load_state_dict(timm_block.bn1.state_dict())
block.operation.conv2.load_state_dict(timm_block.conv_dw.state_dict())
block.operation.norm2.load_state_dict(timm_block.bn2.state_dict())
block.operation.conv3.load_state_dict(timm_block.conv_pwl.state_dict())
block.operation.norm3.load_state_dict(timm_block.bn3.state_dict())
if hasattr(block.operation, 'semodule'):
block.operation.semodule.op.conv1.load_state_dict(
timm_block.se.conv_reduce.state_dict())
block.operation.semodule.op.conv2.load_state_dict(
timm_block.se.conv_expand.state_dict())
def _load_edge_block_parameters(block: Any, timm_block: Any) -> None:
block.operation.conv1.load_state_dict(timm_block.conv_exp.state_dict())
block.operation.norm1.load_state_dict(timm_block.bn1.state_dict())
block.operation.conv2.load_state_dict(timm_block.conv_pwl.state_dict())
block.operation.norm2.load_state_dict(timm_block.bn2.state_dict())
if hasattr(block.operation, 'semodule'):
block.operation.semodule.op.conv1.load_state_dict(
timm_block.se.conv_reduce.state_dict())
block.operation.semodule.op.conv2.load_state_dict(
timm_block.se.conv_expand.state_dict())
def _load_conv_block_parameters(block: Any, timm_block: Any) -> None:
block.operation.conv.load_state_dict(timm_block.conv.state_dict())
block.operation.norm.load_state_dict(timm_block.bn1.state_dict())
def _load_depthwise_block_parameters(block: Any, timm_block: Any) -> None:
block.operation.conv1.load_state_dict(timm_block.conv_dw.state_dict())
block.operation.norm1.load_state_dict(timm_block.bn1.state_dict())
block.operation.conv2.load_state_dict(timm_block.conv_pw.state_dict())
block.operation.norm2.load_state_dict(timm_block.bn2.state_dict())
if hasattr(block.operation, 'semodule'):
block.operation.semodule.op.conv1.load_state_dict(
timm_block.se.conv_reduce.state_dict())
block.operation.semodule.op.conv2.load_state_dict(
timm_block.se.conv_expand.state_dict())
| 45.855263 | 98 | 0.73429 | 494 | 3,485 | 4.825911 | 0.11336 | 0.196309 | 0.141779 | 0.185403 | 0.78146 | 0.713507 | 0.680789 | 0.655621 | 0.641359 | 0.641359 | 0 | 0.011168 | 0.15208 | 3,485 | 75 | 99 | 46.466667 | 0.795601 | 0 | 0 | 0.368421 | 0 | 0 | 0.013486 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.087719 | false | 0 | 0.017544 | 0 | 0.105263 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 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 | 0 | 0 | 3 |
e14adceb4566f58bc99c8b864e609085b8895951 | 173 | py | Python | tests/test_database.py | platiagro/pipeline-generator | d84b9512c39970c469154eaed56f08780ebf21eb | [
"Apache-2.0"
] | 1 | 2020-05-19T14:57:55.000Z | 2020-05-19T14:57:55.000Z | tests/test_database.py | platiagro/pipelines | d84b9512c39970c469154eaed56f08780ebf21eb | [
"Apache-2.0"
] | 93 | 2020-04-25T21:10:49.000Z | 2020-12-15T18:25:49.000Z | tests/test_database.py | platiagro/pipelines | d84b9512c39970c469154eaed56f08780ebf21eb | [
"Apache-2.0"
] | 6 | 2019-09-05T12:37:59.000Z | 2020-08-08T00:08:25.000Z | # -*- coding: utf-8 -*-
from unittest import TestCase
from pipelines.database import init_db
class TestDatabase(TestCase):
def test_init_db(self):
init_db()
| 15.727273 | 38 | 0.699422 | 23 | 173 | 5.086957 | 0.695652 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007194 | 0.196532 | 173 | 10 | 39 | 17.3 | 0.834532 | 0.121387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.4 | 0 | 0.8 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
e1794f8f5bfdfc128f909da85190d5f9645fa288 | 2,259 | py | Python | models.py | timmyoder/schedule_struggles | 6670bed107afaa970e57a4f7cb9dec9e181c7ffc | [
"MIT"
] | null | null | null | models.py | timmyoder/schedule_struggles | 6670bed107afaa970e57a4f7cb9dec9e181c7ffc | [
"MIT"
] | null | null | null | models.py | timmyoder/schedule_struggles | 6670bed107afaa970e57a4f7cb9dec9e181c7ffc | [
"MIT"
] | null | null | null | import os
import peewee as pw
from loguru import logger
import pathlib
project_root = pathlib.Path(__file__).parent
db_file = project_root / 'ff.db'
db = pw.SqliteDatabase(db_file)
class BaseModel(pw.Model):
class Meta:
"""required for each class"""
database = db
class Users(BaseModel):
roster_id = pw.IntegerField(primary_key=True)
user_id = pw.IntegerField(unique=True)
display_name = pw.CharField()
team_name = pw.CharField(null=True)
class Standings(BaseModel):
user = pw.ForeignKeyField(Users,
field='roster_id',
backref='standings')
week_1_rank = pw.IntegerField(null=True)
week_2_rank = pw.IntegerField(null=True)
week_3_rank = pw.IntegerField(null=True)
week_4_rank = pw.IntegerField(null=True)
week_5_rank = pw.IntegerField(null=True)
week_6_rank = pw.IntegerField(null=True)
week_7_rank = pw.IntegerField(null=True)
week_8_rank = pw.IntegerField(null=True)
week_9_rank = pw.IntegerField(null=True)
week_10_rank = pw.IntegerField(null=True)
week_11_rank = pw.IntegerField(null=True)
week_12_rank = pw.IntegerField(null=True)
week_13_rank = pw.IntegerField(null=True)
week_14_rank = pw.IntegerField(null=True)
class Scores(BaseModel):
user = pw.ForeignKeyField(Users,
field='roster_id',
backref='scores')
week = pw.IntegerField()
score = pw.FloatField()
matchup_id = pw.IntegerField()
class Meta:
indexes = (
(("user", "week"), True),
)
class WeeklyResults(BaseModel):
user = pw.ForeignKeyField(Users,
field='roster_id',
backref='week_results')
week = pw.IntegerField()
win_loss_tie = pw.CharField()
total_score = pw.FloatField()
ALL_TABLES = [Users,
Standings,
Scores,
WeeklyResults]
def clear_db():
if db_file.exists():
os.remove(db_file)
logger.info('existing database deleted')
with db.connection():
db.create_tables(ALL_TABLES)
logger.info('New db file create')
if __name__ == '__main__':
clear_db()
| 26.576471 | 53 | 0.623285 | 271 | 2,259 | 4.95941 | 0.313653 | 0.197917 | 0.1875 | 0.229167 | 0.432292 | 0.412946 | 0.122768 | 0.122768 | 0.122768 | 0 | 0 | 0.011515 | 0.269588 | 2,259 | 84 | 54 | 26.892857 | 0.80303 | 0.010182 | 0 | 0.15625 | 0 | 0 | 0.052915 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.015625 | false | 0 | 0.0625 | 0 | 0.609375 | 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 |
e179f8aeeca07a8eeada484d633c003897d23f39 | 301 | py | Python | tarefa10/fatorial.py | PauloVictorSS/unicamp-mc102 | 077ca3ea6d3df40ebe205c2e874d20a934ea5541 | [
"MIT"
] | null | null | null | tarefa10/fatorial.py | PauloVictorSS/unicamp-mc102 | 077ca3ea6d3df40ebe205c2e874d20a934ea5541 | [
"MIT"
] | null | null | null | tarefa10/fatorial.py | PauloVictorSS/unicamp-mc102 | 077ca3ea6d3df40ebe205c2e874d20a934ea5541 | [
"MIT"
] | null | null | null | def calcula_fatorial(numero):
"""
Calcula o fatorial de um número recursivamente
"""
if numero == 0:
return 1
return numero * calcula_fatorial(numero - 1)
def main():
numero = int(input())
fatorial = calcula_fatorial(numero)
print(fatorial)
main()
| 13.681818 | 54 | 0.611296 | 34 | 301 | 5.323529 | 0.5 | 0.248619 | 0.348066 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013953 | 0.285714 | 301 | 21 | 55 | 14.333333 | 0.827907 | 0.152824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.222222 | false | 0 | 0 | 0 | 0.444444 | 0.111111 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
e1a0f67312bf1a3e0e2c09326f085b5900f7d3c5 | 260 | py | Python | srv/python/EDA/process.py | aaditis/egem | 89b4cbd8c623dc1826d65b55bb92527e68ebbcce | [
"MIT"
] | null | null | null | srv/python/EDA/process.py | aaditis/egem | 89b4cbd8c623dc1826d65b55bb92527e68ebbcce | [
"MIT"
] | null | null | null | srv/python/EDA/process.py | aaditis/egem | 89b4cbd8c623dc1826d65b55bb92527e68ebbcce | [
"MIT"
] | null | null | null | """
process.py
@author: Scott Campit
"""
import numpy as np
import pandas as pd
# Proteomics data
# Preprocess CCLE proteomics data for 375 cancer cell lines
# Data taken from publication: https://gygi.med.harvard.edu/publications/ccle
# Metabolomics data
| 17.333333 | 77 | 0.761538 | 37 | 260 | 5.351351 | 0.810811 | 0.141414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013636 | 0.153846 | 260 | 14 | 78 | 18.571429 | 0.886364 | 0.773077 | 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 |
e1a9e4cf0ef7ab385f1560c3d9aa0da59c139cef | 630 | py | Python | tesliper/writing/__init__.py | mishioo/tesliper | e09dcbc0eeb5cc5f7d612ea7f913e4c5dd58a327 | [
"BSD-2-Clause"
] | null | null | null | tesliper/writing/__init__.py | mishioo/tesliper | e09dcbc0eeb5cc5f7d612ea7f913e4c5dd58a327 | [
"BSD-2-Clause"
] | 4 | 2022-02-24T18:28:39.000Z | 2022-03-23T16:27:59.000Z | tesliper/writing/__init__.py | mishioo/tesliper | e09dcbc0eeb5cc5f7d612ea7f913e4c5dd58a327 | [
"BSD-2-Clause"
] | null | null | null | """Objects for data serialization.
Aside from concrete implementations of :class:`.WriterBase`-derived classes for
particular file formats, this module provides a :func:`.writer` factory function that
allows to dynamically retrieve particular writer objects. This function is used by
:class:`.Tesliper` when exporting data to allow for use of user-provided
:class:`.WriterBase` subclasses.
"""
from .csv_writer import CsvWriter
from .gjf_writer import GjfWriter
from .serializer import ArchiveLoader, ArchiveWriter
from .txt_writer import TxtWriter
from .writer_base import WriterBase, writer
from .xlsx_writer import XlsxWriter
| 42 | 85 | 0.81746 | 84 | 630 | 6.071429 | 0.630952 | 0.094118 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119048 | 630 | 14 | 86 | 45 | 0.918919 | 0.614286 | 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 |
bee2b11e9dd045e23520bd35860e4375107105c7 | 7,933 | py | Python | tests/functional/given/git.py | JrGoodle/clowder | 864afacfc7122e937f7087e233c61d05fd007af2 | [
"MIT"
] | 12 | 2016-02-12T02:37:24.000Z | 2021-01-04T05:14:12.000Z | tests/functional/given/git.py | JrGoodle/clowder | 864afacfc7122e937f7087e233c61d05fd007af2 | [
"MIT"
] | 370 | 2015-07-06T22:59:08.000Z | 2021-10-01T14:58:17.000Z | tests/functional/given/git.py | JrGoodle/clowder | 864afacfc7122e937f7087e233c61d05fd007af2 | [
"MIT"
] | 3 | 2015-10-22T18:45:31.000Z | 2018-10-16T15:30:30.000Z | """New syntax test file"""
from pathlib import Path
from pytest_bdd import given, parsers
import tests.functional.util as util
@given(parsers.parse("repo at {directory} is on {start_branch}"))
@given(parsers.parse("project at {directory} is on {start_branch}"))
@given("project at <directory> is on <start_branch>")
def given_directory_on_start_branch(tmp_path: Path, directory: str, start_branch: str) -> None:
path = tmp_path / directory
assert util.is_on_active_branch(path, start_branch)
@given("project at <directory> is on <test_branch>")
def given_directory_on_test_branch(tmp_path: Path, directory: str, test_branch: str) -> None:
path = tmp_path / directory
assert util.is_on_active_branch(path, test_branch)
@given(parsers.parse("repo at {directory} has local branch {test_branch}"))
@given(parsers.parse("project at {directory} has local branch {test_branch}"))
@given("project at <directory> has local <test_branch>")
def given_directory_has_local_branch(tmp_path: Path, directory: str, test_branch: str) -> None:
assert util.local_branch_exists(tmp_path / directory, test_branch)
@given(parsers.parse("repo at {directory} has no local branch {test_branch}"))
@given(parsers.parse("project at {directory} has no local branch {test_branch}"))
@given("project at <directory> has no local <test_branch>")
def given_directory_has_no_local_branch(tmp_path: Path, directory: str, test_branch: str) -> None:
assert not util.local_branch_exists(tmp_path / directory, test_branch)
@given(parsers.parse("repo at {directory} has no remote branch {test_branch}"))
@given(parsers.parse("project at {directory} has no remote branch {test_branch}"))
@given("project at <directory> has no remote <test_branch>")
def given_directory_has_no_remote_branch(tmp_path: Path, directory: str, test_branch: str) -> None:
assert not util.remote_branch_exists(tmp_path / directory, test_branch)
@given(parsers.parse("repo at {directory} has remote branch {test_branch}"))
@given(parsers.parse("project at {directory} has remote branch {test_branch}"))
@given("project at <directory> has remote <test_branch>")
def given_directory_has_remote_branch(tmp_path: Path, directory: str, test_branch: str) -> None:
assert util.remote_branch_exists(tmp_path / directory, test_branch)
@given(parsers.parse("repo at {directory} is on branch {branch}"))
@given(parsers.parse("project at {directory} is on branch {branch}"))
@given("project at <directory> is on <branch>")
def given_directory_branch(tmp_path: Path, directory: str, branch: str) -> None:
path = tmp_path / directory
assert util.is_on_active_branch(path, branch)
@given(parsers.parse("repo at {directory} is on tag {tag}"))
@given(parsers.parse("project at {directory} is on tag {tag}"))
@given("project at <directory> is on <tag>")
def given_directory_tag(tmp_path: Path, directory: str, tag: str) -> None:
path = tmp_path / directory
assert util.is_on_tag(path, tag)
@given(parsers.parse("repo at {directory} is on commit {commit}"))
@given(parsers.parse("project at {directory} is on commit {commit}"))
@given("project at <directory> is on <commit>")
def given_directory_commit(tmp_path: Path, directory: str, commit: str) -> None:
path = tmp_path / directory
assert util.is_on_commit(path, commit)
@given(parsers.parse("repo at {directory} has detached HEAD"))
@given(parsers.parse("project at {directory} has detached HEAD"))
@given("project at <directory> has detached HEAD")
def given_directory_detached_head(tmp_path: Path, directory: str) -> None:
path = tmp_path / directory
assert util.is_detached_head(path)
@given(parsers.parse("repo at {directory} has remote tag {tag}"))
@given(parsers.parse("project at {directory} has remote tag {tag}"))
@given("project at <directory> has remote <tag>")
def given_directory_tag(tmp_path: Path, directory: str, tag: str) -> None:
path = tmp_path / directory
assert util.is_on_tag(path, tag)
@given(parsers.parse("repo at {directory} is clean"))
@given(parsers.parse("project at {directory} is clean"))
@given("project at <directory> is clean")
def given_directory_clean(tmp_path: Path, directory: str) -> None:
path = tmp_path / directory
assert not util.is_dirty(path)
@given(parsers.parse("repo at {directory} is dirty"))
@given(parsers.parse("project at {directory} is dirty"))
@given("project at <directory> is dirty")
def given_directory_dirty(tmp_path: Path, directory: str) -> None:
path = tmp_path / directory
assert util.is_dirty(path)
@given(parsers.parse("repo at {directory} has untracked file {filename}"))
@given(parsers.parse("project at {directory} has untracked file {filename}"))
@given("project at <directory> has untracked file <filename>")
def given_has_untracked_file(tmp_path: Path, directory: str, filename: str) -> None:
path = tmp_path / directory
assert util.has_untracked_file(path, filename)
@given(parsers.parse("repo at {directory} has tracking branch {test_branch}"))
@given(parsers.parse("project at {directory} has tracking branch {test_branch}"))
@given("project at <directory> has tracking <test_branch>")
def given_directory_has_tracking_branch(tmp_path: Path, directory: str, test_branch: str) -> None:
path = tmp_path / directory
assert util.tracking_branch_exists(path, test_branch)
@given(parsers.parse("repo at {directory} has no tracking branch {test_branch}"))
@given(parsers.parse("project at {directory} has no tracking branch {test_branch}"))
@given("project at <directory> has no tracking <test_branch>")
def given_directory_has_no_tracking_branch(tmp_path: Path, directory: str, test_branch: str) -> None:
path = tmp_path / directory
assert not util.tracking_branch_exists(path, test_branch)
@given(parsers.parse("GitHub {repo} has remote tag {tag}"))
@given("GitHub <repo> has remote <tag>")
def given_github_repo_has_remote_tag(tmp_path: Path, repo: str, tag: str) -> None:
path = tmp_path
url = f"https://github.com/{repo}"
assert util.has_remote_tag(path, tag, url)
@given(parsers.parse("GitHub {repo} has no remote tag {tag}"))
@given("GitHub <repo> has no remote <tag>")
def given_github_repo_has_no_remote_tag(tmp_path: Path, repo: str, tag: str) -> None:
path = tmp_path
url = f"https://github.com/{repo}"
assert not util.has_remote_tag(path, tag, url)
@given("<test_directory> is a git repository")
def given_test_dir_is_git_repo(tmp_path: Path, test_directory: str) -> None:
path = tmp_path / test_directory
assert path.exists()
assert path.is_dir()
assert util.has_git_directory(path)
@given("project at <directory> doesn't have lfs installed")
def given_has_no_lfs_installed(tmp_path: Path, directory: str) -> None:
path = tmp_path / directory
util.uninstall_lfs_hooks_filters(path)
assert not util.lfs_hooks_installed(path)
assert not util.lfs_filters_installed(path)
@given("lfs is not installed")
def given_has_no_lfs_installed(tmp_path: Path) -> None:
path = tmp_path
util.uninstall_lfs_hooks_filters(path)
assert not util.lfs_hooks_installed(path)
assert not util.lfs_filters_installed(path)
@given(parsers.parse("{filename} file doesn't exist in directory {directory}"))
@given("<filename> doesn't exist in <directory>")
def given_has_no_file_in_directory(tmp_path: Path, filename: str, directory: str) -> None:
path = tmp_path / directory / filename
assert not path.exists()
@given("<filename> in <directory> is an lfs pointer")
def given_file_is_lfs_pointer(tmp_path: Path, filename: str, directory: str) -> None:
path = tmp_path / directory
assert util.is_lfs_file_pointer(path, filename)
@given("<filename> in <directory> is not an lfs pointer")
def given_file_is_not_lfs_pointer(tmp_path: Path, filename: str, directory: str) -> None:
path = tmp_path / directory
assert util.is_lfs_file_not_pointer(path, filename)
| 41.973545 | 101 | 0.742972 | 1,176 | 7,933 | 4.806122 | 0.056973 | 0.059448 | 0.099257 | 0.053079 | 0.881104 | 0.833333 | 0.785563 | 0.642427 | 0.570064 | 0.492569 | 0 | 0 | 0.131602 | 7,933 | 188 | 102 | 42.196809 | 0.820438 | 0.002521 | 0 | 0.220588 | 0 | 0 | 0.317187 | 0 | 0 | 0 | 0 | 0 | 0.205882 | 1 | 0.176471 | false | 0 | 0.022059 | 0 | 0.198529 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 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 |
beef4b341743077e77447cd225e44133e3d1ea05 | 182 | py | Python | examples/15_component_micropython/packages/micropython-v1.10.1/docs/code-completion/uzlib.py | ghsecuritylab/W601_IoT_Board | c86a7c1dc971bd89b0afccff5cab462361effe4c | [
"Apache-2.0"
] | 284 | 2018-12-11T11:37:14.000Z | 2022-03-29T06:39:27.000Z | examples/15_component_micropython/packages/micropython-v1.10.1/docs/code-completion/uzlib.py | ghsecuritylab/W601_IoT_Board | c86a7c1dc971bd89b0afccff5cab462361effe4c | [
"Apache-2.0"
] | 14 | 2018-12-12T05:48:02.000Z | 2021-09-04T10:25:58.000Z | examples/15_component_micropython/packages/micropython-v1.10.1/docs/code-completion/uzlib.py | ghsecuritylab/W601_IoT_Board | c86a7c1dc971bd89b0afccff5cab462361effe4c | [
"Apache-2.0"
] | 200 | 2018-12-11T12:57:33.000Z | 2022-03-25T08:49:14.000Z | """
uzlib 模块实现了使用 DEFLATE 算法解压缩二进制数据 (常用的 zlib 库和 gzip 文档)。目前不支持压缩。
"""
def decompress(data) -> None:
"""打开一个文件,关联到内建函数open()。所有端口 (用于访问文件系统) 需要支持模式参数,但支持其他参数不同的端口。"""
...
| 20.222222 | 69 | 0.664835 | 20 | 182 | 6.05 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.159341 | 182 | 8 | 70 | 22.75 | 0.79085 | 0.675824 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
831b76c19bc2ed566c4fe8d93b66b034b179fc86 | 1,024 | py | Python | precourse.py | ninja247/ML-Precourse | 71b5192956319ac2161666d41eeb039cdf8d4d43 | [
"MIT"
] | null | null | null | precourse.py | ninja247/ML-Precourse | 71b5192956319ac2161666d41eeb039cdf8d4d43 | [
"MIT"
] | null | null | null | precourse.py | ninja247/ML-Precourse | 71b5192956319ac2161666d41eeb039cdf8d4d43 | [
"MIT"
] | null | null | null | # Machine Learning/Data Science Precourse Work
# ###
# LAMBDA SCHOOL
# ###
# MIT LICENSE
# ###
from numpy.polynomial import Polynomial
import numpy as np
import math
c = [1, 0, 0]
f = Polynomial(c)
d = [1, 0, 0, 0]
f_2 = Polynomial(d)
e = [1, 0, 5, 0]
f_3 = Polynomial(e)
def f(x):
return x ** 2
def f_2(x):
return x ** 3
def f_3(x):
return x ** 3 + 5 * x
def d_f(x):
d_f = f.deriv()
#d_f = 2*x
return d_f(x)
def d_f_2(x):
d_f_2 = f_2.deriv()
#d_f_2 = 3 * x ** 2
return d_f_2(x)
def d_f_3(x):
d_f_3 = f_3.deriv()
#d_f_2 = 3*x**2 + 5
return d_f_3(x)
def vector_sum(x,y):
return np.add(x,y)
def vector_less(x,y):
return np.subtract(x,y)
def vector_magnitude(x):
return math.sqrt(sum(np.square(x)))
def vec5():
return np.array([1, 1, 1, 1, 1])
def vec3():
return np.array([0, 0, 0])
def vec2_1():
return np.array([1, 0])
def vec2_2():
return np.array([0, 1])
def matrix_multiply(vec, matrix):
return np.dot(vec, matrix)
| 14.422535 | 46 | 0.573242 | 204 | 1,024 | 2.720588 | 0.230392 | 0.043243 | 0.032432 | 0.032432 | 0.03964 | 0.03964 | 0.03964 | 0 | 0 | 0 | 0 | 0.069463 | 0.254883 | 1,024 | 70 | 47 | 14.628571 | 0.657929 | 0.115234 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.35 | false | 0 | 0.075 | 0.275 | 0.775 | 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 |
8321138dff101173264bc9604761d83995c6dd9c | 388 | py | Python | Source Code/04_ phonenumber.py | insanecodes/Python | e3e022fa5ff83e418dae32c661296224fc8ded36 | [
"MIT"
] | 22 | 2020-10-11T13:56:25.000Z | 2021-11-10T12:53:10.000Z | Source Code/04_ phonenumber.py | insanecodes/Python | e3e022fa5ff83e418dae32c661296224fc8ded36 | [
"MIT"
] | null | null | null | Source Code/04_ phonenumber.py | insanecodes/Python | e3e022fa5ff83e418dae32c661296224fc8ded36 | [
"MIT"
] | 8 | 2020-10-16T12:58:29.000Z | 2021-12-30T01:28:16.000Z | import phonenumbers
from phonenumbers import geocoder
from phonenumbers import carrier
from phonenumbers import timezone
phone_number = phonenumbers.parse("Enter Number")
# Indian phone number example: 91**********
print(geocoder.description_for_number(phone_number,'en'))
print(carrier.name_for_number(phone_number,'en'))
print(timezone.time_zones_for_number(phone_number))
| 32.333333 | 58 | 0.796392 | 49 | 388 | 6.081633 | 0.408163 | 0.184564 | 0.221477 | 0.201342 | 0.181208 | 0.181208 | 0 | 0 | 0 | 0 | 0 | 0.005747 | 0.103093 | 388 | 11 | 59 | 35.272727 | 0.850575 | 0.10567 | 0 | 0 | 0 | 0 | 0.047904 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0.375 | 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 |
83375acc5d8d7c663ae543b97162f298c2a6675a | 781 | py | Python | snippet_service/settings.py | xfenix/microservice-snippet | 7ec11df41e0f359d68c95dc9832ef8ec54cc8596 | [
"MIT"
] | null | null | null | snippet_service/settings.py | xfenix/microservice-snippet | 7ec11df41e0f359d68c95dc9832ef8ec54cc8596 | [
"MIT"
] | 1 | 2021-06-02T19:58:25.000Z | 2021-06-02T19:58:25.000Z | snippet_service/settings.py | xfenix/microservice-snippet | 7ec11df41e0f359d68c95dc9832ef8ec54cc8596 | [
"MIT"
] | 1 | 2021-11-11T13:06:57.000Z | 2021-11-11T13:06:57.000Z | """All settings here."""
import pathlib
import envcast
SENTRY_DSN: str = envcast.env("SNIPPET_SENTRY_DSN")
API_PREFIX: str = envcast.env("SNIPPET_API_PREFIX").rstrip("/")
FILE_STORAGE_ROOT: pathlib.Path = envcast.env("SNIPPET_FILE_STORAGE_ROOT", "/srv/storage/", type_cast=pathlib.Path)
PARSER_PROVIDER: str = envcast.env("SNIPPET_PARSER", "snippet_service.parser:AsyncBSParser")
STORAGE_PROVIDER: str = envcast.env("SNIPPET_STORAGE", "snippet_service.storage:DummyStorage")
COMEBACKER_ACTOR: str = envcast.env("SNIPPET_COMEBACKER")
HTTP_COMEBACKER_DESTINATON: str = envcast.env("SNIPPET_HTTP_COMEBACKER_DESTINATON")
KAFKA_COMEBACKER_BOOTSTRAP: str = envcast.env("SNIPPET_KAFKA_COMEBACKER_BOOTSTRAP")
KAFKA_COMEBACKER_TOPIC: str = envcast.env("SNIPPET_KAFKA_COMEBACKER_TOPIC")
| 45.941176 | 115 | 0.81178 | 100 | 781 | 5.99 | 0.33 | 0.15025 | 0.255426 | 0.267112 | 0.210351 | 0.116861 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065301 | 781 | 16 | 116 | 48.8125 | 0.820548 | 0.023047 | 0 | 0 | 0 | 0 | 0.385733 | 0.257596 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.181818 | 0 | 0.181818 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
833dd0e7a98f54509016f68d117cecc1f144fdd0 | 60 | py | Python | mapper.py | divir94/News-Analytics | 1fcf2b11e38f9b0c182160dfded7be44d5a7c8bb | [
"Apache-2.0"
] | null | null | null | mapper.py | divir94/News-Analytics | 1fcf2b11e38f9b0c182160dfded7be44d5a7c8bb | [
"Apache-2.0"
] | null | null | null | mapper.py | divir94/News-Analytics | 1fcf2b11e38f9b0c182160dfded7be44d5a7c8bb | [
"Apache-2.0"
] | null | null | null | '''
Created on May 30, 2014
@author: vidurjoshi
'''
def
| 6.666667 | 23 | 0.616667 | 8 | 60 | 4.625 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130435 | 0.233333 | 60 | 8 | 24 | 7.5 | 0.673913 | 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 |
8356332c60839fbad701b91c19c77753f13ccdc7 | 123 | py | Python | examples/ls.py | cloudagon/prey | a0524f5efc7aada8c83fade45ce2e56b0549fafe | [
"MIT"
] | null | null | null | examples/ls.py | cloudagon/prey | a0524f5efc7aada8c83fade45ce2e56b0549fafe | [
"MIT"
] | 2 | 2021-05-18T17:02:34.000Z | 2021-05-18T20:38:13.000Z | examples/ls.py | sachinraja/prey | a0524f5efc7aada8c83fade45ce2e56b0549fafe | [
"MIT"
] | null | null | null | #!/usr/bin/env prey
async def main():
await x("ls -a")
cd("..")
a = await x("ls")
await asyncio.sleep(2)
| 13.666667 | 26 | 0.512195 | 20 | 123 | 3.15 | 0.75 | 0.190476 | 0.253968 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011111 | 0.268293 | 123 | 8 | 27 | 15.375 | 0.688889 | 0.146341 | 0 | 0 | 0 | 0 | 0.086538 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
83662a687f00fa457d69800d43c1af00dd4109c4 | 228 | py | Python | modules.py | pennacap/DISCORD-BOT | d56b4dd6c4cb27451a31d0e4335c5fdb8428cd49 | [
"MIT"
] | 12 | 2019-06-05T09:32:07.000Z | 2019-10-16T08:53:38.000Z | modules.py | pennacap/DISCORD-BOT | d56b4dd6c4cb27451a31d0e4335c5fdb8428cd49 | [
"MIT"
] | null | null | null | modules.py | pennacap/DISCORD-BOT | d56b4dd6c4cb27451a31d0e4335c5fdb8428cd49 | [
"MIT"
] | 1 | 2022-02-21T05:24:17.000Z | 2022-02-21T05:24:17.000Z | #here are the libraries you will be needing to set up your own BOT
import discord
from discord.ext import commands
from discord.ext.commands import Bot
import asyncio
from itertools import cycle5
import json
import os
| 22.8 | 67 | 0.789474 | 37 | 228 | 4.864865 | 0.648649 | 0.1 | 0.155556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005435 | 0.192982 | 228 | 9 | 68 | 25.333333 | 0.972826 | 0.285088 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
55d1798ef037f94e2019a0827826dd84a8fb36a5 | 164 | py | Python | src/baxter_kdl/__init__.py | tanmayshankar/baxter_pykdl | d366003c5acee96f759f773abf05249e392a27a7 | [
"BSD-3-Clause"
] | 43 | 2019-05-29T09:51:05.000Z | 2022-03-31T07:34:47.000Z | src/baxter_kdl/__init__.py | tanmayshankar/baxter_pykdl | d366003c5acee96f759f773abf05249e392a27a7 | [
"BSD-3-Clause"
] | 22 | 2019-11-20T08:19:22.000Z | 2022-03-30T22:37:44.000Z | src/baxter_kdl/__init__.py | tanmayshankar/baxter_pykdl | d366003c5acee96f759f773abf05249e392a27a7 | [
"BSD-3-Clause"
] | 27 | 2016-01-06T20:57:33.000Z | 2021-11-29T08:11:56.000Z | from .kdl_parser import (
euler_to_quat,
urdf_pose_to_kdl_frame,
urdf_joint_to_kdl_joint,
urdf_inertial_to_kdl_rbi,
kdl_tree_from_urdf_model,
)
| 20.5 | 29 | 0.768293 | 27 | 164 | 3.962963 | 0.555556 | 0.140187 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.182927 | 164 | 7 | 30 | 23.428571 | 0.798507 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.142857 | 0 | 0.142857 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
55ddd6c827c1bc138ef21b6073f90346cedde6b6 | 2,440 | py | Python | glance/policies/metadef.py | jaeeuncho34/glance-1 | 2291fe673ec2f875bfc4c49e8ee487c074f1b027 | [
"Apache-2.0"
] | null | null | null | glance/policies/metadef.py | jaeeuncho34/glance-1 | 2291fe673ec2f875bfc4c49e8ee487c074f1b027 | [
"Apache-2.0"
] | null | null | null | glance/policies/metadef.py | jaeeuncho34/glance-1 | 2291fe673ec2f875bfc4c49e8ee487c074f1b027 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_policy import policy
metadef_policies = [
policy.RuleDefault(name="get_metadef_namespace", check_str="rule:default"),
policy.RuleDefault(name="get_metadef_namespaces",
check_str="rule:default"),
policy.RuleDefault(name="modify_metadef_namespace",
check_str="rule:default"),
policy.RuleDefault(name="add_metadef_namespace", check_str="rule:default"),
policy.RuleDefault(name="get_metadef_object", check_str="rule:default"),
policy.RuleDefault(name="get_metadef_objects", check_str="rule:default"),
policy.RuleDefault(name="modify_metadef_object", check_str="rule:default"),
policy.RuleDefault(name="add_metadef_object", check_str="rule:default"),
policy.RuleDefault(name="list_metadef_resource_types",
check_str="rule:default"),
policy.RuleDefault(name="get_metadef_resource_type",
check_str="rule:default"),
policy.RuleDefault(name="add_metadef_resource_type_association",
check_str="rule:default"),
policy.RuleDefault(name="get_metadef_property", check_str="rule:default"),
policy.RuleDefault(name="get_metadef_properties",
check_str="rule:default"),
policy.RuleDefault(name="modify_metadef_property",
check_str="rule:default"),
policy.RuleDefault(name="add_metadef_property", check_str="rule:default"),
policy.RuleDefault(name="get_metadef_tag", check_str="rule:default"),
policy.RuleDefault(name="get_metadef_tags", check_str="rule:default"),
policy.RuleDefault(name="modify_metadef_tag", check_str="rule:default"),
policy.RuleDefault(name="add_metadef_tag", check_str="rule:default"),
policy.RuleDefault(name="add_metadef_tags", check_str="rule:default"),
]
def list_rules():
return metadef_policies
| 46.037736 | 79 | 0.709836 | 303 | 2,440 | 5.491749 | 0.29703 | 0.204327 | 0.252404 | 0.228365 | 0.653846 | 0.639423 | 0.623197 | 0.623197 | 0.623197 | 0.225361 | 0 | 0.001987 | 0.175 | 2,440 | 52 | 80 | 46.923077 | 0.82464 | 0.22377 | 0 | 0.21875 | 0 | 0 | 0.350186 | 0.129324 | 0 | 0 | 0 | 0 | 0 | 1 | 0.03125 | false | 0 | 0.03125 | 0.03125 | 0.09375 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3611c2dfb2bf8ea65494a92bb10937202ba167bc | 114 | py | Python | main.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | main.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | main.py | sphexoo/vlc_yt_downloader | c43f419f6fa3d2703cefc8eb2eedb966046a98ab | [
"MIT"
] | null | null | null | import tkinter as tk
from window import Window
if __name__ == "__main__":
root = Window()
root.mainloop() | 19 | 26 | 0.692982 | 15 | 114 | 4.733333 | 0.733333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.210526 | 114 | 6 | 27 | 19 | 0.788889 | 0 | 0 | 0 | 0 | 0 | 0.069565 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
362af1326f64a00c28063270c8b5fd784b9e7eef | 69 | py | Python | terra_sdk/core/treasury/__init__.py | sejalsahni/terra.py | 0fd84969441c58427a21448520697c3ab3ec2d0c | [
"MIT"
] | 24 | 2021-05-30T05:48:33.000Z | 2021-10-07T04:47:15.000Z | terra_sdk/core/treasury/__init__.py | sejalsahni/terra.py | 0fd84969441c58427a21448520697c3ab3ec2d0c | [
"MIT"
] | 18 | 2021-05-30T09:05:26.000Z | 2021-10-17T07:12:12.000Z | terra_sdk/core/treasury/__init__.py | sejalsahni/terra.py | 0fd84969441c58427a21448520697c3ab3ec2d0c | [
"MIT"
] | 10 | 2021-02-11T00:56:04.000Z | 2021-05-27T08:37:49.000Z | from .data import PolicyConstraints
__all__ = ["PolicyConstraints"]
| 17.25 | 35 | 0.797101 | 6 | 69 | 8.5 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.115942 | 69 | 3 | 36 | 23 | 0.836066 | 0 | 0 | 0 | 0 | 0 | 0.246377 | 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 |
362c6df3440ceeabaf32511854851c752e7efdf0 | 268 | py | Python | example/config_override.py | Swall0w/tacs | 23f28a947391762fd086a43750b93546ed2a33c7 | [
"Apache-2.0"
] | null | null | null | example/config_override.py | Swall0w/tacs | 23f28a947391762fd086a43750b93546ed2a33c7 | [
"Apache-2.0"
] | null | null | null | example/config_override.py | Swall0w/tacs | 23f28a947391762fd086a43750b93546ed2a33c7 | [
"Apache-2.0"
] | null | null | null | # NB: This file is used in unit tests in tests.py; do not change unless you know
# what you're doing
from tacs.config import CfgNode as CN
HYPERPARAMETER_1_BASE_VALUE = 1.0
cfg = CN()
cfg.TRAIN = CN()
cfg.TRAIN.HYPERPARAMETER_1 = 0.9 * HYPERPARAMETER_1_BASE_VALUE
| 22.333333 | 80 | 0.753731 | 49 | 268 | 3.979592 | 0.673469 | 0.230769 | 0.194872 | 0.246154 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.03139 | 0.16791 | 268 | 11 | 81 | 24.363636 | 0.843049 | 0.358209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.2 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
363e3ec7eb9923b7e0f73cc930bf53fe7c94495a | 274 | py | Python | Exe9_quadrado_10_termos.py | lucaslk122/Exercicios-com-lista | 3e614a865f93afa2ff6a32f8da04abb0c0716cdc | [
"MIT"
] | null | null | null | Exe9_quadrado_10_termos.py | lucaslk122/Exercicios-com-lista | 3e614a865f93afa2ff6a32f8da04abb0c0716cdc | [
"MIT"
] | null | null | null | Exe9_quadrado_10_termos.py | lucaslk122/Exercicios-com-lista | 3e614a865f93afa2ff6a32f8da04abb0c0716cdc | [
"MIT"
] | null | null | null | valores =[]
valores_quadrado =[]
for i in range(10):
valores.append(int(input("Digite um numero inteiro: ")))
for i in valores:
valores_quadrado.append(i**2)
print("Valores da lista ao quadrado: ",valores_quadrado)
print("Soma dos quadrados: ",sum(valores_quadrado)) | 34.25 | 60 | 0.729927 | 40 | 274 | 4.9 | 0.575 | 0.306122 | 0.22449 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012552 | 0.127737 | 274 | 8 | 61 | 34.25 | 0.807531 | 0 | 0 | 0 | 0 | 0 | 0.276364 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
364d5349bb6fc74ef7e2d9887a3762a186173df3 | 274 | py | Python | misc/USRP_init.py | awesome-archive/urh | c8c3aabc9d637ca660d8c72c3d8372055e0f3ec7 | [
"Apache-2.0"
] | 1 | 2017-06-21T02:37:16.000Z | 2017-06-21T02:37:16.000Z | misc/USRP_init.py | dspmandavid/urh | 30643c1a68634b1c97eb9989485a4e96a3b038ae | [
"Apache-2.0"
] | null | null | null | misc/USRP_init.py | dspmandavid/urh | 30643c1a68634b1c97eb9989485a4e96a3b038ae | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from subprocess import call
# call(["ifconfig", "eth0", "192.168.10.1"])
call("sysctl -w net.core.rmem_max=50000000", shell = True)
call("sysctl -w net.core.rmem_max=50000000", shell = True)
call("sysctl -w net.core.wmem_max=1048576", shell = True)
| 30.444444 | 58 | 0.70438 | 45 | 274 | 4.222222 | 0.555556 | 0.157895 | 0.173684 | 0.221053 | 0.536842 | 0.536842 | 0.536842 | 0.536842 | 0.536842 | 0.536842 | 0 | 0.139344 | 0.109489 | 274 | 8 | 59 | 34.25 | 0.639344 | 0.233577 | 0 | 0.5 | 0 | 0 | 0.514423 | 0.370192 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.25 | 0 | 0.25 | 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 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
366b2cbce3f3211ad7eb2c2e5fe4613f5e319290 | 203 | py | Python | colorbox/apps.py | BenjaminCherpas/coop-colorbox | db847f46cb9cd07a3ff071cab81baf827ff68409 | [
"BSD-3-Clause"
] | null | null | null | colorbox/apps.py | BenjaminCherpas/coop-colorbox | db847f46cb9cd07a3ff071cab81baf827ff68409 | [
"BSD-3-Clause"
] | 1 | 2017-02-01T20:57:17.000Z | 2017-02-01T21:16:10.000Z | colorbox/apps.py | ljean/coop-colorbox | 54767053cec1c07a8e83017e97eca5612ad9d202 | [
"BSD-3-Clause"
] | 2 | 2018-08-02T08:25:44.000Z | 2019-08-28T10:14:28.000Z | # -*- coding: utf-8 -*-
"""
apps
"""
from __future__ import unicode_literals
from django.apps import AppConfig
class ColorboxAppConfig(AppConfig):
name = 'colorbox'
verbose_name = "Colorbox"
| 14.5 | 39 | 0.699507 | 22 | 203 | 6.181818 | 0.727273 | 0.176471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005988 | 0.17734 | 203 | 13 | 40 | 15.615385 | 0.808383 | 0.133005 | 0 | 0 | 0 | 0 | 0.095238 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
369654d26778565a1ac516bc71b87a92fc306c6b | 103 | py | Python | CursoEmVideo/111Cev/111 - Mod_Moeda.py | yazdejesus/FirstLessons-Python | e2c2d75c3aba459669c972a3c959b18ecc82e030 | [
"MIT"
] | null | null | null | CursoEmVideo/111Cev/111 - Mod_Moeda.py | yazdejesus/FirstLessons-Python | e2c2d75c3aba459669c972a3c959b18ecc82e030 | [
"MIT"
] | 1 | 2021-01-28T17:06:06.000Z | 2021-01-30T15:13:03.000Z | CursoEmVideo/111Cev/111 - Mod_Moeda.py | yazdejesus/FirstLessons-Python | e2c2d75c3aba459669c972a3c959b18ecc82e030 | [
"MIT"
] | null | null | null | from utilidadesCeV import moeda
tako = float(input('Digite o preço: MZN_'))
moeda.resumo(tako, 22, 11) | 25.75 | 43 | 0.747573 | 16 | 103 | 4.75 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.044444 | 0.126214 | 103 | 4 | 44 | 25.75 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0.192308 | 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 |
36968f2e1b7894edbd5d31a65bdb46ee0954038a | 226 | py | Python | co2_9.py | ronawilson/mcalab | 464ea03419ec47b81b21405c348ca8cbd6ca68c5 | [
"MIT"
] | null | null | null | co2_9.py | ronawilson/mcalab | 464ea03419ec47b81b21405c348ca8cbd6ca68c5 | [
"MIT"
] | null | null | null | co2_9.py | ronawilson/mcalab | 464ea03419ec47b81b21405c348ca8cbd6ca68c5 | [
"MIT"
] | null | null | null | r =int(input("enter the row:"))
for i in range(1, r+1):
for j in range(1, i+1):
print("*", end = " ")
print("\n")
x = r
for j in range(1, r):
for i in range(1, x):
print("*", end = " ")
x = x - 1
print("\n")
| 18.833333 | 31 | 0.473451 | 45 | 226 | 2.377778 | 0.355556 | 0.261682 | 0.299065 | 0.205607 | 0.448598 | 0 | 0 | 0 | 0 | 0 | 0 | 0.042683 | 0.274336 | 226 | 11 | 32 | 20.545455 | 0.609756 | 0 | 0 | 0.363636 | 0 | 0 | 0.097345 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.363636 | 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 |
3698982e395ee928eee299b118f472b09390a7c6 | 99 | py | Python | scrooge/datasource/apps.py | SpisTresci/scrooge | 787b7d5f8ece8f3f24feb4273505e6c0ea60b5d7 | [
"MIT"
] | 1 | 2021-01-04T04:30:24.000Z | 2021-01-04T04:30:24.000Z | scrooge/datasource/apps.py | SpisTresci/scrooge | 787b7d5f8ece8f3f24feb4273505e6c0ea60b5d7 | [
"MIT"
] | 6 | 2019-12-21T03:19:17.000Z | 2020-01-07T07:28:04.000Z | scrooge/datasource/apps.py | SpisTresci/scrooge | 787b7d5f8ece8f3f24feb4273505e6c0ea60b5d7 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class TmpApplicationConfig(AppConfig):
name = 'datasource'
| 16.5 | 38 | 0.777778 | 10 | 99 | 7.7 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.151515 | 99 | 5 | 39 | 19.8 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0.10101 | 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 |
369c7236d7138ba8eefc6bc75e232a610b8226a5 | 860 | py | Python | scripts/updateIGV.py | igvteam/igv-notebook | 1d85c58b21dda0e34589939d5be2191333bf501f | [
"MIT"
] | null | null | null | scripts/updateIGV.py | igvteam/igv-notebook | 1d85c58b21dda0e34589939d5be2191333bf501f | [
"MIT"
] | null | null | null | scripts/updateIGV.py | igvteam/igv-notebook | 1d85c58b21dda0e34589939d5be2191333bf501f | [
"MIT"
] | null | null | null | import requests
remote_url = "https://cdn.jsdelivr.net/npm/igv@2.12.6/dist/igv.min.js"
# Define the local filename to save data
local_file = '../igv_notebook/js/igv.min.js'
# Make http request for remote file data
data = requests.get(remote_url)
# Replace the UMD magic with a window global definition. The UMD header is produced by rollup, this might need to be
# modified if rollup changes, but the basic idea is to assign the value returned by the factory function to "window.igv".
tmp = data.text.replace('function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).igv=e()}', 'function (global, factory) {window.igv = factory()}', 1)
# Save file data to local copy
with open(local_file, 'w')as file:
file.write(tmp)
| 45.263158 | 281 | 0.737209 | 141 | 860 | 4.460993 | 0.539007 | 0.028617 | 0.025437 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00664 | 0.124419 | 860 | 18 | 282 | 47.777778 | 0.828685 | 0.397674 | 0 | 0 | 0 | 0.285714 | 0.648438 | 0.431641 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 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 | 1 | 1 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
369f11b3a7abffa9fe988b92afcabbfc7234c640 | 3,509 | py | Python | routes/product_category.py | 1930346/SmartNet | be6973bafec1b71b474359718680d592e908e7aa | [
"MIT"
] | 1 | 2022-03-17T08:10:48.000Z | 2022-03-17T08:10:48.000Z | routes/product_category.py | 1930346/SmartNet | be6973bafec1b71b474359718680d592e908e7aa | [
"MIT"
] | null | null | null | routes/product_category.py | 1930346/SmartNet | be6973bafec1b71b474359718680d592e908e7aa | [
"MIT"
] | null | null | null | #Archivo para rutas USER
#Este modulo permite definir subrutas o rutas por separado, response es para respuestas HTTP
import datetime
from sqlalchemy.sql import func
from fastapi import APIRouter, Response, status
#Esto solo me dice a donde conectarme, no hay un schema
from config.db import conn
#Aquí traemos el schema
from models.product_categories import product_categories
#Llamada al schema usuario para crear uno
from schemas.product_category import Product_category, Product_category_outs, Product_category_update, Product_category_in
#Modulo para generar una función de cifrado
from cryptography.fernet import Fernet
#Ahora para scar los codigos HTTP
from starlette.status import HTTP_204_NO_CONTENT
product_category = APIRouter()
"""
Endpoint para obtener todos los product_categories
@return: lista de product_categories
"""
#Obtiene todos los product_categories
@product_category.get("/product_categories", response_model=list[Product_category_outs], tags=["product_categories"])
def get_product_categories():
return conn.execute(product_categories.select()).fetchall()
"""
Endpoint para obtener un product_category a través de un ID
@param: id_product_category: id del product_category
@return: un product_category
"""
#Obtiene un product_category por id
@product_category.get("/product_categories/{id}", response_model=Product_category_outs, tags=["product_categories"])
def get_product_category(id: str):
return conn.execute(product_categories.select().where(product_categories.c.id == id)).first()
"""
Endpoint para crear un product_category
@param: product_category: información del product_category
@return: un product_category
"""
#Creación de un product_category
@product_category.post("/product_categories", response_model=Product_category_outs, tags=["product_categories"])
def create_product_category(product_category: Product_category_in):
new_product_category = {
"name": product_category.name,
"description": product_category.description
}
result = conn.execute(product_categories.insert().values(new_product_category))
return conn.execute(product_categories.select().where(product_categories.c.id == result.lastrowid)).first()
"""
Endpoint para borrar un product_category
@param: product_category: información del product_category
@return: HTTP_204_NO_CONTENT
"""
#Eliminación de un product_category
@product_category.delete("/product_categories/{id}", status_code=status.HTTP_204_NO_CONTENT, tags=["product_categories"])
def delete_product_category(id: str):
conn.execute(product_categories.delete().where(product_categories.c.id == id))
return Response(status_code=HTTP_204_NO_CONTENT)
"""
Endpoint para actualizar un product_category
@param: product_category: información del product_category
@return: un product_category
"""
#Actualización de un product_category
@product_category.put("/product_categories/{id}", response_model=Product_category_outs, tags=["product_categories"])
def update_product_category(id: str, product_category: Product_category_update):
conn.execute(product_categories.update().values(
name=product_category.name,
description=product_category.description,
modified_at= func.now() #ask for this
).where(product_categories.c.id == id))
return conn.execute(product_categories.select().where(product_categories.c.id == id)).first()
| 44.417722 | 123 | 0.77287 | 444 | 3,509 | 5.855856 | 0.259009 | 0.276923 | 0.071923 | 0.080769 | 0.44 | 0.419615 | 0.365 | 0.326154 | 0.28 | 0.234231 | 0 | 0.00397 | 0.138501 | 3,509 | 78 | 124 | 44.987179 | 0.856103 | 0.138786 | 0 | 0.057143 | 0 | 0 | 0.09689 | 0.032447 | 0 | 0 | 0 | 0.025641 | 0 | 1 | 0.142857 | false | 0 | 0.228571 | 0.057143 | 0.514286 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
36ac6f5ca573107141b3d569c5707a6a61f4b7cd | 1,617 | py | Python | src/executor/iExecutor.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 3 | 2020-02-12T01:24:46.000Z | 2020-02-13T00:50:46.000Z | src/executor/iExecutor.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 32 | 2020-02-20T10:20:56.000Z | 2022-02-10T01:42:46.000Z | src/executor/iExecutor.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 1 | 2020-02-22T02:47:19.000Z | 2020-02-22T02:47:19.000Z | from abc import ABC, abstractmethod
from typing import Union
from ..data.MetaDataItem import MetaDataItem
from ..data.VideoItem import VideoItem
from collections import Iterable
class iExecutor(ABC):
def __init__(self, parents=None, stateful=False):
if parents is None:
parents = []
self.stateful = stateful
self.prev = parents if isinstance(parents, Iterable) else [parents]
self.next = None
for parent in self.prev:
if parent:
parent.set_next(self)
super().__init__()
@abstractmethod
def run(self, item: VideoItem):
pass
def set_next(self, child):
if self.next: raise RuntimeError("Executor already has child")
self.next = child
def add_prev(self, prev):
self.prev.append(prev)
def get_name(self):
cls = self.__class__
return cls.__module__ + '.' + cls.__name__
def get_executor(self):
return self
def register_shared(self, manager):
pass
def shared(self, manager):
return None
def get_next(self):
return self.next
def set_lock(self, lock):
self.lock = lock
def get_lock(self):
return self.lock
def is_stateful(self):
return self.stateful
def requires_database(self) -> bool:
return False
@staticmethod
def get_metadata(item: Union[VideoItem, MetaDataItem]) -> MetaDataItem:
if isinstance(item, VideoItem):
return item.metadata
else:
# Therefore item is a MetadataItem
return item
| 23.434783 | 75 | 0.620284 | 189 | 1,617 | 5.137566 | 0.306878 | 0.030896 | 0.057673 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.298083 | 1,617 | 68 | 76 | 23.779412 | 0.855507 | 0.01979 | 0 | 0.040816 | 0 | 0 | 0.017056 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0.040816 | 0.102041 | 0.122449 | 0.591837 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
36af1b1778e3ecf66653637cb73f871d1f558fef | 30 | py | Python | cellpack/mgl_tools/DejaVu/scenarioInterface/Tests/__init__.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | cellpack/mgl_tools/DejaVu/scenarioInterface/Tests/__init__.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | 21 | 2021-10-02T00:07:05.000Z | 2022-03-30T00:02:10.000Z | cellpack/mgl_tools/DejaVu/scenarioInterface/Tests/__init__.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | #
ignore = {"test_actor": []}
| 10 | 27 | 0.533333 | 3 | 30 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.166667 | 30 | 2 | 28 | 15 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0.344828 | 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 |
36c360d53288d5986883fbff1c349579a84d9950 | 114 | py | Python | python/18108_BornIn.py | anothel/BOJ | cfc693322e609d319aaa8705d4375d098c034b76 | [
"MIT"
] | null | null | null | python/18108_BornIn.py | anothel/BOJ | cfc693322e609d319aaa8705d4375d098c034b76 | [
"MIT"
] | null | null | null | python/18108_BornIn.py | anothel/BOJ | cfc693322e609d319aaa8705d4375d098c034b76 | [
"MIT"
] | null | null | null | import sys
def main():
print(int(sys.stdin.readline().strip()) - 543)
if __name__ == "__main__":
main()
| 11.4 | 48 | 0.614035 | 15 | 114 | 4.133333 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032609 | 0.192982 | 114 | 9 | 49 | 12.666667 | 0.641304 | 0 | 0 | 0 | 0 | 0 | 0.070175 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.2 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
36c803c8a610a6ece3da85ed38aaafa4c5cb8125 | 87 | py | Python | Dictionaries/clear-opration.py | tverma332/python3 | 544c4ec9c726c37293c8da5799f50575cc50852d | [
"MIT"
] | 3 | 2022-03-28T09:10:08.000Z | 2022-03-29T10:47:56.000Z | Dictionaries/clear-opration.py | tverma332/python3 | 544c4ec9c726c37293c8da5799f50575cc50852d | [
"MIT"
] | 1 | 2022-03-27T11:52:58.000Z | 2022-03-27T11:52:58.000Z | Dictionaries/clear-opration.py | tverma332/python3 | 544c4ec9c726c37293c8da5799f50575cc50852d | [
"MIT"
] | null | null | null | my_dict={"fruit":"apple","animal":"fox",1:"one","two":2}
my_dict.clear()
print(my_dict) | 29 | 56 | 0.666667 | 16 | 87 | 3.4375 | 0.75 | 0.327273 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023529 | 0.022989 | 87 | 3 | 57 | 29 | 0.623529 | 0 | 0 | 0 | 0 | 0 | 0.284091 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.333333 | 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 |
36cb61ba9d30c6c670bb1db8beacf8f1ad979453 | 613 | py | Python | notification_api/main.py | LandRegistry/dps-notification-api | 0ebf7e78df096c0ea8fe4fa15e61551ee75448ac | [
"MIT"
] | null | null | null | notification_api/main.py | LandRegistry/dps-notification-api | 0ebf7e78df096c0ea8fe4fa15e61551ee75448ac | [
"MIT"
] | null | null | null | notification_api/main.py | LandRegistry/dps-notification-api | 0ebf7e78df096c0ea8fe4fa15e61551ee75448ac | [
"MIT"
] | 1 | 2021-04-11T05:22:04.000Z | 2021-04-11T05:22:04.000Z | # This file is the entry point.
# First we import the app object, which will get initialised as we do it. Then import methods we're about to use.
from notification_api.app import app
from notification_api.extensions import register_extensions
from notification_api.blueprints import register_blueprints
from notification_api.exceptions import register_exception_handlers
# Now we register any extensions we use into the app
register_extensions(app)
# Register the exception handlers
register_exception_handlers(app)
# Finally we register our blueprints to get our routes up and running.
register_blueprints(app)
| 43.785714 | 113 | 0.838499 | 92 | 613 | 5.456522 | 0.456522 | 0.12749 | 0.151394 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.127243 | 613 | 13 | 114 | 47.153846 | 0.938318 | 0.477977 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.571429 | 0 | 0.571429 | 0.285714 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
36d3ceb9e32d51ee25f8448063ab426f53f18e95 | 2,510 | py | Python | webapp/models.py | LSanten/mixbase_live | 4fd98b80cde1348f441e4f5224b42381e04d400e | [
"MIT"
] | null | null | null | webapp/models.py | LSanten/mixbase_live | 4fd98b80cde1348f441e4f5224b42381e04d400e | [
"MIT"
] | 3 | 2020-03-24T17:46:11.000Z | 2021-08-23T20:23:16.000Z | webapp/models.py | LSanten/mixbase_live | 4fd98b80cde1348f441e4f5224b42381e04d400e | [
"MIT"
] | null | null | null | """
Leon Santen
These are the methods of the webmix database as a part of the package in webapp_run.py
"""
from datetime import datetime, date
from webapp import db, login_manager
from flask_login import UserMixin #UserMixin is class that checks user for us
# Athentication of user when log in
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int())
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(20), unique=True, nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
image_file = db.Column(db.String(20), nullable=False, default='default.jpg')
password = db.Column(db.String(60), nullable=False)
pair_posts = db.relationship('Pair', backref='author', lazy=True) #this is a releationship not a column -- backreference to Pair. You can find out author of a pair post by using pair.author #lazy=True --> sqlalchemy will load data directly when used
date_created = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
def __repr__(self):
return f"User('{self.username}', '{self.id}')"
class Pair(db.Model): #data table for transition pair
id = db.Column(db.Integer, primary_key=True)
firstname = db.Column(db.String(30), nullable=False)
secondname = db.Column(db.String(30), nullable=True)
firstartist = db.Column(db.String(30), nullable=False)
secondartist = db.Column(db.String(30), nullable=True)
comment = db.Column(db.Text)
date_posted = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
user_id = db.Column(db.Integer, db.ForeignKey('user.id'), default=1) ## TODO: change nullable back to False when login works
guestname = db.Column(db.String(30), nullable=True)
firstgenre = db.Column(db.String(30), nullable=True)
secondgenre = db.Column(db.String(30), nullable=True)
tags = db.Column(db.Text)
difficulty = db.Column(db.Integer, nullable=True)
#create getter and setter function for creating list that refers to children of transition
#http://frankvalcarcel.com/blog/conveniently-storing-lists-in-database/
_children = db.Column(db.String, default='0')
@property
def children(self):
return [int(x) for x in self._children.split(';')]
@children.setter
def children(self, value):
self._children += ';%s' % value
def __repr__(self):
return f"Pair('{self.firstname}', '{self.secondname}', '{self.date_posted}' )"
| 47.358491 | 253 | 0.712749 | 367 | 2,510 | 4.803815 | 0.367847 | 0.090754 | 0.113443 | 0.108905 | 0.268293 | 0.216676 | 0.216676 | 0.096427 | 0.05899 | 0 | 0 | 0.011837 | 0.158566 | 2,510 | 52 | 254 | 48.269231 | 0.822917 | 0.238645 | 0 | 0.102564 | 0 | 0 | 0.072296 | 0.024802 | 0 | 0 | 0 | 0.019231 | 0 | 1 | 0.128205 | false | 0.025641 | 0.076923 | 0.102564 | 0.897436 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
36f746dc8f689eb0294ec238b0ed6b0d1887de7c | 2,908 | py | Python | cores/PTX/ProgramParser.py | tinochinamora/iw_imdb | 89964024bee7f8eaaa25530a8d40155251345be0 | [
"MIT"
] | 3 | 2021-09-10T08:14:45.000Z | 2022-02-25T04:53:12.000Z | cores/PTX/ProgramParser.py | PrincetonUniversity/ILA-Modeling-Verification | 88964aad8c465c9da82f1ec66425da9f16fc8d29 | [
"MIT"
] | 1 | 2018-06-25T08:49:22.000Z | 2018-06-25T08:49:22.000Z | cores/PTX/ProgramParser.py | PrincetonUniversity/ILA-Modeling-Verification | 88964aad8c465c9da82f1ec66425da9f16fc8d29 | [
"MIT"
] | 3 | 2018-06-26T11:31:40.000Z | 2021-12-01T20:16:21.000Z | import re
import pickle
source_file = "test.ptx"
source_obj = open(source_file)
try:
source_code = source_obj.readlines()
finally:
source_obj.close()
#Remove comment with /**/
instruction_lines = []
comment_flag = False
for source_line in source_code:
if comment_flag:
if source_line.find('*/') == -1:
continue
else:
instruction_lines.append(source_line[source_line.find('*/'):])
comment_flag = False
else:
if source_line.find('/*') == -1:
instruction_lines.append(source_line)
continue
else:
instruction_lines.append(source_line[:source_line.find('/*')])
comment_flag = True
source_code = instruction_lines
instruction_lines = []
#Remove comment with //
for source_line in source_code:
if source_line.find('//') == -1:
instruction_lines.append(source_line)
else:
instruction_lines.append(source_line[0:source_line.find('//')])
source_code = instruction_lines
instruction_lines = []
#Get rid of directive statements
pattern = re.compile(r'\A[\s]*\.[^\s]+')
for source_line in source_code:
match_flag = pattern.match(source_line)
if not match_flag:
instruction_lines.append(source_line)
#Get rid of blank lines
pattern = re.compile(r'\A[\s]*$')
source_code = instruction_lines
instruction_lines = []
for source_line in source_code:
match_flag = pattern.match(source_line)
if not match_flag:
instruction_lines.append(source_line)
#Get rid of comma,;
source_code = instruction_lines
instruction_lines = []
for source_line in source_code:
source_line = source_line.replace(',', '')
source_line = source_line.replace(';', '')
instruction_lines.append(source_line)
#Split lines
source_code = instruction_lines
instruction_lines = []
for source_line in source_code:
instruction_lines.append(source_line.split())
#Delete type eg:.b32
source_lines = instruction_lines
instruction_lines = []
for source_line in source_lines:
token = source_line[0]
source_rest = source_line[1:]
if token[len(token) - 1] == ':':
if len(source_line) > 1:
instruction_lines.append([source_line[0]])
token = source_line[1]
source_rest = source_line[2:]
source_line = []
else:
instruction_lines.append(source_line)
continue
else:
source_line = []
token_split = token.split('.')
source_line.append(token_split[0])
for rest in source_rest:
source_line.append(rest)
instruction_lines.append(source_line)
for instruction_line in instruction_lines:
for token in instruction_line:
print token,
print ' '
#There are 3 types of code now:
# xxxx: opcode oprands
# opcode operands
# @p opcode oprands
program_file = 'program_' + source_file
program_obj = open(program_file, 'w')
pickle.dump(instruction_lines, program_obj)
program_obj.close()
| 26.678899 | 71 | 0.693948 | 380 | 2,908 | 5.026316 | 0.184211 | 0.209424 | 0.13822 | 0.175916 | 0.609948 | 0.556021 | 0.435079 | 0.401571 | 0.358639 | 0.33089 | 0 | 0.006408 | 0.194979 | 2,908 | 108 | 72 | 26.925926 | 0.809483 | 0.080124 | 0 | 0.5 | 0 | 0 | 0.021404 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.02381 | null | null | 0.02381 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7fc5fa1750f6f13e684b3a28677ad965e995d318 | 797 | py | Python | ledplus/webapp/migrations/0020_auto_20180203_0322.py | CCecilia/ledPlus2 | 1d05d860cb3c786ce68efcaa8f5587dde56440e0 | [
"MIT"
] | null | null | null | ledplus/webapp/migrations/0020_auto_20180203_0322.py | CCecilia/ledPlus2 | 1d05d860cb3c786ce68efcaa8f5587dde56440e0 | [
"MIT"
] | null | null | null | ledplus/webapp/migrations/0020_auto_20180203_0322.py | CCecilia/ledPlus2 | 1d05d860cb3c786ce68efcaa8f5587dde56440e0 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.1 on 2018-02-03 03:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('webapp', '0019_auto_20180203_0211'),
]
operations = [
migrations.RemoveField(
model_name='consumptionscaler',
name='service_class',
),
migrations.RemoveField(
model_name='consumptionscaler',
name='utility',
),
migrations.RemoveField(
model_name='consumptionscaler',
name='zone',
),
migrations.RenameField(
model_name='sale',
old_name='supply_rate',
new_name='base_rate',
),
migrations.DeleteModel(
name='ConsumptionScaler',
),
]
| 23.441176 | 47 | 0.550816 | 67 | 797 | 6.373134 | 0.58209 | 0.084309 | 0.18267 | 0.210773 | 0.358314 | 0.358314 | 0 | 0 | 0 | 0 | 0 | 0.05916 | 0.342535 | 797 | 33 | 48 | 24.151515 | 0.755725 | 0.056462 | 0 | 0.407407 | 1 | 0 | 0.193333 | 0.030667 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.037037 | 0 | 0.148148 | 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 |
7fd04cc83adc963eb1191861c5f9ffc6d7313916 | 24,797 | py | Python | src/main.py | pjotr07740/PjFileExplorer | e87d7dd18cae803a64beacc2cb3d03ed98c3dc45 | [
"MIT"
] | null | null | null | src/main.py | pjotr07740/PjFileExplorer | e87d7dd18cae803a64beacc2cb3d03ed98c3dc45 | [
"MIT"
] | 2 | 2020-08-24T14:20:49.000Z | 2020-08-24T14:26:59.000Z | src/main.py | pjotr07740/PjFileExplorer | e87d7dd18cae803a64beacc2cb3d03ed98c3dc45 | [
"MIT"
] | null | null | null | import os
import shutil
from pyfiglet import Figlet
from update_check import isUpToDate, update
dir_path = os.path.dirname(os.path.realpath("main.py"))
enabled = False
if enabled:
if isUpToDate(f"{dir_path}/main.py", "https://raw.githubusercontent.com/pjotr07740/PjFileExplorer/master/src/main.py") == False:
update(f"{dir_path}/main.py", "https://raw.githubusercontent.com/pjotr07740/PjFileExplorer/master/src/main.py")
f = Figlet(font='slant')
class ConsoleColors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
def disable(self):
self.HEADER = ''
self.OKBLUE = ''
self.OKGREEN = ''
self.WARNING = ''
self.FAIL = ''
self.ENDC = ''
class DisplayDirs:
def print(self, path):
try:
dirs = os.listdir(path=path)
except Exception as e:
print(f"Exception: {e}")
for dir in dirs:
if os.path.isdir(f"{path}{dir}"):
print(ConsoleColors.HEADER + f"Folder:{ConsoleColors.OKBLUE} {path}{dir}\\")
else:
print(ConsoleColors.HEADER + f"File:{ConsoleColors.OKBLUE} {path}{dir}")
def print_dirs(self, path):
path = path
try:
dirs = os.listdir(path=path)
except Exception as e:
print(f"Exception: {e}")
for dir in dirs:
if os.path.isdir(f"{path}/{dir}"):
print(ConsoleColors.HEADER + f"Folder:{ConsoleColors.OKBLUE} {dir}")
def print_supported_files(self, path):
path = path
try:
dirs = os.listdir(path=path)
except Exception as e:
print(f"Exception: {e}")
for dir in dirs:
# Audio files
if dir.endswith(".aif"):
print(ConsoleColors.HEADER + f"AIF audio file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cda"):
print(ConsoleColors.HEADER + f"CD audio track file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mid"):
print(ConsoleColors.HEADER + f"MIDI audio file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".midi"):
print(ConsoleColors.HEADER + f"MIDI audio file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mp3"):
print(ConsoleColors.HEADER + f"MP3 audio file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mpa"):
print(ConsoleColors.HEADER + f"MPEG-2 audio file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ogg"):
print(ConsoleColors.HEADER + f"Ogg Vorbis audio file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".wav"):
print(ConsoleColors.HEADER + f"WAV file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".wma"):
print(ConsoleColors.HEADER + f"WMA audio file :{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".wpl"):
print(ConsoleColors.HEADER + f"Windows Media Player playlist:{ConsoleColors.OKBLUE} {dir}")
# Compressed files
elif dir.endswith(".7z"):
print(ConsoleColors.HEADER + f"7-Zip compressed file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".arj"):
print(ConsoleColors.HEADER + f"ARJ compressed file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".deb"):
print(ConsoleColors.HEADER + f"Debian software package file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pkg"):
print(ConsoleColors.HEADER + f"Package file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".rar"):
print(ConsoleColors.HEADER + f"RAR file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".rpm"):
print(ConsoleColors.HEADER + f"Red Hat Package Manager:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".tar.gz"):
print(ConsoleColors.HEADER + f"Tarball compressed file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".z"):
print(ConsoleColors.HEADER + f"Z compressed file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".zip"):
print(ConsoleColors.HEADER + f"Zip compressed file:{ConsoleColors.OKBLUE} {dir}")
# Disc and media files
elif dir.endswith(".bin"):
print(ConsoleColors.HEADER + f"Binary disc image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".dmg"):
print(ConsoleColors.HEADER + f"macOS X disk image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".iso"):
print(ConsoleColors.HEADER + f"ISO disc image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".toast"):
print(ConsoleColors.HEADER + f"Toast disc image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".vcd"):
print(ConsoleColors.HEADER + f"Virtual CD:{ConsoleColors.OKBLUE} {dir}")
# Data and database files
elif dir.endswith(".csv"):
print(ConsoleColors.HEADER + f"Comma separated value file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".dat"):
print(ConsoleColors.HEADER + f"Data file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".db"):
print(ConsoleColors.HEADER + f"Database file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".dbf"):
print(ConsoleColors.HEADER + f"Database file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".log"):
print(ConsoleColors.HEADER + f"Log file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mdb"):
print(ConsoleColors.HEADER + f"Microsoft Access database file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".sav"):
print(ConsoleColors.HEADER + f"Save file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".sql"):
print(ConsoleColors.HEADER + f"SQL database file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".tar"):
print(ConsoleColors.HEADER + f"Linux / Unix tarball file archive:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".xml"):
print(ConsoleColors.HEADER + f"XML file:{ConsoleColors.OKBLUE} {dir}")
# Email File extensions
elif dir.endswith(".email"):
print(ConsoleColors.HEADER + f"Outlook Express e-mail message file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".eml"):
print(ConsoleColors.HEADER + f"E-mail message file from multiple e-mail clients, including Gmail:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".emlx"):
print(ConsoleColors.HEADER + f"Apple Mail e-mail file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".msg"):
print(ConsoleColors.HEADER + f"Microsoft Outlook e-mail message file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".oft"):
print(ConsoleColors.HEADER + f"Microsoft Outlook e-mail template file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ost"):
print(ConsoleColors.HEADER + f"Microsoft Outlook offline e-mail storage file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pst"):
print(ConsoleColors.HEADER + f"Microsoft Outlook e-mail storage file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".vcf"):
print(ConsoleColors.HEADER + f"E-mail contact file:{ConsoleColors.OKBLUE} {dir}")
# Executable file extensions
elif dir.endswith(".apk"):
print(ConsoleColors.HEADER + f"Android package file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".bat"):
print(ConsoleColors.HEADER + f"Batch file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cgi"):
print(ConsoleColors.HEADER + f"Perl script file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".com"):
print(ConsoleColors.HEADER + f"MS-DOS command file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".exe"):
print(ConsoleColors.HEADER + f"Executable file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".gadget"):
print(ConsoleColors.HEADER + f"Windows gadget:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".jar"):
print(ConsoleColors.HEADER + f"Java Archive file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pl"):
print(ConsoleColors.HEADER + f"Perl script file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".msi"):
print(ConsoleColors.HEADER + f"Windows installer package:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".py"):
print(ConsoleColors.HEADER + f"Python file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".wsf"):
print(ConsoleColors.HEADER + f"Windows Script File:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".bin"):
print(ConsoleColors.HEADER + f"Binary file:{ConsoleColors.OKBLUE} {dir}")
# Font file extensions
elif dir.endswith(".fnt"):
print(ConsoleColors.HEADER + f"Windows font file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".fon"):
print(ConsoleColors.HEADER + f"Generic font file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".otf"):
print(ConsoleColors.HEADER + f"Open type font file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ttf"):
print(ConsoleColors.HEADER + f"TrueType font file:{ConsoleColors.OKBLUE} {dir}")
# Image file extensions
elif dir.endswith(".ai"):
print(ConsoleColors.HEADER + f"Adobe Illustrator file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".bmp"):
print(ConsoleColors.HEADER + f"Bitmap image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".gif"):
print(ConsoleColors.HEADER + f"GIF image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ico"):
print(ConsoleColors.HEADER + f"Icon file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".jpeg"):
print(ConsoleColors.HEADER + f"JPEG image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".jpg"):
print(ConsoleColors.HEADER + f"JPEG image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".png"):
print(ConsoleColors.HEADER + f"PNG image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ps"):
print(ConsoleColors.HEADER + f"PostScript file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".psd"):
print(ConsoleColors.HEADER + f"PSD image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".svg"):
print(ConsoleColors.HEADER + f"Scalable Vector Graphics file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".tif"):
print(ConsoleColors.HEADER + f"TIFF image:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".tiff"):
print(ConsoleColors.HEADER + f"TIFF image:{ConsoleColors.OKBLUE} {dir}")
# Internet file extensions
elif dir.endswith(".asp"):
print(ConsoleColors.HEADER + f"Active Server Page file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".aspx"):
print(ConsoleColors.HEADER + f"Active Server Page file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cer"):
print(ConsoleColors.HEADER + f"Internet security certificate:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cfm"):
print(ConsoleColors.HEADER + f"ColdFusion Markup file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cgi"):
print(ConsoleColors.HEADER + f"Perl script file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pl"):
print(ConsoleColors.HEADER + f"Perl script file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".css"):
print(ConsoleColors.HEADER + f"Cascading Style Sheet file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".htm"):
print(ConsoleColors.HEADER + f"HTML file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".html"):
print(ConsoleColors.HEADER + f"HTML file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".js"):
print(ConsoleColors.HEADER + f"JavaScript file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".jsp"):
print(ConsoleColors.HEADER + f"Java Server Page file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".part"):
print(ConsoleColors.HEADER + f"Partially downloaded file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".php"):
print(ConsoleColors.HEADER + f"PHP file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".py"):
print(ConsoleColors.HEADER + f"Python file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".rss"):
print(ConsoleColors.HEADER + f"RSS file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".xhtml"):
print(ConsoleColors.HEADER + f"XHTML file:{ConsoleColors.OKBLUE} {dir}")
# Presentation file extensions
elif dir.endswith(".key"):
print(ConsoleColors.HEADER + f"Keynote presentation:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".odp"):
print(ConsoleColors.HEADER + f"OpenOffice Impress presentation file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pps"):
print(ConsoleColors.HEADER + f"PowerPoint slide show:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ppt"):
print(ConsoleColors.HEADER + f"PowerPoint presentation:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pptx"):
print(ConsoleColors.HEADER + f"PowerPoint Open XML presentation:{ConsoleColors.OKBLUE} {dir}")
# Programming file extensions
elif dir.endswith(".c"):
print(ConsoleColors.HEADER + f"C and C++ source code file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".class"):
print(ConsoleColors.HEADER + f"Java class file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cpp"):
print(ConsoleColors.HEADER + f"C++ source code file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cs"):
print(ConsoleColors.HEADER + f"Visual C# source code file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".h"):
print(ConsoleColors.HEADER + f"C, C++, and Objective-C header file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".java"):
print(ConsoleColors.HEADER + f"Java Source code file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pl"):
print(ConsoleColors.HEADER + f"Perl script file.:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".sh"):
print(ConsoleColors.HEADER + f"Bash shell script:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".swift"):
print(ConsoleColors.HEADER + f"Swift source code file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".vb"):
print(ConsoleColors.HEADER + f"Visual Basic file:{ConsoleColors.OKBLUE} {dir}")
# Spreadsheet file formats
elif dir.endswith(".ods"):
print(ConsoleColors.HEADER + f"OpenOffice Calc spreadsheet file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".xls"):
print(ConsoleColors.HEADER + f"Microsoft Excel file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".xlsm"):
print(ConsoleColors.HEADER + f"Microsoft Excel file with macros:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".xlsx"):
print(ConsoleColors.HEADER + f"Microsoft Excel Open XML spreadsheet file:{ConsoleColors.OKBLUE} {dir}")
# System file extensions
elif dir.endswith(".bak"):
print(ConsoleColors.HEADER + f"Backup file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cab"):
print(ConsoleColors.HEADER + f"Windows Cabinet file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cfg"):
print(ConsoleColors.HEADER + f"Configuration file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cpl"):
print(ConsoleColors.HEADER + f"Windows Control panel file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".cur"):
print(ConsoleColors.HEADER + f"Windows cursor file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".dll"):
print(ConsoleColors.HEADER + f"DLL file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".dmp"):
print(ConsoleColors.HEADER + f"Dump file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".drv"):
print(ConsoleColors.HEADER + f"Device driver file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".icns"):
print(ConsoleColors.HEADER + f"macOS X icon resource file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ico"):
print(ConsoleColors.HEADER + f"Icon file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".ini"):
print(ConsoleColors.HEADER + f"Initialization file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".Ink"):
print(ConsoleColors.HEADER + f"Windows shortcut file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".msi"):
print(ConsoleColors.HEADER + f"Windows installer package:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".sys"):
print(ConsoleColors.HEADER + f"Windows system file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".tmp"):
print(ConsoleColors.HEADER + f"Temporary file:{ConsoleColors.OKBLUE} {dir}")
# Video file extensions
elif dir.endswith(".3g2"):
print(ConsoleColors.HEADER + f"3GPP2 multimedia file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".3gp"):
print(ConsoleColors.HEADER + f"3GPP multimedia file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".avi"):
print(ConsoleColors.HEADER + f"AVI file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".flv"):
print(ConsoleColors.HEADER + f"Adobe Flash file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".h264"):
print(ConsoleColors.HEADER + f"H.264 video file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".m4v"):
print(ConsoleColors.HEADER + f"Apple MP4 video file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mkv"):
print(ConsoleColors.HEADER + f"Matroska Multimedia Container:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mov"):
print(ConsoleColors.HEADER + f"Apple QuickTime movie file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mp4"):
print(ConsoleColors.HEADER + f"MPEG4 video file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mpg"):
print(ConsoleColors.HEADER + f"MPEG video file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".mpeg"):
print(ConsoleColors.HEADER + f"MPEG video file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".rm"):
print(ConsoleColors.HEADER + f"RealMedia file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".swf"):
print(ConsoleColors.HEADER + f"Shockwave flash file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".vob"):
print(ConsoleColors.HEADER + f"DVD Video Object:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".wmv"):
print(ConsoleColors.HEADER + f"Windows Media Video file:{ConsoleColors.OKBLUE} {dir}")
# Text file extensions
elif dir.endswith(".doc"):
print(ConsoleColors.HEADER + f"Microsoft Word file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".docx"):
print(ConsoleColors.HEADER + f"Microsoft Word file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".odt"):
print(ConsoleColors.HEADER + f"OpenOffice Writer document file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".pdf"):
print(ConsoleColors.HEADER + f"PDF file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".rtf"):
print(ConsoleColors.HEADER + f"Rich Text Format:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".tex"):
print(ConsoleColors.HEADER + f"A LaTeX document file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".txt"):
print(ConsoleColors.HEADER + f"Plain text file:{ConsoleColors.OKBLUE} {dir}")
elif dir.endswith(".wdp"):
print(ConsoleColors.HEADER + f"WordPerfect document:{ConsoleColors.OKBLUE} {dir}")
if __name__ == "__main__":
os.system("cls")
colors = ConsoleColors
print(ConsoleColors.OKGREEN)
print(f.renderText('PjFileExplorer'))
print(ConsoleColors.ENDC)
print(ConsoleColors.OKBLUE + "Commands:\nopen_file 'Opens a supported file.'\nremove_file 'Deletes a file.'\nremove_dir_safe 'Removes a directory in safe mode this means it won't delete directories with files left in it.'\nremove_dir_unsafe 'Exactly previous command but then it doesn't care if there are still files left.'\n")
display = DisplayDirs()
display.print("C:\\")
while True:
print("\u001b[0m")
dir = input(ConsoleColors.ENDC + "What is the directory where you want to go to?: ")
if dir == "open_file":
dir = input(ConsoleColors.ENDC + "What directory is the file in?: ")
os.system("cls")
print(ConsoleColors.OKGREEN)
print(f.renderText('PjFileExplorer'))
print(ConsoleColors.ENDC)
display.print_supported_files(dir)
exec = input(ConsoleColors.ENDC + "What file do you want to open?: ")
os.startfile(f"{dir}/{exec}")
elif dir == "remove_file":
dir = input("What directory is the file in?: ")
os.system("cls")
print(ConsoleColors.OKGREEN)
print(f.renderText('PjFileExplorer'))
print(ConsoleColors.ENDC)
display.print_supported_files(dir)
exec = input(ConsoleColors.ENDC + "What file do you want to delete?: ")
os.remove(f"{dir}/{exec}")
elif dir == "remove_dir_safe":
dir = input("Where is the directory you want to remove?: ")
os.system("cls")
print(ConsoleColors.OKGREEN)
print(f.renderText('PjFileExplorer'))
print(ConsoleColors.ENDC)
display.print_dirs(dir)
exec = input(ConsoleColors.ENDC + "What directory do you want to delete?: ")
os.rmdir(f"{dir}/{exec}")
elif dir == "remove_dir_unsafe":
dir = input("Where is the directory you want to remove?: ")
os.system("cls")
print(ConsoleColors.OKGREEN)
print(f.renderText('PjFileExplorer'))
print(ConsoleColors.ENDC)
display.print_dirs(dir)
exec = input(ConsoleColors.ENDC + "What directory do you want to delete?: ")
shutil.rmtree(f"{dir}/{exec}")
elif not dir.endswith("\\"):
raise TypeError("Please provide a valid directory.")
os.system("cls")
print(ConsoleColors.OKGREEN)
print(f.renderText('PjFileExplorer'))
print(ConsoleColors.ENDC)
display.print(path=dir) | 43.888496 | 331 | 0.591402 | 2,610 | 24,797 | 5.60613 | 0.154406 | 0.195599 | 0.239475 | 0.249453 | 0.6902 | 0.595407 | 0.546268 | 0.407873 | 0.302693 | 0.280686 | 0 | 0.003556 | 0.274186 | 24,797 | 565 | 332 | 43.888496 | 0.809423 | 0.013631 | 0 | 0.22449 | 0 | 0.005102 | 0.359393 | 0.166339 | 0 | 0 | 0 | 0 | 0 | 1 | 0.010204 | false | 0 | 0.010204 | 0 | 0.040816 | 0.454082 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
7fdd259008d514c4c6adac9b38a10651ffcaabbb | 623 | py | Python | pandas_exercises/_nbdev.py | greyhawk/pandas_exercises | 0e910395e34a04b06cd53cb5fdaebbb6a5cbebc0 | [
"Apache-2.0"
] | null | null | null | pandas_exercises/_nbdev.py | greyhawk/pandas_exercises | 0e910395e34a04b06cd53cb5fdaebbb6a5cbebc0 | [
"Apache-2.0"
] | 3 | 2021-05-20T13:07:40.000Z | 2022-02-26T06:36:58.000Z | pandas_exercises/_nbdev.py | greyhawk/pandas_exercises | 0e910395e34a04b06cd53cb5fdaebbb6a5cbebc0 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"generate": "00_numpy.ipynb",
"square_root_by_exhaustive": "01_python03.ipynb",
"square_root_by_binary_search": "01_python03.ipynb",
"square_root_by_newton": "01_python03.ipynb",
"search": "01_python03.ipynb",
"select_sort": "01_python03.ipynb"}
modules = ["numpycore.py",
"py03.py"]
doc_url = "https://greyhawk.github.io/pandas_exercises/"
git_url = "https://github.com/greyhawk/pandas_exercises/tree/master/"
def custom_doc_links(name): return None
| 31.15 | 69 | 0.680578 | 80 | 623 | 4.925 | 0.55 | 0.126904 | 0.190355 | 0.129442 | 0.137056 | 0.137056 | 0 | 0 | 0 | 0 | 0 | 0.046154 | 0.165329 | 623 | 19 | 70 | 32.789474 | 0.711538 | 0.057785 | 0 | 0 | 1 | 0 | 0.603419 | 0.126496 | 0 | 0 | 0 | 0 | 0 | 1 | 0.083333 | false | 0 | 0 | 0.083333 | 0.083333 | 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 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
7fe040ded65181354de4ae62e627de0089e37ab7 | 2,650 | py | Python | credential.py | magechaP/passwordlocker2.0 | e0ae82aa650c4f1cd285f319ec16de38ba0670ea | [
"Unlicense",
"MIT"
] | null | null | null | credential.py | magechaP/passwordlocker2.0 | e0ae82aa650c4f1cd285f319ec16de38ba0670ea | [
"Unlicense",
"MIT"
] | null | null | null | credential.py | magechaP/passwordlocker2.0 | e0ae82aa650c4f1cd285f319ec16de38ba0670ea | [
"Unlicense",
"MIT"
] | null | null | null | import pyperclip #importing pyperclip module
class Credential:
"""
Class that generates new instances of credentials
"""
credentials = []
def __init__(self, username, accountname, password,):
"""
__init__ method that enables us to define properties for our objects
Args:
username: Username for an account being added
accountname: Name of the account being added
password: Password for the account being added
"""
self.username = username
self.accountname = accountname
self.password = password
def save_credential(self):
"""
save_credential method to help a user save a credential
"""
Credential.credentials.append(self)
def delete_credential(self):
"""
delete_method to help a user delete an existing credential
"""
Credential.credentials.remove(self)
@classmethod
def find_accountname(cls,account_name):
"""
find_accountname method to help a user search for an existing credential
by its accountname
"""
for credential in cls.credentials:
if credential.accountname == account_name:
return credential
@classmethod
def credential_exists(cls,accountname):
"""
credential_exists method to check if a credential exists and return a boolean
"""
for credential in cls.credentials:
if credential.accountname == accountname:
return True
@classmethod
def display_credentials(cls):
"""
display_credentials method to help user view all their saved credentials
"""
return cls.credentials
@classmethod
def copy_username(cls, accountname):
"""
copy_username method to help user copy their username to machine clipboard
"""
credential_found = Credential.find_accountname(accountname)
pyperclip.copy(credential_found.username)
@classmethod
def copy_accountname(cls, accountname):
"""
copy_accountname method to help user copy their accountname to machine clipboard
"""
credential_found = Credential.find_accountname(accountname)
pyperclip.copy(credential_found.accountname)
@classmethod
def copy_password(cls, accountname):
"""
copy_password method to help user copy their password to machine clipboard
"""
credential_found = Credential.find_accountname(accountname)
pyperclip.copy(credential_found.password) | 32.317073 | 88 | 0.641509 | 269 | 2,650 | 6.189591 | 0.241636 | 0.038438 | 0.05045 | 0.038438 | 0.312913 | 0.282282 | 0.237237 | 0.237237 | 0.174775 | 0.174775 | 0 | 0 | 0.297358 | 2,650 | 82 | 89 | 32.317073 | 0.8942 | 0.331698 | 0 | 0.305556 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.111111 | 0.027778 | 0 | 0.416667 | 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 |
7fefb24ce0807dbcc02f79987fd9576e6aff845a | 1,465 | py | Python | updaters/fz223test.py | abezpalov/tenders | 6cbc8b50e2d592bbed15d766d87a48f52be37b3c | [
"MIT"
] | 1 | 2015-06-22T17:37:15.000Z | 2015-06-22T17:37:15.000Z | updaters/fz223test.py | abezpalov/tenders | 6cbc8b50e2d592bbed15d766d87a48f52be37b3c | [
"MIT"
] | 10 | 2015-08-06T12:00:20.000Z | 2017-02-12T20:47:29.000Z | updaters/fz223test.py | abezpalov/tenders | 6cbc8b50e2d592bbed15d766d87a48f52be37b3c | [
"MIT"
] | null | null | null | import tenders.updaters.fz223
from tenders.models import *
class Runner(tenders.updaters.fz223.Runner):
subcategories = [
None,
'daily'
]
def __init__(self):
super().__init__()
self.url = 'ftp.zakupki.gov.ru'
self.essences = [
# {'category' : 'nsiOkdp', 'parser' : self.parse_okdp},
# {'category' : 'nsiOkato', 'parser' : self.parse_okato},
{'category' : 'nsiOkei', 'parser' : self.parse_okei},
# {'category' : 'nsiAgency', 'parser' : self.parse_agency},
# {'category' : 'nsiClauseType', 'parser' : self.parse_},
# {'category' : 'nsiOkfs', 'parser' : self.parse_},
# {'category' : 'nsiOkogu', 'parser' : self.parse_},
# {'category' : 'nsiOkopf', 'parser' : self.parse_},
# {'category' : 'nsiOkpd2', 'parser' : self.parse_},
# {'category' : 'nsiOktmo', 'parser' : self.parse_},
# {'category' : 'nsiOkv', 'parser' : self.parse_},
# {'category' : 'nsiOkved', 'parser' : self.parse_},
# {'category' : 'nsiOkved2', 'parser' : self.parse_},
# {'category' : 'nsiOrganisation', 'parser' : self.parse_},
# {'category' : 'nsiProtokol', 'parser' : self.parse_},
# {'category' : 'nsiPurchaseMethod', 'parser' : self.parse_},
]
self.region_essences = [
# {'category' : 'plangraphs', 'parser' : self.parse_plan},
# {'category' : 'notifications', 'parser' : self.parse_notification},
]
| 33.295455 | 71 | 0.565188 | 129 | 1,465 | 6.209302 | 0.379845 | 0.224719 | 0.337079 | 0.315855 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007156 | 0.23686 | 1,465 | 43 | 72 | 34.069767 | 0.709302 | 0.733106 | 0 | 0 | 0 | 0 | 0.118598 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.066667 | false | 0 | 0.133333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d05be5788c73fd582b980d6885faaa10f913f1e | 1,819 | py | Python | flying_robots/compat.py | bunburya/flying-robots | 6cb61913d07c6200f036ea05b7b0ca952aad5eb9 | [
"MIT"
] | 1 | 2019-11-16T14:42:52.000Z | 2019-11-16T14:42:52.000Z | flying_robots/compat.py | bunburya/FlyingRobots | 6cb61913d07c6200f036ea05b7b0ca952aad5eb9 | [
"MIT"
] | null | null | null | flying_robots/compat.py | bunburya/FlyingRobots | 6cb61913d07c6200f036ea05b7b0ca952aad5eb9 | [
"MIT"
] | null | null | null | """This module contains classes for ensuring compatibility across multiple
minor versions of Python 3."""
from configparser import ConfigParser as ConfigParser_pre32, ParsingError
from optparse import OptionParser
### ConfigParser
class _Section:
def __init__(self, parent, name):
self.parent = parent
self.name = name
def __getitem__(self, option):
return self.parent.get(self.name, option)
def __setitem__(self, option, value):
self.parent.set(self.name, option, str(value))
def __contains__(self, option):
return self.parent.has_option(self.name, option)
def get(self, option, default=None):
if self.parent.has_option(self.name, option):
return self[option]
else:
return default
def getint(self, option):
return self.parent.getint(self.name, option)
def getboolean(self, option):
return self.parent.getboolean(self.name, option)
class ConfigParser(ConfigParser_pre32):
def __getitem__(self, section):
return _Section(self, section)
def __setitem__(self, section, optdict):
self.add_section(section)
for key in optdict:
self.set(section, key, str(optdict[key]))
def __contains__(self, section):
return self.has_section(section)
### OptionParser/ArgumentParser
class ArgumentParser(OptionParser):
"""A thin wrapper around OptionParser implementing the relevant parts of
the ArgumentParser API. Designed to ensure compatibility with
Python 3.0-3.1."""
def add_argument(self, *args, **kwargs):
return OptionParser.add_option(self, *args, **kwargs)
def parse_args(self, args=None, values=None):
return OptionParser.parse_args(self, args, values)[0]
| 28.873016 | 76 | 0.673997 | 216 | 1,819 | 5.490741 | 0.319444 | 0.067454 | 0.070826 | 0.067454 | 0.134907 | 0.055649 | 0.055649 | 0 | 0 | 0 | 0 | 0.007143 | 0.230346 | 1,819 | 62 | 77 | 29.33871 | 0.84 | 0.158879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.342857 | false | 0 | 0.057143 | 0.228571 | 0.771429 | 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 |
3d0cff62101e7849ff364371b2bc4293d54ee0df | 226 | py | Python | tola_atom/encoders/base64_file.py | esjoker/Cyanide-Framework_v0.2 | e15ef9b7660bcc20ffe064321c2a185662a9dece | [
"MIT"
] | 3 | 2021-02-16T11:07:34.000Z | 2021-02-21T14:45:17.000Z | tola_atom/encoders/base64_file.py | esjoker/Cyanide-Framework_v0.2 | e15ef9b7660bcc20ffe064321c2a185662a9dece | [
"MIT"
] | null | null | null | tola_atom/encoders/base64_file.py | esjoker/Cyanide-Framework_v0.2 | e15ef9b7660bcc20ffe064321c2a185662a9dece | [
"MIT"
] | 1 | 2021-02-19T13:02:28.000Z | 2021-02-19T13:02:28.000Z | import base64
message = input("Enter a String: ")
message_bytes = message.encode('ascii')
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode('ascii')
print("Ciphered Text: " + base64_message) | 28.25 | 46 | 0.774336 | 29 | 226 | 5.827586 | 0.517241 | 0.230769 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.068966 | 0.10177 | 226 | 8 | 47 | 28.25 | 0.763547 | 0 | 0 | 0 | 0 | 0 | 0.180617 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 0.166667 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
3d27d64395607af16c6a76c0b9b88940ccf97d81 | 67 | py | Python | login.py | 948880225/test27 | d8e483d9373f4cda60156d12f0e33864025910a9 | [
"MIT"
] | null | null | null | login.py | 948880225/test27 | d8e483d9373f4cda60156d12f0e33864025910a9 | [
"MIT"
] | null | null | null | login.py | 948880225/test27 | d8e483d9373f4cda60156d12f0e33864025910a9 | [
"MIT"
] | null | null | null | num1 = 11
num2 = 222
num3 = 3333333
num3 = 333
num4 = 44444
| 5.153846 | 14 | 0.597015 | 10 | 67 | 4 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.555556 | 0.328358 | 67 | 12 | 15 | 5.583333 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 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 |
3d2bcf7a5b210826afb1c968e9aa04c7bcfdc7d7 | 180 | py | Python | jsonParser.py | ledgersafe/BSASARGenerator | 4f89091d817bd0bc2ff6848757791ea9f96b6a46 | [
"Apache-2.0"
] | 1 | 2019-05-25T06:12:42.000Z | 2019-05-25T06:12:42.000Z | jsonParser.py | ledgersafe/BSASARGenerator | 4f89091d817bd0bc2ff6848757791ea9f96b6a46 | [
"Apache-2.0"
] | null | null | null | jsonParser.py | ledgersafe/BSASARGenerator | 4f89091d817bd0bc2ff6848757791ea9f96b6a46 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import json
def loadActivities(filename):
res = {}
with open(filename, 'r') as f:
res = json.load(f)
return (res)
| 15 | 34 | 0.583333 | 22 | 180 | 4.772727 | 0.681818 | 0.266667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.316667 | 180 | 11 | 35 | 16.363636 | 0.853659 | 0 | 0 | 0 | 0 | 0 | 0.005587 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.285714 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3d40369c61e1b4dca758008562c8d7e1357dd497 | 1,139 | py | Python | src/functions.py | integeruser/MNIST-cnn | 8dff7942b37e632ac4c54e2ec940b7b72b4d8615 | [
"MIT"
] | 24 | 2016-11-06T17:28:52.000Z | 2021-07-01T08:51:07.000Z | src/functions.py | vmirly/MNIST-cnn | 654a63bbb1aee2e18cca2a10f635f5e7676b31f3 | [
"MIT"
] | 1 | 2016-11-03T16:43:00.000Z | 2016-11-03T16:43:00.000Z | src/functions.py | integeruser/MNIST-cnn | 8dff7942b37e632ac4c54e2ec940b7b72b4d8615 | [
"MIT"
] | 19 | 2016-11-02T20:56:08.000Z | 2021-01-07T19:18:31.000Z | import numpy as np
### weights initializations ####################################################
def glorot_uniform(shape, num_neurons_in, num_neurons_out):
scale = np.sqrt(6. / (num_neurons_in + num_neurons_out))
return np.random.uniform(low=-scale, high=scale, size=shape)
def zero(shape, *args):
return np.zeros(shape)
### activations ################################################################
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x))
def der_sigmoid(x, y=None):
s = sigmoid(x)
return s * (1 - s)
def softmax(x):
e = np.exp(x - np.max(x))
return e / np.sum(e)
def der_softmax(x, y=None):
s = softmax(x)
if y is not None:
k = s[np.where(y == 1)]
a = - k * s
a[np.where(y == 1)] = k * (1 - k)
return a
return s * (1 - s)
### objectives #################################################################
def quadratic(a, y):
return a-y
def log_likelihood(a, y):
return -1.0 / a[np.where(y == 1)]
def categorical_crossentropy(a, y):
a = a.flatten() / np.sum(a)
i = np.where(y.flatten() == 1)
return np.log(a)[i]
| 22.333333 | 80 | 0.48288 | 164 | 1,139 | 3.27439 | 0.323171 | 0.074488 | 0.05959 | 0.050279 | 0.130354 | 0.09311 | 0 | 0 | 0 | 0 | 0 | 0.015677 | 0.215979 | 1,139 | 50 | 81 | 22.78 | 0.585666 | 0.042142 | 0 | 0.066667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.3 | false | 0 | 0.033333 | 0.133333 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3d55e78b8e20e541c5f4d6fa8ee356974bf49499 | 854 | py | Python | src/api/BoxAPI.py | gregbugaj/marie-ai | f51a74f19ab5d7231c9f8a426284feff1671b974 | [
"MIT"
] | 4 | 2021-09-23T22:38:48.000Z | 2022-01-19T12:03:02.000Z | src/api/BoxAPI.py | gregbugaj/marie-icr | f51a74f19ab5d7231c9f8a426284feff1671b974 | [
"MIT"
] | 17 | 2021-12-22T16:37:21.000Z | 2022-03-16T16:07:34.000Z | src/api/BoxAPI.py | gregbugaj/marie-ai | f51a74f19ab5d7231c9f8a426284feff1671b974 | [
"MIT"
] | null | null | null | import processors
from boxes import box_processor
from flask_restful import Resource, reqparse
from utils.utils import current_milli_time
class BoxListAPI(Resource):
def __init__(self):
super(BoxListAPI, self).__init__()
self.reqparse = reqparse.RequestParser()
self.box_processor = processors.box_processor
print('BoxListAPI inited')
def get(self):
"""Get boxes"""
print(box_processor)
return {'boxes': current_milli_time()}, 200
def post(self):
pass
class BoxAPI(Resource):
def __init__(self):
self.reqparse = reqparse.RequestParser()
super(BoxAPI, self).__init__()
print('BoxAPI inited')
def get(self, uid):
return {'box_id':id}, 200
def put(self, uid):
pass
def delete(self, uid):
pass
| 23.081081 | 53 | 0.628806 | 97 | 854 | 5.268041 | 0.340206 | 0.093933 | 0.062622 | 0.074364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009615 | 0.269321 | 854 | 37 | 54 | 23.081081 | 0.809295 | 0.010539 | 0 | 0.269231 | 0 | 0 | 0.04881 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.269231 | false | 0.115385 | 0.153846 | 0.038462 | 0.576923 | 0.115385 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
e9f3d3429a82dd9d9288287a87f0f8273c5d88a2 | 1,227 | py | Python | cryptos/explorers/btg_explorer.py | cfd2000/pybitcointool | 96e7843226d76cfe73b2ab0660cc89add490d76a | [
"MIT"
] | 230 | 2017-12-07T07:49:39.000Z | 2022-03-27T10:08:16.000Z | cryptos/explorers/btg_explorer.py | cfd2000/pybitcointool | 96e7843226d76cfe73b2ab0660cc89add490d76a | [
"MIT"
] | 26 | 2017-12-19T15:09:57.000Z | 2022-02-25T14:13:56.000Z | cryptos/explorers/btg_explorer.py | cfd2000/pybitcointool | 96e7843226d76cfe73b2ab0660cc89add490d76a | [
"MIT"
] | 145 | 2017-12-20T11:45:55.000Z | 2022-03-05T08:07:32.000Z | from . import base_insight as insight
def get_url(coin_symbol):
if coin_symbol == "btg":
return "https://btgexplorer.com/api"
raise NotImplementedError("Explorer unavailable for Bitcoin Gold testnet")
def unspent(*args, coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.unspent(base_url, *args)
def fetchtx(txhash, coin_symbol="btg"):
base_url = get_url(coin_symbol="btg")
return insight.fetchtx(base_url, txhash)
def txinputs(txhash, coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.txinputs(base_url, txhash)
def pushtx(tx, coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.pushtx(base_url, coin_symbol.upper(), tx)
def history(*args, coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.history(base_url, *args)
def block_height(tx, coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.block_height(base_url, tx)
def current_block_height(coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.current_block_height(base_url)
def block_info(height, coin_symbol="btg"):
base_url = get_url(coin_symbol)
return insight.block_info(base_url, height) | 32.289474 | 78 | 0.737571 | 182 | 1,227 | 4.681319 | 0.208791 | 0.223005 | 0.152582 | 0.169014 | 0.498826 | 0.498826 | 0.498826 | 0.498826 | 0.498826 | 0.498826 | 0 | 0 | 0.147514 | 1,227 | 38 | 79 | 32.289474 | 0.814532 | 0 | 0 | 0.241379 | 0 | 0 | 0.083062 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.310345 | false | 0 | 0.034483 | 0 | 0.655172 | 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 |
180753321999baba6204ed0cd4cd24e52c232f6f | 623 | py | Python | tests/common/test_identifier.py | nuecho/rasa-integration-testing | 4e5f55634a8effb29011f32667983d96b7c69740 | [
"Apache-2.0"
] | 2 | 2020-09-29T13:53:51.000Z | 2020-10-24T19:33:27.000Z | tests/common/test_identifier.py | nuecho/rasa-integration-testing | 4e5f55634a8effb29011f32667983d96b7c69740 | [
"Apache-2.0"
] | 22 | 2020-05-27T17:15:56.000Z | 2020-11-27T19:27:59.000Z | tests/common/test_identifier.py | nuecho/rasa-integration-testing | 4e5f55634a8effb29011f32667983d96b7c69740 | [
"Apache-2.0"
] | 1 | 2021-02-06T03:58:52.000Z | 2021-02-06T03:58:52.000Z | from unittest import TestCase
from rasa_integration_testing.common.identifier import Identifier
ELEMENTS = ["en-US", "pay_bill", "initial"]
class TestIdentifier(TestCase):
def test_equals(self):
self.assertEqual(Identifier(*ELEMENTS), Identifier(*ELEMENTS))
def test_length(self):
self.assertEqual(len(Identifier(*ELEMENTS)), 3)
def test_string(self):
self.assertEqual(str(Identifier(*ELEMENTS)), "en-US.pay_bill.initial")
def test_add(self):
identifier = Identifier(*ELEMENTS) + ["another"]
self.assertEqual(str(identifier), "en-US.pay_bill.initial.another")
| 29.666667 | 78 | 0.707865 | 73 | 623 | 5.917808 | 0.39726 | 0.25 | 0.048611 | 0.076389 | 0.208333 | 0.166667 | 0.166667 | 0 | 0 | 0 | 0 | 0.001908 | 0.158909 | 623 | 20 | 79 | 31.15 | 0.822519 | 0 | 0 | 0 | 0 | 0 | 0.126806 | 0.083467 | 0 | 0 | 0 | 0 | 0.307692 | 1 | 0.307692 | false | 0 | 0.153846 | 0 | 0.538462 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
182c89a432ae8ec917318b1604b3b84ddb41c567 | 930 | py | Python | wrappers/vo.py | gridpp/gridpp-case-studies | 8caecc24e9e688ec57ee110b7c945ab4673270b1 | [
"MIT"
] | null | null | null | wrappers/vo.py | gridpp/gridpp-case-studies | 8caecc24e9e688ec57ee110b7c945ab4673270b1 | [
"MIT"
] | null | null | null | wrappers/vo.py | gridpp/gridpp-case-studies | 8caecc24e9e688ec57ee110b7c945ab4673270b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#...for the logging.
import logging as lg
class VirtualOrganisation(object):
"""
Wrapper base class for a Virtual Organisation.
"""
def __init__(self, jvo):
"""
@param [in] jvo JSON object representaing a VO.
"""
## The VO name.
self.__name = jvo.keys()[0]
vo_details = jvo.values()[0]
## The Operations Portal ID card URL.
self.__ops_portal_url = vo_details['egi_ops']
## The VOMS server URL.
self.__voms_server_url = vo_details['voms_server']
def __lt__(self, other):
return self.get_name() < other.get_name()
def get_name(self):
return self.__name
def get_full_name(self):
return self.__full_name
def get_ops_portal_url(self):
return self.__ops_portal_url
def get_voms_server_url(self):
return self.__voms_server_url
| 24.473684 | 58 | 0.616129 | 124 | 930 | 4.241935 | 0.395161 | 0.095057 | 0.098859 | 0.060837 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004431 | 0.272043 | 930 | 37 | 59 | 25.135135 | 0.772526 | 0.241935 | 0 | 0 | 0 | 0 | 0.027356 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.352941 | false | 0 | 0.058824 | 0.294118 | 0.764706 | 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 |
183bd1d39de303a043bc004eaf3457a84f2a606a | 242 | py | Python | mythril/ethereum/interface/rpc/constants.py | kalloc/mythril | eeee4d7c459189d278ac82a38c5fb778ddd58cdc | [
"MIT"
] | 1,887 | 2018-01-07T10:16:08.000Z | 2022-03-31T16:07:26.000Z | mythril/ethereum/interface/rpc/constants.py | strawberrylady99/mythril | 727d5f3049333f71ccd90a95ca8fe13368aa9c15 | [
"MIT"
] | 746 | 2018-01-09T07:14:01.000Z | 2022-03-31T08:12:44.000Z | mythril/ethereum/interface/rpc/constants.py | strawberrylady99/mythril | 727d5f3049333f71ccd90a95ca8fe13368aa9c15 | [
"MIT"
] | 431 | 2018-01-08T07:47:59.000Z | 2022-03-31T13:00:51.000Z | """This file contains constants used used by the Ethereum JSON RPC
interface."""
BLOCK_TAG_EARLIEST = "earliest"
BLOCK_TAG_LATEST = "latest"
BLOCK_TAG_PENDING = "pending"
BLOCK_TAGS = (BLOCK_TAG_EARLIEST, BLOCK_TAG_LATEST, BLOCK_TAG_PENDING)
| 34.571429 | 70 | 0.805785 | 35 | 242 | 5.2 | 0.485714 | 0.263736 | 0.175824 | 0.241758 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.107438 | 242 | 6 | 71 | 40.333333 | 0.842593 | 0.305785 | 0 | 0 | 0 | 0 | 0.12963 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 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 |
18458669428f232800e69aaab3a1a053ee8c4e8e | 307 | py | Python | django/app/polls/models.py | hany-abdelrahman/django-file-upload | ac5cabdbdf2c65b5ca69941a40b4b2cb332315f0 | [
"CC0-1.0"
] | null | null | null | django/app/polls/models.py | hany-abdelrahman/django-file-upload | ac5cabdbdf2c65b5ca69941a40b4b2cb332315f0 | [
"CC0-1.0"
] | null | null | null | django/app/polls/models.py | hany-abdelrahman/django-file-upload | ac5cabdbdf2c65b5ca69941a40b4b2cb332315f0 | [
"CC0-1.0"
] | null | null | null | from django.db import models
# Create your models here.
def nameFile(instance, filename):
return '/'.join(['images', str(instance.name), filename])
class UploadImageTest(models.Model):
name = models.CharField(max_length=100)
image = models.ImageField(upload_to=nameFile, blank=True, null=True) | 34.111111 | 72 | 0.742671 | 40 | 307 | 5.65 | 0.775 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011194 | 0.127036 | 307 | 9 | 72 | 34.111111 | 0.83209 | 0.078176 | 0 | 0 | 0 | 0 | 0.024823 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0.166667 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
1848315f755fb427c939c49c0c331c3d86c9c2ef | 736 | py | Python | 09_documentation/12_google_style.py | varshashivhare/Mastering-Python | 6101fa7855e57d0bbd194e936084bd64d9d38d76 | [
"MIT"
] | 30 | 2016-10-28T18:14:15.000Z | 2021-08-29T15:20:56.000Z | 09_documentation/12_google_style.py | varshashivhare/Mastering-Python | 6101fa7855e57d0bbd194e936084bd64d9d38d76 | [
"MIT"
] | null | null | null | 09_documentation/12_google_style.py | varshashivhare/Mastering-Python | 6101fa7855e57d0bbd194e936084bd64d9d38d76 | [
"MIT"
] | 31 | 2016-09-10T22:47:12.000Z | 2022-03-13T04:50:35.000Z | class Spam(object):
'''
The Spam object contains lots of spam
Args:
arg (str): The arg is used for ...
*args: The variable arguments are used for ...
**kwargs: The keyword arguments are used for ...
Attributes:
arg (str): This is where we store arg,
'''
def __init__(self, arg, *args, **kwargs):
self.arg = arg
def eggs(self, amount, cooked):
'''We can't have spam without eggs, so here's the eggs
Args:
amount (int): The amount of eggs to return
cooked (bool): Should the eggs be cooked?
Raises:
RuntimeError: Out of eggs
Returns:
Eggs: A bunch of eggs
'''
pass
| 22.30303 | 62 | 0.540761 | 95 | 736 | 4.147368 | 0.515789 | 0.053299 | 0.081218 | 0.096447 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.365489 | 736 | 32 | 63 | 23 | 0.843683 | 0.638587 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0.2 | 0 | 0 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
184aa37a833c93ff4e4f50d13774358e6fc35647 | 612 | py | Python | src/garage/sampler/__init__.py | nhanph/garage | dc8c106854734eec3a9f6c7f05dba9026ce5872f | [
"MIT"
] | null | null | null | src/garage/sampler/__init__.py | nhanph/garage | dc8c106854734eec3a9f6c7f05dba9026ce5872f | [
"MIT"
] | null | null | null | src/garage/sampler/__init__.py | nhanph/garage | dc8c106854734eec3a9f6c7f05dba9026ce5872f | [
"MIT"
] | null | null | null | from garage.sampler.base import BaseSampler
from garage.sampler.base import Sampler
from garage.sampler.batch_sampler import BatchSampler
from garage.sampler.is_sampler import ISSampler
from garage.sampler.parallel_vec_env_executor import ParallelVecEnvExecutor
from garage.sampler.ray_sampler import RaySampler, SamplerWorker
from garage.sampler.stateful_pool import singleton_pool
from garage.sampler.vec_env_executor import VecEnvExecutor
__all__ = [
'BaseSampler', 'BatchSampler', 'Sampler', 'ISSampler', 'singleton_pool',
'RaySampler', 'SamplerWorker', 'ParallelVecEnvExecutor', 'VecEnvExecutor'
]
| 43.714286 | 77 | 0.834967 | 70 | 612 | 7.085714 | 0.328571 | 0.16129 | 0.274194 | 0.084677 | 0.108871 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.089869 | 612 | 13 | 78 | 47.076923 | 0.890485 | 0 | 0 | 0 | 0 | 0 | 0.183007 | 0.035948 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 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 |
185c02a6eb776b53ef296dda3d737a266fe36f49 | 5,273 | py | Python | implementations/python/tests/test_annotation.py | HUPO-PSI/spectralLib-Format | 79ba19513a9138f7d3a7175c8b17d3068c2e304f | [
"Apache-2.0"
] | 7 | 2017-11-01T09:02:31.000Z | 2020-04-08T17:33:09.000Z | implementations/python/tests/test_annotation.py | HUPO-PSI/spectralLib-Format | 79ba19513a9138f7d3a7175c8b17d3068c2e304f | [
"Apache-2.0"
] | 16 | 2017-04-26T07:01:20.000Z | 2020-05-14T16:35:18.000Z | implementations/python/tests/test_annotation.py | HUPO-PSI/spectralLib-Format | 79ba19513a9138f7d3a7175c8b17d3068c2e304f | [
"Apache-2.0"
] | 8 | 2018-04-19T14:33:53.000Z | 2020-03-25T14:38:59.000Z | import os
import unittest
import json
from mzlib.annotation import parse_annotation, MassError, IonAnnotationBase
from .common import datafile
try:
import jsonschema
except ImportError:
jsonschema = None
DEFAULT_SCHEMA_LOCATION = "../../specification/peak-annotation-format/annotation-schema.json"
SCHEMA_LOCATION = os.environ.get("MZSPECLIB_PEAK_ANNOTATION_SCHEMA_LOCATION", DEFAULT_SCHEMA_LOCATION)
try:
schema_error = None
with open(SCHEMA_LOCATION, 'rt') as fh:
schema = json.load(fh)
except OSError as err:
schema = None
schema_error = err
skip_reason = ''
if jsonschema is None:
skip_reason += ("The `jsonschema` library is not installed, cannot test schema compliance. ")
if schema is None:
skip_reason += ("Could not accessed `peak-annotation-format.json` from development, cannot test schema compliance. ")
class TestAnnotationParser(unittest.TestCase):
def test_parse_failfast(self):
assert parse_annotation("?") == []
def test_parse_annotation_complex(self):
base = "b14"
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
base += "-H2O-NH3+[Foo]"
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
base += "+2i"
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
assert parsed.isotope == 2
base += "^2"
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
assert parsed.isotope == 2
assert parsed.charge == 2
base += "[M+NH4]"
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
assert parsed.isotope == 2
assert parsed.charge == 2
assert parsed.adducts == ["M", "NH4"]
base += "/0.5ppm"
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
assert parsed.isotope == 2
assert parsed.charge == 2
assert parsed.adducts == ["M", "NH4"]
assert parsed.mass_error == MassError(0.5, 'ppm')
base = "2@" + base
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
assert parsed.isotope == 2
assert parsed.charge == 2
assert parsed.adducts == ["M", "NH4"]
assert parsed.mass_error == MassError(0.5, 'ppm')
assert parsed.analyte_reference == '2'
assert parsed == base
base = base + '*0.05'
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
assert parsed.isotope == 2
assert parsed.charge == 2
assert parsed.adducts == ["M", "NH4"]
assert parsed.mass_error == MassError(0.5, 'ppm')
assert parsed.analyte_reference == '2'
assert parsed.confidence == 0.05
assert parsed == base
base = '[%s]' % base
parsed = parse_annotation(base)[0]
assert parsed.series == 'b'
assert parsed.position == 14
assert parsed.neutral_loss == ['-H2O', '-NH3', '[Foo]']
assert parsed.isotope == 2
assert parsed.charge == 2
assert parsed.adducts == ["M", "NH4"]
assert parsed.mass_error == MassError(0.5, 'ppm')
assert parsed.analyte_reference == '2'
assert parsed.confidence == 0.05
assert parsed.is_auxiliary
assert parsed == base
@unittest.skipIf(schema is None or jsonschema is None, skip_reason)
def test_jsonschema_compliance(self):
with open(datafile('annotations.txt'), 'rt') as fh:
for line in fh:
line = line.strip()
annot = parse_annotation(line)
if not annot:
raise ValueError("Could not parse %r" % annot)
annot = annot[0]
data = annot.to_json()
jsonschema.validate(instance=data, schema=schema)
def test_from_json(self):
with open(datafile('annotations.txt'), 'rt') as fh:
for line in fh:
line = line.strip()
annot = parse_annotation(line)
if not annot:
raise ValueError("Could not parse %r" % annot)
annot = annot[0]
data = annot.to_json()
parsed = IonAnnotationBase.from_json(data)
# JSON schema enforces analyte_reference but it is implicitly '1'
# without explicitly being set
annot.analyte_reference = '1'
self.assertEqual(annot, parsed)
| 34.464052 | 121 | 0.584487 | 599 | 5,273 | 5.046745 | 0.188648 | 0.226265 | 0.060205 | 0.074429 | 0.634138 | 0.616937 | 0.616937 | 0.616937 | 0.616937 | 0.616937 | 0 | 0.025442 | 0.291864 | 5,273 | 152 | 122 | 34.690789 | 0.784146 | 0.017447 | 0 | 0.664 | 0 | 0 | 0.105639 | 0.026072 | 0 | 0 | 0 | 0 | 0.472 | 1 | 0.032 | false | 0 | 0.056 | 0 | 0.096 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
186a1ea9a3c0854247d4bc9f4b4ae8c1df121e66 | 1,849 | py | Python | RunEntry.py | davgra04/RunLogDesktop | 4eb52071f33d37a597481dd272233dee5041b837 | [
"MIT"
] | null | null | null | RunEntry.py | davgra04/RunLogDesktop | 4eb52071f33d37a597481dd272233dee5041b837 | [
"MIT"
] | null | null | null | RunEntry.py | davgra04/RunLogDesktop | 4eb52071f33d37a597481dd272233dee5041b837 | [
"MIT"
] | null | null | null | from __future__ import print_function
import sys, pprint
# Object for accessing the runlog database
class RunEntry:
console_table_printing_template = "{0:>5} {1:>10} {2:>11} {3:>12} {4:>4} {5:103}"
truncate_length = 60
def __init__(self, input_date, input_seconds_run, input_seconds_rest, input_reps, input_run_id=-1):
self.run_id = input_run_id
self.date = input_date
self.seconds_run = input_seconds_run
self.seconds_rest = input_seconds_rest
self.reps = input_reps
return
def __init__(self, input_date, input_seconds_run, input_seconds_rest, input_reps, input_note, input_run_id=-1):
self.run_id = input_run_id
self.date = input_date
self.seconds_run = input_seconds_run
self.seconds_rest = input_seconds_rest
self.reps = input_reps
self.note = input_note
return
def get_details_string(self, truncate=False):
printed_note = self.note
if printed_note is None:
printed_note = "--"
if truncate:
printed_note = (printed_note[:self.truncate_length] + '...') if len(printed_note) > self.truncate_length else printed_note
return self.console_table_printing_template.format(self.run_id, self.date.strftime('%Y/%m/%d'), self.seconds_run, self.seconds_rest, self.reps, printed_note)
### Getters
def get_id(self):
return self.run_id
def get_date(self):
return self.date
def get_date_string(self):
return self.date.strftime('%Y/%m/%d')
def get_sec_run(self):
return self.seconds_run
def get_sec_rest(self):
return self.seconds_rest
def get_reps(self):
return self.reps
def get_note(self):
return self.note
| 29.822581 | 166 | 0.642509 | 252 | 1,849 | 4.365079 | 0.242063 | 0.087273 | 0.089091 | 0.08 | 0.449091 | 0.373636 | 0.339091 | 0.339091 | 0.339091 | 0.339091 | 0 | 0.015475 | 0.26609 | 1,849 | 61 | 167 | 30.311475 | 0.795136 | 0.02596 | 0 | 0.292683 | 0 | 0.02439 | 0.040946 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.243902 | false | 0 | 0.04878 | 0.170732 | 0.609756 | 0.195122 | 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 |
43e67d84978d699a425db4ffcb0690653752129f | 77 | py | Python | transform/transformers/cora/__init__.py | uk-gov-mirror/ONSdigital.sdx-transform-cs | bc2b46cb14d1ec9d746ad71db7eaab4ebfbc5b0d | [
"MIT"
] | 1 | 2017-11-10T02:20:54.000Z | 2017-11-10T02:20:54.000Z | transform/transformers/cora/__init__.py | uk-gov-mirror/ONSdigital.sdx-transform-cs | bc2b46cb14d1ec9d746ad71db7eaab4ebfbc5b0d | [
"MIT"
] | 228 | 2016-06-21T11:39:10.000Z | 2021-09-07T23:56:07.000Z | transform/transformers/cora/__init__.py | uk-gov-mirror/ONSdigital.sdx-transform-cs | bc2b46cb14d1ec9d746ad71db7eaab4ebfbc5b0d | [
"MIT"
] | 1 | 2021-04-11T07:49:48.000Z | 2021-04-11T07:49:48.000Z | from .ukis_transformer import UKISTransformer
__all__ = ['UKISTransformer']
| 19.25 | 45 | 0.818182 | 7 | 77 | 8.285714 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.103896 | 77 | 3 | 46 | 25.666667 | 0.84058 | 0 | 0 | 0 | 0 | 0 | 0.194805 | 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 |
a1078dce0706dc232c7b88205b11f8f781e413b9 | 285 | py | Python | src/endpoints/config.py | jggomez/Python-Reference-Microservice | 13723c5f5a205bf1f874c44dddbd4cab64839da7 | [
"MIT"
] | 14 | 2020-07-09T22:31:09.000Z | 2022-01-21T23:03:29.000Z | src/endpoints/config.py | jggomez/Python-Reference-Microservice | 13723c5f5a205bf1f874c44dddbd4cab64839da7 | [
"MIT"
] | 1 | 2021-02-03T23:51:35.000Z | 2021-02-03T23:51:35.000Z | src/endpoints/config.py | jggomez/Python-Reference-Microservice | 13723c5f5a205bf1f874c44dddbd4cab64839da7 | [
"MIT"
] | 6 | 2020-07-10T04:07:11.000Z | 2020-10-04T00:04:30.000Z | import os
from typing_extensions import Final
URI_KEY: Final = "NEO4J_URI"
USER_KEY: Final = "NEO4J_USER"
PASSWORD_KEY: Final = "NEO4J_PASS"
class Config:
URI_KEY = os.environ.get(URI_KEY)
USER_KEY = os.environ.get(USER_KEY)
PASSWORD_KEY = os.environ.get(PASSWORD_KEY)
| 20.357143 | 47 | 0.74386 | 45 | 285 | 4.422222 | 0.355556 | 0.090452 | 0.19598 | 0.226131 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0125 | 0.157895 | 285 | 13 | 48 | 21.923077 | 0.816667 | 0 | 0 | 0 | 0 | 0 | 0.101754 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.222222 | 0.222222 | 0 | 0.666667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
a1120ff8ce313ba7c1ba79f45617da1d18e7ab58 | 202 | py | Python | python/ray/rllib/agents/ars/__init__.py | BnJam/ray | c32658ff7550f8672923ca6d824d85c5efd82a5b | [
"Apache-2.0"
] | 2 | 2019-10-23T07:31:45.000Z | 2019-10-23T07:31:47.000Z | python/ray/rllib/agents/ars/__init__.py | BnJam/ray | c32658ff7550f8672923ca6d824d85c5efd82a5b | [
"Apache-2.0"
] | null | null | null | python/ray/rllib/agents/ars/__init__.py | BnJam/ray | c32658ff7550f8672923ca6d824d85c5efd82a5b | [
"Apache-2.0"
] | 2 | 2018-04-04T23:54:34.000Z | 2018-04-10T17:37:17.000Z | from ray.rllib.agents.ars.ars import (ARSTrainer, DEFAULT_CONFIG)
from ray.rllib.utils import renamed_class
ARSAgent = renamed_class(ARSTrainer)
__all__ = ["ARSAgent", "ARSTrainer", "DEFAULT_CONFIG"]
| 28.857143 | 65 | 0.792079 | 26 | 202 | 5.846154 | 0.538462 | 0.092105 | 0.157895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094059 | 202 | 6 | 66 | 33.666667 | 0.830601 | 0 | 0 | 0 | 0 | 0 | 0.158416 | 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 |
a1124b3fd349ea9223800ef885713e171d8d7b32 | 889 | py | Python | Tugas 0/Employee/Employee.py | hafidh561/Pemrograman-Berorientasi-Objek | 55f955aaff8023d40ecfdfa407902ad42937c98e | [
"MIT"
] | null | null | null | Tugas 0/Employee/Employee.py | hafidh561/Pemrograman-Berorientasi-Objek | 55f955aaff8023d40ecfdfa407902ad42937c98e | [
"MIT"
] | null | null | null | Tugas 0/Employee/Employee.py | hafidh561/Pemrograman-Berorientasi-Objek | 55f955aaff8023d40ecfdfa407902ad42937c98e | [
"MIT"
] | 1 | 2020-10-22T10:54:55.000Z | 2020-10-22T10:54:55.000Z | class Employee:
# Constructor untuk Employee
def __init__(self, first_name, last_name, monthly_salary):
self._first_name = first_name
self._last_name = last_name
self._monthly_salary = monthly_salary
if monthly_salary < 0:
self._monthly_salary = 0
# Getter dan setter first_name
@property
def first_name(self):
return self._first_name
@first_name.setter
def first_name(self, new_first_name):
self._first_name = new_first_name
# Getter dan setter last_name
@property
def last_name(self):
return self._last_name
@last_name.setter
def last_name(self, new_last_name):
self._last_name = new_last_name
# Getter dan setter monthly_salary
@property
def monthly_salary(self):
return self._monthly_salary
@monthly_salary.setter
def monthly_salary(self, new_monthly_salary):
self._monthly_salary = new_monthly_salary
| 24.027027 | 60 | 0.751406 | 127 | 889 | 4.826772 | 0.15748 | 0.275693 | 0.084829 | 0.058728 | 0.23491 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002747 | 0.181102 | 889 | 36 | 61 | 24.694444 | 0.839286 | 0.130484 | 0 | 0.12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.28 | false | 0 | 0 | 0.12 | 0.44 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
a1266fcadbc466a70cc763db010bdfad672a87a0 | 815 | py | Python | decawave_1001_rjg/__init__.py | Richard-Gemmell/decawave-1001-rjg | 0ee70d1ca0a1a413ef4f634c0f3cd78a084e5c5f | [
"MIT"
] | 6 | 2019-08-05T22:16:38.000Z | 2021-01-16T02:45:26.000Z | decawave_1001_rjg/__init__.py | Richard-Gemmell/decawave-1001-rjg | 0ee70d1ca0a1a413ef4f634c0f3cd78a084e5c5f | [
"MIT"
] | null | null | null | decawave_1001_rjg/__init__.py | Richard-Gemmell/decawave-1001-rjg | 0ee70d1ca0a1a413ef4f634c0f3cd78a084e5c5f | [
"MIT"
] | 3 | 2021-01-16T02:45:29.000Z | 2022-03-26T21:38:44.000Z | from .messages.dwm_config_response import DwmConfigResponse
from .messages.dwm_distance_and_position import DwmDistanceAndPosition
from .messages.dwm_interrupt_config_request import DwmInterruptConfigRequest
from .messages.dwm_location_response import DwmLocationResponse
from .messages.dwm_position import DwmPosition
from .messages.dwm_position_response import DwmPositionResponse
from .messages.dwm_request import DwmRequests
from .messages.dwm_response import DwmResponse
from .messages.dwm_status_response import DwmStatusResponse
from .messages.dwm_version_response import DwmVersionResponse
from .messages.tlv_message import TlvMessage
from .abstract_interrupt import Interrupt
from .gpio_interrupt import GPIOInterrupt
from .decawave_1001 import Decawave1001Driver
name = "decawave_1001_rjg" | 50.9375 | 77 | 0.874847 | 94 | 815 | 7.319149 | 0.37234 | 0.19186 | 0.218023 | 0.06686 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016194 | 0.090798 | 815 | 16 | 78 | 50.9375 | 0.912281 | 0 | 0 | 0 | 0 | 0 | 0.021223 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.933333 | 0 | 0.933333 | 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 |
a13849d275aa8aabfcfedd61407da69d20eaf5f9 | 565 | py | Python | UserAuth/forms.py | OdidiLavender/FoodWasteManagementProject | a5f339de79c9fb78771197089967caaf2ec1db18 | [
"MIT"
] | 1 | 2022-02-27T13:51:51.000Z | 2022-02-27T13:51:51.000Z | UserAuth/forms.py | OdidiLavender/FoodWasteManagementProject | a5f339de79c9fb78771197089967caaf2ec1db18 | [
"MIT"
] | null | null | null | UserAuth/forms.py | OdidiLavender/FoodWasteManagementProject | a5f339de79c9fb78771197089967caaf2ec1db18 | [
"MIT"
] | 5 | 2022-02-07T13:41:02.000Z | 2022-02-09T10:14:08.000Z | from dataclasses import fields
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from .models import UserProfile
class CreateUserForm(UserCreationForm):
username = forms.CharField(required=True)
email = forms.EmailField(required=True)
class Meta:
model = User
fields = ("username", "first_name", "last_name", "email", "password1", "password2")
class UserProfileForm(forms.ModelForm):
class Meta:
model = UserProfile
fields = '__all__'
| 28.25 | 91 | 0.720354 | 62 | 565 | 6.467742 | 0.483871 | 0.074813 | 0.084788 | 0.104738 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004367 | 0.189381 | 565 | 19 | 92 | 29.736842 | 0.871179 | 0 | 0 | 0.133333 | 0 | 0 | 0.100885 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.066667 | 0.333333 | 0 | 0.733333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
a13c5623220078b72822c9da1125d59704171b43 | 547 | py | Python | Examples/Session03/slicing_lab.py | Sharmila8/intropython2016 | a69aa6f6d0cd28c6a29d0b8adb9ef1ff9e2e8479 | [
"Unlicense"
] | null | null | null | Examples/Session03/slicing_lab.py | Sharmila8/intropython2016 | a69aa6f6d0cd28c6a29d0b8adb9ef1ff9e2e8479 | [
"Unlicense"
] | null | null | null | Examples/Session03/slicing_lab.py | Sharmila8/intropython2016 | a69aa6f6d0cd28c6a29d0b8adb9ef1ff9e2e8479 | [
"Unlicense"
] | null | null | null | # slicing lab
def swap(seq):
return seq[-1:]+seq[1:-1]+seq[:1]
assert swap('something') == 'gomethins'
assert swap(tuple(range(10))) == (9,1,2,3,4,5,6,7,8,0)
def rem(seq):
return seq[::2]
assert rem('a word') == 'awr'
def rem4(seq):
return seq[4:-4:2]
print(rem4( (1,2,3,4,5,6,7,8,9,10,11), ) )
def reverse(seq):
return seq[::-1]
print(reverse('a string'))
def thirds(seq):
i = len(seq)//3
#return seq[i*2:i*3+1] + seq[:i] + seq[i:i*2]
return seq[i:-i] + seq[-i:] + seq[:i]
print (thirds(tuple(range(12))))
| 17.09375 | 54 | 0.561243 | 107 | 547 | 2.869159 | 0.327103 | 0.091205 | 0.156352 | 0.084691 | 0.052117 | 0.052117 | 0.052117 | 0.052117 | 0 | 0 | 0 | 0.095556 | 0.177331 | 547 | 31 | 55 | 17.645161 | 0.586667 | 0.100548 | 0 | 0 | 0 | 0 | 0.071575 | 0 | 0 | 0 | 0 | 0 | 0.176471 | 1 | 0.294118 | false | 0 | 0 | 0.235294 | 0.588235 | 0.176471 | 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 |
a15d0afa335cf6a81b27e81779bf8fa053b5fc0d | 223 | py | Python | IoT_Domain_Analyst_ECE_3502/Lab_1/minkowski.py | aadhityasw/VIT-Labs | 2c449f64f4fdd8c0ed5f2b51d05a7c586e6ab2ab | [
"CC0-1.0"
] | 2 | 2021-11-18T05:30:24.000Z | 2022-03-07T06:28:06.000Z | IoT_Domain_Analyst_ECE_3502/Lab_1/minkowski.py | aadhityasw/VIT-Labs | 2c449f64f4fdd8c0ed5f2b51d05a7c586e6ab2ab | [
"CC0-1.0"
] | null | null | null | IoT_Domain_Analyst_ECE_3502/Lab_1/minkowski.py | aadhityasw/VIT-Labs | 2c449f64f4fdd8c0ed5f2b51d05a7c586e6ab2ab | [
"CC0-1.0"
] | 3 | 2021-10-14T01:10:34.000Z | 2022-03-18T14:33:52.000Z | def minkowski(a, b, p) :
summ = 0
n = len(a)
for i in range(n) :
summ += (b[i]-a[i])**p
summ = summ ** (1/p)
return summ
a = [0, 3, 4, 5]
b = [7, 6, 3, -1]
p=3
print(minkowski(a, b, p))
| 13.117647 | 30 | 0.426009 | 44 | 223 | 2.159091 | 0.477273 | 0.210526 | 0.231579 | 0.252632 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.076389 | 0.35426 | 223 | 16 | 31 | 13.9375 | 0.583333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0 | 0 | 0.181818 | 0.090909 | 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 |
a16ccb5eedb7867b0206684c6b3cda94de3b59b7 | 3,543 | py | Python | pymanopt/manifolds/product.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | null | null | null | pymanopt/manifolds/product.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | null | null | null | pymanopt/manifolds/product.py | codedecde/EmbedMap | bd128c190f3e75146d2e85df05904aaa72117bb0 | [
"MIT"
] | 1 | 2018-07-01T07:45:53.000Z | 2018-07-01T07:45:53.000Z | from __future__ import division
import numpy as np
from pymanopt.manifolds.manifold import Manifold
class Product(Manifold):
"""
Product manifold, i.e. the cartesian product of multiple manifolds.
"""
def __init__(self, manifolds):
self._manifolds = manifolds
self._nmanifolds = len(manifolds)
def __str__(self):
return ("Product manifold: {:s}".format(
" X ".join([str(man) for man in self._manifolds])))
@property
def dim(self):
return np.sum([man.dim for man in self._manifolds])
@property
def typicaldist(self):
return np.sqrt(np.sum([man.typicaldist**2 for man in self._manifolds]))
def inner(self, X, G, H):
return np.sum([self._manifolds[k].inner(X[k], G[k], H[k])
for k in range(0, self._nmanifolds)])
def norm(self, X, G):
return np.sqrt(self.inner(X, G, G))
def dist(self, X, Y):
return np.sqrt(np.sum([self._manifolds[k].dist(X[k], Y[k])**2
for k in range(0, self._nmanifolds)]))
def proj(self, X, U):
return _TangentVector([self._manifolds[k].proj(X[k], U[k])
for k in range(0, self._nmanifolds)])
def egrad2rgrad(self, X, U):
return _TangentVector([self._manifolds[k].egrad2rgrad(X[k], U[k])
for k in range(0, self._nmanifolds)])
def ehess2rhess(self, X, egrad, ehess, H):
return _TangentVector([self._manifolds[k].ehess2rhess(X[k], egrad[k],
ehess[k], H[k])
for k in range(0, self._nmanifolds)])
def exp(self, X, U):
return [self._manifolds[k].exp(X[k], U[k])
for k in range(0, self._nmanifolds)]
def retr(self, X, U):
return [self._manifolds[k].retr(X[k], U[k])
for k in range(0, self._nmanifolds)]
def log(self, X, U):
return _TangentVector([self._manifolds[k].log(X[k], U[k])
for k in range(0, self._nmanifolds)])
def rand(self):
return [self._manifolds[k].rand()
for k in range(0, self._nmanifolds)]
def randvec(self, X):
return _TangentVector([1/np.sqrt(self._nmanifolds) *
self._manifolds[k].randvec(X[k])
for k in range(0, self._nmanifolds)])
def transp(self, X1, X2, G):
return _TangentVector([self._manifolds[k].transp(X1[k], X2[k], G[k])
for k in range(0, self._nmanifolds)])
def pairmean(self, X, Y):
return [self._manifolds[k].pairmean(X[k], Y[k])
for k in range(0, self._nmanifolds)]
def zerovec(self, X):
return _TangentVector([self._manifolds[k].zerovec(X[k])
for k in range(0, self._nmanifolds)])
class _TangentVector(list):
def __add__(self, other):
assert len(self) == len(other)
return _TangentVector([self[k] + other[k] for k in range(len(self))])
def __sub__(self, other):
assert len(self) == len(other)
return _TangentVector([self[k] - other[k] for k in range(len(self))])
def __mul__(self, other):
return _TangentVector([other * val for val in self])
__rmul__ = __mul__
def __div__(self, other):
return _TangentVector([val / other for val in self])
def __neg__(self):
return _TangentVector([-val for val in self])
| 33.424528 | 79 | 0.556308 | 472 | 3,543 | 3.995763 | 0.158898 | 0.124072 | 0.04772 | 0.087487 | 0.539767 | 0.424708 | 0.424708 | 0.363203 | 0.270414 | 0.207317 | 0 | 0.00978 | 0.307367 | 3,543 | 105 | 80 | 33.742857 | 0.758761 | 0.018911 | 0 | 0.219178 | 0 | 0 | 0.007225 | 0 | 0 | 0 | 0 | 0 | 0.027397 | 1 | 0.315068 | false | 0 | 0.041096 | 0.273973 | 0.69863 | 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 |
a16f9eef87edd60aa67fb3135ec6de75217f4666 | 77 | py | Python | Mysrey_code.py | ropso/AlgorithmDesignAndAnalysis-Python | de4a1f695c819a98f590d9156fc84e4468529289 | [
"MIT"
] | null | null | null | Mysrey_code.py | ropso/AlgorithmDesignAndAnalysis-Python | de4a1f695c819a98f590d9156fc84e4468529289 | [
"MIT"
] | null | null | null | Mysrey_code.py | ropso/AlgorithmDesignAndAnalysis-Python | de4a1f695c819a98f590d9156fc84e4468529289 | [
"MIT"
] | null | null | null | mystr_code=input()
prefer_substr,nonPrefStr=input().split(" ")
for i in range | 25.666667 | 43 | 0.766234 | 12 | 77 | 4.75 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.077922 | 77 | 3 | 44 | 25.666667 | 0.802817 | 0 | 0 | 0 | 0 | 0 | 0.012821 | 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 |
a179042dd8570187880fe0ef78ae3ce2970e1ba0 | 125 | py | Python | scripts/field/go40000.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/field/go40000.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/field/go40000.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Created by MechAviv
# ID :: [4000013]
# Maple Road : Inside the Small Forest
sm.showFieldEffect("maplemap/enter/40000", 0) | 25 | 45 | 0.728 | 17 | 125 | 5.352941 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.121495 | 0.144 | 125 | 5 | 45 | 25 | 0.728972 | 0.576 | 0 | 0 | 0 | 0 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a18ee9507d273723937cb49abde8630c7a772f9b | 19 | py | Python | simulator/const.py | lucassm02/fiap-cptm | cd2d5d7ce0390f2d5a745ca8d1cc96dc7d6f3351 | [
"MIT"
] | null | null | null | simulator/const.py | lucassm02/fiap-cptm | cd2d5d7ce0390f2d5a745ca8d1cc96dc7d6f3351 | [
"MIT"
] | null | null | null | simulator/const.py | lucassm02/fiap-cptm | cd2d5d7ce0390f2d5a745ca8d1cc96dc7d6f3351 | [
"MIT"
] | null | null | null | TIME_OF_TRAVEL = 3
| 9.5 | 18 | 0.789474 | 4 | 19 | 3.25 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.0625 | 0.157895 | 19 | 1 | 19 | 19 | 0.75 | 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 |
a195e0c12af197c85e8da8a31e8ab59dee17a638 | 548 | py | Python | Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex107.py | Jhonattan-rocha/Meus-primeiros-programas | f5971b66c0afd049b5d0493e8b7a116b391d058e | [
"MIT"
] | null | null | null | Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex107.py | Jhonattan-rocha/Meus-primeiros-programas | f5971b66c0afd049b5d0493e8b7a116b391d058e | [
"MIT"
] | null | null | null | Python/Curos_Python_curemvid/Exercicios_dos_videos/Ex107.py | Jhonattan-rocha/Meus-primeiros-programas | f5971b66c0afd049b5d0493e8b7a116b391d058e | [
"MIT"
] | null | null | null | from Curos_Python_curemvid.Uteis import Exer107M
numero = int(input("Digite quanto dinheiro você tem: "))
print(f"O dobro de {numero} é: {Exer107M.dobro(numero)}")
print(f"A metade do {numero} é: {Exer107M.metade(numero)}")
por = float(input("Digite o número da porcentagem que deseja aumentar o número: "))
print(f"{numero} com {por}% de aumento é: {Exer107M.aumentar(numero, por)}")
por = float(input("Digite o número da porcentagem que deseja diminuir o número: "))
print(f"{numero} com {por}% de desconto é: {Exer107M.diminuir(numero, por)}")
| 54.8 | 83 | 0.729927 | 85 | 548 | 4.682353 | 0.423529 | 0.060302 | 0.075377 | 0.095477 | 0.376884 | 0.376884 | 0.376884 | 0.376884 | 0.241206 | 0.241206 | 0 | 0.031185 | 0.122263 | 548 | 9 | 84 | 60.888889 | 0.796258 | 0 | 0 | 0 | 0 | 0 | 0.70073 | 0.184307 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.125 | 0 | 0.125 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 3 |
a1ab4faa0339c03d96a2773d058c23c4c74fe4dc | 658 | py | Python | doubleop.py | kaileepm/tutorial_theano | 15699d23775af663c8a6db13b32e4796a175061c | [
"BSD-2-Clause"
] | 70 | 2015-01-14T21:17:48.000Z | 2022-03-01T22:20:59.000Z | doubleop.py | HabibMrad/tutorial_theano | b22999e3d4fd609a98d901fea8e9839e77fbcdbe | [
"BSD-2-Clause"
] | null | null | null | doubleop.py | HabibMrad/tutorial_theano | b22999e3d4fd609a98d901fea8e9839e77fbcdbe | [
"BSD-2-Clause"
] | 44 | 2015-01-16T23:08:13.000Z | 2019-09-21T06:43:05.000Z | from theano import Op, Apply
from theano.tensor import as_tensor_variable
class DoubleOp(Op):
__props__ = ()
def make_node(self, x):
x = as_tensor_variable(x)
return Apply(self, [x], [x.type()])
def perform(self, node, inputs, output_storage):
x = inputs[0]
z = output_storage[0]
z[0] = x * 2
def infer_shape(self, node, input_shapes):
return input_shapes
def grad(self, inputs, output_grads):
return [output_grads[0] * 2]
def R_op(self, inputs, eval_points):
if eval_points[0] is None:
return eval_points
return self.grad(inputs, eval_points)
| 25.307692 | 52 | 0.620061 | 93 | 658 | 4.16129 | 0.397849 | 0.103359 | 0.082687 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.014675 | 0.275076 | 658 | 25 | 53 | 26.32 | 0.796646 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.263158 | false | 0 | 0.105263 | 0.105263 | 0.736842 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
a1dc86ea70f7a61b4c54b2fac7320c729a8f2980 | 594 | py | Python | ACA Assign 2/CS622/node.py | Hirak999/CS622A | 193a2709d9520c5381e95af90f71b057c22ab8b6 | [
"MIT"
] | null | null | null | ACA Assign 2/CS622/node.py | Hirak999/CS622A | 193a2709d9520c5381e95af90f71b057c22ab8b6 | [
"MIT"
] | null | null | null | ACA Assign 2/CS622/node.py | Hirak999/CS622A | 193a2709d9520c5381e95af90f71b057c22ab8b6 | [
"MIT"
] | null | null | null |
class Node:
def __init__(self,tag,valid_bit = 1,next = None,previous = None):
self.tag = tag
self.valid_bit = valid_bit
self.next = next
self.previous = previous
def set_next_pointer(self,next):
self.next = next
def set_previous_pointer(self,previous):
self.previous = previous
def get_tag(self):
return self.tag
def get_index(self):
return self.index
def get_next_pointer(self):
return self.next
def get_previous_pointer(self):
return self.previous
| 21.214286 | 70 | 0.597643 | 75 | 594 | 4.506667 | 0.226667 | 0.094675 | 0.16568 | 0.136095 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002488 | 0.323232 | 594 | 27 | 71 | 22 | 0.838308 | 0 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.388889 | false | 0 | 0 | 0.222222 | 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 |
a1deee678ffc93641b91681eb11cc0625c8422ef | 9,639 | py | Python | tests/vessels_segmentation_test.py | mjirik/imtools | b7ff33631a035db5fa5156adc5d8536650e4573b | [
"MIT"
] | 7 | 2016-01-06T08:36:31.000Z | 2021-11-11T01:00:05.000Z | tests/vessels_segmentation_test.py | mjirik/imtools | b7ff33631a035db5fa5156adc5d8536650e4573b | [
"MIT"
] | 1 | 2018-08-06T18:44:19.000Z | 2018-08-06T18:44:19.000Z | tests/vessels_segmentation_test.py | mjirik/imtools | b7ff33631a035db5fa5156adc5d8536650e4573b | [
"MIT"
] | 1 | 2018-08-06T18:27:03.000Z | 2018-08-06T18:27:03.000Z | #! /usr/bin/python
# -*- coding: utf-8 -*-
# import funkcí z jiného adresáře
import os.path
import sys
path_to_script = os.path.dirname(os.path.abspath(__file__))
pth = os.path.join(path_to_script, "../../seededitorqt/")
sys.path.insert(0, pth)
path_to_script = os.path.dirname(os.path.abspath(__file__))
import unittest
import pytest
import numpy as np
from PyQt5.QtWidgets import QApplication
import sed3
from imtools import segmentation as imsegmentation
class SegmentationTest(unittest.TestCase):
interactiveTest = False
# @unittest.skip("demonstrating skipping")
# @unittest.skipIf(not interactiveTest, "interactive test")
# @pytest.mark.interactive
def synthetic_data(self):
# data
slab = {'none': 0, 'liver': 1, 'porta': 2}
voxelsize_mm = np.array([1.0, 1.0, 1.2])
segm = np.zeros([256, 256, 80], dtype=np.int16)
vessel_seeds=np.zeros_like(segm, dtype=np.int8)
# liver
segm[70:180, 40:190, 30:60] = slab['liver']
# porta
segm[120:130, 70:190, 40:45] = slab['porta']
segm[80:130, 100:110, 40:45] = slab['porta']
segm[120:170, 130:135, 40:44] = slab['porta']
vessel_seeds[85:90, 105, 42] = 1
data3d = np.zeros(segm.shape)
data3d[segm == slab['liver']] = 156
data3d[segm == slab['porta']] = 206
noise = (np.random.normal(0, 30, segm.shape)) # .astype(np.int16)
data3d = (data3d + noise).astype(np.int16)
datap = {
"data3d": data3d,
"segmentation": segm,
"slab": slab,
"seeds": vessel_seeds,
"voxelsize_mm": voxelsize_mm
}
return datap
def test_synthetic_data_segmentation(self):
"""
Function uses organ_segmentation for synthetic box object
segmentation.
"""
datap = self.synthetic_data()
data3d = datap["data3d"]
segm = datap["segmentation"]
voxelsize_mm = datap["voxelsize_mm"]
slab = datap["slab"]
outputTmp = imsegmentation.vesselSegmentation(data3d, segmentation=(segm == slab['liver']), threshold=180,
voxelsize_mm=voxelsize_mm, inputSigma=0.15,
aoi_dilation_iterations=2, nObj=1, biggestObjects=True,
interactivity=False, binaryClosingIterations=5,
binaryOpeningIterations=1)
# @TODO opravit chybu v vesselSegmentation
outputTmp = (outputTmp == 2)
errim = np.abs(
outputTmp.astype(np.int) - (segm == slab['porta']).astype(np.int)
)
# ověření výsledku
# pyed = sed3.sed3(errim, contour=segm==slab['porta'])
# pyed.show()
# evaluation
sum_of_wrong_voxels = np.sum(errim)
sum_of_voxels = np.prod(segm.shape)
errorrate = sum_of_wrong_voxels/sum_of_voxels
self.assertLess(errorrate, 0.1)
def test_synthetic_data_segmentation_with_vessel_seed(self):
"""
Function uses organ_segmentation for synthetic box object
segmentation.
"""
datap = self.synthetic_data()
data3d = datap["data3d"]
segm = datap["segmentation"]
voxelsize_mm = datap["voxelsize_mm"]
slab = datap["slab"]
vessel_seeds = datap["seeds"]
# pyed = sed3.sed3(data3d, seeds=vessel_seeds)
# pyed.show()
outputTmp = imsegmentation.vesselSegmentation(data3d, segmentation=segm, voxelsize_mm=voxelsize_mm,
inputSigma=0.15, aoi_dilation_iterations=2, nObj=1,
biggestObjects=True, seeds=vessel_seeds, interactivity=False,
binaryClosingIterations=5, binaryOpeningIterations=1,
aoi_label=["liver", "porta"], slab=slab)
# @TODO opravit chybu v vesselSegmentation
outputTmp = (outputTmp == 2)
errim = np.abs(
outputTmp.astype(np.int) - (segm == slab['porta']).astype(np.int)
)
# ověření výsledku
# pyed = sed3.sed3(errim, contour=segm==slab['porta'])
# pyed.show()
# evaluation
sum_of_wrong_voxels = np.sum(errim)
sum_of_voxels = np.prod(segm.shape)
errorrate = sum_of_wrong_voxels/sum_of_voxels
self.assertLess(errorrate, 0.1)
@pytest.mark.interactive
def test_synthetic_data_segmentation_interactive_check(self):
"""
Function uses organ_segmentation for synthetic box object
segmentation.
"""
datap = self.synthetic_data()
data3d = datap["data3d"]
segm = datap["segmentation"]
voxelsize_mm = datap["voxelsize_mm"]
slab = datap["slab"]
# @TODO je tam bug, prohlížeč neumí korektně pracovat s doubly
import sys
app = QApplication(sys.argv)
# #pyed = QTSeedEditor(noise )
# pyed = QTSeedEditor(data3d)
# pyed.exec_()
# #img3d = np.zeros([256,256,80], dtype=np.int16)
# pyed = sed3.sed3(data3d)
# pyed.show()
outputTmp = imsegmentation.vesselSegmentation(data3d, segmentation=(segm == slab['liver']), threshold=180,
voxelsize_mm=voxelsize_mm, inputSigma=0.15,
aoi_dilation_iterations=2, nObj=1, biggestObjects=True,
interactivity=True,
binaryClosingIterations=5,
binaryOpeningIterations=1)
# ověření výsledku
pyed = sed3.sed3(outputTmp, contour=segm==slab['porta'])
pyed.show()
# @TODO opravit chybu v vesselSegmentation
outputTmp = (outputTmp == 2)
errim = np.abs(
outputTmp.astype(np.int) - (segm == slab['porta']).astype(np.int)
)
# ověření výsledku
# pyed = sed3.sed3(errim, contour=segm==slab['porta'])
# pyed.show()
# evaluation
sum_of_wrong_voxels = np.sum(errim)
sum_of_voxels = np.prod(segm.shape)
# print "wrong ", sum_of_wrong_voxels
# print "voxels", sum_of_voxels
errorrate = sum_of_wrong_voxels/sum_of_voxels
# import pdb; pdb.set_trace()
self.assertLess(errorrate, 0.1)
# @unittest.skipIf(os.environ.get("TRAVIS", True), "Skip on Travis-CI")
def test_uiThreshold_qt(self):
"""
UI threshold segmentation without binary close
"""
from imtools import uiThreshold
datap = self.synthetic_data()
data3d = datap["data3d"]
# segm = datap["segmentation"]
voxelsize_mm = datap["voxelsize_mm"]
# slab = datap["slab"]
data3d[100:150, 58:70, 50:55] += 50
app = QApplication(sys.argv)
# pyed = sed3.sed3(data3d)
# pyed.show()
uiT = uiThreshold.uiThresholdQt(
data3d, # .astype(np.uint8),
# segmentation=(segm == slab['liver']), # .astype(np.uint8),
# segmentation = oseg.orig_scale_segmentation,
voxel=voxelsize_mm,
threshold=180,
inputSigma=0.15,
nObj=1,
interactivity=False,
# interactivity=True,
biggestObjects=True,
# biggestObjects=False,
binaryClosingIterations=0,
binaryOpeningIterations=0)
# outputTmp = uiT.run()
@unittest.skipIf(os.environ.get("TRAVIS", True), "Skip on Travis-CI")
def test_uiThreshold_binary_close_with_synthetic_data(self):
"""
Function uses ui threshold for synthetic box object
segmentation with binary close
"""
# TODO check the result better
from imtools import uiThreshold
datap = self.synthetic_data()
data3d = datap["data3d"]
segm = datap["segmentation"]
voxelsize_mm = datap["voxelsize_mm"]
slab = datap["slab"]
data3d[100:150, 58:70, 50:55] += 50
# @TODO je tam bug, prohlížeč neumí korektně pracovat s doubly
import sys
app = QApplication(sys.argv)
# pyed = sed3.sed3(data3d)
# pyed.show()
uiT = uiThreshold.uiThresholdQt(
data3d, # .astype(np.uint8),
# segmentation=(segm == slab['liver']), # .astype(np.uint8),
# segmentation = oseg.orig_scale_segmentation,
voxel=voxelsize_mm,
threshold=180,
inputSigma=0.15,
nObj=1,
interactivity=False,
# interactivity=True,
biggestObjects=True,
# biggestObjects=False,
binaryClosingIterations=5,
binaryOpeningIterations=1)
outputTmp = uiT.run()
# ověření výsledku
# pyed = sed3.sed3(outputTmp, contour=segm==slab['porta'])
# pyed.show()
outputTmp = (outputTmp == 2)
errim = np.abs(
outputTmp.astype(np.int) - (segm == slab['porta']).astype(np.int)
)
# evaluation
sum_of_wrong_voxels = np.sum(errim)
sum_of_voxels = np.prod(segm.shape)
errorrate = sum_of_wrong_voxels/sum_of_voxels
# import pdb; pdb.set_trace()
self.assertLess(errorrate, 0.1)
if __name__ == "__main__":
unittest.main()
| 31.295455 | 115 | 0.563336 | 995 | 9,639 | 5.316583 | 0.19397 | 0.043667 | 0.024575 | 0.027221 | 0.738941 | 0.703403 | 0.677505 | 0.677505 | 0.652363 | 0.652363 | 0 | 0.039686 | 0.325552 | 9,639 | 307 | 116 | 31.397394 | 0.774035 | 0.22326 | 0 | 0.6 | 0 | 0 | 0.046336 | 0 | 0 | 0 | 0 | 0.013029 | 0.026667 | 1 | 0.04 | false | 0 | 0.08 | 0 | 0.14 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
a1f4b7b5c5d4a9408fdb5200ce3a4d05bd49a1c7 | 1,367 | py | Python | ietf/ipr/migrations/0009_auto_20161207_1046.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-11-20T03:40:40.000Z | 2021-11-20T03:40:42.000Z | ietf/ipr/migrations/0009_auto_20161207_1046.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/ipr/migrations/0009_auto_20161207_1046.py | ekr/ietfdb | 8d936836b0b9ff31cda415b0a423e3f5b33ab695 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ipr', '0008_auto_20160720_0218'),
]
operations = [
migrations.AlterField(
model_name='genericiprdisclosure',
name='holder_contact_email',
field=models.EmailField(max_length=254),
),
migrations.AlterField(
model_name='holderiprdisclosure',
name='holder_contact_email',
field=models.EmailField(max_length=254),
),
migrations.AlterField(
model_name='holderiprdisclosure',
name='ietfer_contact_email',
field=models.EmailField(max_length=254, blank=True),
),
migrations.AlterField(
model_name='iprdisclosurebase',
name='submitter_email',
field=models.EmailField(max_length=254, blank=True),
),
migrations.AlterField(
model_name='nondocspecificiprdisclosure',
name='holder_contact_email',
field=models.EmailField(max_length=254),
),
migrations.AlterField(
model_name='thirdpartyiprdisclosure',
name='ietfer_contact_email',
field=models.EmailField(max_length=254),
),
]
| 30.377778 | 64 | 0.604974 | 118 | 1,367 | 6.745763 | 0.347458 | 0.150754 | 0.188442 | 0.218593 | 0.645729 | 0.645729 | 0.645729 | 0.645729 | 0.645729 | 0.645729 | 0 | 0.036157 | 0.29188 | 1,367 | 44 | 65 | 31.068182 | 0.786157 | 0.015362 | 0 | 0.657895 | 0 | 0 | 0.197917 | 0.054315 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.052632 | 0 | 0.131579 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
62ad92b5e4e5080a4611224ee16b6d1c6cedfc41 | 25 | py | Python | webofneeds/won-matcher-rescal/src/main/python/extrescal/__init__.py | fkleedorfer/webofneeds | c64a0889e7ac0f81c1f3a6a2d2b3f01372457686 | [
"Apache-2.0"
] | 55 | 2015-01-09T16:53:17.000Z | 2022-03-19T14:52:36.000Z | webofneeds/won-matcher-rescal/src/main/python/extrescal/__init__.py | fkleedorfer/webofneeds | c64a0889e7ac0f81c1f3a6a2d2b3f01372457686 | [
"Apache-2.0"
] | 1,965 | 2015-01-07T12:13:16.000Z | 2021-11-12T15:58:07.000Z | webofneeds/won-matcher-rescal/src/main/python/extrescal/__init__.py | fkleedorfer/webofneeds | c64a0889e7ac0f81c1f3a6a2d2b3f01372457686 | [
"Apache-2.0"
] | 21 | 2015-04-03T08:50:17.000Z | 2022-03-19T14:44:51.000Z | __author__ = 'nzhiltsov'
| 12.5 | 24 | 0.76 | 2 | 25 | 7.5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.12 | 25 | 1 | 25 | 25 | 0.681818 | 0 | 0 | 0 | 0 | 0 | 0.36 | 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 |
62c777439b2bf30c9e6b2151dfb31a6e09b0e5ef | 246 | py | Python | api/date/proposer.py | Th3re/steve-events-api | 49dfc02dcbdffd990a87dc69a3d1b7022241b32c | [
"MIT"
] | null | null | null | api/date/proposer.py | Th3re/steve-events-api | 49dfc02dcbdffd990a87dc69a3d1b7022241b32c | [
"MIT"
] | null | null | null | api/date/proposer.py | Th3re/steve-events-api | 49dfc02dcbdffd990a87dc69a3d1b7022241b32c | [
"MIT"
] | null | null | null | import abc
from datetime import datetime
from typing import List
from api.date.window import Window
class Proposer(abc.ABC):
@abc.abstractmethod
def propose(self, date: datetime, participants: List[str]) -> List[Window]:
pass
| 18.923077 | 79 | 0.727642 | 33 | 246 | 5.424242 | 0.545455 | 0.067039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.186992 | 246 | 12 | 80 | 20.5 | 0.895 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0.125 | 0.5 | 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 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
62d1904d3b4fa05d167ad64776cec05c1a5f5682 | 252 | py | Python | impostor/forms.py | TwigWorld/Impostor | 7589dc235be1a2475e9aad70a20ae5968a260e04 | [
"MIT"
] | null | null | null | impostor/forms.py | TwigWorld/Impostor | 7589dc235be1a2475e9aad70a20ae5968a260e04 | [
"MIT"
] | null | null | null | impostor/forms.py | TwigWorld/Impostor | 7589dc235be1a2475e9aad70a20ae5968a260e04 | [
"MIT"
] | null | null | null | from django.contrib.auth.forms import AuthenticationForm
from django import forms
from django.utils.translation import ugettext_lazy as _
class BigAuthenticationForm(AuthenticationForm):
username = forms.CharField(label=_("Username"), max_length=70)
| 36 | 63 | 0.837302 | 30 | 252 | 6.9 | 0.666667 | 0.144928 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008696 | 0.087302 | 252 | 6 | 64 | 42 | 0.891304 | 0 | 0 | 0 | 0 | 0 | 0.031746 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.6 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 3 |
1a2de7e235cf5a85695d6f5076d23daad681b871 | 7,060 | py | Python | stage/configuration/test_amazon_s3_destination.py | streamsets/datacollector-tests | 6c3e908768e1d4a586e9183e2141096921ecd5be | [
"Apache-2.0"
] | 14 | 2019-03-04T10:12:39.000Z | 2021-11-24T16:17:09.000Z | stage/configuration/test_amazon_s3_destination.py | Pragatibs/datacollector-tests | aac53b2f0e056009ef0e437c8430651e3cf4d502 | [
"Apache-2.0"
] | 48 | 2019-03-08T14:59:06.000Z | 2021-08-13T14:49:56.000Z | stage/configuration/test_amazon_s3_destination.py | Pragatibs/datacollector-tests | aac53b2f0e056009ef0e437c8430651e3cf4d502 | [
"Apache-2.0"
] | 23 | 2018-09-24T20:49:17.000Z | 2021-11-24T16:17:11.000Z | # Copyright 2021 StreamSets Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import pytest
from streamsets.testframework.decorators import stub
@stub
def test_access_key_id(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'server_side_encryption_option': 'KMS',
'use_server_side_encryption': True}])
def test_aws_kms_key_arn(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
def test_bucket(sdc_builder, sdc_executor):
pass
@stub
def test_common_prefix(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'compress_with_gzip': False}, {'compress_with_gzip': True}])
def test_compress_with_gzip(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
def test_connection_timeout(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'server_side_encryption_option': 'CUSTOMER',
'use_server_side_encryption': True}])
def test_customer_encryption_key(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'server_side_encryption_option': 'CUSTOMER',
'use_server_side_encryption': True}])
def test_customer_encryption_key_md5(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
def test_data_time_zone(sdc_builder, sdc_executor):
pass
@stub
def test_delimiter(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'server_side_encryption_option': 'KMS',
'use_server_side_encryption': True}])
def test_encryption_context(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'region': 'OTHER'}])
def test_endpoint(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
def test_minimum_upload_part_size(sdc_builder, sdc_executor):
pass
@stub
def test_multipart_upload_threshold(sdc_builder, sdc_executor):
pass
@stub
def test_object_name_prefix(sdc_builder, sdc_executor):
pass
@stub
def test_object_name_suffix(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'on_record_error': 'DISCARD'},
{'on_record_error': 'STOP_PIPELINE'},
{'on_record_error': 'TO_ERROR'}])
def test_on_record_error(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
def test_partition_prefix(sdc_builder, sdc_executor):
pass
@stub
def test_preconditions(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'use_proxy': True}])
def test_proxy_host(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'use_proxy': True}])
def test_proxy_password(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'use_proxy': True}])
def test_proxy_port(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'use_proxy': True}])
def test_proxy_user(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'region': 'AP_NORTHEAST_1'},
{'region': 'AP_NORTHEAST_2'},
{'region': 'AP_NORTHEAST_3'},
{'region': 'AP_SOUTHEAST_1'},
{'region': 'AP_SOUTHEAST_2'},
{'region': 'AP_SOUTH_1'},
{'region': 'CA_CENTRAL_1'},
{'region': 'CN_NORTHWEST_1'},
{'region': 'CN_NORTH_1'},
{'region': 'EU_CENTRAL_1'},
{'region': 'EU_WEST_1'},
{'region': 'EU_WEST_2'},
{'region': 'EU_WEST_3'},
{'region': 'OTHER'},
{'region': 'SA_EAST_1'},
{'region': 'US_EAST_1'},
{'region': 'US_EAST_2'},
{'region': 'US_GOV_WEST_1'},
{'region': 'US_WEST_1'},
{'region': 'US_WEST_2'}])
def test_region(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
def test_required_fields(sdc_builder, sdc_executor):
pass
@stub
def test_retry_count(sdc_builder, sdc_executor):
pass
@stub
def test_secret_access_key(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'server_side_encryption_option': 'CUSTOMER',
'use_server_side_encryption': True},
{'server_side_encryption_option': 'KMS',
'use_server_side_encryption': True},
{'server_side_encryption_option': 'NONE',
'use_server_side_encryption': True},
{'server_side_encryption_option': 'S3',
'use_server_side_encryption': True}])
def test_server_side_encryption_option(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
def test_socket_timeout(sdc_builder, sdc_executor):
pass
@stub
def test_thread_pool_size_for_parallel_uploads(sdc_builder, sdc_executor):
pass
@stub
def test_time_basis(sdc_builder, sdc_executor):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'use_proxy': False}, {'use_proxy': True}])
def test_use_proxy(sdc_builder, sdc_executor, stage_attributes):
pass
@stub
@pytest.mark.parametrize('stage_attributes', [{'use_server_side_encryption': False},
{'use_server_side_encryption': True}])
def test_use_server_side_encryption(sdc_builder, sdc_executor, stage_attributes):
pass
| 30.562771 | 107 | 0.599292 | 762 | 7,060 | 5.170604 | 0.206037 | 0.058629 | 0.108883 | 0.175888 | 0.674619 | 0.653807 | 0.653807 | 0.62132 | 0.55736 | 0.525127 | 0 | 0.005878 | 0.301133 | 7,060 | 230 | 108 | 30.695652 | 0.792663 | 0.078187 | 0 | 0.557047 | 0 | 0 | 0.197597 | 0.075774 | 0 | 0 | 0 | 0 | 0 | 1 | 0.221477 | false | 0.228188 | 0.013423 | 0 | 0.234899 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 3 |
a7e1140391b31a5dea8b436e4c9fac597acf4691 | 153 | py | Python | src/waldur_auth_bcc/urls.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | 2 | 2017-01-20T15:26:25.000Z | 2017-08-03T04:38:08.000Z | src/waldur_auth_bcc/urls.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | src/waldur_auth_bcc/urls.py | opennode/nodeconductor-assembly-waldur | cad9966389dc9b52b13d2301940c99cf4b243900 | [
"MIT"
] | null | null | null | from django.urls import re_path
from . import views
urlpatterns = [
re_path(r'^api-auth/bcc/user-details/$', views.UserDetailsViewSet.as_view())
]
| 19.125 | 80 | 0.732026 | 22 | 153 | 4.954545 | 0.772727 | 0.110092 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.130719 | 153 | 7 | 81 | 21.857143 | 0.819549 | 0 | 0 | 0 | 0 | 0 | 0.183007 | 0.183007 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 3 |
a7f0226d4b62a7ba3687024cbdf4a50bcfb2bad4 | 1,319 | py | Python | pyhodl/data/parse/markets/gdax.py | sirfoga/pyhodl | 6a8088de30dfc0f5b854db8a04ce98a0169ef07d | [
"MIT"
] | 6 | 2018-09-23T20:57:01.000Z | 2021-10-31T07:50:54.000Z | pyhodl/data/parse/markets/gdax.py | sirfoga/pyhodl | 6a8088de30dfc0f5b854db8a04ce98a0169ef07d | [
"MIT"
] | 8 | 2018-01-02T15:28:18.000Z | 2019-04-15T18:38:20.000Z | pyhodl/data/parse/markets/gdax.py | sirfoga/pyhodl | 6a8088de30dfc0f5b854db8a04ce98a0169ef07d | [
"MIT"
] | 4 | 2018-01-03T18:48:25.000Z | 2018-09-23T20:57:04.000Z | # !/usr/bin/python3
# coding: utf_8
""" Parse raw Gdax data """
import ciso8601
from .coinbase import CoinbaseParser
class GdaxParser(CoinbaseParser):
""" Parses Binance transactions data """
def get_coins_amounts(self, raw):
amount = float(raw["amount"])
coin = raw["currency"]
if amount >= 0: # buy
return coin, abs(amount), None, 0
return None, 0, coin, abs(amount)
def is_trade(self, raw):
return "product_id" in raw["details"]
@staticmethod
def get_transfer_type(raw):
"""
:param raw: {}
Raw trade
:return: str
Transfer type
"""
if raw["type"] == "transfer":
return raw["details"]["transfer_type"]
def is_withdrawal(self, raw):
return self.get_transfer_type(raw) == "withdraw"
def get_commission(self, raw):
return None # by default no way to check if transaction has fee or not
def get_date(self, raw):
return ciso8601.parse_datetime(raw["created_at"])
def is_deposit(self, raw):
return self.get_transfer_type(raw) == "deposit"
def is_successful(self, raw):
return True # always
def build_exchange(self, exchange_name="gdax"):
return super().build_exchange(exchange_name)
| 23.553571 | 79 | 0.607278 | 162 | 1,319 | 4.802469 | 0.444444 | 0.062982 | 0.100257 | 0.069409 | 0.089974 | 0.089974 | 0.089974 | 0.089974 | 0 | 0 | 0 | 0.013655 | 0.278241 | 1,319 | 55 | 80 | 23.981818 | 0.803571 | 0.163002 | 0 | 0 | 0 | 0 | 0.088462 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0.074074 | 0.259259 | 0.814815 | 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 |
c52dff4073600e06e452d62a9b4ea9aba0288b51 | 2,898 | py | Python | python/2019_14_1.py | wensby/advent-of-code | 50cd7fa2d35674d868a79ac8c75be24a43267e2b | [
"MIT"
] | null | null | null | python/2019_14_1.py | wensby/advent-of-code | 50cd7fa2d35674d868a79ac8c75be24a43267e2b | [
"MIT"
] | null | null | null | python/2019_14_1.py | wensby/advent-of-code | 50cd7fa2d35674d868a79ac8c75be24a43267e2b | [
"MIT"
] | null | null | null | import sys
import re
import math
reaction_pattern = re.compile('^(.*) => (.*)$')
class ChemicalAmount:
def __init__(self, name, amount):
self._name = name
self._amount = amount
@property
def name(self):
return self._name
@property
def amount(self):
return self._amount
def __mul__(self, other):
return ChemicalAmount(self._name, self._amount * other)
def __sub__(self, other):
return ChemicalAmount(self._name, self._amount - other)
def __add__(self, other):
return ChemicalAmount(self._name, self._amount + other)
def __repr__(self):
return f'{self._amount} {self._name}'
class Reaction:
def __init__(self, reagents, result):
self._reagents = reagents
self._result = result
@property
def result(self):
return self._result
@property
def reagents(self):
return self._reagents
def __repr__(self):
return f'{self._reagents} => {self._result}'
class RequirementResolver:
def __init__(self, reactions):
self._reactions = reactions
def solve_for(self, requirement):
self._requirements = {requirement.name: requirement}
while not self._only_ore_positive():
subject_requirement = self._next_requirement()
reaction = self._find_reaction(subject_requirement)
self._requirements[subject_requirement.name] -= reaction.result.amount
for reagent in reaction.reagents:
if reagent.name not in self._requirements:
self._requirements[reagent.name] = ChemicalAmount(reagent.name, 0)
self._requirements[reagent.name] += reagent.amount
return self._requirements['ORE'].amount
def _positive_requirements(self):
return [r for r in self._requirements.values() if r.amount > 0]
def _only_ore_positive(self):
positive_requirements = self._positive_requirements()
return len(positive_requirements) == 1 and positive_requirements[0].name == 'ORE'
def _next_requirement(self):
for requirement in self._positive_requirements():
if requirement.name != 'ORE':
return requirement
def _find_reaction(self, requirement):
for reaction in self._reactions:
if reaction.result.name == requirement.name:
return reaction
def run(input):
reactions = parse_reactions(input)
resolver = RequirementResolver(reactions)
return resolver.solve_for(ChemicalAmount('FUEL', 1))
def parse_reactions(lines):
return list(map(parse_reaction, lines.splitlines()))
def parse_reaction(subject):
match = reaction_pattern.match(subject)
product = match.group(2).split(' ')
product_part = ( product[1], int(product[0]) )
factors = map(lambda x: x.split(' '), match.group(1).split(', '))
reagents = list(map(lambda r: ChemicalAmount(r[1], int(r[0])), factors))
result = ChemicalAmount(product[1], int(product[0]))
return Reaction(reagents, result)
if __name__ == '__main__':
print(run(sys.stdin.read()))
| 28.135922 | 85 | 0.70842 | 351 | 2,898 | 5.558405 | 0.19943 | 0.028703 | 0.028703 | 0.044593 | 0.125064 | 0.105587 | 0.084572 | 0.084572 | 0.084572 | 0.084572 | 0 | 0.005421 | 0.172533 | 2,898 | 102 | 86 | 28.411765 | 0.808173 | 0 | 0 | 0.077922 | 0 | 0 | 0.034507 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25974 | false | 0 | 0.038961 | 0.142857 | 0.558442 | 0.012987 | 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 |
c52ee7a445b662819513a85eaa7d0c23d00cd816 | 80 | py | Python | python/testData/stubs/ImportedTypedDictWithAs.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/stubs/ImportedTypedDictWithAs.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2022-02-19T09:45:05.000Z | 2022-02-27T20:32:55.000Z | python/testData/stubs/ImportedTypedDictWithAs.py | tgodzik/intellij-community | f5ef4191fc30b69db945633951fb160c1cfb7b6f | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from typing import TypedDict as TD
td = TD("name", {"field": str}, total=False) | 26.666667 | 44 | 0.6875 | 13 | 80 | 4.230769 | 0.846154 | 0.145455 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15 | 80 | 3 | 44 | 26.666667 | 0.808824 | 0 | 0 | 0 | 0 | 0 | 0.111111 | 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 |
c543a06f97db63a83f8f7f9c4aa2ed5e236196b7 | 30 | py | Python | infupy/__init__.py | jaj42/infupy | 5a8eda58bbeab3e0de6326dce7d206c29db85d72 | [
"ISC"
] | null | null | null | infupy/__init__.py | jaj42/infupy | 5a8eda58bbeab3e0de6326dce7d206c29db85d72 | [
"ISC"
] | null | null | null | infupy/__init__.py | jaj42/infupy | 5a8eda58bbeab3e0de6326dce7d206c29db85d72 | [
"ISC"
] | null | null | null | __all__ = ["backends", "gui"]
| 15 | 29 | 0.6 | 3 | 30 | 4.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 30 | 1 | 30 | 30 | 0.538462 | 0 | 0 | 0 | 0 | 0 | 0.366667 | 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 |
c54897d1a04548090be8533f3232719a6bf988f8 | 1,474 | py | Python | test_life.py | effractor/game-of-life | 8ea1fe98851b749702d425cbf2b85b900bbabe71 | [
"MIT"
] | null | null | null | test_life.py | effractor/game-of-life | 8ea1fe98851b749702d425cbf2b85b900bbabe71 | [
"MIT"
] | null | null | null | test_life.py | effractor/game-of-life | 8ea1fe98851b749702d425cbf2b85b900bbabe71 | [
"MIT"
] | null | null | null | import unittest
import life
class TestCell(unittest.TestCase):
def setUp(self):
self.board = set([(5, 5)])
self.life = life.Life((10, 10), self.board)
def test_creation(self):
self.assertEqual(self.board, self.life.get_board())
def test_evaluation(self):
self.life.evaluate()
self.assertEqual(set(), self.life.get_board())
class TestBlinker(unittest.TestCase):
def setUp(self):
self.board = set([(5, 5), (5, 6), (5, 7)])
self.life = life.Life((10, 10), self.board)
def test_period1(self):
self.life.evaluate()
self.assertEqual(set([(4, 6), (5, 6), (6, 6)]), self.life.get_board())
def test_period2(self):
self.life.evaluate()
self.life.evaluate()
self.assertEqual(self.board, self.life.get_board())
class TestBorderX(unittest.TestCase):
def setUp(self):
self.board = set([(0, 0), (0, 1), (0, 2)])
self.life = life.Life((5, 5), self.board)
def test_period1(self):
self.life.evaluate()
self.assertEqual(set([(4, 1), (0, 1), (1, 1)]), self.life.get_board())
class TestBorderY(unittest.TestCase):
def setUp(self):
self.board = set([(0, 0), (1, 0), (2, 0)])
self.life = life.Life((5, 5), self.board)
def test_period1(self):
self.life.evaluate()
self.assertEqual(set([(1, 4), (1, 0), (1, 1)]), self.life.get_board())
if __name__ == '__main__':
unittest.main()
| 26.8 | 78 | 0.584125 | 205 | 1,474 | 4.102439 | 0.160976 | 0.1522 | 0.085612 | 0.11415 | 0.843044 | 0.747919 | 0.669441 | 0.624257 | 0.529132 | 0.529132 | 0 | 0.047535 | 0.229308 | 1,474 | 54 | 79 | 27.296296 | 0.692782 | 0 | 0 | 0.5 | 0 | 0 | 0.005427 | 0 | 0 | 0 | 0 | 0 | 0.157895 | 1 | 0.263158 | false | 0 | 0.052632 | 0 | 0.421053 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 |
c558d4f1493eaece6994ffb9a6d65f0047d90993 | 435 | py | Python | pinax/comments/hooks.py | ctycheer163/pinax-comments | 3c239b929075d3843f6ed2d07c94b022e6c5b5ff | [
"MIT"
] | 1 | 2019-05-13T05:43:38.000Z | 2019-05-13T05:43:38.000Z | pinax/comments/hooks.py | ctycheer163/pinax-comments | 3c239b929075d3843f6ed2d07c94b022e6c5b5ff | [
"MIT"
] | null | null | null | pinax/comments/hooks.py | ctycheer163/pinax-comments | 3c239b929075d3843f6ed2d07c94b022e6c5b5ff | [
"MIT"
] | null | null | null | class CommentsDefaultHookSet(object):
def load_can_delete(self, user, comment):
if user.is_superuser:
return True
return user == comment.author
def load_can_edit(self, user, comment):
return user == comment.author
class HookProxy(object):
def __getattr__(self, attr):
from .conf import settings
return getattr(settings.COMMENTS_HOOKSET, attr)
hookset = HookProxy()
| 22.894737 | 55 | 0.671264 | 50 | 435 | 5.64 | 0.52 | 0.156028 | 0.070922 | 0.163121 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.245977 | 435 | 18 | 56 | 24.166667 | 0.859756 | 0 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.083333 | 0.083333 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
c565a7658905a8818d53192f04d537f014fe7dc0 | 2,117 | py | Python | mayaSDK/maya/app/renderSetup/views/lightEditor/lightSource.py | FXTD-ODYSSEY/vscode-mayapy | 7a21872f80b5b740fc653e79c3f9b5268e87b3c3 | [
"MIT"
] | 20 | 2019-09-20T00:30:22.000Z | 2021-12-26T06:56:16.000Z | mayaSDK/maya/app/renderSetup/views/lightEditor/lightSource.py | minjiang999/vscode-mayapy | 7a21872f80b5b740fc653e79c3f9b5268e87b3c3 | [
"MIT"
] | 5 | 2019-12-29T15:19:03.000Z | 2022-03-29T16:54:19.000Z | mayaSDK/maya/app/renderSetup/views/lightEditor/lightSource.py | minjiang999/vscode-mayapy | 7a21872f80b5b740fc653e79c3f9b5268e87b3c3 | [
"MIT"
] | 8 | 2019-09-23T05:46:44.000Z | 2022-01-11T14:42:14.000Z | from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
class ItemStyle(QCommonStyle):
"""
This class defines the view item style and is only used when style sheets and the delegate are not sufficient.
"""
def __init__(self, parent):
pass
def drawComplexControl(self, control, option, painter, widget='None'):
pass
def drawControl(self, element, option, painter, widget='None'):
pass
def drawItemPixmap(self, painter, rectangle, alignment, pixmap):
pass
def drawItemText(self, painter, rectangle, alignment, palette, enabled, text, textRole='PySide2.QtGui.QPalette.ColorRole.NoRole'):
pass
def drawPrimitive(self, element, option, painter, widget='None'):
"""
Draws the given primitive element with the provided painter using the style options specified by option.
"""
pass
def generatedIconPixmap(self, iconMode, pixmap, option):
pass
def hitTestComplexControl(self, control, option, position, widget='None'):
pass
def itemPixmapRect(self, rectangle, alignment, pixmap):
pass
def itemTextRect(self, metrics, rectangle, alignment, enabled, text):
pass
def pixelMetric(self, metric, option='None', widget='None'):
pass
def polish(self, *args, **kwargs):
pass
def sizeFromContents(self, ct, opt, contentsSize, widget='None'):
pass
def styleHint(self, hint, option='None', widget='None', returnData='None'):
pass
def subControlRect(self, control, option, subControl, widget='None'):
pass
def subElementRect(self, element, option, widget='None'):
pass
def unpolish(self, *args, **kwargs):
pass
DROP_INDICATOR_COLOR = None
DROP_INDICATOR_LEFT_OFFSET = -50.0
DROP_INDICATOR_WIDTH = 6.0
staticMetaObject = None
| 21.824742 | 134 | 0.598961 | 214 | 2,117 | 5.873832 | 0.434579 | 0.089101 | 0.070008 | 0.09467 | 0.132856 | 0.083532 | 0 | 0 | 0 | 0 | 0 | 0.006169 | 0.310817 | 2,117 | 96 | 135 | 22.052083 | 0.85538 | 0.101559 | 0 | 0.404762 | 0 | 0 | 0.046774 | 0.020968 | 0 | 0 | 0 | 0 | 0 | 1 | 0.404762 | false | 0.404762 | 0.071429 | 0 | 0.595238 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 3 |
c56f5085bcb27be38d1c5d47d4b9b19d1350ec81 | 421 | py | Python | vm/nga-python/IntegerStack.py | crcx/retroforth | 1486cd9e970feef5edb08fdee58046cb64397e9a | [
"ISC"
] | 65 | 2016-11-05T09:10:06.000Z | 2022-03-05T17:01:51.000Z | vm/nga-python/IntegerStack.py | p-unity-lineage/retroforth | 191e64e5e224df6f8d67b137ba416fe0b39d38bd | [
"ISC"
] | null | null | null | vm/nga-python/IntegerStack.py | p-unity-lineage/retroforth | 191e64e5e224df6f8d67b137ba416fe0b39d38bd | [
"ISC"
] | 10 | 2020-12-03T00:02:46.000Z | 2021-11-11T18:57:09.000Z | class IntegerStack(list):
def __init__(self):
stack = [] * 128
self.extend(stack)
def depth(self):
return len(self)
def tos(self):
return self[-1]
def push(self, v):
self.append(v)
def dup(self):
self.append(self[-1])
def drop(self):
self.pop()
def swap(self):
a = self[-2]
self[-2] = self[-1]
self[-1] = a
| 16.84 | 29 | 0.484561 | 55 | 421 | 3.636364 | 0.418182 | 0.1 | 0.08 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.033582 | 0.36342 | 421 | 24 | 30 | 17.541667 | 0.712687 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.388889 | false | 0 | 0 | 0.111111 | 0.555556 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 |
3d70b3696ee685e06e781f5b2891a6bf71e6e755 | 510 | py | Python | Exercicios/test_bhaskara1_fixture.py | eduardodarocha/Introducao_Ciencia_da_Computacao_com_Python_Parte_2_Coursera | b5b9198e16b4b67894b85766eb521ae96010accf | [
"MIT"
] | 1 | 2020-08-28T20:29:23.000Z | 2020-08-28T20:29:23.000Z | Exercicios/test_bhaskara1_fixture.py | eduardodarocha/Introducao_Ciencia_da_Computacao_com_Python_Parte_2_Coursera | b5b9198e16b4b67894b85766eb521ae96010accf | [
"MIT"
] | null | null | null | Exercicios/test_bhaskara1_fixture.py | eduardodarocha/Introducao_Ciencia_da_Computacao_com_Python_Parte_2_Coursera | b5b9198e16b4b67894b85766eb521ae96010accf | [
"MIT"
] | null | null | null | import Bhaskara1
import pytest
class TestBhaskara:
@pytest.fixture
def b(self):
return Bhaskara1.Bhaskara()
def testa_uma_raiz(self, b):
assert b.calcula_raizes(1, 0, 0) == (1, 0)
def testa_duas_raiz(self, b):
assert b.calcula_raizes(1, -5, 6) == (2, 3, 2)
def testa_zero_raiz(self, b):
assert b.calcula_raizes(10, 10, 10) == (0)
def testa_raiz_negativa(self, b):
assert b.calcula_raizes(10, 20, 10) == (1, -1) | 25.5 | 54 | 0.57451 | 74 | 510 | 3.797297 | 0.378378 | 0.113879 | 0.156584 | 0.170819 | 0.419929 | 0.419929 | 0.419929 | 0.213523 | 0 | 0 | 0 | 0.077778 | 0.294118 | 510 | 20 | 55 | 25.5 | 0.702778 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.357143 | false | 0 | 0.142857 | 0.071429 | 0.642857 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 3 |
3d9b17eaa8c3097af7363ac5f796410bcd85b754 | 1,261 | py | Python | src/toolbox/cpu/processing.py | Martth/OCT_calibration | 84406e0c39365d54a6cf9c558ebb40fd5f591725 | [
"MIT"
] | 4 | 2021-10-04T17:35:07.000Z | 2022-02-20T23:16:42.000Z | src/toolbox/cpu/processing.py | hweismile/OCT_calibration | 84406e0c39365d54a6cf9c558ebb40fd5f591725 | [
"MIT"
] | null | null | null | src/toolbox/cpu/processing.py | hweismile/OCT_calibration | 84406e0c39365d54a6cf9c558ebb40fd5f591725 | [
"MIT"
] | 1 | 2019-06-20T04:44:28.000Z | 2019-06-20T04:44:28.000Z | # -MPdSH
'''_____Standard imports_____'''
import numpy as np
import scipy.fftpack as fp
import scipy
'''_____Project imports_____'''
from src.toolbox.filters import butter_highpass_filter
#from src.toolbox.calibration_processing import linearize_spectra, compensate_dispersion
from src.toolbox.maths import spectra2aline, hilbert
from src.toolbox._arguments import Arguments
from src.toolbox.cpu.algorithm import linearize_spectra, compensate_dispersion
def process_2D(Volume_spectra: np.ndarray, calibration: dict, shift: int=0):
"""
CPU based
"""
Volume_spectra = scipy.signal.detrend(Volume_spectra, axis=0, type='linear')
Volume_spectra = compensate_dispersion(Volume_spectra, Arguments.dispersion * complex(0,1) * np.array( calibration['dispersion'] ))
Volume_spectra = linearize_spectra(Volume_spectra, calibration['klinear'])
if Arguments.shift:
spectra = shift_spectra(Volume_spectra, calibration)
return spectra2aline([Volume_spectra])[0,:,:Arguments.dimension[2]//2]
def shift_spectra(Volume_spectra: np.ndarray, calibration: dict):
j = complex(0,1)
shift = calibration['peak_shift1']
return np.real( Volume_spectra * np.exp(j * np.arange(Arguments.dimension[2]) * shift ) )
# ---
| 28.022222 | 135 | 0.754956 | 154 | 1,261 | 5.88961 | 0.383117 | 0.157663 | 0.077178 | 0.070562 | 0.174201 | 0.081588 | 0 | 0 | 0 | 0 | 0 | 0.012844 | 0.135607 | 1,261 | 44 | 136 | 28.659091 | 0.819266 | 0.107058 | 0 | 0 | 0 | 0 | 0.031716 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0.055556 | 0.388889 | 0 | 0.611111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 3 |
3da8a6470cf9800eafb4ca912664c68c72e9eacc | 944 | py | Python | sparkdq/repository/ResultKey.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | 1 | 2021-02-08T07:49:54.000Z | 2021-02-08T07:49:54.000Z | sparkdq/repository/ResultKey.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | sparkdq/repository/ResultKey.py | PasaLab/SparkDQ | 16d50210747ef7de03cf36d689ce26ff7445f63a | [
"Apache-2.0"
] | null | null | null | class ResultKey:
"""
Key for storing and searching Metrics.
"""
def __init__(self, data_set_date, tags):
self.data_set_date = data_set_date
self.tags = tags
def __str__(self):
return "DataSetDate: {}\nTags: {}".format(self.data_set_date, self.tags)
def __eq__(self, other):
if self.data_set_date != other.data_set_date:
return False
if len(self.tags) != len(other.tags):
return False
for k, v in self.tags.items():
if (k not in other.tags) or (v != other.tags[k]):
return False
return True
def __hash__(self):
return hash((self.data_set_date, frozenset(self.tags.items())))
def to_json(self):
return {
"DataSetDate": self.data_set_date,
"Tags": self.tags
}
@staticmethod
def from_json(d):
return ResultKey(d["DataSetDate"], d["Tags"])
| 27.764706 | 80 | 0.573093 | 121 | 944 | 4.190083 | 0.322314 | 0.110454 | 0.17357 | 0.177515 | 0.16568 | 0.09073 | 0 | 0 | 0 | 0 | 0 | 0 | 0.306144 | 944 | 33 | 81 | 28.606061 | 0.774046 | 0.040254 | 0 | 0.12 | 0 | 0 | 0.061798 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.24 | false | 0 | 0 | 0.16 | 0.6 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 3 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.