hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1d957d9277fe8b42e0dc8899243950b6c3b13e4e | 5,787 | py | Python | test_ssd7.py | stanley-king/ssd_kerasex | 54100732342076815113b48c1720898a70f6806e | [
"Apache-2.0"
] | null | null | null | test_ssd7.py | stanley-king/ssd_kerasex | 54100732342076815113b48c1720898a70f6806e | [
"Apache-2.0"
] | null | null | null | test_ssd7.py | stanley-king/ssd_kerasex | 54100732342076815113b48c1720898a70f6806e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
File for testing SSD 7 model
"""
from tensorflow import keras
K = keras.backend
Input = keras.layers.Input
Model = keras.models.Model
Progbar = keras.utils.Progbar
Adam = keras.optimizers.Adam
CSVLogger = keras.callbacks.CSVLogger
ModelCheckpoint = keras.callbacks.Mo... | 41.335714 | 118 | 0.640228 |
15334fb1949b7436ec12f0f4c8d5e0a00d5a51c1 | 4,010 | py | Python | analytical/templatetags/matomo.py | qyl2021/project | 37009f2e08e78d41ddc1bdd1e940f195c3ae4352 | [
"MIT"
] | 454 | 2018-12-03T08:16:19.000Z | 2022-03-28T13:30:59.000Z | analytical/templatetags/matomo.py | qyl2021/project | 37009f2e08e78d41ddc1bdd1e940f195c3ae4352 | [
"MIT"
] | 88 | 2015-02-25T20:56:32.000Z | 2018-11-15T19:46:36.000Z | analytical/templatetags/matomo.py | qyl2021/project | 37009f2e08e78d41ddc1bdd1e940f195c3ae4352 | [
"MIT"
] | 71 | 2015-01-04T15:10:30.000Z | 2018-09-27T18:16:02.000Z | """
Matomo template tags and filters.
"""
import re
from collections import namedtuple
from itertools import chain
from django.conf import settings
from django.template import Library, Node, TemplateSyntaxError
from analytical.utils import (
disable_html,
get_identity,
get_required_setting,
is_intern... | 33.416667 | 110 | 0.613716 |
0a954fa9830c3394b2524b72cdbefe15b29a27e7 | 693 | py | Python | paddleseg/__init__.py | shiyutang/UperNet | 836762b7c0c46023f091d991b5cde7df2dda8bd6 | [
"Apache-2.0"
] | 3 | 2021-09-11T03:44:58.000Z | 2022-01-04T12:15:42.000Z | paddleseg/__init__.py | shiyutang/UperNet | 836762b7c0c46023f091d991b5cde7df2dda8bd6 | [
"Apache-2.0"
] | null | null | null | paddleseg/__init__.py | shiyutang/UperNet | 836762b7c0c46023f091d991b5cde7df2dda8bd6 | [
"Apache-2.0"
] | 4 | 2021-11-04T08:39:07.000Z | 2021-12-27T06:49:17.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 38.5 | 75 | 0.741703 |
f2268cd6277840ee6fb9e6cb6594c0f587f5c51f | 23,131 | py | Python | Models/train_diag.py | ianxmason/Fewshot_Learning_of_Homogeneous_Human_Locomotion_Styles | 7fc993e9f918d30cfc19b6560963d7d7358209e1 | [
"MIT"
] | 25 | 2019-01-03T20:10:41.000Z | 2022-03-21T06:42:51.000Z | Models/train_diag.py | ianxmason/Fewshot_Learning_of_Homogeneous_Human_Locomotion_Styles | 7fc993e9f918d30cfc19b6560963d7d7358209e1 | [
"MIT"
] | null | null | null | Models/train_diag.py | ianxmason/Fewshot_Learning_of_Homogeneous_Human_Locomotion_Styles | 7fc993e9f918d30cfc19b6560963d7d7358209e1 | [
"MIT"
] | 1 | 2019-03-06T23:39:49.000Z | 2019-03-06T23:39:49.000Z | import sys
import numpy as np
import theano
import theano.tensor as T
import time
theano.config.allow_gc = True
sys.path.append('./nn')
from Layer import Layer
from HiddenLayer import HiddenLayer
from BiasLayer import BiasLayer
from DropoutLayer import DropoutLayer
from ActivationLayer import ActivationLayer... | 50.175705 | 231 | 0.631663 |
db0aa93bf382cfe9a9103f22a1f0de9464226fdf | 1,111 | py | Python | data/tests/reader.py | drkpkg/codigo_control | 12159468981bec2ea75455e9dad739e863bc4799 | [
"MIT"
] | 3 | 2017-12-22T22:07:02.000Z | 2018-02-24T18:01:45.000Z | data/tests/reader.py | drkpkg/codigo_control | 12159468981bec2ea75455e9dad739e863bc4799 | [
"MIT"
] | null | null | null | data/tests/reader.py | drkpkg/codigo_control | 12159468981bec2ea75455e9dad739e863bc4799 | [
"MIT"
] | null | null | null | from data.lib.impuestos_internos import ImpuestosInternosHelper
class Reader():
def __init__(self, file):
self.file = open(file, 'r')
self.impuestos = ImpuestosInternosHelper()
def generate_test(self):
lines = self.file.readlines()
lines.pop(0)
case_result = 0
f... | 34.71875 | 69 | 0.490549 |
5efc9596aa75a5600fc62a1e2dd1eed0cd965fb7 | 2,258 | py | Python | pandora/evaluation.py | mikekestemont/pandora | ecae769c8dac5cce563da114be923d22eec6656d | [
"MIT"
] | 2 | 2016-02-19T10:23:17.000Z | 2016-09-28T16:14:41.000Z | pandora/evaluation.py | mikekestemont/pandora | ecae769c8dac5cce563da114be923d22eec6656d | [
"MIT"
] | 6 | 2016-06-22T12:40:57.000Z | 2018-04-16T08:39:52.000Z | pandora/evaluation.py | mikekestemont/pandora | ecae769c8dac5cce563da114be923d22eec6656d | [
"MIT"
] | 3 | 2016-01-10T10:24:53.000Z | 2017-02-06T13:47:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from collections import Counter
from operator import itemgetter
import numpy as np
def single_label_accuracies(gold, silver, test_tokens, known_tokens,
print_scores=True):
"""
Calculate accuracies ... | 27.536585 | 70 | 0.584588 |
e9580ecfb675eaf62ed3fcfa6f6ac1c8a0952904 | 3,406 | py | Python | functional/tests/identity/v2/test_project.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | functional/tests/identity/v2/test_project.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | functional/tests/identity/v2/test_project.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"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
# dist... | 39.149425 | 78 | 0.636817 |
776c03a813cbbf0124f15646a0850f3bdd9e2d1f | 1,059 | py | Python | python/benchmark/variable.py | g5t/scipp | d819c930a5e438fd65e42e2e4e737743b8d39d37 | [
"BSD-3-Clause"
] | null | null | null | python/benchmark/variable.py | g5t/scipp | d819c930a5e438fd65e42e2e4e737743b8d39d37 | [
"BSD-3-Clause"
] | null | null | null | python/benchmark/variable.py | g5t/scipp | d819c930a5e438fd65e42e2e4e737743b8d39d37 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2021 Scipp contributors (https://github.com/scipp)
# @file
import time
import scipp as sc
from scipp import Dim
import numpy as np
def assign_from_numpy_1d(size):
a = np.arange(size, dtype=np.float64)
v = sc.Variable([Dim.X], a)
n_iterations = 10
... | 24.068182 | 72 | 0.652502 |
97a943c9fd7020912bb55c6fe7d2b0fdda073a0a | 397 | py | Python | catch/datasets/human_rubulavirus_2.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 58 | 2018-01-24T16:31:37.000Z | 2022-02-25T07:46:35.000Z | catch/datasets/human_rubulavirus_2.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 29 | 2018-04-17T17:36:06.000Z | 2022-02-25T11:48:58.000Z | catch/datasets/human_rubulavirus_2.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 16 | 2018-05-23T12:19:41.000Z | 2021-08-09T04:16:00.000Z | """Dataset with 'Human rubulavirus 2' sequences.
A dataset with 38 'Human rubulavirus 2' genomes.
THIS PYTHON FILE WAS GENERATED BY A COMPUTER PROGRAM! DO NOT EDIT!
"""
import sys
from catch.datasets import GenomesDatasetSingleChrom
ds = GenomesDatasetSingleChrom(__name__, __file__, __spec__)
ds.add_fasta_path("d... | 24.8125 | 69 | 0.790932 |
01ad95c9ef2c34007dc815ca31a510d8ff405a0b | 17,158 | py | Python | printer/http.py | KosukeHao/terminal_printer | 8bc541e5c339e4bd26af17f5a6410282f4648f1f | [
"MIT"
] | 1 | 2020-09-01T11:55:56.000Z | 2020-09-01T11:55:56.000Z | printer/http.py | KosukeHao/terminal_printer | 8bc541e5c339e4bd26af17f5a6410282f4648f1f | [
"MIT"
] | null | null | null | printer/http.py | KosukeHao/terminal_printer | 8bc541e5c339e4bd26af17f5a6410282f4648f1f | [
"MIT"
] | null | null | null | # coding=utf8
import socket
import math
import sys
import ssl
import os
from subprocess import check_output
from itertools import cycle
from functools import wraps
from time import time
__all__ = ['SockFeed', 'HTTPCons', 'unit_change', 'bar']
def bar(width=0, fill='#'):
"""
进度条处理
:param width: 手动设置进度条宽度... | 34.592742 | 124 | 0.505537 |
0857d21bee55be507c5085749bd4eb0981b2c912 | 3,012 | py | Python | src/wechaty_plugin_contrib/contrib/daily_plugin.py | xinyu3ru/python-wechaty-plugin-contrib | 2fc6ee19438ac29266acb133613f83d3aee3c7c3 | [
"Apache-2.0"
] | 11 | 2020-06-11T15:11:27.000Z | 2022-03-06T01:19:22.000Z | src/wechaty_plugin_contrib/contrib/daily_plugin.py | xinyu3ru/python-wechaty-plugin-contrib | 2fc6ee19438ac29266acb133613f83d3aee3c7c3 | [
"Apache-2.0"
] | 6 | 2020-12-01T14:26:36.000Z | 2021-09-29T03:05:29.000Z | src/wechaty_plugin_contrib/contrib/daily_plugin.py | xinyu3ru/python-wechaty-plugin-contrib | 2fc6ee19438ac29266acb133613f83d3aee3c7c3 | [
"Apache-2.0"
] | 5 | 2020-06-25T11:31:39.000Z | 2021-08-05T05:34:02.000Z | """daily plugin"""
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Union, List, Any, Callable
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from apscheduler.schedulers.base import BaseScheduler
from wechaty import Wechaty, get_logger, Room, Contact
from ... | 32.73913 | 77 | 0.63081 |
3f3a9229a38a538050691cb8a24699e97dab7cef | 7,267 | py | Python | rpython/rlib/_rweakkeydict.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/rlib/_rweakkeydict.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/rlib/_rweakkeydict.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | from rpython.flowspace.model import Constant
from rpython.rtyper.lltypesystem import lltype, llmemory, rdict
from rpython.rtyper.lltypesystem.llmemory import weakref_create, weakref_deref
from rpython.rtyper import rclass
from rpython.rtyper.rclass import getinstancerepr
from rpython.rtyper.rmodel import Repr
from rpyt... | 34.440758 | 79 | 0.645934 |
d2f4d4110037e9920470c3e6072ae4a5ed91732c | 3,055 | py | Python | tests/test_pressureProfile.py | metocean/tcrm | ea782c8a6245419105a0a131ebe8ec61479feb25 | [
"CC-BY-4.0"
] | null | null | null | tests/test_pressureProfile.py | metocean/tcrm | ea782c8a6245419105a0a131ebe8ec61479feb25 | [
"CC-BY-4.0"
] | null | null | null | tests/test_pressureProfile.py | metocean/tcrm | ea782c8a6245419105a0a131ebe8ec61479feb25 | [
"CC-BY-4.0"
] | null | null | null | """
Tropical Cyclone Risk Model (TCRM) - Version 1.0
Copyright (C) 2011 Commonwealth of Australia (Geoscience Australia)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either ver... | 34.715909 | 99 | 0.727332 |
5ee35190c9ec501037dc4a9299aef19c6ddb5ece | 13,597 | py | Python | torchmetrics/functional/classification/accuracy.py | Sharpiless/metrics | 17130f198f0a5de024a992b83a1c13c9f0863e86 | [
"Apache-2.0"
] | 1 | 2021-07-12T02:52:04.000Z | 2021-07-12T02:52:04.000Z | torchmetrics/functional/classification/accuracy.py | Sharpiless/metrics | 17130f198f0a5de024a992b83a1c13c9f0863e86 | [
"Apache-2.0"
] | null | null | null | torchmetrics/functional/classification/accuracy.py | Sharpiless/metrics | 17130f198f0a5de024a992b83a1c13c9f0863e86 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 44.874587 | 116 | 0.655365 |
450024da7bd442f0e419ecf000c4f959183eefd8 | 1,258 | py | Python | pyqtgraph/examples/GraphicsScene.py | secantsquared/pyqtgraph | 3ef7f5b91639543e43bcd66a84290fb9bc18fc5c | [
"MIT"
] | null | null | null | pyqtgraph/examples/GraphicsScene.py | secantsquared/pyqtgraph | 3ef7f5b91639543e43bcd66a84290fb9bc18fc5c | [
"MIT"
] | null | null | null | pyqtgraph/examples/GraphicsScene.py | secantsquared/pyqtgraph | 3ef7f5b91639543e43bcd66a84290fb9bc18fc5c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph as pg
from pyqtgraph.GraphicsScene import GraphicsScene
app = pg.mkQApp("GraphicsScene Example")
win = pg.GraphicsView()
win.show()
class Obj(QtGui.QGraphicsObject):
def __init__(self):
QtGui.QGraphicsObject.__init__(self)
... | 20.966667 | 56 | 0.616852 |
d596a0c28f193b264342fe6f1eb1a72bdea627f1 | 267 | py | Python | tests/00_simple-listing.py | Hakujou/osc-sdk-python | 5689ff66777c4f219e9b8483378c35af871cc996 | [
"BSD-3-Clause"
] | null | null | null | tests/00_simple-listing.py | Hakujou/osc-sdk-python | 5689ff66777c4f219e9b8483378c35af871cc996 | [
"BSD-3-Clause"
] | null | null | null | tests/00_simple-listing.py | Hakujou/osc-sdk-python | 5689ff66777c4f219e9b8483378c35af871cc996 | [
"BSD-3-Clause"
] | null | null | null | import sys
sys.path.append("..")
from osc_sdk_python import Gateway
gw = Gateway()
vms = gw.ReadVms()
assert(isinstance(vms, dict))
assert(isinstance(vms["Vms"], list))
vols = gw.ReadVolumes()
assert(isinstance(vols, dict))
assert(isinstance(vols["Volumes"], list))
| 22.25 | 41 | 0.730337 |
1f7c7ec4ac298b3d93b944def50d70b0c8340b55 | 8,743 | py | Python | scipy/stats/__init__.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 39 | 2016-11-08T11:24:30.000Z | 2021-11-18T06:50:21.000Z | scipy/stats/__init__.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 1 | 2015-09-30T05:26:54.000Z | 2016-03-22T15:09:56.000Z | scipy/stats/__init__.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 13 | 2017-04-08T08:03:12.000Z | 2021-08-25T08:38:52.000Z | """
==========================================
Statistical functions (:mod:`scipy.stats`)
==========================================
.. module:: scipy.stats
This module contains a large number of probability distributions as
well as a growing library of statistical functions.
Each univariate distribution is an insta... | 26.098507 | 94 | 0.577834 |
3537d999b44787dde6af848029c63d55a15b08f1 | 955 | py | Python | individual_1.py | daniilstudent/lab_7 | e57057fe40eda4c287949e92b394a15ae8de753f | [
"MIT"
] | null | null | null | individual_1.py | daniilstudent/lab_7 | e57057fe40eda4c287949e92b394a15ae8de753f | [
"MIT"
] | null | null | null | individual_1.py | daniilstudent/lab_7 | e57057fe40eda4c287949e92b394a15ae8de753f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Написать программу, которая считывает английский текст из файла и выводит его на экран,
# заменив каждую первую букву слов, начинающихся с гласной буквы, на прописную.
if __name__ == '__main__':
with open('textineng.txt', 'r') as f:
textineng = f.read()
... | 29.84375 | 89 | 0.535079 |
3eb08b84faeb50ab36b20204b85e38dd6f65c61c | 19,746 | py | Python | midgard/dev/plugins.py | skjaeve/midgard | afcb1e30236436b63b1232bf54b6531b574676be | [
"MIT"
] | null | null | null | midgard/dev/plugins.py | skjaeve/midgard | afcb1e30236436b63b1232bf54b6531b574676be | [
"MIT"
] | null | null | null | midgard/dev/plugins.py | skjaeve/midgard | afcb1e30236436b63b1232bf54b6531b574676be | [
"MIT"
] | null | null | null | """Set up a plug-in architecture for Midgard
Description:
------------
In order to be able to add models, parsers, data sources etc without needing to
hardcode names, but rather pick them from configuration files, we use a simple
plug-in architecture. The plug-in mechanism is based on the different plug-ins
registeri... | 37.397727 | 119 | 0.681201 |
21cc294755aa5a6e7a6d2ccbfe6cbac045c6288f | 2,994 | py | Python | model.py | indonoso/DNN-Project | 2e798d95616347c1f856fa8669011bcdfb74e131 | [
"MIT"
] | null | null | null | model.py | indonoso/DNN-Project | 2e798d95616347c1f856fa8669011bcdfb74e131 | [
"MIT"
] | null | null | null | model.py | indonoso/DNN-Project | 2e798d95616347c1f856fa8669011bcdfb74e131 | [
"MIT"
] | null | null | null | import torch
from machine_comprehension.models import MatchLSTM
class MatchLSTMModified(torch.nn.Module):
def __init__(self, device, network_input_size, match_lstm_input_size, word_embedding=False, part_of_speech=False,
knowledge_graph=False, hidden_size=150):
super().__init__()
s... | 47.52381 | 117 | 0.681029 |
bc5223961a5917a1e74cf060d851d3098c255703 | 260 | py | Python | config.py | Fillipedem/quora-insincere-questions | 1ad51be239f41958e7b1b51402f189079048dba1 | [
"MIT"
] | 1 | 2022-01-22T08:19:34.000Z | 2022-01-22T08:19:34.000Z | config.py | Fillipedem/quora-insincere-questions | 1ad51be239f41958e7b1b51402f189079048dba1 | [
"MIT"
] | 6 | 2022-03-24T07:51:48.000Z | 2022-03-30T08:54:51.000Z | open_needs_server/config.py | open-needs/open-needs-server | 352abf0866ab9ba17ab7acb7a584f5fec0778941 | [
"MIT"
] | null | null | null |
from dynaconf import Dynaconf
settings = Dynaconf(
envvar_prefix="DYNACONF",
settings_files=['settings.toml', '.secrets.toml'],
)
# `envvar_prefix` = export envvars with `export DYNACONF_FOO=bar`.
# `settings_files` = Load these files in the order.
| 23.636364 | 66 | 0.726923 |
ad4bdb2dfdef4ff36919d4eb3d2c65b4d49a8f13 | 11,986 | py | Python | sympy/solvers/tests/test_inequalities.py | eriknw/sympy | b7544e2bb74c011f6098a7e886fd77f41776c2c4 | [
"BSD-3-Clause"
] | 7 | 2015-01-14T06:55:33.000Z | 2018-08-11T14:43:52.000Z | sympy/solvers/tests/test_inequalities.py | pbeltran/sympy-1 | 94f92b36731c2bebe6de1037c063c2a258a8a399 | [
"BSD-3-Clause"
] | 1 | 2018-02-19T04:56:04.000Z | 2018-02-19T04:56:04.000Z | sympy/solvers/tests/test_inequalities.py | pbeltran/sympy-1 | 94f92b36731c2bebe6de1037c063c2a258a8a399 | [
"BSD-3-Clause"
] | 1 | 2016-04-24T14:39:22.000Z | 2016-04-24T14:39:22.000Z | """Tests for tools for solving inequalities and systems of inequalities. """
from __future__ import with_statement
from sympy import (And, Eq, FiniteSet, Ge, Gt, im, Interval, Le, Lt, Ne, oo,
Or, Q, re, S, sin, sqrt, Union)
from sympy.assumptions import assuming
from sympy.abc import x, y
from sympy.solvers.in... | 53.035398 | 198 | 0.584932 |
cddf6fde2545a59b5bd7a172b22ae0f178b5cb44 | 1,728 | py | Python | pomodoro_system/pomodoros_infrastructure/tests/repositories/test_pauses.py | kamil559/pomodorr_v2 | 33b53db4f1e82025b186e551a4e55840ee75c740 | [
"MIT"
] | null | null | null | pomodoro_system/pomodoros_infrastructure/tests/repositories/test_pauses.py | kamil559/pomodorr_v2 | 33b53db4f1e82025b186e551a4e55840ee75c740 | [
"MIT"
] | null | null | null | pomodoro_system/pomodoros_infrastructure/tests/repositories/test_pauses.py | kamil559/pomodorr_v2 | 33b53db4f1e82025b186e551a4e55840ee75c740 | [
"MIT"
] | null | null | null | import uuid
from datetime import datetime, timedelta
import pytest
import pytz
from foundation.exceptions import NotFound
from pomodoros.domain.entities.pause import Pause
from pomodoros_infrastructure.repositories import SQLPauseRepository
from pony.orm import db_session, flush
@pytest.mark.usefixtures("setup_teard... | 35.265306 | 89 | 0.718171 |
508f015c7f5ac2bc9c8d028771a5269764ebba3e | 21,502 | py | Python | SimPEG/Mesh/TensorMesh.py | KyuboNoh/HY | 8ba9815137c2cff2f1931a1940e1b762e8df0b02 | [
"MIT"
] | 1 | 2020-11-27T03:26:22.000Z | 2020-11-27T03:26:22.000Z | SimPEG/Mesh/TensorMesh.py | KyuboNoh/HY | 8ba9815137c2cff2f1931a1940e1b762e8df0b02 | [
"MIT"
] | null | null | null | SimPEG/Mesh/TensorMesh.py | KyuboNoh/HY | 8ba9815137c2cff2f1931a1940e1b762e8df0b02 | [
"MIT"
] | null | null | null | from SimPEG import Utils, np, sp
from BaseMesh import BaseMesh, BaseRectangularMesh
from View import TensorView
from DiffOperators import DiffOperators
from InnerProducts import InnerProducts
from MeshIO import TensorMeshIO
class BaseTensorMesh(BaseMesh):
__metaclass__ = Utils.SimPEGMetaClass
_meshType = 'BA... | 38.396429 | 135 | 0.530323 |
59c383007ad6dcea48f1c969bdab3dd498669519 | 53,641 | py | Python | theano/sandbox/rng_mrg.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/rng_mrg.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | theano/sandbox/rng_mrg.py | jych/Theano | d7d722faa96aac95c19f460bf60e8e8654ff58df | [
"BSD-3-Clause"
] | null | null | null | """
Implementation of MRG31k3p random number generator for Theano
Generator code in SSJ package (L'Ecuyer & Simard)
http://www.iro.umontreal.ca/~simardr/ssj/indexe.html
"""
from __future__ import print_function
import warnings
import numpy
from six.moves import xrange
from theano import Op, Apply, shared, config, V... | 36.892022 | 156 | 0.530434 |
d7e447597438091026dfa3df5d397227f4699bff | 1,285 | py | Python | users/migrations/0002_create_super_user.py | pawelkonior/idoctor_2 | 58e2835cea813921fbaa47cc0d65b93e4539d5b0 | [
"Beerware"
] | 1 | 2021-07-12T10:22:29.000Z | 2021-07-12T10:22:29.000Z | users/migrations/0002_create_super_user.py | pawelkonior/idoctor_2 | 58e2835cea813921fbaa47cc0d65b93e4539d5b0 | [
"Beerware"
] | null | null | null | users/migrations/0002_create_super_user.py | pawelkonior/idoctor_2 | 58e2835cea813921fbaa47cc0d65b93e4539d5b0 | [
"Beerware"
] | 1 | 2021-07-01T10:37:12.000Z | 2021-07-01T10:37:12.000Z | import os
from django.db import migrations
def generate_superuser(apps, schema_editor):
from django.contrib.auth import get_user_model
from users.models import Nationality
User = get_user_model()
nationality = Nationality.objects.create(iso='EN', full_name='England')
from users.models import Add... | 29.204545 | 107 | 0.668482 |
af773ca7fb5e1ae12892ef1426cd84cd1ad5c715 | 8,937 | py | Python | sweetpea/tests/test_logic.py | anniecherk/sweetpea-py | 23dbad99a9213ff764ec207b456cf5d002707fd0 | [
"MIT"
] | 1 | 2018-05-06T03:54:06.000Z | 2018-05-06T03:54:06.000Z | sweetpea/tests/test_logic.py | anniecherk/sweetpea-py | 23dbad99a9213ff764ec207b456cf5d002707fd0 | [
"MIT"
] | 5 | 2018-09-18T02:15:17.000Z | 2018-12-05T20:02:24.000Z | sweetpea/tests/test_logic.py | anniecherk/sweetpea-py | 23dbad99a9213ff764ec207b456cf5d002707fd0 | [
"MIT"
] | null | null | null | from sweetpea.logic import Iff, And, Or, Not, to_cnf_naive, to_cnf_switching, to_cnf_tseitin, cnf_to_json
def test_to_cnf_naive():
assert to_cnf_naive(1, 2) == (And([1]), 2)
assert to_cnf_naive(And([1]), 2) == (And([1]), 2)
assert to_cnf_naive(And([1, 2]), 3) == (And([1, 2]), 3)
assert to_cnf_naive(O... | 28.103774 | 105 | 0.536645 |
00321a815804ddae47fc1e78bd989f1117a7309d | 3,357 | py | Python | supplements/migrations/0002_auto__add_datalayer.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | 3 | 2015-05-25T07:41:42.000Z | 2020-05-18T05:50:40.000Z | supplements/migrations/0002_auto__add_datalayer.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | null | null | null | supplements/migrations/0002_auto__add_datalayer.py | openwater/h2o-really | bb6ae678cc4f505450684a2579e3f0196236e8dc | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'DataLayer'
db.create_table(u'supplements_datalayer', (
(u'id', self.gf('django.d... | 52.453125 | 120 | 0.586536 |
f1432e2138902496703869e47d02af6c2f5161c0 | 100 | py | Python | notifications/foo.py | jamlamberti/build-bot | 904f65441c9ce9b15b537848f8e18dfc89867847 | [
"Unlicense"
] | null | null | null | notifications/foo.py | jamlamberti/build-bot | 904f65441c9ce9b15b537848f8e18dfc89867847 | [
"Unlicense"
] | null | null | null | notifications/foo.py | jamlamberti/build-bot | 904f65441c9ce9b15b537848f8e18dfc89867847 | [
"Unlicense"
] | null | null | null | from plugin_types.notifier import Notifier
class Foo(Notifier):
def bar(self):
return
| 14.285714 | 42 | 0.7 |
49d06638c45318849b3c99161db8c41a2c94dfc5 | 7,700 | py | Python | fourier/experiments/utils.py | mhw32/fourier-coordconv | 8d14b5b0f62d3a49be9fe34edb6a544942f85c14 | [
"MIT"
] | 1 | 2019-07-10T01:30:57.000Z | 2019-07-10T01:30:57.000Z | fourier/experiments/utils.py | mhw32/fourier-coordconv | 8d14b5b0f62d3a49be9fe34edb6a544942f85c14 | [
"MIT"
] | null | null | null | fourier/experiments/utils.py | mhw32/fourier-coordconv | 8d14b5b0f62d3a49be9fe34edb6a544942f85c14 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import sys
import math
import shutil
import numpy as np
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision.datasets import MNIST
from . import ... | 29.844961 | 97 | 0.613377 |
2a927e02ae49018fd28a37c7c159f6972ed101a4 | 14,196 | py | Python | mkdocs/utils/__init__.py | kay54068/mkdocs | feb3a4b392c4e6a21ad6fec8cdcc2da3fb741a19 | [
"BSD-2-Clause"
] | 1 | 2019-01-21T12:14:41.000Z | 2019-01-21T12:14:41.000Z | mkdocs/utils/__init__.py | kay54068/mkdocs | feb3a4b392c4e6a21ad6fec8cdcc2da3fb741a19 | [
"BSD-2-Clause"
] | 1 | 2018-04-09T13:48:21.000Z | 2018-04-09T13:48:21.000Z | mkdocs/utils/__init__.py | tribut/mkdocs | 1c80f6d6637cc4e471bc3f96c056e1d30e02b2bc | [
"BSD-2-Clause"
] | null | null | null | # coding: utf-8
"""
Standalone file utils.
Nothing in this module should have an knowledge of config or the layout
and structure of the site and pages in the site.
"""
from __future__ import unicode_literals
import logging
import os
import pkg_resources
import shutil
import re
import sys
import yaml
import fnmatch
... | 29.209877 | 96 | 0.622218 |
994dc5492f01183a20628e68f0af10cf636490bf | 6,734 | py | Python | tests/template/test_load_context_framework.py | moutai/kedro | ebcd659f02948e79e7a7930026ca23776028014c | [
"Apache-2.0"
] | null | null | null | tests/template/test_load_context_framework.py | moutai/kedro | ebcd659f02948e79e7a7930026ca23776028014c | [
"Apache-2.0"
] | null | null | null | tests/template/test_load_context_framework.py | moutai/kedro | ebcd659f02948e79e7a7930026ca23776028014c | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 QuantumBlack Visual Analytics 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
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 37.620112 | 85 | 0.672409 |
5ec9abe7a7bc5a66638bd59bd00ef1942dfb5823 | 11,709 | py | Python | ngraph/python/tests/__init__.py | Flex-plaidml-team/openvino | fac0e2f0ee48e5cbf2656e8c304a82b592876f98 | [
"Apache-2.0"
] | null | null | null | ngraph/python/tests/__init__.py | Flex-plaidml-team/openvino | fac0e2f0ee48e5cbf2656e8c304a82b592876f98 | [
"Apache-2.0"
] | 40 | 2020-12-04T07:46:57.000Z | 2022-02-21T13:04:40.000Z | ngraph/python/tests/__init__.py | Flex-plaidml-team/openvino | fac0e2f0ee48e5cbf2656e8c304a82b592876f98 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import pytest
# test.BACKEND_NAME is a configuration variable determining which
# nGraph backend tests will use. It's set during pytest configuration time.
# See `pytest_configure` hook in `conftest.py` for more details.
BACKEND_NAME = ... | 76.032468 | 109 | 0.683662 |
6601d89eef44a00c4264cd5a2cffaa2a6fc53acd | 281 | py | Python | test/test_get_config.py | Hi-Angel/i3ipc-python | 93a8f0c39e5082751824b40b51680bcbc16bfce2 | [
"BSD-3-Clause"
] | null | null | null | test/test_get_config.py | Hi-Angel/i3ipc-python | 93a8f0c39e5082751824b40b51680bcbc16bfce2 | [
"BSD-3-Clause"
] | null | null | null | test/test_get_config.py | Hi-Angel/i3ipc-python | 93a8f0c39e5082751824b40b51680bcbc16bfce2 | [
"BSD-3-Clause"
] | null | null | null | from ipctest import IpcTest
import i3ipc
class TestGetConfig(IpcTest):
def test_get_config(self, i3):
config = i3.get_config()
assert isinstance(config, i3ipc.ConfigReply)
with open('test/i3.config') as f:
assert config.config == f.read()
| 25.545455 | 52 | 0.661922 |
9c09835bf52ee1a15796dfeda996595d6ecf28d5 | 5,544 | py | Python | tests/test_extractors.py | SergeyShk/ruTS-API | 6bb05fb4ddf2f609d979716c9de3c243b3aa8c21 | [
"MIT"
] | 1 | 2021-06-10T16:21:11.000Z | 2021-06-10T16:21:11.000Z | tests/test_extractors.py | SergeyShk/ruTS-API | 6bb05fb4ddf2f609d979716c9de3c243b3aa8c21 | [
"MIT"
] | null | null | null | tests/test_extractors.py | SergeyShk/ruTS-API | 6bb05fb4ddf2f609d979716c9de3c243b3aa8c21 | [
"MIT"
] | null | null | null | import sys
import pytest
from fastapi.testclient import TestClient
sys.path.append("..")
from api.main import api
client = TestClient(api)
text_sents = (
"Да. Времена изменились. Дети больше не слушаются своих родителей, и каждый пишет книги."
)
text_words = "Лучшее время, чтобы посадить дерево, было 20 лет на... | 28.725389 | 98 | 0.52868 |
c57ad26033bf0c4430ad7f54e0ad48329da1e62b | 398 | py | Python | cmocean/__init__.py | MBARIMike/cmocean | 46bfafe3e85f564feb8d34cbd88783fa213eb43b | [
"MIT"
] | 162 | 2015-07-13T12:24:44.000Z | 2022-03-27T20:53:04.000Z | cmocean/__init__.py | jehyunlee/cmocean | bf99b2a8476c93bc645647c924366bc9a3d25a5b | [
"MIT"
] | 41 | 2015-08-15T02:45:48.000Z | 2021-05-11T11:02:29.000Z | cmocean/__init__.py | jehyunlee/cmocean | bf99b2a8476c93bc645647c924366bc9a3d25a5b | [
"MIT"
] | 44 | 2015-07-11T20:23:06.000Z | 2022-01-14T11:08:38.000Z | '''
cmocean is a package to help standardize colormaps for commonly-plotted
oceanographic properties.
See README.md for an overview on instructions.
'''
from __future__ import absolute_import
# from cmocean import *
from . import cm, tools, data
__all__ = ['cm',
'tools',
'plots',
'd... | 18.952381 | 71 | 0.670854 |
b5c5aff43f6ab838175b0326b3495532bc89d682 | 6,152 | py | Python | nikola/plugins/command/subtheme.py | nemodicto/nikola | 2643657148219a2a81b1d34f1ee357cd7cb2ac8d | [
"MIT"
] | null | null | null | nikola/plugins/command/subtheme.py | nemodicto/nikola | 2643657148219a2a81b1d34f1ee357cd7cb2ac8d | [
"MIT"
] | null | null | null | nikola/plugins/command/subtheme.py | nemodicto/nikola | 2643657148219a2a81b1d34f1ee357cd7cb2ac8d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2012-2022 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... | 40.741722 | 149 | 0.588427 |
ba5554af26f17cc3bcb68b225291feadd7dd4974 | 2,862 | py | Python | sandbox/rocky/tf/distributions/recurrent_categorical.py | prosello/rllab | 8677356874d41eb9354785500b554eaf635ece2e | [
"MIT"
] | 10 | 2017-09-05T17:57:26.000Z | 2021-11-10T20:54:09.000Z | sandbox/rocky/tf/distributions/recurrent_categorical.py | prosello/rllab | 8677356874d41eb9354785500b554eaf635ece2e | [
"MIT"
] | null | null | null | sandbox/rocky/tf/distributions/recurrent_categorical.py | prosello/rllab | 8677356874d41eb9354785500b554eaf635ece2e | [
"MIT"
] | 18 | 2017-04-11T22:29:39.000Z | 2021-01-11T13:45:50.000Z | from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import numpy as np
from sandbox.rocky.tf.distributions.categorical import Categorical
from sandbox.rocky.tf.distributions.base import Distribution
TINY = 1e-8
class RecurrentCategorical(Distribution):
def __init_... | 34.071429 | 87 | 0.615653 |
df1b71ca328a6153657c1e9f2344afcdbe3071a2 | 4,260 | py | Python | examples/3dharris.py | for-geeks/python-pcl | fc44cd6e6c5539eed349aeabd6b813d7c567043d | [
"BSD-3-Clause"
] | 1 | 2021-02-02T08:13:57.000Z | 2021-02-02T08:13:57.000Z | examples/3dharris.py | for-geeks/python-pcl | fc44cd6e6c5539eed349aeabd6b813d7c567043d | [
"BSD-3-Clause"
] | 4 | 2019-12-11T09:08:43.000Z | 2020-05-13T04:33:06.000Z | examples/3dharris.py | for-geeks/python-pcl | fc44cd6e6c5539eed349aeabd6b813d7c567043d | [
"BSD-3-Clause"
] | 1 | 2020-05-10T15:47:48.000Z | 2020-05-10T15:47:48.000Z | # -*- coding: utf-8 -*-
# http://virtuemarket-lab.blogspot.jp/2015/03/harris.html
import pcl
import numpy as np
import pcl.pcl_visualization
def main():
# pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
# pcl::io::loadPCDFile<pcl::PointXYZ> (argv[1], *cloud);
# cloud = pcl.... | 38.727273 | 115 | 0.632629 |
ac891d7c98d2e08c6c1ba851603aa39182818fc0 | 17,947 | py | Python | fixit/common/tests/test_unused_suppressions.py | sk-/Fixit | ee0c2c9699f3cf5557b7f1210447c68be1542024 | [
"Apache-2.0"
] | 313 | 2020-09-02T20:35:57.000Z | 2022-03-29T07:55:37.000Z | fixit/common/tests/test_unused_suppressions.py | sk-/Fixit | ee0c2c9699f3cf5557b7f1210447c68be1542024 | [
"Apache-2.0"
] | 93 | 2020-09-02T19:51:22.000Z | 2022-01-19T18:29:46.000Z | fixit/common/tests/test_unused_suppressions.py | sk-/Fixit | ee0c2c9699f3cf5557b7f1210447c68be1542024 | [
"Apache-2.0"
] | 46 | 2020-09-02T21:16:57.000Z | 2022-03-16T18:49:37.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from pathlib import Path
from typing import Collection, List, Optional, Type
import libcst as cst
from libcst.metadata import MetadataWrapper
... | 37.862869 | 88 | 0.511005 |
147ee544b02689015eba4c0b6b22adfc708c026b | 1,089 | py | Python | CIS41B/TKinter/Tkevents.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | 1 | 2021-09-08T18:34:56.000Z | 2021-09-08T18:34:56.000Z | CIS41B/TKinter/Tkevents.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | null | null | null | CIS41B/TKinter/Tkevents.py | jackh423/python | 4187c16a1d6c1269d188a4a039e0a16020de51d0 | [
"Apache-2.0"
] | null | null | null | import tkinter as tk
win = tk.Tk()
# globals
can = tk.Canvas(win, width=300, height=300)
strvar = tk.StringVar()
lab = tk.Label(win, textvar=strvar)
strvar.set("Press a key")
def Click(event=None):
canvas_id = can.create_text(event.x, event.y, anchor="nw")
can.itemconfig(canvas_id, text=str(event.x... | 26.560976 | 69 | 0.610652 |
12f5e529764f6bcbc94b452e216df91f2cdc792c | 2,962 | py | Python | Diabetes_prediction.py | kyokyos/bioinform | 261e99a43291b0768d3d054b5e13f18022c3abb3 | [
"Unlicense"
] | null | null | null | Diabetes_prediction.py | kyokyos/bioinform | 261e99a43291b0768d3d054b5e13f18022c3abb3 | [
"Unlicense"
] | null | null | null | Diabetes_prediction.py | kyokyos/bioinform | 261e99a43291b0768d3d054b5e13f18022c3abb3 | [
"Unlicense"
] | null | null | null | #DIY糖尿病预测器,请随访相关专业医师
#algorithm:
#total_points=gender+BMI+waist+age+race+family_gene+blood_pressure+psycho
#(total_points:0-6 low; 7-15 increased; 16-24 moderate; 25-47high)
#BMI=weight(kg)/height(m)**2
#value
gender="male"
height=1.65
weight=62
hypertension="True"
race="Chinese"
family_history="True"
age=65
waist=10... | 17.736527 | 88 | 0.699865 |
d7da5aaedd73f48cd57bf26d37a99395f79d587b | 3,157 | py | Python | main.py | ChiLlx/Modified-3D-UNet-Pytorch | 0b3bb64bbfa7c5422b2fc85d0c4eb37c0773afec | [
"MIT"
] | 193 | 2018-04-17T07:28:16.000Z | 2022-03-23T00:34:43.000Z | main.py | ChiLlx/Modified-3D-UNet-Pytorch | 0b3bb64bbfa7c5422b2fc85d0c4eb37c0773afec | [
"MIT"
] | 7 | 2018-07-16T01:54:23.000Z | 2020-12-04T06:55:02.000Z | main.py | ChiLlx/Modified-3D-UNet-Pytorch | 0b3bb64bbfa7c5422b2fc85d0c4eb37c0773afec | [
"MIT"
] | 50 | 2018-08-13T23:06:19.000Z | 2021-12-09T09:42:13.000Z | import argparse
import os
import shutil
import time
import logging
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
from torch.utils.data import DataLoader
from sklearn.model_selection import train_test_split
from dataset import load_dataset, BraTS2018List
from model import Modified3DUNe... | 33.585106 | 106 | 0.69433 |
fa12a71a19e8d1f9b472059c2e78328515bad88c | 34,698 | py | Python | swann/viz/beta_bursting.py | alexrockhill/SwannLabResources | 8f49683a073feb3e23919c1faa365e7f04390b0f | [
"BSD-3-Clause"
] | null | null | null | swann/viz/beta_bursting.py | alexrockhill/SwannLabResources | 8f49683a073feb3e23919c1faa365e7f04390b0f | [
"BSD-3-Clause"
] | null | null | null | swann/viz/beta_bursting.py | alexrockhill/SwannLabResources | 8f49683a073feb3e23919c1faa365e7f04390b0f | [
"BSD-3-Clause"
] | null | null | null | import os
import numpy as np
import os.path as op
import matplotlib.pyplot as plt
from matplotlib.colors import BASE_COLORS
from scipy.stats import ttest_ind
from swann.preprocessing import get_info
from swann.utils import get_config, derivative_fname
from swann.analyses import decompose_tfr, find_bursts, get_bursts
... | 46.825911 | 79 | 0.545939 |
08bc24065c1bfa897fbca9546dcf742cdac67393 | 36,920 | py | Python | pay-api/tests/unit/api/test_payment_request.py | stevenc987/sbc-pay | 04f02f362f88a30c082b0643583b8d0ebff6063f | [
"Apache-2.0"
] | null | null | null | pay-api/tests/unit/api/test_payment_request.py | stevenc987/sbc-pay | 04f02f362f88a30c082b0643583b8d0ebff6063f | [
"Apache-2.0"
] | null | null | null | pay-api/tests/unit/api/test_payment_request.py | stevenc987/sbc-pay | 04f02f362f88a30c082b0643583b8d0ebff6063f | [
"Apache-2.0"
] | null | null | null | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 44.109916 | 120 | 0.661863 |
0944dd23b65a9bfad32ab47ea3b9a670aa82d634 | 775 | py | Python | mycleaners/cleaner_wealth/bankcomm_cleaner.py | zhouhongf/cleaner_pdf | 4a01f17b5335571ea00935fdfb0db46ad164c16a | [
"MIT"
] | 1 | 2021-11-27T06:40:46.000Z | 2021-11-27T06:40:46.000Z | mycleaners/cleaner_wealth/bankcomm_cleaner.py | zhouhongf/cleaner_pdf | 4a01f17b5335571ea00935fdfb0db46ad164c16a | [
"MIT"
] | null | null | null | mycleaners/cleaner_wealth/bankcomm_cleaner.py | zhouhongf/cleaner_pdf | 4a01f17b5335571ea00935fdfb0db46ad164c16a | [
"MIT"
] | null | null | null | from mycleaners.base import Cleaner, ManualTable, ManualText
class BankcommTable(ManualTable):
table_labels_config = {}
class BankcommText(ManualText):
labels_check_config = {}
labels_check_one_config = {}
class BankcommCleaner(Cleaner):
name = 'BankcommCleaner'
bank_name = '交通银行... | 27.678571 | 97 | 0.68 |
c70d947b59f420edb445215c164ad31efd6bd71d | 436 | py | Python | recipe_modules/buildbucket/tests/add_tags.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | 1 | 2021-04-24T04:03:01.000Z | 2021-04-24T04:03:01.000Z | recipe_modules/buildbucket/tests/add_tags.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | null | null | null | recipe_modules/buildbucket/tests/add_tags.py | Acidburn0zzz/luci | d8993f4684839b58f5f966dd6273d1d8fd001eae | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
DEPS = [
'buildbucket',
'step',
]
def RunSteps(api):
tags = api.buildbucket.tags(k1='v1', k2=['v2', 'v2_1'])
api.buildbucket.add_tags_to... | 24.222222 | 75 | 0.724771 |
7673529c47cc138956cfbd7c7087859ea35490e4 | 896 | py | Python | openprocurement/tender/esco/views/qualification_comlaint_document.py | openprocurement/openprocurement.tender.esco | ea9732cb22b82997a0d8c0bf413d59e988d0600d | [
"Apache-2.0"
] | 1 | 2020-07-14T05:19:43.000Z | 2020-07-14T05:19:43.000Z | openprocurement/tender/esco/views/qualification_comlaint_document.py | openprocurement/openprocurement.tender.esco | ea9732cb22b82997a0d8c0bf413d59e988d0600d | [
"Apache-2.0"
] | 39 | 2017-05-12T13:08:46.000Z | 2018-08-13T08:26:04.000Z | openprocurement/tender/esco/views/qualification_comlaint_document.py | ProzorroUKR/openprocurement.tender.esco | 9e6a3a00d9ad43a81f3b3415bc023a14088980a2 | [
"Apache-2.0"
] | 17 | 2017-05-11T11:32:28.000Z | 2018-06-15T14:39:18.000Z | # -*- coding: utf-8 -*-
from openprocurement.tender.openeu.utils import qualifications_resource
from openprocurement.tender.openeu.views.qualification_complaint_document import \
TenderEUQualificationComplaintDocumentResource
@qualifications_resource(name='esco:Tender Qualification Complaint Documents',
... | 64 | 137 | 0.75 |
e7db0d758139afba26f74c521ccd8fdd2147b791 | 401 | py | Python | api/yaya_backend/yaya_backend/asgi.py | IrisNotSiri/yayaTest | b056d0e0a7783fc171ffeeee653bb1181281a865 | [
"MIT"
] | null | null | null | api/yaya_backend/yaya_backend/asgi.py | IrisNotSiri/yayaTest | b056d0e0a7783fc171ffeeee653bb1181281a865 | [
"MIT"
] | null | null | null | api/yaya_backend/yaya_backend/asgi.py | IrisNotSiri/yayaTest | b056d0e0a7783fc171ffeeee653bb1181281a865 | [
"MIT"
] | null | null | null | """
ASGI config for yaya_backend project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_... | 23.588235 | 78 | 0.790524 |
ac1e4ce26a7e4b90fd62cb33cacb838e5e76da77 | 349 | py | Python | light_control_2.py | DevopediaOrg/python-for-kids | 2bacc59566a47d03ee100e9a83e110517ad9b653 | [
"MIT"
] | 2 | 2021-06-22T11:54:49.000Z | 2021-11-24T10:53:58.000Z | light_control_2.py | YBofCrypto/python-for-kids | 2bacc59566a47d03ee100e9a83e110517ad9b653 | [
"MIT"
] | 4 | 2021-06-08T19:54:11.000Z | 2022-03-11T23:47:36.000Z | light_control_2.py | YBofCrypto/python-for-kids | 2bacc59566a47d03ee100e9a83e110517ad9b653 | [
"MIT"
] | 2 | 2020-09-23T04:50:32.000Z | 2021-04-22T07:07:57.000Z | light_on = None
if 'y' == input("Is it dark? [y/n]: "):
is_dark = True
else:
is_dark = False
if 'y' == input("Are you sleepy? [y/n]: "):
is_sleepy = True
else:
is_sleepy = False
if is_dark and not is_sleepy:
light_on = True
print("Switching on the light!")
else:
light_on = False
print... | 18.368421 | 43 | 0.60745 |
2dbc28638e3aadc77cbb04ee43825e2e23fa1b67 | 1,678 | py | Python | dee/modules/dropout.py | Spico197/DocEE | d6b585e29e5908b891e765066b96ff7642587e5a | [
"MIT"
] | 90 | 2021-12-14T02:13:51.000Z | 2022-03-28T09:37:50.000Z | dee/modules/dropout.py | Nero0017/DocEE | c7e8a8f8c8fc3b6c39d498ec2d8f61eef47d60c2 | [
"MIT"
] | 24 | 2021-12-15T07:22:15.000Z | 2022-03-30T09:38:27.000Z | dee/modules/dropout.py | Nero0017/DocEE | c7e8a8f8c8fc3b6c39d498ec2d8f61eef47d60c2 | [
"MIT"
] | 22 | 2021-12-14T03:05:25.000Z | 2022-03-30T00:47:25.000Z | import torch.nn as nn
class SharedDropout(nn.Module):
r"""
SharedDropout differs from the vanilla dropout strategy in that
the dropout mask is shared across one dimension.
Args:
p (float):
The probability of an element to be zeroed. Default: 0.5.
batch_first (bool):
... | 27.966667 | 99 | 0.475566 |
95a3bf081a43af5b1c86967111e2f38c20348a92 | 191 | py | Python | src/baboon_tracking/mixins/foreground_mixin.py | radioactivebean0/baboon-tracking | 062351c514073aac8e1207b8b46ca89ece987928 | [
"MIT"
] | 6 | 2019-07-15T19:10:59.000Z | 2022-02-01T04:25:26.000Z | src/baboon_tracking/mixins/foreground_mixin.py | radioactivebean0/baboon-tracking | 062351c514073aac8e1207b8b46ca89ece987928 | [
"MIT"
] | 86 | 2019-07-02T17:59:46.000Z | 2022-02-01T23:23:08.000Z | src/baboon_tracking/mixins/foreground_mixin.py | radioactivebean0/baboon-tracking | 062351c514073aac8e1207b8b46ca89ece987928 | [
"MIT"
] | 7 | 2019-10-16T12:58:21.000Z | 2022-03-08T00:31:32.000Z | """
Mixin for returning the foreground.
"""
class ForegroundMixin:
"""
Mixin for returning the foreground.
"""
def __init__(self):
self.foreground = []
| 14.692308 | 40 | 0.570681 |
54b344e29b0118ce5260051a29f97f08e39dad4e | 949 | py | Python | deploy/setup.py | jojochuang/determined | 22a7cd4b497767d7420b26ead769ba7e61d7f90a | [
"Apache-2.0"
] | null | null | null | deploy/setup.py | jojochuang/determined | 22a7cd4b497767d7420b26ead769ba7e61d7f90a | [
"Apache-2.0"
] | null | null | null | deploy/setup.py | jojochuang/determined | 22a7cd4b497767d7420b26ead769ba7e61d7f90a | [
"Apache-2.0"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="determined-deploy",
version="0.13.4.dev0",
author="Determined AI",
author_email="hello@determined.ai",
url="https://determined.ai/",
description="Determined Deep Learning Training Platform",
long_description="See https://docs.determin... | 37.96 | 95 | 0.661749 |
7ad5485cd1306efb889ba86a12afddee1172bc69 | 327 | py | Python | gs/group/messages/add/smtp2gs/__init__.py | groupserver/gs.group.messages.add.smtp2gs | da1f5d7f7d43e70056b9f870e1b288ded9bbbe40 | [
"ZPL-2.1"
] | null | null | null | gs/group/messages/add/smtp2gs/__init__.py | groupserver/gs.group.messages.add.smtp2gs | da1f5d7f7d43e70056b9f870e1b288ded9bbbe40 | [
"ZPL-2.1"
] | null | null | null | gs/group/messages/add/smtp2gs/__init__.py | groupserver/gs.group.messages.add.smtp2gs | da1f5d7f7d43e70056b9f870e1b288ded9bbbe40 | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
'''The script for adding an email (from SMTP) to GroupServer'''
from enum import Enum
class TimeSource(Enum):
'''Where to get the time-stamp of the post'''
message = 1 #: Get the time stamp from the :mailheader:`Date` header
server = 2 #: Get the time stamp from the clock on the ... | 32.7 | 73 | 0.669725 |
5be0a1acc11dc8c4012e355d13466c82eefd69d6 | 5,070 | py | Python | gpMgmt/bin/gppylib/operations/test/regress/test_package/test_regress_query.py | henglabs/gpdb | 09a8cc05ac90d63c64c6d432ca35179b55a461b2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/operations/test/regress/test_package/test_regress_query.py | henglabs/gpdb | 09a8cc05ac90d63c64c6d432ca35179b55a461b2 | [
"PostgreSQL",
"Apache-2.0"
] | 6 | 2018-08-04T07:51:37.000Z | 2018-11-26T07:09:44.000Z | gpMgmt/bin/gppylib/operations/test/regress/test_package/test_regress_query.py | henglabs/gpdb | 09a8cc05ac90d63c64c6d432ca35179b55a461b2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
import os
import tarfile
from contextlib import closing
from gppylib.commands.base import ExecutionError
from gppylib.operations.test.regress.test_package import GppkgTestCase, unittest, RPMSpec, GppkgSpec, run_command, OS, GPDB_VERSION
class QueryTestCase(GppkgTestCase):
"""Test the query... | 41.900826 | 168 | 0.667061 |
f23395ff8cffa7e731e60300c837eda399c4765d | 2,980 | py | Python | doc/asm/rpn_wordlist.py | pvrs12/python-msp430-tools | bd9b1d55b43f884368eaef9dc537330882058fd9 | [
"BSD-3-Clause"
] | 15 | 2017-10-18T01:56:40.000Z | 2022-02-28T04:33:01.000Z | doc/asm/rpn_wordlist.py | pvrs12/python-msp430-tools | bd9b1d55b43f884368eaef9dc537330882058fd9 | [
"BSD-3-Clause"
] | 3 | 2017-07-24T13:41:04.000Z | 2019-11-08T19:13:54.000Z | doc/asm/rpn_wordlist.py | pvrs12/python-msp430-tools | bd9b1d55b43f884368eaef9dc537330882058fd9 | [
"BSD-3-Clause"
] | 8 | 2017-10-11T14:05:29.000Z | 2022-03-22T02:13:01.000Z | #! /usr/bin/env python
"""\
Create documentation of msp430.asm.rpn based classes.
"""
import sys
import inspect
import codecs
def create_wordlist(obj, output, title):
wordlist = {}
for word, func in obj.builtins.items():
info = wordlist.setdefault(word.upper(), {'doc':'', 'deftype':set()})
in... | 34.252874 | 110 | 0.496309 |
18491635508ff8dbc11d2f9410885baab09b4064 | 3,159 | py | Python | model_4_2_architecture.py | ctrl-gaurav/Pneumonia-Detection | afcfbbc1de736a3a1eb5499d5dceca4690d6ab26 | [
"MIT"
] | null | null | null | model_4_2_architecture.py | ctrl-gaurav/Pneumonia-Detection | afcfbbc1de736a3a1eb5499d5dceca4690d6ab26 | [
"MIT"
] | null | null | null | model_4_2_architecture.py | ctrl-gaurav/Pneumonia-Detection | afcfbbc1de736a3a1eb5499d5dceca4690d6ab26 | [
"MIT"
] | null | null | null | from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D, ZeroPadding2D, Convolution2D
from keras.layers import Dropout
from keras.layers.normalization import BatchNormalization
from keras import optimizers
from k... | 32.90625 | 129 | 0.760684 |
e3a19a8c45abe8e2f0aff1a1e1ff558a52fe46ff | 5,582 | py | Python | salt/modules/kernelpkg_linux_apt.py | nielsk/salt | be5d400d903e68d99c216fd63a7146d86a64a55d | [
"Apache-2.0"
] | null | null | null | salt/modules/kernelpkg_linux_apt.py | nielsk/salt | be5d400d903e68d99c216fd63a7146d86a64a55d | [
"Apache-2.0"
] | null | null | null | salt/modules/kernelpkg_linux_apt.py | nielsk/salt | be5d400d903e68d99c216fd63a7146d86a64a55d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage Linux kernel packages on APT-based systems
'''
from __future__ import absolute_import
import functools
import logging
import re
# Import Salt libs
import salt.ext.six as six
try:
from salt.utils.versions import LooseVersion as _LooseVersion
from salt.ext.six.moves import fil... | 24.375546 | 99 | 0.642064 |
f8f4e9584dc29f265450eb6a1ee292fb1fd49ac7 | 123 | py | Python | gtts/__init__.py | onsunsl/gTTS | c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6 | [
"MIT"
] | 3 | 2019-04-10T18:14:46.000Z | 2020-10-26T05:08:05.000Z | gtts/__init__.py | onsunsl/gTTS | c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6 | [
"MIT"
] | null | null | null | gtts/__init__.py | onsunsl/gTTS | c7ea4fb8a3ababd9dfa9fb35b99232be4347cce6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .version import __version__
from .tts import gTTS, gTTSError
__all__ = ['gTTS', 'gTTSError']
| 20.5 | 32 | 0.682927 |
102daa1396195095233e437cc33993c40d7a759d | 31,876 | py | Python | automated_test.py | jkominek/cloud-files | f7235952ad1968ca97ddcaad3c002e5604a63a49 | [
"BSD-3-Clause"
] | null | null | null | automated_test.py | jkominek/cloud-files | f7235952ad1968ca97ddcaad3c002e5604a63a49 | [
"BSD-3-Clause"
] | null | null | null | automated_test.py | jkominek/cloud-files | f7235952ad1968ca97ddcaad3c002e5604a63a49 | [
"BSD-3-Clause"
] | null | null | null | import gevent.monkey
gevent.monkey.patch_all(thread=False)
import os
import pytest
import re
import shutil
import time
from moto import mock_s3
def rmtree(path):
path = path.replace("file://", "")
if os.path.exists(path):
shutil.rmtree(path)
def compute_url(protocol, name):
from cloudfiles import CloudFil... | 31.560396 | 138 | 0.659524 |
964d70c2c0e2472a049f198d4630ec4c7454b651 | 6,325 | py | Python | webscraper/TheLohas/WebScraping.py | rex-lui/Hong-Kong-Mall-Shop-Directory-Web-Scraping | 6120040cc64b1f2331f894bb411191555f2afdbf | [
"CC0-1.0"
] | null | null | null | webscraper/TheLohas/WebScraping.py | rex-lui/Hong-Kong-Mall-Shop-Directory-Web-Scraping | 6120040cc64b1f2331f894bb411191555f2afdbf | [
"CC0-1.0"
] | null | null | null | webscraper/TheLohas/WebScraping.py | rex-lui/Hong-Kong-Mall-Shop-Directory-Web-Scraping | 6120040cc64b1f2331f894bb411191555f2afdbf | [
"CC0-1.0"
] | null | null | null | #Import necessary package
import requests
import re
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import datetime as dt
import configparser
import os
import json
#Configure parameter
config = configparser.ConfigParser()
config.read(os.path.join(os.path.dirname(__file__), 'config.ini'))
mall = co... | 38.803681 | 239 | 0.493123 |
a931744c0cdb3a353177ed0daa6b0294e6e6e0ee | 286 | py | Python | lab01-mnist/transfer_functions.py | gcollura/deeplearning-labs | 00a95276120b3839801a71f6297c1ba8ee853256 | [
"MIT"
] | null | null | null | lab01-mnist/transfer_functions.py | gcollura/deeplearning-labs | 00a95276120b3839801a71f6297c1ba8ee853256 | [
"MIT"
] | null | null | null | lab01-mnist/transfer_functions.py | gcollura/deeplearning-labs | 00a95276120b3839801a71f6297c1ba8ee853256 | [
"MIT"
] | null | null | null | import numpy as np
# transfer functions
def sigmoid(x):
return 1 / (1 + np.exp(-x))
# derivative of sigmoid
def dsigmoid(y):
return np.multiply(y, (1.0 - y))
def tanh(x):
return np.tanh(x)
# derivative for tanh sigmoid
def dtanh(y):
return 1 - np.multiply(y, y)
| 13.619048 | 36 | 0.632867 |
c2caf68da9da6d9ac3dbd874e53a706612cc15c7 | 2,067 | py | Python | Brahma/__main__.py | DevanshRaghav75/Brahma | fe54a96bd968c7a0f44285ae6ed35fcfc8101816 | [
"MIT"
] | 5 | 2021-07-12T05:08:35.000Z | 2022-03-25T01:16:30.000Z | Brahma/__main__.py | DevanshRaghav75/Brahma | fe54a96bd968c7a0f44285ae6ed35fcfc8101816 | [
"MIT"
] | null | null | null | Brahma/__main__.py | DevanshRaghav75/Brahma | fe54a96bd968c7a0f44285ae6ed35fcfc8101816 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
from Brahma.core.automator import xss, sqli, ssrf, nosqli, lfi, all
from Brahma.core.colors import RED, WHITE, CYAN, YELLOW, GREEN
from Brahma.core.styles import RESET, BRIGHT
def banner():
print(BRIGHT + CYAN + f'''
______ _
| ___ \ ... | 32.809524 | 165 | 0.520077 |
901e12caf0444e74fb5ef8af36aebcdd5d91f234 | 4,347 | py | Python | parlai/mturk/tasks/image_chat/image_chat_collection/run.py | ricsinaruto/ParlAI | 733b627ae456d6b11a2fc4624088a781bc6c1d03 | [
"MIT"
] | 258 | 2020-04-10T07:01:06.000Z | 2022-03-26T11:49:30.000Z | parlai/mturk/tasks/image_chat/image_chat_collection/run.py | ricsinaruto/ParlAI | 733b627ae456d6b11a2fc4624088a781bc6c1d03 | [
"MIT"
] | 33 | 2020-04-10T04:28:51.000Z | 2022-03-31T02:52:02.000Z | parlai/mturk/tasks/image_chat/image_chat_collection/run.py | ricsinaruto/ParlAI | 733b627ae456d6b11a2fc4624088a781bc6c1d03 | [
"MIT"
] | 43 | 2020-04-14T10:43:33.000Z | 2022-03-13T02:27:54.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.params import ParlaiParser
from parlai.mturk.core.mturk_manager import MTurkManager
from parlai.tasks.image_chat.agents import I... | 38.131579 | 81 | 0.638831 |
d23ac7ce425ac4b732c2cde87be4982f8a98f0ad | 1,075 | py | Python | larcv/app/tests/test_eltwisemult.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 14 | 2017-10-19T15:08:29.000Z | 2021-03-31T21:21:07.000Z | larcv/app/tests/test_eltwisemult.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 32 | 2017-10-25T22:54:06.000Z | 2019-10-01T13:57:15.000Z | larcv/app/tests/test_eltwisemult.py | mmajewsk/larcv2 | 9ee74e42b293d547d3a8510fa2139b2d4ccf6b89 | [
"MIT"
] | 16 | 2017-12-07T12:04:40.000Z | 2021-11-15T00:53:31.000Z | import os,sys
import ROOT
import numpy as np
from larcv import larcv
print larcv.Image2D
# TESTS MATRIX MULTIPLICATION FEATURE
a = np.random.rand(6,7)
b = np.random.rand(6,7)
aI = larcv.Image2D( a.shape[0], a.shape[1] )
bI = larcv.Image2D( b.shape[0], b.shape[1] )
arows = a.shape[0]
acols = a.shape[1]
brows = b.sha... | 19.196429 | 44 | 0.612093 |
f17c3f41900bf4c12fcfa93e359bf497986d9be7 | 257 | py | Python | exportdb.py | gbburleigh/scrapelib | 4f4dfe732e5b494b980fcced3aa5f69711c82e5a | [
"MIT"
] | null | null | null | exportdb.py | gbburleigh/scrapelib | 4f4dfe732e5b494b980fcced3aa5f69711c82e5a | [
"MIT"
] | null | null | null | exportdb.py | gbburleigh/scrapelib | 4f4dfe732e5b494b980fcced3aa5f69711c82e5a | [
"MIT"
] | null | null | null | from zipfile import ZipFile
from dbmanager import DBConn
import os
with open('upwork-data.sql.zip', 'x') as z:
with z.open('upwork-data.sql', 'w') as f:
with DBConn as d:
data = '\n'.join(d.conn.iterdump())
f.write(data) | 28.555556 | 47 | 0.607004 |
272b1e198e322c585235d0a7dc71b075e2cb312d | 3,819 | py | Python | src/talker.py | cpotdevin/alarmclockbutler | ce5313dfdd3f7e652f4cf9ceb5d6aeb69e7a89eb | [
"MIT"
] | null | null | null | src/talker.py | cpotdevin/alarmclockbutler | ce5313dfdd3f7e652f4cf9ceb5d6aeb69e7a89eb | [
"MIT"
] | 2 | 2021-04-30T20:54:00.000Z | 2021-06-01T23:59:12.000Z | src/talker.py | cpotdevin/alarmclockbutler | ce5313dfdd3f7e652f4cf9ceb5d6aeb69e7a89eb | [
"MIT"
] | null | null | null | import os
import subprocess
import time
import hashlib
from datetime import datetime
import requests
from google.cloud import texttospeech
path = os.path.dirname(os.path.realpath(__file__))
class Talker:
def __init__(self,
audio_cmd,
weekdays,
lang,
... | 31.561983 | 111 | 0.569783 |
ebea6c73a67575342cc2093c7f3b40435861445d | 1,028 | py | Python | DemPipe/executor/mixin/config_mixin.py | hmiladhia/DemPipe | 48d48150969fa047e2f20b35ee1c61991e7b44ad | [
"MIT"
] | null | null | null | DemPipe/executor/mixin/config_mixin.py | hmiladhia/DemPipe | 48d48150969fa047e2f20b35ee1c61991e7b44ad | [
"MIT"
] | null | null | null | DemPipe/executor/mixin/config_mixin.py | hmiladhia/DemPipe | 48d48150969fa047e2f20b35ee1c61991e7b44ad | [
"MIT"
] | null | null | null | from configDmanager import import_config, Config
from DemPipe.executor import SimplePipeExecutor
class ConfigMixin(SimplePipeExecutor):
pipe_name: str
def __init__(self, config_file=None):
self.__load_config(config_file)
super().__init__()
def load_config(self, config):
self.pip... | 26.358974 | 50 | 0.639105 |
f3fda1f0b4e4eb1fb61499cfcd96d42ad6671ce0 | 11,775 | py | Python | Disc_train.py | avinsit123/keyphrase-gan | fa76ac2f0d0228b22be40acbc471a008cca828a3 | [
"MIT"
] | 66 | 2019-09-11T06:18:13.000Z | 2022-03-21T21:39:29.000Z | Disc_train.py | avinsit123/keyphrase-gan | fa76ac2f0d0228b22be40acbc471a008cca828a3 | [
"MIT"
] | 6 | 2019-11-04T02:24:01.000Z | 2021-12-01T10:25:56.000Z | Disc_train.py | avinsit123/keyphrase-gan | fa76ac2f0d0228b22be40acbc471a008cca828a3 | [
"MIT"
] | 13 | 2019-09-30T13:50:49.000Z | 2021-12-20T03:05:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 1 15:10:45 2019
@author: r17935avinash
"""
################################ IMPORT LIBRARIES ###############################################################
import torch
import numpy as np
import pykp.io
import torch.nn as nn
from utils.statistics... | 47.1 | 594 | 0.615626 |
5ed702f15c6a9c40d94f214e2cd6ffb18fa832f3 | 1,994 | py | Python | env_log.py | LucasZhu97/RaspberryPiFullStack_Raspbian | 732917984467b6c6eff810ee70aa0b274d8eaefe | [
"MIT"
] | 118 | 2018-03-13T17:48:41.000Z | 2022-02-08T18:00:58.000Z | env_log.py | LucasZhu97/RaspberryPiFullStack_Raspbian | 732917984467b6c6eff810ee70aa0b274d8eaefe | [
"MIT"
] | 5 | 2018-06-28T16:05:40.000Z | 2021-02-14T21:01:04.000Z | env_log.py | LucasZhu97/RaspberryPiFullStack_Raspbian | 732917984467b6c6eff810ee70aa0b274d8eaefe | [
"MIT"
] | 114 | 2018-03-15T12:14:13.000Z | 2022-02-12T20:06:05.000Z | #!/usr/bin/env python
'''
FILE NAME
env_log.py
1. WHAT IT DOES
Takes a reading from a DHT sensor and records the values in an SQLite3 database using a Raspberry Pi.
2. REQUIRES
* Any Raspberry Pi
* A DHT sensor
* A 10kOhm resistor
* Jumper wires
3. ORIGINAL WORK
Raspberry Full stack 2018, Peter Dalmaris
4. HARDW... | 24.925 | 101 | 0.723671 |
219fce8f0b445d6bd4fd29d1d24014958b97e10c | 4,222 | py | Python | tests/test_download.py | simon-castano/bqueryd | def7f7c5db6061ca693f18c630b2dab9d614947d | [
"BSD-3-Clause"
] | 6 | 2016-12-02T11:48:43.000Z | 2019-12-25T17:40:28.000Z | tests/test_download.py | simon-castano/bqueryd | def7f7c5db6061ca693f18c630b2dab9d614947d | [
"BSD-3-Clause"
] | 13 | 2017-02-14T00:40:16.000Z | 2021-08-11T11:35:46.000Z | tests/test_download.py | simon-castano/bqueryd | def7f7c5db6061ca693f18c630b2dab9d614947d | [
"BSD-3-Clause"
] | 2 | 2017-02-16T12:52:48.000Z | 2020-01-31T10:40:19.000Z | import logging
import os
from contextlib import contextmanager
import boto3
import numpy as np
import pandas as pd
import pytest
import redis
import shutil
import socket
import threading
import time
from bcolz import ctable
from time import sleep
from uuid import uuid4
import bqueryd
TEST_REDIS = 'redis://redis:6379... | 28.917808 | 102 | 0.690905 |
e1af3e2ee8a2cfa19ab6e3e34daa6dbd0854f90c | 2,071 | py | Python | .buildkite/images/integration/image_build.py | danieldiamond/dagster | d8de290f2ac6fa59d4e69a7e88d7703c31fcd3ea | [
"Apache-2.0"
] | 1 | 2020-12-20T18:39:17.000Z | 2020-12-20T18:39:17.000Z | .buildkite/images/integration/image_build.py | danieldiamond/dagster | d8de290f2ac6fa59d4e69a7e88d7703c31fcd3ea | [
"Apache-2.0"
] | null | null | null | .buildkite/images/integration/image_build.py | danieldiamond/dagster | d8de290f2ac6fa59d4e69a7e88d7703c31fcd3ea | [
"Apache-2.0"
] | null | null | null | import os
import shutil
from subprocess import check_output
import click
from automation.git import git_repo_root
from automation.images import (
aws_integration_base_image,
execute_docker_build,
get_aws_account_id,
local_integration_image,
)
from dagster import check
def execute_build_integration_i... | 30.014493 | 93 | 0.706905 |
5c9ab0d3a269da2064a282de828c9db61966601a | 1,256 | py | Python | netdisco/discoverables/xiaomi_gw.py | jjlawren/netdisco | ffc3cd092bff359b1c1fc1ed51940624b3c8076b | [
"Apache-2.0"
] | 1 | 2020-01-05T21:36:10.000Z | 2020-01-05T21:36:10.000Z | env/lib/python3.7/site-packages/netdisco/discoverables/xiaomi_gw.py | seanmitch/UPnP | f3cb1ef62657f166971c1c470ce5dfd58bdeeac9 | [
"Unlicense"
] | null | null | null | env/lib/python3.7/site-packages/netdisco/discoverables/xiaomi_gw.py | seanmitch/UPnP | f3cb1ef62657f166971c1c470ce5dfd58bdeeac9 | [
"Unlicense"
] | null | null | null | """Discover Xiaomi Mi Home (aka Lumi) Gateways."""
from . import MDNSDiscoverable
from ..const import ATTR_MAC_ADDRESS, ATTR_PROPERTIES
class Discoverable(MDNSDiscoverable):
"""Add support for discovering Xiaomi Gateway"""
def __init__(self, nd):
"""Initialize the discovery."""
super(Discover... | 36.941176 | 68 | 0.627389 |
ab09cc2caf100db9197b6bf5974d76b264a093d5 | 280 | py | Python | catering/catering/doctype/service_personnel/test_service_personnel.py | ahmad18189/catering | 8cce728f0c937d0d6f688fd6b5eb3d0d51907282 | [
"MIT"
] | 2 | 2017-09-25T23:11:23.000Z | 2020-12-07T21:58:06.000Z | catering/catering/doctype/service_personnel/test_service_personnel.py | ahmad18189/catering | 8cce728f0c937d0d6f688fd6b5eb3d0d51907282 | [
"MIT"
] | null | null | null | catering/catering/doctype/service_personnel/test_service_personnel.py | ahmad18189/catering | 8cce728f0c937d0d6f688fd6b5eb3d0d51907282 | [
"MIT"
] | 7 | 2017-09-25T23:11:24.000Z | 2021-03-11T11:35:26.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Ahmad18189 and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# test_records = frappe.get_test_records('Service Personnel')
class TestServicePersonnel(unittest.TestCase):
pass
| 21.538462 | 61 | 0.782143 |
84ebcc5db9827fad3389b4ceb0ba21c13ea26dd5 | 3,299 | py | Python | src/dataset.py | rsommerfeld/trocr | 5f5bcfb5c96c9ed7864b60b97fe5666ae2d3da88 | [
"MIT"
] | 4 | 2022-03-03T09:09:09.000Z | 2022-03-27T12:31:58.000Z | src/dataset.py | rsommerfeld/trocr | 5f5bcfb5c96c9ed7864b60b97fe5666ae2d3da88 | [
"MIT"
] | null | null | null | src/dataset.py | rsommerfeld/trocr | 5f5bcfb5c96c9ed7864b60b97fe5666ae2d3da88 | [
"MIT"
] | null | null | null | from __future__ import division, print_function
import csv
import os
from pathlib import Path
import torch
from PIL import Image
from torch.utils.data import Dataset
from transformers import TrOCRProcessor
from .configs import paths
from .configs.constants import WORD_LEN_PADDING
from .util import debug_print
def ... | 31.721154 | 105 | 0.65535 |
b88e4b0200d7ab0dd9c7b9e069a61aca1dba8aed | 2,282 | py | Python | c_methods.py | simeonf/decorators | 8c67684ca20388c94bfdf2db7b1b15c7444ebc9e | [
"Apache-2.0"
] | 5 | 2019-06-20T02:40:06.000Z | 2021-11-16T06:27:15.000Z | c_methods.py | simeonf/decorators | 8c67684ca20388c94bfdf2db7b1b15c7444ebc9e | [
"Apache-2.0"
] | null | null | null | c_methods.py | simeonf/decorators | 8c67684ca20388c94bfdf2db7b1b15c7444ebc9e | [
"Apache-2.0"
] | 1 | 2019-06-20T02:34:24.000Z | 2019-06-20T02:34:24.000Z | """
Concepts: you can decorate methods. And classes!
Same thing but for classes. This introduces a new wrinkle when decorating methods.
The problem is that our decorator is invoked as each method is defined - we get
the function that results from the definition.
But to store that function function we're going to nee... | 30.426667 | 86 | 0.710342 |
b552a7c75b557cbac913d9f3be350845d2734f71 | 3,310 | py | Python | indico/modules/events/static/tasks.py | salevajo/indico | 6f9cbabc20d1641caea907099388ae2b04965cf8 | [
"MIT"
] | 1 | 2021-12-27T17:51:27.000Z | 2021-12-27T17:51:27.000Z | indico/modules/events/static/tasks.py | salevajo/indico | 6f9cbabc20d1641caea907099388ae2b04965cf8 | [
"MIT"
] | 5 | 2021-04-08T19:26:47.000Z | 2022-01-24T16:30:18.000Z | indico/modules/events/static/tasks.py | salevajo/indico | 6f9cbabc20d1641caea907099388ae2b04965cf8 | [
"MIT"
] | 2 | 2019-02-24T17:29:10.000Z | 2021-04-08T19:23:27.000Z | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from datetime import timedelta
from celery.schedules import crontab
from flask import session
from indic... | 39.879518 | 114 | 0.690937 |
29491bf542570866784887147d289fb0a917c166 | 5,392 | py | Python | generative/chair/base_FR.py | daxixi/Context-Aware-Compilation-of-DNN-Training-Pipelines-across-Edge-and-Cloud | bcdd23ba8424717db67dd0a09f40d0126b7c9851 | [
"Apache-2.0"
] | null | null | null | generative/chair/base_FR.py | daxixi/Context-Aware-Compilation-of-DNN-Training-Pipelines-across-Edge-and-Cloud | bcdd23ba8424717db67dd0a09f40d0126b7c9851 | [
"Apache-2.0"
] | null | null | null | generative/chair/base_FR.py | daxixi/Context-Aware-Compilation-of-DNN-Training-Pipelines-across-Edge-and-Cloud | bcdd23ba8424717db67dd0a09f40d0126b7c9851 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import time
import random
import socket
import copy
from queue import Queue
import numpy as np
import torchvision.models as backbones
from torchvision import datasets, transforms
from modules.model import getmodel
from Dataset import... | 35.708609 | 149 | 0.56046 |
54a6239f06aa60d5303bb68a361fc0b000b0e581 | 1,513 | py | Python | views/jobs.py | w1shmast0ur/emblinator-back | e60bea06c374141f6db857db7b4cbe37c42be6f0 | [
"MIT"
] | null | null | null | views/jobs.py | w1shmast0ur/emblinator-back | e60bea06c374141f6db857db7b4cbe37c42be6f0 | [
"MIT"
] | null | null | null | views/jobs.py | w1shmast0ur/emblinator-back | e60bea06c374141f6db857db7b4cbe37c42be6f0 | [
"MIT"
] | null | null | null | from flask import Blueprint, jsonify
from sqlalchemy import func
from models import Job, db, FileAnnotation, File
api = Blueprint('jobs', __name__, url_prefix='/api')
@api.route('/jobs')
def jobs():
annotations_subquery = (
db.session
.query(
File.id.label('file_id'),
fun... | 24.015873 | 83 | 0.539987 |
1ca799aaebe1a50a9e21191fbfcd49481cac7fe4 | 2,949 | py | Python | csf_tz/csftz_hooks/item_reposting.py | RapidSignal-Electronics/CSF_TZ | 2cb8925e85f783623b4facce4048c88cc9c44ca8 | [
"MIT"
] | null | null | null | csf_tz/csftz_hooks/item_reposting.py | RapidSignal-Electronics/CSF_TZ | 2cb8925e85f783623b4facce4048c88cc9c44ca8 | [
"MIT"
] | null | null | null | csf_tz/csftz_hooks/item_reposting.py | RapidSignal-Electronics/CSF_TZ | 2cb8925e85f783623b4facce4048c88cc9c44ca8 | [
"MIT"
] | null | null | null | import frappe
from frappe import _
from frappe.utils import getdate, get_time, today
from erpnext.stock.stock_ledger import update_entries_after
from erpnext.accounts.utils import update_gl_entries_after
from frappe.utils.background_jobs import enqueue
def execute():
for doctype in ('repost_item_valuation', 'stock_en... | 35.107143 | 139 | 0.757884 |
00db470ae716cc811b09ebc7ff0e8b1d441d89ce | 5,671 | py | Python | qcelemental/models/align.py | dgasmith/QCElemental | cd1eeeffd8655368d5fa884047f1e8eddc4c1988 | [
"BSD-3-Clause"
] | null | null | null | qcelemental/models/align.py | dgasmith/QCElemental | cd1eeeffd8655368d5fa884047f1e8eddc4c1988 | [
"BSD-3-Clause"
] | null | null | null | qcelemental/models/align.py | dgasmith/QCElemental | cd1eeeffd8655368d5fa884047f1e8eddc4c1988 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from pydantic import validator
from ..util import blockwise_contract, blockwise_expand
from .basemodels import ProtoModel
from .types import Array
__all__ = ["AlignmentMill"]
class AlignmentMill(ProtoModel):
"""Facilitates the application of the simple transformation operations
defined by... | 35.223602 | 99 | 0.590548 |
7dc6c95f983ed571ed162412cc1e2fbf46f00f36 | 612 | py | Python | youtube_saver/migrations/0009_auto_20200617_1615.py | cr0manty/Fox_Project | a12e936fba79f290c0c9ecce16bc33de18a3a10c | [
"MIT"
] | null | null | null | youtube_saver/migrations/0009_auto_20200617_1615.py | cr0manty/Fox_Project | a12e936fba79f290c0c9ecce16bc33de18a3a10c | [
"MIT"
] | 4 | 2021-04-08T20:58:40.000Z | 2021-09-08T01:32:35.000Z | youtube_saver/migrations/0009_auto_20200617_1615.py | cr0manty/Fox_Project | a12e936fba79f290c0c9ecce16bc33de18a3a10c | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-06-17 13:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('youtube_saver', '0008_downloadyoutubemp3shortlink'),
]
operations = [
migrations.AlterModelOptions(
name='downloadyoutubemp3shortlink',... | 27.818182 | 97 | 0.633987 |
73b2dcb4f66f01d61d01fe5c8a0805f921a3a63d | 363 | py | Python | tests/kit/unicode.py | untzag/WrightTools | 05480d2f91ceeca422d9e5ac381fce1840207cb0 | [
"MIT"
] | 12 | 2017-07-11T15:58:12.000Z | 2021-05-10T20:33:26.000Z | tests/kit/unicode.py | untzag/WrightTools | 05480d2f91ceeca422d9e5ac381fce1840207cb0 | [
"MIT"
] | 808 | 2015-04-12T00:36:08.000Z | 2022-03-27T21:06:06.000Z | tests/kit/unicode.py | untzag/WrightTools | 05480d2f91ceeca422d9e5ac381fce1840207cb0 | [
"MIT"
] | 9 | 2017-07-22T18:54:23.000Z | 2022-02-17T20:31:05.000Z | """Test unicode dictionary."""
# --- import -------------------------------------------------------------------------------------
import WrightTools as wt
# --- test ---------------------------------------------------------------------------------------
def test_print():
for key, value in wt.kit.unicode_dic... | 22.6875 | 98 | 0.327824 |
14272617d6fd7b8b8863e1f2544e2c40136031c3 | 15,065 | py | Python | ibeis/web/appfuncs.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | 1 | 2019-01-17T22:59:14.000Z | 2019-01-17T22:59:14.000Z | ibeis/web/appfuncs.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | ibeis/web/appfuncs.py | SU-ECE-17-7/ibeis | b12a45b06d8ce8f52585494c15f6776f5889ed67 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from six.moves import cStringIO as StringIO
# import cStringIO as StringIO
import flask
import random
from ibeis.constants import TAU
from flask import request, current_app
from os.path import join, dirname, abspath # NOQA
from da... | 37.197531 | 119 | 0.629539 |
92428183d5b198e9d92d15bc401518740d918c36 | 40,899 | py | Python | vendor-local/lib/python/fudge/tests/test_fudge.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 2 | 2015-04-06T15:20:29.000Z | 2016-12-30T12:25:11.000Z | vendor-local/lib/python/fudge/tests/test_fudge.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 2 | 2019-02-17T17:38:02.000Z | 2019-03-28T03:49:16.000Z | vendor-local/lib/python/fudge/tests/test_fudge.py | Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803 | 4e374b4d52dfb9039ebe543e7f27682189022307 | [
"BSD-3-Clause"
] | 1 | 2019-03-28T03:49:18.000Z | 2019-03-28T03:49:18.000Z | from __future__ import with_statement
import sys
import unittest
from nose.tools import eq_, raises
from nose.exc import SkipTest
import fudge
from fudge.inspector import arg
from fudge import (
Fake, Registry, ExpectedCall, ExpectedCallOrder, Call, CallStack, FakeDeclarationError)
def test_decorator_on_def():
... | 32.027408 | 95 | 0.584831 |
b646c29f40cd522417ea3d457dbfb44a88fa897a | 1,371 | py | Python | components/ai.py | qvant/roquelike3 | c2ece64ee80da3a341095c77f174513b90266396 | [
"MIT"
] | null | null | null | components/ai.py | qvant/roquelike3 | c2ece64ee80da3a341095c77f174513b90266396 | [
"MIT"
] | null | null | null | components/ai.py | qvant/roquelike3 | c2ece64ee80da3a341095c77f174513b90266396 | [
"MIT"
] | null | null | null | import libtcodpy as libtcod
from random import randint
from game_messages import Message
class BasicMonster:
def take_turn(self, target, fov_map, game_map, entities):
results = []
monster = self.owner
if libtcod.map_is_in_fov(fov_map, monster.x, monster.y):
if monster.distance... | 32.642857 | 119 | 0.628009 |
d8f1e99aa7e7fd4ac84957d8444f08a1fd7bbf61 | 6,885 | py | Python | blogofile/tests/test_plugin.py | gencer/blogofile | f8503eb5a4e9f7962b799adfdc3afc2dd6fe91c9 | [
"MIT"
] | 74 | 2015-01-12T07:16:55.000Z | 2022-02-02T10:41:55.000Z | blogofile/tests/test_plugin.py | Acidburn0zzz/blogofile | f8503eb5a4e9f7962b799adfdc3afc2dd6fe91c9 | [
"MIT"
] | 8 | 2015-04-14T22:44:14.000Z | 2016-10-05T04:59:26.000Z | blogofile/tests/test_plugin.py | Acidburn0zzz/blogofile | f8503eb5a4e9f7962b799adfdc3afc2dd6fe91c9 | [
"MIT"
] | 31 | 2015-03-07T11:57:37.000Z | 2022-03-08T06:33:25.000Z | # -*- coding: utf-8 -*-
"""Unit tests for blogofile plugin module.
"""
try:
import unittest2 as unittest # For Python 2.6
except ImportError:
import unittest # flake8 ignore # NOQA
from mock import (
MagicMock,
patch,
)
from .. import plugin
class TestGetByName(unittest.Test... | 39.342857 | 79 | 0.631518 |
3f0fb21494d4fd3a13f7c5245b248864961b0556 | 21,871 | py | Python | earwigbot/config/script.py | evolutionoftheuniverse/earwigbot | 9edd33dad8f24c61e4a800a30e09e89251def749 | [
"MIT"
] | null | null | null | earwigbot/config/script.py | evolutionoftheuniverse/earwigbot | 9edd33dad8f24c61e4a800a30e09e89251def749 | [
"MIT"
] | null | null | null | earwigbot/config/script.py | evolutionoftheuniverse/earwigbot | 9edd33dad8f24c61e4a800a30e09e89251def749 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2009-2016 Ben Kurtovic <ben.kurtovic@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation ... | 45.947479 | 104 | 0.553198 |
36d4fcc1c87abae4af6750aa10d4475fdca57256 | 12,612 | py | Python | tests/test_object_message.py | betasewer/machaon | 63ccb4405ac693f14f9d25f6a706466a917dddbf | [
"MIT"
] | 2 | 2020-07-05T08:39:12.000Z | 2022-01-19T22:08:21.000Z | tests/test_object_message.py | betasewer/machaon | 63ccb4405ac693f14f9d25f6a706466a917dddbf | [
"MIT"
] | 23 | 2020-06-23T16:18:17.000Z | 2021-12-29T09:56:48.000Z | tests/test_object_message.py | betasewer/machaon | 63ccb4405ac693f14f9d25f6a706466a917dddbf | [
"MIT"
] | null | null | null | from machaon.core.invocation import INVOCATION_FLAG_RAISE_ERROR, _new_process_error_object
import pytest
import re
from machaon.core.type import Type
from machaon.core.object import Object
from machaon.core.message import MessageEngine, MessageExpression, MemberGetExpression, MessageTokenBuffer, SequentialMessageExpre... | 30.911765 | 207 | 0.603314 |
d2bb197da6dcf80169d0ea38df078e251a3bdbd6 | 35,222 | py | Python | powerdnsadmin/models/domain.py | gunet/PowerDNS-Admin | 9e999e7202ef4cd83dcddb4179cdd5b357529a30 | [
"MIT"
] | null | null | null | powerdnsadmin/models/domain.py | gunet/PowerDNS-Admin | 9e999e7202ef4cd83dcddb4179cdd5b357529a30 | [
"MIT"
] | null | null | null | powerdnsadmin/models/domain.py | gunet/PowerDNS-Admin | 9e999e7202ef4cd83dcddb4179cdd5b357529a30 | [
"MIT"
] | 1 | 2022-02-22T03:24:16.000Z | 2022-02-22T03:24:16.000Z | import re
import traceback
from flask import current_app
from urllib.parse import urljoin
from distutils.util import strtobool
from ..lib import utils
from .base import db, domain_apikey
from .setting import Setting
from .user import User
from .account import Account
from .account import AccountUser
from .domain_user ... | 39.93424 | 98 | 0.509312 |
22c82e768d1ce82fa8348e7a3d0adec346e63b82 | 1,392 | py | Python | complete/merge_pipeline/tests/file_transform_test.py | asaharland/apache-beam-python-examples | 964a5c72053f293b32348a1996b173615bf6aae4 | [
"Apache-2.0"
] | 7 | 2019-10-10T16:25:17.000Z | 2021-05-05T23:27:58.000Z | complete/merge_pipeline/tests/file_transform_test.py | asaharland/apache-beam-python-examples | 964a5c72053f293b32348a1996b173615bf6aae4 | [
"Apache-2.0"
] | 2 | 2021-02-08T20:28:59.000Z | 2021-04-30T20:44:22.000Z | complete/merge_pipeline/tests/file_transform_test.py | asaharland/apache-beam-python-examples | 964a5c72053f293b32348a1996b173615bf6aae4 | [
"Apache-2.0"
] | 6 | 2019-06-18T00:38:21.000Z | 2021-02-08T21:17:42.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 33.142857 | 85 | 0.747126 |
8c5bdc885a64ec6fcf10fcb2c7718eea25d81f03 | 1,315 | py | Python | tests/integration/test_upgrade_charm.py | canonical/karma-k8s-operator | 344c5c93ed2bdcaead1bb5a7bab1ed275508c9e4 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_upgrade_charm.py | canonical/karma-k8s-operator | 344c5c93ed2bdcaead1bb5a7bab1ed275508c9e4 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_upgrade_charm.py | canonical/karma-k8s-operator | 344c5c93ed2bdcaead1bb5a7bab1ed275508c9e4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 Canonical Ltd.
# See LICENSE file for licensing details.
import logging
from pathlib import Path
import pytest
import yaml
from helpers import get_config_values
logger = logging.getLogger(__name__)
METADATA = yaml.safe_load(Path("./metadata.yaml").read_text())
app_name = MET... | 37.571429 | 99 | 0.764259 |
238b9524e723882f147d8163e4a04b906494bb39 | 22,858 | py | Python | tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/colorization_evaluator.py | ermubuzhiming/open_model_zoo | d204db6ae8afcfb9c484047e538692c89d775bf1 | [
"Apache-2.0"
] | 1 | 2021-01-14T03:33:06.000Z | 2021-01-14T03:33:06.000Z | tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/colorization_evaluator.py | ermubuzhiming/open_model_zoo | d204db6ae8afcfb9c484047e538692c89d775bf1 | [
"Apache-2.0"
] | null | null | null | tools/accuracy_checker/accuracy_checker/evaluators/custom_evaluators/colorization_evaluator.py | ermubuzhiming/open_model_zoo | d204db6ae8afcfb9c484047e538692c89d775bf1 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2018-2021 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 wri... | 44.042389 | 118 | 0.660819 |
bdeef5ecb135e522f7c40abc5e24bd958b8ff052 | 1,859 | py | Python | DatabaseHandler/sqlite_operations.py | utkarsh7236/SCILLA | e11e4d753823ad522a1b3168283b6e6ffe3ea393 | [
"Apache-2.0"
] | 17 | 2019-12-09T19:09:07.000Z | 2021-08-29T01:11:13.000Z | DatabaseHandler/sqlite_operations.py | utkarsh7236/SCILLA | e11e4d753823ad522a1b3168283b6e6ffe3ea393 | [
"Apache-2.0"
] | 1 | 2021-04-14T15:08:18.000Z | 2021-04-14T15:08:18.000Z | DatabaseHandler/sqlite_operations.py | utkarsh7236/SCILLA | e11e4d753823ad522a1b3168283b6e6ffe3ea393 | [
"Apache-2.0"
] | 2 | 2020-06-05T03:01:06.000Z | 2020-07-09T07:13:12.000Z | #!/usr/bin/env python
__author__ = 'Florian Hase'
#========================================================================
import time
import sqlalchemy as sql
#========================================================================
class AddEntry(object):
def __init__(self, database, table, entry):
self.... | 23.833333 | 73 | 0.550834 |
46cbb42e1d8317374bc31889c009d99187a98b4b | 3,978 | py | Python | datuner/tune.py | Hecmay/opentuner | c97e7792622868491c924d0e0288a5972b32121b | [
"MIT"
] | 1 | 2019-08-16T17:22:42.000Z | 2019-08-16T17:22:42.000Z | datuner/tune.py | Hecmay/opentuner | c97e7792622868491c924d0e0288a5972b32121b | [
"MIT"
] | null | null | null | datuner/tune.py | Hecmay/opentuner | c97e7792622868491c924d0e0288a5972b32121b | [
"MIT"
] | null | null | null | import sys
import adddeps
import argparse
import opentuner
from opentuner import ConfigurationManipulator
from opentuner import EnumParameter
from opentuner import FloatParameter
from opentuner import IntegerParameter
from opentuner import MeasurementInterface
from opentuner import Result
import socket
import pickle
im... | 30.6 | 95 | 0.642031 |
42ed4053cad99689141bd486c5b3a203d874fddd | 5,528 | py | Python | azure-mgmt-redis/azure/mgmt/redis/models/redis_resource.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/redis/models/redis_resource.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure/mgmt/redis/models/redis_resource.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 46.847458 | 355 | 0.640376 |
36ce2b80319b9a9a4e9b555e8b212ce6a152e49b | 8,147 | py | Python | tests/test_component_group.py | hemantsangwan/home-assistant | 28b397030d2f66bb084f80d8a237d0a2c11bac79 | [
"MIT"
] | 2 | 2021-05-25T01:08:57.000Z | 2022-01-09T21:02:46.000Z | tests/test_component_group.py | hemantsangwan/home-assistant | 28b397030d2f66bb084f80d8a237d0a2c11bac79 | [
"MIT"
] | null | null | null | tests/test_component_group.py | hemantsangwan/home-assistant | 28b397030d2f66bb084f80d8a237d0a2c11bac79 | [
"MIT"
] | 1 | 2022-02-04T10:11:57.000Z | 2022-02-04T10:11:57.000Z | """
tests.test_component_group
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the group compoments.
"""
# pylint: disable=protected-access,too-many-public-methods
import unittest
import logging
import homeassistant as ha
from homeassistant.const import STATE_ON, STATE_OFF, STATE_HOME, STATE_UNKNOWN
import homeassistant.component... | 37.200913 | 82 | 0.637658 |
a6ad3223e0b9c869439e330c099f93251551497f | 2,714 | py | Python | SenseHat-og-I2C-materiale/sense-hat-board/01. Joystick og gyroskop opgave/#Afleveringer/Anders Christian Rungborg/qyrogyroskop.py | ATS-SKP-DataIT/RaspberryPi-SenseHat | 99cd55bbd17d45be4cc3b57fa25da842a1febf1d | [
"MIT"
] | null | null | null | SenseHat-og-I2C-materiale/sense-hat-board/01. Joystick og gyroskop opgave/#Afleveringer/Anders Christian Rungborg/qyrogyroskop.py | ATS-SKP-DataIT/RaspberryPi-SenseHat | 99cd55bbd17d45be4cc3b57fa25da842a1febf1d | [
"MIT"
] | 1 | 2022-02-02T09:58:34.000Z | 2022-02-02T09:58:34.000Z | SenseHat-og-I2C-materiale/sense-hat-board/01. Joystick og gyroskop opgave/#Afleveringer/Anders Christian Rungborg/qyrogyroskop.py | ATS-SKP-DataIT/RaspberryPi-SenseHat | 99cd55bbd17d45be4cc3b57fa25da842a1febf1d | [
"MIT"
] | 1 | 2022-02-02T09:57:48.000Z | 2022-02-02T09:57:48.000Z | # Anders Chr Rungborg
# 19-04-2020
# LEDPild
from sense_hat import SenseHat
hat = SenseHat()
b = (0, 0, 255) # Blå
g = (0, 255, 0) # Grøn
x = (0, 0, 0) # slåg
image_Op = [ # pil op... | 29.5 | 79 | 0.324982 |
52602a9bb88677bfc30403ff643c258d06f584eb | 2,214 | py | Python | storage/test/responses/minio_mocks.py | virajut/k8-test-data | d2386c2a5c12623f868bd9923d1aa5b262b55b5e | [
"Apache-2.0"
] | null | null | null | storage/test/responses/minio_mocks.py | virajut/k8-test-data | d2386c2a5c12623f868bd9923d1aa5b262b55b5e | [
"Apache-2.0"
] | null | null | null | storage/test/responses/minio_mocks.py | virajut/k8-test-data | d2386c2a5c12623f868bd9923d1aa5b262b55b5e | [
"Apache-2.0"
] | null | null | null | from http import client as httplib
from nose.tools import eq_
class MockResponse(object):
def __init__(self, method, url, headers, status_code,
response_headers=None, content=None):
self.method = method
self.url = url
self.request_headers = {
key.lower(): valu... | 30.328767 | 70 | 0.620145 |
0a4ffac7e4ce1df88f866f54c33283655fefd1e1 | 1,842 | py | Python | test/torch/mpc/test_crypto_store.py | sparkingdark/PySyft | 8fec86803dd20ca9ad58590ff0d16559991f1b08 | [
"Apache-2.0"
] | 3 | 2020-09-23T14:09:09.000Z | 2020-09-23T19:26:28.000Z | test/torch/mpc/test_crypto_store.py | sparkingdark/PySyft | 8fec86803dd20ca9ad58590ff0d16559991f1b08 | [
"Apache-2.0"
] | null | null | null | test/torch/mpc/test_crypto_store.py | sparkingdark/PySyft | 8fec86803dd20ca9ad58590ff0d16559991f1b08 | [
"Apache-2.0"
] | 1 | 2021-03-28T15:11:22.000Z | 2021-03-28T15:11:22.000Z | import pytest
from syft.exceptions import EmptyCryptoPrimitiveStoreError
from syft.frameworks.torch.mpc.przs import RING_SIZE, PRZS, gen_alpha_3of3, gen_alpha_2of3
def test_primitives_usage(workers):
me, alice, bob, crypto_provider = (
workers["me"],
workers["alice"],
workers["bob"],
... | 27.088235 | 90 | 0.650923 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.