hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ba6992ae0c7473a041d6112fdd582d34e53c954a | 4,968 | py | Python | tests/test_protocol.py | callumforrester/graphql-ws-next | 2ad932c326d5897d9be0e53eb431c8da36348b41 | [
"MIT"
] | 8 | 2018-10-12T14:22:22.000Z | 2020-04-25T08:25:09.000Z | tests/test_protocol.py | dfee/graphql-next-ws | 2ad932c326d5897d9be0e53eb431c8da36348b41 | [
"MIT"
] | 2 | 2019-03-08T08:51:38.000Z | 2021-12-02T16:27:44.000Z | tests/test_protocol.py | dfee/graphql-next-ws | 2ad932c326d5897d9be0e53eb431c8da36348b41 | [
"MIT"
] | 1 | 2021-05-25T15:50:08.000Z | 2021-05-25T15:50:08.000Z | import graphql
import pytest
from graphql_ws.protocol import (
OperationMessage,
OperationMessagePayload,
GQLMsgType,
)
# pylint: disable=R0201, no-self-use
class TestOperationMessagePayload:
def test_attrs(self):
params = {
"query": "query myTest { test }",
"variable... | 33.567568 | 80 | 0.527778 |
02ed5517ca895ab070a89f8810f77dadcff9212b | 10,129 | py | Python | tensorflow/python/__init__.py | M155K4R4/Tensorflow | e5e03ef3148303b3dfed89a1492dedf92b45be25 | [
"Apache-2.0"
] | 5 | 2018-05-08T20:42:11.000Z | 2019-11-17T13:00:54.000Z | tensorflow/python/__init__.py | M155K4R4/Tensorflow | e5e03ef3148303b3dfed89a1492dedf92b45be25 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/__init__.py | M155K4R4/Tensorflow | e5e03ef3148303b3dfed89a1492dedf92b45be25 | [
"Apache-2.0"
] | 2 | 2018-03-01T01:28:10.000Z | 2018-03-01T02:07:08.000Z | # Copyright 2015 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... | 31.653125 | 92 | 0.758515 |
b80ade4b3e12553f391fc562ba41ce58c7594df6 | 4,416 | py | Python | tests/test_celery.py | espritgames/celery-types | 4d4064eb78d2a1a3e79a5fefe111f59ad4d3c9b9 | [
"Apache-2.0"
] | null | null | null | tests/test_celery.py | espritgames/celery-types | 4d4064eb78d2a1a3e79a5fefe111f59ad4d3c9b9 | [
"Apache-2.0"
] | null | null | null | tests/test_celery.py | espritgames/celery-types | 4d4064eb78d2a1a3e79a5fefe111f59ad4d3c9b9 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import errno
import sys
from typing import Iterator, Protocol
import celery
from celery import Celery, shared_task, signature
from celery.app.task import Task
from celery.canvas import Signature
from celery.exceptions import Reject
from celery.schedules import crontab
from celery.ut... | 21.753695 | 87 | 0.634284 |
dd1daed782a722465e3b276202ee3debeb34e0e1 | 451 | py | Python | src/dakan_api_graph/routers/health.py | navikt/dakan-api-graph | 63fad724ae40f2ebb494373e79965628a019c1d6 | [
"MIT"
] | null | null | null | src/dakan_api_graph/routers/health.py | navikt/dakan-api-graph | 63fad724ae40f2ebb494373e79965628a019c1d6 | [
"MIT"
] | 22 | 2020-06-24T05:08:34.000Z | 2020-10-19T04:44:12.000Z | src/dakan_api_graph/routers/health.py | navikt/data-catalog-api | 63fad724ae40f2ebb494373e79965628a019c1d6 | [
"MIT"
] | null | null | null | from fastapi import APIRouter, status
from fastapi.responses import JSONResponse
router = APIRouter()
@router.get("/isAlive", include_in_schema=False)
def is_alive_status():
"""
Alive check
"""
return JSONResponse(status_code=status.HTTP_200_OK, content={})
@router.get("/isReady", include_in_schema... | 21.47619 | 67 | 0.716186 |
7f504d70dfcf06e9f19927e782a824f08114bd5b | 646 | py | Python | framework/fota/platform/ucube.py | ghsecuritylab/AliOS_modbus | 990f12ec91ecceea7e0190e31237cc04f7a665fd | [
"Apache-2.0"
] | 54 | 2018-10-10T01:43:10.000Z | 2022-02-26T01:36:40.000Z | framework/fota/platform/ucube.py | ghsecuritylab/AliOS_modbus | 990f12ec91ecceea7e0190e31237cc04f7a665fd | [
"Apache-2.0"
] | 4 | 2019-04-28T04:07:47.000Z | 2021-07-05T13:30:01.000Z | framework/fota/platform/ucube.py | ghsecuritylab/AliOS_modbus | 990f12ec91ecceea7e0190e31237cc04f7a665fd | [
"Apache-2.0"
] | 48 | 2018-08-14T07:12:33.000Z | 2022-03-01T03:52:32.000Z | src = Split('''
ota_platform_os.c
''')
component = aos_component('fota_platform', src)
component.add_includes('.')
@post_config
def fota_platform_post_config(component):
comp_names = [comp.name for comp in aos_global_config.components]
if 'alink' in comp_names:
component.add_comp_deps('framework/f... | 29.363636 | 69 | 0.732198 |
e5edf0ce0059cc6ce0d3db7eabe2fd9b6e0a3a5b | 126 | py | Python | Demo Program/ex1.py | HelloYeew/helloyeew-lab-computer-programming-i | 60b05072f32f23bab4a336b506ba7f66e52c045d | [
"MIT"
] | null | null | null | Demo Program/ex1.py | HelloYeew/helloyeew-lab-computer-programming-i | 60b05072f32f23bab4a336b506ba7f66e52c045d | [
"MIT"
] | null | null | null | Demo Program/ex1.py | HelloYeew/helloyeew-lab-computer-programming-i | 60b05072f32f23bab4a336b506ba7f66e52c045d | [
"MIT"
] | null | null | null | def print_hello(name):
print("Hello," + name) # error cuz + must use string
name = 'Ann'
print_hello(name)
print_hello(7) | 21 | 56 | 0.690476 |
53419f45e573e4c72e4a34312bc7b24248d103ba | 3,288 | py | Python | examples/undocumented/python/graphical/multiclass_qda.py | ShankarNara/shogun | 8ab196de16b8d8917e5c84770924c8d0f5a3d17c | [
"BSD-3-Clause"
] | 2 | 2015-01-13T15:18:27.000Z | 2015-05-01T13:28:48.000Z | examples/undocumented/python/graphical/multiclass_qda.py | ShankarNara/shogun | 8ab196de16b8d8917e5c84770924c8d0f5a3d17c | [
"BSD-3-Clause"
] | null | null | null | examples/undocumented/python/graphical/multiclass_qda.py | ShankarNara/shogun | 8ab196de16b8d8917e5c84770924c8d0f5a3d17c | [
"BSD-3-Clause"
] | 1 | 2020-06-02T09:15:40.000Z | 2020-06-02T09:15:40.000Z | """
Shogun demo
Fernando J. Iglesias Garcia
"""
import numpy as np
import matplotlib as mpl
import pylab
import util
from scipy import linalg
from shogun import QDA
from shogun import RealFeatures, MulticlassLabels
# colormap
cmap = mpl.colors.LinearSegmentedColormap('color_classes',
{'red': [(0, 1, 1),
(1... | 27.864407 | 86 | 0.608577 |
1d88ff2f19c547b52af367b081354284bd65b5d4 | 1,104 | py | Python | tests/playlist/test_playlist_init.py | fdenivac/python-qobuz | 7a70d12b80d022541af5e210f75d8943c8bd54a1 | [
"MIT"
] | 11 | 2020-04-19T00:47:47.000Z | 2022-02-04T15:39:08.000Z | tests/playlist/test_playlist_init.py | fdenivac/python-qobuz | 7a70d12b80d022541af5e210f75d8943c8bd54a1 | [
"MIT"
] | 1 | 2020-05-02T17:11:32.000Z | 2020-05-02T17:11:32.000Z | tests/playlist/test_playlist_init.py | netsuso/python-qobuz | 13a9bfeca2a23b5819f6bdaaad9edf7309ab9443 | [
"MIT"
] | 4 | 2020-04-20T16:36:21.000Z | 2021-03-20T01:56:48.000Z | import pytest
import qobuz
import responses
from tests.resources.responses import playlist_create_json
from tests.resources.fixtures import playlist
@pytest.fixture
def app():
qobuz.api.register_app(app_id="request_from_api@qobuz.com")
def get_url(playlist_id):
return (
qobuz.api.API_URL
+ ... | 25.090909 | 70 | 0.689312 |
312e3ee6f24ad3db3f8a0d93a5701554ea248443 | 1,018 | py | Python | MIT 6.046/lecture 3/fft.py | BrolyDBZ/MIT-6.046J | a47e117104ed2db36591bb625c4cc169cd91812e | [
"MIT"
] | 1 | 2021-12-22T16:30:57.000Z | 2021-12-22T16:30:57.000Z | MIT 6.046/lecture 3/fft.py | BrolyDBZ/MIT-6.046J | a47e117104ed2db36591bb625c4cc169cd91812e | [
"MIT"
] | null | null | null | MIT 6.046/lecture 3/fft.py | BrolyDBZ/MIT-6.046J | a47e117104ed2db36591bb625c4cc169cd91812e | [
"MIT"
] | null | null | null | import numpy as np
import math
def DFT(A):
n=len(A)
if n==1:
return A
A0=[]
A1=[]
nunity_root=np.exp(complex(0,2*math.pi/n))
omega=1
for i in range(n):
if i%2==0:
A0.append(A[i])
else:
A1.append(A[i])
A0=DFT(A0)
A1=DFT... | 21.208333 | 50 | 0.452849 |
8a337e4961ee89474ef7da7e2c7b010b73a28b70 | 2,989 | py | Python | tests/test_geneic.py | garyvdm/mockaioredis | 98d215ec725308d0b8041bcd63efdbfa851eb856 | [
"Apache-2.0"
] | null | null | null | tests/test_geneic.py | garyvdm/mockaioredis | 98d215ec725308d0b8041bcd63efdbfa851eb856 | [
"Apache-2.0"
] | null | null | null | tests/test_geneic.py | garyvdm/mockaioredis | 98d215ec725308d0b8041bcd63efdbfa851eb856 | [
"Apache-2.0"
] | null | null | null | import pytest
@pytest.mark.asyncio
async def test_exists(redis):
redis._redis.set('foo', 'bar')
redis._redis.set('baz', 'blub')
val = await redis.exists('blargh')
assert 0 == val
val = await redis.exists('foo')
assert 1 == val
val = await redis.exists('foo', 'baz')
assert 2 == val
... | 23.535433 | 78 | 0.618602 |
8384603aa5bbe9c3e007e9ed87a1ba577f650d21 | 23,299 | py | Python | arviz/plots/backends/matplotlib/forestplot.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 55 | 2015-07-29T12:06:34.000Z | 2018-03-17T05:42:01.000Z | arviz/plots/backends/matplotlib/forestplot.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 11 | 2015-08-07T20:56:41.000Z | 2018-03-21T15:24:08.000Z | arviz/plots/backends/matplotlib/forestplot.py | zaxtax/arviz | c78deefeeb355d3cee11a93fc148f9198dde8b35 | [
"Apache-2.0"
] | 17 | 2015-07-29T13:55:01.000Z | 2018-03-02T17:16:12.000Z | """Matplotlib forestplot."""
from collections import OrderedDict, defaultdict
from itertools import tee
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import to_rgba
from matplotlib.lines import Line2D
from ....stats import hdi
from ....stats.density_utils import get_bins, histogram, kde
fr... | 35.355083 | 100 | 0.527233 |
03c52b39b3d242050edcaf45e57df123e6ed3e75 | 421 | py | Python | app/user/serializers.py | cocojen/recipe-app-api | ee26ab0d8dcc7cde561c109ff361c14185052e4c | [
"MIT"
] | null | null | null | app/user/serializers.py | cocojen/recipe-app-api | ee26ab0d8dcc7cde561c109ff361c14185052e4c | [
"MIT"
] | null | null | null | app/user/serializers.py | cocojen/recipe-app-api | ee26ab0d8dcc7cde561c109ff361c14185052e4c | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = get_user_model()
fields = ('email', 'password', 'name')
extra_kwargs = {'password': {'write_only': True, 'min_length': 5}}
def... | 28.066667 | 74 | 0.703088 |
691bf78c5d8503536f2fb70336f6912bfcb3a628 | 4,932 | py | Python | deploy_config_generator/output/kube_deployment.py | ApplauseAQI/applause-deploy-config-generator | 46f957fbfe991677f920d5db74b0670385b6e505 | [
"MIT"
] | 3 | 2019-04-05T14:16:17.000Z | 2021-06-25T20:53:03.000Z | deploy_config_generator/output/kube_deployment.py | ApplauseAQI/applause-deploy-config-generator | 46f957fbfe991677f920d5db74b0670385b6e505 | [
"MIT"
] | 6 | 2019-04-04T20:20:16.000Z | 2021-09-27T21:04:39.000Z | deploy_config_generator/output/kube_deployment.py | ApplauseAQI/applause-deploy-config-generator | 46f957fbfe991677f920d5db74b0670385b6e505 | [
"MIT"
] | null | null | null | import copy
from deploy_config_generator.utils import yaml_dump, underscore_to_camelcase
from deploy_config_generator.output import kube_common
class OutputPlugin(kube_common.OutputPlugin):
NAME = 'kube_deployment'
DESCR = 'Kubernetes deployment output plugin'
FILE_EXT = '.yaml'
DEFAULT_CONFIG = {
... | 40.760331 | 133 | 0.449108 |
7afd7abdabace18749425f33d374991f66f2097b | 9,314 | py | Python | ax/core/outcome_constraint.py | trsvchn/Ax | 0b430641c6b33920757dd09ae4318ea487fb4136 | [
"MIT"
] | 1,803 | 2019-05-01T16:04:15.000Z | 2022-03-31T16:01:29.000Z | ax/core/outcome_constraint.py | trsvchn/Ax | 0b430641c6b33920757dd09ae4318ea487fb4136 | [
"MIT"
] | 810 | 2019-05-01T07:17:47.000Z | 2022-03-31T23:58:46.000Z | ax/core/outcome_constraint.py | trsvchn/Ax | 0b430641c6b33920757dd09ae4318ea487fb4136 | [
"MIT"
] | 220 | 2019-05-01T05:37:22.000Z | 2022-03-29T04:30:45.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import logging
from typing import Dict, Optional, List, Iterable, Tuple
from ax.co... | 34.624535 | 87 | 0.62959 |
87f01eabc7561f30a289f922cfe9c3ef2e9b6eb4 | 11,817 | py | Python | intersight/model/iaas_ucsd_managed_infra_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/iaas_ucsd_managed_infra_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/iaas_ucsd_managed_infra_all_of.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 52.754464 | 1,678 | 0.632817 |
90e0ee09955b5846c9194101cd64d38b9360fc09 | 79 | py | Python | contests/aizu/itp1/4a.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | contests/aizu/itp1/4a.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | contests/aizu/itp1/4a.py | conao3/coder | 2cdb610fec013da88a3470d460108e8a9b462445 | [
"CC0-1.0"
] | null | null | null | a, b = map(int, input().split())
print("{} {} {:.5f}".format(a//b, a%b, a/b))
| 19.75 | 44 | 0.468354 |
e71f193c6963c1bc4c45cb678e0caabb8cd9be21 | 479 | py | Python | src/category/urls.py | pfskiev/lisbon | c756d0cd2f8fd2405c7123dab029748da75b6e5b | [
"MIT"
] | null | null | null | src/category/urls.py | pfskiev/lisbon | c756d0cd2f8fd2405c7123dab029748da75b6e5b | [
"MIT"
] | 1 | 2017-11-07T09:09:28.000Z | 2017-11-07T09:09:28.000Z | src/category/urls.py | pfskiev/lisbon | c756d0cd2f8fd2405c7123dab029748da75b6e5b | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = (
# url(r'^$', views.category_list, name='list'),
# url(r'^create/', views.category_create, name='create'),
# url(r'^(?P<pk>[0-9]+)/$', views.category_detail, name='detail'),
# url(r'^(?P<pk>[0-9]+)/edit/$', views.category_update, name... | 31.933333 | 77 | 0.592902 |
18288ef7fba16745777442b9c28a06043aeeee9d | 431 | py | Python | hello.py | polydojo/polydojo | 11a70dcdfec1189a39e12401c6e61c8bf77d8c27 | [
"BSD-3-Clause"
] | null | null | null | hello.py | polydojo/polydojo | 11a70dcdfec1189a39e12401c6e61c8bf77d8c27 | [
"BSD-3-Clause"
] | null | null | null | hello.py | polydojo/polydojo | 11a70dcdfec1189a39e12401c6e61c8bf77d8c27 | [
"BSD-3-Clause"
] | null | null | null | import bottle;
app = bottle.Bottle();
@app.get("/")
def get_root ():
return "Hello, World!";
@app.get("/node_modules/<path:path>")
def get_node_modules (path):
return bottle.static_file(path, root="./node_modules");
@app.get("/front/<path:path>")
def get_front (path):
return bottle.static_file(path, roo... | 22.684211 | 68 | 0.670534 |
daed58fae70acff21973c928dda63ef3fab9eedd | 2,041 | py | Python | tests/checks/integration/test_gearmand.py | joewilliams/dd-agent | 489902eeef5b2f66c4878cb8a42e79c54883c042 | [
"BSD-3-Clause"
] | 11 | 2017-09-13T03:31:51.000Z | 2019-06-05T19:38:09.000Z | tests/checks/integration/test_gearmand.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 3 | 2021-02-08T20:55:47.000Z | 2022-03-29T22:04:12.000Z | tests/checks/integration/test_gearmand.py | fotinakis/dd-agent | b8642a36f26190b7bed3208e145bd3ac4cc4f59b | [
"BSD-3-Clause"
] | 7 | 2016-09-06T18:13:16.000Z | 2020-11-13T10:54:13.000Z | # 3rd party
from nose.plugins.attrib import attr
# Agent
from checks import AgentCheck
from tests.checks.common import AgentCheckTest
@attr(requires='gearman')
class GearmanTestCase(AgentCheckTest):
CHECK_NAME = "gearmand"
def test_metrics(self):
tags = ['first_tag', 'second_tag']
service_ch... | 36.446429 | 82 | 0.634003 |
1f56946182879bbe8480c84fe14b9d88b1959eb2 | 541 | py | Python | tests/resources/test_transactions.py | cuenca-mx/arcus-python | 71e35728d75d9413eb62c18bff0abb3a18bf80ac | [
"MIT"
] | 4 | 2018-10-30T20:23:44.000Z | 2020-06-29T13:56:34.000Z | tests/resources/test_transactions.py | cuenca-mx/arcus-python | 71e35728d75d9413eb62c18bff0abb3a18bf80ac | [
"MIT"
] | 131 | 2018-10-29T17:13:49.000Z | 2022-03-30T16:05:21.000Z | tests/resources/test_transactions.py | cuenca-mx/arcus-python | 71e35728d75d9413eb62c18bff0abb3a18bf80ac | [
"MIT"
] | 2 | 2019-09-22T03:43:29.000Z | 2021-04-19T09:20:24.000Z | import copy
import pytest
from arcus.resources import Transaction
@pytest.mark.vcr
def test_transactions_list(client):
transactions = client.transactions.list()
assert transactions
assert type(transactions) is list
assert all(isinstance(txn, Transaction) for txn in transactions)
@pytest.mark.vcr
d... | 23.521739 | 68 | 0.756007 |
0610f2a234d67f00f2c4241ebf0e136fa97a2bc5 | 408 | py | Python | app/app/tests.py | ahmedhesham2/Recipe-App | 47c13807cb37693aa91ff6a34bfa04e69646a162 | [
"MIT"
] | null | null | null | app/app/tests.py | ahmedhesham2/Recipe-App | 47c13807cb37693aa91ff6a34bfa04e69646a162 | [
"MIT"
] | null | null | null | app/app/tests.py | ahmedhesham2/Recipe-App | 47c13807cb37693aa91ff6a34bfa04e69646a162 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from django.test import TestCase
from app.calc import add, subtract
class CalcTests(TestCase):
def test_add_numbers(self):
"""Test that values are added together"""
self.assertEqual(add(3, 8), 11)
def test_subtract_numbers(self):
"""Test t... | 20.4 | 58 | 0.656863 |
74e65794535e1dd0c84ef14379096d4d394265a9 | 16,015 | py | Python | cFSPlib/cfsp_cluster.py | cloudFPGA/cFSP | f6d93ff8eddb774711064e59e4dc4f931d803d5f | [
"Apache-2.0"
] | 2 | 2022-01-31T10:19:13.000Z | 2022-02-15T06:07:04.000Z | cFSPlib/cfsp_cluster.py | cloudFPGA/cFSP | f6d93ff8eddb774711064e59e4dc4f931d803d5f | [
"Apache-2.0"
] | 1 | 2022-01-24T16:16:52.000Z | 2022-01-25T19:21:52.000Z | cFSPlib/cfsp_cluster.py | cloudFPGA/cFSP | f6d93ff8eddb774711064e59e4dc4f931d803d5f | [
"Apache-2.0"
] | null | null | null | # *****************************************************************************
# * cloudFPGA
# * Copyright 2016 -- 2022 IBM Corporation
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * ... | 54.84589 | 301 | 0.571527 |
a406d0d9e44e7168a8d5ea66963cde50263a2598 | 2,364 | py | Python | src/tunning/std_param.py | LIAMF-USP/Word2vec-pt | d3e705762de0f72d0e4ac0ccdde2a94ed897789c | [
"MIT"
] | 16 | 2017-09-26T21:39:41.000Z | 2021-11-10T03:26:07.000Z | src/tunning/std_param.py | felipessalvatore/Word2vec-pt | d3e705762de0f72d0e4ac0ccdde2a94ed897789c | [
"MIT"
] | 1 | 2017-08-05T14:33:51.000Z | 2017-08-05T14:33:51.000Z | src/tunning/std_param.py | LIAMF-USP/Word2vec-pt | d3e705762de0f72d0e4ac0ccdde2a94ed897789c | [
"MIT"
] | 7 | 2017-08-14T19:53:35.000Z | 2020-05-08T18:43:26.000Z | import os
import sys
from random import randint
import numpy as np
import inspect
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from da... | 29.185185 | 86 | 0.615905 |
a27145138114923b8a9baa657a71a059bb99cab2 | 219 | py | Python | ABC/abc151-abc200/abc200/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 2 | 2020-06-12T09:54:23.000Z | 2021-05-04T01:34:07.000Z | ABC/abc151-abc200/abc200/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | 961 | 2020-06-23T07:26:22.000Z | 2022-03-31T21:34:52.000Z | ABC/abc151-abc200/abc200/a/main.py | KATO-Hiro/AtCoder | cbbdb18e95110b604728a54aed83a6ed6b993fde | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
def main():
import sys
input = sys.stdin.readline
n = int(input())
p, q = divmod(n, 100)
if q >= 1:
p += 1
print(p)
if __name__ == "__main__":
main()
| 10.428571 | 30 | 0.465753 |
c5604ef407b330aa684defbeff1d76cedbece4a5 | 217 | py | Python | main.py | majikpig/ubtech | 8d21f4b522e06f998bfdf3b1947db23bfc349e3d | [
"MIT"
] | null | null | null | main.py | majikpig/ubtech | 8d21f4b522e06f998bfdf3b1947db23bfc349e3d | [
"MIT"
] | null | null | null | main.py | majikpig/ubtech | 8d21f4b522e06f998bfdf3b1947db23bfc349e3d | [
"MIT"
] | 1 | 2019-03-23T16:08:30.000Z | 2019-03-23T16:08:30.000Z | #the following lines will allow you to use buttons and leds
import btnlib as btn
import ledlib as led
import time
led.startup()
while btn.isOn(btn.switch) :
#put your code here
print "Goodbye"
btn.GPIO.cleanup()
| 16.692308 | 59 | 0.75576 |
836aec0e6c99fd6ed83b138668cff04229a44dc7 | 1,014 | py | Python | leetcode/[cutz]num of islands.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | 3 | 2019-11-26T14:31:01.000Z | 2020-01-10T18:19:46.000Z | leetcode/[cutz]num of islands.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | leetcode/[cutz]num of islands.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | class Solution:
row_dir, col_dir = [1, 0, -1, 0], [0, 1, 0, -1]
def numIslands(self, grid: List[List[str]]) -> int:
if not grid:
return 0
self.visited = [[False] * len(grid[0]) for _ in range(len(grid))]
self.row_num = len(grid)
self.col_num = len(grid[0])
... | 32.709677 | 73 | 0.457594 |
fb158c7b683ba775b6bed9d39dda08fe2cdc0cfa | 20 | py | Python | Games/Modulo-01/Python/04-Loops/Aula 07 (1).py | raphoshi/Microlon | 2ff9a8e8bb26a2a6363582d465030fd0a03d4fdb | [
"Apache-2.0"
] | null | null | null | Games/Modulo-01/Python/04-Loops/Aula 07 (1).py | raphoshi/Microlon | 2ff9a8e8bb26a2a6363582d465030fd0a03d4fdb | [
"Apache-2.0"
] | null | null | null | Games/Modulo-01/Python/04-Loops/Aula 07 (1).py | raphoshi/Microlon | 2ff9a8e8bb26a2a6363582d465030fd0a03d4fdb | [
"Apache-2.0"
] | null | null | null | print ('olá mundo!') | 20 | 20 | 0.65 |
a88693791fee991c4fd3486b1cf5f412422cd5b7 | 9,221 | py | Python | pytype/tests/test_builtins3.py | OrBin/pytype | 52bf1b5b03e6c3caf39bf0f187980970d70fd536 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_builtins3.py | OrBin/pytype | 52bf1b5b03e6c3caf39bf0f187980970d70fd536 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_builtins3.py | OrBin/pytype | 52bf1b5b03e6c3caf39bf0f187980970d70fd536 | [
"Apache-2.0"
] | null | null | null | """Tests of builtins (in pytd/builtins/{version}/__builtins__.pytd).
File 3/3. Split into parts to enable better test parallelism.
"""
from pytype import abstract_utils
from pytype import file_utils
from pytype.tests import test_base
class BuiltinTests3(test_base.TargetIndependentTest):
"""Tests for builtin meth... | 24.458886 | 80 | 0.505043 |
87c9b62ba7c418e6fe956eac20cfd05a4b547379 | 604 | py | Python | djstripe/migrations/0027_auto_20170308_0620.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | djstripe/migrations/0027_auto_20170308_0620.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | djstripe/migrations/0027_auto_20170308_0620.py | star302b/dj-stripe | 1d26394414515c4f3ada7132b0eae8f793a0badd | [
"MIT"
] | null | null | null | # Generated by Django 1.10.6 on 2017-03-08 07:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('djstripe', '0026_idempotencykey'),
]
operations = [
migrations.Alt... | 28.761905 | 195 | 0.680464 |
e533238c208525ac7e3912b7ae8f0252de52c309 | 9,929 | py | Python | src/dials/algorithms/indexing/nave_parameters.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-10T17:28:16.000Z | 2021-12-10T17:28:16.000Z | src/dials/algorithms/indexing/nave_parameters.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | null | null | null | src/dials/algorithms/indexing/nave_parameters.py | dials-src/dials | 25055c1f6164dc33e672e7c5c6a9c5a35e870660 | [
"BSD-3-Clause"
] | 1 | 2021-12-07T12:39:04.000Z | 2021-12-07T12:39:04.000Z | from __future__ import annotations
import logging
import math
from scitbx.matrix import col, sqr
from dials.algorithms.indexing import DialsIndexError
from dials.array_family import flex
logger = logging.getLogger(__name__)
"""
Class to determine mosaicity and effective domain size for a crystal given a set of inde... | 43.740088 | 121 | 0.588478 |
c9e045b8067ba0e747eb12c1a0f3baae0fdb9059 | 1,034 | py | Python | st2common/st2common/persistence/actionalias.py | totalkyos/stack-storm | b89bc648d53dae03c7484d22abd771edfe45bbb8 | [
"Apache-2.0"
] | 1 | 2021-04-08T03:21:49.000Z | 2021-04-08T03:21:49.000Z | st2common/st2common/persistence/actionalias.py | totalkyos/stack-storm | b89bc648d53dae03c7484d22abd771edfe45bbb8 | [
"Apache-2.0"
] | 2 | 2020-03-04T08:33:36.000Z | 2020-03-04T08:34:14.000Z | st2common/st2common/persistence/actionalias.py | totalkyos/stack-storm | b89bc648d53dae03c7484d22abd771edfe45bbb8 | [
"Apache-2.0"
] | 13 | 2017-01-12T11:07:20.000Z | 2019-04-19T09:55:49.000Z | # Licensed to the StackStorm, Inc ('StackStorm') 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 use th... | 39.769231 | 74 | 0.773694 |
c0e8c544fe353f140bd42a4a6eca0583957579bc | 51 | py | Python | src/nlp_preprocessors/attacker/__init__.py | TeaKatz/NLP_Preprocessors | ebecbbced15d325f0c0c1c3e9024879fcd9ad614 | [
"MIT"
] | null | null | null | src/nlp_preprocessors/attacker/__init__.py | TeaKatz/NLP_Preprocessors | ebecbbced15d325f0c0c1c3e9024879fcd9ad614 | [
"MIT"
] | null | null | null | src/nlp_preprocessors/attacker/__init__.py | TeaKatz/NLP_Preprocessors | ebecbbced15d325f0c0c1c3e9024879fcd9ad614 | [
"MIT"
] | null | null | null | from .CharacterAttacker import EngCharacterAttacker | 51 | 51 | 0.921569 |
13b6de1cd0fe4beda1fab650f54a7f9c98f00ed9 | 8,269 | py | Python | tasks/network_tracer.py | tsein-bc/datadog-agent | e1259c2ad09bd148aecbb602afa1cd171722c5d5 | [
"Apache-2.0"
] | null | null | null | tasks/network_tracer.py | tsein-bc/datadog-agent | e1259c2ad09bd148aecbb602afa1cd171722c5d5 | [
"Apache-2.0"
] | null | null | null | tasks/network_tracer.py | tsein-bc/datadog-agent | e1259c2ad09bd148aecbb602afa1cd171722c5d5 | [
"Apache-2.0"
] | null | null | null | import datetime
import glob
import os
import contextlib
import shutil
import tempfile
from invoke import task
from subprocess import check_output, CalledProcessError
from .utils import bin_name, get_build_flags, REPO_PATH, get_version, get_git_branch_name, get_go_version, get_git_commit
from .build_tags import get_de... | 27.290429 | 121 | 0.626073 |
1200b2af91279a9f75b937d226900218ee3560ed | 182 | py | Python | SensirionSHT31Logger/test.py | zumbuhllab/SensirionSHT31Logger | 5cb4f20819072f67eb60703d44396ac1d26f687f | [
"MIT"
] | null | null | null | SensirionSHT31Logger/test.py | zumbuhllab/SensirionSHT31Logger | 5cb4f20819072f67eb60703d44396ac1d26f687f | [
"MIT"
] | null | null | null | SensirionSHT31Logger/test.py | zumbuhllab/SensirionSHT31Logger | 5cb4f20819072f67eb60703d44396ac1d26f687f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import struct, time, db, platform
from config import conf
if __name__ == "__main__":
db.record_logs([["nonsense", 12], ["nonsense2", 13]], insert_sensor_ids=True) | 36.4 | 78 | 0.725275 |
c537898b462009dea5ceba288a08da15b04a9cdb | 759 | py | Python | Lib/compiler/consts36.py | solocubi/cinder | b21ecdca6bb5920dae98b5c384ff18af1c0882b9 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/compiler/consts36.py | solocubi/cinder | b21ecdca6bb5920dae98b5c384ff18af1c0882b9 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/compiler/consts36.py | solocubi/cinder | b21ecdca6bb5920dae98b5c384ff18af1c0882b9 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | from .consts import PyCF_ONLY_AST, PyCF_DONT_IMPLY_DEDENT
CO_FUTURE_DIVISION = 0x2000
CO_FUTURE_ABSOLUTE_IMPORT = 0x4000
CO_FUTURE_WITH_STATEMENT = 0x8000
CO_FUTURE_PRINT_FUNCTION = 0x10000
CO_FUTURE_UNICODE_LITERALS = 0x20000
CO_FUTURE_BARRY_AS_BDFL = 0x40000
CO_FUTURE_GENERATOR_STOP = 0x80000
CO_FUTURE_ANNOTATIONS =... | 28.111111 | 63 | 0.822134 |
7c569cf058466507f5f8c4c9999d8b83b8715e5e | 3,659 | py | Python | paper/reviews/code/r2_numba_performance.py | tylerbrunette/tensorpac | afae9557db417a54b001c0837dbc8638f6fe20f0 | [
"BSD-3-Clause"
] | 48 | 2017-06-30T16:52:01.000Z | 2022-03-15T16:02:25.000Z | paper/reviews/code/r2_numba_performance.py | tylerbrunette/tensorpac | afae9557db417a54b001c0837dbc8638f6fe20f0 | [
"BSD-3-Clause"
] | 15 | 2017-06-30T18:58:24.000Z | 2022-03-24T02:03:06.000Z | paper/reviews/code/r2_numba_performance.py | tylerbrunette/tensorpac | afae9557db417a54b001c0837dbc8638f6fe20f0 | [
"BSD-3-Clause"
] | 13 | 2018-09-06T14:27:22.000Z | 2022-03-17T03:21:49.000Z | """Performance comparison between the Tensor / Numba implementations."""
import json
with open("../../paper.json", 'r') as f: cfg = json.load(f) # noqa
import numpy as np
import pandas as pd
from time import time as tst
from tensorpac.signals import pac_signals_wavelet
from tensorpac import Pac
from tensorpac.spectr... | 36.227723 | 79 | 0.538945 |
aab3e2cf1a67aff2f0b9ab379fb8ffe2395338ba | 6,147 | py | Python | rtplot.py | revzin/stm32pyvis | fbcc8b1ea87c06772c232ea4330d44aa64e9e00b | [
"MIT"
] | null | null | null | rtplot.py | revzin/stm32pyvis | fbcc8b1ea87c06772c232ea4330d44aa64e9e00b | [
"MIT"
] | null | null | null | rtplot.py | revzin/stm32pyvis | fbcc8b1ea87c06772c232ea4330d44aa64e9e00b | [
"MIT"
] | null | null | null | import PySide as ps
import pyqtgraph as pg
import collections
import time, datetime
import numpy as np
import logging as log
import threading
class WatchVariable:
def __init__(self, value_buffer_size=100, name='To Be Filled by O. E. M.', address=None):
self.buf_size = value_buffer_size
self.name ... | 28.859155 | 117 | 0.612169 |
e3de4aa408e257a6e8fcd0dcdfdbed5370c5bf85 | 722 | py | Python | attacks/factorization/pollard_rho.py | HimadriP/RSA_attacks | db58478a33f0dffe492b9a626bf0a4a055682690 | [
"MIT"
] | null | null | null | attacks/factorization/pollard_rho.py | HimadriP/RSA_attacks | db58478a33f0dffe492b9a626bf0a4a055682690 | [
"MIT"
] | null | null | null | attacks/factorization/pollard_rho.py | HimadriP/RSA_attacks | db58478a33f0dffe492b9a626bf0a4a055682690 | [
"MIT"
] | null | null | null | import random
import math
#Basic GCD code
def gcd(a,b):
if a<=0:
return b
return gcd(b%a,a)
def rho(number,p,q):
d = 1
while d is 1:
#Function choosen is f(a) = (a**2 + 1) mod m
p = (p**2+1)%number
for i in range(0,2,1):
q = (q**2+1)%number
... | 18.05 | 52 | 0.49723 |
ee51ef79a64f126c165b2580a4050b351d0c8a17 | 160 | py | Python | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_BestCycle_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_BestCycle_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Integration/model_control_one_enabled_Integration_PolyTrend_BestCycle_NoAR.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['PolyTrend'] , ['BestCycle'] , ['NoAR'] ); | 40 | 82 | 0.75 |
d0f2e4cbe332431e04a3233e4d53e61d318cf266 | 1,392 | py | Python | config/urls.py | alexche77/blockbuster-api-clone | 3597b6c6eb1e14b45bca233efabe2bc200a280f1 | [
"MIT"
] | null | null | null | config/urls.py | alexche77/blockbuster-api-clone | 3597b6c6eb1e14b45bca233efabe2bc200a280f1 | [
"MIT"
] | null | null | null | config/urls.py | alexche77/blockbuster-api-clone | 3597b6c6eb1e14b45bca233efabe2bc200a280f1 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views import defaults as default_views
urlpatterns = [
path(settings.ADMIN_URL, admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDI... | 31.636364 | 85 | 0.635776 |
74e5cc193ffec71c119091d1023ebc3f7340c781 | 308 | py | Python | 0901-1000/0946-Validate Stack Sequences/0946-Validate Stack Sequences.py | jiadaizhao/LeetCode | 4ddea0a532fe7c5d053ffbd6870174ec99fc2d60 | [
"MIT"
] | 49 | 2018-05-05T02:53:10.000Z | 2022-03-30T12:08:09.000Z | 0901-1000/0946-Validate Stack Sequences/0946-Validate Stack Sequences.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 11 | 2017-12-15T22:31:44.000Z | 2020-10-02T12:42:49.000Z | 0901-1000/0946-Validate Stack Sequences/0946-Validate Stack Sequences.py | jolly-fellow/LeetCode | ab20b3ec137ed05fad1edda1c30db04ab355486f | [
"MIT"
] | 28 | 2017-12-05T10:56:51.000Z | 2022-01-26T18:18:27.000Z | class Solution:
def validateStackSequences(self, pushed: 'List[int]', popped: 'List[int]') -> 'bool':
St = []
j = 0
for i in pushed:
St.append(i)
while St and St[-1] == popped[j]:
St.pop()
j += 1
return len(St) == 0
| 28 | 89 | 0.441558 |
f39574a7a75341f28ee12abf5d7bc53b9763f5c7 | 2,099 | py | Python | sphinx/source/conf.py | bitdefender/dicom3d | cb32f5783d2451b304532d47c146522f9e6662f7 | [
"MIT"
] | 4 | 2019-12-18T15:52:55.000Z | 2021-11-29T07:32:51.000Z | sphinx/source/conf.py | bitdefender/dicom3d | cb32f5783d2451b304532d47c146522f9e6662f7 | [
"MIT"
] | null | null | null | sphinx/source/conf.py | bitdefender/dicom3d | cb32f5783d2451b304532d47c146522f9e6662f7 | [
"MIT"
] | 3 | 2021-11-29T07:33:05.000Z | 2022-01-11T15:37:22.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:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 32.796875 | 79 | 0.663649 |
b258a42563e439361a8eff9ac78241772b4182aa | 616 | py | Python | test/on_yubikey/test_cli_openpgp.py | amake/yubikey-manager | ba049e1454a2435e4772b17fec88785a50373cf9 | [
"BSD-2-Clause"
] | null | null | null | test/on_yubikey/test_cli_openpgp.py | amake/yubikey-manager | ba049e1454a2435e4772b17fec88785a50373cf9 | [
"BSD-2-Clause"
] | null | null | null | test/on_yubikey/test_cli_openpgp.py | amake/yubikey-manager | ba049e1454a2435e4772b17fec88785a50373cf9 | [
"BSD-2-Clause"
] | null | null | null | import unittest
from .framework import cli_test_suite
@cli_test_suite
def additional_tests(ykman_cli):
class TestOpenPGP(unittest.TestCase):
def setUp(self):
ykman_cli('openpgp', 'reset', '-f')
def test_openpgp_info(self):
output = ykman_cli('openpgp', 'info')
... | 26.782609 | 79 | 0.605519 |
65e22381d186fa6cf06529bb7d3bc6cbe121b6b0 | 4,439 | py | Python | catkin_ws/src/duckietown_microMVP/micromvp_test/include/micromvp_test/xBee.py | eric565648/duckietown-pi2 | 33af7985a857a323e15d20e6572bc07530a16aea | [
"CC-BY-2.0"
] | 1 | 2021-03-17T01:14:08.000Z | 2021-03-17T01:14:08.000Z | catkin_ws/src/duckietown_microMVP/micromvp_test/include/micromvp_test/xBee.py | eric565648/duckietown-pi2 | 33af7985a857a323e15d20e6572bc07530a16aea | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/duckietown_microMVP/micromvp_test/include/micromvp_test/xBee.py | eric565648/duckietown-pi2 | 33af7985a857a323e15d20e6572bc07530a16aea | [
"CC-BY-2.0"
] | 3 | 2017-05-23T19:09:35.000Z | 2017-10-09T11:18:06.000Z | '''
All components of this library are licensed under the BSD 3-Clause
License.
Copyright (c) 2015-, Algorithmic Robotics and Control Group @Rutgers
(http://arc.cs.rutgers.edu). All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided... | 41.877358 | 121 | 0.597882 |
044107b3fe3e2bd23049463e76c3e2de0f32fbae | 5,907 | py | Python | app/api/search_arxiv.py | mpab/semanticsearch | c77f8b6d8977b60d4aa8713a00c7dc0a4e588f45 | [
"Apache-2.0"
] | 1 | 2022-01-22T01:34:36.000Z | 2022-01-22T01:34:36.000Z | app/api/search_arxiv.py | mpab/semanticsearch | c77f8b6d8977b60d4aa8713a00c7dc0a4e588f45 | [
"Apache-2.0"
] | null | null | null | app/api/search_arxiv.py | mpab/semanticsearch | c77f8b6d8977b60d4aa8713a00c7dc0a4e588f45 | [
"Apache-2.0"
] | null | null | null | import os
from typing import List
import requests
from bs4 import BeautifulSoup
from context_types import (
HttpRequestParameters,
SearchContext,
SearchRequest,
SearchResult,
SearchResultPage,
)
from document_utilities import DocUtil
from utilities import Folders
def make_http_r... | 33 | 152 | 0.614864 |
1325da839edfd05732e8255a1e595e5e8b23c31a | 2,390 | py | Python | solutions/molecular_similarity_search/quick_deploy/server/src/operations/load.py | want-fly/bootcamp | e8b2d50413a1e530375372b402044175b69d8ec5 | [
"Apache-2.0"
] | 6 | 2021-05-24T10:51:48.000Z | 2021-09-16T01:57:12.000Z | solutions/molecular_similarity_search/quick_deploy/server/src/operations/load.py | want-fly/bootcamp | e8b2d50413a1e530375372b402044175b69d8ec5 | [
"Apache-2.0"
] | null | null | null | solutions/molecular_similarity_search/quick_deploy/server/src/operations/load.py | want-fly/bootcamp | e8b2d50413a1e530375372b402044175b69d8ec5 | [
"Apache-2.0"
] | 2 | 2021-06-14T23:50:25.000Z | 2021-06-21T10:30:34.000Z | import sys
import os
from diskcache import Cache
from src.logs import LOGGER
from src.encode import smiles_to_vector
from src.config import DEFAULT_TABLE, VECTOR_DIMENSION
from src.config import UPLOAD_PATH
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit import DataStructs
from rdkit.Chem import Draw
... | 33.194444 | 116 | 0.623013 |
17fa5f3f946fcbf6215ed440076493661eb74278 | 12,526 | py | Python | nexus/lib/developer.py | djstaros/qmcpack | 280f67e638bae280448b47fa618f05b848c530d2 | [
"NCSA"
] | null | null | null | nexus/lib/developer.py | djstaros/qmcpack | 280f67e638bae280448b47fa618f05b848c530d2 | [
"NCSA"
] | 11 | 2020-05-09T20:57:21.000Z | 2020-06-10T00:00:17.000Z | nexus/lib/developer.py | djstaros/qmcpack | 280f67e638bae280448b47fa618f05b848c530d2 | [
"NCSA"
] | null | null | null | ##################################################################
## (c) Copyright 2015- by Jaron T. Krogel ##
##################################################################
#====================================================================#
# developer.py ... | 36.097983 | 158 | 0.586061 |
bafa1b4418fdee6ab363f973290693cf76a3f3a8 | 1,686 | py | Python | google/cloud/source_context/__init__.py | LaudateCorpus1/python-source-context | fbbf99b87e34abdb73816319576a17364b9d259b | [
"Apache-2.0"
] | 2 | 2021-09-23T11:43:47.000Z | 2021-10-07T02:07:24.000Z | google/cloud/source_context/__init__.py | LaudateCorpus1/python-source-context | fbbf99b87e34abdb73816319576a17364b9d259b | [
"Apache-2.0"
] | 21 | 2021-06-24T15:17:36.000Z | 2022-03-07T16:48:41.000Z | google/cloud/source_context/__init__.py | LaudateCorpus1/python-source-context | fbbf99b87e34abdb73816319576a17364b9d259b | [
"Apache-2.0"
] | 2 | 2021-07-14T17:54:50.000Z | 2022-01-29T08:13:34.000Z | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 39.209302 | 86 | 0.803677 |
edb822c68d5d2d9f5de624ff4e78276d6d7b7681 | 5,187 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_usages_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | 8 | 2021-01-13T23:44:08.000Z | 2021-03-17T10:13:36.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_usages_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations/_usages_operations.py | vbarbaresi/azure-sdk-for-python | 397ba46c51d001ff89c66b170f5576cf8f49c05f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.902655 | 134 | 0.654135 |
e87460b4dcd9e8f43e570314994f26679b62d914 | 2,646 | py | Python | mindinsight/debugger/common/exceptions/error_code.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | null | null | null | mindinsight/debugger/common/exceptions/error_code.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | null | null | null | mindinsight/debugger/common/exceptions/error_code.py | fapbatista/mindinsight | db5769eb80cbd13a2a9af7682c11f5667d8bf141 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 40.090909 | 78 | 0.739607 |
be5fe7a1c36377f8d32a3e9b93f1c81d2ff028e4 | 336 | py | Python | app/core/migrations/0004_auto_20210212_1158.py | andubarbu/recipe-app-api | f08c1d36fea102a7845f37db9f04691f36e599a1 | [
"MIT"
] | null | null | null | app/core/migrations/0004_auto_20210212_1158.py | andubarbu/recipe-app-api | f08c1d36fea102a7845f37db9f04691f36e599a1 | [
"MIT"
] | null | null | null | app/core/migrations/0004_auto_20210212_1158.py | andubarbu/recipe-app-api | f08c1d36fea102a7845f37db9f04691f36e599a1 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-02-12 11:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20210212_1143'),
]
operations = [
migrations.AlterModelManagers(
name='user',
managers=[
],
... | 17.684211 | 48 | 0.5625 |
3e472216efa3651a663a32ee2db729497d059ff2 | 13,649 | py | Python | mace/python/tools/converter_tool/shape_inference.py | yytdfc/mace | 2a56318518b8aacb15d2d1e522d3f630cbee772f | [
"Apache-2.0"
] | null | null | null | mace/python/tools/converter_tool/shape_inference.py | yytdfc/mace | 2a56318518b8aacb15d2d1e522d3f630cbee772f | [
"Apache-2.0"
] | null | null | null | mace/python/tools/converter_tool/shape_inference.py | yytdfc/mace | 2a56318518b8aacb15d2d1e522d3f630cbee772f | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The MACE 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 applicable la... | 46.743151 | 98 | 0.601876 |
0ef7196625afbef3404b64ff452e44a903059fcc | 2,744 | py | Python | rudics2netcdf_rads.py | NOAA-PMEL/EcoFOCI_Prawler | 04d410d22475707409732e9d78fe92ddd688d8a8 | [
"MIT"
] | null | null | null | rudics2netcdf_rads.py | NOAA-PMEL/EcoFOCI_Prawler | 04d410d22475707409732e9d78fe92ddd688d8a8 | [
"MIT"
] | null | null | null | rudics2netcdf_rads.py | NOAA-PMEL/EcoFOCI_Prawler | 04d410d22475707409732e9d78fe92ddd688d8a8 | [
"MIT"
] | null | null | null | """
Background:
===========
prawler2netcdf_pico.py
Purpose:
========
Script to convert cleaned-up radiometer data from RUDICS stream into netcdf file
See extras/17ck-met_rad.py for cleanup script
Compatibility:
==============
python >=3.6 ?
python 2.7 - Tested
"""
# Standard library.
import dateti... | 31.906977 | 142 | 0.693878 |
7d2c74f6d2968d14103bf74ae4261a347a53346a | 2,467 | py | Python | djdt_flamegraph/djdt_flamegraph.py | ianzapolsky/djdt-flamegraph | c552f04004c2620432e7ad0c99281df9f438a3a0 | [
"MIT"
] | null | null | null | djdt_flamegraph/djdt_flamegraph.py | ianzapolsky/djdt-flamegraph | c552f04004c2620432e7ad0c99281df9f438a3a0 | [
"MIT"
] | null | null | null | djdt_flamegraph/djdt_flamegraph.py | ianzapolsky/djdt-flamegraph | c552f04004c2620432e7ad0c99281df9f438a3a0 | [
"MIT"
] | null | null | null | import collections
import signal
from django.template import Template, Context
from . import flamegraph
try:
from debug_toolbar.panels import Panel
except ImportError as e:
import os
if os.environ.get('TESTING'):
import mock
Panel = mock.Mock()
else:
raise e
template = r"""
<... | 26.244681 | 100 | 0.620997 |
64e4120ddfdd6ca894b37762efaa1152856c42b0 | 54 | py | Python | kernel/music/admin/__init__.py | makridenko/pad-site | eeb04c0564e6e91bc8e2e46cf5c448da31313d76 | [
"MIT"
] | null | null | null | kernel/music/admin/__init__.py | makridenko/pad-site | eeb04c0564e6e91bc8e2e46cf5c448da31313d76 | [
"MIT"
] | null | null | null | kernel/music/admin/__init__.py | makridenko/pad-site | eeb04c0564e6e91bc8e2e46cf5c448da31313d76 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .release import Release
| 13.5 | 28 | 0.62963 |
35194a8e5722d4849e5cc4d59899376b26706c89 | 8,060 | py | Python | pynecone/api.py | markolaban/pycli | e9c7b660a0ceb2ed61a6d3f87558a164bb0d2792 | [
"BSD-3-Clause"
] | null | null | null | pynecone/api.py | markolaban/pycli | e9c7b660a0ceb2ed61a6d3f87558a164bb0d2792 | [
"BSD-3-Clause"
] | null | null | null | pynecone/api.py | markolaban/pycli | e9c7b660a0ceb2ed61a6d3f87558a164bb0d2792 | [
"BSD-3-Clause"
] | null | null | null | from .proto import ProtoShell, ProtoCmd
from .config import Config
import yaml
class Api(ProtoShell):
class Auth(ProtoShell):
class Basic(ProtoCmd):
def __init__(self):
super().__init__('basic',
'configure API to use basic authentication')
... | 39.509804 | 116 | 0.537221 |
f7408aa00e4b70006014d70b64f325b8d62f3321 | 3,952 | py | Python | djoser/utils.py | unacast/djoser | 8b5d547f799bc1140fe587f78213ce9807796ee1 | [
"MIT"
] | null | null | null | djoser/utils.py | unacast/djoser | 8b5d547f799bc1140fe587f78213ce9807796ee1 | [
"MIT"
] | null | null | null | djoser/utils.py | unacast/djoser | 8b5d547f799bc1140fe587f78213ce9807796ee1 | [
"MIT"
] | 1 | 2015-11-24T11:37:50.000Z | 2015-11-24T11:37:50.000Z | from django.conf import settings as django_settings
from django.core.mail import EmailMultiAlternatives, EmailMessage
from django.template import loader
from rest_framework import response, status
try:
from django.contrib.sites.shortcuts import get_current_site
except ImportError:
from django.contrib.sites.mod... | 35.927273 | 98 | 0.700152 |
1546bf31cc34ceb8809c28931cca1249bf121511 | 5,992 | py | Python | server/onesphere/onesphere_core/models/quality.py | kevin0120/onesphere | 7864076ab0de564fa21f91c946f3f1038aa36faf | [
"MIT"
] | null | null | null | server/onesphere/onesphere_core/models/quality.py | kevin0120/onesphere | 7864076ab0de564fa21f91c946f3f1038aa36faf | [
"MIT"
] | null | null | null | server/onesphere/onesphere_core/models/quality.py | kevin0120/onesphere | 7864076ab0de564fa21f91c946f3f1038aa36faf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from odoo import api, fields, models, _
class OneshareOperationStepRel(models.Model):
_name = 'onesphere.mrp.operation.step.rel'
_description = '工步作业关联表'
_log_access = False
_order = "sequence asc, id desc"
sequence = fields.Integer('Sequence', default=0)
... | 42.496454 | 127 | 0.624499 |
f4852c04bd10acf61e893854967e93ad829ebedb | 9,351 | py | Python | minato/cache.py | altescy/minato | bcb198a3f65192367df71a6c3a3324a6b2285785 | [
"MIT"
] | 8 | 2021-05-16T00:50:01.000Z | 2022-02-09T11:15:56.000Z | minato/cache.py | altescy/minato | bcb198a3f65192367df71a6c3a3324a6b2285785 | [
"MIT"
] | null | null | null | minato/cache.py | altescy/minato | bcb198a3f65192367df71a6c3a3324a6b2285785 | [
"MIT"
] | 1 | 2021-06-20T07:22:53.000Z | 2021-06-20T07:22:53.000Z | from __future__ import annotations
import dataclasses
import datetime
import hashlib
import json
import logging
import os
import uuid
from contextlib import contextmanager
from enum import Enum
from pathlib import Path
from typing import Any, Dict, Iterator, List, Optional, Union
from minato.exceptions import CacheAl... | 33.880435 | 88 | 0.610416 |
dda016b4a8c54137001a3c420544fa9ec2cbdeee | 2,524 | py | Python | test/pyaz/deploymentmanager/rollout/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/deploymentmanager/rollout/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/deploymentmanager/rollout/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
def show(resource_group, rollout_name, retry_attempt=None):
params = get_params(locals())
command = "az deploymentmanager rollout show " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess... | 34.108108 | 96 | 0.669176 |
1ed92f0fbf686ec9cab4d98f6296986371fe8b8d | 655 | py | Python | tests/acceptance/test_oauth_authorize.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/acceptance/test_oauth_authorize.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/acceptance/test_oauth_authorize.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase
class OAuthAuthorizeTest(AcceptanceTestCase):
def setUp(self):
super(OAuthAuthorizeTest, self).setUp()
self.user = self.create_user("foo@example.com", is_superuser=True)
self.login_as(self.user)
de... | 34.473684 | 74 | 0.700763 |
1f74a831bb4987e80742cb0dafa987e3f7de3c25 | 6,366 | py | Python | python/example_code/sts/sts_temporary_credentials/session_token.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 12 | 2020-07-28T01:20:15.000Z | 2021-12-10T10:52:49.000Z | python/example_code/sts/sts_temporary_credentials/session_token.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 5 | 2021-12-10T01:52:47.000Z | 2022-01-04T16:47:45.000Z | python/example_code/sts/sts_temporary_credentials/session_token.py | gabehollombe-aws/aws-doc-sdk-examples | dfc0e06ebe1762ab127f3ef5f425507644c6a99c | [
"Apache-2.0"
] | 5 | 2020-08-29T14:01:38.000Z | 2021-11-18T07:11:49.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to get a session token that requires a multi-factor authentication (MFA)
token, using AWS Security Token Service (AWS STS) credentials.
"""
import json
import os
import sys
import time
imp... | 34.978022 | 88 | 0.669023 |
4d6da5f6eae297652d60216ae70ceb38b5ccc4fe | 20 | py | Python | TB2J/__init__.py | obaica/TB2J | 6e6d32769d20d751b1ced15f947b59962dfa0ea3 | [
"BSD-2-Clause"
] | 1 | 2021-01-27T23:53:30.000Z | 2021-01-27T23:53:30.000Z | TB2J/__init__.py | obaica/TB2J | 6e6d32769d20d751b1ced15f947b59962dfa0ea3 | [
"BSD-2-Clause"
] | null | null | null | TB2J/__init__.py | obaica/TB2J | 6e6d32769d20d751b1ced15f947b59962dfa0ea3 | [
"BSD-2-Clause"
] | 1 | 2021-01-28T00:37:14.000Z | 2021-01-28T00:37:14.000Z | __version__="0.2.7"
| 10 | 19 | 0.7 |
6be17ee0a36714c83f55eff341ea67578c0f04a2 | 423 | py | Python | users/forms.py | Gaurav-Zaiswal/django-reusable | 8444964c12ed44aa351b85869f5335442aa66112 | [
"MIT"
] | null | null | null | users/forms.py | Gaurav-Zaiswal/django-reusable | 8444964c12ed44aa351b85869f5335442aa66112 | [
"MIT"
] | 4 | 2021-03-30T13:57:58.000Z | 2021-06-10T19:52:43.000Z | users/forms.py | Gaurav-Zaiswal/django-reusable | 8444964c12ed44aa351b85869f5335442aa66112 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import User
class CustomUserCreationForm(UserCreationForm):
class Meta:
model = User
fields = ('username', 'email', 'first_name', 'last_name')
class CustomUserChangeForm(UserChangeForm):
... | 26.4375 | 70 | 0.702128 |
cdbc7f6440b2684e1fce0dd4a3b59fbcbf6990c3 | 516 | py | Python | integration-tests/pytests/test_small.py | trevor-crypto/thaler | 945bb91da28c4ee022c5a653296f6ffbb1a5576c | [
"Apache-2.0"
] | 144 | 2019-03-20T03:24:43.000Z | 2020-10-06T00:11:30.000Z | integration-tests/pytests/test_small.py | trevor-crypto/thaler | 945bb91da28c4ee022c5a653296f6ffbb1a5576c | [
"Apache-2.0"
] | 2,183 | 2019-03-20T04:18:14.000Z | 2020-10-19T07:41:42.000Z | integration-tests/pytests/test_small.py | trevor-crypto/thaler | 945bb91da28c4ee022c5a653296f6ffbb1a5576c | [
"Apache-2.0"
] | 75 | 2019-03-20T08:08:42.000Z | 2020-10-18T14:49:18.000Z | import pytest
from .common import wait_for_tx, get_rpc
rpc = get_rpc()
@pytest.mark.withfee
def test_deposit_amount(addresses):
'execute a deposit amount to self, check staking state change'
bonded1 = int(rpc.staking.state(addresses.unbonded_staking)['bonded'])
txid = rpc.staking.deposit_amount(addresses... | 32.25 | 76 | 0.751938 |
e909fe791fbe68004cbd5756ba3a0a8cbaad3fdb | 1,664 | py | Python | bot/main.py | TeuxDeux-api/teuxdeux-bot | 83bb78924dc6c5e47f02b1379af6aa2b16437284 | [
"Apache-2.0"
] | null | null | null | bot/main.py | TeuxDeux-api/teuxdeux-bot | 83bb78924dc6c5e47f02b1379af6aa2b16437284 | [
"Apache-2.0"
] | null | null | null | bot/main.py | TeuxDeux-api/teuxdeux-bot | 83bb78924dc6c5e47f02b1379af6aa2b16437284 | [
"Apache-2.0"
] | null | null | null | import time
import dotenv
from aiogram.dispatcher import storage
from aiogram.utils import executor
from bot.utils import auto_auth
from bot.logger import logger_init
from .handlers import authenticate_user, new_task_handler, start_handler, task_update_handler, text_handler, todo_callback_handler, todo_submenu_callba... | 30.814815 | 161 | 0.701322 |
8ea67271e26e78cff1237bfb9bc53b89bd9457c6 | 961 | py | Python | data/transforms/build.py | zqigolden/reid-strong-baseline | 45ca646f435154869e16dcf785d7080bbe0b731a | [
"MIT"
] | null | null | null | data/transforms/build.py | zqigolden/reid-strong-baseline | 45ca646f435154869e16dcf785d7080bbe0b731a | [
"MIT"
] | null | null | null | data/transforms/build.py | zqigolden/reid-strong-baseline | 45ca646f435154869e16dcf785d7080bbe0b731a | [
"MIT"
] | null | null | null | # encoding: utf-8
"""
@author: liaoxingyu
@contact: liaoxingyu2@jd.com
"""
import torchvision.transforms as T
from .transforms import RandomErasing
def build_transforms(cfg, is_train=True):
normalize_transform = T.Normalize(mean=cfg.INPUT.PIXEL_MEAN, std=cfg.INPUT.PIXEL_STD)
if is_train:
transform ... | 28.264706 | 89 | 0.627471 |
3015a15c17dad1f6498640fa7386b81c70799c2a | 266 | py | Python | PrimeNumber_Checker.py | Engeniero/Python-Basics | 588b4abd1af799a232e8f234f4c73e2a84c08c7f | [
"MIT"
] | null | null | null | PrimeNumber_Checker.py | Engeniero/Python-Basics | 588b4abd1af799a232e8f234f4c73e2a84c08c7f | [
"MIT"
] | null | null | null | PrimeNumber_Checker.py | Engeniero/Python-Basics | 588b4abd1af799a232e8f234f4c73e2a84c08c7f | [
"MIT"
] | null | null | null |
def PrimeNumberChecker(n):
y = 2
f = True
if n != 1:
while n > y:
if n % y == 0:
f = False
y = n
y += 1
else:
f = False
return f
Prime = PrimeNumberChecker(1)
print(Prime)
| 15.647059 | 29 | 0.398496 |
4c0c050e2ebce55065dca036254954a91e13aacd | 3,467 | py | Python | driver/tumor_syn_test.py | qgking/FRGAN | b6a250c46981707c43c3889f80d8cc3ec31edaaf | [
"MIT"
] | 2 | 2021-08-10T02:38:23.000Z | 2021-08-10T03:04:22.000Z | driver/tumor_syn_test.py | qgking/FRGAN | b6a250c46981707c43c3889f80d8cc3ec31edaaf | [
"MIT"
] | 1 | 2022-02-21T15:57:03.000Z | 2022-02-21T15:57:03.000Z | driver/tumor_syn_test.py | qgking/FRGAN | b6a250c46981707c43c3889f80d8cc3ec31edaaf | [
"MIT"
] | 2 | 2021-11-07T13:25:51.000Z | 2022-01-18T07:09:30.000Z | import matplotlib
import sys
sys.path.extend(["../", "./"])
from utils.utils import *
from os.path import join
import time
from models import MODELS
import torch
from tumor_data.SYNDataLoader import SYNDataLoader
import random
from driver.Config import Configurable
from driver.syn_train_test_utils import test_old
impo... | 35.377551 | 109 | 0.676666 |
d6e2d347500de77f8f7a6ff0e30479a7b7c5fd72 | 1,054 | py | Python | scripts/clean_canton_univ_edu.py | rr39943/pop_density-edu_level | cbda8e9b290df64dbd0db586a92d8498b32a5427 | [
"MIT"
] | null | null | null | scripts/clean_canton_univ_edu.py | rr39943/pop_density-edu_level | cbda8e9b290df64dbd0db586a92d8498b32a5427 | [
"MIT"
] | 1 | 2021-06-01T22:19:24.000Z | 2021-06-01T22:19:24.000Z | scripts/clean_canton_univ_edu.py | rr39943/pop_density-edu_level | cbda8e9b290df64dbd0db586a92d8498b32a5427 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import sys
import os
sys.path.append('scripts/lib')
from clean_utils import cleanUtils
def create_csv_file(file_name_source, file_name_dest):
"""
Parse the Excel sheet provided and extract the total of persons who have a
diploma of a university. It is working only wit... | 32.9375 | 84 | 0.66888 |
ff673480e84306a32aa9af6618c992645203733c | 704 | py | Python | src/python/grpcio_status/grpc_version.py | goodarzysepideh/grpc | 5a4ba15346f2dc75960e91148f5f77aa682e0f6a | [
"Apache-2.0"
] | 1 | 2022-03-09T01:09:37.000Z | 2022-03-09T01:09:37.000Z | src/python/grpcio_status/grpc_version.py | goodarzysepideh/grpc | 5a4ba15346f2dc75960e91148f5f77aa682e0f6a | [
"Apache-2.0"
] | 1 | 2022-01-28T01:38:47.000Z | 2022-01-28T01:38:47.000Z | src/python/grpcio_status/grpc_version.py | goodarzysepideh/grpc | 5a4ba15346f2dc75960e91148f5f77aa682e0f6a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 39.111111 | 97 | 0.762784 |
2ff46069c44b130c58b54a36ced333a8f583183e | 170 | py | Python | ex04/bissextile.py | Antoine-Mulatier/Day02 | 2291e423c1c7d4a354d1f454dd9837f278fe1dbc | [
"MIT"
] | null | null | null | ex04/bissextile.py | Antoine-Mulatier/Day02 | 2291e423c1c7d4a354d1f454dd9837f278fe1dbc | [
"MIT"
] | null | null | null | ex04/bissextile.py | Antoine-Mulatier/Day02 | 2291e423c1c7d4a354d1f454dd9837f278fe1dbc | [
"MIT"
] | null | null | null | date = input("Taper une date pour savoir si elle est bissextile:\n")
date = int(date)
if(date%4==0 and date%100!=0 or date%400==0):
print("Oui")
else:
print("Non")
| 18.888889 | 68 | 0.652941 |
07f67bd6f8a029777fc719aea9a9833e205339e2 | 3,755 | py | Python | tests/conftest.py | tatarize/vpype | ee1c20d9f920b74206034624571f854fa470cf38 | [
"MIT"
] | 453 | 2019-11-13T10:11:18.000Z | 2022-03-31T18:43:55.000Z | tests/conftest.py | tatarize/vpype | ee1c20d9f920b74206034624571f854fa470cf38 | [
"MIT"
] | 434 | 2019-11-21T07:20:01.000Z | 2022-03-31T17:21:56.000Z | tests/conftest.py | str4w/vpype | c649445b8fec56b4ce9a436a7b8741c5fec1d640 | [
"MIT"
] | 47 | 2019-11-13T20:47:53.000Z | 2022-03-15T12:34:55.000Z | import os
import pathlib
from typing import Callable
import numpy as np
import pytest
from click.testing import CliRunner
from PIL import Image
import vpype as vp
def random_line(length: int) -> np.ndarray:
return np.random.rand(length) + 1j * np.random.rand(length)
@pytest.fixture
def runner():
return Cl... | 31.291667 | 92 | 0.648202 |
fbea52b753eb73e124acab416a8a1e010e526c0f | 1,001 | py | Python | src/fixDSPluginQtPaths.py | danielbui78/reality | 7ecd01b71f28e581becfe5093fab3ddcd6d9b2c1 | [
"BSD-3-Clause"
] | 2 | 2021-12-25T17:24:03.000Z | 2022-03-14T05:07:51.000Z | src/fixDSPluginQtPaths.py | danielbui78/reality | 7ecd01b71f28e581becfe5093fab3ddcd6d9b2c1 | [
"BSD-3-Clause"
] | null | null | null | src/fixDSPluginQtPaths.py | danielbui78/reality | 7ecd01b71f28e581becfe5093fab3ddcd6d9b2c1 | [
"BSD-3-Clause"
] | 2 | 2021-12-10T05:33:04.000Z | 2021-12-10T16:38:54.000Z | #
# This script changes the install names of the Qt libraries embedded in the Reality for DS
# library. It is executed asd a post action for the Mac OS version. See CMakeList.txt
#
import re, sys
from subprocess import *
# This is expected to be the full path of Reality_3_DS64.dylib
libraryFile = sys.argv[1]
print... | 37.074074 | 112 | 0.722278 |
3e33a5e1e03e2ffbcf44273e637dd044988b7357 | 275 | py | Python | grampanchayat/grampanchayat/doctype/street_details/street_details.py | ramjanalilal/grampanchayat | de837d98974b0f9eda559a7ff20890edd814fe29 | [
"MIT"
] | 1 | 2020-10-17T05:39:13.000Z | 2020-10-17T05:39:13.000Z | grampanchayat/grampanchayat/doctype/street_details/street_details.py | ramjanalilal/grampanchayat | de837d98974b0f9eda559a7ff20890edd814fe29 | [
"MIT"
] | null | null | null | grampanchayat/grampanchayat/doctype/street_details/street_details.py | ramjanalilal/grampanchayat | de837d98974b0f9eda559a7ff20890edd814fe29 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, FinForce Consulting LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class StreetDetails(Document):
pass
| 25 | 62 | 0.781818 |
2df9406000ca564f869fda62c34be2b4b31fc7cc | 2,333 | py | Python | tests/fullscale/linearelasticity/faults-2d/meshes.py | cehanagan/pylith | cf5c1c34040460a82f79b6eb54df894ed1b1ee93 | [
"MIT"
] | 93 | 2015-01-08T16:41:22.000Z | 2022-02-25T13:40:02.000Z | tests/fullscale/linearelasticity/faults-2d/meshes.py | sloppyjuicy/pylith | ac2c1587f87e45c948638b19560813d4d5b6a9e3 | [
"MIT"
] | 277 | 2015-02-20T16:27:35.000Z | 2022-03-30T21:13:09.000Z | tests/fullscale/linearelasticity/faults-2d/meshes.py | sloppyjuicy/pylith | ac2c1587f87e45c948638b19560813d4d5b6a9e3 | [
"MIT"
] | 71 | 2015-03-24T12:11:08.000Z | 2022-03-03T04:26:02.000Z | #
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Co... | 32.859155 | 72 | 0.61766 |
a5c0835034df2de796c4cc0bc619620f7d9e550f | 1,324 | py | Python | inference.py | hwRG/FastSpeech2-Pytorch-old-man_city | c32ee3a09bf2a53fcd17a2d0b74e8d1c93586573 | [
"MIT"
] | null | null | null | inference.py | hwRG/FastSpeech2-Pytorch-old-man_city | c32ee3a09bf2a53fcd17a2d0b74e8d1c93586573 | [
"MIT"
] | null | null | null | inference.py | hwRG/FastSpeech2-Pytorch-old-man_city | c32ee3a09bf2a53fcd17a2d0b74e8d1c93586573 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import glob
import os
import argparse
import json
import torch
from scipy.io.wavfile import write
from vocoder.hifigan_generator import Generator
import hparams as hp
MAX_WAV_VALUE = 32768.0
h = None
if torch.cuda.is_avail... | 26.48 | 86 | 0.686556 |
acdaace685c4caa0409dd5a8cafbb6476907dd1b | 714 | py | Python | drillsrs/cmd/delete_deck.py | itwasscience/drill | b10a874161045ad24f0e5b40b81d2f4e79484c0a | [
"MIT"
] | 72 | 2017-03-03T00:48:26.000Z | 2022-03-31T20:58:52.000Z | drillsrs/cmd/delete_deck.py | itwasscience/drill | b10a874161045ad24f0e5b40b81d2f4e79484c0a | [
"MIT"
] | 15 | 2017-03-21T15:57:02.000Z | 2022-01-28T09:24:25.000Z | drillsrs/cmd/delete_deck.py | itwasscience/drill | b10a874161045ad24f0e5b40b81d2f4e79484c0a | [
"MIT"
] | 18 | 2017-12-31T21:00:45.000Z | 2022-01-28T00:57:19.000Z | import argparse
from drillsrs import db, util
from drillsrs.cmd.command_base import CommandBase
class DeleteDeckCommand(CommandBase):
names = ["delete-deck"]
description = "delete a whole deck"
def decorate_arg_parser(self, parser: argparse.ArgumentParser) -> None:
parser.add_argument("deck", he... | 31.043478 | 75 | 0.640056 |
91cffa5025649bad14c600e1a6766fe91b3c0c70 | 349 | py | Python | 0x06-python-test_driven_development/0-add_integer.py | johncoleman83/bootcampschool-higher_level_programming | a83c3b7092cfe893c87e495f8d8eec9228c9b808 | [
"MIT"
] | null | null | null | 0x06-python-test_driven_development/0-add_integer.py | johncoleman83/bootcampschool-higher_level_programming | a83c3b7092cfe893c87e495f8d8eec9228c9b808 | [
"MIT"
] | null | null | null | 0x06-python-test_driven_development/0-add_integer.py | johncoleman83/bootcampschool-higher_level_programming | a83c3b7092cfe893c87e495f8d8eec9228c9b808 | [
"MIT"
] | 1 | 2020-09-25T17:54:36.000Z | 2020-09-25T17:54:36.000Z | #!/usr/bin/python3
"""
module with 1 function, add integers
"""
def add_integer(a, b):
"""returns a + b"""
if isinstance(a, (int, float)) and isinstance(b, (int, float)):
return int(a) + int(b)
else:
raise TypeError("{:} must be an integer"
.format('b' if isinstance... | 24.928571 | 77 | 0.547278 |
a5fd18f7e74480ca7fab56abbdef6078b1264a5a | 9,224 | py | Python | sdk/python/pulumi_azure_native/documentdb/latest/database_account_mongo_db_collection.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/latest/database_account_mongo_db_collection.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/latest/database_account_mongo_db_collection.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 53.627907 | 1,207 | 0.684519 |
1f976bc4aa2dd245fffbb0a6226c76a49fafb55a | 2,844 | py | Python | src/rezgui/widgets/TimestampWidget.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | src/rezgui/widgets/TimestampWidget.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | src/rezgui/widgets/TimestampWidget.py | alexey-pelykh/rez | ad12105d89d658e4d2ea9249e537b3de90391f0e | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
from Qt import QtCore, QtWidgets
from rezgui.util import create_pane
from rezgui.widgets.IconButton import IconButton
from rezgui.widgets.TimeSelecterPopup import TimeSelecterPopup
from rezgui.dialogs.BrowsePackageDialog import BrowsePa... | 34.682927 | 79 | 0.652954 |
80d8537c2f9c7e16b88c4039ac485552fcd78ded | 7,165 | py | Python | KCNQ/docking/scripts/analysis/zincapi.py | jilimcaoco/MPProjects | 5b930ce2fdf5def49444f1953457745af964efe9 | [
"MIT"
] | null | null | null | KCNQ/docking/scripts/analysis/zincapi.py | jilimcaoco/MPProjects | 5b930ce2fdf5def49444f1953457745af964efe9 | [
"MIT"
] | null | null | null | KCNQ/docking/scripts/analysis/zincapi.py | jilimcaoco/MPProjects | 5b930ce2fdf5def49444f1953457745af964efe9 | [
"MIT"
] | 1 | 2021-06-14T20:08:32.000Z | 2021-06-14T20:08:32.000Z | #!/usr/bin/env python
'''connects to ZINC database for smiles, vendors, etc.
Michael Mysinger 200801 Created
Ryan Coleman 201204 Edited down to just SQL queries. See getposes.py for more.
'''
import os
import sys
import requests
REMARK_PREFIX = "# "
# MySQL server
ZINC_URL = os.environ.get('ZINC_URL', 'http://z... | 29.126016 | 108 | 0.577948 |
81b21ed1dc36dfe9345c33820ccf3af52c06cfa5 | 15,387 | py | Python | train_student.py | anonyrep/SuperMix | 3d420c54d542eeed9c4f7055e9391ec020fc8d0c | [
"MIT"
] | 1 | 2020-03-12T03:07:56.000Z | 2020-03-12T03:07:56.000Z | train_student.py | anonyrep/SuperMix | 3d420c54d542eeed9c4f7055e9391ec020fc8d0c | [
"MIT"
] | null | null | null | train_student.py | anonyrep/SuperMix | 3d420c54d542eeed9c4f7055e9391ec020fc8d0c | [
"MIT"
] | null | null | null | """
the general training framework
"""
from __future__ import print_function
import os
import argparse
import time
# import tensorboard_logger as tb_logger
import torch
import torch.optim as optim
import torch.nn as nn
import torch.backends.cudnn as cudnn
from models import model_dict
from models.util import Embed,... | 42.156164 | 124 | 0.637941 |
f6c27b077ac73c81fdb24c8b84cb73b61322224f | 25,792 | py | Python | sparv/util/classes.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | sparv/util/classes.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | sparv/util/classes.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | """Classes used as default input for annotator functions."""
import gzip
import logging
import os
import pathlib
import pickle
import urllib.request
import zipfile
from abc import ABC, abstractmethod
from typing import Any, List, Optional, Tuple, Union
import sparv.core
from sparv.core import io
from sparv.core.paths... | 34.389333 | 127 | 0.628606 |
b7f766bbcc85985c9754211099e130d419c6f3c9 | 41,370 | py | Python | sdks/python/apache_beam/io/gcp/bigquery_test.py | wtanaka/beam | 16f87f49f20796e29d01ed363a9097ea5420583c | [
"Apache-2.0"
] | 1 | 2020-11-08T07:49:18.000Z | 2020-11-08T07:49:18.000Z | sdks/python/apache_beam/io/gcp/bigquery_test.py | wtanaka/beam | 16f87f49f20796e29d01ed363a9097ea5420583c | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/io/gcp/bigquery_test.py | wtanaka/beam | 16f87f49f20796e29d01ed363a9097ea5420583c | [
"Apache-2.0"
] | 1 | 2022-03-31T14:13:02.000Z | 2022-03-31T14:13:02.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... | 41.287425 | 80 | 0.690017 |
48c556c51865e917d2fc1093b224b05338ac1092 | 27,135 | py | Python | post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta2pt6/Output/Histos/MadAnalysis5job_0/selection_14.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta2pt6/Output/Histos/MadAnalysis5job_0/selection_14.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/ma100MeV_L1pt8-2pt4TeV_deta2pt6/Output/Histos/MadAnalysis5job_0/selection_14.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | def selection_14():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.li... | 124.472477 | 1,134 | 0.74391 |
3fbd81d02b3f2b90f9ec89b7a84d39456d1edd93 | 4,193 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/interface/gre/gre.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/interface/gre/gre.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/interface/gre/gre.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | 34.652893 | 290 | 0.728834 |
eda25067a64a64c3e2b3018761f6cebdca770f2a | 5,771 | py | Python | pip/commands/freeze.py | Carreau/pip | 2ba8fc214d7b3ef3ebf4469415b2d916efff85b7 | [
"MIT"
] | 1 | 2015-11-05T17:56:08.000Z | 2015-11-05T17:56:08.000Z | pip/commands/freeze.py | mattcaldwell/pip | 043af838a5c43a6ce8cfc0e610c3ecec1df6e864 | [
"MIT"
] | null | null | null | pip/commands/freeze.py | mattcaldwell/pip | 043af838a5c43a6ce8cfc0e610c3ecec1df6e864 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import logging
import re
import sys
import pip
from pip.compat import stdlib_pkgs
from pip.req import InstallRequirement
from pip.basecommand import Command
from pip.utils import get_installed_distributions
from pip._vendor import pkg_resources
# packages to exclude from free... | 35.623457 | 79 | 0.486398 |
2bc088a6ef678c42bf79a7d8eb259a8b7d80c433 | 3,644 | py | Python | strumenti/tests/test_notify.py | TimothyHelton/strumenti | 793e9e728970f374efc2d3008c2e70db88b89b07 | [
"BSD-3-Clause"
] | null | null | null | strumenti/tests/test_notify.py | TimothyHelton/strumenti | 793e9e728970f374efc2d3008c2e70db88b89b07 | [
"BSD-3-Clause"
] | null | null | null | strumenti/tests/test_notify.py | TimothyHelton/strumenti | 793e9e728970f374efc2d3008c2e70db88b89b07 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""notify.py Unit Tests
..moduleauthor:: Timothy Helton <timothy.j.helton@gmail.com>
"""
import pytest
from strumenti import notify
# Test astrix_line
astrix_line = {'qty = float': (5.8, '*****\n'),
'qty = int': (10, '**********\n'),
'qty... | 26.794118 | 75 | 0.493963 |
7fe0c22868ae017ae4c44e31aa92b5ac612d9eed | 16,156 | py | Python | graph/sampling.py | zeno129/CSAG | 79debf2ef88a8054e0b1c74fd73faf731300c219 | [
"BSD-2-Clause"
] | 1 | 2018-07-27T11:33:24.000Z | 2018-07-27T11:33:24.000Z | graph/sampling.py | zeno129/CSAG | 79debf2ef88a8054e0b1c74fd73faf731300c219 | [
"BSD-2-Clause"
] | null | null | null | graph/sampling.py | zeno129/CSAG | 79debf2ef88a8054e0b1c74fd73faf731300c219 | [
"BSD-2-Clause"
] | null | null | null | import random
# import math
import numpy as np
import itertools
from scipy.stats.stats import pearsonr
from scipy.optimize import linprog, minimize
from kronecker import mKPGM as mKPGM
def graph_sampling(graph_in, x_in, model, epsilon, distribution, params_test=None):
"""
Graph Sampling algorithm
:param ... | 30.656546 | 123 | 0.584117 |
76a8689d69b18a92545c079f28d34aa4731cc419 | 5,599 | py | Python | tests/integrations/tornado/test_tornado.py | harmon/sentry-python | fc55f7909c8c1969b43d43acccb9835f65fcd48c | [
"BSD-2-Clause"
] | null | null | null | tests/integrations/tornado/test_tornado.py | harmon/sentry-python | fc55f7909c8c1969b43d43acccb9835f65fcd48c | [
"BSD-2-Clause"
] | null | null | null | tests/integrations/tornado/test_tornado.py | harmon/sentry-python | fc55f7909c8c1969b43d43acccb9835f65fcd48c | [
"BSD-2-Clause"
] | 1 | 2021-02-18T18:43:27.000Z | 2021-02-18T18:43:27.000Z | import json
import pytest
from sentry_sdk import configure_scope
from sentry_sdk.integrations.tornado import TornadoIntegration
from tornado.web import RequestHandler, Application, HTTPError
from tornado.testing import AsyncHTTPTestCase
@pytest.fixture
def tornado_testcase(request):
# Take the unittest class p... | 28.860825 | 83 | 0.629398 |
a1b7d5605c6ee10ccd7cd762ce0afcbe6555b4fa | 4,094 | py | Python | travis_pypi_setup.py | HadwaAbdelhalem/azure-iot-edge-dev-tool | 0a57cf0c3202e898ec7fa3f1aadc167e695972a5 | [
"MIT"
] | 1 | 2021-02-19T23:33:20.000Z | 2021-02-19T23:33:20.000Z | travis_pypi_setup.py | HadwaAbdelhalem/azure-iot-edge-dev-tool | 0a57cf0c3202e898ec7fa3f1aadc167e695972a5 | [
"MIT"
] | null | null | null | travis_pypi_setup.py | HadwaAbdelhalem/azure-iot-edge-dev-tool | 0a57cf0c3202e898ec7fa3f1aadc167e695972a5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file."""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | 31.984375 | 79 | 0.701026 |
108226fa62ae320c27b7ef4ede1ea483b74246a5 | 96 | py | Python | codes_auto/142.linked-list-cycle-ii.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/142.linked-list-cycle-ii.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/142.linked-list-cycle-ii.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=142 lang=python3
#
# [142] linked-list-cycle-ii
#
None
# @lc code=end | 13.714286 | 41 | 0.666667 |
35a823b28e2882418b9cd6c19bdca5238c5d9c76 | 77,414 | py | Python | arelle/FormulaEvaluator.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 1 | 2021-07-01T17:52:12.000Z | 2021-07-01T17:52:12.000Z | arelle/FormulaEvaluator.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 2 | 2021-03-31T19:26:22.000Z | 2021-12-13T20:28:13.000Z | arelle/FormulaEvaluator.py | DataFinnovation/Arelle | d4bf45f56fc9249f75ab22e6217dbe55f0510841 | [
"Apache-2.0"
] | 2 | 2020-02-24T16:06:12.000Z | 2021-02-24T00:21:32.000Z | '''
Created on Jan 9, 2011
@author: Mark V Systems Limited
(c) Copyright 2011 Mark V Systems Limited, All rights reserved.
'''
from arelle import (XPathContext, XbrlConst, XmlUtil, XbrlUtil, XmlValidate)
from arelle.FunctionXs import xsString
from arelle.ModelObject import ModelObject
from arelle.ModelFormulaObject im... | 54.060056 | 203 | 0.598806 |
6039ea852bf854c220f2263e9579621ec37cc40e | 1,874 | py | Python | model.py | Herosan163/Herosan163-AbnormalEventDetection | 9f6048f23125ff5135f8c894e20187f6a04abdb8 | [
"Apache-2.0"
] | 1 | 2021-04-28T19:33:48.000Z | 2021-04-28T19:33:48.000Z | model.py | Herosan163/Herosan163-AbnormalEventDetection | 9f6048f23125ff5135f8c894e20187f6a04abdb8 | [
"Apache-2.0"
] | null | null | null | model.py | Herosan163/Herosan163-AbnormalEventDetection | 9f6048f23125ff5135f8c894e20187f6a04abdb8 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Dense, Flatten, Conv2D, MaxPooling2D, UpSampling2D
class convolutional_auto_encoder(Model):
def __init__(self, name):
super(convolutional_auto_encoder, self).__init__()
self.name_prefix = name
sel... | 41.644444 | 86 | 0.58698 |
750fef9e03a2a835766b17346780dd4ec6de921b | 38,977 | py | Python | frc_characterization/simplemotor_characterization/data_analyzer.py | prateekma/frc-characterization | cfb9af35a2bf1f1e3dc8a743a9482997034305e2 | [
"Apache-2.0"
] | null | null | null | frc_characterization/simplemotor_characterization/data_analyzer.py | prateekma/frc-characterization | cfb9af35a2bf1f1e3dc8a743a9482997034305e2 | [
"Apache-2.0"
] | null | null | null | frc_characterization/simplemotor_characterization/data_analyzer.py | prateekma/frc-characterization | cfb9af35a2bf1f1e3dc8a743a9482997034305e2 | [
"Apache-2.0"
] | null | null | null | # This GUI analyzes the data collected by the data logger. Support is
# provided for both feedforward and feedback analysis, as well as diagnostic
# plotting.
import json
import math
import os
import tkinter
from tkinter import *
from tkinter import filedialog
from tkinter import messagebox
import control as cnt
imp... | 35.693223 | 138 | 0.624368 |
231559abeaa14bb50082684ed9ea84b9d1904331 | 136,428 | py | Python | HARKinterpolation.py | ganong123/HARK | ed4dae0d43d4dfb492ac05efca11f61cc50dff5d | [
"Apache-2.0"
] | null | null | null | HARKinterpolation.py | ganong123/HARK | ed4dae0d43d4dfb492ac05efca11f61cc50dff5d | [
"Apache-2.0"
] | null | null | null | HARKinterpolation.py | ganong123/HARK | ed4dae0d43d4dfb492ac05efca11f61cc50dff5d | [
"Apache-2.0"
] | null | null | null | '''
Custom interpolation methods for representing approximations to functions.
It also includes wrapper classes to enforce standard methods across classes.
Each interpolation class must have a distance() method that compares itself to
another instance; this is used in HARKcore's solve() method to check for solution
con... | 45.966307 | 173 | 0.553545 |
78c0395f415718dc6cd1fc442fe53407322f9c6a | 2,424 | py | Python | NTMDTRead/kaitai/f10le.py | KOLANICH/NTMDTRead | b02539f925456f4f6a25d8e8e67b1610a1f46633 | [
"Unlicense"
] | 2 | 2018-01-24T23:12:30.000Z | 2018-09-08T08:37:23.000Z | NTMDTRead/kaitai/f10le.py | KOLANICH/NTMDTRead | b02539f925456f4f6a25d8e8e67b1610a1f46633 | [
"Unlicense"
] | 2 | 2018-09-09T19:32:26.000Z | 2020-06-15T17:16:11.000Z | NTMDTRead/kaitai/f10le.py | KOLANICH/NTMDTRead | b02539f925456f4f6a25d8e8e67b1610a1f46633 | [
"Unlicense"
] | 3 | 2018-09-08T08:48:46.000Z | 2020-05-04T11:18:20.000Z | # This is a generated file! Please edit source .ksy file and use kaitai-struct-compiler to rebuild
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise Exception("Incompati... | 39.737705 | 139 | 0.678218 |
77062c74b1798eb134ad5cb00884f06a24061e2c | 10,390 | py | Python | v1.py | XingLiangLondon/Hands-Movement-Trajectories-Tracking | 46c7ad70f59de76f5a8b51dc153f147c1617195c | [
"MIT"
] | 1 | 2021-08-31T14:32:49.000Z | 2021-08-31T14:32:49.000Z | v1.py | XingLiangLondon/Hands-Movement-Trajectories-Tracking | 46c7ad70f59de76f5a8b51dc153f147c1617195c | [
"MIT"
] | null | null | null | v1.py | XingLiangLondon/Hands-Movement-Trajectories-Tracking | 46c7ad70f59de76f5a8b51dc153f147c1617195c | [
"MIT"
] | null | null | null | #Xing @ 2018.12.05
import cv2
import numpy as np
import time
import matplotlib.pyplot as plt
# Initialize webcam input
cap = cv2.VideoCapture(1)
# Initialize video input
#cap = cv2.VideoCapture("C:/Users/liangx/Documents/Dunhill Project Data/Single Sign/Pronated Wrist/WATCH2.mp4")
#cap = cv2.VideoCapture("C:/Users/... | 43.839662 | 207 | 0.574976 |
4ef220db6c651802745eb2ff61b6f6bf40011097 | 5,818 | py | Python | olfactory/indicators.py | OctaveLauby/olfactory | 679b67459c12002041a8f77e1bdffe33d776500b | [
"Apache-2.0"
] | null | null | null | olfactory/indicators.py | OctaveLauby/olfactory | 679b67459c12002041a8f77e1bdffe33d776500b | [
"Apache-2.0"
] | null | null | null | olfactory/indicators.py | OctaveLauby/olfactory | 679b67459c12002041a8f77e1bdffe33d776500b | [
"Apache-2.0"
] | null | null | null | import numpy as np
from bisect import bisect_right
from collections import defaultdict, OrderedDict
# ----------------------------------- #
# Level
def count_within(values, intervals):
"""Count number of values within each interval
Args:
values (n-list of nb)
intervals (m-list of 2-nb-tuple... | 27.186916 | 80 | 0.562908 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.