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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
40dd3c840d2e990beffd155d7f218c48aa66fbd3 | 216 | wsgi | Python | index.wsgi | liukaijv/driving-reserve | 79d0555a7f0b08705dffd8b86f2e713f9a14cdf1 | [
"MIT"
] | 3 | 2018-03-16T08:00:04.000Z | 2021-12-06T13:30:11.000Z | index.wsgi | liukaijv/driving-reserve | 79d0555a7f0b08705dffd8b86f2e713f9a14cdf1 | [
"MIT"
] | null | null | null | index.wsgi | liukaijv/driving-reserve | 79d0555a7f0b08705dffd8b86f2e713f9a14cdf1 | [
"MIT"
] | null | null | null | import sae
import os
import sys
from driving import wsgi
app_root = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(app_root, 'django-filter-0.9.2'))
application = sae.create_wsgi_app(wsgi.application) | 21.6 | 66 | 0.773148 | import sae
import os
import sys
from driving import wsgi
app_root = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(app_root, 'django-filter-0.9.2'))
application = sae.create_wsgi_app(wsgi.application) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d5b6a4388970ef2bf13ac1a64597de5b781975a8 | 1,889 | py | Python | Data Visualization/Matplotlib/3D Graphs.py | ALDOR99/Python | a76f37bb3e573cd3fdcfc19f4f73494cafa9140e | [
"MIT"
] | 2 | 2021-05-27T19:13:02.000Z | 2021-06-02T13:26:35.000Z | Data Visualization/Matplotlib/3D Graphs.py | ALDOR99/Python | a76f37bb3e573cd3fdcfc19f4f73494cafa9140e | [
"MIT"
] | null | null | null | Data Visualization/Matplotlib/3D Graphs.py | ALDOR99/Python | a76f37bb3e573cd3fdcfc19f4f73494cafa9140e | [
"MIT"
] | 1 | 2021-06-07T18:17:35.000Z | 2021-06-07T18:17:35.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 00:12:01 2021
@author: ali_d
"""
#3D graphs
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import style
style.use('fivethirtyeight')
fig = plt.figure()
ax1 = fig.add_subplot(111, projection='3d')
x = [1,2,3,4,5,6,7,8,9,10]
... | 15.87395 | 44 | 0.608788 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 00:12:01 2021
@author: ali_d
"""
#3D graphs
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import style
style.use('fivethirtyeight')
fig = plt.figure()
ax1 = fig.add_subplot(111, projection='3d')
x = [1,2,3,4,5,6,7,8,9,10]
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 23 |
d23926958e4d5f92e5bd9554f8ede9c3ebd631de | 6,201 | py | Python | bindings/python/cntk/initializer.py | atfkaka/CNTK | 4370db138aa1e14d9363a8ad055f23b7e7369377 | [
"RSA-MD"
] | 1 | 2017-11-23T02:03:19.000Z | 2017-11-23T02:03:19.000Z | bindings/python/cntk/initializer.py | atfkaka/CNTK | 4370db138aa1e14d9363a8ad055f23b7e7369377 | [
"RSA-MD"
] | null | null | null | bindings/python/cntk/initializer.py | atfkaka/CNTK | 4370db138aa1e14d9363a8ad055f23b7e7369377 | [
"RSA-MD"
] | null | null | null | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
from . import cntk_py
from .cntk_py import default_param_init_scale as DefaultParamI... | 35.434286 | 155 | 0.703596 | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
from . import cntk_py
from .cntk_py import default_param_init_scale as DefaultParamI... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 0 |
f6ae5b80a2e1f5e69ef871e05a3bf2e1702673e2 | 383,174 | py | Python | source/codegen/metadata/nidaqmx/functions.py | zhindes/grpc-device | 616aa913963098b12d276693895b7eb946f82df4 | [
"MIT"
] | null | null | null | source/codegen/metadata/nidaqmx/functions.py | zhindes/grpc-device | 616aa913963098b12d276693895b7eb946f82df4 | [
"MIT"
] | null | null | null | source/codegen/metadata/nidaqmx/functions.py | zhindes/grpc-device | 616aa913963098b12d276693895b7eb946f82df4 | [
"MIT"
] | null | null | null | functions = {
'AddCDAQSyncConnection': {
'parameters': [
{
'direction': 'in',
'name': 'portList',
'type': 'const char[]'
}
],
'returns': 'int32'
},
'AddGlobalChansToTask': {
'parameters': [
{
... | 27.675984 | 97 | 0.30702 | functions = {
'AddCDAQSyncConnection': {
'parameters': [
{
'direction': 'in',
'name': 'portList',
'type': 'const char[]'
}
],
'returns': 'int32'
},
'AddGlobalChansToTask': {
'parameters': [
{
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
69cd230e71d4b5d168b9c15cc2b63e64ac065523 | 531 | py | Python | function/call_func.py | baayso/learn-python3 | 45f774d031921119807cb801abf0567574201446 | [
"Apache-2.0"
] | null | null | null | function/call_func.py | baayso/learn-python3 | 45f774d031921119807cb801abf0567574201446 | [
"Apache-2.0"
] | null | null | null | function/call_func.py | baayso/learn-python3 | 45f774d031921119807cb801abf0567574201446 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
x = abs(100)
y = abs(-20)
print(x, y)
print()
#
print('max(1, 2, 3) =', max(1, 2, 3))
print('min(1, 2, 3) =', min(1, 2, 3))
print('sum([1, 2, 3]) =', sum([1, 2, 3]))
print()
#
print(int('123'))
print(int(12.34))
print(float('12.34'))
print(str(1.23))
print(str(100))... | 16.59375 | 52 | 0.60452 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
x = abs(100)
y = abs(-20)
print(x, y)
print()
# 以下函数可以接收任意多个参数
print('max(1, 2, 3) =', max(1, 2, 3))
print('min(1, 2, 3) =', min(1, 2, 3))
print('sum([1, 2, 3]) =', sum([1, 2, 3]))
print()
# 数据类型转换
print(int('123'))
print(int(12.34))
print(float('12.34'))
print(str(1.... | 261 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bebe72fc4c0c6d64b4acfc3eaa461359cc76838c | 1,681 | py | Python | tests/code.py | chukhanhhoang/CircuitPython_MPU9250 | 7efd0f27c2e51d9f6ff2817615758645a58ca1a3 | [
"MIT"
] | 9 | 2020-03-14T19:36:54.000Z | 2021-10-01T18:53:22.000Z | tests/code.py | chukhanhhoang/CircuitPython_MPU9250 | 7efd0f27c2e51d9f6ff2817615758645a58ca1a3 | [
"MIT"
] | null | null | null | tests/code.py | chukhanhhoang/CircuitPython_MPU9250 | 7efd0f27c2e51d9f6ff2817615758645a58ca1a3 | [
"MIT"
] | 4 | 2020-03-05T15:56:06.000Z | 2021-06-07T12:06:17.000Z | ### Comparison between drivers
##
import time
import board
import busio
### Adafruit MPU6050 (similar chip)
import adafruit_mpu6050
### RM Forked Driver
### RM CircuitPython Driver
import roboticsmasters_mpu9250
### i2c
i2c = busio.I2C(board.SCL, board.SDA)
### adafruit driver
mpu = adafruit_mpu6050.MPU6050(i2c, ... | 27.557377 | 93 | 0.638311 | ### Comparison between drivers
##
import time
import board
import busio
### Adafruit MPU6050 (similar chip)
import adafruit_mpu6050
### RM Forked Driver
from robohat_mpu9250.mpu9250 import MPU9250 as RM9250
from robohat_mpu9250.mpu6500 import MPU6500 as RM6500
from robohat_mpu9250.ak8963 import AK8963 as RM8963
###... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 103 | 88 |
e7e81950b55cead6237676bba3ef8187bcbf2278 | 463 | py | Python | conf/script/src/build_system/cmd/hierarchy/create_build_dir/impl.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | conf/script/src/build_system/cmd/hierarchy/create_build_dir/impl.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | 113 | 2021-02-15T19:22:36.000Z | 2021-05-07T15:17:42.000Z | conf/script/src/build_system/cmd/hierarchy/create_build_dir/impl.py | benoit-dubreuil/template-repo-cpp-full-ecosystem | f506dd5e2a61cdd311b6a6a4be4abc59567b4b20 | [
"MIT"
] | null | null | null | __all__ = ['create_build_dir']
| 23.15 | 65 | 0.75594 | __all__ = ['create_build_dir']
from pathlib import Path
from typing import Optional
from error import *
from file_structure import *
from ..find_build_dir import *
def create_build_dir(root_dir: Optional[Path] = None) -> Path:
build_dir = get_build_dir_path(root_dir=root_dir)
try:
verify_build_dir(... | 0 | 0 | 0 | 0 | 0 | 273 | 0 | 23 | 135 |
fb49d2c877bd4f1dbf12060bdddef6be55c16c40 | 297 | py | Python | test/yamlConfigTest.py | john123951/gold.icbc.watcher | 402c9ab579b6d40656fae0f5529204c94861f116 | [
"MIT"
] | 1 | 2020-08-07T14:01:37.000Z | 2020-08-07T14:01:37.000Z | test/yamlConfigTest.py | john123951/gold.icbc.watcher | 402c9ab579b6d40656fae0f5529204c94861f116 | [
"MIT"
] | null | null | null | test/yamlConfigTest.py | john123951/gold.icbc.watcher | 402c9ab579b6d40656fae0f5529204c94861f116 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
yaml_test()
| 21.214286 | 115 | 0.703704 | import os
from util.YamlConfig import YamlConfig
def yaml_test():
config_file_path = os.path.join(os.path.split(os.path.realpath(__file__))[0], '..', 'config', 'watcher.config')
config = YamlConfig(config_file_path)
dir(config.__dict__)
if __name__ == "__main__":
yaml_test()
| 0 | 0 | 0 | 0 | 0 | 178 | 0 | 5 | 68 |
b05ac6647f287e2ffc79e487cd542a30717bdef7 | 672 | py | Python | oops_fhir/r4/value_set/v3_security_policy.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_security_policy.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/v3_security_policy.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
__all__ = ["v3SecurityPolicy"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
| 21.677419 | 71 | 0.75744 | 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_act_code import v3ActCode
__all__ = ["v3SecurityPolicy"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class v3SecurityPolicy(v3ActCod... | 0 | 0 | 0 | 361 | 0 | 0 | 0 | 52 | 69 |
16738e855d2f5887592f45dfcc433cd2a41044ad | 4,612 | py | Python | src/test_only_plugins/segment/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/test_only_plugins/segment/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/test_only_plugins/segment/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
| 34.676692 | 79 | 0.557242 | from __future__ import absolute_import
from sentry import http
from sentry.plugins.bases.data_forwarding import DataForwardingPlugin
from test_only_plugins.base import CorePluginMixin
from test_only_plugins.utils import get_secret_field_config
class SegmentPlugin(CorePluginMixin, DataForwardingPlugin):
title = ... | 0 | 0 | 0 | 4,342 | 0 | 0 | 0 | 117 | 113 |
7a8b1eabe4f766097c74d327e1530216b53f8d1f | 485 | py | Python | src/cython/setup_KT15FalseColor.py | ccj5351/DAFStereoNets | 66b720a4abbac9097a794eacef034bab641771d9 | [
"MIT"
] | 19 | 2020-10-16T02:21:13.000Z | 2022-03-25T10:49:47.000Z | src/cython/setup_KT15FalseColor.py | ccj5351/DAFStereoNets | 66b720a4abbac9097a794eacef034bab641771d9 | [
"MIT"
] | null | null | null | src/cython/setup_KT15FalseColor.py | ccj5351/DAFStereoNets | 66b720a4abbac9097a794eacef034bab641771d9 | [
"MIT"
] | 5 | 2020-10-21T06:29:34.000Z | 2022-03-07T05:02:42.000Z | # !/usr/bin/env python3
# -*-coding:utf-8-*-
# @file: setup.py
# @brief:
# @author: Changjiang Cai, ccai1@stevens.edu, caicj5351@gmail.com
# @version: 0.0.1
# @creation date: 28-10-2019
# @last modified: Tue 29 Oct 2019 02:00:37 PM EDT
from distutils.core import setup
from Cython.Build import cythonize
from distutils.... | 25.526316 | 77 | 0.721649 | # !/usr/bin/env python3
# -*-coding:utf-8-*-
# @file: setup.py
# @brief:
# @author: Changjiang Cai, ccai1@stevens.edu, caicj5351@gmail.com
# @version: 0.0.1
# @creation date: 28-10-2019
# @last modified: Tue 29 Oct 2019 02:00:37 PM EDT
from distutils.core import setup
from Cython.Build import cythonize
from distutils.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0df54decc773fcab929b0e60e73ea93f319d969b | 2,410 | py | Python | demo_laplacian.py | yzhou2890/demo | 7cbc43dc17680a199bc9376690f95cbf27dcafd6 | [
"Unlicense"
] | null | null | null | demo_laplacian.py | yzhou2890/demo | 7cbc43dc17680a199bc9376690f95cbf27dcafd6 | [
"Unlicense"
] | null | null | null | demo_laplacian.py | yzhou2890/demo | 7cbc43dc17680a199bc9376690f95cbf27dcafd6 | [
"Unlicense"
] | null | null | null |
#--------------------------------
# demo of convolution of 2D image - laplacian kernel
#--------------------------------
if __name__ == '__main__':
UseWebCam()
| 21.909091 | 111 | 0.492116 |
#--------------------------------
# demo of convolution of 2D image - laplacian kernel
#--------------------------------
import numpy as np
import cv2
def UseWebCam():
vcap = cv2.VideoCapture(0)
nw0 = np.float(vcap.get(cv2.CAP_PROP_FRAME_WIDTH))
nh0 = np.float(vcap.get(cv2... | 0 | 0 | 0 | 0 | 0 | 2,133 | 0 | -14 | 73 |
6bd0903d4eee955f8389e47da0e04172c26c363b | 2,063 | py | Python | src/backtracking/nqueens.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | src/backtracking/nqueens.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | src/backtracking/nqueens.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | """
N Queens
==========
Place N queens on a NxN chessboard such that no queens come under attack.
Give all possible placements of N queens.
SOLUTION
- Backtracking to find all possible placements
- Grow the state space tree by placing a queen on one row at a time
- Bounding function: no two queens share the s... | 33.274194 | 111 | 0.628696 | """
N Queens
==========
Place N queens on a NxN chessboard such that no queens come under attack.
Give all possible placements of N queens.
SOLUTION
- Backtracking to find all possible placements
- Grow the state space tree by placing a queen on one row at a time
- Bounding function: no two queens share the s... | 6 | 0 | 0 | 34 | 0 | 1,031 | 0 | 26 | 123 |
326372c10d63ec29982734a7a92d263d463b8a22 | 346 | py | Python | leehao/learn122.py | pilihaotian/pythonlearning | e84b7766cc9ea8131e9720fb1f06761c9581d0da | [
"Apache-2.0"
] | 1 | 2020-02-26T14:52:17.000Z | 2020-02-26T14:52:17.000Z | leehao/learn122.py | pilihaotian/pythonlearning | e84b7766cc9ea8131e9720fb1f06761c9581d0da | [
"Apache-2.0"
] | null | null | null | leehao/learn122.py | pilihaotian/pythonlearning | e84b7766cc9ea8131e9720fb1f06761c9581d0da | [
"Apache-2.0"
] | null | null | null | # in not in
# contains
l1 = MyList([1, 2, 3])
print(1 in l1) # True
print(1 not in l1) # False
print(4 in l1) # False
| 16.47619 | 41 | 0.592486 | # in not in 重载
# contains
class MyList:
def __init__(self, iterator):
self.data = [x for x in iterator]
def __repr__(self):
return "MyList(%r)" % self.data
def __contains__(self, e):
return e in self.data
l1 = MyList([1, 2, 3])
print(1 in l1) # True
print(1 not in l1) # Fals... | 6 | 0 | 0 | 196 | 0 | 0 | 0 | 0 | 23 |
856712f71ba408fc8f3d603d7d40536450eb076d | 519 | py | Python | chapter_1/lists.py | ibrahimawadhamid/clean-python | 36c30fb57f980ee6fb525142392fde8e477ad962 | [
"MIT"
] | null | null | null | chapter_1/lists.py | ibrahimawadhamid/clean-python | 36c30fb57f980ee6fb525142392fde8e477ad962 | [
"MIT"
] | null | null | null | chapter_1/lists.py | ibrahimawadhamid/clean-python | 36c30fb57f980ee6fb525142392fde8e477ad962 | [
"MIT"
] | null | null | null |
use_list_comprehension()
print(use_zip_for_list_processing()) | 32.4375 | 60 | 0.66474 | def use_list_comprehension():
numbers = [10, 23, 24, 76, 80, 91]
filtered_data = [num for num in numbers if num % 2 == 0]
print(filtered_data)
def use_zip_for_list_processing():
users = ["Abe", "Larry", "John"]
salaries = ["1M", "2M", "1M"]
users_salary = []
for user, salary in zip(users, s... | 0 | 0 | 0 | 0 | 0 | 412 | 0 | 0 | 45 |
fb0ad477de8b590df674821aad9d446b45545a85 | 31,307 | py | Python | tests/testapp/tests/sync/test_operations.py | learningequality/morango | 3fd59c8a800f7984923b929b0fe746aab2b09ef0 | [
"MIT"
] | 9 | 2016-09-16T03:13:41.000Z | 2021-07-23T20:48:50.000Z | tests/testapp/tests/sync/test_operations.py | jamalex/morango | 3fd59c8a800f7984923b929b0fe746aab2b09ef0 | [
"MIT"
] | 117 | 2016-09-13T22:21:12.000Z | 2022-03-09T16:31:12.000Z | tests/testapp/tests/sync/test_operations.py | jamalex/morango | 3fd59c8a800f7984923b929b0fe746aab2b09ef0 | [
"MIT"
] | 11 | 2016-09-13T20:13:58.000Z | 2022-02-03T07:59:41.000Z | from django.db import connection
from morango.sync.backends.utils import load_backend
DBBackend = load_backend(connection).SQLWrapper()
| 45.241329 | 114 | 0.678059 | import json
import uuid
import factory
from django.db import connection
from django.test import TestCase
from django.test import override_settings
from django.utils import timezone
from facility_profile.models import Facility
import mock
import pytest
from ..helpers import create_buffer_and_store_dummy_data
from ..he... | 0 | 29,436 | 0 | 128 | 0 | 0 | 0 | 784 | 819 |
4ba67c35196a7de683a72ee4ce8820e98b8c4311 | 1,522 | py | Python | 875_koko_eats_bnana.py | ojhaanshu87/LeetCode | e6e4a15c4bb9f01b67c50689be3ead6c6d5df155 | [
"Unlicense"
] | null | null | null | 875_koko_eats_bnana.py | ojhaanshu87/LeetCode | e6e4a15c4bb9f01b67c50689be3ead6c6d5df155 | [
"Unlicense"
] | null | null | null | 875_koko_eats_bnana.py | ojhaanshu87/LeetCode | e6e4a15c4bb9f01b67c50689be3ead6c6d5df155 | [
"Unlicense"
] | null | null | null | '''
Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.
Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile.
If the pile has less than k bananas,... | 29.843137 | 143 | 0.617608 | '''
Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.
Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile.
If the pile has less than k bananas,... | 0 | 0 | 0 | 546 | 0 | 0 | 0 | 0 | 23 |
55dfa93d3d91abdb76ac5665c0dfb38f4be72b04 | 877 | py | Python | znet/test/pymysql/dbinit.py | breezechen/zevent | f86219b3ce4afbb516b22c41ce125b0f916c490c | [
"Apache-2.0"
] | 1 | 2021-11-19T06:14:16.000Z | 2021-11-19T06:14:16.000Z | znet/test/pymysql/dbinit.py | geniejl/zevent | 5dd3de57adf1deecc8f008db387ebfa460767fda | [
"Apache-2.0"
] | null | null | null | znet/test/pymysql/dbinit.py | geniejl/zevent | 5dd3de57adf1deecc8f008db387ebfa460767fda | [
"Apache-2.0"
] | 2 | 2017-07-15T02:40:52.000Z | 2021-11-19T06:14:18.000Z | #!/usr/bin/env python
#coding=utf-8
import sys
import db_opr
################################# main program##################################
if __name__ == '__main__':
print 'start initdb...'
db_init = DBInit()
db_init.run()
del db_init
print 'end initdb...'
| 21.390244 | 80 | 0.550741 | #!/usr/bin/env python
#coding=utf-8
import sys
import db_opr
def quotesql(text):
return text.replace("\\", "\\\\").replace("'", "''").replace("%","%%")
class DBInit:
def __init__(self):
self.dbopr = db_opr.DBOpr();
def __del__(self):
del self.dbopr
def init_data(self):
db = 0;
uid = 0;
ret = 0;
whil... | 0 | 0 | 0 | 493 | 0 | 70 | 0 | 0 | 46 |
fe3b8d10aff775c710a2d7206f4351b084efe55d | 7,261 | py | Python | pytext/models/embeddings/char_embedding.py | baronrustamov/pytext | 9790943736e7c0ac53095be2e20177be6fc529a9 | [
"BSD-3-Clause"
] | 1 | 2021-04-12T12:38:14.000Z | 2021-04-12T12:38:14.000Z | pytext/models/embeddings/char_embedding.py | baronrustamov/pytext | 9790943736e7c0ac53095be2e20177be6fc529a9 | [
"BSD-3-Clause"
] | null | null | null | pytext/models/embeddings/char_embedding.py | baronrustamov/pytext | 9790943736e7c0ac53095be2e20177be6fc529a9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import torch.nn as nn
| 37.235897 | 87 | 0.64027 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import List, Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from pytext.config.field_config import CharFeatConfig
from pytext.data.utils import Vocabulary
from pytext.fields import Fi... | 0 | 902 | 0 | 5,893 | 0 | 0 | 0 | 123 | 225 |
63e4703245acba87779c0b4a1c23ae8cbc5765aa | 5,345 | py | Python | creator_studio/instagram.py | asperduti/creator-studio-cli | 22f4ce246febca4c0983c0146cffdda99a47235d | [
"MIT"
] | 15 | 2020-05-22T23:41:23.000Z | 2021-09-22T19:14:52.000Z | creator_studio/instagram.py | asperduti/creator-studio-cli | 22f4ce246febca4c0983c0146cffdda99a47235d | [
"MIT"
] | 9 | 2020-04-25T19:20:47.000Z | 2021-08-06T12:41:19.000Z | creator_studio/instagram.py | asperduti/creator-studio-cli | 22f4ce246febca4c0983c0146cffdda99a47235d | [
"MIT"
] | 5 | 2020-11-24T18:55:14.000Z | 2021-07-11T21:39:17.000Z | from selenium.webdriver.common.action_chains import ActionChains
from time import sleep
from .xpath import xpath
from .browser import explicit_wait_visibility_of_element_located
MODE_INSTAGRAM = "mode=instagram"
def go_to_instagram_Tab(browser):
"""Go to instragram mode"""
if MODE_INSTAGRAM in browser.curre... | 45.683761 | 164 | 0.740879 | from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from time import sleep
from .xpath import xpath
from .browser import explicit_wait_visibility_of_element_located
MODE_INSTAGRAM = "mode=instagram"
def go_to_instagram_Tab(browser):
"""Go to instragram... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 22 |
40c9e250930c50040b71346d1c945c424b4432aa | 13,959 | py | Python | netcal/scaling/LogisticCalibrationDependent.py | by-liu/calibration-framework | f1995512fea511572171974913fe5b569cac0cd0 | [
"Apache-2.0"
] | 148 | 2019-10-29T03:23:04.000Z | 2022-03-30T12:36:20.000Z | netcal/scaling/LogisticCalibrationDependent.py | EFS-OpenSource/calibration-framework | 7b306e4bbe6361d411b209759b7ba3d016bd0d17 | [
"Apache-2.0"
] | 19 | 2020-02-05T06:00:07.000Z | 2022-03-17T06:37:19.000Z | netcal/scaling/LogisticCalibrationDependent.py | EFS-OpenSource/calibration-framework | 7b306e4bbe6361d411b209759b7ba3d016bd0d17 | [
"Apache-2.0"
] | 25 | 2019-11-30T23:03:01.000Z | 2022-02-16T20:40:29.000Z | # Copyright (C) 2019-2021 Ruhr West University of Applied Sciences, Bottrop, Germany
# AND Elektronische Fahrwerksysteme GmbH, Gaimersheim Germany
#
# This Source Code Form is subject to the terms of the Apache License 2.0
# If a copy of the APL2 was not distributed with this
# file, You can obtain one at https://www.a... | 44.884244 | 123 | 0.636077 | # Copyright (C) 2019-2021 Ruhr West University of Applied Sciences, Bottrop, Germany
# AND Elektronische Fahrwerksysteme GmbH, Gaimersheim Germany
#
# This Source Code Form is subject to the terms of the Apache License 2.0
# If a copy of the APL2 was not distributed with this
# file, You can obtain one at https://www.a... | 4 | 1,612 | 0 | 11,715 | 0 | 0 | 0 | 39 | 180 |
ee46ad30d38e4d7965db5e29e6d43c50da871ee5 | 4,697 | py | Python | reviser/commands/reporter.py | rocketboosters/reviser | 03ee5eadd35db78cf122e48fac4d48981518af11 | [
"MIT"
] | null | null | null | reviser/commands/reporter.py | rocketboosters/reviser | 03ee5eadd35db78cf122e48fac4d48981518af11 | [
"MIT"
] | null | null | null | reviser/commands/reporter.py | rocketboosters/reviser | 03ee5eadd35db78cf122e48fac4d48981518af11 | [
"MIT"
] | null | null | null | """Show the current status information for each of the selected lambda targets."""
import argparse
import textwrap
import typing
import yaml
from botocore.client import BaseClient
from reviser import definitions
from reviser import interactivity
from reviser import servicer
def get_completions(
completer: "inte... | 29.540881 | 82 | 0.636789 | """Show the current status information for each of the selected lambda targets."""
import argparse
import textwrap
import typing
import yaml
from botocore.client import BaseClient
from reviser import definitions
from reviser import interactivity
from reviser import servicer
def get_completions(
completer: "inte... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
97e42430724be5211eb9efa00b7fef4456b4fbf2 | 248 | py | Python | hazel/data/transform.py | fluxtransport/hazel2 | 4121df2fa6bf96bf8f193f287bbf11c70c5a519e | [
"MIT"
] | 17 | 2018-08-31T11:13:59.000Z | 2022-01-12T02:30:56.000Z | hazel/data/transform.py | fluxtransport/hazel2 | 4121df2fa6bf96bf8f193f287bbf11c70c5a519e | [
"MIT"
] | 26 | 2018-04-03T15:09:21.000Z | 2021-05-27T10:10:45.000Z | hazel/data/transform.py | fluxtransport/hazel2 | 4121df2fa6bf96bf8f193f287bbf11c70c5a519e | [
"MIT"
] | 3 | 2018-05-01T13:47:21.000Z | 2019-09-23T20:49:08.000Z |
ff = open('LINEAS', 'r')
flines = ff.readlines()
ff.close()
ff = open('LINEAS.csv', 'w')
for l in flines:
tmp = l.split()
idx, element = tmp[0].split('=')
ff.write('{0},{1},{2},{3}\n'.format(idx, element,tmp[1],tmp[2]))
ff.close()
| 16.533333 | 68 | 0.548387 |
ff = open('LINEAS', 'r')
flines = ff.readlines()
ff.close()
ff = open('LINEAS.csv', 'w')
for l in flines:
tmp = l.split()
idx, element = tmp[0].split('=')
ff.write('{0},{1},{2},{3}\n'.format(idx, element,tmp[1],tmp[2]))
ff.close()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3775935ab5c129458b265aa93a6da5f618fe836a | 2,059 | py | Python | oru.py | duncanhawthorne/coffeeworlds | 06a5299413f7309df8a51afc834804fced72f5ca | [
"MIT"
] | 5 | 2015-03-14T12:33:37.000Z | 2019-06-21T19:02:24.000Z | oru.py | duncanhawthorne/coffeeworlds | 06a5299413f7309df8a51afc834804fced72f5ca | [
"MIT"
] | null | null | null | oru.py | duncanhawthorne/coffeeworlds | 06a5299413f7309df8a51afc834804fced72f5ca | [
"MIT"
] | 3 | 2015-12-21T14:40:50.000Z | 2022-01-16T12:14:32.000Z |
# This class keeps an ordered list of sprites in addition to the dict,
# so we can draw in the order the sprites were added.
| 31.676923 | 81 | 0.6678 | from pygame.sprite import RenderClear
from subpixelsurface import *
# This class keeps an ordered list of sprites in addition to the dict,
# so we can draw in the order the sprites were added.
class OrderedRenderUpdates(RenderClear):
def __init__(self, group = ()):
self.spritelist = []
RenderClear.__init__(s... | 0 | 0 | 0 | 1,843 | 0 | 0 | 0 | 24 | 66 |
c77757ae16fce2ff9a1fb1ece090a78416995de8 | 5,821 | py | Python | digsby/src/msn/NSSBAdapter.py | ifwe/digsby | f5fe00244744aa131e07f09348d10563f3d8fa99 | [
"Python-2.0"
] | 35 | 2015-08-15T14:32:38.000Z | 2021-12-09T16:21:26.000Z | digsby/src/msn/NSSBAdapter.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 4 | 2015-09-12T10:42:57.000Z | 2017-02-27T04:05:51.000Z | digsby/src/msn/NSSBAdapter.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 15 | 2015-07-10T23:58:07.000Z | 2022-01-23T22:16:33.000Z | from logging import getLogger
log = getLogger('msn.nssb')
| 26.824885 | 87 | 0.568803 | from logging import getLogger
log = getLogger('msn.nssb')
import msn
from msn import MSNTextMessage
from util import callsback
from util.primitives.funcs import get
from util.Events import EventMixin
class NSSBAdapter(EventMixin):
'''
Chatting with federated (yahoo) buddies happens over the NS ... | 0 | 892 | 0 | 4,692 | 0 | 0 | 0 | 32 | 145 |
9136de1e123a255cfb8f3b3fee23c0f7afabecc0 | 75 | py | Python | ggfilm/wechat_ggfilm_backend/__init__.py | amazingchow/photon-dance-ggfilm-server | edef66c5a0855e4c31342913c391c7dabef27f5c | [
"MIT"
] | null | null | null | ggfilm/wechat_ggfilm_backend/__init__.py | amazingchow/photon-dance-ggfilm-server | edef66c5a0855e4c31342913c391c7dabef27f5c | [
"MIT"
] | null | null | null | ggfilm/wechat_ggfilm_backend/__init__.py | amazingchow/photon-dance-ggfilm-server | edef66c5a0855e4c31342913c391c7dabef27f5c | [
"MIT"
] | null | null | null | default_app_config = 'wechat_ggfilm_backend.apps.WechatGgfilmBackendConfig' | 75 | 75 | 0.906667 | default_app_config = 'wechat_ggfilm_backend.apps.WechatGgfilmBackendConfig' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5acc8562108a35c1c87e8048bb245ee65282c94 | 6,116 | py | Python | ghs/spiders/xart.py | TsingJyujing/mastodon-ghs-bot | 4b877d5f2cb3bbc5c4cac9d9b64348a74c33504c | [
"MIT"
] | 5 | 2020-11-01T07:21:36.000Z | 2020-11-20T19:53:09.000Z | ghs/spiders/xart.py | TsingJyujing/mastodon-ghs-bot | 4b877d5f2cb3bbc5c4cac9d9b64348a74c33504c | [
"MIT"
] | null | null | null | ghs/spiders/xart.py | TsingJyujing/mastodon-ghs-bot | 4b877d5f2cb3bbc5c4cac9d9b64348a74c33504c | [
"MIT"
] | null | null | null | import logging
import mimetypes
from concurrent.futures import ThreadPoolExecutor
from io import BytesIO
from urllib.parse import urlparse
import pymongo
import urllib3
from bson import ObjectId
from requests import HTTPError
from tsing_spider.porn.xarthunter import (XarthunterItemPage)
from tsing_spider.util import h... | 34.948571 | 108 | 0.612165 | import logging
import mimetypes
from concurrent.futures import ThreadPoolExecutor
from http.client import RemoteDisconnected
from io import BytesIO
from typing import Iterator, Callable
from urllib.parse import urlparse
import pymongo
import urllib3
from bson import ObjectId
from requests import HTTPError
from tsing_s... | 0 | 0 | 0 | 1,477 | 0 | 764 | 0 | 134 | 113 |
4934fce3cbf4cfdfdbbfdd771e95082639d33d6b | 671 | py | Python | astar_ttbot/src/get_pose_ttbot.py | Akshaybj0221/Obstacle_Avoidance_AStar | 1cd322ee8819b7bbc6ef97374d03923da3837659 | [
"MIT"
] | 14 | 2018-04-23T08:50:39.000Z | 2022-01-20T04:15:27.000Z | src/get_pose_ttbot.py | Akshaybj0221/Gas_Source_Localization_SLAM | 1cd322ee8819b7bbc6ef97374d03923da3837659 | [
"MIT"
] | null | null | null | src/get_pose_ttbot.py | Akshaybj0221/Gas_Source_Localization_SLAM | 1cd322ee8819b7bbc6ef97374d03923da3837659 | [
"MIT"
] | 3 | 2019-05-07T20:39:01.000Z | 2021-06-08T01:27:59.000Z | #!/usr/bin/env python
#import roslib; roslib.load_manifest('Phoebe')
import rospy
from nav_msgs.msg import Odometry
# print("All data", completePose)
if __name__ == "__main__":
rospy.init_node('getPoseTTBot', anonymous=False) #make node
rospy.Subscriber('odom', Odometry, callback)
rospy.spin()
| 23.964286 | 70 | 0.685544 | #!/usr/bin/env python
#import roslib; roslib.load_manifest('Phoebe')
import rospy
from nav_msgs.msg import Odometry
def callback(data):
# print msg.pose.pose
# completePose = data.data
rospy.sleep(1)
curr_time = data.header.stamp
pose = data.pose.pose # the x,y,z pose and quaternion orientation
... | 0 | 0 | 0 | 0 | 0 | 332 | 0 | 0 | 23 |
43777eeeba655f906f7173ac865875e5dfa7169f | 2,019 | py | Python | grib.py | sergei/gribs | c32d6a2f7e70639c3d4f001e57f5dc09692a28e2 | [
"Apache-2.0"
] | null | null | null | grib.py | sergei/gribs | c32d6a2f7e70639c3d4f001e57f5dc09692a28e2 | [
"Apache-2.0"
] | null | null | null | grib.py | sergei/gribs | c32d6a2f7e70639c3d4f001e57f5dc09692a28e2 | [
"Apache-2.0"
] | null | null | null | import os.path
WGRIB_BIN = os.path.expanduser('bin/osx/wgrib2')
| 32.047619 | 118 | 0.543338 | import datetime
import io
import math
import os.path
import subprocess
WGRIB_BIN = os.path.expanduser('bin/osx/wgrib2')
class Grib:
def __init__(self, grib_name):
self.grib_name = grib_name
self.toc = None
def read_grib_toc(self):
cmd = [WGRIB_BIN, self.grib_name]
process = s... | 0 | 0 | 0 | 1,874 | 0 | 0 | 0 | -32 | 111 |
9142f67c75ecb91b2480e87ace408a48062abeee | 2,078 | py | Python | accounting/accounting/doctype/purchase_order/test_purchase_order.py | noahjacob/Accounting | 6be90c4f82867156532ca71b1faa9d017e3269af | [
"MIT"
] | 1 | 2021-04-05T06:22:16.000Z | 2021-04-05T06:22:16.000Z | accounting/accounting/doctype/purchase_order/test_purchase_order.py | mohsinalimat/Accounting | 6be90c4f82867156532ca71b1faa9d017e3269af | [
"MIT"
] | null | null | null | accounting/accounting/doctype/purchase_order/test_purchase_order.py | mohsinalimat/Accounting | 6be90c4f82867156532ca71b1faa9d017e3269af | [
"MIT"
] | 2 | 2021-04-05T06:22:17.000Z | 2021-04-10T06:05:36.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Noah Jacob and Contributors
# See license.txt
from __future__ import unicode_literals
| 26.303797 | 78 | 0.740616 | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Noah Jacob and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import nowdate,flt
import unittest
class TestPurchaseOrder(unittest.TestCase):
def test_new_purchase_order(self):
p_order = create_purchase_order('Gam... | 0 | 0 | 0 | 1,146 | 0 | 625 | 0 | 1 | 161 |
3c923b1a60a0624b41c5e9bac59378f804b627b0 | 11,772 | py | Python | data/python/c630a4fc1c871b5bce61deb1710460ee_assets.py | maxim5/code-inspector | 14812dfbc7bac1d76c4d9e5be2cdf83fc1c391a1 | [
"Apache-2.0"
] | 5 | 2018-01-03T06:43:07.000Z | 2020-07-30T13:15:29.000Z | data/python/c630a4fc1c871b5bce61deb1710460ee_assets.py | maxim5/code-inspector | 14812dfbc7bac1d76c4d9e5be2cdf83fc1c391a1 | [
"Apache-2.0"
] | null | null | null | data/python/c630a4fc1c871b5bce61deb1710460ee_assets.py | maxim5/code-inspector | 14812dfbc7bac1d76c4d9e5be2cdf83fc1c391a1 | [
"Apache-2.0"
] | 2 | 2019-11-04T02:54:49.000Z | 2020-04-24T17:50:46.000Z | """Manage assets.
Usage:
./manage.py assets rebuild
Rebuild all known assets; this requires tracking to be enabled:
Only assets that have previously been built and tracked are
considered "known".
./manage.py assets rebuild --parse-templates
Try to find as many of the project... | 40.453608 | 117 | 0.549015 | """Manage assets.
Usage:
./manage.py assets rebuild
Rebuild all known assets; this requires tracking to be enabled:
Only assets that have previously been built and tracked are
considered "known".
./manage.py assets rebuild --parse-templates
Try to find as many of the project... | 0 | 0 | 0 | 9,447 | 0 | 0 | 0 | 188 | 223 |
2670d23a77ff9a463b5969051cd15f476c76f308 | 39 | py | Python | azure-kusto-ingest/azure/kusto/ingest/_version.py | scovetta/azure-kusto-python | 4b9817b3d231bacefb6f2b5b642156215b2c1401 | [
"MIT"
] | null | null | null | azure-kusto-ingest/azure/kusto/ingest/_version.py | scovetta/azure-kusto-python | 4b9817b3d231bacefb6f2b5b642156215b2c1401 | [
"MIT"
] | null | null | null | azure-kusto-ingest/azure/kusto/ingest/_version.py | scovetta/azure-kusto-python | 4b9817b3d231bacefb6f2b5b642156215b2c1401 | [
"MIT"
] | null | null | null | """Version file."""
VERSION = "0.0.38"
| 13 | 19 | 0.564103 | """Version file."""
VERSION = "0.0.38"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
469a4bcd73c5a2b4249a5b2648273f014038124b | 3,754 | py | Python | tests/unit/extractor/test_cassandra_extractor.py | gjxdxh/amundsendatabuilder | 4c9e5f753bab6a21f116337005e995e1d38ef268 | [
"Apache-2.0"
] | 1 | 2021-07-13T05:53:06.000Z | 2021-07-13T05:53:06.000Z | tests/unit/extractor/test_cassandra_extractor.py | gjxdxh/amundsendatabuilder | 4c9e5f753bab6a21f116337005e995e1d38ef268 | [
"Apache-2.0"
] | 6 | 2020-09-30T16:07:26.000Z | 2020-10-20T07:35:14.000Z | tests/unit/extractor/test_cassandra_extractor.py | gjxdxh/amundsendatabuilder | 4c9e5f753bab6a21f116337005e995e1d38ef268 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import unittest
# patch whole class to avoid actually calling for boto3.client during tests
if __name__ == '__main__':
unittest.main()
| 42.659091 | 89 | 0.648641 | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import logging
import unittest
from collections import OrderedDict
from mock import patch
from pyhocon import ConfigFactory
from typing import Any
from cassandra.metadata import ColumnMetadata as CassandraColumnMetadata
from data... | 0 | 3,145 | 0 | 0 | 0 | 0 | 0 | 177 | 201 |
5130be4f791849b19fb18fd7d0b25a498534c1f5 | 22,259 | py | Python | pynndescent/tests/test_pynndescent_.py | jamestwebber/pynndescent | d282266141bcc19fa3dfeef4ad4186468a84a50b | [
"BSD-2-Clause"
] | 1 | 2021-11-15T17:35:23.000Z | 2021-11-15T17:35:23.000Z | pynndescent/tests/test_pynndescent_.py | jamestwebber/pynndescent | d282266141bcc19fa3dfeef4ad4186468a84a50b | [
"BSD-2-Clause"
] | null | null | null | pynndescent/tests/test_pynndescent_.py | jamestwebber/pynndescent | d282266141bcc19fa3dfeef4ad4186468a84a50b | [
"BSD-2-Clause"
] | null | null | null |
# This tests a recursion error on cosine metric reported at:
# https://github.com/lmcinnes/umap/issues/99
# graph_data used is a cut-down version of that provided by @scharron
# It contains lots of all-zero vectors and some other duplicates
# same as the previous two test, but this time using the PyNN... | 33.222388 | 98 | 0.667775 | import os
import io
import re
import pytest
from contextlib import redirect_stdout
import numpy as np
from sklearn.neighbors import KDTree
from sklearn.neighbors import NearestNeighbors
from sklearn.preprocessing import normalize
import pickle
import joblib
import scipy
from pynndescent import NNDescent, PyNNDescentT... | 0 | 9,511 | 0 | 0 | 0 | 11,388 | 0 | 43 | 953 |
4a122727675c6be850e2755b637f46f65ee8bff7 | 6,519 | py | Python | dso/dso/run.py | brendenpetersen/deep-symbolic-optimization | 8724839dab910022e24d03debdf564236683474b | [
"BSD-3-Clause"
] | 134 | 2021-07-06T06:14:02.000Z | 2022-03-31T18:24:08.000Z | dso/dso/run.py | brendenpetersen/deep-symbolic-optimization | 8724839dab910022e24d03debdf564236683474b | [
"BSD-3-Clause"
] | 15 | 2021-06-10T17:03:09.000Z | 2022-01-21T20:15:35.000Z | dso/dso/run.py | brendenpetersen/deep-symbolic-optimization | 8724839dab910022e24d03debdf564236683474b | [
"BSD-3-Clause"
] | 44 | 2021-06-26T19:11:28.000Z | 2022-03-25T04:07:41.000Z | """Parallelized, single-point launch script to run DSO on a set of benchmarks."""
import os
import time
from copy import deepcopy
from dso import DeepSymbolicOptimizer
def train_dso(config):
"""Trains DSO and returns dict of reward, expression, and traversal"""
print("\n== TRAINING SEED {} START ==========... | 41.522293 | 142 | 0.625863 | """Parallelized, single-point launch script to run DSO on a set of benchmarks."""
import os
import sys
import time
import multiprocessing
from copy import deepcopy
from datetime import datetime
import click
from dso import DeepSymbolicOptimizer
from dso.logeval import LogEval
from dso.config import load_config
from ... | 0 | 4,284 | 0 | 0 | 0 | 766 | 0 | 34 | 279 |
3cebd2643888aa66fadc9d03bec702efd09a9077 | 2,488 | py | Python | train_all_slices.py | liuqiang12040913/DeepSlicing | 8c30dd7bdaf90dbc2edbb692f93f8aee49163333 | [
"Apache-2.0"
] | 6 | 2021-05-29T07:16:47.000Z | 2021-11-02T06:37:56.000Z | train_all_slices.py | ihatexzh/DeepSlicing | 8c30dd7bdaf90dbc2edbb692f93f8aee49163333 | [
"Apache-2.0"
] | null | null | null | train_all_slices.py | ihatexzh/DeepSlicing | 8c30dd7bdaf90dbc2edbb692f93f8aee49163333 | [
"Apache-2.0"
] | 2 | 2021-06-21T18:30:50.000Z | 2022-01-08T05:49:19.000Z | import matplotlib.pyplot as matplt
from ddpg_alg_spinup import ddpg
import tensorflow as tf
from env_mra import ResourceEnv
import numpy as np
import time
import pickle
if __name__ == "__main__":
with open("saved_alpha.pickle", "wb") as fileop:
pickle.dump(alpha, fileop)
with open("saved_weight.pick... | 34.082192 | 124 | 0.506029 | import cvxpy as cp
import matplotlib.pyplot as matplt
from utils import *
from ddpg_alg_spinup import ddpg
import tensorflow as tf
from env_mra import ResourceEnv
import numpy as np
import time
import pickle
from parameters import *
if __name__ == "__main__":
with open("saved_alpha.pickle", "wb") as fileop:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 66 |
30ef03ac1da52b0d19413daf247091eb879b557b | 2,383 | py | Python | YTPlaylistRanking/__main__.py | TheDigitalPhoenixX/YTPlaylistRanking | 2735174ab68b7be88302f34aebd886537975ea86 | [
"MIT"
] | null | null | null | YTPlaylistRanking/__main__.py | TheDigitalPhoenixX/YTPlaylistRanking | 2735174ab68b7be88302f34aebd886537975ea86 | [
"MIT"
] | null | null | null | YTPlaylistRanking/__main__.py | TheDigitalPhoenixX/YTPlaylistRanking | 2735174ab68b7be88302f34aebd886537975ea86 | [
"MIT"
] | null | null | null | from YTPlaylistRanking.YTPlaylistRanking import SortType, main
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description=("Gets statistics about videos in a YouTube playlist using the playlist's id to write to a file"
" the list of videos in ascendi... | 55.418605 | 117 | 0.59295 | from YTPlaylistRanking.YTPlaylistRanking import SortType, main
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description=("Gets statistics about videos in a YouTube playlist using the playlist's id to write to a file"
" the list of videos in ascendi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3fc2dd844b7f6d6e9678c5de7af2e926dc19c189 | 92 | py | Python | src/config.py | ceIery/epic7-speed-calculator | 2f91e57117e2b6873772e6a703e47241570ab75f | [
"MIT"
] | null | null | null | src/config.py | ceIery/epic7-speed-calculator | 2f91e57117e2b6873772e6a703e47241570ab75f | [
"MIT"
] | null | null | null | src/config.py | ceIery/epic7-speed-calculator | 2f91e57117e2b6873772e6a703e47241570ab75f | [
"MIT"
] | null | null | null | # Bot token goes here
BOT_TOKEN = ''
# Manually specify Tesseract path
TESSERACT_PATH = ''
| 15.333333 | 33 | 0.728261 | # Bot token goes here
BOT_TOKEN = ''
# Manually specify Tesseract path
TESSERACT_PATH = ''
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1239cab8406038fb127616c796fd55bd0ffcef17 | 1,579 | py | Python | presentations/dfwcug/examples/case13_term_server/term_server.py | fallenfuzz/pynet | 9624d83cca160fd325a34e838e4474c9b80fe2ab | [
"Apache-2.0"
] | 528 | 2015-01-07T15:28:51.000Z | 2022-03-27T09:45:37.000Z | presentations/dfwcug/examples/case13_term_server/term_server.py | fallenfuzz/pynet | 9624d83cca160fd325a34e838e4474c9b80fe2ab | [
"Apache-2.0"
] | 19 | 2015-07-01T23:52:27.000Z | 2021-09-22T04:30:34.000Z | presentations/dfwcug/examples/case13_term_server/term_server.py | fallenfuzz/pynet | 9624d83cca160fd325a34e838e4474c9b80fe2ab | [
"Apache-2.0"
] | 555 | 2015-01-18T07:21:43.000Z | 2022-03-20T21:25:22.000Z | #!/usr/bin/env python
import time
from netmiko import ConnectHandler, redispatch
net_connect = ConnectHandler(
device_type='terminal_server',
ip='10.10.10.10',
username='admin',
password='admin123',
secret='secret123')
# Manually handle interaction in the Terminal Server (fictional example, but
#... | 28.196429 | 77 | 0.704877 | #!/usr/bin/env python
import time
from netmiko import ConnectHandler, redispatch
net_connect = ConnectHandler(
device_type='terminal_server',
ip='10.10.10.10',
username='admin',
password='admin123',
secret='secret123')
# Manually handle interaction in the Terminal Server (fictional example, but
#... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
66500c50000b9fa3a71ae339d78b3a642ec7b1f3 | 1,779 | py | Python | Python Fundamentals/Dictionary/More Exercise/Task05.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | 1 | 2022-03-16T10:23:04.000Z | 2022-03-16T10:23:04.000Z | Python Fundamentals/Dictionaries/More Exercise/Task05.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | Python Fundamentals/Dictionaries/More Exercise/Task05.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | 1 | 2021-12-04T12:30:57.000Z | 2021-12-04T12:30:57.000Z | number_of_dragons = int(input())
dragons_dict = {}
for index in range(number_of_dragons):
data = input().split()
type = data[0]
name = data[1]
damage = data[2]
health = data[3]
armor = data[4]
if damage == 'null':
damage = 45
damage = int(damage)
if health == 'null':
... | 40.431818 | 109 | 0.636313 | number_of_dragons = int(input())
dragons_dict = {}
for index in range(number_of_dragons):
data = input().split()
type = data[0]
name = data[1]
damage = data[2]
health = data[3]
armor = data[4]
if damage == 'null':
damage = 45
damage = int(damage)
if health == 'null':
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa7bc7d321a4a5d31c557974839e40f1dde7c87f | 461 | py | Python | aiida_crystal_dft/schemas/jinja/__init__.py | tilde-lab/aiida-crystal-dft | 971fd13a3f414d6e80cc654dc92a8758f6e0365c | [
"MIT"
] | 2 | 2019-02-05T16:49:08.000Z | 2020-01-29T12:27:14.000Z | aiida_crystal_dft/schemas/jinja/__init__.py | tilde-lab/aiida-crystal-dft | 971fd13a3f414d6e80cc654dc92a8758f6e0365c | [
"MIT"
] | 36 | 2020-03-09T19:35:10.000Z | 2021-12-07T22:13:31.000Z | aiida_crystal_dft/schemas/jinja/__init__.py | tilde-lab/aiida-crystal-dft | 971fd13a3f414d6e80cc654dc92a8758f6e0365c | [
"MIT"
] | 1 | 2019-11-13T23:12:10.000Z | 2019-11-13T23:12:10.000Z | # Copyright (c) Andrey Sobolev, 2020. Distributed under MIT license, see LICENSE file.
| 32.928571 | 89 | 0.670282 | # Copyright (c) Andrey Sobolev, 2020. Distributed under MIT license, see LICENSE file.
import os
from jinja2 import Environment, FileSystemLoader
def get_template(schema='d12.j2'):
template_dir = os.path.dirname(__file__)
env = Environment(loader=FileSystemLoader(template_dir),
lstri... | 0 | 0 | 0 | 0 | 0 | 287 | 0 | 15 | 68 |
12c9631847b2837735555e41b97396b525f723c9 | 3,502 | py | Python | src/selectContributors.py | LuizASSilveira/gitMiningDevelopers | 86c49eec5a73987865d5a11cc329ea3b5b2cf771 | [
"Apache-2.0"
] | null | null | null | src/selectContributors.py | LuizASSilveira/gitMiningDevelopers | 86c49eec5a73987865d5a11cc329ea3b5b2cf771 | [
"Apache-2.0"
] | null | null | null | src/selectContributors.py | LuizASSilveira/gitMiningDevelopers | 86c49eec5a73987865d5a11cc329ea3b5b2cf771 | [
"Apache-2.0"
] | null | null | null | import json
import os
import sys
from src.utils import createFolderIfDoesntExist
if __name__ == '__main__':
try:
sys.argv[1]
except IndexError:
print('pass your github token as parameter ('
'https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-li... | 35.373737 | 160 | 0.591376 | import json
import os
import sys
from src.gitHubApiRequest import performRequest
from src.utils import createFolderIfDoesntExist
def getContributors(path, language, numeroContribuidores=100, numeroProjetos=100, ignoreProjects=[]):
listRepo = {}
listDev = []
for lang in language:
url = 'https://a... | 0 | 0 | 0 | 0 | 0 | 2,168 | 0 | 26 | 69 |
812c8b990861c5104b918f249b8c0600aae05e89 | 2,188 | py | Python | sitemessage/templatetags/sitemessage.py | furins/django-sitemessage | 4cdfa0e78eb122dea835c9c4ef845f44e3a5eb90 | [
"BSD-3-Clause"
] | 49 | 2015-01-26T01:31:22.000Z | 2022-02-01T19:10:55.000Z | sitemessage/templatetags/sitemessage.py | furins/django-sitemessage | 4cdfa0e78eb122dea835c9c4ef845f44e3a5eb90 | [
"BSD-3-Clause"
] | 10 | 2015-11-13T09:38:53.000Z | 2021-03-14T11:22:35.000Z | sitemessage/templatetags/sitemessage.py | furins/django-sitemessage | 4cdfa0e78eb122dea835c9c4ef845f44e3a5eb90 | [
"BSD-3-Clause"
] | 10 | 2015-03-16T09:01:47.000Z | 2021-03-14T10:10:27.000Z | from django import template
register = template.Library()
def detect_clause(parser, clause_name, tokens):
"""Helper function detects a certain clause in tag tokens list.
Returns its value.
"""
if clause_name in tokens:
t_index = tokens.index(clause_name)
clause_value = parser.comp... | 30.388889 | 103 | 0.686015 | from django import template
from django.template.base import FilterExpression
from django.template.loader import get_template
from django.conf import settings
from ..exceptions import SiteMessageConfigurationError
register = template.Library()
@register.tag
def sitemessage_prefs_table(parser, token):
tokens = ... | 0 | 550 | 0 | 951 | 0 | 0 | 0 | 98 | 135 |
b8fbbc3c4bccfddda28bac220c0137bf2cf25f33 | 29,364 | py | Python | nnetmaker/batch.py | 0xsx/nnmaker | d7d78e99dc3f738c733895fd937a0bdd092457fe | [
"MIT"
] | null | null | null | nnetmaker/batch.py | 0xsx/nnmaker | d7d78e99dc3f738c733895fd937a0bdd092457fe | [
"MIT"
] | 8 | 2018-12-11T00:48:49.000Z | 2018-12-21T01:05:23.000Z | nnetmaker/batch.py | 0xsx/nnmaker | d7d78e99dc3f738c733895fd937a0bdd092457fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Defines loader objects that parse config files and return functions that provide
inputs to TensorFlow Estimator objects.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__all__ = ["ContinuousSequenceBatchLoader", "DiscreteSe... | 33.829493 | 135 | 0.66888 | # -*- coding: utf-8 -*-
"""
Defines loader objects that parse config files and return functions that provide
inputs to TensorFlow Estimator objects.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__all__ = ["ContinuousSequenceBatchLoader", "DiscreteSe... | 0 | 101 | 0 | 24,021 | 0 | 0 | 0 | 65 | 181 |
b995ba560dd0409274b296fde9a924624965b442 | 10,542 | py | Python | vta/python/vta/environment.py | AWoLnik/tvm-zc706 | eeefbfbc5b99735f591acf463780489197052f85 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | vta/python/vta/environment.py | AWoLnik/tvm-zc706 | eeefbfbc5b99735f591acf463780489197052f85 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | vta/python/vta/environment.py | AWoLnik/tvm-zc706 | eeefbfbc5b99735f591acf463780489197052f85 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | # 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... | 32.337423 | 90 | 0.618953 | # 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... | 0 | 3,141 | 0 | 4,941 | 0 | 0 | 0 | -25 | 270 |
d9dd5fb3af1ac2e9cb782daa38cb691605aa1d53 | 577 | py | Python | client_barvis/ai_request.py | antonstagge/BarvisRepo | 3cc780c09839855a6b1704d0975cf6d4af1beb1a | [
"MIT"
] | null | null | null | client_barvis/ai_request.py | antonstagge/BarvisRepo | 3cc780c09839855a6b1704d0975cf6d4af1beb1a | [
"MIT"
] | null | null | null | client_barvis/ai_request.py | antonstagge/BarvisRepo | 3cc780c09839855a6b1704d0975cf6d4af1beb1a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import sys
try:
import apiai
except ImportError:
sys.path.append(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
)
CLIENT_ACCESS_TOKEN = '73a62055c012487b9312db1d7ac7de61'
| 17.484848 | 76 | 0.674177 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import sys
try:
import apiai
except ImportError:
sys.path.append(
os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir)
)
import apiai
CLIENT_ACCESS_TOKEN = '73a62055c012487b9312db1d7ac7de61'
def aiQurey(text):
... | 0 | 0 | 0 | 0 | 0 | 257 | 0 | -9 | 49 |
3abdfa60a554f8af713881f95c654781c26b8ebf | 3,133 | py | Python | chirp/library/bulk_tagging_form_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 8 | 2015-03-06T17:28:36.000Z | 2020-11-27T10:06:40.000Z | chirp/library/bulk_tagging_form_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 9 | 2015-09-21T18:52:22.000Z | 2018-02-12T19:23:17.000Z | chirp/library/bulk_tagging_form_test.py | chirpradio/chirpradio-machine | e854db2be43a4c879bbda134272a73225d7fa2df | [
"Apache-2.0"
] | 9 | 2016-04-08T00:21:15.000Z | 2018-01-25T19:35:58.000Z | #!/usr/bin/env python
import unittest
from chirp.library import bulk_tagging_form
TEST_FORM_1 = """
00123--------- A Perfect Circle
a7314af4 [ 1 ] 192 12 Mer de Noms
e2ebb0f2 [ 1 ] 128 12 Mer de Noms
55d1c5a4 [ ] 192 12 Thirteenth Step
A line to skip
1234abcd [ x ] 192 10 To Be Deleted
abcd1234 [ ? ] 222 7 What Y... | 34.428571 | 71 | 0.60549 | #!/usr/bin/env python
import codecs
import cStringIO
import unittest
from chirp.library import bulk_tagging_form
TEST_FORM_1 = """
00123--------- A Perfect Circle
a7314af4 [ 1 ] 192 12 Mer de Noms
e2ebb0f2 [ 1 ] 128 12 Mer de Noms
55d1c5a4 [ ] 192 12 Thirteenth Step
A line to skip
1234abcd [ x ] 192 10 To Be Dele... | 0 | 0 | 0 | 1,439 | 0 | 0 | 0 | -13 | 68 |
350107c5e71cf6182a76400d6b63cdb4b9dd4720 | 130 | py | Python | data/config.py | DurbeKK/tg_pdf_bot | 75a180cc7c876df84a4cac825939898892a43aa9 | [
"MIT"
] | 3 | 2021-12-03T09:27:54.000Z | 2021-12-09T03:19:42.000Z | data/config.py | DurbeKK/tg-pdf-bot | 75a180cc7c876df84a4cac825939898892a43aa9 | [
"MIT"
] | null | null | null | data/config.py | DurbeKK/tg-pdf-bot | 75a180cc7c876df84a4cac825939898892a43aa9 | [
"MIT"
] | null | null | null | from environs import Env
env = Env()
env.read_env()
BOT_TOKEN = env.str("BOT_TOKEN")
ADMIN = env.str("ADMIN")
IP = env.str("ip") | 16.25 | 32 | 0.676923 | from environs import Env
env = Env()
env.read_env()
BOT_TOKEN = env.str("BOT_TOKEN")
ADMIN = env.str("ADMIN")
IP = env.str("ip") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9e56d468a4ced60aad000b21dac70e400da1658d | 585 | py | Python | waiter.py | vsajip/sarge | 6200d310b2a0173026554cd2a9a48fa9374985c5 | [
"BSD-3-Clause"
] | 35 | 2015-03-09T20:41:02.000Z | 2022-03-12T10:29:06.000Z | waiter.py | vsajip/sarge | 6200d310b2a0173026554cd2a9a48fa9374985c5 | [
"BSD-3-Clause"
] | 7 | 2019-10-23T12:34:37.000Z | 2022-01-14T18:52:36.000Z | waiter.py | vsajip/sarge | 6200d310b2a0173026554cd2a9a48fa9374985c5 | [
"BSD-3-Clause"
] | 5 | 2015-11-07T17:20:39.000Z | 2021-10-03T19:31:16.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Vinay M. Sajip. See LICENSE for licensing information.
#
# Part of the test harness for sarge: Subprocess Allegedly Rewards Good Encapsulation :-)
#
import sys
if __name__ == '__main__':
try:
rc = main()
except Exception as e:
print(e)
rc =... | 21.666667 | 89 | 0.601709 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Vinay M. Sajip. See LICENSE for licensing information.
#
# Part of the test harness for sarge: Subprocess Allegedly Rewards Good Encapsulation :-)
#
import sys
import time
def main(args=None):
sys.stdout.write('Waiting ... ')
sys.stdout.flush()
if len(sys.argv... | 0 | 0 | 0 | 0 | 0 | 210 | 0 | -10 | 45 |
b0fd133dd65f8601e233595a4efd91bdda06d5cd | 1,860 | py | Python | solver/pqn_nnls.py | mshrAndo/PyMCR | 870aec7befaaeebe886080790b041dd897da1c5d | [
"MIT"
] | 1 | 2021-09-27T19:14:20.000Z | 2021-09-27T19:14:20.000Z | solver/pqn_nnls.py | mshrAndo/PyMCR | 870aec7befaaeebe886080790b041dd897da1c5d | [
"MIT"
] | null | null | null | solver/pqn_nnls.py | mshrAndo/PyMCR | 870aec7befaaeebe886080790b041dd897da1c5d | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# PQN-NNLS algorithm (Kim, Sra, Dhillon 2006)
import numpy as np
def pqn_nnls(A, b, err, limit = 300):
"""return x which is >= 0 and minimizes ||Ax - b||"""
m, n = A.shape;
AtA = np.dot(A.T, A)
Atb = np.dot(A.T, b)
curS = np.eye(n)
x = np... | 24.8 | 83 | 0.452151 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# PQN-NNLS algorithm (Kim, Sra, Dhillon 2006)
import numpy as np
def pqn_nnls(A, b, err, limit = 300):
"""return x which is >= 0 and minimizes ||Ax - b||"""
m, n = A.shape;
AtA = np.dot(A.T, A)
Atb = np.dot(A.T, b)
def proj(x):
return... | 0 | 0 | 0 | 0 | 0 | 98 | 0 | 0 | 93 |
800a2516328e8fa350eb1f02d43782fb0a896b5a | 558 | py | Python | project/memberships/urls.py | hiraqdev/base-django | 4df57f356905274b26af57af8328f015d6c680a4 | [
"MIT"
] | 1 | 2018-03-19T05:21:53.000Z | 2018-03-19T05:21:53.000Z | project/memberships/urls.py | hiraq/base-django | 4df57f356905274b26af57af8328f015d6c680a4 | [
"MIT"
] | 6 | 2020-06-05T20:17:33.000Z | 2022-03-11T23:45:44.000Z | project/memberships/urls.py | hiraq/base-django | 4df57f356905274b26af57af8328f015d6c680a4 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'memberships'
urlpatterns = [
path('register/', views.RegistrationView.as_view(), name='registration'),
path('login/', views.LoginView.as_view(), name='login'),
path('logout/', views.logout_view, name='logout'),
path('forget-pass/', views.For... | 39.857143 | 96 | 0.695341 | from django.urls import path
from . import views
app_name = 'memberships'
urlpatterns = [
path('register/', views.RegistrationView.as_view(), name='registration'),
path('login/', views.LoginView.as_view(), name='login'),
path('logout/', views.logout_view, name='logout'),
path('forget-pass/', views.For... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c00948b2fd3d7471c8d8e15dad2d6b5e6a3bc4f8 | 569 | py | Python | conceptnet_rocks/cli.py | ldtoolkit/conceptnet-rocks | 4dda14c6a2a0fdd036a49ad20927a46bd8121848 | [
"Apache-2.0"
] | 9 | 2020-11-17T22:01:21.000Z | 2022-02-06T14:38:59.000Z | conceptnet_rocks/cli.py | ldtoolkit/conceptnet-rocks | 4dda14c6a2a0fdd036a49ad20927a46bd8121848 | [
"Apache-2.0"
] | null | null | null | conceptnet_rocks/cli.py | ldtoolkit/conceptnet-rocks | 4dda14c6a2a0fdd036a49ad20927a46bd8121848 | [
"Apache-2.0"
] | null | null | null | import typer
app = typer.Typer()
| 23.708333 | 64 | 0.72232 | from conceptnet_rocks.database import load_dump_into_database
from graph_garden import arangodb
from pathlib import Path
from typing import Optional
import typer
app = typer.Typer()
@app.command()
def load(
dump_path: Path,
edge_count: Optional[int] = None,
arangodb_exe_path: Path = arangodb... | 0 | 361 | 0 | 0 | 0 | 0 | 0 | 61 | 111 |
e2f6cfed7cfe7bcab48b1cd3ff7768406b8f867b | 2,683 | py | Python | zeekofile/main.py | cdarlint/zeekofile | e5c999f0adfa1837c255b856eb030fb6838b0ea1 | [
"MIT"
] | 1 | 2022-02-20T08:02:00.000Z | 2022-02-20T08:02:00.000Z | zeekofile/main.py | cdarlint/zeekofile | e5c999f0adfa1837c255b856eb030fb6838b0ea1 | [
"MIT"
] | 1 | 2021-07-23T19:45:58.000Z | 2021-07-23T19:45:58.000Z | zeekofile/main.py | cdarlint/zeekofile | e5c999f0adfa1837c255b856eb030fb6838b0ea1 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
if __name__ == "__main__":
main()
| 27.10101 | 77 | 0.608647 | import logging
import os
import sys
import traceback
import time
import argparse
from . import config, util, server
from .writer import _rebuild, _check_output
logger = logging.getLogger(__name__)
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument(
"-s", "--src-dir", dest="src_di... | 0 | 0 | 0 | 0 | 0 | 2,372 | 0 | -9 | 224 |
0b6b72a1dba9cb75cf4408a82fd444410a7f1d3c | 474 | py | Python | research/count_vect.py | c17hawke/AIOps-project-DVC-NLP-usecase | 86f6153771bcb4285356a5202de0691f722ada7f | [
"MIT"
] | null | null | null | research/count_vect.py | c17hawke/AIOps-project-DVC-NLP-usecase | 86f6153771bcb4285356a5202de0691f722ada7f | [
"MIT"
] | null | null | null | research/count_vect.py | c17hawke/AIOps-project-DVC-NLP-usecase | 86f6153771bcb4285356a5202de0691f722ada7f | [
"MIT"
] | 5 | 2021-12-06T17:34:08.000Z | 2022-02-23T03:18:41.000Z | from sklearn.feature_extraction.text import CountVectorizer
examples = [
"apple ball cat",
"ball cat dog",
]
# vectorizer = CountVectorizer()
# X = vectorizer.fit_transform(examples)
# print(vectorizer.get_feature_names_out())
# print(X.toarray())
max_features = 3
ngrams = 2
vectorizer = CountVectorizer(... | 18.96 | 80 | 0.755274 | from sklearn.feature_extraction.text import CountVectorizer
examples = [
"apple ball cat",
"ball cat dog",
]
# vectorizer = CountVectorizer()
# X = vectorizer.fit_transform(examples)
# print(vectorizer.get_feature_names_out())
# print(X.toarray())
max_features = 3
ngrams = 2
vectorizer = CountVectorizer(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4dddbf67785e87c24b5b5fb219fbbbbc0d6ae81 | 2,116 | py | Python | GetVideoUrl/biliDownLoad.py | Vespa314/bilibili-api | 42b6b90aa7c141f5cfb0fdc754435518106f6966 | [
"MIT"
] | 1,460 | 2015-01-04T09:12:00.000Z | 2022-03-25T03:25:49.000Z | GetVideoUrl/biliDownLoad.py | AutumnMing/bilibili-api | f28a74011c1eb503ee5544f0fa201133bebfba05 | [
"MIT"
] | 24 | 2015-02-27T07:25:17.000Z | 2020-06-12T18:20:37.000Z | GetVideoUrl/biliDownLoad.py | AutumnMing/bilibili-api | f28a74011c1eb503ee5544f0fa201133bebfba05 | [
"MIT"
] | 260 | 2015-02-04T03:08:50.000Z | 2022-03-02T15:13:42.000Z | #coding=utf-8
import sys
import gzip
import json
import hashlib
import re
import urllib2
import xml.dom.minidom
import zlib
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36'
APPKEY = '85eb6835b0a1034e'
APPSEC = '2ad42749773c441109bd... | 33.587302 | 135 | 0.642722 | #coding=utf-8
import sys
import gzip
import json
import hashlib
import re
import urllib2
import xml.dom.minidom
import zlib
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.99 Safari/537.36'
APPKEY = '85eb6835b0a1034e'
APPSEC = '2ad42749773c441109bd... | 24 | 0 | 0 | 0 | 0 | 1,508 | 0 | 0 | 69 |
873e5865f68fc289c20f395e65bf707065fb653d | 2,149 | py | Python | backend/Models/app1.py | Vedant1202/sepsis | ed73d897192e561d1742109e642af72f6f26cfdf | [
"MIT"
] | null | null | null | backend/Models/app1.py | Vedant1202/sepsis | ed73d897192e561d1742109e642af72f6f26cfdf | [
"MIT"
] | 2 | 2020-01-28T23:16:01.000Z | 2020-09-26T00:36:53.000Z | backend/Models/app1.py | Vedant1202/sepsis | ed73d897192e561d1742109e642af72f6f26cfdf | [
"MIT"
] | null | null | null | from flask import Flask #this has changed
app = Flask(__name__)
if __name__ == '__main__':
app.run()
| 34.111111 | 109 | 0.694742 | from flask import Flask, render_template #this has changed
import plotly
import plotly.graph_objs as go
import pandas as pd
import numpy as np
import json
app = Flask(__name__)
def create_plot(rate):
#rate1=3
valuelist1=[rate[0],4-rate[0]]
trace1=go.Pie(values=valuelist1,hole=.6)
fig1=go.Figure(data1... | 0 | 83 | 0 | 0 | 0 | 1,799 | 0 | 3 | 157 |
503092165352bee201ba28d72477979cee3777c2 | 398 | py | Python | django/docs/releases/1.7.8.txt.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/docs/releases/1.7.8.txt.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | django/docs/releases/1.7.8.txt.py | roshanba/mangal | f7b428811dc07214009cc33f0beb665ead402038 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXX XXXXX XXXXXXX XXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXX XX XXXXX
XXXXXX XXXXX XXXXXX
X XXXXXXXX XXXXXXXXXXXXX XXXX XXXXXX XXXXX XXXXXXXXX XXXXX XX XXXXX
XXXXXXXXXXXXXXXXXX
X X XXXXXXXX XXXXX XXXX XXXXXXX XXXXXXXXXX XX XXXXX XXXXXXXXXXXXXXXXXX
X XXX XXXX XX XXXXXXXXXXXXXX XXXXXX XXXX... | 24.875 | 77 | 0.856784 | XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXX XXXXX XXXXXXX XXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXX XX XXXXX
XXXXXX XXXXX XXXXXX
X XXXXXXXX XXXXXXXXXXXXX XXXX XXXXXX XXXXX XXXXXXXXX XXXXX XX XXXXX
XXXXXXXXXXXXXXXXXX
X X XXXXXXXX XXXXX XXXX XXXXXXX XXXXXXXXXX XX XXXXX XXXXXXXXXXXXXXXXXX
X XXX XXXX XX XXXXXXXXXXXXXX XXXXXX XXXX... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d4d986ee51c7efbda19d9f3b83f6c50cbdcd0c2b | 11,408 | py | Python | ignite/metrics/confusion_matrix.py | mkartik/ignite | 62e41bd181206a7ce43d9d21274351edcff265f1 | [
"BSD-3-Clause"
] | 1 | 2020-03-04T20:07:45.000Z | 2020-03-04T20:07:45.000Z | ignite/metrics/confusion_matrix.py | hefv57/ignite | a22a0f5e909ac70d2a1f76a60b6e84b2134f196c | [
"BSD-3-Clause"
] | null | null | null | ignite/metrics/confusion_matrix.py | hefv57/ignite | a22a0f5e909ac70d2a1f76a60b6e84b2134f196c | [
"BSD-3-Clause"
] | null | null | null | import numbers
from typing import Optional
import torch
from ignite.metrics import MetricsLambda
__all__ = ["ConfusionMatrix", "mIoU", "IoU", "DiceCoefficient", "cmAccuracy", "cmPrecision", "cmRecall"]
def IoU(cm: ConfusionMatrix, ignore_index: Optional[int] = None) -> MetricsLambda:
"""Calculates Intersectio... | 39.611111 | 120 | 0.654541 | import numbers
from typing import Optional, Union, Any, Callable, Sequence
import torch
from ignite.metrics import Metric, MetricsLambda
from ignite.exceptions import NotComputableError
from ignite.metrics.metric import sync_all_reduce, reinit__is_reduced
__all__ = ["ConfusionMatrix", "mIoU", "IoU", "DiceCoefficient... | 0 | 1,535 | 0 | 3,967 | 0 | 758 | 0 | 115 | 129 |
3fa8a62e7cce810d00517eb7ff8fb7fbf84dabf1 | 2,694 | py | Python | arcade/examples/gui_scrollable_text.py | janscas/arcade | d83dda946563429c8ee7d1a036bc0407758c638f | [
"MIT"
] | 824 | 2016-01-07T19:27:57.000Z | 2020-08-01T03:15:47.000Z | arcade/examples/gui_scrollable_text.py | janscas/arcade | d83dda946563429c8ee7d1a036bc0407758c638f | [
"MIT"
] | 646 | 2016-01-08T02:42:31.000Z | 2020-08-03T14:13:27.000Z | arcade/examples/gui_scrollable_text.py | janscas/arcade | d83dda946563429c8ee7d1a036bc0407758c638f | [
"MIT"
] | 221 | 2016-01-07T22:36:33.000Z | 2020-07-24T23:30:08.000Z | import arcade
LOREM_IPSUM = (
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget pellentesque velit. "
"Nam eu rhoncus nulla. Fusce ornare libero eget ex vulputate, vitae mattis orci eleifend. "
"Donec quis volutpat arcu. Proin lacinia velit id imperdiet ultrices. Fusce porta magna leo... | 42.761905 | 109 | 0.635857 | import arcade
from arcade import load_texture
from arcade.gui import UIManager
from arcade.gui.widgets import UITextArea, UIInputText, UITexturePane
LOREM_IPSUM = (
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eget pellentesque velit. "
"Nam eu rhoncus nulla. Fusce ornare libero eget ex v... | 0 | 0 | 0 | 1,187 | 0 | 0 | 0 | 69 | 89 |
a8ea0ce2d63d9aca86e2a1e3f3107c9cab9efe98 | 155 | py | Python | Python/Code/Python3-Base/03_Container/tuple.py | hiloWang/notes | 64a637a86f734e4e80975f4aa93ab47e8d7e8b64 | [
"Apache-2.0"
] | 2 | 2020-10-08T13:22:08.000Z | 2021-07-28T14:45:41.000Z | Python/Python3-Base/03_Container/tuple.py | flyfire/Programming-Notes-Code | 4b1bdd74c1ba0c007c504834e4508ec39f01cd94 | [
"Apache-2.0"
] | null | null | null | Python/Python3-Base/03_Container/tuple.py | flyfire/Programming-Notes-Code | 4b1bdd74c1ba0c007c504834e4508ec39f01cd94 | [
"Apache-2.0"
] | 6 | 2020-08-20T07:19:17.000Z | 2022-03-02T08:16:21.000Z | #########################
#
#########################
#
dimensions = (1, 2, 3, 4, 5)
print(dimensions)
print(type(dimensions))
| 15.5 | 28 | 0.458065 | #########################
# 演示元组
#########################
# 元组: 元组是一序列不可修改的元素的集合
dimensions = (1, 2, 3, 4, 5)
print(dimensions)
print(type(dimensions))
| 69 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
529b559a6aba5146b92a62c027fbfbc43cabdbbe | 429 | py | Python | src/byro/mails/migrations/0002_email_attachments.py | mv-idatalytics/jenkins-byro | 1be7f30a8a8c40adf93ea099e9d85cd28fc19783 | [
"Apache-2.0"
] | null | null | null | src/byro/mails/migrations/0002_email_attachments.py | mv-idatalytics/jenkins-byro | 1be7f30a8a8c40adf93ea099e9d85cd28fc19783 | [
"Apache-2.0"
] | null | null | null | src/byro/mails/migrations/0002_email_attachments.py | mv-idatalytics/jenkins-byro | 1be7f30a8a8c40adf93ea099e9d85cd28fc19783 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 1.11.8 on 2018-01-24 15:48
| 25.235294 | 88 | 0.634033 | # Generated by Django 1.11.8 on 2018-01-24 15:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("documents", "0001_initial"), ("mails", "0001_initial")]
operations = [
migrations.AddField(
model_name="email",
name="attachment... | 0 | 0 | 0 | 314 | 0 | 0 | 0 | 19 | 46 |
58382be3102ab1a99c4a9545b3f605f49422e353 | 5,470 | py | Python | measure/views.py | luke-feng/MAP | bc82ec20e2859dd6437d314fc12880f5e6b6aad8 | [
"Apache-2.0"
] | 1 | 2021-11-30T19:38:55.000Z | 2021-11-30T19:38:55.000Z | measure/views.py | luke-feng/MAP | bc82ec20e2859dd6437d314fc12880f5e6b6aad8 | [
"Apache-2.0"
] | null | null | null | measure/views.py | luke-feng/MAP | bc82ec20e2859dd6437d314fc12880f5e6b6aad8 | [
"Apache-2.0"
] | 1 | 2022-02-25T22:48:21.000Z | 2022-02-25T22:48:21.000Z |
# Create your views here.
| 40.518519 | 153 | 0.616819 | from django.shortcuts import render
# Create your views here.
from rest_framework import generics, status, mixins
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from rest_framework.views import APIView
from measure.models import Measures
from .serializers import MeasuresS... | 0 | 0 | 0 | 4,937 | 0 | 0 | 0 | 211 | 290 |
fc78210ac4ca12f8b9aed3b31a9fea4dfd70e722 | 492 | py | Python | pcdet/models/backbones_3d/vfe/vfe_template.py | twn29004/OpenPCDet | 3457cc30b21d882a1376ef272fbaa49755c72a2e | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_3d/vfe/vfe_template.py | twn29004/OpenPCDet | 3457cc30b21d882a1376ef272fbaa49755c72a2e | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_3d/vfe/vfe_template.py | twn29004/OpenPCDet | 3457cc30b21d882a1376ef272fbaa49755c72a2e | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
| 21.391304 | 46 | 0.514228 | import torch.nn as nn
class VFETemplate(nn.Module):
def __init__(self, model_cfg, **kwargs):
super().__init__()
self.model_cfg = model_cfg
def get_output_feature_dim(self):
raise NotImplementedError
def forward(self, **kwargs):
"""
Args:
... | 0 | 0 | 0 | 442 | 0 | 0 | 0 | 0 | 25 |
3ffe942afccfbed59f7eb905c57958ee254c9605 | 4,455 | py | Python | 19/aoc19-1.py | combs/AdventOfCode2021 | 925df8a3526cb9c0dde368cf828673f345096e06 | [
"MIT"
] | null | null | null | 19/aoc19-1.py | combs/AdventOfCode2021 | 925df8a3526cb9c0dde368cf828673f345096e06 | [
"MIT"
] | null | null | null | 19/aoc19-1.py | combs/AdventOfCode2021 | 925df8a3526cb9c0dde368cf828673f345096e06 | [
"MIT"
] | null | null | null | import itertools, tqdm, json
scanners = []
new = []
with open("data.txt", "r") as fh:
lines = fh.readlines()
number = 0
for line in lines:
line = line.strip()
# print(line)
if "scanner" in line:
if new:
scanners.append({"coords_raw":new... | 31.153846 | 153 | 0.559371 | import numpy, itertools, tqdm, json
scanners = []
new = []
def rotateX(x, y, z, count):
i = count
while i > 0:
(x, y, z) = _rotateX(x, y, z)
i -= 1
return (x, y, z)
def _rotateX(x, y, z):
return (x, -z, y)
def rotateY(x, y, z, count):
i = count
while i > 0:
(x, y, z) ... | 0 | 0 | 0 | 0 | 0 | 674 | 0 | 7 | 184 |
51c463b0b761dff5a0cc849e48f9b5020df9629a | 526 | py | Python | pipeline_dsl/resources/resource.py | isabella232/pipeline-dsl | 543dc611821e75b9ee96a0277038de6350bec012 | [
"Apache-2.0"
] | 15 | 2021-01-28T08:33:14.000Z | 2022-01-05T20:24:26.000Z | pipeline_dsl/resources/resource.py | cherwin/pipeline-dsl | 9bfa32c46f09fab15b35d46d4e7fccdadaef8d01 | [
"Apache-2.0"
] | 14 | 2021-03-23T16:10:18.000Z | 2021-08-24T09:03:07.000Z | pipeline_dsl/resources/resource.py | isabella232/pipeline-dsl | 543dc611821e75b9ee96a0277038de6350bec012 | [
"Apache-2.0"
] | 3 | 2021-03-24T08:46:21.000Z | 2022-03-04T00:24:00.000Z | from typing import TypeVar
T = TypeVar("T")
| 18.137931 | 56 | 0.669202 | from typing import TypeVar, Generic, Optional, Dict, Any
from abc import abstractmethod
from dataclasses import dataclass
T = TypeVar("T")
@dataclass
class ConcourseResource:
name: str
type: str
icon: str
source: Dict[str, Any]
class AbstractResource(Generic[T]):
@abstractmethod
def resour... | 0 | 243 | 0 | 14 | 0 | 0 | 0 | 51 | 170 |
a1d38917e070bc08b9fc52f274576bed9a50ef79 | 2,988 | py | Python | analysis/lib/geometry/speedups/parallel.py | astutespruce/sarp | 7ce503380440c47b762ed1a8efd1d3e3aab6605e | [
"MIT"
] | null | null | null | analysis/lib/geometry/speedups/parallel.py | astutespruce/sarp | 7ce503380440c47b762ed1a8efd1d3e3aab6605e | [
"MIT"
] | null | null | null | analysis/lib/geometry/speedups/parallel.py | astutespruce/sarp | 7ce503380440c47b762ed1a8efd1d3e3aab6605e | [
"MIT"
] | null | null | null | import dask.array as da
import dask.dataframe as dd
def apply_parallel(
function,
array,
chunks=4,
drop_axis=None,
new_axis=None,
dtype=float,
*args,
**kwargs
):
"""Apply the function in parallel using Dask.
See https://docs.dask.org/en/latest/array-api.html#dask.array.map_blo... | 25.758621 | 82 | 0.620817 | import dask.array as da
import dask.dataframe as dd
def apply_parallel(
function,
array,
chunks=4,
drop_axis=None,
new_axis=None,
dtype=float,
*args,
**kwargs
):
"""Apply the function in parallel using Dask.
See https://docs.dask.org/en/latest/array-api.html#dask.array.map_blo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b20fece221d18d864d1feee988df9716e2255232 | 227 | py | Python | zephyr/__init__.py | uwoseis/zephyr-cli | e4228be3947021f2b983c919c51bb1f67df90eb0 | [
"MIT"
] | 18 | 2015-11-21T03:36:33.000Z | 2021-07-23T08:20:27.000Z | zephyr/__init__.py | uwoseis/zephyr-cli | e4228be3947021f2b983c919c51bb1f67df90eb0 | [
"MIT"
] | 33 | 2015-11-23T15:38:12.000Z | 2016-10-12T00:41:05.000Z | zephyr/__init__.py | uwoseis/zephyr-cli | e4228be3947021f2b983c919c51bb1f67df90eb0 | [
"MIT"
] | 7 | 2017-01-03T14:54:46.000Z | 2020-01-04T13:39:57.000Z | '''
Zephyr: Open-source seismic waveform modelling and inversion code written in Python
'''
__version__ = 'devel'
__author__ = 'Brendan Smithyman'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015 Brendan Smithyman'
| 22.7 | 83 | 0.744493 | '''
Zephyr: Open-source seismic waveform modelling and inversion code written in Python
'''
__version__ = 'devel'
__author__ = 'Brendan Smithyman'
__license__ = 'MIT'
__copyright__ = 'Copyright 2015 Brendan Smithyman'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
47209892e5e57f81af4b9871b21d30292a45b619 | 965 | py | Python | example/routes.py | ozburo/babushka | dac0f5f1dc8519a75dd362fbba64a63ed150ec08 | [
"MIT"
] | 3 | 2015-08-28T13:22:42.000Z | 2018-01-25T21:34:12.000Z | example/routes.py | ozburo/babushka | dac0f5f1dc8519a75dd362fbba64a63ed150ec08 | [
"MIT"
] | null | null | null | example/routes.py | ozburo/babushka | dac0f5f1dc8519a75dd362fbba64a63ed150ec08 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
example.routes.py
"""
from webapp2_extras.routes import HandlerPrefixRoute, RedirectRoute
# --------------------------------------------------------------------
# Routes
# --------------------------------------------------------------------
routes = [
HandlerPrefixRoute('example.han... | 23.536585 | 70 | 0.420725 | # -*- coding: utf-8 -*-
"""
example.routes.py
"""
from webapp2_extras.routes import HandlerPrefixRoute, RedirectRoute
# --------------------------------------------------------------------
# Routes
# --------------------------------------------------------------------
routes = [
HandlerPrefixRoute('example.han... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a743b884fbceb61629aeb2e4748adc95c694564 | 603 | py | Python | authtestapp/urls.py | plaunezkiy/emphasoft-test | e9e9385ccf784bf12fc0b9b61a92650053b10e0b | [
"MIT"
] | null | null | null | authtestapp/urls.py | plaunezkiy/emphasoft-test | e9e9385ccf784bf12fc0b9b61a92650053b10e0b | [
"MIT"
] | null | null | null | authtestapp/urls.py | plaunezkiy/emphasoft-test | e9e9385ccf784bf12fc0b9b61a92650053b10e0b | [
"MIT"
] | null | null | null | from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('django.contrib.auth.urls')),
path('', include('social_django.urls', namespace='social')),
... | 31.736842 | 64 | 0.676617 | from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('django.contrib.auth.urls')),
path('', include('social_django.urls', namespace='social')),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7645e317aa8c4a50cdfeda2860b24e94b23262d | 1,497 | py | Python | connectivipy/plot.py | dokato/connectivipy | 97ddc400336741513bdcdfa305e6ce6e6172dced | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2015-06-14T09:48:38.000Z | 2022-03-22T09:04:35.000Z | connectivipy/plot.py | dokato/connectivipy | 97ddc400336741513bdcdfa305e6ce6e6172dced | [
"BSD-2-Clause-FreeBSD"
] | 33 | 2015-08-11T06:30:17.000Z | 2021-09-23T12:59:20.000Z | connectivipy/plot.py | dokato/connectivipy | 97ddc400336741513bdcdfa305e6ce6e6172dced | [
"BSD-2-Clause-FreeBSD"
] | 3 | 2018-11-06T17:52:35.000Z | 2021-05-31T05:15:30.000Z | # -*- coding: utf-8 -*-
#! /usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from six.moves import range
# plain plotting from values
def plot_conn(values, name='', fs=1, ylim=None, xlim=None, show=True):
'''
Plot connectivity estimation results. Allows to plot your results
without us... | 31.1875 | 79 | 0.577154 | # -*- coding: utf-8 -*-
#! /usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from six.moves import range
# plain plotting from values
def plot_conn(values, name='', fs=1, ylim=None, xlim=None, show=True):
'''
Plot connectivity estimation results. Allows to plot your results
without us... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
af00aa5106f6606dc488e265f70d643b0c231049 | 591 | py | Python | data/audio_data/audio_norm.py | ishine/Looking-to-Listen-at-the-Cocktail-Party | cb973ae8ec16d1203051f53445d30490646c8772 | [
"MIT"
] | 145 | 2019-10-09T15:44:58.000Z | 2022-03-31T03:37:32.000Z | data/audio_data/audio_norm.py | ishine/Looking-to-Listen-at-the-Cocktail-Party | cb973ae8ec16d1203051f53445d30490646c8772 | [
"MIT"
] | 28 | 2019-12-20T08:44:12.000Z | 2022-03-12T00:48:25.000Z | data/audio_data/audio_norm.py | ishine/Looking-to-Listen-at-the-Cocktail-Party | cb973ae8ec16d1203051f53445d30490646c8772 | [
"MIT"
] | 48 | 2019-10-10T03:18:40.000Z | 2022-03-22T11:49:18.000Z | import librosa
import os
import numpy as np
import scipy.io.wavfile as wavfile
audio_range = (0, 20)
if not os.path.exists('./norm_audio_train'):
os.mkdir('./norm_audio_train')
for idx in range(audio_range[0], audio_range[1]):
print('Processing audio %s'%idx)
path = './audio_train/trim_audio_train%s.wav'... | 26.863636 | 60 | 0.673435 | import librosa
import os
import numpy as np
import scipy.io.wavfile as wavfile
audio_range = (0, 20)
if not os.path.exists('./norm_audio_train'):
os.mkdir('./norm_audio_train')
for idx in range(audio_range[0], audio_range[1]):
print('Processing audio %s'%idx)
path = './audio_train/trim_audio_train%s.wav'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
879186b8a3b3ca289be95fdeef6f5f5d3b2e9d17 | 4,981 | py | Python | Old Code/Workspace8.py | brandyn-gilbert/DAT-281-CAPSTONE | d86dd62eab164e6845dee63954cacc0324a449bc | [
"MIT"
] | null | null | null | Old Code/Workspace8.py | brandyn-gilbert/DAT-281-CAPSTONE | d86dd62eab164e6845dee63954cacc0324a449bc | [
"MIT"
] | null | null | null | Old Code/Workspace8.py | brandyn-gilbert/DAT-281-CAPSTONE | d86dd62eab164e6845dee63954cacc0324a449bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 29 12:08:34 2021
@author: BKG
"""
import sqlite3
from sqlite3 import Error
def _db_connection():
'''
Connects to the .db file
Returns
-------
connection : sqlite db connection
'''
try:
connection = sqlite3.connect('Data\\UIF_... | 28.959302 | 81 | 0.509536 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 29 12:08:34 2021
@author: BKG
"""
import sqlite3
from sqlite3 import Error
import pandas as pd
import PySimpleGUI as sg
import re
from re import search
from datetime import datetime
from fpdf import FPDF
def main():
print()
alumni = lookup_alumni()
print(alu... | 0 | 0 | 0 | 0 | 0 | 4,302 | 0 | -3 | 247 |
ed056eb6d27d878ae1e0b5e16462d12a5671f05f | 6,428 | py | Python | examples/train_narm.py | ChaosCodes/beta-recsys | 8a0b47f154dab5d23a572c75cf64cef4400b3f12 | [
"MIT"
] | 1 | 2021-09-02T20:38:16.000Z | 2021-09-02T20:38:16.000Z | examples/train_narm.py | ChaosCodes/beta-recsys | 8a0b47f154dab5d23a572c75cf64cef4400b3f12 | [
"MIT"
] | null | null | null | examples/train_narm.py | ChaosCodes/beta-recsys | 8a0b47f154dab5d23a572c75cf64cef4400b3f12 | [
"MIT"
] | null | null | null | """isort:skip_file."""
import argparse
import sys
sys.path.append("../")
def parse_args():
"""Parse args from command line.
Returns:
args object.
"""
parser = argparse.ArgumentParser(description="Run NARM..")
parser.add_argument(
"--config_file",
nargs="?",
type=s... | 34.191489 | 117 | 0.633945 | """isort:skip_file."""
import argparse
import os
import sys
sys.path.append("../")
from torch.utils.data import DataLoader
from tqdm import tqdm
from beta_rec.core.eval_engine import SeqEvalEngine
from beta_rec.core.train_engine import TrainEngine
from beta_rec.datasets.seq_data_utils import (
SeqDataset,
co... | 0 | 0 | 0 | 3,707 | 0 | 0 | 0 | 257 | 201 |
3a0935196c12cd7a0875115ff7c3b07e1b3171d5 | 949 | py | Python | main.py | masteusz/simple_face_service | 865bbbe9fb9e3f7b9eb51b35aa2b2b9d406500d3 | [
"MIT"
] | null | null | null | main.py | masteusz/simple_face_service | 865bbbe9fb9e3f7b9eb51b35aa2b2b9d406500d3 | [
"MIT"
] | null | null | null | main.py | masteusz/simple_face_service | 865bbbe9fb9e3f7b9eb51b35aa2b2b9d406500d3 | [
"MIT"
] | null | null | null | import logging
from pathlib import Path
from flask import Flask
from config import config
from model.model import get_detector
from views.views import detector_blueprint
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
app = Flask(__name__)
app.secret_key = config.get("secret_key", "secre... | 30.612903 | 85 | 0.763962 | import logging
from pathlib import Path
from flask import Flask
from config import config
from model.model import get_detector
from views.views import detector_blueprint
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
app = Flask(__name__)
app.secret_key = config.get("secret_key", "secre... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
081b26df7a2f57e794aa422b54bc2318f1cf7604 | 4,657 | py | Python | web/app.py | phinawang/python_rest_tutorial | d75ddfad156f8a932f38b92ac0ff06a6507a958e | [
"MIT"
] | null | null | null | web/app.py | phinawang/python_rest_tutorial | d75ddfad156f8a932f38b92ac0ff06a6507a958e | [
"MIT"
] | null | null | null | web/app.py | phinawang/python_rest_tutorial | d75ddfad156f8a932f38b92ac0ff06a6507a958e | [
"MIT"
] | null | null | null | from flask import Flask
from flask_restful import Api
from pymongo import MongoClient
import logging
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] [%(thread)d] - %(message)s',datefmt='%d/%m/%Y %H:%M:%S',filename='flask.log')
app = Flask(__name__)
api = Api(app)
... | 23.054455 | 179 | 0.54155 | from flask import Flask, jsonify, request
from flask_restful import Api, Resource
from pymongo import MongoClient
import bcrypt
import logging
logging.basicConfig(level=logging.DEBUG,format='%(asctime)s [%(levelname)s] [%(filename)s:%(lineno)d] [%(thread)d] - %(message)s',datefmt='%d/%m/%Y %H:%M:%S',filename='flask.log... | 0 | 0 | 0 | 3,232 | 0 | 487 | 0 | 52 | 205 |
f5cec6ffa053c2e76a321c2d8de99b98eb485fe5 | 215 | py | Python | python_training/open_file.py | Shogo-Sakai/everybodys_ai | 8ea227d3b998e558f7dabbebd121eaff06a09085 | [
"MIT"
] | null | null | null | python_training/open_file.py | Shogo-Sakai/everybodys_ai | 8ea227d3b998e558f7dabbebd121eaff06a09085 | [
"MIT"
] | null | null | null | python_training/open_file.py | Shogo-Sakai/everybodys_ai | 8ea227d3b998e558f7dabbebd121eaff06a09085 | [
"MIT"
] | null | null | null | score_list = []
score_list_file = open("score.txt")
for score in score_list_file:
score = score.rstrip().split(",")
score_list.append([score[0],int(score[1])])
score_list_file.close()
print (score_list)
| 17.916667 | 47 | 0.693023 | score_list = []
score_list_file = open("score.txt")
for score in score_list_file:
score = score.rstrip().split(",")
score_list.append([score[0],int(score[1])])
score_list_file.close()
print (score_list)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d790006a017d3fae880a51b2ab0e2110363d3ac0 | 532 | py | Python | diary/src/example/splidexample.py | 1007530194/Dairy | 8f54fe38b0ddd08b29e7136bdf76f2a80322d73f | [
"MIT"
] | null | null | null | diary/src/example/splidexample.py | 1007530194/Dairy | 8f54fe38b0ddd08b29e7136bdf76f2a80322d73f | [
"MIT"
] | null | null | null | diary/src/example/splidexample.py | 1007530194/Dairy | 8f54fe38b0ddd08b29e7136bdf76f2a80322d73f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/02/25 16:30
# @Author : niuliangtao
# @Site :
# @File : MachineLearninginAction.py
# @Software: PyCharm
import csv
import random
import socket
import time
import http.client
import http.client
import requests
from bs4 import BeautifulSoup
if __n... | 20.461538 | 69 | 0.684211 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2018/02/25 16:30
# @Author : niuliangtao
# @Site :
# @File : MachineLearninginAction.py
# @Software: PyCharm
import csv
import random
import socket
import time
import http.client
import http.client
import requests
from bs4 import BeautifulSoup
if __n... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a3b19d172e1b415a32611e918ffde96accf58008 | 5,088 | py | Python | src/cython/test.py | 1computerguy/mercury | 193bf6432e4f53f1253965f5ca8634bd6ca69136 | [
"BSD-2-Clause"
] | null | null | null | src/cython/test.py | 1computerguy/mercury | 193bf6432e4f53f1253965f5ca8634bd6ca69136 | [
"BSD-2-Clause"
] | null | null | null | src/cython/test.py | 1computerguy/mercury | 193bf6432e4f53f1253965f5ca8634bd6ca69136 | [
"BSD-2-Clause"
] | null | null | null |
b64_cert = 'MIIJRDCCCCygAwIBAgIRAO7eZWDNNcCvAgAAAABZcbcwDQYJKoZIhvcNAQELBQAwQjELMAkGA1UEBhMCVVMxHjAcBgNVBAoTFUdvb2dsZSBUcnVzdCBTZXJ2aWNlczETMBEGA1UEAxMKR1RTIENBIDFPMTAeFw0yMDAyMTIxMTQ3MTFaFw0yMDA1MDYxMTQ3MTFaMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRMwEQYDVQQKEwpHb29nbGUgTExDMRU... | 462.545455 | 4,837 | 0.983097 | from mercury import *
b64_cert = 'MIIJRDCCCCygAwIBAgIRAO7eZWDNNcCvAgAAAABZcbcwDQYJKoZIhvcNAQELBQAwQjELMAkGA1UEBhMCVVMxHjAcBgNVBAoTFUdvb2dsZSBUcnVzdCBTZXJ2aWNlczETMBEGA1UEAxMKR1RTIENBIDFPMTAeFw0yMDAyMTIxMTQ3MTFaFw0yMDA1MDYxMTQ3MTFaMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRMwEQYDV... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
cdf5c83d6d700cd56b3e73cb5b9e57c4cc20653d | 16,050 | py | Python | app/__init__.py | department-of-veterans-affairs/notification-api | 698bc98d8e78a13a0b2cfc432cfc718ff1016b06 | [
"MIT"
] | 10 | 2020-05-04T14:11:06.000Z | 2022-02-22T19:06:36.000Z | app/__init__.py | department-of-veterans-affairs/notification-api | 698bc98d8e78a13a0b2cfc432cfc718ff1016b06 | [
"MIT"
] | 554 | 2020-05-07T21:56:24.000Z | 2022-03-31T23:04:51.000Z | app/__init__.py | department-of-veterans-affairs/notification-api | 698bc98d8e78a13a0b2cfc432cfc718ff1016b06 | [
"MIT"
] | 4 | 2020-08-27T16:43:29.000Z | 2021-02-17T22:17:27.000Z | import os
from dotenv import load_dotenv
from flask import g
from flask_marshmallow import Marshmallow
from flask_migrate import Migrate
from notifications_utils.clients.zendesk.zendesk_client import ZendeskClient
from notifications_utils.clients.statsd.statsd_client import StatsdClient
from notifications_utils.client... | 39.62963 | 120 | 0.788411 | import os
import random
import string
import uuid
from dotenv import load_dotenv
from flask import request, g, jsonify, make_response
from flask_cors import CORS
from flask_sqlalchemy import SQLAlchemy as _SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_migrate import Migrate
from time import monotonic... | 0 | 988 | 0 | 442 | 0 | 11,470 | 0 | 197 | 574 |
87c28b014c50d737d0b6605435a10839f65a0a29 | 2,489 | py | Python | md_service.py | kmdn/linker_recommender_api | 6b0da87187ef7032fd2f0a662846edee66691a61 | [
"Apache-2.0"
] | null | null | null | md_service.py | kmdn/linker_recommender_api | 6b0da87187ef7032fd2f0a662846edee66691a61 | [
"Apache-2.0"
] | null | null | null | md_service.py | kmdn/linker_recommender_api | 6b0da87187ef7032fd2f0a662846edee66691a61 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
#import pprint
import spacy
app = Flask(__name__)
print("Loading spacy SM")
_nlp = spacy.load("en_core_web_sm")
#_nlp = spacy.load("en_core_web_trf") # performs better
# Run with
# <s>flask run --port=5002</s>
# TODO Didn't work with spaCy, use
# python app.py
# Test with
# curl http://127.0... | 28.284091 | 166 | 0.645641 | from flask import Flask, request, Response, jsonify
#import pprint
import json
import spacy
app = Flask(__name__)
print("Loading spacy SM")
_nlp = spacy.load("en_core_web_sm")
#_nlp = spacy.load("en_core_web_trf") # performs better
# Run with
# <s>flask run --port=5002</s>
# TODO Didn't work with spaCy, use
# python... | 0 | 663 | 0 | 415 | 0 | 430 | 0 | 18 | 114 |
6b5638fcb55d0292c9e5087bd4365a50ac7211e4 | 144 | py | Python | modules/agents/__init__.py | netlab-lcy/CMIX | 53e2d8794af2b380295efe06dcb05235089953c1 | [
"MIT"
] | 1 | 2022-01-25T05:30:36.000Z | 2022-01-25T05:30:36.000Z | modules/agents/__init__.py | netlab-lcy/CMIX | 53e2d8794af2b380295efe06dcb05235089953c1 | [
"MIT"
] | null | null | null | modules/agents/__init__.py | netlab-lcy/CMIX | 53e2d8794af2b380295efe06dcb05235089953c1 | [
"MIT"
] | 1 | 2022-03-14T14:45:51.000Z | 2022-03-14T14:45:51.000Z | REGISTRY = {}
from .simple_agent import SimpleAgent
from .cql_agent import CQLAgent
REGISTRY['simple'] = SimpleAgent
REGISTRY['cql'] = CQLAgent | 24 | 37 | 0.777778 | REGISTRY = {}
from .simple_agent import SimpleAgent
from .cql_agent import CQLAgent
REGISTRY['simple'] = SimpleAgent
REGISTRY['cql'] = CQLAgent | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
17c043a3622639f7fdbd7972ced7fe91ba36b347 | 71 | py | Python | tests/test_panoptes_timegen.py | panoptes/panoptes-timegen | 4bee4591c62982f52431ea2c0e51cf84aa7aed33 | [
"MIT"
] | 1 | 2019-08-15T01:21:28.000Z | 2019-08-15T01:21:28.000Z | tests/test_panoptes_timegen.py | panoptes/panoptes-timegen | 4bee4591c62982f52431ea2c0e51cf84aa7aed33 | [
"MIT"
] | null | null | null | tests/test_panoptes_timegen.py | panoptes/panoptes-timegen | 4bee4591c62982f52431ea2c0e51cf84aa7aed33 | [
"MIT"
] | null | null | null | import time_gen
assert time_gen.get_file_list(None,['fits']) == True
| 14.2 | 52 | 0.746479 | import time_gen
assert time_gen.get_file_list(None,['fits']) == True
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
86e4e4120460d322b864999d7225dbeff4c1b3ba | 362 | py | Python | recipes/Python/59883_Random_selectielements_list_no/recipe-59883.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/59883_Random_selectielements_list_no/recipe-59883.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/59883_Random_selectielements_list_no/recipe-59883.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z |
data = range(10000)
# the original, naive version
# "final" version
| 14.48 | 30 | 0.632597 | from random import *
data = range(10000)
# the original, naive version
def select(data):
if data != []:
elem = choice(data)
data.remove(elem)
return elem
else:
return None
# "final" version
def select(data):
if data != []:
pos = randrange( len(data) )
elem = data[pos]
data[pos] = data[-1]
del da... | 0 | 0 | 0 | 0 | 0 | 224 | 0 | -1 | 66 |
79b8278075abb3d7603dd96d6700ff59dce80c39 | 1,516 | py | Python | convertCpGsToLocations.py | imk1/MethylationQTLCode | d193f518994074a29a39e081d470b1c67a95a527 | [
"MIT"
] | null | null | null | convertCpGsToLocations.py | imk1/MethylationQTLCode | d193f518994074a29a39e081d470b1c67a95a527 | [
"MIT"
] | null | null | null | convertCpGsToLocations.py | imk1/MethylationQTLCode | d193f518994074a29a39e081d470b1c67a95a527 | [
"MIT"
] | null | null | null |
if __name__=="__main__":
import sys
CpGLocationFileName = sys.argv[1]
CpGsInfoFileName = sys.argv[2]
outputFileName = sys.argv[3]
CpGToLocationDict = makeCpGLocationDict(CpGLocationFileName)
convertCpGsToLocations(CpGToLocationDict, CpGsInfoFileName, outputFileName) | 43.314286 | 116 | 0.755277 | def makeCpGLocationDict(CpGLocationFileName):
# Make a dictionary that maps Illumina IDs to CpG Locations
CpGLocationFile = open(CpGLocationFileName)
CpGToLocationDict = {}
for line in CpGLocationFile:
# Iterate through the lines of the CpG file and enter the location for the CpG on each line in the file
... | 0 | 0 | 0 | 0 | 0 | 1,188 | 0 | 0 | 48 |
e212049fd4fc09d36d9ec4678b96c6a53faf6ba6 | 18,567 | py | Python | gewittergefahr/gg_utils/probability_distributions.py | dopplerchase/GewitterGefahr | 4415b08dd64f37eba5b1b9e8cc5aa9af24f96593 | [
"MIT"
] | 26 | 2018-10-04T01:07:35.000Z | 2022-01-29T08:49:32.000Z | gewittergefahr/gg_utils/probability_distributions.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 4 | 2017-12-25T02:01:08.000Z | 2018-12-19T01:54:21.000Z | gewittergefahr/gg_utils/probability_distributions.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 11 | 2017-12-10T23:05:29.000Z | 2022-01-29T08:49:33.000Z | """Methods for handling probability distributions."""
import numpy
import pandas
import scipy.stats
from gewittergefahr.gg_utils import error_checking
FEATURE_NAMES_KEY = 'feature_names'
FEATURE_MEANS_KEY = 'feature_means'
COVARIANCE_MATRIX_KEY = 'covariance_matrix'
COVAR_MATRIX_INVERSE_KEY = 'covar_matrix_inverse'
C... | 41.536913 | 80 | 0.703237 | """Methods for handling probability distributions."""
import numpy
import pandas
import scipy.stats
from gewittergefahr.gg_utils import error_checking
FEATURE_NAMES_KEY = 'feature_names'
FEATURE_MEANS_KEY = 'feature_means'
COVARIANCE_MATRIX_KEY = 'covariance_matrix'
COVAR_MATRIX_INVERSE_KEY = 'covar_matrix_inverse'
C... | 0 | 0 | 0 | 1,613 | 0 | 0 | 0 | 0 | 23 |
84ecb4db74670c45b7795abf14142a9c0e2b2060 | 12,058 | py | Python | wool/comment_pr.py | uc-cdis/wool | a5bcd0fa70289e81fcceb8a1176b277a3d7c3339 | [
"Apache-2.0"
] | null | null | null | wool/comment_pr.py | uc-cdis/wool | a5bcd0fa70289e81fcceb8a1176b277a3d7c3339 | [
"Apache-2.0"
] | 5 | 2019-09-23T19:07:51.000Z | 2021-04-20T17:06:35.000Z | wool/comment_pr.py | uc-cdis/wool | a5bcd0fa70289e81fcceb8a1176b277a3d7c3339 | [
"Apache-2.0"
] | 2 | 2019-09-22T22:07:31.000Z | 2021-04-20T15:41:40.000Z | import os
import subprocess
import sys
from time import sleep
import requests
SIGNATURE = (
"This formatting comment was generated automatically by a script in"
" [uc-cdis/wool](https://github.com/uc-cdis/wool)."
)
ASK_FOR_FORMAT_COMMIT = ["wool", "black", "please format my code"]
def main():
"""
... | 35.780415 | 120 | 0.608559 | import json
import os
import re
import subprocess
import sys
from time import sleep
import requests
SIGNATURE = (
"This formatting comment was generated automatically by a script in"
" [uc-cdis/wool](https://github.com/uc-cdis/wool)."
)
ASK_FOR_FORMAT_COMMIT = ["wool", "black", "please format my code"]
d... | 0 | 0 | 0 | 2,130 | 0 | 908 | 0 | -22 | 113 |
da16d15f6ef6b94d26790b4a05c378a4ad3b8bd0 | 3,096 | py | Python | camera.py | symunona/quadroscope | 8bd9591b6e8201daebc9804a9e35204a9a9eb512 | [
"MIT"
] | null | null | null | camera.py | symunona/quadroscope | 8bd9591b6e8201daebc9804a9e35204a9a9eb512 | [
"MIT"
] | null | null | null | camera.py | symunona/quadroscope | 8bd9591b6e8201daebc9804a9e35204a9a9eb512 | [
"MIT"
] | null | null | null | #
# Quadroscope - entry point
#
# The four camera system for raspberries.
#
import os, os.path, sys, json, time, logging
import picamera
logging.basicConfig(filename='camera.log', level=logging.DEBUG)
from quadlib.utils import log
from quadlib.updater import Updater
from quadlib.utils.gpio import Gpio
from qu... | 30.96 | 119 | 0.677649 | #
# Quadroscope - entry point
#
# The four camera system for raspberries.
#
import os, os.path, sys, json, time, thread, datetime, logging
import picamera
logging.basicConfig(filename='camera.log', level=logging.DEBUG)
from quadlib.utils import log
from quadlib import convert
from quadlib.updater import Updat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 22 |
cc2fccb03fe356c69b7b737cb9f0cce751aa9f6e | 2,078 | py | Python | storyboard/plugin/email/smtp_client.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | storyboard/plugin/email/smtp_client.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | storyboard/plugin/email/smtp_client.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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... | 35.220339 | 78 | 0.67565 | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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 | 0 | 0 | 1,332 | 0 | 0 | 0 | -7 | 46 |
d9e0027d15a7fc1300fbcec3bb5e4514bdd75c45 | 596 | py | Python | examples/_twisted/__init__.py | stepank/pyws | ff39133aabeb56bbb08d66286ac0cc8731eda7dd | [
"MIT"
] | 11 | 2015-01-19T15:43:46.000Z | 2022-03-13T08:23:01.000Z | examples/_twisted/__init__.py | stepank/pyws | ff39133aabeb56bbb08d66286ac0cc8731eda7dd | [
"MIT"
] | 1 | 2015-01-21T07:31:35.000Z | 2015-02-08T17:52:35.000Z | examples/_twisted/__init__.py | stepank/pyws | ff39133aabeb56bbb08d66286ac0cc8731eda7dd | [
"MIT"
] | 11 | 2015-01-19T15:43:49.000Z | 2022-03-04T10:11:24.000Z | #!/usr/bin/env python
from twisted.internet import reactor
from twisted.web.server import Site
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
#noinspection PyUnresolvedReferences
reactor.listenTCP(8000, Site(Simple()))
#noinspection PyUnresolvedReferences
reactor.run... | 21.285714 | 79 | 0.755034 | #!/usr/bin/env python
from twisted.internet import reactor
from twisted.web.resource import Resource
from twisted.web.server import Site
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pyws.adapters._twisted import serve
from server import server
class Simple(Re... | 0 | 0 | 0 | 139 | 0 | 0 | 0 | 43 | 91 |
85af3481287a01d52eb4e8aef3c93ae1abf12ca6 | 759 | py | Python | friendly-asyncio/1-threads.py | kangli-bionic/pycon | fa3f338b92f32bd86bf1db1cd4f5eb4674c0be12 | [
"MIT"
] | 32 | 2018-08-25T05:13:47.000Z | 2021-08-18T14:30:39.000Z | friendly-asyncio/1-threads.py | kangli-bionic/pycon | fa3f338b92f32bd86bf1db1cd4f5eb4674c0be12 | [
"MIT"
] | 1 | 2018-08-31T07:18:56.000Z | 2018-08-31T07:18:56.000Z | friendly-asyncio/1-threads.py | kangli-bionic/pycon | fa3f338b92f32bd86bf1db1cd4f5eb4674c0be12 | [
"MIT"
] | 7 | 2018-08-30T14:15:46.000Z | 2021-01-17T11:36:31.000Z | from multiprocessing import Pool as ProcessPool
from multiprocessing.dummy import Pool as ThreadPool
from common import timed
NUM_WORKERS = 8 # four cores
def fib(n):
"""Calculate the n-th element of Fibonacci."""
a, b = 1, 1
while n > 1:
a, b = b, a + b
n -= 1
return a
timed(fib, ... | 19.461538 | 56 | 0.652174 | from multiprocessing import Pool as ProcessPool
from multiprocessing.dummy import Pool as ThreadPool
from common import timed
NUM_WORKERS = 8 # four cores
def fib(n):
"""Calculate the n-th element of Fibonacci."""
a, b = 1, 1
while n > 1:
a, b = b, a + b
n -= 1
return a
timed(fib, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d43fc9c83b533a99e43014d20f51ebbccb9a7a56 | 9,606 | py | Python | photons/equipment/dmm_3458A.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/equipment/dmm_3458A.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/equipment/dmm_3458A.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | """
Communicate with a Keysight 3458A digital multimeter.
"""
| 35.577778 | 112 | 0.537268 | """
Communicate with a Keysight 3458A digital multimeter.
"""
from . import equipment
from .dmm import DMM
@equipment(manufacturer=r'Keysight', model=r'3458A')
class Keysight3458A(DMM):
FUNCTIONS = {
1: 'DCV',
'DCV': 'DCV',
'VOLT': 'DCV',
'VOLTAGE': 'DCV',
2: 'ACV',
... | 3 | 9,474 | 0 | 0 | 0 | 0 | 0 | 1 | 67 |
44a74a0c05f94ae4f08572537178a693c204eb52 | 1,511 | py | Python | NLPCode/sentiment_analysis/utils.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | 1 | 2021-12-21T14:05:34.000Z | 2021-12-21T14:05:34.000Z | NLPCode/sentiment_analysis/utils.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | null | null | null | NLPCode/sentiment_analysis/utils.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | null | null | null | import torch
def binary_accuracy(preds, y):
"""
Returns accuracy per batch, i.e. if you get 8/10 right, this returns 0.8, NOT 8
"""
#round predictions to the closest integer
rounded_preds = torch.round(torch.sigmoid(preds))
correct = (rounded_preds == y).float() #convert into float for divisio... | 32.148936 | 99 | 0.627399 | import time
import torch
from queue import Queue
import numpy as np
def binary_accuracy(preds, y):
"""
Returns accuracy per batch, i.e. if you get 8/10 right, this returns 0.8, NOT 8
"""
#round predictions to the closest integer
rounded_preds = torch.round(torch.sigmoid(preds))
correct = (roun... | 0 | 0 | 0 | 837 | 0 | 196 | 0 | -11 | 112 |
bdf499f465a9db7bae8e722e09e73f0abd209a71 | 22,571 | py | Python | src/tallem/cover.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | null | null | null | src/tallem/cover.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | null | null | null | src/tallem/cover.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | 1 | 2021-07-25T04:58:58.000Z | 2021-07-25T04:58:58.000Z | ## cover.py
import numpy as np
import numpy.typing as npt
from numpy.typing import ArrayLike
from .polytope import sdist_to_boundary
## Type tools
## NOTE: put collections first before typing!
## --- Cover protocol type (its structural subtype) ---
#
# a *Cover* is some type supporting the mixins of the Mapping[T, ... | 44.518738 | 183 | 0.691064 | ## cover.py
import array
import numpy as np
import numpy.typing as npt
import scipy.sparse as sp
from numpy.typing import ArrayLike
from scipy.sparse import csc_matrix, diags
from scipy.sparse.csgraph import minimum_spanning_tree,connected_components
from .distance import *
from .distance import is_dist_like
from .uti... | 0 | 459 | 0 | 13,743 | 0 | 2,481 | 0 | 231 | 468 |
f0a9230c0b486a3ffb8e1dc5c23d06f1d958b8a1 | 1,417 | py | Python | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/versioned-pipeline-ci-samples/mnist-ci-sample/train/mnist.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 6,140 | 2016-05-23T16:09:35.000Z | 2022-03-30T19:00:46.000Z | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/versioned-pipeline-ci-samples/mnist-ci-sample/train/mnist.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/versioned-pipeline-ci-samples/mnist-ci-sample/train/mnist.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 5,110 | 2016-05-27T13:45:18.000Z | 2022-03-31T18:40:42.000Z |
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--storage_bucket', type=str)
args = parser.parse_args()
mnisttrain(args.storage_bucket) | 34.560976 | 93 | 0.632322 | def mnisttrain(storage_bucket:str):
import tensorflow as tf
import json
mnist = tf.keras.datasets.mnist
(x_train,y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train/255.0, x_test/255.0
def create_model():
return tf.keras.models.Sequential([
tf.keras.laye... | 0 | 0 | 0 | 0 | 0 | 1,186 | 0 | 0 | 22 |
b99dee293fb5186715b280f10880c3860abf90d4 | 669 | py | Python | CSIKit/legacy/receiver.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 67 | 2020-03-14T03:32:06.000Z | 2022-03-31T18:51:57.000Z | CSIKit/legacy/receiver.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 25 | 2020-09-23T16:43:58.000Z | 2022-03-30T13:20:16.000Z | CSIKit/legacy/receiver.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 18 | 2020-04-01T09:51:35.000Z | 2022-03-09T12:46:24.000Z | import sys
import netlink
from read_bfee import BeamformReader
from realtime_graph import RealtimeGraph
if __name__ == "__main__":
rxChains = "ABC"
#utils.configure_rx_chains(rxChains)
gType = "default"
if len(sys.argv) == 2:
gType = sys.argv[1]
graph = RealtimeGraph(gType)
sock = ... | 20.90625 | 52 | 0.653214 | import sys
import time
import netlink
import numpy as np
import utils
from read_bfee import BeamformReader
from realtime_graph import RealtimeGraph
if __name__ == "__main__":
rxChains = "ABC"
#utils.configure_rx_chains(rxChains)
gType = "default"
if len(sys.argv) == 2:
gType = sys.argv[1]
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -22 | 66 |
89ffa592791275d03aa24b9f7d75b99b9a140fa2 | 3,712 | py | Python | tests/monkey_patch.py | hz-lschick/mara-google-analytics-downloader | f9cbcc4ee25b026c10b2d6c3be371fad7e13c443 | [
"MIT"
] | null | null | null | tests/monkey_patch.py | hz-lschick/mara-google-analytics-downloader | f9cbcc4ee25b026c10b2d6c3be371fad7e13c443 | [
"MIT"
] | 1 | 2022-01-03T18:53:42.000Z | 2022-01-03T18:53:42.000Z | tests/monkey_patch.py | hz-lschick/mara-google-analytics-downloader | f9cbcc4ee25b026c10b2d6c3be371fad7e13c443 | [
"MIT"
] | 2 | 2021-07-14T18:14:35.000Z | 2022-03-03T14:26:42.000Z | """
Functions for monkey patching functions in other modules. See https://en.wikipedia.org/wiki/Monkey_patch
There are other excellent libraries for this, which unfortunately don't excactly match our use case:
- https://github.com/christophercrouzet/gorilla
- https://github.com/iki/monkeypatch
- https://github.com/thea... | 37.877551 | 119 | 0.708782 | """
Functions for monkey patching functions in other modules. See https://en.wikipedia.org/wiki/Monkey_patch
There are other excellent libraries for this, which unfortunately don't excactly match our use case:
- https://github.com/christophercrouzet/gorilla
- https://github.com/iki/monkeypatch
- https://github.com/thea... | 0 | 0 | 0 | 0 | 0 | 1,632 | 0 | -16 | 99 |
e6315b76f200ec6e1da49a8d9dd4d77018d55244 | 165 | py | Python | PIP/Hands-on Exercise 4/Q25.py | ankitrajbiswal/SEM_5 | db716e242e77149a4091e0e564356ddc724aeff0 | [
"Apache-2.0"
] | 10 | 2021-04-24T11:46:48.000Z | 2022-01-17T05:14:37.000Z | PIP/Hands-on Exercise 4/Q25.py | ankitrajbiswal/SEM_5 | db716e242e77149a4091e0e564356ddc724aeff0 | [
"Apache-2.0"
] | 2 | 2021-06-28T11:51:50.000Z | 2021-11-01T08:21:53.000Z | PIP/Hands-on Exercise 4/Q25.py | ankitrajbiswal/SEM_5 | db716e242e77149a4091e0e564356ddc724aeff0 | [
"Apache-2.0"
] | 16 | 2021-04-24T11:46:58.000Z | 2022-03-02T05:08:19.000Z | t=0
s=0
for i in range(1,500):
t=i
for j in range(1,t):
if(t%j==0):
s=s+j
if s==i:
print(s,end=" ")
s=0
t=0 | 15 | 25 | 0.357576 | t=0
s=0
for i in range(1,500):
t=i
for j in range(1,t):
if(t%j==0):
s=s+j
if s==i:
print(s,end=" ")
s=0
t=0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8b615de584f2c6fed3d13ce88c1b04d52ac16a83 | 817 | py | Python | dictators/dictators_game/migrations/0006_auto_20210720_0047.py | Kool-Kids-Klan/Dictators | c0f44d6933ec8fe128d3b9c8c638ba0e5914f10a | [
"MIT"
] | 2 | 2022-02-19T18:04:23.000Z | 2022-02-19T18:04:25.000Z | dictators/dictators_game/migrations/0006_auto_20210720_0047.py | xbaran4/Dictators | c0f44d6933ec8fe128d3b9c8c638ba0e5914f10a | [
"MIT"
] | 8 | 2021-07-16T07:28:35.000Z | 2021-07-21T07:35:29.000Z | dictators/dictators_game/migrations/0006_auto_20210720_0047.py | Kool-Kids-Klan/Dictators | c0f44d6933ec8fe128d3b9c8c638ba0e5914f10a | [
"MIT"
] | 1 | 2021-08-23T09:27:47.000Z | 2021-08-23T09:27:47.000Z | # Generated by Django 3.1.8 on 2021-07-20 00:47
| 27.233333 | 146 | 0.603427 | # Generated by Django 3.1.8 on 2021-07-20 00:47
import dictators.dictators_game.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dictators_game', '0005_game'),
]
operations = [
migrations.AlterField(
model_name='game',... | 0 | 0 | 0 | 664 | 0 | 0 | 0 | 36 | 68 |
7a02f37952d13a5a8582202115829afc41a6cd5c | 3,895 | py | Python | wagtail_review/wagtail_hooks.py | icanbwell/wagtail-review | 4695f59c9feb94974ceb4a1b03ce8fd836e0ea3e | [
"BSD-3-Clause"
] | 44 | 2018-12-17T16:37:16.000Z | 2022-03-06T15:09:23.000Z | wagtail_review/wagtail_hooks.py | icanbwell/wagtail-review | 4695f59c9feb94974ceb4a1b03ce8fd836e0ea3e | [
"BSD-3-Clause"
] | 33 | 2019-01-07T18:03:14.000Z | 2021-12-15T08:46:57.000Z | wagtail_review/wagtail_hooks.py | icanbwell/wagtail-review | 4695f59c9feb94974ceb4a1b03ce8fd836e0ea3e | [
"BSD-3-Clause"
] | 19 | 2019-01-08T14:08:15.000Z | 2021-10-19T03:16:30.000Z |
import swapper
from wagtail.core import hooks
Review = swapper.load_model('wagtail_review', 'Review')
# Replace 'submit for moderation' action with 'submit for review'
hooks.register('after_create_page', handle_submit_for_review)
hooks.register('after_edit_page', handle_submit_for_review)
| 34.469027 | 107 | 0.715533 | from django.conf.urls import include, url
from django.contrib import messages as django_messages
from django.templatetags.static import static
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
import s... | 0 | 612 | 0 | 810 | 0 | 1,438 | 0 | 310 | 426 |
a84d632a470b0b1bb4fb1a96258c446bdd8ff591 | 10,187 | py | Python | numpy/core/code_generators/genapi.py | efiring/numpy-work | f873f11f3b96ff859debdc91a2c172a6b476f7db | [
"BSD-3-Clause"
] | 1 | 2016-11-11T17:55:13.000Z | 2016-11-11T17:55:13.000Z | numpy/core/code_generators/genapi.py | efiring/numpy-work | f873f11f3b96ff859debdc91a2c172a6b476f7db | [
"BSD-3-Clause"
] | null | null | null | numpy/core/code_generators/genapi.py | efiring/numpy-work | f873f11f3b96ff859debdc91a2c172a6b476f7db | [
"BSD-3-Clause"
] | null | null | null | """
Get API information encoded in C files.
See ``find_function`` for how functions should be formatted, and
``read_order`` for how the order of the functions should be
specified.
"""
import sys, os, re
import md5
import textwrap
from os.path import join
__docformat__ = 'restructuredtext'
# The files under src/ tha... | 32.237342 | 80 | 0.522038 | """
Get API information encoded in C files.
See ``find_function`` for how functions should be formatted, and
``read_order`` for how the order of the functions should be
specified.
"""
import sys, os, re
import md5
import textwrap
from os.path import join
__docformat__ = 'restructuredtext'
# The files under src/ tha... | 0 | 0 | 0 | 1,975 | 0 | 2,304 | 0 | 0 | 230 |