hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0c1d98b1fc02980a8697c6f79f109e50861d91 | 336 | py | Python | AOJ/algo_intro/topic1/Insertion_Sort.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | AOJ/algo_intro/topic1/Insertion_Sort.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | AOJ/algo_intro/topic1/Insertion_Sort.py | Nishi05/Competitive-programming | e59a6755b706d9d5c1f359f4511d92c114e6a94e | [
"MIT"
] | null | null | null | # 挿入ソート
n = int(input())
n_lst = list(map(int, input().split()))
s_lst = [str(i) for i in n_lst]
print(' '.join(s_lst))
for i in range(1, n):
v = n_lst[i]
j = i - 1
while j >= 0 and n_lst[j] > v:
n_lst[j+1] = n_lst[j]
j -= 1
n_lst[j+1] = v
s_lst = [str(i) for i in n_lst]
print('... | 21 | 39 | 0.505952 | n = int(input())
n_lst = list(map(int, input().split()))
s_lst = [str(i) for i in n_lst]
print(' '.join(s_lst))
for i in range(1, n):
v = n_lst[i]
j = i - 1
while j >= 0 and n_lst[j] > v:
n_lst[j+1] = n_lst[j]
j -= 1
n_lst[j+1] = v
s_lst = [str(i) for i in n_lst]
print(' '.join(... | true | true |
1c0c1e57022aa05e43ed172f06486735a85b4727 | 436 | py | Python | meiduo_mall/meiduo_mall/apps/goods/urls.py | aGrass0825/meiduo_project | 78c560c1e9a3205d4958ddbe798cd0ab2be41830 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/goods/urls.py | aGrass0825/meiduo_project | 78c560c1e9a3205d4958ddbe798cd0ab2be41830 | [
"MIT"
] | null | null | null | meiduo_mall/meiduo_mall/apps/goods/urls.py | aGrass0825/meiduo_project | 78c560c1e9a3205d4958ddbe798cd0ab2be41830 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'list/(?P<category_id>\d+)/(?P<page_num>\d+)/$', views.ListView.as_view(), name='list'),
url(r'^hot/(?P<category_id>\d+)/$', views.HotGoodsView.as_view()),
# 提供商品详情界面
url(r'^detail/(?P<sku_id>\d+)/$', views.DetailView.as_view(), ... | 36.333333 | 97 | 0.635321 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'list/(?P<category_id>\d+)/(?P<page_num>\d+)/$', views.ListView.as_view(), name='list'),
url(r'^hot/(?P<category_id>\d+)/$', views.HotGoodsView.as_view()),
url(r'^detail/(?P<sku_id>\d+)/$', views.DetailView.as_view(), name='detai... | true | true |
1c0c1ef17de95da0cca0f5f6c7d6c8340e2dd1f9 | 3,159 | py | Python | lyapunov.py | xiangyu-xing/pychaotic | 4bbe67d0da1d75e6c219115aae37496bf365a59a | [
"Apache-2.0"
] | 2 | 2020-06-19T13:59:40.000Z | 2021-02-04T11:39:00.000Z | lyapunov.py | xiangyu-xing/pychaotic | 4bbe67d0da1d75e6c219115aae37496bf365a59a | [
"Apache-2.0"
] | null | null | null | lyapunov.py | xiangyu-xing/pychaotic | 4bbe67d0da1d75e6c219115aae37496bf365a59a | [
"Apache-2.0"
] | 1 | 2020-12-13T09:52:47.000Z | 2020-12-13T09:52:47.000Z | from typing import NoReturn
import numpy
import math
from scipy.integrate import odeint
from scipy.linalg import solve_lyapunov
def lyapunov(n, rhs_ext_fcn, fcn_integrator, tstart, stept, tend, ystart):
"""
fcn_integrator: callable
"""
n1 = n
n2 = n1*(n1+1)
# number of steps
nit = round((t... | 27.469565 | 75 | 0.474834 | from typing import NoReturn
import numpy
import math
from scipy.integrate import odeint
from scipy.linalg import solve_lyapunov
def lyapunov(n, rhs_ext_fcn, fcn_integrator, tstart, stept, tend, ystart):
n1 = n
n2 = n1*(n1+1)
nit = round((tend - tstart) / stept)
y = numpy.zeros(n2)
cum = nu... | true | true |
1c0c1f0d902c68996cbccaab3e2b28199ba82e39 | 18,699 | py | Python | src/transformers/models/wavlm/configuration_wavlm.py | enze5088/transformers | 2428030c945ee0349b95394b1640d5eff88e93c7 | [
"Apache-2.0"
] | 1 | 2022-02-26T04:55:26.000Z | 2022-02-26T04:55:26.000Z | src/transformers/models/wavlm/configuration_wavlm.py | enze5088/transformers | 2428030c945ee0349b95394b1640d5eff88e93c7 | [
"Apache-2.0"
] | null | null | null | src/transformers/models/wavlm/configuration_wavlm.py | enze5088/transformers | 2428030c945ee0349b95394b1640d5eff88e93c7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Fairseq Authors, Microsoft Research, and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... | 55.159292 | 120 | 0.683726 |
import math
from ...configuration_utils import PretrainedConfig
from ...utils import logging
logger = logging.get_logger(__name__)
WAVLM_PRETRAINED_CONFIG_ARCHIVE_MAP = {
"facebook/wavlm-base-960h": "https://huggingface.co/facebook/wavlm-base-960h/resolve/main/config.json",
}
class WavLMConfig(Pretrained... | true | true |
1c0c1f5be99fdd79645f63713fbcad7afb8ddda3 | 8,359 | py | Python | test/functional/proxy_test.py | wkibbler/nyc3 | cf4ffcbd4c1561d7a21c2f30cad94a0f783d74b5 | [
"MIT"
] | null | null | null | test/functional/proxy_test.py | wkibbler/nyc3 | cf4ffcbd4c1561d7a21c2f30cad94a0f783d74b5 | [
"MIT"
] | null | null | null | test/functional/proxy_test.py | wkibbler/nyc3 | cf4ffcbd4c1561d7a21c2f30cad94a0f783d74b5 | [
"MIT"
] | 1 | 2019-07-21T20:59:27.000Z | 2019-07-21T20:59:27.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Nyc3 Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test nyc3d with different proxy configuration.
Test plan... | 41.17734 | 119 | 0.624118 |
import socket
import os
from test_framework.socks5 import Socks5Configuration, Socks5Command, Socks5Server, AddressType
from test_framework.test_framework import Nyc3TestFramework
from test_framework.util import (
PORT_MIN,
PORT_RANGE,
assert_equal,
)
from test_framework.netutil import test_ipv6_local
RA... | true | true |
1c0c20638391194ddcb8f7cde21ba93fa43b4f34 | 16,403 | py | Python | model.py | tamnguyenvan/small_object_detection | 526ba8be016dd4781ce45c43848f0dac3924a0ee | [
"Apache-2.0"
] | null | null | null | model.py | tamnguyenvan/small_object_detection | 526ba8be016dd4781ce45c43848f0dac3924a0ee | [
"Apache-2.0"
] | null | null | null | model.py | tamnguyenvan/small_object_detection | 526ba8be016dd4781ce45c43848f0dac3924a0ee | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
import math
from utils import convert_to_corners, compute_iou
from data_processing import resize_and_pad_image
from tensorflow import keras
def get_backbone(name="resnet50", weight=None):
"""Supported backbone: resnet50, resnet101, densenet121"""
backbone = None
... | 40.601485 | 108 | 0.639883 | import tensorflow as tf
import numpy as np
import math
from utils import convert_to_corners, compute_iou
from data_processing import resize_and_pad_image
from tensorflow import keras
def get_backbone(name="resnet50", weight=None):
backbone = None
if "resnet" in name:
if name == "resnet50":
... | true | true |
1c0c207c044218b9569d8f916c0600508834432b | 12,226 | py | Python | footmark/rds/rds.py | konstantin-kornienko/footmark | 0421bfb30d94f252a56c5d80a8696d37331b60b9 | [
"Apache-2.0"
] | 18 | 2017-04-29T10:11:41.000Z | 2021-11-18T03:44:22.000Z | footmark/rds/rds.py | KvistA-ELS/footmark | 487a864fc756d03b237ae46b23b67cc68ca72527 | [
"Apache-2.0"
] | 25 | 2017-06-01T09:35:57.000Z | 2021-06-24T08:09:26.000Z | footmark/rds/rds.py | KvistA-ELS/footmark | 487a864fc756d03b237ae46b23b67cc68ca72527 | [
"Apache-2.0"
] | 47 | 2017-05-05T08:02:59.000Z | 2021-07-05T12:44:56.000Z | from footmark.rds.rdsobject import TaggedRDSObject
class DbInstance(TaggedRDSObject):
def __init__(self, connection=None):
super(DbInstance, self).__init__(connection)
def __repr__(self):
return 'DbInstance:%s' % self.id
def __getattr__(self, name):
if name == 'id':
r... | 36.386905 | 281 | 0.609439 | from footmark.rds.rdsobject import TaggedRDSObject
class DbInstance(TaggedRDSObject):
def __init__(self, connection=None):
super(DbInstance, self).__init__(connection)
def __repr__(self):
return 'DbInstance:%s' % self.id
def __getattr__(self, name):
if name == 'id':
r... | true | true |
1c0c222152a4804e554d68f616ff44c3a16294fd | 1,090 | py | Python | ginga/qtw/Viewers.py | kyraikeda/ginga | e0ce979de4a87e12ba7a90eec0517a0be05d14bc | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 76 | 2015-01-05T14:46:14.000Z | 2022-03-23T04:10:54.000Z | ginga/qtw/Viewers.py | kyraikeda/ginga | e0ce979de4a87e12ba7a90eec0517a0be05d14bc | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 858 | 2015-01-17T01:55:12.000Z | 2022-03-08T20:20:31.000Z | ginga/qtw/Viewers.py | kyraikeda/ginga | e0ce979de4a87e12ba7a90eec0517a0be05d14bc | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 60 | 2015-01-14T21:59:07.000Z | 2022-02-13T03:38:49.000Z | from ginga.qtw.ImageViewQt import CanvasView, ScrolledView
from ginga.qtw.ImageViewCanvasQt import ImageViewCanvas # noqa
from ginga.qtw import Widgets
class GingaViewerWidget(Widgets.WidgetBase):
def __init__(self, viewer=None, width=600, height=600):
super(GingaViewerWidget, self).__init__()
... | 27.948718 | 63 | 0.672477 | from ginga.qtw.ImageViewQt import CanvasView, ScrolledView
from ginga.qtw.ImageViewCanvasQt import ImageViewCanvas from ginga.qtw import Widgets
class GingaViewerWidget(Widgets.WidgetBase):
def __init__(self, viewer=None, width=600, height=600):
super(GingaViewerWidget, self).__init__()
if view... | true | true |
1c0c2228856d3ac8fe7989a0c68c25018d4c5f92 | 16,738 | py | Python | var/spack/repos/builtin/packages/py-numpy/package.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-12-28T14:38:41.000Z | 2020-12-28T14:38:41.000Z | var/spack/repos/builtin/packages/py-numpy/package.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | var/spack/repos/builtin/packages/py-numpy/package.py | klevzoff/spack | 396936d24173254ecf4148bc460702185e4c99e5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import platform
import subprocess
class PyNumpy(PythonPackage):
"""NumPy is the fundamental pack... | 52.470219 | 96 | 0.656769 |
from spack import *
import platform
import subprocess
class PyNumpy(PythonPackage):
homepage = "https://numpy.org/"
pypi = "numpy/numpy-1.19.4.zip"
git = "https://github.com/numpy/numpy.git"
maintainers = ['adamjstewart']
version('master', branch='master')
version('1.20.1', sha256='3b... | true | true |
1c0c23f396ce1004c6fe95413b26913dbeac711a | 2,054 | py | Python | conf/test_settings.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 19 | 2018-09-04T14:49:01.000Z | 2020-06-09T22:13:10.000Z | conf/test_settings.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 50 | 2018-09-18T17:28:57.000Z | 2021-01-09T16:18:45.000Z | conf/test_settings.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 4 | 2019-12-15T13:44:18.000Z | 2021-06-09T20:39:54.000Z | from cryptography.hazmat.primitives.asymmetric import rsa
from django_redis.pool import ConnectionFactory
from moto.iam.models import ACCOUNT_ID
from conf import *
ENVIRONMENT = 'TEST'
INFLUXDB_DISABLED = True
# Disable auth for unit tests
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = []
REST_FRAMEWORK['DEFAULT... | 34.233333 | 117 | 0.763875 | from cryptography.hazmat.primitives.asymmetric import rsa
from django_redis.pool import ConnectionFactory
from moto.iam.models import ACCOUNT_ID
from conf import *
ENVIRONMENT = 'TEST'
INFLUXDB_DISABLED = True
REST_FRAMEWORK['DEFAULT_AUTHENTICATION_CLASSES'] = []
REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES'] = []
EN... | true | true |
1c0c2562a177c856251a6218e566f76fb370e086 | 2,024 | py | Python | config/settings/test.py | LIMCHULWAN/instagram | 7ab44decb20424a51f88424cad4d39eb8b2a5f4a | [
"MIT"
] | null | null | null | config/settings/test.py | LIMCHULWAN/instagram | 7ab44decb20424a51f88424cad4d39eb8b2a5f4a | [
"MIT"
] | 12 | 2020-06-05T20:04:54.000Z | 2022-02-26T11:17:43.000Z | config/settings/test.py | LIMCHULWAN/instagram | 7ab44decb20424a51f88424cad4d39eb8b2a5f4a | [
"MIT"
] | null | null | null | """
With these settings, tests run faster.
"""
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = False
# https://docs.djangoproject.com/en/dev/ref/settings/#se... | 36.142857 | 113 | 0.546443 |
from .base import * from .base import env
DEBUG = False
SECRET_KEY = env("DJANGO_SECRET_KEY", default="tUyGnApkqFmIIuJJ9hWnxVg6CTkQQbLtEck22ZsZVbRGZzJjozpoYRqQunzSPMpT")
TEST_RUNNER = "django.test.runner.DiscoverRunner"
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache", ... | true | true |
1c0c25dc344eec89b769290ad46a95dd37e8dac6 | 610 | py | Python | python/crab/Moriond17/TTJets_PowhegPythia8_mtop1695.py | EmyrClement/NTupleProduction | 4c1b67ac8826656e804912512f4c4dc6695c7674 | [
"Apache-2.0"
] | 1 | 2018-02-20T21:23:21.000Z | 2018-02-20T21:23:21.000Z | python/crab/Moriond17/TTJets_PowhegPythia8_mtop1695.py | RickeyEstes/NTupleProduction | 1319183de0ce00749c8f5841fa925479b9024b48 | [
"Apache-2.0"
] | 116 | 2015-01-09T22:38:07.000Z | 2017-05-24T08:12:48.000Z | python/crab/Moriond17/TTJets_PowhegPythia8_mtop1695.py | RickeyEstes/NTupleProduction | 1319183de0ce00749c8f5841fa925479b9024b48 | [
"Apache-2.0"
] | 1 | 2020-11-01T00:01:17.000Z | 2020-11-01T00:01:17.000Z | import crab.base
from copy import deepcopy
NAME = __file__.split('/')[-1].replace('.pyc', '')
NAME = NAME.split('/')[-1].replace('.py', '')
CAMPAIGN = __file__.split('/')[-2]
config = deepcopy(crab.base.config)
config.General.requestName = NAME
config.Data.outputDatasetTag = NAME
config.Data.outLFNDirBase += '/' + CAM... | 38.125 | 173 | 0.768852 | import crab.base
from copy import deepcopy
NAME = __file__.split('/')[-1].replace('.pyc', '')
NAME = NAME.split('/')[-1].replace('.py', '')
CAMPAIGN = __file__.split('/')[-2]
config = deepcopy(crab.base.config)
config.General.requestName = NAME
config.Data.outputDatasetTag = NAME
config.Data.outLFNDirBase += '/' + CAM... | true | true |
1c0c26cec34232bac1ca2d4852a9d1dccf2ea198 | 8,955 | py | Python | monai/deploy/operators/dicom_data_loader_operator.py | gigony/test_readthedocs | e8c820ecda15aa59b50c1fe7674cbef00e24553d | [
"Apache-2.0"
] | null | null | null | monai/deploy/operators/dicom_data_loader_operator.py | gigony/test_readthedocs | e8c820ecda15aa59b50c1fe7674cbef00e24553d | [
"Apache-2.0"
] | null | null | null | monai/deploy/operators/dicom_data_loader_operator.py | gigony/test_readthedocs | e8c820ecda15aa59b50c1fe7674cbef00e24553d | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | 35.82 | 124 | 0.634506 |
import os
from typing import List
from monai.deploy.core import (
DataPath,
ExecutionContext,
InputContext,
IOType,
Operator,
OutputContext,
env,
input,
output,
)
from monai.deploy.core.domain.dicom_series import DICOMSeries
from monai.deploy.core.domain.dicom_study import DICOMStu... | true | true |
1c0c281bdd72daa6b83dbccd330d2e1ea51b2f1f | 4,898 | py | Python | src/metanetx_sdk/ftp.py | Midnighter/metanetx-sdk | 22d626bce95364f8e9a5e4f1d3ee912da33dbac5 | [
"Apache-2.0"
] | 3 | 2019-09-16T07:36:37.000Z | 2020-09-02T22:25:44.000Z | src/metanetx_sdk/ftp.py | Midnighter/metanetx-sdk | 22d626bce95364f8e9a5e4f1d3ee912da33dbac5 | [
"Apache-2.0"
] | null | null | null | src/metanetx_sdk/ftp.py | Midnighter/metanetx-sdk | 22d626bce95364f8e9a5e4f1d3ee912da33dbac5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019, Moritz E. Beber.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 31.805195 | 86 | 0.63577 |
import asyncio
import gzip
import logging
from datetime import datetime
from pathlib import Path, PurePosixPath
from typing import List, Union
import aioftp
from pytz import timezone
from .model import PathInfoModel
logger = logging.getLogger(__name__)
async def update_file(
host: str,
ftp_directory: ... | true | true |
1c0c29277d52e48f06be4b15db65b27c8c83113d | 217 | py | Python | common/utils/database/heroku_db_creds.py | Jay206-Programmer/FEASTA_NEW | e32b47c74ec1cb3875bd31c4e6edecbd7094fd8c | [
"MIT"
] | null | null | null | common/utils/database/heroku_db_creds.py | Jay206-Programmer/FEASTA_NEW | e32b47c74ec1cb3875bd31c4e6edecbd7094fd8c | [
"MIT"
] | null | null | null | common/utils/database/heroku_db_creds.py | Jay206-Programmer/FEASTA_NEW | e32b47c74ec1cb3875bd31c4e6edecbd7094fd8c | [
"MIT"
] | null | null | null | # DataBase Credentials
database="da665kfg2oc9og"
user = "aourrzrdjlrpjo"
password = "12359d0fa8d70aeea4d2ef3acd96eb794f178dee42887f7c350ad49a4d78e323"
host = "ec2-18-207-95-219.compute-1.amazonaws.com"
port = "5432" | 36.166667 | 77 | 0.81106 | database="da665kfg2oc9og"
user = "aourrzrdjlrpjo"
password = "12359d0fa8d70aeea4d2ef3acd96eb794f178dee42887f7c350ad49a4d78e323"
host = "ec2-18-207-95-219.compute-1.amazonaws.com"
port = "5432" | true | true |
1c0c29c603b3f2dffb49099c41a24f840b5c5244 | 17,811 | py | Python | log_mito_bcl2/model_468.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_bcl2/model_468.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito_bcl2/model_468.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
M... | 92.284974 | 798 | 0.801022 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', 'Xiap'])
M... | true | true |
1c0c2b4e2666c9ed3df478de2749872522fc42f4 | 1,786 | py | Python | assignment01b.py | makukha/pythoniasa19fall | b6a3f9ab173039478ab813bd7c4f06d8777de0af | [
"MIT"
] | 1 | 2019-12-26T22:28:38.000Z | 2019-12-26T22:28:38.000Z | assignment01b.py | makukha/pythoniasa19fall | b6a3f9ab173039478ab813bd7c4f06d8777de0af | [
"MIT"
] | null | null | null | assignment01b.py | makukha/pythoniasa19fall | b6a3f9ab173039478ab813bd7c4f06d8777de0af | [
"MIT"
] | null | null | null | """
Assignment 1-B (optional)
=========================
This assignment is similar to 1-A except that the poem is in Russian now.
"""
poem = '''
Вот дом, который построил Джек.
А это пшеница,
Которая в тёмном чулане хранится
В доме, который построил Джек.
А это весёлая птица-синица,
Которая часто ворует пшеницу,
К... | 24.135135 | 73 | 0.784994 |
poem = '''
Вот дом, который построил Джек.
А это пшеница,
Которая в тёмном чулане хранится
В доме, который построил Джек.
А это весёлая птица-синица,
Которая часто ворует пшеницу,
Которая в тёмном чулане хранится
В доме, который построил Джек.
Вот кот,
Который пугает и ловит синицу,
Которая часто ворует пшеницу,
Ко... | true | true |
1c0c2bda454c56a43fc385c1a4f6922aa4515c3e | 3,597 | py | Python | src/crate/client/sqlalchemy/predicates/__init__.py | Aymaru/crate-smartnow | cdef8196041993a2ff0fd686a848c05ecdfa409b | [
"Apache-2.0"
] | 50 | 2015-04-06T17:25:33.000Z | 2021-12-25T16:20:15.000Z | src/crate/client/sqlalchemy/predicates/__init__.py | Aymaru/crate-smartnow | cdef8196041993a2ff0fd686a848c05ecdfa409b | [
"Apache-2.0"
] | 163 | 2015-01-14T22:51:42.000Z | 2022-02-20T20:47:52.000Z | src/crate/client/sqlalchemy/predicates/__init__.py | Aymaru/crate-smartnow | cdef8196041993a2ff0fd686a848c05ecdfa409b | [
"Apache-2.0"
] | 35 | 2015-05-03T22:57:25.000Z | 2021-02-22T14:49:05.000Z | # -*- coding: utf-8; -*-
#
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License"... | 36.333333 | 79 | 0.648596 |
from sqlalchemy.sql.expression import ColumnElement, literal
from sqlalchemy.ext.compiler import compiles
class Match(ColumnElement):
def __init__(self, column, term, match_type=None, options=None):
super(Match, self).__init__()
self.column = column
self.term = term
self.match_ty... | true | true |
1c0c2c6079943db764c75a305a8d82e9ca2e4d81 | 9,684 | py | Python | app/request.py | jeromegn/whoogle-search | cf55765933abf19c478a5473288012c54ace9508 | [
"MIT"
] | null | null | null | app/request.py | jeromegn/whoogle-search | cf55765933abf19c478a5473288012c54ace9508 | [
"MIT"
] | null | null | null | app/request.py | jeromegn/whoogle-search | cf55765933abf19c478a5473288012c54ace9508 | [
"MIT"
] | null | null | null | from app.models.config import Config
from datetime import datetime
import xml.etree.ElementTree as ET
import random
import requests
from requests import Response, ConnectionError
import urllib.parse as urlparse
import os
from stem import Signal, SocketError
from stem.control import Controller
SEARCH_URL = 'https://www... | 36 | 79 | 0.59273 | from app.models.config import Config
from datetime import datetime
import xml.etree.ElementTree as ET
import random
import requests
from requests import Response, ConnectionError
import urllib.parse as urlparse
import os
from stem import Signal, SocketError
from stem.control import Controller
SEARCH_URL = 'https://www... | true | true |
1c0c2da1a0b053684244c0c1498789dfdeb883f8 | 2,349 | py | Python | tests/testproject/multidb/tests/test_models.py | dgladkov/tddspry | d604331b87eae0dd01b68a5388298884c998e3ec | [
"BSD-3-Clause"
] | 4 | 2015-03-04T16:35:54.000Z | 2021-01-08T04:17:37.000Z | tests/testproject/multidb/tests/test_models.py | dgladkov/tddspry | d604331b87eae0dd01b68a5388298884c998e3ec | [
"BSD-3-Clause"
] | null | null | null | tests/testproject/multidb/tests/test_models.py | dgladkov/tddspry | d604331b87eae0dd01b68a5388298884c998e3ec | [
"BSD-3-Clause"
] | null | null | null | from tddspry.django import TestCase
from tddspry.django.helpers import EMAIL, PASSWORD, USERNAME
from django.contrib.auth.models import User
class TestModels(TestCase):
multidb = True
def setup(self):
self.model = User
self.manager = self.model.objects.using('legacy')
self.kwargs =... | 33.557143 | 72 | 0.60877 | from tddspry.django import TestCase
from tddspry.django.helpers import EMAIL, PASSWORD, USERNAME
from django.contrib.auth.models import User
class TestModels(TestCase):
multidb = True
def setup(self):
self.model = User
self.manager = self.model.objects.using('legacy')
self.kwargs =... | true | true |
1c0c30311d8831481dab6940ed9dbb33ec58232a | 690 | py | Python | tests/extmod/ubinascii_b2a_base64.py | 84KaliPleXon3/micropython-esp32 | a64dc82742749cf4a4bbe5688dde05122fb38f56 | [
"MIT"
] | 8 | 2017-01-08T19:45:01.000Z | 2020-09-07T04:39:10.000Z | tests/extmod/ubinascii_b2a_base64.py | 84KaliPleXon3/micropython-esp32 | a64dc82742749cf4a4bbe5688dde05122fb38f56 | [
"MIT"
] | null | null | null | tests/extmod/ubinascii_b2a_base64.py | 84KaliPleXon3/micropython-esp32 | a64dc82742749cf4a4bbe5688dde05122fb38f56 | [
"MIT"
] | 2 | 2017-07-27T19:45:05.000Z | 2020-08-02T19:00:33.000Z | try:
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
print(binascii.b2a_base64(b''))
print(binascii.b2a_base64(b'f'))
print(binascii.b2a_base64(b'fo'))
print(binascii.b2a_base64(b'foo'))
print(binascii.b2a... | 28.75 | 63 | 0.723188 | try:
try:
import ubinascii as binascii
except ImportError:
import binascii
except ImportError:
import sys
print("SKIP")
sys.exit()
print(binascii.b2a_base64(b''))
print(binascii.b2a_base64(b'f'))
print(binascii.b2a_base64(b'fo'))
print(binascii.b2a_base64(b'foo'))
print(binascii.b2a... | true | true |
1c0c30abb45840bac396d6f22f64c488a0d6fd08 | 850 | py | Python | input.py | AmI-2015/python-basics | b7847bd219c2fe02efafb2a8ed4bd890ec36e1e0 | [
"Apache-2.0"
] | 1 | 2015-03-12T13:51:48.000Z | 2015-03-12T13:51:48.000Z | input.py | AmI-2015/python-basics | b7847bd219c2fe02efafb2a8ed4bd890ec36e1e0 | [
"Apache-2.0"
] | null | null | null | input.py | AmI-2015/python-basics | b7847bd219c2fe02efafb2a8ed4bd890ec36e1e0 | [
"Apache-2.0"
] | null | null | null | '''
Created on Mar 6, 2014
Copyright 2014-2015 Dario Bonino
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | 28.333333 | 79 | 0.722353 | '''
Created on Mar 6, 2014
Copyright 2014-2015 Dario Bonino
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ... | false | true |
1c0c30be4e64b80f2ef7b56a15d881dfe9151261 | 449 | py | Python | config.py | ax-rwnd/E-dot | b1b64fcce43c5d6f54dc38959498cdba95e757b1 | [
"BSD-3-Clause"
] | null | null | null | config.py | ax-rwnd/E-dot | b1b64fcce43c5d6f54dc38959498cdba95e757b1 | [
"BSD-3-Clause"
] | 1 | 2015-12-05T02:04:35.000Z | 2015-12-11T02:47:28.000Z | config.py | ax-rwnd/E-dot | b1b64fcce43c5d6f54dc38959498cdba95e757b1 | [
"BSD-3-Clause"
] | null | null | null | import time
config = dict(
#server
HOSTIP='localhost',
HOSTPORT=5000,
HOSTDBG=True,
HOSTKEY="SUPER-SECRET-SIGNING-KEY-:o)"+str(int(time.time())),
RATE_LIMIT = ["90/minute"],
DEFAULT_IMAGE = '/static/img/default.png/',
UPLOAD_FOLDER = '/static/img/',
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif']),
... | 17.269231 | 62 | 0.654788 | import time
config = dict(
HOSTIP='localhost',
HOSTPORT=5000,
HOSTDBG=True,
HOSTKEY="SUPER-SECRET-SIGNING-KEY-:o)"+str(int(time.time())),
RATE_LIMIT = ["90/minute"],
DEFAULT_IMAGE = '/static/img/default.png/',
UPLOAD_FOLDER = '/static/img/',
ALLOWED_EXTENSIONS = set(['png', 'jpg', 'jpeg', 'gif']),
HOST='l... | true | true |
1c0c317ab535975d03f507503c2faf0be2fa2329 | 5,084 | py | Python | MaunaLoa_Code/MaunaLoaFiltering.py | mmstoll/Ocean569_Code | 228cb719f3e82f187f704f343d3b3590a38236d7 | [
"MIT"
] | null | null | null | MaunaLoa_Code/MaunaLoaFiltering.py | mmstoll/Ocean569_Code | 228cb719f3e82f187f704f343d3b3590a38236d7 | [
"MIT"
] | null | null | null | MaunaLoa_Code/MaunaLoaFiltering.py | mmstoll/Ocean569_Code | 228cb719f3e82f187f704f343d3b3590a38236d7 | [
"MIT"
] | null | null | null | #program to create spectra of MaunaLoa CO2 data
import numpy as np
import matplotlib.pyplot as plt
import random
from netCDF4 import Dataset
#
# read and plot Mauna Loa CO2 data, from a netcdf file
#
# define the netcdf reading function
def import_data(file_name):
data_netcdf = Dataset(file_name, mode = 'r')
d... | 29.55814 | 83 | 0.683714 | import numpy as np
import matplotlib.pyplot as plt
import random
from netCDF4 import Dataset
def import_data(file_name):
data_netcdf = Dataset(file_name, mode = 'r')
data = {}
for vname in list(data_netcdf.variables):
data[str(vname)] = data_netcdf.variables[vname][:]
data_netcdf.close()
ret... | true | true |
1c0c31fc9960574915b66f9cae57c91b0aae0c84 | 8,794 | py | Python | tests/api/_test_async_step34.py | wombat70/behave | c54493b0531795d946ac6754bfc643248cf3056a | [
"BSD-2-Clause"
] | 13 | 2019-10-03T19:15:14.000Z | 2019-10-16T02:01:57.000Z | tests/api/_test_async_step34.py | wombat70/behave | c54493b0531795d946ac6754bfc643248cf3056a | [
"BSD-2-Clause"
] | 2 | 2020-03-21T22:37:54.000Z | 2021-10-04T17:14:14.000Z | tests/api/_test_async_step34.py | fluendo/behave | eeffde083456dcf1a0ea9b6139b32091970118c0 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
Unit tests for :mod:`behave.api.async_test`.
"""
# -- IMPORTS:
from __future__ import absolute_import, print_function
from behave.api.async_step import AsyncContext, use_or_create_async_context
from behave._stepimport import use_step_import_modules
from behave.runner import Context, Runner
... | 42.076555 | 87 | 0.643848 |
from __future__ import absolute_import, print_function
from behave.api.async_step import AsyncContext, use_or_create_async_context
from behave._stepimport import use_step_import_modules
from behave.runner import Context, Runner
import sys
from mock import Mock
import pytest
from .testing_support import StopWatch, Sim... | true | true |
1c0c320835899a05b53a048e9c33de72f46f1eda | 30,722 | py | Python | ocrd_cis/ocropy/ocrolib/common.py | bertsky/cis-ocrd-py | c3fad1a8b04dc5a305460e8bb3c54cb79cd75515 | [
"MIT"
] | 26 | 2019-10-23T22:40:17.000Z | 2022-03-04T11:32:51.000Z | ocrd_cis/ocropy/ocrolib/common.py | cisocrgroup/ocrd_cis | c3fad1a8b04dc5a305460e8bb3c54cb79cd75515 | [
"MIT"
] | 64 | 2019-08-29T14:27:40.000Z | 2022-03-25T15:23:21.000Z | ocrd_cis/ocropy/ocrolib/common.py | bertsky/ocrd_cis | c3fad1a8b04dc5a305460e8bb3c54cb79cd75515 | [
"MIT"
] | 7 | 2019-09-23T13:32:04.000Z | 2021-04-15T11:46:48.000Z | # -*- coding: utf-8 -*-
################################################################
### common functions for data structures, file name manipulation, etc.
################################################################
import os
import os.path
import re
import sys
import sysconfig
import unicodedata
import ins... | 34.635851 | 127 | 0.5831 |
import os
import os.path
import re
import sys
import sysconfig
import unicodedata
import inspect
import glob
import gzip
import pickle
from .exceptions import (BadClassLabel, BadInput, FileNotFound,
OcropusException)
from numpy import (amax, amin, array, bitwise_and, clip, dtype, mean... | true | true |
1c0c33418627308d2b011f892987a046b4b7d029 | 834 | py | Python | examples/downloading.py | alexwlchan/concurrently | c3d46bf5e7b3b1469a14a55dfcb7cede097d1e09 | [
"MIT"
] | 5 | 2022-01-04T09:08:12.000Z | 2022-02-27T12:16:39.000Z | examples/downloading.py | alexwlchan/concurrently | c3d46bf5e7b3b1469a14a55dfcb7cede097d1e09 | [
"MIT"
] | null | null | null | examples/downloading.py | alexwlchan/concurrently | c3d46bf5e7b3b1469a14a55dfcb7cede097d1e09 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This example downloads a collection of images from https://http.cat/
Rather than downloading the images one-by-one, it runs multiple instances
of the download() function to complete the process faster.
"""
import tempfile
import urllib.request
from concurrently import concurrently
def sav... | 26.903226 | 75 | 0.709832 |
import tempfile
import urllib.request
from concurrently import concurrently
def save_http_cat(status_code):
_, path = tempfile.mkstemp(suffix=f"_{status_code}.jpg")
urllib.request.urlretrieve(f"https://http.cat/{status_code}", path)
return path
if __name__ == "__main__":
codes = [200, 201, 202, 30... | true | true |
1c0c334fbeebf152f87e8b51e82b8bde78d4224c | 2,483 | py | Python | lldb/test/API/python_api/breakpoint/TestBreakpointAPI.py | elizabethandrews/llvm | 308498236c1c4778fdcba0bfbb556adf8aa333ea | [
"Apache-2.0"
] | 305 | 2019-09-14T17:16:05.000Z | 2022-03-31T15:05:20.000Z | lldb/test/API/python_api/breakpoint/TestBreakpointAPI.py | elizabethandrews/llvm | 308498236c1c4778fdcba0bfbb556adf8aa333ea | [
"Apache-2.0"
] | 11 | 2019-10-17T21:11:52.000Z | 2022-02-17T20:10:00.000Z | lldb/test/API/python_api/breakpoint/TestBreakpointAPI.py | elizabethandrews/llvm | 308498236c1c4778fdcba0bfbb556adf8aa333ea | [
"Apache-2.0"
] | 24 | 2019-10-03T11:22:11.000Z | 2022-01-25T09:59:30.000Z | """
Test SBBreakpoint APIs.
"""
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class BreakpointAPITestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(['pyapi'])
... | 34.486111 | 87 | 0.644382 |
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class BreakpointAPITestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(['pyapi'])
def test_breakpoint_is_valid(se... | true | true |
1c0c335af5f197cb84a20e71caa3f5f56f3d0f52 | 7,064 | py | Python | tensorflow/python/keras/mixed_precision/experimental/policy_test.py | dan-zheng/tensorflow | b4245c36bc9bcb752c0a2118728098b359fd97e2 | [
"Apache-2.0"
] | 1 | 2021-01-18T04:50:42.000Z | 2021-01-18T04:50:42.000Z | tensorflow/python/keras/mixed_precision/experimental/policy_test.py | shyampandey1/tensorflow | 5e04065935920b0a07175283408297e73d2191fb | [
"Apache-2.0"
] | 1 | 2019-08-19T08:03:52.000Z | 2019-08-19T08:03:52.000Z | tensorflow/python/keras/mixed_precision/experimental/policy_test.py | shyampandey1/tensorflow | 5e04065935920b0a07175283408297e73d2191fb | [
"Apache-2.0"
] | 1 | 2019-08-23T12:36:08.000Z | 2019-08-23T12:36:08.000Z | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.83237 | 84 | 0.703001 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.python.keras import testing_utils
from tensorflow.py... | true | true |
1c0c34406e1fb27d50e0eb342a239eab7a18bcd3 | 660 | py | Python | plugins/bot_auto_revoke.py | xiyaowong/botoy-example | a0a25a6642f571ffbc8725e6a0c7aff950cb420c | [
"MIT"
] | 2 | 2020-11-14T10:24:16.000Z | 2021-01-18T10:05:28.000Z | plugins/bot_auto_revoke.py | xiyaowong/botoy-example | a0a25a6642f571ffbc8725e6a0c7aff950cb420c | [
"MIT"
] | 1 | 2021-03-13T07:34:38.000Z | 2021-03-25T03:59:03.000Z | plugins/bot_auto_revoke.py | xiyaowong/botoy-example | a0a25a6642f571ffbc8725e6a0c7aff950cb420c | [
"MIT"
] | 2 | 2020-12-29T11:43:51.000Z | 2021-04-15T16:14:58.000Z | import os
import random
import re
import time
from botoy import Action, GroupMsg
from botoy.decorators import from_botself, in_content
_KEYWORD = "revoke"
# 包含指定关键字时撤回,假设关键字为 revoke
# revoke 随机0-90s撤回
# revoke[10] 10s后撤回
@from_botself
@in_content(_KEYWORD)
def receive_group_msg(ctx: GroupMsg):
delay = re.finda... | 21.290323 | 60 | 0.677273 | import os
import random
import re
import time
from botoy import Action, GroupMsg
from botoy.decorators import from_botself, in_content
_KEYWORD = "revoke"
@from_botself
@in_content(_KEYWORD)
def receive_group_msg(ctx: GroupMsg):
delay = re.findall(_KEYWORD + r"\[(\d+)\]", ctx.Content)
if delay:
del... | true | true |
1c0c35c2f24e716780b1751019076a4228cafb69 | 1,144 | py | Python | pyfire/src/EXAMPLE_RunSkyfire.py | blackducksoftware/perceptor-skyfire | 594716d24cd15814c084ee0ba740adf123531387 | [
"Apache-2.0"
] | 3 | 2018-04-11T17:57:02.000Z | 2021-03-26T17:28:39.000Z | pyfire/src/EXAMPLE_RunSkyfire.py | blackducksoftware/perceptor-skyfire | 594716d24cd15814c084ee0ba740adf123531387 | [
"Apache-2.0"
] | 6 | 2018-05-21T14:34:53.000Z | 2018-11-20T17:56:37.000Z | pyfire/src/EXAMPLE_RunSkyfire.py | blackducksoftware/perceptor-skyfire | 594716d24cd15814c084ee0ba740adf123531387 | [
"Apache-2.0"
] | 2 | 2018-04-11T18:57:06.000Z | 2018-10-16T18:31:56.000Z | import json
from scraper import Scraper
from cluster_clients import *
from skyfire import MockSkyfire
import sys
def real_reader(conf):
"""
Another example not to be used in PDCs!
"""
from cluster_clients import PerceptorClient, KubeClient, HubClient
# Create a logger
root_logger = logging.ge... | 27.902439 | 151 | 0.708916 | import json
from scraper import Scraper
from cluster_clients import *
from skyfire import MockSkyfire
import sys
def real_reader(conf):
from cluster_clients import PerceptorClient, KubeClient, HubClient
root_logger = logging.getLogger()
perceptor_client = PerceptorClient(conf.perceptor_host,conf... | true | true |
1c0c3673a5f7b712b985550a168f8aab6f58f416 | 780 | py | Python | bin/fastaBlockSplit.py | PapenfussLab/Mungo | 02c5b0e48ecd28596cb9481b282753859f47fed6 | [
"Artistic-2.0"
] | 1 | 2015-09-16T07:53:18.000Z | 2015-09-16T07:53:18.000Z | bin/fastaBlockSplit.py | PapenfussLab/Mungo | 02c5b0e48ecd28596cb9481b282753859f47fed6 | [
"Artistic-2.0"
] | null | null | null | bin/fastaBlockSplit.py | PapenfussLab/Mungo | 02c5b0e48ecd28596cb9481b282753859f47fed6 | [
"Artistic-2.0"
] | 3 | 2016-01-02T16:34:59.000Z | 2021-07-21T04:21:55.000Z | #!/usr/bin/env python
"""
fasta_block_split.py <iFilenames> <oFilename>
Author: Tony Papenfuss
Date: Fri Mar 30 12:58:58 EST 2007
"""
import os, sys
from mungo.fasta import FastaFile
from optparse import OptionParser
usage = "%prog [-b <block_size>] <input_file1> [<input_file2> ...] <output_file>"
parser = OptionP... | 22.941176 | 81 | 0.696154 |
import os, sys
from mungo.fasta import FastaFile
from optparse import OptionParser
usage = "%prog [-b <block_size>] <input_file1> [<input_file2> ...] <output_file>"
parser = OptionParser(usage=usage, version="%prog - Version 1")
parser.add_option("-b", "--blocksize", action="store", type="int",
dest="blocksize"... | true | true |
1c0c36c7dbfa30e0436eae7e97e8fa29067a5096 | 1,440 | py | Python | src/behavioural_cloning_cnn/run_training.py | charlierance/Behavioural_Cloning_CNN | 22b7d8c975f4c7380bd690a5b354930f25a31551 | [
"MIT"
] | 2 | 2022-01-30T17:31:10.000Z | 2022-01-30T17:32:57.000Z | src/behavioural_cloning_cnn/run_training.py | charlierance/Behavioural_Cloning_CNN | 22b7d8c975f4c7380bd690a5b354930f25a31551 | [
"MIT"
] | 3 | 2020-09-25T22:33:06.000Z | 2022-02-09T23:37:09.000Z | src/behavioural_cloning_cnn/run_training.py | charlierance/Behavioural_Cloning_CNN | 22b7d8c975f4c7380bd690a5b354930f25a31551 | [
"MIT"
] | null | null | null | import argparse
from behavioural_cloning_cnn.model import BehaviouralModel
def run():
# Set configurable params
parser = argparse.ArgumentParser(
description="Run NN Training For Behavioural Cloning"
)
parser.add_argument(
"--csv",
nargs=1,
type=str,
default="... | 24 | 87 | 0.604167 | import argparse
from behavioural_cloning_cnn.model import BehaviouralModel
def run():
parser = argparse.ArgumentParser(
description="Run NN Training For Behavioural Cloning"
)
parser.add_argument(
"--csv",
nargs=1,
type=str,
default="./training_data/driving_lo... | true | true |
1c0c38066ea13028af9af91d27a8275a2353e2d9 | 547 | py | Python | rango/migrations/0011_auto_20180506_1213.py | T-Boya/Image-Hosting-Site-1 | 25f88e7a653986eb8aa159e6ca8377a5a347039a | [
"CNRI-Python"
] | null | null | null | rango/migrations/0011_auto_20180506_1213.py | T-Boya/Image-Hosting-Site-1 | 25f88e7a653986eb8aa159e6ca8377a5a347039a | [
"CNRI-Python"
] | null | null | null | rango/migrations/0011_auto_20180506_1213.py | T-Boya/Image-Hosting-Site-1 | 25f88e7a653986eb8aa159e6ca8377a5a347039a | [
"CNRI-Python"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.10 on 2018-05-06 09:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rango', '0010_auto_20180506_1212'),
]
operations =... | 24.863636 | 114 | 0.650823 | from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rango', '0010_auto_20180506_1212'),
]
operations = [
migrations.AlterField(
model_name='photo',
... | true | true |
1c0c385ef0e09b5f92fa19acfdf7c9d46473aced | 14,795 | py | Python | heat/tests/aws/test_loadbalancer.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | heat/tests/aws/test_loadbalancer.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | heat/tests/aws/test_loadbalancer.py | maestro-hybrid-cloud/heat | 91a4bb3170bd81b1c67a896706851e55709c9b5a | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 35.910194 | 79 | 0.605475 |
import copy
import mock
from oslo_config import cfg
from heat.common import exception
from heat.common import template_format
from heat.engine.clients.os import nova
from heat.engine.resources.aws.lb import loadbalancer as lb
from heat.engine import rsrc_defn
from heat.tests import common
from heat.tests.nova import... | true | true |
1c0c390705ade8c1c1a99f61e6009dfd039152f3 | 9,010 | py | Python | cs246_colab_9.py | x3pi/mining-massive-datasets | 36d1f8ab437ea75d7437fc3e28593c2bb907ddd9 | [
"MIT"
] | 3 | 2021-12-24T01:06:24.000Z | 2022-03-25T10:54:57.000Z | cs246_colab_9.py | x3pi/mining-massive-datasets | 36d1f8ab437ea75d7437fc3e28593c2bb907ddd9 | [
"MIT"
] | null | null | null | cs246_colab_9.py | x3pi/mining-massive-datasets | 36d1f8ab437ea75d7437fc3e28593c2bb907ddd9 | [
"MIT"
] | 2 | 2021-09-11T17:31:14.000Z | 2022-03-05T20:33:33.000Z | # -*- coding: utf-8 -*-
"""CS246 - Colab 9.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/github/nhutnamhcmus/mining-massive-datasets/blob/main/CS246_Colab_9.ipynb
# CS246 - Colab 9
## Studying COVID-19
### Setup
Let's setup Spark on your Colab envi... | 46.205128 | 399 | 0.766593 | """CS246 - Colab 9.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/github/nhutnamhcmus/mining-massive-datasets/blob/main/CS246_Colab_9.ipynb
# CS246 - Colab 9
## Studying COVID-19
### Setup
Let's setup Spark on your Colab environment. Run the cell b... | false | true |
1c0c3a8f4651d6a72686a112fcde15395e4ebe57 | 2,882 | py | Python | multi_locus_analysis/examples/burgess/analysis.py | brunobeltran/multi_locus_analysis | bef1e25ad5ca848cc5900d4b0207a93f48cf8c62 | [
"MIT"
] | null | null | null | multi_locus_analysis/examples/burgess/analysis.py | brunobeltran/multi_locus_analysis | bef1e25ad5ca848cc5900d4b0207a93f48cf8c62 | [
"MIT"
] | null | null | null | multi_locus_analysis/examples/burgess/analysis.py | brunobeltran/multi_locus_analysis | bef1e25ad5ca848cc5900d4b0207a93f48cf8c62 | [
"MIT"
] | null | null | null | """Miscellaneous analysis of the Burgess data not worth saving anywhere
else."""
from . import *
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator)
import scipy
def alpha_fit():
"""We notice from bplot.mscds_by_meiotic_stage that some of the t0 times
actually spend a reason... | 44.338462 | 103 | 0.618668 |
from . import *
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator)
import scipy
def alpha_fit():
mscd_unbound_only = pd.read_csv(burgess_dir / Path('msds_dvel_by_wait.csv'))
mscd_unbound_only.set_index(condition_cols, inplace=True)
mslow = mscd_unbound_only.loc['LYS2', ... | true | true |
1c0c3c221c010a5fbf2dee81e9a1fc01638a7907 | 789 | py | Python | utils/ckpt.py | sungyubkim/cifar_training_jax | 790df44c1d23057bc1e8b0193ed797ce973d5685 | [
"MIT"
] | null | null | null | utils/ckpt.py | sungyubkim/cifar_training_jax | 790df44c1d23057bc1e8b0193ed797ce973d5685 | [
"MIT"
] | null | null | null | utils/ckpt.py | sungyubkim/cifar_training_jax | 790df44c1d23057bc1e8b0193ed797ce973d5685 | [
"MIT"
] | null | null | null | import os
import jax
from flax.training import checkpoints
def check_dir(folder_path):
# save path
if not os.path.exists(folder_path):
os.makedirs(folder_path)
def dict2tsv(res, file_name):
for k, v in res.items():
if type(v) == float:
res[k] = '{:.4e}'.format(v)
if not os.... | 30.346154 | 76 | 0.596958 | import os
import jax
from flax.training import checkpoints
def check_dir(folder_path):
if not os.path.exists(folder_path):
os.makedirs(folder_path)
def dict2tsv(res, file_name):
for k, v in res.items():
if type(v) == float:
res[k] = '{:.4e}'.format(v)
if not os.path.exists(... | true | true |
1c0c3c8f7686c9cf2d5e23971c9510645929ecfd | 4,511 | py | Python | ldif/results/eval_unseen_occnet.py | JRyanShue/ldif | fd2cbfbcb752d0e5e19e80b98760bf5bf9d1661f | [
"Apache-2.0"
] | null | null | null | ldif/results/eval_unseen_occnet.py | JRyanShue/ldif | fd2cbfbcb752d0e5e19e80b98760bf5bf9d1661f | [
"Apache-2.0"
] | null | null | null | ldif/results/eval_unseen_occnet.py | JRyanShue/ldif | fd2cbfbcb752d0e5e19e80b98760bf5bf9d1661f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 36.379032 | 78 | 0.686987 |
from absl import app
from absl import flags
import apache_beam as beam
import numpy as np
import pandas as pd
from ldif.inference import metrics
from ldif.results import results_pb2
from ldif.util import file_util
from ldif.util import mesh_util
from ldif.util.file_util import log
FLAGS = flags.FLAGS
... | true | true |
1c0c3d1c909b142ebc576ba21e82c393507880ea | 1,709 | py | Python | tfmodel.py | ca7869/tensorflow | 2daf3a3121f0da5cb060dca3958b2fa9c2f5dbc2 | [
"BSD-2-Clause"
] | null | null | null | tfmodel.py | ca7869/tensorflow | 2daf3a3121f0da5cb060dca3958b2fa9c2f5dbc2 | [
"BSD-2-Clause"
] | null | null | null | tfmodel.py | ca7869/tensorflow | 2daf3a3121f0da5cb060dca3958b2fa9c2f5dbc2 | [
"BSD-2-Clause"
] | null | null | null | import os
import tensorflow as tf
from tensorflow.python import keras
#import keras
from tensorflow.python.keras.layers import Input, Dense
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
from tensorflow.python.keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
... | 37.152174 | 118 | 0.758338 | import os
import tensorflow as tf
from tensorflow.python import keras
from tensorflow.python.keras.layers import Input, Dense
from tensorflow.python.keras.preprocessing.image import ImageDataGenerator
from tensorflow.python.keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
from keras.mod... | true | true |
1c0c3dd99165a244701b12687da9e54b9eb0bf03 | 2,291 | py | Python | docs/conf.py | InsanePhin/py-sdk | 51085c59ccb9e61ac23de2c5eeec898fec3a0275 | [
"MIT"
] | 24 | 2020-05-09T02:58:34.000Z | 2022-03-30T13:44:37.000Z | docs/conf.py | InsanePhin/py-sdk | 51085c59ccb9e61ac23de2c5eeec898fec3a0275 | [
"MIT"
] | 28 | 2020-05-11T23:35:27.000Z | 2021-10-09T04:38:19.000Z | docs/conf.py | InsanePhin/py-sdk | 51085c59ccb9e61ac23de2c5eeec898fec3a0275 | [
"MIT"
] | 22 | 2020-05-11T13:38:37.000Z | 2022-03-30T10:29:42.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 32.728571 | 79 | 0.678306 |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
project = "koreanbots"
copyright = "2021, Koreanbots"
author = "Koreanbots"
release = "2.0.0"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
]
templates_path = ["_templates"]
language = "ko"
ex... | true | true |
1c0c3e6c50a404db16939e61403856e881d04feb | 321 | py | Python | OtherPlatform/ScreenSaver.py | ftoorto/JiraTest | 4ab79385c30f70e2fe879e639816b93a18bfc3fc | [
"MIT"
] | null | null | null | OtherPlatform/ScreenSaver.py | ftoorto/JiraTest | 4ab79385c30f70e2fe879e639816b93a18bfc3fc | [
"MIT"
] | null | null | null | OtherPlatform/ScreenSaver.py | ftoorto/JiraTest | 4ab79385c30f70e2fe879e639816b93a18bfc3fc | [
"MIT"
] | null | null | null | import os
import time
from Main import Utils
def start_test():
i = 1
while True:
i = i + 1
os.system("adb connect 192.168.1.102")
time.sleep(310)
Utils.up()
print(i, "times screen saver")
if i > 50:
break
if __name__ == "__main__":
start_test()... | 16.05 | 46 | 0.53271 | import os
import time
from Main import Utils
def start_test():
i = 1
while True:
i = i + 1
os.system("adb connect 192.168.1.102")
time.sleep(310)
Utils.up()
print(i, "times screen saver")
if i > 50:
break
if __name__ == "__main__":
start_test()... | true | true |
1c0c3eb4eff393d8caf931857ffcb0b33e4b8910 | 3,660 | py | Python | lib/python/graph.py | stjude/Episomizer | 764fa822bd0ddb753d848a315b3e4c513b2388b3 | [
"Apache-2.0"
] | 5 | 2020-02-09T09:17:23.000Z | 2021-03-23T04:13:12.000Z | lib/python/graph.py | adamdingliang/Episomizer | 764fa822bd0ddb753d848a315b3e4c513b2388b3 | [
"Apache-2.0"
] | null | null | null | lib/python/graph.py | adamdingliang/Episomizer | 764fa822bd0ddb753d848a315b3e4c513b2388b3 | [
"Apache-2.0"
] | 5 | 2018-08-28T23:51:08.000Z | 2021-02-20T17:03:33.000Z | #!/usr/bin/env python3
"""
This module contains functions to work with networkx graphs.
"""
import networkx as nx
import pybedtools
def build_graph(cna_segment_file, linked_sv_file, **kwargs):
""" Read a text file with number of nodes and edges. Create a networkx bidirectional graph.
Args:
Required a... | 35.192308 | 114 | 0.589071 |
import networkx as nx
import pybedtools
def build_graph(cna_segment_file, linked_sv_file, **kwargs):
linked_sv_edges = []
with open(linked_sv_file, 'r') as fin:
while True:
line = fin.readline().rstrip()
if not line:
break
linked_sv_edges.append... | true | true |
1c0c3f9ba1357a6340b865f6023c0da9d89a1484 | 25,681 | py | Python | datasette/views/base.py | sethvargo/datasette | 30e5f0e67c38054a8087a2a4eae3fc4d1779af90 | [
"Apache-2.0"
] | null | null | null | datasette/views/base.py | sethvargo/datasette | 30e5f0e67c38054a8087a2a4eae3fc4d1779af90 | [
"Apache-2.0"
] | null | null | null | datasette/views/base.py | sethvargo/datasette | 30e5f0e67c38054a8087a2a4eae3fc4d1779af90 | [
"Apache-2.0"
] | null | null | null | import asyncio
import csv
import hashlib
import re
import sys
import time
import urllib
import pint
from datasette import __version__
from datasette.database import QueryInterrupted
from datasette.utils.asgi import Request
from datasette.utils import (
add_cors_headers,
await_me_maybe,
EscapeHtmlWriter,
... | 38.15899 | 115 | 0.50037 | import asyncio
import csv
import hashlib
import re
import sys
import time
import urllib
import pint
from datasette import __version__
from datasette.database import QueryInterrupted
from datasette.utils.asgi import Request
from datasette.utils import (
add_cors_headers,
await_me_maybe,
EscapeHtmlWriter,
... | true | true |
1c0c41e875b4c6b585b545296936c23ccffe8754 | 570 | py | Python | source/brailleDisplayDrivers/noBraille.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | source/brailleDisplayDrivers/noBraille.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | source/brailleDisplayDrivers/noBraille.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | #brailleDisplayDrivers/noBraille.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2009 NVDA Contributors <http://www.nvda-project.org/>
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import braille
class BrailleDisplayDriver(braille.BrailleDisplayDriv... | 30 | 74 | 0.768421 |
import braille
class BrailleDisplayDriver(braille.BrailleDisplayDriver):
name = "noBraille"
description = _("No braille")
@classmethod
def check(cls):
return True
| true | true |
1c0c4346ba8b07fca928b9477265d769704aa1c7 | 1,899 | py | Python | model/ops.py | 530824679/YOLOv3 | 2ea5ccd136f00260b42eb459f5ab0884cb162483 | [
"MIT"
] | null | null | null | model/ops.py | 530824679/YOLOv3 | 2ea5ccd136f00260b42eb459f5ab0884cb162483 | [
"MIT"
] | null | null | null | model/ops.py | 530824679/YOLOv3 | 2ea5ccd136f00260b42eb459f5ab0884cb162483 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# --------------------------------------
# @Time : 2020/11/01
# @Author : Oscar Chen
# @Email : 530824679@qq.com
# @File : ops.py
# Description :base operators.
# --------------------------------------
import tensorflow as tf
import tensorflow.contrib.slim as slim
def fixed_padding(in... | 31.65 | 161 | 0.650342 |
import tensorflow as tf
import tensorflow.contrib.slim as slim
def fixed_padding(inputs, kernel_size):
pad_total = kernel_size - 1
pad_beg = pad_total // 2
pad_end = pad_total - pad_beg
padded_inputs = tf.pad(inputs, [[0, 0], [pad_beg, pad_end], [pad_beg, pad_end], [0, 0]], mode='CONSTANT')
retur... | true | true |
1c0c43b6c6b6f39fcb6d8ed5b9331940b7aff20b | 5,511 | py | Python | angr/state_plugins/heap/heap_brk.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 2 | 2020-04-29T02:39:42.000Z | 2020-04-29T08:07:44.000Z | angr/state_plugins/heap/heap_brk.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | null | null | null | angr/state_plugins/heap/heap_brk.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 1 | 2020-11-18T16:39:13.000Z | 2020-11-18T16:39:13.000Z | from angr.errors import SimSolverError
from ..plugin import SimStatePlugin
from . import SimHeapBase
import logging
l = logging.getLogger("angr.state_plugins.heap.heap_brk")
class SimHeapBrk(SimHeapBase):
"""
SimHeapBrk represents a trivial heap implementation based on the Unix `brk` system call. This type o... | 42.068702 | 120 | 0.685538 | from angr.errors import SimSolverError
from ..plugin import SimStatePlugin
from . import SimHeapBase
import logging
l = logging.getLogger("angr.state_plugins.heap.heap_brk")
class SimHeapBrk(SimHeapBase):
def __init__(self, heap_base=None, heap_size=None):
super(SimHeapBrk, self).__init__(heap_base, hea... | true | true |
1c0c448d480cc45a13801bec4c070b48465cb162 | 450 | py | Python | ait/commons/util/progress_bar.py | ebi-ait/hca_util | 9de505211cec6eb2653d070b867d2b9174a657e5 | [
"Apache-2.0"
] | 1 | 2020-05-06T16:55:21.000Z | 2020-05-06T16:55:21.000Z | ait/commons/util/progress_bar.py | ebi-ait/hca_util | 9de505211cec6eb2653d070b867d2b9174a657e5 | [
"Apache-2.0"
] | 4 | 2020-03-31T10:16:33.000Z | 2021-03-10T15:59:02.000Z | ait/commons/util/progress_bar.py | ebi-ait/hca_util | 9de505211cec6eb2653d070b867d2b9174a657e5 | [
"Apache-2.0"
] | 2 | 2020-05-21T15:35:57.000Z | 2020-06-18T14:23:36.000Z | import threading
from tqdm import tqdm
class ProgressBar:
def __init__(self, target, total):
self._target = target
self._total = total
self._seen_so_far = 0
self._lock = threading.Lock()
def __call__(self, bytes_amount):
with tqdm(total=self._total, desc=self._target) ... | 28.125 | 64 | 0.631111 | import threading
from tqdm import tqdm
class ProgressBar:
def __init__(self, target, total):
self._target = target
self._total = total
self._seen_so_far = 0
self._lock = threading.Lock()
def __call__(self, bytes_amount):
with tqdm(total=self._total, desc=self._target) ... | true | true |
1c0c44fb94f13b2e164255cb4f6faa90eb01e051 | 15,972 | py | Python | datastore/core/test/test_query.py | datastore/datastore | 7ccf0cd4748001d3dbf5e6dda369b0f63e0269d3 | [
"MIT"
] | 65 | 2015-03-22T23:43:48.000Z | 2022-03-25T16:10:33.000Z | datastore/core/test/test_query.py | datastore/datastore | 7ccf0cd4748001d3dbf5e6dda369b0f63e0269d3 | [
"MIT"
] | 3 | 2015-03-11T21:57:23.000Z | 2019-07-26T16:20:29.000Z | datastore/core/test/test_query.py | datastore/datastore | 7ccf0cd4748001d3dbf5e6dda369b0f63e0269d3 | [
"MIT"
] | 14 | 2015-01-23T17:03:33.000Z | 2020-02-03T06:35:04.000Z | import time
import datetime
import unittest
import hashlib
import nanotime
from ..key import Key
from ..query import Filter, Order, Query, Cursor
def version_objects():
sr1 = {}
sr1['key'] = '/ABCD'
sr1['hash'] = hashlib.sha1('herp').hexdigest()
sr1['parent'] = '0000000000000000000000000000000000000000'
s... | 33.205821 | 77 | 0.635111 | import time
import datetime
import unittest
import hashlib
import nanotime
from ..key import Key
from ..query import Filter, Order, Query, Cursor
def version_objects():
sr1 = {}
sr1['key'] = '/ABCD'
sr1['hash'] = hashlib.sha1('herp').hexdigest()
sr1['parent'] = '0000000000000000000000000000000000000000'
s... | true | true |
1c0c4581c0df4f3c4784b1b0b3a5a469a49258ac | 23,128 | py | Python | tensorflow/python/estimator/canned/dnn.py | nicdnb/tensorflow | ad5c0c4d091c93ef65e91c55cb4df065d0c7a989 | [
"Apache-2.0"
] | 1 | 2020-02-04T06:39:30.000Z | 2020-02-04T06:39:30.000Z | tensorflow/python/estimator/canned/dnn.py | nicdnb/tensorflow | ad5c0c4d091c93ef65e91c55cb4df065d0c7a989 | [
"Apache-2.0"
] | 1 | 2019-08-22T20:29:33.000Z | 2019-12-19T10:16:21.000Z | tensorflow/python/estimator/canned/dnn.py | nicdnb/tensorflow | ad5c0c4d091c93ef65e91c55cb4df065d0c7a989 | [
"Apache-2.0"
] | 6 | 2018-12-20T01:35:20.000Z | 2020-07-10T17:29:57.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.597122 | 93 | 0.698504 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.estimator import estimator
from tensorflow.python.estimator import model_fn
from tensorflow.python.estimator.canned import head as head_lib
from tensorflow.python.estimator.c... | true | true |
1c0c45b14f26069a46a05ea9c9e2738cd53a2475 | 10,364 | py | Python | src/_pytest/pathlib.py | yashtodi94/pytest | 0d3958e8dec5f78ed19ba5bc7a00a35f3ea3deb0 | [
"MIT"
] | null | null | null | src/_pytest/pathlib.py | yashtodi94/pytest | 0d3958e8dec5f78ed19ba5bc7a00a35f3ea3deb0 | [
"MIT"
] | null | null | null | src/_pytest/pathlib.py | yashtodi94/pytest | 0d3958e8dec5f78ed19ba5bc7a00a35f3ea3deb0 | [
"MIT"
] | null | null | null | import atexit
import errno
import fnmatch
import itertools
import operator
import os
import shutil
import sys
import uuid
import warnings
from functools import partial
from os.path import expanduser
from os.path import expandvars
from os.path import isabs
from os.path import sep
from posixpath import sep as posix_sep
... | 30.127907 | 118 | 0.646951 | import atexit
import errno
import fnmatch
import itertools
import operator
import os
import shutil
import sys
import uuid
import warnings
from functools import partial
from os.path import expanduser
from os.path import expandvars
from os.path import isabs
from os.path import sep
from posixpath import sep as posix_sep
... | true | true |
1c0c45d6607eea9736f6fd9f9af88549b9febd79 | 17,305 | py | Python | DatabaseRelated/buttons.py | CalmingAgent/Pew-Pew-Test | fed527ca7b83dafd1960c2daf4a0e616e56354ca | [
"MIT"
] | null | null | null | DatabaseRelated/buttons.py | CalmingAgent/Pew-Pew-Test | fed527ca7b83dafd1960c2daf4a0e616e56354ca | [
"MIT"
] | null | null | null | DatabaseRelated/buttons.py | CalmingAgent/Pew-Pew-Test | fed527ca7b83dafd1960c2daf4a0e616e56354ca | [
"MIT"
] | null | null | null | import nextcord
from nextcord.abc import _Overwrites
from nextcord.interactions import Interaction
import mongodb
import UpdateELO
from battle import Battle
from datetime import datetime as dt
import logging
import bot
import sys
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter = logging.F... | 47.672176 | 144 | 0.589252 | import nextcord
from nextcord.abc import _Overwrites
from nextcord.interactions import Interaction
import mongodb
import UpdateELO
from battle import Battle
from datetime import datetime as dt
import logging
import bot
import sys
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
formatter = logging.F... | true | true |
1c0c46cfce120a4c0ec71620e161949ae7e7f72e | 1,636 | py | Python | setup.py | schmidtbri/rest-model-service | 0d1705cb62e6a942f90150da3bcf51e3e1265a25 | [
"BSD-3-Clause"
] | 1 | 2021-11-10T19:48:35.000Z | 2021-11-10T19:48:35.000Z | setup.py | schmidtbri/rest-model-service | 0d1705cb62e6a942f90150da3bcf51e3e1265a25 | [
"BSD-3-Clause"
] | 1 | 2022-03-15T12:36:46.000Z | 2022-03-15T12:36:46.000Z | setup.py | schmidtbri/rest-model-service | 0d1705cb62e6a942f90150da3bcf51e3e1265a25 | [
"BSD-3-Clause"
] | null | null | null | from os import path
from io import open
from setuptools import setup, find_packages
from rest_model_service import __name__, __version__, __doc__
def load_file(file_name):
here = path.abspath(path.dirname(__file__))
with open(path.join(here, file_name)) as f:
return f.read()
setup(name=__name__,
... | 35.565217 | 115 | 0.633252 | from os import path
from io import open
from setuptools import setup, find_packages
from rest_model_service import __name__, __version__, __doc__
def load_file(file_name):
here = path.abspath(path.dirname(__file__))
with open(path.join(here, file_name)) as f:
return f.read()
setup(name=__name__,
... | true | true |
1c0c47ab6171e698393271a8b30370e539989348 | 272 | py | Python | dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/aws_s3/_jsii/__init__.py | chriscoombs/amazon-sagemaker-cdk-examples | ba848218dab59abb03f68dc92bcad7929841fcc9 | [
"Apache-2.0"
] | 41 | 2019-08-22T13:03:42.000Z | 2022-02-24T05:07:32.000Z | dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/aws_s3/_jsii/__init__.py | chriscoombs/amazon-sagemaker-cdk-examples | ba848218dab59abb03f68dc92bcad7929841fcc9 | [
"Apache-2.0"
] | 1 | 2021-06-23T20:28:53.000Z | 2021-06-23T20:28:53.000Z | dask-fargate/.env/lib/python3.6/site-packages/aws_cdk/aws_s3/_jsii/__init__.py | chriscoombs/amazon-sagemaker-cdk-examples | ba848218dab59abb03f68dc92bcad7929841fcc9 | [
"Apache-2.0"
] | 31 | 2019-08-23T17:33:41.000Z | 2022-03-28T09:20:07.000Z | import abc
import datetime
import enum
import typing
import jsii
import jsii.compat
import publication
from jsii.python import classproperty
import aws_cdk.aws_events
import aws_cdk.aws_iam
import aws_cdk.aws_kms
import aws_cdk.core
__all__ = []
publication.publish()
| 14.315789 | 37 | 0.830882 | import abc
import datetime
import enum
import typing
import jsii
import jsii.compat
import publication
from jsii.python import classproperty
import aws_cdk.aws_events
import aws_cdk.aws_iam
import aws_cdk.aws_kms
import aws_cdk.core
__all__ = []
publication.publish()
| true | true |
1c0c49374ce6f0bcd9607f2b4d3464e155c1ced1 | 4,867 | py | Python | docs/conf.py | the16thpythonist/rewardify-base | 4740ec78b22fb6b9d1a62697c8592e5830a38ac6 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | the16thpythonist/rewardify-base | 4740ec78b22fb6b9d1a62697c8592e5830a38ac6 | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | the16thpythonist/rewardify-base | 4740ec78b22fb6b9d1a62697c8592e5830a38ac6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# rewardify documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# a... | 29.676829 | 77 | 0.686049 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import rewardify
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'rewardify-base'
copyright = u"2019, Jonas Teufel"
author = u"Jonas Teufel"
# for |v... | true | true |
1c0c4a8897a9f2bf6c8ae5887317009851c9aaa0 | 286 | py | Python | imdb/middlewares.py | rinkurajole/imdb_sanic_app | 502852b911eb2cfdc5dfcdb4fba585b91e2ce7c6 | [
"BSD-3-Clause"
] | null | null | null | imdb/middlewares.py | rinkurajole/imdb_sanic_app | 502852b911eb2cfdc5dfcdb4fba585b91e2ce7c6 | [
"BSD-3-Clause"
] | null | null | null | imdb/middlewares.py | rinkurajole/imdb_sanic_app | 502852b911eb2cfdc5dfcdb4fba585b91e2ce7c6 | [
"BSD-3-Clause"
] | null | null | null | """
Add security response headers using secure python package
"""
from secure import SecureHeaders
secure_headers = SecureHeaders()
def setup_middlewares(app):
@app.middleware('response')
async def set_secure_headers(request, response):
secure_headers.sanic(response)
| 23.833333 | 57 | 0.762238 | from secure import SecureHeaders
secure_headers = SecureHeaders()
def setup_middlewares(app):
@app.middleware('response')
async def set_secure_headers(request, response):
secure_headers.sanic(response)
| true | true |
1c0c4ac034bbb650c32fef199dae3a790079b3a7 | 1,904 | py | Python | segmentation/IOUEval.py | buptlihang/ESPNetv2 | 9901d7e8a64cbfb24e5412a496d4ef230ac81093 | [
"MIT"
] | 429 | 2018-11-29T02:52:55.000Z | 2022-03-25T13:57:00.000Z | segmentation/IOUEval.py | buptlihang/ESPNetv2 | 9901d7e8a64cbfb24e5412a496d4ef230ac81093 | [
"MIT"
] | 37 | 2018-12-05T06:54:54.000Z | 2021-09-23T14:55:06.000Z | segmentation/IOUEval.py | buptlihang/ESPNetv2 | 9901d7e8a64cbfb24e5412a496d4ef230ac81093 | [
"MIT"
] | 77 | 2018-11-29T03:38:00.000Z | 2022-01-17T11:25:29.000Z | import numpy as np
#adapted from https://github.com/shelhamer/fcn.berkeleyvision.org/blob/master/score.py
#============================================
__author__ = "Sachin Mehta"
__license__ = "MIT"
__maintainer__ = "Sachin Mehta"
#============================================
class iouEval:
def __init__(self, n... | 34.618182 | 135 | 0.607668 | import numpy as np
__author__ = "Sachin Mehta"
__license__ = "MIT"
__maintainer__ = "Sachin Mehta"
class iouEval:
def __init__(self, nClasses):
self.nClasses = nClasses
self.reset()
def reset(self):
self.overall_acc = 0
self.per_class_acc = np.zeros(self.nClasses, dtype=np.fl... | true | true |
1c0c4aca14243e62192e99044a43e995f833f284 | 2,292 | py | Python | mne/gui/tests/test_fiducials_gui.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 3 | 2021-01-04T08:45:56.000Z | 2021-05-19T12:25:59.000Z | mne/gui/tests/test_fiducials_gui.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 28 | 2020-05-07T00:58:34.000Z | 2020-08-29T23:02:17.000Z | mne/gui/tests/test_fiducials_gui.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | 3 | 2019-01-28T13:48:00.000Z | 2019-07-10T16:02:11.000Z | # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import os
import os.path as op
from numpy.testing import assert_array_equal
from mne.utils import requires_mayavi, run_tests_if_main, traits_test
@requires_mayavi
@traits_test
def test_mri_model(subjects_dir_tmp):
"""Test MRI... | 31.833333 | 79 | 0.673647 |
import os
import os.path as op
from numpy.testing import assert_array_equal
from mne.utils import requires_mayavi, run_tests_if_main, traits_test
@requires_mayavi
@traits_test
def test_mri_model(subjects_dir_tmp):
from mne.gui._fiducials_gui import MRIHeadWithFiducialsModel
tgt_fname = op.join(subjects_dir... | true | true |
1c0c4b01a4631c8eab4cf987496c710e5ca71cfa | 2,417 | py | Python | digitick_client/models/seat_list.py | frague59/digitick-client | b8787438cddc60720c60c8b23826185a7d0988d5 | [
"MIT"
] | null | null | null | digitick_client/models/seat_list.py | frague59/digitick-client | b8787438cddc60720c60c8b23826185a7d0988d5 | [
"MIT"
] | null | null | null | digitick_client/models/seat_list.py | frague59/digitick-client | b8787438cddc60720c60c8b23826185a7d0988d5 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Digitick REST API
The Digitick REST API is a set of methods giving access to catalog, user and cart management.
OpenAPI spec version: v1.0
Contact: contact@digitick.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six i... | 25.712766 | 97 | 0.522135 |
from pprint import pformat
from six import iteritems
import re
class SeatList(object):
def __init__(self):
self.swagger_types = {
}
self.attribute_map = {
}
def to_dict(self):
result = {}
for attr, _ in iteritems(self.swagger_typ... | true | true |
1c0c4b39744ee7b2533d5d7c10013e1e98125a3d | 1,832 | py | Python | examples/app_commands/slash_basic.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/app_commands/slash_basic.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/app_commands/slash_basic.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | 1 | 2022-02-20T09:10:40.000Z | 2022-02-20T09:10:40.000Z | # This example requires the 'members' privileged intent to use the Member converter.
import discord
intents = discord.Intents.default()
intents.members = True
bot = discord.Bot(intents=intents)
# The debug guilds parameter can be used to restrict slash command registration to only the supplied guild IDs.
# ... | 42.604651 | 112 | 0.731987 |
import discord
intents = discord.Intents.default()
intents.members = True
bot = discord.Bot(intents=intents)
# With discord.Bot you can use @bot.command as an alias
# of @bot.slash_command but this is overridden by commands.Bot.
@bot.slash_command(guild_ids=[...]) # Create a slash command
async de... | true | true |
1c0c4b47bbe2063f094ada049eae60a480c8d27b | 539 | py | Python | tracker/filters.py | RoadRunner11/expense-tracker | ea965499d7b93355f099f84ebe6b33ef3dd6cdbc | [
"MIT"
] | 9 | 2018-04-18T15:00:34.000Z | 2020-06-24T14:45:21.000Z | tracker/filters.py | thangadurairajapandiyan/django-expense-tracker | 873514fc89f4c65dceda1c76014e7c61ea9425ee | [
"MIT"
] | 13 | 2018-04-15T14:30:17.000Z | 2018-09-23T05:47:22.000Z | tracker/filters.py | thangadurairajapandiyan/django-expense-tracker | 873514fc89f4c65dceda1c76014e7c61ea9425ee | [
"MIT"
] | 11 | 2019-02-22T10:20:44.000Z | 2021-06-21T14:30:26.000Z | import django_filters
from .models import Expense
class ExpenseFilter(django_filters.FilterSet):
description = django_filters.CharFilter(lookup_expr='icontains')
type = django_filters.CharFilter(lookup_expr='icontains')
payment = django_filters.CharFilter(lookup_expr='icontains')
amount = django_filte... | 28.368421 | 68 | 0.643785 | import django_filters
from .models import Expense
class ExpenseFilter(django_filters.FilterSet):
description = django_filters.CharFilter(lookup_expr='icontains')
type = django_filters.CharFilter(lookup_expr='icontains')
payment = django_filters.CharFilter(lookup_expr='icontains')
amount = django_filte... | true | true |
1c0c4c4e94b1a0ffeacc7b00db6e616ef408564b | 33,195 | py | Python | manim/mobject/graph.py | SamuilYu/manim | b726b40089a58a4684725d7216b01d8400ffb2bf | [
"MIT"
] | null | null | null | manim/mobject/graph.py | SamuilYu/manim | b726b40089a58a4684725d7216b01d8400ffb2bf | [
"MIT"
] | null | null | null | manim/mobject/graph.py | SamuilYu/manim | b726b40089a58a4684725d7216b01d8400ffb2bf | [
"MIT"
] | null | null | null | """Mobjects used to represent mathematical graphs (think graph theory, not plotting)."""
__all__ = [
"Graph",
]
from copy import copy
from typing import Hashable, List, Optional, Tuple, Type, Union
import networkx as nx
import numpy as np
from ..animation.composition import AnimationGroup
from ..animation.creat... | 35.238854 | 133 | 0.569122 |
__all__ = [
"Graph",
]
from copy import copy
from typing import Hashable, List, Optional, Tuple, Type, Union
import networkx as nx
import numpy as np
from ..animation.composition import AnimationGroup
from ..animation.creation import Create, Uncreate
from ..utils.color import BLACK
from .geometry import Dot, La... | true | true |
1c0c4ce2ef469eb0b4bc83055f55f3246072193f | 1,759 | py | Python | setup.py | andrewtholt/python-sonoffdiy | 350ae275fefadd92355741eed0667a5422ea7ac5 | [
"MIT"
] | 3 | 2019-11-09T14:46:52.000Z | 2022-02-11T00:34:29.000Z | setup.py | andrewtholt/python-sonoffdiy | 350ae275fefadd92355741eed0667a5422ea7ac5 | [
"MIT"
] | 3 | 2020-01-12T12:48:42.000Z | 2021-11-15T17:51:54.000Z | setup.py | andrewtholt/python-sonoffdiy | 350ae275fefadd92355741eed0667a5422ea7ac5 | [
"MIT"
] | 4 | 2020-04-26T11:38:08.000Z | 2022-02-11T00:34:31.000Z | #!/usr/bin/env python
"""The setup script."""
import os
import re
import sys
from setuptools import find_packages, setup
def get_version():
"""Get current version from code."""
regex = r"__version__\s=\s\"(?P<version>[\d\.]+?)\""
path = ("sonoffdiy", "__version__.py")
return re.search(regex, read(*pa... | 30.859649 | 79 | 0.63502 | import os
import re
import sys
from setuptools import find_packages, setup
def get_version():
regex = r"__version__\s=\s\"(?P<version>[\d\.]+?)\""
path = ("sonoffdiy", "__version__.py")
return re.search(regex, read(*path)).group("version")
def read(*parts):
filename = os.path.join(os.path.abspath(o... | true | true |
1c0c4d22a5ce919ee4d3a00e58c5851e3a078d5c | 413 | py | Python | ojos/sys.py | ojos/python-core | d43f99d31c99493f0966ba7020bdc40f2dc2ed2e | [
"MIT"
] | null | null | null | ojos/sys.py | ojos/python-core | d43f99d31c99493f0966ba7020bdc40f2dc2ed2e | [
"MIT"
] | null | null | null | ojos/sys.py | ojos/python-core | d43f99d31c99493f0966ba7020bdc40f2dc2ed2e | [
"MIT"
] | null | null | null | from typing import Any, List
from .decorator import logging
@logging
def lazy_loader(name: str) -> Any:
mod: Any
try:
mod = __import__(name)
except ModuleNotFoundError:
mod_list: List[str] = name.split(".")
mod = __import__(".".join(mod_list[:-1]))
components: List[str] = nam... | 21.736842 | 49 | 0.612591 | from typing import Any, List
from .decorator import logging
@logging
def lazy_loader(name: str) -> Any:
mod: Any
try:
mod = __import__(name)
except ModuleNotFoundError:
mod_list: List[str] = name.split(".")
mod = __import__(".".join(mod_list[:-1]))
components: List[str] = nam... | true | true |
1c0c4e8b8fb06dbf29420cd2ddcecf0d3008c533 | 339 | py | Python | sentdex_data_analysis/pandas_intro.py | yull1860outlook/Data-Analysis | b777d9a75eb1acc4c899946d547e5585469a83ae | [
"MIT"
] | 4,358 | 2017-12-29T17:56:07.000Z | 2022-03-30T15:14:57.000Z | sentdex_data_analysis/pandas_intro.py | MarwanAmr509/Data-Analysis | 34a48f16f6be757ed3f35cb3fc458569023c9bd8 | [
"MIT"
] | 61 | 2018-01-18T17:50:46.000Z | 2022-03-09T20:16:01.000Z | sentdex_data_analysis/pandas_intro.py | MarwanAmr509/Data-Analysis | 34a48f16f6be757ed3f35cb3fc458569023c9bd8 | [
"MIT"
] | 3,689 | 2017-12-29T17:57:36.000Z | 2022-03-29T12:26:03.000Z | import pandas as pd
import datetime
from pandas_datareader import data
import matplotlib.pyplot as plt
from matplotlib import style
style.use("seaborn-dark")
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2016, 12, 31)
df = data.DataReader("GM", "yahoo", start, end)
print(df.head())
df["Adj Close"].... | 17.842105 | 47 | 0.734513 | import pandas as pd
import datetime
from pandas_datareader import data
import matplotlib.pyplot as plt
from matplotlib import style
style.use("seaborn-dark")
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2016, 12, 31)
df = data.DataReader("GM", "yahoo", start, end)
print(df.head())
df["Adj Close"].... | true | true |
1c0c50011fc72895d2a7f05a7ab0c62a23a368e6 | 1,830 | py | Python | app/user/api/views.py | HSAkash/Questionnaire-Docker | ee7f45ddc04e9ce72156a888255711df6a34720b | [
"MIT"
] | null | null | null | app/user/api/views.py | HSAkash/Questionnaire-Docker | ee7f45ddc04e9ce72156a888255711df6a34720b | [
"MIT"
] | null | null | null | app/user/api/views.py | HSAkash/Questionnaire-Docker | ee7f45ddc04e9ce72156a888255711df6a34720b | [
"MIT"
] | null | null | null | """rest freamwork import"""
from . import serializers
from rest_framework import status
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
from rest_framework_simplejwt.backends import TokenBackend
from rest_framework.response import... | 31.016949 | 74 | 0.722951 | from . import serializers
from rest_framework import status
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
from rest_framework_simplejwt.backends import TokenBackend
from rest_framework.response import Response
from rest_framewor... | true | true |
1c0c5186b9f1a4fae7349918d7dc9e3cbdaddd13 | 4,116 | py | Python | HatchBaby/grow.py | eskibars/hatchbabyble | 369b94efcc56607e0409882b945a8af7bd395d6b | [
"Apache-2.0"
] | null | null | null | HatchBaby/grow.py | eskibars/hatchbabyble | 369b94efcc56607e0409882b945a8af7bd395d6b | [
"Apache-2.0"
] | null | null | null | HatchBaby/grow.py | eskibars/hatchbabyble | 369b94efcc56607e0409882b945a8af7bd395d6b | [
"Apache-2.0"
] | null | null | null | import pygatt
import time
import collections
import threading
class Grow(object):
_mac_address = None
_timeout = None
_gatt_obj = None
_battery_level = 0
_num_samples = 0
_desired_samples = 1
_last_sample_num = None
_tare = None
_sample_list = None
_active_status = None
_hci_device = None
_resu... | 37.418182 | 166 | 0.707726 | import pygatt
import time
import collections
import threading
class Grow(object):
_mac_address = None
_timeout = None
_gatt_obj = None
_battery_level = 0
_num_samples = 0
_desired_samples = 1
_last_sample_num = None
_tare = None
_sample_list = None
_active_status = None
_hci_device = None
_resu... | true | true |
1c0c523d6858366bdefdbe843fecd5f20c7e3184 | 3,086 | py | Python | Lib/test/test_unpack.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 11,058 | 2018-05-29T07:40:06.000Z | 2022-03-31T11:38:42.000Z | Lib/test/test_unpack.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 2,105 | 2018-06-01T10:07:16.000Z | 2022-03-31T14:56:42.000Z | Lib/test/test_unpack.py | shawwn/cpython | 0ff8a3b374286d2218fc18f47556a5ace202dad3 | [
"0BSD"
] | 914 | 2018-07-27T09:36:14.000Z | 2022-03-31T19:56:34.000Z | doctests = """
Unpack tuple
>>> t = (1, 2, 3)
>>> a, b, c = t
>>> a == 1 and b == 2 and c == 3
True
Unpack list
>>> l = [4, 5, 6]
>>> a, b, c = l
>>> a == 4 and b == 5 and c == 6
True
Unpack implied tuple
>>> a, b, c = 7, 8, 9
>>> a == 7 and b == 8 and c == 9
True
Unpa... | 20.302632 | 79 | 0.54407 | doctests = """
Unpack tuple
>>> t = (1, 2, 3)
>>> a, b, c = t
>>> a == 1 and b == 2 and c == 3
True
Unpack list
>>> l = [4, 5, 6]
>>> a, b, c = l
>>> a == 4 and b == 5 and c == 6
True
Unpack implied tuple
>>> a, b, c = 7, 8, 9
>>> a == 7 and b == 8 and c == 9
True
Unpa... | true | true |
1c0c52cb4f9686a255d63670c72ff38a33abbbaa | 6,140 | py | Python | lang_compiler.py | jackmax/Open-PS2-Loader | f087febed7acf794390c36cc840f591ac064c759 | [
"AFL-3.0"
] | null | null | null | lang_compiler.py | jackmax/Open-PS2-Loader | f087febed7acf794390c36cc840f591ac064c759 | [
"AFL-3.0"
] | null | null | null | lang_compiler.py | jackmax/Open-PS2-Loader | f087febed7acf794390c36cc840f591ac064c759 | [
"AFL-3.0"
] | null | null | null | import json
from io import TextIOWrapper
from typing import Any, Dict
import yaml
TAB = 4*' '
YAML_DUMP_ARGS = dict(
encoding='utf-8',
allow_unicode=True,
sort_keys=False,
)
ENUM_START = """
#pragma once
// THIS FILE WAS AUTO-GENERATED.
enum {enum_name} {{
"""
STRINGS_START = """
#include "lang_autoge... | 34.886364 | 122 | 0.674267 | import json
from io import TextIOWrapper
from typing import Any, Dict
import yaml
TAB = 4*' '
YAML_DUMP_ARGS = dict(
encoding='utf-8',
allow_unicode=True,
sort_keys=False,
)
ENUM_START = """
#pragma once
// THIS FILE WAS AUTO-GENERATED.
enum {enum_name} {{
"""
STRINGS_START = """
#include "lang_autoge... | true | true |
1c0c536c4fb3d5090902faf4ba80522c3ae0fb9d | 7,307 | py | Python | python/pyspark/mllib/classification.py | kalpit/spark | b2ebf429e24566c29850c570f8d76943151ad78c | [
"Apache-2.0"
] | 24 | 2015-01-14T10:55:42.000Z | 2020-01-14T20:42:45.000Z | python/pyspark/mllib/classification.py | kalpit/spark | b2ebf429e24566c29850c570f8d76943151ad78c | [
"Apache-2.0"
] | 8 | 2021-04-14T14:44:23.000Z | 2021-04-18T02:44:19.000Z | python/pyspark/mllib/classification.py | kalpit/spark | b2ebf429e24566c29850c570f8d76943151ad78c | [
"Apache-2.0"
] | 22 | 2015-01-05T04:51:57.000Z | 2020-06-08T12:01:25.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 36.718593 | 95 | 0.631586 |
import numpy
from numpy import array, shape
from pyspark import SparkContext
from pyspark.mllib._common import \
_dot, _get_unmangled_rdd, _get_unmangled_double_vector_rdd, \
_serialize_double_matrix, _deserialize_double_matrix, \
_serialize_double_vector, _deserialize_double_vector, \
_get_initial_we... | true | true |
1c0c53a09dab096228ac0ef96bc4a7d1e81c449d | 6,164 | py | Python | tests/testapp/test_fields.py | jghyllebert/django-translated-fields | 5a812331b11342faafc99a9e707c16d33edb3fa2 | [
"BSD-3-Clause"
] | null | null | null | tests/testapp/test_fields.py | jghyllebert/django-translated-fields | 5a812331b11342faafc99a9e707c16d33edb3fa2 | [
"BSD-3-Clause"
] | null | null | null | tests/testapp/test_fields.py | jghyllebert/django-translated-fields | 5a812331b11342faafc99a9e707c16d33edb3fa2 | [
"BSD-3-Clause"
] | null | null | null | import re
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.forms.models import modelform_factory
from django.test import Client, TestCase
from django.utils.translation import deactivate_all... | 32.962567 | 85 | 0.623621 | import re
from django import forms
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.files.base import ContentFile
from django.forms.models import modelform_factory
from django.test import Client, TestCase
from django.utils.translation import deactivate_all... | true | true |
1c0c546dcf5813038ce4bd0ca90b253614e29d51 | 638 | py | Python | lap/distributions/debian_sid.py | kenkeiras/lxc-application-packages | 29f11b3185e5078e41cb433c647bd87d1537490f | [
"MIT"
] | 1 | 2020-02-16T15:02:18.000Z | 2020-02-16T15:02:18.000Z | lap/distributions/debian_sid.py | kenkeiras/lxc-application-packages | 29f11b3185e5078e41cb433c647bd87d1537490f | [
"MIT"
] | 6 | 2016-11-15T22:07:19.000Z | 2016-11-20T22:54:08.000Z | lap/distributions/debian_sid.py | kenkeiras/lxc-application-packages | 29f11b3185e5078e41cb433c647bd87d1537490f | [
"MIT"
] | null | null | null | # coding: utf-8
import lxc
from .debian_derived import *
class DebianStretch(DebianDerived):
def __init__(self):
DebianDerived.__init__(self, repositories=[
DebianRepository('http://httpredir.debian.org/debian', 'sid', ['main']),
],
identifier='debian.sid')
def create_ins... | 27.73913 | 84 | 0.529781 |
import lxc
from .debian_derived import *
class DebianStretch(DebianDerived):
def __init__(self):
DebianDerived.__init__(self, repositories=[
DebianRepository('http://httpredir.debian.org/debian', 'sid', ['main']),
],
identifier='debian.sid')
def create_instance(self, name... | true | true |
1c0c54e10a8780b787964f583c9f6ea987afe7a1 | 2,155 | py | Python | tests/test_recordcache.py | dairiki/lektorlib | 94337c51a7df18dcb2a5bf2aa4fa9b99ea842d44 | [
"MIT"
] | 1 | 2021-12-17T07:47:30.000Z | 2021-12-17T07:47:30.000Z | tests/test_recordcache.py | dairiki/lektorlib | 94337c51a7df18dcb2a5bf2aa4fa9b99ea842d44 | [
"MIT"
] | null | null | null | tests/test_recordcache.py | dairiki/lektorlib | 94337c51a7df18dcb2a5bf2aa4fa9b99ea842d44 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from lektor.sourceobj import VirtualSourceObject
from lektorlib.recordcache import get_or_create_virtual
class Test_get_or_create_virtual(object):
@pytest.fixture
def record(self, lektor_pad):
return lektor_pad.get('/about')
@pytest.fixture
def virtual... | 31.231884 | 75 | 0.643619 |
import pytest
from lektor.sourceobj import VirtualSourceObject
from lektorlib.recordcache import get_or_create_virtual
class Test_get_or_create_virtual(object):
@pytest.fixture
def record(self, lektor_pad):
return lektor_pad.get('/about')
@pytest.fixture
def virtual_source(self, record):
... | true | true |
1c0c5638b3cb8ec043367c6c0f3dd87a914e9e03 | 10,933 | py | Python | theano/gof/optdb.py | mrgloom/Theano | 018c7fa9a292858486b92e03a5d0a36cb3e45e1f | [
"BSD-3-Clause"
] | 1 | 2020-12-27T13:50:59.000Z | 2020-12-27T13:50:59.000Z | theano/gof/optdb.py | mrgloom/Theano | 018c7fa9a292858486b92e03a5d0a36cb3e45e1f | [
"BSD-3-Clause"
] | null | null | null | theano/gof/optdb.py | mrgloom/Theano | 018c7fa9a292858486b92e03a5d0a36cb3e45e1f | [
"BSD-3-Clause"
] | null | null | null | import sys
from theano.gof.python25 import DefaultOrderedDict
import numpy
from theano.compat.six import StringIO
from theano.gof import opt
from theano.configparser import AddConfigVar, FloatParam
from theano import config
AddConfigVar('optdb.position_cutoff',
'Where to stop eariler during optimization. It r... | 37.313993 | 79 | 0.587304 | import sys
from theano.gof.python25 import DefaultOrderedDict
import numpy
from theano.compat.six import StringIO
from theano.gof import opt
from theano.configparser import AddConfigVar, FloatParam
from theano import config
AddConfigVar('optdb.position_cutoff',
'Where to stop eariler during optimization. It r... | true | true |
1c0c598c0edfb525d1034e127416a7d94a15a6ff | 4,987 | py | Python | SmartNewsApp/views.py | GerardGuerrero/SmartNews | afa3a4dc4ed6d8cbf30ada8445c81f578a32f883 | [
"MIT"
] | null | null | null | SmartNewsApp/views.py | GerardGuerrero/SmartNews | afa3a4dc4ed6d8cbf30ada8445c81f578a32f883 | [
"MIT"
] | 3 | 2020-03-26T15:25:03.000Z | 2020-03-26T15:25:04.000Z | SmartNewsApp/views.py | GerardGuerrero/SmartNews | afa3a4dc4ed6d8cbf30ada8445c81f578a32f883 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.urls import reverse, reverse_lazy
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views.g... | 40.877049 | 102 | 0.629637 | from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.urls import reverse, reverse_lazy
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views.g... | true | true |
1c0c59c45ee7b45f87446726ead4c802e2fbb597 | 4,799 | py | Python | digits/tools/pb/label_image.py | Linda-liugongzi/DIGITS-digits-py3 | 6df5eb6972574a628b9544934518ec8dfa9c7439 | [
"BSD-3-Clause"
] | null | null | null | digits/tools/pb/label_image.py | Linda-liugongzi/DIGITS-digits-py3 | 6df5eb6972574a628b9544934518ec8dfa9c7439 | [
"BSD-3-Clause"
] | null | null | null | digits/tools/pb/label_image.py | Linda-liugongzi/DIGITS-digits-py3 | 6df5eb6972574a628b9544934518ec8dfa9c7439 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.646259 | 80 | 0.694936 |
import argparse
import numpy as np
import tensorflow as tf
def load_graph(model_file):
graph = tf.Graph()
graph_def = tf.GraphDef()
with open(model_file, "rb") as f:
graph_def.ParseFromString(f.read())
with graph.as_default():
tf.import_graph_def(graph_def)
return graph
def read_tensor_fro... | true | true |
1c0c5a8e0dfad33813efd733c31b8eedaa11a14d | 24,198 | py | Python | pgmpy/estimators/ConstraintBasedEstimator.py | marcotama/pgmpy | 4efbc255d2f68f59b0caaf0bc5f32030d29214e8 | [
"MIT"
] | 1 | 2019-02-13T12:06:45.000Z | 2019-02-13T12:06:45.000Z | pgmpy/estimators/ConstraintBasedEstimator.py | marcotama/pgmpy | 4efbc255d2f68f59b0caaf0bc5f32030d29214e8 | [
"MIT"
] | null | null | null | pgmpy/estimators/ConstraintBasedEstimator.py | marcotama/pgmpy | 4efbc255d2f68f59b0caaf0bc5f32030d29214e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from warnings import warn
from itertools import combinations
from pgmpy.base import UndirectedGraph
from pgmpy.models import BayesianModel
from pgmpy.estimators import StructureEstimator
from pgmpy.independencies import Independencies, IndependenceAssertion
class ConstraintBasedEstimator(Struc... | 45.229907 | 116 | 0.580833 |
from warnings import warn
from itertools import combinations
from pgmpy.base import UndirectedGraph
from pgmpy.models import BayesianModel
from pgmpy.estimators import StructureEstimator
from pgmpy.independencies import Independencies, IndependenceAssertion
class ConstraintBasedEstimator(StructureEstimator):
de... | true | true |
1c0c5cb8cd14bd7170f71eba3b2630053699d1c9 | 10,409 | py | Python | python/GafferCortexUI/ParameterisedHolderUI.py | brendanholt/gaffer | 921cc4c924fbfb4d0e09ae2a0640376728d68429 | [
"BSD-3-Clause"
] | null | null | null | python/GafferCortexUI/ParameterisedHolderUI.py | brendanholt/gaffer | 921cc4c924fbfb4d0e09ae2a0640376728d68429 | [
"BSD-3-Clause"
] | null | null | null | python/GafferCortexUI/ParameterisedHolderUI.py | brendanholt/gaffer | 921cc4c924fbfb4d0e09ae2a0640376728d68429 | [
"BSD-3-Clause"
] | 1 | 2020-12-21T12:33:49.000Z | 2020-12-21T12:33:49.000Z | ##########################################################################
#
# Copyright (c) 2011-2015, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2011-2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted prov... | 32.528125 | 162 | 0.683255 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
import re
import pipes
import fnmatch
import imath
import IECore
import Gaffer
import GafferUI
import GafferCortex
import GafferCortexUI
__nodeTypes = (
GafferCortex.ParameterisedHolderNode,
GafferCortex.ParameterisedHolderComputeNode,
... | true | true |
1c0c5ec48974fb636780b1cfd5e6ea9bb1acaa4d | 26,665 | py | Python | mathics/builtin/datentime.py | bnjones/Mathics | e1470e759e1440ce1137c27bd6cd98e20eccb2d0 | [
"Apache-2.0"
] | 1 | 2016-03-02T01:21:38.000Z | 2016-03-02T01:21:38.000Z | mathics/builtin/datentime.py | bnjones/Mathics | e1470e759e1440ce1137c27bd6cd98e20eccb2d0 | [
"Apache-2.0"
] | null | null | null | mathics/builtin/datentime.py | bnjones/Mathics | e1470e759e1440ce1137c27bd6cd98e20eccb2d0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Date and Time
"""
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
import six
from six.moves import range
import time
from datetime import datetime, timedelta
import dateutil.parser
from mathics.core.exp... | 31.556213 | 106 | 0.533396 |
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
import six
from six.moves import range
import time
from datetime import datetime, timedelta
import dateutil.parser
from mathics.core.expression import (Expression, Real, Symbol, String,
... | true | true |
1c0c5f695e213b290b00ae5bb4e61cba03720252 | 6,703 | py | Python | LAMARCK_ML/individuals/implementations/classifierIndividualOPACDG.py | JonasDHomburg/LAMARCK | 0e372c908ff59effc6fd68e6477d04c4d89e6c26 | [
"Apache-2.0",
"BSD-3-Clause"
] | 3 | 2019-09-20T08:03:47.000Z | 2021-05-10T11:02:09.000Z | LAMARCK_ML/individuals/implementations/classifierIndividualOPACDG.py | JonasDHomburg/LAMARCK_ML | 0e372c908ff59effc6fd68e6477d04c4d89e6c26 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | LAMARCK_ML/individuals/implementations/classifierIndividualOPACDG.py | JonasDHomburg/LAMARCK_ML | 0e372c908ff59effc6fd68e6477d04c4d89e6c26 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from LAMARCK_ML.architectures.functions import Dense, Softmax
from LAMARCK_ML.architectures.losses import Reduce, LossInterface
from LAMARCK_ML.architectures import OverParameterizedNeuralNetwork
from LAMARCK_ML.architectures.losses import SoftmaxCrossEntropyWithLogits, MeanSquaredError
from LAMARCK_ML.data_util import... | 42.694268 | 111 | 0.716246 | from LAMARCK_ML.architectures.functions import Dense, Softmax
from LAMARCK_ML.architectures.losses import Reduce, LossInterface
from LAMARCK_ML.architectures import OverParameterizedNeuralNetwork
from LAMARCK_ML.architectures.losses import SoftmaxCrossEntropyWithLogits, MeanSquaredError
from LAMARCK_ML.data_util import... | true | true |
1c0c5f8b55120a4773cfa2066b58a58a6e7720e9 | 11,241 | py | Python | src/mqtt_remote_method_calls.py | tanzichen0403/99-CapstoneProject-201920 | 3183f502cd2689dd0ef68da1d4ef0a495a90c51c | [
"MIT"
] | null | null | null | src/mqtt_remote_method_calls.py | tanzichen0403/99-CapstoneProject-201920 | 3183f502cd2689dd0ef68da1d4ef0a495a90c51c | [
"MIT"
] | null | null | null | src/mqtt_remote_method_calls.py | tanzichen0403/99-CapstoneProject-201920 | 3183f502cd2689dd0ef68da1d4ef0a495a90c51c | [
"MIT"
] | null | null | null | """
Library for making MQTT remote method calls.
The purpose of the MqttClient class is to allow one computer to call a method on an object
that lives on another computer. So if your PC wanted to call the arm_up method on an
instance of your robot, it could! Example:
# Assuming imports like these
impor... | 39.580986 | 117 | 0.665332 |
import json
import collections
import paho.mqtt.client as mqtt
LEGO_NUMBER = 17
class MqttClient(object):
def __init__(self, delegate=None):
self.client = mqtt.Client()
self.delegate = delegate
self.subscription_topic_name = None
self.publish_topic_name = None
def connect... | true | true |
1c0c5ff361465c221cdad5ef45af69120ab850d4 | 449 | py | Python | Lesson 2/Set 1/10.py | veecos1/Grinstead_And_Snell_Python | 1ee23dc4a8db14e5e139e4992b6a08b4d1ae7a48 | [
"MIT"
] | null | null | null | Lesson 2/Set 1/10.py | veecos1/Grinstead_And_Snell_Python | 1ee23dc4a8db14e5e139e4992b6a08b4d1ae7a48 | [
"MIT"
] | null | null | null | Lesson 2/Set 1/10.py | veecos1/Grinstead_And_Snell_Python | 1ee23dc4a8db14e5e139e4992b6a08b4d1ae7a48 | [
"MIT"
] | null | null | null | import random as ra
import numpy as np
import math
import matplotlib.pyplot as plt
simulations = 10000
waiting_time = 30
xs = []
x1 = np.arange(0, 1, 0.001)
y1 = [2 - 2*x for x in x1]
for i in range(simulations):
x = ra.random()
y = ra.random()
if x + y <= 1:
xs.append(x)
plt.hist(xs, bins=10, de... | 19.521739 | 52 | 0.64588 | import random as ra
import numpy as np
import math
import matplotlib.pyplot as plt
simulations = 10000
waiting_time = 30
xs = []
x1 = np.arange(0, 1, 0.001)
y1 = [2 - 2*x for x in x1]
for i in range(simulations):
x = ra.random()
y = ra.random()
if x + y <= 1:
xs.append(x)
plt.hist(xs, bins=10, de... | true | true |
1c0c601f68f8cbfe846b641dc24c629c8fe97388 | 966 | py | Python | time_conversions.py | Tanushka01/SmartAlarm-CA3 | 2b6afcd9595956c3a22b75a2f5be2fcd4227255c | [
"MIT"
] | null | null | null | time_conversions.py | Tanushka01/SmartAlarm-CA3 | 2b6afcd9595956c3a22b75a2f5be2fcd4227255c | [
"MIT"
] | null | null | null | time_conversions.py | Tanushka01/SmartAlarm-CA3 | 2b6afcd9595956c3a22b75a2f5be2fcd4227255c | [
"MIT"
] | null | null | null | from datetime import datetime
def minutes_to_seconds(minutes) -> int:
"""Converts minutes to seconds"""
return int(minutes) * 60
def hours_to_minutes(hours) -> int:
"""Converts hours to minutes"""
return int(hours) * 60
def hhmm_to_seconds(hhmm: str):
if len(hhmm.split(':')) != 2:
prin... | 27.6 | 83 | 0.638716 | from datetime import datetime
def minutes_to_seconds(minutes) -> int:
return int(minutes) * 60
def hours_to_minutes(hours) -> int:
return int(hours) * 60
def hhmm_to_seconds(hhmm: str):
if len(hhmm.split(':')) != 2:
print('Incorrect format. Argument must be formatted as HH:MM')
return ... | true | true |
1c0c60bfc2b9bb95b3cdc250135cd1bc2c307651 | 8,426 | py | Python | model/cl_args.py | cmu-snap/unfair | 3e1011c983f5815dfecc10eb0df1f6dde6f24751 | [
"BSD-3-Clause-Clear"
] | 2 | 2020-11-06T00:05:29.000Z | 2020-11-08T12:37:46.000Z | model/cl_args.py | cmu-snap/unfair | 3e1011c983f5815dfecc10eb0df1f6dde6f24751 | [
"BSD-3-Clause-Clear"
] | null | null | null | model/cl_args.py | cmu-snap/unfair | 3e1011c983f5815dfecc10eb0df1f6dde6f24751 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-11-08T12:37:48.000Z | 2020-11-08T12:37:48.000Z | """ Common command line arguments. """
import os
from os import path
import defaults
import models
def add_out(psr, psr_verify=lambda args: args):
"""
Adds an "out-dir" argument to the provided ArgumentParser, and returns it.
"""
def verify(args):
out_dir = args.out_dir
if not path.e... | 38.651376 | 80 | 0.622478 |
import os
from os import path
import defaults
import models
def add_out(psr, psr_verify=lambda args: args):
def verify(args):
out_dir = args.out_dir
if not path.exists(out_dir):
os.makedirs(out_dir)
return args
psr.add_argument(
"--out-dir", default=".",
... | true | true |
1c0c61a6ef1ae08e2c98a31f190cd62e3a10a50a | 2,523 | py | Python | ourdestiny/bungienet.py | Lewis-Trowbridge/Our-Destiny | aba5a04d4c6fb4f9579104e49a929050345fba7a | [
"MIT"
] | 5 | 2020-07-19T21:16:20.000Z | 2021-12-18T21:14:17.000Z | ourdestiny/bungienet.py | Lewis-Trowbridge/Our-Destiny | aba5a04d4c6fb4f9579104e49a929050345fba7a | [
"MIT"
] | 1 | 2021-02-07T15:39:07.000Z | 2021-02-07T15:39:15.000Z | ourdestiny/bungienet.py | Lewis-Trowbridge/Our-Destiny | aba5a04d4c6fb4f9579104e49a929050345fba7a | [
"MIT"
] | null | null | null | import datetime
class bungienetuser():
"""
A class representing a Bungie.net user account
:param bungienet_json: A JSON file obtained from the Bungie API for bungienet users
:type bungienet_json: dict
:ivar membership_id: The membership ID for this bungienet user
:type membership_id: string... | 42.762712 | 198 | 0.676179 | import datetime
class bungienetuser():
def __init__(self, bungienet_json):
self.membership_id = bungienet_json["membershipId"]
self.unique_name = bungienet_json["uniqueName"]
self.display_name = bungienet_json["displayName"]
self.about = bungienet_json["about"]
self.statu... | true | true |
1c0c61faf5828162a101e12d432943f1ba5faff9 | 6,705 | py | Python | molecule/default/tests/test_role.py | cenk1cenk2/ansible_role_antigen | d600e2f928ee58e04261544e8e65e088d7bdedbc | [
"MIT"
] | null | null | null | molecule/default/tests/test_role.py | cenk1cenk2/ansible_role_antigen | d600e2f928ee58e04261544e8e65e088d7bdedbc | [
"MIT"
] | null | null | null | molecule/default/tests/test_role.py | cenk1cenk2/ansible_role_antigen | d600e2f928ee58e04261544e8e65e088d7bdedbc | [
"MIT"
] | null | null | null | import pytest
@pytest.mark.parametrize('username', [
'test_usr1',
'test_usr2',
])
def test_antigen_install(host, username):
antigen = host.file('/home/' + username + '/.antigen')
assert antigen.exists
assert antigen.is_directory
assert antigen.user == username
assert antigen.group in [user... | 25.206767 | 75 | 0.677107 | import pytest
@pytest.mark.parametrize('username', [
'test_usr1',
'test_usr2',
])
def test_antigen_install(host, username):
antigen = host.file('/home/' + username + '/.antigen')
assert antigen.exists
assert antigen.is_directory
assert antigen.user == username
assert antigen.group in [user... | true | true |
1c0c6308c536ac73d93ea9b01fd3fcd4a669a12b | 10,445 | py | Python | conftest.py | JPchico/aiida-lammps | 8f618541784bbd6360efc653350570cf76398e83 | [
"MIT"
] | 7 | 2021-02-26T06:12:28.000Z | 2022-03-27T17:06:41.000Z | conftest.py | JPchico/aiida-lammps | 8f618541784bbd6360efc653350570cf76398e83 | [
"MIT"
] | 21 | 2020-09-18T14:03:16.000Z | 2022-02-14T10:48:40.000Z | conftest.py | JPchico/aiida-lammps | 8f618541784bbd6360efc653350570cf76398e83 | [
"MIT"
] | 5 | 2020-10-21T08:35:13.000Z | 2021-11-16T05:23:05.000Z | """
initialise a text database and profile
"""
from collections import namedtuple
import io
import os
import shutil
import tempfile
from aiida.plugins import DataFactory
import numpy as np
import pytest
from aiida_lammps.tests.utils import TEST_DIR, AiidaTestApp
pytest_plugins = ["aiida.manage.tests.pytest_fixtures"... | 32.742947 | 126 | 0.491719 | from collections import namedtuple
import io
import os
import shutil
import tempfile
from aiida.plugins import DataFactory
import numpy as np
import pytest
from aiida_lammps.tests.utils import TEST_DIR, AiidaTestApp
pytest_plugins = ["aiida.manage.tests.pytest_fixtures"]
def pytest_addoption(parser):
group = p... | true | true |
1c0c634b52be0f76e390776d02897e17b3a7dfa0 | 6,797 | py | Python | ns/shaper/two_rate_token_bucket.py | JinJinGuang/ns.py | 90415c4c83dd775cc50976c609ecbf551191cdf0 | [
"Apache-2.0"
] | null | null | null | ns/shaper/two_rate_token_bucket.py | JinJinGuang/ns.py | 90415c4c83dd775cc50976c609ecbf551191cdf0 | [
"Apache-2.0"
] | 1 | 2021-07-20T02:48:41.000Z | 2021-07-20T02:48:41.000Z | ns/shaper/two_rate_token_bucket.py | JinJinGuang/ns.py | 90415c4c83dd775cc50976c609ecbf551191cdf0 | [
"Apache-2.0"
] | null | null | null | """
Implments a two-rate token bucket shaper, with a bucket for committed information rate (CIR) and
another for the peak information rate (PIR).
"""
import simpy
class TwoRateTokenBucketShaper:
""" The token bucket size should be greater than the size of the largest packet that
can occur on input. If this is... | 41.699387 | 96 | 0.57393 | import simpy
class TwoRateTokenBucketShaper:
def __init__(self,
env,
cir,
cbs,
pir=None,
pbs=None,
zero_buffer=False,
zero_downstream_buffer=False,
debug=False):
self.sto... | true | true |
1c0c63914f36ef6568a6a2c88daf30ccd2c317e1 | 2,564 | py | Python | Source/Git/wb_git_status_view.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | 24 | 2017-03-23T06:24:02.000Z | 2022-03-19T13:35:44.000Z | Source/Git/wb_git_status_view.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | 14 | 2016-06-21T10:06:27.000Z | 2020-07-25T11:56:23.000Z | Source/Git/wb_git_status_view.py | barry-scott/git-workbench | 9f352875ab097ce5e45f85bf255b1fa02a196807 | [
"Apache-2.0"
] | 11 | 2016-12-25T12:36:16.000Z | 2022-03-23T14:25:25.000Z | '''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
===========================================================... | 38.268657 | 135 | 0.618175 | from PyQt5 import QtWidgets
import wb_tracked_qwidget
class WbGitStatusView(wb_tracked_qwidget.WbTrackedModelessQWidget):
def __init__( self, app, title ):
self.app = app
super().__init__()
self.setWindowTitle( title )
self.setWindowIcon( self.app.getAppQIcon() )
self.la... | true | true |
1c0c65115513e125b351f53048f75441684dde01 | 7,649 | py | Python | pythonspain/partners/models.py | python-spain/socios.es.python.org | 993153dcb3f35b928633c933a84e0330aae59524 | [
"MIT"
] | null | null | null | pythonspain/partners/models.py | python-spain/socios.es.python.org | 993153dcb3f35b928633c933a84e0330aae59524 | [
"MIT"
] | null | null | null | pythonspain/partners/models.py | python-spain/socios.es.python.org | 993153dcb3f35b928633c933a84e0330aae59524 | [
"MIT"
] | null | null | null | import datetime
import re
from typing import TYPE_CHECKING, Dict
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import gettext_lazy as _
from model_utils.models import TimeStampedModel
from options.models import Option
from pythonspain.core.models import ... | 31.220408 | 85 | 0.644529 | import datetime
import re
from typing import TYPE_CHECKING, Dict
from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import gettext_lazy as _
from model_utils.models import TimeStampedModel
from options.models import Option
from pythonspain.core.models import ... | true | true |
1c0c66c9a8b4963f523179f0c1f61c2383bd9a16 | 8,413 | py | Python | sdks/python/apache_beam/typehints/typed_pipeline_test_py3.py | jhalaria/beam | ee45cb03f6e6f3685ae0dccf75a8af4d259b3b1a | [
"Apache-2.0"
] | 1 | 2019-06-28T13:01:00.000Z | 2019-06-28T13:01:00.000Z | sdks/python/apache_beam/typehints/typed_pipeline_test_py3.py | jhalaria/beam | ee45cb03f6e6f3685ae0dccf75a8af4d259b3b1a | [
"Apache-2.0"
] | 7 | 2020-09-26T01:27:21.000Z | 2022-02-10T02:27:46.000Z | sdks/python/apache_beam/typehints/typed_pipeline_test_py3.py | jhalaria/beam | ee45cb03f6e6f3685ae0dccf75a8af4d259b3b1a | [
"Apache-2.0"
] | 1 | 2021-03-21T23:28:23.000Z | 2021-03-21T23:28:23.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.061674 | 80 | 0.661001 |
from __future__ import absolute_import
import unittest
import apache_beam as beam
from apache_beam import typehints
from apache_beam.typehints import decorators
decorators._enable_from_callable = True
class MainInputTest(unittest.TestCase):
def test_typed_dofn_method(self):
@typehints.with_input_types... | true | true |
1c0c680d01342acb187015db474dd156173f620c | 537 | py | Python | data/complex_data_processing/water_area_processing.py | KingOnTheStar/pytorch-CycleGAN-and-pix2pix | 9016b98d09902975b49a07c394bb0d5066e2aa55 | [
"BSD-3-Clause"
] | null | null | null | data/complex_data_processing/water_area_processing.py | KingOnTheStar/pytorch-CycleGAN-and-pix2pix | 9016b98d09902975b49a07c394bb0d5066e2aa55 | [
"BSD-3-Clause"
] | null | null | null | data/complex_data_processing/water_area_processing.py | KingOnTheStar/pytorch-CycleGAN-and-pix2pix | 9016b98d09902975b49a07c394bb0d5066e2aa55 | [
"BSD-3-Clause"
] | null | null | null | import cv2 as cv
from data.complex_data_processing.map_elem_split import *
def draw_water_area_mask(cv_img):
water_img = MapElemSplit.water_only(cv_img)
water_ch_img = water_img.copy()
water_ch_img[:, :, 1:] = 0
water_img = cv.cvtColor(water_img, cv.COLOR_RGB2GRAY)
kernel = cv.getStructuringElem... | 28.263158 | 72 | 0.735568 | import cv2 as cv
from data.complex_data_processing.map_elem_split import *
def draw_water_area_mask(cv_img):
water_img = MapElemSplit.water_only(cv_img)
water_ch_img = water_img.copy()
water_ch_img[:, :, 1:] = 0
water_img = cv.cvtColor(water_img, cv.COLOR_RGB2GRAY)
kernel = cv.getStructuringElem... | true | true |
1c0c6824bba5ebc46502f54282bcc3feb6d112f2 | 22,949 | py | Python | tests/tests_geomstats/test_discrete_curves.py | martinsipka/geomstats | e95461d44bb8dc3a8a2b6c90fd0028f4024aa8ec | [
"MIT"
] | 743 | 2018-05-23T02:23:29.000Z | 2022-03-29T22:59:22.000Z | tests/tests_geomstats/test_discrete_curves.py | martinsipka/geomstats | e95461d44bb8dc3a8a2b6c90fd0028f4024aa8ec | [
"MIT"
] | 1,119 | 2018-05-15T05:29:38.000Z | 2022-03-31T18:27:02.000Z | tests/tests_geomstats/test_discrete_curves.py | martinsipka/geomstats | e95461d44bb8dc3a8a2b6c90fd0028f4024aa8ec | [
"MIT"
] | 159 | 2018-05-23T17:49:24.000Z | 2022-03-30T16:44:47.000Z | """Unit tests for parameterized manifolds."""
import geomstats.backend as gs
import geomstats.datasets.utils as data_utils
import geomstats.tests
from geomstats.geometry.discrete_curves import ClosedDiscreteCurves, DiscreteCurves
from geomstats.geometry.euclidean import Euclidean
from geomstats.geometry.hypersphere im... | 40.120629 | 88 | 0.655279 |
import geomstats.backend as gs
import geomstats.datasets.utils as data_utils
import geomstats.tests
from geomstats.geometry.discrete_curves import ClosedDiscreteCurves, DiscreteCurves
from geomstats.geometry.euclidean import Euclidean
from geomstats.geometry.hypersphere import Hypersphere
class TestDiscreteCurves(ge... | true | true |
1c0c68ea762988e254802dbe4001bce615408582 | 30,406 | py | Python | greenberry/wallet/cc_wallet/cc_wallet.py | greenberrycoin/gbch-blockchain | d99843d720c6e7bd7baaf8bb4639a46dbb56caed | [
"Apache-2.0"
] | null | null | null | greenberry/wallet/cc_wallet/cc_wallet.py | greenberrycoin/gbch-blockchain | d99843d720c6e7bd7baaf8bb4639a46dbb56caed | [
"Apache-2.0"
] | null | null | null | greenberry/wallet/cc_wallet/cc_wallet.py | greenberrycoin/gbch-blockchain | d99843d720c6e7bd7baaf8bb4639a46dbb56caed | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import logging
import time
from dataclasses import replace
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Set
from blspy import AugSchemeMPL, G2Element
from greenberry.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from greenber... | 40.813423 | 118 | 0.650069 | from __future__ import annotations
import logging
import time
from dataclasses import replace
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Set
from blspy import AugSchemeMPL, G2Element
from greenberry.consensus.cost_calculator import calculate_cost_of_program, NPCResult
from greenber... | true | true |
1c0c6924b781ab2bda11993b3ebbd6ebafcfbcb8 | 24,393 | py | Python | AsynchronousActorCritic.py | KishanGitASU/A3C-RL-baseline-agent-for-Grid2Op-environment | 675a559d03d9532505d687e11e3a2922348cc767 | [
"MIT"
] | null | null | null | AsynchronousActorCritic.py | KishanGitASU/A3C-RL-baseline-agent-for-Grid2Op-environment | 675a559d03d9532505d687e11e3a2922348cc767 | [
"MIT"
] | 1 | 2020-06-05T09:51:34.000Z | 2020-06-22T10:36:46.000Z | AsynchronousActorCritic.py | KishanGitASU/A3C-RL-baseline-agent-for-Grid2Op-environment | 675a559d03d9532505d687e11e3a2922348cc767 | [
"MIT"
] | 3 | 2021-02-04T10:27:43.000Z | 2021-09-30T04:28:44.000Z | try:
import grid2op
import threading
import numpy as np
import time
import json
import copy
import os
from grid2op import make
from grid2op.Agent import MLAgent
from grid2op.Environment import Environment
from grid2op.Parameters import Parameters
from grid2op.... | 52.571121 | 218 | 0.655557 | try:
import grid2op
import threading
import numpy as np
import time
import json
import copy
import os
from grid2op import make
from grid2op.Agent import MLAgent
from grid2op.Environment import Environment
from grid2op.Parameters import Parameters
from grid2op.... | true | true |
1c0c695ee96b4c708112612102fc1b3020150ca7 | 7,893 | py | Python | Lib/site-packages/gensim/models/lda_dispatcher.py | little-carp/gobang | 1594921d16fed41a1d32e7b0a374465b7614750e | [
"bzip2-1.0.6"
] | 3 | 2018-11-27T06:30:23.000Z | 2021-05-30T15:56:32.000Z | Lib/site-packages/gensim/models/lda_dispatcher.py | little-carp/gobang | 1594921d16fed41a1d32e7b0a374465b7614750e | [
"bzip2-1.0.6"
] | 1 | 2018-11-15T02:00:31.000Z | 2021-12-06T02:20:32.000Z | Lib/site-packages/gensim/models/lda_dispatcher.py | little-carp/gobang | 1594921d16fed41a1d32e7b0a374465b7614750e | [
"bzip2-1.0.6"
] | 1 | 2018-04-04T12:38:47.000Z | 2018-04-04T12:38:47.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
USAGE: %(program)s SIZE_OF_JOBS_QUEUE
Dispatcher process which orchestrates distributed LDA computations. Run this \
script onl... | 36.711628 | 112 | 0.65007 |
from __future__ import with_statement
import argparse
import os
import sys
import logging
import threading
import time
from six import iteritems, itervalues
try:
from Queue import Queue
except ImportError:
from queue import Queue
import Pyro4
from gensim import utils
from gensim.models.lda_worker import LDA... | true | true |
1c0c699f39655bffc4b7c800b856a3e75a48aec6 | 4,509 | py | Python | glue/core/tests/test_aggregate.py | yuvallanger/glue | 1e27b47328db1e9a44eb6734e894a897c4b693be | [
"BSD-3-Clause"
] | null | null | null | glue/core/tests/test_aggregate.py | yuvallanger/glue | 1e27b47328db1e9a44eb6734e894a897c4b693be | [
"BSD-3-Clause"
] | null | null | null | glue/core/tests/test_aggregate.py | yuvallanger/glue | 1e27b47328db1e9a44eb6734e894a897c4b693be | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from numpy.testing import assert_allclose
import pytest
from ..aggregate import Aggregate
from .. import Data
class TestFunctions(object):
def setup_method(self, method):
self.d = Data(a=np.random.random((3, 3, 3)) - 0.5)
self.agg = Aggregate(self.d, 'a', 0, (0, 'y', 'x'), (0... | 31.753521 | 73 | 0.57108 | import numpy as np
from numpy.testing import assert_allclose
import pytest
from ..aggregate import Aggregate
from .. import Data
class TestFunctions(object):
def setup_method(self, method):
self.d = Data(a=np.random.random((3, 3, 3)) - 0.5)
self.agg = Aggregate(self.d, 'a', 0, (0, 'y', 'x'), (0... | true | true |
1c0c69b462080fdc8280ad4887ccf0c0c18f1daa | 1,079 | py | Python | ninfs/__main__.py | PMArkive/fuse-3ds | 08ce462bfe3fa2e774b717938320dd33209e6b19 | [
"MIT"
] | 1 | 2021-09-10T17:13:21.000Z | 2021-09-10T17:13:21.000Z | ninfs/__main__.py | PMArkive/fuse-3ds | 08ce462bfe3fa2e774b717938320dd33209e6b19 | [
"MIT"
] | null | null | null | ninfs/__main__.py | PMArkive/fuse-3ds | 08ce462bfe3fa2e774b717938320dd33209e6b19 | [
"MIT"
] | null | null | null | # This file is a part of ninfs.
#
# Copyright (c) 2017-2019 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
from os.path import dirname, realpath
from sys import argv, exit, path, version_info
# path fun times
path.insert... | 31.735294 | 101 | 0.679333 |
from os.path import dirname, realpath
from sys import argv, exit, path, version_info
path.insert(0, dirname(realpath(__file__)))
from main import exit_print_types, mount
if len(argv) < 2:
exit_print_types()
if argv[1] == '--install-desktop-entry':
from main import create_desktop_entry
prefix = None if l... | true | true |
1c0c6abba627bac37c518c9627e3c1c5383233de | 1,181 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/GLES1/QCOM/driver_control.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 3 | 2019-04-01T11:03:04.000Z | 2019-12-31T02:17:15.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GLES1/QCOM/driver_control.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 1 | 2021-02-08T20:34:54.000Z | 2021-02-08T20:34:54.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GLES1/QCOM/driver_control.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 1 | 2021-09-23T13:43:07.000Z | 2021-09-23T13:43:07.000Z | '''OpenGL extension QCOM.driver_control
This module customises the behaviour of the
OpenGL.raw.GLES1.QCOM.driver_control to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/QCOM/driver_control.txt
'''
from OpenGL import platform, co... | 39.366667 | 93 | 0.828959 | from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GLES1 import _types, _glgets
from OpenGL.raw.GLES1.QCOM.driver_control import *
from OpenGL.raw.GLES1.QCOM.driver_control import _EXTENSION_NAME
def glInitDriverControlQCOM():
from OpenGL import exten... | true | true |
1c0c6b02d54a4da0af741a88622d562057ebb476 | 56 | py | Python | merge/__init__.py | muthuubalakan/overlapping-intervals | 5563e4be4947117a52cd00fb997baf355b367e25 | [
"Apache-2.0"
] | null | null | null | merge/__init__.py | muthuubalakan/overlapping-intervals | 5563e4be4947117a52cd00fb997baf355b367e25 | [
"Apache-2.0"
] | null | null | null | merge/__init__.py | muthuubalakan/overlapping-intervals | 5563e4be4947117a52cd00fb997baf355b367e25 | [
"Apache-2.0"
] | null | null | null | from .merge_intervals import merge_overlapping_intervals | 56 | 56 | 0.928571 | from .merge_intervals import merge_overlapping_intervals | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.