hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f758d533b36ba6fd1da61425e1c03475009fd885 | 2,377 | py | Python | experiment.py | yagmurtumukluu/shopee-challenge | 132bd0353dfe64e00d6c42b7325bfd841d3e6e45 | [
"MIT"
] | null | null | null | experiment.py | yagmurtumukluu/shopee-challenge | 132bd0353dfe64e00d6c42b7325bfd841d3e6e45 | [
"MIT"
] | null | null | null | experiment.py | yagmurtumukluu/shopee-challenge | 132bd0353dfe64e00d6c42b7325bfd841d3e6e45 | [
"MIT"
] | null | null | null | import logging
import pytorch_metric_learning.utils.logging_presets as logging_presets
import sentencepiece as spm
import torch
from pytorch_metric_learning import losses, miners, samplers, trainers, testers
from pytorch_metric_learning.utils.accuracy_calculator import AccuracyCalculator
from config import SPIECE_MOD... | 26.707865 | 80 | 0.772402 | import logging
import pytorch_metric_learning.utils.logging_presets as logging_presets
import sentencepiece as spm
import torch
from pytorch_metric_learning import losses, miners, samplers, trainers, testers
from pytorch_metric_learning.utils.accuracy_calculator import AccuracyCalculator
from config import SPIECE_MOD... | true | true |
f758d7f8c815790bb856640b51b1a704cf603b44 | 2,613 | py | Python | examples/neural_network_inference/tensorflow_converter/Tensorflow_1/linear_mnist_train.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | 2 | 2020-01-07T21:27:38.000Z | 2020-11-21T06:02:50.000Z | examples/neural_network_inference/tensorflow_converter/Tensorflow_1/linear_mnist_train.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | null | null | null | examples/neural_network_inference/tensorflow_converter/Tensorflow_1/linear_mnist_train.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | 1 | 2019-04-02T09:20:23.000Z | 2019-04-02T09:20:23.000Z | from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data # Import MINST data
def linear_model(x):
# x is the image input
# mnist data image of shape 28*28=784
# Set model weights
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf... | 30.034483 | 79 | 0.656334 | from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def linear_model(x):
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
pred = tf.nn.softmax(tf.matmul(x, W) + b)
return pred
def train():
... | true | true |
f758d8268c15dfa3976d3f16037d71b4d530b518 | 1,012 | py | Python | tests/example_tests/test_sync_cmdclass_pyproject.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 423 | 2021-03-22T08:45:12.000Z | 2022-03-31T21:05:53.000Z | tests/example_tests/test_sync_cmdclass_pyproject.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 1 | 2022-02-23T08:53:24.000Z | 2022-03-23T14:11:54.000Z | tests/example_tests/test_sync_cmdclass_pyproject.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 9 | 2021-03-26T14:20:07.000Z | 2022-03-24T13:17:06.000Z | import pathlib
import subprocess
import pytest
from setuptools import sandbox
from pysen.path import change_dir
TARGET_EXAMPLE = "sync_cmdclass_pyproject"
@pytest.mark.examples
def test_cli_run(example_dir: pathlib.Path) -> None:
target = example_dir / TARGET_EXAMPLE
with change_dir(target):
subpro... | 27.351351 | 85 | 0.704545 | import pathlib
import subprocess
import pytest
from setuptools import sandbox
from pysen.path import change_dir
TARGET_EXAMPLE = "sync_cmdclass_pyproject"
@pytest.mark.examples
def test_cli_run(example_dir: pathlib.Path) -> None:
target = example_dir / TARGET_EXAMPLE
with change_dir(target):
subpro... | true | true |
f758d955f03853d5e77d880dc63bd656f7eef532 | 770 | py | Python | tests/AOJ/test_ITP1_6_B.py | nabetama-training/CompetitionProgrammingPractice | 0801173df3992c2e78b02b383f2df9ba792cbf2f | [
"BSD-2-Clause"
] | null | null | null | tests/AOJ/test_ITP1_6_B.py | nabetama-training/CompetitionProgrammingPractice | 0801173df3992c2e78b02b383f2df9ba792cbf2f | [
"BSD-2-Clause"
] | 2 | 2020-07-04T04:19:28.000Z | 2020-07-26T06:16:07.000Z | tests/AOJ/test_ITP1_6_B.py | nabetama-training/CompetitionProgrammingPractice | 0801173df3992c2e78b02b383f2df9ba792cbf2f | [
"BSD-2-Clause"
] | null | null | null | import sys
from io import StringIO
import unittest
from src.AOJ.ITP1_6_B import resolve
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
... | 10.547945 | 59 | 0.590909 | import sys
from io import StringIO
import unittest
from src.AOJ.ITP1_6_B import resolve
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
... | true | true |
f758d9841670a47317358b738069eb38696c094b | 542 | py | Python | env/lib/python3.8/site-packages/plotly/validators/scatter3d/projection/y/_scale.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/scatter3d/projection/y/_scale.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/scatter3d/projection/y/_scale.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 ScaleValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="scale", parent_name="scatter3d.projection.y", **kwargs
):
super(ScaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | 31.882353 | 81 | 0.607011 | import _plotly_utils.basevalidators
class ScaleValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="scale", parent_name="scatter3d.projection.y", **kwargs
):
super(ScaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | true | true |
f758da1d10a8be550af33ea6fb6894442361595a | 4,622 | py | Python | code/train/train.py | mlopstemplates/Ignitedemo | 9a8329d8aaa4c82b0f322b6e677df5b1769050ea | [
"MIT"
] | null | null | null | code/train/train.py | mlopstemplates/Ignitedemo | 9a8329d8aaa4c82b0f322b6e677df5b1769050ea | [
"MIT"
] | null | null | null | code/train/train.py | mlopstemplates/Ignitedemo | 9a8329d8aaa4c82b0f322b6e677df5b1769050ea | [
"MIT"
] | null | null | null | import os
import argparse
import itertools
import numpy as np
import joblib
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.svm import SVC
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score
from sklearn.model_selection import train_test_split
from azureml.c... | 35.553846 | 135 | 0.680225 | import os
import argparse
import itertools
import numpy as np
import joblib
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.svm import SVC
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score
from sklearn.model_selection import train_test_split
from azureml.c... | true | true |
f758dac26c4e057c350fe5e638fabd37c34eef9d | 8,115 | py | Python | contrib/devtools/update-translations.py | Basecoin-BAB/Basecoin-Core | 39facf86b3d34b82256ea27f76c701e905f6b918 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Basecoin-BAB/Basecoin-Core | 39facf86b3d34b82256ea27f76c701e905f6b918 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Basecoin-BAB/Basecoin-Core | 39facf86b3d34b82256ea27f76c701e905f6b918 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the foll... | 38.459716 | 124 | 0.632656 |
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'basecoin_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
def check_at_repository_root():
if not os.path.exists('.git'):
print('No .git directory found')
print('E... | true | true |
f758db469a5ed90b15e393662bea370f14b35040 | 824 | py | Python | server/urls.py | RS-GIS-Geeks/AQI-Background | 4bfe52285b826e38f82c8652230cbbaa6ebd5c62 | [
"Apache-2.0"
] | 1 | 2021-01-05T07:51:50.000Z | 2021-01-05T07:51:50.000Z | server/urls.py | RS-GIS-Geeks/AQI-Background | 4bfe52285b826e38f82c8652230cbbaa6ebd5c62 | [
"Apache-2.0"
] | null | null | null | server/urls.py | RS-GIS-Geeks/AQI-Background | 4bfe52285b826e38f82c8652230cbbaa6ebd5c62 | [
"Apache-2.0"
] | null | null | null | """server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 34.333333 | 77 | 0.711165 | from django.contrib import admin
from django.urls import path, include
from aqiserver import urls
urlpatterns = [
path('admin/', admin.site.urls),
path('', include(urls.urlpatterns))
]
| true | true |
f758dba9c8f6db2d042873a651109bfce1c11d81 | 93,020 | py | Python | pyNastran/bdf/cards/dmig.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/cards/dmig.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/cards/dmig.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | 1 | 2020-10-04T19:28:07.000Z | 2020-10-04T19:28:07.000Z | # pylint: disable=R0902,R0904,R0914
from math import sin, cos, radians, atan2, sqrt, degrees
from itertools import count
from typing import Tuple # , TYPE_CHECKING
import numpy as np
from numpy import array, zeros
from scipy.sparse import coo_matrix # type: ignore
from pyNastran.utils.numpy_utils import integer_type... | 36.636471 | 114 | 0.490239 |
from math import sin, cos, radians, atan2, sqrt, degrees
from itertools import count
from typing import Tuple
import numpy as np
from numpy import array, zeros
from scipy.sparse import coo_matrix
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.bdf.cards.base_card import BaseCard
from pyNastra... | true | true |
f758dc97339a2090f91694aff8ea942072daafa5 | 7,797 | py | Python | datasetIO.py | ktian08/6784-drugs | 7c3ae9f65ce60b031008b0026bb9b954575315fa | [
"MIT"
] | 1 | 2020-06-13T00:40:21.000Z | 2020-06-13T00:40:21.000Z | datasetIO.py | ktian08/6784-drugs | 7c3ae9f65ce60b031008b0026bb9b954575315fa | [
"MIT"
] | null | null | null | datasetIO.py | ktian08/6784-drugs | 7c3ae9f65ce60b031008b0026bb9b954575315fa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Andrew D. Rouillard
Computational Biologist
Target Sciences
GSK
andrew.d.rouillard@gsk.com
"""
import os
import gzip
import pickle
import numpy as np
import dataclasses as dc
def load_datasetinfo(datasetspath):
dataset_info = []
with open(datasetspath, mode='rt', encoding="utf-8", ... | 49.348101 | 160 | 0.582019 |
import os
import gzip
import pickle
import numpy as np
import dataclasses as dc
def load_datasetinfo(datasetspath):
dataset_info = []
with open(datasetspath, mode='rt', encoding="utf-8", errors="surrogateescape") as fr:
fields = [x.strip() for x in fr.readline().split('\t')]
for line in fr:
... | true | true |
f758dccb2a8de614d215bf329caa55cd7184acbc | 1,821 | py | Python | epsagon/runners/celery.py | clericeon/epsagon-python | 387b785708d5b6ac0e8a9f8562c52f56d0825cdf | [
"MIT"
] | null | null | null | epsagon/runners/celery.py | clericeon/epsagon-python | 387b785708d5b6ac0e8a9f8562c52f56d0825cdf | [
"MIT"
] | null | null | null | epsagon/runners/celery.py | clericeon/epsagon-python | 387b785708d5b6ac0e8a9f8562c52f56d0825cdf | [
"MIT"
] | null | null | null | """
Runner for a Celery Python function
"""
from __future__ import absolute_import
import time
from uuid import uuid4
from importlib import import_module
from ..event import BaseEvent
from ..utils import add_data_if_needed
class CeleryRunner(BaseEvent):
"""
Represents Python Celery event runner.
"""
... | 25.291667 | 75 | 0.554091 |
from __future__ import absolute_import
import time
from uuid import uuid4
from importlib import import_module
from ..event import BaseEvent
from ..utils import add_data_if_needed
class CeleryRunner(BaseEvent):
ORIGIN = 'runner'
RESOURCE_TYPE = 'celery'
OPERATION = 'execute'
def __init__(self, *args... | true | true |
f758dcd5da8ddc609d44a07bef8764620a9c1d04 | 1,667 | py | Python | Config/query_configservice.py | kyhau/arki | b5d6b160ef0780032f231362158dd9dd892f4e8e | [
"MIT"
] | 1 | 2020-05-12T13:35:50.000Z | 2020-05-12T13:35:50.000Z | Config/query_configservice.py | kyhau/arki | b5d6b160ef0780032f231362158dd9dd892f4e8e | [
"MIT"
] | 18 | 2018-09-03T09:31:11.000Z | 2020-07-06T09:56:34.000Z | Config/query_configservice.py | kyhau/arki | b5d6b160ef0780032f231362158dd9dd892f4e8e | [
"MIT"
] | null | null | null | import click
import logging
from os.path import basename, exists
from shutil import rmtree
from helper.aws import AwsApiHelper
logging.getLogger().setLevel(logging.DEBUG)
class Helper(AwsApiHelper):
def __init__(self, sql_file):
super().__init__()
self._sql_file = sql_file
with open(sql_f... | 32.057692 | 123 | 0.646671 | import click
import logging
from os.path import basename, exists
from shutil import rmtree
from helper.aws import AwsApiHelper
logging.getLogger().setLevel(logging.DEBUG)
class Helper(AwsApiHelper):
def __init__(self, sql_file):
super().__init__()
self._sql_file = sql_file
with open(sql_f... | true | true |
f758dd0289c2cf6d87801f7fa912bfa16a1ae740 | 823 | py | Python | generate_dmrpp.py | vbjayanti/dmrpp-file-generator-docker | d6b5da3e9a00242c853b20300e510930035cc11e | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | vbjayanti/dmrpp-file-generator-docker | d6b5da3e9a00242c853b20300e510930035cc11e | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | vbjayanti/dmrpp-file-generator-docker | d6b5da3e9a00242c853b20300e510930035cc11e | [
"Apache-2.0"
] | null | null | null | from os import listdir, getenv
from os.path import isfile, join, basename
from dmrpp_generator.main import DMRPPGenerator
from re import match
import logging
import json
logging.getLogger()
if __name__ == "__main__":
payload = getenv('PAYLOAD', '{}')
meta = json.loads(payload)
workstation_path = getenv('MO... | 45.722222 | 135 | 0.668287 | from os import listdir, getenv
from os.path import isfile, join, basename
from dmrpp_generator.main import DMRPPGenerator
from re import match
import logging
import json
logging.getLogger()
if __name__ == "__main__":
payload = getenv('PAYLOAD', '{}')
meta = json.loads(payload)
workstation_path = getenv('MO... | true | true |
f758dd5598e782f396750d94ba466bbe7d504b89 | 1,662 | py | Python | solutions/python/Lesson02-03/Operation.py | 0xLiso/DeepLearningFromScratch | 997e94953b9e5e1ffd8c38af9277e7925e0b4ea7 | [
"CC0-1.0"
] | 2 | 2022-01-10T21:22:10.000Z | 2022-01-10T21:22:14.000Z | solutions/python/Lesson02-03/Operation.py | 0xLiso/DeepLearningFromScratch | 997e94953b9e5e1ffd8c38af9277e7925e0b4ea7 | [
"CC0-1.0"
] | null | null | null | solutions/python/Lesson02-03/Operation.py | 0xLiso/DeepLearningFromScratch | 997e94953b9e5e1ffd8c38af9277e7925e0b4ea7 | [
"CC0-1.0"
] | 1 | 2021-05-09T23:17:17.000Z | 2021-05-09T23:17:17.000Z | import numpy as np
from Tensor import Tensor
class Operation:
result = None
def forward(self):
raise NotImplementedError
def backward(self, gradOutput: Tensor):
raise NotImplementedError
class Negative(Operation):
def __init__(self, A: Tensor,B:Tensor):
self.A = A
def forward(self):
self.result = ... | 16.455446 | 63 | 0.652828 | import numpy as np
from Tensor import Tensor
class Operation:
result = None
def forward(self):
raise NotImplementedError
def backward(self, gradOutput: Tensor):
raise NotImplementedError
class Negative(Operation):
def __init__(self, A: Tensor,B:Tensor):
self.A = A
def forward(self):
self.result = ... | true | true |
f758de11235ecd17f99ee62e8dff7e421c650588 | 306 | py | Python | contests/pythonist_3/capitalize.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2017-07-02T01:35:39.000Z | 2017-07-02T01:35:39.000Z | contests/pythonist_3/capitalize.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | null | null | null | contests/pythonist_3/capitalize.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2018-04-03T15:11:56.000Z | 2018-04-03T15:11:56.000Z | """
Capitalize!
:author: Dela Anthonio
:hackerrank: https://hackerrank.com/delaanthonio
:problem: https://www.hackerrank.com/contests/pythonist3/challenges/capitalize
"""
def solve(s: str):
words = [word.capitalize() for word in s.split(' ')]
return " ".join(words)
print(solve('hi jake hj ')) | 23.538462 | 78 | 0.696078 |
def solve(s: str):
words = [word.capitalize() for word in s.split(' ')]
return " ".join(words)
print(solve('hi jake hj ')) | true | true |
f758df81a85fa66a2064e994b7e4086003f54fd7 | 1,992 | py | Python | source/data_model/python/test/lue_test/test_case.py | OliverSchmitz/lue | da097e8c1de30724bfe7667cc04344b6535b40cd | [
"MIT"
] | null | null | null | source/data_model/python/test/lue_test/test_case.py | OliverSchmitz/lue | da097e8c1de30724bfe7667cc04344b6535b40cd | [
"MIT"
] | null | null | null | source/data_model/python/test/lue_test/test_case.py | OliverSchmitz/lue | da097e8c1de30724bfe7667cc04344b6535b40cd | [
"MIT"
] | null | null | null | import os
import shlex
import subprocess
import unittest
import numpy
import lue
import lue_test
class TestCase(unittest.TestCase):
@classmethod
def dataset_name(self,
module_name,
filename):
return "{}.lue".format(
os.path.join(os.path.dirname(module_name), filena... | 24.9 | 76 | 0.596386 | import os
import shlex
import subprocess
import unittest
import numpy
import lue
import lue_test
class TestCase(unittest.TestCase):
@classmethod
def dataset_name(self,
module_name,
filename):
return "{}.lue".format(
os.path.join(os.path.dirname(module_name), filena... | true | true |
f758df94c02195bdc2147a24a0e97c331597592a | 4,984 | py | Python | tests/test_numerical_predictor.py | xrael/orbit-predictor | 9ff616122be0b33e43144bd32a055e1f676801dd | [
"MIT"
] | null | null | null | tests/test_numerical_predictor.py | xrael/orbit-predictor | 9ff616122be0b33e43144bd32a055e1f676801dd | [
"MIT"
] | null | null | null | tests/test_numerical_predictor.py | xrael/orbit-predictor | 9ff616122be0b33e43144bd32a055e1f676801dd | [
"MIT"
] | null | null | null | import datetime as dt
from unittest import TestCase
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pytest
from orbit_predictor.locations import ARG
from orbit_predictor.predictors.numerical import (
J2Predictor, InvalidOrbitError, R_E_KM, is_sun_synchronous
)
class J2Pr... | 36.379562 | 99 | 0.700241 | import datetime as dt
from unittest import TestCase
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pytest
from orbit_predictor.locations import ARG
from orbit_predictor.predictors.numerical import (
J2Predictor, InvalidOrbitError, R_E_KM, is_sun_synchronous
)
class J2Pr... | true | true |
f758dfa79e70a70ba5acb97cc450854e241efcef | 447 | py | Python | setup.py | azizmb/pushwhendone | b2ab4e64ca88c200e470a87cdb668f7871d06ec3 | [
"Apache-2.0"
] | null | null | null | setup.py | azizmb/pushwhendone | b2ab4e64ca88c200e470a87cdb668f7871d06ec3 | [
"Apache-2.0"
] | null | null | null | setup.py | azizmb/pushwhendone | b2ab4e64ca88c200e470a87cdb668f7871d06ec3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(
name='notify-when-done',
version='1.0',
description='Send push notifications to monitor long running jobs',
author='Aziz M. Bookwala',
author_email='aziz.mansur@gmail.com',
url='https://github.com/azizmb/pushwhendone',
py_module... | 23.526316 | 71 | 0.646532 |
from distutils.core import setup
setup(
name='notify-when-done',
version='1.0',
description='Send push notifications to monitor long running jobs',
author='Aziz M. Bookwala',
author_email='aziz.mansur@gmail.com',
url='https://github.com/azizmb/pushwhendone',
py_modules=['notify_when_done'... | true | true |
f758dfb0d9a4ed9ee3de22519a3abc3113e8b448 | 324 | py | Python | tests/types/test_any_of.py | manoadamro/flapi-schema | 840cfe4bd0ff1e057c3ace9931bd35d8fdaf7808 | [
"MIT"
] | null | null | null | tests/types/test_any_of.py | manoadamro/flapi-schema | 840cfe4bd0ff1e057c3ace9931bd35d8fdaf7808 | [
"MIT"
] | null | null | null | tests/types/test_any_of.py | manoadamro/flapi-schema | 840cfe4bd0ff1e057c3ace9931bd35d8fdaf7808 | [
"MIT"
] | null | null | null | import unittest
from flapi_schema.types import AnyOf
class AnyOfTest(unittest.TestCase):
def test_any_of(self):
rule = AnyOf(lambda _: True, lambda _: False)
self.assertTrue(rule({}))
def test_fails(self):
rule = AnyOf(lambda _: False, lambda _: False)
self.assertFalse(rule({... | 23.142857 | 54 | 0.657407 | import unittest
from flapi_schema.types import AnyOf
class AnyOfTest(unittest.TestCase):
def test_any_of(self):
rule = AnyOf(lambda _: True, lambda _: False)
self.assertTrue(rule({}))
def test_fails(self):
rule = AnyOf(lambda _: False, lambda _: False)
self.assertFalse(rule({... | true | true |
f758e1d0a4e4db9df617b04c187ac800e35e44fb | 7,158 | py | Python | api/typechecker.py | nixiaocang/work | 1fdab83c8749e36da8c17c0d6c20f67212c35ce5 | [
"MIT"
] | null | null | null | api/typechecker.py | nixiaocang/work | 1fdab83c8749e36da8c17c0d6c20f67212c35ce5 | [
"MIT"
] | 2 | 2021-02-08T20:22:38.000Z | 2021-04-30T20:39:07.000Z | api/typechecker.py | nixiaocang/work | 1fdab83c8749e36da8c17c0d6c20f67212c35ce5 | [
"MIT"
] | null | null | null | from api.exceptions import DatasourceBadParameterTypeError
import os
import six
import importlib
class TypeChecker:
primitive_types = set(["unsigned int", "int", "bool", "string", "Object",
"datetime", "float"])
def __init__(self, type_check_info, type_check_enum):
self._type_check_info = typ... | 38.691892 | 106 | 0.59905 | from api.exceptions import DatasourceBadParameterTypeError
import os
import six
import importlib
class TypeChecker:
primitive_types = set(["unsigned int", "int", "bool", "string", "Object",
"datetime", "float"])
def __init__(self, type_check_info, type_check_enum):
self._type_check_info = typ... | true | true |
f758e3dc9f845783e23ea5d9d50b2e8955adec2a | 1,891 | py | Python | cards/models.py | i-DAT-Qualia/Card-Backend | ad11c4bdecc20f7f8c386c8f3f452cbfd9c9aa73 | [
"Apache-2.0"
] | 1 | 2015-02-17T19:23:48.000Z | 2015-02-17T19:23:48.000Z | cards/models.py | i-DAT-Qualia/Card-Backend | ad11c4bdecc20f7f8c386c8f3f452cbfd9c9aa73 | [
"Apache-2.0"
] | null | null | null | cards/models.py | i-DAT-Qualia/Card-Backend | ad11c4bdecc20f7f8c386c8f3f452cbfd9c9aa73 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class Batch(models.Model):
name = models.CharField(max_length=250)
notes = models.TextField(blank=True)
added = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
def __unicode__(self):
return self.name
class Card(models.Mo... | 29.546875 | 82 | 0.718139 | from django.db import models
class Batch(models.Model):
name = models.CharField(max_length=250)
notes = models.TextField(blank=True)
added = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
def __unicode__(self):
return self.name
class Card(models.Mo... | true | true |
f758e3e74d07ab371713077f3d4282812353bda6 | 216 | py | Python | breviar/cli/text.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | 1 | 2020-04-13T12:14:50.000Z | 2020-04-13T12:14:50.000Z | breviar/cli/text.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | null | null | null | breviar/cli/text.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | null | null | null | BITLY_CONFIGURE_PROMPT = 'Please enter the bitly API access token. ' \
'You can get it here (login to the bitly first): ' \
'https://bitly.is/accesstoken\nAPI token'
| 54 | 77 | 0.564815 | BITLY_CONFIGURE_PROMPT = 'Please enter the bitly API access token. ' \
'You can get it here (login to the bitly first): ' \
'https://bitly.is/accesstoken\nAPI token'
| true | true |
f758e5801a46107e513720a4d5ddb37a2c491f77 | 2,424 | py | Python | certbot-dns-google/setup.py | FirstBlue/certbot | 05a9ded297daf58144d966c6d6276f039761dd8d | [
"Apache-2.0"
] | null | null | null | certbot-dns-google/setup.py | FirstBlue/certbot | 05a9ded297daf58144d966c6d6276f039761dd8d | [
"Apache-2.0"
] | 3 | 2022-03-24T21:03:53.000Z | 2022-03-24T21:04:43.000Z | certbot-dns-google/setup.py | pertinkoira/certbot | 9ef6110e36e0cd03611409350de08b49b09c5bf2 | [
"Apache-2.0"
] | null | null | null | import os
import sys
from setuptools import find_packages
from setuptools import setup
version = '1.26.0.dev0'
install_requires = [
'google-api-python-client>=1.5.5',
'oauth2client>=4.0',
'setuptools>=41.6.0',
# already a dependency of google-api-python-client, but added for consistency
'httplib2... | 31.480519 | 81 | 0.631188 | import os
import sys
from setuptools import find_packages
from setuptools import setup
version = '1.26.0.dev0'
install_requires = [
'google-api-python-client>=1.5.5',
'oauth2client>=4.0',
'setuptools>=41.6.0',
'httplib2'
]
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
... | true | true |
f758e65b8ab13e8864eba1240e6c6fa481ba1836 | 1,165 | py | Python | netests/converters/vrf/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | 14 | 2020-06-08T07:34:59.000Z | 2022-03-14T08:52:03.000Z | netests/converters/vrf/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | null | null | null | netests/converters/vrf/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | 3 | 2020-06-19T03:57:05.000Z | 2020-06-22T22:46:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from netests.constants import NOT_SET
from netests.protocols.vrf import VRF, ListVRF
def _arista_vrf_api_converter(
hostname: str(),
cmd_output,
options={}
) -> ListVRF:
if not isinstance(cmd_output['result'][0], dict):
cmd_output = ... | 25.326087 | 66 | 0.538197 |
import json
from netests.constants import NOT_SET
from netests.protocols.vrf import VRF, ListVRF
def _arista_vrf_api_converter(
hostname: str(),
cmd_output,
options={}
) -> ListVRF:
if not isinstance(cmd_output['result'][0], dict):
cmd_output = json.loads(cmd_output['result'][0])
else:... | true | true |
f758e662a9b9bb671955f33099f8d8d8b680a117 | 6,279 | py | Python | utils/wsi_util.py | PingjunChen/ThyroidRule | 1213cf0783c84da5917ca903c156e5e4280402f5 | [
"MIT"
] | 6 | 2020-02-10T00:48:38.000Z | 2022-03-03T22:11:43.000Z | utils/wsi_util.py | PingjunChen/ThyroidRule | 1213cf0783c84da5917ca903c156e5e4280402f5 | [
"MIT"
] | null | null | null | utils/wsi_util.py | PingjunChen/ThyroidRule | 1213cf0783c84da5917ca903c156e5e4280402f5 | [
"MIT"
] | 1 | 2022-02-01T21:22:30.000Z | 2022-02-01T21:22:30.000Z | # -*- coding: utf-8 -*-
import os, sys, pdb
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as data
from torchvision import datasets, transforms
import numpy as np
import cv2, copy, time
import matplotlib.pyplot as plt
from scipy.ndimage import binary_fill_hol... | 36.505814 | 111 | 0.681637 |
import os, sys, pdb
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as data
from torchvision import datasets, transforms
import numpy as np
import cv2, copy, time
import matplotlib.pyplot as plt
from scipy.ndimage import binary_fill_holes, binary_closing, bin... | true | true |
f758e74ca35f4a23c425c9643a551e99f5c3a376 | 13,657 | py | Python | Mask-Predict/fairseq/data/language_pair_context_mask.py | shawnkx/NAT-with-Local-AT | 16b29e068ad568e3a020f1309e140aa0dbc38479 | [
"MIT"
] | 6 | 2020-11-17T18:54:08.000Z | 2022-01-21T16:21:18.000Z | Mask-Predict/fairseq/data/language_pair_context_mask.py | shawnkx/NAT-with-Local-AT | 16b29e068ad568e3a020f1309e140aa0dbc38479 | [
"MIT"
] | 2 | 2021-01-01T10:57:32.000Z | 2021-01-13T01:17:35.000Z | Mask-Predict/fairseq/data/language_pair_context_mask.py | shawnkx/NAT-with-Local-AT | 16b29e068ad568e3a020f1309e140aa0dbc38479 | [
"MIT"
] | 1 | 2020-12-29T12:02:44.000Z | 2020-12-29T12:02:44.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import numpy as np
import torch
im... | 44.485342 | 156 | 0.616094 |
import numpy as np
import torch
import random
from fairseq import utils
from . import data_utils, FairseqDataset
def collate(
samples, pad_idx, eos_idx, left_pad_source=True, left_pad_target=False,
input_feeding=True,
):
if len(samples) == 0:
return {}
def merge(key, is_list=False):
... | true | true |
f758e7c1bf16c899372e3789e8a66097ad4e83ee | 1,759 | py | Python | reactivated/utils.py | silviogutierrez/reactivated | 8bbd3095cd07af5bb022f110233a184fd3946b44 | [
"MIT"
] | 178 | 2018-10-24T07:58:26.000Z | 2022-03-31T10:26:57.000Z | reactivated/utils.py | silviogutierrez/reactivated | 8bbd3095cd07af5bb022f110233a184fd3946b44 | [
"MIT"
] | 26 | 2019-10-19T02:52:08.000Z | 2022-03-23T16:47:33.000Z | reactivated/utils.py | silviogutierrez/reactivated | 8bbd3095cd07af5bb022f110233a184fd3946b44 | [
"MIT"
] | 5 | 2019-07-25T03:55:03.000Z | 2022-03-21T04:19:50.000Z | import collections
from typing import Any, Sequence
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Manager
# Mock is_simple_callable for now
# instead of the more sophisticated one from rest_framework.fields
def is_simple_callable(possible_callable: Any) -> bool:
return callab... | 35.897959 | 103 | 0.621376 | import collections
from typing import Any, Sequence
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Manager
def is_simple_callable(possible_callable: Any) -> bool:
return callable(possible_callable)
def get_attribute(instance: Any, attrs: Sequence[str]) -> Any:
for att... | true | true |
f758e8652e6f0705aa0ffbb9e6250cce2735e79b | 1,070 | py | Python | astrogame/game/resources.py | siddharth2016/AstroGame | 59e12789d42728b5efb06f2aabaa4beee3656a1f | [
"MIT"
] | null | null | null | astrogame/game/resources.py | siddharth2016/AstroGame | 59e12789d42728b5efb06f2aabaa4beee3656a1f | [
"MIT"
] | null | null | null | astrogame/game/resources.py | siddharth2016/AstroGame | 59e12789d42728b5efb06f2aabaa4beee3656a1f | [
"MIT"
] | null | null | null | import pyglet
def center_image(image):
"""Sets an image's anchor point to its center"""
image.anchor_x = image.width / 2
image.anchor_y = image.height / 2
# Tell pyglet where to find the resources
pyglet.resource.path = ['../resources']
pyglet.resource.reindex()
# Load the three main resources and get ... | 33.4375 | 86 | 0.769159 | import pyglet
def center_image(image):
image.anchor_x = image.width / 2
image.anchor_y = image.height / 2
pyglet.resource.path = ['../resources']
pyglet.resource.reindex()
player_image = pyglet.resource.image("player.png")
center_image(player_image)
bullet_image = pyglet.resource.image("bullet.png")
cen... | true | true |
f758e9676a070288012ccf6c88da50de208142d9 | 175 | py | Python | lib/partitioner/constants.py | hashnfv/hashnfv-domino | eb2fbb1315e6489dd159c8227030d035bdeb1864 | [
"Apache-2.0"
] | null | null | null | lib/partitioner/constants.py | hashnfv/hashnfv-domino | eb2fbb1315e6489dd159c8227030d035bdeb1864 | [
"Apache-2.0"
] | null | null | null | lib/partitioner/constants.py | hashnfv/hashnfv-domino | eb2fbb1315e6489dd159c8227030d035bdeb1864 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Licence statement goes here
#
tosca_ordered_fields = ['tosca_definitions_version', 'description', 'metadata', 'policy_types', 'topology_template']
| 21.875 | 116 | 0.754286 |
tosca_ordered_fields = ['tosca_definitions_version', 'description', 'metadata', 'policy_types', 'topology_template']
| true | true |
f758eb0f984c084453bf0e61f9f630becb039f17 | 4,998 | py | Python | test/specs/openapi/test_expressions.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 659 | 2020-09-03T13:27:50.000Z | 2022-03-31T17:07:16.000Z | test/specs/openapi/test_expressions.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 651 | 2019-08-23T09:16:35.000Z | 2020-09-02T08:30:10.000Z | test/specs/openapi/test_expressions.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 66 | 2020-09-05T07:09:03.000Z | 2022-03-17T08:17:55.000Z | import json
import pytest
import requests
from hypothesis import given
from hypothesis import strategies as st
from schemathesis import Case
from schemathesis.models import APIOperation
from schemathesis.specs.openapi import expressions
from schemathesis.specs.openapi.expressions.errors import RuntimeExpressionError
... | 30.47561 | 120 | 0.554022 | import json
import pytest
import requests
from hypothesis import given
from hypothesis import strategies as st
from schemathesis import Case
from schemathesis.models import APIOperation
from schemathesis.specs.openapi import expressions
from schemathesis.specs.openapi.expressions.errors import RuntimeExpressionError
... | true | true |
f758eb58b889ac7d8142ca3a97ab1a003abb1050 | 6,901 | py | Python | dvc/dependency/repo.py | amritghimire/dvc-1 | 27666ffba7002c82ad3a3f8a4399c79056722e41 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/repo.py | amritghimire/dvc-1 | 27666ffba7002c82ad3a3f8a4399c79056722e41 | [
"Apache-2.0"
] | 99 | 2021-03-29T08:59:15.000Z | 2022-03-31T04:10:23.000Z | dvc/dependency/repo.py | amritghimire/dvc-1 | 27666ffba7002c82ad3a3f8a4399c79056722e41 | [
"Apache-2.0"
] | null | null | null | import os
from collections import defaultdict
from copy import copy
from typing import TYPE_CHECKING, Dict, Optional, Set, Tuple
from voluptuous import Required
from dvc.path_info import PathInfo
from .base import Dependency
if TYPE_CHECKING:
from dvc.hash_info import HashInfo
from dvc.objects.db.base impor... | 32.706161 | 79 | 0.573105 | import os
from collections import defaultdict
from copy import copy
from typing import TYPE_CHECKING, Dict, Optional, Set, Tuple
from voluptuous import Required
from dvc.path_info import PathInfo
from .base import Dependency
if TYPE_CHECKING:
from dvc.hash_info import HashInfo
from dvc.objects.db.base impor... | true | true |
f758ec4b8cf6dc9008bdbffdc8dcdade5c9251e9 | 3,423 | py | Python | fairseq_las/data/data_utils.py | sooftware/Fairseq-Listen-Attend-Spell | 9c66b3e7afef8bdcd24c6e71efffc45b8db6ae04 | [
"MIT"
] | 14 | 2020-11-30T16:44:52.000Z | 2021-09-01T02:39:54.000Z | fairseq_las/data/data_utils.py | sooftware/Fairseq-Listen-Attend-Spell | 9c66b3e7afef8bdcd24c6e71efffc45b8db6ae04 | [
"MIT"
] | null | null | null | fairseq_las/data/data_utils.py | sooftware/Fairseq-Listen-Attend-Spell | 9c66b3e7afef8bdcd24c6e71efffc45b8db6ae04 | [
"MIT"
] | null | null | null | # 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 torch
def calc_mean_invstddev(feature):
if len(feature.size()) != 2:
raise ValueError("We expect the input feature to be ... | 34.575758 | 91 | 0.668712 |
import torch
def calc_mean_invstddev(feature):
if len(feature.size()) != 2:
raise ValueError("We expect the input feature to be 2-D tensor")
mean = feature.mean(0)
var = feature.var(0)
eps = 1e-8
if (var < eps).any():
return mean, 1.0 / (torch.sqrt(var) + eps)
return ... | true | true |
f758ecaf904c0fecbf7b4c39b449c3a7e7ccf168 | 534 | py | Python | django/tests/regressiontests/text/tests.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | null | null | null | django/tests/regressiontests/text/tests.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | null | null | null | django/tests/regressiontests/text/tests.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | 1 | 2018-12-06T12:50:52.000Z | 2018-12-06T12:50:52.000Z | """
# Tests for stuff in django.utils.text.
>>> from django.utils.text import *
### smart_split ###########################################################
>>> list(smart_split(r'''This is "a person" test.'''))
['This', 'is', '"a person"', 'test.']
>>> print list(smart_split(r'''This is "a person's" test.'''))[2]
"a ... | 29.666667 | 75 | 0.522472 | true | true | |
f758ee190e1b7b8b48efe4f419a4abee52ba2d90 | 248 | py | Python | src/tools/palette/onPanelInsideChange.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 108 | 2020-11-23T01:22:37.000Z | 2022-03-29T09:27:32.000Z | src/tools/palette/onPanelInsideChange.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 794 | 2020-11-21T22:27:37.000Z | 2022-03-24T06:41:19.000Z | src/tools/palette/onPanelInsideChange.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 3 | 2021-06-19T00:57:54.000Z | 2021-11-01T11:55:07.000Z | # noinspection PyUnreachableCode
if False:
# noinspection PyUnresolvedReferences
from _stubs import *
from .palette import Palette
ext.palette = Palette(COMP())
def onValueChange(panelValue, prev):
ext.palette.onPanelInsideChange(panelValue)
| 24.8 | 44 | 0.806452 |
if False:
from _stubs import *
from .palette import Palette
ext.palette = Palette(COMP())
def onValueChange(panelValue, prev):
ext.palette.onPanelInsideChange(panelValue)
| true | true |
f758f10d47f2172b547ff70ceeb15e4f6e19e1b7 | 111 | py | Python | keras_multi_head/__init__.py | SpereShelde/keras-multi-head | a09b46f544b3886c9747ef969be8237a5e93ae6e | [
"MIT"
] | 214 | 2018-10-11T03:02:58.000Z | 2022-03-20T05:09:09.000Z | keras_multi_head/__init__.py | SpereShelde/keras-multi-head | a09b46f544b3886c9747ef969be8237a5e93ae6e | [
"MIT"
] | 10 | 2019-04-29T16:54:00.000Z | 2021-06-19T09:22:54.000Z | keras_multi_head/__init__.py | SpereShelde/keras-multi-head | a09b46f544b3886c9747ef969be8237a5e93ae6e | [
"MIT"
] | 46 | 2018-11-11T13:17:20.000Z | 2022-03-18T09:24:13.000Z | from .multi_head import MultiHead
from .multi_head_attention import MultiHeadAttention
__version__ = '0.28.0'
| 22.2 | 52 | 0.828829 | from .multi_head import MultiHead
from .multi_head_attention import MultiHeadAttention
__version__ = '0.28.0'
| true | true |
f758f29fc25fc0e51f0c0c25c80bade6a654e2dc | 296 | py | Python | Exercicios/Todos/ex090.py | Edson921/exerciciosResolvidos | 72a3089f4848650c62ac0dd876abf5695a64525a | [
"MIT"
] | null | null | null | Exercicios/Todos/ex090.py | Edson921/exerciciosResolvidos | 72a3089f4848650c62ac0dd876abf5695a64525a | [
"MIT"
] | null | null | null | Exercicios/Todos/ex090.py | Edson921/exerciciosResolvidos | 72a3089f4848650c62ac0dd876abf5695a64525a | [
"MIT"
] | null | null | null | dados = {'nome': str(input('Nome: ')), 'média': float(input('Média: '))}
if dados['média'] > 9:
dados['situação'] = 'apto'
elif 6 < dados['média'] < 10:
dados['situação'] = 'recurso'
else:
dados['situação'] = 'Ñapto'
for chave, valor in dados.items():
print(f'{chave} é {valor}')
| 29.6 | 72 | 0.581081 | dados = {'nome': str(input('Nome: ')), 'média': float(input('Média: '))}
if dados['média'] > 9:
dados['situação'] = 'apto'
elif 6 < dados['média'] < 10:
dados['situação'] = 'recurso'
else:
dados['situação'] = 'Ñapto'
for chave, valor in dados.items():
print(f'{chave} é {valor}')
| true | true |
f758f2a2aea38910ae2e89d5cbbe923c2a7173c7 | 1,590 | py | Python | Bugscan_exploits-master/exp_list/exp-753.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-753.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-753.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#author:DWBH
#Exploit Title : Wordpress N-Media Website Contact Form with File Upload 1.3.4
import sys
import re
def assign(service, arg):
if service == "wordpress":
return True, arg
def audit(arg):
uploader=''
payload='/wp-admin/admin-aja... | 39.75 | 98 | 0.620126 |
import sys
import re
def assign(service, arg):
if service == "wordpress":
return True, arg
def audit(arg):
uploader=''
payload='/wp-admin/admin-ajax.php'
uploaderdir_url = 'wp-content/uploads/contact_files/'
data = ''
data += "------WebKitFormBoundaryoWXEZaqFafD1oOA... | true | true |
f758f2b2ff9ff7f76c0df83f59ab5f5236aa9b9b | 1,381 | py | Python | tests/test_0006-deep-iteration.py | colesbury/awkward-1.0 | d036ab18eb54de8a2571d9f179d315ac8ee22119 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0006-deep-iteration.py | colesbury/awkward-1.0 | d036ab18eb54de8a2571d9f179d315ac8ee22119 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0006-deep-iteration.py | colesbury/awkward-1.0 | d036ab18eb54de8a2571d9f179d315ac8ee22119 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import sys
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
def test_iterator():
content = ak.layout.NumpyArray(np.array([1.1, 2.2, 3.3]))
offsets = ak.layout.Index32(np.ar... | 32.116279 | 87 | 0.641564 |
import sys
import pytest
import numpy as np
import awkward as ak
def test_iterator():
content = ak.layout.NumpyArray(np.array([1.1, 2.2, 3.3]))
offsets = ak.layout.Index32(np.array([0, 2, 2, 3], "i4"))
array = ak.layout.ListOffsetArray32(offsets, content)
assert list(content) == [1.1, 2.2, 3... | true | true |
f758f400196518d331974673063ca73b81a7a435 | 1,878 | py | Python | TurtleChase.py | ewiertel/TurtleChase | 45615d8dd68dc8e9894316e2e674240bb5a8cf01 | [
"MIT"
] | null | null | null | TurtleChase.py | ewiertel/TurtleChase | 45615d8dd68dc8e9894316e2e674240bb5a8cf01 | [
"MIT"
] | null | null | null | TurtleChase.py | ewiertel/TurtleChase | 45615d8dd68dc8e9894316e2e674240bb5a8cf01 | [
"MIT"
] | null | null | null | import superturtle, turtle
turtle.setup(500,500)
wn = turtle.Screen()
wn.title("Turtle Chase!")
wn.bgcolor("pink")
player_one = superturtle.SuperTurtle()
player_two = superturtle.SuperTurtle()
# make anouncements
player_one.write(" Bet you can't catch me!")
player_two.write(" Im gonna catch you man.")
# he... | 26.828571 | 59 | 0.689031 | import superturtle, turtle
turtle.setup(500,500)
wn = turtle.Screen()
wn.title("Turtle Chase!")
wn.bgcolor("pink")
player_one = superturtle.SuperTurtle()
player_two = superturtle.SuperTurtle()
player_one.write(" Bet you can't catch me!")
player_two.write(" Im gonna catch you man.")
# helper functions
def ... | true | true |
f758f4a7ddd39ce7ce1170f33e29bdbaa1cea1bf | 8,759 | py | Python | src/lambda/cmd/cmd.py | aws-samples/cqrs-lab-on-aws | 5ea2b80426ccde0f6a76ffde25b0cbf2b35cb250 | [
"MIT-0"
] | 7 | 2020-03-20T03:56:54.000Z | 2021-11-08T09:43:41.000Z | src/lambda/cmd/cmd.py | aws-samples/cqrs-lab-on-aws | 5ea2b80426ccde0f6a76ffde25b0cbf2b35cb250 | [
"MIT-0"
] | null | null | null | src/lambda/cmd/cmd.py | aws-samples/cqrs-lab-on-aws | 5ea2b80426ccde0f6a76ffde25b0cbf2b35cb250 | [
"MIT-0"
] | 1 | 2021-10-30T20:42:10.000Z | 2021-10-30T20:42:10.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import os
import json
import uuid
import boto3
import datetime
flight_table_name = os.environ['ORDER_TABLE_NAME']
init_db_lambda_name = os.environ['INITDB_LAMBDA_NAME']
dynamodb = boto3.resource('dynamodb')
table =... | 33.431298 | 132 | 0.457586 |
import os
import json
import uuid
import boto3
import datetime
flight_table_name = os.environ['ORDER_TABLE_NAME']
init_db_lambda_name = os.environ['INITDB_LAMBDA_NAME']
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(flight_table_name)
lam = boto3.client('lambda')
def http_return(body):
return... | true | true |
f758f55ce5da6c71304dfa8e621b182fbb97feea | 350 | py | Python | zsh/.jupyter/jupyter_qtconsole_config.py | mrossinek/dotfiles | 3fd5e271cbff8641766cabe9201c2e45f18caa5c | [
"MIT"
] | 3 | 2019-07-15T13:25:00.000Z | 2021-02-08T19:20:11.000Z | zsh/.jupyter/jupyter_qtconsole_config.py | mrossinek/dotfiles | 3fd5e271cbff8641766cabe9201c2e45f18caa5c | [
"MIT"
] | null | null | null | zsh/.jupyter/jupyter_qtconsole_config.py | mrossinek/dotfiles | 3fd5e271cbff8641766cabe9201c2e45f18caa5c | [
"MIT"
] | null | null | null | c.JupyterConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.hide_menubar = True
c.ConsoleWidget.include_other_output = True
c.HistoryConsoleWidget.include_other_output = True
c.FrontendWidget.include_other_output = True
c.JupyterWidget.include_other_output = True
c.JupyterW... | 38.888889 | 50 | 0.857143 | c.JupyterConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.hide_menubar = True
c.ConsoleWidget.include_other_output = True
c.HistoryConsoleWidget.include_other_output = True
c.FrontendWidget.include_other_output = True
c.JupyterWidget.include_other_output = True
c.JupyterW... | true | true |
f758f6f927fbd0d9f4bc2db377e7f4b00d9e73a3 | 5,682 | py | Python | tests/test_client.py | shinseitaro/pybotters | 2f8504fa798ebddacda9ae13edafa56816bffeea | [
"MIT"
] | null | null | null | tests/test_client.py | shinseitaro/pybotters | 2f8504fa798ebddacda9ae13edafa56816bffeea | [
"MIT"
] | null | null | null | tests/test_client.py | shinseitaro/pybotters | 2f8504fa798ebddacda9ae13edafa56816bffeea | [
"MIT"
] | null | null | null | import asyncio
import json
from unittest.mock import mock_open
import aiohttp
import pytest
import pytest_mock
import pybotters
async def test_client():
apis = {
'name1': ['key1', 'secret1'],
'name2': ['key2', 'secret2'],
'name3': ['key3', 'secret3'],
}
base_url = 'http://example... | 36.191083 | 88 | 0.686026 | import asyncio
import json
from unittest.mock import mock_open
import aiohttp
import pytest
import pytest_mock
import pybotters
async def test_client():
apis = {
'name1': ['key1', 'secret1'],
'name2': ['key2', 'secret2'],
'name3': ['key3', 'secret3'],
}
base_url = 'http://example... | true | true |
f758f7aa20df075e98ccdec26dfac81d4bb37c97 | 9,927 | py | Python | contrib/spendfrom/spendfrom.py | lyradevelopers/core | d0e628ca772b57235bf44a053597e2598de93566 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | lyradevelopers/core | d0e628ca772b57235bf44a053597e2598de93566 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | lyradevelopers/core | d0e628ca772b57235bf44a053597e2598de93566 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend LYRAs received on particular addresses,
# and lyra any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a lyrad or lyra-Qt r... | 37.041045 | 111 | 0.628589 |
mport *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis != 20000... | true | true |
f758f7f368a6c82965bd179f1790197cfa3433c9 | 3,097 | py | Python | setup.py | madsbk/ucx-py | 9946db226bf090f4f097714d681f267da848a7c9 | [
"BSD-3-Clause"
] | null | null | null | setup.py | madsbk/ucx-py | 9946db226bf090f4f097714d681f267da848a7c9 | [
"BSD-3-Clause"
] | null | null | null | setup.py | madsbk/ucx-py | 9946db226bf090f4f097714d681f267da848a7c9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# This file is a copy of what is available in a Cython demo + some additions
from __future__ import absolute_import, print_function
import os
from distutils.sysconfig import get_config_var, get_python_inc
import versioneer
... | 30.97 | 80 | 0.658702 |
from __future__ import absolute_import, print_function
import os
from distutils.sysconfig import get_config_var, get_python_inc
import versioneer
from setuptools import setup
from setuptools.extension import Extension
try:
from Cython.Distutils.build_ext import new_build_ext as build_ext
except ImportError:... | true | true |
f758f8137e12b5019a86ae0c59dcfac15b4f2754 | 1,133 | py | Python | clients/client/python/test/test_submit_self_service_settings_flow_with_lookup_method_body.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_submit_self_service_settings_flow_with_lookup_method_body.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_submit_self_service_settings_flow_with_lookup_method_body.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.71
Contact: support@ory.sh
Generated by: htt... | 30.621622 | 194 | 0.765225 |
import sys
import unittest
import ory_client
from ory_client.model.submit_self_service_settings_flow_with_lookup_method_body import SubmitSelfServiceSettingsFlowWithLookupMethodBody
class TestSubmitSelfServiceSettingsFlowWithLookupMethodBody(unittest.TestCase):
def setUp(self):
pass
def tearDown(... | true | true |
f758f8430281ee26a74eca31d5531c769f6f7792 | 11,760 | py | Python | kake/server_client.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | kake/server_client.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | kake/server_client.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | """Routines for talking to a kake-server daemon, spawning one if necessary.
Routines in this module are meant to be used from dev-appserver.
This module defines these routines:
start_server(): spawn a kake server as a daemon, if needed
server_port(): returns port the current kake server is running on
get(): giv... | 37.21519 | 79 | 0.673384 |
from __future__ import absolute_import
import contextlib
import logging
import os
import rfc822
import sys
import time
from google.appengine.api import urlfetch
from . import project_root
from shared import shared_globals
from shared.cache import request_cache
import subprocess_util
assert shared_globals.IS_DEV_... | true | true |
f758f8741ceba986e1bb5ec87d2b164cbc9c52d5 | 10,054 | py | Python | contrib/spendfrom/spendfrom.py | zouied2000/samacoin | 94d4dfeb9339dd6b10eb8065aaec7fdf47a929d1 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | zouied2000/samacoin | 94d4dfeb9339dd6b10eb8065aaec7fdf47a929d1 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | zouied2000/samacoin | 94d4dfeb9339dd6b10eb8065aaec7fdf47a929d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | 37.514925 | 111 | 0.632286 |
mport *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis != 20000... | true | true |
f758f8bc4db7de0827f9ebcee736b38f0d05dcca | 28,174 | py | Python | pytorch_toolkit/nncf/tests/modules/test_rnn.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 3 | 2020-12-29T02:47:32.000Z | 2021-11-12T08:12:51.000Z | pytorch_toolkit/nncf/tests/modules/test_rnn.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 23 | 2020-09-25T22:41:48.000Z | 2021-12-13T20:43:37.000Z | pytorch_toolkit/nncf/tests/modules/test_rnn.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 1 | 2021-03-12T10:08:44.000Z | 2021-03-12T10:08:44.000Z | """
Copyright (c) 2019-2020 Intel Corporation
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 w... | 42.303303 | 120 | 0.599844 | import logging
import sys
from collections import namedtuple
from typing import List, Tuple
import copy
import onnx
import os
import pytest
import torch
import torch.nn.functional as F
from functools import partial
from torch import nn
from torch.autograd import Variable
from torch.nn.utils.rnn import PackedSequence
... | true | true |
f758fa4eceda74da992e006bdec82dd5aa4c618f | 976 | py | Python | HDMI_splitter_mod/hdmi_funcs.py | LiamHowell/SmartCube | c782e5fd99caaca4ae32a66b1648eee9e3a3e4b3 | [
"MIT"
] | null | null | null | HDMI_splitter_mod/hdmi_funcs.py | LiamHowell/SmartCube | c782e5fd99caaca4ae32a66b1648eee9e3a3e4b3 | [
"MIT"
] | null | null | null | HDMI_splitter_mod/hdmi_funcs.py | LiamHowell/SmartCube | c782e5fd99caaca4ae32a66b1648eee9e3a3e4b3 | [
"MIT"
] | null | null | null | from machine import Pin
from time import sleep
analog_switch = Pin(16,Pin.OUT, Pin.PULL_DOWN)
led_status1 = Pin(15,Pin.IN,Pin.PULL_UP)
led_status2 = Pin(14,Pin.IN,Pin.PULL_UP)
led_status3 = Pin(13,Pin.IN,Pin.PULL_UP)
def button_sim():
analog_switch.value(1)
sleep(0.1)
analog_switch.value(0)
... | 24.4 | 80 | 0.535861 | from machine import Pin
from time import sleep
analog_switch = Pin(16,Pin.OUT, Pin.PULL_DOWN)
led_status1 = Pin(15,Pin.IN,Pin.PULL_UP)
led_status2 = Pin(14,Pin.IN,Pin.PULL_UP)
led_status3 = Pin(13,Pin.IN,Pin.PULL_UP)
def button_sim():
analog_switch.value(1)
sleep(0.1)
analog_switch.value(0)
... | true | true |
f758fb0f9c55439085f88f344f4a140e64de6cfd | 2,154 | py | Python | tests/test_working_set.py | Netflix-Skunkworks/service-capacity-modeling | 563ed66e62c84f387a4c710e008a0d82479a6718 | [
"Apache-2.0"
] | 6 | 2021-06-24T21:32:35.000Z | 2021-12-20T21:03:46.000Z | tests/test_working_set.py | Netflix-Skunkworks/service-capacity-modeling | 563ed66e62c84f387a4c710e008a0d82479a6718 | [
"Apache-2.0"
] | 6 | 2021-06-30T23:05:04.000Z | 2022-03-09T16:29:29.000Z | tests/test_working_set.py | Netflix-Skunkworks/service-capacity-modeling | 563ed66e62c84f387a4c710e008a0d82479a6718 | [
"Apache-2.0"
] | 4 | 2021-06-26T19:27:16.000Z | 2021-09-23T09:39:40.000Z | from service_capacity_modeling.hardware import shapes
from service_capacity_modeling.interface import FixedInterval
from service_capacity_modeling.models.common import WorkingSetEstimator
from service_capacity_modeling.stats import dist_for_interval
def test_working_set():
gp2_interval = shapes.region("us-east-1"... | 33.65625 | 88 | 0.74559 | from service_capacity_modeling.hardware import shapes
from service_capacity_modeling.interface import FixedInterval
from service_capacity_modeling.models.common import WorkingSetEstimator
from service_capacity_modeling.stats import dist_for_interval
def test_working_set():
gp2_interval = shapes.region("us-east-1"... | true | true |
f758fb59ef350da8a22389ce6a7bc128caca591e | 6,072 | py | Python | bamboo/unit_tests/test_unit_layer_squared_difference.py | naoyam/lbann | d30e053b6f86d1cf8cca1d61c94bbbdbfc4945c4 | [
"Apache-2.0"
] | null | null | null | bamboo/unit_tests/test_unit_layer_squared_difference.py | naoyam/lbann | d30e053b6f86d1cf8cca1d61c94bbbdbfc4945c4 | [
"Apache-2.0"
] | 66 | 2018-04-04T22:24:42.000Z | 2020-10-23T01:50:34.000Z | bamboo/unit_tests/test_unit_layer_squared_difference.py | naoyam/lbann | d30e053b6f86d1cf8cca1d61c94bbbdbfc4945c4 | [
"Apache-2.0"
] | null | null | null | import functools
import operator
import os
import os.path
import sys
import numpy as np
# Bamboo utilities
current_file = os.path.realpath(__file__)
current_dir = os.path.dirname(current_file)
sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python'))
import tools
# ==============================... | 29.91133 | 85 | 0.554842 | import functools
import operator
import os
import os.path
import sys
import numpy as np
current_file = os.path.realpath(__file__)
current_dir = os.path.dirname(current_file)
sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python'))
import tools
np.random.seed(2019102415)
_samples = np.ra... | true | true |
f758fb9ed2aeff189cd9b05a51af5cc32afddfa9 | 12,159 | py | Python | mnemocards/builders/autogenerate_builder.py | Otter-man/mnemocards-for-play-books | 421afadb6749ad590cc83aa81967b2f2ca1c0be8 | [
"MIT"
] | 1 | 2022-02-09T05:52:34.000Z | 2022-02-09T05:52:34.000Z | mnemocards/builders/autogenerate_builder.py | Otter-man/mnemocards-for-play-books | 421afadb6749ad590cc83aa81967b2f2ca1c0be8 | [
"MIT"
] | null | null | null | mnemocards/builders/autogenerate_builder.py | Otter-man/mnemocards-for-play-books | 421afadb6749ad590cc83aa81967b2f2ca1c0be8 | [
"MIT"
] | null | null | null | import os
import csv
import genanki
from gtts import gTTS
from mnemocards import ASSETS_DIR
from mnemocards.utils import get_hash_id, NoteID, generate_furigana
from mnemocards.builders.vocabulary_builder import VocabularyBuilder
from mnemocards.builders.vocabulary_builder import remove_parentheses, remove_spaces
fr... | 36.845455 | 88 | 0.484826 | import os
import csv
import genanki
from gtts import gTTS
from mnemocards import ASSETS_DIR
from mnemocards.utils import get_hash_id, NoteID, generate_furigana
from mnemocards.builders.vocabulary_builder import VocabularyBuilder
from mnemocards.builders.vocabulary_builder import remove_parentheses, remove_spaces
fr... | true | true |
f758fbcfa46ea83ba3598cf3af32bd5ea46d9d2d | 3,477 | py | Python | weasyl/test/web/test_characters.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | null | null | null | weasyl/test/web/test_characters.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | 19 | 2018-01-02T07:27:22.000Z | 2019-01-23T05:20:06.000Z | weasyl/test/web/test_characters.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from __future__ import absolute_import
import os
import pytest
import webtest
from io import BytesIO
from PIL import Image
from weasyl.macro import MACRO_APP_ROOT, MACRO_STORAGE_ROOT
from weasyl.test import db_utils
from weasyl.test.web.wsgi import app
_BASE_FORM = {
'title': u'Test name',
... | 30.769912 | 133 | 0.687662 |
from __future__ import absolute_import
import os
import pytest
import webtest
from io import BytesIO
from PIL import Image
from weasyl.macro import MACRO_APP_ROOT, MACRO_STORAGE_ROOT
from weasyl.test import db_utils
from weasyl.test.web.wsgi import app
_BASE_FORM = {
'title': u'Test name',
'age': u'6402161... | true | true |
f758fbcfcf9e44896ff47fb03d0a837814365758 | 8,057 | py | Python | afqueue/source/manager_worker_manager.py | appfirst/distributed_queue_manager | 733fd18a7c178e1163bac8ee6359156789641f7f | [
"MIT"
] | 1 | 2021-05-24T17:09:50.000Z | 2021-05-24T17:09:50.000Z | afqueue/source/manager_worker_manager.py | appfirst/distributed_queue_manager | 733fd18a7c178e1163bac8ee6359156789641f7f | [
"MIT"
] | null | null | null | afqueue/source/manager_worker_manager.py | appfirst/distributed_queue_manager | 733fd18a7c178e1163bac8ee6359156789641f7f | [
"MIT"
] | null | null | null | from afqueue.source.manager_worker import ManagerWorker #@UnresolvedImport
from multiprocessing import Process, Queue #@UnresolvedImport
from afqueue.common.exception_formatter import ExceptionFormatter #@UnresolvedImport
from afqueue.messages import system_messages #@UnresolvedImport
from afqueue.threads.data_worker_t... | 40.898477 | 150 | 0.624302 | from afqueue.source.manager_worker import ManagerWorker
from multiprocessing import Process, Queue
from afqueue.common.exception_formatter import ExceptionFormatter
from afqueue.messages import system_messages
from afqueue.threads.data_worker_thread import DataWorkerThread
class ManagerWorkerManager():
... | true | true |
f758fe14f7050858822719f28f847bf9568e6bca | 5,026 | py | Python | projects/adnet/mains/ADNet2.py | hizb-resume/LTD-local-track-to-detect-for-VID | 7147ac7c6cd4b22a956aaaabaa151e5ed5410c68 | [
"Apache-2.0"
] | 1 | 2021-03-30T07:25:42.000Z | 2021-03-30T07:25:42.000Z | projects/adnet/mains/ADNet2.py | hizb-resume/LTD-local-track-to-detect-for-VID | 7147ac7c6cd4b22a956aaaabaa151e5ed5410c68 | [
"Apache-2.0"
] | null | null | null | projects/adnet/mains/ADNet2.py | hizb-resume/LTD-local-track-to-detect-for-VID | 7147ac7c6cd4b22a956aaaabaa151e5ed5410c68 | [
"Apache-2.0"
] | null | null | null | import _init_paths
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
from trainers.adnet_train_sl import adnet_train_sl
import argparse
from options.general2 import opts
from models.ADNet import adnet
from utils.get_train_videos import get_train_videos
from trainers.adnet_train_rl i... | 52.905263 | 178 | 0.731397 | import _init_paths
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
from trainers.adnet_train_sl import adnet_train_sl
import argparse
from options.general2 import opts
from models.ADNet import adnet
from utils.get_train_videos import get_train_videos
from trainers.adnet_train_rl i... | true | true |
f758fe8965411e398cb138b4e9198f6c0c85dd73 | 25,924 | py | Python | tacotron/models/tacotron.py | ruclion/Fantasy_Mix-Lingual_Tacotron_Version_7_NOVAE-Phoneme-HCSI-NOLID_DBMIX | baa4c8c3f3ba80acf68cec88aed53084a97c8aa1 | [
"MIT"
] | null | null | null | tacotron/models/tacotron.py | ruclion/Fantasy_Mix-Lingual_Tacotron_Version_7_NOVAE-Phoneme-HCSI-NOLID_DBMIX | baa4c8c3f3ba80acf68cec88aed53084a97c8aa1 | [
"MIT"
] | null | null | null | tacotron/models/tacotron.py | ruclion/Fantasy_Mix-Lingual_Tacotron_Version_7_NOVAE-Phoneme-HCSI-NOLID_DBMIX | baa4c8c3f3ba80acf68cec88aed53084a97c8aa1 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tacotron.utils.symbols import symbols
from tacotron.utils.symbols import tone_stress_symbols_max_no
from tacotron.utils.symbols import symbols_tag
from infolog import log
from tacotron.models.helpers import TacoTrainingHelper, TacoTestHelper
from tacotron.models.modules import *
from tenso... | 48.456075 | 194 | 0.740935 | import tensorflow as tf
from tacotron.utils.symbols import symbols
from tacotron.utils.symbols import tone_stress_symbols_max_no
from tacotron.utils.symbols import symbols_tag
from infolog import log
from tacotron.models.helpers import TacoTrainingHelper, TacoTestHelper
from tacotron.models.modules import *
from tenso... | true | true |
f758ff1ed8465a30c33e686bc7316ad2bce2e837 | 3,309 | py | Python | hw6.py | blthayer/ecen-667 | cf609fa230b94e5b98af7afe554250a0824c2e11 | [
"Apache-2.0"
] | null | null | null | hw6.py | blthayer/ecen-667 | cf609fa230b94e5b98af7afe554250a0824c2e11 | [
"Apache-2.0"
] | null | null | null | hw6.py | blthayer/ecen-667 | cf609fa230b94e5b98af7afe554250a0824c2e11 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def main():
p1()
p2()
p6()
def p1():
# Do part 1.
print('*' * 80)
print('Problem 8.8, Part 1')
a1 = np.array([
[3, 8],
[2, 3]
])
_get_participation(a1)
# Now part 2.
print('*' * 80)
print('Problem 8.8, Part 2')
a2 = np.array([
... | 20.943038 | 79 | 0.515866 | import numpy as np
def main():
p1()
p2()
p6()
def p1():
print('*' * 80)
print('Problem 8.8, Part 1')
a1 = np.array([
[3, 8],
[2, 3]
])
_get_participation(a1)
print('*' * 80)
print('Problem 8.8, Part 2')
a2 = np.array([
[1, 2, 1],
... | true | true |
f758ff5c509a2d67554fb65700b48e70f3dd4b15 | 1,205 | py | Python | python/ray/experimental/serve/examples/test.py | RehanSD/ray | 48c801f1680bc9de5f80e7b86bc357669a8915d4 | [
"Apache-2.0"
] | null | null | null | python/ray/experimental/serve/examples/test.py | RehanSD/ray | 48c801f1680bc9de5f80e7b86bc357669a8915d4 | [
"Apache-2.0"
] | null | null | null | python/ray/experimental/serve/examples/test.py | RehanSD/ray | 48c801f1680bc9de5f80e7b86bc357669a8915d4 | [
"Apache-2.0"
] | 1 | 2019-03-26T01:57:26.000Z | 2019-03-26T01:57:26.000Z | import ray
import socket
ray.init()
import pickle
import docker
from contextlib import closing
@ray.remote
class Predictor(object):
"""Actor that adds deploys specified container.
result = "Recieved " + input_batch.
"""
def __init__(self, container):
with closing(socket.socket(socket.AF_INET, ... | 29.390244 | 87 | 0.623237 | import ray
import socket
ray.init()
import pickle
import docker
from contextlib import closing
@ray.remote
class Predictor(object):
def __init__(self, container):
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
s.bind(('', 0))
s.setsockopt(socket.SOL_SOCKET, so... | true | true |
f758ff907acdcbe644ddb774e53b692314eff3bd | 2,482 | py | Python | kolibri/plugins/oidc_provider_plugin/management/commands/oidccreateclient.py | MikiasEphrem/kolibri | 3a2356883278f79b4a7655a47c7fa6db70acc184 | [
"MIT"
] | null | null | null | kolibri/plugins/oidc_provider_plugin/management/commands/oidccreateclient.py | MikiasEphrem/kolibri | 3a2356883278f79b4a7655a47c7fa6db70acc184 | [
"MIT"
] | null | null | null | kolibri/plugins/oidc_provider_plugin/management/commands/oidccreateclient.py | MikiasEphrem/kolibri | 3a2356883278f79b4a7655a47c7fa6db70acc184 | [
"MIT"
] | null | null | null | import binascii
import logging
import os
from django.core.management.base import BaseCommand
from oidc_provider.models import Client
from oidc_provider.models import ResponseType
logger = logging.getLogger(__name__)
"""
Usage example:
kolibri manage oidccreateclient --name="hooooo" --redirect-uri="http://otro/callb... | 32.657895 | 109 | 0.570105 | import binascii
import logging
import os
from django.core.management.base import BaseCommand
from oidc_provider.models import Client
from oidc_provider.models import ResponseType
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Command to add new clients applications that will use kolib... | true | true |
f758ffaa8b87ead02a9c8690331473ebf4bcd0a4 | 5,695 | py | Python | tests/hazmat/primitives/test_block.py | glyph/cryptography | 43cf688e885668198bc966b1cf3a4a425a60f1a6 | [
"Apache-2.0"
] | 1 | 2015-04-27T09:28:26.000Z | 2015-04-27T09:28:26.000Z | tests/hazmat/primitives/test_block.py | glyph/cryptography | 43cf688e885668198bc966b1cf3a4a425a60f1a6 | [
"Apache-2.0"
] | 4 | 2021-03-22T02:00:19.000Z | 2021-04-07T07:40:19.000Z | tests/hazmat/primitives/test_block.py | majacQ/cryptography | add8bec357f09aba6609af16577111addec07ef7 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | 29.661458 | 71 | 0.612116 |
from __future__ import absolute_import, division, print_function
import binascii
import pytest
from cryptography import utils
from cryptography.exceptions import (
UnsupportedAlgorithm, AlreadyFinalized,
)
from cryptography.hazmat.primitives import interfaces
from cryptography.hazmat.primitives.ciph... | true | true |
f758ffdbb0f0f8eece75cff9a26bf1a08e2ed18f | 611 | py | Python | examples/metric_logging.py | vishwanath1306/mltrace | 73301e90e413f6d40beac6ef449f547c687cbb55 | [
"Apache-2.0"
] | 328 | 2021-04-26T17:22:12.000Z | 2022-03-30T08:52:33.000Z | examples/metric_logging.py | vishwanath1306/mltrace | 73301e90e413f6d40beac6ef449f547c687cbb55 | [
"Apache-2.0"
] | 94 | 2021-04-14T19:39:51.000Z | 2022-03-26T00:43:46.000Z | examples/metric_logging.py | vishwanath1306/mltrace | 73301e90e413f6d40beac6ef449f547c687cbb55 | [
"Apache-2.0"
] | 20 | 2021-05-10T15:24:27.000Z | 2022-03-30T00:14:27.000Z | from mltrace import Task
from sklearn.metrics import mean_squared_error
import random
import string
task = Task("testing")
def inference_component(output_id):
task.logOutput(random.randint(0, 1), output_id)
def feedback_component(output_id):
task.logFeedback(random.randint(0, 1), output_id)
if __name__ ... | 20.366667 | 68 | 0.700491 | from mltrace import Task
from sklearn.metrics import mean_squared_error
import random
import string
task = Task("testing")
def inference_component(output_id):
task.logOutput(random.randint(0, 1), output_id)
def feedback_component(output_id):
task.logFeedback(random.randint(0, 1), output_id)
if __name__ ... | true | true |
f7590034b86abfb57c17625666a551bb4c5d0c99 | 104 | py | Python | paperbroker/adapters/quotes/__init__.py | yutiansut/paperbroker | 3b4124ee79532d4b56b5fd5e864ed2ca1f4f857e | [
"MIT"
] | 227 | 2017-07-14T19:10:04.000Z | 2022-03-23T01:29:46.000Z | paperbroker/adapters/quotes/__init__.py | ajmal017/paperbroker | 3b4124ee79532d4b56b5fd5e864ed2ca1f4f857e | [
"MIT"
] | 7 | 2017-07-14T01:59:49.000Z | 2021-05-19T06:10:55.000Z | paperbroker/adapters/quotes/__init__.py | ajmal017/paperbroker | 3b4124ee79532d4b56b5fd5e864ed2ca1f4f857e | [
"MIT"
] | 59 | 2017-07-15T06:55:56.000Z | 2022-03-22T21:20:22.000Z | from .QuoteAdapter import QuoteAdapter
from .GoogleFinanceQuoteAdapter import GoogleFinanceQuoteAdapter
| 34.666667 | 64 | 0.903846 | from .QuoteAdapter import QuoteAdapter
from .GoogleFinanceQuoteAdapter import GoogleFinanceQuoteAdapter
| true | true |
f759011e4a1139c1b1c561ab6c1f9687f4cf4833 | 5,193 | py | Python | tests/sequence_labelling/utils/checkpoints_test.py | elifesciences/sciencebeam-trainer-delft | 0f7da96cdf32acf1538a5fded192255158883ba0 | [
"MIT"
] | 5 | 2019-10-19T13:00:34.000Z | 2022-01-16T17:31:42.000Z | tests/sequence_labelling/utils/checkpoints_test.py | elifesciences/sciencebeam-trainer-delft | 0f7da96cdf32acf1538a5fded192255158883ba0 | [
"MIT"
] | 162 | 2019-08-22T10:28:46.000Z | 2022-03-28T17:33:16.000Z | tests/sequence_labelling/utils/checkpoints_test.py | elifesciences/sciencebeam-trainer-delft | 0f7da96cdf32acf1538a5fded192255158883ba0 | [
"MIT"
] | null | null | null | import json
from pathlib import Path
import pytest
from sciencebeam_trainer_delft.sequence_labelling.utils.checkpoints import (
CheckPoints,
get_resume_train_model_params
)
class TestCheckPoints:
def test_should_raise_exception_without_log_dir(self):
with pytest.raises(AssertionError):
... | 34.390728 | 97 | 0.625265 | import json
from pathlib import Path
import pytest
from sciencebeam_trainer_delft.sequence_labelling.utils.checkpoints import (
CheckPoints,
get_resume_train_model_params
)
class TestCheckPoints:
def test_should_raise_exception_without_log_dir(self):
with pytest.raises(AssertionError):
... | true | true |
f75903b6df28ebe8095e2069a5d0b14823768f8e | 1,002 | py | Python | toWebHtml/toWebHtmlMacro.py | p--q/toWebHtml | 7baffaf62abc6319d0f315a523c9d1c2ba862b3d | [
"MIT"
] | null | null | null | toWebHtml/toWebHtmlMacro.py | p--q/toWebHtml | 7baffaf62abc6319d0f315a523c9d1c2ba862b3d | [
"MIT"
] | null | null | null | toWebHtml/toWebHtmlMacro.py | p--q/toWebHtml | 7baffaf62abc6319d0f315a523c9d1c2ba862b3d | [
"MIT"
] | null | null | null | # toWebHtmlMacro.py
# -*- coding: utf-8 -*-
# LibreOfficeのディスパッチコマンドでウェブブラウザに出力するマクロ。
from com.sun.star.beans import PropertyValue
def toWebHtml():
desktop = XSCRIPTCONTEXT.getDesktop() # デスクトップを取得。
prop = PropertyValue(Name="Hidden",Value=True) # バックグラウンドで開く設定。
doc = desktop.loadComponentFromURL("privat... | 55.666667 | 137 | 0.753493 |
from com.sun.star.beans import PropertyValue
def toWebHtml():
desktop = XSCRIPTCONTEXT.getDesktop()
prop = PropertyValue(Name="Hidden",Value=True)
doc = desktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, (prop,))
doc.getText().setString("toWebHTML拡張機能から出力")
frame = doc.... | true | true |
f759046f47d67428a2a9785cee3b9c2ee68e963c | 575 | py | Python | newmu/data_utils.py | laputian/dml | d106f89567fa3dcdc304b5c6570fe1a69dd3c3ff | [
"MIT"
] | null | null | null | newmu/data_utils.py | laputian/dml | d106f89567fa3dcdc304b5c6570fe1a69dd3c3ff | [
"MIT"
] | null | null | null | newmu/data_utils.py | laputian/dml | d106f89567fa3dcdc304b5c6570fe1a69dd3c3ff | [
"MIT"
] | 3 | 2016-10-25T23:09:40.000Z | 2020-10-17T23:08:14.000Z | import cPickle as pickle
def save_model(params, epoch = 0, annotation='', namestub = '', savepath = '../data/models/', test_score=0.0):
savedFileName = namestub + '_' + str(epoch) + '_pars_' + annotation +'.pkl'
gg = open(savepath + savedFileName, 'wb')
pickle.dump(params, gg, protocol=pickle.HIGHEST_PRO... | 38.333333 | 110 | 0.634783 | import cPickle as pickle
def save_model(params, epoch = 0, annotation='', namestub = '', savepath = '../data/models/', test_score=0.0):
savedFileName = namestub + '_' + str(epoch) + '_pars_' + annotation +'.pkl'
gg = open(savepath + savedFileName, 'wb')
pickle.dump(params, gg, protocol=pickle.HIGHEST_PRO... | true | true |
f759056ecd68c4ce98c31d4062e9ad3543a0db14 | 629 | py | Python | introduction-to-data-visualization-in-python/4. Analyzing time series and images/script_1.py | nhutnamhcmus/datacamp-playground | 25457e813b1145e1d335562286715eeddd1c1a7b | [
"MIT"
] | 1 | 2021-05-08T11:09:27.000Z | 2021-05-08T11:09:27.000Z | introduction-to-data-visualization-in-python/4. Analyzing time series and images/script_1.py | nhutnamhcmus/datacamp-playground | 25457e813b1145e1d335562286715eeddd1c1a7b | [
"MIT"
] | 1 | 2022-03-12T15:42:14.000Z | 2022-03-12T15:42:14.000Z | introduction-to-data-visualization-in-python/4. Analyzing time series and images/script_1.py | nhutnamhcmus/datacamp-playground | 25457e813b1145e1d335562286715eeddd1c1a7b | [
"MIT"
] | 1 | 2021-04-30T18:24:19.000Z | 2021-04-30T18:24:19.000Z | # Multiple time series on common axes
# Import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
# Plot the aapl time series in blue
plt.plot(aapl, color='blue', label='AAPL')
# Plot the ibm time series in green
plt.plot(ibm, color='green', label='IBM')
# Plot the csco time series in red
plt.plot... | 24.192308 | 50 | 0.701113 |
import matplotlib.pyplot as plt
plt.plot(aapl, color='blue', label='AAPL')
plt.plot(ibm, color='green', label='IBM')
plt.plot(csco, color='red', label='CSCO')
plt.plot(msft, color='magenta', label='MSFT')
plt.legend(loc='upper left')
plt.xticks(rotation=60)
plt.show()
| true | true |
f75905e5832a118ff603dd400d86c2dcbe03a74b | 888 | py | Python | paas-ce/paas/esb/components/generic/templates/qcloud_sms/toolkit/configs.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 767 | 2019-03-25T06:35:43.000Z | 2022-03-30T08:57:51.000Z | paas-ce/paas/esb/components/generic/templates/qcloud_sms/toolkit/configs.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 194 | 2019-03-29T07:16:41.000Z | 2022-03-30T06:17:49.000Z | paas-ce/paas/esb/components/generic/templates/qcloud_sms/toolkit/configs.py | renmcc/bk-PaaS | 1c9e4e9cfb40fc3375cd6b5f08af8c84203de246 | [
"Apache-2.0"
] | 381 | 2019-03-25T07:19:54.000Z | 2022-03-29T03:22:42.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 46.736842 | 305 | 0.774775 |
from esb.utils import SmartHost
SYSTEM_NAME = 'QCLOUD_SMS'
host = SmartHost(
host_prod='https://yun.tim.qq.com'
)
default_nation_code = '86'
| true | true |
f759071c0f22a55808078a5530bb400e6beac4de | 313 | py | Python | python/divide_and_conquer/0241_different_ways_to_add_parentheses.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 6 | 2019-07-15T13:23:57.000Z | 2020-01-22T03:12:01.000Z | python/divide_and_conquer/0241_different_ways_to_add_parentheses.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | null | null | null | python/divide_and_conquer/0241_different_ways_to_add_parentheses.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 1 | 2019-07-24T02:15:31.000Z | 2019-07-24T02:15:31.000Z | class Solution(object):
def diffWaysToCompute(self, input):
"""
:type input: str
:rtype: List[int]
"""
def test_diff_ways_to_compute():
s = Solution()
assert [0, 2] == s.diffWaysToCompute("2-1-1")
assert [-34, -14, -10, -10, 10] == s.diffWaysToCompute("2*3-4*5")
| 24.076923 | 69 | 0.5623 | class Solution(object):
def diffWaysToCompute(self, input):
def test_diff_ways_to_compute():
s = Solution()
assert [0, 2] == s.diffWaysToCompute("2-1-1")
assert [-34, -14, -10, -10, 10] == s.diffWaysToCompute("2*3-4*5")
| true | true |
f7590a27c0e0eaa7b162a951cbf5e999c63c623a | 12,897 | py | Python | nsupdate/main/models.py | cyroxx/nsupdate.info | f963672c4284d958255518f2ef6a44820e9109b9 | [
"BSD-3-Clause"
] | 1 | 2020-09-06T09:29:57.000Z | 2020-09-06T09:29:57.000Z | nsupdate/main/models.py | cyroxx/nsupdate.info | f963672c4284d958255518f2ef6a44820e9109b9 | [
"BSD-3-Clause"
] | null | null | null | nsupdate/main/models.py | cyroxx/nsupdate.info | f963672c4284d958255518f2ef6a44820e9109b9 | [
"BSD-3-Clause"
] | null | null | null | """
models for hosts, domains, service updaters, ...
"""
import re
import base64
import dns.resolver
from django.db import models
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.conf import settings
from d... | 39.683077 | 111 | 0.675894 |
import re
import base64
import dns.resolver
from django.db import models
from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
from django.conf import settings
from django.db.models.signals import pre_delete
from django.con... | true | true |
f7590b2ba32bd8630ed1a49d47bac508dc27142c | 2,205 | py | Python | bind9/datadog_checks/bind9/bind9.py | gzussa/integrations-extras | cc93a01997befebc521fa1d3bc868efa80a793bd | [
"BSD-3-Clause"
] | null | null | null | bind9/datadog_checks/bind9/bind9.py | gzussa/integrations-extras | cc93a01997befebc521fa1d3bc868efa80a793bd | [
"BSD-3-Clause"
] | null | null | null | bind9/datadog_checks/bind9/bind9.py | gzussa/integrations-extras | cc93a01997befebc521fa1d3bc868efa80a793bd | [
"BSD-3-Clause"
] | 1 | 2019-06-19T11:33:45.000Z | 2019-06-19T11:33:45.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import xml.etree.ElementTree as ET
from datetime import datetime
import requests
from datadog_checks.base import AgentCheck, ConfigurationError
EPOCH = datetime(1970, 1, 1)
class Bind9Check(AgentCheck):
B... | 35.564516 | 119 | 0.66712 |
import xml.etree.ElementTree as ET
from datetime import datetime
import requests
from datadog_checks.base import AgentCheck, ConfigurationError
EPOCH = datetime(1970, 1, 1)
class Bind9Check(AgentCheck):
BIND_SERVICE_CHECK = "bind9.can_connect"
QUERY_ARRAY = ["opcode", "qtype", "nsstat", "zonestat", "res... | true | true |
f7590b3ae66ed324b41bc7ab5468a73b5d157c4f | 2,509 | py | Python | api/licenses/views.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | api/licenses/views.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | api/licenses/views.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | from rest_framework import generics, permissions as drf_permissions
from framework.auth.oauth_scopes import CoreScopes
from api.base.filters import ODMFilterMixin
from api.base import permissions as base_permissions
from api.base.utils import get_object_or_error
from api.licenses.serializers import LicenseSerializer
f... | 27.877778 | 101 | 0.671582 | from rest_framework import generics, permissions as drf_permissions
from framework.auth.oauth_scopes import CoreScopes
from api.base.filters import ODMFilterMixin
from api.base import permissions as base_permissions
from api.base.utils import get_object_or_error
from api.licenses.serializers import LicenseSerializer
f... | true | true |
f7590fe84aab60176d57630fe73cf260fd4c709d | 11,773 | py | Python | django/contrib/gis/tests/geo3d/tests.py | WoLpH/django | eabb44417ce1842007719b4b9378acca0e668b45 | [
"BSD-3-Clause"
] | null | null | null | django/contrib/gis/tests/geo3d/tests.py | WoLpH/django | eabb44417ce1842007719b4b9378acca0e668b45 | [
"BSD-3-Clause"
] | 1 | 2016-02-19T00:22:18.000Z | 2016-02-19T00:22:18.000Z | django/contrib/gis/tests/geo3d/tests.py | WoLpH/django | eabb44417ce1842007719b4b9378acca0e668b45 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import os
import re
from django.contrib.gis.db.models import Union, Extent3D
from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon
from django.contrib.gis.utils import LayerMapping, LayerMapError
from django.test import TestCase
from .mo... | 43.765799 | 676 | 0.632379 | from __future__ import absolute_import, unicode_literals
import os
import re
from django.contrib.gis.db.models import Union, Extent3D
from django.contrib.gis.geos import GEOSGeometry, LineString, Point, Polygon
from django.contrib.gis.utils import LayerMapping, LayerMapError
from django.test import TestCase
from .mo... | true | true |
f75910ad124390e05f1bacb310de99a1e717f125 | 30 | py | Python | scripts/dbseeder/tests/__init__.py | inkenbrandt/ugs-chemistry | 50f45f9634e3b1ca55f7c128008ecaa6b4ee5abf | [
"MIT"
] | null | null | null | scripts/dbseeder/tests/__init__.py | inkenbrandt/ugs-chemistry | 50f45f9634e3b1ca55f7c128008ecaa6b4ee5abf | [
"MIT"
] | null | null | null | scripts/dbseeder/tests/__init__.py | inkenbrandt/ugs-chemistry | 50f45f9634e3b1ca55f7c128008ecaa6b4ee5abf | [
"MIT"
] | null | null | null | """Test module for dbseeder""" | 30 | 30 | 0.7 | true | true | |
f75910eaf2108d78d8e46ab20746c6eba4f11449 | 1,694 | py | Python | tools/html5lib/setup.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 4 | 2020-09-09T15:28:01.000Z | 2021-12-01T00:59:56.000Z | tools/html5lib/setup.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 1 | 2021-03-31T20:23:55.000Z | 2021-03-31T20:23:55.000Z | tools/html5lib/setup.py | shs96c/web-platform-tests | 61acad6dd9bb99d32340eb41f5146de64f542359 | [
"BSD-3-Clause"
] | 1 | 2021-04-06T20:06:58.000Z | 2021-04-06T20:06:58.000Z | from distutils.core import setup
import os
import codecs
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Pyt... | 37.644444 | 92 | 0.624557 | from distutils.core import setup
import os
import codecs
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Pyt... | true | true |
f759117f8a40fdb5db3d6b4ebcbc0b7287417960 | 7,232 | py | Python | ohmysportsfeedspy/v1_0.py | alecglen/mysportsfeeds-python | b409ab4f565794e44304705003e21e3c4fdca1d2 | [
"MIT"
] | null | null | null | ohmysportsfeedspy/v1_0.py | alecglen/mysportsfeeds-python | b409ab4f565794e44304705003e21e3c4fdca1d2 | [
"MIT"
] | null | null | null | ohmysportsfeedspy/v1_0.py | alecglen/mysportsfeeds-python | b409ab4f565794e44304705003e21e3c4fdca1d2 | [
"MIT"
] | null | null | null | import os
import csv
import requests
from datetime import datetime
import simplejson as json
import platform
import base64
import ohmysportsfeedspy
# API class for dealing with v1.0 of the API
class API_v1_0(object):
# Constructor
def __init__(self, verbose, store_type=None, store_location=None):
se... | 34.274882 | 159 | 0.569137 | import os
import csv
import requests
from datetime import datetime
import simplejson as json
import platform
import base64
import ohmysportsfeedspy
class API_v1_0(object):
def __init__(self, verbose, store_type=None, store_location=None):
self.base_url = "https://api.mysportsfeeds.com/v1.0/pull"
... | true | true |
f75911f7cf9df446c348a36419d62fde9565d45c | 32,063 | py | Python | test_shaders.py | GoogleDepends/spirv-cross | 01cee74b0200b5c3b4f886939a54012e51cb8d45 | [
"Apache-2.0"
] | null | null | null | test_shaders.py | GoogleDepends/spirv-cross | 01cee74b0200b5c3b4f886939a54012e51cb8d45 | [
"Apache-2.0"
] | null | null | null | test_shaders.py | GoogleDepends/spirv-cross | 01cee74b0200b5c3b4f886939a54012e51cb8d45 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2015-2020 Arm Limited
#
# 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 ... | 38.817191 | 237 | 0.631631 |
import sys
import os
import os.path
import subprocess
import tempfile
import re
import itertools
import hashlib
import shutil
import argparse
import codecs
import json
import multiprocessing
import errno
from functools import partial
class Paths():
def __init__(self, spirv_cross, glslang, spirv_as,... | true | true |
f759126bf57c40e7d860d97165787f5f75ea77f5 | 1,113 | py | Python | src/miptlabs/interpolators/interpolators.py | dimon58/miptlabs | 538f6c410210a6e3405ca5b61dc7bc41d251cdf8 | [
"MIT"
] | null | null | null | src/miptlabs/interpolators/interpolators.py | dimon58/miptlabs | 538f6c410210a6e3405ca5b61dc7bc41d251cdf8 | [
"MIT"
] | null | null | null | src/miptlabs/interpolators/interpolators.py | dimon58/miptlabs | 538f6c410210a6e3405ca5b61dc7bc41d251cdf8 | [
"MIT"
] | null | null | null | from numpy import linspace
from scipy.interpolate import interp1d
class Interpolator:
"""
Базовый класс интерполятора
"""
def __init__(self, points=100):
self.points = points
def interpolate(self, x, y):
pass
class Quadratic(Interpolator):
"""
Квдратичный интерполятор
... | 23.680851 | 118 | 0.609164 | from numpy import linspace
from scipy.interpolate import interp1d
class Interpolator:
def __init__(self, points=100):
self.points = points
def interpolate(self, x, y):
pass
class Quadratic(Interpolator):
def gen_x_axis(self, start, end):
return linspace(start, end, self.points... | true | true |
f75912a012e219b6ebd86772ed5a14e707ae5498 | 3,125 | py | Python | source/Userdocs/NML2_examples/izhikevich-single-neuron.py | NeuroML/Documentation | 06e355a8268c848b872b4e4c44d990b77b1fcb37 | [
"CC-BY-4.0"
] | 5 | 2020-09-28T20:47:04.000Z | 2021-08-23T16:46:30.000Z | source/Userdocs/NML2_examples/izhikevich-single-neuron.py | NeuroML/Documentation | 06e355a8268c848b872b4e4c44d990b77b1fcb37 | [
"CC-BY-4.0"
] | 86 | 2020-11-05T12:32:01.000Z | 2022-03-30T22:45:00.000Z | source/Userdocs/NML2_examples/izhikevich-single-neuron.py | NeuroML/Documentation | 06e355a8268c848b872b4e4c44d990b77b1fcb37 | [
"CC-BY-4.0"
] | 2 | 2021-08-23T16:46:34.000Z | 2022-03-25T00:43:11.000Z | #!/usr/bin/env python3
"""
Simulating a regular spiking Izhikevich neuron with NeuroML.
File: izhikevich-single-neuron.py
"""
from neuroml import NeuroMLDocument
from neuroml import Izhikevich2007Cell
from neuroml import Population
from neuroml import Network
from neuroml import PulseGenerator
from neuroml import Exp... | 34.340659 | 80 | 0.74112 |
from neuroml import NeuroMLDocument
from neuroml import Izhikevich2007Cell
from neuroml import Population
from neuroml import Network
from neuroml import PulseGenerator
from neuroml import ExplicitInput
import neuroml.writers as writers
from neuroml.utils import validate_neuroml2
from pyneuroml import pynml
from pyne... | true | true |
f75912a0495a997cd2dec939ef5f75c91bee9d29 | 4,791 | py | Python | src/fklearn/metrics/pd_extractors.py | WesleyBatista/fklearn | 8e5b5e4575965c51c1416241a4ae2dc1d6679219 | [
"Apache-2.0"
] | 1 | 2021-02-25T19:31:31.000Z | 2021-02-25T19:31:31.000Z | src/fklearn/metrics/pd_extractors.py | beblueapp/fklearn | 7a606d246545de5ab68b2d9f38d0fdbeec6ca630 | [
"Apache-2.0"
] | null | null | null | src/fklearn/metrics/pd_extractors.py | beblueapp/fklearn | 7a606d246545de5ab68b2d9f38d0fdbeec6ca630 | [
"Apache-2.0"
] | null | null | null | import collections
from datetime import datetime
from itertools import chain, repeat
import pandas as pd
from toolz import curry
from numpy import nan
@curry
def evaluator_extractor(result, evaluator_name):
metric_value = result[evaluator_name] if result else nan
return pd.DataFrame({evaluator_name: [metric_... | 34.970803 | 120 | 0.740764 | import collections
from datetime import datetime
from itertools import chain, repeat
import pandas as pd
from toolz import curry
from numpy import nan
@curry
def evaluator_extractor(result, evaluator_name):
metric_value = result[evaluator_name] if result else nan
return pd.DataFrame({evaluator_name: [metric_... | true | true |
f7591434a92bd175d14ea639aa98b11124825217 | 35,389 | py | Python | venv/lib/python3.9/site-packages/google/cloud/spanner_v1/proto/spanner_pb2_grpc.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/google/cloud/spanner_v1/proto/spanner_pb2_grpc.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.9/site-packages/google/cloud/spanner_v1/proto/spanner_pb2_grpc.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
from google.cloud.spanner_v1.proto import (
result_set_pb2 as google_dot_cloud_dot_spanner__v1_dot_proto_dot_result__set__pb2,
)
from google.cloud.spanner_v1... | 43.157317 | 138 | 0.694453 |
import grpc
from google.cloud.spanner_v1.proto import (
result_set_pb2 as google_dot_cloud_dot_spanner__v1_dot_proto_dot_result__set__pb2,
)
from google.cloud.spanner_v1.proto import (
spanner_pb2 as google_dot_cloud_dot_spanner__v1_dot_proto_dot_spanner__pb2,
)
from google.cloud.spanner_v1.proto import (
... | true | true |
f7591457b101fc0db7e74e6440400554dd44cae4 | 10,245 | py | Python | src/spaceone/inventory/manager/instance_group_manager.py | spaceone-dev/plugin-google-cloud-cloudservices | 4566bfc54f4930801c47764eb7cfb1850038e9eb | [
"Apache-2.0"
] | 2 | 2021-09-09T06:10:30.000Z | 2021-09-09T06:44:02.000Z | src/spaceone/inventory/manager/instance_group_manager.py | spaceone-dev/plugin-google-cloud-cloudservices | 4566bfc54f4930801c47764eb7cfb1850038e9eb | [
"Apache-2.0"
] | 1 | 2021-12-10T03:39:19.000Z | 2021-12-10T03:39:19.000Z | src/spaceone/inventory/manager/instance_group_manager.py | spaceone-dev/plugin-google-cloud-service-inven-collector | f193278f887518bf49003045a1c702ba4b871e40 | [
"Apache-2.0"
] | 4 | 2020-10-19T02:35:11.000Z | 2021-07-15T08:00:36.000Z | import time
import logging
from spaceone.inventory.libs.manager import GoogleCloudManager
from spaceone.inventory.libs.schema.base import ReferenceModel
from spaceone.inventory.connector.instance_group import InstanceGroupConnector
from spaceone.inventory.model.instance_group.data import *
from spaceone.inventory.mode... | 41.987705 | 216 | 0.623621 | import time
import logging
from spaceone.inventory.libs.manager import GoogleCloudManager
from spaceone.inventory.libs.schema.base import ReferenceModel
from spaceone.inventory.connector.instance_group import InstanceGroupConnector
from spaceone.inventory.model.instance_group.data import *
from spaceone.inventory.mode... | true | true |
f7591748168f4b1662ff8b3c68b73dca1a4914e9 | 1,791 | py | Python | app/config/setting.py | zcxyun/snack-api-lin | 7b728c583f5467fcfffaf30ccf75c3e5ffefb7e5 | [
"MIT"
] | 1 | 2020-02-03T18:39:33.000Z | 2020-02-03T18:39:33.000Z | app/config/setting.py | zcxyun/snack-api-lin | 7b728c583f5467fcfffaf30ccf75c3e5ffefb7e5 | [
"MIT"
] | null | null | null | app/config/setting.py | zcxyun/snack-api-lin | 7b728c583f5467fcfffaf30ccf75c3e5ffefb7e5 | [
"MIT"
] | null | null | null | """
:copyright: © 2019 by the Lin team.
:license: MIT, see LICENSE for more details.
"""
from datetime import timedelta
class BaseConfig(object):
"""
基础配置
"""
# 分页配置
COUNT_DEFAULT = 10
PAGE_DEFAULT = 0
PAY_COUNTDOWN = 1800 # 单位秒
# 屏蔽 sql alchemy 的 FSADeprecationWarning
... | 28.887097 | 111 | 0.586265 |
from datetime import timedelta
class BaseConfig(object):
COUNT_DEFAULT = 10
PAGE_DEFAULT = 0
PAY_COUNTDOWN = 1800
SQLALCHEMY_TRACK_MODIFICATIONS = False
class DevelopmentConfig(BaseConfig):
DEBUG = True
SITE_DOMAIN = 'http://localhost:5000'
JWT_ACCESS_TOKEN_EXPIRES... | true | true |
f7591761523dc38f4a2946663b1ecfe9a56b02aa | 3,382 | py | Python | tests/system/reserves/balance/test_regulation_up.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | tests/system/reserves/balance/test_regulation_up.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | tests/system/reserves/balance/test_regulation_up.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | 1 | 2021-12-21T20:44:21.000Z | 2021-12-21T20:44:21.000Z | # Copyright 2016-2020 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 31.027523 | 87 | 0.683619 |
from __future__ import print_function
from builtins import str
from collections import OrderedDict
from importlib import import_module
import os.path
import sys
import unittest
from tests.common_functions import create_abstract_model, add_components_and_load_data
TEST_DATA_DIRECTORY = os.path.join(
... | true | true |
f75917eb5da6ea1b4bbb402d9b0d01e49c3438bd | 41,858 | py | Python | Plugins/UnrealEnginePython/Binaries/Win64/Lib/site-packages/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py | JustinACoder/H22-GR3-UnrealAI | 361eb9ef1147f8a2991e5f98c4118cd823184adf | [
"MIT"
] | 6 | 2022-02-04T18:12:24.000Z | 2022-03-21T23:57:12.000Z | Lib/site-packages/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/tensorflow/contrib/timeseries/python/timeseries/input_pipeline.py | shfkdroal/Robot-Learning-in-Mixed-Adversarial-and-Collaborative-Settings | 1fa4cd6a566c8745f455fc3d2273208f21f88ced | [
"bzip2-1.0.6"
] | 1 | 2022-02-08T03:53:23.000Z | 2022-02-08T03:53:23.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 48.279123 | 81 | 0.703904 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import abc
import numpy
from tensorflow.contrib.timeseries.python.timeseries import feature_keys
from tensorflow.contrib.timeseries.python.timeseries import model_utils
from tensor... | true | true |
f7591892a21c17f2024fa7e993cd4a2d0221fef7 | 4,016 | py | Python | tests/test_manage.py | james-portman/openstack-ansible | 882d98c94b6e429dec9d66d26722ed457e3b18b9 | [
"Apache-2.0"
] | null | null | null | tests/test_manage.py | james-portman/openstack-ansible | 882d98c94b6e429dec9d66d26722ed457e3b18b9 | [
"Apache-2.0"
] | null | null | null | tests/test_manage.py | james-portman/openstack-ansible | 882d98c94b6e429dec9d66d26722ed457e3b18b9 | [
"Apache-2.0"
] | 1 | 2018-05-21T18:41:51.000Z | 2018-05-21T18:41:51.000Z | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 31.622047 | 75 | 0.668327 |
import os
from os import path
import test_inventory
import unittest
TARGET_DIR = path.join(os.getcwd(), 'tests', 'inventory')
from osa_toolkit import manage as mi
def setUpModule():
test_inventory.make_config()
def tearDownModule():
os.remove(test_inventory.USER_CONFIG_FILE)
class TestExpo... | true | true |
f7591953c4ef243e50c8ba0b0d8821b5d4bf15d7 | 1,501 | py | Python | lib/sqlalchemy_json_querybuilder/commons/error_handlers/errors/errors.py | suyash248/sqlalchemy-json-querybuilder | 3deefd8935ce49c484a4936a751e9ccb5eb574a6 | [
"MIT"
] | 32 | 2018-06-21T17:07:57.000Z | 2021-11-29T14:04:40.000Z | lib/sqlalchemy_json_querybuilder/commons/error_handlers/errors/errors.py | suyash248/sqlalchemy-json-querybuilder | 3deefd8935ce49c484a4936a751e9ccb5eb574a6 | [
"MIT"
] | null | null | null | lib/sqlalchemy_json_querybuilder/commons/error_handlers/errors/errors.py | suyash248/sqlalchemy-json-querybuilder | 3deefd8935ce49c484a4936a751e9ccb5eb574a6 | [
"MIT"
] | 10 | 2018-12-11T10:00:16.000Z | 2022-02-12T14:07:31.000Z | __author__ = "Suyash Soni"
__email__ = "suyash.soni248@gmail.com"
import itertools
from ....constants.error_codes import DBErrorCode
class Error(object):
"""
Every time error needs to thrown, instance of this class must be used to represent an error.
"""
def __init__(self, error_constant, *fields, mes... | 35.738095 | 114 | 0.666889 | __author__ = "Suyash Soni"
__email__ = "suyash.soni248@gmail.com"
import itertools
from ....constants.error_codes import DBErrorCode
class Error(object):
def __init__(self, error_constant, *fields, message=None):
self.error_constant = error_constant or DBErrorCode.NON_STANDARD_ERROR
self.fields = ... | true | true |
f7591962c5ffd27143d1940fa0da54879476773d | 269 | py | Python | accountifie/celery/views.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 4 | 2017-06-02T08:48:48.000Z | 2021-11-21T23:57:15.000Z | accountifie/celery/views.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 3 | 2020-06-05T16:55:42.000Z | 2021-06-10T17:43:12.000Z | accountifie/celery/views.py | imcallister/accountifie | 094834c9d632e0353e3baf8d924eeb10cba0add4 | [
"MIT",
"Unlicense"
] | 4 | 2015-12-15T14:27:51.000Z | 2017-04-21T21:42:27.000Z |
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .apiv1 import tasks_in_progress
from django.http import JsonResponse
@login_required
def tasks_list(request):
return JsonResponse(tasks_in_progress(), safe=False)
| 24.454545 | 57 | 0.832714 |
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from .apiv1 import tasks_in_progress
from django.http import JsonResponse
@login_required
def tasks_list(request):
return JsonResponse(tasks_in_progress(), safe=False)
| true | true |
f75919958c10b872944d86660502ba1311a32886 | 282 | py | Python | formidable/json_migrations/0004_add_conditions.py | jayvdb/django-formidable | df8bcd0c882990d72d302be47aeb4fb11915b1fa | [
"MIT"
] | 11 | 2018-02-14T08:15:23.000Z | 2021-09-10T02:16:38.000Z | formidable/json_migrations/0004_add_conditions.py | jayvdb/django-formidable | df8bcd0c882990d72d302be47aeb4fb11915b1fa | [
"MIT"
] | 61 | 2017-11-27T10:15:43.000Z | 2021-06-28T14:17:25.000Z | formidable/json_migrations/0004_add_conditions.py | jayvdb/django-formidable | df8bcd0c882990d72d302be47aeb4fb11915b1fa | [
"MIT"
] | 2 | 2019-04-06T11:17:05.000Z | 2020-10-10T08:36:27.000Z | """
Add conditions as an empty list if it doesn't exist in the form.
This JSON migration is related to:
* 0004_formidable_conditions
* 0005_conditions_default
"""
def migrate(data):
if 'conditions' not in data:
data.setdefault('conditions', [])
return data
| 17.625 | 64 | 0.695035 |
def migrate(data):
if 'conditions' not in data:
data.setdefault('conditions', [])
return data
| true | true |
f7591abbaf171162c6d33b5a18b59a643bc0bff3 | 1,002 | py | Python | monitoring_system/drivers/sensors/SwitchSensor.py | NesterukSergey/Rpi_monitoring_study | a2e9431232ea59757b53dcbfdccf998178ed6264 | [
"MIT"
] | null | null | null | monitoring_system/drivers/sensors/SwitchSensor.py | NesterukSergey/Rpi_monitoring_study | a2e9431232ea59757b53dcbfdccf998178ed6264 | [
"MIT"
] | null | null | null | monitoring_system/drivers/sensors/SwitchSensor.py | NesterukSergey/Rpi_monitoring_study | a2e9431232ea59757b53dcbfdccf998178ed6264 | [
"MIT"
] | null | null | null | import time
from monitoring_system.drivers.sensors.Sensor import Sensor
class SwitchSensor(Sensor):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.__dict__.update(kwargs)
self.pin = self._get_wpi_pin(self.pin)
self._register_pins([], [self.pin])
if kwargs['... | 22.772727 | 59 | 0.547904 | import time
from monitoring_system.drivers.sensors.Sensor import Sensor
class SwitchSensor(Sensor):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.__dict__.update(kwargs)
self.pin = self._get_wpi_pin(self.pin)
self._register_pins([], [self.pin])
if kwargs['... | true | true |
f7591cb48ad0f5e32261c5167d7739b9af5bdf14 | 392 | py | Python | services/admin.py | shakyasaijal/businessAnalytics | 9312bae79709387c6eadd50f87f6be85bd52c396 | [
"BSD-3-Clause"
] | null | null | null | services/admin.py | shakyasaijal/businessAnalytics | 9312bae79709387c6eadd50f87f6be85bd52c396 | [
"BSD-3-Clause"
] | 8 | 2021-03-30T13:03:11.000Z | 2022-03-12T00:20:13.000Z | services/admin.py | shakyasaijal/businessAnalytics | 9312bae79709387c6eadd50f87f6be85bd52c396 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from django.contrib.admin import AdminSite
from . import models
class SuperAdmin(AdminSite):
site_header = "Saijal Shakya"
site_title = "Super Admin"
index_title = "Super Admin - Saijal Shakya"
super_admin_site = SuperAdmin(name='super_admin')
super_admin_site.register(... | 26.133333 | 51 | 0.790816 | from django.contrib import admin
from django.contrib.admin import AdminSite
from . import models
class SuperAdmin(AdminSite):
site_header = "Saijal Shakya"
site_title = "Super Admin"
index_title = "Super Admin - Saijal Shakya"
super_admin_site = SuperAdmin(name='super_admin')
super_admin_site.register(... | true | true |
f7591cfe92c943c187f5bced7c5e186a9bf85943 | 1,446 | py | Python | tools/mo/openvino/tools/mo/ops/constant_fill.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/openvino/tools/mo/ops/constant_fill.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/openvino/tools/mo/ops/constant_fill.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.front.common.partial_infer.utils import is_fully_defined
from openvino.tools.mo.graph.graph import Node, Graph
from openvino.tools.mo.ops.op import Op
class ConstantFill(Op):
""" Constant ... | 28.92 | 88 | 0.62379 |
import numpy as np
from openvino.tools.mo.front.common.partial_infer.utils import is_fully_defined
from openvino.tools.mo.graph.graph import Node, Graph
from openvino.tools.mo.ops.op import Op
class ConstantFill(Op):
op = 'ConstantFill'
enabled = False
def __init__(self, graph: Graph, attrs: dict):
... | true | true |
f7591d0afa92a19e84cc879517b1332811bc0776 | 639 | py | Python | leetcode/[cutz][2darray.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | 3 | 2019-11-26T14:31:01.000Z | 2020-01-10T18:19:46.000Z | leetcode/[cutz][2darray.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | leetcode/[cutz][2darray.py | cutz-j/AlgorithmStudy | de0f81220e29bd5e109d174800f507b12a3bee36 | [
"MIT"
] | null | null | null | class Solution:
def searchMatrix(self, matrix, target) -> bool:
"""
:type matrix: List[List[int]]
:type target: int
:rtype: bool
"""
if not matrix:
return False
row = 0
col = len(matrix[0]) - 1
while row <= len(matrix) - 1 and col... | 23.666667 | 52 | 0.471049 | class Solution:
def searchMatrix(self, matrix, target) -> bool:
if not matrix:
return False
row = 0
col = len(matrix[0]) - 1
while row <= len(matrix) - 1 and col >= 0:
if target == matrix[row][col]:
return True
elif target < matr... | true | true |
f7591d2dd1ab1d40e364386d56a8e899396c6cfa | 7,787 | py | Python | src/data.py | ebrunet28/MultiDecoder-DPRNN | 36fd6c35e730379e4f676a25eac451409a01f068 | [
"MIT"
] | 8 | 2021-01-22T07:33:55.000Z | 2022-01-14T03:11:55.000Z | src/data.py | ebrunet28/MultiDecoder-DPRNN | 36fd6c35e730379e4f676a25eac451409a01f068 | [
"MIT"
] | null | null | null | src/data.py | ebrunet28/MultiDecoder-DPRNN | 36fd6c35e730379e4f676a25eac451409a01f068 | [
"MIT"
] | 4 | 2021-02-28T13:30:21.000Z | 2022-03-28T12:47:08.000Z | """
Dataset classes for variable number of speakers
Author: Junzhe Zhu
"""
import numpy as np
import torch
import torch.utils.data as data
from librosa import load
from time import time
import glob
import os
import random
import json
from tqdm import tqdm
def load_json(filename):
with open(filename) as f:
d... | 44.752874 | 160 | 0.608835 | import numpy as np
import torch
import torch.utils.data as data
from librosa import load
from time import time
import glob
import os
import random
import json
from tqdm import tqdm
def load_json(filename):
with open(filename) as f:
data = json.load(f)
return data
def pad_audio(audio, len_samples=4*8000... | true | true |
f7591dc4084c8670976a18a99a469cf80c44bd41 | 7,143 | py | Python | kikimr/public/api/grpc/ydb_rate_limiter_v1_pb2_grpc.py | MihanixA/ydb-python-sdk | d1b93c6d2409a87c350acd604915576891d1e4f3 | [
"Apache-2.0"
] | 19 | 2019-07-01T08:25:29.000Z | 2022-01-26T14:46:51.000Z | kikimr/public/api/grpc/ydb_rate_limiter_v1_pb2_grpc.py | MihanixA/ydb-python-sdk | d1b93c6d2409a87c350acd604915576891d1e4f3 | [
"Apache-2.0"
] | 5 | 2019-07-02T13:36:42.000Z | 2021-09-14T06:46:48.000Z | kikimr/public/api/grpc/ydb_rate_limiter_v1_pb2_grpc.py | MihanixA/ydb-python-sdk | d1b93c6d2409a87c350acd604915576891d1e4f3 | [
"Apache-2.0"
] | 10 | 2019-06-07T10:36:19.000Z | 2021-10-15T08:58:11.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from kikimr.public.api.protos import ydb_rate_limiter_pb2 as kikimr_dot_public_dot_api_dot_protos_dot_ydb__rate__limiter__pb2
class RateLimiterServiceStub(object):
"""Service that implements distributed rate limiting.
To use rate l... | 51.76087 | 138 | 0.801764 |
import grpc
from kikimr.public.api.protos import ydb_rate_limiter_pb2 as kikimr_dot_public_dot_api_dot_protos_dot_ydb__rate__limiter__pb2
class RateLimiterServiceStub(object):
def __init__(self, channel):
self.CreateResource = channel.unary_unary(
'/Ydb.RateLimiter.V1.RateLimiterService/CreateResourc... | true | true |
f7591f3007635998eb3363d2f9950511d4f005a6 | 79 | py | Python | ipydatawidgets/_version.py | consideRatio/ipydatawidgets | 69eebeb5647d58dec6bf459d424727cb23cce8ab | [
"BSD-3-Clause"
] | null | null | null | ipydatawidgets/_version.py | consideRatio/ipydatawidgets | 69eebeb5647d58dec6bf459d424727cb23cce8ab | [
"BSD-3-Clause"
] | null | null | null | ipydatawidgets/_version.py | consideRatio/ipydatawidgets | 69eebeb5647d58dec6bf459d424727cb23cce8ab | [
"BSD-3-Clause"
] | null | null | null | version_info = (4, 0, 2, 'dev')
__version__ = ".".join(map(str, version_info))
| 26.333333 | 46 | 0.64557 | version_info = (4, 0, 2, 'dev')
__version__ = ".".join(map(str, version_info))
| true | true |
f75920b0cb1a9cfe40c792b2b99724d0a01761a7 | 1,834 | py | Python | src/homework4/q6/get_state.py | skymarshal/cs229-machine-learning-stanford-fall-2016 | 3f9e0f4ea7d4fe73a50dc12c84fe47131bb0622a | [
"Apache-2.0",
"MIT"
] | 13 | 2019-08-22T03:15:36.000Z | 2021-06-29T15:50:34.000Z | src/homework4/q6/get_state.py | skymarshal/cs229-machine-learning-stanford-fall-2016 | 3f9e0f4ea7d4fe73a50dc12c84fe47131bb0622a | [
"Apache-2.0",
"MIT"
] | null | null | null | src/homework4/q6/get_state.py | skymarshal/cs229-machine-learning-stanford-fall-2016 | 3f9e0f4ea7d4fe73a50dc12c84fe47131bb0622a | [
"Apache-2.0",
"MIT"
] | 8 | 2019-09-29T13:12:20.000Z | 2020-10-21T14:15:31.000Z | import numpy as np
def get_state(x, x_dot, theta, theta_dot):
"""
This function returns a discretized value (a number) for a continuous
state vector. Currently x is divided into 3 "boxes", x_dot into 3,
theta into 6 and theta_dot into 3. A finer discretization produces a
larger state space, but al... | 27.787879 | 88 | 0.533261 | import numpy as np
def get_state(x, x_dot, theta, theta_dot):
one_degree = 0.0174532
six_degrees = 0.1047192
twelve_degrees = 0.2094384
fifty_degrees = 0.87266
total_states = 163
state = 0
if (x < -2.4) or (x > 2.4) or (theta < -twelve_degrees) or (theta > twelve_degrees)... | true | true |
f75920cf6c67e18ab9c30ef2ef86987b3db9a0e4 | 1,654 | py | Python | huaweicloud-sdk-eip/setup.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-eip/setup.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-eip/setup.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
from os import path
from setuptools import setup, find_packages
NAME = "huaweicloudsdkeip"
VERSION = "3.0.67"
AUTHOR = "HuaweiCloud SDK"
AUTHOR_EMAIL = "hwcloudsdk@huawei.com"
URL = "https://github.com/huaweicloud/huaweicloud-sdk-python-v3"
DESCRIPTION = "EIP"
this_directory = path.abspath(path.dirna... | 29.535714 | 78 | 0.646917 |
from os import path
from setuptools import setup, find_packages
NAME = "huaweicloudsdkeip"
VERSION = "3.0.67"
AUTHOR = "HuaweiCloud SDK"
AUTHOR_EMAIL = "hwcloudsdk@huawei.com"
URL = "https://github.com/huaweicloud/huaweicloud-sdk-python-v3"
DESCRIPTION = "EIP"
this_directory = path.abspath(path.dirname(__file__))
w... | true | true |
f759237b10317231c65c1210a95783df20e04568 | 4,997 | py | Python | numba/cuda/libdevice.py | ludaavics/numba | d630c1cc7f261365aa92f6e3437abaaa185d8482 | [
"BSD-2-Clause"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | numba/cuda/libdevice.py | ludaavics/numba | d630c1cc7f261365aa92f6e3437abaaa185d8482 | [
"BSD-2-Clause"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | numba/cuda/libdevice.py | ludaavics/numba | d630c1cc7f261365aa92f6e3437abaaa185d8482 | [
"BSD-2-Clause"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import sys
import math
from llvmlite.llvmpy.core import Type
from numba.core import types, cgutils
from numba.core.imputils import Registry
registry = Registry()
lower = registry.lower
float_set = types.float32, types.float64
def bool_implement(nvname, ty):
def core(context, builder, sig, args):
assert ... | 34.701389 | 73 | 0.656994 | import sys
import math
from llvmlite.llvmpy.core import Type
from numba.core import types, cgutils
from numba.core.imputils import Registry
registry = Registry()
lower = registry.lower
float_set = types.float32, types.float64
def bool_implement(nvname, ty):
def core(context, builder, sig, args):
assert ... | true | true |
f75923f19b8cd05235693c207cf8041571630b6e | 609 | py | Python | tests/integration/util.py | jaipradeesh/plaid-python | fbd9d980c05caa1c852781ddfa5f46a102868262 | [
"MIT"
] | null | null | null | tests/integration/util.py | jaipradeesh/plaid-python | fbd9d980c05caa1c852781ddfa5f46a102868262 | [
"MIT"
] | null | null | null | tests/integration/util.py | jaipradeesh/plaid-python | fbd9d980c05caa1c852781ddfa5f46a102868262 | [
"MIT"
] | null | null | null | '''Shared objects for integration testing.'''
import os
from plaid import Client
def create_client():
'''Create a new client for testing.'''
return Client(os.environ['CLIENT_ID'],
os.environ['SECRET'],
os.environ['PUBLIC_KEY'],
'sandbox',
... | 21.75 | 55 | 0.599343 |
import os
from plaid import Client
def create_client():
return Client(os.environ['CLIENT_ID'],
os.environ['SECRET'],
os.environ['PUBLIC_KEY'],
'sandbox',
api_version="2019-05-29",
client_app="plaid-python-unit-tests")
SA... | true | true |
f75924674e680dcd9f953cc9b579afb4c07b6a8c | 5,892 | py | Python | path_prediction/utils/process_file_trajnetplusplus.py | cimat-ris/OF-PathPred | 85ca275707e5988491d0a510b9d31883824411db | [
"Apache-2.0"
] | 1 | 2020-02-20T16:24:28.000Z | 2020-02-20T16:24:28.000Z | path_prediction/utils/process_file_trajnetplusplus.py | cimat-ris/OF-PathPred | 85ca275707e5988491d0a510b9d31883824411db | [
"Apache-2.0"
] | 2 | 2020-04-11T16:27:22.000Z | 2020-10-18T18:56:53.000Z | path_prediction/utils/process_file_trajnetplusplus.py | cimat-ris/OF-PathPred | 85ca275707e5988491d0a510b9d31883824411db | [
"Apache-2.0"
] | null | null | null | import os, glob, sys, logging, math
from tqdm import tqdm
import numpy as np
from .interaction_optical_flow import OpticalFlowSimulator
from .obstacles import load_world_obstacle_polygons
# Since it is used as a submodule, the trajnetplusplustools directory should be there
sys.path.append("../../trajnetplusplustools")
... | 51.684211 | 152 | 0.674134 | import os, glob, sys, logging, math
from tqdm import tqdm
import numpy as np
from .interaction_optical_flow import OpticalFlowSimulator
from .obstacles import load_world_obstacle_polygons
sys.path.append("../../trajnetplusplustools")
from trajnetplusplustools import Reader
def prepare_data_trajnetplusplus(datasets_pa... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.