hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
160b1c97ac3f8a38cfc9b68c4f0651550e3df491 | 266 | py | Python | employees/choices.py | sauli6692/barbershop | 862357bd78235e720b2e3b868d2423a57bb4e328 | [
"MIT"
] | null | null | null | employees/choices.py | sauli6692/barbershop | 862357bd78235e720b2e3b868d2423a57bb4e328 | [
"MIT"
] | null | null | null | employees/choices.py | sauli6692/barbershop | 862357bd78235e720b2e3b868d2423a57bb4e328 | [
"MIT"
] | null | null | null | from django.utils.translation import ugettext_lazy as _
USER_TYPE_STAFF = 'STAFF'
USER_TYPE_ADMIN = 'ADMIN'
USER_TYPE_BARBER = 'BARBER'
USER_TYPE_CHOICES = (
(USER_TYPE_STAFF, _('Dev')),
(USER_TYPE_ADMIN, _('Admin')),
(USER_TYPE_BARBER, _('Barber')),
) | 24.181818 | 55 | 0.714286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 42 | 0.157895 |
160b335422855d4c69636103d3682d2f66956533 | 821 | py | Python | tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/html5test.py | google-ar/chromium | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/html5test.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | tools/chrome_proxy/integration_tests/chrome_proxy_pagesets/html5test.py | harrymarkovskiy/WebARonARCore | 2441c86a5fd975f09a6c30cddb57dfb7fc239699 | [
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from common.chrome_proxy_shared_page_state import ChromeProxySharedPageState
from telemetry.page import page as page_module
from telemetry import story
cla... | 27.366667 | 76 | 0.751523 | 500 | 0.609013 | 0 | 0 | 0 | 0 | 0 | 0 | 236 | 0.287454 |
160c8a87b1d001ed3cb1d85873c9a8a8f238d3b2 | 6,537 | py | Python | lessons/sqlite_example/database.py | eliranM98/python_course | d9431dd6c0f27fca8ca052cc2a821ed0b883136c | [
"MIT"
] | 6 | 2019-03-29T06:14:53.000Z | 2021-10-15T23:42:36.000Z | lessons/sqlite_example/database.py | eliranM98/python_course | d9431dd6c0f27fca8ca052cc2a821ed0b883136c | [
"MIT"
] | 4 | 2019-09-06T10:03:40.000Z | 2022-03-11T23:30:55.000Z | lessons/sqlite_example/database.py | eliranM98/python_course | d9431dd6c0f27fca8ca052cc2a821ed0b883136c | [
"MIT"
] | 12 | 2019-06-20T19:34:52.000Z | 2021-10-15T23:42:39.000Z | """
in this example we want to create a user credentials database with:
user_id & password
logger showing connection logs, DB version, errors during fetching & executing
"""
import sqlite3
from lessons.sqlite_example.log import create as create_logger
class Commands:
create_users_table = '''
CREATE TABLE... | 39.379518 | 137 | 0.621539 | 3,371 | 0.51568 | 0 | 0 | 0 | 0 | 0 | 0 | 3,505 | 0.536179 |
160d55ef119cabea32b158df2e672f5773e80b28 | 217 | py | Python | backend/app/projectx/routing.py | emmawoollett/projectx | c061df01d581456884f46c2b8e3b478626501dec | [
"MIT"
] | null | null | null | backend/app/projectx/routing.py | emmawoollett/projectx | c061df01d581456884f46c2b8e3b478626501dec | [
"MIT"
] | null | null | null | backend/app/projectx/routing.py | emmawoollett/projectx | c061df01d581456884f46c2b8e3b478626501dec | [
"MIT"
] | null | null | null | from django.urls import re_path
from projectx.consumers import UserWebSocketConsumer
from .consumers import UserWebSocketConsumer
websocket_urlpatterns = [
re_path(r"^ws/$", UserWebSocketConsumer.as_asgi()),
]
| 21.7 | 55 | 0.801843 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.036866 |
160fd3286e288456d5bdd6bcd283afcbe0cfc945 | 399 | py | Python | aldryn_search/cms_apps.py | lab360-ch/aldryn-search | 15a319edac126aa1e44f22d34a7bcb5aec3e3dde | [
"BSD-3-Clause"
] | 11 | 2019-03-29T10:32:13.000Z | 2021-02-26T11:44:44.000Z | aldryn_search/cms_apps.py | lab360-ch/aldryn-search | 15a319edac126aa1e44f22d34a7bcb5aec3e3dde | [
"BSD-3-Clause"
] | 23 | 2019-01-31T16:20:57.000Z | 2021-11-10T19:57:58.000Z | aldryn_search/cms_apps.py | lab360-ch/aldryn-search | 15a319edac126aa1e44f22d34a7bcb5aec3e3dde | [
"BSD-3-Clause"
] | 23 | 2019-02-14T09:59:40.000Z | 2022-03-10T12:38:48.000Z | from django.utils.translation import ugettext_lazy as _
from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from .conf import settings
class AldrynSearchApphook(CMSApp):
name = _("aldryn search")
def get_urls(self, *args, **kwargs):
return ['aldryn_search.urls']
if settings.... | 22.166667 | 55 | 0.77193 | 144 | 0.360902 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0.087719 |
161021c6a14b006c767d40fee4f27d3f18827442 | 744 | py | Python | BizPy/openpyxl/20200513/horizontal_chart.py | t2y/python-study | 52a132ea600d4696164e540d8a8f8f5fc58e097a | [
"Apache-2.0"
] | 18 | 2016-08-15T00:24:44.000Z | 2020-11-30T15:11:52.000Z | BizPy/openpyxl/20200513/horizontal_chart.py | t2y/python-study | 52a132ea600d4696164e540d8a8f8f5fc58e097a | [
"Apache-2.0"
] | null | null | null | BizPy/openpyxl/20200513/horizontal_chart.py | t2y/python-study | 52a132ea600d4696164e540d8a8f8f5fc58e097a | [
"Apache-2.0"
] | 6 | 2016-09-28T10:47:03.000Z | 2020-10-14T10:20:06.000Z | import pandas as pd
from openpyxl import Workbook
from openpyxl.chart import BarChart, Reference
wb = Workbook()
ws = wb.active
df = pd.read_csv('population.csv')
ws.append(df.columns.tolist())
for row in df.values:
ws.append(list(row))
row_length = 1 + len(df.values)
values = Reference(ws, min_col=... | 25.655172 | 76 | 0.72043 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 101 | 0.130829 |
161068852c112b7ab6b2bbf31d699217b497ca00 | 462 | py | Python | changes/api/serializer/models/logsource.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | 1 | 2015-11-08T13:00:44.000Z | 2015-11-08T13:00:44.000Z | changes/api/serializer/models/logsource.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | changes/api/serializer/models/logsource.py | alex/changes | 69a17b4c639e7082a75d037384ccb68ead3a0b4b | [
"Apache-2.0"
] | null | null | null | from changes.api.serializer import Serializer, register
from changes.models.log import LogSource
@register(LogSource)
class LogSourceSerializer(Serializer):
def serialize(self, instance, attrs):
return {
'id': instance.id.hex,
'job': {
'id': instance.job_id.hex,
... | 27.176471 | 55 | 0.582251 | 341 | 0.738095 | 0 | 0 | 362 | 0.78355 | 0 | 0 | 38 | 0.082251 |
161139c53368ea4186cb4cad223d2c35a3e06750 | 1,246 | py | Python | examples/prostate/data_preparation/utils/nrrd_to_nifti.py | IsaacYangSLA/NVFlare | 8c6582894c9a8431f64479bc9f472fefcd71e5a7 | [
"Apache-2.0"
] | null | null | null | examples/prostate/data_preparation/utils/nrrd_to_nifti.py | IsaacYangSLA/NVFlare | 8c6582894c9a8431f64479bc9f472fefcd71e5a7 | [
"Apache-2.0"
] | null | null | null | examples/prostate/data_preparation/utils/nrrd_to_nifti.py | IsaacYangSLA/NVFlare | 8c6582894c9a8431f64479bc9f472fefcd71e5a7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ... | 35.6 | 100 | 0.764045 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 773 | 0.620385 |
16117ea75b817e23fa127a364786f0a599ad09cc | 1,570 | py | Python | setup.py | jszakmeister/rst2ctags | 22f4035d9ea1e43a07b91f806014d318b3dc5097 | [
"BSD-3-Clause"
] | 23 | 2015-03-05T14:12:08.000Z | 2022-01-08T00:21:39.000Z | setup.py | jszakmeister/rst2ctags | 22f4035d9ea1e43a07b91f806014d318b3dc5097 | [
"BSD-3-Clause"
] | 8 | 2015-03-05T14:15:44.000Z | 2020-10-02T00:16:55.000Z | setup.py | jszakmeister/rst2ctags | 22f4035d9ea1e43a07b91f806014d318b3dc5097 | [
"BSD-3-Clause"
] | 12 | 2015-03-05T15:12:22.000Z | 2021-11-09T21:29:55.000Z | from setuptools import setup
import io
import os
import re
version_re = re.compile(r'^__version__ = "([^"]*)"$')
# Find the version number.
with open('rst2ctags.py', 'r') as f:
for line in f:
line = line.rstrip()
m = version_re.match(line)
if m:
version = m.group(1)
... | 26.610169 | 74 | 0.610191 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 740 | 0.471338 |
161220d89127fbd24716ad1fd95c0f68eb787901 | 50,986 | py | Python | py-ws/hardshare/cli.py | rerobots/hardshare | 456e7d1d1eb21d03efc3cd1f7960a1729b62527b | [
"Apache-2.0"
] | 8 | 2020-04-14T17:19:57.000Z | 2022-03-03T08:55:34.000Z | py-ws/hardshare/cli.py | rerobots/hardshare | 456e7d1d1eb21d03efc3cd1f7960a1729b62527b | [
"Apache-2.0"
] | 11 | 2020-04-01T15:13:37.000Z | 2021-06-15T22:10:31.000Z | py-ws/hardshare/cli.py | rerobots/hardshare | 456e7d1d1eb21d03efc3cd1f7960a1729b62527b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2018 rerobots, Inc.
#
# 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... | 47.784442 | 109 | 0.530459 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14,393 | 0.282293 |
1612dd8d2c7befa9fffd9b219b0f1e9b1d9948d5 | 508 | py | Python | Dataset/Leetcode/train/7/93.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/7/93.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/7/93.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution:
def XXX(self, x: int) -> int:
def solve(x):
a = list(map(int,str(x)))
p = {}
d=0
for ind, val in enumerate(a):
p[ind] = val
for i, v in p.items():
d += v*(10**i)
if (2**31 - 1>= d >= -(2**... | 24.190476 | 43 | 0.324803 | 506 | 0.996063 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1612e716ac963ff1c93e60be69cd7a089a9ba5ac | 3,870 | py | Python | app/realty.py | JenBanks8585/Labs_CitySpireDS | 4755bd5ce718ee2f65f6a53a5918bd0cf18b2ddf | [
"MIT"
] | null | null | null | app/realty.py | JenBanks8585/Labs_CitySpireDS | 4755bd5ce718ee2f65f6a53a5918bd0cf18b2ddf | [
"MIT"
] | null | null | null | app/realty.py | JenBanks8585/Labs_CitySpireDS | 4755bd5ce718ee2f65f6a53a5918bd0cf18b2ddf | [
"MIT"
] | null | null | null | """Realty Info"""
import os
import requests
from dotenv import load_dotenv
from fastapi import APIRouter, Depends
import sqlalchemy
from pydantic import BaseModel, SecretStr
from app import config
from app.walk_score import *
load_dotenv()
router = APIRouter()
headers = {'x-rapidapi-key': os.getenv('api_key'),
... | 28.880597 | 100 | 0.575969 | 0 | 0 | 0 | 0 | 3,485 | 0.900517 | 3,343 | 0.863824 | 1,336 | 0.34522 |
1614bfb3f4849c9afe583c49f1da9a5698654285 | 2,648 | py | Python | dist/weewx-4.0.0b3/bin/weewx/junk2.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 10 | 2017-01-05T17:30:48.000Z | 2021-09-18T15:04:20.000Z | dist/weewx-4.0.0b3/bin/weewx/junk2.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 2 | 2019-07-21T10:48:42.000Z | 2022-02-16T20:36:45.000Z | dist/weewx-4.0.0b3/bin/weewx/junk2.py | v0rts/docker-weewx | 70b2f252051dfead4fcb74e74662b297831e6342 | [
"Apache-2.0"
] | 12 | 2017-01-05T18:50:30.000Z | 2021-10-05T07:35:45.000Z | from __future__ import print_function
import time
import weeutil.weeutil
import weewx.manager
import weewx.xtypes
archive_sqlite = {'database_name': '/home/weewx/archive/weepwr.sdb', 'driver': 'weedb.sqlite'}
archive_mysql = {'database_name': 'weewx', 'user': 'weewx', 'password': 'weewx', 'driver': 'weedb.mysql'}
sq... | 50.923077 | 203 | 0.692976 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,735 | 0.655211 |
16156ec4833837e6239f5128828011fb974363b0 | 5,868 | py | Python | fast_lemon_api_test.py | a6502/fast_lemon_api | 09a5b6eec3e84d1d006f927e502a7071a28739cc | [
"Unlicense"
] | null | null | null | fast_lemon_api_test.py | a6502/fast_lemon_api | 09a5b6eec3e84d1d006f927e502a7071a28739cc | [
"Unlicense"
] | null | null | null | fast_lemon_api_test.py | a6502/fast_lemon_api | 09a5b6eec3e84d1d006f927e502a7071a28739cc | [
"Unlicense"
] | null | null | null | #!/usr/bin/env pytest-3
from fastapi.testclient import TestClient
from fast_lemon_api import app
client = TestClient(app)
def test_get_root():
response = client.get("/")
assert response.status_code == 200
assert response.text == "Welcome to the fast-lemon-api!\n"
neworder = {
"isin": "blablablabl... | 30.5625 | 80 | 0.387014 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,631 | 0.277948 |
1616161b4c2c7495b51d0bf323d5ee79ad27b64f | 4,999 | py | Python | tests/regenerate_credentials.py | andrewkozlik/pam-u2f | 5b504783c9af972c790bdcb506867bad7df5e333 | [
"BSD-2-Clause"
] | null | null | null | tests/regenerate_credentials.py | andrewkozlik/pam-u2f | 5b504783c9af972c790bdcb506867bad7df5e333 | [
"BSD-2-Clause"
] | null | null | null | tests/regenerate_credentials.py | andrewkozlik/pam-u2f | 5b504783c9af972c790bdcb506867bad7df5e333 | [
"BSD-2-Clause"
] | null | null | null | #!/bin/python2
import collections
import re
import subprocess
import sys
PUC = "../pamu2fcfg/pamu2fcfg"
resident = ["", "-r"]
presence = ["", "-P"]
pin = ["", "-N"]
verification = ["", "-V"]
Credential = collections.namedtuple("Credential", "keyhandle pubkey attributes oldformat")
sshformat = 0
def print_test_... | 34.475862 | 109 | 0.509302 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,303 | 0.260652 |
16173a166fd943413345036df12245c2a4ab8343 | 5,807 | py | Python | tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_scalar_test.py | zhangyujing/tensorflow | c7a04561fb8972fb64907acc5f10f3c6d4cef9f2 | [
"Apache-2.0"
] | 13 | 2018-07-23T18:53:35.000Z | 2021-11-18T19:56:45.000Z | tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_scalar_test.py | zhangyujing/tensorflow | c7a04561fb8972fb64907acc5f10f3c6d4cef9f2 | [
"Apache-2.0"
] | 6 | 2020-04-21T20:38:18.000Z | 2020-06-16T01:00:15.000Z | tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_scalar_test.py | zhangyujing/tensorflow | c7a04561fb8972fb64907acc5f10f3c6d4cef9f2 | [
"Apache-2.0"
] | 13 | 2018-09-07T13:28:38.000Z | 2020-07-17T15:06:24.000Z | # Copyright 2016 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... | 37.707792 | 92 | 0.646633 | 4,595 | 0.791286 | 0 | 0 | 0 | 0 | 0 | 0 | 1,243 | 0.214052 |
161805dd743777711d517821e54c4fec5cc46ec8 | 7,634 | py | Python | mule/util/algorand_util.py | bricerisingalgorand/mule | 721b73f691076e5c3e2ebb8a79313da486fb0f96 | [
"MIT"
] | null | null | null | mule/util/algorand_util.py | bricerisingalgorand/mule | 721b73f691076e5c3e2ebb8a79313da486fb0f96 | [
"MIT"
] | null | null | null | mule/util/algorand_util.py | bricerisingalgorand/mule | 721b73f691076e5c3e2ebb8a79313da486fb0f96 | [
"MIT"
] | null | null | null | import os
import subprocess
import json
import urllib.request
from mule.util import os_util
from mule.util import file_util
from mule.util import time_util
from mule.util import s3_util
from mule.util import semver_util
import platform
def build_algo_release_url(package_type, channel, os_type, cpu_arch_type, package_v... | 38.361809 | 150 | 0.716793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,010 | 0.263296 |
161931efe310b9554c601df989d24d47e0bdfff9 | 2,490 | py | Python | examples/showcase/src/demos_panels/scrollPanel.py | allbuttonspressed/pyjs | c726fdead530eb63ee4763ae15daaa58d84cd58f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/showcase/src/demos_panels/scrollPanel.py | allbuttonspressed/pyjs | c726fdead530eb63ee4763ae15daaa58d84cd58f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/showcase/src/demos_panels/scrollPanel.py | allbuttonspressed/pyjs | c726fdead530eb63ee4763ae15daaa58d84cd58f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-11-18T14:17:59.000Z | 2019-11-18T14:17:59.000Z | """
The ``ui.ScrollPanel`` class implements a panel that scrolls its contents.
If you want the scroll bars to be always visible, call
``setAlwaysShowScrollBars(True)``. You can also change the current scrolling
position programmatically by calling ``setScrollPosition(vPos)`` and
``setScrollHorizontalPosition(hPos)`` ... | 42.20339 | 97 | 0.677912 | 1,400 | 0.562249 | 0 | 0 | 0 | 0 | 0 | 0 | 1,368 | 0.549398 |
1619ba2c67e7c086f7e9ae9363f2ebb460f2febc | 772 | py | Python | psdn.py | xiongchiamiov/phone-suitable-domain-name | da8d28c5783415f406e19b8ef2cde4c790a4c95d | [
"WTFPL"
] | 3 | 2017-10-23T18:31:24.000Z | 2021-02-01T21:22:24.000Z | psdn.py | xiongchiamiov/phone-suitable-domain-name | da8d28c5783415f406e19b8ef2cde4c790a4c95d | [
"WTFPL"
] | null | null | null | psdn.py | xiongchiamiov/phone-suitable-domain-name | da8d28c5783415f406e19b8ef2cde4c790a4c95d | [
"WTFPL"
] | 1 | 2016-10-14T10:47:41.000Z | 2016-10-14T10:47:41.000Z | #!/usr/bin/env python3
# May you recognize your weaknesses and share your strengths.
# May you share freely, never taking more than you give.
# May you find love and love everyone you find.
import re
import time
import whois
phone_spellable = re.compile(r'^[filoqrsuwxy]+$')
candidate_words = []
with open('/usr/sha... | 23.393939 | 61 | 0.634715 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 262 | 0.339378 |
161a0260062e641dc32fc774ac4b854148c5381e | 3,310 | py | Python | src/requester/py/ElevatorTestCaseList.py | akzare/Elevator_Sys_Design | 2f7d7381d68699515a43ec4cf7a8a8afade726f3 | [
"MIT"
] | 1 | 2020-09-03T06:36:22.000Z | 2020-09-03T06:36:22.000Z | src/requester/py/ElevatorTestCaseList.py | akzare/Elevator_Sys_Design | 2f7d7381d68699515a43ec4cf7a8a8afade726f3 | [
"MIT"
] | null | null | null | src/requester/py/ElevatorTestCaseList.py | akzare/Elevator_Sys_Design | 2f7d7381d68699515a43ec4cf7a8a8afade726f3 | [
"MIT"
] | null | null | null | '''
* @file ElevatorTestCaseList.py
* @author Armin Zare Zadeh
* @date 30 July 2020
* @version 0.1
* @brief Implements a class to hold all the test cases during the program life cycle.
'''
#!/usr/bin/env python3
import sys
import ctypes
import ElevatorConfig as cfg
import ElevatorMsgProtocol as msgProto
... | 50.151515 | 105 | 0.459517 | 2,989 | 0.903021 | 0 | 0 | 0 | 0 | 0 | 0 | 762 | 0.230211 |
161a66975b57933d5f14b6a51378ceceb0ae3ebd | 1,725 | py | Python | cart/views.py | pmaigutyak/mp-cart | 53adbbdeea7f8f8b2d432b103f7347d89adf3e30 | [
"0BSD"
] | 1 | 2021-09-25T14:31:48.000Z | 2021-09-25T14:31:48.000Z | cart/views.py | pmaigutyak/mp-cart | 53adbbdeea7f8f8b2d432b103f7347d89adf3e30 | [
"0BSD"
] | null | null | null | cart/views.py | pmaigutyak/mp-cart | 53adbbdeea7f8f8b2d432b103f7347d89adf3e30 | [
"0BSD"
] | 1 | 2021-04-10T18:50:47.000Z | 2021-04-10T18:50:47.000Z |
from django.utils.translation import ugettext
from django.views.decorators.http import require_POST
from django.http import JsonResponse
from django.shortcuts import render
from django.core.exceptions import ValidationError
from django.views.decorators.csrf import csrf_exempt
from cart.lib import get_cart
from cart.f... | 26.136364 | 75 | 0.697391 | 0 | 0 | 0 | 0 | 788 | 0.456812 | 0 | 0 | 137 | 0.07942 |
161a6fecb9358040e2c0bfdcfac12240bdf3bc16 | 2,089 | py | Python | ChessAI/src/const.py | darius-luca-tech/AI_Projects | 3cff26878807121e077375e5dbef39390fea0189 | [
"MIT"
] | 2 | 2020-07-11T14:48:27.000Z | 2020-08-04T11:24:58.000Z | ChessAI/src/const.py | darius-luca-tech/AI_Projects | 3cff26878807121e077375e5dbef39390fea0189 | [
"MIT"
] | null | null | null | ChessAI/src/const.py | darius-luca-tech/AI_Projects | 3cff26878807121e077375e5dbef39390fea0189 | [
"MIT"
] | null | null | null |
#------ game constants -----#
#players
WHITE = 0
BLACK = 1
BOTH = 2
#color for onTurnLabel
PLAYER_COLOR = ["white", "black"]
#figures
PAWN = 1
KNIGHT = 2
BISHOP = 3
ROOK = 4
QUEEN = 5
KING = 6
FIGURE_NAME = [ "", "pawn", "knight", "bishop", "rook", "queen", "king" ]
#used in move 32bit for prom... | 22.706522 | 99 | 0.567736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 783 | 0.37482 |
161b1a291b36fd8f7983e45a6a229f8f666d35f1 | 392 | py | Python | agent.py | kapzlok2408/Pokemon-Showdown-Node-Bot | c759eb9106fd2a3da3ebe4692a6730c37b2e5ee3 | [
"MIT"
] | null | null | null | agent.py | kapzlok2408/Pokemon-Showdown-Node-Bot | c759eb9106fd2a3da3ebe4692a6730c37b2e5ee3 | [
"MIT"
] | null | null | null | agent.py | kapzlok2408/Pokemon-Showdown-Node-Bot | c759eb9106fd2a3da3ebe4692a6730c37b2e5ee3 | [
"MIT"
] | null | null | null | import gym
import gym_pokemon
import random
if __name__ == "__main__":
env = gym.make("Pokemon-v0")
total_reward = 0.0
total_steps = 0
obs = env.reset()
while True:
action = random.randint(-1,8)
obs, reward, done, _ = env.step(action)
total_reward += reward
total_steps += 1
print("Currently %d steps, t... | 20.631579 | 81 | 0.683673 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 64 | 0.163265 |
161b1ad3ceff80971c5c3ea0ba2b51d497a4a215 | 264 | py | Python | Curso-Em-Video-Python/Mundo-2/EXs/EX038.py | victor-da-costa/Aprendendo-Python | 8fd19b93a13953cda30de02de7dac22b4e62fb5b | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/Mundo-2/EXs/EX038.py | victor-da-costa/Aprendendo-Python | 8fd19b93a13953cda30de02de7dac22b4e62fb5b | [
"MIT"
] | null | null | null | Curso-Em-Video-Python/Mundo-2/EXs/EX038.py | victor-da-costa/Aprendendo-Python | 8fd19b93a13953cda30de02de7dac22b4e62fb5b | [
"MIT"
] | null | null | null | num1 = int(input('Digite o 1º número: '))
num2 = int(input('Digite o 2º número: '))
if num1 > num2:
print('O {} é maior que {}'.format(num1, num2))
elif num1 < num2:
print('O {} é maior que4 {}'.format(num2, num1))
else:
print('Os números são iguais')
| 29.333333 | 52 | 0.613636 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 118 | 0.433824 |
161b52cb8725f9e857d4d9abd90c6be8f1cb0dec | 964 | py | Python | setup.py | danjjl/ipyfilechooser | 19d2e906207b2c3426675eda7889267f5956b182 | [
"MIT"
] | null | null | null | setup.py | danjjl/ipyfilechooser | 19d2e906207b2c3426675eda7889267f5956b182 | [
"MIT"
] | null | null | null | setup.py | danjjl/ipyfilechooser | 19d2e906207b2c3426675eda7889267f5956b182 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
def read(fname):
"""Open files relative to package."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='ipyfilechooser',
version='0.3.1',
author='Thomas Bouve (@crahan)',
author_email='... | 26.777778 | 70 | 0.637967 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 471 | 0.488589 |
161dd7d6b32c517702822fdd2b972e9c34a403fe | 8,759 | py | Python | appengine/chromium_build_logs/handler.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | 1 | 2018-01-02T05:47:07.000Z | 2018-01-02T05:47:07.000Z | appengine/chromium_build_logs/handler.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | appengine/chromium_build_logs/handler.py | mithro/chromium-infra | d27ac0b230bedae4bc968515b02927cf9e17c2b7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import appengine_config
import datetime
import json
import logging
import os.path
import pickle
import sys
import urllib
sys.path.append(
os.path.j... | 31.170819 | 79 | 0.685352 | 6,746 | 0.770179 | 0 | 0 | 0 | 0 | 0 | 0 | 2,326 | 0.265555 |
161de43480d9d0733aef7b6ee4c05009bd0cafa3 | 810 | py | Python | tools/leetcode.127.Word Ladder/leetcode.127.Word Ladder.submission1.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | 4 | 2015-10-10T00:30:55.000Z | 2020-07-27T19:45:54.000Z | tools/leetcode.127.Word Ladder/leetcode.127.Word Ladder.submission1.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | tools/leetcode.127.Word Ladder/leetcode.127.Word Ladder.submission1.py | tedye/leetcode | 975d7e3b8cb9b6be9e80e07febf4bcf6414acd46 | [
"MIT"
] | null | null | null | class Solution:
# @param {string} beginWord
# @param {string} endWord
# @param {set<string>} wordDict
# @return {integer}
def ladderLength(self, beginWord, endWord, wordDict):
# BFS
scanLayer = [beginWord]
distRecord = [1]
while scanLayer:
curWord = scanLa... | 810 | 810 | 0.504938 | 810 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 790 | 0.975309 |
161f5fc0724b14420397243336670a4b9fb7062e | 20,580 | py | Python | aws_lambda/pytorch/source/caffe2/python/operator_test/elementwise_op_broadcast_test.py | YevhenVieskov/ML-DL-in-production | 03839abcb93a49d4f05c43aa4e446a040027cdb0 | [
"MIT"
] | 4 | 2020-09-17T11:50:17.000Z | 2021-08-25T06:14:10.000Z | aws_lambda/pytorch/source/caffe2/python/operator_test/elementwise_op_broadcast_test.py | YevhenVieskov/ML-DL-in-production | 03839abcb93a49d4f05c43aa4e446a040027cdb0 | [
"MIT"
] | null | null | null | aws_lambda/pytorch/source/caffe2/python/operator_test/elementwise_op_broadcast_test.py | YevhenVieskov/ML-DL-in-production | 03839abcb93a49d4f05c43aa4e446a040027cdb0 | [
"MIT"
] | 6 | 2020-10-16T13:28:31.000Z | 2021-08-25T12:08:34.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
from hypothesis import given
import numpy as np
from caffe2.proto import caffe2_pb2
from caffe2.python import core, workspace
import caffe2.python.hypot... | 42 | 79 | 0.56035 | 20,056 | 0.974538 | 0 | 0 | 19,945 | 0.969145 | 0 | 0 | 2,897 | 0.140768 |
161fe3f007696be8bbc024b9cad0f629ab8008f8 | 28,143 | py | Python | kayobe/tests/unit/cli/test_commands.py | jovial/kayobe | 49e61fef4a221ee9fcfcee2b7bac02b6acc5bd0c | [
"Apache-2.0"
] | null | null | null | kayobe/tests/unit/cli/test_commands.py | jovial/kayobe | 49e61fef4a221ee9fcfcee2b7bac02b6acc5bd0c | [
"Apache-2.0"
] | null | null | null | kayobe/tests/unit/cli/test_commands.py | jovial/kayobe | 49e61fef4a221ee9fcfcee2b7bac02b6acc5bd0c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 StackHPC 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 in wr... | 37.324934 | 93 | 0.538855 | 27,422 | 0.974381 | 0 | 0 | 27,009 | 0.959706 | 0 | 0 | 6,392 | 0.227126 |
1620270422616b41ca7180a5b9004dcde020933a | 1,590 | py | Python | keras2onnx/proto/tfcompat.py | CNugteren/keras-onnx | b3d6b6486fe56640c48c62dd098e9405e35b4e9f | [
"MIT"
] | 1 | 2021-04-15T16:35:54.000Z | 2021-04-15T16:35:54.000Z | keras2onnx/proto/tfcompat.py | CNugteren/keras-onnx | b3d6b6486fe56640c48c62dd098e9405e35b4e9f | [
"MIT"
] | null | null | null | keras2onnx/proto/tfcompat.py | CNugteren/keras-onnx | b3d6b6486fe56640c48c62dd098e9405e35b4e9f | [
"MIT"
] | null | null | null | ###############################################################################
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
###############################################################################
imp... | 31.8 | 83 | 0.610692 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 464 | 0.291824 |
16205a78e576c7488204d92806cb7a59f5ca5566 | 11,588 | py | Python | back2back/httpmulticlient.py | excentis/ByteBlower_python_examples | 0e082e17413abf5e25f6d14b85e50e7f73e7f965 | [
"BSD-3-Clause"
] | 2 | 2018-10-04T10:55:55.000Z | 2018-11-29T08:51:38.000Z | back2back/httpmulticlient.py | excentis/ByteBlower_python_examples | 0e082e17413abf5e25f6d14b85e50e7f73e7f965 | [
"BSD-3-Clause"
] | null | null | null | back2back/httpmulticlient.py | excentis/ByteBlower_python_examples | 0e082e17413abf5e25f6d14b85e50e7f73e7f965 | [
"BSD-3-Clause"
] | 3 | 2018-10-04T10:56:29.000Z | 2019-10-28T10:19:40.000Z | """
HTTP MultiServer/MultiClient for the ByteBlower Python API.
All examples are guaranteed to work with Python 2.7 and above
Copyright 2018, Excentis N.V.
"""
# Needed for python2 / python3 print function compatibility
from __future__ import print_function
# import the ByteBlower module
import byteblowerll.byteblowe... | 36.440252 | 101 | 0.621764 | 7,960 | 0.686918 | 0 | 0 | 0 | 0 | 0 | 0 | 4,523 | 0.390318 |
16214a743fb88fbf7d2c7ed97c9778c2fbeb46d1 | 4,764 | py | Python | tools/pod-xml-to-geojson.py | 24-timmarsseglingarna/app | 0c028bd2eb284c6893cb16dd91bd093b2222338f | [
"Apache-2.0"
] | null | null | null | tools/pod-xml-to-geojson.py | 24-timmarsseglingarna/app | 0c028bd2eb284c6893cb16dd91bd093b2222338f | [
"Apache-2.0"
] | 14 | 2017-08-24T12:46:58.000Z | 2021-04-21T07:56:58.000Z | tools/pod-xml-to-geojson.py | 24-timmarsseglingarna/app | 0c028bd2eb284c6893cb16dd91bd093b2222338f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Converts a PoD XML file to a GeoJSON file.
#
# With the --javascript parameter, the generated file is a javascript
# file defining a variable 'basePodSpec'.
#
# Get the PoD XML file from http://dev.24-timmars.nu/PoD/xmlapi_app.php.
import xml.etree.ElementTree as etree
import argparse
import r... | 29.407407 | 79 | 0.553736 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,203 | 0.252519 |
1621aa767e78100c7f16f615ddf74780115c4b1d | 9,106 | py | Python | rastervision/plugin.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 3 | 2020-07-05T04:04:18.000Z | 2021-02-05T16:19:55.000Z | rastervision/plugin.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | null | null | null | rastervision/plugin.py | carderne/raster-vision | 915fbcd3263d8f2193e65c2cd0eb53e050a47a01 | [
"Apache-2.0"
] | 1 | 2020-04-27T15:21:53.000Z | 2020-04-27T15:21:53.000Z | import os
import json
import importlib
from pluginbase import PluginBase
import rastervision as rv
from rastervision.protos.plugin_pb2 import PluginConfig as PluginConfigMsg
from rastervision.utils.files import download_if_needed
class PluginError(Exception):
pass
def load_conf_list(s):
"""Loads a list of... | 40.471111 | 80 | 0.648913 | 8,221 | 0.902811 | 0 | 0 | 88 | 0.009664 | 0 | 0 | 3,477 | 0.381836 |
1621ccd669a0abec2dea3abc64d60feca57f3bfe | 2,134 | py | Python | acsm/nnutils/resunet.py | eldar/acsm | 04069e8bb4c12185473dc10c3355e5367fa98968 | [
"Apache-2.0"
] | 52 | 2020-04-02T12:35:55.000Z | 2022-03-11T07:47:30.000Z | acsm/nnutils/resunet.py | eldar/acsm | 04069e8bb4c12185473dc10c3355e5367fa98968 | [
"Apache-2.0"
] | 8 | 2020-06-04T07:34:34.000Z | 2021-09-18T21:17:26.000Z | acsm/nnutils/resunet.py | eldar/acsm | 04069e8bb4c12185473dc10c3355e5367fa98968 | [
"Apache-2.0"
] | 6 | 2020-07-12T02:12:18.000Z | 2021-03-06T05:03:33.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl import app
from absl import flags
import os
import os.path as osp
import numpy as np
import torch
import torchvision
import torch.nn as nn
from torch.autograd import Variable
import functools
from . ... | 27.358974 | 79 | 0.612933 | 1,773 | 0.830834 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
162335a5b07a8e07ba6397644e3e4ed7a9f459e2 | 8,442 | py | Python | uproot_methods/common/TVector.py | marinang/uproot-methods | 1d16d51ab7da19b4f31070d24e8fbfed3ae3ec8f | [
"BSD-3-Clause"
] | null | null | null | uproot_methods/common/TVector.py | marinang/uproot-methods | 1d16d51ab7da19b4f31070d24e8fbfed3ae3ec8f | [
"BSD-3-Clause"
] | null | null | null | uproot_methods/common/TVector.py | marinang/uproot-methods | 1d16d51ab7da19b4f31070d24e8fbfed3ae3ec8f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2018, DIANA-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list ... | 31.036765 | 91 | 0.650912 | 6,792 | 0.804549 | 0 | 0 | 683 | 0.080905 | 0 | 0 | 1,716 | 0.203269 |
16262857a0ab051d70328d47ffe56eedbe48f8d3 | 1,259 | py | Python | tpp/controller/ConversionController.py | pennyarcade/TPPP | 9bb6db774d77f74c54ed2fa004e97c1aa114fff9 | [
"MIT"
] | null | null | null | tpp/controller/ConversionController.py | pennyarcade/TPPP | 9bb6db774d77f74c54ed2fa004e97c1aa114fff9 | [
"MIT"
] | null | null | null | tpp/controller/ConversionController.py | pennyarcade/TPPP | 9bb6db774d77f74c54ed2fa004e97c1aa114fff9 | [
"MIT"
] | null | null | null | """
Implements a non interactive controller to controt non-interactive visualizers.
(i.e. those that are used for converting TPP souce code into another format)
"""
from tpp.FileParser import FileParser
from tpp.controller.TPPController import TPPController
class ConversionController(TPPController):
"""
Impl... | 24.686275 | 81 | 0.590151 | 997 | 0.791898 | 0 | 0 | 0 | 0 | 0 | 0 | 581 | 0.461477 |
1626ca15f81c599021a7770317db1230752e7b3f | 4,282 | py | Python | scrapers/covid_scraper.py | ZachGeo/covidGR_API | 2f316337dda65bd33ac895df336481c3c2abe2c6 | [
"MIT"
] | null | null | null | scrapers/covid_scraper.py | ZachGeo/covidGR_API | 2f316337dda65bd33ac895df336481c3c2abe2c6 | [
"MIT"
] | null | null | null | scrapers/covid_scraper.py | ZachGeo/covidGR_API | 2f316337dda65bd33ac895df336481c3c2abe2c6 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from datetime import date
from lxml import html
import requests
import re
import json
class CovidScraper:
def __init__(self):
self.api_url = 'http://127.0.0.1:5000/covidgr'
self.api_sum_url = 'http://127.0.0.1:5000/summary/covidgr'
self.api_test_url = 'http://... | 32.439394 | 148 | 0.615834 | 4,061 | 0.948389 | 0 | 0 | 0 | 0 | 0 | 0 | 542 | 0.126576 |
16278cfaea317b80559af8d9f8ed6e412d50c446 | 776 | py | Python | img/autoeditimg.py | schorsche/css3-imageslider | 6d15b2e77f141b8e871bdce2049ee7b2567981fe | [
"MIT"
] | null | null | null | img/autoeditimg.py | schorsche/css3-imageslider | 6d15b2e77f141b8e871bdce2049ee7b2567981fe | [
"MIT"
] | null | null | null | img/autoeditimg.py | schorsche/css3-imageslider | 6d15b2e77f141b8e871bdce2049ee7b2567981fe | [
"MIT"
] | 1 | 2019-02-23T22:54:22.000Z | 2019-02-23T22:54:22.000Z | #!/usr/bin/python2.7
import os
from PIL import Image
DATEI_WEB_GROSSE = 700
def isimg(isitimg):
ext = os.path.splitext(isitimg)[1].lower()
if ext == ".jpg" or ext == ".png" or ext == ".gif":
return True
return False
def bearbeiten(datei):
img = Image.open(datei)
wrel = DATEI_WEB_GROSSE / float(img.size[0])
h... | 22.171429 | 68 | 0.68299 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 51 | 0.065722 |
1627fcf089cd43ce83004fbce276962343e2f2c7 | 785 | py | Python | wow/wow.py | brisberg/Kiri-Cogs | 9a5307ff8fbaa5e0560ec518cf26df52347da98d | [
"MIT"
] | null | null | null | wow/wow.py | brisberg/Kiri-Cogs | 9a5307ff8fbaa5e0560ec518cf26df52347da98d | [
"MIT"
] | null | null | null | wow/wow.py | brisberg/Kiri-Cogs | 9a5307ff8fbaa5e0560ec518cf26df52347da98d | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
class WowCog:
"""Custom Cog that had commands for WoW Memes"""
def __init__(self, bot):
self.bot = bot
async def _play(self, url, ctx):
"""Helper for aliasing Play in the Audio module"""
audio = self.bot.get_cog('Audio')
if ... | 29.074074 | 99 | 0.64586 | 687 | 0.875159 | 0 | 0 | 220 | 0.280255 | 503 | 0.640764 | 246 | 0.313376 |
16286e428c3bbec3fb9fbe61340a4121c6311a63 | 274 | py | Python | tests/attacks/class_test.py | henrik997/privacy-evaluator | f1d0e6c10ff58e582a44243788ab66c1d453bfa0 | [
"MIT"
] | null | null | null | tests/attacks/class_test.py | henrik997/privacy-evaluator | f1d0e6c10ff58e582a44243788ab66c1d453bfa0 | [
"MIT"
] | null | null | null | tests/attacks/class_test.py | henrik997/privacy-evaluator | f1d0e6c10ff58e582a44243788ab66c1d453bfa0 | [
"MIT"
] | null | null | null | import pytest
from privacy_evaluator.attacks.sample_attack import Sample_Attack
"""
This test only test if no error is thrown when calling the function, can be removed in the future
"""
def test_sample_attack():
test = Sample_Attack(0, 0, 0)
test.perform_attack()
| 24.909091 | 97 | 0.762774 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 105 | 0.383212 |
162894b73abedfff0ad797772b95e5e53cb507ab | 2,412 | py | Python | setup.py | Oli2/presto-python-client | 11a89c2528a35d5af6916e9c9175cb3e1f84160b | [
"Apache-2.0"
] | null | null | null | setup.py | Oli2/presto-python-client | 11a89c2528a35d5af6916e9c9175cb3e1f84160b | [
"Apache-2.0"
] | null | null | null | setup.py | Oli2/presto-python-client | 11a89c2528a35d5af6916e9c9175cb3e1f84160b | [
"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
# distributed under th... | 33.041096 | 78 | 0.641376 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,664 | 0.689884 |
162b50aea1cc09a5257abec74537cee83cae39dc | 368 | py | Python | Graphs/Pie Chart.py | TausifAnsari/PyHub | f6c949dc6a3974f57d7d146708443d0ceeb4418f | [
"MIT"
] | 1 | 2020-09-30T19:31:20.000Z | 2020-09-30T19:31:20.000Z | Graphs/Pie Chart.py | TanviSutar/PyHub | 6281e9f515674fb51f0d0862c26ec18020fa7d83 | [
"MIT"
] | null | null | null | Graphs/Pie Chart.py | TanviSutar/PyHub | 6281e9f515674fb51f0d0862c26ec18020fa7d83 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as graph
subject = ["Probability", "Calculas", "Discrete Mathematics", "Adv Engineering Mathematics",
"Linear Algebra", "Cryptography"]
weightage = [250,900,850,1200,290,345]
seperator = [0.05,0,0,0,0.05,0.05]
graph.title("Mathematics Topic Weightage")
graph.pie(weightage,labels=subject,au... | 30.666667 | 93 | 0.741848 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 142 | 0.38587 |
162b6c04231d6cc1d5159da7ca51127039c4295e | 6,252 | py | Python | exercises/perform_model_selection.py | noavilk/IML.HUJI | 35aa4e6fbe489239e4fe72bf38c0dba3e6c81f37 | [
"MIT"
] | null | null | null | exercises/perform_model_selection.py | noavilk/IML.HUJI | 35aa4e6fbe489239e4fe72bf38c0dba3e6c81f37 | [
"MIT"
] | null | null | null | exercises/perform_model_selection.py | noavilk/IML.HUJI | 35aa4e6fbe489239e4fe72bf38c0dba3e6c81f37 | [
"MIT"
] | null | null | null | from __future__ import annotations
import numpy as np
import pandas as pd
from sklearn import datasets
from IMLearn.metrics import mean_square_error
from IMLearn.utils import split_train_test
from IMLearn.model_selection import cross_validate
from IMLearn.learners.regressors import PolynomialFitting, LinearRegression, ... | 45.304348 | 117 | 0.644274 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,215 | 0.354287 |
162c0bbced3e06420246b7de0d2ad6e3745c54ef | 9,001 | py | Python | libraries/tools/media_utils.py | unfoldingWord-dev/d43-catalog | 6c36f59b9b326e0ead45739c09631ef1e57c4932 | [
"MIT"
] | 1 | 2017-05-18T22:18:31.000Z | 2017-05-18T22:18:31.000Z | libraries/tools/media_utils.py | unfoldingWord-dev/d43-catalog | 6c36f59b9b326e0ead45739c09631ef1e57c4932 | [
"MIT"
] | 54 | 2016-11-07T03:07:03.000Z | 2021-04-14T21:24:04.000Z | libraries/tools/media_utils.py | unfoldingWord-dev/d43-catalog | 6c36f59b9b326e0ead45739c09631ef1e57c4932 | [
"MIT"
] | 7 | 2016-10-26T18:15:14.000Z | 2018-06-01T18:37:32.000Z | import re
import copy
def parse_media(media, content_version, project_chapters):
"""
Converts a media object into formats usable in the catalog
:param media: the media object
:type media: dict
:param content_version: the current version of the source content
:type content_version: string
:p... | 39.47807 | 120 | 0.579602 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,278 | 0.364182 |
162c1fe872f535df8473bc4c5719a90f0e1d8d91 | 4,518 | py | Python | django_customflow/mixins.py | Brad19940809/django-customflow | 502eed512d7c29e8d176c67fa62a7fce0be492d7 | [
"MIT"
] | 1 | 2019-08-06T09:28:11.000Z | 2019-08-06T09:28:11.000Z | django_customflow/mixins.py | Brad19940809/django-customflow | 502eed512d7c29e8d176c67fa62a7fce0be492d7 | [
"MIT"
] | null | null | null | django_customflow/mixins.py | Brad19940809/django-customflow | 502eed512d7c29e8d176c67fa62a7fce0be492d7 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# create_time: 2019/8/5 16:02
# __author__ = 'brad'
from . import utils
from .tasks.base import WaitingTask, BaseTask
class WorkflowMixin(object):
"""Mixin class to make objects workflow aware.
"""
def get_workflow(self):
"""Returns the current workflow of the object.
... | 34.227273 | 112 | 0.626162 | 4,572 | 0.969466 | 0 | 0 | 0 | 0 | 0 | 0 | 1,765 | 0.374258 |
162c59bea2ea2599ffb8f94490a631231802e6ea | 2,272 | py | Python | video_encoding/fields.py | fossabot/django-video-encoding | 16a88c2d61d28e6f5ec2b49956ce356f8c458c67 | [
"BSD-3-Clause"
] | 164 | 2019-07-29T17:59:06.000Z | 2022-03-19T21:36:01.000Z | video_encoding/fields.py | fossabot/django-video-encoding | 16a88c2d61d28e6f5ec2b49956ce356f8c458c67 | [
"BSD-3-Clause"
] | 188 | 2019-03-16T09:53:25.000Z | 2019-07-25T14:57:24.000Z | video_encoding/fields.py | fossabot/django-video-encoding | 16a88c2d61d28e6f5ec2b49956ce356f8c458c67 | [
"BSD-3-Clause"
] | 80 | 2019-08-03T17:49:08.000Z | 2022-02-28T16:56:33.000Z | from django.db.models.fields.files import (FieldFile, ImageField,
ImageFileDescriptor)
from django.utils.translation import ugettext as _
from .backends import get_backend_class
from .files import VideoFile
class VideoFileDescriptor(ImageFileDescriptor):
pass
class Vi... | 31.555556 | 78 | 0.636444 | 2,012 | 0.885563 | 0 | 0 | 0 | 0 | 0 | 0 | 275 | 0.121039 |
162cd54c3b760abba50c342688a1d04f0b1b3010 | 631 | py | Python | BST.py | boristown/leetcode | 2e510b7913653da75cd9d10f1adce4c466e74768 | [
"MIT"
] | 1 | 2021-10-04T03:09:51.000Z | 2021-10-04T03:09:51.000Z | BST.py | boristown/leetcode | 2e510b7913653da75cd9d10f1adce4c466e74768 | [
"MIT"
] | null | null | null | BST.py | boristown/leetcode | 2e510b7913653da75cd9d10f1adce4c466e74768 | [
"MIT"
] | null | null | null | class BST:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
@staticmethod
def array2BST(array):
'''
array:sorted array
'''
n = len(array)
if n == 0: return None
m = n//2
left,... | 26.291667 | 76 | 0.534073 | 631 | 1 | 0 | 0 | 476 | 0.754358 | 0 | 0 | 79 | 0.125198 |
162cf5942b39cb55c7afb1cde65c73f78fbc4d55 | 8,182 | py | Python | test/spec/test_spec.py | raghu1121/SLM-Lab | 58e98b6521f581515d04ebacff5226105237ed9b | [
"MIT"
] | 1 | 2021-09-01T11:57:04.000Z | 2021-09-01T11:57:04.000Z | test/spec/test_spec.py | ragtz/SLM-Lab | 42c48af308dfe36401990aca3795bc481cf28c17 | [
"MIT"
] | null | null | null | test/spec/test_spec.py | ragtz/SLM-Lab | 42c48af308dfe36401990aca3795bc481cf28c17 | [
"MIT"
] | null | null | null | from flaky import flaky
from slm_lab.experiment.control import Trial
from slm_lab.experiment.monitor import InfoSpace
from slm_lab.lib import util
from slm_lab.spec import spec_util
import os
import pandas as pd
import pytest
import sys
# helper method to run all tests in test_spec
def run_trial_test(spec_file, spec_... | 36.855856 | 82 | 0.744072 | 0 | 0 | 0 | 0 | 7,528 | 0.920068 | 0 | 0 | 4,682 | 0.572232 |
162d0aa4bb77e9b34f76b8530aaf8f57b28901c9 | 647 | py | Python | test/test_modify_group.py | Sfairat00/training_python | 14562b377d19bf22fc077e02efc7e56e73785a55 | [
"Apache-2.0"
] | null | null | null | test/test_modify_group.py | Sfairat00/training_python | 14562b377d19bf22fc077e02efc7e56e73785a55 | [
"Apache-2.0"
] | null | null | null | test/test_modify_group.py | Sfairat00/training_python | 14562b377d19bf22fc077e02efc7e56e73785a55 | [
"Apache-2.0"
] | null | null | null | from model.group import Group
def test_modify_group_name(app):
if app.group.count() == 0:
app.group.create(Group(name="test"))
old_groups = app.group.get_group_list()
app.group.modify_first_group(Group(name="New group"))
new_groups = app.group.get_group_list()
assert len(old_groups) == len... | 26.958333 | 60 | 0.698609 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0.054096 |
162ffe7bb753d133521ad38601ddfbb5cb83a226 | 4,192 | py | Python | readme_metrics/MetricsMiddleware.py | readmeio/metrics-sdks-python | 02bc6e486260641f1a62760d20370157a4928af6 | [
"0BSD"
] | 2 | 2020-09-23T04:44:22.000Z | 2021-07-06T18:14:11.000Z | readme_metrics/MetricsMiddleware.py | readmeio/metrics-sdks-python | 02bc6e486260641f1a62760d20370157a4928af6 | [
"0BSD"
] | null | null | null | readme_metrics/MetricsMiddleware.py | readmeio/metrics-sdks-python | 02bc6e486260641f1a62760d20370157a4928af6 | [
"0BSD"
] | 1 | 2020-09-23T04:44:25.000Z | 2020-09-23T04:44:25.000Z | import io
import time
import datetime
from readme_metrics.Metrics import Metrics
from readme_metrics.MetricsApiConfig import MetricsApiConfig
from readme_metrics.ResponseInfoWrapper import ResponseInfoWrapper
from werkzeug import Request
class MetricsMiddleware:
"""Core middleware class for ReadMe Metrics
A... | 34.933333 | 87 | 0.569656 | 3,950 | 0.942271 | 3,176 | 0.757634 | 0 | 0 | 0 | 0 | 1,468 | 0.350191 |
16312fcb11ab7937c366343185da9dd102a4e745 | 4,048 | py | Python | kbrl.py | deekshaarya4/gymexperiments | 2d503ba14fcfba41339de25dd78d649bd12693e6 | [
"MIT"
] | null | null | null | kbrl.py | deekshaarya4/gymexperiments | 2d503ba14fcfba41339de25dd78d649bd12693e6 | [
"MIT"
] | null | null | null | kbrl.py | deekshaarya4/gymexperiments | 2d503ba14fcfba41339de25dd78d649bd12693e6 | [
"MIT"
] | null | null | null | import numpy as np
import gym
from sklearn.neighbors import NearestNeighbors
import matplotlib.pyplot as plt
import argparse
parser = argparse.ArgumentParser(description='KBRL with KNN')
parser.add_argument('--episodes', nargs='?', type=int, default=500)
parser.add_argument('--max_timesteps', nargs='?', type=int, defa... | 30.900763 | 100 | 0.673913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,021 | 0.252223 |
1631aec82f9bb8a63392680178fdfa614b25b1c9 | 10,654 | py | Python | shardDesigner/shardTemplateDir/shardStemDir/log/elast.py | vinci-project/rootShard | 2f6633c7fb1c1b690c0a38ffbb16af0b50d532bb | [
"MIT"
] | null | null | null | shardDesigner/shardTemplateDir/shardStemDir/log/elast.py | vinci-project/rootShard | 2f6633c7fb1c1b690c0a38ffbb16af0b50d532bb | [
"MIT"
] | 7 | 2020-03-02T11:23:41.000Z | 2022-03-11T23:52:51.000Z | shardDesigner/shardTemplateDir/shardStemDir/log/elast.py | vinci-project/rootShard | 2f6633c7fb1c1b690c0a38ffbb16af0b50d532bb | [
"MIT"
] | null | null | null | import elasticsearch
from elasticsearch import Elasticsearch
from elasticsearch import helpers
import time, json, datetime, os
class elalog:
def __init__(self, date):
es_host = os.getenv("ES_PORT_9200_TCP_ADDR") or '<%ELASTICIP%>'
es_port = os.getenv("ES_PORT_9200_TCP_PORT") or '9200'
sel... | 41.455253 | 186 | 0.382016 | 10,524 | 0.987798 | 0 | 0 | 0 | 0 | 0 | 0 | 1,922 | 0.180402 |
1631ce5936a7d3f836485152fc8ba3c55b4623c2 | 722 | py | Python | corehq/apps/sms/tests.py | dslowikowski/commcare-hq | ad8885cf8dab69dc85cb64f37aeaf06106124797 | [
"BSD-3-Clause"
] | 1 | 2015-02-10T23:26:39.000Z | 2015-02-10T23:26:39.000Z | corehq/apps/sms/tests.py | SEL-Columbia/commcare-hq | 992ee34a679c37f063f86200e6df5a197d5e3ff6 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/apps/sms/tests.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from util import clean_phone_number, clean_outgoing_sms_text
from django.test import TestCase
class UtilTestCase(TestCase):
def setUp(self):
pass
def testCleanPhoneNumber(self):
phone_number = " 324 23-23421241"
cl... | 32.818182 | 106 | 0.685596 | 562 | 0.770919 | 0 | 0 | 0 | 0 | 0 | 0 | 258 | 0.353909 |
16320687d82ed5fd57ef5ebf44c1b6e925a208e1 | 12,169 | py | Python | deepchem/models/atomic_conv.py | cjgalvin/deepchem | 64993a129e7f0f78fed9500298b1828ac8a0757a | [
"MIT"
] | 3 | 2019-05-29T19:18:25.000Z | 2021-01-25T05:44:05.000Z | deepchem/models/atomic_conv.py | cjgalvin/deepchem | 64993a129e7f0f78fed9500298b1828ac8a0757a | [
"MIT"
] | 10 | 2017-02-23T19:39:22.000Z | 2017-08-31T22:21:18.000Z | deepchem/models/atomic_conv.py | cjgalvin/deepchem | 64993a129e7f0f78fed9500298b1828ac8a0757a | [
"MIT"
] | 1 | 2018-09-22T00:53:53.000Z | 2018-09-22T00:53:53.000Z | __author__ = "Joseph Gomes"
__copyright__ = "Copyright 2017, Stanford University"
__license__ = "MIT"
import sys
from deepchem.models import KerasModel
from deepchem.models.layers import AtomicConvolution
from deepchem.models.losses import L2Loss
from tensorflow.keras.layers import Input, Layer
import numpy as np
im... | 36.109792 | 143 | 0.639494 | 10,813 | 0.888569 | 3,250 | 0.267072 | 0 | 0 | 0 | 0 | 1,891 | 0.155395 |
163248c24fc9b2b48d8f714d22251c83d3496af1 | 2,694 | py | Python | dialogue-engine/test/programytest/config/brain/test_oob.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 104 | 2020-03-30T09:40:00.000Z | 2022-03-06T22:34:25.000Z | dialogue-engine/test/programytest/config/brain/test_oob.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 25 | 2020-06-12T01:36:35.000Z | 2022-02-19T07:30:44.000Z | dialogue-engine/test/programytest/config/brain/test_oob.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 10 | 2020-04-02T23:43:56.000Z | 2021-05-14T13:47:01.000Z | """
Copyright (c) 2020 COTOBA DESIGN, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distri... | 42.761905 | 126 | 0.72977 | 1,406 | 0.521901 | 0 | 0 | 0 | 0 | 0 | 0 | 1,410 | 0.523385 |
16329b70c55c3c7cf597931457db274fe5d63821 | 327 | py | Python | pypad/active_skill/interfaces/orb_generator_asi.py | candyninja001/pypad | 82bfc104c2524ca54cc415d37d2c21fec471838f | [
"MIT"
] | null | null | null | pypad/active_skill/interfaces/orb_generator_asi.py | candyninja001/pypad | 82bfc104c2524ca54cc415d37d2c21fec471838f | [
"MIT"
] | null | null | null | pypad/active_skill/interfaces/orb_generator_asi.py | candyninja001/pypad | 82bfc104c2524ca54cc415d37d2c21fec471838f | [
"MIT"
] | null | null | null | import abc
from ...orb_attribute import OrbAttribute
# Interface for active skills that create specific orb types (whether board change, orb change, orb spawn, etc)
class OrbGeneratorASI(abc.ABC):
@abc.abstractmethod
def does_orb_generator_create_orb_attribute(self, orb_attribute: OrbAttribute) -> bool:
... | 36.333333 | 111 | 0.776758 | 160 | 0.489297 | 0 | 0 | 124 | 0.379205 | 0 | 0 | 111 | 0.33945 |
1632af4d460f191002d145c0aa53f5434243e662 | 5,717 | py | Python | setup.py | DivoK/mystery | b656eebe678c64864b2a5762765f36bddd540933 | [
"MIT"
] | 8 | 2019-05-31T19:46:49.000Z | 2020-05-14T22:21:35.000Z | setup.py | DivoK/mystery | b656eebe678c64864b2a5762765f36bddd540933 | [
"MIT"
] | 4 | 2019-06-04T15:24:22.000Z | 2021-06-01T23:53:37.000Z | setup.py | DivoK/mystery | b656eebe678c64864b2a5762765f36bddd540933 | [
"MIT"
] | 4 | 2019-06-04T15:08:46.000Z | 2020-04-25T15:52:00.000Z | """
Core business logic for `mystery`.
This code will run when the package is being built and installed.
"""
import json
import pathlib
import random
import tempfile
import urllib.request
import typing
import setuptools
from setuptools.command.sdist import sdist
# Load the configuration file.
CONFIG_PATH = pathlib.P... | 32.117978 | 109 | 0.688473 | 295 | 0.0516 | 0 | 0 | 0 | 0 | 0 | 0 | 3,045 | 0.532622 |
1632cc5107307be666384111255532a74d2d121a | 1,665 | py | Python | ADMM_primal.py | CrazyIvanPro/Optimal_Transport | aa782820a5ca5a01909ed3c32acbada43f6cfa0f | [
"MIT"
] | 2 | 2020-11-09T10:37:19.000Z | 2021-07-06T09:24:30.000Z | ADMM_primal.py | CrazyIvanPro/Optimal_Transport | aa782820a5ca5a01909ed3c32acbada43f6cfa0f | [
"MIT"
] | null | null | null | ADMM_primal.py | CrazyIvanPro/Optimal_Transport | aa782820a5ca5a01909ed3c32acbada43f6cfa0f | [
"MIT"
] | 1 | 2021-06-03T17:07:01.000Z | 2021-06-03T17:07:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# =======================================
# File Name: ADMM_primal.py
# Purpose : implementation for ADMM method
# for solving primal problem
# =======================================
from utils import get_params
import numpy as np
import sys
def ADMM_primal(... | 29.732143 | 89 | 0.465465 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 368 | 0.221021 |
163306f757b2b46fb97912f794d0169c24de2f36 | 1,117 | py | Python | misc_scripts/CleanVCFparams.py | pombase/legacy-eg-loader | 1a324121325ffc3b9a4c15922f7a12756a9c3206 | [
"Apache-2.0"
] | null | null | null | misc_scripts/CleanVCFparams.py | pombase/legacy-eg-loader | 1a324121325ffc3b9a4c15922f7a12756a9c3206 | [
"Apache-2.0"
] | null | null | null | misc_scripts/CleanVCFparams.py | pombase/legacy-eg-loader | 1a324121325ffc3b9a4c15922f7a12756a9c3206 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import os
import sys
import pprint
import argparse
parser = argparse.ArgumentParser(description='Clean up the data for a given parameter')
parser.add_argument('--infile', help="Path to the VCF file", default='test.vcf')
parser.add_argument('--outfile', help="Path to the new VCF file", default='test.... | 25.386364 | 94 | 0.637422 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 314 | 0.28111 |
1633a9fb3de8a2d02c1b973e0da5225da5fdee84 | 25,426 | py | Python | create_coherency_dataset.py | UKPLab/acl20-dialogue-coherence-assessment | 328b888855dc833b4b0c05c259ee7115f4219dbe | [
"MIT"
] | 12 | 2020-05-03T12:41:53.000Z | 2021-11-19T06:45:56.000Z | create_coherency_dataset.py | UKPLab/acl20-dialogue-coherence-assessment | 328b888855dc833b4b0c05c259ee7115f4219dbe | [
"MIT"
] | 2 | 2020-07-02T08:19:19.000Z | 2021-12-03T16:58:02.000Z | create_coherency_dataset.py | UKPLab/acl20-dialogue-coherence-assessment | 328b888855dc833b4b0c05c259ee7115f4219dbe | [
"MIT"
] | 4 | 2020-08-27T08:36:55.000Z | 2021-08-19T21:53:31.000Z | import math
import os
from copy import deepcopy
from ast import literal_eval
import pandas as pd
from math import factorial
import random
from collections import Counter, defaultdict
import sys
from nltk import word_tokenize
from tqdm import tqdm, trange
import argparse
import numpy as np
import re
import csv
from skle... | 39.977987 | 146 | 0.532801 | 17,868 | 0.702745 | 0 | 0 | 0 | 0 | 0 | 0 | 3,404 | 0.133879 |
163549f9139dc6999e9e0ca088584cc51b142caa | 12,432 | py | Python | tests/test_selections.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | tests/test_selections.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | tests/test_selections.py | swimmio/sqlalchemy_swimm | d24accb7792743cf586bd7062531d108e7063eba | [
"MIT"
] | null | null | null | import typing
import pytest
from src import selections
@pytest.mark.parametrize(
'min_time, min_bytes, expected_result',
[
(
10 * 60 * 1000,
500 * 1024 * 1024,
[
(2820,),
(2827,),
(2832,),
(2834,),
... | 24.617822 | 91 | 0.178571 | 0 | 0 | 0 | 0 | 12,373 | 0.995254 | 0 | 0 | 38 | 0.003057 |
1635645909c86684dc1d01665725f73b3baa25cb | 348 | py | Python | tests/utils/test_clean_accounting_column.py | richardqiu/pyjanitor | aa3150e7b8e2adc4733ea206ea9c3093e21d4025 | [
"MIT"
] | 2 | 2020-09-06T22:11:01.000Z | 2022-03-19T23:57:24.000Z | tests/utils/test_clean_accounting_column.py | richardqiu/pyjanitor | aa3150e7b8e2adc4733ea206ea9c3093e21d4025 | [
"MIT"
] | 1 | 2021-05-17T15:30:04.000Z | 2021-07-29T09:39:56.000Z | tests/utils/test_clean_accounting_column.py | richardqiu/pyjanitor | aa3150e7b8e2adc4733ea206ea9c3093e21d4025 | [
"MIT"
] | 1 | 2020-08-10T20:30:20.000Z | 2020-08-10T20:30:20.000Z | import pytest
from janitor.utils import _clean_accounting_column
@pytest.mark.utils
def test_clean_accounting_column():
test_str = "(1,000)"
assert _clean_accounting_column(test_str) == float(-1000)
@pytest.mark.utils
def test_clean_accounting_column_zeroes():
test_str = "()"
assert _clean_accounti... | 21.75 | 61 | 0.761494 | 0 | 0 | 0 | 0 | 276 | 0.793103 | 0 | 0 | 13 | 0.037356 |
16369f4689956af64363c246df723fffbf5f3a5e | 7,164 | py | Python | downloadParagraph.py | icadot86/bert | 42070209183dab3b5ff59b0dea1398a9538960f3 | [
"Apache-2.0"
] | null | null | null | downloadParagraph.py | icadot86/bert | 42070209183dab3b5ff59b0dea1398a9538960f3 | [
"Apache-2.0"
] | null | null | null | downloadParagraph.py | icadot86/bert | 42070209183dab3b5ff59b0dea1398a9538960f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import sys, getopt
import urllib
import requests
import requests_cache
import re
import time
from bs4 import BeautifulSoup
from requests import Session
sys.path.append("/home/taejoon1kim/BERT/my_bert")
from utils.cacheUtils import cacheExist, writeCache, readCache, getDownloadCachePath
from utils.path... | 35.82 | 458 | 0.564768 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,586 | 0.352412 |
1637357f64028a6c4c7d59c4294f21b8d56010e2 | 2,861 | py | Python | data_io.py | LucasChenLC/courseManager2 | 3f91ea72dbc0a3f3afcc88c7f0959edb6c33adf9 | [
"MIT"
] | null | null | null | data_io.py | LucasChenLC/courseManager2 | 3f91ea72dbc0a3f3afcc88c7f0959edb6c33adf9 | [
"MIT"
] | null | null | null | data_io.py | LucasChenLC/courseManager2 | 3f91ea72dbc0a3f3afcc88c7f0959edb6c33adf9 | [
"MIT"
] | null | null | null | from xml.dom.minidom import Document, parse
class InfoBatch:
def __init__(self, title, pre_node_titles):
self.title = title
self.pre_node_titles = pre_node_titles
def save_data_xml(course_list, file_path):
doc = Document()
courses = doc.createElement('course_list')
doc.appendChild(co... | 37.644737 | 124 | 0.71828 | 138 | 0.048235 | 0 | 0 | 0 | 0 | 0 | 0 | 1,106 | 0.386578 |
163841fc5da39772ff971e9eff1ba89827ff6817 | 1,003 | py | Python | tests/rules/test_git_rm_local_modifications.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | tests/rules/test_git_rm_local_modifications.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | tests/rules/test_git_rm_local_modifications.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | import pytest
from theheck.rules.git_rm_local_modifications import match, get_new_command
from theheck.types import Command
@pytest.fixture
def output(target):
return ('error: the following file has local modifications:\n {}\n(use '
'--cached to keep the file, or -f to force removal)').format(targe... | 34.586207 | 81 | 0.67996 | 0 | 0 | 0 | 0 | 867 | 0.864407 | 0 | 0 | 366 | 0.364905 |
16384fd421a05dbe791af899ad03aaf8e20b6076 | 6,078 | py | Python | application.py | statisticsnorway/microdata-data-service | d477b7b75589d4c977771122558c948c040a1106 | [
"Apache-2.0"
] | null | null | null | application.py | statisticsnorway/microdata-data-service | d477b7b75589d4c977771122558c948c040a1106 | [
"Apache-2.0"
] | 7 | 2021-10-08T13:40:33.000Z | 2022-02-04T10:37:55.000Z | application.py | statisticsnorway/microdata-data-service | d477b7b75589d4c977771122558c948c040a1106 | [
"Apache-2.0"
] | null | null | null | import logging
import json_logging
import tomlkit
import uvicorn
from fastapi import FastAPI, status
from fastapi.encoders import jsonable_encoder
from fastapi.openapi.docs import (
get_redoc_html,
get_swagger_ui_html,
get_swagger_ui_oauth2_redirect_html,
)
from fastapi.responses import JSONResponse
from f... | 33.766667 | 109 | 0.74054 | 2,552 | 0.419875 | 0 | 0 | 2,109 | 0.346989 | 1,288 | 0.211912 | 1,097 | 0.180487 |
16386e8f49ac83e2f9c436adbc056266858401ad | 18,764 | py | Python | graspologic/embed/n2v.py | dtborders/graspologic | 8ea9a47cabe35ad28ec9d381e525358c2027f619 | [
"MIT"
] | null | null | null | graspologic/embed/n2v.py | dtborders/graspologic | 8ea9a47cabe35ad28ec9d381e525358c2027f619 | [
"MIT"
] | null | null | null | graspologic/embed/n2v.py | dtborders/graspologic | 8ea9a47cabe35ad28ec9d381e525358c2027f619 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import logging
import math
import time
from typing import Any, List, Optional, Tuple, Union
import networkx as nx
import numpy as np
from ..utils import remap_node_ids
def node2vec_embed(
graph: Union[nx.Graph, nx.DiGraph... | 35.537879 | 127 | 0.627052 | 9,288 | 0.49499 | 0 | 0 | 1,319 | 0.070294 | 0 | 0 | 7,280 | 0.387977 |
1638d587cabcf4138e331d614308389b13e85fb7 | 8,421 | py | Python | bot.py | NotBlizzard/blizzybot | 41a6f07e4d3bb97772b07aa9d6a3af935b78fb9a | [
"MIT"
] | null | null | null | bot.py | NotBlizzard/blizzybot | 41a6f07e4d3bb97772b07aa9d6a3af935b78fb9a | [
"MIT"
] | null | null | null | bot.py | NotBlizzard/blizzybot | 41a6f07e4d3bb97772b07aa9d6a3af935b78fb9a | [
"MIT"
] | null | null | null | # bot.py
# TODO:
# organize imports
# organize
from websocket import create_connection
from threading import Thread
from battle import Battle
import commands
import traceback
import requests
import inspect
import json
from fractions import Fraction
import random
import time
import sys
import re
imp... | 36.141631 | 131 | 0.517278 | 8,064 | 0.957606 | 0 | 0 | 0 | 0 | 0 | 0 | 927 | 0.110082 |
16391df203c1efac2e1f8b82d3e69209d5e07f18 | 10,758 | py | Python | stRT/tdr/widgets/changes.py | Yao-14/stAnalysis | d08483ce581f5b03cfcad8be500aaa64b0293f74 | [
"BSD-3-Clause"
] | null | null | null | stRT/tdr/widgets/changes.py | Yao-14/stAnalysis | d08483ce581f5b03cfcad8be500aaa64b0293f74 | [
"BSD-3-Clause"
] | null | null | null | stRT/tdr/widgets/changes.py | Yao-14/stAnalysis | d08483ce581f5b03cfcad8be500aaa64b0293f74 | [
"BSD-3-Clause"
] | null | null | null | from typing import Optional, Tuple, Union
import numpy as np
import pandas as pd
import pyvista as pv
from pyvista import DataSet, MultiBlock, PolyData, UnstructuredGrid
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
from .ddrtree import DDRTree, cal_ncenter
from .s... | 31.734513 | 125 | 0.635899 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,133 | 0.384179 |
16394617ff3197501b57f08cd314d25d52093a16 | 842 | py | Python | test/test_add_group.py | nkoshkina/Python_Training3 | e917440d37883dbcaa527a0700bcfa1478a1c1ce | [
"Apache-2.0"
] | null | null | null | test/test_add_group.py | nkoshkina/Python_Training3 | e917440d37883dbcaa527a0700bcfa1478a1c1ce | [
"Apache-2.0"
] | null | null | null | test/test_add_group.py | nkoshkina/Python_Training3 | e917440d37883dbcaa527a0700bcfa1478a1c1ce | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.group import Group
import pytest
import allure_pytest
def test_add_group(app, db, check_ui, json_groups):
group0 = json_groups
#with pytest.allure.step("Given a group list"):
old_groups = db.get_group_list()
#with pytest.allure.step("When I add a group %s to the list"... | 36.608696 | 93 | 0.693587 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 287 | 0.340855 |
163995382115c67384ddb8a508342f8bf7650216 | 1,164 | py | Python | cyberbrain/frame_tree.py | testinggg-art/Cyberbrain | e38c74c174e23aa386d005b03f09b30aa1b3a0ae | [
"MIT"
] | null | null | null | cyberbrain/frame_tree.py | testinggg-art/Cyberbrain | e38c74c174e23aa386d005b03f09b30aa1b3a0ae | [
"MIT"
] | null | null | null | cyberbrain/frame_tree.py | testinggg-art/Cyberbrain | e38c74c174e23aa386d005b03f09b30aa1b3a0ae | [
"MIT"
] | null | null | null | from __future__ import annotations
from .frame import Frame
from .generated.communication_pb2 import CursorPosition
class FrameTree:
"""A tree to store all frames. For now it's a fake implementation.
Each node in the tree represents a frame that ever exists during program execution.
Caller and callee fr... | 28.390244 | 87 | 0.670103 | 1,044 | 0.896907 | 0 | 0 | 510 | 0.438144 | 0 | 0 | 553 | 0.475086 |
163c66ec8f6a6a9ebf21f694414728829c5d030d | 7,851 | py | Python | src/otp_yubikey/models.py | moggers87/django-otp-yubikey | 2d7cf9dc91ba57b65aa62254532997cc1e6261dd | [
"BSD-2-Clause"
] | null | null | null | src/otp_yubikey/models.py | moggers87/django-otp-yubikey | 2d7cf9dc91ba57b65aa62254532997cc1e6261dd | [
"BSD-2-Clause"
] | null | null | null | src/otp_yubikey/models.py | moggers87/django-otp-yubikey | 2d7cf9dc91ba57b65aa62254532997cc1e6261dd | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
from base64 import b64decode
from binascii import hexlify, unhexlify
from struct import pack
import six
from django.db import models
from django.utils.encoding import force_text
from django_otp.models import Device
from django_otp.ut... | 27.644366 | 139 | 0.640683 | 7,107 | 0.905235 | 0 | 0 | 76 | 0.00968 | 0 | 0 | 3,415 | 0.434976 |
163cbfb7a11f70465bec9d58e23cdc35d6fe4e2c | 5,976 | py | Python | v1/hsvfilter.py | gavinIRL/RHBot | 1e22ae5ca7b67ebd6a72c23d9f46d5a8eb6e99cf | [
"MIT"
] | null | null | null | v1/hsvfilter.py | gavinIRL/RHBot | 1e22ae5ca7b67ebd6a72c23d9f46d5a8eb6e99cf | [
"MIT"
] | 60 | 2021-03-29T14:29:49.000Z | 2021-05-03T06:06:19.000Z | v1/hsvfilter.py | gavinIRL/RHBot | 1e22ae5ca7b67ebd6a72c23d9f46d5a8eb6e99cf | [
"MIT"
] | null | null | null | import typing
# custom data structure to hold the state of an HSV filter
class HsvFilter:
def __init__(self, hMin=None, sMin=None, vMin=None, hMax=None, sMax=None, vMax=None,
sAdd=None, sSub=None, vAdd=None, vSub=None):
self.hMin = hMin
self.sMin = sMin
self.vMin = vMin
... | 49.38843 | 97 | 0.593373 | 417 | 0.069779 | 0 | 0 | 0 | 0 | 0 | 0 | 1,280 | 0.21419 |
163d64f557e7427d0b9ba345ed63cc3b52a618e5 | 14,278 | py | Python | glue/core/tests/test_state_objects.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | null | null | null | glue/core/tests/test_state_objects.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | null | null | null | glue/core/tests/test_state_objects.py | HPLegion/glue | 1843787ccb4de852dfe103ff58473da13faccf5f | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from numpy.testing import assert_allclose
from echo import CallbackProperty, ListCallbackProperty
from glue.core import Data, DataCollection
from .test_state import clone
from ..state_objects import (State, StateAttributeLimitsHelper,
StateAttributeSingleValueHelper,
... | 27.832359 | 96 | 0.588178 | 8,617 | 0.603516 | 0 | 0 | 0 | 0 | 0 | 0 | 1,486 | 0.104076 |
163d903313e3ca0e241b2c27dfd7fddcb15bbfdb | 287 | py | Python | ecommerce_api/core/cart/exceptions.py | victormartinez/ecommerceapi | a887d9e938050c15ebf52001f63d7aa7f33fa5ee | [
"MIT"
] | null | null | null | ecommerce_api/core/cart/exceptions.py | victormartinez/ecommerceapi | a887d9e938050c15ebf52001f63d7aa7f33fa5ee | [
"MIT"
] | null | null | null | ecommerce_api/core/cart/exceptions.py | victormartinez/ecommerceapi | a887d9e938050c15ebf52001f63d7aa7f33fa5ee | [
"MIT"
] | null | null | null | from typing import Iterable, Optional
class ProductsNotFound(Exception):
def __init__(self, product_ids: Optional[Iterable[int]] = None):
self.product_ids = product_ids or []
self.message = "One or more products are invalid."
super().__init__(self.message)
| 31.888889 | 68 | 0.700348 | 246 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0.121951 |
163dc7048c89ab3ce7a0707b33435bed5fbe6660 | 6,742 | py | Python | test/unit/test_record.py | jsoref/neo4j-python-driver | 32c130c9a975dbf8c0d345b362d096b5e1dd3e5b | [
"Apache-2.0"
] | null | null | null | test/unit/test_record.py | jsoref/neo4j-python-driver | 32c130c9a975dbf8c0d345b362d096b5e1dd3e5b | [
"Apache-2.0"
] | null | null | null | test/unit/test_record.py | jsoref/neo4j-python-driver | 32c130c9a975dbf8c0d345b362d096b5e1dd3e5b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Copyright (c) 2002-2018 "Neo Technology,"
# Network Engine for Objects in Lund AB [http://neotechnology.com]
#
# This file is part of Neo4j.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | 43.496774 | 116 | 0.590923 | 5,940 | 0.881044 | 0 | 0 | 0 | 0 | 0 | 0 | 2,127 | 0.315485 |
163ee50e70aae9c38787e48d9c60c83c946fac91 | 9,923 | py | Python | tests/integration_tests/test_dashboards.py | hugocool/explainerdashboard | e725528c3d94a1a45b51bd9632686d0697274f54 | [
"MIT"
] | 1 | 2021-11-19T09:30:56.000Z | 2021-11-19T09:30:56.000Z | tests/integration_tests/test_dashboards.py | hugocool/explainerdashboard | e725528c3d94a1a45b51bd9632686d0697274f54 | [
"MIT"
] | null | null | null | tests/integration_tests/test_dashboards.py | hugocool/explainerdashboard | e725528c3d94a1a45b51bd9632686d0697274f54 | [
"MIT"
] | null | null | null |
import dash
from catboost import CatBoostClassifier, CatBoostRegressor
from xgboost import XGBClassifier, XGBRegressor
from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from explainerdashboard.explainers import ClassifierExplainer, RegressionExplainer
from explainerdashboard.datasets import... | 44.698198 | 102 | 0.665121 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,332 | 0.134234 |
163f5e0eb3de89d92ad7d61128630ed72fcd3690 | 1,079 | py | Python | code/scripts/GeneratePNG_Preview_AsIs.py | dgrechka/bengaliai-cv19 | 9ef15c5b140628337ae6efe0d76e7ec5d291dc17 | [
"MIT"
] | null | null | null | code/scripts/GeneratePNG_Preview_AsIs.py | dgrechka/bengaliai-cv19 | 9ef15c5b140628337ae6efe0d76e7ec5d291dc17 | [
"MIT"
] | null | null | null | code/scripts/GeneratePNG_Preview_AsIs.py | dgrechka/bengaliai-cv19 | 9ef15c5b140628337ae6efe0d76e7ec5d291dc17 | [
"MIT"
] | null | null | null | import tensorflow as tf
import sys
import os
from glob import glob
import png
sys.path.append(os.path.join(__file__,'..','..'))
from tfDataIngest import tfDataSetParquet as tfDsParquet
inputDataDir = sys.argv[1]
outputDir = sys.argv[2]
# test app
if __name__ == "__main__":
files = glob(os.path.join(inputDataDir... | 29.972222 | 85 | 0.636701 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 335 | 0.310473 |
1640d2033b3fc61dda0183c87b5baa9f8cbed3bd | 2,763 | py | Python | widgets/datepicker_ctrl/codegen.py | RSabet/wxGlade | 8b62eb8397308e60977857455b2765727b1b940f | [
"MIT"
] | 225 | 2018-03-26T11:23:22.000Z | 2022-03-24T09:44:08.000Z | widgets/datepicker_ctrl/codegen.py | RSabet/wxGlade | 8b62eb8397308e60977857455b2765727b1b940f | [
"MIT"
] | 403 | 2018-01-03T19:47:28.000Z | 2018-03-23T17:43:39.000Z | widgets/datepicker_ctrl/codegen.py | DietmarSchwertberger/wxGlade | 8e78cdc509d458cc896d47315e19f3daa6c09213 | [
"MIT"
] | 47 | 2018-04-08T16:48:38.000Z | 2021-12-21T20:08:44.000Z | """\
Code generator functions for wxDatePickerCtrl objects
@copyright: 2002-2007 Alberto Griggio
@copyright: 2014-2016 Carsten Grohmann
@copyright: 2016-2021 Dietmar Schwertberger
@license: MIT (see LICENSE.txt) - THIS PROGRAM COMES WITH NO WARRANTY
"""
import common, compat
import wcodegen
class PythonDatePickerCt... | 33.695122 | 106 | 0.615635 | 2,035 | 0.736518 | 0 | 0 | 0 | 0 | 0 | 0 | 784 | 0.28375 |
1642121cd961a12c79b579c9fabd08e8a6ce9bc8 | 3,960 | py | Python | train.py | lck1201/simple-effective-3Dpose-baseline | 790a185b44e48a9cc619f52b6615aae729bff76b | [
"MIT"
] | 20 | 2019-03-29T12:20:10.000Z | 2021-02-07T08:32:18.000Z | train.py | motokimura/simple-effective-3Dpose-baseline | 790a185b44e48a9cc619f52b6615aae729bff76b | [
"MIT"
] | 10 | 2019-04-03T15:25:00.000Z | 2021-03-26T16:23:33.000Z | train.py | motokimura/simple-effective-3Dpose-baseline | 790a185b44e48a9cc619f52b6615aae729bff76b | [
"MIT"
] | 7 | 2019-06-02T13:25:27.000Z | 2020-12-17T06:07:17.000Z | import pprint
import mxnet as mx
from mxnet import gluon
from mxnet import init
from lib.core.get_optimizer import *
from lib.core.metric import MPJPEMetric
from lib.core.loss import MeanSquareLoss
from lib.core.loader import JointsDataIter
from lib.network import get_net
from lib.net_module import *
from lib.utils i... | 41.684211 | 124 | 0.646212 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 370 | 0.093434 |
1643d3915575e537c0423b05a3b3b1e3b7eb7865 | 6,789 | py | Python | FastLinear/generate_memory_bank.py | WangFeng18/dino | 1a4e49bd0e99d7e205338b14994a1d57c3084cfe | [
"Apache-2.0"
] | null | null | null | FastLinear/generate_memory_bank.py | WangFeng18/dino | 1a4e49bd0e99d7e205338b14994a1d57c3084cfe | [
"Apache-2.0"
] | null | null | null | FastLinear/generate_memory_bank.py | WangFeng18/dino | 1a4e49bd0e99d7e205338b14994a1d57c3084cfe | [
"Apache-2.0"
] | null | null | null | import os
from tqdm import tqdm
import torch.backends.cudnn as cudnn
import torch
from datasets import ImageNetInstance, ImageNetInstanceLMDB
from torchvision import transforms
import argparse
from BaseTaskModel.task_network import get_moco_network, get_swav_network, get_selfboost_network, get_minmaxent_network, get_si... | 44.664474 | 174 | 0.705259 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 913 | 0.134482 |
16447f2400735bc0538f6c77d41578715bdd08b9 | 2,489 | py | Python | tests/utils/test_mercator.py | anuragtr/fabric8-analytics-rudra | 13fb15539d195fcb89ced02b205d034ec0c18e00 | [
"Apache-2.0"
] | 1 | 2019-05-13T09:31:19.000Z | 2019-05-13T09:31:19.000Z | tests/utils/test_mercator.py | anuragtr/fabric8-analytics-rudra | 13fb15539d195fcb89ced02b205d034ec0c18e00 | [
"Apache-2.0"
] | null | null | null | tests/utils/test_mercator.py | anuragtr/fabric8-analytics-rudra | 13fb15539d195fcb89ced02b205d034ec0c18e00 | [
"Apache-2.0"
] | null | null | null | import pytest
from rudra.utils.mercator import SimpleMercator
class TestSimpleMercator:
pom_xml_content = """
<project>
<dependencies>
<dependency>
<groupId>grp1.id</groupId>
<artifactId>art1.id</artifactId>
</dependency... | 34.09589 | 82 | 0.526718 | 2,423 | 0.973483 | 0 | 0 | 0 | 0 | 0 | 0 | 1,350 | 0.542387 |
16449c2c8a80a3f0f14b7a2a74915dc78441651d | 139 | py | Python | tests/checks/run_performance_tests.py | stjordanis/mljar-supervised | 8c3f9d1ed527dfcfdaef91cf82e2779c5832e294 | [
"MIT"
] | 1,882 | 2018-11-05T13:20:54.000Z | 2022-03-31T14:31:46.000Z | tests/checks/run_performance_tests.py | stjordanis/mljar-supervised | 8c3f9d1ed527dfcfdaef91cf82e2779c5832e294 | [
"MIT"
] | 499 | 2019-03-14T09:57:51.000Z | 2022-03-30T06:00:43.000Z | tests/checks/run_performance_tests.py | stjordanis/mljar-supervised | 8c3f9d1ed527dfcfdaef91cf82e2779c5832e294 | [
"MIT"
] | 277 | 2019-02-08T21:32:13.000Z | 2022-03-29T03:26:05.000Z | import os
import sys
import unittest
from tests.tests_bin_class.test_performance import *
if __name__ == "__main__":
unittest.main()
| 15.444444 | 52 | 0.769784 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.071942 |
1645daef0bb42b38a2691d6bb4f86fefa0af94a5 | 283 | py | Python | task/CheckAllocations.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | 1 | 2019-07-17T19:01:34.000Z | 2019-07-17T19:01:34.000Z | task/CheckAllocations.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | null | null | null | task/CheckAllocations.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from vc3master.task import VC3Task
class CheckAllocations(VC3Task):
'''
Plugin to do consistency/sanity checks on Allocations.
'''
def runtask(self):
'''
'''
self.log.info("Running task %s" % self.section) | 16.647059 | 58 | 0.590106 | 221 | 0.780919 | 0 | 0 | 0 | 0 | 0 | 0 | 129 | 0.45583 |
16477f8a306c6c85422ce092acee78844c0cd611 | 4,037 | py | Python | django_airbrake/utils/client.py | Captricity/airbrake-django | 2ea126653883732a13f1a80c9e567b7076601620 | [
"BSD-3-Clause"
] | null | null | null | django_airbrake/utils/client.py | Captricity/airbrake-django | 2ea126653883732a13f1a80c9e567b7076601620 | [
"BSD-3-Clause"
] | 2 | 2016-07-12T15:44:02.000Z | 2016-08-19T20:31:49.000Z | django_airbrake/utils/client.py | Captricity/airbrake-django | 2ea126653883732a13f1a80c9e567b7076601620 | [
"BSD-3-Clause"
] | null | null | null | import sys
import traceback
from django.conf import settings
from django.urls import resolve
from lxml import etree
from six.moves.urllib.request import urlopen, Request
class Client(object):
API_URL = '%s://airbrake.io/notifier_api/v2/notices'
ERRORS = {
403: "Cannot use SSL",
422: "Invalid X... | 34.211864 | 107 | 0.566757 | 3,864 | 0.957146 | 0 | 0 | 407 | 0.100817 | 0 | 0 | 577 | 0.142928 |
1648b2044844b3d9b645771b179a716a797264e9 | 599 | py | Python | src/spaceone/inventory/connector/snapshot.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 1 | 2020-12-08T11:59:54.000Z | 2020-12-08T11:59:54.000Z | src/spaceone/inventory/connector/snapshot.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 4 | 2021-01-26T10:43:37.000Z | 2021-12-17T10:13:33.000Z | src/spaceone/inventory/connector/snapshot.py | jean1042/plugin-azure-cloud-services | 3a75a516c9a4d1e8a4962988934ead3fd40e8494 | [
"Apache-2.0"
] | 2 | 2021-01-13T03:24:05.000Z | 2021-01-19T07:25:45.000Z | import logging
from spaceone.inventory.libs.connector import AzureConnector
from spaceone.inventory.error import *
from spaceone.inventory.error.custom import *
__all__ = ['SnapshotConnector']
_LOGGER = logging.getLogger(__name__)
class SnapshotConnector(AzureConnector):
def __init__(self, **kwargs):
su... | 28.52381 | 69 | 0.721202 | 364 | 0.607679 | 0 | 0 | 0 | 0 | 0 | 0 | 51 | 0.085142 |
1649638736a414c6fde2874636d2e6f9fe9164e4 | 2,912 | py | Python | docs/tutorial/context/app.py | theasylum/wired | 6b6a3e83702b18ebb41ca1f94e957bdf7e44986d | [
"MIT"
] | 12 | 2018-07-22T15:40:35.000Z | 2020-12-27T21:39:18.000Z | docs/tutorial/context/app.py | theasylum/wired | 6b6a3e83702b18ebb41ca1f94e957bdf7e44986d | [
"MIT"
] | 36 | 2019-03-23T13:47:25.000Z | 2020-11-28T18:08:14.000Z | docs/tutorial/context/app.py | theasylum/wired | 6b6a3e83702b18ebb41ca1f94e957bdf7e44986d | [
"MIT"
] | 6 | 2019-03-23T20:08:57.000Z | 2021-06-03T16:52:06.000Z | """
A customer walks into a store. Do the steps to interact with them:
- Get *a* (not *the*) greeter
- Interact with them
Simple wired application:
- Settings that say what punctuation to use
- Registry
- Two factories that says hello, one for the FrenchCustomer context
- A default Customer and FrenchCustomer
... | 25.54386 | 74 | 0.712569 | 469 | 0.161058 | 0 | 0 | 524 | 0.179945 | 0 | 0 | 1,290 | 0.442995 |
1649bff1d5c282f752cad12fddde82da77d3b6ea | 3,133 | py | Python | feast/DetectionModules/ldar_program.py | GeoSensorWebLab/FEAST_PtE | 63ff8b7925873d756666f3c0c4b9f0f84abd5eb2 | [
"MIT"
] | 10 | 2020-03-26T20:12:19.000Z | 2022-02-14T22:47:01.000Z | feast/DetectionModules/ldar_program.py | GeoSensorWebLab/FEAST_PtE | 63ff8b7925873d756666f3c0c4b9f0f84abd5eb2 | [
"MIT"
] | 1 | 2021-07-14T21:14:12.000Z | 2021-07-14T21:14:12.000Z | feast/DetectionModules/ldar_program.py | GeoSensorWebLab/FEAST_PtE | 63ff8b7925873d756666f3c0c4b9f0f84abd5eb2 | [
"MIT"
] | 9 | 2020-03-27T22:57:31.000Z | 2021-09-29T17:29:35.000Z | """
This module defines the LDARProgram class.
"""
import numpy as np
import copy
from .repair import Repair
from ..EmissionSimModules.result_classes import ResultDiscrete, ResultContinuous
class LDARProgram:
"""
An LDAR program contains one or more detection methods and one or more repair methods. Each LDAR... | 48.2 | 120 | 0.679221 | 2,939 | 0.938079 | 0 | 0 | 0 | 0 | 0 | 0 | 1,507 | 0.481009 |
164cf23737de25e42e24acaa15cc12f759dc3323 | 12,783 | py | Python | src/CycleGAN.py | sjmoran/SIDGAN | 169bd69974bbb7f5760c28a00c231a856017e51c | [
"0BSD"
] | 25 | 2020-09-17T06:29:41.000Z | 2022-03-22T06:38:37.000Z | src/CycleGAN.py | sjmoran/SIDGAN | 169bd69974bbb7f5760c28a00c231a856017e51c | [
"0BSD"
] | 2 | 2021-05-30T09:00:46.000Z | 2021-11-24T08:34:26.000Z | src/CycleGAN.py | sjmoran/SIDGAN | 169bd69974bbb7f5760c28a00c231a856017e51c | [
"0BSD"
] | 5 | 2020-10-16T00:44:10.000Z | 2021-11-04T15:59:55.000Z | #Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#This program is free software; you can redistribute it and/or modify it under the terms of the BSD 0-Clause License.
#This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ... | 46.824176 | 181 | 0.586013 | 12,125 | 0.948525 | 0 | 0 | 0 | 0 | 0 | 0 | 2,422 | 0.18947 |
164e763a74e067d7e8c03c1d5ec3635ec5b33a02 | 876 | py | Python | application/fastapi/main.py | edson-dev/neoway | f792e16c0f627e8b94b54f001e87e076f36311ab | [
"MIT"
] | null | null | null | application/fastapi/main.py | edson-dev/neoway | f792e16c0f627e8b94b54f001e87e076f36311ab | [
"MIT"
] | null | null | null | application/fastapi/main.py | edson-dev/neoway | f792e16c0f627e8b94b54f001e87e076f36311ab | [
"MIT"
] | null | null | null | import uvicorn
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from routes import doc, api
from fastapi.templating import Jinja2Templates
from starlette.requests import Request
# configure static and templates file on jinja 2
app = FastAPI(
title=f"Technical Case",
description=f"endpoi... | 28.258065 | 90 | 0.745434 | 0 | 0 | 0 | 0 | 138 | 0.157534 | 108 | 0.123288 | 300 | 0.342466 |
164f24393208739c6bb0a99eb1b2e8ed9fcd90d3 | 58,056 | py | Python | civis/io/_tables.py | jsfalk/civis-python | 39b6498b2d67d838d720d9631d74f3d3d43f7c1a | [
"BSD-3-Clause"
] | null | null | null | civis/io/_tables.py | jsfalk/civis-python | 39b6498b2d67d838d720d9631d74f3d3d43f7c1a | [
"BSD-3-Clause"
] | null | null | null | civis/io/_tables.py | jsfalk/civis-python | 39b6498b2d67d838d720d9631d74f3d3d43f7c1a | [
"BSD-3-Clause"
] | null | null | null | import json
import concurrent.futures
import csv
from os import path
import io
import logging
import os
import shutil
from tempfile import TemporaryDirectory
import warnings
import zlib
import gzip
import zipfile
from civis import APIClient
from civis._utils import maybe_get_random_name
from civis.base import EmptyRe... | 40.798313 | 79 | 0.617111 | 0 | 0 | 0 | 0 | 41,016 | 0.70649 | 0 | 0 | 34,394 | 0.592428 |
164f6ae0c583900eea5f44762f6006a785208240 | 2,218 | py | Python | tests/unit/small_text/integrations/pytorch/test_strategies.py | chschroeder/small-text | ef28e91ba0c94fe938dde4f16253aa8695ea13b7 | [
"MIT"
] | 218 | 2021-05-26T16:38:53.000Z | 2022-03-30T09:48:54.000Z | tests/unit/small_text/integrations/pytorch/test_strategies.py | chschroeder/small-text | ef28e91ba0c94fe938dde4f16253aa8695ea13b7 | [
"MIT"
] | 9 | 2021-10-16T23:23:02.000Z | 2022-02-22T15:23:11.000Z | tests/unit/small_text/integrations/pytorch/test_strategies.py | chschroeder/small-text | ef28e91ba0c94fe938dde4f16253aa8695ea13b7 | [
"MIT"
] | 21 | 2021-06-24T11:19:44.000Z | 2022-03-12T16:29:53.000Z | import unittest
import pytest
from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
try:
from small_text.integrations.pytorch.query_strategies import (
BADGE,
ExpectedGradientLength,
ExpectedGradientLengthMaxWord)
except PytorchNotFoundError:
pass
@pytest.mark.... | 30.383562 | 94 | 0.712353 | 1,842 | 0.830478 | 0 | 0 | 1,905 | 0.858882 | 0 | 0 | 124 | 0.055906 |
164ff194ddd6475fcc83a8af8f5b4d32701c55ea | 886 | py | Python | pymterm/colour/tango.py | stonewell/pymterm | af36656d5f7fb008533178d14b00d83d72ba00cf | [
"MIT"
] | 102 | 2016-07-21T06:39:02.000Z | 2022-03-09T19:34:03.000Z | pymterm/colour/tango.py | stonewell/pymterm | af36656d5f7fb008533178d14b00d83d72ba00cf | [
"MIT"
] | 2 | 2017-01-11T13:43:34.000Z | 2020-01-19T12:06:47.000Z | pymterm/colour/tango.py | stonewell/pymterm | af36656d5f7fb008533178d14b00d83d72ba00cf | [
"MIT"
] | 4 | 2020-03-22T04:08:35.000Z | 2021-06-27T23:38:02.000Z | TANGO_PALLETE = [
'2e2e34343636',
'cccc00000000',
'4e4e9a9a0606',
'c4c4a0a00000',
'34346565a4a4',
'757550507b7b',
'060698989a9a',
'd3d3d7d7cfcf',
'555557575353',
'efef29292929',
'8a8ae2e23434',
'fcfce9e94f4f',
'72729f9fcfcf',
'adad7f7fa8a8',
'34... | 24.611111 | 69 | 0.613995 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 252 | 0.284424 |
16506683fe35155169d6fbcd3b4087bff7394386 | 22,681 | py | Python | user_manager/oauth/oauth2.py | voegtlel/auth-manager-backend | 20d40de0abc9deeb3fcddd892ffe2e635301917a | [
"MIT"
] | null | null | null | user_manager/oauth/oauth2.py | voegtlel/auth-manager-backend | 20d40de0abc9deeb3fcddd892ffe2e635301917a | [
"MIT"
] | null | null | null | user_manager/oauth/oauth2.py | voegtlel/auth-manager-backend | 20d40de0abc9deeb3fcddd892ffe2e635301917a | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from enum import Enum
from typing import List, Optional, Tuple, Dict, Any, Union
import time
from authlib.common.security import generate_token
from authlib.consts import default_json_headers
from authlib.oauth2 import (
OAuth2Request,
AuthorizationServer as _Authorizat... | 40.501786 | 121 | 0.680217 | 17,915 | 0.789868 | 0 | 0 | 0 | 0 | 7,103 | 0.31317 | 1,670 | 0.07363 |
16517f3c2ccf47bb7eb0759cee7e8d2e4ec1a86f | 3,553 | py | Python | src/adsb/sbs/server.py | claws/adsb | 4a7d35880dece6baaf24370fab445e2571fc19e9 | [
"MIT"
] | 7 | 2018-07-11T00:50:47.000Z | 2021-09-29T10:36:44.000Z | src/adsb/sbs/server.py | claws/adsb | 4a7d35880dece6baaf24370fab445e2571fc19e9 | [
"MIT"
] | 3 | 2020-06-13T23:27:42.000Z | 2020-07-22T03:06:16.000Z | src/adsb/sbs/server.py | claws/adsb | 4a7d35880dece6baaf24370fab445e2571fc19e9 | [
"MIT"
] | 3 | 2020-01-08T19:05:42.000Z | 2022-02-11T02:22:23.000Z |
import asyncio
import datetime
import logging
import socket
from . import protocol
from typing import Tuple
from asyncio import AbstractEventLoop
logger = logging.getLogger(__name__)
class Server(object):
def __init__(
self,
host: str = "localhost",
port: int = 30003,
backlog... | 32.59633 | 77 | 0.565156 | 3,362 | 0.946243 | 0 | 0 | 0 | 0 | 1,285 | 0.361666 | 1,253 | 0.35266 |
1652c769892c847b99d4a49f23694f814ea670c4 | 2,803 | py | Python | src/robusta/core/model/events.py | kandahk/robusta | 61a2001cb1c4e90e8a74b810463ec99e6cb80787 | [
"MIT"
] | null | null | null | src/robusta/core/model/events.py | kandahk/robusta | 61a2001cb1c4e90e8a74b810463ec99e6cb80787 | [
"MIT"
] | null | null | null | src/robusta/core/model/events.py | kandahk/robusta | 61a2001cb1c4e90e8a74b810463ec99e6cb80787 | [
"MIT"
] | null | null | null | import logging
import uuid
from enum import Enum
from typing import List, Optional, Dict, Any
from dataclasses import dataclass, field
from pydantic import BaseModel
from ...integrations.scheduled.playbook_scheduler import PlaybooksScheduler
from ..reporting.base import Finding, BaseBlock
class EventType(Enum):
... | 35.481013 | 135 | 0.708883 | 2,048 | 0.730646 | 0 | 0 | 1,848 | 0.659294 | 0 | 0 | 811 | 0.289333 |
1653cd2fffd32e2ad6ea59e14f67f33d48afc170 | 560 | py | Python | examples/django_mongoengine/bike/models.py | pfrantz/graphene-mongo | f7d4f3e194ec41793e6da547934c34e11fd9ef51 | [
"MIT"
] | 260 | 2018-02-03T01:00:42.000Z | 2022-02-18T12:42:01.000Z | examples/django_mongoengine/bike/models.py | pfrantz/graphene-mongo | f7d4f3e194ec41793e6da547934c34e11fd9ef51 | [
"MIT"
] | 159 | 2018-02-09T07:35:03.000Z | 2022-03-20T03:43:23.000Z | examples/django_mongoengine/bike/models.py | pfrantz/graphene-mongo | f7d4f3e194ec41793e6da547934c34e11fd9ef51 | [
"MIT"
] | 124 | 2018-02-04T20:19:01.000Z | 2022-03-25T21:40:41.000Z | from mongoengine import Document
from mongoengine.fields import (
FloatField,
StringField,
ListField,
URLField,
ObjectIdField,
)
class Shop(Document):
meta = {"collection": "shop"}
ID = ObjectIdField()
name = StringField()
address = StringField()
website = URLField()
class Bi... | 20 | 35 | 0.642857 | 405 | 0.723214 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 0.064286 |
1653e68a3494182dbc33ba8410b68bb9f85c16c2 | 97 | py | Python | src/tensor/tensor/movement/__init__.py | jedhsu/tensor | 3b2fe21029fa7c50b034190e77d79d1a94ea5e8f | [
"Apache-2.0"
] | null | null | null | src/tensor/tensor/movement/__init__.py | jedhsu/tensor | 3b2fe21029fa7c50b034190e77d79d1a94ea5e8f | [
"Apache-2.0"
] | null | null | null | src/tensor/tensor/movement/__init__.py | jedhsu/tensor | 3b2fe21029fa7c50b034190e77d79d1a94ea5e8f | [
"Apache-2.0"
] | null | null | null | from ._movement import Movement
from .path import MovementPath
from .paths import MovementPaths
| 19.4 | 32 | 0.835052 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1654499e8423c0c8a91eb13123406b32dfc847c1 | 8,988 | py | Python | opticalmapping/standalone/om_augmenter.py | sauloal/ipython | 35c24a10330da3e54b5ee29df54ee263f5268d18 | [
"MIT"
] | null | null | null | opticalmapping/standalone/om_augmenter.py | sauloal/ipython | 35c24a10330da3e54b5ee29df54ee263f5268d18 | [
"MIT"
] | null | null | null | opticalmapping/standalone/om_augmenter.py | sauloal/ipython | 35c24a10330da3e54b5ee29df54ee263f5268d18 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import sys
from om_shared import *
def parse_args(args):
parser = argparse.ArgumentParser(description="Bionano Genomics MAP parser")
parser.add_argument( 'infile', help="MAP file" )
parser.add_ar... | 61.561644 | 1,184 | 0.595683 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,517 | 0.502559 |
1654fce2866f6b2ef021c29092efa26419e5ba83 | 4,918 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/impairment/profile/fixedclassifier/fixedclassifier.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | uhd_restpy/testplatform/sessions/ixnetwork/impairment/profile/fixedclassifier/fixedclassifier.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | uhd_restpy/testplatform/sessions/ixnetwork/impairment/profile/fixedclassifier/fixedclassifier.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 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,... | 41.677966 | 187 | 0.700895 | 3,696 | 0.751525 | 0 | 0 | 635 | 0.129118 | 0 | 0 | 3,911 | 0.795242 |