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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
719d0ca40aff4c282ff89597163d7a075257991a | 89 | py | Python | flask_imagine/adapters/__init__.py | FlaskGuys/Flask-Imagine | c42b2f068f449891a72ff48fc3526e8472fe9edb | [
"MIT"
] | 1 | 2016-04-16T00:51:35.000Z | 2016-04-16T00:51:35.000Z | flask_imagine/adapters/__init__.py | FlaskGuys/Flask-Imagine | c42b2f068f449891a72ff48fc3526e8472fe9edb | [
"MIT"
] | 8 | 2016-04-12T22:32:51.000Z | 2021-09-07T23:23:32.000Z | flask_imagine/adapters/__init__.py | FlaskGuys/Flask-Imagine | c42b2f068f449891a72ff48fc3526e8472fe9edb | [
"MIT"
] | 2 | 2017-05-21T13:45:54.000Z | 2017-12-14T17:28:18.000Z | from .filesystem import ImagineFilesystemAdapter
__all__ = ['ImagineFilesystemAdapter']
| 22.25 | 48 | 0.842697 | 6 | 89 | 11.833333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.089888 | 89 | 3 | 49 | 29.666667 | 0.876543 | 0 | 0 | 0 | 0 | 0 | 0.269663 | 0.269663 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 1 | 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 | 4 |
719f78e281a34e8f30403c8d661d8ae2a7623f84 | 386 | py | Python | roll_engine/exceptions.py | js882829/tars | 54488909422839ecddcec5b4fc9b024bfb6b86dd | [
"Apache-2.0"
] | 371 | 2016-12-19T13:35:43.000Z | 2022-03-16T02:48:28.000Z | roll_engine/exceptions.py | js882829/tars | 54488909422839ecddcec5b4fc9b024bfb6b86dd | [
"Apache-2.0"
] | 17 | 2017-04-27T02:31:20.000Z | 2022-03-21T13:10:25.000Z | roll_engine/exceptions.py | js882829/tars | 54488909422839ecddcec5b4fc9b024bfb6b86dd | [
"Apache-2.0"
] | 165 | 2016-12-21T09:41:52.000Z | 2022-03-03T09:18:13.000Z | class DeploymentError(Exception):
pass
class BatchPatternError(DeploymentError):
pass
class MetaMissing(DeploymentError):
pass
class JobMissing(DeploymentError):
pass
class StatusError(DeploymentError):
pass
class ActionNotExist(DeploymentError):
pass
class ActionNotAllowed(DeploymentError):
pass
class ActionFailed(DeploymentError):
pass
| 12.451613 | 41 | 0.756477 | 32 | 386 | 9.125 | 0.34375 | 0.215753 | 0.493151 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.181347 | 386 | 30 | 42 | 12.866667 | 0.924051 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.5 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
71a48864b7957fb34581d959cd83cf7f24256bd5 | 4,432 | py | Python | src/upb/gen_build_yaml.py | thiagoss/grpc | 3eb743ba4c9e38941aeac3a54420628b46335d20 | [
"Apache-2.0"
] | 1 | 2021-01-29T01:52:54.000Z | 2021-01-29T01:52:54.000Z | src/upb/gen_build_yaml.py | thiagoss/grpc | 3eb743ba4c9e38941aeac3a54420628b46335d20 | [
"Apache-2.0"
] | 5 | 2017-11-06T22:46:19.000Z | 2018-06-26T16:22:04.000Z | src/upb/gen_build_yaml.py | thiagoss/grpc | 3eb743ba4c9e38941aeac3a54420628b46335d20 | [
"Apache-2.0"
] | 3 | 2017-11-09T07:54:39.000Z | 2018-08-09T14:51:11.000Z | #!/usr/bin/env python2.7
# Copyright 2015 gRPC authors.
#
# 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.
# TODO: This should ideally be in upb submodule to avoid hardcoding this here.
import re
import os
import sys
import yaml
out = {}
try:
out['libs'] = [{
'name': 'upb',
'build': 'all',
'language': 'c',
'src': [
"third_party/upb/upb/decode_fast.c",
"third_party/upb/upb/decode.c",
"third_party/upb/upb/def.c",
"third_party/upb/upb/encode.c",
"third_party/upb/upb/json_decode.c",
"third_party/upb/upb/json_encode.c",
"third_party/upb/upb/msg.c",
"third_party/upb/upb/reflection.c",
"third_party/upb/upb/table.c",
"third_party/upb/upb/text_encode.c",
"third_party/upb/upb/upb.c",
"src/core/ext/upb-generated/google/protobuf/any.upb.c",
"src/core/ext/upb-generated/google/protobuf/descriptor.upb.c",
"src/core/ext/upb-generated/google/protobuf/duration.upb.c",
"src/core/ext/upb-generated/google/protobuf/empty.upb.c",
"src/core/ext/upb-generated/google/protobuf/struct.upb.c",
"src/core/ext/upb-generated/google/protobuf/timestamp.upb.c",
"src/core/ext/upb-generated/google/protobuf/wrappers.upb.c",
"src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.c",
"src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.c",
],
'headers': [
"third_party/upb/upb/decode_fast.h",
"third_party/upb/upb/decode.h",
"third_party/upb/upb/decode.int.h",
"third_party/upb/upb/def.h",
"third_party/upb/upb/def.hpp",
"third_party/upb/upb/encode.h",
"third_party/upb/upb/json_decode.h",
"third_party/upb/upb/json_encode.h",
"third_party/upb/upb/msg.h",
"third_party/upb/upb/port_def.inc",
"third_party/upb/upb/port_undef.inc",
"third_party/upb/upb/reflection.h",
"third_party/upb/upb/table.int.h",
"third_party/upb/upb/text_encode.h",
"third_party/upb/upb/upb.h",
"third_party/upb/upb/upb.hpp",
"third_party/upb/upb/upb.int.h",
"third_party/upb/third_party/wyhash/wyhash.h",
"src/core/ext/upb-generated/google/protobuf/any.upb.h",
"src/core/ext/upb-generated/google/protobuf/descriptor.upb.h",
"src/core/ext/upb-generated/google/protobuf/duration.upb.h",
"src/core/ext/upb-generated/google/protobuf/empty.upb.h",
"src/core/ext/upb-generated/google/protobuf/struct.upb.h",
"src/core/ext/upb-generated/google/protobuf/timestamp.upb.h",
"src/core/ext/upb-generated/google/protobuf/wrappers.upb.h",
"src/core/ext/upbdefs-generated/google/protobuf/any.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/descriptor.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/duration.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/empty.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/struct.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/timestamp.upbdefs.h",
"src/core/ext/upbdefs-generated/google/protobuf/wrappers.upbdefs.h",
],
'secure': False,
}]
except:
pass
print(yaml.dump(out))
| 45.22449 | 82 | 0.63583 | 605 | 4,432 | 4.591736 | 0.208264 | 0.069114 | 0.135709 | 0.161267 | 0.758819 | 0.670266 | 0.515119 | 0.515119 | 0.514039 | 0 | 0 | 0.002889 | 0.219088 | 4,432 | 97 | 83 | 45.690722 | 0.799769 | 0.146886 | 0 | 0.026316 | 0 | 0 | 0.689326 | 0.677642 | 0 | 0 | 0 | 0.010309 | 0 | 1 | 0 | false | 0.013158 | 0.052632 | 0 | 0.052632 | 0.013158 | 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 | 1 | 1 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
71a95c1107865b9c8d879ce480a81d5ef5b9eddf | 173 | py | Python | test19/Scripts/django-admin.py | diegomazorra1/electron-django | 240746222fa22e43532bc979a0e3256448738574 | [
"CC0-1.0"
] | 12 | 2020-05-24T02:09:17.000Z | 2022-03-18T08:53:17.000Z | test19/Scripts/django-admin.py | keeganskeate/electron-django | 240746222fa22e43532bc979a0e3256448738574 | [
"CC0-1.0"
] | 3 | 2020-07-18T16:32:58.000Z | 2021-07-13T19:15:25.000Z | test19/Scripts/django-admin.py | keeganskeate/electron-django | 240746222fa22e43532bc979a0e3256448738574 | [
"CC0-1.0"
] | 9 | 2020-03-17T09:53:22.000Z | 2022-03-18T08:53:26.000Z | #!C:\Users\Diego M\Desktop\CARPETA TESIS\test19\Scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 28.833333 | 66 | 0.786127 | 24 | 173 | 5.208333 | 0.916667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012821 | 0.098266 | 173 | 5 | 67 | 34.6 | 0.788462 | 0.375723 | 0 | 0 | 0 | 0 | 0.074766 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
71d3abf864c2e77a55e20abe978b651a0e97e14e | 1,164 | py | Python | fastapi_server/routes/login.py | BurnySc2/python-template | ff95adfb72afa1f06cc880467713dc4408783209 | [
"MIT"
] | null | null | null | fastapi_server/routes/login.py | BurnySc2/python-template | ff95adfb72afa1f06cc880467713dc4408783209 | [
"MIT"
] | null | null | null | fastapi_server/routes/login.py | BurnySc2/python-template | ff95adfb72afa1f06cc880467713dc4408783209 | [
"MIT"
] | null | null | null | from fastapi import Depends, Response
from fastapi.routing import APIRouter
from pydantic import BaseModel # pylint: disable=E0611
from sqlmodel import Session, select
from starlette.responses import JSONResponse
from fastapi_server.database.database import get_session
from fastapi_server.models.user import User
login_router = APIRouter()
class LoginModel(BaseModel):
email: str
password: str
# TODO: Replace /login endpoint when Response is available in strawberry query info-context
@login_router.post('/login')
async def login(login_data: LoginModel, session: Session = Depends(get_session)) -> Response:
statement = select(User).where(User.email == login_data.email, User.password_hashed == login_data.password)
user = session.exec(statement).first()
if user is None:
raise FileNotFoundError('Email and password do not match')
# Set message and cookies in frontend
content = {'message': 'Come to the dark side, we have cookies'}
response = JSONResponse(content=content)
response.set_cookie(key='fakesession', value='fake-cookie-session-value', httponly=True, secure=True, expires=3600)
return response
| 37.548387 | 119 | 0.765464 | 151 | 1,164 | 5.827815 | 0.536424 | 0.05 | 0.038636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.008065 | 0.147766 | 1,164 | 30 | 120 | 38.8 | 0.879032 | 0.126289 | 0 | 0 | 0 | 0 | 0.116486 | 0.024679 | 0 | 0 | 0 | 0.033333 | 0 | 1 | 0 | false | 0.142857 | 0.333333 | 0 | 0.52381 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 4 |
71dbf8141286bc70cf3538beaf3323dcc9737296 | 796 | py | Python | hackerrank/Algorithms/Cut the Tree/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/Algorithms/Cut the Tree/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/Algorithms/Cut the Tree/test.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | import unittest
import solution
class TestQ(unittest.TestCase):
def test_case_0(self):
self.assertEqual(solution.cutTheTree(
[100, 200, 100, 500, 100, 600],
[
[1, 2],
[2, 3],
[2, 5],
[4, 5],
[5, 6],
]
), 400)
def test_case_1(self):
self.assertEqual(solution.cutTheTree(
[205, 573, 985, 242, 830, 514, 592, 263, 142, 915],
[
[2, 8],
[10, 5],
[1, 7],
[6, 9],
[4, 3],
[8, 10],
[5, 1],
[7, 6],
[9, 4],
]
), 99)
if __name__ == '__main__':
unittest.main()
| 20.947368 | 63 | 0.33794 | 77 | 796 | 3.337662 | 0.545455 | 0.054475 | 0.085603 | 0.210117 | 0.357977 | 0.070039 | 0.070039 | 0.070039 | 0 | 0 | 0 | 0.223097 | 0.521357 | 796 | 37 | 64 | 21.513514 | 0.451444 | 0 | 0 | 0.064516 | 0 | 0 | 0.01005 | 0 | 0 | 0 | 0 | 0 | 0.064516 | 1 | 0.064516 | false | 0 | 0.064516 | 0 | 0.16129 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e08924232ee4de5ca1ecf910740e6ba69f9be6c0 | 63 | py | Python | app/boot.py | enborra/turing-atlasec | 2db4ed4b83af388e3cca24d604f81b8ddbe83c3b | [
"MIT"
] | null | null | null | app/boot.py | enborra/turing-atlasec | 2db4ed4b83af388e3cca24d604f81b8ddbe83c3b | [
"MIT"
] | null | null | null | app/boot.py | enborra/turing-atlasec | 2db4ed4b83af388e3cca24d604f81b8ddbe83c3b | [
"MIT"
] | null | null | null | from core import CoreService
app = CoreService()
app.start()
| 10.5 | 28 | 0.746032 | 8 | 63 | 5.875 | 0.75 | 0.595745 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.15873 | 63 | 5 | 29 | 12.6 | 0.886792 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 1 | 0 | 0 | null | 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 | 1 | 0 | 0 | 0 | 0 | 4 |
e08ceb379a7fae658d6c02eff1f2b9c1f10b2364 | 175 | py | Python | wqxlib/wqx_v3_0/HorizontalAccuracyMeasure.py | FlippingBinary/wqxlib-python | 5aa1d41384928f1faca47d5984485e2efa93174c | [
"MIT"
] | null | null | null | wqxlib/wqx_v3_0/HorizontalAccuracyMeasure.py | FlippingBinary/wqxlib-python | 5aa1d41384928f1faca47d5984485e2efa93174c | [
"MIT"
] | null | null | null | wqxlib/wqx_v3_0/HorizontalAccuracyMeasure.py | FlippingBinary/wqxlib-python | 5aa1d41384928f1faca47d5984485e2efa93174c | [
"MIT"
] | null | null | null | # This file was not converted from XSD because it is does not define a complex type
# It only creates an element called "HorizontalAccuracyMeasure" of type "MeasureCompact"
| 58.333333 | 89 | 0.794286 | 26 | 175 | 5.346154 | 0.884615 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171429 | 175 | 2 | 90 | 87.5 | 0.958621 | 0.96 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e0e0a15ca10587f6814b75f7042d66492b867e8c | 28 | py | Python | ml-agents/mlagents/trainers/__init__.py | microm8/ml-agents | 30468c812c86abf069a5c5b256af6cbcc28d84a0 | [
"Apache-2.0"
] | 1 | 2019-01-03T04:34:12.000Z | 2019-01-03T04:34:12.000Z | ml-agents/mlagents/trainers/__init__.py | moonsh/ml-agents | d76bea75a2eb9b0b9429bd912cc7f72686a9896e | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/__init__.py | moonsh/ml-agents | d76bea75a2eb9b0b9429bd912cc7f72686a9896e | [
"Apache-2.0"
] | null | null | null | __version__ = "0.14.0.dev0"
| 14 | 27 | 0.678571 | 5 | 28 | 3 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0.107143 | 28 | 1 | 28 | 28 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0.392857 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e0e2a6cd6ce179b0ad38c2cf6ee3d48a9d32db9a | 786 | py | Python | ABC/abc101-abc150/abc129/e/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc101-abc150/abc129/e/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc101-abc150/abc129/e/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
l = list(input())
n = len(l)
mod = 10 ** 9 + 7
dp = [[0 for _ in range(2)] for _ in range(n + 10)]
dp[0][0] = 1
for i, li in enumerate(l):
# a + b = 0
if li == '0':
dp[i + 1][0] = dp[i][0]
dp[i + 1][1] = dp[i][1]
else:
dp[i + 1][1] = dp[i][0] + dp[i][1]
dp[i + 1][1] %= mod
# a + b = 1
if li == '0':
dp[i + 1][1] += dp[i][1] * 2
dp[i + 1][1] %= mod
else:
dp[i + 1][0] += dp[i][0] * 2
dp[i + 1][0] %= mod
dp[i + 1][1] += dp[i][1] * 2
dp[i + 1][1] %= mod
ans = dp[n][0] + dp[n][1]
ans %= mod
print(ans)
if __name__ == "__main__":
main()
| 21.243243 | 55 | 0.324427 | 133 | 786 | 1.842105 | 0.233083 | 0.208163 | 0.228571 | 0.142857 | 0.383673 | 0.35102 | 0.261224 | 0.191837 | 0.146939 | 0.146939 | 0 | 0.110092 | 0.445293 | 786 | 36 | 56 | 21.833333 | 0.451835 | 0.052163 | 0 | 0.346154 | 0 | 0 | 0.013495 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.038462 | false | 0 | 0 | 0 | 0.038462 | 0.038462 | 0 | 0 | 1 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
460937338b18879828ee75b23e35d6b04884800f | 1,036 | py | Python | dvc_oss/tests/cloud.py | iterative/dvc-oss | 6496ed0b74ee611cb356e8e296173b9ec6c3cd86 | [
"Apache-2.0"
] | null | null | null | dvc_oss/tests/cloud.py | iterative/dvc-oss | 6496ed0b74ee611cb356e8e296173b9ec6c3cd86 | [
"Apache-2.0"
] | 1 | 2021-12-02T08:10:34.000Z | 2021-12-02T08:10:34.000Z | dvc_oss/tests/cloud.py | iterative/dvc-oss | 6496ed0b74ee611cb356e8e296173b9ec6c3cd86 | [
"Apache-2.0"
] | null | null | null | # pylint:disable=abstract-method
import os
import uuid
from dvc.testing.cloud import Cloud
from dvc.testing.path_info import CloudURLInfo
TEST_OSS_REPO_BUCKET = "dvc-test-github"
class OSS(Cloud, CloudURLInfo):
IS_OBJECT_STORAGE = True
@staticmethod
def get_url():
return f"oss://{TEST_OSS_REPO_BUCKET}/{uuid.uuid4()}"
@property
def config(self):
return {
"url": self.url,
"oss_key_id": os.environ.get("OSS_ACCESS_KEY_ID"),
"oss_key_secret": os.environ.get("OSS_ACCESS_KEY_SECRET"),
"oss_endpoint": os.environ.get("OSS_ENDPOINT"),
}
def is_file(self):
raise NotImplementedError
def is_dir(self):
raise NotImplementedError
def exists(self):
raise NotImplementedError
def mkdir(self, mode=0o777, parents=False, exist_ok=False):
raise NotImplementedError
def write_bytes(self, contents):
raise NotImplementedError
def read_bytes(self):
raise NotImplementedError
| 23.022222 | 70 | 0.664093 | 126 | 1,036 | 5.246032 | 0.444444 | 0.217852 | 0.204236 | 0.068079 | 0.072617 | 0.072617 | 0 | 0 | 0 | 0 | 0 | 0.006337 | 0.238417 | 1,036 | 44 | 71 | 23.545455 | 0.831432 | 0.028958 | 0 | 0.2 | 0 | 0 | 0.146414 | 0.063745 | 0 | 0 | 0 | 0 | 0 | 1 | 0.266667 | false | 0 | 0.133333 | 0.066667 | 0.533333 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
1ca63d4d19b9c345f05554c42b75752553597e7e | 3,028 | py | Python | mrldb/type_cassandra.py | merlleu/mrldb | ea95474995219992edfe00b7606d1c780efd7451 | [
"MIT"
] | 1 | 2019-04-30T11:54:23.000Z | 2019-04-30T11:54:23.000Z | mrldb/type_cassandra.py | merlleu/mrldb | ea95474995219992edfe00b7606d1c780efd7451 | [
"MIT"
] | 1 | 2020-11-04T11:37:44.000Z | 2020-11-04T11:37:44.000Z | mrldb/type_cassandra.py | merlleu/mrldb | ea95474995219992edfe00b7606d1c780efd7451 | [
"MIT"
] | null | null | null | __doc__=f"""mrldb by Rémi "Mr e-RL" LANGDORPH
Copyright (c) 2019 Rémi LANGDORPH - mrerl@warlegend.net
under MIT License (https://github.com/merlleu/mrldb/blob/master/LICENSE)"""
from .struct import get_struct_init
class MrlDBCassandra:
def __init__(self, cluster, db=None, structure=None, username=None, password=None):
from cassandra.cqlengine import connection
from cassandra.cluster import Cluster
if isinstance(cluster, str):
cluster=[cluster]
if (username==None or password==None):
self.cluster=Cluster(cluster)
else:
from cassandra.auth import PlainTextAuthProvider
self.auth_provider = PlainTextAuthProvider(username=username, password=password)
self.cluster_=Cluster(cluster, auth_provider=self.auth_provider)
if db is not None:
self.db=self.cluster.connect(db)
self.cursor=self.db
else:
self.cluster_=self.cluster
self.cursor=self.cluster_.connect()
self.structure=structure
self._config={"system":"cassandra", "cluster": cluster,"database": db, "structure": f"{len(structure) if structure!=None else '0'} tables", "username": username, "password":password}
return
def insert(self, table, data):
def frmt(d):
return d.__repr__() if d is not None else "null"
return self.cursor.execute(f"INSERT INTO {table}({', '.join([x for x in data.keys()])}) VALUES ({', '.join([frmt(x) for x in data.values()])})")
def update(self, table, data, conds=None):
def frmt(d):
return d.__repr__() if d is not None else "null"
return self.cursor.execute(f"UPDATE {table} SET {', '.join([key+'='+frmt(arg) for key, arg in data.items()])}{' WHERE '+conds if conds!=None else ''}")
def select(self, table, columns, conds=None):
if self.structure!=None:
if columns=="*":columns=self.structure[table].keys()
return [
{_col:_var for _col, _var in zip(columns, record)}
for record in
self.cursor.execute(f"SELECT {'*' if columns=='*' else ', '.join(columns)} FROM {table}{' WHERE '+conds if conds!=None else ''}")
]
else:
return self.cursor.execute(f"SELECT {'*' if columns=='*' else ', '.join(columns)} FROM {table}{' WHERE '+conds if conds!=None else ''}")
def delete(self, table, conds=None):
# table= "mytable"
# conds= "(x=1) or (x=2 and y=3)"
return self.cursor.execute(f"DELETE FROM {table}{' WHERE '+conds if conds!=None else ''}")
def _getinfos(self):
return self._config
def init(self):
[self.cursor.execute(command) for command in get_struct_init(self.structure)]
return self
def __str__(self):
return f"<mrldb.MrlDBCassandra at {id(self)} - connection: {self._config['cluster']}>"
def __repr__(self):
return f"<mrldb.MrlDBCassandra at {id(self)} - connection: {self._config['cluster']}>"
| 52.206897 | 190 | 0.623184 | 385 | 3,028 | 4.78961 | 0.25974 | 0.043384 | 0.055315 | 0.048807 | 0.292842 | 0.264642 | 0.264642 | 0.249458 | 0.249458 | 0.227766 | 0 | 0.003439 | 0.231836 | 3,028 | 57 | 191 | 53.122807 | 0.789338 | 0.015852 | 0 | 0.166667 | 0 | 0.074074 | 0.312731 | 0.039973 | 0 | 0 | 0 | 0 | 0 | 1 | 0.203704 | false | 0.074074 | 0.074074 | 0.111111 | 0.518519 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 4 |
1cc9aa0581c19939d039136b263c08ff1c0f50b8 | 70 | py | Python | testapp/settings_with_south.py | imtapps/django-nose | 7e0412dabe2494f36d9d231020633b9d76fe7b4f | [
"BSD-3-Clause"
] | 1 | 2019-04-27T20:15:08.000Z | 2019-04-27T20:15:08.000Z | testapp/settings_with_south.py | h4ck3rm1k3/django-nose | 7fd0132090256e752119f90a3d4568203c486f2e | [
"BSD-3-Clause"
] | null | null | null | testapp/settings_with_south.py | h4ck3rm1k3/django-nose | 7fd0132090256e752119f90a3d4568203c486f2e | [
"BSD-3-Clause"
] | 1 | 2021-09-08T11:53:49.000Z | 2021-09-08T11:53:49.000Z | from settings import *
INSTALLED_APPS = ('south',) + INSTALLED_APPS
| 14 | 44 | 0.728571 | 8 | 70 | 6.125 | 0.75 | 0.530612 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.157143 | 70 | 4 | 45 | 17.5 | 0.830508 | 0 | 0 | 0 | 0 | 0 | 0.071429 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 4 |
1ce3b11abbe43e314e3b57a3c17a08a43e59cfbf | 13,726 | py | Python | mediapipe/util/tracking/tone_models_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | 5 | 2021-01-01T11:02:41.000Z | 2022-03-11T19:44:29.000Z | mediapipe/util/tracking/tone_models_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | null | null | null | mediapipe/util/tracking/tone_models_pb2.py | mengfu188/simple-mediapipe | 85dc8a87c9586312c2d057ad587bfccf3b5e2eb6 | [
"Apache-2.0"
] | 1 | 2021-04-12T05:59:46.000Z | 2021-04-12T05:59:46.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mediapipe/util/tracking/tone_models.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='mediapipe/util/tracking/tone_models.proto',
package='mediapipe',
syntax='proto2',
serialized_options=None,
create_key=_descriptor._internal_create_key,
serialized_pb=b'\n)mediapipe/util/tracking/tone_models.proto\x12\tmediapipe\"\x87\x01\n\rGainBiasModel\x12\x12\n\x07gain_c1\x18\x01 \x01(\x02:\x01\x31\x12\x12\n\x07\x62ias_c1\x18\x02 \x01(\x02:\x01\x30\x12\x12\n\x07gain_c2\x18\x03 \x01(\x02:\x01\x31\x12\x12\n\x07\x62ias_c2\x18\x04 \x01(\x02:\x01\x30\x12\x12\n\x07gain_c3\x18\x05 \x01(\x02:\x01\x31\x12\x12\n\x07\x62ias_c3\x18\x06 \x01(\x02:\x01\x30\"?\n\x14MixtureGainBiasModel\x12\'\n\x05model\x18\x01 \x03(\x0b\x32\x18.mediapipe.GainBiasModel\"\xdd\x01\n\x0f\x41\x66\x66ineToneModel\x12\x0f\n\x04g_00\x18\x01 \x01(\x02:\x01\x31\x12\x0f\n\x04g_01\x18\x02 \x01(\x02:\x01\x30\x12\x0f\n\x04g_02\x18\x03 \x01(\x02:\x01\x30\x12\x0f\n\x04g_03\x18\x04 \x01(\x02:\x01\x30\x12\x0f\n\x04g_10\x18\x05 \x01(\x02:\x01\x30\x12\x0f\n\x04g_11\x18\x06 \x01(\x02:\x01\x31\x12\x0f\n\x04g_12\x18\x07 \x01(\x02:\x01\x30\x12\x0f\n\x04g_13\x18\x08 \x01(\x02:\x01\x30\x12\x0f\n\x04g_20\x18\t \x01(\x02:\x01\x30\x12\x0f\n\x04g_21\x18\n \x01(\x02:\x01\x30\x12\x0f\n\x04g_22\x18\x0b \x01(\x02:\x01\x31\x12\x0f\n\x04g_23\x18\x0c \x01(\x02:\x01\x30\"C\n\x16MixtureAffineToneModel\x12)\n\x05model\x18\x01 \x03(\x0b\x32\x1a.mediapipe.AffineToneModel'
)
_GAINBIASMODEL = _descriptor.Descriptor(
name='GainBiasModel',
full_name='mediapipe.GainBiasModel',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='gain_c1', full_name='mediapipe.GainBiasModel.gain_c1', index=0,
number=1, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(1),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='bias_c1', full_name='mediapipe.GainBiasModel.bias_c1', index=1,
number=2, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='gain_c2', full_name='mediapipe.GainBiasModel.gain_c2', index=2,
number=3, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(1),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='bias_c2', full_name='mediapipe.GainBiasModel.bias_c2', index=3,
number=4, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='gain_c3', full_name='mediapipe.GainBiasModel.gain_c3', index=4,
number=5, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(1),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='bias_c3', full_name='mediapipe.GainBiasModel.bias_c3', index=5,
number=6, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=57,
serialized_end=192,
)
_MIXTUREGAINBIASMODEL = _descriptor.Descriptor(
name='MixtureGainBiasModel',
full_name='mediapipe.MixtureGainBiasModel',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='model', full_name='mediapipe.MixtureGainBiasModel.model', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=194,
serialized_end=257,
)
_AFFINETONEMODEL = _descriptor.Descriptor(
name='AffineToneModel',
full_name='mediapipe.AffineToneModel',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='g_00', full_name='mediapipe.AffineToneModel.g_00', index=0,
number=1, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(1),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_01', full_name='mediapipe.AffineToneModel.g_01', index=1,
number=2, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_02', full_name='mediapipe.AffineToneModel.g_02', index=2,
number=3, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_03', full_name='mediapipe.AffineToneModel.g_03', index=3,
number=4, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_10', full_name='mediapipe.AffineToneModel.g_10', index=4,
number=5, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_11', full_name='mediapipe.AffineToneModel.g_11', index=5,
number=6, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(1),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_12', full_name='mediapipe.AffineToneModel.g_12', index=6,
number=7, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_13', full_name='mediapipe.AffineToneModel.g_13', index=7,
number=8, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_20', full_name='mediapipe.AffineToneModel.g_20', index=8,
number=9, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_21', full_name='mediapipe.AffineToneModel.g_21', index=9,
number=10, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_22', full_name='mediapipe.AffineToneModel.g_22', index=10,
number=11, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(1),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
_descriptor.FieldDescriptor(
name='g_23', full_name='mediapipe.AffineToneModel.g_23', index=11,
number=12, type=2, cpp_type=6, label=1,
has_default_value=True, default_value=float(0),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=260,
serialized_end=481,
)
_MIXTUREAFFINETONEMODEL = _descriptor.Descriptor(
name='MixtureAffineToneModel',
full_name='mediapipe.MixtureAffineToneModel',
filename=None,
file=DESCRIPTOR,
containing_type=None,
create_key=_descriptor._internal_create_key,
fields=[
_descriptor.FieldDescriptor(
name='model', full_name='mediapipe.MixtureAffineToneModel.model', index=0,
number=1, type=11, cpp_type=10, label=3,
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key),
],
extensions=[
],
nested_types=[],
enum_types=[
],
serialized_options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=483,
serialized_end=550,
)
_MIXTUREGAINBIASMODEL.fields_by_name['model'].message_type = _GAINBIASMODEL
_MIXTUREAFFINETONEMODEL.fields_by_name['model'].message_type = _AFFINETONEMODEL
DESCRIPTOR.message_types_by_name['GainBiasModel'] = _GAINBIASMODEL
DESCRIPTOR.message_types_by_name['MixtureGainBiasModel'] = _MIXTUREGAINBIASMODEL
DESCRIPTOR.message_types_by_name['AffineToneModel'] = _AFFINETONEMODEL
DESCRIPTOR.message_types_by_name['MixtureAffineToneModel'] = _MIXTUREAFFINETONEMODEL
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
GainBiasModel = _reflection.GeneratedProtocolMessageType('GainBiasModel', (_message.Message,), {
'DESCRIPTOR' : _GAINBIASMODEL,
'__module__' : 'mediapipe.util.tracking.tone_models_pb2'
# @@protoc_insertion_point(class_scope:mediapipe.GainBiasModel)
})
_sym_db.RegisterMessage(GainBiasModel)
MixtureGainBiasModel = _reflection.GeneratedProtocolMessageType('MixtureGainBiasModel', (_message.Message,), {
'DESCRIPTOR' : _MIXTUREGAINBIASMODEL,
'__module__' : 'mediapipe.util.tracking.tone_models_pb2'
# @@protoc_insertion_point(class_scope:mediapipe.MixtureGainBiasModel)
})
_sym_db.RegisterMessage(MixtureGainBiasModel)
AffineToneModel = _reflection.GeneratedProtocolMessageType('AffineToneModel', (_message.Message,), {
'DESCRIPTOR' : _AFFINETONEMODEL,
'__module__' : 'mediapipe.util.tracking.tone_models_pb2'
# @@protoc_insertion_point(class_scope:mediapipe.AffineToneModel)
})
_sym_db.RegisterMessage(AffineToneModel)
MixtureAffineToneModel = _reflection.GeneratedProtocolMessageType('MixtureAffineToneModel', (_message.Message,), {
'DESCRIPTOR' : _MIXTUREAFFINETONEMODEL,
'__module__' : 'mediapipe.util.tracking.tone_models_pb2'
# @@protoc_insertion_point(class_scope:mediapipe.MixtureAffineToneModel)
})
_sym_db.RegisterMessage(MixtureAffineToneModel)
# @@protoc_insertion_point(module_scope)
| 45.003279 | 1,173 | 0.755719 | 1,781 | 13,726 | 5.505334 | 0.087591 | 0.052218 | 0.079449 | 0.068842 | 0.771749 | 0.699031 | 0.673534 | 0.665783 | 0.629169 | 0.620602 | 0 | 0.050614 | 0.121958 | 13,726 | 304 | 1,174 | 45.151316 | 0.762944 | 0.034023 | 0 | 0.709559 | 1 | 0.007353 | 0.177976 | 0.14703 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.014706 | 0 | 0.014706 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
1cf215c717180638114375195e543db5bf0f4638 | 7,480 | py | Python | bad_channel_lhc17q_all2.py | dhruvdixit/alice_calib_emcal | 26357206518511842c047c78c9b784acae6203e8 | [
"BSD-3-Clause-LBNL"
] | 1 | 2017-06-06T19:28:08.000Z | 2017-06-06T19:28:08.000Z | bad_channel_lhc17q_all2.py | dhruvdixit/alice_calib_emcal | 26357206518511842c047c78c9b784acae6203e8 | [
"BSD-3-Clause-LBNL"
] | null | null | null | bad_channel_lhc17q_all2.py | dhruvdixit/alice_calib_emcal | 26357206518511842c047c78c9b784acae6203e8 | [
"BSD-3-Clause-LBNL"
] | 1 | 2018-10-11T20:07:25.000Z | 2018-10-11T20:07:25.000Z | warm_emcal=[594, 832, 895, 1061, 1143, 1275, 1276, 2126, 2165, 2190, 2639, 2688, 2778, 2795, 2929, 3169, 3455, 3872, 3876, 3884, 3923, 4026, 4057, 4059, 4063, 4052, 4054, 4060, 4100, 4106, 4144, 4201, 4211, 4299, 4531, 4675, 4683, 5491, 5608, 6055, 6653, 6642, 6646, 6689, 7271, 7329, 7377, 7679, 8400, 8632, 9118, 9202, 9695, 9839, 9875, 9884, 10559, 10654, 10659, 10702, 10779, 11042, 11044, 11048, 11050, 11052, 11095, 11102, 11139, 11141, 11138, 11148, 11195, 11197, 11243, 11295, 11531, 11551, 11587, 11647, 12287, 12276, 12286]
warm_dcal=[12611, 12610, 12877, 12874, 12988, 13281, 13287, 13289, 13293, 13290, 13469, 13562, 13590, 13916, 14017, 14303, 14373, 14380, 14401, 14542, 14669, 14713, 14734, 14789, 14987, 14993, 15298, 15315, 15323, 15322, 15749, 15758, 15802, 15804, 16289, 16483, 16485, 16489, 16488, 16887, 16945, 16944, 17329, 17328, 17396, 17452, 17463]
bad_emcal=[68, 74, 103, 128, 191, 176, 198, 287, 324, 353, 447, 554, 655, 759, 720, 764, 917, 1002, 1038, 1050, 1175, 1204, 1222, 1288, 1329, 1366, 1376, 1380, 1382, 1386, 1414, 1441, 1519, 1535, 1711, 1696, 1704, 1738, 1837, 1839, 1836, 1838, 1844, 1860, 1892, 1961, 1963, 1967, 2014, 2020, 2022, 2026, 2094, 2113, 2119, 2125, 2127, 2118, 2122, 2124, 2161, 2196, 2245, 2298, 2313, 2325, 2395, 2397, 2399, 2406, 2424, 2487, 2505, 2533, 2506, 2534, 2540, 2575, 2579, 2581, 2544, 2586, 2624, 2665, 2682, 2787, 2793, 2797, 2805, 2823, 2825, 2824, 2841, 2857, 2891, 2915, 2921, 2884, 2888, 2985, 3002, 3039, 3051, 3135, 3161, 3176, 3196, 3223, 3259, 3236, 3244, 3307, 3339, 3353, 3397, 3403, 3493, 3503, 3488, 3504, 3732, 3740, 3748, 3754, 3772, 3803, 3839, 3796, 3826, 3873, 3840, 3854, 3878, 3931, 3906, 3908, 3914, 3916, 3920, 3977, 3979, 3940, 3962, 4011, 4053, 4055, 4061, 4058, 4062, 4129, 4154, 4196, 4200, 4202, 4212, 4237, 4230, 4236, 4282, 4320, 4371, 4372, 4421, 4543, 4516, 4530, 4532, 4538, 4597, 4596, 4602, 4613, 4621, 4627, 4637, 4614, 4817, 5183, 5201, 5221, 5229, 5263, 5354, 5411, 5420, 5448, 5698, 5831, 5818, 5850, 6064, 6111, 6104, 6184, 6275, 6331, 6481, 6519, 6527, 6592, 6641, 6645, 6649, 6640, 6648, 6650, 6803, 6811, 6802, 6808, 6810, 6814, 6991, 7150, 7331, 7333, 7335, 7337, 7339, 7343, 7328, 7332, 7334, 7336, 7338, 7340, 7342, 7371, 7375, 7381, 7383, 7389, 7388, 7390, 7417, 7425, 7430, 7457, 7491, 7507, 7525, 7527, 7533, 7532, 7747, 7751, 7770, 8047, 8165, 8176, 8236, 8238, 8244, 8275, 8283, 8260, 8274, 8298, 8340, 8352, 8356, 8372, 8404, 8420, 8436, 8610, 8628, 8630, 8724, 8743, 8795, 8807, 8809, 8813, 8916, 8938, 9061, 9056, 9060, 9066, 9076, 9078, 9092, 9098, 9140, 9146, 9222, 9262, 9269, 9275, 9291, 9286, 9288, 9302, 9323, 9349, 9357, 9332, 9354, 9533, 9552, 9703, 9706, 9769, 9819, 9806, 9849, 9885, 9927, 9941, 9945, 9951, 9940, 9942, 10073, 10115, 10123, 10125, 10139, 10171, 10134, 10154, 10164, 10203, 10196, 10267, 10325, 10363, 10326, 10451, 10505, 10474, 10609, 10611, 10660, 10666, 10723, 10831, 10921, 10980, 10986, 11091, 11241, 11286, 11363, 11589, 11630, 11738, 11867, 11948, 12052, 12068, 12134, 12142, 12147, 12216]
bad_dcal=[12384, 12599, 12601, 12603, 12605, 12617, 12619, 12621, 12592, 12594, 12604, 12616, 12618, 12622, 12641, 12643, 12647, 12649, 12640, 12644, 12650, 12654, 12805, 12831, 12857, 12865, 12867, 12869, 12871, 12873, 12864, 12866, 12868, 12870, 12872, 12876, 12915, 12917, 12919, 12921, 12923, 12912, 12918, 12922, 12926, 13049, 13053, 13055, 13068, 13126, 13193, 13172, 13236, 13459, 13463, 13465, 13467, 13471, 13458, 13462, 13464, 13466, 13508, 13514, 13556, 13558, 13589, 13943, 13951, 13953, 13944, 13985, 13989, 13991, 13995, 13997, 13988, 13990, 13994, 13996, 13998, 14042, 14081, 14153, 14155, 14157, 14191, 14193, 14225, 14229, 14239, 14249, 14228, 14232, 14234, 14236, 14248, 14313, 14381, 14374, 14378, 14403, 14405, 14407, 14409, 14411, 14413, 14415, 14443, 14402, 14410, 14414, 14543, 14498, 14557, 14625, 14633, 14626, 14628, 14632, 14679, 14678, 14707, 14709, 14711, 14715, 14719, 14704, 14706, 14710, 14712, 14714, 14772, 14839, 14867, 14832, 14862, 14874, 14928, 14977, 15012, 15027, 15107, 15094, 15098, 15152, 15154, 15201, 15209, 15200, 15208, 15210, 15255, 15297, 15299, 15301, 15305, 15307, 15300, 15304, 15314, 15445, 15457, 15459, 15465, 15469, 15483, 15489, 15456, 15458, 15460, 15466, 15480, 15511, 15519, 15508, 15510, 15516, 15518, 15653, 15690, 15719, 15785, 15754, 15776, 15799, 15805, 15807, 15821, 15798, 15800, 15806, 15933, 15941, 15965, 15967, 15958, 16033, 16073, 16215, 16268, 16311, 16319, 16304, 16306, 16318, 16349, 16353, 16361, 16367, 16362, 16364, 16395, 16386, 16394, 16404, 16449, 16451, 16453, 16459, 16461, 16456, 16481, 16507, 16480, 16482, 16510, 16529, 16531, 16537, 16530, 16536, 16538, 16579, 16581, 16583, 16589, 16591, 16578, 16580, 16582, 16588, 16590, 16608, 16610, 16618, 16622, 16634, 16785, 16784, 16801, 16803, 16805, 16809, 16800, 16808, 16810, 16812, 16849, 16857, 16859, 16850, 16854, 16856, 16858, 16886, 16888, 16897, 16977, 17061, 17093, 17191, 17197, 17192, 17205, 17207, 17280, 17300, 17352, 17413, 17408, 17504, 17537, 17597, 17633, 17637, 17634]
dead_emcal=[1534, 2047, 2115, 2117, 2123, 2112, 2114, 2116, 2120, 2776, 3297, 5217, 5219, 5223, 5225, 5227, 5231, 5216, 5218, 5220, 5222, 5224, 5226, 5228, 5230, 5265, 5267, 5269, 5271, 5273, 5275, 5277, 5279, 5264, 5266, 5268, 5270, 5272, 5274, 5276, 5278, 5281, 5283, 5285, 5287, 5289, 5291, 5293, 5295, 5280, 5282, 5284, 5286, 5288, 5290, 5292, 5294, 5329, 5331, 5333, 5335, 5337, 5339, 5341, 5343, 5328, 5330, 5332, 5334, 5336, 5338, 5340, 5342, 6295, 7341, 7330, 7380, 7521, 7523, 7529, 7531, 7535, 7520, 7522, 7524, 7526, 7528, 7530, 7534, 7569, 7571, 7573, 7575, 7577, 7579, 7581, 7583, 7568, 7570, 7572, 7574, 7576, 7578, 7580, 7582, 8353, 8357, 8577, 8579, 8581, 8583, 8585, 8587, 8589, 8591, 8576, 8578, 8580, 8582, 8584, 8586, 8588, 8590, 9282, 9361, 9943, 10718, 11462]
dead_dcal=[12501, 12505, 12507, 12593, 12595, 12597, 12607, 12596, 12598, 12600, 12602, 12606, 12645, 12651, 12653, 12655, 12642, 12646, 12648, 12652, 12801, 12803, 12807, 12809, 12811, 12813, 12815, 12800, 12802, 12804, 12806, 12808, 12810, 12812, 12814, 12849, 12851, 12853, 12855, 12859, 12861, 12863, 12848, 12850, 12852, 12854, 12856, 12858, 12860, 12862, 12913, 12925, 12927, 12914, 12916, 12920, 12924, 13470, 13524, 13848, 13969, 13999, 14406, 14627, 14629, 14631, 14635, 14637, 14639, 14624, 14630, 14634, 14636, 14638, 14718, 14895, 15051, 15203, 15205, 15207, 15211, 15213, 15215, 15202, 15204, 15206, 15212, 15214, 15217, 15296, 15461, 15463, 15467, 15471, 15462, 15464, 15468, 15470, 15505, 15507, 15509, 15513, 15515, 15517, 15504, 15506, 15512, 15514, 15624, 15963, 16455, 16457, 16463, 16448, 16450, 16452, 16454, 16458, 16460, 16462, 16533, 16535, 16539, 16541, 16543, 16528, 16532, 16534, 16540, 16542, 16577, 16585, 16587, 16576, 16584, 16586, 16609, 16611, 16613, 16615, 16617, 16619, 16621, 16623, 16612, 16614, 16616, 16620, 16807, 16811, 16813, 16815, 16802, 16804, 16806, 16814, 16851, 16853, 16855, 16861, 16863, 16848, 16852, 16860, 16862, 17185, 17187, 17189, 17193, 17195, 17199, 17184, 17186, 17188, 17190, 17194, 17196, 17198, 17201, 17203, 17209, 17211, 17213, 17215, 17200, 17202, 17204, 17206, 17208, 17210, 17212, 17214, 17635, 17639, 17641, 17643, 17645, 17647, 17632, 17636, 17638, 17640, 17642, 17644, 17646, 17649, 17651, 17653, 17655, 17657, 17659, 17661, 17663, 17648, 17650, 17652, 17654, 17656, 17658, 17660, 17662]
bad_all = bad_emcal+bad_dcal+warm_emcal+warm_dcal+dead_emcal+dead_dcal
| 534.285714 | 2,169 | 0.69639 | 1,148 | 7,480 | 4.526132 | 0.982578 | 0.003464 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.802016 | 0.151203 | 7,480 | 13 | 2,170 | 575.384615 | 0.016381 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e801077fd8c8f91107e57bbcb4039f9d9f2a4f22 | 196 | py | Python | source/detection/__init__.py | FrancescoSaverioZuppichini/Smash-Bros-Melee | 4ca6f67240bfe60e86a82409c4056aaa25a5a860 | [
"MIT"
] | null | null | null | source/detection/__init__.py | FrancescoSaverioZuppichini/Smash-Bros-Melee | 4ca6f67240bfe60e86a82409c4056aaa25a5a860 | [
"MIT"
] | null | null | null | source/detection/__init__.py | FrancescoSaverioZuppichini/Smash-Bros-Melee | 4ca6f67240bfe60e86a82409c4056aaa25a5a860 | [
"MIT"
] | null | null | null | from .EASTTextDetector import EASTTextDetector
from .Yolov3Detector import Yolov3Detector
from .Detector import Detector
from .OCRDetector import OCRDetector
from .Detection import ObjectDetection | 39.2 | 46 | 0.877551 | 20 | 196 | 8.6 | 0.4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011299 | 0.096939 | 196 | 5 | 47 | 39.2 | 0.960452 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
e8051317c2eded0422822937136587b45cd57a82 | 159 | py | Python | seeuletter/__init__.py | seeuletter/seeuletter-python | 622b073966a261f818ccc385dbf3d85606fb3e7e | [
"MIT"
] | 3 | 2017-11-10T18:49:19.000Z | 2021-02-04T22:38:24.000Z | seeuletter/__init__.py | seeuletter/seeuletter-python | 622b073966a261f818ccc385dbf3d85606fb3e7e | [
"MIT"
] | null | null | null | seeuletter/__init__.py | seeuletter/seeuletter-python | 622b073966a261f818ccc385dbf3d85606fb3e7e | [
"MIT"
] | 1 | 2021-02-22T17:12:07.000Z | 2021-02-22T17:12:07.000Z | # Resources
from seeuletter.resource import (Letter, Postcard)
from seeuletter.version import VERSION
api_key = None
api_base = 'https://api.seeuletter.com'
| 19.875 | 50 | 0.786164 | 21 | 159 | 5.857143 | 0.666667 | 0.227642 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.119497 | 159 | 7 | 51 | 22.714286 | 0.878571 | 0.056604 | 0 | 0 | 0 | 0 | 0.175676 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 0 | 0 | 4 |
e80ecae47e6a09789169c1925026196e7d226f24 | 68 | py | Python | Language Skills/Python/Unit 10 Advanced Topics in Python/02 Introduction to Bitwise Operators/A bit more Complicated/13-Just Flip Out.py | WarHatch/Codecademy-Exercise-Answers | 1fe3684d7edfa712747bce8e595e89409446eb94 | [
"MIT"
] | 346 | 2016-02-22T20:21:10.000Z | 2022-01-27T20:55:53.000Z | Language Skills/Python/Unit 10/2-Introduction to Bitwise Operators/A bit more Complicated/13-Just Flip Out_.py | vpstudios/Codecademy-Exercise-Answers | ebd0ee8197a8001465636f52c69592ea6745aa0c | [
"MIT"
] | 55 | 2016-04-07T13:58:44.000Z | 2020-06-25T12:20:24.000Z | Language Skills/Python/Unit 10/2-Introduction to Bitwise Operators/A bit more Complicated/13-Just Flip Out_.py | vpstudios/Codecademy-Exercise-Answers | ebd0ee8197a8001465636f52c69592ea6745aa0c | [
"MIT"
] | 477 | 2016-02-21T06:17:02.000Z | 2021-12-22T10:08:01.000Z | a = 0b11101110
mask = 0b11111111
result =(a^mask)
print bin(result)
| 13.6 | 17 | 0.735294 | 10 | 68 | 5 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.310345 | 0.147059 | 68 | 4 | 18 | 17 | 0.551724 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
e82cccc65fefa7f1faba636c3d7cb40ed5cd2812 | 63 | py | Python | engine/src/brain/conscious/personalidade.py | Sergio-D-Barbosa/SiriusIA | 6e4580ef2ea78335cc0617fc56028fa19b32be61 | [
"MIT"
] | null | null | null | engine/src/brain/conscious/personalidade.py | Sergio-D-Barbosa/SiriusIA | 6e4580ef2ea78335cc0617fc56028fa19b32be61 | [
"MIT"
] | null | null | null | engine/src/brain/conscious/personalidade.py | Sergio-D-Barbosa/SiriusIA | 6e4580ef2ea78335cc0617fc56028fa19b32be61 | [
"MIT"
] | null | null | null | from math import floor
x = 12.449800
print(round(x*100)/100) | 10.5 | 23 | 0.714286 | 12 | 63 | 3.75 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.264151 | 0.15873 | 63 | 6 | 23 | 10.5 | 0.584906 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.333333 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 4 |
e835e3dc4b0a1411bb00a2e2baf7af675fd9bac4 | 135 | py | Python | 2021/day24.py | tangarts/advent-of-code | 5879fbec1a5377d1288666a357b029f6345d4a5d | [
"MIT"
] | null | null | null | 2021/day24.py | tangarts/advent-of-code | 5879fbec1a5377d1288666a357b029f6345d4a5d | [
"MIT"
] | null | null | null | 2021/day24.py | tangarts/advent-of-code | 5879fbec1a5377d1288666a357b029f6345d4a5d | [
"MIT"
] | null | null | null |
add = lambda a, b: a + b
mul = lambda a, b: a * b
div = lambda a, b: a // b
mod = lambda a, b: a % b
eql = lambda a, b: int(a == b)
| 15 | 30 | 0.503704 | 31 | 135 | 2.193548 | 0.290323 | 0.294118 | 0.588235 | 0.529412 | 0.588235 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.318519 | 135 | 8 | 31 | 16.875 | 0.73913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
1c0bc7d7826df5a50352993c114363fd5fb24f6d | 69 | py | Python | src/spectacle/manim_extension/utils/consts.py | juegodynamics/spectacle | 470678d59745963fbd039b22ed3b3095a5687d72 | [
"MIT"
] | null | null | null | src/spectacle/manim_extension/utils/consts.py | juegodynamics/spectacle | 470678d59745963fbd039b22ed3b3095a5687d72 | [
"MIT"
] | null | null | null | src/spectacle/manim_extension/utils/consts.py | juegodynamics/spectacle | 470678d59745963fbd039b22ed3b3095a5687d72 | [
"MIT"
] | null | null | null | from manim import *
BOLD_STROKE_WIDTH = 1.5 * DEFAULT_STROKE_WIDTH
| 13.8 | 46 | 0.782609 | 11 | 69 | 4.545455 | 0.818182 | 0.44 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.034483 | 0.15942 | 69 | 4 | 47 | 17.25 | 0.827586 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 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 | 1 | 0 | 0 | 0 | 0 | 4 |
1c1ae3c78150b0ab7e41bfa1933015f99f1ab577 | 87 | py | Python | make_queue/views/quota/__init__.py | MAKENTNU/web | 7a5b512bf4c087d1561cdb623d7df4b3d04811a2 | [
"MIT"
] | 10 | 2017-11-25T01:47:20.000Z | 2020-03-24T18:28:24.000Z | make_queue/views/quota/__init__.py | MAKENTNU/web | 7a5b512bf4c087d1561cdb623d7df4b3d04811a2 | [
"MIT"
] | 319 | 2017-11-16T09:56:03.000Z | 2022-03-28T00:24:37.000Z | make_queue/views/quota/__init__.py | MAKENTNU/web | 7a5b512bf4c087d1561cdb623d7df4b3d04811a2 | [
"MIT"
] | 6 | 2017-11-12T14:04:08.000Z | 2021-03-10T09:41:18.000Z | __all__ = ["user"]
for _import in __all__:
__import__(f"{__package__}.{_import}")
| 17.4 | 42 | 0.678161 | 10 | 87 | 4.1 | 0.7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.149425 | 87 | 4 | 43 | 21.75 | 0.554054 | 0 | 0 | 0 | 0 | 0 | 0.310345 | 0.264368 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
1c1ca86e91e6a53b3f612f56c9ddd6661f01abab | 379 | py | Python | reports/graphs/__init__.py | cephos/babybuddy | c45e8ef53bbf5d2553989f68f62219b1055142ca | [
"BSD-2-Clause"
] | null | null | null | reports/graphs/__init__.py | cephos/babybuddy | c45e8ef53bbf5d2553989f68f62219b1055142ca | [
"BSD-2-Clause"
] | null | null | null | reports/graphs/__init__.py | cephos/babybuddy | c45e8ef53bbf5d2553989f68f62219b1055142ca | [
"BSD-2-Clause"
] | null | null | null | from .diaperchange_lifetimes import diaperchange_lifetimes # NOQA
from .diaperchange_types import diaperchange_types # NOQA
from .feeding_amounts import feeding_amounts # NOQA
from .feeding_duration import feeding_duration # NOQA
from .sleep_pattern import sleep_pattern # NOQA
from .sleep_totals import sleep_totals # NOQA
from .weight_weight import weight_weight # NOQA
| 47.375 | 66 | 0.833773 | 49 | 379 | 6.163265 | 0.265306 | 0.15894 | 0.099338 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.129288 | 379 | 7 | 67 | 54.142857 | 0.915152 | 0.08971 | 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 | 1 | 0 | 0 | 4 |
1c2449ece4e864e92488b600adbdb4c43e1f1dca | 94 | py | Python | No.py | carolinacastiglia/AP2_aula13_repositorio_carolina | ef28a016b9866bb89a2c0f5cfe9827846e09882c | [
"MIT"
] | null | null | null | No.py | carolinacastiglia/AP2_aula13_repositorio_carolina | ef28a016b9866bb89a2c0f5cfe9827846e09882c | [
"MIT"
] | null | null | null | No.py | carolinacastiglia/AP2_aula13_repositorio_carolina | ef28a016b9866bb89a2c0f5cfe9827846e09882c | [
"MIT"
] | null | null | null | class No:
def __init__(self, dado):
self.dado = dado
self.anterior = None | 18.8 | 29 | 0.574468 | 12 | 94 | 4.166667 | 0.666667 | 0.32 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.329787 | 94 | 5 | 30 | 18.8 | 0.793651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
1c37c6dbd9f5765f750aee5d81ab7b88235339b9 | 402 | py | Python | litemark/__init__.py | pyrustic/litemark | 49669865b7aa23f964eec0117b7ba1936658a0d2 | [
"MIT"
] | 4 | 2021-10-14T16:20:36.000Z | 2022-01-18T08:44:12.000Z | litemark/__init__.py | pyrustic/litemark | 49669865b7aa23f964eec0117b7ba1936658a0d2 | [
"MIT"
] | null | null | null | litemark/__init__.py | pyrustic/litemark | 49669865b7aa23f964eec0117b7ba1936658a0d2 | [
"MIT"
] | null | null | null | from litemark.core import scanner
from litemark.core.scanner import Element
from litemark.core.viewer import Viewer, get_light_style
from litemark.core.style import Style
from litemark.core.util import center_window
__all__ = ["scan", "Element", "Viewer", "get_light_style", "Style"]
def scan(text):
"""Returns a generator. If you need a list: list(scan(text))"""
return scanner.scan(text)
| 28.714286 | 67 | 0.756219 | 59 | 402 | 5 | 0.423729 | 0.20339 | 0.271186 | 0.128814 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.131841 | 402 | 13 | 68 | 30.923077 | 0.845272 | 0.141791 | 0 | 0 | 0 | 0 | 0.109145 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.125 | false | 0 | 0.625 | 0 | 0.875 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
1c3d859ae28e80d0d58e9dbc5ecfff154142ab2d | 7,491 | py | Python | tests/unit/network/GenericNetworkTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | 1 | 2021-05-01T11:10:43.000Z | 2021-05-01T11:10:43.000Z | tests/unit/network/GenericNetworkTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | 2 | 2020-06-26T19:58:23.000Z | 2021-12-14T07:16:41.000Z | tests/unit/network/GenericNetworkTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | null | null | null | import numpy as np
import openpnm as op
class GenericNetworkTest:
def setup_class(self):
self.net = op.network.Cubic(shape=[10, 10, 10])
def teardown_class(self):
ws = op.Workspace()
ws.clear()
def test_find_connected_pores_numeric_not_flattend(self):
a = self.net.find_connected_pores(throats=[0, 1])
assert np.all(a.flatten() == [0, 1, 1, 2])
def test_find_connected_pores_numeric_flattend(self):
a = self.net.find_connected_pores(throats=[0, 1], flatten=True)
assert np.all(a == [0, 1, 2])
def test_find_connected_pores_boolean_flattend(self):
Tind = np.zeros((self.net.Nt,), dtype=bool)
Tind[[0, 1]] = True
a = self.net.find_connected_pores(throats=Tind, flatten=True)
assert np.all(a == [0, 1, 2])
def test_find_connected_pores_empty_flattend(self):
a = self.net.find_connected_pores(throats=[], flatten=True)
assert np.shape(a) == (0, )
def test_find_neighbor_pores_numeric(self):
a = self.net.find_neighbor_pores(pores=[])
assert np.size(a) == 0
def test_find_neighbor_pores_boolean(self):
Pind = np.zeros((self.net.Np,), dtype=bool)
Pind[[0, 1]] = True
a = self.net.find_neighbor_pores(pores=Pind)
assert np.all(a == [2, 10, 11, 100, 101])
def test_find_neighbor_pores_numeric_union(self):
a = self.net.find_neighbor_pores(pores=[0, 2], mode='union')
assert np.all(a == [1, 3, 10, 12, 100, 102])
def test_find_neighbor_pores_numeric_intersection(self):
a = self.net.find_neighbor_pores(pores=[0, 2], mode='xnor')
assert np.all(a == [1])
def test_find_neighbor_pores_numeric_exclusive_or(self):
a = self.net.find_neighbor_pores(pores=[0, 2], mode='exclusive_or')
assert np.all(a == [3, 10, 12, 100, 102])
def test_find_neighbor_pores_numeric_union_include_input(self):
a = self.net.find_neighbor_pores(pores=[0, 2], mode='or',
include_input=True)
assert np.all(a == [1, 3, 10, 12, 100, 102])
a = self.net.find_neighbor_pores(pores=[0, 1], mode='or',
include_input=True)
assert np.all(a == [0, 1, 2, 10, 11, 100, 101])
def test_find_neighbor_pores_numeric_intersection_include_input(self):
a = self.net.find_neighbor_pores(pores=[0, 2], mode='and',
include_input=True)
assert np.all(a == [1])
a = self.net.find_neighbor_pores(pores=[0, 1], mode='and',
include_input=True)
assert np.all(a == [])
def test_find_neighbor_pores_numeric_intersection_exclude_input(self):
a = self.net.find_neighbor_pores(pores=[0, 2], mode='and',
include_input=False)
assert np.all(a == [1])
def test_find_neighbor_pores_numeric_exclusive_or_include_input(self):
a = self.net.find_neighbor_pores(pores=[0, 2], mode='exclusive_or',
include_input=True)
assert np.all(a == [3, 10, 12, 100, 102])
a = self.net.find_neighbor_pores(pores=[0, 1], mode='exclusive_or',
include_input=True)
assert np.all(a == [0, 1, 2, 10, 11, 100, 101])
def test_find_neighbor_throats_on_pores_wo_throats(self):
net = op.network.Cubic(shape=[10, 10, 1])
ts = net.find_neighbor_throats(pores=net.Ps[-1])
op.topotools.trim(net, throats=ts)
ts2 = net.find_neighbor_throats(pores=99)
assert ts2.size == 0
def test_find_neighbor_throats_empty(self):
a = self.net.find_neighbor_throats(pores=[])
assert np.size(a) == 0
def test_find_neighbor_throats_boolean(self):
Pind = np.zeros((self.net.Np,), dtype=bool)
Pind[[0, 1]] = True
a = self.net.find_neighbor_throats(pores=Pind)
assert np.all(a == [0, 1, 900, 901, 1800, 1801])
def test_find_neighbor_throats_numeric_union(self):
a = self.net.find_neighbor_throats(pores=[0, 2], mode='union')
assert np.all(a == [0, 1, 2, 900, 902, 1800, 1802])
def test_find_neighbor_throats_numeric_intersection(self):
a = self.net.find_neighbor_throats(pores=[0, 2], mode='xnor')
assert np.size(a) == 0
def test_find_neighbor_throats_numeric_exclusive_or(self):
a = self.net.find_neighbor_throats(pores=[0, 2],
mode='exclusive_or')
assert np.all(a == [0, 1, 2, 900, 902, 1800, 1802])
def test_num_neighbors_empty(self):
a = self.net.num_neighbors(pores=[])
assert np.size(a) == 0
def test_num_neighbors_pores_flattened(self):
a = self.net.num_neighbors(pores=0, flatten=True)
assert a == 3
assert isinstance(a, int)
a = self.net.num_neighbors(pores=[0, 2], flatten=True)
assert a == 6
assert isinstance(a, int)
def test_num_neighbors_pores_with_modes(self):
a = self.net.num_neighbors(pores=[0, 2], mode='union', flatten=True)
assert a == 6
a = self.net.num_neighbors(pores=[0, 2], mode='xnor',
flatten=True)
assert a == 1
a = self.net.num_neighbors(pores=[0, 2], mode='exclusive_or',
flatten=True)
assert a == 5
def test_num_neighbors_pores_not_flattened(self):
a = self.net.num_neighbors(pores=[0, 2], flatten=False)
assert np.all(a == [3, 4])
a = self.net.num_neighbors(pores=0, flatten=False)
assert np.all(a == [3])
assert isinstance(a, np.ndarray)
def test_find_nearby_pores_distance_1(self):
a = self.net.find_nearby_pores(pores=[0, 1], r=1, flatten=False,
include_input=True)
b = self.net.find_neighbor_pores(pores=[0, 1], flatten=False,
include_input=True)
assert np.all([np.all(a[i] == b[i]) for i in range(0, len(a))])
def test_find_nearby_pores_distance_2(self):
a = self.net.find_nearby_pores(pores=[0, 1], r=2)
assert np.all([np.size(a[i]) for i in [0, 1]] == [9, 13])
def test_find_nearby_pores_distance_0(self):
a = self.net.find_nearby_pores(pores=[0, 1], r=1e-9, flatten=False)
assert np.shape(a) == (2, 0)
a = self.net.find_nearby_pores(pores=[0, 1], r=1e-9, flatten=True)
assert a.shape == (0,)
def test_find_nearby_pores_distance_1_flattened(self):
a = self.net.find_nearby_pores(pores=[0, 1], r=1, flatten=True)
b = self.net.find_neighbor_pores(pores=[0, 1])
assert np.all(a == b)
def test_find_nearby_pores_distance_2_flattened(self):
a = self.net.find_nearby_pores(pores=[0, 1], r=2, flatten=True)
assert np.size(a) == 15
def test_find_nearby_pores_distance_2_flattened_include_input(self):
a = self.net.find_nearby_pores(pores=[0, 1], r=2,
flatten=True, include_input=True)
assert np.size(a) == 17
assert np.all(np.in1d([0, 1], a))
if __name__ == '__main__':
t = GenericNetworkTest()
t.setup_class()
self = t
for item in t.__dir__():
if item.startswith('test'):
print('running test: '+item)
t.__getattribute__(item)()
| 40.934426 | 76 | 0.595248 | 1,080 | 7,491 | 3.885185 | 0.10463 | 0.071735 | 0.068637 | 0.080076 | 0.847712 | 0.78551 | 0.720448 | 0.636559 | 0.563632 | 0.479028 | 0 | 0.049963 | 0.270591 | 7,491 | 182 | 77 | 41.159341 | 0.717972 | 0 | 0 | 0.251701 | 0 | 0 | 0.01682 | 0 | 0 | 0 | 0 | 0 | 0.278912 | 1 | 0.210884 | false | 0 | 0.013605 | 0 | 0.231293 | 0.006803 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
1c53e62f54e6cd1629814372949db5cd63d8706e | 125 | py | Python | orc_site/__main__.py | PetarDinevBG/orc | 5cc105e404623967cc568695fd79124a79bcc868 | [
"MIT"
] | null | null | null | orc_site/__main__.py | PetarDinevBG/orc | 5cc105e404623967cc568695fd79124a79bcc868 | [
"MIT"
] | null | null | null | orc_site/__main__.py | PetarDinevBG/orc | 5cc105e404623967cc568695fd79124a79bcc868 | [
"MIT"
] | 1 | 2019-10-13T16:44:28.000Z | 2019-10-13T16:44:28.000Z | from orc_site.app import app
if __name__ == '__main__':
# run the application on local development server
app.run()
| 20.833333 | 53 | 0.712 | 18 | 125 | 4.444444 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.208 | 125 | 5 | 54 | 25 | 0.808081 | 0.376 | 0 | 0 | 0 | 0 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
1c671e52443ab081c8914d0d87f5b6cb5ab53286 | 343 | py | Python | examples/library/project/users/serializers.py | zshongyi/drf-psq | bc86b9bf13da12feb82f94b259ba94cbe4e1dc1a | [
"MIT"
] | 29 | 2020-07-07T17:06:09.000Z | 2022-02-27T21:43:26.000Z | examples/library/project/users/serializers.py | zshongyi/drf-psq | bc86b9bf13da12feb82f94b259ba94cbe4e1dc1a | [
"MIT"
] | 4 | 2021-01-23T23:41:58.000Z | 2021-12-06T15:38:25.000Z | examples/library/project/users/serializers.py | zshongyi/drf-psq | bc86b9bf13da12feb82f94b259ba94cbe4e1dc1a | [
"MIT"
] | 8 | 2020-07-19T14:36:47.000Z | 2021-12-28T22:27:03.000Z | from rest_framework import serializers
from .models import User
class UserBasicSerializer(serializers.ModelSerializer):
class Meta:
model = User
exclude = ('is_superuser', 'is_staff', 'is_active')
class UserFullSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = '__all__'
| 19.055556 | 59 | 0.696793 | 34 | 343 | 6.794118 | 0.588235 | 0.225108 | 0.268398 | 0.30303 | 0.380952 | 0.380952 | 0 | 0 | 0 | 0 | 0 | 0 | 0.22449 | 343 | 17 | 60 | 20.176471 | 0.868421 | 0 | 0 | 0.4 | 0 | 0 | 0.104956 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 0.6 | 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 | 1 | 0 | 0 | 4 |
1c771957ea7f98232cc5a2e4c60796ae672c6fdc | 30 | py | Python | src/git_portfolio/request_objects/__init__.py | staticdev/github-portfolio | 850461eed8160e046ee16664ac3dbc19e3ec0965 | [
"MIT"
] | 3 | 2020-07-28T05:02:40.000Z | 2021-10-17T17:12:46.000Z | src/git_portfolio/request_objects/__init__.py | staticdev/github-portfolio | 850461eed8160e046ee16664ac3dbc19e3ec0965 | [
"MIT"
] | 218 | 2020-06-20T18:19:16.000Z | 2022-03-31T11:58:24.000Z | src/git_portfolio/request_objects/__init__.py | staticdev/github-portfolio | 850461eed8160e046ee16664ac3dbc19e3ec0965 | [
"MIT"
] | 2 | 2020-10-17T13:03:24.000Z | 2021-02-11T07:11:19.000Z | """Git portfolio requests."""
| 15 | 29 | 0.666667 | 3 | 30 | 6.666667 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.1 | 30 | 1 | 30 | 30 | 0.740741 | 0.766667 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
1c839245e4a2bd8c6a872194033790cfc0fb7600 | 18,166 | py | Python | PgMigrator.py | DuoSoftware/DVP-MigrationScripts | 98d5686e6ec751209dee76d160abab5910e8482c | [
"Apache-2.0"
] | null | null | null | PgMigrator.py | DuoSoftware/DVP-MigrationScripts | 98d5686e6ec751209dee76d160abab5910e8482c | [
"Apache-2.0"
] | null | null | null | PgMigrator.py | DuoSoftware/DVP-MigrationScripts | 98d5686e6ec751209dee76d160abab5910e8482c | [
"Apache-2.0"
] | null | null | null | import PostgresHandler as pg
import configs.ConfigHandler as config
default_data = config.get_conf('config.ini','DefaultData')
con = None
# CSDB_CacheUpdates ignore
def CSDB_CallCDRProcessed(): #tested
try:
print("CSDB_CallCDRProcesseds - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallCDRProcesseds" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("CSDB_CallCDRProcesseds - BusinessUnit 'ADD' process completed")
print("CSDB_CallCDRProcesseds - QueuePriority 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallCDRProcesseds" ADD COLUMN IF NOT EXISTS "QueuePriority" integer;""")
print("CSDB_CallCDRProcesseds - QueuePriority 'ADD' process completed")
print("CSDB_CallCDRProcesseds - TimeAfterInitialBridge 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallCDRProcesseds" ADD COLUMN IF NOT EXISTS "TimeAfterInitialBridge" integer;""")
print("CSDB_CallCDRProcesseds - TimeAfterInitialBridge 'ADD' process completed")
except Exception as err:
print(err)
try:
print("CSDB_CallCDRProcesseds - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."CSDB_CallCDRProcesseds" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("CSDB_CallCDRProcesseds - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
# no need to update old data
def CSDB_CallCDRs():
try:
print("CSDB_CallCDRs - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallCDRs" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("CSDB_CallCDRs - BusinessUnit 'ADD' process completed")
print("CSDB_CallCDRs - MemberUuid 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallCDRs" ADD COLUMN IF NOT EXISTS "MemberUuid" varchar(255);""")
print("CSDB_CallCDRs - MemberUuid 'ADD' process completed")
print("CSDB_CallCDRs - QueuePriority 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallCDRs" ADD COLUMN IF NOT EXISTS "QueuePriority" integer ;""")
print("CSDB_CallCDRs - QueuePriority 'ADD' process completed")
print("CSDB_CallCDRs - TimeAfterInitialBridge 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallCDRs" ADD COLUMN IF NOT EXISTS "TimeAfterInitialBridge" integer ;""")
print("CSDB_CallCDRs - TimeAfterInitialBridge 'ADD' process completed")
except Exception as err:
print(err)
try:
print("CSDB_CallCDRs - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."CSDB_CallCDRs" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("CSDB_CallCDRs - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
# no need to update old data
def CSDB_CallRules(): # tested
try:
print("CSDB_CallRules - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallRules" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("CSDB_CallRules - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("CSDB_CallRules - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."CSDB_CallRules" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("CSDB_CallRules - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def CSDB_CallServers(): #Imp should manually add values
try:
print("CSDB_CallServers - MainIp 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_CallServers" ADD COLUMN IF NOT EXISTS "MainIp" varchar(255);""")
print("CSDB_CallServers - MainIp 'ADD' process completed")
except Exception as err:
print(err)
# try:
# con.execute_query("""UPDATE "public"."CSDB_CallServers" SET "MainIp" = '?' """)
# except Exception as err:
# print(err)
def CSDB_Crons(): # data is not persistent so no need to migration
try:
print("CSDB_Crons - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_Crons" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("CSDB_Crons - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("CSDB_Crons - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."CSDB_Crons" SET "Timezone" = '?' """)
print("CSDB_Crons - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def CSDB_DVPEvents(): # tested
try:
print("CSDB_DVPEvents - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_DVPEvents" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("CSDB_DVPEvents - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("CSDB_DVPEvents - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."CSDB_DVPEvents" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("CSDB_DVPEvents - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def CSDB_FileCategories(): # tested
try:
print("CSDB_FileCategories - Company 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_FileCategories" ADD COLUMN IF NOT EXISTS "Company" integer;""")
print("CSDB_FileCategories - Company 'ADD' process completed")
print("CSDB_FileCategories - Tenant 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_FileCategories" ADD COLUMN IF NOT EXISTS "Tenant" integer;""")
print("CSDB_FileCategories - Tenant 'ADD' process completed")
except Exception as err:
print(err)
try:
print("CSDB_FileCategories - Company, Tenant 'UPDATE' process started")
con.execute_query("""UPDATE "public"."CSDB_FileCategories" SET "Company" = {0}, "Tenant" = {1};""".format(default_data['company'], default_data['tenant']))
print("CSDB_FileCategories - Company, Tenant 'UPDATE' process completed")
except Exception as err:
print(err)
def CSDB_QueueProfiles(): # tested dialtime, maxwaitqueuethreshold check at singer. In development server lowercased fields are available in addition to them.
try:
print("CSDB_QueueProfiles - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_QueueProfiles" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("CSDB_QueueProfiles - BusinessUnit 'ADD' process completed")
# print("CSDB_QueueProfiles - dialtime 'ADD' process started")
# con.execute_query("""ALTER TABLE "public"."CSDB_QueueProfiles" ADD COLUMN IF NOT EXISTS "dialtime" integer;""")
# print("CSDB_QueueProfiles - dialtime 'ADD' process completed")
# print("CSDB_QueueProfiles - maxwaitqueuethreshold 'ADD' process started")
# con.execute_query("""ALTER TABLE "public"."CSDB_QueueProfiles" ADD COLUMN IF NOT EXISTS "maxwaitqueuethreshold" integer;""")
# print("CSDB_QueueProfiles - maxwaitqueuethreshold 'ADD' process completed")
except Exception as err:
print(err)
try:
print("CSDB_FileCategories - BusinessUnit 'ADD' process started")
con.execute_query("""UPDATE "public"."CSDB_QueueProfiles" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("CSDB_FileCategories - BusinessUnit 'ADD' process completed")
# print("CSDB_FileCategories - BusinessUnit 'ADD' process started")
# con.execute_query("""UPDATE "public"."CSDB_QueueProfiles" SET "dialtime" = '{0}'""".format(default_data['bu']))
# print("CSDB_FileCategories - BusinessUnit 'ADD' process completed")
# print("CSDB_FileCategories - BusinessUnit 'ADD' process started")
# con.execute_query("""UPDATE "public"."CSDB_QueueProfiles" SET "maxwaitqueuethreshold" = '{0}'""".format(default_data['bu']))
# print("CSDB_FileCategories - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
# CSDB_Trunks manual migration
def CSDB_Trunks():
try:
print("CSDB_Trunks - Register 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."CSDB_Trunks" ADD COLUMN IF NOT EXISTS "Register" boolean;""")
print("CSDB_Trunks - Register 'ADD' process completed")
except Exception as err:
print(err)
def DB_AuditTrails(): # tested
try:
print("DB_AuditTrails - OtherData 'RENAME' process started")
con.execute_query("""ALTER TABLE "public"."DB_AuditTrails" RENAME COLUMN "OtherData" TO "OtherJsonData";""")
print("DB_AuditTrails - OtherData 'RENAME' process completed")
print("DB_AuditTrails - json 'TYPE' process started")
con.execute_query("""ALTER TABLE "public"."DB_AuditTrails" ALTER COLUMN "OtherJsonData" TYPE json USING "OtherJsonData"::json;""")
print("DB_AuditTrails - json 'TYPE' process completed")
except Exception as err:
print(err)
# no existing data at Singer so nothing to update
def DB_CAMP_CallBackReasons(): # tested
try:
print("DB_CAMP_CallBackReasons - CompanyId 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_CallBackReasons" DROP COLUMN IF EXISTS "CompanyId";""")
print("DB_CAMP_CallBackReasons - CompanyId 'ADD' process completed")
print("DB_CAMP_CallBackReasons - TenantId 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_CallBackReasons" DROP COLUMN IF EXISTS "TenantId";""")
print("DB_CAMP_CallBackReasons - TenantId 'ADD' process completed")
except Exception as err:
print(err)
# no data to update
def DB_CAMP_CallbackInfos():
try:
print("DB_CAMP_CallbackInfos - CampaignName 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_CallbackInfos" ADD COLUMN IF NOT EXISTS "CampaignName" varchar(255);""")
print("DB_CAMP_CallbackInfos - CampaignName 'ADD' process completed")
except Exception as err:
print(err)
# no data to update
def DB_CAMP_CampDialoutInfos():
try:
print("DB_CAMP_CampDialoutInfos - CampaignName, DialNumber, 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_CampDialoutInfos" ADD COLUMN IF NOT EXISTS "CampaignName" varchar(255);""")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_CampDialoutInfos" ADD COLUMN IF NOT EXISTS "DialNumber" varchar(255);""")
print("DB_CAMP_CampDialoutInfos - CampaignName, DialNumber, 'ADD' process completed")
except Exception as err:
print(err)
# no data to update
def DB_CAMP_Configurations():
try:
print("DB_CAMP_CampDialoutInfos - DuplicateNumTimeout, IntegrationData, NumberLoadingMethod 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_Configurations" ADD COLUMN IF NOT EXISTS "DuplicateNumTimeout" integer;""")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_Configurations" ADD COLUMN IF NOT EXISTS "IntegrationData" json;""")
con.execute_query("""ALTER TABLE "public"."DB_CAMP_Configurations" ADD COLUMN IF NOT EXISTS "NumberLoadingMethod" varchar(255);""")
print("DB_CAMP_CampDialoutInfos - DuplicateNumTimeout, IntegrationData, NumberLoadingMethod 'ADD' process completed")
except Exception as err:
print(err)
# no data to update
def DB_RES_ResourceAcwInfos():
try:
print("DB_RES_ResourceAcwInfos - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_RES_ResourceAcwInfos" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("DB_RES_ResourceAcwInfos - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("DB_RES_ResourceAcwInfos - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."DB_RES_ResourceAcwInfos" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("DB_RES_ResourceAcwInfos - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def DB_RES_ResourceStatusChangeInfos(): # tested
try:
print("DB_RES_ResourceStatusChangeInfos - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_RES_ResourceStatusChangeInfos" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("DB_RES_ResourceStatusChangeInfos - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("DB_RES_ResourceStatusChangeInfos - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."DB_RES_ResourceStatusChangeInfos" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("DB_RES_ResourceStatusChangeInfos - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def DB_RES_ResourceStatusDurationInfos(): # tested
try:
print("DB_RES_ResourceStatusDurationInfos - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_RES_ResourceStatusDurationInfos" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("DB_RES_ResourceStatusDurationInfos - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("DB_RES_ResourceStatusDurationInfos - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."DB_RES_ResourceStatusDurationInfos" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("DB_RES_ResourceStatusDurationInfos - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def DB_RES_ResourceTaskRejectInfos(): # tested
try:
print("DB_RES_ResourceTaskRejectInfos - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_RES_ResourceTaskRejectInfos" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("DB_RES_ResourceTaskRejectInfos - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("DB_RES_ResourceTaskRejectInfos - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."DB_RES_ResourceTaskRejectInfos" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("DB_RES_ResourceTaskRejectInfos - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def DB_VOX_OderData(): # tested
try:
print("DB_VOX_OderData - ChannelCount, VoxStatus 'ADD' and 'DROP' process started")
con.execute_query("""ALTER TABLE "public"."DB_VOX_OderData" ADD COLUMN IF NOT EXISTS "ChannelCount" integer;""")
con.execute_query("""ALTER TABLE "public"."DB_VOX_OderData" DROP COLUMN IF EXISTS "VoxStatus";""")
print("DB_VOX_OderData - ChannelCount, VoxStatus 'ADD' and 'DROP' process completed")
except Exception as err:
print(err)
def DB_WalletHistories(): # tested
try:
print("DB_WalletHistories - SessionID 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."DB_WalletHistories" ADD COLUMN IF NOT EXISTS "SessionID" varchar(255);""")
print("DB_WalletHistories - SessionID 'ADD' process completed")
except Exception as err:
print(err)
def Dashboard_DailySummaries():
try:
print("Dashboard_DailySummaries - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."Dashboard_DailySummaries" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("Dashboard_DailySummaries - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("Dashboard_DailySummaries - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."Dashboard_DailySummaries" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("Dashboard_DailySummaries - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
def Dashboard_ThresholdBreakDowns():
try:
print("Dashboard_ThresholdBreakDowns - BusinessUnit 'ADD' process started")
con.execute_query("""ALTER TABLE "public"."Dashboard_ThresholdBreakDowns" ADD COLUMN IF NOT EXISTS "BusinessUnit" varchar(255);""")
print("Dashboard_ThresholdBreakDowns - BusinessUnit 'ADD' process completed")
except Exception as err:
print(err)
try:
print("Dashboard_ThresholdBreakDowns - BusinessUnit 'UPDATE' process started")
con.execute_query("""UPDATE "public"."Dashboard_ThresholdBreakDowns" SET "BusinessUnit" = '{0}'""".format(default_data['bu']))
print("Dashboard_ThresholdBreakDowns - BusinessUnit 'UPDATE' process completed")
except Exception as err:
print(err)
if __name__ == "__main__":
con = pg.PostgresHandler('db2')
con.initiate()
# CSDB_CallCDRProcessed()
# CSDB_CallRules()
# CSDB_DVPEvents()
# CSDB_FileCategories()
# DB_AuditTrails()
# DB_CAMP_CallBackReasons()
# DB_CAMP_CallbackInfos()
# DB_CAMP_CampDialoutInfos()
# DB_CAMP_Configurations()
# DB_RES_ResourceAcwInfos()
# DB_RES_ResourceStatusChangeInfos()
# DB_RES_ResourceStatusDurationInfos()
# DB_RES_ResourceTaskRejectInfos()
# DB_VOX_OderData()
# DB_WalletHistories()
# Dashboard_DailySummaries()
# Dashboard_ThresholdBreakDowns()
# CSDB_QueueProfiles()
# CSDB_CallCDRs()
# CSDB_CallServers()
# CSDB_Trunks()
| 50.18232 | 163 | 0.696576 | 1,981 | 18,166 | 6.220091 | 0.068652 | 0.05194 | 0.063301 | 0.091544 | 0.832251 | 0.819672 | 0.701428 | 0.646811 | 0.629687 | 0.567035 | 0 | 0.004943 | 0.187108 | 18,166 | 361 | 164 | 50.32133 | 0.829485 | 0.118573 | 0 | 0.393258 | 0 | 0.003745 | 0.585919 | 0.173093 | 0 | 0 | 0 | 0 | 0 | 1 | 0.082397 | false | 0 | 0.007491 | 0 | 0.089888 | 0.453184 | 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 | 1 | 0 | 4 |
1c8bfa7966130f884e9e98ce99005037b7b8207b | 2,345 | py | Python | mak/libs/pyxx/cxx/grammar/declaration/specifier/type/__init__.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | null | null | null | mak/libs/pyxx/cxx/grammar/declaration/specifier/type/__init__.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | null | null | null | mak/libs/pyxx/cxx/grammar/declaration/specifier/type/__init__.py | motor-dev/Motor | 98cb099fe1c2d31e455ed868cc2a25eae51e79f0 | [
"BSD-3-Clause"
] | null | null | null | """
type-specifier:
simple-type-specifier
elaborated-type-specifier
typename-specifier
cv-qualifier
type-specifier-seq:
type-specifier attribute-specifier-seq?
type-specifier type-specifier-seq
defining-type-specifier:
type-specifier
class-specifier
enum-specifier
defining-type-specifier-seq:
defining-type-specifier attribute-specifier-seq?
defining-type-specifier defining-type-specifier-seq
"""
import glrp
from .....parser import cxx98
from motor_typing import TYPE_CHECKING
from . import simple
from . import elaborated
from . import decltype
from . import placeholder
@glrp.rule('type-specifier : simple-type-specifier[split:declaration]')
@glrp.rule('type-specifier : elaborated-type-specifier')
@glrp.rule('type-specifier : typename-specifier[split:declaration]')
@glrp.rule('type-specifier : cv-qualifier')
@cxx98
def type_specifier(self, p):
# type: (CxxParser, glrp.Production) -> None
pass
@glrp.rule('type-specifier-seq : type-specifier end-type-specifier-seq attribute-specifier-seq?')
@glrp.rule('type-specifier-seq : type-specifier continue-type-specifier-seq type-specifier-seq')
@cxx98
def type_specifier_seq(self, p):
# type: (CxxParser, glrp.Production) -> None
pass
@glrp.rule('end-type-specifier-seq[split:end_type_specifier_seq] :')
@cxx98
def end_type_specifier_seq(self, p):
# type: (CxxParser, glrp.Production) -> None
pass
@glrp.rule('continue-type-specifier-seq[split:continue_type_specifier_seq] :')
@cxx98
def continue_type_specifier_seq(self, p):
# type: (CxxParser, glrp.Production) -> None
pass
@glrp.rule('defining-type-specifier : type-specifier')
@glrp.rule('defining-type-specifier : class-specifier')
@glrp.rule('defining-type-specifier : enum-specifier')
@cxx98
def defining_type_specifier(self, p):
# type: (CxxParser, glrp.Production) -> None
pass
@glrp.rule('defining-type-specifier-seq : defining-type-specifier end-type-specifier-seq attribute-specifier-seq?')
# TODO: attribute-specifier-seq? not allowed
@glrp.rule(
'defining-type-specifier-seq : defining-type-specifier continue-type-specifier-seq defining-type-specifier-seq'
)
@cxx98
def defining_type_specifier_seq(self, p):
# type: (CxxParser, glrp.Production) -> None
pass
if TYPE_CHECKING:
from .....parser import CxxParser | 27.916667 | 115 | 0.745416 | 302 | 2,345 | 5.711921 | 0.125828 | 0.354203 | 0.204058 | 0.083478 | 0.755942 | 0.553043 | 0.447536 | 0.337391 | 0.337391 | 0.238841 | 0 | 0.006806 | 0.122815 | 2,345 | 84 | 116 | 27.916667 | 0.831794 | 0.315139 | 0 | 0.285714 | 0 | 0.095238 | 0.499686 | 0.350282 | 0 | 0 | 0 | 0.011905 | 0 | 1 | 0.142857 | false | 0.142857 | 0.190476 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
98dc595c9c6d80462ffbb5246dfbdb28d7143bea | 115 | py | Python | Ch6/cat_napping.py | dmdinh22/ATBS | 3ddd331757cc434faa5f27997b178f8a39e3b5d2 | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | Ch6/cat_napping.py | dmdinh22/ATBS | 3ddd331757cc434faa5f27997b178f8a39e3b5d2 | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | Ch6/cat_napping.py | dmdinh22/ATBS | 3ddd331757cc434faa5f27997b178f8a39e3b5d2 | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | print('''Dear Alice,
Eve's cat has been arrested for catnapping, cat burglary, and extortion.
Sincerely,
Bob''')
| 16.428571 | 72 | 0.730435 | 17 | 115 | 4.941176 | 0.941176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147826 | 115 | 6 | 73 | 19.166667 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0.878261 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
98fc9d4e4b35a6e3d884820176e1d3c78b6c1dd9 | 100 | py | Python | runoob100/033.py | GenweiWu/PythonDemo | 957bacb6fc0eb0bc37c4af7a64220d8aa58189ba | [
"MIT"
] | null | null | null | runoob100/033.py | GenweiWu/PythonDemo | 957bacb6fc0eb0bc37c4af7a64220d8aa58189ba | [
"MIT"
] | null | null | null | runoob100/033.py | GenweiWu/PythonDemo | 957bacb6fc0eb0bc37c4af7a64220d8aa58189ba | [
"MIT"
] | null | null | null | # _*_ coding:utf-8 _*_
# 按逗号分隔列表。
arr=["a","b",12,True,False]
print ",".join(str(i) for i in arr) | 14.285714 | 35 | 0.59 | 18 | 100 | 3.055556 | 0.888889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035294 | 0.15 | 100 | 7 | 35 | 14.285714 | 0.611765 | 0.29 | 0 | 0 | 0 | 0 | 0.043478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0.5 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
c738c729f3061b5441e646d086b4aa4bdf795f20 | 235 | py | Python | modoboa_demo/apps.py | modoboa/modoboa-demo | 9a900632f207e8c0fc69296490293debd0355926 | [
"MIT"
] | 2 | 2017-06-23T08:19:02.000Z | 2020-12-02T13:45:12.000Z | modoboa_demo/apps.py | modoboa/modoboa-demo | 9a900632f207e8c0fc69296490293debd0355926 | [
"MIT"
] | null | null | null | modoboa_demo/apps.py | modoboa/modoboa-demo | 9a900632f207e8c0fc69296490293debd0355926 | [
"MIT"
] | 1 | 2018-10-26T05:04:35.000Z | 2018-10-26T05:04:35.000Z | """AppConfig for demo."""
from django.apps import AppConfig
class DemoConfig(AppConfig):
"""App configuration."""
name = "modoboa_demo"
verbose_name = "Modoboa demo"
def ready(self):
from . import handlers
| 16.785714 | 33 | 0.655319 | 26 | 235 | 5.846154 | 0.692308 | 0.144737 | 0.197368 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.225532 | 235 | 13 | 34 | 18.076923 | 0.835165 | 0.161702 | 0 | 0 | 0 | 0 | 0.129032 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.333333 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
c76fa33b28b0a45d99eff2e1ee576b95b50d91bc | 7,925 | py | Python | tour/tests/model_tests.py | ambitioninc/django-tour | f0181d71ebd6c66e11dd921ad5e602192fc621cc | [
"MIT"
] | 24 | 2015-02-20T23:56:13.000Z | 2021-10-06T18:01:22.000Z | tour/tests/model_tests.py | ambitioninc/django-tour | f0181d71ebd6c66e11dd921ad5e602192fc621cc | [
"MIT"
] | 4 | 2015-01-05T16:03:42.000Z | 2016-01-23T08:48:16.000Z | tour/tests/model_tests.py | ambitioninc/django-tour | f0181d71ebd6c66e11dd921ad5e602192fc621cc | [
"MIT"
] | 12 | 2015-04-01T19:11:27.000Z | 2021-09-18T12:59:18.000Z | from django.contrib.auth.models import User
from django.test import TestCase
from django_dynamic_fixture import G
from mock import patch
from tour.models import Tour, TourStatus, Step
from tour.tests.tour_tests import BaseTourTest
class TourManagerTest(BaseTourTest):
"""
Tests the methods of the TourManager
"""
@patch('tour.tests.mocks.MockStep1.is_complete', spec_set=True)
def test_complete_tours(self, mock_step1_is_complete):
"""
Verifies that any completed tours get marked as complete
:type mock_step1_is_complete: Mock
"""
mock_step1_is_complete.return_value = False
self.tour1.steps.add(self.step1)
# add user to tours
self.tour1.load_tour_class().add_user(self.test_user)
self.tour2.load_tour_class().add_user(self.test_user)
Tour.objects.complete_tours(self.test_user)
self.assertEqual(1, TourStatus.objects.filter(complete=True).count())
self.assertEqual(1, TourStatus.objects.filter(complete=False).count())
def test_complete_tours_no_user(self):
"""
Makes sure None is returned if the user is anonymous
"""
self.assertIsNone(Tour.objects.complete_tours(User()))
@patch('tour.tests.mocks.MockStep1.is_complete', spec_set=True)
def test_get_for_user(self, mock_step1_is_complete):
"""
Verifies that an incomplete tour class is fetched for a user
:type mock_step1_is_complete: Mock
"""
mock_step1_is_complete.return_value = False
self.tour1.steps.add(self.step1)
self.tour2.steps.add(self.step2)
# add users to tours
self.tour1.load_tour_class().add_user(self.test_user)
self.tour1.load_tour_class().add_user(self.test_user2)
self.tour2.load_tour_class().add_user(self.test_user)
self.tour2.load_tour_class().add_user(self.test_user2)
# tour 2 will be completed, so check for tour 1
self.assertEqual(self.tour1, Tour.objects.get_for_user(self.test_user))
def test_get_for_user_no_user(self):
"""
Makes sure None is returned if the user is anonymous
"""
self.assertIsNone(Tour.objects.get_for_user(User()))
def test_get_for_user_empty(self):
"""
Verifies that None is returned if no incomplete tours
"""
self.tour1.steps.add(self.step1)
# add user to tour
self.tour1.load_tour_class().add_user(self.test_user)
self.tour1.load_tour_class().add_user(self.test_user2)
self.tour2.load_tour_class().add_user(self.test_user)
self.tour2.load_tour_class().add_user(self.test_user2)
# all tours should be completed
self.assertIsNone(Tour.objects.get_for_user(self.test_user))
def test_get_recent_tour_complete(self):
"""
Makes sure that a recently completed tour is returned. Verifies most recently completed tour
is returned
"""
# add user to tour
self.tour1.load_tour_class().add_user(self.test_user)
self.tour1.load_tour_class().add_user(self.test_user2)
self.tour2.load_tour_class().add_user(self.test_user)
self.tour2.load_tour_class().add_user(self.test_user2)
# complete tours
self.tour2.load_tour_class().mark_complete(self.test_user)
self.tour1.load_tour_class().mark_complete(self.test_user)
self.tour1.load_tour_class().mark_complete(self.test_user2)
# make sure complete
self.assertEqual(3, TourStatus.objects.filter(complete=True).count())
# check that correct tour is returned
self.assertEqual(self.tour1, Tour.objects.get_recent_tour(self.test_user))
def test_get_recent_tour_no_user(self):
"""
Makes sure None is returned if the user is anonymous
"""
self.assertIsNone(Tour.objects.get_recent_tour(User()))
def test_get_recent_tour_incomplete(self):
"""
Makes sure that an incomplete tour is returned before a complete tour
"""
# add user to tour
self.tour1.load_tour_class().add_user(self.test_user)
self.tour1.load_tour_class().add_user(self.test_user2)
self.tour2.load_tour_class().add_user(self.test_user)
self.tour2.load_tour_class().add_user(self.test_user2)
# complete tours
self.tour1.load_tour_class().mark_complete(self.test_user)
self.tour2.load_tour_class().mark_complete(self.test_user)
self.tour1.load_tour_class().mark_complete(self.test_user2)
# make sure complete
self.assertEqual(3, TourStatus.objects.filter(complete=True).count())
# check that correct tour is returned
self.assertEqual(self.tour2, Tour.objects.get_recent_tour(self.test_user2))
def test_get_recent_tour_none(self):
"""
Makes sure None is returned if there is no completed tour
"""
self.assertIsNone(Tour.objects.get_recent_tour(self.test_user))
@patch('tour.tests.mocks.MockStep1.is_complete', spec_set=True)
@patch('tour.models.TourManager.get_for_user')
def test_get_next_url_current_tour(self, mock_get_for_user, mock_step1_is_complete):
"""
Verifies that the next url of a tour will be returned
:type mock_get_for_user: Mock
:type mock_step1_is_complete: Mock
"""
mock_get_for_user.return_value = self.tour1
mock_step1_is_complete.return_value = False
self.tour1.steps.add(self.step1)
# add user to tour
self.tour1.load_tour_class().add_user(self.test_user)
self.tour1.load_tour_class().add_user(self.test_user2)
self.tour2.load_tour_class().add_user(self.test_user)
self.tour2.load_tour_class().add_user(self.test_user2)
self.assertEqual(self.step1.url, Tour.objects.get_next_url(self.test_user))
self.assertEqual(1, mock_get_for_user.call_count)
@patch('tour.tests.mocks.MockStep1.is_complete', spec_set=True)
@patch('tour.models.TourManager.get_recent_tour')
@patch('tour.models.TourManager.get_for_user')
def test_get_next_url_recent_tour(self, mock_get_for_user, mock_get_recent_tour, mock_step1_is_complete):
"""
Verifies that the next url of a recent tour will be returned
:type mock_get_for_user: Mock
:type mock_get_recent_tour: Mock
:type mock_step1_is_complete: Mock
"""
mock_get_for_user.return_value = None
mock_get_recent_tour.return_value = self.tour2
mock_step1_is_complete.return_value = False
self.tour2.steps.add(self.step1)
# add user to tour
self.tour1.load_tour_class().add_user(self.test_user)
self.tour1.load_tour_class().add_user(self.test_user2)
self.tour2.load_tour_class().add_user(self.test_user)
self.tour2.load_tour_class().add_user(self.test_user2)
self.assertEqual(self.step1.url, Tour.objects.get_next_url(self.test_user))
self.assertEqual(1, mock_get_for_user.call_count)
self.assertEqual(1, mock_get_recent_tour.call_count)
def test_get_next_url_no_user(self):
"""
Makes sure None is returned if the user is anonymous
"""
self.assertIsNone(Tour.objects.get_next_url(User()))
def test_get_next_url_none(self):
"""
Verifies that None is returned if no tours exist for a user
"""
self.assertIsNone(Tour.objects.get_next_url(self.test_user))
class TourTest(TestCase):
def test_str(self):
"""
Tests the tour str method
"""
tour = G(Tour, display_name='test1')
self.assertEqual('test1', str(tour))
class StepTest(TestCase):
def test_str(self):
"""
Tests the step str method
"""
step = G(Step, display_name='test1')
self.assertEqual('test1', str(step))
| 37.738095 | 109 | 0.685552 | 1,123 | 7,925 | 4.554764 | 0.091719 | 0.084457 | 0.081329 | 0.081329 | 0.834409 | 0.798436 | 0.780059 | 0.679961 | 0.633431 | 0.633431 | 0 | 0.015283 | 0.215647 | 7,925 | 209 | 110 | 37.91866 | 0.807593 | 0.183218 | 0 | 0.54 | 0 | 0 | 0.046901 | 0.043586 | 0 | 0 | 0 | 0 | 0.21 | 1 | 0.15 | false | 0 | 0.06 | 0 | 0.24 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
c76fb6df3bbd9a510abf8f38101ec7b5af53f002 | 1,622 | py | Python | MFWR/forms.py | TsubasaK111/MFWer | 47358776a9e3e96c29e1b7a38bd6aa9b681fa8d8 | [
"MIT"
] | 1 | 2016-02-29T15:45:49.000Z | 2016-02-29T15:45:49.000Z | MFWR/forms.py | TsubasaK111/MFWR | 47358776a9e3e96c29e1b7a38bd6aa9b681fa8d8 | [
"MIT"
] | null | null | null | MFWR/forms.py | TsubasaK111/MFWR | 47358776a9e3e96c29e1b7a38bd6aa9b681fa8d8 | [
"MIT"
] | null | null | null | from wtforms import Form, BooleanField, StringField, DateField, IntegerField, DecimalField, validators
class CategoryForm(Form):
name = StringField( "Name",
[ validators.InputRequired(),
validators.Length(min=2, max=40) ] )
description = StringField( "Description",
[ validators.InputRequired(),
validators.Length(min=2, max=100) ] )
id = IntegerField( "Category_ID" )
class MFWForm(Form):
name = StringField( "Name",
[ validators.InputRequired(),
validators.Length(min=2, max=20) ] )
description = StringField( "Description",
[ validators.InputRequired(),
validators.Length(min=2, max=100) ] )
id = IntegerField( "MFW_ID" )
image_url = StringField( "Image URL", [validators.URL() ] )
reference_url = StringField( "Reference URL", [ validators.URL() ] )
class ElementForm(Form):
letter = StringField( "Letter",
[ validators.InputRequired(),
validators.Length(min=1, max=1) ] )
description = StringField( "Description",
[ validators.InputRequired(),
validators.Length(min=2, max=100) ] )
order = IntegerField("Order",
[ validators.InputRequired() ] )
id = IntegerField("Element_ID" )
| 45.055556 | 102 | 0.491985 | 116 | 1,622 | 6.836207 | 0.293103 | 0.203026 | 0.249685 | 0.295082 | 0.572509 | 0.519546 | 0.519546 | 0.519546 | 0.519546 | 0.519546 | 0 | 0.02064 | 0.402589 | 1,622 | 35 | 103 | 46.342857 | 0.79773 | 0 | 0 | 0.482759 | 0 | 0 | 0.062269 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.034483 | 0 | 0.551724 | 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 | 1 | 0 | 0 | 4 |
c77a354db24ab8fcd22dd077dde32d2b90349c02 | 185 | py | Python | test.py | waltronix/poker-player-player-one | beb28b744961db185a86ffd4acd1b99c5c32617a | [
"MIT"
] | null | null | null | test.py | waltronix/poker-player-player-one | beb28b744961db185a86ffd4acd1b99c5c32617a | [
"MIT"
] | null | null | null | test.py | waltronix/poker-player-player-one | beb28b744961db185a86ffd4acd1b99c5c32617a | [
"MIT"
] | null | null | null | from player import Player
import json
if __name__ == '__main__':
with open('test.json', 'r') as file:
state = json.loads(file.read())
print(Player(state).betRequest())
| 23.125 | 40 | 0.654054 | 25 | 185 | 4.52 | 0.72 | 0.212389 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.194595 | 185 | 7 | 41 | 26.428571 | 0.758389 | 0 | 0 | 0 | 0 | 0 | 0.097297 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
c7821c284d41fddc1342aae239f3528fc95c1c9e | 5,628 | py | Python | resources.py | vermeulendivan/qgis-latlng | 8a00c2d1729e040fcf0481ca20c2a4a84f5876da | [
"MIT"
] | null | null | null | resources.py | vermeulendivan/qgis-latlng | 8a00c2d1729e040fcf0481ca20c2a4a84f5876da | [
"MIT"
] | null | null | null | resources.py | vermeulendivan/qgis-latlng | 8a00c2d1729e040fcf0481ca20c2a4a84f5876da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.15.2)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x03\x95\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1f\xf3\xff\x61\
\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6f\x66\x74\x77\x61\x72\x65\
\x00\x41\x64\x6f\x62\x65\x20\x49\x6d\x61\x67\x65\x52\x65\x61\x64\
\x79\x71\xc9\x65\x3c\x00\x00\x03\x37\x49\x44\x41\x54\x78\xda\x54\
\x53\x4b\x6f\x1b\x55\x14\xfe\xee\x78\x3c\x0f\x7b\xc6\xe3\xf8\x95\
\xf8\x91\xd0\xc4\x45\x38\xa5\x42\xa5\x2f\xa5\x0d\x2a\x55\x41\x75\
\xa4\x16\xa1\xaa\x42\xa8\x9b\x6e\x51\x7f\x40\x59\xa4\xcb\xb2\xe2\
\x17\x44\xdd\x90\x15\x88\x05\x08\xa9\x48\x24\x14\xaa\xaa\x91\xda\
\x82\x02\x94\x58\x40\x88\x9d\xc8\x0e\x75\x9d\xc4\x6e\xe2\x71\xc6\
\x1e\xdb\x33\x9e\xdb\x3b\x49\x9b\x94\x23\x7d\xd2\xcc\x3d\xdf\xe3\
\x8c\xe6\x5c\x42\x29\x05\x21\x04\xe4\xcc\x35\x70\xd9\x4f\x15\xf0\
\xde\x09\x76\x70\x0e\xc0\x6b\xd8\xad\x12\x28\xbd\x0b\xdb\x9a\xe9\
\xdd\x18\x26\xec\xfd\x2c\xc3\xcf\x0c\x2d\x57\xcb\xbb\x0c\x72\xf2\
\x2a\xc8\xe0\xd1\x38\xba\xe6\xcd\x4c\xb8\x3e\x36\x96\x36\x53\xf1\
\x90\xa9\x48\x6a\x15\x35\x13\xc6\x5c\x2e\x7e\xe6\x71\x3e\x3a\x21\
\x27\x33\x7f\x76\x2a\x4b\xf3\x4c\x72\x9a\x85\xfe\xe4\x6a\x5f\x1a\
\xb0\x64\xe1\xb3\xf7\x46\x97\xce\x67\xd4\x70\xea\xc0\xc1\x32\xb6\
\xf2\x6f\x03\x1d\x01\xe9\x91\x82\x36\x18\xfd\x57\x4b\x06\x2b\xda\
\xf7\xfa\x2d\xe2\xf9\x75\xfa\x0b\xcf\xef\x5f\x4e\x70\x1c\x97\x64\
\xd2\x32\xb7\x33\xa4\x5e\xbb\x90\x8e\x15\xc7\x63\xb2\x9d\xe2\x42\
\x65\x98\x1d\x82\x6e\x07\x08\x0c\x17\x50\xc9\x07\xd0\x70\xb6\xf1\
\x7a\xa6\x98\x4a\x8a\x95\xf1\x5e\xfa\xfc\x05\x49\x92\x72\xa2\x28\
\x66\xf6\x26\xa0\xc6\x66\x36\xd2\x6f\x25\x0a\xc5\x28\xb6\x74\x15\
\xff\xd1\x3e\x78\x3d\x6d\x54\x16\x04\xd4\x0a\x40\x74\xa8\x84\xa7\
\x8b\x09\x44\x34\x3b\xf1\x64\x49\xcf\x2a\x8a\xf2\x03\x93\x1d\x7f\
\xc5\xa0\x9e\xa6\x7d\x6d\x5f\x53\xfe\x0b\xed\xb5\x77\x21\x89\x36\
\xa8\xdd\x03\x27\x57\x21\xbc\x3f\x87\xf2\xfd\x37\xd1\x2c\x0c\x43\
\xb6\x82\x3e\x6a\x94\xd2\x7e\xbf\xbf\xc9\x64\xf2\x9e\x01\xac\x2e\
\xa7\x17\x13\xa4\xcb\x05\x20\x58\x40\x0f\x0e\xe0\x50\xd8\xb9\xa3\
\xb0\xf4\x4d\xd8\x74\x1b\xf4\xc4\x37\xf0\x94\x0e\x13\x3c\x70\x38\
\x36\x01\x5e\xd6\xae\x01\xe7\x59\x71\xb6\x95\x23\xb2\x98\x51\x64\
\x59\x80\x97\xe7\xc0\xb1\x1f\xe6\xf0\x3c\x5a\x9e\x28\x9a\x0d\x1e\
\xed\x81\x3b\xe8\xd8\x8d\x16\xb8\xf1\x15\x55\x55\xfd\x4c\x65\xee\
\x1b\x08\xbe\xd9\xad\x12\xf7\xce\x5b\x27\x35\x45\xf0\x7a\x21\x7a\
\x09\x78\xd7\x81\x3a\x68\x1b\x59\xd4\x82\x5f\xc3\x34\x34\x14\xe7\
\x46\x37\x5c\xae\x26\x6a\x83\x8e\xe3\xac\xed\x1b\x48\xca\xed\x0d\
\xdd\xbc\x58\xdf\x78\xe6\x3f\x72\xe8\x60\xbf\x2b\xf6\x7a\x76\x47\
\xec\xf0\x02\x64\x12\xc5\xc2\xfc\x89\xf5\x7a\xf1\xf0\x2f\xd9\xf0\
\xe3\x19\x9f\xe3\x3b\xc7\x96\xe8\xe1\xbe\xc1\x77\x9f\xa8\x72\xff\
\xc8\xc3\x79\xff\xe7\xd4\xb0\x7a\x63\xa7\x32\x07\x62\xe1\x90\xea\
\x73\x5b\x65\xbd\xd9\xfa\xe3\x9f\xc4\x46\xbe\x1c\x79\xf4\x61\xf8\
\xb7\xeb\x31\xda\x7e\x03\x50\xea\xbd\x5e\xaf\xbc\x6f\x00\x1c\x33\
\xd7\x57\xe6\x91\xfb\x76\x7a\x51\xbc\xfa\xc1\xe2\xfa\x42\x96\x9d\
\x8d\xbc\xe8\xad\x0c\xf1\xad\xd9\x8f\x43\x85\x99\x01\xda\x62\x62\
\xdf\x80\x65\x59\xb3\x6c\x91\x76\x9a\xe4\xc5\x5d\x70\xd3\x4e\x33\
\x04\x19\x72\x0c\x15\x86\xe6\xe4\xe4\xa4\xcb\xf1\x33\xce\x20\xc3\
\x28\x7b\xae\xdb\xb6\xfd\xa0\xc5\x8a\x4d\x80\xa9\xa9\xa9\x3d\x03\
\xa4\x35\x20\x1d\xc0\xd9\xb8\x1f\x57\x86\x14\xf4\x47\x64\xa4\x5c\
\xb5\x2d\xf5\x3d\xb1\xd5\xf8\xba\x2d\x47\xbf\xca\xeb\xce\xbd\xbb\
\x0b\x25\xac\xae\xae\xee\xa4\xef\x5d\x26\x37\x65\x59\x47\xe0\xa3\
\x24\x6e\x5c\xbe\x72\xe9\x58\x28\x12\x96\x1a\x86\x21\x54\xab\x55\
\xf8\x24\xe9\x90\xd5\xb1\xda\xb3\xb7\x7f\x1c\x99\xfe\x1b\x4b\x8c\
\xdb\x60\x30\xfe\xbf\x07\xec\xc3\x18\x06\xee\x2f\xa3\x5a\xb9\x75\
\xaf\x1c\x8b\x05\x85\xb5\xb5\xcd\xee\xb3\x9a\xde\x09\x85\x55\x91\
\x10\x0e\xcb\x35\x54\x19\x27\xce\xe0\xbc\x6a\xf0\x5c\x80\x01\x00\
\x66\x79\x51\x96\x57\x03\x49\xd1\x00\x00\x00\x00\x49\x45\x4e\x44\
\xae\x42\x60\x82\
"
qt_resource_name = b"\
\x00\x07\
\x07\x3b\xe0\xb3\
\x00\x70\
\x00\x6c\x00\x75\x00\x67\x00\x69\x00\x6e\x00\x73\
\x00\x0a\
\x03\x43\xc9\x43\
\x00\x6c\
\x00\x61\x00\x74\x00\x6c\x00\x6e\x00\x67\x00\x63\x00\x61\x00\x6c\x00\x63\
\x00\x08\
\x0a\x61\x5a\xa7\
\x00\x69\
\x00\x63\x00\x6f\x00\x6e\x00\x2e\x00\x70\x00\x6e\x00\x67\
"
qt_resource_struct_v1 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
"
qt_resource_struct_v2 = b"\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x14\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
\x00\x00\x00\x00\x00\x00\x00\x00\
\x00\x00\x00\x2e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
\x00\x00\x01\x79\xea\xec\xd2\xe5\
"
qt_version = [int(v) for v in QtCore.qVersion().split('.')]
if qt_version < [5, 8, 0]:
rcc_version = 1
qt_resource_struct = qt_resource_struct_v1
else:
rcc_version = 2
qt_resource_struct = qt_resource_struct_v2
def qInitResources():
QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
def qCleanupResources():
QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
qInitResources()
| 46.131148 | 104 | 0.710554 | 1,250 | 5,628 | 3.1688 | 0.2392 | 0.156021 | 0.161323 | 0.124211 | 0.149205 | 0.149205 | 0.13229 | 0.13229 | 0.13229 | 0.13229 | 0 | 0.3037 | 0.058635 | 5,628 | 121 | 105 | 46.512397 | 0.443941 | 0.027008 | 0 | 0.104762 | 0 | 0.647619 | 0.000187 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0.019048 | false | 0 | 0.009524 | 0 | 0.028571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
c79987d1fcaefcee5467e4910e29dc667c18a193 | 25 | py | Python | SerialReader/db/__init__.py | 923132714/SerialReader | 1c687ff139f280edc25d676569797b36a5951cbd | [
"Apache-2.0"
] | 1 | 2019-01-30T09:51:32.000Z | 2019-01-30T09:51:32.000Z | SerialReader/db/__init__.py | 923132714/SerialReader | 1c687ff139f280edc25d676569797b36a5951cbd | [
"Apache-2.0"
] | null | null | null | SerialReader/db/__init__.py | 923132714/SerialReader | 1c687ff139f280edc25d676569797b36a5951cbd | [
"Apache-2.0"
] | null | null | null | """
@author Logic923
"""
| 6.25 | 16 | 0.56 | 2 | 25 | 7 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0.16 | 25 | 3 | 17 | 8.333333 | 0.52381 | 0.64 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
c7a6dc25dc9871e13e1b304f984dae766db6991f | 178 | py | Python | api/schemas/songs_schema_db.py | helmcode/api_salsa | 4345d3b249646bb4055147f2481912a9c10ed7e2 | [
"MIT"
] | null | null | null | api/schemas/songs_schema_db.py | helmcode/api_salsa | 4345d3b249646bb4055147f2481912a9c10ed7e2 | [
"MIT"
] | 6 | 2021-09-16T18:02:15.000Z | 2021-10-05T13:25:48.000Z | api/schemas/songs_schema_db.py | helmcode/api_salsa | 4345d3b249646bb4055147f2481912a9c10ed7e2 | [
"MIT"
] | null | null | null | import datetime
from typing import Optional
from pydantic import BaseModel
class SongsModelDb(BaseModel):
id: Optional[int]
name: str
departure_date: datetime.date
| 17.8 | 33 | 0.769663 | 22 | 178 | 6.181818 | 0.681818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.179775 | 178 | 9 | 34 | 19.777778 | 0.931507 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.428571 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
c7c8861de61b100c163beb2d025ab95044a33d8c | 302 | py | Python | mason/cli/server.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 4 | 2021-04-12T17:49:34.000Z | 2022-01-23T19:54:29.000Z | mason/cli/server.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 24 | 2021-04-30T18:40:25.000Z | 2021-05-12T20:52:06.000Z | mason/cli/server.py | kyprifog/mason | bf45672124ef841bc16216c293034f4ccc506621 | [
"Apache-2.0"
] | 3 | 2021-04-12T19:40:43.000Z | 2021-09-07T21:56:36.000Z | import click
@click.command("server", short_help="Runs mason flask server on port 5000")
def server():
"""
Will run mason flask server on port 5000.
To view the mason swagger ui go to: http://localhost:5000/api/ui/
"""
from mason.server import MasonServer
MasonServer().run()
| 25.166667 | 75 | 0.682119 | 44 | 302 | 4.659091 | 0.590909 | 0.097561 | 0.156098 | 0.17561 | 0.253659 | 0.253659 | 0 | 0 | 0 | 0 | 0 | 0.05 | 0.205298 | 302 | 11 | 76 | 27.454545 | 0.804167 | 0.354305 | 0 | 0 | 0 | 0 | 0.241379 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | true | 0 | 0.4 | 0 | 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 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
c7ca5e37b0dced8af22e32f0f82c0541a252fafb | 214 | py | Python | 0217-Contains-Duplicate/py_0217/solution1.py | ooooo-youwillsee/leetcode | 07b273f133c8cf755ea40b3ae9df242ce044823c | [
"MIT"
] | 12 | 2020-03-18T14:36:23.000Z | 2021-12-19T02:24:33.000Z | 0217-Contains-Duplicate/py_0217/solution1.py | ooooo-youwillsee/leetcode | 07b273f133c8cf755ea40b3ae9df242ce044823c | [
"MIT"
] | null | null | null | 0217-Contains-Duplicate/py_0217/solution1.py | ooooo-youwillsee/leetcode | 07b273f133c8cf755ea40b3ae9df242ce044823c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/12/13 10:26
# @Author : ooooo
from typing import *
class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
return len(set(nums)) != len(nums)
| 19.454545 | 57 | 0.598131 | 29 | 214 | 4.413793 | 0.896552 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.078788 | 0.228972 | 214 | 10 | 58 | 21.4 | 0.69697 | 0.308411 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0.25 | 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 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
c7da3119f4a065dee354b713f5df3af2f715df17 | 280 | py | Python | tests/micropython/decorator_error.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 692 | 2016-12-19T23:25:35.000Z | 2022-03-31T14:20:48.000Z | tests/micropython/decorator_error.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 509 | 2017-03-28T19:37:18.000Z | 2022-03-31T20:31:43.000Z | tests/micropython/decorator_error.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 228 | 2016-12-19T05:03:30.000Z | 2022-03-22T18:13:00.000Z | # test syntax errors for uPy-specific decorators
def test_syntax(code):
try:
exec(code)
except SyntaxError:
print("SyntaxError")
# invalid micropython decorators
test_syntax("@micropython.a\ndef f(): pass")
test_syntax("@micropython.a.b\ndef f(): pass")
| 23.333333 | 48 | 0.696429 | 36 | 280 | 5.333333 | 0.583333 | 0.208333 | 0.21875 | 0.229167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.178571 | 280 | 11 | 49 | 25.454545 | 0.834783 | 0.275 | 0 | 0 | 0 | 0 | 0.355 | 0.105 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0.285714 | 0 | 0 | 0.142857 | 0.142857 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
c7f28aea1e1573fa132754992d49fdd63a9071e9 | 590 | py | Python | blog/USERAPP/admin.py | Brktrlw/django-rest-framework-blog | 141b07033ca15bb092e695e676e6455af3e8f523 | [
"Apache-2.0"
] | null | null | null | blog/USERAPP/admin.py | Brktrlw/django-rest-framework-blog | 141b07033ca15bb092e695e676e6455af3e8f523 | [
"Apache-2.0"
] | null | null | null | blog/USERAPP/admin.py | Brktrlw/django-rest-framework-blog | 141b07033ca15bb092e695e676e6455af3e8f523 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import ProfileModel
from FAVORITES.models import FavoritesModel
from LIKESAPP.models import PostLikesModel
from COMMENTLIKES.models import CommentLikesModel
from NOTIFICATIONAPP.models import ModelNotification
from POSTAPP.models import PostModel
from COMMENTAPP.models import CommentModel
admin.site.register(PostLikesModel)
admin.site.register(CommentLikesModel)
admin.site.register(ModelNotification)
admin.site.register(PostModel)
admin.site.register(CommentModel)
admin.site.register(FavoritesModel)
admin.site.register(ProfileModel)
| 28.095238 | 52 | 0.864407 | 67 | 590 | 7.61194 | 0.313433 | 0.164706 | 0.233333 | 0.113725 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.074576 | 590 | 20 | 53 | 29.5 | 0.934066 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.533333 | 0 | 0.533333 | 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 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
1be49bf984510e4da65ef178b61e1e3603c48467 | 81 | py | Python | copier/__main__.py | oprypin/copier | 60f916017b43c66e1629823cd87afce9497c32d9 | [
"MIT"
] | 438 | 2020-06-18T20:44:13.000Z | 2022-03-28T17:09:09.000Z | copier/__main__.py | oprypin/copier | 60f916017b43c66e1629823cd87afce9497c32d9 | [
"MIT"
] | 327 | 2020-06-17T08:47:19.000Z | 2022-03-31T21:27:52.000Z | copier/__main__.py | oprypin/copier | 60f916017b43c66e1629823cd87afce9497c32d9 | [
"MIT"
] | 54 | 2020-07-28T23:02:25.000Z | 2022-03-27T15:43:20.000Z | from copier.cli import CopierApp
if __name__ == "__main__":
CopierApp.run()
| 16.2 | 32 | 0.716049 | 10 | 81 | 5 | 0.9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.17284 | 81 | 4 | 33 | 20.25 | 0.746269 | 0 | 0 | 0 | 0 | 0 | 0.098765 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
1be6f320e241f06c998b26b8701f00731cfc22d0 | 50 | py | Python | PCTC/2022 R1 Senior/Q4.py | object-oriented-human/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | 1 | 2022-02-21T15:43:01.000Z | 2022-02-21T15:43:01.000Z | PCTC/2022 R1 Senior/Q4.py | foooop/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | null | null | null | PCTC/2022 R1 Senior/Q4.py | foooop/competitive | 9e761020e887d8980a39a64eeaeaa39af0ecd777 | [
"MIT"
] | null | null | null | print(sorted([int(input()) for i in range(3)])[1]) | 50 | 50 | 0.64 | 10 | 50 | 3.2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.043478 | 0.08 | 50 | 1 | 50 | 50 | 0.652174 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 1 | 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 | 1 | 0 | 4 |
1bf622c4ed7dd4f3f87b58d3c1278c6f28efc0c2 | 95 | py | Python | monthertree/friends/admin.py | youtaya/mothertree | d2a58890b5b84dbed72b60480a972c1e0ac74f86 | [
"MIT"
] | null | null | null | monthertree/friends/admin.py | youtaya/mothertree | d2a58890b5b84dbed72b60480a972c1e0ac74f86 | [
"MIT"
] | null | null | null | monthertree/friends/admin.py | youtaya/mothertree | d2a58890b5b84dbed72b60480a972c1e0ac74f86 | [
"MIT"
] | null | null | null | from django.contrib import admin
from friends.models import Friend
admin.site.register(Friend) | 23.75 | 33 | 0.842105 | 14 | 95 | 5.714286 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094737 | 95 | 4 | 34 | 23.75 | 0.930233 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
1bfc6f49f75c67a6a2472202f38a62214e995648 | 338 | py | Python | eda5/import/forms/import_deli_forms.py | vasjapavlovic/eda5 | bc4b387b24239ea1dfb927657f05ddabbf707479 | [
"BSD-3-Clause"
] | null | null | null | eda5/import/forms/import_deli_forms.py | vasjapavlovic/eda5 | bc4b387b24239ea1dfb927657f05ddabbf707479 | [
"BSD-3-Clause"
] | null | null | null | eda5/import/forms/import_deli_forms.py | vasjapavlovic/eda5 | bc4b387b24239ea1dfb927657f05ddabbf707479 | [
"BSD-3-Clause"
] | null | null | null | from django import forms
# potrditev ali žeiliš uvoziti ali ne
class DeliUvozCsvForm(forms.Form):
skupine_delov_stavbe = forms.BooleanField(initial=False, required=False)
podskupine_delov_stavbe = forms.BooleanField(initial=False, required=False)
del02_ostali_deli_stavbe = forms.BooleanField(initial=False, required=False)
| 37.555556 | 80 | 0.807692 | 42 | 338 | 6.333333 | 0.547619 | 0.12406 | 0.259399 | 0.338346 | 0.578947 | 0.578947 | 0.578947 | 0.398496 | 0 | 0 | 0 | 0.006689 | 0.115385 | 338 | 8 | 81 | 42.25 | 0.882943 | 0.10355 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.2 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
400d88dbfded37173736214132a412af8bc488cd | 135 | py | Python | Exercicios/Desafio12.py | mauriciozago/CursoPython3 | cbcff9ebfd4d5f5e3a32a369dac8521c6758bfe5 | [
"MIT"
] | null | null | null | Exercicios/Desafio12.py | mauriciozago/CursoPython3 | cbcff9ebfd4d5f5e3a32a369dac8521c6758bfe5 | [
"MIT"
] | null | null | null | Exercicios/Desafio12.py | mauriciozago/CursoPython3 | cbcff9ebfd4d5f5e3a32a369dac8521c6758bfe5 | [
"MIT"
] | null | null | null | preco = float(input("Insira o preço do produto: "))
print('O novo preço do produto, com 5% de desconto, é {:0.2f}'.format(preco*0.95))
| 45 | 82 | 0.681481 | 25 | 135 | 3.68 | 0.76 | 0.152174 | 0.304348 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051724 | 0.140741 | 135 | 2 | 83 | 67.5 | 0.741379 | 0 | 0 | 0 | 0 | 0 | 0.6 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 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 | 1 | 0 | 4 |
401b690ccc4d2cc8b5b8c8209320d98fab20850a | 156 | py | Python | p2_continuous-control/agent.py | bhattsachin/deep-reinforcement-learning | 4d75b012495009bf156273e170d75caf400fa7aa | [
"MIT"
] | null | null | null | p2_continuous-control/agent.py | bhattsachin/deep-reinforcement-learning | 4d75b012495009bf156273e170d75caf400fa7aa | [
"MIT"
] | null | null | null | p2_continuous-control/agent.py | bhattsachin/deep-reinforcement-learning | 4d75b012495009bf156273e170d75caf400fa7aa | [
"MIT"
] | null | null | null | class Agent:
def __init__(self, seed, n_state, n_action):
pass
def step(self, env_config):
pass
def act(self):
pass
| 13 | 48 | 0.557692 | 21 | 156 | 3.809524 | 0.666667 | 0.175 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.352564 | 156 | 11 | 49 | 14.181818 | 0.792079 | 0 | 0 | 0.428571 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.428571 | false | 0.428571 | 0 | 0 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 4 |
401bffe697cbca71f724de0f7c1e380d3a2bb064 | 172 | py | Python | graphpipe/graphpipefb/Req.py | LaudateCorpus1/graphpipe-py | eb474b29860d4a0dc713b834586dec527028e688 | [
"UPL-1.0"
] | 38 | 2018-08-15T15:56:15.000Z | 2020-09-18T09:19:45.000Z | graphpipe/graphpipefb/Req.py | LaudateCorpus1/graphpipe-py | eb474b29860d4a0dc713b834586dec527028e688 | [
"UPL-1.0"
] | 3 | 2018-08-16T04:56:53.000Z | 2019-02-21T09:16:36.000Z | graphpipe/graphpipefb/Req.py | LaudateCorpus1/graphpipe-py | eb474b29860d4a0dc713b834586dec527028e688 | [
"UPL-1.0"
] | 11 | 2018-08-16T09:10:05.000Z | 2022-02-18T04:45:20.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: graphpipe
class Req(object):
NONE = 0
InferRequest = 1
MetadataRequest = 2
| 17.2 | 68 | 0.715116 | 20 | 172 | 6.15 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.022556 | 0.226744 | 172 | 9 | 69 | 19.111111 | 0.902256 | 0.505814 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
402fae5775eade5156f28341248cf82d73d387f6 | 333 | py | Python | pytorch_helper_bot/__init__.py | ceshine/pytorch-helper-bot | 32c88d41fffa41fe35ba21c278eae83d914f3847 | [
"MIT"
] | 10 | 2019-12-13T23:30:31.000Z | 2021-12-08T14:21:47.000Z | pytorch_helper_bot/__init__.py | ceshine/pytorch-helper-bot | 32c88d41fffa41fe35ba21c278eae83d914f3847 | [
"MIT"
] | null | null | null | pytorch_helper_bot/__init__.py | ceshine/pytorch-helper-bot | 32c88d41fffa41fe35ba21c278eae83d914f3847 | [
"MIT"
] | 1 | 2021-11-07T19:00:03.000Z | 2021-11-07T19:00:03.000Z | from .discriminative_learning_rates import freeze_layers, optimizer_with_layer_attributes
from .bot import BaseBot, DeepSpeedBot
from .lr_scheduler import *
from .weight_decay import *
from .metrics import Metric, AUC, FBeta, Top1Accuracy, TopKAccuracy
from .callbacks import *
from torch.optim.lr_scheduler import CosineAnnealingLR
| 41.625 | 89 | 0.846847 | 42 | 333 | 6.5 | 0.666667 | 0.10989 | 0.124542 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.003344 | 0.102102 | 333 | 7 | 90 | 47.571429 | 0.909699 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
40310785a23d9797fb86ca605e9008843ce97b32 | 11,106 | py | Python | sdk/python/pulumi_azure/securitycenter/subscription_pricing.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 109 | 2018-06-18T00:19:44.000Z | 2022-02-20T05:32:57.000Z | sdk/python/pulumi_azure/securitycenter/subscription_pricing.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 663 | 2018-06-18T21:08:46.000Z | 2022-03-31T20:10:11.000Z | sdk/python/pulumi_azure/securitycenter/subscription_pricing.py | henriktao/pulumi-azure | f1cbcf100b42b916da36d8fe28be3a159abaf022 | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-07-19T22:37:38.000Z | 2022-03-14T10:56:26.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ = ['SubscriptionPricingArgs', 'SubscriptionPricing']
@pulumi.input_type
class SubscriptionPricingArgs:
def __init__(__self__, *,
tier: pulumi.Input[str],
resource_type: Optional[pulumi.Input[str]] = None):
"""
The set of arguments for constructing a SubscriptionPricing resource.
:param pulumi.Input[str] tier: The pricing tier to use. Possible values are `Free` and `Standard`.
:param pulumi.Input[str] resource_type: The resource type this setting affects. Possible values are `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `OpenSourceRelationalDatabases`, `Containers` and `Dns`. Defaults to `VirtualMachines`.
"""
pulumi.set(__self__, "tier", tier)
if resource_type is not None:
pulumi.set(__self__, "resource_type", resource_type)
@property
@pulumi.getter
def tier(self) -> pulumi.Input[str]:
"""
The pricing tier to use. Possible values are `Free` and `Standard`.
"""
return pulumi.get(self, "tier")
@tier.setter
def tier(self, value: pulumi.Input[str]):
pulumi.set(self, "tier", value)
@property
@pulumi.getter(name="resourceType")
def resource_type(self) -> Optional[pulumi.Input[str]]:
"""
The resource type this setting affects. Possible values are `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `OpenSourceRelationalDatabases`, `Containers` and `Dns`. Defaults to `VirtualMachines`.
"""
return pulumi.get(self, "resource_type")
@resource_type.setter
def resource_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "resource_type", value)
@pulumi.input_type
class _SubscriptionPricingState:
def __init__(__self__, *,
resource_type: Optional[pulumi.Input[str]] = None,
tier: Optional[pulumi.Input[str]] = None):
"""
Input properties used for looking up and filtering SubscriptionPricing resources.
:param pulumi.Input[str] resource_type: The resource type this setting affects. Possible values are `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `OpenSourceRelationalDatabases`, `Containers` and `Dns`. Defaults to `VirtualMachines`.
:param pulumi.Input[str] tier: The pricing tier to use. Possible values are `Free` and `Standard`.
"""
if resource_type is not None:
pulumi.set(__self__, "resource_type", resource_type)
if tier is not None:
pulumi.set(__self__, "tier", tier)
@property
@pulumi.getter(name="resourceType")
def resource_type(self) -> Optional[pulumi.Input[str]]:
"""
The resource type this setting affects. Possible values are `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `OpenSourceRelationalDatabases`, `Containers` and `Dns`. Defaults to `VirtualMachines`.
"""
return pulumi.get(self, "resource_type")
@resource_type.setter
def resource_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "resource_type", value)
@property
@pulumi.getter
def tier(self) -> Optional[pulumi.Input[str]]:
"""
The pricing tier to use. Possible values are `Free` and `Standard`.
"""
return pulumi.get(self, "tier")
@tier.setter
def tier(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "tier", value)
class SubscriptionPricing(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
resource_type: Optional[pulumi.Input[str]] = None,
tier: Optional[pulumi.Input[str]] = None,
__props__=None):
"""
Manages the Pricing Tier for Azure Security Center in the current subscription.
> **NOTE:** Deletion of this resource does not change or reset the pricing tier to `Free`
## Example Usage
```python
import pulumi
import pulumi_azure as azure
example = azure.securitycenter.SubscriptionPricing("example",
resource_type="VirtualMachines",
tier="Standard")
```
## Import
The pricing tier can be imported using the `resource id`, e.g.
```sh
$ pulumi import azure:securitycenter/subscriptionPricing:SubscriptionPricing example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/pricings/<resource_type>
```
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] resource_type: The resource type this setting affects. Possible values are `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `OpenSourceRelationalDatabases`, `Containers` and `Dns`. Defaults to `VirtualMachines`.
:param pulumi.Input[str] tier: The pricing tier to use. Possible values are `Free` and `Standard`.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: SubscriptionPricingArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Manages the Pricing Tier for Azure Security Center in the current subscription.
> **NOTE:** Deletion of this resource does not change or reset the pricing tier to `Free`
## Example Usage
```python
import pulumi
import pulumi_azure as azure
example = azure.securitycenter.SubscriptionPricing("example",
resource_type="VirtualMachines",
tier="Standard")
```
## Import
The pricing tier can be imported using the `resource id`, e.g.
```sh
$ pulumi import azure:securitycenter/subscriptionPricing:SubscriptionPricing example /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/pricings/<resource_type>
```
:param str resource_name: The name of the resource.
:param SubscriptionPricingArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(SubscriptionPricingArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
resource_type: Optional[pulumi.Input[str]] = None,
tier: Optional[pulumi.Input[str]] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = SubscriptionPricingArgs.__new__(SubscriptionPricingArgs)
__props__.__dict__["resource_type"] = resource_type
if tier is None and not opts.urn:
raise TypeError("Missing required property 'tier'")
__props__.__dict__["tier"] = tier
super(SubscriptionPricing, __self__).__init__(
'azure:securitycenter/subscriptionPricing:SubscriptionPricing',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None,
resource_type: Optional[pulumi.Input[str]] = None,
tier: Optional[pulumi.Input[str]] = None) -> 'SubscriptionPricing':
"""
Get an existing SubscriptionPricing resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] resource_type: The resource type this setting affects. Possible values are `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `OpenSourceRelationalDatabases`, `Containers` and `Dns`. Defaults to `VirtualMachines`.
:param pulumi.Input[str] tier: The pricing tier to use. Possible values are `Free` and `Standard`.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = _SubscriptionPricingState.__new__(_SubscriptionPricingState)
__props__.__dict__["resource_type"] = resource_type
__props__.__dict__["tier"] = tier
return SubscriptionPricing(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="resourceType")
def resource_type(self) -> pulumi.Output[Optional[str]]:
"""
The resource type this setting affects. Possible values are `AppServices`, `ContainerRegistry`, `KeyVaults`, `KubernetesService`, `SqlServers`, `SqlServerVirtualMachines`, `StorageAccounts`, `VirtualMachines`, `Arm`, `OpenSourceRelationalDatabases`, `Containers` and `Dns`. Defaults to `VirtualMachines`.
"""
return pulumi.get(self, "resource_type")
@property
@pulumi.getter
def tier(self) -> pulumi.Output[str]:
"""
The pricing tier to use. Possible values are `Free` and `Standard`.
"""
return pulumi.get(self, "tier")
| 46.663866 | 352 | 0.665766 | 1,153 | 11,106 | 6.213356 | 0.150911 | 0.070352 | 0.054718 | 0.046064 | 0.741625 | 0.715103 | 0.701005 | 0.67909 | 0.66569 | 0.643635 | 0 | 0.007604 | 0.230326 | 11,106 | 237 | 353 | 46.860759 | 0.830487 | 0.467495 | 0 | 0.551724 | 1 | 0 | 0.094204 | 0.015669 | 0 | 0 | 0 | 0 | 0 | 1 | 0.146552 | false | 0.008621 | 0.043103 | 0 | 0.275862 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
40516e42624f63e6be42b1bee74c861122258994 | 153 | py | Python | backend/myproject/core/actions.py | rg3915/crm-django-vuejs-archived | 121c1a32c0324762358cf3818385fba20c61fa40 | [
"MIT"
] | 1 | 2020-04-21T19:39:58.000Z | 2020-04-21T19:39:58.000Z | backend/myproject/core/actions.py | rg3915/crm-django-vuejs-archived | 121c1a32c0324762358cf3818385fba20c61fa40 | [
"MIT"
] | 10 | 2020-06-05T19:15:21.000Z | 2022-02-26T06:32:30.000Z | backend/myproject/core/actions.py | rg3915/crm-django-vuejs-archived | 121c1a32c0324762358cf3818385fba20c61fa40 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
def _delete(model, pk):
obj = get_object_or_404(model, pk=pk)
obj.active = False
obj.save()
| 19.125 | 46 | 0.712418 | 25 | 153 | 4.08 | 0.64 | 0.176471 | 0.215686 | 0.27451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.048387 | 0.189542 | 153 | 7 | 47 | 21.857143 | 0.774194 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4077f3768cf2550847688d66e89674583d7ece8f | 238 | py | Python | src/test/test_day02.py | joeeoj/advent2021 | 8ccd2dbaf89b26b42b8bdc6c45b78e8cc5351dcc | [
"MIT"
] | null | null | null | src/test/test_day02.py | joeeoj/advent2021 | 8ccd2dbaf89b26b42b8bdc6c45b78e8cc5351dcc | [
"MIT"
] | null | null | null | src/test/test_day02.py | joeeoj/advent2021 | 8ccd2dbaf89b26b42b8bdc6c45b78e8cc5351dcc | [
"MIT"
] | null | null | null | import pytest
from src.day02.part01 import main as main_part01
from src.day02.part02 import main as main_part02
def test_part01_ans():
assert main_part01() == 1947824
def test_part02_ans():
assert main_part02() == 1813062561
| 18.307692 | 48 | 0.760504 | 36 | 238 | 4.805556 | 0.416667 | 0.080925 | 0.138728 | 0.184971 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.18593 | 0.163866 | 238 | 12 | 49 | 19.833333 | 0.683417 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | 1 | 0.285714 | true | 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 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
407929ccccda495cad95f2306ba5239e3365d52f | 25,590 | py | Python | sdk/python/pulumi_azure_native/apimanagement/v20210101preview/subscription.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20210101preview/subscription.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20210101preview/subscription.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from ._enums import *
__all__ = ['SubscriptionArgs', 'Subscription']
@pulumi.input_type
class SubscriptionArgs:
def __init__(__self__, *,
display_name: pulumi.Input[str],
resource_group_name: pulumi.Input[str],
scope: pulumi.Input[str],
service_name: pulumi.Input[str],
allow_tracing: Optional[pulumi.Input[bool]] = None,
app_type: Optional[pulumi.Input[str]] = None,
notify: Optional[pulumi.Input[bool]] = None,
owner_id: Optional[pulumi.Input[str]] = None,
primary_key: Optional[pulumi.Input[str]] = None,
secondary_key: Optional[pulumi.Input[str]] = None,
sid: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input['SubscriptionState']] = None):
"""
The set of arguments for constructing a Subscription resource.
:param pulumi.Input[str] display_name: Subscription name.
:param pulumi.Input[str] resource_group_name: The name of the resource group.
:param pulumi.Input[str] scope: Scope like /products/{productId} or /apis or /apis/{apiId}.
:param pulumi.Input[str] service_name: The name of the API Management service.
:param pulumi.Input[bool] allow_tracing: Determines whether tracing can be enabled
:param pulumi.Input[str] app_type: Determines the type of application which send the create user request. Default is legacy publisher portal.
:param pulumi.Input[bool] notify: Notify change in Subscription State.
- If false, do not send any email notification for change of state of subscription
- If true, send email notification of change of state of subscription
:param pulumi.Input[str] owner_id: User (user id path) for whom subscription is being created in form /users/{userId}
:param pulumi.Input[str] primary_key: Primary subscription key. If not specified during request key will be generated automatically.
:param pulumi.Input[str] secondary_key: Secondary subscription key. If not specified during request key will be generated automatically.
:param pulumi.Input[str] sid: Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
:param pulumi.Input['SubscriptionState'] state: Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
"""
pulumi.set(__self__, "display_name", display_name)
pulumi.set(__self__, "resource_group_name", resource_group_name)
pulumi.set(__self__, "scope", scope)
pulumi.set(__self__, "service_name", service_name)
if allow_tracing is not None:
pulumi.set(__self__, "allow_tracing", allow_tracing)
if app_type is not None:
pulumi.set(__self__, "app_type", app_type)
if notify is not None:
pulumi.set(__self__, "notify", notify)
if owner_id is not None:
pulumi.set(__self__, "owner_id", owner_id)
if primary_key is not None:
pulumi.set(__self__, "primary_key", primary_key)
if secondary_key is not None:
pulumi.set(__self__, "secondary_key", secondary_key)
if sid is not None:
pulumi.set(__self__, "sid", sid)
if state is not None:
pulumi.set(__self__, "state", state)
@property
@pulumi.getter(name="displayName")
def display_name(self) -> pulumi.Input[str]:
"""
Subscription name.
"""
return pulumi.get(self, "display_name")
@display_name.setter
def display_name(self, value: pulumi.Input[str]):
pulumi.set(self, "display_name", value)
@property
@pulumi.getter(name="resourceGroupName")
def resource_group_name(self) -> pulumi.Input[str]:
"""
The name of the resource group.
"""
return pulumi.get(self, "resource_group_name")
@resource_group_name.setter
def resource_group_name(self, value: pulumi.Input[str]):
pulumi.set(self, "resource_group_name", value)
@property
@pulumi.getter
def scope(self) -> pulumi.Input[str]:
"""
Scope like /products/{productId} or /apis or /apis/{apiId}.
"""
return pulumi.get(self, "scope")
@scope.setter
def scope(self, value: pulumi.Input[str]):
pulumi.set(self, "scope", value)
@property
@pulumi.getter(name="serviceName")
def service_name(self) -> pulumi.Input[str]:
"""
The name of the API Management service.
"""
return pulumi.get(self, "service_name")
@service_name.setter
def service_name(self, value: pulumi.Input[str]):
pulumi.set(self, "service_name", value)
@property
@pulumi.getter(name="allowTracing")
def allow_tracing(self) -> Optional[pulumi.Input[bool]]:
"""
Determines whether tracing can be enabled
"""
return pulumi.get(self, "allow_tracing")
@allow_tracing.setter
def allow_tracing(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "allow_tracing", value)
@property
@pulumi.getter(name="appType")
def app_type(self) -> Optional[pulumi.Input[str]]:
"""
Determines the type of application which send the create user request. Default is legacy publisher portal.
"""
return pulumi.get(self, "app_type")
@app_type.setter
def app_type(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "app_type", value)
@property
@pulumi.getter
def notify(self) -> Optional[pulumi.Input[bool]]:
"""
Notify change in Subscription State.
- If false, do not send any email notification for change of state of subscription
- If true, send email notification of change of state of subscription
"""
return pulumi.get(self, "notify")
@notify.setter
def notify(self, value: Optional[pulumi.Input[bool]]):
pulumi.set(self, "notify", value)
@property
@pulumi.getter(name="ownerId")
def owner_id(self) -> Optional[pulumi.Input[str]]:
"""
User (user id path) for whom subscription is being created in form /users/{userId}
"""
return pulumi.get(self, "owner_id")
@owner_id.setter
def owner_id(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "owner_id", value)
@property
@pulumi.getter(name="primaryKey")
def primary_key(self) -> Optional[pulumi.Input[str]]:
"""
Primary subscription key. If not specified during request key will be generated automatically.
"""
return pulumi.get(self, "primary_key")
@primary_key.setter
def primary_key(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "primary_key", value)
@property
@pulumi.getter(name="secondaryKey")
def secondary_key(self) -> Optional[pulumi.Input[str]]:
"""
Secondary subscription key. If not specified during request key will be generated automatically.
"""
return pulumi.get(self, "secondary_key")
@secondary_key.setter
def secondary_key(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "secondary_key", value)
@property
@pulumi.getter
def sid(self) -> Optional[pulumi.Input[str]]:
"""
Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
"""
return pulumi.get(self, "sid")
@sid.setter
def sid(self, value: Optional[pulumi.Input[str]]):
pulumi.set(self, "sid", value)
@property
@pulumi.getter
def state(self) -> Optional[pulumi.Input['SubscriptionState']]:
"""
Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
"""
return pulumi.get(self, "state")
@state.setter
def state(self, value: Optional[pulumi.Input['SubscriptionState']]):
pulumi.set(self, "state", value)
class Subscription(pulumi.CustomResource):
@overload
def __init__(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
allow_tracing: Optional[pulumi.Input[bool]] = None,
app_type: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
notify: Optional[pulumi.Input[bool]] = None,
owner_id: Optional[pulumi.Input[str]] = None,
primary_key: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
scope: Optional[pulumi.Input[str]] = None,
secondary_key: Optional[pulumi.Input[str]] = None,
service_name: Optional[pulumi.Input[str]] = None,
sid: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input['SubscriptionState']] = None,
__props__=None):
"""
Subscription details.
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[bool] allow_tracing: Determines whether tracing can be enabled
:param pulumi.Input[str] app_type: Determines the type of application which send the create user request. Default is legacy publisher portal.
:param pulumi.Input[str] display_name: Subscription name.
:param pulumi.Input[bool] notify: Notify change in Subscription State.
- If false, do not send any email notification for change of state of subscription
- If true, send email notification of change of state of subscription
:param pulumi.Input[str] owner_id: User (user id path) for whom subscription is being created in form /users/{userId}
:param pulumi.Input[str] primary_key: Primary subscription key. If not specified during request key will be generated automatically.
:param pulumi.Input[str] resource_group_name: The name of the resource group.
:param pulumi.Input[str] scope: Scope like /products/{productId} or /apis or /apis/{apiId}.
:param pulumi.Input[str] secondary_key: Secondary subscription key. If not specified during request key will be generated automatically.
:param pulumi.Input[str] service_name: The name of the API Management service.
:param pulumi.Input[str] sid: Subscription entity Identifier. The entity represents the association between a user and a product in API Management.
:param pulumi.Input['SubscriptionState'] state: Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
"""
...
@overload
def __init__(__self__,
resource_name: str,
args: SubscriptionArgs,
opts: Optional[pulumi.ResourceOptions] = None):
"""
Subscription details.
:param str resource_name: The name of the resource.
:param SubscriptionArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
...
def __init__(__self__, resource_name: str, *args, **kwargs):
resource_args, opts = _utilities.get_resource_args_opts(SubscriptionArgs, pulumi.ResourceOptions, *args, **kwargs)
if resource_args is not None:
__self__._internal_init(resource_name, opts, **resource_args.__dict__)
else:
__self__._internal_init(resource_name, *args, **kwargs)
def _internal_init(__self__,
resource_name: str,
opts: Optional[pulumi.ResourceOptions] = None,
allow_tracing: Optional[pulumi.Input[bool]] = None,
app_type: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
notify: Optional[pulumi.Input[bool]] = None,
owner_id: Optional[pulumi.Input[str]] = None,
primary_key: Optional[pulumi.Input[str]] = None,
resource_group_name: Optional[pulumi.Input[str]] = None,
scope: Optional[pulumi.Input[str]] = None,
secondary_key: Optional[pulumi.Input[str]] = None,
service_name: Optional[pulumi.Input[str]] = None,
sid: Optional[pulumi.Input[str]] = None,
state: Optional[pulumi.Input['SubscriptionState']] = None,
__props__=None):
if opts is None:
opts = pulumi.ResourceOptions()
if not isinstance(opts, pulumi.ResourceOptions):
raise TypeError('Expected resource options to be a ResourceOptions instance')
if opts.version is None:
opts.version = _utilities.get_version()
if opts.id is None:
if __props__ is not None:
raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
__props__ = SubscriptionArgs.__new__(SubscriptionArgs)
__props__.__dict__["allow_tracing"] = allow_tracing
__props__.__dict__["app_type"] = app_type
if display_name is None and not opts.urn:
raise TypeError("Missing required property 'display_name'")
__props__.__dict__["display_name"] = display_name
__props__.__dict__["notify"] = notify
__props__.__dict__["owner_id"] = owner_id
__props__.__dict__["primary_key"] = primary_key
if resource_group_name is None and not opts.urn:
raise TypeError("Missing required property 'resource_group_name'")
__props__.__dict__["resource_group_name"] = resource_group_name
if scope is None and not opts.urn:
raise TypeError("Missing required property 'scope'")
__props__.__dict__["scope"] = scope
__props__.__dict__["secondary_key"] = secondary_key
if service_name is None and not opts.urn:
raise TypeError("Missing required property 'service_name'")
__props__.__dict__["service_name"] = service_name
__props__.__dict__["sid"] = sid
__props__.__dict__["state"] = state
__props__.__dict__["created_date"] = None
__props__.__dict__["end_date"] = None
__props__.__dict__["expiration_date"] = None
__props__.__dict__["name"] = None
__props__.__dict__["notification_date"] = None
__props__.__dict__["start_date"] = None
__props__.__dict__["state_comment"] = None
__props__.__dict__["type"] = None
alias_opts = pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="azure-nextgen:apimanagement/v20210101preview:Subscription"), pulumi.Alias(type_="azure-native:apimanagement:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20160707:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20160707:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20161010:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20161010:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20170301:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20170301:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20180101:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20180101:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20180601preview:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20180601preview:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20190101:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20190101:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20191201:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20191201:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20191201preview:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20191201preview:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20200601preview:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20200601preview:Subscription"), pulumi.Alias(type_="azure-native:apimanagement/v20201201:Subscription"), pulumi.Alias(type_="azure-nextgen:apimanagement/v20201201:Subscription")])
opts = pulumi.ResourceOptions.merge(opts, alias_opts)
super(Subscription, __self__).__init__(
'azure-native:apimanagement/v20210101preview:Subscription',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name: str,
id: pulumi.Input[str],
opts: Optional[pulumi.ResourceOptions] = None) -> 'Subscription':
"""
Get an existing Subscription resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions opts: Options for the resource.
"""
opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))
__props__ = SubscriptionArgs.__new__(SubscriptionArgs)
__props__.__dict__["allow_tracing"] = None
__props__.__dict__["created_date"] = None
__props__.__dict__["display_name"] = None
__props__.__dict__["end_date"] = None
__props__.__dict__["expiration_date"] = None
__props__.__dict__["name"] = None
__props__.__dict__["notification_date"] = None
__props__.__dict__["owner_id"] = None
__props__.__dict__["primary_key"] = None
__props__.__dict__["scope"] = None
__props__.__dict__["secondary_key"] = None
__props__.__dict__["start_date"] = None
__props__.__dict__["state"] = None
__props__.__dict__["state_comment"] = None
__props__.__dict__["type"] = None
return Subscription(resource_name, opts=opts, __props__=__props__)
@property
@pulumi.getter(name="allowTracing")
def allow_tracing(self) -> pulumi.Output[Optional[bool]]:
"""
Determines whether tracing is enabled
"""
return pulumi.get(self, "allow_tracing")
@property
@pulumi.getter(name="createdDate")
def created_date(self) -> pulumi.Output[str]:
"""
Subscription creation date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
"""
return pulumi.get(self, "created_date")
@property
@pulumi.getter(name="displayName")
def display_name(self) -> pulumi.Output[Optional[str]]:
"""
The name of the subscription, or null if the subscription has no name.
"""
return pulumi.get(self, "display_name")
@property
@pulumi.getter(name="endDate")
def end_date(self) -> pulumi.Output[Optional[str]]:
"""
Date when subscription was cancelled or expired. The setting is for audit purposes only and the subscription is not automatically cancelled. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
"""
return pulumi.get(self, "end_date")
@property
@pulumi.getter(name="expirationDate")
def expiration_date(self) -> pulumi.Output[Optional[str]]:
"""
Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
"""
return pulumi.get(self, "expiration_date")
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
"""
Resource name.
"""
return pulumi.get(self, "name")
@property
@pulumi.getter(name="notificationDate")
def notification_date(self) -> pulumi.Output[Optional[str]]:
"""
Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
"""
return pulumi.get(self, "notification_date")
@property
@pulumi.getter(name="ownerId")
def owner_id(self) -> pulumi.Output[Optional[str]]:
"""
The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier.
"""
return pulumi.get(self, "owner_id")
@property
@pulumi.getter(name="primaryKey")
def primary_key(self) -> pulumi.Output[Optional[str]]:
"""
Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
"""
return pulumi.get(self, "primary_key")
@property
@pulumi.getter
def scope(self) -> pulumi.Output[str]:
"""
Scope like /products/{productId} or /apis or /apis/{apiId}.
"""
return pulumi.get(self, "scope")
@property
@pulumi.getter(name="secondaryKey")
def secondary_key(self) -> pulumi.Output[Optional[str]]:
"""
Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.
"""
return pulumi.get(self, "secondary_key")
@property
@pulumi.getter(name="startDate")
def start_date(self) -> pulumi.Output[Optional[str]]:
"""
Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.
"""
return pulumi.get(self, "start_date")
@property
@pulumi.getter
def state(self) -> pulumi.Output[str]:
"""
Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated.
"""
return pulumi.get(self, "state")
@property
@pulumi.getter(name="stateComment")
def state_comment(self) -> pulumi.Output[Optional[str]]:
"""
Optional subscription comment added by an administrator when the state is changed to the 'rejected'.
"""
return pulumi.get(self, "state_comment")
@property
@pulumi.getter
def type(self) -> pulumi.Output[str]:
"""
Resource type for API Management resource.
"""
return pulumi.get(self, "type")
| 52.331288 | 1,773 | 0.670379 | 3,051 | 25,590 | 5.412652 | 0.088823 | 0.057951 | 0.055105 | 0.043963 | 0.805498 | 0.728291 | 0.683238 | 0.562674 | 0.544144 | 0.491401 | 0 | 0.009996 | 0.229894 | 25,590 | 488 | 1,774 | 52.438525 | 0.826762 | 0.345955 | 0 | 0.403333 | 1 | 0 | 0.172969 | 0.079259 | 0 | 0 | 0 | 0 | 0 | 1 | 0.15 | false | 0.003333 | 0.02 | 0 | 0.27 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
4092cec0c2caaa4e9122ef5216241908c2c78940 | 263 | py | Python | b0mb3r/services/shopandshow.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | b0mb3r/services/shopandshow.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | b0mb3r/services/shopandshow.py | Superior0/b0mb3r_r | 216b1851303f5101b09457ba31749b63e4d0d5e8 | [
"Apache-2.0"
] | null | null | null | from b0mb3r.services.service import Service
class ShopAndShow(Service):
async def run(self):
await self.post(
"https://shopandshow.ru/sms/password-request/",
data={"phone": "+" + self.formatted_phone, "resend": 0},
)
| 26.3 | 68 | 0.608365 | 29 | 263 | 5.482759 | 0.793103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.015152 | 0.247148 | 263 | 9 | 69 | 29.222222 | 0.787879 | 0 | 0 | 0 | 0 | 0 | 0.212928 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.142857 | 0.142857 | 0 | 0.285714 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
409e87f0c5cfe05a01a29d4a67b6654b8121d6e6 | 169 | py | Python | packages/api/resources/python-templates/code.py | ennovat/bumblebee | 1146657bc848247b27d2f8b7f0c6521652b750ca | [
"Apache-2.0"
] | 19 | 2021-06-17T22:12:16.000Z | 2022-02-25T04:17:22.000Z | packages/api/resources/python-templates/code.py | ennovat/bumblebee | 1146657bc848247b27d2f8b7f0c6521652b750ca | [
"Apache-2.0"
] | 62 | 2021-06-30T20:10:37.000Z | 2022-03-24T18:09:26.000Z | packages/api/resources/python-templates/code.py | ennovat/bumblebee | 1146657bc848247b27d2f8b7f0c6521652b750ca | [
"Apache-2.0"
] | 10 | 2021-06-24T11:25:47.000Z | 2022-02-16T11:34:10.000Z | #{this.measureTime ? this.timeStart : ""}
#{payload}
res = {'result': _output}
#{this.measureTime ? this.timeEnd : ""}
#{this.includeVariables}
#{this.outputJSON("res")} | 28.166667 | 41 | 0.674556 | 17 | 169 | 6.647059 | 0.588235 | 0.265487 | 0.336283 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.094675 | 169 | 6 | 42 | 28.166667 | 0.738562 | 0.792899 | 0 | 0 | 0 | 0 | 0.193548 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 4 |
40b2e56c4374121d99e9c8db39ba9a8f65ab4c0c | 78 | py | Python | projects/09-perso/src/app/header.py | pattypooh/pez-jedha | 9a23b5446158c0f95b05f81ff2ff6629e56b1800 | [
"MIT"
] | null | null | null | projects/09-perso/src/app/header.py | pattypooh/pez-jedha | 9a23b5446158c0f95b05f81ff2ff6629e56b1800 | [
"MIT"
] | null | null | null | projects/09-perso/src/app/header.py | pattypooh/pez-jedha | 9a23b5446158c0f95b05f81ff2ff6629e56b1800 | [
"MIT"
] | null | null | null | import streamlit as st
import pandas as pd
items = pd.read_csv('iteams.csv')
| 15.6 | 33 | 0.75641 | 14 | 78 | 4.142857 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.153846 | 78 | 4 | 34 | 19.5 | 0.878788 | 0 | 0 | 0 | 0 | 0 | 0.128205 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
40b373a0e1d1fe6fdaa70836e76c5117dc1b62b6 | 218 | py | Python | rtmlparse/elements/scoring.py | thusser/rtml-parse | 4266d1223708d6e04d4558c81c49769710520725 | [
"MIT"
] | 1 | 2016-03-11T18:37:29.000Z | 2016-03-11T18:37:29.000Z | rtmlparse/elements/scoring.py | thusser/rtml-parse | 4266d1223708d6e04d4558c81c49769710520725 | [
"MIT"
] | null | null | null | rtmlparse/elements/scoring.py | thusser/rtml-parse | 4266d1223708d6e04d4558c81c49769710520725 | [
"MIT"
] | null | null | null | from lxml import etree
from .baseelement import BaseElement
class Scoring(BaseElement):
def __init__(self, parent, name=None, uid=None):
BaseElement.__init__(self, 'Scoring', parent, name=name, uid=uid)
| 24.222222 | 73 | 0.733945 | 28 | 218 | 5.428571 | 0.5 | 0.105263 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.16055 | 218 | 8 | 74 | 27.25 | 0.830601 | 0 | 0 | 0 | 0 | 0 | 0.03211 | 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 | 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 | 4 |
40cc181f6418d29ffa6c4a4617b59287a5a12691 | 1,155 | py | Python | src/sage/graphs/all.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 5 | 2015-01-04T07:15:06.000Z | 2022-03-04T15:15:18.000Z | src/sage/graphs/all.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | null | null | null | src/sage/graphs/all.py | bopopescu/sage-5 | 9d85b34956ca2edd55af307f99c5d3859acd30bf | [
"BSL-1.0"
] | 10 | 2016-09-28T13:12:40.000Z | 2022-02-12T09:28:34.000Z | from sage.misc.lazy_import import lazy_import
lazy_import("sage.graphs.graph_generators", "graphs")
lazy_import("sage.graphs.digraph_generators", "digraphs")
lazy_import("sage.graphs.hypergraph_generators", "hypergraphs")
from graph_database import GraphDatabase, GenericGraphQuery, GraphQuery
from graph import Graph
from digraph import DiGraph
from hypergraph import Hypergraph
from bipartite_graph import BipartiteGraph
from graph_bundle import GraphBundle
import weakly_chordal
import graph_list as graphs_list
import sage.graphs.generic_graph_pyx
import sage.graphs.generic_graph
import sage.graphs.graph_decompositions
import sage.graphs.graph
import sage.graphs.digraph
lazy_import("sage.graphs", "graph_coloring")
import sage.graphs.graph_decompositions
import sage.graphs.modular_decomposition.modular_decomposition
import sage.graphs.comparability
from sage.graphs.cliquer import *
from graph_database import graph_db_info
lazy_import("sage.graphs.graph_editor", "graph_editor")
import sage.graphs.isgci
from sage.graphs.isgci import graph_classes
import sage.graphs.distances_all_pairs
import sage.graphs.trees
import sage.graphs.graph_latex
| 36.09375 | 71 | 0.85974 | 159 | 1,155 | 6.037736 | 0.264151 | 0.197917 | 0.283333 | 0.153125 | 0.242708 | 0.10625 | 0.10625 | 0.10625 | 0 | 0 | 0 | 0 | 0.072727 | 1,155 | 31 | 72 | 37.258065 | 0.896359 | 0 | 0 | 0.068966 | 0 | 0 | 0.153247 | 0.099567 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 0 | 1 | 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 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
40d317a94455525944c1198712364e2f224eed00 | 114 | py | Python | vmlog/test/data/link.py | belm0/vmprof-server | c26f93b5bfec977da33bc62841251dbb956b7f5a | [
"MIT"
] | 35 | 2015-06-14T06:50:32.000Z | 2022-02-24T22:26:56.000Z | vmlog/test/data/link.py | belm0/vmprof-server | c26f93b5bfec977da33bc62841251dbb956b7f5a | [
"MIT"
] | 31 | 2015-06-25T12:12:35.000Z | 2022-03-17T12:55:30.000Z | vmlog/test/data/link.py | belm0/vmprof-server | c26f93b5bfec977da33bc62841251dbb956b7f5a | [
"MIT"
] | 23 | 2015-08-23T17:17:17.000Z | 2022-03-17T12:56:28.000Z | import math
def g(x):
return math.floor(math.sqrt(x))
def f():
for i in range(10000):
g(i)
f()
| 10.363636 | 35 | 0.54386 | 21 | 114 | 2.952381 | 0.666667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.061728 | 0.289474 | 114 | 10 | 36 | 11.4 | 0.703704 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.142857 | 0.142857 | 0.571429 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
40e3b7ef8145254a873aaed61267ed5e30eb2cd4 | 143 | py | Python | cassie/env/cassie_gymtest.py | WooQi57/cassie-run | 9aac12e3a69a011735540d9f5711b8f06da9af81 | [
"MIT"
] | null | null | null | cassie/env/cassie_gymtest.py | WooQi57/cassie-run | 9aac12e3a69a011735540d9f5711b8f06da9af81 | [
"MIT"
] | null | null | null | cassie/env/cassie_gymtest.py | WooQi57/cassie-run | 9aac12e3a69a011735540d9f5711b8f06da9af81 | [
"MIT"
] | null | null | null | from cassie import CassieEnv
from stable_baselines3.common.env_checker import check_env
cassie = CassieEnv()
check_env(cassie)
print('done')
| 17.875 | 58 | 0.818182 | 20 | 143 | 5.65 | 0.6 | 0.141593 | 0.247788 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007813 | 0.104895 | 143 | 7 | 59 | 20.428571 | 0.875 | 0 | 0 | 0 | 0 | 0 | 0.027972 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.4 | 0 | 0.4 | 0.2 | 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 | 1 | 0 | 0 | 0 | 0 | 4 |
40f2a2a098d60d7e9f77949e0fd7c21709214232 | 3,375 | py | Python | K_Mathematical_Modeling/Section 2/solutionODEsExercise9.py | oercompbiomed/CBM101 | 20010dcb99fbf218c4789eb5918dcff8ceb94898 | [
"MIT"
] | 7 | 2019-07-03T07:41:55.000Z | 2022-02-06T20:25:37.000Z | K_Mathematical_Modeling/Section 2/solutionODEsExercise9.py | oercompbiomed/CBM101 | 20010dcb99fbf218c4789eb5918dcff8ceb94898 | [
"MIT"
] | 9 | 2019-03-14T15:15:09.000Z | 2019-08-01T14:18:21.000Z | K_Mathematical_Modeling/Section 2/solutionODEsExercise9.py | oercompbiomed/CBM101 | 20010dcb99fbf218c4789eb5918dcff8ceb94898 | [
"MIT"
] | 11 | 2019-03-12T10:43:11.000Z | 2021-10-05T12:15:00.000Z | from IPython.display import display, Latex
print("We use the QSSA to compute [SE(t)] as a function of [S(t)]:")
display(Latex('$ [SE(t)]= k_1*E_0*[S(t)]/(k_2+k_3+k_1*[S(t)])$'))
print("Let's make an important point here:")
display(Latex('$ [SE(t)]= [S(t)] * [k_1*E_0/(k_2+k_3+k_1*[S(t)])]$'))
print("In the (frequent) situation where the enzyme is in default compare to the initial substrate pool substrate, for most of the time evolution we have [S(t)]>>E0, and thus k1*[S(t)]>>k1*E_0 and then, obviously, k2+k3+k1*[S(t)]>>k1*E_0. Thus, the fraction in the equation above is always small, maybe with the exception of the very last minute of the reaction where there's almost no free substrate left. ")
print("And therefore, [SE(t)] is always much smaller than [S(t)].")
print("We next use the conservation of total substrate-like pool [S(t)]+[SE(t)]+[P(t)]=S_0 to compute [S(t)] as a function of [P(t)]. Thanks to the default enzyme approximation above, it's easy:")
display(Latex('$ [S(t)]=S_0 -[P(t)]$'))
print("from which we get [SE(t)] as a function of [P(t)]:")
display(Latex('$ [SE(t)]= (S_0 -[P(t)]) * k_1*E_0/(k_2+k_3+k_1*(S_0 -[P(t)]))$'))
print("And finally we can write the ODE for P(t):")
display(Latex('$ d[P]/dt = k_3*(S_0 -[P(t)]) * k_1*E_0/(k_2+k_3+k_1*(S_0 -[P(t)]))$'))
print("Now we need to solve it. First, we remark that using the variable [X(t)]=S_0 -[P(t)] would make things look nicer, on the right and side that is obvious, but also on the left hand side:")
display(Latex('$ d[P]/dt = dS_0/dt-d[X]/dt = 0-d[X]/dt = k_3*[X(t)] * k_1*E_0/(k_2+k_3+k_1*[X(t)])$'))
print("so")
display(Latex('$ d[X]/dt = - k_3*[X(t)] * k_1*E_0/(k_2+k_3+k_1*[X(t)])$'))
print("in which the X and time variables can be separated:")
display(Latex('$ d[X] * (k_2+k_3+k_1*[X])/[X] = - k_3* k_1*E_0*dt$'))
print("To prepare an equation for integration, it is convenient to write it as sum of terms that can be integrated separately:")
display(Latex('$ k_1*d[X]+(k_2+k_3)*d[X]/[X] = - k_3* k_1*E_0*dt$'))
print("And then we can integrate each term between the initial time t=0 where we put only substrate and enzyme in the test tube, and thus there is no product and thus X=S_0, and any time t where X=X(t):")
display(Latex('$ k_1*([X(t)]-S_0)+(k_2+k_3)*\ln ([X(t)]/S_0) = - k_3* k_1*E_0*t$'))
print("in which we can, if we want, put the product concentration [P(t)] back in place of [X(t)] using X(t)=S_0 -[P(t)]:")
display(Latex('$ - k_1*[P(t)]+(k_2+k_3)*\ln (1-[P(t)]/S_0) = - k_3* k_1*E_0*t$'))
print("This equation defines a relationship that implicitly links ´[P] to time and the model parameters. It is, therefore, a solution of the initial ODE problem. Going further and plot the function can be done with an easy computer program.")
print("So we might ask: why doing all this work, while eventually we'll still need a computer? First, often we can proceed until the end and write an explicit solution P(t)=... . And even when we can't like here, such a relationship can be analyzed in a more straightforward way than the initial ODE system, to find the asymptotics, infer how the different parameters affect the solution ... And also, computational solving of this final algebraic equation is much faster, robust and overall more reliable than solving the ODE system computationally from the beginning.")
| 73.369565 | 572 | 0.673185 | 693 | 3,375 | 3.176046 | 0.282828 | 0.018174 | 0.014993 | 0.019991 | 0.190822 | 0.126761 | 0.102226 | 0.084961 | 0.084961 | 0.076329 | 0 | 0.028853 | 0.157926 | 3,375 | 45 | 573 | 75 | 0.74525 | 0 | 0 | 0 | 0 | 0.666667 | 0.874136 | 0.097927 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.074074 | 0 | 0.074074 | 0.555556 | 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 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
40f2e9d9044c170f69b42006bd030926c899b395 | 73 | py | Python | ResponseSelection/__init__.py | fatma-mohamed/professor-3abqarino | 8accc2c690d4fbda36b280d3dc6d697b8048ad13 | [
"Apache-2.0"
] | null | null | null | ResponseSelection/__init__.py | fatma-mohamed/professor-3abqarino | 8accc2c690d4fbda36b280d3dc6d697b8048ad13 | [
"Apache-2.0"
] | null | null | null | ResponseSelection/__init__.py | fatma-mohamed/professor-3abqarino | 8accc2c690d4fbda36b280d3dc6d697b8048ad13 | [
"Apache-2.0"
] | null | null | null | __all__ = ['ResponseSelector','FeatureOneSelector', 'FeatureTwoSelector'] | 73 | 73 | 0.808219 | 4 | 73 | 13.75 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041096 | 73 | 1 | 73 | 73 | 0.785714 | 0 | 0 | 0 | 0 | 0 | 0.702703 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
40f534ce0c38b409f3133b088a6908e235170d71 | 440 | py | Python | INBa/2015/Ermashov_A_V/task_1_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_1_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | INBa/2015/Ermashov_A_V/task_1_5.py | YukkaSarasti/pythonintask | eadf4245abb65f4400a3bae30a4256b4658e009c | [
"Apache-2.0"
] | null | null | null | #Задача №1, Вариант 5
#Напишите программу, которая будет сообщать род деятельности и псевдоним под которым скрывается Анна Андреевна Горенко. После вывода информации программа должна дожидаться пока пользователь нажмет Enter для выхода.
#Ермашов А.В.
#26.04.2016
print("Фредерик Аустерлиц - американский актёр, танцор, хореограф и певец, звезда Голливуда.")
print("Более известен, как Фред Астер.\n\n")
input("Нажмите Enter для выхода.")
| 48.888889 | 214 | 0.793182 | 61 | 440 | 5.754098 | 0.901639 | 0.045584 | 0.079772 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026042 | 0.127273 | 440 | 8 | 215 | 55 | 0.882813 | 0.579545 | 0 | 0 | 0 | 0 | 0.80663 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0.666667 | 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 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 4 |
dc09061545b1ceb3cdc0c9c7b5abc8b879c7d350 | 12,396 | py | Python | tests/commands/delete/test_delete_cmd.py | eriksjolund/scout | b2723735916e0052d4ef092c9de6c2493b932018 | [
"BSD-3-Clause"
] | null | null | null | tests/commands/delete/test_delete_cmd.py | eriksjolund/scout | b2723735916e0052d4ef092c9de6c2493b932018 | [
"BSD-3-Clause"
] | null | null | null | tests/commands/delete/test_delete_cmd.py | eriksjolund/scout | b2723735916e0052d4ef092c9de6c2493b932018 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from pymongo import IndexModel, ASCENDING
from scout.commands import cli
from scout.server.extensions import store
def test_delete_panel_non_existing(empty_mock_app, dummypanel_obj):
"Test the CLI command that deletes a gene panel"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN database with a gene panel
store.panel_collection.insert_one(dummypanel_obj)
## WHEN fetching giving a wrong version
result = runner.invoke(
cli,
[
"delete",
"panel",
"--panel-id",
dummypanel_obj["panel_name"],
"-v",
5.0, # db_panel version is 1.0
],
)
## THEN assert no panel was found
assert "No panels found" in result.output
def test_delete_panel(empty_mock_app, dummypanel_obj):
"Test the CLI command that deletes a gene panel"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN database with a gene panel
store.panel_collection.insert_one(dummypanel_obj)
# Test the CLI by using panel name without version
result = runner.invoke(cli, ["delete", "panel", "--panel-id", dummypanel_obj["panel_name"]])
# Panel should be correctly removed from database
assert "WARNING Deleting panel {}".format(dummypanel_obj["panel_name"]) in result.output
# And no panels ahould be available in database
assert sum(1 for i in store.panel_collection.find()) == 0
def test_delete_index(empty_mock_app):
"Test the CLI command that will drop indexes"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN an adapter with indexes
store.load_indexes()
indexes = list(store.case_collection.list_indexes())
assert len(indexes) > 1
## WHEN removing all indexes using the CLI
result = runner.invoke(cli, ["delete", "index"])
## THEN assert that the function should not exit with error
assert result.exit_code == 0
assert "All indexes deleted" in result.output
## THEN assert all indexes should be gone
indexes = list(store.case_collection.list_indexes())
assert len(indexes) == 1 # _id index is the only index left
def test_delete_nonexisting_user(empty_mock_app, user_obj):
"Test the CLI command that will delete a user"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN there is one user in populated database
store.user_collection.insert_one(user_obj)
assert store.user_collection.find_one()
## WHEN using the CLI command to remove users with a random email
result = runner.invoke(cli, ["delete", "user", "-m", "unknown_email@email.com"])
## THEN function should return error
assert "User unknown_email@email.com could not be found in database" in result.output
def test_delete_user(empty_mock_app, user_obj, case_obj, institute_obj):
"Test the CLI command that will delete a user"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN there is one user in populated database
store.user_collection.insert_one(user_obj)
assert store.user_collection.find_one()
## And the user is an assignee of a case of an institute
store.institute_collection.insert_one(institute_obj)
## And no events in the database
assert store.event_collection.find_one() is None
case_obj["assignees"] = [user_obj["email"]]
store.case_collection.insert_one(case_obj)
assert store.case_collection.find_one({"assignees": {"$in": case_obj["assignees"]}})
## WHEN deleting the user from the CLI
result = runner.invoke(cli, ["delete", "user", "-m", user_obj["email"]])
## THEN the user should be gone
assert result.exit_code == 0
assert store.user_collection.find_one() is None
## The case should not have an assignee
assert store.case_collection.find_one({"assignees": {"$in": case_obj["assignees"]}}) is None
## And a new event for unassigning the user should have been created in event collection
assert store.event_collection.find_one()
def test_delete_genes(empty_mock_app, gene_bulk):
"Test the CLI command that will delete genes"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN an adapter populated with genes
assert store.hgnc_collection.find_one() is None
store.hgnc_collection.insert_many(gene_bulk)
assert store.hgnc_collection.find_one()
## WHEN removing them with CLI command
result = runner.invoke(cli, ["delete", "genes", "-b", "37"])
## THEN should print "Dropping genes" message and drop all genes for build 37
assert result.exit_code == 0
assert "ropping genes collection for build: 37" in result.output
assert store.hgnc_collection.find_one() is None
def test_delete_genes_one_build(empty_mock_app, gene_bulk_all):
"Test the CLI command that will delete genes"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN an adapter populated with genes
assert store.hgnc_collection.find_one() is None
store.hgnc_collection.insert_many(gene_bulk_all)
assert store.hgnc_collection.find_one()
## WHEN removing them with CLI command
result = runner.invoke(cli, ["delete", "genes", "-b", "37"])
## THEN should print "Dropping genes" message and drop all genes for build 37
assert result.exit_code == 0
assert "ropping genes collection for build: 37" in result.output
## THEN the genes from build 37 should be gone
assert store.hgnc_collection.find_one({"build": "37"}) is None
## THEN the genes from build 38 should be left
assert store.hgnc_collection.find_one({"build": "38"})
def test_delete_all_genes_both_builds(empty_mock_app, gene_bulk_all):
"Test the CLI command that will delete genes"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN an adapter populated with genes
assert store.hgnc_collection.find_one() is None
store.hgnc_collection.insert_many(gene_bulk_all)
assert store.hgnc_collection.find_one()
## WHEN removing them with CLI command
result = runner.invoke(cli, ["delete", "genes"])
## THEN should print "Dropping genes" message and drop all genes for build 37
assert result.exit_code == 0
assert "ropping all genes" in result.output
## THEN the genes from build 37 should be gone
assert store.hgnc_collection.find_one() is None
def test_delete_exons_37(empty_mock_app):
"Test the CLI command that will delete exons"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
exon_objs = [
{"_id": "mock_exon_1", "build": "37"},
{"_id": "mock_exon_2", "build": "37"},
{"_id": "mock_exon_3", "build": "38"},
]
## GIVEN a database with some exons
store.exon_collection.insert_many(exon_objs)
assert store.exon_collection.find_one()
## WHEN using the CLI to remove all exons with build == 38
result = runner.invoke(cli, ["delete", "exons", "-b", "38"])
## THEN the command should exit without errors
assert result.exit_code == 0
## THEN there should be no exons with build 38
assert store.exon_collection.find_one({"build": "38"}) is None
## THEN there should be exons left with build 37
assert store.exon_collection.find_one({"build": "37"})
# Use the CLI to remove all exons regardless:
result = runner.invoke(cli, ["delete", "exons"])
# and all exons should be removed
assert result.exit_code == 0
assert sum(1 for i in store.exon_collection.find()) == 0
def test_delete_exons(empty_mock_app):
"Test the CLI command that will delete exons"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
exon_objs = [
{"_id": "mock_exon_1", "build": "37"},
{"_id": "mock_exon_2", "build": "37"},
{"_id": "mock_exon_3", "build": "38"},
]
## GIVEN a database with some exons
store.exon_collection.insert_many(exon_objs)
assert store.exon_collection.find_one()
## WHEN using the CLI to remove all exons
result = runner.invoke(cli, ["delete", "exons"])
## THEN the command should exit without errors
assert result.exit_code == 0
## THEN there should be no exons left
assert store.exon_collection.find_one() is None
def test_delete_case_no_specs(empty_mock_app, case_obj):
"Test the CLI command that will delete a case"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
assert store.case_collection.find_one() is None
## GIVEN a adapter with a case
store.case_collection.insert_one(case_obj)
assert store.case_collection.find_one()
## WHEN deleting case without specifying anything
result = runner.invoke(cli, ["delete", "case"])
## THEN assert corrects information is communicated
assert "Please specify what case to delete" in result.output
## THEN assert the cli exits with error
assert result.exit_code == 1
## THEN assert there is a case left
assert store.case_collection.find_one()
def test_delete_case_wrong_id(empty_mock_app, case_obj):
"Test the CLI command that will delete a case"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN a adapter with a case
store.case_collection.insert_one(case_obj)
assert store.case_collection.find_one()
## WHEN deleting case with non exosting id
result = runner.invoke(cli, ["delete", "case", "-i", case_obj["owner"], "-c", "unknown_id"])
## THEN assert the correct information is communicated
assert "Coudn't find any case in database matching the provided parameters" in result.output
## THEN assert the cli exits with error
assert result.exit_code == 1
## THEN assert there is a case left
assert store.case_collection.find_one()
def test_delete_case(empty_mock_app, case_obj):
"Test the CLI command that will delete a case"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN a adapter with a case
store.case_collection.insert_one(case_obj)
assert store.case_collection.find_one()
## WHEN deleting the case
result = runner.invoke(cli, ["delete", "case", "-c", case_obj["_id"]])
## THEN assert it exits without problems
assert result.exit_code == 0
## THEN assert the case is gone
assert store.case_collection.find_one() is None
def test_delete_case_no_institute(empty_mock_app, case_obj):
"Test the CLI command that will delete a case"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN a adapter with a case
store.case_collection.insert_one(case_obj)
assert store.case_collection.find_one()
## WHEN providing the right display_name but not institute
result = runner.invoke(cli, ["delete", "case", "-d", case_obj["display_name"]])
## THEN assert it exots with error
assert result.exit_code == 1
## THEN assert the correct information is communicated
assert "Please specify the owner of the case that should be deleted" in result.output
# Provide right display_name and right institute
result = runner.invoke(
cli, ["delete", "case", "-d", case_obj["display_name"], "-i", case_obj["owner"]]
)
# and the case should have been removed again
assert result.exit_code == 0
assert sum(1 for i in store.case_collection.find()) == 0
def test_delete_case_correct_institute(empty_mock_app, case_obj):
"Test the CLI command that will delete a case"
mock_app = empty_mock_app
runner = mock_app.test_cli_runner()
assert runner
## GIVEN a adapter with a case
store.case_collection.insert_one(case_obj)
assert store.case_collection.find_one()
## WHEN providing the right display_name and institute
result = runner.invoke(
cli, ["delete", "case", "-d", case_obj["display_name"], "-i", case_obj["owner"]]
)
## THEN assert case should have been removed
assert store.case_collection.find_one() is None
## THEN assert the CLI exits without problems
assert result.exit_code == 0
| 33.776567 | 96 | 0.701839 | 1,816 | 12,396 | 4.587555 | 0.098568 | 0.050414 | 0.065298 | 0.042852 | 0.804465 | 0.78514 | 0.708798 | 0.67819 | 0.646381 | 0.637138 | 0 | 0.00843 | 0.205712 | 12,396 | 366 | 97 | 33.868852 | 0.837701 | 0.291304 | 0 | 0.65 | 0 | 0 | 0.170813 | 0.004932 | 0 | 0 | 0 | 0 | 0.38 | 1 | 0.075 | false | 0 | 0.015 | 0 | 0.09 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
dc0cc5407c6f5e618e1f74cc2c7540c3d412e399 | 24 | py | Python | pagedown/__init__.py | s-block/django-pagedown | 4f7ed4a8897a870adde5077e9cc5b21a13d951b7 | [
"BSD-3-Clause"
] | 1 | 2015-04-27T16:56:02.000Z | 2015-04-27T16:56:02.000Z | pagedown/__init__.py | sai-prasanna/django-pagedown | f685a95c7340952e20c71f61ad3a4690e983fff6 | [
"BSD-3-Clause"
] | null | null | null | pagedown/__init__.py | sai-prasanna/django-pagedown | f685a95c7340952e20c71f61ad3a4690e983fff6 | [
"BSD-3-Clause"
] | 1 | 2021-04-11T07:02:04.000Z | 2021-04-11T07:02:04.000Z | VERSION = ('0','1','0')
| 12 | 23 | 0.416667 | 4 | 24 | 2.5 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0.125 | 24 | 1 | 24 | 24 | 0.333333 | 0 | 0 | 0 | 0 | 0 | 0.125 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
9075b46c1ba6691a35cf2ad0bd8d65ee51d7d318 | 106 | py | Python | configure/DNN/mrcg/config.py | MeitalRann/Feature-and-Arcitecture-Study-for-Speech-Activity-Detection | 1f37d2090c41081ccedc0dd1fa0d1721b026b396 | [
"MIT"
] | 1 | 2021-01-13T00:09:02.000Z | 2021-01-13T00:09:02.000Z | configure/DNN/mrcg/config.py | MeitalRann/Feature-and-Arcitecture-Study-for-Speech-Activity-Detection | 1f37d2090c41081ccedc0dd1fa0d1721b026b396 | [
"MIT"
] | null | null | null | configure/DNN/mrcg/config.py | MeitalRann/Feature-and-Arcitecture-Study-for-Speech-Activity-Detection | 1f37d2090c41081ccedc0dd1fa0d1721b026b396 | [
"MIT"
] | null | null | null | lr=0.0001
dropout_rate=0.5
max_epoch=850 #3317
batch_size=4096
w=19
u=9
num_hidden_1=512
num_hidden_2=512
| 11.777778 | 19 | 0.811321 | 26 | 106 | 3.038462 | 0.846154 | 0.227848 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.298969 | 0.084906 | 106 | 8 | 20 | 13.25 | 0.515464 | 0.037736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
90d671dc0a44707219e06cf403bbdaf5b149f61f | 264 | py | Python | ai_based/utilities/mixins.py | robvoe/apnoe-detection | f60f6850f5c4296a89299d6b74a15c7faf7bbcf2 | [
"MIT"
] | 2 | 2021-08-17T11:58:15.000Z | 2022-02-04T14:15:34.000Z | ai_based/utilities/mixins.py | robvoe/apnoe-detection | f60f6850f5c4296a89299d6b74a15c7faf7bbcf2 | [
"MIT"
] | null | null | null | ai_based/utilities/mixins.py | robvoe/apnoe-detection | f60f6850f5c4296a89299d6b74a15c7faf7bbcf2 | [
"MIT"
] | null | null | null | class DictLike:
"""This class makes any inheritor's members accessible via dictionary-like [] accesses."""
def __setitem__(self, key, value):
self.__setattr__(key, value)
def __getitem__(self, item):
return self.__getattribute__(item)
| 33 | 94 | 0.693182 | 31 | 264 | 5.387097 | 0.741935 | 0.095808 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.200758 | 264 | 7 | 95 | 37.714286 | 0.791469 | 0.318182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.4 | false | 0 | 0 | 0.2 | 0.8 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
90e07e7c08f3428941e3915d2199f48dba41601b | 3,227 | py | Python | clueless/server/errors.py | arthurtucker/Clue-Less | cf082f5c3b1baf2e93a94984100b6ca58e761383 | [
"Apache-2.0"
] | 4 | 2016-09-21T04:59:05.000Z | 2020-09-23T03:12:52.000Z | clueless/server/errors.py | arthurtucker/Clue-Less | cf082f5c3b1baf2e93a94984100b6ca58e761383 | [
"Apache-2.0"
] | null | null | null | clueless/server/errors.py | arthurtucker/Clue-Less | cf082f5c3b1baf2e93a94984100b6ca58e761383 | [
"Apache-2.0"
] | 1 | 2020-04-01T23:27:44.000Z | 2020-04-01T23:27:44.000Z |
class GameEngineException(Exception):
pass
class PlayerInvalidException(GameEngineException):
def __init__(self):
msg = "Player specified does not exist"
super(PlayerInvalidException, self).__init__(msg)
class PlayerOperationOutOfTurnException(GameEngineException):
def __init__(self):
msg = "Player operation attempted out of turn"
super(PlayerOperationOutOfTurnException, self).__init__(msg)
class TurnStatusException(GameEngineException):
def __init__(self, msg):
super(TurnStatusException, self).__init__(msg)
class PlayerInvalidSuspectException(GameEngineException):
def __init__(self):
msg = "Player does not own this supsect"
super(PlayerInvalidSuspectException, self).__init__(msg)
class GameSpaceInvalidException(GameEngineException):
def __init__(self):
msg = "GameSpace specified does not exist"
super(GameSpaceInvalidException, self).__init__(msg)
class GameSpaceUnavilableException(GameEngineException):
def __init__(self):
msg = "GameSpace specified is occupied or unavailable for move"
super(GameSpaceUnavilableException, self).__init__(msg)
class GameSpaceNotConnectedException(GameEngineException):
def __init__(self):
msg = "Space specified is not adjacent to the player's current space"
super(GameSpaceNotConnectedException, self).__init__(msg)
class SuspectInvalidException(GameEngineException):
def __init__(self):
msg = "Invalid Suspect"
super(SuspectInvalidException, self).__init__(msg)
class WeaponInvalidException(GameEngineException):
def __init__(self):
msg = "Invalid Weapon"
super(WeaponInvalidException, self).__init__(msg)
class RoomInvalidException(GameEngineException):
def __init__(self):
msg = "Invalid Room"
super(RoomInvalidException, self).__init__(msg)
class SuggestionTurnStatusException(GameEngineException):
def __init__(self):
msg = "Suggestion can not be made when awaiting a move or accusation"
super(SuggestionTurnStatusException, self).__init__(msg)
class SuggestionInvalidRoomException(GameEngineException):
def __init__(self):
msg = "Suggestion invalid, player must be in room used in suggestion"
super(SuggestionInvalidRoomException, self).__init__(msg)
class SuggestionResponsePlayerInvalidException(GameEngineException):
def __init__(self):
msg = "Invalid, not the correct player to respond to suggestion"
super(SuggestionResponsePlayerInvalidException, self).__init__(msg)
class GameCardItemInvalidException(GameEngineException):
def __init__(self):
msg = "Item is not a valid GameCard item"
super(GameCardItemInvalidException, self).__init__(msg)
class PlayerInvalidGameCardException(GameEngineException):
def __init__(self):
msg = "Player does not own the game_card provided in request"
super(PlayerInvalidGameCardException, self).__init__(msg)
class EndTurnStatusException(GameEngineException):
def __init__(self):
msg = "Player can not end_turn, awaiting other action"
super(EndTurnStatusException, self).__init__(msg)
| 32.27 | 77 | 0.744654 | 298 | 3,227 | 7.627517 | 0.261745 | 0.154861 | 0.183018 | 0.211175 | 0.310163 | 0.24769 | 0.087989 | 0.043115 | 0.043115 | 0 | 0 | 0 | 0.179424 | 3,227 | 99 | 78 | 32.59596 | 0.858384 | 0 | 0 | 0.230769 | 0 | 0 | 0.186667 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.246154 | false | 0.015385 | 0 | 0 | 0.507692 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
90f34c8439bfc1458ba6e70f0644da168d6beb5c | 100 | py | Python | topCoder/srms/600s/srm624/div2/cost_of_dancing.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 25 | 2015-01-21T16:39:18.000Z | 2021-05-24T07:01:24.000Z | topCoder/srms/600s/srm624/div2/cost_of_dancing.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 2 | 2020-09-30T19:39:36.000Z | 2020-10-01T17:15:16.000Z | topCoder/srms/600s/srm624/div2/cost_of_dancing.py | ferhatelmas/algo | a7149c7a605708bc01a5cd30bf5455644cefd04d | [
"WTFPL"
] | 15 | 2015-01-21T16:39:27.000Z | 2020-10-01T17:00:22.000Z | class CostOfDancing:
def minimum(self, K, danceCost):
return sum(sorted(danceCost)[:K])
| 25 | 41 | 0.67 | 12 | 100 | 5.583333 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 100 | 3 | 42 | 33.333333 | 0.8375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0.333333 | 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 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 4 |
90fbcd6005b68185d4b34be7ed1aeb7f1d17799d | 221 | py | Python | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/67. maximum value in a dictionary.py | jaswinder9051998/Resources | fd468af37bf24ca57555d153ee64693c018e822e | [
"MIT"
] | 101 | 2021-12-20T11:57:11.000Z | 2022-03-23T09:49:13.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/67. maximum value in a dictionary.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 4 | 2022-01-12T11:55:56.000Z | 2022-02-12T04:53:33.000Z | Programming Languages/Python/Theory/100_Python_Challenges/Section_4_Dictionary/67. maximum value in a dictionary.py | Sid-1164/Resources | 3987dcaeddc8825f9bc79609ff26094282b8ece1 | [
"MIT"
] | 38 | 2022-01-12T11:56:16.000Z | 2022-03-23T10:07:52.000Z | """
Write a Python function that returns the maximum value in a dictionary.
input_dict = {1:1, 2:4, 3:9, 4:16, 5:25}
"""
#Solution is:
def max_value(input_dict):
return max(input_dict.values())
| 14.733333 | 71 | 0.624434 | 36 | 221 | 3.722222 | 0.75 | 0.201493 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.071856 | 0.244344 | 221 | 14 | 72 | 15.785714 | 0.730539 | 0.570136 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0.5 | 1 | 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 | 1 | 0 | 0 | 4 |
90fdbaa9f100d5c878fb066bf6c6b2c1673a9c25 | 24 | py | Python | .vscode/extensions/batisteo.vscode-django-1.3.0/.venv/lib/python3.9/site-packages/poetry/core/_vendor/_pyrsistent_version.py | cclint/dotfiles | 8dbd1b768add3fdb68e749f965ef3025ee9de4ed | [
"MIT"
] | 1 | 2020-08-07T16:09:57.000Z | 2020-08-07T16:09:57.000Z | .vscode/extensions/batisteo.vscode-django-1.3.0/.venv/lib/python3.9/site-packages/poetry/core/_vendor/_pyrsistent_version.py | cclint/dotfiles | 8dbd1b768add3fdb68e749f965ef3025ee9de4ed | [
"MIT"
] | null | null | null | .vscode/extensions/batisteo.vscode-django-1.3.0/.venv/lib/python3.9/site-packages/poetry/core/_vendor/_pyrsistent_version.py | cclint/dotfiles | 8dbd1b768add3fdb68e749f965ef3025ee9de4ed | [
"MIT"
] | null | null | null | __version__ = '0.16.0'
| 12 | 23 | 0.625 | 4 | 24 | 2.75 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.2 | 0.166667 | 24 | 1 | 24 | 24 | 0.35 | 0 | 0 | 0 | 0 | 0 | 0.26087 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
2902addca0c80049535fb5d367c4b31209b46992 | 12,696 | py | Python | tests/components/rest/test_init.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | tests/components/rest/test_init.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | tests/components/rest/test_init.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Tests for rest component."""
import asyncio
from datetime import timedelta
from os import path
from unittest.mock import patch
import respx
from homeassistant import config as hass_config
from homeassistant.components.rest.const import DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
DATA_MEGABYTES,
SERVICE_RELOAD,
STATE_UNAVAILABLE,
)
from homeassistant.setup import async_setup_component
from homeassistant.util.dt import utcnow
from tests.common import async_fire_time_changed
@respx.mock
async def test_setup_with_endpoint_timeout_with_recovery(hass):
"""Test setup with an endpoint that times out that recovers."""
await async_setup_component(hass, "homeassistant", {})
respx.get("http://localhost").mock(side_effect=asyncio.TimeoutError())
assert await async_setup_component(
hass,
DOMAIN,
{
DOMAIN: [
{
"resource": "http://localhost",
"method": "GET",
"verify_ssl": "false",
"timeout": 30,
"sensor": [
{
"unit_of_measurement": DATA_MEGABYTES,
"name": "sensor1",
"value_template": "{{ value_json.sensor1 }}",
},
{
"unit_of_measurement": DATA_MEGABYTES,
"name": "sensor2",
"value_template": "{{ value_json.sensor2 }}",
},
],
"binary_sensor": [
{
"name": "binary_sensor1",
"value_template": "{{ value_json.binary_sensor1 }}",
},
{
"name": "binary_sensor2",
"value_template": "{{ value_json.binary_sensor2 }}",
},
],
}
]
},
)
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 0
respx.get("http://localhost").respond(
status_code=200,
json={
"sensor1": "1",
"sensor2": "2",
"binary_sensor1": "on",
"binary_sensor2": "off",
},
)
# Refresh the coordinator
async_fire_time_changed(hass, utcnow() + timedelta(seconds=31))
await hass.async_block_till_done()
# Wait for platform setup retry
async_fire_time_changed(hass, utcnow() + timedelta(seconds=61))
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 4
assert hass.states.get("sensor.sensor1").state == "1"
assert hass.states.get("sensor.sensor2").state == "2"
assert hass.states.get("binary_sensor.binary_sensor1").state == "on"
assert hass.states.get("binary_sensor.binary_sensor2").state == "off"
# Now the end point flakes out again
respx.get("http://localhost").mock(side_effect=asyncio.TimeoutError())
# Refresh the coordinator
async_fire_time_changed(hass, utcnow() + timedelta(seconds=31))
await hass.async_block_till_done()
assert hass.states.get("sensor.sensor1").state == STATE_UNAVAILABLE
assert hass.states.get("sensor.sensor2").state == STATE_UNAVAILABLE
assert hass.states.get("binary_sensor.binary_sensor1").state == STATE_UNAVAILABLE
assert hass.states.get("binary_sensor.binary_sensor2").state == STATE_UNAVAILABLE
# We request a manual refresh when the
# endpoint is working again
respx.get("http://localhost").respond(
status_code=200,
json={
"sensor1": "1",
"sensor2": "2",
"binary_sensor1": "on",
"binary_sensor2": "off",
},
)
await hass.services.async_call(
"homeassistant",
"update_entity",
{ATTR_ENTITY_ID: ["sensor.sensor1"]},
blocking=True,
)
assert hass.states.get("sensor.sensor1").state == "1"
assert hass.states.get("sensor.sensor2").state == "2"
assert hass.states.get("binary_sensor.binary_sensor1").state == "on"
assert hass.states.get("binary_sensor.binary_sensor2").state == "off"
@respx.mock
async def test_setup_minimum_resource_template(hass):
"""Test setup with minimum configuration (resource_template)."""
respx.get("http://localhost").respond(
status_code=200,
json={
"sensor1": "1",
"sensor2": "2",
"binary_sensor1": "on",
"binary_sensor2": "off",
},
)
assert await async_setup_component(
hass,
DOMAIN,
{
DOMAIN: [
{
"resource_template": "{% set url = 'http://localhost' %}{{ url }}",
"method": "GET",
"verify_ssl": "false",
"timeout": 30,
"sensor": [
{
"unit_of_measurement": DATA_MEGABYTES,
"name": "sensor1",
"value_template": "{{ value_json.sensor1 }}",
},
{
"unit_of_measurement": DATA_MEGABYTES,
"name": "sensor2",
"value_template": "{{ value_json.sensor2 }}",
},
],
"binary_sensor": [
{
"name": "binary_sensor1",
"value_template": "{{ value_json.binary_sensor1 }}",
},
{
"name": "binary_sensor2",
"value_template": "{{ value_json.binary_sensor2 }}",
},
],
}
]
},
)
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 4
assert hass.states.get("sensor.sensor1").state == "1"
assert hass.states.get("sensor.sensor2").state == "2"
assert hass.states.get("binary_sensor.binary_sensor1").state == "on"
assert hass.states.get("binary_sensor.binary_sensor2").state == "off"
@respx.mock
async def test_reload(hass):
"""Verify we can reload."""
respx.get("http://localhost") % 200
assert await async_setup_component(
hass,
DOMAIN,
{
DOMAIN: [
{
"resource": "http://localhost",
"method": "GET",
"verify_ssl": "false",
"timeout": 30,
"sensor": [
{
"name": "mockrest",
},
],
}
]
},
)
await hass.async_block_till_done()
await hass.async_start()
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 1
assert hass.states.get("sensor.mockrest")
yaml_path = path.join(
_get_fixtures_base_path(),
"fixtures",
"rest/configuration_top_level.yaml",
)
with patch.object(hass_config, "YAML_CONFIG_FILE", yaml_path):
await hass.services.async_call(
"rest",
SERVICE_RELOAD,
{},
blocking=True,
)
await hass.async_block_till_done()
assert hass.states.get("sensor.mockreset") is None
assert hass.states.get("sensor.rollout")
assert hass.states.get("sensor.fallover")
@respx.mock
async def test_reload_and_remove_all(hass):
"""Verify we can reload and remove all."""
respx.get("http://localhost") % 200
assert await async_setup_component(
hass,
DOMAIN,
{
DOMAIN: [
{
"resource": "http://localhost",
"method": "GET",
"verify_ssl": "false",
"timeout": 30,
"sensor": [
{
"name": "mockrest",
},
],
}
]
},
)
await hass.async_block_till_done()
await hass.async_start()
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 1
assert hass.states.get("sensor.mockrest")
yaml_path = path.join(
_get_fixtures_base_path(),
"fixtures",
"rest/configuration_empty.yaml",
)
with patch.object(hass_config, "YAML_CONFIG_FILE", yaml_path):
await hass.services.async_call(
"rest",
SERVICE_RELOAD,
{},
blocking=True,
)
await hass.async_block_till_done()
assert hass.states.get("sensor.mockreset") is None
@respx.mock
async def test_reload_fails_to_read_configuration(hass):
"""Verify reload when configuration is missing or broken."""
respx.get("http://localhost") % 200
assert await async_setup_component(
hass,
DOMAIN,
{
DOMAIN: [
{
"resource": "http://localhost",
"method": "GET",
"verify_ssl": "false",
"timeout": 30,
"sensor": [
{
"name": "mockrest",
},
],
}
]
},
)
await hass.async_block_till_done()
await hass.async_start()
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 1
yaml_path = path.join(
_get_fixtures_base_path(),
"fixtures",
"rest/configuration_invalid.notyaml",
)
with patch.object(hass_config, "YAML_CONFIG_FILE", yaml_path):
await hass.services.async_call(
"rest",
SERVICE_RELOAD,
{},
blocking=True,
)
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 1
def _get_fixtures_base_path():
return path.dirname(path.dirname(path.dirname(__file__)))
@respx.mock
async def test_multiple_rest_endpoints(hass):
"""Test multiple rest endpoints."""
respx.get("http://date.jsontest.com").respond(
status_code=200,
json={
"date": "03-17-2021",
"milliseconds_since_epoch": 1616008268573,
"time": "07:11:08 PM",
},
)
respx.get("http://time.jsontest.com").respond(
status_code=200,
json={
"date": "03-17-2021",
"milliseconds_since_epoch": 1616008299665,
"time": "07:11:39 PM",
},
)
respx.get("http://localhost").respond(
status_code=200,
json={
"value": "1",
},
)
assert await async_setup_component(
hass,
DOMAIN,
{
DOMAIN: [
{
"resource": "http://date.jsontest.com",
"sensor": [
{
"name": "JSON Date",
"value_template": "{{ value_json.date }}",
},
{
"name": "JSON Date Time",
"value_template": "{{ value_json.time }}",
},
],
},
{
"resource": "http://time.jsontest.com",
"sensor": [
{
"name": "JSON Time",
"value_template": "{{ value_json.time }}",
},
],
},
{
"resource": "http://localhost",
"binary_sensor": [
{
"name": "Binary Sensor",
"value_template": "{{ value_json.value }}",
},
],
},
]
},
)
await hass.async_block_till_done()
assert len(hass.states.async_all()) == 4
assert hass.states.get("sensor.json_date").state == "03-17-2021"
assert hass.states.get("sensor.json_date_time").state == "07:11:08 PM"
assert hass.states.get("sensor.json_time").state == "07:11:39 PM"
assert hass.states.get("binary_sensor.binary_sensor").state == "on"
| 30.519231 | 87 | 0.48535 | 1,150 | 12,696 | 5.132174 | 0.146087 | 0.057608 | 0.070485 | 0.0837 | 0.779905 | 0.740766 | 0.720434 | 0.705015 | 0.675025 | 0.636733 | 0 | 0.023742 | 0.39288 | 12,696 | 415 | 88 | 30.592771 | 0.741956 | 0.015911 | 0 | 0.58 | 0 | 0 | 0.204068 | 0.042323 | 0 | 0 | 0 | 0 | 0.114286 | 1 | 0.002857 | false | 0 | 0.031429 | 0.002857 | 0.037143 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 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 | 4 |
2910a8fafb21b2112307f20a42fc9d20814d084b | 31 | py | Python | pymavlink-2.3.8/generator/__init__.py | NicEscobar/InertialNavigation | 85dffed6cf5c4063a097c3c9305f4ec92ce53623 | [
"MIT"
] | 24 | 2019-08-13T02:39:01.000Z | 2022-03-03T15:44:54.000Z | pymavlink-2.3.8/generator/__init__.py | NicEscobar/InertialNavigation | 85dffed6cf5c4063a097c3c9305f4ec92ce53623 | [
"MIT"
] | 4 | 2020-11-16T02:03:09.000Z | 2021-08-19T08:16:48.000Z | pymavlink-2.3.8/generator/__init__.py | NicEscobar/InertialNavigation | 85dffed6cf5c4063a097c3c9305f4ec92ce53623 | [
"MIT"
] | 11 | 2019-07-28T09:11:40.000Z | 2022-03-17T08:08:27.000Z | '''pymavlink code generator'''
| 15.5 | 30 | 0.709677 | 3 | 31 | 7.333333 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096774 | 31 | 1 | 31 | 31 | 0.785714 | 0.774194 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
29166d4e9b089f26433cdfb97e063cbdf34b964f | 146 | py | Python | ex3.py | welykPereira/cursoemvideo | 53bdd538270714f944de5b480e1d5ca51a16ff51 | [
"MIT"
] | null | null | null | ex3.py | welykPereira/cursoemvideo | 53bdd538270714f944de5b480e1d5ca51a16ff51 | [
"MIT"
] | null | null | null | ex3.py | welykPereira/cursoemvideo | 53bdd538270714f944de5b480e1d5ca51a16ff51 | [
"MIT"
] | null | null | null | n1 = int(input('Digite um valor '))
n2 = int(input('Digite um outro valor '))
s = n1 + n2
print('A soma de {} com {} e de {} '.format(n1, n2, s))
| 29.2 | 55 | 0.582192 | 27 | 146 | 3.148148 | 0.592593 | 0.188235 | 0.329412 | 0.376471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.051724 | 0.205479 | 146 | 4 | 56 | 36.5 | 0.681034 | 0 | 0 | 0 | 0 | 0 | 0.452055 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
2957578f7aabb476c43ead884b963a0868fb0cf8 | 132 | py | Python | 5 kyu/Extract the domain name from a URL.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 6 | 2020-09-03T09:32:25.000Z | 2020-12-07T04:10:01.000Z | 5 kyu/Extract the domain name from a URL.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | 1 | 2021-12-13T15:30:21.000Z | 2021-12-13T15:30:21.000Z | 5 kyu/Extract the domain name from a URL.py | mwk0408/codewars_solutions | 9b4f502b5f159e68024d494e19a96a226acad5e5 | [
"MIT"
] | null | null | null | def domain_name(url):
url=url.replace("http://", "").replace("https://", "").replace("www.", "")
return url[:url.index(".")] | 44 | 78 | 0.55303 | 16 | 132 | 4.5 | 0.625 | 0.25 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113636 | 132 | 3 | 79 | 44 | 0.615385 | 0 | 0 | 0 | 0 | 0 | 0.150376 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | false | 0 | 0 | 0 | 0.666667 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
295ecf08505c9f07eff56159cf71c2e8803298a5 | 303 | py | Python | source/tests/test_fitschan.py | demitri/cornish | b1f37feac38edaab5543bcb8ccbd0aa26b87456d | [
"MIT"
] | 1 | 2020-11-10T18:59:00.000Z | 2020-11-10T18:59:00.000Z | source/tests/test_fitschan.py | demitri/cornish | b1f37feac38edaab5543bcb8ccbd0aa26b87456d | [
"MIT"
] | 2 | 2020-08-03T22:52:46.000Z | 2020-08-13T19:09:48.000Z | source/tests/test_fitschan.py | demitri/cornish | b1f37feac38edaab5543bcb8ccbd0aa26b87456d | [
"MIT"
] | 1 | 2020-02-23T19:17:20.000Z | 2020-02-23T19:17:20.000Z |
import pytest
import fitsio
import astropy
from cornish import ASTFITSChannel
def test_read_fits_header_astropy():
'''
'''
#astropy.io.fits.open(...
#channel = ASTFITSChannel(header=...)
def test_read_fits_header_fitsio():
'''
'''
#fitsio.open(...
#channel = ASTFITSChannel(header=...)
| 13.772727 | 38 | 0.69967 | 34 | 303 | 6 | 0.441176 | 0.068627 | 0.107843 | 0.147059 | 0.205882 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.141914 | 303 | 21 | 39 | 14.428571 | 0.784615 | 0.366337 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.333333 | true | 0 | 0.666667 | 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 | 1 | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
296d6ab0d1d3f6417c7a6e96de1273e04f331ff5 | 2,522 | py | Python | toppy/topgg/bot.py | chawkk6404/top_gg | 59b0d2a812c99921accf9b8a7296ccc2545c0d41 | [
"MIT"
] | 1 | 2022-03-08T00:10:16.000Z | 2022-03-08T00:10:16.000Z | toppy/topgg/bot.py | chawkk6404/top_gg | 59b0d2a812c99921accf9b8a7296ccc2545c0d41 | [
"MIT"
] | null | null | null | toppy/topgg/bot.py | chawkk6404/top_gg | 59b0d2a812c99921accf9b8a7296ccc2545c0d41 | [
"MIT"
] | null | null | null | from __future__ import annotations
from functools import cached_property
from typing import Optional
from datetime import datetime
__all__ = (
'Bot'
)
class Bot:
"""
A class that represents a bot on Top.gg, not on discord.
It will be initialized automatically. Not manually.
"""
def __init__(self, data: dict) -> None:
self._data = data
@cached_property
def id(self) -> int:
return int(self._data['id'])
@cached_property
def name(self) -> str:
return self._data['username']
@cached_property
def discriminator(self) -> int:
return int(self._data['discriminator'])
@cached_property
def avatar(self) -> str:
return self._data.get('avatar') or self._data['defAvatar']
@cached_property
def prefix(self) -> str:
return self._data['prefix']
@cached_property
def short_description(self) -> str:
return self._data['shortdesc']
@cached_property
def long_description(self) -> str:
return self._data['longdesc']
@cached_property
def tags(self) -> list[str]:
return self._data['tags']
@cached_property
def website(self) -> Optional[str]:
return self._data.get('website')
@cached_property
def support(self) -> Optional[str]:
return self._data.get('support')
@cached_property
def github(self) -> Optional[str]:
return self._data.get('github')
@cached_property
def owners(self) -> list[int]:
return [int(owner) for owner in self._data['owners']]
@cached_property
def featured_guilds(self) -> list[int]:
return [int(guild) for guild in self._data['guilds']]
@cached_property
def invite(self) -> Optional[str]:
return self._data.get('invite')
@cached_property
def date(self) -> datetime:
return datetime.fromisoformat(self._data['date'])
@cached_property
def server_count(self) -> Optional[int]:
return self._data.get('server_count')
@cached_property
def shard_count(self) -> Optional[int]:
return self._data.get('shard_count')
@cached_property
def certified(self) -> bool:
return self._data['certifiedBot']
@cached_property
def vanity(self) -> Optional[str]:
return self._data['vanity']
@cached_property
def upvotes(self) -> int:
return self._data['points']
@cached_property
def monthly_upvotes(self) -> int:
return self._data['monthlyPoints']
| 24.019048 | 66 | 0.639968 | 302 | 2,522 | 5.129139 | 0.251656 | 0.123951 | 0.230471 | 0.120723 | 0.326017 | 0.257586 | 0.130407 | 0.047773 | 0 | 0 | 0 | 0 | 0.239492 | 2,522 | 104 | 67 | 24.25 | 0.807612 | 0.042823 | 0 | 0.287671 | 0 | 0 | 0.071011 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.30137 | false | 0 | 0.054795 | 0.287671 | 0.657534 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 4 |
297691e40271ff08b4435f531e7b1b2c181cfad3 | 147 | py | Python | encrypt.py | boopo/newCumtLogin | e873409c20eaae702e7f49c629521e3324a40613 | [
"Apache-2.0"
] | 4 | 2020-12-16T14:23:32.000Z | 2021-04-10T08:52:56.000Z | encrypt.py | boopo/NewCumtLogin | e873409c20eaae702e7f49c629521e3324a40613 | [
"Apache-2.0"
] | null | null | null | encrypt.py | boopo/NewCumtLogin | e873409c20eaae702e7f49c629521e3324a40613 | [
"Apache-2.0"
] | 1 | 2022-03-24T08:19:35.000Z | 2022-03-24T08:19:35.000Z | import execjs
def get_token(pwd, salt):
Passwd = execjs.compile(open(r"aes.js").read()).call('encryptPassword', pwd, salt)
return Passwd
| 21 | 86 | 0.693878 | 21 | 147 | 4.809524 | 0.809524 | 0.138614 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.14966 | 147 | 6 | 87 | 24.5 | 0.808 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0.5 | 0.25 | 0 | 0.75 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 4 |
297f3c9ac97df2295bdd0c8bed7733bd9d2f64c6 | 345 | py | Python | keras_adversarial/backend/__init__.py | BenStriner/unrolled_gan | 6651cfad771f72521c78a5cc3a23a2313efeaa88 | [
"MIT"
] | 914 | 2017-01-21T03:07:33.000Z | 2022-02-18T10:31:51.000Z | keras_adversarial/backend/__init__.py | tungsomot/keras-adversarial | 6651cfad771f72521c78a5cc3a23a2313efeaa88 | [
"MIT"
] | 64 | 2017-01-30T11:19:47.000Z | 2020-09-07T12:17:58.000Z | keras_adversarial/backend/__init__.py | tungsomot/keras-adversarial | 6651cfad771f72521c78a5cc3a23a2313efeaa88 | [
"MIT"
] | 268 | 2017-01-22T13:41:22.000Z | 2022-03-30T00:59:52.000Z | import keras.backend as K
if K.backend() == "tensorflow":
from .tensorflow_backend import unpack_assignment, clone_replace, map_params, variable_key
else:
from .theano_backend import unpack_assignment, clone_replace, map_params, variable_key
def unpack_assignments(assignments):
return [unpack_assignment(a) for a in assignments]
| 31.363636 | 94 | 0.794203 | 46 | 345 | 5.695652 | 0.521739 | 0.183206 | 0.145038 | 0.221374 | 0.465649 | 0.465649 | 0.465649 | 0.465649 | 0.465649 | 0.465649 | 0 | 0 | 0.133333 | 345 | 10 | 95 | 34.5 | 0.876254 | 0 | 0 | 0 | 0 | 0 | 0.028986 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.142857 | false | 0 | 0.428571 | 0.142857 | 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 | 1 | 1 | 0 | 0 | 4 |
4625ebcf012b0fbb084afcdd2e3a9ef5e6d0e471 | 90 | py | Python | listen1/logconfig/__init__.py | xielutian/listen | 15bfff8f688fca2a3a807f11ae7ba4acd133b83c | [
"MIT"
] | 4,515 | 2016-04-23T02:13:11.000Z | 2022-03-31T05:58:11.000Z | listen1/logconfig/__init__.py | xielutian/listen | 15bfff8f688fca2a3a807f11ae7ba4acd133b83c | [
"MIT"
] | 85 | 2016-04-23T14:14:04.000Z | 2022-03-03T15:00:46.000Z | listen1/logconfig/__init__.py | xielutian/listen | 15bfff8f688fca2a3a807f11ae7ba4acd133b83c | [
"MIT"
] | 844 | 2016-04-25T06:42:40.000Z | 2022-03-23T02:02:20.000Z | from __future__ import absolute_import
from logconfig.logconfig import initialize_logging
| 30 | 50 | 0.9 | 11 | 90 | 6.818182 | 0.636364 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088889 | 90 | 2 | 51 | 45 | 0.914634 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 1 | 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 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
466531d452ef2ab9992d07bb6b8f0a558cd0a959 | 1,534 | py | Python | tests/expected/infer_ops.py | div72/py2many | 60277bc13597bd32d078b88a7390715568115fc6 | [
"MIT"
] | 345 | 2021-01-28T17:33:08.000Z | 2022-03-25T16:07:56.000Z | tests/expected/infer_ops.py | mkos11/py2many | be6cfaad5af32c43eb24f182cb20ad63b979d4ef | [
"MIT"
] | 291 | 2021-01-31T13:15:06.000Z | 2022-03-23T21:28:49.000Z | tests/expected/infer_ops.py | mkos11/py2many | be6cfaad5af32c43eb24f182cb20ad63b979d4ef | [
"MIT"
] | 23 | 2021-02-09T17:15:03.000Z | 2022-02-03T05:57:44.000Z | from typing import Callable, Dict, List, Set, Optional
from ctypes import c_int8 as i8, c_int16 as i16, c_int32 as i32, c_int64 as i64
from ctypes import c_uint8 as u8, c_uint16 as u16, c_uint32 as u32, c_uint64 as u64
import sys
from ctypes import (
c_int8,
c_int16,
c_int32,
c_int64,
c_uint8,
c_uint16,
c_uint32,
c_uint64,
)
def foo():
a: int = 10
b: int = 20
_c1: int = a + b
_c2: int = a - b
_c3: int = a * b
_c4: float = a / b
_c5: int = -a
d: float = 2.0
_e1: float = a + d
_e2: float = a - d
_e3: float = a * d
_e4: float = a / d
_f: float = -3.0
_g: int = -a
def add1(x: c_int8, y: c_int8) -> c_int16:
return x + y
def add2(x: c_int16, y: c_int16) -> c_int32:
return x + y
def add3(x: c_int32, y: c_int32) -> c_int64:
return x + y
def add4(x: c_int64, y: c_int64) -> c_int64:
return x + y
def add5(x: c_uint8, y: c_uint8) -> c_uint16:
return x + y
def add6(x: c_uint16, y: c_uint16) -> c_uint32:
return x + y
def add7(x: c_uint32, y: c_uint32) -> c_uint64:
return x + y
def add8(x: c_uint64, y: c_uint64) -> c_uint64:
return x + y
def add9(x: c_int8, y: c_uint16) -> c_uint32:
return x + y
def sub(x: c_int8, y: c_int8) -> c_int8:
return x - y
def mul(x: c_int8, y: c_int8) -> c_int16:
return x * y
def fadd1(x: c_int8, y: float) -> float:
return x + y
def show():
assert fadd1(6, 6.0) == 12
print("OK")
if __name__ == "__main__":
foo()
show()
| 17.044444 | 83 | 0.576923 | 290 | 1,534 | 2.813793 | 0.258621 | 0.029412 | 0.117647 | 0.161765 | 0.295343 | 0.23652 | 0.150735 | 0.134804 | 0.134804 | 0.071078 | 0 | 0.122336 | 0.29661 | 1,534 | 89 | 84 | 17.235955 | 0.63392 | 0 | 0 | 0.169492 | 0 | 0 | 0.006519 | 0 | 0 | 0 | 0 | 0 | 0.016949 | 1 | 0.237288 | false | 0 | 0.084746 | 0.20339 | 0.525424 | 0.016949 | 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 | 1 | 0 | 0 | 4 |
46a051c315daefe5cd7bd4bfffacf5c084b7f91d | 73 | py | Python | utils/__init__.py | ssichynskyi/SDMX-API-testing-ECB | 10c2a80180ce6909d1f92b7cde178e9c943ff599 | [
"MIT"
] | null | null | null | utils/__init__.py | ssichynskyi/SDMX-API-testing-ECB | 10c2a80180ce6909d1f92b7cde178e9c943ff599 | [
"MIT"
] | null | null | null | utils/__init__.py | ssichynskyi/SDMX-API-testing-ECB | 10c2a80180ce6909d1f92b7cde178e9c943ff599 | [
"MIT"
] | null | null | null | """Various utilities and helpers that allow to test the required API."""
| 36.5 | 72 | 0.753425 | 11 | 73 | 5 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.150685 | 73 | 1 | 73 | 73 | 0.887097 | 0.90411 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
46af26359cf12dcdd7c77cf9f3e3ae11cec62f17 | 246 | py | Python | app/lib/configuration.py | janlycn/flask-restful-demo | 905301fe62cdbb17ddccc80aca0d9d16ec43dc64 | [
"Apache-2.0"
] | 1 | 2018-07-20T03:37:40.000Z | 2018-07-20T03:37:40.000Z | app/lib/configuration.py | janlycn/flask-restful-demo | 905301fe62cdbb17ddccc80aca0d9d16ec43dc64 | [
"Apache-2.0"
] | null | null | null | app/lib/configuration.py | janlycn/flask-restful-demo | 905301fe62cdbb17ddccc80aca0d9d16ec43dc64 | [
"Apache-2.0"
] | null | null | null | from config import config
def init(app):
app.config['BUNDLE_ERRORS'] = True
app.config['SQLALCHEMY_DATABASE_URI'] = config.SQLALCHEMY_DATABASE_URI
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = config.SQLALCHEMY_TRACK_MODIFICATIONS
| 30.75 | 88 | 0.788618 | 30 | 246 | 6.166667 | 0.466667 | 0.345946 | 0.205405 | 0.291892 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117886 | 246 | 7 | 89 | 35.142857 | 0.852535 | 0 | 0 | 0 | 0 | 0 | 0.268293 | 0.215447 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.4 | 0 | 0 | 0 | 0 | null | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
d3c32a554ef45e67597051d7492cc0a450f50554 | 379 | py | Python | backend/home/models.py | crowdbotics-dev/testmodel-dev-23453 | 6805bc45c18898a90566d0beae417d282fcba52a | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/models.py | crowdbotics-dev/testmodel-dev-23453 | 6805bc45c18898a90566d0beae417d282fcba52a | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/models.py | crowdbotics-dev/testmodel-dev-23453 | 6805bc45c18898a90566d0beae417d282fcba52a | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.conf import settings
from django.db import models
class HomePage(models.Model):
"Generated Model"
body = models.TextField()
class CustomText(models.Model):
"Generated Model"
title = models.CharField(
max_length=150,
)
class Contact(models.Model):
"Generated Model"
address = models.TextField()
phone = models.TextField()
| 18.047619 | 32 | 0.688654 | 43 | 379 | 6.046512 | 0.511628 | 0.126923 | 0.230769 | 0.288462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.010033 | 0.211082 | 379 | 20 | 33 | 18.95 | 0.859532 | 0.124011 | 0 | 0.214286 | 1 | 0 | 0.118734 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.642857 | 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 | 1 | 0 | 0 | 4 |
d3c47a06d7d47b2ae3b4486b35b0e2e1b0333c46 | 149 | py | Python | test.py | tiruns/grad_proj | 8882ff1e3205e346e972d963480c57dbf5aef407 | [
"MIT"
] | null | null | null | test.py | tiruns/grad_proj | 8882ff1e3205e346e972d963480c57dbf5aef407 | [
"MIT"
] | null | null | null | test.py | tiruns/grad_proj | 8882ff1e3205e346e972d963480c57dbf5aef407 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import os
if __name__ == '__main__':
x = plt.imread("./a.jpg")
y = plt.imread("./b.png")
print(y.dtype)
| 18.625 | 31 | 0.61745 | 23 | 149 | 3.652174 | 0.782609 | 0.214286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.201342 | 149 | 7 | 32 | 21.285714 | 0.705882 | 0 | 0 | 0 | 0 | 0 | 0.147651 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0.166667 | 1 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
d3d2877cc9880f2c4a38c64a245a3a2a8b4fe3c9 | 292 | py | Python | app/forms.py | SergV77/socmedParser | b60cd66e634020b03085f255c0dfde44114beeaf | [
"MIT"
] | null | null | null | app/forms.py | SergV77/socmedParser | b60cd66e634020b03085f255c0dfde44114beeaf | [
"MIT"
] | null | null | null | app/forms.py | SergV77/socmedParser | b60cd66e634020b03085f255c0dfde44114beeaf | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import TextField, TextAreaField, SubmitField, StringField
from wtforms.validators import Required, DataRequired, InputRequired
class ParsForm(FlaskForm):
text = TextAreaField(validators=[DataRequired()])
submit = SubmitField("Распознать") | 41.714286 | 70 | 0.811644 | 29 | 292 | 8.137931 | 0.655172 | 0.09322 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.113014 | 292 | 7 | 71 | 41.714286 | 0.911197 | 0 | 0 | 0 | 0 | 0 | 0.03413 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.5 | 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 | 1 | 0 | 0 | 4 |
d3f29bf9cbd85784082b953f44a583e44514f30d | 128 | py | Python | nes/processors/cpu/instructions/increment/inx.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 1 | 2017-05-13T18:57:09.000Z | 2017-05-13T18:57:09.000Z | nes/processors/cpu/instructions/increment/inx.py | Hexadorsimal/py6502 | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | 7 | 2020-10-24T17:16:56.000Z | 2020-11-01T14:10:23.000Z | nes/processors/cpu/instructions/increment/inx.py | Hexadorsimal/pynes | dbb3d40c1240fa27f70fa798bcec09188755eec2 | [
"MIT"
] | null | null | null | from .increment_register import IncrementRegisterInstruction
class Inx(IncrementRegisterInstruction):
register_name = 'x'
| 21.333333 | 60 | 0.828125 | 11 | 128 | 9.454545 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.117188 | 128 | 5 | 61 | 25.6 | 0.920354 | 0 | 0 | 0 | 0 | 0 | 0.007813 | 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 | 1 | 0 | 0 | 4 |
310c371906bc08f2fbb7b686d7774bf09762197a | 523 | py | Python | build/lib/bandwidth/voice/models/state_2_enum.py | Spaced-Out/python-bandwidth-sdk | 5332f29d1c093003444384f63a9d4a00843c954f | [
"MIT"
] | null | null | null | build/lib/bandwidth/voice/models/state_2_enum.py | Spaced-Out/python-bandwidth-sdk | 5332f29d1c093003444384f63a9d4a00843c954f | [
"MIT"
] | null | null | null | build/lib/bandwidth/voice/models/state_2_enum.py | Spaced-Out/python-bandwidth-sdk | 5332f29d1c093003444384f63a9d4a00843c954f | [
"MIT"
] | 1 | 2020-12-01T15:25:51.000Z | 2020-12-01T15:25:51.000Z | # -*- coding: utf-8 -*-
"""
bandwidth
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class State2Enum(object):
"""Implementation of the 'State2' enum.
TODO: type enum description here.
Attributes:
NOT_RECORDING: TODO: type description here.
PAUSED: TODO: type description here.
RECORDING: TODO: type description here.
"""
NOT_RECORDING = 'NOT_RECORDING'
PAUSED = 'PAUSED'
RECORDING = 'RECORDING'
| 18.678571 | 80 | 0.611855 | 54 | 523 | 5.87037 | 0.574074 | 0.100946 | 0.179811 | 0.217666 | 0.201893 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013298 | 0.281071 | 523 | 27 | 81 | 19.37037 | 0.829787 | 0.632887 | 0 | 0 | 1 | 0 | 0.222222 | 0 | 0 | 0 | 0 | 0.148148 | 0 | 1 | 0 | false | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 4 |
31184566367e43a023bffd4d0ce252428a42491d | 14,034 | py | Python | botany_konz_eval/hkws16_utils.py | lnsndn/neural-word-search | cae82593a546590ff272b6062004d66dd2497337 | [
"MIT"
] | 5 | 2018-12-15T00:02:05.000Z | 2021-07-06T14:40:32.000Z | botany_konz_eval/hkws16_utils.py | lnsndn/neural-word-search | cae82593a546590ff272b6062004d66dd2497337 | [
"MIT"
] | 4 | 2019-07-31T15:43:41.000Z | 2022-03-09T09:57:48.000Z | botany_konz_eval/hkws16_utils.py | lnsndn/neural-word-search | cae82593a546590ff272b6062004d66dd2497337 | [
"MIT"
] | 7 | 2019-01-04T10:50:20.000Z | 2022-01-18T18:03:01.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 25 12:02:35 2019
@author: tomas
"""
import torch
from evaluate_dtp import pairwise_cosine_distances
from evaluate import recall_torch
import misc.box_utils as box_utils
from misc.boxIoU import bbox_overlaps
import numpy as np
from misc.utils import average_dictionary, copy_log
def postprocessing(features, loader, args, model):
score_nms_overlap = args.score_nms_overlap #For wordness scores
score_threshold = args.score_threshold
qbs_queries, qbs_qtargets = loader.dataset.get_queries(tensorize=True)
qbe_queries, gt_targets = [], []
for li, data in enumerate(loader):
qbe_queries.append(features[li][4].numpy())
gt_targets.append(torch.squeeze(data[5]).numpy())
qbe_queries, qbe_qtargets, _ = loader.dataset.dataset_query_filter(qbe_queries, gt_targets, gt_targets, tensorize=True)
gt_targets = torch.from_numpy(np.concatenate(gt_targets, axis=0))
all_proposals, log, joint_boxes, db, all_gt_boxes= [], [], [], [], []
prop2img, recalls = [], []
db_targets, max_overlaps, amax_overlaps = [], [], []
n_gt = 0
overlaps = []
offset = [0, 0]
li = 0
for data in loader:
roi_scores, eproposal_scores, proposals, embeddings, gt_embed, eproposal_embed = features[li]
(img, oshape, gt_boxes, external_proposals, gt_embeddings, gt_labels) = data
#boxes are xcycwh from dataloader, convert to x1y1x2y2
external_proposals = box_utils.xcycwh_to_x1y1x2y2(external_proposals[0].float())#.round()#.int()
gt_boxes = box_utils.xcycwh_to_x1y1x2y2(gt_boxes[0].float())#.round()#.int()
img = torch.squeeze(img)
gt_boxes = torch.squeeze(gt_boxes)
all_gt_boxes.append(gt_boxes)
gt_labels = torch.squeeze(gt_labels)
gt_embeddings = torch.squeeze(gt_embeddings)
gt_boxes = gt_boxes.cuda()
gt_embeddings = gt_embeddings.cuda()
gt_labels = gt_labels.cuda()
roi_scores = roi_scores.cuda()
eproposal_scores = eproposal_scores.cuda()
eproposal_embed = eproposal_embed.cuda()
proposals = proposals.cuda()
embeddings = embeddings.cuda()
gt_embed = gt_embed.cuda()
external_proposals = external_proposals.cuda()
#convert to probabilities with sigmoid
scores = 1 / (1 + torch.exp(-roi_scores))
if args.use_external_proposals:
eproposal_scores = 1 / (1 + torch.exp(-eproposal_scores))
scores = torch.cat((scores, eproposal_scores), 0)
proposals = torch.cat((proposals, external_proposals), 0)
embeddings = torch.cat((embeddings, eproposal_embed), 0)
#Scale boxes back to original size
sh, sw = img.shape
img_shape = np.array([oshape[0], oshape[1]])
scale = float(max(img_shape)) / max(sh, sw)
scale *= 2
proposals = torch.round((proposals -1) * scale + 1).int()
gt_boxes = torch.round((gt_boxes -1) * scale + 1).int()
#calculate the different recalls before NMS
entry = {}
#Since slicing empty array doesn't work in torch, we need to do this explicitly
threshold_pick = torch.squeeze(scores > score_threshold)
scores = scores[threshold_pick]
tmp = threshold_pick.view(-1, 1).expand(threshold_pick.size(0), 4)
proposals = proposals[tmp].view(-1, 4)
embeddings = embeddings[threshold_pick.view(-1, 1).expand(threshold_pick.size(0), embeddings.size(1))].view(-1, embeddings.size(1))
dets = torch.cat([proposals.float(), scores.view(-1, 1)], 1)
if dets.size(0) <= 1:
continue
pick = box_utils.nms(dets, score_nms_overlap)
tt = torch.zeros(len(dets)).byte().cuda()
tt[pick] = 1
proposals = proposals[pick]
embeddings = embeddings[pick]
scores = scores[pick]
r1 = recall_torch(proposals.float(), gt_boxes.float(), 0.25)
r2 = recall_torch(proposals.float(), gt_boxes.float(), 0.5)
recalls.append((r1, r2))
for kk in range(len(proposals)):
prop2img.append(li)
all_proposals.append(proposals.cpu())
overlap = bbox_overlaps(proposals, gt_boxes)
overlaps.append(overlap)
max_gt_overlap, amax_gt_overlap = overlap.max(dim=1)
proposal_labels = torch.Tensor([gt_labels[i] for i in amax_gt_overlap])
proposal_labels = proposal_labels.cuda()
mask = overlap.sum(dim=1) == 0
proposal_labels[mask] = loader.dataset.get_vocab_size() + 1
max_overlaps.append(max_gt_overlap)
amax_overlaps.append(amax_gt_overlap + n_gt)
n_gt += len(gt_boxes)
# Artificially make a huge image containing all the boxes to be able to
# perform nms on distance to query
proposals[:, 0] += offset[1]
proposals[:, 1] += offset[0]
proposals[:, 2] += offset[1]
proposals[:, 3] += offset[0]
joint_boxes.append(proposals)
offset[0] += img.shape[0]
offset[1] += img.shape[1]
db_targets.append(proposal_labels)
db.append(embeddings)
log.append(entry)
li += 1
db = torch.cat(db, dim=0)
joint_boxes = torch.cat(joint_boxes, dim=0)
# joint_boxes = torch.FloatTensor(joint_boxes).cuda()
db_targets = torch.cat(db_targets, dim=0)
all_gt_boxes = torch.cat(all_gt_boxes, dim=0)
max_overlaps = torch.cat(max_overlaps, dim=0)
amax_overlaps = torch.cat(amax_overlaps, dim=0)
assert qbe_queries.shape[0] == qbe_qtargets.shape[0]
assert qbs_queries.shape[0] == qbs_qtargets.shape[0]
qbe_queries = qbe_queries.cuda()
qbs_queries = qbs_queries.cuda()
qbe_dists = pairwise_cosine_distances(qbe_queries, db)
qbs_dists = pairwise_cosine_distances(qbs_queries, db)
if args.mAP_gpu:
gt_targets = gt_targets.cuda()
qbs_qtargets = qbs_qtargets.cuda()
qbe_qtargets = qbe_qtargets.cuda()
else:
qbe_dists = qbe_dists.cpu()
qbs_dists = qbs_dists.cpu()
joint_boxes = joint_boxes.cpu()
max_overlaps = max_overlaps.cpu()
amax_overlaps = amax_overlaps.cpu()
db_targets = db_targets.cpu()
if args.mAP_numpy:
gt_targets = gt_targets.numpy()
qbs_qtargets = qbs_qtargets.numpy()
qbe_qtargets = qbe_qtargets.numpy()
qbe_dists = qbe_dists.numpy()
qbs_dists = qbs_dists.numpy()
joint_boxes = joint_boxes.numpy()
max_overlaps = max_overlaps.numpy()
amax_overlaps = amax_overlaps.numpy()
db_targets = db_targets.numpy()
prop2img = np.array(prop2img)
recalls = np.array(recalls)
#A hack for some printing compatability
if not args.use_external_proposals:
keys = []
for i in range(1, 4):
for ot in args.overlap_thresholds:
keys += ['%d_dtp_recall_%d' % (i, ot * 100),
'%d_rpn_recall_%d' % (i, ot * 100)]
for entry in log:
for key in keys:
if not entry.has_key(key):
entry[key] = entry['1_total_recall_50']
return (qbe_dists, qbe_qtargets, qbs_dists, qbs_qtargets, db_targets, gt_targets, prop2img,
joint_boxes, all_proposals, recalls, max_overlaps, amax_overlaps)
def postprocessing_dtp(features, loader, args, model):
score_nms_overlap = args.score_nms_overlap #For wordness scores
score_threshold = args.score_threshold
overlap_thresholds = args.overlap_thresholds
num_queries = args.num_queries
all_gt_boxes = []
joint_boxes = []
qbs_queries, qbs_qtargets = loader.dataset.get_queries(tensorize=True)
qbe_queries, gt_targets = [], []
for li, data in enumerate(loader):
qbe_queries.append(features[li][1].numpy())
gt_targets.append(torch.squeeze(data[5]).numpy())
qbe_queries, qbe_qtargets, _ = loader.dataset.dataset_query_filter(qbe_queries, gt_targets, gt_targets, tensorize=True)
gt_targets = torch.from_numpy(np.concatenate(gt_targets, axis=0))
if num_queries < 1:
num_queries = len(qbe_queries) + len(qbs_queries) + 1
qbe_queries = qbe_queries[:num_queries]
qbs_queries = qbs_queries[:num_queries]
qbe_qtargets = qbe_qtargets[:num_queries]
qbs_qtargets = qbs_qtargets[:num_queries]
max_overlaps, amax_overlaps = [], []
prop2img, recalls = [], []
all_proposals = []
overlaps = []
all_gt_boxes = []
db_targets = []
db = []
joint_boxes = []
offset = [0, 0]
n_gt = 0
for li, data in enumerate(loader):
scores, gt_embed, embeddings = features[li]
(img, oshape, gt_boxes, dtp_proposals, gt_embeddings, gt_labels) = data
#boxes are xcycwh from dataloader, convert to x1y1x2y2
dtp_proposals = box_utils.xcycwh_to_x1y1x2y2(dtp_proposals[0].float())#.round()#.int()
gt_boxes = box_utils.xcycwh_to_x1y1x2y2(gt_boxes[0].float())#.round()#.int()
img = torch.squeeze(img)
gt_boxes = torch.squeeze(gt_boxes)
all_gt_boxes.append(gt_boxes)
gt_labels = torch.squeeze(gt_labels)
gt_embeddings = torch.squeeze(gt_embeddings)
gt_boxes = gt_boxes.cuda()
gt_embeddings = gt_embeddings.cuda()
gt_labels = gt_labels.cuda()
scores = scores.cuda()
embeddings = embeddings.cuda()
gt_embed = gt_embed.cuda()
dtp_proposals = dtp_proposals.cuda()
#convert to probabilities with sigmoid
scores = 1 / (1 + torch.exp(-scores))
#Scale boxes back to original size
sh, sw = img.shape
img_shape = np.array([oshape[0], oshape[1]])
scale = float(max(img_shape)) / max(sh, sw)
scale *= 2
dtp_proposals = torch.round((dtp_proposals -1) * scale + 1).int()
gt_boxes = torch.round((gt_boxes -1) * scale + 1).int()
threshold_pick = torch.squeeze(scores > score_threshold)
scores = scores[threshold_pick]
tmp = threshold_pick.view(-1, 1).expand(threshold_pick.size(0), 4)
dtp_proposals = dtp_proposals[tmp].view(-1, 4)
embeddings = embeddings[threshold_pick.view(-1, 1).expand(threshold_pick.size(0), embeddings.size(1))].view(-1, embeddings.size(1))
dets = torch.cat([dtp_proposals.float(), scores], 1)
pick = box_utils.nms(dets, score_nms_overlap, args.nms_max_boxes)
tt = torch.zeros(len(dets)).byte().cuda()
tt[pick] = 1
dtp_proposals = dtp_proposals[pick]
embeddings = embeddings[pick]
scores = scores[pick]
r1 = recall_torch(dtp_proposals.float(), gt_boxes.float(), 0.25)
r2 = recall_torch(dtp_proposals.float(), gt_boxes.float(), 0.5)
recalls.append((r1, r2))
for kk in range(len(dtp_proposals)):
prop2img.append(li)
all_proposals.append(dtp_proposals.cpu())
overlap = bbox_overlaps(dtp_proposals, gt_boxes)
overlaps.append(overlap)
max_gt_overlap, amax_gt_overlap = overlap.max(dim=1)
proposal_labels = torch.Tensor([gt_labels[i] for i in amax_gt_overlap])
proposal_labels = proposal_labels.cuda()
mask = overlap.sum(dim=1) == 0
proposal_labels[mask] = loader.dataset.get_vocab_size() + 1
max_overlaps.append(max_gt_overlap)
amax_overlaps.append(amax_gt_overlap + n_gt)
n_gt += len(gt_boxes)
# Artificially make a huge image containing all the boxes to be able to
# perform nms on distance to query
dtp_proposals[:, 0] += offset[1]
dtp_proposals[:, 1] += offset[0]
dtp_proposals[:, 2] += offset[1]
dtp_proposals[:, 3] += offset[0]
joint_boxes.append(dtp_proposals)
offset[0] += img.shape[0]
offset[1] += img.shape[1]
db_targets.append(proposal_labels)
db.append(embeddings)
db = torch.cat(db, dim=0)
db_targets = torch.cat(db_targets, dim=0)
joint_boxes = torch.cat(joint_boxes, dim=0)
max_overlaps = torch.cat(max_overlaps, dim=0)
amax_overlaps = torch.cat(amax_overlaps, dim=0)
all_gt_boxes = torch.cat(all_gt_boxes, dim=0)
assert qbe_queries.shape[0] == qbe_qtargets.shape[0]
assert qbs_queries.shape[0] == qbs_qtargets.shape[0]
assert db.shape[0] == db_targets.shape[0]
qbe_queries = qbe_queries.cuda()
qbs_queries = qbs_queries.cuda()
# print qbe_queries.shape, db.shape, qbs_queries.shape
qbe_dists = pairwise_cosine_distances(qbe_queries, db)
qbs_dists = pairwise_cosine_distances(qbs_queries, db)
if args.mAP_gpu:
gt_targets = gt_targets.cuda()
qbs_qtargets = qbs_qtargets.cuda()
qbe_qtargets = qbe_qtargets.cuda()
else:
qbe_dists = qbe_dists.cpu()
qbs_dists = qbs_dists.cpu()
db_targets = db_targets.cpu()
joint_boxes = joint_boxes.cpu()
max_overlaps = max_overlaps.cpu()
amax_overlaps = amax_overlaps.cpu()
if args.mAP_numpy:
gt_targets = gt_targets.numpy()
qbs_qtargets = qbs_qtargets.numpy()
qbe_qtargets = qbe_qtargets.numpy()
qbe_dists = qbe_dists.numpy()
qbs_dists = qbs_dists.numpy()
db_targets = db_targets.numpy()
joint_boxes = joint_boxes.numpy()
max_overlaps = max_overlaps.numpy()
amax_overlaps = amax_overlaps.numpy()
prop2img = np.array(prop2img)
recalls = np.array(recalls)
return (qbe_dists, qbe_qtargets, qbs_dists, qbs_qtargets, db_targets, gt_targets, prop2img,
joint_boxes, all_proposals, recalls, max_overlaps, amax_overlaps)
| 38.983333 | 139 | 0.631039 | 1,811 | 14,034 | 4.634456 | 0.107675 | 0.030859 | 0.010723 | 0.012868 | 0.766949 | 0.75277 | 0.723698 | 0.705588 | 0.69129 | 0.668533 | 0 | 0.019751 | 0.256805 | 14,034 | 359 | 140 | 39.091922 | 0.784947 | 0.064843 | 0 | 0.660584 | 0 | 0 | 0.003743 | 0 | 0 | 0 | 0 | 0 | 0.018248 | 1 | 0.007299 | false | 0 | 0.025547 | 0 | 0.040146 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 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 | 4 |
3133675e186b1efd86dcf1db22ce32c6a051bf87 | 408 | py | Python | tools/ManualDistance.py | jileiwang/CJ-Glo | e2c9ecf040bcc31276ba1d122327e0f0c5b46744 | [
"Apache-2.0"
] | null | null | null | tools/ManualDistance.py | jileiwang/CJ-Glo | e2c9ecf040bcc31276ba1d122327e0f0c5b46744 | [
"Apache-2.0"
] | null | null | null | tools/ManualDistance.py | jileiwang/CJ-Glo | e2c9ecf040bcc31276ba1d122327e0f0c5b46744 | [
"Apache-2.0"
] | null | null | null |
import WordVecDict
if __name__ == '__main__':
#wordVecDict = WordVecDict.WordVecDict("output/vocab.cj_001", "output/batch_02/ctrl_s_0.03.vec.txt")
wordVecDict = WordVecDict.WordVecDict("output/vocab.cj_001", "output/batch_02/exp_s_0.05_c_0.05.vec.txt")
while True:
print "Input w0 w1 w2 w3:"
line = raw_input().split()
print wordVecDict.distance(line[0], line[1], True) | 37.090909 | 109 | 0.693627 | 60 | 408 | 4.4 | 0.55 | 0.333333 | 0.25 | 0.295455 | 0.469697 | 0.469697 | 0.469697 | 0.469697 | 0.469697 | 0.469697 | 0 | 0.073314 | 0.164216 | 408 | 11 | 110 | 37.090909 | 0.70088 | 0.242647 | 0 | 0 | 0 | 0 | 0.28013 | 0.13355 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.142857 | null | null | 0.285714 | 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 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
31385b6559226160e69b0883637c618383139f19 | 5,651 | py | Python | google/ads/google_ads/v6/proto/services/campaign_label_service_pb2_grpc.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v6/proto/services/campaign_label_service_pb2_grpc.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v6/proto/services/campaign_label_service_pb2_grpc.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.ads.google_ads.v6.proto.resources import campaign_label_pb2 as google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_campaign__label__pb2
from google.ads.google_ads.v6.proto.services import campaign_label_service_pb2 as google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2
class CampaignLabelServiceStub(object):
"""Proto file describing the Campaign Label service.
Service to manage labels on campaigns.
"""
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
self.GetCampaignLabel = channel.unary_unary(
'/google.ads.googleads.v6.services.CampaignLabelService/GetCampaignLabel',
request_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.GetCampaignLabelRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_campaign__label__pb2.CampaignLabel.FromString,
)
self.MutateCampaignLabels = channel.unary_unary(
'/google.ads.googleads.v6.services.CampaignLabelService/MutateCampaignLabels',
request_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.MutateCampaignLabelsRequest.SerializeToString,
response_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.MutateCampaignLabelsResponse.FromString,
)
class CampaignLabelServiceServicer(object):
"""Proto file describing the Campaign Label service.
Service to manage labels on campaigns.
"""
def GetCampaignLabel(self, request, context):
"""Returns the requested campaign-label relationship in full detail.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def MutateCampaignLabels(self, request, context):
"""Creates and removes campaign-label relationships.
Operation statuses are returned.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_CampaignLabelServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
'GetCampaignLabel': grpc.unary_unary_rpc_method_handler(
servicer.GetCampaignLabel,
request_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.GetCampaignLabelRequest.FromString,
response_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_campaign__label__pb2.CampaignLabel.SerializeToString,
),
'MutateCampaignLabels': grpc.unary_unary_rpc_method_handler(
servicer.MutateCampaignLabels,
request_deserializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.MutateCampaignLabelsRequest.FromString,
response_serializer=google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.MutateCampaignLabelsResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'google.ads.googleads.v6.services.CampaignLabelService', rpc_method_handlers)
server.add_generic_rpc_handlers((generic_handler,))
# This class is part of an EXPERIMENTAL API.
class CampaignLabelService(object):
"""Proto file describing the Campaign Label service.
Service to manage labels on campaigns.
"""
@staticmethod
def GetCampaignLabel(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.CampaignLabelService/GetCampaignLabel',
google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.GetCampaignLabelRequest.SerializeToString,
google_dot_ads_dot_googleads__v6_dot_proto_dot_resources_dot_campaign__label__pb2.CampaignLabel.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def MutateCampaignLabels(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/google.ads.googleads.v6.services.CampaignLabelService/MutateCampaignLabels',
google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.MutateCampaignLabelsRequest.SerializeToString,
google_dot_ads_dot_googleads__v6_dot_proto_dot_services_dot_campaign__label__service__pb2.MutateCampaignLabelsResponse.FromString,
options, channel_credentials,
call_credentials, compression, wait_for_ready, timeout, metadata)
| 50.90991 | 177 | 0.749779 | 593 | 5,651 | 6.62226 | 0.192243 | 0.069519 | 0.042781 | 0.053476 | 0.759104 | 0.759104 | 0.746881 | 0.694423 | 0.694423 | 0.661319 | 0 | 0.008096 | 0.191294 | 5,651 | 110 | 178 | 51.372727 | 0.851204 | 0.11644 | 0 | 0.422535 | 1 | 0 | 0.096787 | 0.070595 | 0 | 0 | 0 | 0 | 0 | 1 | 0.084507 | false | 0 | 0.042254 | 0.028169 | 0.197183 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
3145766261b47f74b0e38fa96bdbd83c2d35e787 | 221 | py | Python | pynilha/pynilhaapp/admin.py | rafarbop/django_library | d66d2a715a55482f3beab0bf7246af986ac32e9e | [
"MIT"
] | null | null | null | pynilha/pynilhaapp/admin.py | rafarbop/django_library | d66d2a715a55482f3beab0bf7246af986ac32e9e | [
"MIT"
] | null | null | null | pynilha/pynilhaapp/admin.py | rafarbop/django_library | d66d2a715a55482f3beab0bf7246af986ac32e9e | [
"MIT"
] | null | null | null | """admin."""
from django.contrib import admin
# Register your models here.
from .models import Receitas, Despesas, Aplicacoes
admin.site.register(Receitas)
admin.site.register(Despesas)
admin.site.register(Aplicacoes)
| 20.090909 | 50 | 0.78733 | 28 | 221 | 6.214286 | 0.464286 | 0.155172 | 0.293103 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.099548 | 221 | 10 | 51 | 22.1 | 0.874372 | 0.153846 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.4 | 0 | 0.4 | 0 | 1 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 4 |
314727c318639374782fee61d3e07e74357e44da | 161 | py | Python | technology/scn4m_subm/tf/glade_scn4m_subm.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | 335 | 2018-03-13T21:05:22.000Z | 2022-03-30T07:53:25.000Z | technology/scn4m_subm/tf/glade_scn4m_subm.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | 87 | 2018-03-06T00:55:51.000Z | 2022-03-30T19:38:29.000Z | technology/scn4m_subm/tf/glade_scn4m_subm.py | bsg-external/OpenRAM | 3c5e13f95c925a204cabf052525c3de07638168f | [
"BSD-3-Clause"
] | 95 | 2018-03-14T16:22:55.000Z | 2022-03-24T00:34:37.000Z | import os
CWD = os.environ.get("OPENRAM_TECH") + "/scn4m_subm/tf"
ui().importCds("default", CWD+"/display.drf", CWD+"/mosis.tf", 1000, 1, CWD+"/layers.map")
| 20.125 | 90 | 0.652174 | 25 | 161 | 4.12 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.041667 | 0.10559 | 161 | 7 | 91 | 23 | 0.673611 | 0 | 0 | 0 | 0 | 0 | 0.414013 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.666667 | 0 | 0.666667 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 4 |
319f2327fc6b2934b9ae9665d70d4a17ef8ffeda | 462 | py | Python | test.py | lexibank/abvd | fcd8a2b991e8a44e8247c4e505e4237f056b0c87 | [
"CC-BY-4.0"
] | 1 | 2020-09-10T03:53:27.000Z | 2020-09-10T03:53:27.000Z | test.py | lexibank/abvd | fcd8a2b991e8a44e8247c4e505e4237f056b0c87 | [
"CC-BY-4.0"
] | 11 | 2018-04-24T16:36:47.000Z | 2022-02-09T21:55:32.000Z | test.py | lexibank/abvd | fcd8a2b991e8a44e8247c4e505e4237f056b0c87 | [
"CC-BY-4.0"
] | 1 | 2019-05-15T07:28:02.000Z | 2019-05-15T07:28:02.000Z | def test_valid(cldf_dataset, cldf_logger):
assert cldf_dataset.validate(log=cldf_logger)
# should be 210 items
def test_parameters(cldf_dataset):
assert len(list(cldf_dataset["ParameterTable"])) == 210
# test we have some languages
def test_languages(cldf_dataset):
assert len(list(cldf_dataset["LanguageTable"])) > 1000
# test we have some cognates
def test_cognates(cldf_dataset):
assert len(list(cldf_dataset["CognateTable"])) == 233260
| 25.666667 | 60 | 0.75974 | 64 | 462 | 5.265625 | 0.40625 | 0.261128 | 0.151335 | 0.178042 | 0.311573 | 0.311573 | 0.311573 | 0 | 0 | 0 | 0 | 0.04 | 0.134199 | 462 | 17 | 61 | 27.176471 | 0.8025 | 0.160173 | 0 | 0 | 0 | 0 | 0.101563 | 0 | 0 | 0 | 0 | 0 | 0.5 | 1 | 0.5 | false | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
31ad4ed825ecb5b0d791431fe00d7ed2ea72564f | 249 | py | Python | Testing/tensorflow2-gputest.py | Kai-Beast223/learningdatascience | 302229c1bf29bc02be50c3f83aad575c63b44562 | [
"MIT"
] | null | null | null | Testing/tensorflow2-gputest.py | Kai-Beast223/learningdatascience | 302229c1bf29bc02be50c3f83aad575c63b44562 | [
"MIT"
] | null | null | null | Testing/tensorflow2-gputest.py | Kai-Beast223/learningdatascience | 302229c1bf29bc02be50c3f83aad575c63b44562 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.python.client import device_lib
print(device_lib.list_local_devices())
# Meant to verify that gpu is properly installed
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices("GPU")))
| 35.571429 | 87 | 0.811245 | 37 | 249 | 5.297297 | 0.756757 | 0.091837 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.096386 | 249 | 6 | 88 | 41.5 | 0.871111 | 0.184739 | 0 | 0 | 0 | 0 | 0.114428 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.5 | 0 | 0.5 | 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 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 4 |
31b94b3886c019d83b9d97b4d4398315237721cd | 147 | py | Python | code/global_vars.py | btaille/contener | 993da8e966fd732927b9d2aa7688960cf1c6b1a8 | [
"Apache-2.0"
] | 13 | 2020-02-01T21:47:03.000Z | 2021-09-29T05:11:02.000Z | code/global_vars.py | btaille/contener | 993da8e966fd732927b9d2aa7688960cf1c6b1a8 | [
"Apache-2.0"
] | null | null | null | code/global_vars.py | btaille/contener | 993da8e966fd732927b9d2aa7688960cf1c6b1a8 | [
"Apache-2.0"
] | 3 | 2020-02-05T15:06:28.000Z | 2021-11-16T09:17:12.000Z | PROJECT_DIR = "/notebooks/contener/"
RUN_DIR = PROJECT_DIR + "runs/"
DATA_DIR = PROJECT_DIR + "data/"
EMBEDDINGS_DIR = PROJECT_DIR + "embeddings/"
| 29.4 | 44 | 0.734694 | 19 | 147 | 5.315789 | 0.421053 | 0.39604 | 0.386139 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.122449 | 147 | 4 | 45 | 36.75 | 0.782946 | 0 | 0 | 0 | 0 | 0 | 0.278912 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 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 | 4 |
31c09dbc351e929ffa9ca0b09f593f208dd144cf | 1,213 | py | Python | phonenumbers/shortdata/region_IS.py | igushev/fase_lib | 182c626193193b196041b18b9974b5b2cbf15c67 | [
"MIT"
] | 7 | 2019-05-20T09:57:02.000Z | 2020-01-10T05:30:48.000Z | phonenumbers/shortdata/region_IS.py | igushev/fase_lib | 182c626193193b196041b18b9974b5b2cbf15c67 | [
"MIT"
] | null | null | null | phonenumbers/shortdata/region_IS.py | igushev/fase_lib | 182c626193193b196041b18b9974b5b2cbf15c67 | [
"MIT"
] | null | null | null | """Auto-generated file, do not edit by hand. IS metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_IS = PhoneMetadata(id='IS', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{2,5}', possible_number_pattern='\\d{3,6}', possible_length=(3, 4, 6)),
toll_free=PhoneNumberDesc(national_number_pattern='1717', possible_number_pattern='\\d{4}', example_number='1717', possible_length=(4,)),
premium_rate=PhoneNumberDesc(national_number_pattern='1848', possible_number_pattern='\\d{4}', example_number='1848', possible_length=(4,)),
emergency=PhoneNumberDesc(national_number_pattern='112', possible_number_pattern='\\d{3,6}', example_number='112', possible_length=(3,)),
short_code=PhoneNumberDesc(national_number_pattern='1(?:1(?:[28]|6(?:1(?:23|16)))|4(?:00|1[145]|4[0146])|55|7(?:00|17|7[07-9])|8(?:0[08]|1[016-9]|20|48|8[018])|900)', possible_number_pattern='\\d{3,6}', example_number='112', possible_length=(3, 4, 6)),
carrier_specific=PhoneNumberDesc(national_number_pattern='1441', possible_number_pattern='\\d{4}', example_number='1441', possible_length=(4,)),
short_data=True)
| 101.083333 | 256 | 0.743611 | 175 | 1,213 | 4.897143 | 0.4 | 0.18203 | 0.203034 | 0.252042 | 0.390898 | 0.28238 | 0.254376 | 0.128355 | 0.128355 | 0.128355 | 0 | 0.09507 | 0.063479 | 1,213 | 11 | 257 | 110.272727 | 0.659331 | 0.043693 | 0 | 0 | 1 | 0.111111 | 0.171577 | 0.097054 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.111111 | 0 | 0.111111 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.