hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | 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 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
34c2cfd6b9e37608df44ff0e6379934f1861f606 | 2,038 | py | Python | date-conversion/models/transformer/attention.py | AndreMaz/dnn-attention | 86e834b90bd419646fd00c6ff4df910ab7874910 | [
"MIT"
] | 1 | 2020-03-11T22:52:19.000Z | 2020-03-11T22:52:19.000Z | date-conversion/models/transformer/attention.py | AndreMaz/dnn-attention | 86e834b90bd419646fd00c6ff4df910ab7874910 | [
"MIT"
] | 3 | 2021-05-21T16:15:18.000Z | 2022-02-10T01:11:23.000Z | sorting-numbers/models/transformer/attention.py | AndreMaz/dnn-attention | 86e834b90bd419646fd00c6ff4df910ab7874910 | [
"MIT"
] | null | null | null | import tensorflow as tf
from models.transformer.utils import scaled_dot_product_attention
class MultiHeadAttention(tf.keras.layers.Layer):
def __init__(self, d_model, num_heads):
super(MultiHeadAttention, self).__init__()
self.num_heads = num_heads
self.d_model = d_model
assert d_model % self.nu... | 41.591837 | 117 | 0.675172 |
4848170d260b8e4b3152cf82c09cbb3563bcd577 | 1,823 | py | Python | examples/example4.py | mainqueg/steeldesign | e1250f93af0b156f5820e83e5925d2d991d43519 | [
"MIT"
] | null | null | null | examples/example4.py | mainqueg/steeldesign | e1250f93af0b156f5820e83e5925d2d991d43519 | [
"MIT"
] | null | null | null | examples/example4.py | mainqueg/steeldesign | e1250f93af0b156f5820e83e5925d2d991d43519 | [
"MIT"
] | null | null | null | '''Example 17.1 I-Section (LRFD).
Lin, Shin-Hua; Yu, Wei-wen; and Galambos, Theodore V., "Illustrative examples based on the ASCE
standard specifcation for the design of cold-formed stainless steel structural members" (1991). Center
for Cold-Formed Steel Structures Library. p221
'''
import steeldesign as sd
# creo... | 38.787234 | 130 | 0.6791 |
2d12b87ed251a452aba94525fea768763ab47bf5 | 17,068 | py | Python | cdsdashboards/hubextension/spawners/variablemixin.py | pierrotsmnrd/cdsdashboards | e1d3ddb1999e7c77d4ef3c659c948e923825d6d2 | [
"BSD-3-Clause"
] | 153 | 2020-04-28T17:46:47.000Z | 2022-03-31T15:19:12.000Z | cdsdashboards/hubextension/spawners/variablemixin.py | pierrotsmnrd/cdsdashboards | e1d3ddb1999e7c77d4ef3c659c948e923825d6d2 | [
"BSD-3-Clause"
] | 94 | 2020-05-26T14:16:14.000Z | 2022-03-24T06:00:05.000Z | cdsdashboards/hubextension/spawners/variablemixin.py | pierrotsmnrd/cdsdashboards | e1d3ddb1999e7c77d4ef3c659c948e923825d6d2 | [
"BSD-3-Clause"
] | 32 | 2020-06-17T09:38:18.000Z | 2022-03-18T12:17:27.000Z | import os.path
import re
from copy import deepcopy
from traitlets import Unicode, Integer, Dict, Bool, validate, default
from traitlets.config import Configurable
from jupyterhub.spawner import _quote_safe
from jupyterhub.traitlets import Command
from ..base import SpawnPermissionsController, CDSConfigStore
def _get... | 43.210127 | 179 | 0.628486 |
abaa9d2669d521f4ec737354d1c2f4c402f41db0 | 843 | py | Python | twitch_project/geo/views.py | tejesh95/livecoding | 327114d67d613ef7300528d62b5165cd215bc1b4 | [
"MIT"
] | null | null | null | twitch_project/geo/views.py | tejesh95/livecoding | 327114d67d613ef7300528d62b5165cd215bc1b4 | [
"MIT"
] | null | null | null | twitch_project/geo/views.py | tejesh95/livecoding | 327114d67d613ef7300528d62b5165cd215bc1b4 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
from .models import Geo
# Create your views here.
# import googlemaps
from geopy.geocoders import Nominatim
@csrf_exempt
def fetch_location(request):
if request.method == 'POST':
i... | 36.652174 | 114 | 0.70344 |
ca2ce18a715b8d605fa375afd51b5f9e4d2b311e | 2,317 | py | Python | anndata/tests/test_get_vector.py | michalk8/anndata | 664e32b0aa6625fe593370d37174384c05abfd4e | [
"BSD-3-Clause"
] | 262 | 2017-11-10T11:43:19.000Z | 2022-03-31T20:24:24.000Z | anndata/tests/test_get_vector.py | michalk8/anndata | 664e32b0aa6625fe593370d37174384c05abfd4e | [
"BSD-3-Clause"
] | 654 | 2017-11-22T13:26:02.000Z | 2022-03-30T04:31:15.000Z | anndata/tests/test_get_vector.py | michalk8/anndata | 664e32b0aa6625fe593370d37174384c05abfd4e | [
"BSD-3-Clause"
] | 137 | 2017-12-28T14:33:11.000Z | 2022-03-24T02:39:53.000Z | import numpy as np
import pandas as pd
from scipy import sparse
import pytest
import anndata as ad
def test_amgibuous_keys():
"""Tests that an error is raised if obs_vector or var_vector is ambiguous."""
var_keys = ["The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"]
obs_keys = [
... | 34.073529 | 86 | 0.594303 |
f31268cdc035fdbef6ff21ed29a8804685b5971a | 345 | py | Python | code/2-example-solution.py | jrperlic/data-structure-tutorial | 5e2376556e2df413517b46895a3657da8b706f1b | [
"MIT"
] | null | null | null | code/2-example-solution.py | jrperlic/data-structure-tutorial | 5e2376556e2df413517b46895a3657da8b706f1b | [
"MIT"
] | null | null | null | code/2-example-solution.py | jrperlic/data-structure-tutorial | 5e2376556e2df413517b46895a3657da8b706f1b | [
"MIT"
] | null | null | null | from collections import deque
def mystery1(ll):
for i in reversed(ll):
print(i, end=" ")
print("")
def mystery2(ll):
for i in range(0, len(ll), 2):
print(ll[i], end=" ")
for i in range(1, len(ll), 2):
print(ll[i], end=" ")
ll = deque([1, 2, 3, 4, 5])
mystery1(ll) # 5 4 3 2 1... | 19.166667 | 34 | 0.527536 |
dc3a6f0af5f60a946b5a9a3c95bbba90bfb0f311 | 80 | py | Python | project/project/settings/prod/settings.py | identitynr8/nlp | 0d8436ebef6692f472f81082265aade9c3052088 | [
"MIT"
] | null | null | null | project/project/settings/prod/settings.py | identitynr8/nlp | 0d8436ebef6692f472f81082265aade9c3052088 | [
"MIT"
] | null | null | null | project/project/settings/prod/settings.py | identitynr8/nlp | 0d8436ebef6692f472f81082265aade9c3052088 | [
"MIT"
] | null | null | null | from .._base import *
DEBUG = False
ALLOWED_HOSTS = [
'.YOURHOST.COM',
]
| 8.888889 | 21 | 0.6125 |
e95af8103f67a07ee4ac370c0c33e1e1a8c93967 | 1,492 | py | Python | tests/sentry/utils/locking/backends/test_redis.py | E-LLP/sentry | 83d97a0ca45cdaac1d5f3026058131a3aeae0068 | [
"BSD-3-Clause"
] | 4 | 2016-03-16T07:21:36.000Z | 2017-09-04T07:29:56.000Z | tests/sentry/utils/locking/backends/test_redis.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/utils/locking/backends/test_redis.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | import pytest
from exam import fixture
from sentry.testutils import TestCase
from sentry.utils.locking.backends.redis import RedisLockBackend
from sentry.utils.redis import clusters
class RedisLockBackendTestCase(TestCase):
@fixture
def cluster(self):
return clusters.get('default')
@fixture
... | 29.254902 | 92 | 0.672252 |
70f7fe2d81a0141c98d5fb2994865d4afd536fd0 | 1,667 | py | Python | tests/post/test_prometheus.py | ssalaues/metalk8s | cca4a4c64fe9cd4d7b87717aa3fda1642144da4b | [
"Apache-2.0"
] | null | null | null | tests/post/test_prometheus.py | ssalaues/metalk8s | cca4a4c64fe9cd4d7b87717aa3fda1642144da4b | [
"Apache-2.0"
] | null | null | null | tests/post/test_prometheus.py | ssalaues/metalk8s | cca4a4c64fe9cd4d7b87717aa3fda1642144da4b | [
"Apache-2.0"
] | null | null | null | import logging
import pytest
import requests
from pytest_bdd import parsers
from pytest_bdd import scenarios
from pytest_bdd import then
from pytest_bdd import when
@pytest.fixture
def pytestbdd_strict_gherkin():
return False
scenarios('features/prometheus.feature')
@when(parsers.parse(
"I list the prom... | 31.45283 | 79 | 0.709058 |
9a31132cdc9874d5ed3d28e05454a7cc043e3a52 | 356 | py | Python | setup.py | cosmic-tichy/geogateway-django-app-develop | c14853e5cbb56edd0643615e522b5476e0afca64 | [
"Apache-2.0"
] | null | null | null | setup.py | cosmic-tichy/geogateway-django-app-develop | c14853e5cbb56edd0643615e522b5476e0afca64 | [
"Apache-2.0"
] | null | null | null | setup.py | cosmic-tichy/geogateway-django-app-develop | c14853e5cbb56edd0643615e522b5476e0afca64 | [
"Apache-2.0"
] | null | null | null | import setuptools
setuptools.setup(
name="geogateway-django-app",
version="0.0.1",
description="GeoGateway Django app",
packages=setuptools.find_packages(),
install_requires=[
'django>=1.11.16'
],
entry_points="""
[airavata.djangoapp]
geogateway_django_app = geogateway_django_app.ap... | 22.25 | 76 | 0.707865 |
6d8f70dae6a60bb7c2a373fd579066d77af1ff0e | 850 | py | Python | angr/procedures/definitions/win32_mapi32.py | r4b3rt/angr | c133cfd4f83ffea2a1d9e064241e9459eaabc55f | [
"BSD-2-Clause"
] | null | null | null | angr/procedures/definitions/win32_mapi32.py | r4b3rt/angr | c133cfd4f83ffea2a1d9e064241e9459eaabc55f | [
"BSD-2-Clause"
] | null | null | null | angr/procedures/definitions/win32_mapi32.py | r4b3rt/angr | c133cfd4f83ffea2a1d9e064241e9459eaabc55f | [
"BSD-2-Clause"
] | null | null | null | # pylint:disable=line-too-long
import logging
from ...sim_type import SimTypeFunction, SimTypeShort, SimTypeInt, SimTypeLong, SimTypeLongLong, SimTypeDouble, SimTypeFloat, SimTypePointer, SimTypeChar, SimStruct, SimTypeFixedSizeArray, SimTypeBottom, SimUnion, SimTypeBool
from ...calling... | 35.416667 | 257 | 0.745882 |
5d13b3177916ec01e1d0752560c1ba0c93b3a8e7 | 4,654 | py | Python | buildpack/stage.py | huibin-coder/cf-mendix-buildpack | 8c376e9852d107ba3773ae88c9cdaee4dd0c2e2f | [
"Apache-2.0"
] | 36 | 2015-01-22T16:28:55.000Z | 2021-12-28T10:26:10.000Z | buildpack/stage.py | huibin-coder/cf-mendix-buildpack | 8c376e9852d107ba3773ae88c9cdaee4dd0c2e2f | [
"Apache-2.0"
] | 208 | 2015-06-01T13:39:17.000Z | 2022-03-24T14:16:09.000Z | buildpack/stage.py | huibin-coder/cf-mendix-buildpack | 8c376e9852d107ba3773ae88c9cdaee4dd0c2e2f | [
"Apache-2.0"
] | 135 | 2015-01-17T14:47:22.000Z | 2022-03-07T08:20:18.000Z | #!/usr/bin/env python3
import logging
import os
import shutil
import sys
from buildpack import (
appdynamics,
dynatrace,
databroker,
datadog,
java,
metering,
mx_java_agent,
mxbuild,
newrelic,
nginx,
runtime,
telegraf,
util,
)
from buildpack.runtime_components import ... | 27.702381 | 164 | 0.643532 |
1639467cb178639c2d99c49777f2c770ef12c01e | 1,723 | py | Python | Chapter18/hw/run.py | haohaoxiao/Deep-Reinforcement-Learning-Hands-On-Second-Edition | 1cbdff216fdc5cec02cc0da8664b788941f025c1 | [
"MIT"
] | 621 | 2019-07-27T19:24:56.000Z | 2022-03-31T14:19:52.000Z | Chapter18/hw/run.py | haohaoxiao/Deep-Reinforcement-Learning-Hands-On-Second-Edition | 1cbdff216fdc5cec02cc0da8664b788941f025c1 | [
"MIT"
] | 40 | 2019-09-01T09:45:22.000Z | 2022-03-24T13:13:00.000Z | Chapter18/hw/run.py | haohaoxiao/Deep-Reinforcement-Learning-Hands-On-Second-Edition | 1cbdff216fdc5cec02cc0da8664b788941f025c1 | [
"MIT"
] | 346 | 2019-07-26T15:16:56.000Z | 2022-03-30T15:33:20.000Z | """
Simple orientation calculation from Accelerometer
"""
import pyb
import utime
from machine import I2C
from libhw.hw_sensors import lis331dlh as lis
from libhw.sensor_buffer import SensorsBuffer
from libhw.postproc import PostPitchRoll
from libhw import servo
SDA = 'X12'
SCL = 'Y11'
PINS = ["B6", "B7", "B10", "B11"... | 26.921875 | 74 | 0.551944 |
886f576a45759632492bab1da51b2e9bc62ae421 | 2,796 | py | Python | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/restore_point_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/restore_point_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/db-up/azext_db_up/vendored_sdks/azure_mgmt_sql/sql/models/restore_point_py3.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.833333 | 106 | 0.626967 |
c9c4785a603223f77ae99b074f9bc0891f470b4d | 5,271 | py | Python | deep_learning/DeepLearningWithPython/chapter6-seq-text-rnn-cnn/6.3-advanced-usage-of-recurrent-neural-networks.py | keepangry/ai_algorithm | 21d8024296a2f2d2797448ed34eb383359259684 | [
"Apache-2.0"
] | 2 | 2018-08-29T11:09:36.000Z | 2018-10-22T11:46:36.000Z | deep_learning/DeepLearningWithPython/chapter6-seq-text-rnn-cnn/6.3-advanced-usage-of-recurrent-neural-networks.py | keepangry/ai_algorithm | 21d8024296a2f2d2797448ed34eb383359259684 | [
"Apache-2.0"
] | null | null | null | deep_learning/DeepLearningWithPython/chapter6-seq-text-rnn-cnn/6.3-advanced-usage-of-recurrent-neural-networks.py | keepangry/ai_algorithm | 21d8024296a2f2d2797448ed34eb383359259684 | [
"Apache-2.0"
] | null | null | null | import os
data_dir = '/home/yangsen/workspace/ai_algorithm/data/'
fname = os.path.join(data_dir, 'jena_climate_2009_2016.csv')
f = open(fname)
data = f.read()
f.close()
lines = data.split('\n')
header = lines[0].split(',')
lines = lines[1:]
print(header)
print(len(lines))
import numpy as np
float_data = np.zeros(... | 29.283333 | 81 | 0.600266 |
15bc5f87e9e8ef5e403c1977b69ea04ee3312910 | 3,253 | py | Python | robosuite/models/arenas/table_cabinet_arena.py | quantumiracle/robolite | b3166a1c51a1118706177f4a4e7401e7c2c6c404 | [
"MIT"
] | null | null | null | robosuite/models/arenas/table_cabinet_arena.py | quantumiracle/robolite | b3166a1c51a1118706177f4a4e7401e7c2c6c404 | [
"MIT"
] | null | null | null | robosuite/models/arenas/table_cabinet_arena.py | quantumiracle/robolite | b3166a1c51a1118706177f4a4e7401e7c2c6c404 | [
"MIT"
] | null | null | null | import numpy as np
from robosuite.models.arenas import Arena
from robosuite.utils.mjcf_utils import xml_path_completion
from robosuite.utils.mjcf_utils import array_to_string, string_to_array
class TableCabinetArena(Arena):
"""Workspace that contains an empty table."""
def __init__(
self, table_full_... | 47.838235 | 197 | 0.673225 |
08d327a3739b669f6660f3b2b81dea3366c9f8e4 | 227 | py | Python | ivf/core/sfs/normal_from_gradient.py | tody411/ImageViewerFramework | 5c183c34e65494b6af1287e70152b995a868c6ac | [
"MIT"
] | null | null | null | ivf/core/sfs/normal_from_gradient.py | tody411/ImageViewerFramework | 5c183c34e65494b6af1287e70152b995a868c6ac | [
"MIT"
] | null | null | null | ivf/core/sfs/normal_from_gradient.py | tody411/ImageViewerFramework | 5c183c34e65494b6af1287e70152b995a868c6ac | [
"MIT"
] | null | null | null |
# -*- coding: utf-8 -*-
## @package ivf.core.sfs.normal_from_gradient
#
# ivf.core.sfs.normal_from_gradient utility package.
# @author tody
# @date 2016/02/08
import numpy as np
import scipy.sparse
import cv2
| 17.461538 | 53 | 0.678414 |
56d5195f1d8562743e9ddcdfd69805a38e2ae4ed | 5,178 | py | Python | lambda/functions/createDCV/lambda_function_createDCV.py | xinlaoda/DCVCluster | fdc77fdd5bbef17e56c4477fc89d09cadc504757 | [
"Apache-2.0"
] | null | null | null | lambda/functions/createDCV/lambda_function_createDCV.py | xinlaoda/DCVCluster | fdc77fdd5bbef17e56c4477fc89d09cadc504757 | [
"Apache-2.0"
] | null | null | null | lambda/functions/createDCV/lambda_function_createDCV.py | xinlaoda/DCVCluster | fdc77fdd5bbef17e56c4477fc89d09cadc504757 | [
"Apache-2.0"
] | null | null | null | import boto3
import json
import logging
import os
from uuid import uuid4
uuidChars = ("a", "b", "c", "d", "e", "f",
"g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s",
"t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "A", "B", "C",... | 30.280702 | 85 | 0.50618 |
4991e8babb4d9edf060d9d0f7a6248f9cfbb07e5 | 8,016 | py | Python | python_modules/dagster/dagster/core/execution/context/compute.py | alexismanuel/dagster | b2cdf8cc985ad48ff203b44b664ff3cb4aded9a3 | [
"Apache-2.0"
] | 4,606 | 2018-06-21T17:45:20.000Z | 2022-03-31T23:39:42.000Z | python_modules/dagster/dagster/core/execution/context/compute.py | alexismanuel/dagster | b2cdf8cc985ad48ff203b44b664ff3cb4aded9a3 | [
"Apache-2.0"
] | 6,221 | 2018-06-12T04:36:01.000Z | 2022-03-31T21:43:05.000Z | python_modules/dagster/dagster/core/execution/context/compute.py | alexismanuel/dagster | b2cdf8cc985ad48ff203b44b664ff3cb4aded9a3 | [
"Apache-2.0"
] | 619 | 2018-08-22T22:43:09.000Z | 2022-03-31T22:48:06.000Z | from abc import ABC, abstractmethod, abstractproperty
from typing import Any, Optional
from dagster import check
from dagster.core.definitions.dependency import Node, NodeHandle
from dagster.core.definitions.mode import ModeDefinition
from dagster.core.definitions.pipeline import PipelineDefinition
from dagster.core.d... | 31.435294 | 107 | 0.6749 |
fd58922a43e028e481fb3c6f671df6f2176d75da | 5,068 | py | Python | wagtail/core/templatetags/wagtailcore_tags.py | mukesh5/wagtail | 857a4fe18bb7bb0a43019bc1a678f90bf3fce01b | [
"BSD-3-Clause"
] | null | null | null | wagtail/core/templatetags/wagtailcore_tags.py | mukesh5/wagtail | 857a4fe18bb7bb0a43019bc1a678f90bf3fce01b | [
"BSD-3-Clause"
] | null | null | null | wagtail/core/templatetags/wagtailcore_tags.py | mukesh5/wagtail | 857a4fe18bb7bb0a43019bc1a678f90bf3fce01b | [
"BSD-3-Clause"
] | null | null | null | from django import template
from django.template.defaulttags import token_kwargs
from django.utils.encoding import force_text
from django.utils.safestring import mark_safe
from wagtail import VERSION, __version__
from wagtail.core.models import Page
from wagtail.core.rich_text import RichText, expand_db_html
from wagt... | 32.280255 | 143 | 0.677585 |
dfea38cb9efdc6220c4a8b82e93e22d2e98bcd64 | 2,651 | py | Python | other_functions.py | Ariel96cs/SimpleMapReduceFramework | 7cf482f94b1ed1e6436a7b229dfe09c3c0906d56 | [
"MIT"
] | null | null | null | other_functions.py | Ariel96cs/SimpleMapReduceFramework | 7cf482f94b1ed1e6436a7b229dfe09c3c0906d56 | [
"MIT"
] | null | null | null | other_functions.py | Ariel96cs/SimpleMapReduceFramework | 7cf482f94b1ed1e6436a7b229dfe09c3c0906d56 | [
"MIT"
] | null | null | null | # def _get_str_data(self, data_file_name='map_data', data_url=None):
# if data_url is None:
# file_url = "{}/{}".format(self.job_url, data_file_name)
# else:
# file_url = data_url
#
# message = mt.Message()
# message.set_message("GETDATA", {'file_url': file_url,
# ... | 37.338028 | 111 | 0.556017 |
99facefe330edd0f5164c8fe263efe6848024a5c | 1,198 | py | Python | patternai/charcounter1.py | uogbuji/techwriting | 5c4610fa508f050a7923cd9bbd28b44566417978 | [
"Apache-2.0"
] | 6 | 2019-04-13T20:19:00.000Z | 2020-09-18T07:54:50.000Z | patternai/charcounter1.py | uogbuji/techwriting | 5c4610fa508f050a7923cd9bbd28b44566417978 | [
"Apache-2.0"
] | 1 | 2019-11-15T14:54:46.000Z | 2019-11-22T04:02:05.000Z | patternai/charcounter1.py | uogbuji/techwriting | 5c4610fa508f050a7923cd9bbd28b44566417978 | [
"Apache-2.0"
] | 4 | 2019-09-06T19:23:12.000Z | 2019-09-06T22:43:43.000Z | import sys
import pprint
def count_chars(input_fp, frequencies, buffer_size=1024):
'''Read the text content of a file and keep a running count of how often
each character appears.
Arguments:
input_fp -- file pointer with input text
frequencies -- mapping from each character to its counted ... | 30.717949 | 76 | 0.66611 |
c9ecf4407aa22d1eae118aacbc04eb3260cca2fa | 2,914 | py | Python | bumblebee_status/modules/core/memory.py | spxtr/bumblebee-status | 45125f39af8323775aeabf809ae5ae80cfe3ccd9 | [
"MIT"
] | 1,089 | 2016-11-06T10:02:53.000Z | 2022-03-26T12:53:30.000Z | bumblebee_status/modules/core/memory.py | spxtr/bumblebee-status | 45125f39af8323775aeabf809ae5ae80cfe3ccd9 | [
"MIT"
] | 817 | 2016-11-05T05:42:39.000Z | 2022-03-25T19:43:52.000Z | bumblebee_status/modules/core/memory.py | spxtr/bumblebee-status | 45125f39af8323775aeabf809ae5ae80cfe3ccd9 | [
"MIT"
] | 317 | 2016-11-05T00:35:06.000Z | 2022-03-24T13:35:03.000Z | # pylint: disable=C0111,R0903
"""Displays available RAM, total amount of RAM and percentage available.
By default, opens `gnome-system-monitor` on left mouse click.
Requirements:
* gnome-system-monitor for default mouse click action
Parameters:
* memory.warning : Warning threshold in % of memory used (defau... | 30.354167 | 109 | 0.569321 |
cd52d3b903b646c3311dce5bd5f9d51f27e367cd | 129 | py | Python | tests/expr3.py | Smit-create/lpython | 6a731170ba9628eadc0430815c52c175a8c2e767 | [
"MIT"
] | null | null | null | tests/expr3.py | Smit-create/lpython | 6a731170ba9628eadc0430815c52c175a8c2e767 | [
"MIT"
] | null | null | null | tests/expr3.py | Smit-create/lpython | 6a731170ba9628eadc0430815c52c175a8c2e767 | [
"MIT"
] | null | null | null | def test_cast():
a: i32
b: f32
a = 2
b = 4.2
a *= b
b += 1
a = 5
a -= 3.9
a /= b
b = 3/4
| 10.75 | 16 | 0.302326 |
fbf86a69499f3e439a69df68d666fff99080d19b | 244 | py | Python | src/arc_utilities/numpy_conversions.py | ToyotaResearchInstitute/arc_utilities | f15a1dfd9fba5ca83296354bae8b97628895c1c2 | [
"BSD-2-Clause"
] | null | null | null | src/arc_utilities/numpy_conversions.py | ToyotaResearchInstitute/arc_utilities | f15a1dfd9fba5ca83296354bae8b97628895c1c2 | [
"BSD-2-Clause"
] | null | null | null | src/arc_utilities/numpy_conversions.py | ToyotaResearchInstitute/arc_utilities | f15a1dfd9fba5ca83296354bae8b97628895c1c2 | [
"BSD-2-Clause"
] | 1 | 2017-11-06T21:38:23.000Z | 2017-11-06T21:38:23.000Z | import numpy as np
from geometry_msgs.msg import *
def ListPointsToNpArray(points):
arr = np.empty(shape=(3, len(points)))
for ind in range(len(points)):
arr[:,ind] = [points[ind].x, points[ind].y, points[ind].z]
return arr | 30.5 | 66 | 0.659836 |
f79edc8435293faed732243134ab0e4447f6b5d9 | 14,381 | py | Python | tools/manifest/manifest.py | janvenmans/wpt | c063a8c9acc637e3bd72b719b46e6f2fb627da4a | [
"BSD-3-Clause"
] | 2 | 2020-04-16T18:41:05.000Z | 2021-01-30T04:33:07.000Z | tools/manifest/manifest.py | janvenmans/wpt | c063a8c9acc637e3bd72b719b46e6f2fb627da4a | [
"BSD-3-Clause"
] | null | null | null | tools/manifest/manifest.py | janvenmans/wpt | c063a8c9acc637e3bd72b719b46e6f2fb627da4a | [
"BSD-3-Clause"
] | 1 | 2020-05-04T05:26:16.000Z | 2020-05-04T05:26:16.000Z | import itertools
import json
import os
from copy import deepcopy
from multiprocessing import Pool, cpu_count
from six import PY3, iteritems, itervalues, string_types, binary_type, text_type
from . import vcs
from .item import (ConformanceCheckerTest, ManifestItem, ManualTest, RefTest, SupportFile,
T... | 35.9525 | 117 | 0.59064 |
da69d4c44e0b6052d4dbfe66b869f5d5b90fe639 | 3,350 | py | Python | src/adafruit-circuitpython-bundle-4.x-mpy-20190713/examples/rfm69_simpletest.py | mbaaba/solar_panel | 42059d8c61320494ad1298065dbc50cd9b3bd51e | [
"MIT"
] | 1 | 2020-04-13T16:10:53.000Z | 2020-04-13T16:10:53.000Z | infra/libs-400rc2-20190512/examples/rfm69_simpletest.py | jadudm/feather-isa | b7419e6698c3f64be4d8122656eb8124631ca859 | [
"MIT"
] | null | null | null | infra/libs-400rc2-20190512/examples/rfm69_simpletest.py | jadudm/feather-isa | b7419e6698c3f64be4d8122656eb8124631ca859 | [
"MIT"
] | null | null | null | # Simple example to send a message and then wait indefinitely for messages
# to be received. This uses the default RadioHead compatible GFSK_Rb250_Fd250
# modulation and packet format for the radio.
# Author: Tony DiCola
import board
import busio
import digitalio
import adafruit_rfm69
# Define radio para... | 44.078947 | 97 | 0.709254 |
b10e7ac7baeb3ca610a27258dc048c131589e525 | 91 | py | Python | enthought/graphcanvas/graph_view.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/graphcanvas/graph_view.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/graphcanvas/graph_view.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from graphcanvas.graph_view import *
| 22.75 | 38 | 0.846154 |
c2eb890202de9ebb96af99e358bf2e900e1dcc2f | 21,549 | py | Python | PythonNetwork/venv/Lib/site-packages/scipy/sparse/linalg/_expm_multiply.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | PythonNetwork/venv/Lib/site-packages/scipy/sparse/linalg/_expm_multiply.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | PythonNetwork/venv/Lib/site-packages/scipy/sparse/linalg/_expm_multiply.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """Compute the action of the matrix exponential.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
import scipy.sparse.linalg
from scipy.sparse.linalg import aslinearoperator
__all__ = ['expm_multiply']
def _exact_inf_norm(A):
# A compatibility functio... | 30.609375 | 80 | 0.575943 |
befde76b358b87eaef2855cf6086659fa3e7cfa0 | 15,591 | py | Python | rlcard/agents/human_agents/gin_rummy_human_agent/gui_gin_rummy/game_canvas_post_doing_action.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 1,735 | 2019-09-05T12:49:43.000Z | 2022-03-30T12:02:07.000Z | rlcard/agents/human_agents/gin_rummy_human_agent/gui_gin_rummy/game_canvas_post_doing_action.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 197 | 2019-09-14T05:59:02.000Z | 2022-03-03T19:21:19.000Z | rlcard/agents/human_agents/gin_rummy_human_agent/gui_gin_rummy/game_canvas_post_doing_action.py | randombenj/rlcard | 0948035d26e1b619c068360326f12451f5d28f8b | [
"MIT"
] | 476 | 2019-09-13T15:25:32.000Z | 2022-03-29T01:41:29.000Z | '''
Project: Gui Gin Rummy
File name: game_canvas_post_doing_action.py
Author: William Hale
Date created: 3/14/2020
'''
# from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .game_canvas import GameCanvas
from typing import List, Tuple
from rlcard.games.base... | 54.324042 | 118 | 0.70701 |
27d8b1d588dccab4aad8ef551ae24c87eb66e95f | 2,975 | py | Python | dhtxmpp_componentd/dhtxmpp_componentd.py | pendleto/dhtxmpp_component | f7b5f018b74d5d1bf34d175b6766677de9eaa987 | [
"MIT"
] | 3 | 2018-10-24T07:07:44.000Z | 2021-12-24T20:25:24.000Z | dhtxmpp_componentd/dhtxmpp_componentd.py | pendleto/dhtxmpp_component | f7b5f018b74d5d1bf34d175b6766677de9eaa987 | [
"MIT"
] | null | null | null | dhtxmpp_componentd/dhtxmpp_componentd.py | pendleto/dhtxmpp_component | f7b5f018b74d5d1bf34d175b6766677de9eaa987 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import logging
from optparse import OptionParser
from dhtxmpp_component.component import dhtxmpp_component
class dhtxmpp_componentd:
def run(self, opts):
# Setup the dhtxmpp_component and register plugins. Note that while plugins
# may have interdependencies, the... | 36.280488 | 99 | 0.590252 |
d5f11f0054abb2926a4c0c789681ad79a83a425b | 3,300 | py | Python | alexber/utils/importer.py | AndreyRub/AlexBerUtils | b2d79c98c083533534470b62632a36dfd730be48 | [
"BSD-2-Clause"
] | null | null | null | alexber/utils/importer.py | AndreyRub/AlexBerUtils | b2d79c98c083533534470b62632a36dfd730be48 | [
"BSD-2-Clause"
] | 8 | 2019-12-15T05:13:27.000Z | 2021-02-16T20:03:40.000Z | alexber/utils/importer.py | AndreyRub/AlexBerUtils | b2d79c98c083533534470b62632a36dfd730be48 | [
"BSD-2-Clause"
] | 2 | 2019-12-12T03:52:37.000Z | 2021-05-21T21:14:34.000Z | """
See here https://medium.com/analytics-vidhya/how-to-write-easily-customizable-code-8b00b43406b2 for documentation.
"""
import importlib
import logging
import inspect
import pkgutil
logger = logging.getLogger(__name__)
#adopted from scrapy
def _walk_modules(path):
"""
Loads a module and all its submodul... | 31.132075 | 115 | 0.68697 |
db597cf6e57ff546b3806df5340ecd3c2ddcbe9d | 6,813 | py | Python | tensorboard/plugins/npmi/npmi_plugin_test.py | gbaned/tensorboard | 63bc56bbe36d22fc8f2993e38f53efb6722e5edf | [
"Apache-2.0"
] | 1 | 2021-07-21T15:54:17.000Z | 2021-07-21T15:54:17.000Z | tensorboard/plugins/npmi/npmi_plugin_test.py | rmothukuru/tensorboard | 63bc56bbe36d22fc8f2993e38f53efb6722e5edf | [
"Apache-2.0"
] | null | null | null | tensorboard/plugins/npmi/npmi_plugin_test.py | rmothukuru/tensorboard | 63bc56bbe36d22fc8f2993e38f53efb6722e5edf | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# Un... | 37.85 | 80 | 0.6059 |
176b419243ff0082a1af59b30e4586b41f1e0543 | 3,186 | py | Python | tests/query/stateless/test_if_exists.py | panda-sheep/nebula-graph | 27f832a16413d6dab06ca2bf9e931547306c3819 | [
"Apache-2.0"
] | 1 | 2021-08-23T05:55:55.000Z | 2021-08-23T05:55:55.000Z | tests/query/stateless/test_if_exists.py | panda-sheep/nebula-graph | 27f832a16413d6dab06ca2bf9e931547306c3819 | [
"Apache-2.0"
] | null | null | null | tests/query/stateless/test_if_exists.py | panda-sheep/nebula-graph | 27f832a16413d6dab06ca2bf9e931547306c3819 | [
"Apache-2.0"
] | null | null | null | # --coding:utf-8--
#
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import re
import sys
import pytest
import time
from nebula2.graph import ttypes
import nebula2.Client
fro... | 33.1875 | 101 | 0.686127 |
6e86e01add1b30638f66d7ec85567849a1ca4bc3 | 293 | py | Python | Python3/0343-Integer-Break/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/0343-Integer-Break/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/0343-Integer-Break/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | class Solution:
def integerBreak(self, n):
"""
:type n: int
:rtype: int
"""
# get maximum
if n == 2: return 1
if n == 3: return 2
prod = 1
while n > 4:
prod *= 3
n -= 3
return prod * n | 20.928571 | 30 | 0.37884 |
52056b261a95d0dbf9ca620387ed105ffb0e05a0 | 12,471 | py | Python | examples/albert/run_trainer.py | deniskamazur/hm-debug | cf31951504c38a1ea5e868e607ea74691092561a | [
"MIT"
] | 1 | 2021-08-23T01:16:12.000Z | 2021-08-23T01:16:12.000Z | examples/albert/run_trainer.py | deniskamazur/hm-debug | cf31951504c38a1ea5e868e607ea74691092561a | [
"MIT"
] | 1 | 2021-08-23T01:16:21.000Z | 2021-08-23T01:16:21.000Z | examples/albert/run_trainer.py | deniskamazur/hm-debug | cf31951504c38a1ea5e868e607ea74691092561a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import logging
import os
import pickle
from dataclasses import asdict
from pathlib import Path
import torch
import transformers
from datasets import load_from_disk
from torch.utils.data import DataLoader
from torch_optimizer import Lamb
from transformers import DataCollatorForLanguageModeling, H... | 39.716561 | 119 | 0.697618 |
6c6d3062d2909b20cb59b5c0b77a7fc98149319d | 1,950 | py | Python | config.py | mjscjj/SCDP | 379d7c52dec58c623c363fc7347a67f269c3c3f3 | [
"MIT"
] | null | null | null | config.py | mjscjj/SCDP | 379d7c52dec58c623c363fc7347a67f269c3c3f3 | [
"MIT"
] | null | null | null | config.py | mjscjj/SCDP | 379d7c52dec58c623c363fc7347a67f269c3c3f3 | [
"MIT"
] | null | null | null | import os
import time
'''
模型的基本配置
BASE_DIR 本地路径
train_path 训练路径
test_path 测试路径
'''
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
train_path = os.path.join(BASE_DIR, "avazu_CTR/train.csv")
test_path = os.path.join(BASE_DIR, "avazu_CTR/test.csv")
data_path = os.path.join(BASE_DIR, "avazu_CTR/sets/")
field2coun... | 28.676471 | 87 | 0.762051 |
cc9fb91050c2eee0b486f333343bd330c607f7dc | 2,835 | py | Python | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/pause_scaling_policy_option.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/pause_scaling_policy_option.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/pause_scaling_policy_option.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class PauseScalingPolicyOption:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the... | 25.540541 | 75 | 0.541446 |
576629e2c91a763478bef85a603bd0f86d4b2ae3 | 633 | py | Python | likelihoods/ACTPol_lite_DR4_onlyEE/__init__.py | s-ilic/ECLAIR | d82e1cf96f4f3676120e94cd46a7ed7734002b0c | [
"MIT"
] | 4 | 2020-04-23T03:30:27.000Z | 2021-08-19T15:59:15.000Z | likelihoods/ACTPol_lite_DR4_onlyEE/__init__.py | s-ilic/ECLAIR | d82e1cf96f4f3676120e94cd46a7ed7734002b0c | [
"MIT"
] | null | null | null | likelihoods/ACTPol_lite_DR4_onlyEE/__init__.py | s-ilic/ECLAIR | d82e1cf96f4f3676120e94cd46a7ed7734002b0c | [
"MIT"
] | null | null | null | import pyactlike
import numpy as np
### Some important variables ###
use_tt = False
use_te = False
use_ee = True
tt_lmax = 5000
bmin = 0
like = pyactlike.ACTPowerSpectrumData(
use_tt=use_tt,
use_te=use_te,
use_ee=use_ee,
tt_lmax=tt_lmax,
bmin=bmin,
)
### ACTPol lite DR4 likelihood
def get_loglike(... | 24.346154 | 80 | 0.655608 |
c6edbb375775ea2bab75e5591ccb559dfbe570ba | 1,451 | py | Python | test_code/aiy_hotword_recording_.py | YeongJunKim/rpi-pyrec | 81ccfce023a877ad6fa8543f199be10742739400 | [
"Apache-2.0"
] | 1 | 2018-08-06T08:28:11.000Z | 2018-08-06T08:28:11.000Z | test_code/aiy_hotword_recording_.py | YeongJunKim/rpi_pyrec | 81ccfce023a877ad6fa8543f199be10742739400 | [
"Apache-2.0"
] | null | null | null | test_code/aiy_hotword_recording_.py | YeongJunKim/rpi_pyrec | 81ccfce023a877ad6fa8543f199be10742739400 | [
"Apache-2.0"
] | null | null | null | # autor : colson (Yeong Jun Kim)
# https://www.github.com/YeongJunKim
from aiy_led import MyLed
from aiy_log import MyLogger
from aiy_play import MyAudio
from aiy_rec import MyRec
import logging
import aiy.voicehat
import datetime
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
logger = MyLogger(level=logging.DEBUG, g... | 23.031746 | 117 | 0.635424 |
377bef86e9852db735d05f95209d58ba65cd2da2 | 464 | py | Python | servicos/migrations/0004_auto_20170201_1153.py | eduardoedson/SCP | 52bb96b35b4f6e40272eb2dc65f304ac72279b3f | [
"MIT"
] | null | null | null | servicos/migrations/0004_auto_20170201_1153.py | eduardoedson/SCP | 52bb96b35b4f6e40272eb2dc65f304ac72279b3f | [
"MIT"
] | null | null | null | servicos/migrations/0004_auto_20170201_1153.py | eduardoedson/SCP | 52bb96b35b4f6e40272eb2dc65f304ac72279b3f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-02-01 11:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('servicos', '0003_auto_20170201_1143'),
]
operations = [
migrations.AlterField(... | 22.095238 | 61 | 0.625 |
4c629dc90bf81117ab5d4cc6c7ff028b76debea9 | 4,119 | py | Python | kartothek/io/dask/bag.py | kagharpure/kartothek | 6ddab8fc1376f381730cf4db6ca5cd3df5ac99f6 | [
"MIT"
] | null | null | null | kartothek/io/dask/bag.py | kagharpure/kartothek | 6ddab8fc1376f381730cf4db6ca5cd3df5ac99f6 | [
"MIT"
] | null | null | null | kartothek/io/dask/bag.py | kagharpure/kartothek | 6ddab8fc1376f381730cf4db6ca5cd3df5ac99f6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from functools import partial
import dask.bag as db
from kartothek.core import naming
from kartothek.core.factory import _ensure_factory
from kartothek.core.utils import _check_callable
from kartothek.core.uuid import gen_uuid
from kartothek.io.eager import read_dataset_as_metapartitions
from ... | 29.633094 | 120 | 0.725904 |
e509c4b86ce4c1603c1bb35264489610dc1754d8 | 4,964 | py | Python | qpaint/qpaint.py | Time0o/QPaint | 596d6c1c96f7f448205bf49725f4723a27d80953 | [
"MIT"
] | null | null | null | qpaint/qpaint.py | Time0o/QPaint | 596d6c1c96f7f448205bf49725f4723a27d80953 | [
"MIT"
] | null | null | null | qpaint/qpaint.py | Time0o/QPaint | 596d6c1c96f7f448205bf49725f4723a27d80953 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from sys import argv, exit
from typing import Optional
from PyQt5 import QtCore, QtGui, QtWidgets
class DrawAreaView(QtWidgets.QGraphicsView):
ZOOM_FACTOR = 1.25
def __init__(self):
super().__init__()
self.setTransformationAnchor(QtWidgets.QGraphicsView.AnchorUnderMo... | 28.693642 | 82 | 0.612409 |
961832becae7fc60131c4c8fdc8422b994814d53 | 839 | py | Python | ped/style.py | anordin95/ped | 6d8110568f9c0461fc4b64053ea5c123328d9b88 | [
"MIT"
] | 45 | 2015-09-06T19:50:40.000Z | 2020-11-25T03:04:37.000Z | ped/style.py | anordin95/ped | 6d8110568f9c0461fc4b64053ea5c123328d9b88 | [
"MIT"
] | 7 | 2015-09-07T01:10:27.000Z | 2020-09-25T13:04:53.000Z | ped/style.py | anordin95/ped | 6d8110568f9c0461fc4b64053ea5c123328d9b88 | [
"MIT"
] | 4 | 2015-09-08T13:48:30.000Z | 2020-03-09T16:25:10.000Z | from typing import Optional, IO, Any
import os
import sys
RED = 31
GREEN = 32
BOLD = 1
RESET_ALL = 0
def style(
text: str, fg: Optional[int] = None, *, bold: bool = False, file: IO = sys.stdout
) -> str:
use_color = not os.environ.get("NO_COLOR") and file.isatty()
if use_color:
parts = [
... | 23.971429 | 85 | 0.575685 |
1ac0f6999734e14c44c0d5cb0dfb99613e000b14 | 2,444 | py | Python | chunair/kicad-footprint-generator-master/scripts/Capacitors_SMD/corners.py | speedypotato/chuni-lite | c8dda8428723f8c4f99075e7cbaa22a44cbc187d | [
"CC-BY-4.0"
] | 2 | 2022-03-18T23:42:51.000Z | 2022-03-19T15:31:34.000Z | chunair/kicad-footprint-generator-master/scripts/Capacitors_SMD/corners.py | speedypotato/chuni-lite | c8dda8428723f8c4f99075e7cbaa22a44cbc187d | [
"CC-BY-4.0"
] | null | null | null | chunair/kicad-footprint-generator-master/scripts/Capacitors_SMD/corners.py | speedypotato/chuni-lite | c8dda8428723f8c4f99075e7cbaa22a44cbc187d | [
"CC-BY-4.0"
] | null | null | null | from KicadModTree import * # NOQA
def add_corners(m, start_pos, end_pos, size_x, size_y, layer, width, offset=(0, 0), chamfers=[]):
# If specified, an 'offset' can be applied to the corners.
# For example, creating corners around a given Rect of a specified size
# offset for the rect line
# For the ... | 52 | 136 | 0.645663 |
be0d22d48659037d1b8ace53578836797cf44eb1 | 1,487 | py | Python | Others/Source/05/5.1/function_test.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | 1 | 2018-05-30T01:38:23.000Z | 2018-05-30T01:38:23.000Z | Others/Source/05/5.1/function_test.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | null | null | null | Others/Source/05/5.1/function_test.py | silence0201/Learn-Python | 662da7c0e74221cedb445ba17d5cb1cd3af41c86 | [
"MIT"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version... | 40.189189 | 74 | 0.279758 |
b7954d7c8ff17c5a1f81a5ca028ed3619daeae3f | 6,253 | py | Python | ASK/tests/ask1.py | SQAPractical/AssesmentControlePython | ac41cf4bf4df7ef5ca9fa718d26b0333468be6ca | [
"Apache-2.0"
] | null | null | null | ASK/tests/ask1.py | SQAPractical/AssesmentControlePython | ac41cf4bf4df7ef5ca9fa718d26b0333468be6ca | [
"Apache-2.0"
] | null | null | null | ASK/tests/ask1.py | SQAPractical/AssesmentControlePython | ac41cf4bf4df7ef5ca9fa718d26b0333468be6ca | [
"Apache-2.0"
] | null | null | null | import unittest
from selenium import webdriver
#Create User with 5 Alphanumerical & Special characters First name
class MyTestCase(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome(
executable_path='/Users/a123/ask_automation/ASK/browsers/chromedriver')
self.driver.g... | 40.869281 | 318 | 0.682233 |
97ae7958297f3e5dace33fb8102080d950b9216d | 9,079 | py | Python | docs/source/conf.py | oleksiyVeretiuk/openprocurement.auctions.insider | f380caa9b63dadbfe7bd1f9512e21c486a138457 | [
"Apache-2.0"
] | null | null | null | docs/source/conf.py | oleksiyVeretiuk/openprocurement.auctions.insider | f380caa9b63dadbfe7bd1f9512e21c486a138457 | [
"Apache-2.0"
] | 64 | 2017-09-08T14:06:47.000Z | 2019-02-20T11:55:21.000Z | docs/source/conf.py | oleksiyVeretiuk/openprocurement.auctions.insider | f380caa9b63dadbfe7bd1f9512e21c486a138457 | [
"Apache-2.0"
] | 13 | 2017-08-09T12:04:30.000Z | 2018-09-07T10:46:59.000Z | # -*- coding: utf-8 -*-
#
# openprocurement.auctions.dgf documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 1 02:29:13 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 32.776173 | 109 | 0.72508 |
0672aba08fae5f6a1e997cd0e30b7d63d5218c04 | 479 | py | Python | env/lib/python3.8/site-packages/plotly/validators/contour/colorbar/_tickprefix.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/contour/colorbar/_tickprefix.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/contour/colorbar/_tickprefix.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class TickprefixValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(
self, plotly_name="tickprefix", parent_name="contour.colorbar", **kwargs
):
super(TickprefixValidator, self).__init__(
plotly_name=plotly_name,
par... | 31.933333 | 80 | 0.649269 |
e48efd218c6e0602337dc785e53cd7549f8a9abd | 2,329 | py | Python | src/examples/stimuli-representation.py | jacksonlli/learn-hippo | 7695d22e73c334b6d9df7e35cb6e30855db187fe | [
"MIT"
] | 13 | 2020-12-06T02:31:02.000Z | 2022-02-16T16:20:31.000Z | src/examples/stimuli-representation.py | jacksonlli/learn-hippo | 7695d22e73c334b6d9df7e35cb6e30855db187fe | [
"MIT"
] | 1 | 2021-09-19T20:55:32.000Z | 2021-09-19T20:55:32.000Z | src/examples/stimuli-representation.py | jacksonlli/learn-hippo | 7695d22e73c334b6d9df7e35cb6e30855db187fe | [
"MIT"
] | 3 | 2020-12-24T00:52:43.000Z | 2021-12-15T02:12:15.000Z | import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from task import SequenceLearning
sns.set(style='white', palette='colorblind', context='poster')
np.random.seed(0)
'''how to use'''
# init
n_param, n_branch = 16, 4
pad_len = 0
n_parts = 2
n_samples = 256
p_rm_ob_enc = 0
p_rm_ob_rcl = 0
n_rm_fixe... | 29.481013 | 74 | 0.649206 |
88ed9da2de9d0b2b9ab08d19ecf3c1f7025e6fe1 | 2,714 | py | Python | toolchain/riscv/MSYS/python/Lib/idlelib/window.py | zhiqiang-hu/bl_iot_sdk | 154ee677a8cc6a73e6a42a5ff12a8edc71e6d15d | [
"Apache-2.0"
] | 207 | 2018-10-01T08:53:01.000Z | 2022-03-14T12:15:54.000Z | Thonny/Lib/idlelib/window.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 30 | 2019-01-04T10:14:56.000Z | 2020-10-12T14:00:31.000Z | Thonny/Lib/idlelib/window.py | Pydiderot/pydiderotIDE | a42fcde3ea837ae40c957469f5d87427e8ce46d3 | [
"MIT"
] | 53 | 2019-03-12T16:50:21.000Z | 2022-03-15T23:16:18.000Z | from tkinter import Toplevel, TclError
import sys
class WindowList:
def __init__(self):
self.dict = {}
self.callbacks = []
def add(self, window):
window.after_idle(self.call_callbacks)
self.dict[str(window)] = window
def delete(self, window):
try:
... | 27.414141 | 75 | 0.56448 |
67d661450559a83a9af9619bc1b7849253324dd8 | 7,242 | py | Python | modules/pmg_qt/pymol_gl_widget.py | tranas-open/pymolXT | e11cc7994178e439534f15c7b5eac51b4e678c54 | [
"CNRI-Python"
] | 1 | 2021-02-04T19:35:51.000Z | 2021-02-04T19:35:51.000Z | modules/pmg_qt/pymol_gl_widget.py | tranas-open/pymolXT | e11cc7994178e439534f15c7b5eac51b4e678c54 | [
"CNRI-Python"
] | null | null | null | modules/pmg_qt/pymol_gl_widget.py | tranas-open/pymolXT | e11cc7994178e439534f15c7b5eac51b4e678c54 | [
"CNRI-Python"
] | null | null | null | import sys
from pymol2 import SingletonPyMOL as PyMOL
import pymol
from pymol.Qt import QtCore
from pymol.Qt import QtGui
from pymol.Qt import QtWidgets
Gesture = QtCore.QEvent.Gesture
Qt = QtCore.Qt
from .keymapping import get_modifiers
from .keymapping import get_wheel_button
# don't import the heavy OpenGL (PyOp... | 28.85259 | 80 | 0.581331 |
4a74662d75408173070d453b0ec4c576c433c7e7 | 1,132 | py | Python | extreme-learning-machine/elm.py | brenoalef/ICA | 8593a1c53ba536538d99dafb9edfb64413088e24 | [
"MIT"
] | 1 | 2019-02-04T18:05:30.000Z | 2019-02-04T18:05:30.000Z | extreme-learning-machine/elm.py | brenoalef/ICA | 8593a1c53ba536538d99dafb9edfb64413088e24 | [
"MIT"
] | null | null | null | extreme-learning-machine/elm.py | brenoalef/ICA | 8593a1c53ba536538d99dafb9edfb64413088e24 | [
"MIT"
] | null | null | null | import numpy as np
class ELM:
def __init__(self, hidden_units=5, activation="log"):
self.hidden_units = hidden_units
self.activation = activation
def __init_weights(self, n_features):
self.h = np.random.normal(size=(n_features, self.hidden_units))
def __activation(self, X):
... | 30.594595 | 71 | 0.536219 |
8ca54025914ae7709085916bc20aa40400ad8a5a | 2,347 | py | Python | h2o-py/h2o/model/multinomial.py | voltek62/h2o-3 | d581245120bf0cb6fab2bc7e8273b4f41f461448 | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/model/multinomial.py | voltek62/h2o-3 | d581245120bf0cb6fab2bc7e8273b4f41f461448 | [
"Apache-2.0"
] | null | null | null | h2o-py/h2o/model/multinomial.py | voltek62/h2o-3 | d581245120bf0cb6fab2bc7e8273b4f41f461448 | [
"Apache-2.0"
] | null | null | null | from builtins import zip
from ..frame import H2OFrame
from ..h2o import H2OConnection
from .model_base import ModelBase
class H2OMultinomialModel(ModelBase):
def _make_model(self):
return H2OMultinomialModel()
def confusion_matrix(self, data):
"""
Returns a confusion matrix based of H2O's default pre... | 43.462963 | 124 | 0.681295 |
23053bf4d92eecee6b4eba0dd9ab1d217dd11922 | 17,205 | py | Python | numpy/lib/_iotools.py | qpython-android/QPypi-numpy | 4e5fa5c2e01bb6250537fe44f426f878a240bcc7 | [
"BSD-3-Clause"
] | 7 | 2016-11-29T18:01:53.000Z | 2018-08-21T09:45:15.000Z | numpy/lib/_iotools.py | efiring/numpy-work | f873f11f3b96ff859debdc91a2c172a6b476f7db | [
"BSD-3-Clause"
] | 1 | 2016-06-28T14:03:59.000Z | 2016-06-28T14:03:59.000Z | numpy/lib/_iotools.py | qpython-libs/QPypi-numpy | 4e5fa5c2e01bb6250537fe44f426f878a240bcc7 | [
"BSD-3-Clause"
] | 3 | 2016-10-19T00:41:31.000Z | 2020-03-01T04:57:36.000Z | """
A collection of functions designed to help I/O with ascii file.
"""
__docformat__ = "restructuredtext en"
import numpy as np
import numpy.core.numeric as nx
from __builtin__ import bool, int, long, float, complex, object, unicode, str
def _is_string_like(obj):
"""
Check whether obj behaves like a string... | 34.827935 | 82 | 0.584481 |
62bd316a2a62d2b0213ae0a387fa70472ff30edb | 5,236 | py | Python | basicmodule/views.py | CocoBir/django-restful-demo | aeb7f8a0bcff5c52b528c7b0c48f87de5f392320 | [
"MIT"
] | null | null | null | basicmodule/views.py | CocoBir/django-restful-demo | aeb7f8a0bcff5c52b528c7b0c48f87de5f392320 | [
"MIT"
] | null | null | null | basicmodule/views.py | CocoBir/django-restful-demo | aeb7f8a0bcff5c52b528c7b0c48f87de5f392320 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
basic module management restful design
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Created: 2016-8-3
:Copyright: (c) 2016<smileboywtu@gmail.com>
"""
from rest_framework import permissions
from rest_framework import status
from rest_framework import viewsets
from rest_framewo... | 30.619883 | 88 | 0.584798 |
788d7fe524c3ee02c28d1db2e2c55332fc30c11a | 9,148 | py | Python | test/functional/test_framework/test_node.py | farsider350/AUTX-Core | 6d00d1e027a5a6dffb3b0815a155e4515ced007b | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | farsider350/AUTX-Core | 6d00d1e027a5a6dffb3b0815a155e4515ced007b | [
"MIT"
] | null | null | null | test/functional/test_framework/test_node.py | farsider350/AUTX-Core | 6d00d1e027a5a6dffb3b0815a155e4515ced007b | [
"MIT"
] | 1 | 2021-01-03T02:35:54.000Z | 2021-01-03T02:35:54.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Class for autxd node under test"""
import decimal
import errno
import http.client
import json
import loggin... | 38.762712 | 248 | 0.632707 |
fc5aea6207e9c0c3a885c631e44efa548ae0bc1d | 5,815 | py | Python | facebook_business/adobjects/serverside/tests/event_request_test.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 576 | 2018-05-01T19:09:32.000Z | 2022-03-31T11:45:11.000Z | facebook_business/adobjects/serverside/tests/event_request_test.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 217 | 2018-05-03T07:31:59.000Z | 2022-03-29T14:19:52.000Z | facebook_business/adobjects/serverside/tests/event_request_test.py | MyrikLD/facebook-python-business-sdk | a53c8ba0e8f7d0b41b385c60089f6ba00fa5c814 | [
"CNRI-Python"
] | 323 | 2018-05-01T20:32:26.000Z | 2022-03-29T07:05:12.000Z | # Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... | 43.721805 | 104 | 0.685125 |
7678b49ecd2d727ffd79eb4c1a5297d3082727f5 | 3,264 | py | Python | tests/test_s3_hashfs.py | danielhfrank/cas-manifest | e78b190d68eac6c22b9c1576ec9807b8b54ebf68 | [
"MIT"
] | 2 | 2021-02-03T02:52:11.000Z | 2021-02-10T18:27:49.000Z | tests/test_s3_hashfs.py | danielhfrank/cas-manifest | e78b190d68eac6c22b9c1576ec9807b8b54ebf68 | [
"MIT"
] | null | null | null | tests/test_s3_hashfs.py | danielhfrank/cas-manifest | e78b190d68eac6c22b9c1576ec9807b8b54ebf68 | [
"MIT"
] | null | null | null | from io import StringIO
import os
from mock import patch
from pathlib import Path
import tempfile
import boto3
from moto import mock_s3
import pytest
from cas_manifest.s3_hashfs import S3HashFS, S3CasInfo, get_extension
BUCKET = 'facet-models-test'
@pytest.fixture(scope='function')
def aws_credentials():
"""Mo... | 30.222222 | 99 | 0.685049 |
c4ddfb2b1b3c57b4975cac3dc048e1310aa10772 | 2,033 | py | Python | examples/Pipeline/simple_web_service/web_service_java.py | avr248/Serving | bd12b303d3e490278dd94461fa8f70dc24c81ec0 | [
"Apache-2.0"
] | 789 | 2019-04-05T09:20:46.000Z | 2022-03-31T13:43:54.000Z | examples/Pipeline/simple_web_service/web_service_java.py | avr248/Serving | bd12b303d3e490278dd94461fa8f70dc24c81ec0 | [
"Apache-2.0"
] | 1,195 | 2019-04-08T10:05:28.000Z | 2022-03-31T03:43:42.000Z | examples/Pipeline/simple_web_service/web_service_java.py | avr248/Serving | bd12b303d3e490278dd94461fa8f70dc24c81ec0 | [
"Apache-2.0"
] | 229 | 2019-04-05T09:20:57.000Z | 2022-03-30T06:21:22.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 33.327869 | 74 | 0.692573 |
111facb547c8aa30a373b9f1b208b58f437100fa | 1,024 | py | Python | src/Gon/history_starter_cnstock.py | majiajue/Listed-company-news-crawl-and-text-analysis | fd3b23814039cbe8fbb2e25cbadb68238e0d998b | [
"MIT"
] | 635 | 2018-02-25T08:45:06.000Z | 2022-03-30T10:05:23.000Z | src/Gon/history_starter_cnstock.py | NongMaYiSheng/Listed-company-news-crawl-and-text-analysis | fd3b23814039cbe8fbb2e25cbadb68238e0d998b | [
"MIT"
] | 5 | 2018-10-29T16:21:28.000Z | 2022-01-03T12:59:28.000Z | src/Gon/history_starter_cnstock.py | NongMaYiSheng/Listed-company-news-crawl-and-text-analysis | fd3b23814039cbe8fbb2e25cbadb68238e0d998b | [
"MIT"
] | 216 | 2018-02-26T09:27:15.000Z | 2022-03-30T10:05:26.000Z | import __init__
import time
import logging
from Kite import config
from Killua.denull import DeNull
from Killua.deduplication import Deduplication
from Killua.buildstocknewsdb import GenStockNewsDB
from Gon.cnstockspyder import CnStockSpyder
# 1. 爬取历史数据
cnstock_spyder = CnStockSpyder(config.DATABASE_NAME, config.... | 31.030303 | 105 | 0.825195 |
4795a2d386857866a65818fe49b0c9939b6447fd | 16,858 | py | Python | python/tvm/relay/build_module.py | domin1985/tvm | 7dd6d6e38142cd22567714b57e56c4f8b1937154 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | python/tvm/relay/build_module.py | domin1985/tvm | 7dd6d6e38142cd22567714b57e56c4f8b1937154 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | python/tvm/relay/build_module.py | domin1985/tvm | 7dd6d6e38142cd22567714b57e56c4f8b1937154 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.047817 | 119 | 0.649721 |
1b3e8897edba9c9ecf25a0126fd761a575fc76ac | 3,915 | py | Python | beetsplug/syncpl.py | lrnt/beets-syncpl | 9cee89cb47510c48eb26f86cff2a6aa7be6ccb29 | [
"MIT"
] | 6 | 2015-02-02T22:38:59.000Z | 2018-05-04T23:39:19.000Z | beetsplug/syncpl.py | lrnt/beets-syncpl | 9cee89cb47510c48eb26f86cff2a6aa7be6ccb29 | [
"MIT"
] | null | null | null | beetsplug/syncpl.py | lrnt/beets-syncpl | 9cee89cb47510c48eb26f86cff2a6aa7be6ccb29 | [
"MIT"
] | null | null | null | from beets.plugins import BeetsPlugin
from beets import ui, config, library
from os import fsync
from os.path import isdir, isfile, join, relpath
from tempfile import NamedTemporaryFile
from subprocess import Popen, STDOUT, PIPE
from shlex import split as shsplit
def syncpl(lib, opts, args):
config['syncpl'].set_... | 34.646018 | 80 | 0.588761 |
8221072b6b2838776330b12779cbd6f0e058f072 | 5,586 | py | Python | fast_to_sql/fast_to_sql.py | jdglaser/fast_to_SQL | 71b38ef8df7e7efeb79793394e94ca3988601140 | [
"MIT"
] | 20 | 2019-09-04T10:15:20.000Z | 2022-02-26T12:04:39.000Z | fast_to_sql/fast_to_sql.py | jdglaser/fast_to_SQL | 71b38ef8df7e7efeb79793394e94ca3988601140 | [
"MIT"
] | 16 | 2019-04-23T07:49:11.000Z | 2021-07-26T15:28:56.000Z | fast_to_sql/fast_to_sql.py | jdglaser/fast_to_SQL | 71b38ef8df7e7efeb79793394e94ca3988601140 | [
"MIT"
] | 6 | 2019-07-30T10:33:53.000Z | 2021-05-13T20:55:40.000Z | """Main script that holds logic for fast_to_sql
"""
from __future__ import absolute_import
import pandas as pd
import numpy as np
import pyodbc
from . import errors
# Global
DTYPE_MAP = {
"int64": "int",
"float64": "float",
"object": "varchar(255)",
"datetime64[ns]": "datetime2",
"bool": "bit"
}
... | 32.858824 | 164 | 0.629073 |
21cd8f2ac03551e98e87f12d543b27cac8207b09 | 4,547 | py | Python | configs/representation/archive/uvc_lab/uvc2_r18_diff_coord_video_2x8x1_50e_kinetics400_lab.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | configs/representation/archive/uvc_lab/uvc2_r18_diff_coord_video_2x8x1_50e_kinetics400_lab.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | configs/representation/archive/uvc_lab/uvc2_r18_diff_coord_video_2x8x1_50e_kinetics400_lab.py | happywu/mmaction2-CycleContrast | 019734e471dffd1161b7a9c617ba862d2349a96c | [
"Apache-2.0"
] | null | null | null | # model settings
temperature = 0.01
with_norm = True
model = dict(
type='UVCTrackerV2',
backbone=dict(
type='ResNet',
pretrained=None,
depth=18,
out_indices=(3, ),
strides=(1, 2, 1, 1),
norm_eval=False,
zero_init_residual=True),
cls_head=dict(
... | 31.358621 | 76 | 0.632945 |
b1b44e964cf1771cdf178273b1ece6e26fa7cb1b | 46,519 | py | Python | flask_test/aget_test_result.py | rahman-mahmudur/PyART | 36591cd10b2b7a560bbcb47a6cf744b72466f92a | [
"Apache-2.0"
] | null | null | null | flask_test/aget_test_result.py | rahman-mahmudur/PyART | 36591cd10b2b7a560bbcb47a6cf744b72466f92a | [
"Apache-2.0"
] | null | null | null | flask_test/aget_test_result.py | rahman-mahmudur/PyART | 36591cd10b2b7a560bbcb47a6cf744b72466f92a | [
"Apache-2.0"
] | null | null | null | import os,time,math,sys,json,re,string,json
import importlib
import get_dataflow
import pandas as pd
import joblib
import json
import requests
import bs4
import lxml
from sklearn.ensemble import RandomForestClassifier
from nltk.tokenize import word_tokenize
stdlib=['string','re','difflib','textwrap','unicodedata','st... | 26.643184 | 274 | 0.6208 |
4f3d11426954538b02554adeac339fdd3a495c7d | 734 | py | Python | nehushtan/mysql/MySQLAnyTable.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | null | null | null | nehushtan/mysql/MySQLAnyTable.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | 1 | 2020-11-20T03:10:23.000Z | 2020-11-20T09:30:34.000Z | nehushtan/mysql/MySQLAnyTable.py | sinri/nehushtan | 6fda496e16a8d443a86c617173d35f31c392beb6 | [
"MIT"
] | 1 | 2021-10-13T10:16:58.000Z | 2021-10-13T10:16:58.000Z | # Copyright (c) 2020. Sinri Edogawa
from nehushtan.mysql.MySQLKit import MySQLKit
from nehushtan.mysql.MySQLTableMixin import MySQLTableMixin
class MySQLAnyTable(MySQLTableMixin):
def __init__(self, mysql_kit: MySQLKit, table_name: str, schema_name: str = ''):
super().__init__()
self._mysql_kit... | 25.310345 | 84 | 0.666213 |
d2f8ace96e9e1e61eaac9eb1a3345f58ed2863c2 | 71,813 | py | Python | utils/utils.py | chumingqian/Model_Compression_For_YOLOV4 | 3bc803ff6ebb4000bf1f2cafc61c7711fea7a2ab | [
"Apache-2.0"
] | 13 | 2020-12-14T02:22:47.000Z | 2021-08-07T09:58:09.000Z | utils/utils.py | chumingqian/Model_Compression_For_YOLOV4 | 3bc803ff6ebb4000bf1f2cafc61c7711fea7a2ab | [
"Apache-2.0"
] | 2 | 2021-02-02T17:37:40.000Z | 2021-02-10T01:40:11.000Z | utils/utils.py | chumingqian/Model_Compression_For_YOLOV4 | 3bc803ff6ebb4000bf1f2cafc61c7711fea7a2ab | [
"Apache-2.0"
] | 3 | 2020-12-14T02:22:48.000Z | 2021-08-01T19:03:18.000Z | import glob
import math
import os
import random
import shutil
import subprocess
from pathlib import Path
from sys import platform
import cv2
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torchvision
from tqdm import tqdm
import torch.nn.functional as F
... | 40.503666 | 121 | 0.567349 |
a9ba9889d2475624b951348975f9f11cf552ca83 | 360 | py | Python | src/messages/client_test.py | kpbhole/CDN | 725f90c710bf6fd82efe015b387447b6465eacd9 | [
"MIT"
] | 3 | 2019-12-27T11:43:58.000Z | 2020-11-21T10:09:44.000Z | src/messages/client_test.py | kpbhole/CDN | 725f90c710bf6fd82efe015b387447b6465eacd9 | [
"MIT"
] | 1 | 2019-04-19T20:17:59.000Z | 2019-04-19T20:17:59.000Z | src/messages/client_test.py | kpbhole/CDN | 725f90c710bf6fd82efe015b387447b6465eacd9 | [
"MIT"
] | 3 | 2019-05-26T19:23:31.000Z | 2021-04-14T10:07:41.000Z | from dns_request_message import *
import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 12345 # Reserve a port for your service.
s.connect((host, port))
msg = DNSRequestMessage(0, "www.google... | 30 | 66 | 0.655556 |
cf8584a1e999b237eee7288113115bfa72db2f04 | 24,220 | py | Python | python/tvm/hybrid/parser.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 3 | 2020-03-12T10:25:51.000Z | 2020-08-05T05:36:23.000Z | python/tvm/hybrid/parser.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | null | null | null | python/tvm/hybrid/parser.py | jheo4/incubator-tvm | c4c61cb766608fb2f0fd8c9facc480a43afed3f5 | [
"Apache-2.0"
] | 1 | 2018-10-19T18:11:41.000Z | 2018-10-19T18:11:41.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.641452 | 99 | 0.585797 |
faee909e8bc6f41d79d0d83d66a213ccbd748943 | 25,565 | py | Python | pypy/rpython/lltypesystem/test/test_rffi.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/rpython/lltypesystem/test/test_rffi.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/rpython/lltypesystem/test/test_rffi.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null |
import py
import sys
from pypy.rpython.lltypesystem.rffi import *
from pypy.rpython.lltypesystem.rffi import _keeper_for_type # crap
from pypy.rlib.rposix import get_errno, set_errno
from pypy.translator.c.test.test_genc import compile as compile_c
from pypy.rpython.lltypesystem.lltype import Signed, Ptr, Char, malloc... | 31.406634 | 85 | 0.515549 |
61d265a45d2223525939a758eb1d9f77efe62fd6 | 3,599 | py | Python | project/boh/reports.py | j2yemi/dso-demo1 | c489d20494b0cbeb1a4c5d5605216c06c625f39a | [
"Apache-2.0"
] | 109 | 2016-05-23T15:00:27.000Z | 2022-02-16T17:15:53.000Z | project/boh/reports.py | j2yemi/dso-demo1 | c489d20494b0cbeb1a4c5d5605216c06c625f39a | [
"Apache-2.0"
] | 116 | 2021-03-29T16:45:28.000Z | 2022-03-31T22:11:07.000Z | project/boh/reports.py | j2yemi/dso-demo1 | c489d20494b0cbeb1a4c5d5605216c06c625f39a | [
"Apache-2.0"
] | 45 | 2016-05-31T20:16:24.000Z | 2022-03-08T14:05:55.000Z | from django.conf import settings
from django.http import HttpResponse
from django.template import loader, Context
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from . import models
class Report(object):
"""Base class used for generating reports."""
def __init__(se... | 34.605769 | 122 | 0.641011 |
22aee79ebccba1ed26e13c3be55f8233d26c978b | 1,201 | py | Python | server/src/posts/migrations/0013_auto_20180829_1605.py | guptachetan1997/SnapShare | c6883ca21d6f86aad025829a49a5d845893cdd9b | [
"MIT"
] | 13 | 2018-03-23T12:38:59.000Z | 2021-09-28T07:27:05.000Z | server/src/posts/migrations/0013_auto_20180829_1605.py | guptachetan1997/SnapShare | c6883ca21d6f86aad025829a49a5d845893cdd9b | [
"MIT"
] | 17 | 2020-01-28T22:21:54.000Z | 2022-01-13T00:44:01.000Z | server/src/posts/migrations/0013_auto_20180829_1605.py | guptachetan1997/SnapShare | c6883ca21d6f86aad025829a49a5d845893cdd9b | [
"MIT"
] | 6 | 2018-08-29T17:01:31.000Z | 2021-08-13T01:40:21.000Z | # Generated by Django 2.0.1 on 2018-08-29 10:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('posts', '0012_auto_20180328_0915'),
]
operations = [
migrations.CreateModel(
name='PostTagBridg... | 34.314286 | 134 | 0.592007 |
a02c28492b15da6fa3034ff59497b5b25f355cfe | 12,060 | py | Python | elobot.py | samm81/slack-elobot | 01cf66f24d1ab1573888d9ba5275bfb655cbbff8 | [
"MIT"
] | null | null | null | elobot.py | samm81/slack-elobot | 01cf66f24d1ab1573888d9ba5275bfb655cbbff8 | [
"MIT"
] | 10 | 2018-06-27T17:11:23.000Z | 2018-09-06T18:44:28.000Z | elobot.py | samm81/slack-elobot | 01cf66f24d1ab1573888d9ba5275bfb655cbbff8 | [
"MIT"
] | 2 | 2018-06-29T07:47:46.000Z | 2018-08-15T02:43:55.000Z | import time
import json
import re
from slackclient import SlackClient
from tabulate import tabulate
from peewee import *
from datetime import datetime
from dateutil import tz
from itertools import takewhile
from collections import defaultdict
from models import db, Player, Match
HANDLE_RE = '<@([A-z0-9]*)>'
# We all... | 38.653846 | 176 | 0.631758 |
59196f85536f459b595dd295045bfe331a29502b | 372,196 | py | Python | tests/test_constraints.py | jbarberia/PFNET.py | a2f327d84401acc63fd4ce91c99086770ce72a6b | [
"BSD-2-Clause"
] | 3 | 2018-03-21T11:54:38.000Z | 2020-12-29T16:46:14.000Z | tests/test_constraints.py | jbarberia/PFNET.py | a2f327d84401acc63fd4ce91c99086770ce72a6b | [
"BSD-2-Clause"
] | 23 | 2018-03-29T00:42:06.000Z | 2021-01-05T19:15:05.000Z | tests/test_constraints.py | ttinoco/PFNET.py | 3a6845d132ddba6053fc84b1099597d99c0ac5e2 | [
"BSD-2-Clause"
] | 5 | 2018-10-01T19:05:11.000Z | 2020-05-27T06:19:11.000Z | #***************************************************#
# This file is part of PFNET. #
# #
# Copyright (c) 2015, Tomas Tinoco De Rubira. #
# #
# PFNET is released under the BSD 2-clause license... | 43.84967 | 144 | 0.482273 |
36c4569159ee9d9d0f00b3844753d392f8bbe571 | 1,822 | py | Python | python/general-python/agol-helper/community.py | claudeshyaka-esri/developer-support | 016940d74f92a78f362900ab5329aa88c27d0a43 | [
"Apache-2.0"
] | 272 | 2015-02-11T16:26:39.000Z | 2022-03-31T08:47:33.000Z | python/general-python/agol-helper/community.py | claudeshyaka-esri/developer-support | 016940d74f92a78f362900ab5329aa88c27d0a43 | [
"Apache-2.0"
] | 254 | 2015-02-11T01:12:35.000Z | 2021-04-22T22:14:20.000Z | python/general-python/agol-helper/community.py | claudeshyaka-esri/developer-support | 016940d74f92a78f362900ab5329aa88c27d0a43 | [
"Apache-2.0"
] | 211 | 2015-02-10T00:09:07.000Z | 2022-02-24T12:27:40.000Z | from agol import AGOL
class community(AGOL):
"""
Community object that contains operations related to users and groups, \
and inherits properties from the AGOL object.
"""
def groupSearch(self):
"""
The Group Search operation searches for groups in the portal:
http://resour... | 39.608696 | 103 | 0.603183 |
b5e256209acf7db9e6256aa4236d2076146e516b | 1,922 | py | Python | trust-devices.py | slayerizer/intrusion-detection | 8515b1d86eae6bf7fbce444d2ec7bec97e209a3a | [
"MIT"
] | 42 | 2019-03-17T00:57:48.000Z | 2020-06-21T18:27:13.000Z | trust-devices.py | LRA-QC/intrusion-detection | 8515b1d86eae6bf7fbce444d2ec7bec97e209a3a | [
"MIT"
] | 1 | 2019-03-17T15:10:21.000Z | 2019-04-01T18:17:40.000Z | trust-devices.py | LRA-QC/intrusion-detection | 8515b1d86eae6bf7fbce444d2ec7bec97e209a3a | [
"MIT"
] | 4 | 2019-03-17T05:05:07.000Z | 2019-03-19T14:15:59.000Z | #!/usr/bin/python3
"""Device intrusion script
This script will import devices listed in the second argumment into the database specified in the first argument.
The detect.py script will detect devices in your network and generate a list of devices in detects in devices.mac.
You can modify it if needed and import i... | 29.569231 | 115 | 0.613944 |
1dfcdac6efd0866fc0fa85eb1ba67a3fb82acbe3 | 1,900 | py | Python | tests/test_service_customer_groups.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | null | null | null | tests/test_service_customer_groups.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | 1 | 2019-07-15T07:27:06.000Z | 2019-07-15T07:27:06.000Z | tests/test_service_customer_groups.py | jeroenubbink/commercetools-python-sdk | ee27768d6fdde3e12618059891d1d4f75dd61390 | [
"MIT"
] | null | null | null | from commercetools import types
def test_get_by_id(client):
customer_group = client.customer_groups.create(
draft=types.CustomerGroupDraft(group_name="test customer group")
)
assert customer_group.id
customer_group = client.customer_groups.get_by_id(customer_group.id)
assert customer_grou... | 29.230769 | 79 | 0.708947 |
0bea2bdcef55ebbbaebac304e62a16ae84fde0ad | 13,221 | py | Python | gsxws/repairs.py | wgoldm/py-gsxws | 213979f2c3d52c9b4f6a55f6848edc1941db6093 | [
"BSD-2-Clause"
] | null | null | null | gsxws/repairs.py | wgoldm/py-gsxws | 213979f2c3d52c9b4f6a55f6848edc1941db6093 | [
"BSD-2-Clause"
] | null | null | null | gsxws/repairs.py | wgoldm/py-gsxws | 213979f2c3d52c9b4f6a55f6848edc1941db6093 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"gsxws/repairs.py"
import sys
import logging
from core import GsxObject, GsxError, validate
from lookups import Lookup
REPAIR_TYPES = (
('CA', 'Carry-In/Non-Replinished'),
('NE', 'Return Before Replace'),
('NT', 'No Trouble Found'),
('ON', 'Onsite (Indirect/Direct)'),
('RR... | 33.386364 | 100 | 0.635504 |
912b489455f4f7c3389b7e1ad86969de022da6ea | 5,654 | py | Python | dentalapp-backend/dentalapp/restapi/serializers.py | PavelescuVictor/DentalApplicationReact | e35e8f04c39fc52bb49d99ffd573c5ab8cc05316 | [
"MIT"
] | null | null | null | dentalapp-backend/dentalapp/restapi/serializers.py | PavelescuVictor/DentalApplicationReact | e35e8f04c39fc52bb49d99ffd573c5ab8cc05316 | [
"MIT"
] | null | null | null | dentalapp-backend/dentalapp/restapi/serializers.py | PavelescuVictor/DentalApplicationReact | e35e8f04c39fc52bb49d99ffd573c5ab8cc05316 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from rest_framework.validators import UniqueTogetherValidator, UniqueValidator
from .models import Doctor, DoctorDetails, Patient, PatientDetails, Order, OrderType, OrderStatus, OrderTypeEntry, OrderColor
# ModelSerializer is from django rest framework
def validateNumber... | 31.764045 | 214 | 0.591086 |
29c8bfc8356b0582d204b0527dc79a540a9eaf70 | 8,103 | py | Python | run.py | obss/turkish-question-generation | 5440a5e4bc9b89c322ffb502fbce1b60b396f235 | [
"MIT"
] | 18 | 2021-11-18T16:24:37.000Z | 2022-03-08T11:31:32.000Z | run.py | obss/turkish-question-generation | 5440a5e4bc9b89c322ffb502fbce1b60b396f235 | [
"MIT"
] | null | null | null | run.py | obss/turkish-question-generation | 5440a5e4bc9b89c322ffb502fbce1b60b396f235 | [
"MIT"
] | null | null | null | import json
import logging
import os
from typing import Tuple
import torch
import transformers
from transformers import Trainer as HFTrainer
from transformers import set_seed
from transformers.hf_argparser import DataClass
from transformers.optimization import Adafactor, AdamW
from transformers.trainer import Trainer
... | 35.077922 | 124 | 0.664692 |
5a579657e4c6b84dc45ca13d243fbe40b50fad9b | 219 | py | Python | varnish/datadog_checks/varnish/__init__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 4 | 2021-06-21T19:21:49.000Z | 2021-06-23T21:21:55.000Z | varnish/datadog_checks/varnish/__init__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2018-08-15T05:50:17.000Z | 2018-08-15T05:50:17.000Z | varnish/datadog_checks/varnish/__init__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2021-06-21T19:21:51.000Z | 2021-06-21T19:21:51.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from .__about__ import __version__
from .varnish import Varnish
__all__ = [
"__version__",
"Varnish"
]
| 19.909091 | 59 | 0.716895 |
c798916c74cc81165a4b42925e89940f14b3cf1f | 750 | py | Python | setup.py | iWeeti/Lavalink.py | c47149c0f6dcdd11cd57ee10b6f92ef932c027ea | [
"MIT"
] | null | null | null | setup.py | iWeeti/Lavalink.py | c47149c0f6dcdd11cd57ee10b6f92ef932c027ea | [
"MIT"
] | null | null | null | setup.py | iWeeti/Lavalink.py | c47149c0f6dcdd11cd57ee10b6f92ef932c027ea | [
"MIT"
] | null | null | null | import re
from setuptools import setup
version = ''
with open('lavalink/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError('version is not set')
setup(
name='lavalink',
packages=['lavalink'],
ver... | 28.846154 | 122 | 0.676 |
87f9eaa209277c6258dd061de7281be8852ea386 | 6,924 | py | Python | pandas/tests/indexes/interval/test_interval_tree.py | LauraCollard/pandas | b1c3a9031569334cafc4e8d45d35408421f7dea4 | [
"BSD-3-Clause"
] | 4 | 2020-01-22T20:07:06.000Z | 2021-01-23T23:34:28.000Z | pandas/tests/indexes/interval/test_interval_tree.py | LauraCollard/pandas | b1c3a9031569334cafc4e8d45d35408421f7dea4 | [
"BSD-3-Clause"
] | 16 | 2021-03-19T09:44:52.000Z | 2022-03-12T00:22:14.000Z | pandas/tests/indexes/interval/test_interval_tree.py | LauraCollard/pandas | b1c3a9031569334cafc4e8d45d35408421f7dea4 | [
"BSD-3-Clause"
] | 9 | 2020-02-05T10:24:12.000Z | 2020-02-10T13:08:50.000Z | from itertools import permutations
import numpy as np
import pytest
from pandas._libs.interval import IntervalTree
from pandas import compat
import pandas.util.testing as tm
def skipif_32bit(param):
"""
Skip parameters in a parametrize on 32bit systems. Specifically used
here to skip leaf_size paramete... | 34.969697 | 84 | 0.606153 |
c5e6755b58433628106637fb59005cce58d6962c | 16,481 | py | Python | gammapy/datasets/evaluator.py | AtreyeeS/gammapy | a3b47c3da08900a833f0360e0374203e054cadfc | [
"BSD-3-Clause"
] | null | null | null | gammapy/datasets/evaluator.py | AtreyeeS/gammapy | a3b47c3da08900a833f0360e0374203e054cadfc | [
"BSD-3-Clause"
] | 1 | 2017-07-04T15:03:24.000Z | 2017-09-11T08:44:14.000Z | gammapy/datasets/evaluator.py | AtreyeeS/gammapy | a3b47c3da08900a833f0360e0374203e054cadfc | [
"BSD-3-Clause"
] | 1 | 2022-03-05T15:56:38.000Z | 2022-03-05T15:56:38.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import logging
import numpy as np
import astropy.units as u
from astropy.utils import lazyproperty
from astropy.coordinates.angle_utilities import angular_separation
from regions import CircleSkyRegion
from gammapy.maps import Map
from gammapy.modeling.mod... | 33.028056 | 98 | 0.608398 |
e3552593b394d9415acc174ae0293211e8951cd8 | 6,495 | py | Python | src/simple_volume_adjuster.py | jzucker2/RufusRaspberry | ee554ee0608688b85fa864c55921fef705c3aa55 | [
"MIT"
] | 1 | 2021-03-06T02:38:43.000Z | 2021-03-06T02:38:43.000Z | src/simple_volume_adjuster.py | jzucker2/RufusRaspberry | ee554ee0608688b85fa864c55921fef705c3aa55 | [
"MIT"
] | null | null | null | src/simple_volume_adjuster.py | jzucker2/RufusRaspberry | ee554ee0608688b85fa864c55921fef705c3aa55 | [
"MIT"
] | null | null | null | import logging
from functools import reduce
from dataclasses import dataclass
from enum import Enum
from datetime import datetime, timedelta
import threading
from .activities import ActivityName
log = logging.getLogger(__name__)
class RotationDirectionException(Exception): pass
class RotationDirection(Enum):
... | 36.284916 | 209 | 0.692995 |
cdfbec18f65b27b4c5ddf6c9415c5347784cb3c7 | 4,794 | py | Python | osu-ac/loader.py | spook0/osu-anticheat | 23b153c741aef94a97769bee4cc75bfb6942b7b0 | [
"MIT"
] | null | null | null | osu-ac/loader.py | spook0/osu-anticheat | 23b153c741aef94a97769bee4cc75bfb6942b7b0 | [
"MIT"
] | null | null | null | osu-ac/loader.py | spook0/osu-anticheat | 23b153c741aef94a97769bee4cc75bfb6942b7b0 | [
"MIT"
] | null | null | null | import requests
from datetime import datetime
import time
import base64
from config import API_SCORES_ALL, API_SCORES_USER, API_REPLAY
def api(function):
"""
Decorator that checks if we can refresh the time at which we started our requests because
it's been more than RATELIMIT_RESET since the first reque... | 33.760563 | 117 | 0.64685 |
f0a58228cf41a07180d042966851a220d31d434f | 7,480 | py | Python | mmdet/models/roi_heads/bbox_heads/obb/obb_convfc_bbox_head.py | vpeopleonatank/OBBDetection | 86fb098d8d2ff3fc3cc447714d89a44c0939614a | [
"Apache-2.0"
] | 274 | 2021-04-06T15:46:06.000Z | 2022-03-31T02:00:10.000Z | mmdet/models/roi_heads/bbox_heads/obb/obb_convfc_bbox_head.py | LiWentomng/OBBDetection | bf0dda9553fcccd4a08dc6c0d2ab9c9af1efee63 | [
"Apache-2.0"
] | 136 | 2021-07-11T11:26:54.000Z | 2022-03-31T02:45:34.000Z | mmdet/models/roi_heads/bbox_heads/obb/obb_convfc_bbox_head.py | LiWentomng/OBBDetection | bf0dda9553fcccd4a08dc6c0d2ab9c9af1efee63 | [
"Apache-2.0"
] | 84 | 2021-05-29T06:58:14.000Z | 2022-03-31T07:44:10.000Z | import torch.nn as nn
from mmcv.cnn import ConvModule
from mmdet.models.builder import HEADS
from .obbox_head import OBBoxHead
@HEADS.register_module()
class OBBConvFCBBoxHead(OBBoxHead):
r"""More general bbox head, with shared conv and fc layers and two optional
separated branches.
.. code-block:: none... | 36.31068 | 79 | 0.568583 |
1ff2fdf50d3fcdb7047165964c37084706abe336 | 2,282 | py | Python | pygam_paramters_impact_with_pdp.py | mbronis/pyGAM | 23a482af1ccb8e81eeaadee3f5600bfcfa5f920d | [
"MIT"
] | 1 | 2019-11-12T21:13:32.000Z | 2019-11-12T21:13:32.000Z | pygam_paramters_impact_with_pdp.py | mbronis/pyGAM | 23a482af1ccb8e81eeaadee3f5600bfcfa5f920d | [
"MIT"
] | null | null | null | pygam_paramters_impact_with_pdp.py | mbronis/pyGAM | 23a482af1ccb8e81eeaadee3f5600bfcfa5f920d | [
"MIT"
] | null | null | null |
'''
TODO:
0) proper import and naming ot terms
00) usage of 0 variance terms
1) fit gam on continous and categorical data
2) integers as numerical and categorical data
3) gridsearch on lambdas
4) grid search on type of terms
Insights:
-all data required in numerical format (ndarray),
factors need to be transform... | 24.276596 | 95 | 0.64943 |
880e831e3aa051d68ec8d8273c9bc44bca862741 | 3,791 | py | Python | assignment1/q3_sgd.py | HeroKillerEver/cs224n-spring-2017 | 52e82f93ddc7192263930ecd90df999c775d1238 | [
"MIT"
] | 3 | 2018-01-29T04:26:48.000Z | 2021-09-16T12:38:01.000Z | assignment1/q3_sgd.py | HeroKillerEver/cs224n-spring-2017 | 52e82f93ddc7192263930ecd90df999c775d1238 | [
"MIT"
] | null | null | null | assignment1/q3_sgd.py | HeroKillerEver/cs224n-spring-2017 | 52e82f93ddc7192263930ecd90df999c775d1238 | [
"MIT"
] | 3 | 2019-01-04T05:48:57.000Z | 2020-08-03T19:31:15.000Z | #!/usr/bin/env python
# Save parameters every a few SGD iterations as fail-safe
SAVE_PARAMS_EVERY = 5000
import glob
import random
import numpy as np
import os.path as op
import cPickle as pickle
def load_saved_params():
"""
A helper function that loads previously saved parameters and resets
iteration s... | 26.326389 | 75 | 0.600633 |
f8de76d20d2f1d124a495a1b9a7c5c4462c719dd | 19,517 | py | Python | examples/linformer/linformer_src/modules/multihead_linear_attention.py | indra622/FBK-fairseq | 4357af09ef2ad1594f75a5b7bcc02d5b10cad2e5 | [
"MIT"
] | 2 | 2021-09-14T06:42:08.000Z | 2021-11-09T21:15:18.000Z | examples/linformer/linformer_src/modules/multihead_linear_attention.py | indra622/FBK-fairseq | 4357af09ef2ad1594f75a5b7bcc02d5b10cad2e5 | [
"MIT"
] | null | null | null | examples/linformer/linformer_src/modules/multihead_linear_attention.py | indra622/FBK-fairseq | 4357af09ef2ad1594f75a5b7bcc02d5b10cad2e5 | [
"MIT"
] | 3 | 2021-09-06T10:18:39.000Z | 2021-12-29T10:52:51.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
from typing import Dict, Optional, Tuple
import torch
import torch.nn.functional as F
from fairseq import utils
from fairseq.incr... | 39.749491 | 98 | 0.574935 |
5bd3852298e5b6a58c4c363c041983004b7c0170 | 1,478 | bzl | Python | tools/snapshot.bzl | xn3cr0nx/entangled | 92d03837a4e966600729521f9315750d509084bc | [
"Apache-2.0"
] | null | null | null | tools/snapshot.bzl | xn3cr0nx/entangled | 92d03837a4e966600729521f9315750d509084bc | [
"Apache-2.0"
] | null | null | null | tools/snapshot.bzl | xn3cr0nx/entangled | 92d03837a4e966600729521f9315750d509084bc | [
"Apache-2.0"
] | null | null | null | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
SNAPSHOT_REPOSITORY = "https://raw.githubusercontent.com/iotaledger/snapshots/master"
SNAPSHOT_TIMESTAMP_MAINNET = "20181222"
SNAPSHOT_TIMESTAMP_TESTNET = "20180329"
def fetch_snapshot_files():
http_file(
name = "snapshot_conf_mainnet",
... | 44.787879 | 99 | 0.716509 |
7705f7d9c8e06c76e98fd28276f85fe3fe1202e5 | 1,000 | py | Python | inlineplz/parsers/gherkinlint.py | kyleburton/inline-plz | 701b13e17ea0c3849b96c4746d7c0d2672fc78e4 | [
"ISC"
] | null | null | null | inlineplz/parsers/gherkinlint.py | kyleburton/inline-plz | 701b13e17ea0c3849b96c4746d7c0d2672fc78e4 | [
"ISC"
] | null | null | null | inlineplz/parsers/gherkinlint.py | kyleburton/inline-plz | 701b13e17ea0c3849b96c4746d7c0d2672fc78e4 | [
"ISC"
] | null | null | null | from __future__ import absolute_import
from __future__ import unicode_literals
import traceback
import dirtyjson as json
from inlineplz.parsers.base import ParserBase
class GherkinLintParser(ParserBase):
"""Parse json gherkin-lint output."""
def parse(self, lint_data):
messages = set()
try... | 32.258065 | 73 | 0.548 |
4591939016acbf0d7446066692d0cd4efe2705fe | 48 | py | Python | src/genie/libs/parser/iosxe/tests/ShowSdwanVersion/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/iosxe/tests/ShowSdwanVersion/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/iosxe/tests/ShowSdwanVersion/cli/equal/golden_output_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {"version": "10.145.1.0.214"}
| 24 | 47 | 0.666667 |
c0895c5b81fdda7d52c10e680827f50749204b7b | 698 | py | Python | cav_box/kafka/src/server.py | usdot-fhwa-stol/cav-education | 6e3698c6322a8115dac9437a6dbd6cadde891477 | [
"Apache-2.0"
] | null | null | null | cav_box/kafka/src/server.py | usdot-fhwa-stol/cav-education | 6e3698c6322a8115dac9437a6dbd6cadde891477 | [
"Apache-2.0"
] | 2 | 2021-01-29T21:47:23.000Z | 2021-02-09T14:30:02.000Z | cav_box/kafka/src/server.py | usdot-fhwa-stol/cav-education | 6e3698c6322a8115dac9437a6dbd6cadde891477 | [
"Apache-2.0"
] | 5 | 2021-01-19T21:47:22.000Z | 2021-06-07T13:19:08.000Z | import socket
import socketserver
from tcp_handler.handler import TCPHandler
import os
import logging
if __name__ == "__main__":
LOGLEVEL = os.environ.get('LOGLEVEL', 'WARNING').upper()
logging.basicConfig(level=LOGLEVEL)
DSRC_LISTENER_HOST = os.getenv('DSRC_LISTENER_HOST', "0.0.0.0")
DSRC_LISTE... | 31.727273 | 68 | 0.724928 |
a6613cebcb76c92ab1f8105df96557908c9f683f | 4,827 | py | Python | samcli/commands/deploy/guided_config.py | michael-k/aws-sam-cli | a8525fc8157d507c4b102477ded4d221deaed145 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/commands/deploy/guided_config.py | michael-k/aws-sam-cli | a8525fc8157d507c4b102477ded4d221deaed145 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/commands/deploy/guided_config.py | michael-k/aws-sam-cli | a8525fc8157d507c4b102477ded4d221deaed145 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | """
Set of Utilities to deal with reading/writing to configuration file during sam deploy
"""
import click
from samcli.cli.context import get_cmd_names
from samcli.commands.deploy.exceptions import GuidedDeployFailedError
from samcli.lib.config.samconfig import SamConfig, DEFAULT_ENV, DEFAULT_CONFIG_FILE_NAME
class... | 43.881818 | 119 | 0.653201 |
c88dafccb186d433fae0e1bcb3847fa32b38035d | 3,909 | py | Python | consulalerting/utilities.py | jrxFive/consulalerting | 714fb2e7f76267864551dd9f3925bfe0325f62c2 | [
"MIT"
] | 10 | 2015-08-25T21:12:58.000Z | 2021-04-17T06:45:19.000Z | consulalerting/utilities.py | jrxFive/Consul-Alerting | 714fb2e7f76267864551dd9f3925bfe0325f62c2 | [
"MIT"
] | 6 | 2015-11-02T00:56:38.000Z | 2016-04-12T20:13:08.000Z | consulalerting/utilities.py | jrxFive/Consul-Alerting | 714fb2e7f76267864551dd9f3925bfe0325f62c2 | [
"MIT"
] | 5 | 2015-10-28T00:56:49.000Z | 2021-04-17T06:45:22.000Z | import consulate
import hashlib
import requests
import json
import settings
from ConsulHealthStruct import ConsulHealthStruct
def currentState():
try:
current = settings.consul.health.state("any")
settings.logger.debug("CurrentConsulHealth={health}".format(health=current))
return current
... | 24.898089 | 84 | 0.651062 |
4b4c8fab786e0e826b5a76980dc69112b93e7255 | 5,613 | py | Python | DeepEBM/ESM/data.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 12 | 2020-05-23T10:02:12.000Z | 2021-03-25T19:54:00.000Z | DeepEBM/ESM/data.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 6 | 2021-03-19T15:30:28.000Z | 2022-03-12T00:51:16.000Z | DeepEBM/ESM/data.py | taufikxu/FD-ScoreMatching | 9df0789bb98bb798b3de57072f63ee4b2f19947f | [
"MIT"
] | 4 | 2020-11-04T03:52:45.000Z | 2021-12-28T16:07:08.000Z | import torch
import numpy as np
from torchvision import transforms, datasets
import PIL.Image
import torch.nn.functional as F
def inf_train_gen_imagenet(batch_size, flip=True, train=True, infinity=True):
if flip:
transf = transforms.Compose(
[
transforms.CenterCrop(128),
... | 26.601896 | 88 | 0.563157 |
20aeb7ac5c4b8fd70d09fd289d09318856df3c52 | 8,041 | py | Python | genomics/sequence.py | IC-Induja/genomics | 84bba3b54dc8f1f81c611b405070d10fc797ab0b | [
"MIT"
] | null | null | null | genomics/sequence.py | IC-Induja/genomics | 84bba3b54dc8f1f81c611b405070d10fc797ab0b | [
"MIT"
] | null | null | null | genomics/sequence.py | IC-Induja/genomics | 84bba3b54dc8f1f81c611b405070d10fc797ab0b | [
"MIT"
] | null | null | null | """ Contains the base Sequence class, along with its derivatives:
DNASequence, RNASequence, and AminoAcidSequence
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .constants import CODON_TABLE
class Sequence(object):
"""Abstract sequence cl... | 30.69084 | 113 | 0.64395 |
eb4a8865fd178ce8106c423fdcb3358c654ca6b3 | 10,807 | py | Python | salt/renderers/gpg.py | edusperoni/salt | c9bfb00c2a81a9d4734fa7d1aa80e893d5ef790b | [
"Apache-2.0"
] | 1 | 2017-06-26T18:14:56.000Z | 2017-06-26T18:14:56.000Z | salt/renderers/gpg.py | edusperoni/salt | c9bfb00c2a81a9d4734fa7d1aa80e893d5ef790b | [
"Apache-2.0"
] | 1 | 2015-10-05T22:03:10.000Z | 2015-10-05T22:03:10.000Z | salt/renderers/gpg.py | edusperoni/salt | c9bfb00c2a81a9d4734fa7d1aa80e893d5ef790b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
r'''
Renderer that will decrypt GPG ciphers
Any key in the SLS file can be a GPG cipher, and this renderer will decrypt it
before passing it off to Salt. This allows you to safely store secrets in
source control, in such a way that only your Salt master can decrypt them and
distribute them only... | 31.692082 | 210 | 0.67373 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.