hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ed614a563d311fbd9e62fbe065c720a65f267c7e | 2,788 | py | Python | DestroyerIGN/captchaServer.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 128 | 2020-11-16T09:28:17.000Z | 2022-03-14T10:38:52.000Z | DestroyerIGN/captchaServer.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 7 | 2020-11-27T14:45:19.000Z | 2022-02-15T09:47:12.000Z | DestroyerIGN/captchaServer.py | Ravenclaw-OIer/ISML_auto_voter | 9c53bd87530697d374163f571186542c3fc9734b | [
"MIT"
] | 11 | 2020-12-11T12:24:38.000Z | 2022-02-20T12:42:31.000Z | #coding:utf-8
portList=(8888,8889)#
import tornado.ioloop
#import shutil
#import os
import utils
model = utils.loadmodel('Model.json', 'Weights.h5')
REFSTR = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if __name__ == '__main__':
from multiprocessing import Process
length=len(portList)
for port in ... | 31.325843 | 79 | 0.581062 | #coding:utf-8
portList=(8888,8889)#本服务器监听端口
import tornado.ioloop
import tornado.web
import numpy as np
from time import sleep
#import shutil
#import os
from random import random
from io import BytesIO
from PIL import Image
from base64 import b64decode
import utils
model = utils.loadmodel('Model.json', ... | 348 | 0 | 120 | 458 | 0 | 1,401 | 0 | 7 | 235 |
07acdd890b5325633a96917335e808b0db43398b | 2,344 | py | Python | Emall/base_api.py | syz247179876/e_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 7 | 2021-04-10T13:20:56.000Z | 2022-03-29T15:00:29.000Z | Emall/base_api.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 9 | 2021-05-11T03:53:31.000Z | 2022-03-12T00:58:03.000Z | Emall/base_api.py | syz247179876/E_mall | f94e39e091e098242342f532ae371b8ff127542f | [
"Apache-2.0"
] | 2 | 2020-11-24T08:59:22.000Z | 2020-11-24T14:10:59.000Z | # -*- coding: utf-8 -*-
# @Time : 2020/11/21 11:27
# @Author :
# @File : base_api.py
# @Software: Pycharm
"""
API
"""
from rest_framework import status
from rest_framework.response import Response
from Emall.response_code import response_code
def check_code(redis, validated_data):
""""""
code_status = redi... | 30.441558 | 98 | 0.65273 | # -*- coding: utf-8 -*-
# @Time : 2020/11/21 上午11:27
# @Author : 司云中
# @File : base_api.py
# @Software: Pycharm
"""
通用API共享函数
"""
from rest_framework import status
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView
from Emall.exceptions import SqlServerError
from Emall.re... | 159 | 0 | 0 | 1,652 | 0 | 0 | 0 | 51 | 68 |
0c04a654f297ea6cc5bad97d952631d9da83c061 | 2,532 | py | Python | commands/slowmode.py | edazpotato/bot | e2d7742b9432ea49552d2b73aed040330b1b3b0b | [
"MIT"
] | null | null | null | commands/slowmode.py | edazpotato/bot | e2d7742b9432ea49552d2b73aed040330b1b3b0b | [
"MIT"
] | null | null | null | commands/slowmode.py | edazpotato/bot | e2d7742b9432ea49552d2b73aed040330b1b3b0b | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020 GamingGeek
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, dis... | 43.655172 | 133 | 0.697867 | """
MIT License
Copyright (c) 2020 GamingGeek
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, dis... | 0 | 968 | 0 | 87 | 0 | 225 | 0 | 19 | 157 |
f408d2dd962ede10ebbdcaff4c81acd93a0057e9 | 8,155 | py | Python | mamba/FastSubdirData.py | dmaljovec/mamba | 599c2820086b5d69df8c73a98b2a4acf5dffe0df | [
"BSD-3-Clause"
] | null | null | null | mamba/FastSubdirData.py | dmaljovec/mamba | 599c2820086b5d69df8c73a98b2a4acf5dffe0df | [
"BSD-3-Clause"
] | null | null | null | mamba/FastSubdirData.py | dmaljovec/mamba | 599c2820086b5d69df8c73a98b2a4acf5dffe0df | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from logging import getLogger
log = getLogger(__name__)
stderrlog = getLogger('conda.stderrlog')
REPODATA_PICKLE_VERSION = 28
MAX_REPODA... | 39.396135 | 104 | 0.638872 | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
import bz2
import sys, os
from collections import defaultdict
from contextlib import closing
from errno import EACCES, ENODEV, EPERM
from... | 0 | 5,407 | 0 | 579 | 0 | 0 | 0 | 948 | 796 |
1cdd6ff900ddffaaf978064ae475159f69ceb0b1 | 14,328 | py | Python | webenmr/controllers/xplor.py | andreagia/WEBNMR | 512a8cc04cf69300796585feae722614501389a9 | [
"Apache-2.0"
] | null | null | null | webenmr/controllers/xplor.py | andreagia/WEBNMR | 512a8cc04cf69300796585feae722614501389a9 | [
"Apache-2.0"
] | null | null | null | webenmr/controllers/xplor.py | andreagia/WEBNMR | 512a8cc04cf69300796585feae722614501389a9 | [
"Apache-2.0"
] | null | null | null | import logging
log = logging.getLogger(__name__)
| 43.418182 | 165 | 0.542155 | from lxml import etree
import logging
import random
import os
import shutil
import types, cgi
from pylons import config
from pylons import request, response, session, tmpl_context as c, url
from pylons.controllers.util import abort, redirect
from webenmr.model import Projects, Calculations, Jobs, CalculationTipology, U... | 0 | 0 | 0 | 13,695 | 0 | 0 | 0 | 226 | 353 |
9c5a68a883a88ef8d7d76077b1df4d21455cf9d3 | 1,633 | py | Python | lib/galaxy/model/migrate/versions/0135_add_library_tags.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/model/migrate/versions/0135_add_library_tags.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | 2 | 2017-05-18T16:12:55.000Z | 2022-03-08T12:08:43.000Z | lib/galaxy/model/migrate/versions/0135_add_library_tags.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | null | null | null | """
This migration script adds support for storing tags in the context of a dataset in a library
"""
import logging
from sqlalchemy import (Column, ForeignKey, Integer, MetaData, Table)
# Need our custom types, but don't import anything else from model
from galaxy.model.custom_types import TrimmedString
log = loggi... | 27.677966 | 92 | 0.73117 | """
This migration script adds support for storing tags in the context of a dataset in a library
"""
import logging
from sqlalchemy import (
Column,
ForeignKey,
Integer,
MetaData,
Table,
)
# Need our custom types, but don't import anything else from model
from galaxy.model.custom_types import Tri... | 0 | 0 | 0 | 0 | 0 | 537 | 0 | 23 | 46 |
621bf6e7e7084f4fb8c71412d057f29ec2921329 | 7,780 | py | Python | tests/testactions.py | HeliumEdu/helium-cli | 926018a09b3e868a894a32295fdfcb2d134c9d41 | [
"MIT"
] | 2 | 2019-01-23T19:08:37.000Z | 2021-05-27T23:25:48.000Z | tests/testactions.py | HeliumEdu/helium-cli | 926018a09b3e868a894a32295fdfcb2d134c9d41 | [
"MIT"
] | 17 | 2018-04-20T14:45:29.000Z | 2020-03-16T19:03:31.000Z | tests/testactions.py | HeliumEdu/helium-cli | 926018a09b3e868a894a32295fdfcb2d134c9d41 | [
"MIT"
] | 2 | 2018-05-04T21:50:29.000Z | 2018-06-01T19:29:13.000Z |
__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Helium Edu"
__version__ = "1.6.0"
| 39.492386 | 115 | 0.64473 | import os
from unittest import mock
from heliumcli import utils, settings
from heliumcli.main import main
from tests.helpers.commonhelper import given_config_exists
from .helpers import testcase, commonhelper
__author__ = "Alex Laird"
__copyright__ = "Copyright 2018, Helium Edu"
__version__ = "1.6.0"
class TestActi... | 0 | 1,873 | 0 | 5,579 | 0 | 0 | 0 | 77 | 156 |
69cac34efbadf6fd73233a4b23e60acd1487b619 | 168 | py | Python | tests/test_bi.py | kvh/dags-bi | 2e0877b19fb0738ba384b798ad1c5c33c4b3111e | [
"BSD-3-Clause"
] | 1 | 2020-12-22T23:22:10.000Z | 2020-12-22T23:22:10.000Z | tests/test_bi.py | kvh/dags-bi | 2e0877b19fb0738ba384b798ad1c5c33c4b3111e | [
"BSD-3-Clause"
] | null | null | null | tests/test_bi.py | kvh/dags-bi | 2e0877b19fb0738ba384b798ad1c5c33c4b3111e | [
"BSD-3-Clause"
] | 1 | 2021-07-11T10:07:16.000Z | 2021-07-11T10:07:16.000Z | from loguru import logger
logger.enable("snapflow")
if __name__ == "__main__":
test()
| 12 | 40 | 0.672619 | from loguru import logger
logger.enable("snapflow")
def test():
from snapflow_bi import module as bi
bi.run_tests()
if __name__ == "__main__":
test()
| 0 | 0 | 0 | 0 | 0 | 51 | 0 | 0 | 23 |
3ca576d08c7f3e8c7d9ea7df90eeae962a62ad25 | 3,045 | py | Python | ixian_docker/modules/docker/utils/client.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | ixian_docker/modules/docker/utils/client.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | ixian_docker/modules/docker/utils/client.py | kreneskyp/ixian-docker | ce7a6cee2f961b8446dc3d9429a809ab5a235467 | [
"Apache-2.0"
] | null | null | null | # Copyright [2018-2020] Peter Krenesky
#
# 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... | 29 | 94 | 0.663054 | # Copyright [2018-2020] Peter Krenesky
#
# 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... | 0 | 760 | 0 | 1,323 | 0 | 28 | 0 | 14 | 205 |
ff6285e126baa8fdebcfba48c1625e8679c9397b | 229 | py | Python | mysite/annotatorapp/forms.py | hareeshbabu82ns/smart-sanskrit-annotator | 763e1dd067107334761ba66796a559c18c2a2807 | [
"MIT"
] | 7 | 2019-04-15T14:33:21.000Z | 2021-12-20T10:04:30.000Z | mysite/annotatorapp/forms.py | hareeshbabu82ns/smart-sanskrit-annotator | 763e1dd067107334761ba66796a559c18c2a2807 | [
"MIT"
] | 4 | 2020-07-05T17:46:45.000Z | 2021-12-11T16:46:40.000Z | mysite/annotatorapp/forms.py | hareeshbabu82ns/smart-sanskrit-annotator | 763e1dd067107334761ba66796a559c18c2a2807 | [
"MIT"
] | 6 | 2018-07-16T10:42:52.000Z | 2021-09-26T06:54:55.000Z | #landing page inputs taken as a form input.
| 22.9 | 45 | 0.759825 | #landing page inputs taken as a form input.
from django import forms
from . import models
class inputlineform(forms.Form):
model = forms
line = forms.CharField(max_length = 100)
linetype = forms.CharField(max_length = 100)
| 0 | 0 | 0 | 114 | 0 | 0 | 0 | 2 | 67 |
7013918c81c6bad76dfdcdb70889dc3508a62702 | 328 | py | Python | URI/1 - INICIANTE/Python/1182 - ColunaNaMatriz.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | 1 | 2020-04-14T16:48:16.000Z | 2020-04-14T16:48:16.000Z | URI/1 - INICIANTE/Python/1182 - ColunaNaMatriz.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | URI/1 - INICIANTE/Python/1182 - ColunaNaMatriz.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | l = int(input())
operacao = input()
matriz = []
soma = 0.0
for x in range(0, 12):
linha = []
for y in range(0, 12):
linha.append(float(input()))
matriz.append(linha)
for x in range(0, 12):
soma += matriz[x][l]
if operacao == 'S':
print('{:.1f}'.format(soma))
else:
print('{:.1f}'.format(s... | 21.866667 | 36 | 0.554878 | l = int(input())
operacao = input()
matriz = []
soma = 0.0
for x in range(0, 12):
linha = []
for y in range(0, 12):
linha.append(float(input()))
matriz.append(linha)
for x in range(0, 12):
soma += matriz[x][l]
if operacao == 'S':
print('{:.1f}'.format(soma))
else:
print('{:.1f}'.format(s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fb5ab216047bdc84770b95501d224e4d5a3c6122 | 20,802 | py | Python | src/data/readers/load_hrit.py | gridl/kcl-fire-aot | 2833df64b289f5ef02b8b93c3c620d0ba702f5b5 | [
"MIT"
] | null | null | null | src/data/readers/load_hrit.py | gridl/kcl-fire-aot | 2833df64b289f5ef02b8b93c3c620d0ba702f5b5 | [
"MIT"
] | null | null | null | src/data/readers/load_hrit.py | gridl/kcl-fire-aot | 2833df64b289f5ef02b8b93c3c620d0ba702f5b5 | [
"MIT"
] | 1 | 2021-03-26T02:28:33.000Z | 2021-03-26T02:28:33.000Z | # open Himawari-8 standard format
# output data dictionary ready to put in frp_pixel.py
# the struction of the dictionary should be like this
# ['ir39', 'ir12', 'saa', 'ir11', 'cloudfree', 'lat',
# 'ir11rad', 'diff', 'sun_glint', 'ACQTIME', 'vza',
# 'vaa', 'lon', 'cmask', 'CMa_TEST', 'pixsize', 'szen',
# 'tirradratio',... | 36.430823 | 106 | 0.571484 | # open Himawari-8 standard format
# output data dictionary ready to put in frp_pixel.py
# the struction of the dictionary should be like this
# ['ir39', 'ir12', 'saa', 'ir11', 'cloudfree', 'lat',
# 'ir11rad', 'diff', 'sun_glint', 'ACQTIME', 'vza',
# 'vaa', 'lon', 'cmask', 'CMa_TEST', 'pixsize', 'szen',
# 'tirradratio',... | 0 | 0 | 0 | 0 | 0 | 284 | 0 | 0 | 23 |
668d96dc85f2dcb56b1266245486159c92348042 | 318 | py | Python | profiles_api/urls.py | shalaka-dengale16/profiles-rest-api | fb0ea419123ffe5a6a4000b7893fe506dd5456f9 | [
"MIT"
] | null | null | null | profiles_api/urls.py | shalaka-dengale16/profiles-rest-api | fb0ea419123ffe5a6a4000b7893fe506dd5456f9 | [
"MIT"
] | null | null | null | profiles_api/urls.py | shalaka-dengale16/profiles-rest-api | fb0ea419123ffe5a6a4000b7893fe506dd5456f9 | [
"MIT"
] | null | null | null | from django.urls import path, include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router=DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,basename='hello-viewset')
urlpatterns=[
path('hello-api/',views.HelloApi.as_view()),
path('',include(router.urls))
]
| 26.5 | 76 | 0.779874 | from django.urls import path,include
from rest_framework.routers import DefaultRouter
from profiles_api import views
router=DefaultRouter()
router.register('hello-viewset',views.HelloViewSet,basename='hello-viewset')
urlpatterns=[
path('hello-api/',views.HelloApi.as_view()),
path('',include(router.urls))
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
2a78100207b1f584bd76849f055d4bad916d1dcd | 897 | py | Python | start.py | zxlim/pyHookDeploy | 8b151dc0351b13df74555d2087daf877e6c80797 | [
"Apache-2.0"
] | 1 | 2020-08-07T04:29:02.000Z | 2020-08-07T04:29:02.000Z | start.py | zxlim/pyHookDeploy | 8b151dc0351b13df74555d2087daf877e6c80797 | [
"Apache-2.0"
] | null | null | null | start.py | zxlim/pyHookDeploy | 8b151dc0351b13df74555d2087daf877e6c80797 | [
"Apache-2.0"
] | 1 | 2021-07-15T14:01:55.000Z | 2021-07-15T14:01:55.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################################
# Copyright (c) 2019 Zhao Xiang Lim.
# Distributed under the Apache License 2.0 (the "License").
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an... | 27.181818 | 74 | 0.639911 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
##################################################
# Copyright (c) 2019 Zhao Xiang Lim.
# Distributed under the Apache License 2.0 (the "License").
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an... | 0 | 0 | 0 | 0 | 0 | 67 | 0 | 0 | 23 |
26b636a86c604a98c671236be20e5c67f52404ba | 2,189 | py | Python | lexical_analyzer.py | Tenchi88/lexical_analyzer | ef7b5d6af12de602c6f50c899928d36cb6408646 | [
"Apache-2.0"
] | null | null | null | lexical_analyzer.py | Tenchi88/lexical_analyzer | ef7b5d6af12de602c6f50c899928d36cb6408646 | [
"Apache-2.0"
] | null | null | null | lexical_analyzer.py | Tenchi88/lexical_analyzer | ef7b5d6af12de602c6f50c899928d36cb6408646 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
| 36.483333 | 110 | 0.745089 | # -*- coding: utf-8 -*-
import collections
from lexical_analyzer_helpers import *
def get_top_words_in_path(path, name_type, speech_part, top_size=10):
if name_type not in ["variable", "function_definition"]:
raise ValueError(name_type + " not supported. Available types: [variable, function_definition]"... | 0 | 0 | 0 | 0 | 0 | 1,913 | 0 | 14 | 230 |
7797d8f5bfbc1aa24b9f92677ad4b1d2bac9ebb0 | 869 | py | Python | build.py | ryanc414/pytest_runner | 11681fea458de1761e808684f578e183bddc40ef | [
"MIT"
] | 21 | 2020-09-19T02:19:51.000Z | 2022-03-05T16:01:48.000Z | build.py | ryanc414/pytest_runner | 11681fea458de1761e808684f578e183bddc40ef | [
"MIT"
] | 12 | 2020-08-25T17:41:31.000Z | 2021-08-17T21:57:32.000Z | build.py | ryanc414/pytest_runner | 11681fea458de1761e808684f578e183bddc40ef | [
"MIT"
] | 8 | 2020-09-19T02:20:12.000Z | 2022-02-22T15:21:25.000Z | #!/usr/bin/env python3
"""
Build everything from source.
Handles:
1. Install npm dependencies and build the UI client
2. Build source and binary distributions of the python package.
"""
import os
WEB_CLIENT_DIR = os.path.join(
os.path.dirname(__file__), "pytest_commander", "web_client"
)
if __name__ == "__mai... | 22.868421 | 73 | 0.674338 | #!/usr/bin/env python3
"""
Build everything from source.
Handles:
1. Install npm dependencies and build the UI client
2. Build source and binary distributions of the python package.
"""
import os
import shutil
import subprocess
import sys
WEB_CLIENT_DIR = os.path.join(
os.path.dirname(__file__), "pytest_commande... | 0 | 0 | 0 | 0 | 0 | 466 | 0 | -23 | 89 |
6011f11e84b0ca5ba3caa12f9e06568d9dbe7af6 | 474 | py | Python | src/consensus/block_rewards.py | reghacker/chia-blockchain | 51ab6260dcfbd95b4be9686f717f8d63133ef50f | [
"Apache-2.0"
] | null | null | null | src/consensus/block_rewards.py | reghacker/chia-blockchain | 51ab6260dcfbd95b4be9686f717f8d63133ef50f | [
"Apache-2.0"
] | null | null | null | src/consensus/block_rewards.py | reghacker/chia-blockchain | 51ab6260dcfbd95b4be9686f717f8d63133ef50f | [
"Apache-2.0"
] | null | null | null | from src.util.ints import uint32, uint64
def calculate_block_reward(height: uint32) -> uint64:
"""
Returns the coinbase reward at a certain block height.
1 Chia coin = 16,000,000,000,000 = 16 trillion mojo.
"""
return uint64(14000000000000)
def calculate_base_fee(height: uint32) -> uint64:
"... | 26.333333 | 58 | 0.691983 | from src.util.ints import uint32, uint64
def calculate_block_reward(height: uint32) -> uint64:
"""
Returns the coinbase reward at a certain block height.
1 Chia coin = 16,000,000,000,000 = 16 trillion mojo.
"""
return uint64(14000000000000)
def calculate_base_fee(height: uint32) -> uint64:
"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b525ded27d8f2ca62cb466a65a21bbd19071ef22 | 3,061 | py | Python | dp_tornado/helper/security/crypto/__init__.py | donghak-shin/dp-tornado | 095bb293661af35cce5f917d8a2228d273489496 | [
"MIT"
] | 18 | 2015-04-07T14:28:39.000Z | 2020-02-08T14:03:38.000Z | dp_tornado/helper/security/crypto/__init__.py | donghak-shin/dp-tornado | 095bb293661af35cce5f917d8a2228d273489496 | [
"MIT"
] | 7 | 2016-10-05T05:14:06.000Z | 2021-05-20T02:07:22.000Z | dp_tornado/helper/security/crypto/__init__.py | donghak-shin/dp-tornado | 095bb293661af35cce5f917d8a2228d273489496 | [
"MIT"
] | 11 | 2015-12-15T09:49:39.000Z | 2021-09-06T18:38:21.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
| 34.011111 | 116 | 0.611565 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from dp_tornado.engine.helper import Helper as dpHelper
from Crypto.Cipher import AES
class CryptoHelper(dpHelper):
def encrypt(self, plain, randomized=False, expire_in=0, key=None, raw=False, encode=True, pad=True):
if raw:
retu... | 0 | 0 | 0 | 2,886 | 0 | 0 | 0 | 42 | 67 |
b40678d6e6142c5ce139c5ab13bce7b7eed2edf6 | 10,091 | py | Python | Figures.py | swtietz/BA_Analysis | 197e4aad2b054dc9235808fcc5900659cec8cce6 | [
"MIT"
] | 1 | 2016-11-30T07:23:51.000Z | 2016-11-30T07:23:51.000Z | Figures.py | swtietz/BA_Analysis | 197e4aad2b054dc9235808fcc5900659cec8cce6 | [
"MIT"
] | null | null | null | Figures.py | swtietz/BA_Analysis | 197e4aad2b054dc9235808fcc5900659cec8cce6 | [
"MIT"
] | 1 | 2016-11-30T07:24:25.000Z | 2016-11-30T07:24:25.000Z | import matplotlib
import matplotlib.cm
if __name__ == '__main__':
matplotlib.rcParams.update({'font.size': 20})
createGroundTruthCreation()
| 36.168459 | 146 | 0.651373 | import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.cm
from scipy.signal.windows import gaussian
import sklearn.metrics
from DataSet import createDataSetFromFile
from Utils import getProjectPath
from Evaluation import getSpecificCol... | 0 | 0 | 0 | 0 | 0 | 9,384 | 0 | 175 | 346 |
7ca55fae0b20b4213cd5dea9d90664287f5cdc5c | 655 | py | Python | Ch9/datadefault_start.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | Ch9/datadefault_start.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | Ch9/datadefault_start.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | # Python Object Oriented Programming by Joe Marini course example
# implementing default values in data classes
# Default Values always have to come first - i.e. before non-default values.
b1 = Book("War and Peace", "Leo Tolstoy", 1225)
b2 = Book("The Catcher in the Rye", "JD Salinger", 234)
print(b1)
print(b2)
| 27.291667 | 77 | 0.720611 | # Python Object Oriented Programming by Joe Marini course example
# implementing default values in data classes
# Default Values always have to come first - i.e. before non-default values.
from dataclasses import dataclass, field
import random
def price_func():
return float(random.randrange(20, 40))
@dataclass... | 0 | 198 | 0 | 0 | 0 | 39 | 0 | 11 | 91 |
7dc6f35c51c58e0ce7864e4def04a2076bf3889b | 2,954 | py | Python | modules/compressor.py | zeroone2numeral2/nmjpeg-bot | 8c77b0b90933cf2efb221fdad097e2087deae1f1 | [
"MIT"
] | 6 | 2018-03-25T02:04:18.000Z | 2020-07-03T04:22:30.000Z | modules/compressor.py | zeroone2numeral2/nmjpeg-bot | 8c77b0b90933cf2efb221fdad097e2087deae1f1 | [
"MIT"
] | null | null | null | modules/compressor.py | zeroone2numeral2/nmjpeg-bot | 8c77b0b90933cf2efb221fdad097e2087deae1f1 | [
"MIT"
] | 1 | 2019-08-12T16:25:12.000Z | 2019-08-12T16:25:12.000Z | import os
import sys
import logging
logger = logging.getLogger(__name__)
BASE_FILE_PATH = os.path.abspath(os.path.dirname(sys.argv[0])) + '/tmp/{}_{}.jpg'
private_chat = FilterPrivateChat()
photo_reply = FilterReplyToPhoto()
| 28.403846 | 89 | 0.651997 | import os
import sys
import logging
from telegram.ext import MessageHandler
from telegram.ext import CommandHandler
from telegram.ext import Filters
from telegram.ext import BaseFilter
from telegram.ext.dispatcher import run_async
from picture import Picture
logger = logging.getLogger(__name__)
BASE_F... | 0 | 343 | 0 | 1,592 | 0 | 357 | 0 | 91 | 317 |
c06ed1ad8feac712313aca6df1e744a56c3c1611 | 2,687 | py | Python | python/observesim/observations.py | jsobeck/observesim | 8019c3031ad24cd08d9eb0e68b3fbe534a2d30ad | [
"BSD-3-Clause"
] | null | null | null | python/observesim/observations.py | jsobeck/observesim | 8019c3031ad24cd08d9eb0e68b3fbe534a2d30ad | [
"BSD-3-Clause"
] | null | null | null | python/observesim/observations.py | jsobeck/observesim | 8019c3031ad24cd08d9eb0e68b3fbe534a2d30ad | [
"BSD-3-Clause"
] | null | null | null |
"""Observations module class.
Dependencies:
numpy
scipy
"""
| 26.343137 | 67 | 0.54038 | import numpy as np
"""Observations module class.
Dependencies:
numpy
scipy
"""
class Observations(object):
"""Observations class.
Parameters:
----------
observatory : string
Observatory for tiles ('apo' or 'lco'; default 'apo')
Attributes:
----------
nobservations : np.int... | 0 | 0 | 0 | 2,578 | 0 | 0 | 0 | -3 | 45 |
eba7469e17fc1598df3072271972a8ee3c7065f4 | 13,859 | py | Python | main.py | aziznal/luigi-sacco-and-route-encryption | 7e9ebba5572ef58e9f47bca9d443b93d579624d5 | [
"MIT"
] | 1 | 2022-02-24T18:34:36.000Z | 2022-02-24T18:34:36.000Z | main.py | aziznal/luigi-sacco-and-route-encryption | 7e9ebba5572ef58e9f47bca9d443b93d579624d5 | [
"MIT"
] | null | null | null | main.py | aziznal/luigi-sacco-and-route-encryption | 7e9ebba5572ef58e9f47bca9d443b93d579624d5 | [
"MIT"
] | null | null | null | from typing import Callable, Literal, Tuple
from PyQt5.QtWidgets import QApplication, QComboBox, QWidget
from PyQt5.QtGui import QPixmap
from gui import Gui
from logic.luigi_sacco import luigi_sacco_encrypt, luigi_sacco_decrypt, confirm_text_in_correct_lang, format_key_and_input_text
from logic.route_encryption imp... | 29.054507 | 139 | 0.696082 | from typing import Callable, Literal, Tuple
from PyQt5.QtWidgets import QApplication, QComboBox, QWidget
from PyQt5.QtGui import QPixmap
from gui import Gui
from logic.luigi_sacco import luigi_sacco_encrypt, luigi_sacco_decrypt, confirm_text_in_correct_lang, format_key_and_input_text
from logic.route_encryption imp... | 0 | 0 | 0 | 0 | 0 | 54 | 0 | 0 | 79 |
0d783e56e550a44e98454d237e710237dfde05ff | 5,589 | py | Python | Random-Programs/dev/battle.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | Random-Programs/dev/battle.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | Random-Programs/dev/battle.py | naumoff0/Archive | d4ad2da89abb1576dd5a7c72ded6bf9b45c3f610 | [
"MIT"
] | null | null | null | """ this program kills humans """
import sys
import time
import random
import builtins
import termcolor
PRINT_SPEED = 0.005
DEBUG_MODE = False
def remove_lines(amount):
""" deletes lines printed previously """
cursor_up = "\x1b[1A"
erase = "\x1b[2K"
for _ in range(amount):
sys.stdout.write(... | 25.75576 | 102 | 0.55985 | """ this program kills humans """
import sys
import time
import random
import builtins
import termcolor
PRINT_SPEED = 0.005
DEBUG_MODE = False
class human:
""" a human exists... to die """
def __init__(self, name):
self.hp = 10
self.incombat = False
self.name = name
self.advant... | 0 | 0 | 0 | 680 | 0 | 0 | 0 | 0 | 23 |
ae1e992f116581312c1a1a97506a08f6cff69711 | 6,426 | py | Python | validation/GCMC/TIP3_DIOX/build/create_solvent_boxes.py | GregorySchwing/wolfCalibration | 9ff7ca7f0d144da407c14f0f4e9a202c4691de2d | [
"MIT"
] | null | null | null | validation/GCMC/TIP3_DIOX/build/create_solvent_boxes.py | GregorySchwing/wolfCalibration | 9ff7ca7f0d144da407c14f0f4e9a202c4691de2d | [
"MIT"
] | null | null | null | validation/GCMC/TIP3_DIOX/build/create_solvent_boxes.py | GregorySchwing/wolfCalibration | 9ff7ca7f0d144da407c14f0f4e9a202c4691de2d | [
"MIT"
] | null | null | null | from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.PDBIO import PDBIO
import numpy as np
import shutil
f = open("log.txt", "a")
parser = PDBParser(PERMISSIVE=1)
structure_id = "3rgk"
filename = "../1-1-build/MYO_HEME_MUT.pdb"
structure = parser.get_structure(structure_id, filename)
atoms = structure.get_atoms()
lis... | 36.931034 | 110 | 0.583411 | from Bio.PDB.PDBParser import PDBParser
from Bio.PDB.PDBIO import PDBIO
import numpy as np
import shutil
f = open("log.txt", "a")
parser = PDBParser(PERMISSIVE=1)
structure_id = "3rgk"
filename = "../1-1-build/MYO_HEME_MUT.pdb"
structure = parser.get_structure(structure_id, filename)
atoms = structure.get_atoms()
lis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0276c7a19b751d8212996f1a3edd5965b18f8e95 | 9,764 | py | Python | src/SALib/util/__init__.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | 1 | 2019-12-20T00:32:45.000Z | 2019-12-20T00:32:45.000Z | src/SALib/util/__init__.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | null | null | null | src/SALib/util/__init__.py | QianWanghhu/SALib | 95a3371e503f9253cb917b8f0101c0202b969c2b | [
"MIT"
] | null | null | null | """A set of utility functions
"""
from collections import OrderedDict
from typing import Dict, Tuple
import numpy as np # type: ignore
import scipy as sp # type: ignore
from typing import List
from .util_funcs import (avail_approaches, read_param_file, _check_bounds)
from .results import ResultDict
__all__ = ["s... | 32.013115 | 89 | 0.600676 | """A set of utility functions
"""
from collections import OrderedDict
import pkgutil
from typing import Dict, Tuple
import numpy as np # type: ignore
import scipy as sp # type: ignore
from scipy import stats
from typing import List
from .util_funcs import (avail_approaches, read_param_file, _check_bounds, _check_g... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21 | 66 |
e9c9dd925406982a79befda5862e8bff57412e0d | 2,585 | py | Python | search.py | mizuff/gbf-rapid-search | 3d6ab8cdba5b4f3a4e9fe956056fe3f7d0bc0a7d | [
"0BSD"
] | 5 | 2018-03-06T02:23:21.000Z | 2019-04-25T06:38:05.000Z | search.py | mizuff/gbf-rapid-search | 3d6ab8cdba5b4f3a4e9fe956056fe3f7d0bc0a7d | [
"0BSD"
] | 1 | 2021-01-29T04:18:14.000Z | 2021-01-29T04:18:14.000Z | search.py | bookii/gbf-rapid-search | 3d6ab8cdba5b4f3a4e9fe956056fe3f7d0bc0a7d | [
"0BSD"
] | 4 | 2019-09-27T08:17:20.000Z | 2021-03-14T03:43:56.000Z | # -*- coding: utf-8 -*-
# Consumer Key
CK = 'consumer_key'
CS = 'consumer_secret'
AT = 'access_token'
AS = 'access_token_secret'
FILTER_URL = 'https://stream.twitter.com/1.1/statuses/filter.json'
# ID
# string
if __name__ == "__main__":
main()
| 29.712644 | 114 | 0.597292 | # -*- coding: utf-8 -*-
import json
import re
import subprocess
import sys
import time
from requests_oauthlib import OAuth1Session
# 取得したConsumer Key等と置き換えてください
CK = 'consumer_key'
CS = 'consumer_secret'
AT = 'access_token'
AS = 'access_token_secret'
FILTER_URL = 'https://stream.twitter.com/1.1/statuses/filter.json'... | 330 | 0 | 0 | 0 | 0 | 1,974 | 0 | -25 | 273 |
91ea2b2a100b4f84af908e54d6c94e5a481595ad | 8,090 | py | Python | pysnmp/ASCEND-MIBTRANSACTION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ASCEND-MIBTRANSACTION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ASCEND-MIBTRANSACTION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ASCEND-MIBTRANSACTION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBTRANSACTION-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:12:43 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... | 139.482759 | 1,428 | 0.813103 | #
# PySNMP MIB module ASCEND-MIBTRANSACTION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-MIBTRANSACTION-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:12:43 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... | 0 | 0 | 0 | 21 | 0 | 0 | 0 | 0 | 22 |
b04416d3afeafec6d7544afdc6277f1a157d0148 | 5,608 | py | Python | Applications/SIR/plotting.py | lcbendall/numerical_computing | 565cde92525ea44c55abe933c6419c1543f9800b | [
"CC-BY-3.0"
] | null | null | null | Applications/SIR/plotting.py | lcbendall/numerical_computing | 565cde92525ea44c55abe933c6419c1543f9800b | [
"CC-BY-3.0"
] | null | null | null | Applications/SIR/plotting.py | lcbendall/numerical_computing | 565cde92525ea44c55abe933c6419c1543f9800b | [
"CC-BY-3.0"
] | null | null | null | #! /usr/bin/env python
from __future__ import division
# Example()
# Exercise1()
# Exercise2()
# Exercise2a()
# Exercise2b()
Exercise3()
# Exercise4()
| 27.223301 | 120 | 0.599857 | #! /usr/bin/env python
from __future__ import division
from scipy.integrate import ode
import numpy as np
import matplotlib.pyplot as plt
from solution import SIR #, SIRS, SIS
from scikits import bvp_solver
def Example():
a, ya, b = 0., 2., 1.6
def ode_f(t,y):
return np.array([-1.*y+6.+2.*t])
ode_object = od... | 0 | 0 | 0 | 0 | 0 | 5,126 | 0 | 29 | 289 |
abed2523cd069a7a9682de47eb8de08c27d3fef1 | 61 | py | Python | sheetsync/version.py | guykisel/SheetSync | b6fa15f14320c2ae4fec88747f1f311dcabbac7b | [
"MIT"
] | 1 | 2017-03-30T17:38:06.000Z | 2017-03-30T17:38:06.000Z | sheetsync/version.py | guykisel/SheetSync | b6fa15f14320c2ae4fec88747f1f311dcabbac7b | [
"MIT"
] | null | null | null | sheetsync/version.py | guykisel/SheetSync | b6fa15f14320c2ae4fec88747f1f311dcabbac7b | [
"MIT"
] | null | null | null | # Single place version should be set.
__version__ = '0.2.2'
| 20.333333 | 38 | 0.704918 | # Single place version should be set.
__version__ = '0.2.2'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4e67bf9d3581151e96fe9476c73689ab77c5975d | 8,084 | py | Python | deepracer_env_config/config_server.py | aws-deepracer/deepracer-env-config | 9df38766ac3f35f9138ed8a48f96e9cf367d44c0 | [
"Apache-2.0"
] | null | null | null | deepracer_env_config/config_server.py | aws-deepracer/deepracer-env-config | 9df38766ac3f35f9138ed8a48f96e9cf367d44c0 | [
"Apache-2.0"
] | null | null | null | deepracer_env_config/config_server.py | aws-deepracer/deepracer-env-config | 9df38766ac3f35f9138ed8a48f96e9cf367d44c0 | [
"Apache-2.0"
] | null | null | null | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | 35.769912 | 103 | 0.537853 | #################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"). ... | 0 | 208 | 0 | 6,078 | 0 | 0 | 0 | 282 | 245 |
4b332e150db5ee5e6294b41aa93700fbb5552631 | 756 | py | Python | sendinblue/jinja.py | apihackers/wagtail-sendinblue | c52a3ab22c1cb6a919326b9b20bb8bb69e95f7bc | [
"MIT"
] | 1 | 2018-02-01T16:39:08.000Z | 2018-02-01T16:39:08.000Z | sendinblue/jinja.py | apihackers/wagtail-sendinblue | c52a3ab22c1cb6a919326b9b20bb8bb69e95f7bc | [
"MIT"
] | null | null | null | sendinblue/jinja.py | apihackers/wagtail-sendinblue | c52a3ab22c1cb6a919326b9b20bb8bb69e95f7bc | [
"MIT"
] | null | null | null |
settings = SendinBlueExtension
| 26.068966 | 64 | 0.752646 | import jinja2
from jinja2.ext import Extension
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from .models import SendinBlueSettings
@jinja2.contextfunction
def sendinblue(context):
request = context['request']
settings = SendinBlueSettings.for_site(request... | 0 | 282 | 0 | 207 | 0 | 0 | 0 | 74 | 158 |
f2d36c2c036a4f007ec818bf94e1b480398a8fa1 | 533 | py | Python | inserthelper.py | gabalese/py-BookBundler | 22420a2f865b3f5612962130412c2e93a2ae89ab | [
"MIT"
] | 2 | 2021-05-25T10:34:58.000Z | 2022-02-18T06:40:11.000Z | inserthelper.py | bigdig/SkinAI | 50c7e025d4c3ad6a7c9a2d5a227caf8314f352be | [
"MIT"
] | null | null | null | inserthelper.py | bigdig/SkinAI | 50c7e025d4c3ad6a7c9a2d5a227caf8314f352be | [
"MIT"
] | 1 | 2019-09-29T15:18:29.000Z | 2019-09-29T15:18:29.000Z | import database
import os
DIRECTORY = "pages/"
# helper script to add target contents to db
# could be refactored to accept a list of files via shell expansion
if __name__ == "__main__":
# test script
db = database.Database()
for path, dirs, files in os.walk(os.path.abspath(DIRECTORY)):
for singu... | 28.052632 | 72 | 0.630394 | import database
import os
DIRECTORY = "pages/"
# helper script to add target contents to db
# could be refactored to accept a list of files via shell expansion
if __name__ == "__main__":
# test script
db = database.Database()
for path, dirs, files in os.walk(os.path.abspath(DIRECTORY)):
for singu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f067864d9da92540424c0e9ce762420e165a9ec6 | 296 | py | Python | Python/py-check-strict-superset.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | 1 | 2020-07-28T00:08:38.000Z | 2020-07-28T00:08:38.000Z | Python/py-check-strict-superset.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | null | null | null | Python/py-check-strict-superset.py | DacioRomero/HackerRank | d1d43bd23e319bf8015a741eca70ba471a13c045 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 21.142857 | 48 | 0.5 | def main():
A = set(map(int, input().split()))
for _ in range(int(input())):
subset = set(map(int, input().split()))
if A.intersection(subset) != subset:
print('False')
break
else:
print('True')
if __name__ == '__main__':
main()
| 0 | 0 | 0 | 0 | 0 | 235 | 0 | 0 | 22 |
918279db550254174256b45efa403096b528d2d6 | 20,754 | py | Python | SciDataTool/Methods/DataND/plot_2D_Data.py | EOMYS-Public/SciDataTool | dd74504fbed8e4071582981ff8736c37f1c25bdc | [
"Apache-2.0"
] | null | null | null | SciDataTool/Methods/DataND/plot_2D_Data.py | EOMYS-Public/SciDataTool | dd74504fbed8e4071582981ff8736c37f1c25bdc | [
"Apache-2.0"
] | null | null | null | SciDataTool/Methods/DataND/plot_2D_Data.py | EOMYS-Public/SciDataTool | dd74504fbed8e4071582981ff8736c37f1c25bdc | [
"Apache-2.0"
] | null | null | null | from SciDataTool.Functions.Plot.plot_2D import plot_2D
from SciDataTool.Functions.Plot import (unit_dict, norm_dict, axes_dict, COLORS)
from SciDataTool.Functions.Load.import_class import import_class
from SciDataTool.Classes.Norm_indices import Norm_indices
from numpy import (squeeze, split, array, where, unique, nanm... | 32.995231 | 154 | 0.504963 | from SciDataTool.Functions.Plot.plot_2D import plot_2D
from SciDataTool.Functions.Plot import (
unit_dict,
norm_dict,
axes_dict,
COLORS,
)
from SciDataTool.Functions.Load.import_class import import_class
from SciDataTool.Classes.Norm_indices import Norm_indices
from numpy import (
squeeze,
split... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 70 | 0 |
617b66d0fa72fce403e4b7e7d45099612d8d9b4e | 817 | py | Python | api/cities.py | csmets/travel-wish-list | 83d49d93e6f50fd20839f2097f8936cd88f166fb | [
"MIT"
] | null | null | null | api/cities.py | csmets/travel-wish-list | 83d49d93e6f50fd20839f2097f8936cd88f166fb | [
"MIT"
] | null | null | null | api/cities.py | csmets/travel-wish-list | 83d49d93e6f50fd20839f2097f8936cd88f166fb | [
"MIT"
] | null | null | null | #!/usr/bin/python3
| 20.425 | 61 | 0.518972 | #!/usr/bin/python3
import json
import falcon
from database import Database
class City(object):
def on_get(self, req, resp, country, city):
db = Database()
country_data = db.fetch('countries', 'name', country)
country_code = country_data['code']
if city.lower() == 'all':
... | 0 | 0 | 0 | 718 | 0 | 0 | 0 | -10 | 90 |
1c85d6299243c4559cbeefd7d9134659dcbdcb5b | 294 | py | Python | src/python/nimbusml/utils/__init__.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 134 | 2018-11-01T22:15:24.000Z | 2019-05-04T11:30:08.000Z | src/python/nimbusml/utils/__init__.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 226 | 2019-05-07T19:00:44.000Z | 2021-01-06T07:59:48.000Z | src/python/nimbusml/utils/__init__.py | michaelgsharp/NimbusML | 50031157265f49eec85d27fe67582d9ddaf01ef9 | [
"MIT"
] | 43 | 2019-05-15T20:19:42.000Z | 2022-03-30T10:26:07.000Z | from .utils import get_X_y, evaluate_binary_classifier, load_img, ColumnSelector
try:
from inspect import signature
except ImportError:
from funcsigs import signature
__all__ = [
'get_X_y',
'evaluate_binary_classifier',
'load_img',
'ColumnSelector',
'signature'
]
| 19.6 | 80 | 0.727891 | from .utils import get_X_y, evaluate_binary_classifier, load_img, ColumnSelector
try:
from inspect import signature
except ImportError:
from funcsigs import signature
__all__ = [
'get_X_y',
'evaluate_binary_classifier',
'load_img',
'ColumnSelector',
'signature'
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
60d00d09c6b6a5e3e2a4aaaca9cc01937f5f3d0b | 4,554 | py | Python | gcloud/tasktmpl3/sites/utils.py | gangh/bk-sops | 29f4b4915be42650c2eeee637e0cf798e4066f09 | [
"Apache-2.0"
] | 1 | 2019-12-23T07:23:35.000Z | 2019-12-23T07:23:35.000Z | gcloud/tasktmpl3/sites/utils.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 9 | 2020-02-12T03:15:49.000Z | 2021-06-10T22:04:51.000Z | gcloud/tasktmpl3/sites/utils.py | bk-sops/bk-sops | 9f5950b13473bf7b5032528b20016b7a571bb3cd | [
"Apache-2.0"
] | 1 | 2022-01-17T11:32:05.000Z | 2022-01-17T11:32:05.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making PaaS (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance ... | 36.432 | 115 | 0.539306 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 141 | 0 | 0 | 0 | 0 | 3,760 | 0 | 0 | 23 |
a3c9bf11fc548a2900def0c6b7c4d550e107b31f | 231 | py | Python | lab6/q1/l6q1b.py | nandiniproothi/itt-lab | fb0381c00abc94fb0653e8e723ca6c3f60c0f7b3 | [
"MIT"
] | 11 | 2021-02-21T14:44:28.000Z | 2021-05-30T10:11:18.000Z | lab6/q1/l6q1b.py | nandiniproothi/itt-lab | fb0381c00abc94fb0653e8e723ca6c3f60c0f7b3 | [
"MIT"
] | null | null | null | lab6/q1/l6q1b.py | nandiniproothi/itt-lab | fb0381c00abc94fb0653e8e723ca6c3f60c0f7b3 | [
"MIT"
] | 1 | 2021-05-05T05:39:56.000Z | 2021-05-05T05:39:56.000Z | import re
s = "is this a string?!"
print("The original string is : " + s)
res = re.sub(r'[^\w\s]', '', s) #remove any char that is not a word, space, or tab using regex
print("The string after removing punctuation is: " + res)
| 23.1 | 94 | 0.645022 | import re
s = "is this a string?!"
print("The original string is : " + s)
res = re.sub(r'[^\w\s]', '', s) #remove any char that is not a word, space, or tab using regex
print("The string after removing punctuation is: " + res)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e2998563bd59901909ecc6b9bc2b036a4c157519 | 3,268 | py | Python | BSTU App/BSTU App/Database/DatabaseManagement/NavigationDB/Premise/GUK/Stage_5.py | alextar04/BSTU-APP | ff9df53335be4a94a1e04d4d4072b3bba18ba08b | [
"MIT"
] | null | null | null | BSTU App/BSTU App/Database/DatabaseManagement/NavigationDB/Premise/GUK/Stage_5.py | alextar04/BSTU-APP | ff9df53335be4a94a1e04d4d4072b3bba18ba08b | [
"MIT"
] | null | null | null | BSTU App/BSTU App/Database/DatabaseManagement/NavigationDB/Premise/GUK/Stage_5.py | alextar04/BSTU-APP | ff9df53335be4a94a1e04d4d4072b3bba18ba08b | [
"MIT"
] | null | null | null | import os
os.chdir('../../..')
PremiseRemove()
PremiseAdd() | 61.660377 | 93 | 0.705936 | import os
from peewee import *
from NavigationDB.Premise.PremiseDB import Premise
def PremiseAdd():
Premise.create(id=137, idMap=5, idTypePremise=0, name="515а", description="ГУК 515а")
Premise.create(id=138, idMap=5, idTypePremise=0, name="517", description="ГУК 517")
Premise.create(id=139, idMap=5, idTy... | 298 | 0 | 0 | 0 | 0 | 2,939 | 0 | 28 | 90 |
b2df41919d3facb549d20991b7050ec9f9c68b19 | 1,131 | py | Python | src/AgentAI/aiframework/AIModelParameter.py | Passer-D/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 1,210 | 2020-08-18T07:57:36.000Z | 2022-03-31T15:06:05.000Z | src/AgentAI/aiframework/AIModelParameter.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 37 | 2020-08-24T02:48:38.000Z | 2022-01-30T06:41:52.000Z | src/AgentAI/aiframework/AIModelParameter.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 275 | 2020-08-18T08:35:16.000Z | 2022-03-31T15:06:07.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... | 41.888889 | 111 | 0.727675 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... | 0 | 0 | 0 | 716 | 0 | 0 | 0 | 0 | 23 |
1f9c259eab6beff9924a84b7996362aabcacc9cf | 535 | py | Python | day3/supermarket.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | 1 | 2019-06-13T13:52:09.000Z | 2019-06-13T13:52:09.000Z | day3/supermarket.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | null | null | null | day3/supermarket.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu May 9 10:29:45 2019
@author: DiPu
"""
from collections import OrderedDict
od=OrderedDict()
while True:
user_inp = input("Enter Product: ")
if user_inp == "":
break
user_inp = user_inp.split()
key = " ".join(user_inp[:-1])
value = int(user_inp... | 17.833333 | 39 | 0.530841 | # -*- coding: utf-8 -*-
"""
Created on Thu May 9 10:29:45 2019
@author: DiPu
"""
from collections import OrderedDict
od=OrderedDict()
while True:
user_inp = input("Enter Product: ")
if user_inp == "":
break
user_inp = user_inp.split()
key = " ".join(user_inp[:-1])
value = int(user_inp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
75835994dc81359fee88e3157fca38504d792923 | 1,500 | py | Python | neutron/plugins/bigswitch/routerrule_db.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | 5 | 2015-10-20T07:56:53.000Z | 2017-12-31T22:39:15.000Z | neutron/plugins/bigswitch/routerrule_db.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/bigswitch/routerrule_db.py | sajuptpm/notification_neutron | 45933f63c9eff0d2931a7209b040ff2dc69835c5 | [
"Apache-2.0"
] | 3 | 2015-05-08T22:36:28.000Z | 2015-10-24T21:25:35.000Z | # Copyright 2013, Big Switch Networks
# All Rights Reserved.
#
# 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 requ... | 38.461538 | 78 | 0.656667 | # Copyright 2013, Big Switch Networks
# All Rights Reserved.
#
# 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 requ... | 0 | 0 | 0 | 730 | 0 | 0 | 0 | 19 | 114 |
c054d5e14cb3c24004c03f3f34246371b7c0bd0c | 315 | py | Python | Mundo 2/Ex048.py | FelipeDreissig/Prog-em-Py---CursoEmVideo | 59a85e228b4c7bc0738d1a213e71b0f7fb07d03a | [
"MIT"
] | null | null | null | Mundo 2/Ex048.py | FelipeDreissig/Prog-em-Py---CursoEmVideo | 59a85e228b4c7bc0738d1a213e71b0f7fb07d03a | [
"MIT"
] | null | null | null | Mundo 2/Ex048.py | FelipeDreissig/Prog-em-Py---CursoEmVideo | 59a85e228b4c7bc0738d1a213e71b0f7fb07d03a | [
"MIT"
] | null | null | null | ### soma de nmeros
print('Iremos somar nmeros mpares que so mltiplos de 3')
s = 0
p = 0
for c in range(1,501,2):
print(c, end=' ')
if c%3==0:
p = p + 1
s = s + c
print('\nA soma de todos os nmeros mpares que so mltiplos de 3 {}.\n O total de nmeros mltiplos {}.'.format(s, p)) | 31.5 | 124 | 0.596825 | ### soma de números
print('Iremos somar números ímpares que são múltiplos de 3')
s = 0
p = 0
for c in range(1,501,2):
print(c, end=' ')
if c%3==0:
p = p + 1
s = s + c
print('\nA soma de todos os números ímpares que são múltiplos de 3 é {}.\n O total de números múltiplos é {}.'.format(s, p)) | 26 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cf5a28dbd86e8414bfaddf8c6202802aaaded915 | 14,327 | py | Python | testcases/OpenStack/vPing/vping_util.py | rski/functest-mirror | 7a2538438eab7a406c821acd7c72352f4a6ba364 | [
"Apache-2.0"
] | null | null | null | testcases/OpenStack/vPing/vping_util.py | rski/functest-mirror | 7a2538438eab7a406c821acd7c72352f4a6ba364 | [
"Apache-2.0"
] | null | null | null | testcases/OpenStack/vPing/vping_util.py | rski/functest-mirror | 7a2538438eab7a406c821acd7c72352f4a6ba364 | [
"Apache-2.0"
] | null | null | null | import pprint
import functest.utils.functest_utils as ft_utils
FUNCTEST_REPO = ft_utils.FUNCTEST_REPO
NAME_VM_1 = ft_utils.get_functest_config('vping.vm_name_1')
NAME_VM_2 = ft_utils.get_functest_config('vping.vm_name_2')
VM_BOOT_TIMEOUT = 180
VM_DELETE_TIMEOUT = 100
PING_TIMEOUT = ft_utils.get_functest_config('vpin... | 31.010823 | 79 | 0.580024 | import os
import pprint
import re
import sys
import time
import paramiko
from scp import SCPClient
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
FUNCTEST_REPO = ft_utils.FUNCTEST_REPO
NAME_VM_1 = ft_utils.get_functest_config('vping.vm_name_1')
NAME_VM_2 = ft_utils... | 0 | 0 | 0 | 0 | 0 | 12,151 | 0 | -19 | 684 |
3628d9d479bbe8458d81ca54ccbdce2f1d00cf41 | 919 | py | Python | src/analysis/duration/warping.py | EstevaoVieira/spikelearn | 060206558cc37c31493f1c9f01412d90375403cb | [
"MIT"
] | null | null | null | src/analysis/duration/warping.py | EstevaoVieira/spikelearn | 060206558cc37c31493f1c9f01412d90375403cb | [
"MIT"
] | null | null | null | src/analysis/duration/warping.py | EstevaoVieira/spikelearn | 060206558cc37c31493f1c9f01412d90375403cb | [
"MIT"
] | null | null | null | from spikelearn.data import io, select, to_feature_array, SHORTCUTS
from spikelearn.models.shuffle_decoding import shuffle_cross_predict
import pickle
allres = {}
for rat, dset in product(SHORTCUTS['group']['eletro'], DSETS):
data = select(io.load(rat, dset), _min_duration=.5, is_tired=False)
tercils = [data.d... | 45.95 | 80 | 0.713819 | from spikelearn.data import io, select, to_feature_array, SHORTCUTS
from spikelearn.models.shuffle_decoding import shuffle_cross_predict
from catboost import CatBoostClassifier
from sklearn.linear_model import BayesianRidgeRegression
import pickle
allres = {}
for rat, dset in product(SHORTCUTS['group']['eletro'], DSE... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 44 |
5ae2e5d8421127ef312b8bedb5149f9d2700c48b | 798 | py | Python | pytrade/__broker/__init__.py | sasano8/magnet-migrade | b5669b34a6a3b845df8df96dfedaf967df6b88e2 | [
"MIT"
] | null | null | null | pytrade/__broker/__init__.py | sasano8/magnet-migrade | b5669b34a6a3b845df8df96dfedaf967df6b88e2 | [
"MIT"
] | 4 | 2021-03-24T23:38:22.000Z | 2021-03-31T07:24:30.000Z | pytrade/__broker/__init__.py | sasano8/magnet-migrade | b5669b34a6a3b845df8df96dfedaf967df6b88e2 | [
"MIT"
] | null | null | null |
from .. import logic
# class Calculator:
# def __init__(self, allocated_margin: Decimal):
# self.margin = allocated_margin
# def calc_amount_and_round_by_unit(self, real_price: Decimal, min_unit: Decimal):
# return logic.calc_unit_amount(
# budget=self.margin, real_price=real_pric... | 33.25 | 86 | 0.692982 | from decimal import Decimal
from .. import logic
from ..portfolio import VirtualAccount
# class Calculator:
# def __init__(self, allocated_margin: Decimal):
# self.margin = allocated_margin
# def calc_amount_and_round_by_unit(self, real_price: Decimal, min_unit: Decimal):
# return logic.calc_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 44 |
077cd167f7e416bf1feacdd22f3ce9f5d2b54a8e | 9,897 | py | Python | codes/data_scripts/extract_subimages.py | Yangzhen0000/EDVR | 388ae869a1b4e2e6399f5feeea1f3acc969a3c75 | [
"Apache-2.0"
] | null | null | null | codes/data_scripts/extract_subimages.py | Yangzhen0000/EDVR | 388ae869a1b4e2e6399f5feeea1f3acc969a3c75 | [
"Apache-2.0"
] | null | null | null | codes/data_scripts/extract_subimages.py | Yangzhen0000/EDVR | 388ae869a1b4e2e6399f5feeea1f3acc969a3c75 | [
"Apache-2.0"
] | null | null | null | """A multi-thread tool to crop large images to sub-images for faster IO."""
import os.path as osp
import sys
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
if __name__ == '__main__':
main()
| 40.896694 | 131 | 0.579469 | """A multi-thread tool to crop large images to sub-images for faster IO."""
import os
import os.path as osp
import sys
from multiprocessing import Pool
import numpy as np
import cv2
from PIL import Image
sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__))))
from utils.util import ProgressBar # noqa: E402
im... | 0 | 0 | 0 | 0 | 0 | 9,399 | 0 | 6 | 274 |
a6c5666bb6e7e97b7a610fc225c2db5329510d51 | 9,818 | py | Python | synthetic/synthetic_utils.py | mlaugharn/EB_GFN | 2d20b5d37edb9c50e0bc0fb7feedbc390ddfefd7 | [
"MIT"
] | 24 | 2022-02-04T01:48:01.000Z | 2022-03-10T19:01:38.000Z | synthetic/synthetic_utils.py | mlaugharn/EB_GFN | 2d20b5d37edb9c50e0bc0fb7feedbc390ddfefd7 | [
"MIT"
] | null | null | null | synthetic/synthetic_utils.py | mlaugharn/EB_GFN | 2d20b5d37edb9c50e0bc0fb7feedbc390ddfefd7 | [
"MIT"
] | 5 | 2022-03-06T10:44:41.000Z | 2022-03-10T19:01:40.000Z | import torch
import numpy as np
def pairwise_distances(x, y=None):
'''
Input: x is a Nxd matrix
y is an optional Mxd matirx
Output: dist is a NxM matrix where dist[i,j] is the square norm between x[i,:] and y[j,:]
if y is not given then use 'y=x'.
i.e. dist[i,j] = ||x[i,:... | 32.40264 | 116 | 0.574659 | import torch as T
import torch
import torch.nn.functional as F
import numpy as np
import tqdm
import random
import sys, os
from matplotlib import pyplot as plt
from sympy.combinatorics.graycode import GrayCode
import time
import ipdb
def get_true_samples(db, size, bm, int_salce, discrete_dim, seed=None):
if see... | 63 | 0 | 0 | 589 | 0 | 7,713 | 0 | 28 | 657 |
fe9d384ff8c4fedbe2ffc2321bdfe27173895e5f | 783 | py | Python | tests/settings.py | anthonyalmarza/django-timeseries | e7ce5ef15daad18d11e4c0e49603df7d0fff2dc5 | [
"MIT"
] | 15 | 2017-11-04T19:13:11.000Z | 2021-06-08T04:42:31.000Z | tests/settings.py | anthonyalmarza/django-timeseries | e7ce5ef15daad18d11e4c0e49603df7d0fff2dc5 | [
"MIT"
] | 1 | 2019-12-10T23:25:12.000Z | 2019-12-10T23:25:12.000Z | tests/settings.py | anthonyalmarza/timeseries | e7ce5ef15daad18d11e4c0e49603df7d0fff2dc5 | [
"MIT"
] | 2 | 2017-04-24T11:59:04.000Z | 2017-06-07T13:37:09.000Z | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'tdzf@9g8lofi@lo$=126jrka1ydzjix^!8j)vg$6cd+kz^ei5h'
INSTALLED_APPS = [
'django.contrib.contenttypes',
'tests'
]
test_db = os.environ.get('TE... | 25.258065 | 71 | 0.65645 | import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'tdzf@9g8lofi@lo$=126jrka1ydzjix^!8j)vg$6cd+kz^ei5h'
INSTALLED_APPS = [
'django.contrib.contenttypes',
'tests'
]
test_db = os.environ.get('TE... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ba9c44aaf47f5818535f2580276719050a477e45 | 1,284 | py | Python | pygcn/models.py | han-2059/GCN | f7a701e78d761531d3dd26b9485ec19977161711 | [
"MIT"
] | 2 | 2021-07-26T08:06:45.000Z | 2022-01-20T01:18:56.000Z | pygcn/models.py | han-2059/GCN | f7a701e78d761531d3dd26b9485ec19977161711 | [
"MIT"
] | null | null | null | pygcn/models.py | han-2059/GCN | f7a701e78d761531d3dd26b9485ec19977161711 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 34.702703 | 107 | 0.661994 | import torch.nn as nn
import torch.nn.functional as F
from .layers import GraphConvolution
class GCN(nn.Module):
# 底层节点的参数,feature的个数;隐层节点个数;最终的分类数
def __init__(self, nfeat, nhid, nclass, dropout):
'''
:param nfeat: 底层节点的参数,feature的个数
:param nhid: 隐层节点个数
:param ncla... | 594 | 0 | 0 | 971 | 0 | 0 | 0 | 25 | 67 |
85055fd4450669db56357200de53a076f91cd15a | 1,287 | py | Python | Talk/catalog/models.py | alex545228/def_hack_brain | 9d3e9f3918619e32ec187afdb48a17312aa6308c | [
"Apache-2.0"
] | null | null | null | Talk/catalog/models.py | alex545228/def_hack_brain | 9d3e9f3918619e32ec187afdb48a17312aa6308c | [
"Apache-2.0"
] | null | null | null | Talk/catalog/models.py | alex545228/def_hack_brain | 9d3e9f3918619e32ec187afdb48a17312aa6308c | [
"Apache-2.0"
] | 2 | 2021-11-03T21:16:30.000Z | 2021-11-05T08:54:13.000Z |
# class Person(models.Model):
# name = models.CharField(max_length=50)
# age = models.IntegerField()
# city = models.CharField(max_length=50)
# rating = models.IntegerField()
#
#
# class PersonalData(models.Model):
# name = models.CharField(max_length=50)
# mail = models.EmailField(max_lengt... | 33 | 51 | 0.724165 | from django.db import models
class Category(models.Model):
title = models.CharField(max_length=20)
class Group(models.Model):
category = models.CharField(max_length=20)
vk_id = models.IntegerField(null=True)
# class Person(models.Model):
# name = models.CharField(max_length=50)
# age = models.... | 0 | 0 | 0 | 605 | 0 | 0 | 0 | 7 | 91 |
9caef61a006ff74f4975d7994384f2da8800709a | 520 | py | Python | src/Quiet.X.Tests/debug.py | callwyat/Quiet-Firmware | 864c210e44d368a4a683704841067717ebc8ac43 | [
"MIT"
] | null | null | null | src/Quiet.X.Tests/debug.py | callwyat/Quiet-Firmware | 864c210e44d368a4a683704841067717ebc8ac43 | [
"MIT"
] | null | null | null | src/Quiet.X.Tests/debug.py | callwyat/Quiet-Firmware | 864c210e44d368a4a683704841067717ebc8ac43 | [
"MIT"
] | null | null | null | from serial import Serial
from serial.tools.list_ports import comports
qPort = None
for p in list(comports()):
if p.product and 'FT232R' in p.product:
qPort = p.device
break
if not qPort:
raise Exception('No Quiet Board found')
quite = Serial(qPort, 57600, timeout=1)
loops = 0
whil... | 20 | 55 | 0.648077 | from email.charset import QP
from serial import Serial
from serial.tools.list_ports import comports
qPort = None
for p in list(comports()):
if p.product and 'FT232R' in p.product:
qPort = p.device
break
if not qPort:
raise Exception('No Quiet Board found')
quite = Serial(qPort, 5760... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 22 |
29850a776755e89c74dc40bad748f55147252d21 | 1,228 | py | Python | setup.py | morepath/more.body_model | 6f581224adfefb42a9e140350937aa8b4b1de921 | [
"BSD-3-Clause"
] | null | null | null | setup.py | morepath/more.body_model | 6f581224adfefb42a9e140350937aa8b4b1de921 | [
"BSD-3-Clause"
] | 4 | 2017-02-22T15:26:06.000Z | 2021-01-20T14:35:30.000Z | setup.py | morepath/more.body_model | 6f581224adfefb42a9e140350937aa8b4b1de921 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
long_description = (
open("README.rst", encoding="utf-8").read()
+ "\n\n"
+ open("CHANGES.rst", encoding="utf-8").read()
)
setup(
name="more.body_model",
version="0.1dev0",
description="load_json infrastructure for Morepath",
long_description=lon... | 28.55814 | 76 | 0.595277 | from setuptools import setup, find_packages
long_description = (
open("README.rst", encoding="utf-8").read()
+ "\n\n"
+ open("CHANGES.rst", encoding="utf-8").read()
)
setup(
name="more.body_model",
version="0.1dev0",
description="load_json infrastructure for Morepath",
long_description=lon... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0863b84ee32b6351f62db01edd9b09b8388608e0 | 739 | py | Python | scripts/quest/q6508e.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/quest/q6508e.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/quest/q6508e.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | # Teary Expression (6508)
from net.swordie.ms.enums import Stat
camilla = 1012108
rubble = 4000022
ouch = 5160024
# Grab current fame for quest-induced defame later
fame = chr.getStat(Stat.pop)
sm.setSpeakerID(camilla)
sm.sendNext(''.join(["Hello. Is there something I can... Eeek! "
"Is that #t", repr(rubble), "#?... | 28.423077 | 89 | 0.705007 | # Teary Expression (6508)
from net.swordie.ms.enums import Stat
camilla = 1012108
rubble = 4000022
ouch = 5160024
# Grab current fame for quest-induced defame later
fame = chr.getStat(Stat.pop)
sm.setSpeakerID(camilla)
sm.sendNext(''.join(["Hello. Is there something I can... Eeek! "
"Is that #t", repr(rubble), "#?... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0310c49ff233035805061ff9975d3bbd318b49cb | 862 | py | Python | time_app/admin.py | MthwBrwn/Varius_project | 478d423f49665becae41eda60597899d4940050c | [
"MIT"
] | null | null | null | time_app/admin.py | MthwBrwn/Varius_project | 478d423f49665becae41eda60597899d4940050c | [
"MIT"
] | 7 | 2020-02-11T01:59:04.000Z | 2021-06-10T18:04:40.000Z | time_app/admin.py | MthwBrwn/Varius_project | 478d423f49665becae41eda60597899d4940050c | [
"MIT"
] | null | null | null | # from import_export.admin import ImportExportActionModelAdmin
from django.contrib import admin
from .models import Client, Project
# admin.site.register(TimePost)
admin.site.register(Client)
admin.site.register(Project)
| 26.9375 | 62 | 0.704176 | from import_export import resources
from import_export.admin import ImportExportModelAdmin
# from import_export.admin import ImportExportActionModelAdmin
from django.contrib import admin
from .models import TimePost, Client, Project
class TimePostResource(resources.ModelResource):
class Meta:
model = Tim... | 0 | 141 | 0 | 344 | 0 | 0 | 0 | 57 | 89 |
8c154bf2c335e8afd259563bae152d057158498d | 4,174 | py | Python | cosmosis-standard-library/intrinsic_alignments/flexible_grid/bias_grid.py | ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra | 07e5d308c6a8641a369a3e0b8d13c4104988cd2b | [
"BSD-2-Clause"
] | 1 | 2021-09-15T10:10:26.000Z | 2021-09-15T10:10:26.000Z | cosmosis-standard-library/intrinsic_alignments/flexible_grid/bias_grid.py | ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra | 07e5d308c6a8641a369a3e0b8d13c4104988cd2b | [
"BSD-2-Clause"
] | null | null | null | cosmosis-standard-library/intrinsic_alignments/flexible_grid/bias_grid.py | ktanidis2/Modified_CosmoSIS_for_galaxy_number_count_angular_power_spectra | 07e5d308c6a8641a369a3e0b8d13c4104988cd2b | [
"BSD-2-Clause"
] | 1 | 2021-06-11T15:29:43.000Z | 2021-06-11T15:29:43.000Z | from __future__ import print_function
"""
This module calculates the galaxy and intrinsic alignment bias
using the flexible grid parameterisation of Joachimi and Bridle
(2010) p 6-9.
Outputs both stochastic and systematic terms rI, bI, rg and bg.
"""
| 42.161616 | 103 | 0.572353 | from __future__ import print_function
from builtins import range
from builtins import object
import scipy.interpolate as interp
import numpy as np
import pdb
"""
This module calculates the galaxy and intrinsic alignment bias
using the flexible grid parameterisation of Joachimi and Bridle
(2010) p 6-9.
Outputs both sto... | 0 | 0 | 0 | 3,677 | 0 | 69 | 0 | 10 | 156 |
5bd1e639df502451d94703c409a07112f3d074f5 | 3,501 | py | Python | src/core/db/connection.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | src/core/db/connection.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null | src/core/db/connection.py | KevinXuxuxu/datahub_lsems | 87ecaf877117b6747f2432fa4379243fdd3d87bd | [
"MIT"
] | null | null | null |
'''
@author: anant bhardwaj
@date: Oct 3, 2013
DataHub DB wrapper for backends (only postgres implemented)
Any new backend must implement the DataHubConnection interface
'''
| 30.982301 | 78 | 0.734076 | import psycopg2
import re
from backend.mg import MGBackend
'''
@author: anant bhardwaj
@date: Oct 3, 2013
DataHub DB wrapper for backends (only postgres implemented)
Any new backend must implement the DataHubConnection interface
'''
class DataHubConnection:
def __init__(self, user, password, repo_base=None):
... | 0 | 0 | 0 | 3,242 | 0 | 0 | 0 | -7 | 90 |
97d3f582ae3778129b742bcae3eec88c274dde87 | 2,046 | py | Python | djdt_api_requests/panels/api_requests.py | ingresso-group/django-debug-toolbar-api-requests | c95a515bba61e1be1ee6870d734b71491a019ace | [
"MIT"
] | 1 | 2020-05-19T20:07:28.000Z | 2020-05-19T20:07:28.000Z | djdt_api_requests/panels/api_requests.py | ingresso-group/django-debug-toolbar-api-requests | c95a515bba61e1be1ee6870d734b71491a019ace | [
"MIT"
] | 1 | 2018-08-08T14:59:44.000Z | 2018-08-08T14:59:44.000Z | djdt_api_requests/panels/api_requests.py | ingresso-group/django-debug-toolbar-api-requests | c95a515bba61e1be1ee6870d734b71491a019ace | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 31 | 79 | 0.637341 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from debug_toolbar.panels import Panel
from django.utils.translation import ugettext_lazy as _, ungettext
import requests.sessions
def patch_send(send_method, panel):
def patched_send(self, request, **kwargs):
response = send_method(self, ... | 0 | 306 | 0 | 1,124 | 0 | 370 | 0 | 65 | 114 |
9fb8d1876f501522b165c627bb68a7858bed948d | 201 | py | Python | aula15/tupla.py | Eduardo-Quirino/python | acece64c8ed9f35bc94d111861acf65b50ae263c | [
"Apache-2.0"
] | null | null | null | aula15/tupla.py | Eduardo-Quirino/python | acece64c8ed9f35bc94d111861acf65b50ae263c | [
"Apache-2.0"
] | null | null | null | aula15/tupla.py | Eduardo-Quirino/python | acece64c8ed9f35bc94d111861acf65b50ae263c | [
"Apache-2.0"
] | null | null | null | t_carros = ("HRV", "Golf", "Argo")#tupla, no pode alterar o valor
l_carros = list(t_carros)
l_carros[2] = "Focus"
t_carros = tuple(l_carros)
for x in t_carros:
print(x)
input()#lista fica aberta | 25.125 | 66 | 0.691542 | t_carros = ("HRV", "Golf", "Argo")#tupla, não pode alterar o valor
l_carros = list(t_carros)
l_carros[2] = "Focus"
t_carros = tuple(l_carros)
for x in t_carros:
print(x)
input()#lista fica aberta | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16a06257e948c6830419cd90d23115c71afc82b4 | 1,835 | py | Python | build_tools/benchmarks/common/linux_device_utils.py | anthonycanino/iree | be167a62f8872597eac1b72e26b4c62e291bfd5c | [
"Apache-2.0"
] | 1 | 2022-02-12T17:56:47.000Z | 2022-02-12T17:56:47.000Z | build_tools/benchmarks/common/linux_device_utils.py | okkwon/iree | e32cc76952d37a14f73c8a7da889edf47fcc2fce | [
"Apache-2.0"
] | null | null | null | build_tools/benchmarks/common/linux_device_utils.py | okkwon/iree | e32cc76952d37a14f73c8a7da889edf47fcc2fce | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2022 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Utils for accessing Linux device information."""
from typing import Optional,... | 35.980392 | 77 | 0.680654 | #!/usr/bin/env python3
# Copyright 2022 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Utils for accessing Linux device information."""
import re
from typing impor... | 0 | 0 | 0 | 0 | 0 | 192 | 0 | 51 | 46 |
64e7ede2dcf9bdda884108d88c7d2da7d27bbc3b | 8,791 | py | Python | 8.py | ZerocksX/AOC2020 | 930a4d1da9e5a9efe0f1f94cb93d6b39039f774f | [
"MIT"
] | null | null | null | 8.py | ZerocksX/AOC2020 | 930a4d1da9e5a9efe0f1f94cb93d6b39039f774f | [
"MIT"
] | null | null | null | 8.py | ZerocksX/AOC2020 | 930a4d1da9e5a9efe0f1f94cb93d6b39039f774f | [
"MIT"
] | null | null | null | input = """nop +116
acc +12
acc -8
acc +34
jmp +485
acc +42
jmp +388
acc +36
nop +605
acc +17
jmp +411
acc +49
jmp +1
acc -9
jmp +289
jmp +288
jmp +74
acc +4
acc +42
jmp +258
acc +14
acc -13
nop +106
jmp +280
jmp +534
acc +41
acc +40
jmp +224
acc +43
acc +10
nop +240
jmp +211
acc +7
acc... | 11.69016 | 60 | 0.550336 | input = """nop +116
acc +12
acc -8
acc +34
jmp +485
acc +42
jmp +388
acc +36
nop +605
acc +17
jmp +411
acc +49
jmp +1
acc -9
jmp +289
jmp +288
jmp +74
acc +4
acc +42
jmp +258
acc +14
acc -13
nop +106
jmp +280
jmp +534
acc +41
acc +40
jmp +224
acc +43
acc +10
nop +240
jmp +211
acc +7
acc... | 0 | 0 | 0 | 1,955 | 0 | 0 | 0 | 0 | 150 |
9cac231cf2fe33aff15be82cbd15f524945be850 | 7,744 | py | Python | radloggerpy/tests/cli/device/test_device_show.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | radloggerpy/tests/cli/device/test_device_show.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | radloggerpy/tests/cli/device/test_device_show.py | Dantali0n/RadLoggerPy | c630ce730519001ee39fb3a02dd3652943a23067 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
# Copyright (c) 2020 Dantali0n
#
# 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 ... | 38.336634 | 76 | 0.685434 | # -*- encoding: utf-8 -*-
# Copyright (c) 2020 Dantali0n
#
# 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 ... | 0 | 6,236 | 0 | 216 | 0 | 0 | 0 | 374 | 313 |
e0b2a8431f343b1996b3b1f088fb8091f32ff84a | 2,500 | py | Python | faucet.py | topnoom259/railblock | b164ae05d70a2c6af637bcf0f07c74f60f81e175 | [
"BSD-3-Clause"
] | 1 | 2018-11-09T08:53:23.000Z | 2018-11-09T08:53:23.000Z | faucet.py | topnoom259/railblock | b164ae05d70a2c6af637bcf0f07c74f60f81e175 | [
"BSD-3-Clause"
] | null | null | null | faucet.py | topnoom259/railblock | b164ae05d70a2c6af637bcf0f07c74f60f81e175 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# RaiBlocks Telegram bot
# @RaiWalletBot https://t.me/RaiWalletBot
#
# Source code:
# https://github.com/SergiySW/RaiWalletBot
#
# Released under the BSD 3-Clause License
#
#
# Run by cron every hour, 1-2 minutes after distribution starts
# With new rules it can be in... | 27.777778 | 132 | 0.7368 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# RaiBlocks Telegram bot
# @RaiWalletBot https://t.me/RaiWalletBot
#
# Source code:
# https://github.com/SergiySW/RaiWalletBot
#
# Released under the BSD 3-Clause License
#
#
# Run by cron every hour, 1-2 minutes after distribution starts
# With new rules it can be in... | 0 | 0 | 0 | 0 | 0 | 1,237 | 0 | 208 | 155 |
ff12e324df12b9288d3b1c80e2fba0ab24fcb1d8 | 1,762 | py | Python | 2020/day19/solve2.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | 3 | 2021-12-01T09:27:34.000Z | 2022-02-24T23:35:56.000Z | 2020/day19/solve2.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | null | null | null | 2020/day19/solve2.py | krother/advent_of_code | fd7d5199666b2f3a60c41c6cf24b747322ad88e5 | [
"MIT"
] | null | null | null |
# TODO: check https://en.wikipedia.org/wiki/Earley_parser
data = '''
0: 1 2 3
1: "a"
2: "b"
3: 1 1 4 2
4: 1 | 2
abaabb
baaabb
ababab
abaaab
abaabb
abaabc'''.strip()
def solve(rules, message):
"""check whether message matches r"""
queue = [(0, ['0'])]
while queue:
position, (rule, *following... | 22.025 | 66 | 0.529512 |
# TODO: check https://en.wikipedia.org/wiki/Earley_parser
data = '''
0: 1 2 3
1: "a"
2: "b"
3: 1 1 4 2
4: 1 | 2
abaabb
baaabb
ababab
abaaab
abaabb
abaabc'''.strip()
def parse(data):
r, msg = data.strip().split('\n\n')
msg = msg.split('\n')
rules = {}
for line in r.split('\n'):
k, v = l... | 0 | 0 | 0 | 0 | 0 | 413 | 0 | 0 | 69 |
c9da19a1134f1020da00255ec415e6701fe851e1 | 14,390 | py | Python | MainWindow.py | Khairiazim/Uniten-sprout | 1f1ed2368e57c8977aedd59284945661a5befe02 | [
"BSD-3-Clause"
] | null | null | null | MainWindow.py | Khairiazim/Uniten-sprout | 1f1ed2368e57c8977aedd59284945661a5befe02 | [
"BSD-3-Clause"
] | null | null | null | MainWindow.py | Khairiazim/Uniten-sprout | 1f1ed2368e57c8977aedd59284945661a5befe02 | [
"BSD-3-Clause"
] | null | null | null | #todo / schedule/ internet connection
#todo instabot.log at api.py / instabot started at bot.py
#todo set follow followers count limit
#generate random number at server send to apps
#both check
import os
import sys
import errno
from PyQt5 import QtWidgets
#IMPORT INSTABOT
sys.path.append(os.path.join(sy... | 35.183374 | 125 | 0.570327 | #todo / schedule/ internet connection
#todo instabot.log at api.py / instabot started at bot.py
#todo set follow followers count limit
#generate random number at server send to apps
#both check
import os
import random
import shutil
import sys
import time
import threading
import errno
import requests
... | 0 | 0 | 0 | 12,552 | 0 | 0 | 0 | 17 | 401 |
5022073b94aa06c9a780426f2c33cd14e5791612 | 1,978 | py | Python | egressive.py | P4tches/Egress-ive | 403aa2e9aa56ffdff4c465c78ba0be86638ca398 | [
"MIT"
] | null | null | null | egressive.py | P4tches/Egress-ive | 403aa2e9aa56ffdff4c465c78ba0be86638ca398 | [
"MIT"
] | null | null | null | egressive.py | P4tches/Egress-ive | 403aa2e9aa56ffdff4c465c78ba0be86638ca398 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
## Rules
#I1 = ['''-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT''','''-A OUTPUT -j REJECT''']
I1 = ['''ufw-not-local -j DROP'''] #For testing purposes
B1 = ['''-A INPUT -p tcp --dport 53 -j DROP''']
B2 = ['''-A INPUT -p icmp -j REJECT --reject-with icmp-port-unreachable''']
## Check i... | 23.547619 | 108 | 0.664307 | #!/usr/bin/python3
import subprocess,sys
def main():
menu()
def menu():
ruleDump()
print("")
print("Options:")
# Ingress
print(appliedBox(ruleMatch(I1)) + "I1) Only Allow Incoming Traffic (Very Restrictive)")
# Egress
print("E1) Only Allow Top 10,000 Sites (Somewhat Restrictive)")
print("E2) Only Allow 53,80... | 0 | 0 | 0 | 0 | 0 | 1,389 | 0 | 0 | 227 |
0507760acbce99cc1430bb26727d75edc9909bd0 | 1,090 | py | Python | medium/problem113/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | 1 | 2018-02-25T03:45:04.000Z | 2018-02-25T03:45:04.000Z | medium/problem113/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | null | null | null | medium/problem113/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
root = TreeNode(1)
root.left = TreeNode(2)
root.right = TreeNode(3)
solution = Solution()
ans = solution.pathSum(root, 4)
for i in range(len(ans)):
print(ans[i])
| 23.191489 | 56 | 0.53211 | #!/usr/bin/python
# -*- coding: utf-8 -*-
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution(object):
def pathSum(self, root, sum):
"""
:type root: TreeNode
:type sum: int
:rtype: List[List[int]]... | 0 | 0 | 0 | 835 | 0 | 0 | 0 | 0 | 46 |
b2ea83662d0b2689f48c9ba46c2246a7903f0702 | 310 | py | Python | src/main.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2020-04-10T19:32:43.000Z | 2021-05-08T23:39:21.000Z | src/main.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 5 | 2016-09-01T04:38:53.000Z | 2019-01-31T15:51:39.000Z | src/main.py | abeakkas/ipho-unofficial.org | 803ab3cc20670304f7be899ecc48b753765c2ddc | [
"MIT"
] | 7 | 2016-08-10T10:30:59.000Z | 2020-02-21T14:12:35.000Z |
if __name__ == "__main__":
run()
| 16.315789 | 40 | 0.635484 | import countries
import e404
import index
import search
import static_files
import timeline
def run():
print("Creating the whole project")
index.run()
e404.run()
timeline.run()
countries.run()
search.run()
static_files.run()
if __name__ == "__main__":
run()
| 0 | 0 | 0 | 0 | 0 | 146 | 0 | -40 | 163 |
297edefe6ee585ccb2d96661b63396fac71557fd | 8,907 | py | Python | src/GeneralProcess/InitialParser.py | haganenoneko/EphysAnalysisTools | c404e213095ff4f14831d78f810101c19bce152e | [
"MIT"
] | null | null | null | src/GeneralProcess/InitialParser.py | haganenoneko/EphysAnalysisTools | c404e213095ff4f14831d78f810101c19bce152e | [
"MIT"
] | 1 | 2021-12-26T17:09:21.000Z | 2021-12-26T17:09:21.000Z | src/GeneralProcess/InitialParser.py | haganenoneko/EphysAnalysisTools | c404e213095ff4f14831d78f810101c19bce152e | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Delbert Yip
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import GeneralProcess.base as base
"""Find CSV and ABF files that meet selection criteria
This module contains classes and methods that specialize in
1. Applying, but not validating/reading,... | 30.608247 | 108 | 0.581453 | # Copyright (c) 2021 Delbert Yip
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import os
import logging
import pandas as pd
from pathlib import Path
from typing import Dict, Any, List
import GeneralProcess.base as base
from GeneralProcess.ephys_info_filter import EphysIn... | 0 | 1,388 | 0 | 6,227 | 0 | 0 | 0 | 45 | 300 |
b17570f975254eb582451c8008a5f8277305ca87 | 306 | py | Python | fstmt/table/__init__.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fstmt/table/__init__.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | fstmt/table/__init__.py | mission-liao/fin-stmt-additional | da9ef5299e6ff10406996d0cb0975b46498d3c39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 30.6 | 55 | 0.836601 | # -*- coding: utf-8 -*-
from .cost_breakdown import CostBreakdown
from .manufacturing_expense import ManufacturingExpense
from .stock import Stock
from .factory import TableAdaptorFactory
from .me2 import ManufacturingExpense2
from .product_price import ProductPrice
from .product_cost import ProductCost
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 127 | 155 |
7524574830bfd648c2c773c48d37d248d559da32 | 608 | py | Python | oops_fhir/r4/value_set/v3_processing_mode.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_processing_mode.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_processing_mode.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
__all__ = ["v3ProcessingMode"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
| 19.612903 | 69 | 0.733553 | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.v3_processing_mode import (
v3ProcessingMode as v3ProcessingMode_,
)
__all__ = ["v3ProcessingMode"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix... | 0 | 0 | 0 | 253 | 0 | 0 | 0 | 96 | 69 |
457aaaf1dfd9f71afd38241785863148c7859cb4 | 161 | py | Python | uploading/admin.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | uploading/admin.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | uploading/admin.py | trevin-livele/django_api_awwwards | 604a480cfe3d0efc01019c4ba15ffba5c140be0b | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Post, ReviewRating
# Register your models here.
admin.site.register(Post)
admin.site.register(ReviewRating) | 23 | 37 | 0.819876 | from django.contrib import admin
from .models import Post,ReviewRating
# Register your models here.
admin.site.register(Post)
admin.site.register(ReviewRating) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 0 |
a188f1c773c39a2017c2542f0382177d7951c891 | 3,966 | py | Python | cd4ml/ml_model.py | muralipoola/CD4ML-Scenarios | 2efb4adc3221d6daaa28fd62c3df1c1ff2c78424 | [
"MIT"
] | null | null | null | cd4ml/ml_model.py | muralipoola/CD4ML-Scenarios | 2efb4adc3221d6daaa28fd62c3df1c1ff2c78424 | [
"MIT"
] | null | null | null | cd4ml/ml_model.py | muralipoola/CD4ML-Scenarios | 2efb4adc3221d6daaa28fd62c3df1c1ff2c78424 | [
"MIT"
] | null | null | null | import mlflow.sklearn
| 40.469388 | 115 | 0.652547 | import joblib
from wickedhot import OneHotEncoder
from cd4ml.train import get_trained_model
from cd4ml.model_utils import get_target_id_features_lists
import logging
import mlflow.sklearn
import mlflow
import os
from cd4ml.utils.utils import mini_batch_eval
class MLModel:
def __init__(self, algorithm_name,
... | 0 | 0 | 0 | 3,683 | 0 | 0 | 0 | 60 | 200 |
4a3816d4c395304ae8175a3ae48d262adc748f0d | 8,409 | py | Python | games/management/commands/fillrankingdb.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | 1 | 2018-11-10T21:03:48.000Z | 2018-11-10T21:03:48.000Z | games/management/commands/fillrankingdb.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | null | null | null | games/management/commands/fillrankingdb.py | MarkusShepherd/ludoj-server | 6cfb218029e6e1cf520eed1ccab2576c990cd287 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Parses the ranking CSVs and writes them to the database."""
import csv
import logging
import sys
from datetime import timezone
import pandas as pd
csv.field_size_limit(sys.maxsize)
LOGGER = logging.getLogger(__name__)
WEEK_DAYS = ("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT")
d... | 30.139785 | 87 | 0.593888 | # -*- coding: utf-8 -*-
"""Parses the ranking CSVs and writes them to the database."""
import csv
import logging
import os
import sys
from datetime import datetime, timezone
from functools import lru_cache
from itertools import groupby
from pathlib import Path
import pandas as pd
from django.core.management.base i... | 0 | 367 | 0 | 3,195 | 2,720 | 944 | 0 | 116 | 407 |
941ffa52dfc4e009046f91e469fc8909811556a1 | 4,567 | py | Python | event_store_client.py | martinez099/event-store | bc007adcf7ce6a3cb2a9d99cf9ab32708dcb17a9 | [
"MIT"
] | 5 | 2020-06-14T10:08:29.000Z | 2021-07-06T05:46:14.000Z | event_store_client.py | martinez099/event-store | bc007adcf7ce6a3cb2a9d99cf9ab32708dcb17a9 | [
"MIT"
] | null | null | null | event_store_client.py | martinez099/event-store | bc007adcf7ce6a3cb2a9d99cf9ab32708dcb17a9 | [
"MIT"
] | 3 | 2020-09-30T13:49:33.000Z | 2021-09-04T23:48:51.000Z | import json
import os
import uuid
EVENT_STORE_HOSTNAME = os.getenv('EVENT_STORE_HOSTNAME', 'localhost')
EVENT_STORE_PORTNR = os.getenv('EVENT_STORE_PORTNR', '50051')
def create_event(_action, _data):
"""
Create an event.
:param _action: The event action.
:param _data: A dict with the event data.
... | 27.184524 | 92 | 0.592511 | import json
import logging
import os
import threading
import uuid
import grpc
from event_store_pb2 import PublishRequest, SubscribeRequest, UnsubscribeRequest, GetRequest
from event_store_pb2_grpc import EventStoreStub
EVENT_STORE_HOSTNAME = os.getenv('EVENT_STORE_HOSTNAME', 'localhost')
EVENT_STORE_PORTNR = os.gete... | 0 | 0 | 0 | 3,828 | 0 | 0 | 0 | 75 | 158 |
c0752693a81375be4af89460a0fc8ed1656c43af | 2,133 | py | Python | ntgen/utils.py | mrapacz/ntgen | 62f1e04624a0b406060418eb4f89af132a635a3f | [
"MIT"
] | 4 | 2020-03-29T09:31:52.000Z | 2020-04-27T19:02:54.000Z | ntgen/utils.py | mrapacz/ntgen | 62f1e04624a0b406060418eb4f89af132a635a3f | [
"MIT"
] | 2 | 2020-03-29T10:47:09.000Z | 2020-04-05T08:12:38.000Z | ntgen/utils.py | mrapacz/ntgen | 62f1e04624a0b406060418eb4f89af132a635a3f | [
"MIT"
] | null | null | null | import re
from typing import Optional
def normalize_field_name(name: str, leading_undescores_prefix: Optional[str] = None) -> str:
"""
Normalize a string to take a Pythonic form.
Normalize a string to take a Pythonic form by:
- replacing leading underscores with a given (optional) prefix
- conver... | 31.835821 | 117 | 0.676981 | import re
from typing import Optional
def normalize_field_name(name: str, leading_undescores_prefix: Optional[str] = None) -> str:
"""
Normalize a string to take a Pythonic form.
Normalize a string to take a Pythonic form by:
- replacing leading underscores with a given (optional) prefix
- conver... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0e45a7779e2663718ced38640283e0176e71c2af | 2,158 | py | Python | dostuff.py | rumkex/IonTools | e4c80a6385fa41fd7dd3721636a1a4b177839625 | [
"BSD-3-Clause"
] | 3 | 2018-08-09T08:49:40.000Z | 2019-07-24T02:48:55.000Z | dostuff.py | rumkex/IonTools | e4c80a6385fa41fd7dd3721636a1a4b177839625 | [
"BSD-3-Clause"
] | null | null | null | dostuff.py | rumkex/IonTools | e4c80a6385fa41fd7dd3721636a1a4b177839625 | [
"BSD-3-Clause"
] | 1 | 2019-05-22T12:22:45.000Z | 2019-05-22T12:22:45.000Z | #!/usr/bin/env python3
import os.path as path
baseflags = ['--interpolate=linear', '--enable-weights']
config = {
"base": baseflags + ['-n=128'],
"smoothing": baseflags + ['-n=128', '--enable-aa'],
"128x128-multigrid-3-layers": baseflags + ['-n=128', '-l=3'],
"64x128-multigrid-3-layers": baseflags + [... | 30.394366 | 117 | 0.603336 | #!/usr/bin/env python3
from math import pi
from multiprocessing import Pool
from tempfile import NamedTemporaryFile
from subprocess import call, DEVNULL
import time
import os
import os.path as path
from shared import update_progress, plot_data
baseflags = ['--interpolate=linear', '--enable-weights']
config = {
... | 0 | 0 | 0 | 0 | 0 | 1,528 | 0 | 44 | 202 |
4008b775c8f08dd29efc36b744c6a3bd6e47d7fe | 106 | py | Python | Misc/10print.py | sparkstark03/Awesome-Scripts | 7326f2480bdeb4d843c50488bc790a5139820c8a | [
"MIT"
] | 141 | 2018-10-04T10:02:15.000Z | 2022-03-18T08:47:01.000Z | Misc/10print.py | sparkstark03/Awesome-Scripts | 7326f2480bdeb4d843c50488bc790a5139820c8a | [
"MIT"
] | 34 | 2018-10-04T08:28:01.000Z | 2020-11-02T09:36:02.000Z | Misc/10print.py | sparkstark03/Awesome-Scripts | 7326f2480bdeb4d843c50488bc790a5139820c8a | [
"MIT"
] | 110 | 2018-10-04T04:28:11.000Z | 2022-03-22T05:49:02.000Z | #!/usr/bin/env python3
import random
for i in range(100000):print(chr(9585+random.randint(0,1)), end="")
| 21.2 | 67 | 0.707547 | #!/usr/bin/env python3
import random
for i in range(100000):print(chr(9585+random.randint(0,1)), end="")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
41739de9d63f3025d9be0b4a264539bc8a971b23 | 4,395 | py | Python | sa/profiles/Zyxel/ZyNOS/get_switchport.py | xUndero/noc | 9fb34627721149fcf7064860bd63887e38849131 | [
"BSD-3-Clause"
] | 1 | 2019-09-20T09:36:48.000Z | 2019-09-20T09:36:48.000Z | sa/profiles/Zyxel/ZyNOS/get_switchport.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | sa/profiles/Zyxel/ZyNOS/get_switchport.py | ewwwcha/noc | aba08dc328296bb0e8e181c2ac9a766e1ec2a0bb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Zyxel.ZyNOS.get_switchport
# ---------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# -----------------------------------------------------... | 36.932773 | 87 | 0.471445 | # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# Zyxel.ZyNOS.get_switchport
# ---------------------------------------------------------------------
# Copyright (C) 2007-2015 The NOC Project
# See LICENSE for details
# -----------------------------------------------------... | 0 | 0 | 0 | 3,887 | 0 | 0 | 0 | 48 | 89 |
52bf3108b8781fe487dcaa7f471df575358ab42e | 157 | py | Python | practice/practice52.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | practice/practice52.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | practice/practice52.py | tomhaoye/LetsPython | 3c5f66d2e672067ed9aea33c0abd6b01708734ff | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
if __name__ == '__main__':
a = 077
b = a | 3
print 'a | b = %d' % b
b |= 7
print 'a|b=%d' % b
| 15.7 | 26 | 0.426752 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
if __name__ == '__main__':
a = 077
b = a | 3
print 'a | b = %d' % b
b |= 7
print 'a|b=%d' % b
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
628473232007d9a6c34401980c9d1a671512e47e | 8,572 | py | Python | postprocess/ensemble_masks.py | shawnau/DataScienceBowl2018 | 3c6f0f26dd86b71aad55fca52314e6432d0b3a82 | [
"MIT"
] | null | null | null | postprocess/ensemble_masks.py | shawnau/DataScienceBowl2018 | 3c6f0f26dd86b71aad55fca52314e6432d0b3a82 | [
"MIT"
] | null | null | null | postprocess/ensemble_masks.py | shawnau/DataScienceBowl2018 | 3c6f0f26dd86b71aad55fca52314e6432d0b3a82 | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
def clustering_masks(instances, iou_threshold=0.5, overlap_threshold=0.8):
"""
:param instances: numpy array of instances
:return:
"""
clusters = []
num = instances.shape[0]
instance_sizes = []
for i in range(num):
instance = instances[i]
... | 34.425703 | 112 | 0.625758 | import sys, operator
sys.path.append('..')
from scipy.ndimage.morphology import binary_fill_holes
from configuration import Configuration
from dataset.reader import *
from dataset.folder import TrainFolder
from utility.draw import *
from net.lib.nms.cython_nms.cython_nms import cython_nms
from net.layer.mask import in... | 0 | 1,459 | 0 | 890 | 0 | 4,408 | 0 | 160 | 314 |
f28bdca64ae4805bfca0002fe2ade27265ccf4c1 | 6,675 | py | Python | ssdpipelineClass.py | scrambleegg7/ssd_prescription | 37932d16d5b7a7741fcdf6afff5be0804ef958a8 | [
"MIT"
] | null | null | null | ssdpipelineClass.py | scrambleegg7/ssd_prescription | 37932d16d5b7a7741fcdf6afff5be0804ef958a8 | [
"MIT"
] | null | null | null | ssdpipelineClass.py | scrambleegg7/ssd_prescription | 37932d16d5b7a7741fcdf6afff5be0804ef958a8 | [
"MIT"
] | null | null | null | from keras.backend.tensorflow_backend import set_session
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
#
# for keras version 1.2
# from ssd import SSD300
#
plt.rcParams['figure.figsize'] = (8, 8)
plt.rcParams['image.interpolation'] = 'nearest'
np.set_printoptions(suppress=True)
config = ... | 35.31746 | 238 | 0.578876 | import cv2
import keras
from keras.applications.imagenet_utils import preprocess_input
from keras.backend.tensorflow_backend import set_session
from keras.models import Model
from keras.preprocessing import image
import matplotlib.pyplot as plt
import numpy as np
from scipy.misc import imread
import tensorflow as tf
i... | 0 | 0 | 0 | 5,827 | 0 | 0 | 0 | 121 | 291 |
5d5aaa78abda3a5dac6f04c7e1a655e11a29afae | 3,017 | py | Python | var/spack/repos/builtin/packages/libtree/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-11-16T02:42:57.000Z | 2019-06-06T19:18:50.000Z | var/spack/repos/builtin/packages/libtree/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 25 | 2021-02-08T14:39:48.000Z | 2022-03-21T18:37:29.000Z | var/spack/repos/builtin/packages/libtree/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 7 | 2018-09-13T18:04:56.000Z | 2020-03-18T20:52:06.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
| 45.029851 | 109 | 0.721246 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Libtree(CMakePackage):
"""ldd as a tree with an option to bundle dependencies into a
... | 0 | 0 | 0 | 2,775 | 0 | 0 | 0 | -2 | 46 |
8b54be24e2e3815e5d119808a2523cd5ff0a4e7f | 1,819 | py | Python | tests/test_env_yaml_from_manifest.py | rigzba21/conda-vendor | be06c520af0a08f6dc58a6bdc46e760b04e55869 | [
"MIT"
] | 10 | 2021-08-25T14:31:01.000Z | 2021-12-27T19:46:38.000Z | tests/test_env_yaml_from_manifest.py | rigzba21/conda-vendor | be06c520af0a08f6dc58a6bdc46e760b04e55869 | [
"MIT"
] | 6 | 2021-09-22T21:08:51.000Z | 2022-03-31T17:28:41.000Z | tests/test_env_yaml_from_manifest.py | rigzba21/conda-vendor | be06c520af0a08f6dc58a6bdc46e760b04e55869 | [
"MIT"
] | 2 | 2021-10-06T13:28:48.000Z | 2022-01-27T16:47:30.000Z | # TODO: Utils ? like load so we don't duplicate code ?
| 36.38 | 80 | 0.772402 | # TODO: Utils ? like load so we don't duplicate code ?
from unittest import TestCase
from unittest.mock import patch
import pytest
from ruamel.yaml import YAML
from yaml import SafeLoader
from conda_vendor.env_yaml_from_manifest import YamlFromManifest
@pytest.fixture
def yml_man_fixture(tmp_path, get_path_location... | 0 | 243 | 0 | 0 | 0 | 1,201 | 0 | 66 | 249 |
e64f42e56034356f778ffe1a7cb05be62e8ad980 | 112 | py | Python | arquivos-py/2109/seis2109.py | byancasantos/exercicios-python | b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c | [
"MIT"
] | null | null | null | arquivos-py/2109/seis2109.py | byancasantos/exercicios-python | b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c | [
"MIT"
] | null | null | null | arquivos-py/2109/seis2109.py | byancasantos/exercicios-python | b7796b9e2e7c714ebc1dbe8ca31d37c4f40cb19c | [
"MIT"
] | null | null | null | cont=0
while cont<5:
print(cont)
cont=cont+1
else:
print('o loop while foi encerrado com sucesso.')
| 16 | 52 | 0.660714 | cont=0
while cont<5:
print(cont)
cont=cont+1
else:
print('o loop while foi encerrado com sucesso.')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9fed3a96c9c373a5bc11bfec86583807e2dc75ca | 64 | py | Python | spire/version.py | bugout-dev/spire | def55cb64fbd306ddde47067d8573cf4b234115c | [
"Apache-2.0"
] | 1 | 2021-12-01T14:18:12.000Z | 2021-12-01T14:18:12.000Z | spire/version.py | bugout-dev/spire | def55cb64fbd306ddde47067d8573cf4b234115c | [
"Apache-2.0"
] | 13 | 2021-07-13T19:19:22.000Z | 2022-01-14T16:33:42.000Z | spire/version.py | bugout-dev/spire | def55cb64fbd306ddde47067d8573cf4b234115c | [
"Apache-2.0"
] | null | null | null | """
Spire library and API version.
"""
SPIRE_VERSION = "0.4.0"
| 10.666667 | 30 | 0.640625 | """
Spire library and API version.
"""
SPIRE_VERSION = "0.4.0"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c8e9b7b9fa7a13fbc7df412245423487884e294 | 424 | py | Python | roda_purchase/api/serializers.py | sanss021/roda_case | 1e8cf876ae6856615aea0a2f8946b8f542a42bc0 | [
"MIT"
] | null | null | null | roda_purchase/api/serializers.py | sanss021/roda_case | 1e8cf876ae6856615aea0a2f8946b8f542a42bc0 | [
"MIT"
] | null | null | null | roda_purchase/api/serializers.py | sanss021/roda_case | 1e8cf876ae6856615aea0a2f8946b8f542a42bc0 | [
"MIT"
] | null | null | null |
'''Aqui onde transformamos dados em um formato que pode ser armazenado ou transmitido''' | 28.266667 | 90 | 0.738208 | from rest_framework import serializers
from roda_purchase import models
class PurchaseSerializer(serializers.ModelSerializer):
class Meta:
model = models.Purchase
fields = '__all__'
class ProductSerializer(serializers.ModelSerializer):
class Meta:
model = models.Product
fields ... | 2 | 0 | 0 | 214 | 0 | 0 | 0 | 28 | 90 |
9afc46003dbb0c41cf0b8a68be575471e0c01980 | 925 | py | Python | setup.py | pptx704/torpedo | f35e66b571f07d5d3553434da25cb29e05a1a6fb | [
"MIT"
] | 16 | 2021-07-09T16:39:47.000Z | 2021-12-26T20:29:18.000Z | setup.py | pptx704/torpedo | f35e66b571f07d5d3553434da25cb29e05a1a6fb | [
"MIT"
] | null | null | null | setup.py | pptx704/torpedo | f35e66b571f07d5d3553434da25cb29e05a1a6fb | [
"MIT"
] | 2 | 2021-07-09T17:58:25.000Z | 2021-10-01T20:21:45.000Z | import setuptools
long_description = "Check full documentation [here](https://github.com/pptx704/torpedo)"
setuptools.setup(
name="mailtorpedo",
version="1.1.0",
author="Rafeed M. Bhuiyan",
author_email="rafeedm.bhuiyan@gmail.com",
description="A Python package for sending personalized emails usin... | 31.896552 | 90 | 0.661622 | import setuptools
long_description = "Check full documentation [here](https://github.com/pptx704/torpedo)"
setuptools.setup(
name="mailtorpedo",
version="1.1.0",
author="Rafeed M. Bhuiyan",
author_email="rafeedm.bhuiyan@gmail.com",
description="A Python package for sending personalized emails usin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5bb9621225aaadac5ceca87a02f4a40632c3701 | 2,575 | py | Python | python/l0904.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0904.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | python/l0904.py | daidaifan/leetcode-problem-solver | 1793eada501a2a18d05f118a98ac52e2edd12ef8 | [
"MIT"
] | null | null | null | """
In a row of trees, the i-th tree produces fruit with type tree[i].
You start at any tree of your choice, then repeatedly perform the following steps:
Add one piece of fruit from this tree to your baskets. If you cannot, stop.
Move to the next tree to the right of the current tree. If there is no tree to the rig... | 31.024096 | 203 | 0.641165 | """
In a row of trees, the i-th tree produces fruit with type tree[i].
You start at any tree of your choice, then repeatedly perform the following steps:
Add one piece of fruit from this tree to your baskets. If you cannot, stop.
Move to the next tree to the right of the current tree. If there is no tree to the rig... | 0 | 0 | 0 | 714 | 0 | 0 | 0 | 0 | 23 |
bd66867f86dfd9aa4e1aaffdb68dbb54cb15d46b | 12,454 | py | Python | testing/test_streaming.py | vincent-antaki/Neuraxle | cef1284a261010c655f8ef02b4fca5b8bb45850c | [
"Apache-2.0"
] | 1 | 2021-04-26T23:46:40.000Z | 2021-04-26T23:46:40.000Z | testing/test_streaming.py | Tubbz-alt/Neuraxle | 308f24248cdb242b7e2f6ec7c51daf2ee3e38834 | [
"Apache-2.0"
] | null | null | null | testing/test_streaming.py | Tubbz-alt/Neuraxle | 308f24248cdb242b7e2f6ec7c51daf2ee3e38834 | [
"Apache-2.0"
] | null | null | null |
import numpy as np
EXPECTED_OUTPUTS = np.array(range(100)) * 2 * 2 * 2 * 2
EXPECTED_OUTPUTS_PARALLEL = np.array((np.array(range(100)) * 2).tolist() * 4)
| 34.787709 | 112 | 0.689979 | import time
import numpy as np
import pytest
from neuraxle.base import BaseStep, ExecutionContext
from neuraxle.data_container import DataContainer, AbsentValuesNullObject
from neuraxle.distributed.streaming import SequentialQueuedPipeline, ParallelQueuedFeatureUnion, QueueJoiner
from neuraxle.hyperparams.space impor... | 0 | 0 | 0 | 295 | 0 | 10,980 | 0 | 300 | 704 |
5882a31d0860d31e880c999a1557a68bd379e23b | 630 | py | Python | atbash-cipher/atbash_cipher.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | atbash-cipher/atbash_cipher.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | atbash-cipher/atbash_cipher.py | gordonli08/Exercism-python | ff3d79ccc61bac7475641ee6c2f19a0367e3e254 | [
"MIT"
] | null | null | null | import string
cipheren = dict(zip(list(string.ascii_lowercase), string.ascii_lowercase[::-1]))
cipherde = dict(zip(string.ascii_lowercase[::-1], list(string.ascii_lowercase)))
| 37.058824 | 87 | 0.680952 | import string
cipheren = dict(zip(list(string.ascii_lowercase), string.ascii_lowercase[::-1]))
cipherde = dict(zip(string.ascii_lowercase[::-1], list(string.ascii_lowercase)))
def encode(plain_text):
stripped = [ch for ch in plain_text.lower() if ch.isalnum()]
stripped = [cipheren[ch] if ch.isalpha() else ch f... | 0 | 0 | 0 | 0 | 0 | 408 | 0 | 0 | 46 |
f119b86d9b0f095daf2dc2565973dd23411342c0 | 3,205 | py | Python | img.py | Naruki-Ichihara/portraitprinter | c3720d71cd9ac275dde90a7f5c5856b78326e397 | [
"MIT"
] | null | null | null | img.py | Naruki-Ichihara/portraitprinter | c3720d71cd9ac275dde90a7f5c5856b78326e397 | [
"MIT"
] | null | null | null | img.py | Naruki-Ichihara/portraitprinter | c3720d71cd9ac275dde90a7f5c5856b78326e397 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as s
eps = 0.3
g = 0.0
w0 = 0.8
dt = 1e-5
gamma = 1.0
file = File('./test.pvd')
eps = 0.3
g = 0.0
w0 = 0.8
dt = 0.01
gamma = 1.0
img = plt.imread("./img/newton.jpeg")/256
(Nx, Ny) = img.shape
print(img)
L = 100
x = np.linspace(0, L, Nx)
y =... | 23.394161 | 97 | 0.614041 | from dolfin import *
import matplotlib.pyplot as plt
import numpy as np
import scipy.interpolate as s
eps = 0.3
g = 0.0
w0 = 0.8
dt = 1e-5
gamma = 1.0
file = File('./test.pvd')
eps = 0.3
g = 0.0
w0 = 0.8
dt = 0.01
gamma = 1.0
img = plt.imread("./img/newton.jpeg")/256
(Nx, Ny) = img.shape
print(img)
L = 100
x = np.l... | 0 | 0 | 0 | 1,083 | 0 | 206 | 0 | -1 | 229 |
cd63c3b8b53f2f236bd67362d698bb3d491c86cb | 189 | py | Python | kw6/__init__.py | Aiwizo/kw6 | c079b2a57a07d9c56fefd90de65cf3f41d81e70f | [
"Apache-2.0"
] | 3 | 2020-09-18T22:31:28.000Z | 2020-09-21T09:38:42.000Z | kw6/__init__.py | Aiwizo/kw6 | c079b2a57a07d9c56fefd90de65cf3f41d81e70f | [
"Apache-2.0"
] | 2 | 2021-06-15T09:29:17.000Z | 2021-07-15T10:41:00.000Z | kw6/__init__.py | Aiwizo/kw6 | c079b2a57a07d9c56fefd90de65cf3f41d81e70f | [
"Apache-2.0"
] | null | null | null |
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("kw6").version
except DistributionNotFound:
pass
| 23.625 | 64 | 0.814815 | from kw6.reader import Reader
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution("kw6").version
except DistributionNotFound:
pass
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 22 |
8c88cd80bf347df648b894c24aa16ce5b07cee02 | 11,125 | py | Python | figures.py | mattjj/dirichlet-truncated-multinomial | 1b239e8960042bbf0f063d4f9e0400dfa6cb648b | [
"MIT"
] | 2 | 2020-07-24T20:50:29.000Z | 2020-07-26T08:30:42.000Z | figures.py | mattjj/dirichlet-truncated-multinomial | 1b239e8960042bbf0f063d4f9e0400dfa6cb648b | [
"MIT"
] | null | null | null | figures.py | mattjj/dirichlet-truncated-multinomial | 1b239e8960042bbf0f063d4f9e0400dfa6cb648b | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
na = np.newaxis
allfigfuncs = []
SAVING = True
# plt.interactive(False)
#################################
# Figure-Generating Functions #
#################################
allfigfuncs.append(prior_posterior_2D)
allfigfuncs.append(aux_posterior_2D)
allfigfuncs.ap... | 39.874552 | 111 | 0.65609 | from __future__ import division
from matplotlib import pyplot as plt
import numpy as np
na = np.newaxis
from scipy.interpolate import griddata
import simplex, dirichlet, sampling, tests, density, timing
allfigfuncs = []
SAVING = True
# plt.interactive(False)
#################################
# Figure-Generating Fun... | 0 | 0 | 0 | 0 | 0 | 9,612 | 0 | 58 | 250 |
056005ab7f53638037cc2312b0332cac8f1847ec | 655 | py | Python | nad_logging_service/tests/logger/exception_test.py | KaiPrince/NAD-Logging-Service | f6310f459a1770a2a4664843cfdca5f05506cf66 | [
"MIT"
] | null | null | null | nad_logging_service/tests/logger/exception_test.py | KaiPrince/NAD-Logging-Service | f6310f459a1770a2a4664843cfdca5f05506cf66 | [
"MIT"
] | null | null | null | nad_logging_service/tests/logger/exception_test.py | KaiPrince/NAD-Logging-Service | f6310f459a1770a2a4664843cfdca5f05506cf66 | [
"MIT"
] | null | null | null | """
* Project Name: NAD-Logging-Service
* File Name: exception_test.py
* Programmer: Kai Prince
* Date: Sun, Nov 15, 2020
* Description: This file contains exception tests for the Logger app.
"""
| 21.129032 | 70 | 0.665649 | """
* Project Name: NAD-Logging-Service
* File Name: exception_test.py
* Programmer: Kai Prince
* Date: Sun, Nov 15, 2020
* Description: This file contains exception tests for the Logger app.
"""
import pytest
from .sample_data import exception_logs as sample_logs
@pytest.mark.parametrize("data", sample_logs)... | 0 | 358 | 0 | 0 | 0 | 0 | 0 | 25 | 69 |
e557939ae3675417623f858389f1ee28f2bb3c74 | 9,585 | py | Python | common/crypto_utils/avalon_crypto_utils/crypto_utility.py | karthikamurthy/avalon | 5aca5d6236f18ecf8c44ffe7ff9ada3640c1d6e2 | [
"Apache-2.0"
] | null | null | null | common/crypto_utils/avalon_crypto_utils/crypto_utility.py | karthikamurthy/avalon | 5aca5d6236f18ecf8c44ffe7ff9ada3640c1d6e2 | [
"Apache-2.0"
] | 1 | 2020-06-12T11:55:38.000Z | 2020-06-12T12:35:25.000Z | common/crypto_utils/avalon_crypto_utils/crypto_utility.py | pankajgoyal2/trusted-compute-framework | c060755995864f05516206e98c46e00e3826e425 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Intel Corporation
#
# 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 wri... | 34.981752 | 79 | 0.592175 | # Copyright 2020 Intel Corporation
#
# 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 wri... | 0 | 0 | 0 | 0 | 0 | 460 | 0 | 13 | 110 |
753ec3ebf2072f47ab0e4ff3a93374bb9a709c8e | 372 | py | Python | QR_code_generator/qrcode.py | Wish1991/Python | 11b407ea1c47f63cb07dbf8cb90df93d2190821f | [
"MIT"
] | 1 | 2022-03-23T23:04:02.000Z | 2022-03-23T23:04:02.000Z | QR_code_generator/qrcode.py | Wish1991/Python | 11b407ea1c47f63cb07dbf8cb90df93d2190821f | [
"MIT"
] | null | null | null | QR_code_generator/qrcode.py | Wish1991/Python | 11b407ea1c47f63cb07dbf8cb90df93d2190821f | [
"MIT"
] | 1 | 2022-03-23T23:04:40.000Z | 2022-03-23T23:04:40.000Z | import pyqrcode
# Text which is to be converted to QR code
print("Enter text to convert")
s = input(": ")
# Name of QR code png file
print("Enter image name to save")
n = input(": ")
# Adding extension as .pnf
d = n + ".png"
# Creating QR code
url = pyqrcode.create(s)
# Saving QR code as a png file
url.show()
url.png... | 20.666667 | 42 | 0.69086 | import pyqrcode
import png
from pyqrcode import QRCode
# Text which is to be converted to QR code
print("Enter text to convert")
s = input(": ")
# Name of QR code png file
print("Enter image name to save")
n = input(": ")
# Adding extension as .pnf
d = n + ".png"
# Creating QR code
url = pyqrcode.create(s)
# Saving QR... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 44 |
fa39a00958f800d57a2c9d07e16cfacc1534663c | 413 | py | Python | advanced/decorator.py | djordjijeK/python-essentials | 51dac04ac44090ae01a65c5adb6c57f6f4d15189 | [
"Unlicense"
] | null | null | null | advanced/decorator.py | djordjijeK/python-essentials | 51dac04ac44090ae01a65c5adb6c57f6f4d15189 | [
"Unlicense"
] | null | null | null | advanced/decorator.py | djordjijeK/python-essentials | 51dac04ac44090ae01a65c5adb6c57f6f4d15189 | [
"Unlicense"
] | null | null | null | def log(funct):
"""
Logs the function.
"""
return wrapper
if __name__ == '__main__':
f = log(multiply) # process and return `multipy` function.
print(f(2,5))
print(add(10, 7))
| 17.208333 | 65 | 0.566586 | def log(funct):
"""
Logs the function.
"""
def wrapper(*args, **kwargs):
print('Calling', funct.__name__)
return funct(*args, **kwargs)
return wrapper
@log # decorator
def add(x, y):
return x + y
def multiply(x, y):
return x*y
if __name__ == '__main__':
f = log(mu... | 0 | 30 | 0 | 0 | 0 | 100 | 0 | 0 | 72 |
1506ccd3ee1896c80a197be88f1e591912327e05 | 14,929 | py | Python | lib_pypy/_ctypes/primitive.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | lib_pypy/_ctypes/primitive.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2022-02-22T00:59:49.000Z | 2022-02-22T00:59:49.000Z | lib_pypy/_ctypes/primitive.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | import sys
SIMPLE_TYPE_CHARS = "cbBhHiIlLdfguzZqQPXOv?"
from _ctypes.array import Array
from _ctypes.pointer import _Pointer
NULL = NULL()
TP_TO_DEFAULT = {
'c': 0,
'u': 0,
'b': 0,
'B': 0,
'h': 0,
'H': 0,
'i': 0,
'I': 0,
'l': 0,
'L': 0,
... | 33.699774 | 99 | 0.523947 | from _rawffi import alt as _ffi
import _rawffi
import weakref
import sys
SIMPLE_TYPE_CHARS = "cbBhHiIlLdfguzZqQPXOv?"
from _ctypes.basics import (
_CData, _CDataMeta, cdata_from_address, CArgObject, sizeof)
from _ctypes.builtin import ConvMode
from _ctypes.array import Array, byteorder
from _ctypes.pointer import... | 0 | 0 | 0 | 10,852 | 0 | 1,962 | 0 | 109 | 249 |