hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a63dd6ae87dac33dcdfc59cc58a963bf0e291080 | 3,817 | py | Python | python/acc_sweep.py | tkoziara/parmec | fefe0586798cd65744334f9abeab183159bd3d7a | [
"MIT"
] | null | null | null | python/acc_sweep.py | tkoziara/parmec | fefe0586798cd65744334f9abeab183159bd3d7a | [
"MIT"
] | 15 | 2017-06-09T12:05:27.000Z | 2018-10-25T13:59:58.000Z | python/acc_sweep.py | parmes/parmec | fefe0586798cd65744334f9abeab183159bd3d7a | [
"MIT"
] | null | null | null | # acceleration sine sweep signal generation
import matplotlib.pyplot as plt
from math import sin, cos, pi
# acc_sweep: generate constant magnitude acceleration sine sweep signal
# ---------------------------------------------------------------------
# step - signal time step
# stop - duration of the signal
# lofq - lo... | 28.916667 | 117 | 0.550694 |
423ef8a3bf8541ae6cf186e2376a44c7a5f4370d | 1,312 | py | Python | kh_site/blog/migrations/0001_initial.py | nhuntwalker/kyeisha-site | ccccc4a277f354a5f64c38476885a499483f80fc | [
"MIT"
] | null | null | null | kh_site/blog/migrations/0001_initial.py | nhuntwalker/kyeisha-site | ccccc4a277f354a5f64c38476885a499483f80fc | [
"MIT"
] | 7 | 2020-06-05T18:51:41.000Z | 2022-03-11T23:28:14.000Z | kh_site/blog/migrations/0001_initial.py | nhuntwalker/kyeisha-site | ccccc4a277f354a5f64c38476885a499483f80fc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-12-19 09:27
from __future__ import unicode_literals
import blog.models
from django.db import migrations, models
import redactor.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migratio... | 37.485714 | 139 | 0.59375 |
7014d5dcf0f54c8ce75d5e7899ae7fd0cb983b24 | 1,198 | py | Python | boto3_type_annotations/boto3_type_annotations/machinelearning/paginator.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 119 | 2018-12-01T18:20:57.000Z | 2022-02-02T10:31:29.000Z | boto3_type_annotations/boto3_type_annotations/machinelearning/paginator.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 15 | 2018-11-16T00:16:44.000Z | 2021-11-13T03:44:18.000Z | boto3_type_annotations/boto3_type_annotations/machinelearning/paginator.py | cowboygneox/boto3_type_annotations | 450dce1de4e066b939de7eac2ec560ed1a7ddaa2 | [
"MIT"
] | 11 | 2019-05-06T05:26:51.000Z | 2021-09-28T15:27:59.000Z | from typing import Dict
from botocore.paginate import Paginator
class DescribeBatchPredictions(Paginator):
def paginate(self, FilterVariable: str = None, EQ: str = None, GT: str = None, LT: str = None, GE: str = None, LE: str = None, NE: str = None, Prefix: str = None, SortOrder: str = None, PaginationConfig: Dic... | 52.086957 | 229 | 0.661937 |
6f8f0bb4ef0d2e5e49466f611f019c593f10f35d | 6,244 | py | Python | notebooks/_build/jupyter_execute/content/analysis.py | LandryBulls/py-feat | 764763270e4da5bc4614d7f61e48ddae5f855d8d | [
"MIT"
] | 5 | 2021-04-20T01:06:29.000Z | 2021-12-09T06:26:14.000Z | notebooks/_build/jupyter_execute/content/analysis.py | LiQiang0307/py-feat | 46c018bc469fdb7afd5e189b73714fbc263eb8b3 | [
"MIT"
] | null | null | null | notebooks/_build/jupyter_execute/content/analysis.py | LiQiang0307/py-feat | 46c018bc469fdb7afd5e189b73714fbc263eb8b3 | [
"MIT"
] | null | null | null | # Preprocessing FEX data
## How to preprocess and analyze facial expression data with Feat.
*Written by Jin Hyun Cheong*
Here we will be using a sample dataset by David Watson on ["A Data-Driven Characterisation Of Natural Facial Expressions When Giving Good And Bad News"](https://journals.plos.org/ploscompbiol/arti... | 49.165354 | 333 | 0.741031 |
41431e0ec29993b52dba2b51fe2cf6b5797ed6fe | 1,056 | py | Python | example/example_holdout.py | jimgoo/auto-sklearn | a263efb49f7b7f597963bc1e787105ea7615ea75 | [
"BSD-3-Clause"
] | 1 | 2017-08-13T13:57:40.000Z | 2017-08-13T13:57:40.000Z | example/example_holdout.py | jimgoo/auto-sklearn | a263efb49f7b7f597963bc1e787105ea7615ea75 | [
"BSD-3-Clause"
] | null | null | null | example/example_holdout.py | jimgoo/auto-sklearn | a263efb49f7b7f597963bc1e787105ea7615ea75 | [
"BSD-3-Clause"
] | 1 | 2020-05-06T14:47:17.000Z | 2020-05-06T14:47:17.000Z | import sklearn.model_selection
import sklearn.datasets
import sklearn.metrics
import autosklearn.classification
def main():
X, y = sklearn.datasets.load_digits(return_X_y=True)
X_train, X_test, y_train, y_test = \
sklearn.model_selection.train_test_split(X, y, random_state=1)
automl = autosklear... | 34.064516 | 80 | 0.747159 |
20a1185fe043c5de5e460b334ea81e6a3a3c603b | 4,530 | py | Python | models/sac_models.py | hyyh28/SAIL | 125ad3e64eefcf532931f567b95a5320737851e9 | [
"MIT"
] | 16 | 2020-04-29T03:25:41.000Z | 2022-03-22T02:19:38.000Z | models/sac_models.py | hyyh28/SAIL | 125ad3e64eefcf532931f567b95a5320737851e9 | [
"MIT"
] | null | null | null | models/sac_models.py | hyyh28/SAIL | 125ad3e64eefcf532931f567b95a5320737851e9 | [
"MIT"
] | 4 | 2020-04-29T03:22:53.000Z | 2021-12-01T02:40:16.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
LOG_SIG_MAX = 2
LOG_SIG_MIN = -20
epsilon = 1e-6
# Initialize Policy weights
def weights_init_(m):
if isinstance(m, nn.Linear):
torch.nn.init.xavier_uniform_(m.weight, gain=1)
torch.nn.init.co... | 33.80597 | 84 | 0.630022 |
bf7548fa775412ccfda1f3da20225332c08f0e89 | 264 | py | Python | Practice/balance2.py | ashishjayamohan/competitive-programming | 05c5c560c2c2eb36121c52693b8c7d084f435f9e | [
"MIT"
] | null | null | null | Practice/balance2.py | ashishjayamohan/competitive-programming | 05c5c560c2c2eb36121c52693b8c7d084f435f9e | [
"MIT"
] | null | null | null | Practice/balance2.py | ashishjayamohan/competitive-programming | 05c5c560c2c2eb36121c52693b8c7d084f435f9e | [
"MIT"
] | null | null | null | a=int(input())
for i in range(a):
b=int(input())
if b%4==0:
print("YES")
c = []
for j in range(2, b+1, 2):
c.append(j)
k=1
for j in range(b//2-1):
c.append(k)
k+=2
c.append(sum(c[:b//2+1])-sum(c[b//2+1:])-2)
print(*c)
else:
print("NO")
| 15.529412 | 45 | 0.5 |
f225a44918d26de90bc9db9b9d74934a0f22c030 | 10,054 | py | Python | CharakterUebernatuerlich.py | brzGatsu/Sephrasto | 4586ffb87506fd776fc6d6f37d5b222884adb4e9 | [
"MIT"
] | null | null | null | CharakterUebernatuerlich.py | brzGatsu/Sephrasto | 4586ffb87506fd776fc6d6f37d5b222884adb4e9 | [
"MIT"
] | null | null | null | CharakterUebernatuerlich.py | brzGatsu/Sephrasto | 4586ffb87506fd776fc6d6f37d5b222884adb4e9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'CharakterUebernatuerlich.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Fo... | 54.053763 | 108 | 0.720708 |
1bbfa0c687b579c87b34df398882316e47f40da5 | 1,353 | py | Python | Implementation/DataStructures/python/ArrayStack.py | J0sueTM/Competitive-Programming | e83418a1ae3feb34917ac17835195964c6ef143a | [
"MIT"
] | 2 | 2020-08-20T23:48:02.000Z | 2020-11-22T18:35:08.000Z | Implementation/DataStructures/python/ArrayStack.py | J0sueTM/Competitive-Programming | e83418a1ae3feb34917ac17835195964c6ef143a | [
"MIT"
] | null | null | null | Implementation/DataStructures/python/ArrayStack.py | J0sueTM/Competitive-Programming | e83418a1ae3feb34917ac17835195964c6ef143a | [
"MIT"
] | null | null | null | import sys
class Stack:
def __init__(self, stack_capacity):
self.stack = [0] * (stack_capacity + 1)
self.stack_size = stack_capacity
self.current_top_pos = 0
def is_empty(self):
return self.current_top_pos == 0
def is_full(self):
return self.current_top_pos == (sel... | 22.180328 | 60 | 0.641537 |
8abad7c8acdb0b4da22945151e79e39e2bbfafb6 | 29,574 | py | Python | python_modules/dagster/dagster_tests/check_tests/test_check.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | 1 | 2019-11-25T19:03:32.000Z | 2019-11-25T19:03:32.000Z | python_modules/dagster/dagster_tests/check_tests/test_check.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/check_tests/test_check.py | shahvineet98/dagster | 2471d39c52f660e23e8c0d8e8ded873ddc3df036 | [
"Apache-2.0"
] | null | null | null | import sys
from collections import defaultdict
from contextlib import contextmanager
import pytest
from dagster import check
from dagster.check import (
CheckError,
ElementCheckError,
NotImplementedCheckError,
ParameterCheckError,
)
def test_int_param():
assert check.int_param(-1, 'param_name') ... | 29.963526 | 97 | 0.675492 |
c7290f865a95e7d9c0b93eb60eb594cdcfcbc698 | 11,356 | py | Python | library/azure_rm_devtestlabschedule.py | portos060474/azure_modules | 008332fb07f79507cf00ac71f8249bc668bd7c7e | [
"MIT"
] | 31 | 2018-01-24T08:39:30.000Z | 2021-12-19T00:01:04.000Z | library/azure_rm_devtestlabschedule.py | portos060474/azure_modules | 008332fb07f79507cf00ac71f8249bc668bd7c7e | [
"MIT"
] | 17 | 2018-02-01T12:35:57.000Z | 2020-04-22T20:47:52.000Z | library/azure_rm_devtestlabschedule.py | portos060474/azure_modules | 008332fb07f79507cf00ac71f8249bc668bd7c7e | [
"MIT"
] | 39 | 2018-02-01T11:56:03.000Z | 2021-12-19T18:34:49.000Z | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 33.204678 | 149 | 0.554773 |
657fc33c4ceb0bf4f03a5a5419b3d2c05c7d7ca1 | 1,133 | py | Python | designate-8.0.0/designate/backend/impl_powerdns/migrate_repo/versions/007_add_recordset_id_col.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | designate-8.0.0/designate/backend/impl_powerdns/migrate_repo/versions/007_add_recordset_id_col.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | designate-8.0.0/designate/backend/impl_powerdns/migrate_repo/versions/007_add_recordset_id_col.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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 r... | 29.051282 | 75 | 0.752868 |
86dde59ae68b9c2defc8e727af3b19c1754dbf09 | 3,226 | py | Python | rnnparser/RecursiveNN/npRNN/rnn.py | uphere-co/nlp-prototype | c4623927e5c5c5f9c3e702eb36497ea1d9fd1ff3 | [
"BSD-3-Clause"
] | null | null | null | rnnparser/RecursiveNN/npRNN/rnn.py | uphere-co/nlp-prototype | c4623927e5c5c5f9c3e702eb36497ea1d9fd1ff3 | [
"BSD-3-Clause"
] | null | null | null | rnnparser/RecursiveNN/npRNN/rnn.py | uphere-co/nlp-prototype | c4623927e5c5c5f9c3e702eb36497ea1d9fd1ff3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from plain import *
from param import Param
from node import RNNnode
from tree_utils import Node, NodeTree
float_type = np.float32
int_type = np.int64
class Parser(object):
def __init__(self, activation_f, activation_df):
self.activation_f = activation_f
... | 37.511628 | 73 | 0.631432 |
0aba517604f9ab2af30a112098e8f56e814d8aff | 7,658 | py | Python | contrib/devtools/update-translations.py | herzogvonbelder/Alpenschilling | 74f0b13f2feaae6e84c82b416cacaf18167573b5 | [
"MIT"
] | 4 | 2018-04-26T15:39:34.000Z | 2018-10-05T18:27:53.000Z | contrib/devtools/update-translations.py | herzogvonbelder/Alpenschilling | 74f0b13f2feaae6e84c82b416cacaf18167573b5 | [
"MIT"
] | 1 | 2018-06-05T23:31:25.000Z | 2018-06-05T23:31:25.000Z | contrib/devtools/update-translations.py | Alpenschilling/Alpenschilling | 76ba3422d26b63228a8465adeadc6f6827e846b9 | [
"MIT"
] | 5 | 2018-06-23T12:54:53.000Z | 2018-12-14T07:43:31.000Z | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... | 37.539216 | 124 | 0.629277 |
0c7eaaf3e1f46c8fa1c25824d0632d5c3bfa58e8 | 141 | py | Python | neo4j/datadog_checks/neo4j/__init__.py | Dcanzano/integrations-extras | 0e5c9cde116798a724d9903ab2cefb356318f1d0 | [
"BSD-3-Clause"
] | null | null | null | neo4j/datadog_checks/neo4j/__init__.py | Dcanzano/integrations-extras | 0e5c9cde116798a724d9903ab2cefb356318f1d0 | [
"BSD-3-Clause"
] | 3 | 2020-03-30T12:26:28.000Z | 2021-08-25T11:58:47.000Z | neo4j/datadog_checks/neo4j/__init__.py | Dcanzano/integrations-extras | 0e5c9cde116798a724d9903ab2cefb356318f1d0 | [
"BSD-3-Clause"
] | 1 | 2017-09-01T04:29:17.000Z | 2017-09-01T04:29:17.000Z | from .__about__ import __version__
from .neo4j import GLOBAL_DB_NAME, NAMESPACE, Config, Neo4jCheck
__all__ = ['__version__', 'Neo4jCheck']
| 28.2 | 64 | 0.794326 |
c42ab6756aba551e795bc3e8909f6c90016cc406 | 1,109 | py | Python | setup.py | ine-rmotr-projects/itp-w2-hangman | 39dce7d585cca9f6d523ede868e20a7a7985c93e | [
"MIT"
] | null | null | null | setup.py | ine-rmotr-projects/itp-w2-hangman | 39dce7d585cca9f6d523ede868e20a7a7985c93e | [
"MIT"
] | 1 | 2017-02-25T21:25:43.000Z | 2017-02-25T21:25:43.000Z | setup.py | ine-rmotr-projects/itp-w2-hangman | 39dce7d585cca9f6d523ede868e20a7a7985c93e | [
"MIT"
] | 89 | 2016-11-01T21:53:47.000Z | 2019-01-11T05:02:54.000Z | import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ["tests/"]
... | 25.204545 | 74 | 0.616772 |
3762c83f090f017376061eb5658b1171eb447bca | 506 | py | Python | opencv_threshold_python.py | vaishnavidatir/Opencv | a35edde63bae336e27ecbaa99c72335ea041f94d | [
"Apache-2.0"
] | null | null | null | opencv_threshold_python.py | vaishnavidatir/Opencv | a35edde63bae336e27ecbaa99c72335ea041f94d | [
"Apache-2.0"
] | null | null | null | opencv_threshold_python.py | vaishnavidatir/Opencv | a35edde63bae336e27ecbaa99c72335ea041f94d | [
"Apache-2.0"
] | null | null | null | import cv2
img = cv2.imread("lena.jpg")
_,th1 = cv2.threshold(img,50,250,cv2.THRESH_BINARY)
_,th2= cv2.threshold(img,50,250,cv2.THRESH_BINARY_INV)
_,th3 = cv2.threshold(img,50,250,cv2.THRESH_TRUNC)
_,th4 = cv2.threshold(img,50,250,cv2.THRESH_TOZERO)
_,th5 = cv2.threshold(img,50,250,cv2.THRESH_TOZERO_INV)
cv2.i... | 23 | 56 | 0.70751 |
3c29b9dcb2f7b4b008f02e8f29f17d0abebbaeb7 | 520 | py | Python | audiovisual/indico_audiovisual/blueprint.py | ThiefMaster/indico-plugins-cern | 0082a66dd21ac093c1a31316d12c338f52ffe2d0 | [
"MIT"
] | null | null | null | audiovisual/indico_audiovisual/blueprint.py | ThiefMaster/indico-plugins-cern | 0082a66dd21ac093c1a31316d12c338f52ffe2d0 | [
"MIT"
] | null | null | null | audiovisual/indico_audiovisual/blueprint.py | ThiefMaster/indico-plugins-cern | 0082a66dd21ac093c1a31316d12c338f52ffe2d0 | [
"MIT"
] | null | null | null | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2021 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
from indico.core.plugins import IndicoPluginBlueprint
from indico_... | 34.666667 | 93 | 0.792308 |
e0c8b028e6c51153b0c2b7e69226cd2691f29ec7 | 2,092 | py | Python | code.py | debapriyaroy95/python-mini-challenges | 3a28b0ecf778eeefda524e4e849243613242d131 | [
"MIT"
] | null | null | null | code.py | debapriyaroy95/python-mini-challenges | 3a28b0ecf778eeefda524e4e849243613242d131 | [
"MIT"
] | null | null | null | code.py | debapriyaroy95/python-mini-challenges | 3a28b0ecf778eeefda524e4e849243613242d131 | [
"MIT"
] | null | null | null | # --------------
#Code starts here
import sys
#Function to check for palindrome
#Function to find the smallest palindrome
def palindrome(num):
for i in range(num+1,sys.maxsize):
if str(i) == str(i)[::-1]:
return i
print(palindrome(123))
#palindrome_check(55)
print(p... | 19.018182 | 68 | 0.585086 |
246f2c39576be72c148dd79124a1467b91827e75 | 33,185 | py | Python | conference.py | chenlu2015/AppEngineConferenceCenter | 11e8920c59f05bdc026ddd172e49a723a17aea6c | [
"Apache-2.0"
] | 1 | 2016-01-12T21:44:54.000Z | 2016-01-12T21:44:54.000Z | conference.py | chenlu2015/AppEngineConferenceCenter | 11e8920c59f05bdc026ddd172e49a723a17aea6c | [
"Apache-2.0"
] | null | null | null | conference.py | chenlu2015/AppEngineConferenceCenter | 11e8920c59f05bdc026ddd172e49a723a17aea6c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | 37.753129 | 109 | 0.626789 |
3da7d04b8af0cd886f8e74ecde7189ada89ac7c1 | 1,633 | py | Python | keras_frcnn/config.py | TuanDH94/AutoLicensePlateRecognition | 41d4d68b1d3ded6729067ab3469657d0d5b700df | [
"Apache-2.0"
] | null | null | null | keras_frcnn/config.py | TuanDH94/AutoLicensePlateRecognition | 41d4d68b1d3ded6729067ab3469657d0d5b700df | [
"Apache-2.0"
] | null | null | null | keras_frcnn/config.py | TuanDH94/AutoLicensePlateRecognition | 41d4d68b1d3ded6729067ab3469657d0d5b700df | [
"Apache-2.0"
] | null | null | null | from keras import backend as K
import math
class Config:
def __init__(self):
self.verbose = True
# self.network = 'resnet50'
self.network = 'vgg'
# setting for data augmentation
self.use_horizontal_flips = False
self.use_vertical_flips = False
self.rot_90 = False
# anchor box scales
self.anchor... | 27.216667 | 128 | 0.731782 |
5a9bd2173680fb9e521a3900429f5220f9084347 | 1,820 | py | Python | quantum_regression/protac_linear_regression_aq.py | jt667/protac | 94eecd9b8deec0a9745d1b49f8f875d71798c6b1 | [
"Apache-2.0"
] | 1 | 2022-02-25T08:24:29.000Z | 2022-02-25T08:24:29.000Z | quantum_regression/protac_linear_regression_aq.py | jt667/protac | 94eecd9b8deec0a9745d1b49f8f875d71798c6b1 | [
"Apache-2.0"
] | null | null | null | quantum_regression/protac_linear_regression_aq.py | jt667/protac | 94eecd9b8deec0a9745d1b49f8f875d71798c6b1 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
#import dimod
from azure.quantum import Workspace
from azure.quantum.optimization import Problem, ProblemType, Term, SimulatedAnnealing
# Quantum Workspace details
# These can be found in the Azure Portal in the workspace o... | 27.575758 | 86 | 0.655495 |
a1f0182d61839374f6eca81c3ce9708c6b61ad39 | 4,154 | py | Python | platform_test/cores/larson.py | zignig/tinybx_stuff | 5c62665c87c30fb7eb34a651992041bbdef10b0b | [
"MIT"
] | 5 | 2019-03-30T01:08:13.000Z | 2020-05-04T06:02:41.000Z | platform_test/cores/larson.py | zignig/tinybx_stuff | 5c62665c87c30fb7eb34a651992041bbdef10b0b | [
"MIT"
] | null | null | null | platform_test/cores/larson.py | zignig/tinybx_stuff | 5c62665c87c30fb7eb34a651992041bbdef10b0b | [
"MIT"
] | 1 | 2020-05-04T06:02:17.000Z | 2020-05-04T06:02:17.000Z | from nmigen import *
from nmigen.cli import main, pysim
class OnOff(Elaboratable):
def __init__(self, stretch=200):
self.stretcher = Signal(max=stretch + 1)
self.stretch = stretch
self.o = Signal()
def elaborate(self, platform):
m = Module()
m.d.sync += self.stretcher.... | 31.469697 | 66 | 0.508907 |
3ecdff2445beca50741f74ec44e20db58c28e7d2 | 8,477 | py | Python | src/clifunzone/xml2json.py | Justin-W/clifunland | c3d5b3d3a5b72611b215d6d793de752e061fefa4 | [
"BSD-2-Clause"
] | 1 | 2016-02-26T02:55:06.000Z | 2016-02-26T02:55:06.000Z | src/clifunzone/xml2json.py | Justin-W/clifunland | c3d5b3d3a5b72611b215d6d793de752e061fefa4 | [
"BSD-2-Clause"
] | null | null | null | src/clifunzone/xml2json.py | Justin-W/clifunland | c3d5b3d3a5b72611b215d6d793de752e061fefa4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""xml2json.py Convert XML to JSON
Relies on ElementTree for the XML parsing. This is based on
pesterfish.py but uses a different XML->JSON mapping.
The XML->JSON mapping is described at
http://www.xml.com/pub/a/2006/05/31/converting-between-xml-and-json.html
Rewritten to a command line utility... | 33.374016 | 130 | 0.62121 |
13cb0ffa79b3d1ef4b793641b9cc37330e2a4212 | 150 | py | Python | setup.py | d1b/fetch-grsec-patches-and-kernel | 4a2a4710d62bdfab8d6c2249623d1f1a65f6b503 | [
"MIT"
] | 1 | 2017-08-04T16:52:26.000Z | 2017-08-04T16:52:26.000Z | setup.py | d1b/fetch-grsec-patches-and-kernel | 4a2a4710d62bdfab8d6c2249623d1f1a65f6b503 | [
"MIT"
] | null | null | null | setup.py | d1b/fetch-grsec-patches-and-kernel | 4a2a4710d62bdfab8d6c2249623d1f1a65f6b503 | [
"MIT"
] | 1 | 2021-08-10T13:00:44.000Z | 2021-08-10T13:00:44.000Z | #!/usr/bin/python
from setuptools import setup
setup(
setup_requires=['pbr==3.0.1'],
pbr=True,
platforms=['any'],
zip_safe=False,
)
| 13.636364 | 34 | 0.626667 |
224644798efa0013bcfa56c4b212c47e73ff970b | 3,169 | py | Python | run_webapp.py | AlphaStan/alphacross | 11dbcb3a9490e9547dc9fb30c62e8beff0489e05 | [
"BSD-3-Clause"
] | 2 | 2020-06-19T21:29:16.000Z | 2020-10-27T08:50:21.000Z | run_webapp.py | AlphaStan/alphacross | 11dbcb3a9490e9547dc9fb30c62e8beff0489e05 | [
"BSD-3-Clause"
] | 10 | 2019-11-10T17:42:38.000Z | 2020-05-27T15:09:11.000Z | run_webapp.py | AlphaStan/alphacross | 11dbcb3a9490e9547dc9fb30c62e8beff0489e05 | [
"BSD-3-Clause"
] | null | null | null | from flask import Flask, render_template, current_app
import json
from src.main.environment.errors import ColumnIsFullError
from webapp.factory import create_app
app = create_app()
@app.route("/")
def home():
return render_template('index.html',
title=app.config["PANE_TITLE"],
... | 36.848837 | 118 | 0.628274 |
5ce9a5384f62df9675655ea29fc80c53d23d68f6 | 2,069 | py | Python | scripts/util/list_stale_autoplots.py | jamayfieldjr/iem | 275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a | [
"MIT"
] | 1 | 2019-10-07T17:01:24.000Z | 2019-10-07T17:01:24.000Z | scripts/util/list_stale_autoplots.py | jamayfieldjr/iem | 275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a | [
"MIT"
] | null | null | null | scripts/util/list_stale_autoplots.py | jamayfieldjr/iem | 275b77a65f3b12e26e6cbdb230786b9c7d2b9c9a | [
"MIT"
] | null | null | null | """Look into which autoplots have not been used in a while"""
from __future__ import print_function
import re
import pandas as pd
from pyiem.util import get_dbconn
QRE = re.compile("q=([0-9]+)")
NO_FEATURES = [
17, # is referenced by canonical page
28, # too complex and generally hated by the public
31,... | 29.985507 | 80 | 0.59884 |
2d80ea2ee36b625968c2a5fdbfa324e90b01da42 | 200 | py | Python | About_KV/python/global.py | NCDerek/duedge-recipes | b52358b9f8128c5e349d1f1420ada886624e6302 | [
"MIT"
] | null | null | null | About_KV/python/global.py | NCDerek/duedge-recipes | b52358b9f8128c5e349d1f1420ada886624e6302 | [
"MIT"
] | null | null | null | About_KV/python/global.py | NCDerek/duedge-recipes | b52358b9f8128c5e349d1f1420ada886624e6302 | [
"MIT"
] | null | null | null | async def handler(event):
v = await event.kv.get_global('my_key1')
if v is not None:
return {'status': 200, 'body': v}
else:
return {'status': 404, 'body': b'not found!'}
| 25 | 53 | 0.57 |
d0f988883a222e62685366a308101dde3703e9a4 | 22,831 | py | Python | tencentcloud/rce/v20201103/models.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | tencentcloud/rce/v20201103/models.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | tencentcloud/rce/v20201103/models.py | qin5506/tencentcloud-sdk-python | e9c59d80beabf75fb96456bb8d7a53400346fe9a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... | 33.873887 | 150 | 0.656958 |
1587d74590cffaa9e439da7e4c2f6753d79c5a14 | 817 | py | Python | award/urls.py | stevekibe/Awards | b24f5fb7ac9e1e47ecd365f7794931f7cea0fa2d | [
"MIT"
] | null | null | null | award/urls.py | stevekibe/Awards | b24f5fb7ac9e1e47ecd365f7794931f7cea0fa2d | [
"MIT"
] | null | null | null | award/urls.py | stevekibe/Awards | b24f5fb7ac9e1e47ecd365f7794931f7cea0fa2d | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.conf.urls import url
from . import views
urlpatterns=[
url('^$',views.index,name='index'),
url(r'^new/post$',views.new_project, name='new-project'),
url(r'votes/$',views.vote_project, name='vote_project'),
url(r'^us... | 40.85 | 81 | 0.681763 |
e90472183c9a1e713f54a7502ceddf4c5bb42818 | 25,076 | py | Python | example/ui/dw_buttons_pyside2_ui.py | dpizetta/QDarkStyleSheet | f41405ad791fb118387482ae39b94665c35df662 | [
"CC-BY-4.0"
] | null | null | null | example/ui/dw_buttons_pyside2_ui.py | dpizetta/QDarkStyleSheet | f41405ad791fb118387482ae39b94665c35df662 | [
"CC-BY-4.0"
] | null | null | null | example/ui/dw_buttons_pyside2_ui.py | dpizetta/QDarkStyleSheet | f41405ad791fb118387482ae39b94665c35df662 | [
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'dw_buttons.ui'
#
# Created: Sat Oct 27 00:00:52 2018
# by: pyside2-uic 2.0.0 running on PySide2 5.6.0~a1
#
# WARNING! All changes made in this file will be lost!
from PySide2 import QtCore, QtGui, QtWidgets
class Ui_DockWidget(object)... | 71.441595 | 135 | 0.724717 |
f7379f0a932918d82994fe95749b56a6277fc071 | 13,020 | py | Python | gans/experiments/emnist/preprocessing/filtered_emnist_data_utils.py | alshedivat/federated | 100f0e0940282818c42c39156407ae419f26de50 | [
"Apache-2.0"
] | 2 | 2021-10-19T13:55:11.000Z | 2021-11-11T11:26:05.000Z | federated/gans/experiments/emnist/preprocessing/filtered_emnist_data_utils.py | luke-who/TFF | fe9f44a504bc51b603a3ab9a181148da0aa9612f | [
"MIT"
] | null | null | null | federated/gans/experiments/emnist/preprocessing/filtered_emnist_data_utils.py | luke-who/TFF | fe9f44a504bc51b603a3ab9a181148da0aa9612f | [
"MIT"
] | null | null | null | # Copyright 2019, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 45.365854 | 87 | 0.701613 |
913b3d2800a3b757b0ac532e70b0143facd53384 | 1,503 | py | Python | test/ipr_tests.py | genomeannotation/Annie-new | 4bb39804c4d51877907f531d72e8b2e841c58243 | [
"MIT"
] | 7 | 2018-06-14T18:19:14.000Z | 2022-01-12T12:31:50.000Z | test/ipr_tests.py | genomeannotation/Annie-new | 4bb39804c4d51877907f531d72e8b2e841c58243 | [
"MIT"
] | 10 | 2015-05-01T00:42:32.000Z | 2022-02-08T17:27:31.000Z | test/ipr_tests.py | genomeannotation/Annie | 4bb39804c4d51877907f531d72e8b2e841c58243 | [
"MIT"
] | 5 | 2016-01-22T11:59:08.000Z | 2022-03-14T06:21:13.000Z | #!/usr/bin/env python
import unittest
import io
from src.ipr import read_ipr
class TestIPR(unittest.TestCase):
def setUp(self):
self.ipr_file = io.StringIO(\
'm.98281\tc95b0824ccd627403aa63f9e474649cc\t7571\tSuperFamily\tSSF48726\t5997\t6096\t6.42E-13\tT\t04-04-2014\n\
m.98281\tc95b0824ccd627403a... | 39.552632 | 196 | 0.709914 |
994bdbc6d7e396dc47edaad36bf697a72e1abe9c | 2,020 | py | Python | ooobuild/dyn/smarttags/smart_tag_recognizer_mode.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/smarttags/smart_tag_recognizer_mode.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/smarttags/smart_tag_recognizer_mode.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 38.113208 | 144 | 0.718812 |
6db7266170a73cbead4ac4c78a57137569947340 | 3,524 | py | Python | py/ffmpeg/enc_dec_so_part2.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/ffmpeg/enc_dec_so_part2.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | py/ffmpeg/enc_dec_so_part2.py | YodaEmbedding/experiments | 567c6a1c18fac2d951fe2af54aaa4917b7d529d2 | [
"MIT"
] | null | null | null | import subprocess
from queue import Queue
from threading import Thread
from time import sleep, time
import numpy as np
WIDTH = 224
HEIGHT = 224
NUM_FRAMES = 16
def t(epoch=time()):
return round(time() - epoch, 2)
def make_frames(num_frames):
x = np.arange(WIDTH, dtype=np.uint8)
x = np.broadcast_to(x, ... | 24.136986 | 79 | 0.570091 |
ea6fc9c6db1cfbfc59ede603a8ea211252bbcf8b | 125 | py | Python | python/config.open.py | ruslo/configs | db80431964e3b252cd03b1b60ad61a9ff44b17a0 | [
"BSD-2-Clause"
] | 3 | 2016-03-08T04:13:01.000Z | 2017-05-21T23:55:14.000Z | python/config.open.py | ruslo/configs | db80431964e3b252cd03b1b60ad61a9ff44b17a0 | [
"BSD-2-Clause"
] | null | null | null | python/config.open.py | ruslo/configs | db80431964e3b252cd03b1b60ad61a9ff44b17a0 | [
"BSD-2-Clause"
] | null | null | null | [default]
open = gvim.py
[extensions]
# text format
.txt = gvim.py
# c++ sources
.cpp = gvim.py
.hpp = gvim.py
| 11.363636 | 16 | 0.576 |
c4d407a9a3595f64376a7d345444d142c2778e3f | 729 | py | Python | downstream/sws2013/model.py | OlegJakushkin/s3prl | c0e41f07fa56f0f79b5bf3839b4d0a4cf7c421bf | [
"MIT"
] | 856 | 2021-01-15T15:40:32.000Z | 2022-03-31T07:08:17.000Z | downstream/sws2013/model.py | shuchengzhang92/s3prl | 39460b7ab8d19cd2fbe3406ed1073a5dbe96bfc0 | [
"MIT"
] | 210 | 2021-01-15T13:28:50.000Z | 2022-03-30T06:13:51.000Z | downstream/sws2013/model.py | shuchengzhang92/s3prl | 39460b7ab8d19cd2fbe3406ed1073a5dbe96bfc0 | [
"MIT"
] | 208 | 2021-01-15T03:03:12.000Z | 2022-03-31T08:33:27.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
class Model(nn.Module):
def __init__(self, input_dim, bottleneck_dim, hidden_dim, **kwargs):
super(Model, self).__init__()
self.connector = nn.Linear(input_dim, bottleneck_dim)
self.fc1 = nn.Linear(bottleneck_dim, hidden_d... | 30.375 | 76 | 0.676269 |
3c6a34d920437dcb3a333dde9cf36b236a88649f | 3,284 | py | Python | CIM100/IEC61970/Base/LoadModel/SeasonDayTypeSchedule.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM100/IEC61970/Base/LoadModel/SeasonDayTypeSchedule.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM100/IEC61970/Base/LoadModel/SeasonDayTypeSchedule.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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... | 40.04878 | 341 | 0.702192 |
d62de82ec2e842142b14bb6044c24a0db960ae32 | 2,043 | py | Python | plotMeanOfACF.py | Yu-Chuan/Dendrite_Growth_Model | 5145a5232712ed26700036fb06265b85a91b8429 | [
"MIT"
] | null | null | null | plotMeanOfACF.py | Yu-Chuan/Dendrite_Growth_Model | 5145a5232712ed26700036fb06265b85a91b8429 | [
"MIT"
] | null | null | null | plotMeanOfACF.py | Yu-Chuan/Dendrite_Growth_Model | 5145a5232712ed26700036fb06265b85a91b8429 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 24 11:13:56 2019
@author: Yu-Chuan Chen
"""
#%% library
import numpy as np
import os
import matplotlib.pyplot as plt
#%% create folder
dataPath = '/Yu-Chuan/ForYuChuan/python program/dedritic growth model/meanOfACF/'
neuronType = 'Tm'
labname = 'LeeCH'
neu... | 28.375 | 95 | 0.617719 |
1de8a8b7b14279768eced360023467d3be9b4367 | 20,103 | py | Python | python/cudf/cudf/core/column/numerical.py | mt-jones/cudf | 1a70ee21aacef4c83971ddf14e1df98448b3fb81 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/core/column/numerical.py | mt-jones/cudf | 1a70ee21aacef4c83971ddf14e1df98448b3fb81 | [
"Apache-2.0"
] | null | null | null | python/cudf/cudf/core/column/numerical.py | mt-jones/cudf | 1a70ee21aacef4c83971ddf14e1df98448b3fb81 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018-2020, NVIDIA CORPORATION.
import numpy as np
import pandas as pd
import pyarrow as pa
from pandas.api.types import is_integer_dtype
import rmm
import cudf._lib as libcudf
import cudf._libxx as libcudfxx
from cudf.core._sort import get_sorted_inds
from cudf.core.buffer import Buffer
from cudf.cor... | 34.422945 | 79 | 0.57663 |
ea9c33521dcee3f2e9528dc15523aeaeb060e349 | 433 | py | Python | cool_mammals_web_application/wsgi.py | luiztauffer/cool_mammals_web_application | d2f6a5f1e083fc300b9b3a6d525ae548eb8e073f | [
"MIT"
] | null | null | null | cool_mammals_web_application/wsgi.py | luiztauffer/cool_mammals_web_application | d2f6a5f1e083fc300b9b3a6d525ae548eb8e073f | [
"MIT"
] | null | null | null | cool_mammals_web_application/wsgi.py | luiztauffer/cool_mammals_web_application | d2f6a5f1e083fc300b9b3a6d525ae548eb8e073f | [
"MIT"
] | null | null | null | """
WSGI config for cool_mammals_web_application project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.set... | 25.470588 | 88 | 0.806005 |
fa73d9691e05b1095c5893a141aba99b0db0cd1a | 9,465 | py | Python | tutorials/foundations/plot_setup_model.py | samtx/pyapprox | c926d910e30fbcfed7d0621175d3b0268d59f852 | [
"MIT"
] | null | null | null | tutorials/foundations/plot_setup_model.py | samtx/pyapprox | c926d910e30fbcfed7d0621175d3b0268d59f852 | [
"MIT"
] | null | null | null | tutorials/foundations/plot_setup_model.py | samtx/pyapprox | c926d910e30fbcfed7d0621175d3b0268d59f852 | [
"MIT"
] | null | null | null | r"""
Model Definition
----------------
This tutorial describes how to setup a function with random inputs. It also provides examples of how to use model wrappers to time function calls and evaluate a function at multiple samples in parallel.
We start by defining a function of two random variables. We will use the Rose... | 50.345745 | 642 | 0.785843 |
27106dccc57b36a78ff94dc7d662d3cf75ee05e0 | 3,574 | py | Python | tests/plugins/test_remove_worker_metadata.py | ktdreyer/atomic-reactor | a3cc6a1a5187c7a178b183bef15faf3a4c9de52a | [
"BSD-3-Clause"
] | null | null | null | tests/plugins/test_remove_worker_metadata.py | ktdreyer/atomic-reactor | a3cc6a1a5187c7a178b183bef15faf3a4c9de52a | [
"BSD-3-Clause"
] | null | null | null | tests/plugins/test_remove_worker_metadata.py | ktdreyer/atomic-reactor | a3cc6a1a5187c7a178b183bef15faf3a4c9de52a | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, unicode_literals
import os
from flexmock import flexmock
from atomic_reactor.core import DockerTask... | 27.075758 | 79 | 0.654449 |
e113ed63ddf3b69c4713be8892ae27b5d477ac7f | 18,251 | py | Python | Lib/test/libregrtest/main.py | DreamerComp/cpython | 995e31e538d3321959e526d9b7ed4dd60e4eb4bb | [
"PSF-2.0"
] | null | null | null | Lib/test/libregrtest/main.py | DreamerComp/cpython | 995e31e538d3321959e526d9b7ed4dd60e4eb4bb | [
"PSF-2.0"
] | null | null | null | Lib/test/libregrtest/main.py | DreamerComp/cpython | 995e31e538d3321959e526d9b7ed4dd60e4eb4bb | [
"PSF-2.0"
] | null | null | null | import datetime
import faulthandler
import locale
import os
import platform
import random
import re
import sys
import sysconfig
import tempfile
import textwrap
import time
from test.libregrtest.cmdline import _parse_args
from test.libregrtest.runtest import (
findtests, runtest,
STDTESTS, NOTTESTS, PASSED, FAIL... | 34.370998 | 88 | 0.559257 |
2e9de64a4011fcebd148db5b7ccf1f9a27c26956 | 314 | py | Python | 76-100/80.py | tonyyzy/ProjectEuler | f52de2f931ebd4df2020e32d12062866b1586e72 | [
"MIT"
] | null | null | null | 76-100/80.py | tonyyzy/ProjectEuler | f52de2f931ebd4df2020e32d12062866b1586e72 | [
"MIT"
] | null | null | null | 76-100/80.py | tonyyzy/ProjectEuler | f52de2f931ebd4df2020e32d12062866b1586e72 | [
"MIT"
] | null | null | null | from decimal import getcontext, Decimal
getcontext().prec = 102
non_natural = []
for i in range(1, 101):
if i ** 0.5 % 1 != 0:
non_natural.append(i)
result = 0
for i in non_natural:
a = Decimal(i).sqrt()
result += sum(int(c) for c in str(a * (10 ** 99))[:100])
print(result) | 19.625 | 61 | 0.573248 |
b05532f3ba3f67630eb126893b478a7b21d36941 | 18,440 | py | Python | flask_restx/inputs.py | james-powis/flask-restx | ee1fc4ceb93887065b4785f14dadd70d7bc2efe7 | [
"BSD-3-Clause"
] | 1 | 2021-05-24T14:33:40.000Z | 2021-05-24T14:33:40.000Z | flask_restx/inputs.py | james-powis/flask-restx | ee1fc4ceb93887065b4785f14dadd70d7bc2efe7 | [
"BSD-3-Clause"
] | 1 | 2021-06-15T09:49:50.000Z | 2021-06-15T09:49:50.000Z | flask_restx/inputs.py | james-powis/flask-restx | ee1fc4ceb93887065b4785f14dadd70d7bc2efe7 | [
"BSD-3-Clause"
] | 1 | 2020-08-16T22:20:31.000Z | 2020-08-16T22:20:31.000Z | # -*- coding: utf-8 -*-
"""
This module provide some helpers for advanced types parsing.
You can define you own parser using the same pattern:
.. code-block:: python
def my_type(value):
if not condition:
raise ValueError('This is not my type')
return parse(value)
# Swagger docume... | 30.180033 | 109 | 0.601952 |
2e29cb97468a9cf237e3a88b9d446a6f59099f9c | 1,304 | py | Python | loginpass/slack.py | authlib/socialism | 635823a78a2a92cf8630f9935aebb9afcccb8656 | [
"BSD-3-Clause"
] | 223 | 2018-04-23T14:48:17.000Z | 2022-03-19T09:27:36.000Z | loginpass/slack.py | authlib/socialism | 635823a78a2a92cf8630f9935aebb9afcccb8656 | [
"BSD-3-Clause"
] | 68 | 2018-04-22T13:55:25.000Z | 2022-03-15T15:28:42.000Z | loginpass/slack.py | authlib/socialism | 635823a78a2a92cf8630f9935aebb9afcccb8656 | [
"BSD-3-Clause"
] | 86 | 2018-04-24T21:09:26.000Z | 2022-03-17T08:55:34.000Z | """
loginpass.slack
~~~~~~~~~~~~~~~
Loginpass Backend of Slack (https://slack.com).
Useful Links:
- Create App: https://api.slack.com/apps
- API documentation: https://api.slack.com/
- Sign In: https://api.slack.com/docs/sign-in-with-slack
:copyright: (c) 2018 by Hsiaoming Yang
:... | 25.568627 | 69 | 0.567485 |
1b215bc4626976da0ddda0b82575e037040177bc | 55,053 | py | Python | aloha/create_aloha.py | mfasDa/MadGraph5 | 9b90feda56d6209b81f74e61dc353a729886a4a5 | [
"NCSA"
] | null | null | null | aloha/create_aloha.py | mfasDa/MadGraph5 | 9b90feda56d6209b81f74e61dc353a729886a4a5 | [
"NCSA"
] | null | null | null | aloha/create_aloha.py | mfasDa/MadGraph5 | 9b90feda56d6209b81f74e61dc353a729886a4a5 | [
"NCSA"
] | 1 | 2021-07-06T08:19:27.000Z | 2021-07-06T08:19:27.000Z | ################################################################################
#
# Copyright (c) 2010 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix elements for arbitrary
# h... | 41.14574 | 187 | 0.52553 |
3157d39e92ee8f5242c5ce42d5c532828c792063 | 10,736 | py | Python | sdk/python/pulumi_azure_native/recoveryservices/v20180110/replicationv_center.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20180110/replicationv_center.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/recoveryservices/v20180110/replicationv_center.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 44.920502 | 941 | 0.663934 |
97bcd2a07a3d6d7c99e27f61c0956675eb489773 | 849 | py | Python | multivariate_time_series_rnn/scripts/train.py | xdr940/huawei2021 | 4d51f4b15bf152a6a7c75c9724d9414df3b9b636 | [
"MIT"
] | 1 | 2021-12-10T10:14:55.000Z | 2021-12-10T10:14:55.000Z | multivariate_time_series_rnn/scripts/train.py | xdr940/huawei2021 | 4d51f4b15bf152a6a7c75c9724d9414df3b9b636 | [
"MIT"
] | null | null | null | multivariate_time_series_rnn/scripts/train.py | xdr940/huawei2021 | 4d51f4b15bf152a6a7c75c9724d9414df3b9b636 | [
"MIT"
] | null | null | null | # Copyright Niantic 2019. Patent Pending. All rights reserved.
#
# This software is licensed under the terms of the Monodepth2 licence
# which allows for non-commercial use only, the full terms of which are made
# available in the LICENSE file.
from __future__ import absolute_import, division, print_function
from uti... | 32.653846 | 131 | 0.760895 |
d801cf25f20b2f00b13123568eb75064077da80e | 887 | py | Python | nilearn/plotting/tests/test_img_plotting/test_plot_prob_atlas.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | 827 | 2015-01-30T23:11:42.000Z | 2022-03-29T21:21:05.000Z | nilearn/plotting/tests/test_img_plotting/test_plot_prob_atlas.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | 2,845 | 2015-01-04T22:14:41.000Z | 2022-03-31T20:28:09.000Z | nilearn/plotting/tests/test_img_plotting/test_plot_prob_atlas.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | 484 | 2015-02-03T10:58:19.000Z | 2022-03-29T21:57:16.000Z | """Tests for :func:`nilearn.plotting.plot_prob_atlas`."""
import pytest
import numpy as np
import matplotlib.pyplot as plt
from nibabel import Nifti1Image
from nilearn.plotting import plot_prob_atlas
@pytest.mark.parametrize("params",
[{"view_type": 'contours'},
{"v... | 34.115385 | 77 | 0.606539 |
a3314d05ea25c97785e9a3010cf16ee691f69487 | 11,310 | py | Python | tests/jinja_context_tests.py | hikaya-io/incubator-superset | 3dac81c89613f04dc9e4424dda043821c7557323 | [
"Apache-2.0"
] | 44 | 2021-04-14T10:53:36.000Z | 2021-09-11T00:29:50.000Z | tests/jinja_context_tests.py | hikaya-io/incubator-superset | 3dac81c89613f04dc9e4424dda043821c7557323 | [
"Apache-2.0"
] | 77 | 2020-02-02T07:54:13.000Z | 2022-03-23T18:22:04.000Z | tests/jinja_context_tests.py | hikaya-io/incubator-superset | 3dac81c89613f04dc9e4424dda043821c7557323 | [
"Apache-2.0"
] | 11 | 2021-06-09T08:30:57.000Z | 2021-11-30T03:16:14.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.338983 | 82 | 0.603802 |
353cfc8853ec5666c7e9408573c9711273ce61b9 | 2,334 | py | Python | tests/api_resources/test_webhook_endpoint.py | photocrowd/stripe-python | 7c705e3d41f38f8524e419eb7ea18c1425a4ad89 | [
"MIT"
] | null | null | null | tests/api_resources/test_webhook_endpoint.py | photocrowd/stripe-python | 7c705e3d41f38f8524e419eb7ea18c1425a4ad89 | [
"MIT"
] | null | null | null | tests/api_resources/test_webhook_endpoint.py | photocrowd/stripe-python | 7c705e3d41f38f8524e419eb7ea18c1425a4ad89 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import stripe_modern as stripe
TEST_RESOURCE_ID = "we_123"
class TestWebhookEndpoint(object):
def test_is_listable(self, request_mock):
resources = stripe.WebhookEndpoint.list()
request_mock.assert_requested("get", "/v1/webhook_en... | 37.047619 | 73 | 0.680805 |
22ef56785069f58a46cb7a6989fc445b4189af15 | 3,527 | py | Python | sdk/lusid/models/operator.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/models/operator.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | sdk/lusid/models/operator.py | finbourne/lusid-sdk-python-generated-preview | 9c36c953e8149443a4390ed7f0c04d01211401b6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.4425
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 27.992063 | 124 | 0.577545 |
b3767ff5584a2aa19ddddeaed877e4b9847f822b | 65,070 | py | Python | fusionless/core.py | Colorbleed/fusionless | 4ff726c64e40f48383ddb032267587722712aaff | [
"BSD-3-Clause"
] | 10 | 2017-08-14T05:07:25.000Z | 2021-07-01T23:33:36.000Z | fusionless/core.py | BigRoy/fusionless | 4ff726c64e40f48383ddb032267587722712aaff | [
"BSD-3-Clause"
] | 5 | 2016-09-05T14:04:19.000Z | 2016-09-14T07:26:00.000Z | fusionless/core.py | Colorbleed/fusionless | 4ff726c64e40f48383ddb032267587722712aaff | [
"BSD-3-Clause"
] | null | null | null | """
Contains the main `PyNode` base class and its derived classes.
### Reference
For a community-built class list of Fusion's built-in classes:
http://www.steakunderwater.com/VFXPedia/96.0.243.189/index8c76.html?title=Eyeon:Script/Reference/Applications/Fusion/Classes
"""
import sys
class PyObject(object):
"""... | 33.165138 | 169 | 0.594206 |
19fafb3626d183034ab96b1a19ae8e7a0d021950 | 16,530 | py | Python | ombott/ombott.py | macneiln/ombott | f18f6e0e639f20efb63b137edbab8c8b3871d354 | [
"MIT"
] | null | null | null | ombott/ombott.py | macneiln/ombott | f18f6e0e639f20efb63b137edbab8c8b3871d354 | [
"MIT"
] | null | null | null | ombott/ombott.py | macneiln/ombott | f18f6e0e639f20efb63b137edbab8c8b3871d354 | [
"MIT"
] | null | null | null | import sys
import json
import functools
from traceback import format_exc
import itertools
from urllib.parse import urljoin
from .common_helpers import (
html_escape,
tob,
cached_property,
WSGIFileWrapper,
SimpleConfig,
)
from .router import HookTypes, RadiRouter
from .request import Request, errors... | 36.409692 | 119 | 0.557532 |
c462d45285faa5d03dcdb3156b2cc174e5abe722 | 8,477 | py | Python | model-optimizer/extensions/middle/ONNXResize11ToInterpolate.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/extensions/middle/ONNXResize11ToInterpolate.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/extensions/middle/ONNXResize11ToInterpolate.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
import numpy as np
from extensions.ops.Cast import Cast
from extensions.ops.activation_ops import Floor
from extensions.ops.elementwise import Add, Div, Mul
from extensions.ops.interpolate import Interpolate
from ... | 52.652174 | 117 | 0.6021 |
57a2524188bb74800e748338b7d4dcbe330ccf87 | 1,513 | py | Python | kinko/constant.py | vmagamedov/kinko | b65f8ae97bbf5d056781e90e22d2a369f440ed4c | [
"BSD-3-Clause"
] | 5 | 2015-11-18T20:31:14.000Z | 2016-05-05T07:43:21.000Z | kinko/constant.py | vmagamedov/kinko | b65f8ae97bbf5d056781e90e22d2a369f440ed4c | [
"BSD-3-Clause"
] | 5 | 2016-03-17T14:42:30.000Z | 2016-06-27T13:31:26.000Z | kinko/constant.py | vmagamedov/kinko | b65f8ae97bbf5d056781e90e22d2a369f440ed4c | [
"BSD-3-Clause"
] | null | null | null | HTML_ELEMENTS = frozenset((
# root
'html',
# metadata
'head', 'title', 'base', 'link', 'meta', 'style',
# sections
'body', 'article', 'section', 'nav', 'aside', 'h1', 'h2', 'h3', 'h4', 'h5',
'h6', 'hgroup', 'headers', 'footer', 'address',
# grouping content
'p', 'hr', 'pre', 'bloc... | 23.640625 | 80 | 0.487112 |
bcde01ef484e836d9c77121db1f31099b0bd203e | 870 | py | Python | mestre/src/exceptions/exception_handlers/movie_exception_handlers.py | rodrigoddc/simple_mvc | faff65547ccaf0d2b36d7e0fc7c5297ff0dd35c0 | [
"MIT"
] | null | null | null | mestre/src/exceptions/exception_handlers/movie_exception_handlers.py | rodrigoddc/simple_mvc | faff65547ccaf0d2b36d7e0fc7c5297ff0dd35c0 | [
"MIT"
] | 1 | 2021-12-10T00:41:55.000Z | 2021-12-10T00:41:55.000Z | mestre/src/exceptions/exception_handlers/movie_exception_handlers.py | rodrigoddc/simple_mvc | faff65547ccaf0d2b36d7e0fc7c5297ff0dd35c0 | [
"MIT"
] | null | null | null | from fastapi import Request
from fastapi.responses import JSONResponse
from mestre.src.exceptions.movie_exceptions import MovieRatingException, MovieNotFoundException, \
MovieMissingDataFromTMDBAPIException
def movie_exception_handler(request: Request, exc: MovieRatingException):
return JSONResponse(
... | 33.461538 | 102 | 0.73908 |
47a6a0ae8c51888baaf8a47b77b788044bb96d04 | 10,636 | py | Python | fabfile.py | smaragden/OpenRenderManagement | cf3ab356f96969d7952b60417b48e941955e435c | [
"BSD-3-Clause"
] | 35 | 2015-02-23T23:13:13.000Z | 2021-01-03T05:56:39.000Z | fabfile.py | smaragden/OpenRenderManagement | cf3ab356f96969d7952b60417b48e941955e435c | [
"BSD-3-Clause"
] | 15 | 2015-01-12T12:58:29.000Z | 2016-03-30T13:10:19.000Z | fabfile.py | mikrosimage/OpenRenderManagement | 6f9237a86cb8e4b206313f9c22424c8002fd5e4d | [
"BSD-3-Clause"
] | 20 | 2015-03-18T06:57:13.000Z | 2020-07-01T15:09:36.000Z | #!/usr/bin/python2.6
# -*- coding: utf8 -*-
from __future__ import with_statement
"""
"""
__author__ = "Jerome Samson"
__copyright__ = "Copyright 2013, Mikros Image"
from fabric.api import *
from fabric.colors import green, blue
env.timeout = 5
env.disable_known_hosts = True
env.source_path = ''
env.target_path = ''... | 39.835206 | 130 | 0.641783 |
39d2f1c50b4ef80a1198a8acc796ef8b3f6eb892 | 18,314 | py | Python | tensorflow_federated/python/core/impl/caching_executor_test.py | federated-learning-experiments/federated | ba258f53ff28574375cc5e5a8a80da1a2cd57290 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/caching_executor_test.py | federated-learning-experiments/federated | ba258f53ff28574375cc5e5a8a80da1a2cd57290 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/caching_executor_test.py | federated-learning-experiments/federated | ba258f53ff28574375cc5e5a8a80da1a2cd57290 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 43.708831 | 80 | 0.729551 |
60aeb4e989a3e4a9933f2e2a35cf0b91025c2085 | 12,893 | py | Python | packages/syft/src/syft/core/node/common/action/run_class_method_action.py | maltetoelle/PySyft | 0521f407cfdd046d00c332b733894a865848bd19 | [
"Apache-1.1"
] | null | null | null | packages/syft/src/syft/core/node/common/action/run_class_method_action.py | maltetoelle/PySyft | 0521f407cfdd046d00c332b733894a865848bd19 | [
"Apache-1.1"
] | 3 | 2021-11-17T15:34:03.000Z | 2021-12-08T14:39:10.000Z | packages/syft/src/syft/core/node/common/action/run_class_method_action.py | maltetoelle/PySyft | 0521f407cfdd046d00c332b733894a865848bd19 | [
"Apache-1.1"
] | null | null | null | # stdlib
import functools
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
# third party
from google.protobuf.reflection import GeneratedProtocolMessageType
from nacl.signing import VerifyKey
# syft absolute
import syft as sy
# relative
from ..... import lib
from ...... | 38.25816 | 95 | 0.59955 |
60a74af84063c3c2b2f9b43db4c1810897173c83 | 159 | py | Python | scipy/solutions/simple_linalg_solution.py | ramosmaria/school2021 | 3e162a05767bbc8fa6ce3f92c858d1bd639fee16 | [
"MIT"
] | 252 | 2021-05-18T11:58:17.000Z | 2022-03-12T06:48:52.000Z | scipy/solutions/simple_linalg_solution.py | ramosmaria/school2021 | 3e162a05767bbc8fa6ce3f92c858d1bd639fee16 | [
"MIT"
] | 44 | 2021-05-21T14:28:34.000Z | 2021-07-12T22:36:06.000Z | scipy/solutions/simple_linalg_solution.py | ramosmaria/school2021 | 3e162a05767bbc8fa6ce3f92c858d1bd639fee16 | [
"MIT"
] | 128 | 2021-05-24T18:32:54.000Z | 2022-03-26T11:24:16.000Z | # flake8: noqa
# 1
A = np.random.uniform(0, 1, size=(10, 10))
#2
A_sym = A + A.T
plt.matshow(A_sym)
plt.grid(False)
#3
values, vectors = linalg.eigh(A_sym) | 14.454545 | 42 | 0.641509 |
200acc2bfe3a21df253cb38ad668da717c168220 | 5,790 | py | Python | docs/conf.py | Clariteia/api_gateway_common | e68095f31091699fc6cc4537bd6acf97a8dc6c3e | [
"MIT"
] | 3 | 2021-05-14T08:13:09.000Z | 2021-05-26T11:25:35.000Z | docs/conf.py | Clariteia/api_gateway_common | e68095f31091699fc6cc4537bd6acf97a8dc6c3e | [
"MIT"
] | 27 | 2021-05-13T08:43:19.000Z | 2021-08-24T17:19:36.000Z | docs/conf.py | Clariteia/api_gateway_common | e68095f31091699fc6cc4537bd6acf97a8dc6c3e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# minos documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 28.106796 | 77 | 0.675993 |
5ee4942594d31d798e6bdab038db216bb0c3edf3 | 2,167 | py | Python | 04_Properties_and_Class_methods/iso3436.py | MANOJPATRA1991/Python-Beyond-the-Basics | aed7bfd35e33c2b1759b48e1c89314aa149c56d0 | [
"MIT"
] | null | null | null | 04_Properties_and_Class_methods/iso3436.py | MANOJPATRA1991/Python-Beyond-the-Basics | aed7bfd35e33c2b1759b48e1c89314aa149c56d0 | [
"MIT"
] | null | null | null | 04_Properties_and_Class_methods/iso3436.py | MANOJPATRA1991/Python-Beyond-the-Basics | aed7bfd35e33c2b1759b48e1c89314aa149c56d0 | [
"MIT"
] | null | null | null | """
ISO 6346 shipping container codes.
"""
def create(owner_code, serial, category='U'):
"""Create an ISO 6346 shipping container code.
Args:
owner_code (str): Three character alphabetic container code.
serial (str): Six digit numeric serial number.
category (str): Equipment category i... | 32.343284 | 86 | 0.636364 |
9af81a3f5c40e7696c65089e18848cab933d71d0 | 36 | py | Python | external/models/TransE_GUSE/__init__.py | swapUniba/Elliot_refactor-tesi-Ventrella | 3ddffc041696c90a6f6d3e8906c212fc4f55f842 | [
"Apache-2.0"
] | null | null | null | external/models/TransE_GUSE/__init__.py | swapUniba/Elliot_refactor-tesi-Ventrella | 3ddffc041696c90a6f6d3e8906c212fc4f55f842 | [
"Apache-2.0"
] | null | null | null | external/models/TransE_GUSE/__init__.py | swapUniba/Elliot_refactor-tesi-Ventrella | 3ddffc041696c90a6f6d3e8906c212fc4f55f842 | [
"Apache-2.0"
] | null | null | null | from .TransE_GUSE import TransE_GUSE | 36 | 36 | 0.888889 |
c9ab8f13984603f905227d9c9a11fa22364db3b6 | 1,576 | py | Python | tools/filters/lav_to_bed.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | tools/filters/lav_to_bed.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | tools/filters/lav_to_bed.py | vimalkumarvelayudhan/galaxy | ea89dd8f149778b6c2f0f3f4a34c8b21f7033af7 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
#Reads a LAV file and writes two BED files.
import sys
from galaxy import eggs
import pkg_resources
pkg_resources.require( "bx-python" )
import bx.align.lav
assert sys.version_info[:2] >= ( 2, 4 )
def stop_err( msg ):
sys.stderr.write( msg )
sys.exit()
def main():
try:
lav... | 28.142857 | 135 | 0.564721 |
9a9374f40b20213be4181c18826e1c6d4638f58f | 2,950 | py | Python | backend/users/models/user.py | hnthh/foodgram-project-react | 3383c6a116fded11b4a764b95e6ca4ead03444f3 | [
"MIT"
] | 1 | 2022-02-09T10:42:45.000Z | 2022-02-09T10:42:45.000Z | backend/users/models/user.py | hnthh/foodgram | 3383c6a116fded11b4a764b95e6ca4ead03444f3 | [
"MIT"
] | null | null | null | backend/users/models/user.py | hnthh/foodgram | 3383c6a116fded11b4a764b95e6ca4ead03444f3 | [
"MIT"
] | null | null | null | from config.models import DefaultUserQuerySet, models
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.validators import (
UnicodeUsernameValidator as _UnicodeUsernameValidator,
)
from django.db.models import Count, Exists, OuterRef, Q, Value
class UnicodeUsernameValidator(_UnicodeUser... | 27.314815 | 75 | 0.605424 |
117aa3044489ec7ef687e190a2e22a6665d924b6 | 647 | py | Python | misprogs/contador.py | dacocube/CursoGalileo | 1dac903031d9ff61174cb0c5e00e3f3795ea60de | [
"Apache-2.0"
] | null | null | null | misprogs/contador.py | dacocube/CursoGalileo | 1dac903031d9ff61174cb0c5e00e3f3795ea60de | [
"Apache-2.0"
] | null | null | null | misprogs/contador.py | dacocube/CursoGalileo | 1dac903031d9ff61174cb0c5e00e3f3795ea60de | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import signal
import sys
import time
import pyupm_grove as grove
import pyupm_ttp223 as ttp223
import pyupm_i2clcd as lcd
def interruptHandler(signal, frame):
sys.exit(0)
if __name__ == '__main__':
signal.signal(signal.SIGINT, interruptHandler)
touch = ttp223.TTP223(6)
myLcd = lcd.Jhd1313m1(0, 0x3... | 21.566667 | 64 | 0.727975 |
c9e56f5f70dd474993a40687a674f32c37bed1cb | 7,470 | py | Python | molecule.py | Ved-P/molecule | 9727a9e7f8c0412feee27bbe034a1540cff7534e | [
"MIT"
] | null | null | null | molecule.py | Ved-P/molecule | 9727a9e7f8c0412feee27bbe034a1540cff7534e | [
"MIT"
] | 1 | 2022-01-03T20:07:31.000Z | 2022-01-04T18:45:21.000Z | molecule.py | Ved-P/molecule | 9727a9e7f8c0412feee27bbe034a1540cff7534e | [
"MIT"
] | null | null | null | # Molecule
#
# This program takes in a molecular formula and creates a Lewis diagram and a 3D
# model of the molecule as the output.
#
# Author: Ved Pradhan
# Since: December 31, 2021
import json
import matplotlib.pyplot as plt
import sys
import math
# Opens the JSON file for use.
with open("elements.json", "r", enc... | 30.995851 | 107 | 0.58822 |
3aab968d3452d7013fa9764a8812c92fab73bd01 | 1,899 | py | Python | spec.py | swimclan/fergus_names | 28c10d99a40408839b321f0dbb5fc26764668d3e | [
"MIT"
] | null | null | null | spec.py | swimclan/fergus_names | 28c10d99a40408839b321f0dbb5fc26764668d3e | [
"MIT"
] | null | null | null | spec.py | swimclan/fergus_names | 28c10d99a40408839b321f0dbb5fc26764668d3e | [
"MIT"
] | null | null | null | from app import Directory
# =============================
# TESTS
# =============================
# TEST Instantiate a Directory with a max size of 2 and get empty initia
# list with None type in each index
product_team = Directory(2)
print "\nShould be an a list of size 2 with None objects in each index"
print produ... | 37.235294 | 101 | 0.770932 |
193ab794aec56788d7751fe8de623df9bd8d22be | 1,888 | py | Python | setup.py | KCRW-org/kcrw.apple_news | 81c0a402f210e87ae73fe02a3d39b7929c328ceb | [
"MIT"
] | null | null | null | setup.py | KCRW-org/kcrw.apple_news | 81c0a402f210e87ae73fe02a3d39b7929c328ceb | [
"MIT"
] | 85 | 2020-03-09T22:40:20.000Z | 2022-03-31T01:10:18.000Z | setup.py | KCRW-org/kcrw.apple_news | 81c0a402f210e87ae73fe02a3d39b7929c328ceb | [
"MIT"
] | 2 | 2021-05-12T17:37:09.000Z | 2021-08-14T11:30:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
###################################################################
KEYWORDS = ['Apple News', 'REST API', 'KCRW']
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Develop... | 28.606061 | 68 | 0.610169 |
afb51f98e575842a537ab31be89d2e7a1af05c86 | 40,767 | py | Python | zerver/lib/message.py | yakkl/yakkl | 89ecf4ee8998554a0634667067e16f428e4c480c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | zerver/lib/message.py | yakkl/yakkl | 89ecf4ee8998554a0634667067e16f428e4c480c | [
"ECL-2.0",
"Apache-2.0"
] | 4 | 2020-06-06T00:51:42.000Z | 2022-02-10T21:38:40.000Z | zerver/lib/message.py | yakkl/yakkl | 89ecf4ee8998554a0634667067e16f428e4c480c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null |
import datetime
import ujson
import zlib
import ahocorasick
from django.utils.translation import ugettext as _
from django.utils.timezone import now as timezone_now
from django.db import connection
from django.db.models import Sum
from analytics.lib.counts import COUNT_STATS, RealmCount
from zerver.lib.avatar impor... | 36.793321 | 108 | 0.629431 |
e580665cfc569f132558234d1ff61ee8811ca446 | 22,220 | py | Python | homeassistant/components/fritz/common.py | andersonshatch/home-assistant | 10e2caf9e698759c48f4e859d3ed7d5c335a18b8 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/fritz/common.py | andersonshatch/home-assistant | 10e2caf9e698759c48f4e859d3ed7d5c335a18b8 | [
"Apache-2.0"
] | 19 | 2021-11-24T06:23:55.000Z | 2022-03-31T06:22:45.000Z | homeassistant/components/fritz/common.py | andersonshatch/home-assistant | 10e2caf9e698759c48f4e859d3ed7d5c335a18b8 | [
"Apache-2.0"
] | null | null | null | """Support for AVM FRITZ!Box classes."""
from __future__ import annotations
from collections.abc import Callable, ValuesView
from dataclasses import dataclass, field
from datetime import datetime, timedelta
import logging
from types import MappingProxyType
from typing import Any, TypedDict, cast
from fritzconnection ... | 32.772861 | 113 | 0.610666 |
cf77e268055a7930c748fb3ec0f3f07b8ed7fd52 | 4,662 | py | Python | core/dr_utils/dib_renderer_x/renderer/texrender_batch.py | weiqi-luo/Self6D-Diff-Renderer | 1e1caad49f0f8de90a332995814de29261598982 | [
"Apache-2.0"
] | null | null | null | core/dr_utils/dib_renderer_x/renderer/texrender_batch.py | weiqi-luo/Self6D-Diff-Renderer | 1e1caad49f0f8de90a332995814de29261598982 | [
"Apache-2.0"
] | null | null | null | core/dr_utils/dib_renderer_x/renderer/texrender_batch.py | weiqi-luo/Self6D-Diff-Renderer | 1e1caad49f0f8de90a332995814de29261598982 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
from __future__ import division
from ..rasterizer import linear_rasterizer
from ..utils import datanormalize
from .fragment_shaders.frag_tex import fragmentshader
from .vertex_shaders.perpsective import perspective_projection
import torch
import torch.nn as nn
import numpy as np
... | 39.176471 | 107 | 0.54526 |
3f158cd585a9bcbbb893fbf75847a24a8075f0b4 | 103,555 | py | Python | src/grassfire/test/test_parallel_failing.py | bmmeijers/grassfire | 20995d97ca41763d40b23f0fadb6e0581dff859b | [
"MIT"
] | 1 | 2021-07-09T14:53:34.000Z | 2021-07-09T14:53:34.000Z | src/grassfire/test/test_parallel_failing.py | bmmeijers/grassfire | 20995d97ca41763d40b23f0fadb6e0581dff859b | [
"MIT"
] | null | null | null | src/grassfire/test/test_parallel_failing.py | bmmeijers/grassfire | 20995d97ca41763d40b23f0fadb6e0581dff859b | [
"MIT"
] | null | null | null | import unittest
from tri.delaunay.helpers import ToPointsAndSegments
from grassfire import calc_skel
from grassfire.events import at_same_location
PAUSE = False
OUTPUT = False
LOGGING = False
class TestMoreAdvancedParallelEvents(unittest.TestCase):
def setUp(self):
pass
def test_capital_T(self):
... | 158.099237 | 11,542 | 0.612679 |
e5271ef9bfcae191d78572c871ee0e9103c76d21 | 2,034 | py | Python | examples/ex2_ackley.py | evdcush/neorl | a1af069072e752ab79e7279a88ad95d195a81821 | [
"MIT"
] | 20 | 2021-04-20T19:15:33.000Z | 2022-03-19T17:00:12.000Z | examples/ex2_ackley.py | evdcush/neorl | a1af069072e752ab79e7279a88ad95d195a81821 | [
"MIT"
] | 17 | 2021-04-07T21:52:41.000Z | 2022-03-06T16:05:31.000Z | examples/ex2_ackley.py | evdcush/neorl | a1af069072e752ab79e7279a88ad95d195a81821 | [
"MIT"
] | 8 | 2021-05-07T03:36:30.000Z | 2021-12-15T03:41:41.000Z | #---------------------------------
# Import packages
#---------------------------------
import numpy as np
import matplotlib.pyplot as plt
from neorl import PSO, DE, XNES
from math import exp, sqrt, cos, pi
np.random.seed(50)
#---------------------------------
# Fitness function
#---------------------------... | 31.292308 | 81 | 0.483284 |
eee9760308d11b14da1050887cd000f517c32c0a | 1,844 | py | Python | tests/test_verify.py | arjenzijlstra/python-rest-api | 81cfc0c3621864ab88128fb7fefb3e4bdec58429 | [
"BSD-2-Clause"
] | null | null | null | tests/test_verify.py | arjenzijlstra/python-rest-api | 81cfc0c3621864ab88128fb7fefb3e4bdec58429 | [
"BSD-2-Clause"
] | null | null | null | tests/test_verify.py | arjenzijlstra/python-rest-api | 81cfc0c3621864ab88128fb7fefb3e4bdec58429 | [
"BSD-2-Clause"
] | null | null | null | import unittest
from messagebird import Client
try:
from unittest.mock import Mock
except ImportError:
# mock was added to unittest in Python 3.3, but was an external library
# before.
from mock import Mock
class TestVerify(unittest.TestCase):
def test_verify(self):
http_client = Mock()
... | 44.97561 | 385 | 0.691432 |
4bcd0f0ae9636a0c5fd8d174dcc6d030cfa3d67f | 17,580 | py | Python | pyADVISE/report.py | lightnerdevtech/pyADVISE | 7496729b57a777c5ac73d1ac08589b9794a77955 | [
"Apache-2.0"
] | null | null | null | pyADVISE/report.py | lightnerdevtech/pyADVISE | 7496729b57a777c5ac73d1ac08589b9794a77955 | [
"Apache-2.0"
] | null | null | null | pyADVISE/report.py | lightnerdevtech/pyADVISE | 7496729b57a777c5ac73d1ac08589b9794a77955 | [
"Apache-2.0"
] | null | null | null | ###########################################
###########################################
#### Function to generate reports in Reportlab
###########################################
###########################################
# libraries
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
## repor... | 35.301205 | 366 | 0.584528 |
f5b6d8cfba02a75aa43bc910456dfe4c2b04d16f | 6,168 | py | Python | homeassistant/components/sensor/haveibeenpwned.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/sensor/haveibeenpwned.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/sensor/haveibeenpwned.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | null | null | null | """
Support for haveibeenpwned (email breaches) sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.haveibeenpwned/
"""
from datetime import timedelta
import logging
import voluptuous as vol
import requests
from homeassistant.components.senso... | 34.266667 | 78 | 0.630026 |
e00fd19768e4ad1ea8bec3214f0514e2ed7b3e28 | 1,571 | py | Python | final-project/repositories/Real-time_3D_Rendering/HLS3D-master/render/transformable.py | bol-edu/2020-fall-ntu | 5e009875dec5a3bbcebd1b3fae327990371d1b6a | [
"MIT"
] | 7 | 2021-02-10T17:59:48.000Z | 2021-09-27T15:02:56.000Z | final-project/repositories/Real-time_3D_Rendering/HLS3D-master/render/transformable.py | bol-edu/2020-fall-ntu | 5e009875dec5a3bbcebd1b3fae327990371d1b6a | [
"MIT"
] | null | null | null | final-project/repositories/Real-time_3D_Rendering/HLS3D-master/render/transformable.py | bol-edu/2020-fall-ntu | 5e009875dec5a3bbcebd1b3fae327990371d1b6a | [
"MIT"
] | 1 | 2022-03-22T01:46:01.000Z | 2022-03-22T01:46:01.000Z | import numpy as np
class Transformable:
def __init__(self, transform):
self.transform = transform
self.scale = 1
def set_scale(self, scale):
self.scale = scale
def translate_local_z(self, offset):
pass
def translate_local_y(self, offset):
pass
def transl... | 25.33871 | 52 | 0.471674 |
cc6743275539a06849c3845b90a8f850d3b8e367 | 4,212 | py | Python | utils.py | carrier-io/security | a1dd3f0f0d9a923dc97b8e1b5ee45f5828f2454e | [
"Apache-2.0"
] | null | null | null | utils.py | carrier-io/security | a1dd3f0f0d9a923dc97b8e1b5ee45f5828f2454e | [
"Apache-2.0"
] | 1 | 2022-01-20T10:26:03.000Z | 2022-01-20T10:26:03.000Z | utils.py | carrier-io/security | a1dd3f0f0d9a923dc97b8e1b5ee45f5828f2454e | [
"Apache-2.0"
] | 3 | 2021-06-16T11:36:34.000Z | 2021-07-21T09:09:47.000Z | import json
from queue import Empty
from typing import Tuple, Union
from pydantic import ValidationError
from pylon.core.tools import log
from .models.api_tests import SecurityTestsDAST
from .models.security_results import SecurityResultsDAST
from ..tasks.api.utils import run_task
from ..projects.models.statistics i... | 31.909091 | 109 | 0.591643 |
4a649381327ffd8fd9291801ee2e78daf1e93563 | 2,762 | py | Python | calh/app.py | ricky-lim/calh | 27185862b93cec92c9a5af4705aadea47b7a15d1 | [
"Apache-2.0"
] | 2 | 2020-05-05T20:12:26.000Z | 2021-08-19T20:25:46.000Z | calh/app.py | ricky-lim/calh | 27185862b93cec92c9a5af4705aadea47b7a15d1 | [
"Apache-2.0"
] | 6 | 2020-04-11T04:59:28.000Z | 2020-05-03T06:17:25.000Z | calh/app.py | ricky-lim/calh | 27185862b93cec92c9a5af4705aadea47b7a15d1 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import ipyvuetify as v
from ipywidgets import FileUpload
from calh.visualization import Heatmap
class App:
def __init__(self, app_dir="."):
self.app_dir = app_dir
self.main_loading = v.ProgressLinear(indeterminate=False)
self.main_toolbar = self.create_main_toolb... | 32.494118 | 79 | 0.542723 |
bf6eaba0e0e77d681c8edf7e58e7b10aed74c98a | 418 | py | Python | connect/models/activation_response.py | ht-albert/connect-python-sdk | 15de3b9d641e25c058a4ebe4a3644c584b3e6dfa | [
"Apache-2.0"
] | null | null | null | connect/models/activation_response.py | ht-albert/connect-python-sdk | 15de3b9d641e25c058a4ebe4a3644c584b3e6dfa | [
"Apache-2.0"
] | null | null | null | connect/models/activation_response.py | ht-albert/connect-python-sdk | 15de3b9d641e25c058a4ebe4a3644c584b3e6dfa | [
"Apache-2.0"
] | null | null | null | import json
class ActivationTileResponse(object):
tile = 'Activation succeeded'
def __init__(self, markdown=None, *args, **kwargs):
if markdown:
try:
self.tile = json.loads(markdown)
except ValueError:
self.tile = markdown
class ActivationTemp... | 23.222222 | 55 | 0.626794 |
a760fe61f383c2dea2d926decfa4b43cc2aa9a83 | 331 | py | Python | ai_part/data_collection/rename_img_files.py | BuildForSDGCohort2/Team-253-Group-A-Backend | 6640d3779ca6b2768eb0ea88e12cd78538e71e15 | [
"MIT"
] | 5 | 2020-09-28T16:50:24.000Z | 2022-02-16T15:01:22.000Z | ai_part/data_collection/rename_img_files.py | BuildForSDGCohort2/Team-253-Group-A-Backend | 6640d3779ca6b2768eb0ea88e12cd78538e71e15 | [
"MIT"
] | 16 | 2020-08-25T07:50:12.000Z | 2020-09-30T09:36:53.000Z | ai_part/data_collection/rename_img_files.py | BuildForSDGCohort2/Team-253-Group-A-Backend | 6640d3779ca6b2768eb0ea88e12cd78538e71e15 | [
"MIT"
] | 3 | 2020-08-29T16:32:25.000Z | 2021-12-20T13:29:45.000Z | # This piece of code is used to rename image files and move them to a specific folder.
import os
root_dir = './covidTrash'
directory = './covidTrash/as_trash_clean_v1.clean/'
clean_data_dir = './covidTrash/cleaned_data/'
for file in os.listdir(directory):
os.rename(directory + file, clean_data_dir + 'number_of_d... | 33.1 | 86 | 0.752266 |
38cbe548bb23b33f29cf41582e60c6753664673e | 3,338 | py | Python | Pix2Vox-F/models/encoder.py | chicleee/Pix2Vox | deaf8a161268bdc0cfddc3d2196457886fe12f95 | [
"MIT"
] | 2 | 2021-04-26T01:49:56.000Z | 2021-05-18T16:05:01.000Z | Pix2Vox-F/models/encoder.py | chicleee/Pix2Vox | deaf8a161268bdc0cfddc3d2196457886fe12f95 | [
"MIT"
] | null | null | null | Pix2Vox-F/models/encoder.py | chicleee/Pix2Vox | deaf8a161268bdc0cfddc3d2196457886fe12f95 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# import torch
# import torchvision.models
import paddle
from paddle.vision.models import vgg16
from paddle.vision.models import resnet50
class Encoder(paddle.nn.Layer):
def __init__(self, cfg):
super(Encoder, self).__init__()
self.cfg = cfg
# Layer Definition
... | 46.361111 | 161 | 0.6426 |
488c189e744b3f92142c939ae29974675e7fc7ae | 11,026 | py | Python | models/US CERT National Cyber Awareness System Alerts.py | outsideken/brewlytics | 9326ad1b06e81ac5b64a9e4e83d4d185d20c8d6a | [
"CC0-1.0"
] | null | null | null | models/US CERT National Cyber Awareness System Alerts.py | outsideken/brewlytics | 9326ad1b06e81ac5b64a9e4e83d4d185d20c8d6a | [
"CC0-1.0"
] | null | null | null | models/US CERT National Cyber Awareness System Alerts.py | outsideken/brewlytics | 9326ad1b06e81ac5b64a9e4e83d4d185d20c8d6a | [
"CC0-1.0"
] | null | null | null | ################################################################################
################################################################################
## US CERT National Cyber Awareness System Alerts
## RSS Feed
## Author: outsideKen
## Created: 07 July 2020
## Updated: 07 May 2022
##
######################... | 34.892405 | 84 | 0.462724 |
9fe82ad76e83bc584053d415d4a4274fe4152ac7 | 463 | py | Python | mynn/initializers.py | HashimHL/EvolveDNNRL | a7d5bfad037af503a994f73f556e172bda825926 | [
"MIT"
] | 1 | 2019-11-10T15:01:22.000Z | 2019-11-10T15:01:22.000Z | mynn/initializers.py | HashimHL/EvolveDNNRL | a7d5bfad037af503a994f73f556e172bda825926 | [
"MIT"
] | null | null | null | mynn/initializers.py | HashimHL/EvolveDNNRL | a7d5bfad037af503a994f73f556e172bda825926 | [
"MIT"
] | null | null | null | import numpy as np
class Zeros:
def __init__(self):
pass
def create_weights(self,size):
return np.zeros(size)
class Ones:
def __init__(self):
pass
def create_weights(self,size):
return np.ones(size)
class Uniform:
def __init__(self,low=-1,high=1):
self.low=low
self.high=high
def create_weights(... | 14.46875 | 65 | 0.712743 |
30fa327ab87717aa0e8a2b1d666de94f486c7ccb | 17,251 | py | Python | .modules/.metagoofil/hachoir_core/tools.py | termux-one/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 1,103 | 2018-04-20T14:08:11.000Z | 2022-03-29T06:22:43.000Z | .modules/.metagoofil/hachoir_core/tools.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 29 | 2019-04-03T14:52:38.000Z | 2022-03-24T12:33:05.000Z | .modules/.metagoofil/hachoir_core/tools.py | sshourya948/EasY_HaCk | 0a8d09ca4b126b027b6842e02fa0c29d8250e090 | [
"Apache-2.0"
] | 262 | 2017-09-16T22:15:50.000Z | 2022-03-31T00:38:42.000Z | # -*- coding: utf-8 -*-
"""
Various utilities.
"""
from hachoir_core.i18n import _, ngettext
import re
import stat
from datetime import datetime, timedelta, MAXYEAR
from warnings import warn
def deprecated(comment=None):
"""
This is a decorator which can be used to mark functions
as deprecated. It will r... | 29.590051 | 84 | 0.589995 |
ccb031ea022edf40ae433810471b1f47465df396 | 2,789 | py | Python | models/stylegan2/op/fused_act.py | jojoon99/Barbershop | f5e837166806c27ce8f94dd96dd888a78640fcda | [
"MIT"
] | 492 | 2021-06-03T01:14:03.000Z | 2022-03-31T12:27:41.000Z | models/stylegan2/op/fused_act.py | jojoon99/Barbershop | f5e837166806c27ce8f94dd96dd888a78640fcda | [
"MIT"
] | 30 | 2021-06-05T10:14:35.000Z | 2022-03-15T08:13:33.000Z | models/stylegan2/op/fused_act.py | jojoon99/Barbershop | f5e837166806c27ce8f94dd96dd888a78640fcda | [
"MIT"
] | 93 | 2021-06-04T11:08:29.000Z | 2022-03-31T12:06:00.000Z | import os
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Function
from torch.utils.cpp_extension import load
module_path = os.path.dirname(__file__)
fused = load(
"fused",
sources=[
os.path.join(module_path, "fused_bias_act.cpp"),
... | 28.752577 | 84 | 0.621011 |
e7c7ef03f7f25483e73182198ec74bc03e57e60f | 1,395 | py | Python | flumine/clients/simulatedclient.py | betcode-org/flumine | b33d82b75175106b2de0d0c4f9851599b085e389 | [
"MIT"
] | 2 | 2022-03-21T11:42:56.000Z | 2022-03-26T08:36:18.000Z | flumine/clients/simulatedclient.py | betcode-org/flumine | b33d82b75175106b2de0d0c4f9851599b085e389 | [
"MIT"
] | 4 | 2022-03-25T09:49:37.000Z | 2022-03-25T10:18:13.000Z | flumine/clients/simulatedclient.py | betcode-org/flumine | b33d82b75175106b2de0d0c4f9851599b085e389 | [
"MIT"
] | null | null | null | from typing import Optional
from betfairlightweight.metadata import currency_parameters
from betfairlightweight.resources.accountresources import AccountDetails
from .baseclient import BaseClient
from .clients import ExchangeType
class SimulatedClient(BaseClient):
"""
Simulated betting client.
"""
E... | 26.826923 | 86 | 0.656631 |
cd3668e5b3634552966dcdfa12e27edf06cd77c7 | 1,004 | py | Python | Python3/187.repeated-dna-sequences.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/187.repeated-dna-sequences.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/187.repeated-dna-sequences.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=187 lang=python3
#
# [187] Repeated DNA Sequences
#
# @lc code=start
class Solution:
def findRepeatedDnaSequences(self, s):
if len(s) <= 10:
return []
repeated = []
bit_dic = {
# 00
'A': 0,
# 01
'C': 1,
... | 25.1 | 70 | 0.438247 |
af3aa8bd8d2ab7a708a11f662acad6226745db09 | 27,340 | py | Python | jasmin/protocols/smpp/factory.py | phil-lavin/jasmin | 75897bb394f531cd76113b21d697acc86c4f5e81 | [
"Apache-2.0"
] | 2 | 2020-05-14T18:27:01.000Z | 2021-03-21T17:26:19.000Z | jasmin/protocols/smpp/factory.py | phil-lavin/jasmin | 75897bb394f531cd76113b21d697acc86c4f5e81 | [
"Apache-2.0"
] | null | null | null | jasmin/protocols/smpp/factory.py | phil-lavin/jasmin | 75897bb394f531cd76113b21d697acc86c4f5e81 | [
"Apache-2.0"
] | 1 | 2020-11-24T06:48:22.000Z | 2020-11-24T06:48:22.000Z | # pylint: disable=W0401,W0611,W0231
import cPickle as pickle
import logging
import re
from datetime import datetime, timedelta
from logging.handlers import TimedRotatingFileHandler
from OpenSSL import SSL
from twisted.internet import defer, reactor, ssl
from twisted.internet.protocol import ClientFactory
from jasmin.... | 44.527687 | 123 | 0.625896 |
982f71543d386ae442db9b113292f597581ffdac | 2,814 | py | Python | akira_lang.py | Daniell2020UKR/YT_dl | 6c819f5162e98fff104638529a08b9ee9e243e01 | [
"MIT"
] | null | null | null | akira_lang.py | Daniell2020UKR/YT_dl | 6c819f5162e98fff104638529a08b9ee9e243e01 | [
"MIT"
] | 3 | 2021-06-08T21:53:26.000Z | 2022-01-13T02:57:31.000Z | akira_lang.py | Daniell2020UKR/YT_dl | 6c819f5162e98fff104638529a08b9ee9e243e01 | [
"MIT"
] | null | null | null | translations = {
'en': {
'akira_start': 'Hi! Type \".help\" to get a list of commands.',
'akira_noargs': 'No arguments.',
'akira_version': 'My version - ',
'akira_nolang': 'This language is not supported.',
'akira_newlang': 'New language is set.',
'akira_pmonly': 'Thi... | 56.28 | 240 | 0.61656 |
b68531ff5e5d72c57a8d4e5170381aa50916af2a | 2,270 | py | Python | sources/lambda/async/index.py | stmayne/workshop-textract-comprehend-es | 9e886cacf3ba00a2c696baafa745fa753e2e5202 | [
"MIT-0"
] | 26 | 2020-02-12T20:45:17.000Z | 2021-12-23T15:23:03.000Z | sources/lambda/async/index.py | stmayne/workshop-textract-comprehend-es | 9e886cacf3ba00a2c696baafa745fa753e2e5202 | [
"MIT-0"
] | 2 | 2020-02-20T13:13:23.000Z | 2021-09-28T19:21:54.000Z | sources/lambda/async/index.py | stmayne/workshop-textract-comprehend-es | 9e886cacf3ba00a2c696baafa745fa753e2e5202 | [
"MIT-0"
] | 22 | 2020-02-19T20:36:55.000Z | 2022-03-19T07:11:16.000Z | #
# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
#
# 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 w... | 33.880597 | 87 | 0.7 |
c5e9fc90085756c9fdf363cb6b12a17ee7648e75 | 891 | py | Python | sharppy/sharptab/constants.py | skovic/SHARPpy | 19175269ab11fe06c917b5d10376862a4716e1db | [
"BSD-3-Clause"
] | 163 | 2015-01-05T06:57:16.000Z | 2022-03-15T04:19:42.000Z | sharppy/sharptab/constants.py | skovic/SHARPpy | 19175269ab11fe06c917b5d10376862a4716e1db | [
"BSD-3-Clause"
] | 187 | 2015-01-20T05:30:55.000Z | 2022-03-28T17:50:38.000Z | sharppy/sharptab/constants.py | skovic/SHARPpy | 19175269ab11fe06c917b5d10376862a4716e1db | [
"BSD-3-Clause"
] | 110 | 2015-01-06T05:55:47.000Z | 2022-03-15T18:40:21.000Z | ''' Frequently used meteorological constants '''
__all__ = ['MISSING', 'ROCP', 'ZEROCNK', 'G', 'TOL', 'WHITE', 'RED',
'ORANGE', 'YELLOW', 'MAGENTA', 'DBROWN', 'LBROWN', 'LBLUE',
'CYAN', 'BLACK', 'GREEN', 'DGREEN', 'HAINES_HIGH', 'HAINES_MID',
'HAINES_LOW']
# Meteorological Constants
M... | 25.457143 | 75 | 0.611672 |
59bb154a0a142bb44f1e617b59a6516f99d21a50 | 8,958 | py | Python | socketio/handler.py | ansible/gevent-socketio | bd81cb6cc6fab8b67d108ecde94305d654bcd143 | [
"BSD-3-Clause"
] | 2 | 2017-12-19T13:28:05.000Z | 2020-04-13T07:34:55.000Z | socketio/handler.py | ansible/gevent-socketio | bd81cb6cc6fab8b67d108ecde94305d654bcd143 | [
"BSD-3-Clause"
] | null | null | null | socketio/handler.py | ansible/gevent-socketio | bd81cb6cc6fab8b67d108ecde94305d654bcd143 | [
"BSD-3-Clause"
] | 2 | 2017-12-19T13:27:38.000Z | 2020-04-13T07:34:57.000Z | import sys
import re
import gevent
import urlparse
from gevent.pywsgi import WSGIHandler
from socketio import transports
class SocketIOHandler(WSGIHandler):
RE_REQUEST_URL = re.compile(r"""
^/(?P<resource>.+?)
/1
/(?P<transport_id>[^/]+)
/(?P<sessid>[^/]+)/?$
""", re.X)... | 39.462555 | 86 | 0.592096 |
1169ccfa2282947ee4672b7e4b19f1a174b5fe6f | 3,054 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2019-05-17T21:24:53.000Z | 2020-02-12T11:13:42.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 15 | 2019-07-12T18:18:04.000Z | 2019-07-25T20:55:51.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2019_10_17/aio/_configuration_async.py | LianwMS/azure-sdk-for-python | 612d7bca9de86ee1bd1fa59291d7bf897ba9213f | [
"MIT"
] | 2 | 2020-05-21T22:51:22.000Z | 2020-05-26T20:53:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.272727 | 134 | 0.688278 |
796b1bdb778efe5da26dcfcf9effb5b875abbd2c | 2,400 | py | Python | prensilia/parloma_demo_test1.py | parloma/Prensilia | e0292834b82e7046e4333ecdb0be78502fdf6dab | [
"Apache-2.0"
] | 1 | 2015-01-12T03:08:25.000Z | 2015-01-12T03:08:25.000Z | prensilia/parloma_demo_test1.py | parloma/Prensilia | e0292834b82e7046e4333ecdb0be78502fdf6dab | [
"Apache-2.0"
] | null | null | null | prensilia/parloma_demo_test1.py | parloma/Prensilia | e0292834b82e7046e4333ecdb0be78502fdf6dab | [
"Apache-2.0"
] | null | null | null | from cv2 import namedWindow, imshow, waitKey, cvtColor, COLOR_RGB2BGR
from hand_grabber import PyOpenNIHandGrabber
from pose_recognizer import PyPoseRecognizer
from my_fun import *
from sklearn.externals import joblib
from hand import *
import time
import socket
WIDTH = 640
HEIGHT = 480
USE_CPU = False
#clien... | 25.263158 | 69 | 0.575 |
ff1884108a577cb9c834a2191838169ebc03e0e8 | 8,467 | py | Python | accelbyte_py_sdk/api/cloudsave/operations/public_player_record/delete_player_record_ha_3addde.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/operations/public_player_record/delete_player_record_ha_3addde.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/cloudsave/operations/public_player_record/delete_player_record_ha_3addde.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 29.918728 | 136 | 0.612614 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.