hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8cc55b181a31a8b2c6b2743c3ce8e5eeb74dea04 | 8,638 | py | Python | modeflip/api_internal/designer_api.py | lmcgnlzt/modeflip | 415e9441561fe0ba40544b8313d912dd65c93981 | [
"Apache-2.0"
] | null | null | null | modeflip/api_internal/designer_api.py | lmcgnlzt/modeflip | 415e9441561fe0ba40544b8313d912dd65c93981 | [
"Apache-2.0"
] | null | null | null | modeflip/api_internal/designer_api.py | lmcgnlzt/modeflip | 415e9441561fe0ba40544b8313d912dd65c93981 | [
"Apache-2.0"
] | null | null | null | from pyramid.httpexceptions import exception_response
from modeflip.models.designer import Designer, DesignerConfig
from modeflip.models.collection import Collection, CollectionConfig
from modeflip.models.garment import Garment, GarmentConfig
class DesignerAPI(object):
def __init__(self, context, request):
self.c... | 35.113821 | 107 | 0.72702 |
229014ad4c84f2395269b461a39ff0070d47676c | 594 | py | Python | gatkcwlgenerator/tests/test_gatk_classes.py | wtsi-hgi/PY | 36f8d95a2fae310795bdf6f16169363b7450fc68 | [
"MIT"
] | 8 | 2017-10-12T06:36:30.000Z | 2020-06-09T15:32:07.000Z | gatkcwlgenerator/tests/test_gatk_classes.py | wtsi-hgi/PY | 36f8d95a2fae310795bdf6f16169363b7450fc68 | [
"MIT"
] | 17 | 2017-09-08T10:59:12.000Z | 2020-04-08T18:07:05.000Z | gatkcwlgenerator/tests/test_gatk_classes.py | wtsi-hgi/PY | 36f8d95a2fae310795bdf6f16169363b7450fc68 | [
"MIT"
] | 1 | 2017-11-22T04:02:23.000Z | 2017-11-22T04:02:23.000Z | from gatkcwlgenerator.GATK_classes import GATKTool
def test_gatk_tool_override():
gatk_tool = GATKTool(
{
"arguments": [{
"name": "arg1",
"prop": 1
}]
},
[
{
"name": "arg1",
"prop": 2,
... | 22 | 56 | 0.419192 |
f79cb1d3b95e4a85f4f2eae64901a539bce9c5c0 | 38,787 | gyp | Python | src/ui/views/views.gyp | jxjnjjn/chromium | 435c1d02fd1b99001dc9e1e831632c894523580d | [
"Apache-2.0"
] | 9 | 2018-09-21T05:36:12.000Z | 2021-11-15T15:14:36.000Z | ui/views/views.gyp | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ui/views/views.gyp | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 3 | 2018-11-28T14:54:13.000Z | 2020-07-02T07:36:07.000Z | # Copyright (c) 2012 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.
{
'variables': {
'chromium_code': 1,
},
'target_defaults': {
'conditions': [
['use_aura==1', {
'sources/': [ ['exclude', '_win... | 38.026471 | 97 | 0.601387 |
12bf6c55aec444d54dab078e00b251dd901d30ed | 376 | py | Python | Contributions/Clock.py | sattwik21/Hacktoberfest2021-1 | 74c8edd54f9c967c0f301f74dec31526dffa8222 | [
"MIT"
] | 215 | 2021-10-01T08:18:16.000Z | 2022-03-29T04:12:03.000Z | Contributions/Clock.py | sattwik21/Hacktoberfest2021-1 | 74c8edd54f9c967c0f301f74dec31526dffa8222 | [
"MIT"
] | 51 | 2021-10-01T08:16:42.000Z | 2021-10-31T13:51:51.000Z | Contributions/Clock.py | sattwik21/Hacktoberfest2021-1 | 74c8edd54f9c967c0f301f74dec31526dffa8222 | [
"MIT"
] | 807 | 2021-10-01T08:11:45.000Z | 2021-11-21T18:57:09.000Z | from tkinter import *
from tkinter.font import BOLD
from tkinter.ttk import *
from time import strftime
root=Tk()
root.title('clock')
def time():
string=strftime('%H:%M:%S')
label.config(text=string)
label.after(1000,time)
label= Label(root, font=('Comic sans ms',80, BOLD), background="Black",foreground=... | 18.8 | 89 | 0.702128 |
95298c4e8769bff15f1e015f4b0d4033c1fb4cb1 | 413 | py | Python | backend/boards/migrations/0009_task_labels.py | aibek79/Django-React-knboard | 074f4b1388a440290f9ae4a88c71fef749775932 | [
"MIT"
] | 665 | 2020-05-22T16:13:59.000Z | 2022-03-30T01:22:51.000Z | backend/boards/migrations/0009_task_labels.py | aibek79/Django-React-knboard | 074f4b1388a440290f9ae4a88c71fef749775932 | [
"MIT"
] | 70 | 2020-05-02T12:09:43.000Z | 2022-02-27T12:54:48.000Z | backend/boards/migrations/0009_task_labels.py | aibek79/Django-React-knboard | 074f4b1388a440290f9ae4a88c71fef749775932 | [
"MIT"
] | 161 | 2020-05-25T21:10:09.000Z | 2022-03-08T15:39:24.000Z | # Generated by Django 3.0.4 on 2020-05-13 15:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("boards", "0008_auto_20200510_1646"),
]
operations = [
migrations.AddField(
model_name="task",
name="labels",
... | 21.736842 | 82 | 0.605327 |
1d44dc2af792bbc9937790b21a80d10cab294381 | 3,104 | py | Python | pomo.py | konr/pomo | e1c66363cf0388268b9aa87d09f9026099e4c520 | [
"Unlicense"
] | null | null | null | pomo.py | konr/pomo | e1c66363cf0388268b9aa87d09f9026099e4c520 | [
"Unlicense"
] | null | null | null | pomo.py | konr/pomo | e1c66363cf0388268b9aa87d09f9026099e4c520 | [
"Unlicense"
] | null | null | null | import time
import os
import string
import json
from datetime import datetime
import subprocess
from abc import ABCMeta, abstractmethod
import sys
from common import epoch, Config, Configurable
ONE_MINUTE = 60
ONE_HOUR = 60*ONE_MINUTE
class TimerHook(object):
__metaclass__ = ABCMeta
def __init__(self, config... | 25.442623 | 89 | 0.606314 |
87ef39325ae2c3d83d0708795be2d80f730ca1bd | 9,351 | py | Python | parakeet/data/dataset.py | JiaXiao243/Parakeet | 7c4267476ee9211236f5ea848131a3638fd0f555 | [
"Apache-2.0"
] | 1 | 2020-09-11T22:50:37.000Z | 2020-09-11T22:50:37.000Z | parakeet/data/dataset.py | xbsdsongnan/Parakeet | 1db01ccc90d11ec7c75d707db4932f9d4c98fcf6 | [
"Apache-2.0"
] | null | null | null | parakeet/data/dataset.py | xbsdsongnan/Parakeet | 1db01ccc90d11ec7c75d707db4932f9d4c98fcf6 | [
"Apache-2.0"
] | null | null | null | # 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.27758 | 190 | 0.598546 |
1864e89a160b3e5c2832c796685b2c383be120aa | 5,804 | py | Python | tools/android/stubify_manifest_test.py | kjlubick/bazel | 6f0913e6e75477ec297430102a8213333a12967e | [
"Apache-2.0"
] | 1 | 2022-03-22T11:55:06.000Z | 2022-03-22T11:55:06.000Z | tools/android/stubify_manifest_test.py | kjlubick/bazel | 6f0913e6e75477ec297430102a8213333a12967e | [
"Apache-2.0"
] | null | null | null | tools/android/stubify_manifest_test.py | kjlubick/bazel | 6f0913e6e75477ec297430102a8213333a12967e | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 33.356322 | 76 | 0.761199 |
cc0dfc26d631762e630b69ff29737d2b4998a641 | 13,140 | py | Python | pug/nlp/plot.py | hobson/pug-nlp | deb84c27f9f2e32f069037ea787c4bc97109f72e | [
"MIT"
] | 2 | 2015-08-23T02:15:19.000Z | 2017-10-09T02:41:22.000Z | pug/nlp/plot.py | hobson/pug-nlp | deb84c27f9f2e32f069037ea787c4bc97109f72e | [
"MIT"
] | null | null | null | pug/nlp/plot.py | hobson/pug-nlp | deb84c27f9f2e32f069037ea787c4bc97109f72e | [
"MIT"
] | 2 | 2015-04-23T14:45:20.000Z | 2015-05-03T04:23:42.000Z | import seaborn as sb
import pandas
np = pandas.np
import bisect
from matplotlib import pyplot as plt
# from pylab import figure, savefig, imshow, axes, axis, cm, show
#####################################################################################
######## Based on the statistics plotting wrapper from Udaci... | 75.085714 | 4,736 | 0.602283 |
0d361b14e1070c873dd34a2d8d97f42b55f5ee46 | 657 | py | Python | accounts/admin.py | marprezd/api-small-business | 8730816292cc34e6b556755f0e9fc998a6c1e112 | [
"MIT"
] | null | null | null | accounts/admin.py | marprezd/api-small-business | 8730816292cc34e6b556755f0e9fc998a6c1e112 | [
"MIT"
] | 1 | 2021-03-07T23:33:44.000Z | 2021-03-07T23:33:44.000Z | accounts/admin.py | marprezd/api-small-business | 8730816292cc34e6b556755f0e9fc998a6c1e112 | [
"MIT"
] | null | null | null | # # api-small-business/accounts/admin.py
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from .forms import CustomUserCreationForm, CustomUserChangeForm
CustomUser = get_user_model()
class CustomUserAdmin(UserAdmin):
"""This class ex... | 29.863636 | 78 | 0.753425 |
3195e9ca4c0c1d4e24e36aaba6e71a96fef6eed8 | 1,460 | py | Python | src/scripts/themis/cloud/download_logs.py | TritonNetworking/themis_tritonsort | cd1f6dbf93978471de1d0beb4b026625787edd9c | [
"BSD-3-Clause"
] | 11 | 2015-12-14T05:35:17.000Z | 2021-11-08T22:02:32.000Z | src/scripts/themis/cloud/download_logs.py | TritonNetworking/themis_tritonsort | cd1f6dbf93978471de1d0beb4b026625787edd9c | [
"BSD-3-Clause"
] | null | null | null | src/scripts/themis/cloud/download_logs.py | TritonNetworking/themis_tritonsort | cd1f6dbf93978471de1d0beb4b026625787edd9c | [
"BSD-3-Clause"
] | 8 | 2015-12-22T19:31:16.000Z | 2020-12-15T12:09:00.000Z | #!/usr/bin/env python
import sys, os, plumbum
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.abspath(os.path.join(
SCRIPT_DIR, os.pardir, "cluster")))
from conf_utils import read_conf_file
from plumbum.commands.processes import ProcessExecutionError
def download_logs():
clu... | 29.795918 | 78 | 0.594521 |
96d59d4bf36906f3f5224b04f7164c984e5123ad | 4,121 | py | Python | metrics/f1/f1.py | rkc007/datasets | 6b2f6cd7e55323898d3562b99bc9ab7244955aa3 | [
"Apache-2.0"
] | 2 | 2021-01-09T07:41:37.000Z | 2021-01-09T07:41:41.000Z | metrics/f1/f1.py | rkc007/datasets | 6b2f6cd7e55323898d3562b99bc9ab7244955aa3 | [
"Apache-2.0"
] | null | null | null | metrics/f1/f1.py | rkc007/datasets | 6b2f6cd7e55323898d3562b99bc9ab7244955aa3 | [
"Apache-2.0"
] | 1 | 2020-12-09T10:27:25.000Z | 2020-12-09T10:27:25.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 41.626263 | 112 | 0.659306 |
b5fd9f2a46ba8b71e1380419170fd8d3c6f74863 | 53,849 | py | Python | tests/test_validators_jsonschema.py | zanachka/spidermon | d2840b6bbb6ba6d8a0ef633deac66588d243e615 | [
"BSD-3-Clause"
] | 405 | 2019-01-10T13:06:09.000Z | 2022-03-30T20:14:58.000Z | tests/test_validators_jsonschema.py | zanachka/spidermon | d2840b6bbb6ba6d8a0ef633deac66588d243e615 | [
"BSD-3-Clause"
] | 226 | 2019-01-04T13:31:17.000Z | 2022-03-28T21:06:10.000Z | tests/test_validators_jsonschema.py | zanachka/spidermon | d2840b6bbb6ba6d8a0ef633deac66588d243e615 | [
"BSD-3-Clause"
] | 87 | 2019-01-07T10:23:26.000Z | 2022-02-22T04:38:04.000Z | from unittest import TestCase
from spidermon.contrib.validation import JSONSchemaValidator
from spidermon.contrib.validation import messages
from slugify import slugify
class SchemaTestCaseMetaclass(type):
def __new__(mcs, name, bases, attrs):
def _test_function(data_test):
def _function(sel... | 33.076781 | 99 | 0.473788 |
f721429b03aedf2a6362c8a4270184f7d7d464c4 | 4,555 | py | Python | project/ionicv1/main.py | Bhanditz/JavaScriptEnhancements | f87ff0ae9dba99bab69bf4fe4e73ca29d198f81e | [
"MIT"
] | null | null | null | project/ionicv1/main.py | Bhanditz/JavaScriptEnhancements | f87ff0ae9dba99bab69bf4fe4e73ca29d198f81e | [
"MIT"
] | null | null | null | project/ionicv1/main.py | Bhanditz/JavaScriptEnhancements | f87ff0ae9dba99bab69bf4fe4e73ca29d198f81e | [
"MIT"
] | null | null | null | import sublime, sublime_plugin
import os, webbrowser, shlex, json, collections
def ionicv1_ask_custom_path(project_path, type):
sublime.active_window().show_input_panel("Ionic v1 CLI custom path", "ionic", lambda ionicv1_custom_path: ionicv1_prepare_project(project_path, ionicv1_custom_path) if type == "create_new... | 47.947368 | 304 | 0.730626 |
9c50f3508a8c20b97b793a8de860cca77a4b3d05 | 290 | py | Python | code/ch09/9.1.1.two_sum.py | leetcode-pp/leetcode-pp1 | a1f9e46fdd2f480d2fcb94e76370e040e0f0a4f5 | [
"MIT"
] | 22 | 2021-02-23T13:42:28.000Z | 2022-03-02T11:19:28.000Z | code/ch09/9.1.1.two_sum.py | leetcode-pp/leetcode-pp1 | a1f9e46fdd2f480d2fcb94e76370e040e0f0a4f5 | [
"MIT"
] | 9 | 2021-06-16T10:42:01.000Z | 2021-08-24T09:06:29.000Z | code/ch09/9.1.1.two_sum.py | leetcode-pp/leetcode-pp1 | a1f9e46fdd2f480d2fcb94e76370e040e0f0a4f5 | [
"MIT"
] | 9 | 2021-02-20T08:29:00.000Z | 2021-09-18T08:52:25.000Z | class Solution:
def twoSum(self, numbers:List[int], target:int)->List[int]:
for i in range(0, len(numbers), 1):
for j in range(i + 1, len(numbers), 1):
if numbers[i] + numbers[j] == target:
return [i + 1, j + 1]
return [] | 36.25 | 63 | 0.493103 |
2c5f2d8ee35de89bbacabad5420e3a79bee22025 | 1,112 | py | Python | tests/conftest.py | pllim/pytest-filter-subpackage | ec0ca571e0628824dd6e6b00d67f6589f345823d | [
"BSD-3-Clause"
] | 1 | 2019-12-29T12:48:32.000Z | 2019-12-29T12:48:32.000Z | tests/conftest.py | pllim/pytest-filter-subpackage | ec0ca571e0628824dd6e6b00d67f6589f345823d | [
"BSD-3-Clause"
] | 5 | 2020-01-20T13:25:14.000Z | 2021-12-31T06:52:37.000Z | tests/conftest.py | pllim/pytest-filter-subpackage | ec0ca571e0628824dd6e6b00d67f6589f345823d | [
"BSD-3-Clause"
] | 3 | 2020-01-09T14:27:12.000Z | 2021-06-03T14:21:57.000Z | import pytest
TEST_TEMPLATE = """
def test_{sub}_1():
assert True
def test_{sub}_2():
assert '{sub}' == 'a'
"""
DOCS_TEMPLATE = """
Documentation for {sub}
=======================
::
>>> a = 1
>>> b = 2
>>> a + b
3
"""
@pytest.fixture
def testpackage(testdir):
# Fixture to make a test... | 25.860465 | 78 | 0.56205 |
3583182066c9698fda32cf5e5fe106272f07b383 | 2,031 | py | Python | reduction/rule_measures.py | bgulowaty/non-overlapping-rules-ensemble | c5cc6a41db2c4ef5695d4533f0f1d0a2b6212f6d | [
"Apache-2.0"
] | null | null | null | reduction/rule_measures.py | bgulowaty/non-overlapping-rules-ensemble | c5cc6a41db2c4ef5695d4533f0f1d0a2b6212f6d | [
"Apache-2.0"
] | null | null | null | reduction/rule_measures.py | bgulowaty/non-overlapping-rules-ensemble | c5cc6a41db2c4ef5695d4533f0f1d0a2b6212f6d | [
"Apache-2.0"
] | null | null | null | from typing import Set
import numpy as np
from attr import attrs, attrib
from .api import Rule, Statement, Relation
from .classification import to_instance
EPS = np.finfo(float).eps
def covered_by_statements(rule, x):
return {idx for idx, x_single in enumerate(x) if rule.describes(to_instance(x_single))}
def ... | 31.246154 | 115 | 0.665682 |
f092337a20c45dc96fdebea12194c3439ad2e778 | 65 | py | Python | test.py | aws-samples/aws-security-hub-analytic-pipeline | 3e4242c24297725f656ff8a560ff180604443223 | [
"MIT-0"
] | 7 | 2021-06-16T00:55:44.000Z | 2022-02-13T23:00:27.000Z | test.py | aws-samples/aws-security-hub-analytic-pipeline | 3e4242c24297725f656ff8a560ff180604443223 | [
"MIT-0"
] | null | null | null | test.py | aws-samples/aws-security-hub-analytic-pipeline | 3e4242c24297725f656ff8a560ff180604443223 | [
"MIT-0"
] | 2 | 2021-07-11T02:41:38.000Z | 2022-03-29T20:34:23.000Z | from time import sleep
print('Test')
#sleep(0.1)
print('Test')
| 9.285714 | 22 | 0.676923 |
6b3ed35d923335112876c583b5c60d4976ed9059 | 409 | py | Python | backend/mentor_app_32090/wsgi.py | crowdbotics-apps/mentor-app-32090 | 40d64cc5f5e5c2bfedfcc7974d65e96c42178c4d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/mentor_app_32090/wsgi.py | crowdbotics-apps/mentor-app-32090 | 40d64cc5f5e5c2bfedfcc7974d65e96c42178c4d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/mentor_app_32090/wsgi.py | crowdbotics-apps/mentor-app-32090 | 40d64cc5f5e5c2bfedfcc7974d65e96c42178c4d | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for mentor_app_32090 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJA... | 24.058824 | 78 | 0.794621 |
62ac8950dc8d14dde1621abd114cd3e0cd9108c6 | 446 | py | Python | app/core/urls.py | danish21752/audio_apis | 932a74c51e67394b1c3cba0bcd22a636ea11aeb1 | [
"MIT"
] | null | null | null | app/core/urls.py | danish21752/audio_apis | 932a74c51e67394b1c3cba0bcd22a636ea11aeb1 | [
"MIT"
] | null | null | null | app/core/urls.py | danish21752/audio_apis | 932a74c51e67394b1c3cba0bcd22a636ea11aeb1 | [
"MIT"
] | null | null | null | from django.urls import path
from django.urls import include
from rest_framework.routers import DefaultRouter
from core import views
router = DefaultRouter()
router.register(r"song", views.SongViewSet)
router.register(r"podcast", views.PodcastViewSet)
router.register(r"audiobook", views.AudiobookViewSet)
router.regis... | 24.777778 | 63 | 0.782511 |
a4ffd7f0cdf4b5957ee1ae1274372f2b4ff06ee2 | 4,768 | py | Python | pinion/__init__.py | svisser/pinion | 8fabce44921e60fa27e75c9707d38b8a401cad4f | [
"Apache-2.0"
] | null | null | null | pinion/__init__.py | svisser/pinion | 8fabce44921e60fa27e75c9707d38b8a401cad4f | [
"Apache-2.0"
] | null | null | null | pinion/__init__.py | svisser/pinion | 8fabce44921e60fa27e75c9707d38b8a401cad4f | [
"Apache-2.0"
] | null | null | null | import struct
__title__ = 'pinion'
__version__ = '0.0.1'
__author__ = 'Simeon Visser'
__email__ = 'simeonvisser@gmail.com'
__license__ = 'Apache 2.0'
__copyright__ = 'Copyright 2015 Simeon Visser'
from pinion import compat
NULL_BYTE = b'\x00'
MAGIC_CODE_REQ = b'\x00REQ'
MAGIC_CODE_RES = b'\x00RES'
PACKET_TYPE_CAN_D... | 26.197802 | 95 | 0.712039 |
80bff0f03ac4a1afa16d8ed56fbd0fee83301369 | 1,433 | py | Python | tello/tello.py | initialed85/pi-rc-car | 4fa8efb67a6a8fcaab114f751d0cd7cc9bd7196d | [
"MIT"
] | 1 | 2020-03-03T18:03:44.000Z | 2020-03-03T18:03:44.000Z | tello/tello.py | initialed85/pi-rc-car | 4fa8efb67a6a8fcaab114f751d0cd7cc9bd7196d | [
"MIT"
] | null | null | null | tello/tello.py | initialed85/pi-rc-car | 4fa8efb67a6a8fcaab114f751d0cd7cc9bd7196d | [
"MIT"
] | null | null | null | import socket
import time
class Tello(object):
def __init__(self, host='192.168.10.1', port=8889, listen_port=9000):
self.host = host
self.port = port
self.listen_port = listen_port
self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.socket.bind(('', 9000))... | 25.589286 | 73 | 0.505932 |
d0d40cfacace5a8c576ee5ab96600323209e176b | 1,689 | py | Python | ebl/users/infrastructure/auth0.py | ElectronicBabylonianLiterature/dictionary | 5977a57314cf57f94f75cd12520f178b1d6a6555 | [
"MIT"
] | 4 | 2020-04-12T14:24:51.000Z | 2020-10-15T15:48:15.000Z | ebl/users/infrastructure/auth0.py | ElectronicBabylonianLiterature/dictionary | 5977a57314cf57f94f75cd12520f178b1d6a6555 | [
"MIT"
] | 200 | 2019-12-04T09:53:20.000Z | 2022-03-30T20:11:31.000Z | ebl/users/infrastructure/auth0.py | ElectronicBabylonianLiterature/dictionary | 5977a57314cf57f94f75cd12520f178b1d6a6555 | [
"MIT"
] | 1 | 2021-09-06T16:22:39.000Z | 2021-09-06T16:22:39.000Z | import copy
from typing import Any, Callable
import pydash
import requests
from falcon_auth import JWTAuthBackend
from ebl.users.domain.user import User
def fetch_user_profile(issuer: str, authorization: str):
url = f"{issuer}userinfo"
headers = {"Authorization": authorization}
response = requests.get(u... | 29.631579 | 79 | 0.657194 |
4295bbf7885210ae3891379609e98583ff6ccdc9 | 1,028 | py | Python | manage.py | tollbran/weather | 09d428c3c276fd72c2cefdff86e689db96f6057a | [
"MIT"
] | null | null | null | manage.py | tollbran/weather | 09d428c3c276fd72c2cefdff86e689db96f6057a | [
"MIT"
] | null | null | null | manage.py | tollbran/weather | 09d428c3c276fd72c2cefdff86e689db96f6057a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.local')
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 34.266667 | 77 | 0.656615 |
a88e3af9f0e8ca5090adca804ce9d2fa63319ef1 | 40,840 | py | Python | contrib/pyln-testing/pyln/testing/utils.py | bram00767/lightning | ff968e773074061d6f76cb81c6c61a1047ffaef1 | [
"MIT"
] | 1 | 2020-05-07T22:28:20.000Z | 2020-05-07T22:28:20.000Z | contrib/pyln-testing/pyln/testing/utils.py | satoshinakamoto007/lightning | ff968e773074061d6f76cb81c6c61a1047ffaef1 | [
"MIT"
] | 1 | 2020-05-03T00:56:31.000Z | 2020-05-03T00:56:31.000Z | contrib/pyln-testing/pyln/testing/utils.py | satoshinakamoto007/lightning | ff968e773074061d6f76cb81c6c61a1047ffaef1 | [
"MIT"
] | null | null | null | from bitcoin.rpc import RawProxy as BitcoinProxy
from pyln.testing.btcproxy import BitcoinRpcProxy
from collections import OrderedDict
from decimal import Decimal
from ephemeral_port_reserve import reserve
from pyln.client import LightningRpc
import json
import logging
import lzma
import math
import os
import random
i... | 37.127273 | 176 | 0.579946 |
6ef5a2b99b7fec039f74f759eddae26b32e28788 | 13 | py | Python | kanto_bus_navi_parser/__init__.py | sawadyrr5/kanto-bus-navi-parser | 4e6d58bc5f40592048f19b1c842a9a1069e510bf | [
"MIT"
] | 1 | 2018-09-30T13:51:13.000Z | 2018-09-30T13:51:13.000Z | kanto_bus_navi_parser/__init__.py | sawadyrr5/kanto-bus-navi-parser | 4e6d58bc5f40592048f19b1c842a9a1069e510bf | [
"MIT"
] | null | null | null | kanto_bus_navi_parser/__init__.py | sawadyrr5/kanto-bus-navi-parser | 4e6d58bc5f40592048f19b1c842a9a1069e510bf | [
"MIT"
] | null | null | null | import parser | 13 | 13 | 0.923077 |
841fc109691bb01e2a6e877e6ae37093ebf2dea1 | 3,372 | py | Python | reinforcement-learning/deep-rts/tensorforce/simple_tests.py | cair/experiments | d19a9eda0e9e743e401f46eec358f0c815c64a7c | [
"MIT"
] | null | null | null | reinforcement-learning/deep-rts/tensorforce/simple_tests.py | cair/experiments | d19a9eda0e9e743e401f46eec358f0c815c64a7c | [
"MIT"
] | null | null | null | reinforcement-learning/deep-rts/tensorforce/simple_tests.py | cair/experiments | d19a9eda0e9e743e401f46eec358f0c815c64a7c | [
"MIT"
] | null | null | null |
import numpy as np
from tensorforce.agents import DQNAgent
from pyDeepRTS import PyDeepRTS
if __name__ == "__main__":
agent = DQNAgent(
states={
"image": dict(type='float', shape=(672, 672, 3))
},
actions=dict(type='int', num_actions=16),
network=[
dict(ty... | 29.068966 | 96 | 0.432088 |
79f469f90425e6b6a3c46ee2921f563c033845bc | 1,249 | py | Python | Chapter7_CodingGuidelines/Configs/test.py | tomex74/UdemyPythonPro | b4b83483fa2d3337a2860d53ff38e68eb38b3ac4 | [
"MIT"
] | null | null | null | Chapter7_CodingGuidelines/Configs/test.py | tomex74/UdemyPythonPro | b4b83483fa2d3337a2860d53ff38e68eb38b3ac4 | [
"MIT"
] | null | null | null | Chapter7_CodingGuidelines/Configs/test.py | tomex74/UdemyPythonPro | b4b83483fa2d3337a2860d53ff38e68eb38b3ac4 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import Dict
from typing import Iterable
from typing import List
from typing import NewType
from typing import Tuple
from typing import TypeVar
from typing import Union
AllowedContainers = Union[Dict, List]
Name = NewType('Name', str)
UserId_NT = NewType('UserId_NT', st... | 20.145161 | 63 | 0.651721 |
b0ceac03355c7231871e44e25b22f6d6181713e4 | 441 | py | Python | orchestra/contrib/issues/migrations/0002_auto_20150709_1018.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 68 | 2015-02-09T10:28:44.000Z | 2022-03-12T11:08:36.000Z | orchestra/contrib/issues/migrations/0002_auto_20150709_1018.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 17 | 2015-05-01T18:10:03.000Z | 2021-03-19T21:52:55.000Z | orchestra/contrib/issues/migrations/0002_auto_20150709_1018.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 29 | 2015-03-31T04:51:03.000Z | 2022-02-17T02:58:50.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('issues', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='ticket',
name='created... | 22.05 | 97 | 0.621315 |
e5de9e531abafbbad6f9e2c2b42e5f6683e6d41d | 2,046 | py | Python | download_avatars.py | nepomunich/codefor.de | 1847d00891a251a14e246b19e5d9a516645e3619 | [
"MIT"
] | null | null | null | download_avatars.py | nepomunich/codefor.de | 1847d00891a251a14e246b19e5d9a516645e3619 | [
"MIT"
] | null | null | null | download_avatars.py | nepomunich/codefor.de | 1847d00891a251a14e246b19e5d9a516645e3619 | [
"MIT"
] | null | null | null | import glob
import os
import logging
import requests
import yaml
logging.basicConfig(level=logging.DEBUG)
BLACKLIST = ('blog', '_site',)
def get_github(username):
response = requests.get('https://api.github.com/users/' + username)
return response.json()['avatar_url']
avatar_source = [
('github', get_... | 35.275862 | 89 | 0.490225 |
8c82d430d08e07441f3f39f7ef1da507bf9efa19 | 8,472 | py | Python | sdk/python/pulumi_azure_nextgen/datamigration/latest/task.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/datamigration/latest/task.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/datamigration/latest/task.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 61.391304 | 1,487 | 0.720727 |
b510848e1431242f805a47c1225d2d7e06cbc677 | 19,533 | py | Python | Mineshaft Explorer/Mineshaft Explorer.py | Jpiv1212/PersonalProjects | a53c4c4db715b3e9a670df001e273eda31dd06be | [
"MIT"
] | null | null | null | Mineshaft Explorer/Mineshaft Explorer.py | Jpiv1212/PersonalProjects | a53c4c4db715b3e9a670df001e273eda31dd06be | [
"MIT"
] | null | null | null | Mineshaft Explorer/Mineshaft Explorer.py | Jpiv1212/PersonalProjects | a53c4c4db715b3e9a670df001e273eda31dd06be | [
"MIT"
] | null | null | null | from livewires import games, color
from generate4 import *
import pygame,math
screen_width = 620
screen_height = 620
tilesize = 20
games.init(screen_width = screen_width,screen_height = screen_height, fps=50)
shaft123 = games.load_image("hidden\\shaft.png", transparent=False)
tiles = [games.load_image("hidden\\plan... | 41.383475 | 151 | 0.503302 |
5d668c1b8b7b401dd8b569175cceb616186db160 | 2,840 | py | Python | csv_cti/models/cdr.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | csv_cti/models/cdr.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | csv_cti/models/cdr.py | Osmond1689/csv-cti | 84be8241e9ba50f495b23775eb153e4129845474 | [
"MIT"
] | null | null | null | from . import db
from contextlib import contextmanager
'''
csv_address
call_type
crm_uuid
product_code
agent
caller_id_name
caller_id_number
destination_number
old_destination_number
dialplan
context
start_stamp
answer_stamp
end_stamp
bleg_start_stamp
bleg... | 31.555556 | 64 | 0.6 |
ead547c9e705b2dd7fd6b5f1d81827bcb56cc8db | 4,522 | py | Python | examples/model_compress/pruning/mobilenetv2_end2end/pretrain.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | examples/model_compress/pruning/mobilenetv2_end2end/pretrain.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | examples/model_compress/pruning/mobilenetv2_end2end/pretrain.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import argparse
from time import gmtime, strftime
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from tqdm import tqdm
import numpy as np
from utils import *
device = torch.device("cuda" if torch.cuda.is_a... | 36.467742 | 120 | 0.643963 |
75c353ffec785b38924b6577a51f3a811b226cc9 | 1,244 | py | Python | dubhe-visual-server/backend/main.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-01-11T07:14:37.000Z | 2022-01-11T07:14:37.000Z | dubhe-visual-server/backend/main.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-04T07:19:43.000Z | 2022-03-04T07:19:43.000Z | dubhe-visual-server/backend/main.py | Gouzhong1223/Dubhe | 8959a51704410dc38b595a0926646b9928451c9a | [
"Apache-2.0"
] | 1 | 2022-03-20T13:09:14.000Z | 2022-03-20T13:09:14.000Z | # -*- coding: UTF-8 -*-
"""
Copyright 2020 Tianshu AI Platform. 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 req... | 24.392157 | 73 | 0.649518 |
c2bf4b29e28f87e2e767a4be274ea50000ba35c2 | 5,250 | py | Python | ariadne/results_to_graphs.py | gbosetti/ca | 3f37edc4b8f69f61d02b881242522f6fa15e2695 | [
"MIT"
] | null | null | null | ariadne/results_to_graphs.py | gbosetti/ca | 3f37edc4b8f69f61d02b881242522f6fa15e2695 | [
"MIT"
] | 4 | 2021-06-08T22:30:03.000Z | 2022-03-12T00:48:52.000Z | ariadne/results_to_graphs.py | gbosetti/cati | 3f37edc4b8f69f61d02b881242522f6fa15e2695 | [
"MIT"
] | null | null | null | import json
import ast
import plotly.plotly as py
import plotly.graph_objs as go
import plotly.io as pio
import os
import re
import numpy as np
import matplotlib.pyplot as plt
# Functions
def draw_barchart(**kwargs):
data = []
for loop_index in kwargs["values_by_loop"]:
res = []
all_configs_a... | 35 | 131 | 0.549143 |
fae2c6760b29f4a9a02fc1708bac334a6f72b482 | 1,388 | py | Python | Control_Exp1001/demo/thickener_chinese/controllers/backward_test.py | y18810919727/Control_Exp1001 | f9fa0a46d838915de9c5f16c315c6c9eaba07f62 | [
"MIT"
] | 1 | 2019-01-03T01:38:50.000Z | 2019-01-03T01:38:50.000Z | Control_Exp1001/demo/thickener_chinese/controllers/backward_test.py | y18810919727/Control_Exp1001 | f9fa0a46d838915de9c5f16c315c6c9eaba07f62 | [
"MIT"
] | null | null | null | Control_Exp1001/demo/thickener_chinese/controllers/backward_test.py | y18810919727/Control_Exp1001 | f9fa0a46d838915de9c5f16c315c6c9eaba07f62 | [
"MIT"
] | 1 | 2019-09-15T14:33:40.000Z | 2019-09-15T14:33:40.000Z | #!/usr/bin/python
# -*- coding:utf8 -*-
import numpy as np
import math
import os
import json
import torch
from torch.autograd import Function
class LinearFunction(Function):
@staticmethod
def forward(ctx, input, weight, bias=None):
ctx.save_for_backward(input, weight, bias)
output = input.m... | 25.703704 | 70 | 0.670029 |
d71de1ac28a18d45410ded938f931407e81dd8ce | 8,517 | py | Python | scripts/batch_load_fold_change.py | IndianaBiosciences/toxapp | 19a77ee19ea92736741b439fc28bbaf268e5ef41 | [
"Apache-2.0"
] | 1 | 2021-08-18T13:46:33.000Z | 2021-08-18T13:46:33.000Z | scripts/batch_load_fold_change.py | IndianaBiosciences/toxapp | 19a77ee19ea92736741b439fc28bbaf268e5ef41 | [
"Apache-2.0"
] | 20 | 2019-04-30T15:36:48.000Z | 2020-10-13T14:18:07.000Z | scripts/batch_load_fold_change.py | IndianaBiosciences/toxapp | 19a77ee19ea92736741b439fc28bbaf268e5ef41 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Indiana Biosciences Research Institute (IBRI)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.955665 | 142 | 0.698838 |
10c26c73fab1d41a7ee0a12d99ac45d7214edcd3 | 12,497 | py | Python | nightbus/tasks.py | ssssam/night-train | 22f69c71964993bd9332e3a337c0b96bba0ca994 | [
"Apache-2.0"
] | 4 | 2017-05-18T22:19:27.000Z | 2017-06-02T10:46:24.000Z | nightbus/tasks.py | ssssam/night-train | 22f69c71964993bd9332e3a337c0b96bba0ca994 | [
"Apache-2.0"
] | 2 | 2017-05-17T17:36:50.000Z | 2017-06-06T17:27:36.000Z | nightbus/tasks.py | ssssam/nightbus | 22f69c71964993bd9332e3a337c0b96bba0ca994 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Codethink 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 writin... | 36.434402 | 90 | 0.602465 |
6aa8ef9b8207680ed4513e57b1296b4a748b2218 | 3,832 | py | Python | code/python/echomesh/command/ElementCommands.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 30 | 2015-02-18T14:07:00.000Z | 2021-12-11T15:19:01.000Z | code/python/echomesh/command/ElementCommands.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 16 | 2015-01-01T23:17:24.000Z | 2015-04-18T23:49:27.000Z | code/python/echomesh/command/ElementCommands.py | rec/echomesh | be668971a687b141660fd2e5635d2fd598992a01 | [
"MIT"
] | 31 | 2015-03-11T20:04:07.000Z | 2020-11-02T13:56:59.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from echomesh.util import Log
from echomesh.base import Join
from echomesh.command.Registry import registry as command_registry
from echomesh.remote import REGISTRY as remote_registry
LOGGER = Log.logger(__name__)
def _perform(action... | 24.564103 | 82 | 0.685282 |
7e98b3930f0381a9f188554e57cb1965211f235a | 1,630 | py | Python | ebl/transliteration/domain/note_line_transformer.py | ElectronicBabylonianLiterature/dictionary | 5977a57314cf57f94f75cd12520f178b1d6a6555 | [
"MIT"
] | 4 | 2020-04-12T14:24:51.000Z | 2020-10-15T15:48:15.000Z | ebl/transliteration/domain/note_line_transformer.py | ElectronicBabylonianLiterature/dictionary | 5977a57314cf57f94f75cd12520f178b1d6a6555 | [
"MIT"
] | 200 | 2019-12-04T09:53:20.000Z | 2022-03-30T20:11:31.000Z | ebl/transliteration/domain/note_line_transformer.py | ElectronicBabylonianLiterature/dictionary | 5977a57314cf57f94f75cd12520f178b1d6a6555 | [
"MIT"
] | 1 | 2021-09-06T16:22:39.000Z | 2021-09-06T16:22:39.000Z | from typing import Sequence
from lark.lexer import Token
from lark.visitors import Transformer, v_args
from ebl.bibliography.domain.reference import BibliographyId
from ebl.transliteration.domain.language import Language
from ebl.transliteration.domain.markup import (
BibliographyPart,
EmphasisPart,
Langu... | 31.346154 | 83 | 0.729448 |
0ac3fbdcdf33ea21a3bfdb2eb9ad7775c77128e1 | 18,655 | py | Python | timeseria/models/reconstructors.py | sarusso/Timeseria | fdf9990ab68e20f75a64f090a2c43979266dcba9 | [
"Apache-2.0"
] | 8 | 2021-01-02T17:43:13.000Z | 2022-02-22T09:07:22.000Z | timeseria/models/reconstructors.py | sarusso/Timeseria | fdf9990ab68e20f75a64f090a2c43979266dcba9 | [
"Apache-2.0"
] | 20 | 2020-07-15T11:29:41.000Z | 2022-03-29T22:51:52.000Z | timeseria/models/reconstructors.py | sarusso/Timeseria | fdf9990ab68e20f75a64f090a2c43979266dcba9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Data reconstructions models."""
import copy
import statistics
from ..utilities import get_periodicity, get_periodicity_index, set_from_t_and_to_t, item_is_in_range, mean_absolute_percentage_error
from ..time import dt_from_s
from sklearn.metrics import mean_absolute_error, mean_squared_error... | 42.786697 | 186 | 0.562798 |
217c31b01b7d242bad437253c2d557ab9190b6c7 | 2,774 | py | Python | src/robot/parsing/__init__.py | ishandutta2007/robotframework | f8fd5bf91c649506049e5c21766a47365cef8736 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-11-28T09:21:19.000Z | 2019-11-28T09:21:19.000Z | src/robot/parsing/__init__.py | ishandutta2007/robotframework | f8fd5bf91c649506049e5c21766a47365cef8736 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/parsing/__init__.py | ishandutta2007/robotframework | f8fd5bf91c649506049e5c21766a47365cef8736 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | 33.421687 | 85 | 0.7354 |
ab0a633e6b6ce6017cb68ab570fb1302f15e5cef | 7,699 | py | Python | tianshou/policy/modelfree/sac.py | duburcqa/tianshou | 26fb87433de0d2604078ecbc99502efe0a815d5d | [
"MIT"
] | 1 | 2021-12-18T02:31:04.000Z | 2021-12-18T02:31:04.000Z | tianshou/policy/modelfree/sac.py | duburcqa/tianshou | 26fb87433de0d2604078ecbc99502efe0a815d5d | [
"MIT"
] | null | null | null | tianshou/policy/modelfree/sac.py | duburcqa/tianshou | 26fb87433de0d2604078ecbc99502efe0a815d5d | [
"MIT"
] | null | null | null | import torch
import numpy as np
from copy import deepcopy
import torch.nn.functional as F
from typing import Dict, Tuple, Union, Optional
from tianshou.policy import DDPGPolicy
from tianshou.policy.dist import DiagGaussian
from tianshou.data import Batch, to_torch_as, ReplayBuffer
from tianshou.exploration import Base... | 42.071038 | 79 | 0.613586 |
dff50527de08fdd741b7ba9266aabc37ed5bb6c6 | 565 | py | Python | plotly/validators/splom/marker/colorbar/_dtick.py | paulamool/plotly.py | 6121ac1f324e247e4e4b2964d65d7393377777c0 | [
"MIT"
] | 1 | 2020-08-26T03:30:36.000Z | 2020-08-26T03:30:36.000Z | plotly/validators/splom/marker/colorbar/_dtick.py | paulamool/plotly.py | 6121ac1f324e247e4e4b2964d65d7393377777c0 | [
"MIT"
] | 1 | 2020-12-15T16:56:11.000Z | 2020-12-15T16:56:11.000Z | plotly/validators/splom/marker/colorbar/_dtick.py | skeptycal/plotly.py | 2e5bf6e2f7c213295c405ece3e859f4d3f8030d1 | [
"MIT"
] | 1 | 2019-02-14T05:18:20.000Z | 2019-02-14T05:18:20.000Z | import _plotly_utils.basevalidators
class DtickValidator(_plotly_utils.basevalidators.AnyValidator):
def __init__(
self,
plotly_name='dtick',
parent_name='splom.marker.colorbar',
**kwargs
):
super(DtickValidator, self).__init__(
plotly_name=plotly_name,
... | 28.25 | 78 | 0.60354 |
3109268ca48bc23fccc232136ce901db03c74ec6 | 10,186 | py | Python | src/utils/obj_file.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-01-16T20:24:09.000Z | 2022-01-16T20:24:09.000Z | src/utils/obj_file.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | null | null | null | src/utils/obj_file.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-03-16T03:14:37.000Z | 2022-03-16T03:14:37.000Z | import warnings
import numpy as np
from obj_loader import obj_loader
from math import sin, cos
def plot_pc(pcs,color=None,scale_factor=.05,mode='point'):
if color == 'red':
mayalab.points3d(pcs[:,0],pcs[:,1],pcs[:,2],mode=mode,scale_factor=scale_factor,color=(1,0,0))
elif color == 'blue':
mayalab.points3d(... | 42.798319 | 194 | 0.6559 |
195178d018e4a33979bd4f5059e5b9029641c593 | 1,521 | py | Python | src/losses/perceptual_loss.py | tomasmikeska/deep-colorization | 690acd265e7807f718a7a7ce76be04cf503a2bfc | [
"MIT"
] | 7 | 2019-09-26T09:25:15.000Z | 2021-06-24T02:59:35.000Z | src/losses/perceptual_loss.py | tomasmikeska/deep-colorization | 690acd265e7807f718a7a7ce76be04cf503a2bfc | [
"MIT"
] | 2 | 2020-11-09T09:23:50.000Z | 2020-11-09T09:24:03.000Z | src/losses/perceptual_loss.py | tomasmikeska/deep-colorization | 690acd265e7807f718a7a7ce76be04cf503a2bfc | [
"MIT"
] | 3 | 2020-08-16T06:30:31.000Z | 2022-03-17T22:42:08.000Z | '''
Implementation of perceptual loss from paper Perceptual Losses for Real-Time Style Transfer and Super-Resolution
(link: https://arxiv.org/abs/1603.08155)
It measures distance (L2 distance in our case) between output of several layers of VGG16 pretrained model
for ground truth and output images.
'''
import keras.ba... | 35.372093 | 119 | 0.689678 |
eca9b39f020eebaf8ac72d9ba914e74950a8938a | 3,316 | py | Python | eve/tests/methods/delete.py | mindjuice/eve | c7981152a72ad68918dc9462d9e4fd3ee8f9a6a0 | [
"BSD-3-Clause"
] | null | null | null | eve/tests/methods/delete.py | mindjuice/eve | c7981152a72ad68918dc9462d9e4fd3ee8f9a6a0 | [
"BSD-3-Clause"
] | null | null | null | eve/tests/methods/delete.py | mindjuice/eve | c7981152a72ad68918dc9462d9e4fd3ee8f9a6a0 | [
"BSD-3-Clause"
] | 1 | 2021-02-13T17:03:39.000Z | 2021-02-13T17:03:39.000Z | from eve.tests import TestBase
class TestDelete(TestBase):
def test_unknown_resource(self):
url = '%s%s/' % (self.unknown_resource_url, self.item_id)
r, status = self.delete(url)
self.assert404(status)
def test_delete_from_resource_endpoint(self):
r, status = self.delete(self.... | 37.681818 | 77 | 0.639023 |
1532ee9f775d1fea86e4b0e79802e123e661aaf9 | 37,371 | py | Python | strawberryfields/backends/bosonicbackend/bosoniccircuit.py | federico0112/strawberryfields | 07c6f9568a132b71df215bb0b9ae42c8af524948 | [
"Apache-2.0"
] | 1 | 2021-04-10T08:40:09.000Z | 2021-04-10T08:40:09.000Z | strawberryfields/backends/bosonicbackend/bosoniccircuit.py | federico0112/strawberryfields | 07c6f9568a132b71df215bb0b9ae42c8af524948 | [
"Apache-2.0"
] | 21 | 2020-11-19T17:58:52.000Z | 2021-04-15T20:27:53.000Z | strawberryfields/backends/bosonicbackend/bosoniccircuit.py | federico0112/strawberryfields | 07c6f9568a132b71df215bb0b9ae42c8af524948 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Xanadu Quantum Technologies 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
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | 38.606405 | 100 | 0.597602 |
30704e0626f5fefe967b95f6ba0220cb809502bd | 1,515 | py | Python | setup.py | JetNoLi/easymqtt | 755f5fa6ce1bc58e8a32314bc8377c9752c4961e | [
"MIT"
] | null | null | null | setup.py | JetNoLi/easymqtt | 755f5fa6ce1bc58e8a32314bc8377c9752c4961e | [
"MIT"
] | null | null | null | setup.py | JetNoLi/easymqtt | 755f5fa6ce1bc58e8a32314bc8377c9752c4961e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = ['Click>=7.0', ]
setup_requirements = [ ]
test_requirements ... | 28.055556 | 76 | 0.637624 |
9c08a929d3915a37c61d3ee4e610e969e9954b2d | 9,125 | py | Python | Cantera-data-examples/examples/surface_chemistry/sofc.py | vincentrobin/conda | 54ff4acb95721c54996b2b6378498dd439b42b6d | [
"BSD-3-Clause"
] | 1 | 2020-10-09T05:19:16.000Z | 2020-10-09T05:19:16.000Z | Cantera-data-examples/examples/surface_chemistry/sofc.py | vincentrobin/conda | 54ff4acb95721c54996b2b6378498dd439b42b6d | [
"BSD-3-Clause"
] | null | null | null | Cantera-data-examples/examples/surface_chemistry/sofc.py | vincentrobin/conda | 54ff4acb95721c54996b2b6378498dd439b42b6d | [
"BSD-3-Clause"
] | null | null | null | """
A simple model of a solid oxide fuel cell.
Unlike most SOFC models, this model does not use semi-empirical Butler- Volmer
kinetics for the charge transfer reactions, but uses elementary, reversible
reactions obeying mass-action kinetics for all reactions, including charge
transfer. As this script will demonstrate,... | 34.828244 | 79 | 0.675836 |
719658c26d298a1c40d6e906e004e3db958d80f8 | 732 | py | Python | main/models.py | tinyx/yitao.io | 8a3a75016e417b4c158bca0ceae98a589b2adff2 | [
"MIT"
] | null | null | null | main/models.py | tinyx/yitao.io | 8a3a75016e417b4c158bca0ceae98a589b2adff2 | [
"MIT"
] | 12 | 2020-06-05T19:26:11.000Z | 2022-03-11T23:33:24.000Z | main/models.py | tinyx/yitao.io | 8a3a75016e417b4c158bca0ceae98a589b2adff2 | [
"MIT"
] | null | null | null | import uuid
from django.contrib.auth.models import User
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
guid = models.UUIDField(default=uuid.uuid4, editabl... | 30.5 | 79 | 0.763661 |
33e3b1256913bb2f823f383eb9cb1143122b89e8 | 665 | py | Python | samcli/commands/init/init_generator.py | ganeshnj/aws-sam-cli | 4ece956fdd33cf3c69ec3c7eab2cb00aed77c0a0 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/commands/init/init_generator.py | ganeshnj/aws-sam-cli | 4ece956fdd33cf3c69ec3c7eab2cb00aed77c0a0 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/commands/init/init_generator.py | ganeshnj/aws-sam-cli | 4ece956fdd33cf3c69ec3c7eab2cb00aed77c0a0 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | """
Cookiecutter-based generation logic for project templates.
"""
from samcli.commands.exceptions import UserException
from samcli.lib.init import generate_project
from samcli.lib.init.exceptions import GenerateProjectFailedError, ArbitraryProjectDownloadFailed
def do_generate(location, package_type, runtime, depen... | 44.333333 | 120 | 0.813534 |
c6231c452030ceb44f90ead1365cc2ef633bca5f | 31,634 | py | Python | polaris/polaris/models.py | IanMinash/django-polaris | 54bda33c6362002a67a272dafb574d56701eb249 | [
"Apache-2.0"
] | null | null | null | polaris/polaris/models.py | IanMinash/django-polaris | 54bda33c6362002a67a272dafb574d56701eb249 | [
"Apache-2.0"
] | null | null | null | polaris/polaris/models.py | IanMinash/django-polaris | 54bda33c6362002a67a272dafb574d56701eb249 | [
"Apache-2.0"
] | null | null | null | """This module defines the models used by Polaris."""
import datetime
import decimal
import secrets
import uuid
from base64 import urlsafe_b64encode as b64e, urlsafe_b64decode as b64d
from cryptography.fernet import Fernet
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives imp... | 34.459695 | 95 | 0.67772 |
93da28934f74c59eeba925a542cd50afef0c192f | 1,981 | py | Python | src/Shared/DC/Scripts/Script.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | 1 | 2018-11-30T12:39:27.000Z | 2018-11-30T12:39:27.000Z | src/Shared/DC/Scripts/Script.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | null | null | null | src/Shared/DC/Scripts/Script.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | 1 | 2018-11-30T12:39:34.000Z | 2018-11-30T12:39:34.000Z | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 32.47541 | 78 | 0.683493 |
006933f11b14f93bed8064ea04b017db7d8b7ffb | 7,614 | py | Python | ntkprune.py | YiteWang/pytorch_resnet_cifar10 | fed17d2912a3ff1df8ccd94dd5d3bde9042f85c1 | [
"BSD-2-Clause"
] | null | null | null | ntkprune.py | YiteWang/pytorch_resnet_cifar10 | fed17d2912a3ff1df8ccd94dd5d3bde9042f85c1 | [
"BSD-2-Clause"
] | null | null | null | ntkprune.py | YiteWang/pytorch_resnet_cifar10 | fed17d2912a3ff1df8ccd94dd5d3bde9042f85c1 | [
"BSD-2-Clause"
] | null | null | null | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import types
import snip
import utils
# Code obtained by TENAS: https://github.com/VITA-Group/TENAS/blob/main/prune_tenas.py
def get_ntk_n(xloader, networks, recalbn=0, train_mode=False, num_batch=-1, num_classes=10, samples_per_class=1):
... | 40.073684 | 139 | 0.601655 |
cbbed4921238ac1301277f6fac47c1629973bb12 | 149 | py | Python | scrapers/SFT-sefton/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 4 | 2018-10-17T13:30:08.000Z | 2021-06-22T13:29:43.000Z | scrapers/SFT-sefton/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 46 | 2018-10-15T13:47:48.000Z | 2022-03-23T10:26:18.000Z | scrapers/SFT-sefton/councillors.py | DemocracyClub/LGSF | 21c2a049db08575e03db2fb63a8bccc8de0c636b | [
"MIT"
] | 1 | 2018-10-15T13:36:03.000Z | 2018-10-15T13:36:03.000Z | from lgsf.councillors.scrapers import ModGovCouncillorScraper
class Scraper(ModGovCouncillorScraper):
base_url = "http://modgov.sefton.gov.uk"
| 24.833333 | 61 | 0.805369 |
957e2e998000a04c2ca5ba2ef7866c3c739fae5d | 14,867 | py | Python | pysnmp/ERICSSON-ALARM-PC-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/ERICSSON-ALARM-PC-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/ERICSSON-ALARM-PC-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module ERICSSON-ALARM-PC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ERICSSON-ALARM-PC-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:51:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... | 594.68 | 10,926 | 0.754624 |
996bd5b460ae2777e0f6aeba3b17de5073f90cc9 | 1,853 | py | Python | bot/keyboards/game.py | darksidecat/telegram-2048-bot | 2c5efbb8fc7c02e0139502506fa2104a1495d1b8 | [
"MIT"
] | 9 | 2021-09-28T11:47:11.000Z | 2022-03-07T10:08:45.000Z | bot/keyboards/game.py | darksidecat/telegram-2048-bot | 2c5efbb8fc7c02e0139502506fa2104a1495d1b8 | [
"MIT"
] | null | null | null | bot/keyboards/game.py | darksidecat/telegram-2048-bot | 2c5efbb8fc7c02e0139502506fa2104a1495d1b8 | [
"MIT"
] | 2 | 2022-03-06T20:58:53.000Z | 2022-03-31T06:38:13.000Z | from enum import Enum
from uuid import UUID
from aiogram.dispatcher.filters.callback_data import CallbackData
from aiogram.types import InlineKeyboardButton
from aiogram.utils.keyboard import KeyboardBuilder
GAME_SIZES = [4, 5, 6, 7]
class GameAction(str, Enum):
PASS = "PASS"
LEFT = "LEFT"
UP = "UP"
... | 24.706667 | 88 | 0.660011 |
5952385ea9e8a9eae7a7d1def16e527c1ff07c20 | 3,108 | py | Python | contrib/zmq/zmq_sub.py | luascoin/luascoin | 74558007cfd46f9d914e9683dfaac1b0274717a9 | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub.py | luascoin/luascoin | 74558007cfd46f9d914e9683dfaac1b0274717a9 | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub.py | luascoin/luascoin | 74558007cfd46f9d914e9683dfaac1b0274717a9 | [
"MIT"
] | 1 | 2020-02-04T22:41:33.000Z | 2020-02-04T22:41:33.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Luascoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Luascoin should be started with the command line argume... | 36.139535 | 109 | 0.644788 |
364f29343e3f152ef6261f3c51145a0c250b7e8b | 2,800 | py | Python | packages/qt5base/package.py | drbenmorgan/spack-supernemo | 40aefc7925bdb5f63db57b0ef47e27f650fbe6b8 | [
"MIT"
] | null | null | null | packages/qt5base/package.py | drbenmorgan/spack-supernemo | 40aefc7925bdb5f63db57b0ef47e27f650fbe6b8 | [
"MIT"
] | null | null | null | packages/qt5base/package.py | drbenmorgan/spack-supernemo | 40aefc7925bdb5f63db57b0ef47e27f650fbe6b8 | [
"MIT"
] | null | null | null | from spack import *
import sys
class Qt5base(Package):
"""Qt5 Core Libraries
"""
homepage = "http://qt-project.org/"
url = "http://download.qt.io/official_releases/qt/5.10/5.10.1/submodules/qtbase-everywhere-src-5.10.1.tar.xz"
version('5.10.1', sha256='d8660e189caa5da5142d5894d328b61a4d3ee9750b76... | 31.460674 | 115 | 0.578929 |
995f8c7a45fb438f07566fbac55bef79f90cd22b | 413 | py | Python | bubbob/setup.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | 1 | 2021-01-16T22:00:06.000Z | 2021-01-16T22:00:06.000Z | bubbob/setup.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | 2 | 2022-03-18T09:46:12.000Z | 2022-03-25T09:36:42.000Z | bubbob/setup.py | fpiesche/bub-n-bros | 29f6b77a125aa4ac071f470607c268fcd210a6fb | [
"MIT"
] | null | null | null | #! /usr/bin/env python
from distutils.core import setup
from distutils.extension import Extension
setup ( name="statesaver",
version="0.1",
description="object duplicator working on generators and iterators",
author="Armin",
author_email="arigo@tunes.org",
ext_modules=[Extensio... | 29.5 | 76 | 0.615012 |
c98773a95573f6c898087cde8e07366669173130 | 1,910 | py | Python | sigmar/board.py | spladug/sigmar-solver | 55f9bde8f0d4e9babec9f65d29fe0c8edb277d58 | [
"BSD-3-Clause"
] | 1 | 2018-02-19T07:54:09.000Z | 2018-02-19T07:54:09.000Z | sigmar/board.py | spladug/sigmar-solver | 55f9bde8f0d4e9babec9f65d29fe0c8edb277d58 | [
"BSD-3-Clause"
] | 2 | 2019-08-10T22:30:57.000Z | 2021-05-17T21:48:47.000Z | sigmar/board.py | spladug/sigmar-solver | 55f9bde8f0d4e9babec9f65d29fe0c8edb277d58 | [
"BSD-3-Clause"
] | 2 | 2018-01-23T01:31:33.000Z | 2021-05-17T04:55:10.000Z | import enum
import itertools
from sigmar.hex import Hex
class Element(enum.IntEnum):
EMPTY = 0
AIR = 1
FIRE = 2
WATER = 3
EARTH = 4
SALT = 5
MORS = 6
VITAE = 7
LEAD = 8
TIN = 9
IRON = 10
COPPER = 11
SILVER = 12
GOLD = 13
QUICKSILVER = 14
Element.Cardi... | 18.910891 | 78 | 0.526178 |
5c5ff3f32be4ed912f4b37f9732a902d2ef18baa | 94 | py | Python | recipe_app/apps.py | el-Joft/recipe-app | e8cb3abb0f5f671aab502aa196aa31f0237eae1e | [
"MIT"
] | null | null | null | recipe_app/apps.py | el-Joft/recipe-app | e8cb3abb0f5f671aab502aa196aa31f0237eae1e | [
"MIT"
] | 8 | 2020-02-12T00:25:26.000Z | 2022-03-11T23:49:00.000Z | recipe_app/apps.py | el-Joft/recipe-app | e8cb3abb0f5f671aab502aa196aa31f0237eae1e | [
"MIT"
] | 1 | 2018-09-04T08:48:39.000Z | 2018-09-04T08:48:39.000Z | from django.apps import AppConfig
class RecipeAppConfig(AppConfig):
name = 'recipe_app'
| 15.666667 | 33 | 0.765957 |
69b082ffbc521a5c3eabb79bae6c66b9cbccae9a | 181 | py | Python | networkx/algorithms/coloring/__init__.py | FrancescoBonacina/networkx | a73a610e0bbd6e13b183b15ca47b221df5f8e26a | [
"BSD-3-Clause"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | networkx/algorithms/coloring/__init__.py | FrancescoBonacina/networkx | a73a610e0bbd6e13b183b15ca47b221df5f8e26a | [
"BSD-3-Clause"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | networkx/algorithms/coloring/__init__.py | FrancescoBonacina/networkx | a73a610e0bbd6e13b183b15ca47b221df5f8e26a | [
"BSD-3-Clause"
] | 31 | 2019-03-10T09:51:27.000Z | 2022-02-14T23:11:12.000Z | from networkx.algorithms.coloring.greedy_coloring import *
from networkx.algorithms.coloring.equitable_coloring import equitable_color
__all__ = ['greedy_color', 'equitable_color']
| 45.25 | 75 | 0.850829 |
e50eb36b28248673d1ef2ccf28f4f9b6bbd334dd | 1,463 | py | Python | Packs/ShiftManagement/Scripts/GetNumberOfUsersOnCall/GetNumberOfUsersOnCall_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2021-12-06T21:38:24.000Z | 2022-01-13T08:23:36.000Z | Packs/ShiftManagement/Scripts/GetNumberOfUsersOnCall/GetNumberOfUsersOnCall_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 87 | 2022-02-23T12:10:53.000Z | 2022-03-31T11:29:05.000Z | Packs/ShiftManagement/Scripts/GetNumberOfUsersOnCall/GetNumberOfUsersOnCall_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 2 | 2022-01-05T15:27:01.000Z | 2022-02-01T19:27:43.000Z | import demistomock as demisto
from GetNumberOfUsersOnCall import main, DemistoException
import pytest
USERS_ON_CALL = [
{
'Type': 1,
'Contents': [
{
'id': 'user1',
'username': 'user1'
},
{
'id': 'user2',
... | 23.222222 | 99 | 0.568011 |
ea67d508737df9c54b6aafb64255b7c2ae4aff78 | 8,992 | py | Python | vendors/espressif/esp-idf/tools/test_idf_monitor/run_test_idf_monitor.py | Yoimer/AFR_ESP32_FreeRTOS_V202007 | 6758176cbceaf4ad6c2b8236d33e4dc302fe3693 | [
"MIT"
] | 6 | 2018-01-07T15:23:15.000Z | 2020-08-03T05:42:03.000Z | tools/test_idf_monitor/run_test_idf_monitor.py | brunocasu/esp-idf | dfcb844445185f3c095b2b8f655d8f09cb67607c | [
"Apache-2.0"
] | 2 | 2020-01-03T10:29:38.000Z | 2020-04-20T10:39:40.000Z | tools/test_idf_monitor/run_test_idf_monitor.py | brunocasu/esp-idf | dfcb844445185f3c095b2b8f655d8f09cb67607c | [
"Apache-2.0"
] | 6 | 2018-07-28T16:14:42.000Z | 2020-02-13T10:14:44.000Z | #!/usr/bin/env python
#
# Copyright 2018-2019 Espressif Systems (Shanghai) PTE 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
#
# Unles... | 45.64467 | 123 | 0.598754 |
23678a9b92910e568a28387ce142c523d9e392d9 | 456 | py | Python | runAlgo_Take_Opposite_position_over_sharp_price_changes/controller_functionality_historical_data.py | g-make-it/IG_Trading_Algo_Scripts_Python | 931f1d568f8e89fbaac56aa5ec58473bbed606f6 | [
"BSD-3-Clause"
] | 186 | 2021-09-05T10:03:01.000Z | 2022-03-08T05:47:04.000Z | runAlgo_Take_Opposite_position_over_sharp_price_changes/controller_functionality_historical_data.py | g-make-it/IG_Trading_Algo_Scripts_Python | 931f1d568f8e89fbaac56aa5ec58473bbed606f6 | [
"BSD-3-Clause"
] | 1 | 2021-11-19T21:56:55.000Z | 2021-12-29T18:21:29.000Z | runAlgo_Take_Opposite_position_over_sharp_price_changes/controller_functionality_historical_data.py | g-make-it/IG_Trading_Algo_Scripts_Python | 931f1d568f8e89fbaac56aa5ec58473bbed606f6 | [
"BSD-3-Clause"
] | 32 | 2021-09-05T11:46:32.000Z | 2022-03-22T08:23:38.000Z | from predefined_functions.initialisation import Initialisation
from predefined_functions.algo_opposing_position_on_sharp_price_changes_based_on_historical_data import Algo0
class Controller_Functionality:
# def __init__(self):
# intial = Initialisation()
# self.initial = intial.initialise_connectio... | 22.8 | 109 | 0.736842 |
d5e1a6ec5a5b70ebab362683ac785b737fb0792f | 826 | py | Python | azure-cosmosdb-table/samples/config.py | bluca/azure-cosmos-table-python | 25e99050f93b1f76f19bbd2534502955d0247aac | [
"Apache-2.0"
] | 20 | 2018-10-03T04:36:03.000Z | 2021-10-03T09:01:05.000Z | azure-cosmosdb-table/samples/config.py | bluca/azure-cosmos-table-python | 25e99050f93b1f76f19bbd2534502955d0247aac | [
"Apache-2.0"
] | 25 | 2018-12-13T15:31:06.000Z | 2021-12-13T19:29:36.000Z | azure-cosmosdb-table/samples/config.py | bluca/azure-cosmos-table-python | 25e99050f93b1f76f19bbd2534502955d0247aac | [
"Apache-2.0"
] | 16 | 2019-01-19T09:04:26.000Z | 2021-09-10T19:05:35.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.ap... | 41.3 | 76 | 0.617433 |
6971f8c37c4726069802d088f83d241de1a5e18f | 1,348 | py | Python | pygenesys/commodity/resource.py | arfc/pygenesys | 2ac0c1fbe7c2dffd0135cf8c52d2c8b31cc31ab4 | [
"BSD-3-Clause"
] | 1 | 2021-05-27T18:28:48.000Z | 2021-05-27T18:28:48.000Z | pygenesys/commodity/resource.py | arfc/pygenesys | 2ac0c1fbe7c2dffd0135cf8c52d2c8b31cc31ab4 | [
"BSD-3-Clause"
] | 34 | 2021-05-31T18:52:46.000Z | 2022-03-07T17:57:13.000Z | pygenesys/commodity/resource.py | arfc/pygenesys | 2ac0c1fbe7c2dffd0135cf8c52d2c8b31cc31ab4 | [
"BSD-3-Clause"
] | 2 | 2021-05-27T18:30:46.000Z | 2021-06-01T14:09:48.000Z | """
This file contains pre-made commodities.
In practice, any commodity could be an "infinite reservoir" is there is no
technology that "creates" the commodity.
"""
from pygenesys.commodity.commodity import Commodity
electricity = Commodity(comm_name='ELC',
units='GWh',
... | 32.878049 | 76 | 0.557122 |
ca9087b96904fc3579f067e70580e0daad703486 | 2,160 | py | Python | code/20_hyperparameters.py | lcmd-epfl/SPAHM | a89148497f55513ad1e4e451d132fe7d7dff5238 | [
"MIT"
] | 1 | 2022-02-07T07:05:09.000Z | 2022-02-07T07:05:09.000Z | code/20_hyperparameters.py | lcmd-epfl/SPAHM | a89148497f55513ad1e4e451d132fe7d7dff5238 | [
"MIT"
] | null | null | null | code/20_hyperparameters.py | lcmd-epfl/SPAHM | a89148497f55513ad1e4e451d132fe7d7dff5238 | [
"MIT"
] | 2 | 2022-02-07T07:05:09.000Z | 2022-03-11T04:51:48.000Z | #!/usr/bin/env python3
import argparse
import numpy as np
from sklearn.model_selection import train_test_split, KFold
from utils import get_kernel
parser = argparse.ArgumentParser(description='This program finds the optimal hyperparameters.')
parser.add_argument('--x', type=str, dest='repr', required=True... | 38.571429 | 184 | 0.692593 |
ead050ad266825053916f89b3c380edf5f2705fb | 7,083 | py | Python | python_modules/libraries/dagster-aws/dagster_aws_tests/s3_tests/test_s3_file_manager.py | sd2k/dagster | d15542e2be374a0c35f2b1623c1fff98f002c605 | [
"Apache-2.0"
] | 1 | 2021-05-13T08:42:14.000Z | 2021-05-13T08:42:14.000Z | python_modules/libraries/dagster-aws/dagster_aws_tests/s3_tests/test_s3_file_manager.py | sd2k/dagster | d15542e2be374a0c35f2b1623c1fff98f002c605 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-aws/dagster_aws_tests/s3_tests/test_s3_file_manager.py | sd2k/dagster | d15542e2be374a0c35f2b1623c1fff98f002c605 | [
"Apache-2.0"
] | null | null | null | import os
import uuid
import boto3
from dagster_aws.s3 import (
S3FileHandle,
S3FileManager,
s3_file_manager,
s3_plus_default_storage_defs,
)
from moto import mock_s3
from dagster import (
InputDefinition,
Int,
ModeDefinition,
OutputDefinition,
ResourceDefinition,
configured,
... | 29.268595 | 99 | 0.650854 |
30503e7873041f767c86d1ec372548c936be3693 | 6,985 | py | Python | dl_code/pcode/utils/sparsification.py | ZhicongLiang/ChocoSGD | a127f32e0629d32dc6ca4c4f2837c3980fa3f76c | [
"Apache-2.0"
] | 39 | 2019-06-16T15:28:49.000Z | 2022-03-15T09:20:35.000Z | dl_code/pcode/utils/sparsification.py | Distributed-Deep-Learning/ChocoSGD | c7715b368cc9f66674720ea9c823032c8058bdf6 | [
"Apache-2.0"
] | 6 | 2020-04-15T21:02:49.000Z | 2021-05-24T23:24:03.000Z | dl_code/pcode/utils/sparsification.py | Distributed-Deep-Learning/ChocoSGD | c7715b368cc9f66674720ea9c823032c8058bdf6 | [
"Apache-2.0"
] | 18 | 2019-07-24T22:19:10.000Z | 2022-02-09T08:20:10.000Z | # -*- coding: utf-8 -*-
import math
import numpy as np
import torch
import bit2byte
def get_n_bits(tensor):
return 8 * tensor.nelement() * tensor.element_size()
"""define some general compressors, e.g., top_k, random_k, sign"""
class SparsificationCompressor(object):
def get_top_k(self, x, ratio):
... | 35.820513 | 87 | 0.615748 |
3f91233d7f17eb7c62e30dbb336af5efe011884a | 3,665 | py | Python | applications/sentiment_analysis/extraction/evaluate.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/sentiment_analysis/extraction/evaluate.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | applications/sentiment_analysis/extraction/evaluate.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # 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... | 42.616279 | 131 | 0.734516 |
bdb16fafe687312548d8357bd3b8ff9c1565c6ed | 95 | py | Python | lanzador.py | Javifdz12/Recursividad | cae1e53c416a6f2025a63bc1cda49cfd81163615 | [
"Apache-2.0"
] | 1 | 2022-03-27T17:29:27.000Z | 2022-03-27T17:29:27.000Z | lanzador.py | Javifdz12/Recursividad | cae1e53c416a6f2025a63bc1cda49cfd81163615 | [
"Apache-2.0"
] | null | null | null | lanzador.py | Javifdz12/Recursividad | cae1e53c416a6f2025a63bc1cda49cfd81163615 | [
"Apache-2.0"
] | null | null | null | from clases.ejercicio1 import *
from clases.ejercicio2 import *
from clases.ejercicio3 import * | 31.666667 | 31 | 0.821053 |
ecbecc4c7ca11bcc93bcdacb58f471036b7bb463 | 846 | py | Python | analysis_feature_match.py | nishant34/RotSolver | d50def173eed2ebc782d51942303ce5d91031f42 | [
"Apache-2.0"
] | null | null | null | analysis_feature_match.py | nishant34/RotSolver | d50def173eed2ebc782d51942303ce5d91031f42 | [
"Apache-2.0"
] | null | null | null | analysis_feature_match.py | nishant34/RotSolver | d50def173eed2ebc782d51942303ce5d91031f42 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import cv2 as cv
import matplotlib.pyplot as plt
img1 = cv.imread(r'C:\Users\DELL\Desktop/1.jpeg',cv.IMREAD_GRAYSCALE) # queryImage
img2 = cv.imread(r'C:\Users\DELL\Desktop/2.jpeg',cv.IMREAD_GRAYSCALE) # trainImage
# Initiate SIFT detector
sift = cv.xfeatures2d.SIFT_create()
# find th... | 40.285714 | 103 | 0.732861 |
85a6610df0031debbcb1ef1754abf7d1fd50b09c | 1,307 | py | Python | setup.py | Jaimeloeuf/Jevents | 391696fa89433c00c57764a52acdac15d66ac75f | [
"MIT"
] | null | null | null | setup.py | Jaimeloeuf/Jevents | 391696fa89433c00c57764a52acdac15d66ac75f | [
"MIT"
] | 1 | 2020-01-17T13:51:08.000Z | 2020-01-17T13:51:08.000Z | setup.py | Jaimeloeuf/Jevents | 391696fa89433c00c57764a52acdac15d66ac75f | [
"MIT"
] | 1 | 2020-01-17T13:43:49.000Z | 2020-01-17T13:43:49.000Z | from setuptools import setup
# Function to open the README file.
def readme():
with open('README.md') as f:
return f.read()
setup(name='Jevents',
version='1.1.3',
description='Simple to use Utilities package for creating EventEmitters and implementing data observers.',
long_description=read... | 38.441176 | 112 | 0.676358 |
008d6a3528ecd6fe75091d164c7c6e24772e09a9 | 17,768 | py | Python | src/sage/schemes/product_projective/subscheme.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | 3 | 2016-06-19T14:48:31.000Z | 2022-01-28T08:46:01.000Z | src/sage/schemes/product_projective/subscheme.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/product_projective/subscheme.py | rwst/sage | a9d274b9338e6ee24bf35ea8d25875507e51e455 | [
"BSL-1.0"
] | 7 | 2021-11-08T10:01:59.000Z | 2022-03-03T11:25:52.000Z | r"""
Subschemes of products of projective spaces
AUTHORS:
- Ben Hutz (2014): subschemes of Cartesian products of projective space
"""
#*****************************************************************************
# Copyright (C) 2014 Ben Hutz <bn4941@gmail.com>
#
# Distributed under the terms of the GNU General Publ... | 36.559671 | 114 | 0.510412 |
3b3c6c156c5f7abd9f0d0fa99a8e95e69a517aaf | 1,912 | py | Python | mlp-mmdgm/anglepy/data/cifar10.py | jjzhunet9/mmdgm | 9422bdc88b913c09506944d3529f6f955b95687c | [
"MIT"
] | 22 | 2015-11-12T09:49:05.000Z | 2020-04-06T10:44:04.000Z | mlp-mmdgm/anglepy/data/cifar10.py | jjzhunet9/mmdgm | 9422bdc88b913c09506944d3529f6f955b95687c | [
"MIT"
] | null | null | null | mlp-mmdgm/anglepy/data/cifar10.py | jjzhunet9/mmdgm | 9422bdc88b913c09506944d3529f6f955b95687c | [
"MIT"
] | 11 | 2015-10-07T08:07:01.000Z | 2020-07-16T03:12:15.000Z | import numpy as np
import scipy.io
import os
# from http://cs.nyu.edu/~roweis/data.html
path = os.environ['ML_DATA_PATH']+'/cifar10/'
# Load the original images into numpy arrays
def load_numpy():
n_train = 5
train = [unpickle(path+'data_batch_'+str(i+1)) for i in range(n_train)]
train_x = np.concatenate(... | 26.555556 | 95 | 0.608264 |
91a9b49da7b801021657b2f7be041f8bf4e8667f | 22,875 | py | Python | salt/modules/state.py | topochan/salt | 87d1a7327aee0388e2a5ff3555d8113d974ed11f | [
"Apache-2.0"
] | 1 | 2019-06-27T13:03:07.000Z | 2019-06-27T13:03:07.000Z | salt/modules/state.py | topochan/salt | 87d1a7327aee0388e2a5ff3555d8113d974ed11f | [
"Apache-2.0"
] | null | null | null | salt/modules/state.py | topochan/salt | 87d1a7327aee0388e2a5ff3555d8113d974ed11f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Control the state system on the minion
'''
# Import python libs
import os
import json
import copy
import shutil
import time
import logging
import tarfile
import datetime
import tempfile
# Import salt libs
import salt.utils
import salt.state
import salt.payload
from salt._compat import stri... | 28.240741 | 105 | 0.59047 |
8e6a086d84069dfa01be7b21221be66acb682ffe | 203 | py | Python | fabscript/example/execution_sequence/multi_setup.py | syunkitada/fabkit-repo | 126d3507c3d395ca70662eb18d1c12d4588eb3ec | [
"MIT"
] | null | null | null | fabscript/example/execution_sequence/multi_setup.py | syunkitada/fabkit-repo | 126d3507c3d395ca70662eb18d1c12d4588eb3ec | [
"MIT"
] | null | null | null | fabscript/example/execution_sequence/multi_setup.py | syunkitada/fabkit-repo | 126d3507c3d395ca70662eb18d1c12d4588eb3ec | [
"MIT"
] | null | null | null | # coding: utf-8
from fabkit import task
from multi_setup_lib import * # noqa
@task(is_bootstrap=False)
def setup1():
print 'setup 1'
@task(is_bootstrap=False)
def setup3():
print 'setup 3'
| 13.533333 | 37 | 0.694581 |
2cb94a25c69bff8e08c2b355d9b780dcbb1d9897 | 813 | py | Python | Funcionamento_FLP.py | GuilhermeMonteiroPeixoto/LOCK-IN-AMPLIFIER-with-PYTHON | 58453fa5fe11bf695d2ee82cb0a2ebd2623093fe | [
"MIT"
] | 2 | 2021-03-24T20:41:28.000Z | 2021-03-25T18:24:12.000Z | Funcionamento_FLP.py | GuilhermeMonteiroPeixoto/LOCK-IN-AMPLIFIER-with-PYTHON | 58453fa5fe11bf695d2ee82cb0a2ebd2623093fe | [
"MIT"
] | null | null | null | Funcionamento_FLP.py | GuilhermeMonteiroPeixoto/LOCK-IN-AMPLIFIER-with-PYTHON | 58453fa5fe11bf695d2ee82cb0a2ebd2623093fe | [
"MIT"
] | null | null | null | import numpy as np
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import statistics
Vref_f = 150
Vref_A = 1 # recomendavel deixar 1
Vref_w = 2*np.pi*Vref_f
pontos = 20000 # afeta na resulocao da curva
array_seno_ref = np.array([Vref_A*(np.sin(Vref_f*2*np.pi*a/pontos)) for a in ran... | 27.1 | 95 | 0.707257 |
ba053050f997fb5198ff3540f872f2fb1a3ebf03 | 9,774 | py | Python | tests/components/config/test_config_entries.py | sgrzys/AIS-home-assistant | 7bfc4d6d90de75eea06702c36474d91bf38df3bf | [
"Apache-2.0"
] | 2 | 2020-08-29T07:24:56.000Z | 2020-10-27T21:47:35.000Z | tests/components/config/test_config_entries.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 6 | 2021-02-08T20:25:50.000Z | 2022-03-11T23:27:53.000Z | tests/components/config/test_config_entries.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2018-09-14T07:34:09.000Z | 2018-09-29T12:57:10.000Z | """Test config entries API."""
import asyncio
from collections import OrderedDict
from unittest.mock import patch
import pytest
import voluptuous as vol
from homeassistant import config_entries as core_ce
from homeassistant.config_entries import HANDLERS
from homeassistant.data_entry_flow import FlowHandler
from hom... | 29.351351 | 79 | 0.557602 |
dc3c0fafe08db84f1aa1bb69190c7d5ca9da62f6 | 970 | py | Python | addons/io_scene_gltf_ksons/camera.py | Andgonag/gltf-blender-importer | a4c719dc155ff0726bc160057e411fa9f956db9f | [
"MIT"
] | 199 | 2017-03-14T18:41:55.000Z | 2022-02-23T09:43:42.000Z | addons/io_scene_gltf_ksons/camera.py | Andgonag/gltf-blender-importer | a4c719dc155ff0726bc160057e411fa9f956db9f | [
"MIT"
] | 38 | 2017-08-01T15:54:55.000Z | 2019-08-15T07:59:55.000Z | addons/io_scene_gltf_ksons/camera.py | Andgonag/gltf-blender-importer | a4c719dc155ff0726bc160057e411fa9f956db9f | [
"MIT"
] | 33 | 2017-06-27T20:29:16.000Z | 2022-01-19T13:51:07.000Z | import bpy
def create_camera(op, idx):
"""Create a Blender camera for the glTF cameras[idx]."""
data = op.gltf['cameras'][idx]
name = data.get('name', 'cameras[%d]' % idx)
camera = bpy.data.cameras.new(name)
if data['type'] == 'orthographic':
camera.type = 'ORTHO'
p = data['orthog... | 28.529412 | 63 | 0.56701 |
80fc59f735a96a889f8325f0f4928605bcf0f3e0 | 3,778 | py | Python | research/gnn/sgcn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 1 | 2021-11-18T08:17:44.000Z | 2021-11-18T08:17:44.000Z | research/gnn/sgcn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | null | null | null | research/gnn/sgcn/export.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 2 | 2019-09-01T06:17:04.000Z | 2019-10-04T08:39:45.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 44.97619 | 115 | 0.660402 |
d68107fdd13e585adce6fb23e7a0c2ca70cf8619 | 5,682 | py | Python | colour/plotting/characterisation.py | amulyagupta1278/colour | 8aad215d069c6b6f6dfccf78c25b8c5a97822b8c | [
"BSD-3-Clause"
] | 2 | 2020-06-20T03:44:41.000Z | 2020-06-20T14:08:41.000Z | colour/plotting/characterisation.py | enneract/colour | 27470c16f7a5bf388d0f0798884e8b7abdceafa4 | [
"BSD-3-Clause"
] | null | null | null | colour/plotting/characterisation.py | enneract/colour | 27470c16f7a5bf388d0f0798884e8b7abdceafa4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Characterisation Plotting
=========================
Defines the characterisation plotting objects:
- :func:`colour.plotting.plot_single_colour_checker`
- :func:`colour.plotting.plot_multi_colour_checkers`
"""
from __future__ import division
import numpy as np
from colour.models impo... | 29.59375 | 79 | 0.634812 |
49214eabfd52901a250cd2ecf29f35264a72c52f | 21,932 | py | Python | test/unit/agent/collectors/plus/stream_upstream.py | dp92987/nginx-amplify-agent | 1b2eed6eab52a82f35974928d75044451b4bedaf | [
"BSD-2-Clause"
] | 308 | 2015-11-17T13:15:33.000Z | 2022-03-24T12:03:40.000Z | test/unit/agent/collectors/plus/stream_upstream.py | dp92987/nginx-amplify-agent | 1b2eed6eab52a82f35974928d75044451b4bedaf | [
"BSD-2-Clause"
] | 211 | 2015-11-16T15:27:41.000Z | 2022-03-28T16:20:15.000Z | test/unit/agent/collectors/plus/stream_upstream.py | dp92987/nginx-amplify-agent | 1b2eed6eab52a82f35974928d75044451b4bedaf | [
"BSD-2-Clause"
] | 80 | 2015-11-16T18:20:30.000Z | 2022-03-02T12:47:56.000Z | # -*- coding: utf-8 -*-
from hamcrest import *
from test.base import BaseTestCase
from amplify.agent.common.context import context
from amplify.agent.objects.plus.object import NginxStreamUpstreamObject
__author__ = "Mike Belov"
__copyright__ = "Copyright (C) Nginx, Inc. All rights reserved."
__license__ = ""
__main... | 43.343874 | 116 | 0.279819 |
b5065682197fa5e9bccc76f1314bd7da675f961f | 25,382 | py | Python | api/namex/services/name_request/name_request.py | riyazuddinsyed/namex | c100ef4378794f509b738d38276e3b902d26067a | [
"Apache-2.0"
] | null | null | null | api/namex/services/name_request/name_request.py | riyazuddinsyed/namex | c100ef4378794f509b738d38276e3b902d26067a | [
"Apache-2.0"
] | null | null | null | api/namex/services/name_request/name_request.py | riyazuddinsyed/namex | c100ef4378794f509b738d38276e3b902d26067a | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from pytz import timezone
from namex.utils.logging import setup_logging
from namex.utils.api_resource import log_error
from namex.utils.common import convert_to_ascii
from namex.constants import NameState
from namex.models import Request, Name, State, Comment, Applicant
from .abstract_... | 39.049231 | 145 | 0.633953 |
6c94410a16cac87ea16ddc50c4d4b259c4270844 | 13,759 | py | Python | utils.py | medtray/IEEEBigData2020-DSRMM-Table-Retrieval | ff274f0c029c856b584d29ee1590c971cb12b051 | [
"MIT"
] | 2 | 2021-01-11T02:00:40.000Z | 2022-02-16T20:24:00.000Z | utils.py | medtray/IEEEBigData2020-DSRMM-Table-Retrieval | ff274f0c029c856b584d29ee1590c971cb12b051 | [
"MIT"
] | null | null | null | utils.py | medtray/IEEEBigData2020-DSRMM-Table-Retrieval | ff274f0c029c856b584d29ee1590c971cb12b051 | [
"MIT"
] | null | null | null | import numpy as np
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import os
import re
import torch
import pandas as pd
import subprocess
import torch.nn.functional as F
def isEnglish(s):
try:
s.encode(encoding='utf-8').decode('ascii')
except UnicodeDecodeError:
retur... | 29.399573 | 174 | 0.550839 |
894c283c9c78ddb4eec638e36ab7a9ab386f87f1 | 966 | py | Python | setup.py | filipecosta90/redisai-py | 167be1146bc881130f09fe3cd1ca611b543aeb61 | [
"BSD-3-Clause"
] | null | null | null | setup.py | filipecosta90/redisai-py | 167be1146bc881130f09fe3cd1ca611b543aeb61 | [
"BSD-3-Clause"
] | null | null | null | setup.py | filipecosta90/redisai-py | 167be1146bc881130f09fe3cd1ca611b543aeb61 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
with open('README.rst') as f:
long_description = f.read()
setup(
name='redisai',
version='1.0.1',
description='RedisAI Python Client',
long_description=long_description,
long_description_content_type='text/x-rst',
url='http... | 30.1875 | 54 | 0.622153 |
b8d3642044985a57cd0dc141c7f10579c7e6ea11 | 1,209 | py | Python | pyvisdk/do/nas_connection_limit_reached.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/nas_connection_limit_reached.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null | pyvisdk/do/nas_connection_limit_reached.py | Infinidat/pyvisdk | f2f4e5f50da16f659ccc1d84b6a00f397fa997f8 | [
"MIT"
] | null | null | null |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def NasConnectionLimitReached(vim, *args, **kwargs):
'''This fault is thrown when an oper... | 33.583333 | 124 | 0.626137 |
fb6df53757ad9838f586fcc3f61556cad696cdf5 | 11,468 | py | Python | spyder/utils/introspection/old_fallback.py | suokunlong/spyder | 2d5d450fdcef232fb7f38e7fefc27f0e7f704c9a | [
"MIT"
] | 3 | 2019-09-27T21:00:00.000Z | 2021-03-07T23:28:32.000Z | spyder/utils/introspection/old_fallback.py | jastema/spyder | 0ef48ea227c53f57556cd8002087dc404b0108b0 | [
"MIT"
] | 3 | 2020-10-13T21:15:23.000Z | 2020-10-13T21:15:24.000Z | spyder/utils/introspection/old_fallback.py | jastema/spyder | 0ef48ea227c53f57556cd8002087dc404b0108b0 | [
"MIT"
] | 2 | 2021-04-30T01:18:22.000Z | 2021-09-19T06:31:42.000Z | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Introspection utilities used by Spyder
"""
from __future__ import print_function
import imp
import os
import os.path as osp
import re
import time
... | 36.638978 | 84 | 0.516742 |
a17eedfa1b8796307e99d29b9cb7ffbcecd708e7 | 14,426 | py | Python | test/functional/mempool_accept.py | Aldiandr/pigycoin | 5748c29e56b36e10af6994cbf384f0f1967e4c43 | [
"MIT"
] | 3 | 2020-02-26T13:33:55.000Z | 2021-01-31T20:08:33.000Z | test/functional/mempool_accept.py | Aldiandr/pigycoin | 5748c29e56b36e10af6994cbf384f0f1967e4c43 | [
"MIT"
] | 1 | 2020-03-15T03:23:19.000Z | 2020-03-15T03:23:19.000Z | test/functional/mempool_accept.py | pigycoin-project/pigycoin | 7b48eaa19d65b52f6d5bac0b40391bec93f0f62f | [
"MIT"
] | 7 | 2020-02-24T22:28:02.000Z | 2020-04-07T10:00:32.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool acceptance of raw transactions."""
from io import BytesIO
from test_framework.test_framew... | 48.572391 | 154 | 0.644253 |
450d246da7fd3a2cc011ce7e883efaf18444bdfa | 33,107 | py | Python | datasets/indonlu/indonlu.py | PierreColombo/datasets | c22ec7e64edb6596a6ff5894712dea4dc5441de8 | [
"Apache-2.0"
] | 1 | 2021-07-29T06:28:28.000Z | 2021-07-29T06:28:28.000Z | datasets/indonlu/indonlu.py | norabelrose/datasets | b0511c65b32d1103d34cb5ac9ffb50e9cf387843 | [
"Apache-2.0"
] | null | null | null | datasets/indonlu/indonlu.py | norabelrose/datasets | b0511c65b32d1103d34cb5ac9ffb50e9cf387843 | [
"Apache-2.0"
] | 1 | 2021-05-04T16:54:23.000Z | 2021-05-04T16:54:23.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 51.729688 | 201 | 0.595493 |
c45425bcbd5d195a29be2f3fa19e1bd82f66ba5c | 640 | py | Python | pytorch_lightning/utilities/exceptions.py | JackCaster/pytorch-lightning | c94c0a2b1ee6b444ab1ecf58059e922229d44436 | [
"Apache-2.0"
] | 3 | 2021-04-09T21:24:32.000Z | 2021-04-12T13:09:38.000Z | pytorch_lightning/utilities/exceptions.py | JackCaster/pytorch-lightning | c94c0a2b1ee6b444ab1ecf58059e922229d44436 | [
"Apache-2.0"
] | 8 | 2020-10-27T22:39:24.000Z | 2021-01-24T16:41:34.000Z | pytorch_lightning/utilities/exceptions.py | JackCaster/pytorch-lightning | c94c0a2b1ee6b444ab1ecf58059e922229d44436 | [
"Apache-2.0"
] | 1 | 2022-03-21T18:37:54.000Z | 2022-03-21T18:37:54.000Z | # Copyright The PyTorch Lightning team.
#
# 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 i... | 37.647059 | 74 | 0.767188 |
b0a7d9ef2938c58dbc340cafe61acae965aebffc | 16,166 | py | Python | scripts/elf_helper.py | jaruiz/zephyr | 2a103ea67493ebcae5c5d7720f6e1a38a05faff1 | [
"Apache-2.0"
] | 2 | 2018-12-17T21:00:20.000Z | 2019-02-03T09:47:38.000Z | scripts/elf_helper.py | jaruiz/zephyr | 2a103ea67493ebcae5c5d7720f6e1a38a05faff1 | [
"Apache-2.0"
] | 6 | 2019-01-09T08:50:20.000Z | 2019-07-29T09:47:59.000Z | scripts/elf_helper.py | jaruiz/zephyr | 2a103ea67493ebcae5c5d7720f6e1a38a05faff1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2017-2018 Linaro
#
# SPDX-License-Identifier: Apache-2.0
import sys
import os
import struct
from distutils.version import LooseVersion
import elftools
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import SymbolTableSection
if LooseVersion(elftools.__vers... | 29.992579 | 79 | 0.580106 |
13968b9983cdfcfc01d9f2175450138dd821fdea | 538 | py | Python | src/tt_storage/tt_storage/migrations/0007_auto_20211109_0554.py | serhii73/the-tale | ee69b033f57fae5004c14afb51f4a6679b189410 | [
"BSD-3-Clause"
] | null | null | null | src/tt_storage/tt_storage/migrations/0007_auto_20211109_0554.py | serhii73/the-tale | ee69b033f57fae5004c14afb51f4a6679b189410 | [
"BSD-3-Clause"
] | 1 | 2022-01-18T12:04:47.000Z | 2022-01-18T12:04:47.000Z | src/tt_storage/tt_storage/migrations/0007_auto_20211109_0554.py | serhii73/the-tale | ee69b033f57fae5004c14afb51f4a6679b189410 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.1.13 on 2021-11-09 05:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tt_storage', '0006_auto_20211018_0821'),
]
operations = [
migrations.AlterField(
model_name='item',
name='data',
... | 22.416667 | 50 | 0.572491 |
2f7c2fabaf429e46c3d0c1c7f649b4cb147b3e4f | 56 | py | Python | ETL_SQLALCH_sharmila/config.py | RussellMcGrath/project_2_repo | 5909a0b7d2654eba4cbc95ee98df7040431afac9 | [
"MIT"
] | null | null | null | ETL_SQLALCH_sharmila/config.py | RussellMcGrath/project_2_repo | 5909a0b7d2654eba4cbc95ee98df7040431afac9 | [
"MIT"
] | null | null | null | ETL_SQLALCH_sharmila/config.py | RussellMcGrath/project_2_repo | 5909a0b7d2654eba4cbc95ee98df7040431afac9 | [
"MIT"
] | null | null | null | const User_id= "-----------'
const password= '------'
| 18.666667 | 29 | 0.446429 |
9176b2385ffc2930c4757ba8243483a93ec49664 | 1,791 | py | Python | cride/circles/migrations/0005_invitation.py | thmxluis/cride-app | 28b298f53aa937cf197a27a8f34ea826b660a4c7 | [
"MIT"
] | null | null | null | cride/circles/migrations/0005_invitation.py | thmxluis/cride-app | 28b298f53aa937cf197a27a8f34ea826b660a4c7 | [
"MIT"
] | 7 | 2020-06-05T23:41:37.000Z | 2022-03-12T00:02:07.000Z | cride/circles/migrations/0005_invitation.py | thmxluis/cride-app | 28b298f53aa937cf197a27a8f34ea826b660a4c7 | [
"MIT"
] | null | null | null | # Generated by Django 2.1 on 2019-10-29 15:45
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('circles', '0004_auto_20191... | 49.75 | 209 | 0.639308 |
3305a97c3163a46969846b6ed2a2cb90c6e5136d | 7,952 | py | Python | setup.py | dgvncsz0f/sklearn-pmml-model | 7b56eececd971216e27e628189424cebe159e60c | [
"BSD-2-Clause"
] | null | null | null | setup.py | dgvncsz0f/sklearn-pmml-model | 7b56eececd971216e27e628189424cebe159e60c | [
"BSD-2-Clause"
] | null | null | null | setup.py | dgvncsz0f/sklearn-pmml-model | 7b56eececd971216e27e628189424cebe159e60c | [
"BSD-2-Clause"
] | null | null | null | from __future__ import division, print_function, absolute_import
# Choose build type.
build_type="optimized" # "debug"
# Long description for package homepage on PyPI
with open("README.md", "r") as fh:
long_description = fh.read()
#########################################################
# Init
###################... | 38.047847 | 148 | 0.690141 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.