hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ed2d4f3d4617a80c1351020a3c1077973d29df81 | 1,532 | py | Python | subscriptions/services.py | andela-cnnadi/pubsubservices | 7a356e841009a934d1c9ed28b337d808bea90ef0 | [
"MIT"
] | null | null | null | subscriptions/services.py | andela-cnnadi/pubsubservices | 7a356e841009a934d1c9ed28b337d808bea90ef0 | [
"MIT"
] | null | null | null | subscriptions/services.py | andela-cnnadi/pubsubservices | 7a356e841009a934d1c9ed28b337d808bea90ef0 | [
"MIT"
] | null | null | null | import sys
import os
import signal
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from munch import Munch
'''
Signals
munch.subscription.create -> Create a new subscription
munch.subscription.delete -> Deletes an existing subscription
munch.subscription.update -> Updates an existing subscription
m... | 23.212121 | 102 | 0.715405 | import sys
import os
import signal
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from munch import Munch
'''
Signals
munch.subscription.create -> Create a new subscription
munch.subscription.delete -> Deletes an existing subscription
munch.subscription.update -> Updates an existing subscription
m... | 441 | 0 | 44 |
a8ce20aae254436b83b05483a18a8c8abe4dd7b4 | 860 | py | Python | medium/flatten a multilevel doubly linked list/solution.py | ilya-sokolov/leetcode | ad421111d0d7c5ec5245f33552e94a373b6fd426 | [
"MIT"
] | 4 | 2021-06-03T22:19:13.000Z | 2021-10-05T18:14:12.000Z | medium/flatten a multilevel doubly linked list/solution.py | ilya-sokolov/leetcode | ad421111d0d7c5ec5245f33552e94a373b6fd426 | [
"MIT"
] | null | null | null | medium/flatten a multilevel doubly linked list/solution.py | ilya-sokolov/leetcode | ad421111d0d7c5ec5245f33552e94a373b6fd426 | [
"MIT"
] | null | null | null | # Definition for a Node.
from typing import Optional
s = Solution()
print(s.flatten(Node(None, None, None, None)))
| 23.243243 | 52 | 0.50814 | # Definition for a Node.
from typing import Optional
class Node:
def __init__(self, val, prev, next, child):
self.val = val
self.prev = prev
self.next = next
self.child = child
class Solution:
def flatten(self, head: Node) -> Optional[Node]:
if not head:
r... | 659 | -16 | 98 |
74c0dc6cf49c0edf5ec620eb22ccd53ffb69c141 | 4,706 | py | Python | core/Container.py | ImperatorS79/phoenicis-winebuild | 2b3e5f6190be99d0851ccfecddaee9b0113a3b58 | [
"MIT"
] | null | null | null | core/Container.py | ImperatorS79/phoenicis-winebuild | 2b3e5f6190be99d0851ccfecddaee9b0113a3b58 | [
"MIT"
] | null | null | null | core/Container.py | ImperatorS79/phoenicis-winebuild | 2b3e5f6190be99d0851ccfecddaee9b0113a3b58 | [
"MIT"
] | null | null | null | import io
import os
import tarfile
from core.DockerClient import DockerClient
from core.LineBuffer import LineBuffer
from core.TarUtils import make_tarfile
| 34.859259 | 108 | 0.593923 | import io
import os
import tarfile
from core.DockerClient import DockerClient
from core.LineBuffer import LineBuffer
from core.TarUtils import make_tarfile
class Container:
@staticmethod
def from_id(container_id):
container = Container(None)
container.container = container.docker_client.clien... | 4,162 | 363 | 23 |
0b2e0fc476eaba8c61ac424a6107d61a92dd338c | 179 | py | Python | cellpy/utils/live.py | lithium-ion/cellpy | 5345912dbd51a8f546542ef7797a074aac9ba3c7 | [
"MIT"
] | 38 | 2016-08-16T10:54:56.000Z | 2022-03-03T04:43:20.000Z | cellpy/utils/live.py | Ozzstein/cellpy | ee532905741db4cb928303d75426d2a4fa77144a | [
"MIT"
] | 88 | 2016-08-16T13:10:27.000Z | 2022-03-29T10:36:39.000Z | cellpy/utils/live.py | Ozzstein/cellpy | ee532905741db4cb928303d75426d2a4fa77144a | [
"MIT"
] | 13 | 2019-01-02T03:57:52.000Z | 2022-01-19T08:06:49.000Z | """Routines for streaming cell data"""
import os
import warnings
import logging
logging.captureWarnings(True)
if __name__ == "__main__":
warnings.warn("to be implemented")
| 16.272727 | 38 | 0.748603 | """Routines for streaming cell data"""
import os
import warnings
import logging
logging.captureWarnings(True)
if __name__ == "__main__":
warnings.warn("to be implemented")
| 0 | 0 | 0 |
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 |
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 |
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 |
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 |
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.... | 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.... | 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
from robohat_mpu9250.mpu9250 import MPU9250 as RM9250
from robohat_mpu9250.mpu6500 import MPU6500 as RM6500
from robohat_mpu9250.ak8963 import AK8963 as RM8963
###... | 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 |
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']
from pathlib import Path
from typing import Optional
from error import *
from file_structure import *
from ..find_build_dir import *
| 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(... | 273 | 0 | 23 |
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 | import os
from util.YamlConfig import YamlConfig
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()
| 178 | 0 | 23 |
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
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... | 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 | 19 | 27 |
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
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
| 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 = ... | 3,955 | 387 | 23 |
dd591f3f36c7bbcb3c62ea38f67a4f62280c60ac | 1,575 | py | Python | tests/test_measures.py | onlyrico/contextualized-topic-models | ac338eab6601cd34475d490ae8072fecb73bb0c2 | [
"MIT"
] | 814 | 2020-04-04T20:50:52.000Z | 2022-03-31T17:19:20.000Z | tests/test_measures.py | onlyrico/contextualized-topic-models | ac338eab6601cd34475d490ae8072fecb73bb0c2 | [
"MIT"
] | 82 | 2020-04-23T09:10:57.000Z | 2022-03-12T17:05:41.000Z | tests/test_measures.py | onlyrico/contextualized-topic-models | ac338eab6601cd34475d490ae8072fecb73bb0c2 | [
"MIT"
] | 103 | 2020-04-17T18:20:08.000Z | 2022-03-23T10:44:51.000Z | import pytest
import os
from contextualized_topic_models.models.ctm import ZeroShotTM
from contextualized_topic_models.evaluation.measures import CoherenceNPMI, CoherenceCV, InvertedRBO, TopicDiversity
from contextualized_topic_models.utils.data_preparation import TopicModelDataPreparation
@pytest.fixture
@pytest.f... | 29.716981 | 115 | 0.726984 | import pytest
import os
from contextualized_topic_models.models.ctm import ZeroShotTM
from contextualized_topic_models.evaluation.measures import CoherenceNPMI, CoherenceCV, InvertedRBO, TopicDiversity
from contextualized_topic_models.utils.data_preparation import TopicModelDataPreparation
@pytest.fixture
def root_d... | 1,118 | 0 | 112 |
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 |
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
#--------------------------------
import numpy as np
import cv2
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... | 2,133 | 0 | 25 |
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... | 1,031 | 34 | 100 |
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... | 123 | -8 | 104 |
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... | 412 | 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 | 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... | 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... | 26,408 | 3,035 | 67 |
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,... | 487 | 2 | 80 |
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... | 479 | -8 | 138 |
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
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... | 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... | 2,384 | 0 | 108 |
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 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... | 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 |
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... | 0 | 0 | 0 |
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 |
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 |
90c22e182ae5f014ed43715a9557d0fce4a15d14 | 2,300 | py | Python | cmdline.py | pmosakowski/vm-scripts | 0d40e31ad5f1e0ffa4fac341e768bf4494601950 | [
"MIT"
] | null | null | null | cmdline.py | pmosakowski/vm-scripts | 0d40e31ad5f1e0ffa4fac341e768bf4494601950 | [
"MIT"
] | null | null | null | cmdline.py | pmosakowski/vm-scripts | 0d40e31ad5f1e0ffa4fac341e768bf4494601950 | [
"MIT"
] | null | null | null | import argparse, logging
| 38.333333 | 103 | 0.648261 | import argparse, logging
class ParseLoglevel(argparse.Action):
def __init__(self, option_strings, dest, nargs=None, **kwargs):
if nargs is not None:
raise ValueError("nargs not allowed")
# 'choices' dictionary provided as argument to add_argument()
# is used both in validation o... | 1,793 | 436 | 46 |
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 | 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.
# Some quick benchmarks show that [:] is the fastest way to get a
# shallow copy of a list.
# This is kind of a wart -... | 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... | 1,421 | 19 | 170 |
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')
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 ... | 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 ... | 2,335 | 0 | 539 |
7cbf33725eb3a219ee21682fe1f4739cf756b5fe | 2,552 | py | Python | src/olympia/reviews/feeds.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/reviews/feeds.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/reviews/feeds.py | Osmose/olympia | 774c3b927ec05ef971e4206e2669b4291b8b4f17 | [
"BSD-3-Clause"
] | null | null | null | import urllib
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext
from olympia.amo.templatetags import jinja_helpers
from olympia.amo.feeds import NonAtomicFeed
from olympia.addons.models import Addon, Review
| 35.444444 | 76 | 0.639107 | import urllib
from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext
from olympia.amo.templatetags import jinja_helpers
from olympia.amo.feeds import NonAtomicFeed
from olympia.addons.models import Addon, Review
class ReviewsRss(NonAtomicFeed):
addon = None
def get_ob... | 0 | 2,276 | 23 |
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 |
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 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... | 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... | 2,154 | 34 | 99 |
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
... | 332 | 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 datetime
import io
import math
import os.path
import subprocess
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... | 1,804 | -10 | 103 |
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
import frappe
from frappe.utils import nowdate,flt
import unittest
| 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... | 1,701 | 22 | 142 |
25c5b907407b68326a12418f2e7d3de08f77f0db | 21,942 | py | Python | src/apodeixi/xli/interval.py | ChateauClaudia-Labs/apodeixi | dd668e210e92cabc2682ad3049781c06e58e3101 | [
"MIT"
] | null | null | null | src/apodeixi/xli/interval.py | ChateauClaudia-Labs/apodeixi | dd668e210e92cabc2682ad3049781c06e58e3101 | [
"MIT"
] | null | null | null | src/apodeixi/xli/interval.py | ChateauClaudia-Labs/apodeixi | dd668e210e92cabc2682ad3049781c06e58e3101 | [
"MIT"
] | null | null | null |
from nltk.tokenize import SExprTokenizer
from apodeixi.util.a6i_error import ApodeixiError
from apodeixi.util.dataframe_utils import DataFrameUtils
from apodeixi.util.formatting_utils import ListUtils, StringUtils
class IntervalSpec():
'''... | 54.58209 | 136 | 0.553733 |
from nltk.tokenize import SExprTokenizer
from apodeixi.util.a6i_error import ApodeixiError
from apodeixi.util.dataframe_utils import DataFrameUtils
from apodeixi.util.formatting_utils import ListUtils, StringUtils
class IntervalUtils():
de... | 2,163 | 2,948 | 221 |
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... | 7,288 | 2,159 | 23 |
b3f676793a54feb39e1c2ccca9e61f6a2778ebf5 | 713 | py | Python | lucid_torch/objectives/channel/DirectionChannelObjective.py | HealthML/lucid-torch | 627700a83b5b2690cd8f95010b5ed439204102f4 | [
"MIT"
] | 1 | 2021-08-20T07:38:09.000Z | 2021-08-20T07:38:09.000Z | lucid_torch/objectives/channel/DirectionChannelObjective.py | HealthML/lucid-torch | 627700a83b5b2690cd8f95010b5ed439204102f4 | [
"MIT"
] | 5 | 2021-03-19T15:50:42.000Z | 2022-03-12T00:53:17.000Z | lucid_torch/objectives/channel/DirectionChannelObjective.py | HealthML/lucid-torch | 627700a83b5b2690cd8f95010b5ed439204102f4 | [
"MIT"
] | null | null | null | import torch
from ..Objective import Objective
| 32.409091 | 65 | 0.652174 | import torch
from ..Objective import Objective
class DirectionChannelObjective(Objective):
def __init__(self, get_layer, direction):
super().__init__(get_layer)
self.direction = torch.tensor(
direction, dtype=torch.float32).view(1, -1)
def _hook(self, module, input, output):
... | 539 | 22 | 103 |
0b76545c15a5b2ea28c8581071d3eb1de7fb4c90 | 7,256 | py | Python | nehushtan/mail/IMAPAgent.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | null | null | null | nehushtan/mail/IMAPAgent.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | 1 | 2020-11-20T03:10:23.000Z | 2020-11-20T09:30:34.000Z | nehushtan/mail/IMAPAgent.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | 1 | 2021-10-13T10:16:58.000Z | 2021-10-13T10:16:58.000Z | import imaplib
import re
import warnings
from typing import Iterable, List
from nehushtan.logger.NehushtanFileLogger import NehushtanFileLogger
from nehushtan.logger.NehushtanLogging import NehushtanLogging
from nehushtan.mail.rfc3501.SearchCommandKit import SearchCommandKit
from nehushtan.mail.rfc822.NehushtanEmailMe... | 35.743842 | 108 | 0.616869 | import imaplib
import re
import warnings
from typing import Iterable, List
from nehushtan.logger.NehushtanFileLogger import NehushtanFileLogger
from nehushtan.logger.NehushtanLogging import NehushtanLogging
from nehushtan.mail.rfc3501.SearchCommandKit import SearchCommandKit
from nehushtan.mail.rfc822.NehushtanEmailMe... | 2,470 | 0 | 162 |
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 |
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 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... | 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... | 2,145 | 940 | 22 |
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 | 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... | 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... | 20,143 | 0 | 655 |
7732dbc62b70ab193dd88a38074d6049592630e1 | 1,052 | py | Python | tests/utils_tests/test_deprecation.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/utils_tests/test_deprecation.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/utils_tests/test_deprecation.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | from django.test import SimpleTestCase
from django.utils.deprecation import CallableFalse, CallableTrue
| 37.571429 | 64 | 0.705323 | from django.test import SimpleTestCase
from django.utils.deprecation import CallableFalse, CallableTrue
class TestCallableBool(SimpleTestCase):
def test_true(self):
self.assertTrue(CallableTrue)
self.assertEqual(CallableTrue, True)
self.assertFalse(CallableTrue != True) # noqa: E712
... | 826 | 18 | 103 |
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 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 ... | 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 ... | 766 | 0 | 23 |
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 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:
... | 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 |
c3ce0b1ade5bf92796ad4641195d0ebb79d5a0e4 | 1,210 | py | Python | parallel.py | SamanKhamesian/Hybrid-Self-Attention-NEAT | 9064e9e5c5fbbbc961980b53064b9fb3ae321288 | [
"Apache-2.0"
] | 5 | 2021-12-15T19:29:18.000Z | 2022-02-13T23:13:44.000Z | parallel.py | SamanKhamesian/Hybrid-Self-Attention-NEAT | 9064e9e5c5fbbbc961980b53064b9fb3ae321288 | [
"Apache-2.0"
] | 1 | 2022-03-06T13:40:30.000Z | 2022-03-06T13:40:30.000Z | parallel.py | SamanKhamesian/Hybrid-Self-Attention-NEAT | 9064e9e5c5fbbbc961980b53064b9fb3ae321288 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import neat.parallel
| 32.702703 | 107 | 0.678512 | import numpy as np
import neat.parallel
class ParallelEvaluator(neat.parallel.ParallelEvaluator):
def __init__(self, num_workers, cmaes, eval_function, timeout=None):
super().__init__(num_workers, eval_function, timeout)
self.cmaes = cmaes
def __del__(self):
self.pool.close()
... | 1,002 | 36 | 130 |
7c93f25bc1536b391491fdf37f4c4988bc539dff | 257 | py | Python | tests/utils.py | bassory99/aiobaro | fbb8fef4f40a66b72e28436a93aaff3cf50f1ece | [
"MIT"
] | null | null | null | tests/utils.py | bassory99/aiobaro | fbb8fef4f40a66b72e28436a93aaff3cf50f1ece | [
"MIT"
] | 22 | 2021-03-13T22:10:42.000Z | 2021-03-17T10:33:25.000Z | tests/utils.py | bassory99/aiobaro | fbb8fef4f40a66b72e28436a93aaff3cf50f1ece | [
"MIT"
] | 2 | 2021-03-13T14:56:40.000Z | 2021-03-14T15:10:30.000Z | import httpx
| 19.769231 | 49 | 0.661479 | import httpx
def is_responsive(url):
try:
response: httpx.Response = httpx.get(url)
response.raise_for_status()
except httpx.RequestError:
return False
except httpx.HTTPStatusError:
return False
return True
| 220 | 0 | 23 |
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 |
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 |
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 |
89e6cd7ae91131db466757761efa7d854f285ccc | 21,017 | py | Python | MVMOO/multi_mixed_optimiser.py | jmanson377/MVMOO | 0e3d5ca5c1a9dd0fb9ff949e8e0d0448ae78a535 | [
"Apache-2.0"
] | 5 | 2021-07-10T10:22:14.000Z | 2022-03-28T05:16:21.000Z | MVMOO/multi_mixed_optimiser.py | jmanson377/MVMOO | 0e3d5ca5c1a9dd0fb9ff949e8e0d0448ae78a535 | [
"Apache-2.0"
] | 2 | 2021-01-19T15:28:32.000Z | 2021-08-16T14:21:47.000Z | MVMOO/multi_mixed_optimiser.py | jmanson377/MVMOO | 0e3d5ca5c1a9dd0fb9ff949e8e0d0448ae78a535 | [
"Apache-2.0"
] | 1 | 2022-03-28T05:16:25.000Z | 2022-03-28T05:16:25.000Z | import numpy as np
from scipy.stats import norm
from .mixed_optimiser import MVO
from scipy.optimize import shgo, differential_evolution, dual_annealing
import scipy as stats
class MVMOO(MVO):
"""
Multi variate mixed variable optimisation
"""
def __init__(self, input_dim=1, num_qual=0, num_obj=2, bound... | 37.664875 | 190 | 0.538136 | import numpy as np
from scipy.stats import norm
from .mixed_optimiser import MVO
from scipy.optimize import shgo, differential_evolution, dual_annealing
import scipy as stats
class MVMOO(MVO):
"""
Multi variate mixed variable optimisation
"""
def __init__(self, input_dim=1, num_qual=0, num_obj=2, bound... | 5,018 | 0 | 91 |
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 |
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.
import os
from jinja2 import Environment, FileSystemLoader
| 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... | 287 | 0 | 23 |
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.gitHubApiRequest import performRequest
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/cr... | 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... | 2,168 | 0 | 46 |
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
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 detect_clause(parser, clause_name, tokens):
""... | 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 = ... | 1,405 | 28 | 99 |
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... | 22,426 | 0 | 202 |
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... | 4,209 | 0 | 317 |
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)
)
import apiai
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):
... | 257 | 0 | 23 |
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 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... | 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... | 1,361 | 24 | 77 |
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 |
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
import time
if __name__ == '__main__':
try:
rc = main()
except Exception as e:
print(e)
... | 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... | 210 | 0 | 23 |
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... | 98 | 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 |
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 | 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()
| 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... | 346 | 0 | 22 |
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
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__)
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... | 2,372 | 0 | 69 |
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 |
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... | 1,508 | 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, 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__)
@app.route('/')
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... | 1,866 | 0 | 45 |
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 |
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, 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... | 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... | 3,880 | 0 | 194 |
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
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... | 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... | 1,125 | 9 | 76 |
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))
| 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
from django.db import migrations, models
| 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 | 314 | 23 |
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 | 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... | 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... | 4,386 | 551 | 69 |
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:
... | 130 | 312 | 25 |
c9552dba3d87ef7cddc922a772598c99fa707970 | 134 | py | Python | scratch/abstract.py | aaron-christopher-jones/scratch | 48a7351073eee98f4b9e760c9907af9130b052cb | [
"MIT"
] | null | null | null | scratch/abstract.py | aaron-christopher-jones/scratch | 48a7351073eee98f4b9e760c9907af9130b052cb | [
"MIT"
] | null | null | null | scratch/abstract.py | aaron-christopher-jones/scratch | 48a7351073eee98f4b9e760c9907af9130b052cb | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
| 13.4 | 35 | 0.619403 | from abc import ABC, abstractmethod
class AbstractModel(ABC):
def fit(self):
pass
def predict(self):
pass
| 16 | 4 | 78 |
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 numpy, 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_r... | 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) ... | 674 | 0 | 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, Generic, Optional, Dict, Any
from abc import abstractmethod
from dataclasses import dataclass
T = TypeVar("T")
@dataclass
| 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... | 100 | 226 | 45 |
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 |
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 |
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 |
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 |
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 |
d6e8ca2d20de85ea380a61ed6157a999b5e2ca82 | 970 | py | Python | tottle/types/objects/passport.py | muffleo/tottle | 69a5bdda879ab56d43505d517d3369a687c135a2 | [
"MIT"
] | 12 | 2020-09-06T15:31:34.000Z | 2021-02-27T20:30:34.000Z | tottle/types/objects/passport.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 2 | 2021-04-13T06:43:42.000Z | 2021-07-07T20:52:39.000Z | tottle/types/objects/passport.py | cyanlabs-org/tottle | 6cf02022ed7b445c9b5af475c6e854b91780d792 | [
"MIT"
] | 4 | 2020-09-12T03:09:25.000Z | 2021-03-22T08:52:04.000Z | from typing import Optional, List
from pydantic import BaseModel
| 25.526316 | 57 | 0.717526 | from typing import Optional, List
from pydantic import BaseModel
class PassportFile(BaseModel):
file_id: Optional[str] = None
file_unique_id: Optional[str] = None
file_size: Optional[int] = None
file_date: Optional[int] = None
class EncryptedPassportElement(BaseModel):
type: Optional[str] = No... | 0 | 808 | 92 |
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 |
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
import pandas as pd
import PySimpleGUI as sg
import re
from re import search
from datetime import datetime
from fpdf import FPDF
def _db_connection():
'''
Connects to the .db file
... | 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... | 4,302 | 0 | 115 |
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 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... | 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 |
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 |
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, 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... | 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... | 3,606 | 9 | 265 |
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 |
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 |
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 | from mercury import *
b64_cert = 'MIIJRDCCCCygAwIBAgIRAO7eZWDNNcCvAgAAAABZcbcwDQYJKoZIhvcNAQELBQAwQjELMAkGA1UEBhMCVVMxHjAcBgNVBAoTFUdvb2dsZSBUcnVzdCBTZXJ2aWNlczETMBEGA1UEAxMKR1RTIENBIDFPMTAeFw0yMDAyMTIxMTQ3MTFaFw0yMDA1MDYxMTQ3MTFaMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRMwEQYDV... | 462.545455 | 4,837 | 0.983097 | from mercury import *
b64_cert = 'MIIJRDCCCCygAwIBAgIRAO7eZWDNNcCvAgAAAABZcbcwDQYJKoZIhvcNAQELBQAwQjELMAkGA1UEBhMCVVMxHjAcBgNVBAoTFUdvb2dsZSBUcnVzdCBTZXJ2aWNlczETMBEGA1UEAxMKR1RTIENBIDFPMTAeFw0yMDAyMTIxMTQ3MTFaFw0yMDA1MDYxMTQ3MTFaMGYxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRMwEQYDV... | 0 | 0 | 0 |
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
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... | 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... | 12,941 | 0 | 188 |
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, 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... | 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... | 1,403 | 11 | 144 |
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 |
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 |
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 | from random import *
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... | 224 | 0 | 44 |
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
... | 1,188 | 0 | 48 |