hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
03904fa59151719f98204fac99c915de00045232 | 5,818 | py | Python | src/olympia/translations/query.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 3 | 2020-03-05T18:17:14.000Z | 2020-03-09T01:24:38.000Z | src/olympia/translations/query.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/translations/query.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2021-11-24T07:29:55.000Z | 2021-11-24T07:29:55.000Z | import itertools
from collections import OrderedDict
from django.conf import settings
from django.db import models
from django.db.models.sql import compiler
from django.db.models.sql.constants import LOUTER
from django.db.models.sql.datastructures import Join
from django.utils import translation as translation_utils
... | 39.578231 | 79 | 0.64352 |
039055147b30569f68e1dce8512d32898545c994 | 16,945 | py | Python | pyqmc/slaterpbc.py | YiqingZhouKelly/pyqmc | ec14c7b3cceb01d287cb09ebc5d2af37014c1c8e | [
"MIT"
] | null | null | null | pyqmc/slaterpbc.py | YiqingZhouKelly/pyqmc | ec14c7b3cceb01d287cb09ebc5d2af37014c1c8e | [
"MIT"
] | null | null | null | pyqmc/slaterpbc.py | YiqingZhouKelly/pyqmc | ec14c7b3cceb01d287cb09ebc5d2af37014c1c8e | [
"MIT"
] | null | null | null | import numpy as np
from pyqmc import pbc, slateruhf
def get_supercell_kpts(supercell):
Sinv = np.linalg.inv(supercell.S).T
u = [0, 1]
unit_box = np.stack([x.ravel() for x in np.meshgrid(*[u] * 3, indexing="ij")]).T
unit_box_ = np.dot(unit_box, supercell.S.T)
xyz_range = np.stack([f(unit_b... | 39.870588 | 225 | 0.557569 |
039067d20cc9f037b0c1ecbc0a938f7695980d3b | 144 | py | Python | django_enum_choices/tests/testapp/apps.py | okapies/django-enum-choices | f913ad8eb74e73fda77662018a5f03b929799aea | [
"MIT"
] | 73 | 2019-06-21T15:20:15.000Z | 2021-11-18T16:05:52.000Z | django_enum_choices/tests/testapp/apps.py | okapies/django-enum-choices | f913ad8eb74e73fda77662018a5f03b929799aea | [
"MIT"
] | 36 | 2019-06-21T14:48:44.000Z | 2021-11-25T14:42:33.000Z | django_enum_choices/tests/testapp/apps.py | okapies/django-enum-choices | f913ad8eb74e73fda77662018a5f03b929799aea | [
"MIT"
] | 13 | 2019-07-24T12:42:41.000Z | 2021-11-18T16:06:35.000Z | from django.apps import AppConfig
class TestAppConfig(AppConfig):
name = 'django_enum_choices.tests.testapp'
verbose_name = 'TestApp'
| 20.571429 | 46 | 0.763889 |
0390ac9cb4c8be65314910c8047573565e69146e | 7,518 | py | Python | helpers.py | gate42qc/EM-and-DD | 2a37e5f9dbe59a7636c6876df88995f853fec941 | [
"MIT"
] | 1 | 2019-10-06T20:59:11.000Z | 2019-10-06T20:59:11.000Z | helpers.py | gate42qc/EM-and-DD | 2a37e5f9dbe59a7636c6876df88995f853fec941 | [
"MIT"
] | null | null | null | helpers.py | gate42qc/EM-and-DD | 2a37e5f9dbe59a7636c6876df88995f853fec941 | [
"MIT"
] | 1 | 2019-04-12T22:25:39.000Z | 2019-04-12T22:25:39.000Z | from pyquil.noise import add_decoherence_noise
from pyquil.gates import *
from pyquil.quil import Program
import random
random.seed()
import numpy as np
pi = np.pi
def get_one_q_circuit(q_index, depth):
"""
:param q_index: index of the qubit which the circuit acts on
:depth: depth of the circuit
:ret... | 31.325 | 131 | 0.568103 |
0390ba22ef5a5f64c6cd55836546e0f50fbfb699 | 9,701 | py | Python | kusanagi/base/ExperienceDataset.py | tsetimmy/kusanagi | 868b301b6064af7d21f0f716aa4390e402f2e2ec | [
"MIT"
] | 22 | 2018-08-04T04:51:27.000Z | 2021-11-03T14:22:16.000Z | kusanagi/base/ExperienceDataset.py | tsetimmy/kusanagi | 868b301b6064af7d21f0f716aa4390e402f2e2ec | [
"MIT"
] | 1 | 2021-11-16T12:41:14.000Z | 2021-11-16T12:41:14.000Z | kusanagi/base/ExperienceDataset.py | tsetimmy/kusanagi | 868b301b6064af7d21f0f716aa4390e402f2e2ec | [
"MIT"
] | 7 | 2018-08-04T04:51:29.000Z | 2021-07-17T07:26:04.000Z | import theano
import numpy as np
from kusanagi import utils
from kusanagi.base.Loadable import Loadable
class ExperienceDataset(Loadable):
''' Class used to store data from runs with a learning agent'''
def __init__(self, name='Experience', filename_prefix=None, filename=None):
self.name = name
... | 39.758197 | 79 | 0.570354 |
0390e9b55b29447ed68f6764f978b11461e1ffbb | 157 | py | Python | we_search/apps.py | shawxiaozhang/we_web | c9736c09fda1aa9b5d7796ba0315637697baa7e0 | [
"MIT"
] | null | null | null | we_search/apps.py | shawxiaozhang/we_web | c9736c09fda1aa9b5d7796ba0315637697baa7e0 | [
"MIT"
] | null | null | null | we_search/apps.py | shawxiaozhang/we_web | c9736c09fda1aa9b5d7796ba0315637697baa7e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class WeSearchConfig(AppConfig):
name = 'we_search'
| 17.444444 | 39 | 0.738854 |
0390ea0e9d6da5f8e48b4316cfbec85822bd3860 | 3,858 | py | Python | homeassistant/components/sensor/fastdotcom.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 13 | 2017-02-01T13:25:34.000Z | 2022-01-26T01:30:39.000Z | homeassistant/components/sensor/fastdotcom.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 9 | 2017-07-26T18:05:32.000Z | 2021-12-05T14:16:34.000Z | homeassistant/components/sensor/fastdotcom.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 21 | 2017-07-26T17:09:40.000Z | 2022-03-27T22:37:22.000Z | """
Support for Fast.com internet speed testing sensor.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.fastdotcom/
"""
import logging
import voluptuous as vol
import homeassistant.util.dt as dt_util
import homeassistant.helpers.config_validation ... | 32.694915 | 78 | 0.622602 |
039108ead15272faac429718f6a059a8819dec9d | 4,230 | py | Python | tests/dictlrn/test_onlinecdl.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 217 | 2016-06-13T16:41:26.000Z | 2022-03-22T06:31:05.000Z | tests/dictlrn/test_onlinecdl.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 21 | 2016-06-13T23:28:35.000Z | 2022-02-17T23:20:01.000Z | tests/dictlrn/test_onlinecdl.py | vishalbelsare/sporco | afc3dae3ab81d84a23e8487812670ecb7457e869 | [
"BSD-3-Clause"
] | 47 | 2016-12-14T13:08:33.000Z | 2021-12-12T01:59:49.000Z | from __future__ import division
from builtins import object
import numpy as np
from sporco.dictlrn import onlinecdl
class TestSet01(object):
def setup_method(self, method):
N = 16
Nd = 5
M = 4
K = 3
np.random.seed(12345)
self.D0 = np.random.randn(Nd, Nd, M)
... | 28.581081 | 78 | 0.521513 |
03911173989099201d704ab6315ea2fb6e18a7db | 4,260 | py | Python | cogs/anime and vocaloids/vocaloids_slash.py | Hatsune-Miku-Bot/miku | 821f21f5ff0d7731d8afff26cabfe5b64ef91289 | [
"CC0-1.0"
] | null | null | null | cogs/anime and vocaloids/vocaloids_slash.py | Hatsune-Miku-Bot/miku | 821f21f5ff0d7731d8afff26cabfe5b64ef91289 | [
"CC0-1.0"
] | 18 | 2021-05-19T11:35:49.000Z | 2022-01-10T08:50:21.000Z | cogs/anime and vocaloids/vocaloids_slash.py | Hatsune-Miku-Bot/miku | 821f21f5ff0d7731d8afff26cabfe5b64ef91289 | [
"CC0-1.0"
] | null | null | null | from discord.ext import commands
from discord_slash import SlashContext, cog_ext
from util import meek_moe
class VocaloidSlash(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.description = 'Get some kawai pictures of the vocaloids.'
@cog_ext.cog_slash(name="rin", description='Rin... | 40.571429 | 83 | 0.669718 |
03912deea0a2f34e61ef4d838def7dd6f1c5a964 | 24,881 | py | Python | google-cloud-sdk/platform/gsutil/gslib/tests/test_rewrite.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/platform/gsutil/gslib/tests/test_rewrite.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/platform/gsutil/gslib/tests/test_rewrite.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # -*- coding: utf-8 -*-
# Copyright 2015 Google Inc. 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 require... | 46.768797 | 80 | 0.665608 |
03913153671d962f682bf828e9f7a5851dd26b27 | 334 | py | Python | setup.py | crherman7/govini-site-crawler | c8ca026a3af241a2740ed77ed15889dbb3839d38 | [
"MIT"
] | null | null | null | setup.py | crherman7/govini-site-crawler | c8ca026a3af241a2740ed77ed15889dbb3839d38 | [
"MIT"
] | null | null | null | setup.py | crherman7/govini-site-crawler | c8ca026a3af241a2740ed77ed15889dbb3839d38 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="govini-site-crawler",
description="Govini assessment script that crawls a specified website",
version="1",
packages=find_packages(exclude="tests"),
author="Christopher Herman",
author_email="crherman7@gmail.com",
scripts=['scripts/run... | 27.833333 | 75 | 0.724551 |
0391343f6e2bdee3b180ee4e13657efeb1a21e9d | 13,531 | py | Python | aea/manager/project.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | aea/manager/project.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | aea/manager/project.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 36.669377 | 108 | 0.640603 |
03913f54a173e2fb20bbbee682467880227ca1e3 | 379 | py | Python | tests/test_boil_use.py | jneug/parboil | ef12c98a7f577694e6a915070ab3a639257351ce | [
"MIT"
] | 1 | 2021-03-09T20:09:48.000Z | 2021-03-09T20:09:48.000Z | tests/test_boil_use.py | jneug/parboil | ef12c98a7f577694e6a915070ab3a639257351ce | [
"MIT"
] | 20 | 2021-03-02T14:24:46.000Z | 2021-03-10T17:07:07.000Z | tests/test_boil_use.py | jneug/parboil | ef12c98a7f577694e6a915070ab3a639257351ce | [
"MIT"
] | null | null | null | from click.testing import CliRunner
from parboil.parboil import boil
def test_boil_use():
runner = CliRunner()
# use without args not allowed
result = runner.invoke(boil, ["use"])
assert result.exit_code == 2
# help message
result = runner.invoke(boil, ["use", "--help"])
assert result.ex... | 23.6875 | 51 | 0.672823 |
03914cdbda1daeb8dbb9ad583cbac2ed9a090d22 | 3,140 | py | Python | main/guess_a_number_codemaker.py | techrabbit58/guess_a_number | f57b421e8c175d11958f710181d8cd74cb947e15 | [
"Unlicense"
] | null | null | null | main/guess_a_number_codemaker.py | techrabbit58/guess_a_number | f57b421e8c175d11958f710181d8cd74cb947e15 | [
"Unlicense"
] | null | null | null | main/guess_a_number_codemaker.py | techrabbit58/guess_a_number | f57b421e8c175d11958f710181d8cd74cb947e15 | [
"Unlicense"
] | null | null | null | """
Mastermind Game Play: Code Maker
"""
import sys
from argparse import ArgumentParser
from collections import Counter
from itertools import product, permutations
from random import choice
from typing import Tuple, List
# variants
STANDARD = 0
NO_REPEATS = 1
# number of colors for code
BASIC = 6
SUPER = 8
# number ... | 32.371134 | 114 | 0.611465 |
039161d23d71da6860472dd95e61a4ccc2c38084 | 6,635 | py | Python | src/spaceone/repository/connector/repository_connector.py | choonho/repository | 9522ecad06dd4e36c718e203864d1d58574cdbfc | [
"Apache-2.0"
] | null | null | null | src/spaceone/repository/connector/repository_connector.py | choonho/repository | 9522ecad06dd4e36c718e203864d1d58574cdbfc | [
"Apache-2.0"
] | null | null | null | src/spaceone/repository/connector/repository_connector.py | choonho/repository | 9522ecad06dd4e36c718e203864d1d58574cdbfc | [
"Apache-2.0"
] | null | null | null | import logging
from spaceone.core.connector import BaseConnector
from spaceone.core import pygrpc
from spaceone.core.utils import *
from spaceone.core.auth.jwt.jwt_util import JWTUtil
from spaceone.repository.error import *
__all__ = ["RepositoryConnector"]
_LOGGER = logging.getLogger(__name__)
class RepositoryCon... | 35.481283 | 116 | 0.583873 |
0391763c1355bc2dc7462c97201e7088cac85ccc | 337 | py | Python | Aula8/Aula8-Tuplas.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula8/Aula8-Tuplas.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | Aula8/Aula8-Tuplas.py | diegocolombo1989/Trabalho-Python | 4603117bebfb6e801c3289e108b4e8f29442ab6f | [
"MIT"
] | null | null | null | # Aula 8 - 18-11-2019
# Tuplas
numeros = [1,4,6]
usuario = {'nome':'user', 'passwd':123456 }
pessoa = ('maykon','granemann',0, 45.5, numeros)
# print(numeros)
# print(usuario)
# print(pessoa)
lista = [1]
numeros[1] = 5
usuario['passwd'] = 456123
lista_pessoas = []
lista_pessoas.append(pessoa)
#pessoa[4][1] = 6
print... | 16.85 | 48 | 0.643917 |
03917ee34d5c7b83fa4d4ec0504bdfe47fd38024 | 2,075 | py | Python | authors/apps/authentication/tests/test_user_model.py | andela/ah-backend-prime | 0708463d4565a4977a5a5dcb839f1dfed52fdc90 | [
"BSD-3-Clause"
] | 1 | 2019-09-19T14:30:05.000Z | 2019-09-19T14:30:05.000Z | authors/apps/authentication/tests/test_user_model.py | e-ian/authors-haven-frontend | 05829c8088ca49ef2cf0863dc87ec55b44b13534 | [
"BSD-3-Clause"
] | 22 | 2019-03-25T16:10:53.000Z | 2022-03-11T23:44:21.000Z | authors/apps/authentication/tests/test_user_model.py | e-ian/authors-haven-frontend | 05829c8088ca49ef2cf0863dc87ec55b44b13534 | [
"BSD-3-Clause"
] | 6 | 2019-03-25T09:39:39.000Z | 2021-03-11T23:54:12.000Z | from authors.apps.authentication.models import User, UserManager
from django.test import TestCase
from unittest.mock import patch, MagicMock, PropertyMock
from .base import BaseTest
class TestModel(TestCase):
def test_empty_email(self):
User.objects.create_user(username="anyatibrian",
... | 34.016393 | 80 | 0.590843 |
0391837821a08a0372cb2670a7725f6344f92f75 | 7,685 | py | Python | src/create_data.py | sovit-123/SSD300-VGG11-on-Pascal-VOC-2005-Data | cb21c4c3e762a0184611b1a1659e7e730ef31932 | [
"MIT"
] | 2 | 2020-08-15T13:02:05.000Z | 2021-05-06T13:11:16.000Z | src/create_data.py | sovit-123/SSD300-VGG11-on-Pascal-VOC-2005-Data | cb21c4c3e762a0184611b1a1659e7e730ef31932 | [
"MIT"
] | null | null | null | src/create_data.py | sovit-123/SSD300-VGG11-on-Pascal-VOC-2005-Data | cb21c4c3e762a0184611b1a1659e7e730ef31932 | [
"MIT"
] | null | null | null | from utils import label_map
import os
import json
import re
import argparse
def parse_text_files(annotation_path, obj_type):
"""
Function to parser the dataset text files. You can find
more details about the datset here:
http://host.robots.ox.ac.uk/pascal/VOC/voc2005/chapter.pdf
"""
boxes = l... | 39.410256 | 114 | 0.524658 |
03918a7c64c761d433d93bb543643d9ed4ae9e06 | 3,145 | py | Python | irony_detection/control_random.py | amosbastian/IronyDetection | da97a9644f2979f356d769bcbec260d7fb35e6a1 | [
"MIT"
] | null | null | null | irony_detection/control_random.py | amosbastian/IronyDetection | da97a9644f2979f356d769bcbec260d7fb35e6a1 | [
"MIT"
] | 4 | 2020-01-28T22:44:27.000Z | 2021-05-21T15:38:56.000Z | irony_detection/control_random.py | amosbastian/IronyDetection | da97a9644f2979f356d769bcbec260d7fb35e6a1 | [
"MIT"
] | null | null | null | import logging
import os
from random import shuffle
import nltk
from utils import remove_ngram, tokenise
DIR_PATH = os.path.dirname(os.path.realpath(__file__))
def random_ngrams(ngrams, number_of_ngrams):
relevant_ngrams = ngrams[:number_of_ngrams]
remaining_ngrams = ngrams[number_of_ngrams:]
relevant... | 31.767677 | 84 | 0.628617 |
039195ee7889534b4580b9384923e8ab725fe06d | 1,685 | py | Python | modules/loto/LotoModule.py | Korbier/PyWsServer | 95510a935c3019ead04d2de71e4344d94b3ac560 | [
"MIT"
] | null | null | null | modules/loto/LotoModule.py | Korbier/PyWsServer | 95510a935c3019ead04d2de71e4344d94b3ac560 | [
"MIT"
] | null | null | null | modules/loto/LotoModule.py | Korbier/PyWsServer | 95510a935c3019ead04d2de71e4344d94b3ac560 | [
"MIT"
] | null | null | null | import sys
from datetime import datetime
from core.module.module import Module
from core.module.message import *
from modules.loto.service.LotoDaoService import LotoDaoService
class LotoModule(Module):
"""Module Loto"""
KEYWORD_SELECT = 'select' # Usage: select 'number'
KEYWORD_UNSEL... | 30.636364 | 85 | 0.624926 |
0391b837bf896b20a985142f5e6014c34923e57f | 7,549 | py | Python | multicurrency/shekel.py | fscm/multicurrency | 5eabdcbfbf427dcafe08d4d05cfce8c9348aeb91 | [
"MIT"
] | 2 | 2021-03-26T18:19:57.000Z | 2021-07-27T01:15:50.000Z | multicurrency/shekel.py | fscm/multicurrency | 5eabdcbfbf427dcafe08d4d05cfce8c9348aeb91 | [
"MIT"
] | null | null | null | multicurrency/shekel.py | fscm/multicurrency | 5eabdcbfbf427dcafe08d4d05cfce8c9348aeb91 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
#
# copyright: 2020-2022, Frederico Martins
# author: Frederico Martins <http://github.com/fscm>
# license: SPDX-License-Identifier: MIT
"""Shekel currency representation(s)."""
from decimal import Decimal
from typing import Optional, Union
from .currency import Currency
class NewIsraeliShek... | 36.468599 | 77 | 0.605246 |
0391cc56ccc4348b828c1dba2a361a6311c152e4 | 1,241 | py | Python | alipay/aop/api/domain/PayForPrivilegeCardTemplateOperationItem.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/PayForPrivilegeCardTemplateOperationItem.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/PayForPrivilegeCardTemplateOperationItem.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class PayForPrivilegeCardTemplateOperationItem(object):
def __init__(self):
self._text = None
self._url = None
@property
def text(self):
return self._text
@text.se... | 22.160714 | 59 | 0.540693 |
039245f18267365aade040df155a5b164f6fedc1 | 42,644 | py | Python | nemo/utils/exp_manager.py | volkoshkursk/NeMo | 2df92ec9ca3204b7d3cd52f1b133c971de8dc00a | [
"Apache-2.0"
] | null | null | null | nemo/utils/exp_manager.py | volkoshkursk/NeMo | 2df92ec9ca3204b7d3cd52f1b133c971de8dc00a | [
"Apache-2.0"
] | null | null | null | nemo/utils/exp_manager.py | volkoshkursk/NeMo | 2df92ec9ca3204b7d3cd52f1b133c971de8dc00a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 45.952586 | 202 | 0.68298 |
0392584c9c4a943b66f1e96bb843b13336adb27f | 466 | py | Python | free-speech-django/app/migrations/0022_quantitativequestion_average_score.py | BerkeleyAutomation/free-speech | 5e046d1f856deb13ff8fd1a68e861d687fdc8705 | [
"MIT"
] | null | null | null | free-speech-django/app/migrations/0022_quantitativequestion_average_score.py | BerkeleyAutomation/free-speech | 5e046d1f856deb13ff8fd1a68e861d687fdc8705 | [
"MIT"
] | null | null | null | free-speech-django/app/migrations/0022_quantitativequestion_average_score.py | BerkeleyAutomation/free-speech | 5e046d1f856deb13ff8fd1a68e861d687fdc8705 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-26 23:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pcari', '0021_auto_20160825_1927'),
]
operations = [
migrations.AddField(
... | 22.190476 | 49 | 0.628755 |
03927a7630fe456243a1ee7651abe90e230677e7 | 424 | py | Python | 169_Majority-Element.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | 3 | 2018-07-05T05:51:10.000Z | 2019-05-04T08:35:44.000Z | 169_Majority-Element.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | 169_Majority-Element.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | class Solution(object):
def majorityElement(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
temp = dict()
if len(nums) == 1:
return nums[0]
for num in nums:
if temp.has_key(num):
temp[num] += 1
if ... | 24.941176 | 43 | 0.403302 |
03928e8cf892b94a1dc42fe3c35256cc05a3a89b | 7,151 | py | Python | asposewordscloud/models/requests/update_custom_xml_part_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | asposewordscloud/models/requests/update_custom_xml_part_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | asposewordscloud/models/requests/update_custom_xml_part_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="update_custom_xml_part_request.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining... | 50.359155 | 255 | 0.672214 |
0392b476dafcbca586bdb1ec6159a634906c0b7e | 572 | py | Python | salt/pillar/cmd_yaml.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | 1 | 2017-11-19T06:56:46.000Z | 2017-11-19T06:56:46.000Z | salt/pillar/cmd_yaml.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | salt/pillar/cmd_yaml.py | gotcha/salt | 7b84c704777d3d2062911895dc3fdf93d40e9848 | [
"Apache-2.0"
] | null | null | null | '''
Execute a command and read the output as YAML. The YAML data is then directly
overlaid onto the minion's pillar data
'''
# Import python libs
import logging
# Import third party libs
import yaml
# Set up logging
log = logging.getLogger(__name__)
def ext_pillar(pillar, command):
'''
Execute a command an... | 21.185185 | 77 | 0.645105 |
0392d5673ca418e9d6f4aad393f6d43cddf587e3 | 2,753 | py | Python | mediagrabber/mediafile.py | ch5i/mediagrabber | 5851df88f49f721fc249fb8864b3bdb4cc8b1c1f | [
"MIT"
] | 1 | 2017-06-05T16:04:47.000Z | 2017-06-05T16:04:47.000Z | mediagrabber/mediafile.py | ch5i/MediaGrabber | 5851df88f49f721fc249fb8864b3bdb4cc8b1c1f | [
"MIT"
] | 2 | 2019-01-13T20:39:49.000Z | 2019-01-25T23:11:39.000Z | mediagrabber/mediafile.py | ch5i/mediagrabber | 5851df88f49f721fc249fb8864b3bdb4cc8b1c1f | [
"MIT"
] | null | null | null | # To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.
import datetime
import logging
import os
import filehash
class MediaFile:
def __init__(self, file_path=None, logger=None, *args, **kwargs... | 31.643678 | 92 | 0.611696 |
0392ed8bc3175205237d3cdb71d9763afbb2530d | 1,290 | py | Python | homecontrol/modules/433mhz_adapter/module.py | jaipradeesh/HomeControl | 79ffe8a403fb53e3faf91f55f66d912bb62b4f5f | [
"MIT"
] | null | null | null | homecontrol/modules/433mhz_adapter/module.py | jaipradeesh/HomeControl | 79ffe8a403fb53e3faf91f55f66d912bb62b4f5f | [
"MIT"
] | null | null | null | homecontrol/modules/433mhz_adapter/module.py | jaipradeesh/HomeControl | 79ffe8a403fb53e3faf91f55f66d912bb62b4f5f | [
"MIT"
] | null | null | null | """Support for 3-pin 433MHz receivers and transmitters using pigpio"""
# pylint: disable=import-error
from .dependencies import rf
from homecontrol.dependencies.entity_types import Item
class RFRXAdapter(Item):
"""The RX adapter"""
cfg: dict
# pylint: disable=invalid-name
async def init(self):
... | 26.326531 | 70 | 0.604651 |
0392f3497c2c232f98f4c9b474be2128e4164d74 | 5,325 | py | Python | django_codemod/visitors/admin.py | cvanderkolk/django-codemod | 9d03ebbf98285e408bacf7553c886fbf4960b720 | [
"MIT"
] | null | null | null | django_codemod/visitors/admin.py | cvanderkolk/django-codemod | 9d03ebbf98285e408bacf7553c886fbf4960b720 | [
"MIT"
] | 2 | 2022-01-19T14:30:11.000Z | 2022-01-28T14:32:34.000Z | django_codemod/visitors/admin.py | jayvdb/django-codemod | 8626e6bb5383d9ef3b733861d6996213d90cf26d | [
"MIT"
] | null | null | null | from typing import Union
from libcst import (
Arg,
BaseExpression,
BaseSmallStatement,
BaseStatement,
Call,
ClassDef,
FunctionDef,
ImportFrom,
Module,
Name,
Param,
RemovalSentinel,
)
from libcst import matchers as m
from libcst.codemod import ContextAwareTransformer
fro... | 37.5 | 87 | 0.57615 |
0392f460443d45e63f0c0065d45ce1c730bb4164 | 3,258 | py | Python | src/zope/server/http/tests/test_chunking.py | cjwatson/zope.server | 9c40c8a1ae57d28f1e0fa21e740826befefc30d5 | [
"ZPL-2.1"
] | null | null | null | src/zope/server/http/tests/test_chunking.py | cjwatson/zope.server | 9c40c8a1ae57d28f1e0fa21e740826befefc30d5 | [
"ZPL-2.1"
] | null | null | null | src/zope/server/http/tests/test_chunking.py | cjwatson/zope.server | 9c40c8a1ae57d28f1e0fa21e740826befefc30d5 | [
"ZPL-2.1"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tests for chunking.py
"""
import unittest
from zope.server.http import chunking
from zope.server.buffers import StringIOBasedBuffer
class TestChunkedReceiver(unittest.TestCase):
def _makeOne(self):
return chunking.ChunkedReceiver(StringIOBasedBuffer())
def _do_test(self,... | 33.9375 | 73 | 0.621854 |
0392f4b5c7896c8b7090c3ffeae887c0496aa8ae | 108 | py | Python | homeassistant/components/http/frontend.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | 1 | 2017-03-01T10:57:20.000Z | 2017-03-01T10:57:20.000Z | homeassistant/components/http/frontend.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | null | null | null | homeassistant/components/http/frontend.py | loghound/home-assistant | 48089b01ab38848b07517a4d3e847cc0f79cf435 | [
"MIT"
] | 1 | 2020-11-13T10:06:21.000Z | 2020-11-13T10:06:21.000Z | """ DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "12ba7bca8ad0c196cb04ada4fe85a76b"
| 36 | 62 | 0.787037 |
03931607881bc3b5c4f08e23cf34589237ee9fe6 | 467 | py | Python | cmd.py | LanJosh/QuestionAnswer | 38066e3268ba1a95640ae87f4066bf7223c1ad4f | [
"MIT"
] | null | null | null | cmd.py | LanJosh/QuestionAnswer | 38066e3268ba1a95640ae87f4066bf7223c1ad4f | [
"MIT"
] | null | null | null | cmd.py | LanJosh/QuestionAnswer | 38066e3268ba1a95640ae87f4066bf7223c1ad4f | [
"MIT"
] | null | null | null | """
Script for running the QA system end to end
"""
from prepro import prepro
from evaluate import evaluate
import model
import baseline
data = prepro()
predictions = model.run()
results = evaluate(predictions, data['answers'])
print("Sentence score {} F1 score {}".format(results['sscore'], results['f1']))
baseline_... | 24.578947 | 79 | 0.740899 |
03931adf4192a67a2e5bf6d1a7a219b56c9a984e | 5,893 | py | Python | src/prediction_knn.py | pedrohenriquebr/web-face-recognition | 5a1fac7ce6e4186bca33f7e0ead2de42670786e0 | [
"MIT"
] | 1 | 2020-09-14T03:46:12.000Z | 2020-09-14T03:46:12.000Z | src/prediction_knn.py | pedrohenriquebr/web-face-recognition | 5a1fac7ce6e4186bca33f7e0ead2de42670786e0 | [
"MIT"
] | 13 | 2019-01-21T22:11:33.000Z | 2019-08-18T18:47:26.000Z | src/prediction_knn.py | pedrohenriquebr/web-face-recognition | 5a1fac7ce6e4186bca33f7e0ead2de42670786e0 | [
"MIT"
] | null | null | null |
import math
from sklearn import neighbors
import os
from os import environ
import os.path
import pickle
import face_recognition
from face_recognition.face_recognition_cli import image_files_in_folder
import sys
ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg'}
THRESHOLD = os.getenv('THRESHOLD', 'TRUE')
def predict_frame(... | 42.092857 | 119 | 0.686408 |
03931b216b9cfa38667bb2f6ae4ad1e655b7a9ff | 539 | py | Python | reliabilly/tests/data_clients/test_data_client.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2018-11-24T02:07:37.000Z | 2018-11-24T02:07:37.000Z | reliabilly/tests/data_clients/test_data_client.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2019-01-23T07:12:30.000Z | 2019-01-23T07:12:30.000Z | reliabilly/tests/data_clients/test_data_client.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2019-01-16T05:30:49.000Z | 2019-01-16T05:30:49.000Z | from unittest import TestCase
from reliabilly.components.data import get_query
from reliabilly.settings import Constants
class TestDataClient(TestCase):
def test_arg_processing(self):
offset, limit, query = get_query(offset=1, limit=4, test='jjb')
self.assertEqual(offset, 1)
self.assertEqu... | 35.933333 | 71 | 0.705009 |
039321bdb22a62dbb30805c4941f551b7ab18dcc | 7,545 | py | Python | sunpy/lightcurve/sources/fermi_gbm.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | sunpy/lightcurve/sources/fermi_gbm.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | sunpy/lightcurve/sources/fermi_gbm.py | derdon/sunpy | 619102cd48c73a326c45263369446be9b74366e8 | [
"MIT"
] | null | null | null | """Provides programs to process and analyse Fermi/GBM lightcurve data."""
from __future__ import absolute_import, print_function
import urlparse
from collections import OrderedDict
import numpy as np
import matplotlib.pyplot as plt
import pandas
from sunpy.io.fits import fits
from sunpy.instr import fermi
from sun... | 38.299492 | 99 | 0.62452 |
0393353511b90e3d01f7a9cc9cb555aa4e9e6268 | 8,753 | py | Python | bpython/importcompletion.py | ocurero/bpython | 32363dc8bea1fd12997f314cb424bf72cbe1e599 | [
"PSF-2.0"
] | null | null | null | bpython/importcompletion.py | ocurero/bpython | 32363dc8bea1fd12997f314cb424bf72cbe1e599 | [
"PSF-2.0"
] | null | null | null | bpython/importcompletion.py | ocurero/bpython | 32363dc8bea1fd12997f314cb424bf72cbe1e599 | [
"PSF-2.0"
] | null | null | null | # The MIT License
#
# Copyright (c) 2009-2011 Andreas Stuehrk
# Copyright (c) 2020-2021 Sebastian Ramacher
#
# 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 wit... | 37.728448 | 92 | 0.582886 |
039342cd2add5154221ced36071824fb880a757a | 3,093 | py | Python | xblock/reference/user_service.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | xblock/reference/user_service.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | xblock/reference/user_service.py | cclauss/XBlock | 3e5341015e8f8b4a203ac4a41471bac5549182b0 | [
"Apache-2.0"
] | null | null | null | """
This file supports the XBlock service that returns data about users.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from xblock.reference.plugins import Service
class UserService(Service):
"""
UserService returns information about users. Initially only data about... | 49.887097 | 120 | 0.722599 |
039358303700463b78d6bab146fb2bd16293b2eb | 3,423 | py | Python | Burgers/burgers.py | Bsuniverse/NWPU-CFD | b893575451e5309cd1a81cf43fda88a5935b1ebc | [
"MIT"
] | 1 | 2021-11-07T07:49:00.000Z | 2021-11-07T07:49:00.000Z | Burgers/burgers.py | lpf2215/NWPU-CFD | b893575451e5309cd1a81cf43fda88a5935b1ebc | [
"MIT"
] | null | null | null | Burgers/burgers.py | lpf2215/NWPU-CFD | b893575451e5309cd1a81cf43fda88a5935b1ebc | [
"MIT"
] | 1 | 2021-11-07T07:48:48.000Z | 2021-11-07T07:48:48.000Z | #!/usr/bin/python
#-*- coding: <encoding name> -*-
import numpy as np
import pandas as pd
import os
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
class Burgers:
'''
A Burgers 1-demension partial differential equation numerical solver with:
- 3 inputs: viscosity ,time and iter... | 31.118182 | 110 | 0.56208 |
03937948fe8bcbe222a5e5b19cf3830b6349f447 | 13,172 | py | Python | test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/legacy/Expected/AcceptanceTests/BodyString/bodystring/aio/operations/_enum_operations.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.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 may ... | 44.955631 | 106 | 0.688354 |
0393ba14f157e3445820c452e70b0440b3d71486 | 9,181 | py | Python | More/E00_Publications/Magazines/TypeMagazine3/A_Firsts_01.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-06-20T22:01:23.000Z | 2021-08-06T04:39:50.000Z | More/E00_Publications/Magazines/TypeMagazine3/A_Firsts_01.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 5 | 2020-05-17T09:32:27.000Z | 2021-03-15T19:45:52.000Z | More/E00_Publications/Magazines/TypeMagazine3/A_Firsts_01.py | freder/PageBotExamples | eb4ced53a673b9376e8357afa9ea0795b022b13c | [
"Ruby",
"MIT"
] | 2 | 2021-02-25T19:07:45.000Z | 2022-01-09T21:14:06.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T E X A M P L E S
#
# Copyright (c) 2017 Thom Janssen <https://github.com/thomgb>
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, ww... | 37.473469 | 122 | 0.673783 |
0393e6acfbb61f76aa240f02d1608aa76d2664b4 | 385 | py | Python | selenium/helloSelenium.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | selenium/helloSelenium.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | selenium/helloSelenium.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/evn python
# -*- coding: utf-8 -*-
# python version 2.7.10
from selenium import webdriver
import time
driver = webdriver.Firefox()
driver.get("http://www.baidu.com")
driver.find_element_by_id("kw").send_keys("Selenium2")
driver.find_element_by_id("su").click()
#设置浏览器的宽,高显示
#driver.set_window_size(480,800... | 18.333333 | 54 | 0.74026 |
03940e315d3e470e3eb2511baae0135b4fd421ba | 593 | py | Python | binarysearch.io/first_missing_positive_interger.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | binarysearch.io/first_missing_positive_interger.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | binarysearch.io/first_missing_positive_interger.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | class Solution:
def solve(self, nums):
# Write your code here
nums = sorted(nums)
n = set()
if len(nums) == 0:
return 1
for i in nums:
n.add(i)
if 1 not in n:
return 1
for i in nums:
if i !=... | 24.708333 | 39 | 0.354132 |
03941d01381474dda2908b53d620ae68ddf6e727 | 298 | py | Python | src/genie/telemetry/tests/scripts/mockplugin.py | CiscoTestAutomation/genietelemetry | 286cd1d281c7375c3d161955fa3ce52e1da52372 | [
"Apache-2.0"
] | 3 | 2020-05-24T11:47:53.000Z | 2020-09-06T21:22:21.000Z | src/genie/telemetry/tests/scripts/mockplugin.py | CiscoTestAutomation/genietelemetry | 286cd1d281c7375c3d161955fa3ce52e1da52372 | [
"Apache-2.0"
] | null | null | null | src/genie/telemetry/tests/scripts/mockplugin.py | CiscoTestAutomation/genietelemetry | 286cd1d281c7375c3d161955fa3ce52e1da52372 | [
"Apache-2.0"
] | null | null | null |
from unittest.mock import Mock
from genie.telemetry import BasePlugin
from genie.telemetry.status import PARTIAL
class Plugin(BasePlugin):
parser = None
def parse_args(self, *args, **kwargs):
return
def execution(self, device):
return PARTIAL('mocked plugin result') | 22.923077 | 46 | 0.718121 |
03942c4758bde48553ca27c908fe0f4bf0b201ec | 7,829 | py | Python | qiskit/circuit/library/standard_gates/rz.py | obliviateandsurrender/qiskit-terra | 046a63632f22f9b010d793bf91a0b65d06ba8921 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/standard_gates/rz.py | obliviateandsurrender/qiskit-terra | 046a63632f22f9b010d793bf91a0b65d06ba8921 | [
"Apache-2.0"
] | null | null | null | qiskit/circuit/library/standard_gates/rz.py | obliviateandsurrender/qiskit-terra | 046a63632f22f9b010d793bf91a0b65d06ba8921 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 32.894958 | 99 | 0.542853 |
03946c1e2357f2b4766095d62b200d9711eed5de | 14,318 | py | Python | aries-test-harness/features/steps/0454-present-proof-v2.py | pruneau628/aries-agent-test-harness | ca49b544afdcdd5f23e33c4677139111683db5f4 | [
"Apache-2.0"
] | 30 | 2020-08-19T20:42:54.000Z | 2022-03-29T11:47:37.000Z | aries-test-harness/features/steps/0454-present-proof-v2.py | pruneau628/aries-agent-test-harness | ca49b544afdcdd5f23e33c4677139111683db5f4 | [
"Apache-2.0"
] | 191 | 2020-08-25T16:22:34.000Z | 2022-03-31T13:34:16.000Z | aries-test-harness/features/steps/0454-present-proof-v2.py | pruneau628/aries-agent-test-harness | ca49b544afdcdd5f23e33c4677139111683db5f4 | [
"Apache-2.0"
] | 31 | 2020-08-19T20:53:38.000Z | 2022-03-24T08:57:44.000Z | from behave import *
import json
from agent_backchannel_client import agent_backchannel_POST, expected_agent_state
from agent_test_utils import get_relative_timestamp_to_epoch, amend_presentation_definition_with_runtime_data
@given('"{prover}" has an issued credential with formats from {issuer} with {credential_data}... | 59.410788 | 211 | 0.680402 |
039485c21f4068c003aefb32834bd20a6a16edbf | 1,575 | py | Python | vectorforge/lib/boto_s3.py | geoadmin/vector-forge | ce071a7f846d1a50932ea3cd3a920759c3691a5d | [
"BSD-3-Clause"
] | 8 | 2015-03-31T15:14:56.000Z | 2017-06-19T17:42:35.000Z | vectorforge/lib/boto_s3.py | geoadmin/vector-forge | ce071a7f846d1a50932ea3cd3a920759c3691a5d | [
"BSD-3-Clause"
] | 21 | 2015-03-31T15:14:32.000Z | 2017-08-16T12:13:51.000Z | vectorforge/lib/boto_s3.py | geoadmin/vector-forge | ce071a7f846d1a50932ea3cd3a920759c3691a5d | [
"BSD-3-Clause"
] | 1 | 2016-04-14T09:46:06.000Z | 2016-04-14T09:46:06.000Z | # -*- coding: utf-8 -*-
import boto
import geojson
from io import BytesIO
from boto.s3.key import Key
def s3Connect(profileName):
try:
conn = boto.connect_s3(profile_name=profileName)
except Exception as e:
raise e
return conn
def getBucket(conn):
try:
# TODO move S3 bucket ... | 30.288462 | 79 | 0.67746 |
03948c955d2dfa01447fc81f6a935e3beb43c6c0 | 1,533 | py | Python | system_a/scripts/segment_level_evaluation.py | hkayesh/depend_clean | 1d4bfdaf9a4d323582ab36e3ec0f9b4f2faae851 | [
"Apache-2.0"
] | null | null | null | system_a/scripts/segment_level_evaluation.py | hkayesh/depend_clean | 1d4bfdaf9a4d323582ab36e3ec0f9b4f2faae851 | [
"Apache-2.0"
] | null | null | null | system_a/scripts/segment_level_evaluation.py | hkayesh/depend_clean | 1d4bfdaf9a4d323582ab36e3ec0f9b4f2faae851 | [
"Apache-2.0"
] | null | null | null | from utilities import Utilities
from wrapper_classifiers import AspectClassifier
from sklearn.metrics import classification_report as clsr
from sklearn.metrics import f1_score, accuracy_score
class SegmentLevelEvaluation:
def __init__(self):
self.utilities = Utilities()
self.aspect_classifier = As... | 32.617021 | 93 | 0.627528 |
0394981a436251e1c5dc8ab97f1439b1b65e2a7f | 2,709 | py | Python | jwt_apns_client/utils.py | Mobelux/jwt_apns_client | 1e6cc2e65a2e7134da61d391976b00fcb86d7015 | [
"MIT"
] | 2 | 2017-05-17T18:20:09.000Z | 2017-09-18T12:04:56.000Z | jwt_apns_client/utils.py | Mobelux/jwt_apns_client | 1e6cc2e65a2e7134da61d391976b00fcb86d7015 | [
"MIT"
] | 1 | 2021-11-15T17:47:04.000Z | 2021-11-15T17:47:04.000Z | jwt_apns_client/utils.py | Mobelux/jwt_apns_client | 1e6cc2e65a2e7134da61d391976b00fcb86d7015 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jwt_apns_client/utils
General utility classes and functions
"""
from __future__ import absolute_import, unicode_literals, print_function, division
import jwt
import time
class APNSReasons(object):
"""
Constants for the various reason strings returned by APNs on error.
This i... | 28.21875 | 111 | 0.696198 |
0394d37039c851cadd7d2c100e8b450bb5d0f09a | 4,451 | py | Python | dietr/models/roommate.py | essoplerck/dietr | 982636c1fea848cf6b90c036dc6ca8a4f37f68a2 | [
"MIT"
] | 1 | 2020-09-25T03:53:46.000Z | 2020-09-25T03:53:46.000Z | dietr/models/roommate.py | essoplerck/dietr | 982636c1fea848cf6b90c036dc6ca8a4f37f68a2 | [
"MIT"
] | null | null | null | dietr/models/roommate.py | essoplerck/dietr | 982636c1fea848cf6b90c036dc6ca8a4f37f68a2 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from flask import session
from dietr.database import database
from dietr.models.allergy import Allergy
from dietr.models.ingredient import Ingredient
@dataclass
class Roommate:
id: int
handle: int
user_id: int
first_name: str
middle_name: str
last_nam... | 34.238462 | 79 | 0.572231 |
0394db20815e3d942280973e2f69968acaaa23c2 | 1,779 | py | Python | scripts/download_random_tweets.py | juliandehne/whowhatwhy | fa4c89158e65d90b1cea62838f3d12f7c14e59fb | [
"MIT"
] | null | null | null | scripts/download_random_tweets.py | juliandehne/whowhatwhy | fa4c89158e65d90b1cea62838f3d12f7c14e59fb | [
"MIT"
] | 6 | 2021-08-18T11:09:25.000Z | 2021-10-04T08:23:43.000Z | scripts/download_random_tweets.py | juliandehne/whowhatwhy | fa4c89158e65d90b1cea62838f3d12f7c14e59fb | [
"MIT"
] | null | null | null | import json
from django.db import IntegrityError
from delab.tw_connection_util import TwitterConnector
from twitter.models import Tweet, TwTopic
import requests
def run():
# create topic
topic_example = TwTopic()
topic_example.title = "random"
topic, created = TwTopic.objects.get_or_create(topic_ex... | 31.767857 | 87 | 0.558179 |
0394f1c535fe2a8dfdace4633d750f884f7f3745 | 6,644 | py | Python | custom_components/hasl3/config_schema.py | jadlers/integration | f8a489ce6febdada9330cf8b319d71d34e8efb89 | [
"Apache-2.0"
] | 22 | 2020-05-16T20:51:54.000Z | 2022-03-26T21:59:11.000Z | custom_components/hasl3/config_schema.py | jadlers/integration | f8a489ce6febdada9330cf8b319d71d34e8efb89 | [
"Apache-2.0"
] | 32 | 2020-05-20T11:44:31.000Z | 2022-03-25T10:43:14.000Z | custom_components/hasl3/config_schema.py | jadlers/integration | f8a489ce6febdada9330cf8b319d71d34e8efb89 | [
"Apache-2.0"
] | 10 | 2021-01-05T12:02:56.000Z | 2022-01-17T11:09:33.000Z | """HASL Configuration Database."""
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from .const import (
CONF_NAME,
CONF_RI4_KEY,
CONF_SI2_KEY,
CONF_TL2_KEY,
CONF_RP3_KEY,
CONF_SITE_ID,
CONF_DEBUG,
CONF_FP_PT,
CONF_FP_RB,
CONF_FP_TVB,
CONF_FP_SB,... | 46.788732 | 266 | 0.717489 |
0395044eb377225f7b1f84171e93cb93a0a742e5 | 2,948 | py | Python | tri/undreamt/undreamt/encoder.py | hoangle96/CS539_project | 20f704398a8bdb3ab709cef45ed861898fd4d1dd | [
"MIT"
] | null | null | null | tri/undreamt/undreamt/encoder.py | hoangle96/CS539_project | 20f704398a8bdb3ab709cef45ed861898fd4d1dd | [
"MIT"
] | null | null | null | tri/undreamt/undreamt/encoder.py | hoangle96/CS539_project | 20f704398a8bdb3ab709cef45ed861898fd4d1dd | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Mikel Artetxe <artetxem@gmail.com>
#
# 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 version 3 of the License, or
# (at your option) any later version.
#
# This prog... | 49.966102 | 116 | 0.688602 |
03952f7f62bb5c946ee632995a9c589faab2d665 | 4,127 | py | Python | spectroscope/validator_client.py | peterblockman/spectroscope | 2a33742838a95c1e56ce0e13cc7719c56e9d6cc8 | [
"Apache-2.0"
] | null | null | null | spectroscope/validator_client.py | peterblockman/spectroscope | 2a33742838a95c1e56ce0e13cc7719c56e9d6cc8 | [
"Apache-2.0"
] | null | null | null | spectroscope/validator_client.py | peterblockman/spectroscope | 2a33742838a95c1e56ce0e13cc7719c56e9d6cc8 | [
"Apache-2.0"
] | null | null | null | import spectroscope
from ethereumapis.v1alpha1 import validator_pb2, validator_pb2_grpc
from spectroscope.model import ChainTimestamp, ValidatorIdentity
from spectroscope.model.update import (
ValidatorActivationUpdate,
ActivationBatch,
)
from spectroscope.exceptions import Invalid,ValidatorInvalid,ValidatorAct... | 40.067961 | 110 | 0.650351 |
0395388d2fab496600b5cef891fa103c7335400a | 2,731 | py | Python | lib/reportlab/graphics/samples/filled_radar.py | jwheare/digest | 963a0f46862319aa499d4cbbfdbd6380287fc5a5 | [
"BSD-3-Clause"
] | 5 | 2016-05-08T23:51:38.000Z | 2021-05-02T10:09:29.000Z | lib/reportlab/graphics/samples/filled_radar.py | jwheare/digest | 963a0f46862319aa499d4cbbfdbd6380287fc5a5 | [
"BSD-3-Clause"
] | null | null | null | lib/reportlab/graphics/samples/filled_radar.py | jwheare/digest | 963a0f46862319aa499d4cbbfdbd6380287fc5a5 | [
"BSD-3-Clause"
] | 1 | 2018-01-16T16:03:44.000Z | 2018-01-16T16:03:44.000Z | #Autogenerated by ReportLab guiedit do not edit
from reportlab.graphics.charts.legends import Legend
from reportlab.graphics.charts.spider import SpiderChart
from reportlab.graphics.shapes import Drawing, _DrawingEditorMixin, String
from reportlab.graphics.charts.textlabels import Label
from excelcolors import *
... | 49.654545 | 100 | 0.603808 |
03954e776ee948cacbfce7ab0f5fdc406f61b869 | 741 | py | Python | reliabilly/components/tools/newrelic_http_client.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2018-11-24T02:07:37.000Z | 2018-11-24T02:07:37.000Z | reliabilly/components/tools/newrelic_http_client.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2019-01-23T07:12:30.000Z | 2019-01-23T07:12:30.000Z | reliabilly/components/tools/newrelic_http_client.py | corpseware/reliabilly | e8d310d43478407e2cf8b45cc746362124140385 | [
"MIT"
] | 1 | 2019-01-16T05:30:49.000Z | 2019-01-16T05:30:49.000Z | import json
from reliabilly.settings import Settings
from reliabilly.components.web.http_requestor import HttpRequestor
class NewRelicHttpClient:
def __init__(self, api_key, url=Settings.DATA_MONITORING_URL):
self.api_key = api_key
self.url = url
def generate_headers(self):
return {'C... | 33.681818 | 96 | 0.689609 |
03955208e931d757099ec0f9adeddb44e1a6b976 | 738 | py | Python | tests/test_model_group.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 3 | 2020-05-10T23:52:41.000Z | 2021-08-31T14:38:24.000Z | tests/test_model_group.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 1 | 2020-09-27T03:26:51.000Z | 2022-03-30T12:18:08.000Z | tests/test_model_group.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 1 | 2020-10-01T04:07:39.000Z | 2020-10-01T04:07:39.000Z | from pydemic import models, ModelGroup
from pydemic.clinical_models import CrudeFR
class TestModelGroup:
def test_model_group_from_split(self):
m = models.SIR(R0=2, gamma=1)
m.run(10)
grp: ModelGroup = m.split(R0=[1.25, 1.5, 2.0, 2.5], name="R0 = {R0}")
# Basic properties
... | 30.75 | 80 | 0.569106 |
03955f4cad502cdb51feff91c02667b452d97168 | 646 | py | Python | tests/test_mantle/arith/mothball/adc2.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 14 | 2017-10-08T09:16:10.000Z | 2021-11-27T19:12:24.000Z | tests/test_mantle/arith/mothball/adc2.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 7 | 2018-04-12T21:33:49.000Z | 2018-08-21T22:14:20.000Z | tests/test_mantle/arith/mothball/adc2.py | splhack/loam | 10b08bd622b7cfd63eabaec4729f6238e4521b30 | [
"MIT"
] | 3 | 2018-07-24T04:55:02.000Z | 2019-12-30T08:12:39.000Z | from magma import array, wire, compile, EndCircuit
from loam.boards.icestick import IceStick, Add
icestick = IceStick()
icestick.Clock.on()
icestick.J1[0].rename('A0').input().on()
icestick.J1[1].rename('A1').input().on()
icestick.J1[2].rename('B0').input().on()
icestick.J1[3].rename('B1').input().on()
icestick.J1[4].... | 22.275862 | 50 | 0.668731 |
03956b0a155893415f2f5d88b5f6a1b039a4c75b | 606 | py | Python | tEvash/tevash_06.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | 3 | 2020-11-16T15:20:11.000Z | 2020-12-11T17:01:42.000Z | tEvash/tevash_06.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | null | null | null | tEvash/tevash_06.py | techartorg/Advent_of_Code_2020 | ae21164bc126352e7a2e9c9c6a0017ccb9d946cc | [
"MIT"
] | 1 | 2020-12-13T04:42:44.000Z | 2020-12-13T04:42:44.000Z |
with open("inputs_6.txt") as f:
inputs = f.read().split("\n\n")
def part1(inputs):
count = 0
for ans in inputs:
count += len(set(ans.replace("\n", "")))
print(count)
def part2(inputs):
count = 0
for ans in inputs:
# get unique characters
uniques = set(ans.replace("\n", ""))
# then loop and count if e... | 20.2 | 51 | 0.622112 |
039571cde29adec4bf34511c190647c2d2a9eaa6 | 96,167 | py | Python | localstack/services/cloudformation/service_models.py | qubyte/localstack | b7520260fa9281d7c11aad64a7ae1aff53953b97 | [
"Apache-2.0"
] | null | null | null | localstack/services/cloudformation/service_models.py | qubyte/localstack | b7520260fa9281d7c11aad64a7ae1aff53953b97 | [
"Apache-2.0"
] | null | null | null | localstack/services/cloudformation/service_models.py | qubyte/localstack | b7520260fa9281d7c11aad64a7ae1aff53953b97 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import re
from moto.cloudformation.exceptions import UnformattedGetAttTemplateException
from moto.core.models import CloudFormationModel
from moto.ec2.utils import generate_route_id
from moto.iam.models import Role as MotoRole
from moto.s3.models import FakeBucket
from moto.sqs.mod... | 37.07286 | 128 | 0.599509 |
0395814d67b6bd691aa15e3ec37e9d757ec6107a | 12,031 | py | Python | mokas_cluster_methods.py | gdurin/mokas | 57893d0191c988b241dcf5701d4213a3cbcf587a | [
"CC-BY-3.0"
] | null | null | null | mokas_cluster_methods.py | gdurin/mokas | 57893d0191c988b241dcf5701d4213a3cbcf587a | [
"CC-BY-3.0"
] | null | null | null | mokas_cluster_methods.py | gdurin/mokas | 57893d0191c988b241dcf5701d4213a3cbcf587a | [
"CC-BY-3.0"
] | null | null | null | import os
import numpy as np
import mahotas
import skimage.morphology as morph
import skimage.feature as feature
from skimage import measure
import matplotlib.pyplot as plt
import heapq
k0 = np.array([0,0,1,1,1,0,0])
k1 = np.array([0,1,0,0,0,1,0])
kc = np.array([1,0,0,0,0,0,1])
kernel = np.vstack((k0,k1,kc,kc,kc,k1... | 39.188925 | 105 | 0.604605 |
0395a4d2aef076fd9ea5c137973afb9dcdab0652 | 23,539 | py | Python | ann/roi_heads.py | yt7589/codis | 0b480b1d93235593503d34fe7c76b6188479f328 | [
"Apache-2.0"
] | null | null | null | ann/roi_heads.py | yt7589/codis | 0b480b1d93235593503d34fe7c76b6188479f328 | [
"Apache-2.0"
] | null | null | null | ann/roi_heads.py | yt7589/codis | 0b480b1d93235593503d34fe7c76b6188479f328 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn.functional as F
from torch import nn
from torchvision.ops import boxes as box_ops
from torchvision.ops import misc as misc_nn_ops
from torchvision.ops import roi_align
import ann.pt_utils as det_utils
def fastrcnn_loss(class_logits, box_regression, labels, regression_target... | 37.6624 | 119 | 0.611029 |
0395a8e7b5a3e440e0b8192a4a77a9fa10bee843 | 13,000 | py | Python | neuropype/ressources/progressbar.py | ablot/Pinceau | ae8f3dd088349f8976a5ddf91d83c60ca1ef39e2 | [
"MIT"
] | null | null | null | neuropype/ressources/progressbar.py | ablot/Pinceau | ae8f3dd088349f8976a5ddf91d83c60ca1ef39e2 | [
"MIT"
] | null | null | null | neuropype/ressources/progressbar.py | ablot/Pinceau | ae8f3dd088349f8976a5ddf91d83c60ca1ef39e2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: iso-8859-1 -*-
#
# progressbar - Text progressbar library for python.
# Copyright (c) 2005 Nilton Volpato
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundatio... | 34.391534 | 91 | 0.612308 |
0395b542beed9fed343203e887f260688de51cc6 | 8,904 | py | Python | proj08_RSSfeed/RSS_Feed.py | hawiab/VSA18 | 852902f96f97d62e4cfbc8e997c96b305754bf5b | [
"MIT"
] | null | null | null | proj08_RSSfeed/RSS_Feed.py | hawiab/VSA18 | 852902f96f97d62e4cfbc8e997c96b305754bf5b | [
"MIT"
] | null | null | null | proj08_RSSfeed/RSS_Feed.py | hawiab/VSA18 | 852902f96f97d62e4cfbc8e997c96b305754bf5b | [
"MIT"
] | null | null | null | # Name:
# Date
import feedparser
import string
import time
from project_util import translate_html
from news_gui import Popup
#-----------------------------------------------------------------------
#
# proj08: RSS Feed Filter
#======================
# Code for retrieving and parsing
# Google and Yahoo News feeds
# ... | 28.088328 | 120 | 0.619272 |
0395b5cff03ee9abfce37456c4df9d5efbd1b2b8 | 42 | py | Python | axonius_api_client/tests/tests_pkg/__init__.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 11 | 2020-01-31T00:28:26.000Z | 2022-03-25T20:27:08.000Z | axonius_api_client/tests/tests_pkg/__init__.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 83 | 2020-01-22T12:52:38.000Z | 2022-02-07T16:20:18.000Z | axonius_api_client/tests/tests_pkg/__init__.py | kf-careem/axonius_api_client | 27767c896ca446e74ca5d69e087e1a0dcf7157ec | [
"MIT"
] | 16 | 2019-08-23T17:44:31.000Z | 2022-01-06T00:57:34.000Z | # -*- coding: utf-8 -*-
"""Test suite."""
| 14 | 23 | 0.452381 |
0395f135ae1c69cc5c2f99ea6d1aae54ee864650 | 5,098 | py | Python | refinery/bnpy/bnpy-dev/tests/merge/AbstractBaseTestForHDP.py | csa0001/Refinery | 0d5de8fc3d680a2c79bd0e9384b506229787c74f | [
"MIT"
] | 103 | 2015-01-13T00:48:14.000Z | 2021-11-08T10:53:22.000Z | refinery/bnpy/bnpy-dev/tests/merge/AbstractBaseTestForHDP.py | csa0001/Refinery | 0d5de8fc3d680a2c79bd0e9384b506229787c74f | [
"MIT"
] | 7 | 2015-02-21T04:03:40.000Z | 2021-08-23T20:24:54.000Z | refinery/bnpy/bnpy-dev/tests/merge/AbstractBaseTestForHDP.py | csa0001/Refinery | 0d5de8fc3d680a2c79bd0e9384b506229787c74f | [
"MIT"
] | 27 | 2015-01-23T00:54:31.000Z | 2020-12-30T14:30:50.000Z |
import numpy as np
import unittest
import bnpy
from bnpy.learnalg import MergeMove
from scipy.special import digamma
import copy
######################################################### Make Data
#########################################################
def MakeData(K=4, D=2500, nWordsPerDoc=50):
''' Simple 4 com... | 36.414286 | 79 | 0.591408 |
0395f653aea81aa1039beb90fb968398fac177e1 | 836 | py | Python | var/spack/repos/builtin/packages/py-rsa/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/py-rsa/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/py-rsa/package.py | joequant/spack | e028ee0d5903045e1cdeb57550cbff61f2ffb2fa | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyRsa(PythonPackage):
"""Pure-Python RSA implementation"""
homepage = "https://stuvel... | 38 | 95 | 0.723684 |
0396192e178497beabf69484255f41126551282f | 2,651 | py | Python | test/test_client_common.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | test/test_client_common.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T12:01:38.000Z | 2022-03-21T02:39:59.000Z | test/test_client_common.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import unittest
from pymodbus.client.common import ModbusClientMixin
from pymodbus.bit_read_message import *
from pymodbus.bit_write_message import *
from pymodbus.file_message import *
from pymodbus.register_read_message import *
from pymodbus.register_write_message import *
#------------------... | 47.339286 | 116 | 0.56092 |
03965eb5368dc6bcaeb8375f33811c6ba4325939 | 661 | py | Python | boiler/feature/orm.py | projectshift/shift-boiler | 5f1d236b97fc814ba72897fa8bc76c7518bd1919 | [
"MIT"
] | 19 | 2016-08-06T20:06:21.000Z | 2020-10-22T08:31:49.000Z | boiler/feature/orm.py | projectshift/shift-boiler | 5f1d236b97fc814ba72897fa8bc76c7518bd1919 | [
"MIT"
] | 104 | 2016-07-31T19:45:00.000Z | 2021-09-15T08:13:36.000Z | boiler/feature/orm.py | projectshift/shift-boiler | 5f1d236b97fc814ba72897fa8bc76c7518bd1919 | [
"MIT"
] | 1 | 2017-12-30T09:07:38.000Z | 2017-12-30T09:07:38.000Z | from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy(session_options=dict(autoflush=False, autocommit=False))
def orm_feature(app):
"""
Enables SQLAlchemy integration feature for database connectivity
Please note, that at the moment there can only be one central database that
is used by boiler mod... | 31.47619 | 79 | 0.747352 |
03966175c1470c907926407f8a80e2875c9a46e0 | 284 | py | Python | drawpage/test.py | Nitroklaus31/Clustering-in-Object-Centric-Process-Mining | 7ca6bd4bf9845b3e68ebcc94a441cfb2f318b2e0 | [
"MIT"
] | 4 | 2021-12-02T15:48:09.000Z | 2022-01-17T17:21:13.000Z | drawpage/test.py | Nitroklaus31/Clustering-in-Object-Centric-Process-Mining | 7ca6bd4bf9845b3e68ebcc94a441cfb2f318b2e0 | [
"MIT"
] | null | null | null | drawpage/test.py | Nitroklaus31/Clustering-in-Object-Centric-Process-Mining | 7ca6bd4bf9845b3e68ebcc94a441cfb2f318b2e0 | [
"MIT"
] | 10 | 2021-12-07T17:41:04.000Z | 2022-01-21T15:55:36.000Z | from jsonschema.validators import validate
from readocel import validate_ocel, get_ocel_summary
test = validate_ocel("./media/validation/test.jsonocel")
print(test)
print(validate_ocel("./media/running-example.jsonocel"))
print(get_ocel_summary("./media/running-example.jsonocel")) | 31.555556 | 59 | 0.81338 |
03967520a5f98ab24c6c53a6db4eafb24ce1ae81 | 4,763 | py | Python | main/components/callstack_panel.py | xieguo/sublime_db | f2a7b0e55e9f0b77b90a9aa2ea4c4f9136db1315 | [
"MIT"
] | 1 | 2019-01-21T17:37:32.000Z | 2019-01-21T17:37:32.000Z | main/components/callstack_panel.py | xieguo/sublime_db | f2a7b0e55e9f0b77b90a9aa2ea4c4f9136db1315 | [
"MIT"
] | null | null | null | main/components/callstack_panel.py | xieguo/sublime_db | f2a7b0e55e9f0b77b90a9aa2ea4c4f9136db1315 | [
"MIT"
] | null | null | null |
import os
from sublime_db.core.typecheck import (List, Callable, Optional)
from sublime_db import ui
from sublime_db import core
from sublime_db.main.debugger import (
Thread,
StackFrame,
DebugAdapterClient,
DebuggerState
)
class CallStackPanel (ui.Component):
def __init__(self) -> None:
super().__init__()
... | 29.042683 | 102 | 0.686752 |
0396848a686af1f5c91855ae44ec9c9f7d877a1a | 11,697 | py | Python | kndetect/features.py | b-biswas/kndetect | 2a3a59ae1048490954c581986d7a9376840f0358 | [
"BSD-3-Clause"
] | null | null | null | kndetect/features.py | b-biswas/kndetect | 2a3a59ae1048490954c581986d7a9376840f0358 | [
"BSD-3-Clause"
] | null | null | null | kndetect/features.py | b-biswas/kndetect | 2a3a59ae1048490954c581986d7a9376840f0358 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pandas as pd
from scipy.optimize import minimize
from tqdm import tqdm
from kndetect.utils import extract_mimic_alerts_region
def get_feature_names(npcs=3):
"""
Create the list of feature names depending on the number of principal components.
Parameters
----------
npcs ... | 32.312155 | 113 | 0.662563 |
0396b05af88885cfce916898a409b3501800bb24 | 9,014 | py | Python | tests/read_test.py | bertrandchenal/tanker | b955311dc8f05f8bb3c0b391e169974e5c6a11b2 | [
"0BSD"
] | 1 | 2019-11-12T08:35:10.000Z | 2019-11-12T08:35:10.000Z | tests/read_test.py | bertrandchenal/tanker | b955311dc8f05f8bb3c0b391e169974e5c6a11b2 | [
"0BSD"
] | 1 | 2019-11-20T09:00:33.000Z | 2019-11-20T09:00:33.000Z | tests/read_test.py | bertrandchenal/tanker | b955311dc8f05f8bb3c0b391e169974e5c6a11b2 | [
"0BSD"
] | 1 | 2019-11-19T21:53:16.000Z | 2019-11-19T21:53:16.000Z | from datetime import datetime, date
from tanker import View, Expression, ctx, Expression
from .base_test import session, members
def test_filters(session):
view = View('team', ['name'])
filters = '(= country.name "France")'
res = view.read(filters).all()
assert res == [('Blue',)]
filters = [
... | 26.827381 | 76 | 0.537497 |
0396c04ffc096e32c16c1d5d7e94e2fab9bf5dd2 | 8,930 | py | Python | PlaceHoldMachine.py | Priler/PlaceHoldMachine | edfd0e94e6f013ab49823ebd0f1b3fc7b86a629c | [
"MIT"
] | 44 | 2015-11-27T13:17:50.000Z | 2022-03-26T17:22:14.000Z | PlaceHoldMachine.py | Priler/PlaceHoldMachine | edfd0e94e6f013ab49823ebd0f1b3fc7b86a629c | [
"MIT"
] | 4 | 2016-01-12T07:27:00.000Z | 2020-02-13T15:57:43.000Z | PlaceHoldMachine.py | Priler/PlaceHoldMachine | edfd0e94e6f013ab49823ebd0f1b3fc7b86a629c | [
"MIT"
] | 8 | 2016-08-14T15:10:51.000Z | 2021-09-02T11:12:45.000Z | # -*- coding: utf-8 -*-
from PIL import Image, ImageDraw, ImageFont
import os, time, sys
from math import ceil
class PlaceHoldMachine:
'''Author: Abraham Tugalov (aka Priler)'''
text = ""
prefix = ""
font_name = 'fonts/Ubuntu_Condensed/UbuntuCondensed-Regular.ttf'
font_size = '7%'
font = None
active_image = No... | 29.866221 | 113 | 0.687682 |
0396c0c9239ad73555621372589c8cf2ed088b56 | 1,313 | py | Python | src/ultipro/helpers.py | 0xW1sKy/ukg-python-sdk | 5aa7be3a95acd2d1ad5562fbbbda3fda34476209 | [
"MIT"
] | null | null | null | src/ultipro/helpers.py | 0xW1sKy/ukg-python-sdk | 5aa7be3a95acd2d1ad5562fbbbda3fda34476209 | [
"MIT"
] | null | null | null | src/ultipro/helpers.py | 0xW1sKy/ukg-python-sdk | 5aa7be3a95acd2d1ad5562fbbbda3fda34476209 | [
"MIT"
] | null | null | null | import os
import zeep
import logging
import io
from lxml import etree
from zeep import Plugin
# Use this plugin as a kwarg for the zeep class to print SOAP messages
class LoggingPlugin(Plugin):
def ingress(self, envelope, http_headers, operation):
print(etree.tostring(envelope, pretty_print=True))
... | 27.93617 | 76 | 0.692308 |
0396f08f83f3203c4404bea75793ef8cfcc0297f | 3,867 | py | Python | data/samplers/triplet_sampler.py | jackie840129/CF-AAN | 2b357bf5823837908f0fe04a22b47deaf9e3da4e | [
"MIT"
] | 16 | 2021-05-31T09:15:55.000Z | 2022-03-04T14:24:54.000Z | data/samplers/triplet_sampler.py | jackie840129/CF-AAN | 2b357bf5823837908f0fe04a22b47deaf9e3da4e | [
"MIT"
] | 2 | 2021-06-09T07:15:00.000Z | 2022-03-16T09:42:03.000Z | data/samplers/triplet_sampler.py | jackie840129/CF-AAN | 2b357bf5823837908f0fe04a22b47deaf9e3da4e | [
"MIT"
] | 4 | 2021-06-29T04:14:24.000Z | 2022-03-04T14:24:57.000Z | # encoding: utf-8
"""
@author: liaoxingyu
@contact: liaoxingyu2@jd.com
"""
import copy
import random
import torch
from collections import defaultdict
import numpy as np
from torch.utils.data.sampler import Sampler
class RandomIdentitySampler(Sampler):
"""
Randomly sample P identities, then for each identit... | 33.921053 | 96 | 0.620378 |
03974e448b49a68d1e59a34a33364116f2dd2797 | 4,248 | py | Python | tempest/api/identity/admin/v3/test_regions.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_regions.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/v3/test_regions.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 OpenStack Foundation
# 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 requ... | 41.242718 | 78 | 0.663371 |
0397727dfa473be8e9232abfe1ce7bbdeb1412a5 | 683 | py | Python | backend/src/app/models/user.py | niikakralj/EESTEC-Team | be70366dfc249e200ade8deb84408e758123c499 | [
"MIT"
] | null | null | null | backend/src/app/models/user.py | niikakralj/EESTEC-Team | be70366dfc249e200ade8deb84408e758123c499 | [
"MIT"
] | null | null | null | backend/src/app/models/user.py | niikakralj/EESTEC-Team | be70366dfc249e200ade8deb84408e758123c499 | [
"MIT"
] | null | null | null | from sqlalchemy import Boolean, Column, Integer, String, DateTime
from sqlalchemy.orm import relationship
from sqlalchemy.sql import func
from app.db.base_class import Base
class User(Base):
user_id = Column(Integer, primary_key=True, index=True)
name = Column(String, index=True)
surname = Column(String)
... | 42.6875 | 71 | 0.745242 |
039781759959d9d2526de3b21939e7d27f72238c | 3,600 | py | Python | ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs_namenode.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | 5 | 2018-06-03T05:19:40.000Z | 2021-04-16T17:10:49.000Z | ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs_namenode.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/HDP/1.3.2/services/HDFS/package/scripts/hdfs_namenode.py | wbear2/ambari | a1891193984da47015cd5483b5b95e040677d7df | [
"Apache-2.0"
] | 6 | 2019-05-07T13:24:39.000Z | 2021-02-15T14:12:37.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 use this ... | 28.346457 | 116 | 0.661111 |
0397833ede89af01b3d0275e6b12fa4217e94383 | 1,010 | py | Python | examples/example_filter/example_equal.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 86 | 2017-08-17T12:41:52.000Z | 2022-02-24T12:17:47.000Z | examples/example_filter/example_equal.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 10 | 2020-03-30T03:24:46.000Z | 2022-02-23T01:34:53.000Z | examples/example_filter/example_equal.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 7 | 2017-08-18T03:40:35.000Z | 2020-05-19T04:09:10.000Z | # !/usr/local/python/bin/python
# -*- coding: utf-8 -*-
# (C) Wu Dong, 2020
# All rights reserved
# @Author: 'Wu Dong <wudong@eastwu.cn>'
# @Time: '2020-03-27 15:44'
""" 演示 pre-request 框架如何使用等于、不等于判断
"""
import json
from flask import Flask
from pre_request import pre, Rule
app = Flask(__name__)
app.config["TESTING"]... | 18.035714 | 45 | 0.584158 |
039795c7e6e2d964818cb686724099992a795c52 | 48,653 | py | Python | site-packages/extensionsimporter.py | ProjectZeroDays/Pyto | d5d77f3541f329bbb28142d18606b22f115b7df6 | [
"MIT"
] | 2 | 2020-08-25T13:55:00.000Z | 2020-08-25T16:36:03.000Z | site-packages/extensionsimporter.py | ProjectZeroDays/Pyto | d5d77f3541f329bbb28142d18606b22f115b7df6 | [
"MIT"
] | null | null | null | site-packages/extensionsimporter.py | ProjectZeroDays/Pyto | d5d77f3541f329bbb28142d18606b22f115b7df6 | [
"MIT"
] | null | null | null | """
Module used internally by Pyto for importing C extension.
"""
import sys
import importlib
import traceback
import os
import warnings
class __UpgradeException__(Exception):
pass
if "widget" not in os.environ:
from sharing import open_url
import urllib.parse
from pyto import Python, __Class__
f... | 41.97843 | 2,407 | 0.506546 |
0397c303d4e89c637cd95047255cd05a4a3b4900 | 9,947 | py | Python | aiolifx/__main__.py | frawau/aiolifx | 7ba0a3775e273ac878f286e9685939f8fa19da70 | [
"MIT"
] | 11 | 2017-03-22T12:38:47.000Z | 2021-02-15T17:30:46.000Z | aiolifx/__main__.py | frawau/aiolifx | 7ba0a3775e273ac878f286e9685939f8fa19da70 | [
"MIT"
] | 31 | 2017-03-10T03:29:48.000Z | 2022-03-06T12:36:09.000Z | aiolifx/__main__.py | frawau/aiolifx | 7ba0a3775e273ac878f286e9685939f8fa19da70 | [
"MIT"
] | 11 | 2017-03-10T00:32:06.000Z | 2022-02-19T20:40:02.000Z | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#
# This application is an example on how to use aiolifx
#
# Copyright (c) 2016 François Wautier
#
# 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 Softwar... | 38.554264 | 126 | 0.442545 |
0397dcc8557517afb000660a2637d79e65ed1c46 | 10,916 | py | Python | tests/scripts/thread-cert/Cert_5_6_09_NetworkDataForwarding.py | sarah-iot/openthread | 8210a02400c145eb862b65e32040ed0415ba36c2 | [
"BSD-3-Clause"
] | 69 | 2021-12-16T01:34:09.000Z | 2022-03-31T08:27:39.000Z | tests/scripts/thread-cert/Cert_5_6_09_NetworkDataForwarding.py | xuyirio/openthread | 349041bc61e899acdccefea455c3401c05e1318b | [
"BSD-3-Clause"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | tests/scripts/thread-cert/Cert_5_6_09_NetworkDataForwarding.py | xuyirio/openthread | 349041bc61e899acdccefea455c3401c05e1318b | [
"BSD-3-Clause"
] | 21 | 2021-12-20T09:05:45.000Z | 2022-03-28T02:52:28.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 48.088106 | 401 | 0.655826 |
0397e6aaef3eae4da613d4737b09ab387f8d690d | 1,143 | py | Python | common/es_proxy.py | DalavanCloud/ccdb-data-pipeline | df494a56261598dc152d1d8280ce64ddd8cf7982 | [
"CC0-1.0"
] | 1 | 2019-02-25T21:29:51.000Z | 2019-02-25T21:29:51.000Z | common/es_proxy.py | DalavanCloud/ccdb-data-pipeline | df494a56261598dc152d1d8280ce64ddd8cf7982 | [
"CC0-1.0"
] | null | null | null | common/es_proxy.py | DalavanCloud/ccdb-data-pipeline | df494a56261598dc152d1d8280ce64ddd8cf7982 | [
"CC0-1.0"
] | null | null | null | import configargparse
from elasticsearch import Elasticsearch
def add_basic_es_arguments(parser):
group = parser.add_argument_group('Elasticsearch')
group.add('--es-host', '-o', required=True, dest='es_host',
help='Elasticsearch host', env_var='ES_HOST')
group.add('--es-port', '-p', dest='es... | 35.71875 | 69 | 0.634296 |
03981431b068b1278037d33b456f007208fe01c6 | 32,937 | py | Python | tofu/data/_spectrallines.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 56 | 2017-07-09T10:29:45.000Z | 2022-03-31T02:44:50.000Z | tofu/data/_spectrallines.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 522 | 2017-07-02T21:06:07.000Z | 2022-03-02T08:07:57.000Z | tofu/data/_spectrallines.py | Didou09/tofu | 4a4e1f058bab8e7556ed9d518f90807cec605476 | [
"MIT"
] | 9 | 2017-07-02T20:38:53.000Z | 2021-12-04T00:12:30.000Z |
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import warnings
from ._DataCollection_class import DataCollection
from . import _comp_spectrallines
from . import _DataCollection_comp
from . import _DataCollection_plot
__all__ = ['SpectralLines', 'TimeTra... | 28.393966 | 79 | 0.477244 |
03981481b085fd68999818117883a9e525b7a01e | 254 | py | Python | qa327_test/frontend/test_connection.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | qa327_test/frontend/test_connection.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | qa327_test/frontend/test_connection.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | import pytest
import requests
from qa327_test.conftest import base_url
"""
Simple test case for server connection
"""
# @pytest.mark.usefixtures('server')
# def test_server_is_live():
# r = requests.get(base_url)
# assert r.status_code == 200
| 18.142857 | 40 | 0.728346 |
0398307d1f2a499fffac5941c95936e861b6197f | 22,531 | py | Python | src/archive/WRP.py | andrawaag/WRP | df58b060b21df23c4fdc09ca7f2dc7ff63602049 | [
"CC0-1.0"
] | 1 | 2021-09-29T02:09:14.000Z | 2021-09-29T02:09:14.000Z | src/archive/WRP.py | andrawaag/WRP | df58b060b21df23c4fdc09ca7f2dc7ff63602049 | [
"CC0-1.0"
] | 24 | 2021-03-30T18:32:46.000Z | 2021-12-30T02:38:31.000Z | src/archive/WRP.py | andrawaag/WRP | df58b060b21df23c4fdc09ca7f2dc7ff63602049 | [
"CC0-1.0"
] | 1 | 2021-12-23T21:07:19.000Z | 2021-12-23T21:07:19.000Z | # Run in terminal with command 'python3 WRP.py' *in src folder *use venv as needed
## Make sure you've first run "pip install -r 00_requirements.txt"
# Table of Contents
## Packages: Line 9
## Nodes: Line 28
## Edges: Line 174
# Relevant Packages
import pandas as pd
import time
from datetime import datetime
import... | 37.42691 | 180 | 0.682393 |
0398982b0dda665e6ea95df5d3bec220182cb8ad | 462 | py | Python | IBMCloud/boids/setup.py | mateoglzc/TC2008B | e4e217d9edbb0d6c73df28324686ec069b361f0d | [
"MIT"
] | 7 | 2021-11-01T15:36:16.000Z | 2021-11-11T03:37:43.000Z | IBMCloud/boids/setup.py | mateoglzc/TC2008B | e4e217d9edbb0d6c73df28324686ec069b361f0d | [
"MIT"
] | null | null | null | IBMCloud/boids/setup.py | mateoglzc/TC2008B | e4e217d9edbb0d6c73df28324686ec069b361f0d | [
"MIT"
] | 4 | 2021-11-01T23:35:02.000Z | 2021-11-30T02:01:49.000Z | """
Hello World app for running Python apps on Bluemix
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='boids-example',
version='1.0.0',... | 23.1 | 66 | 0.731602 |
0398a57c862fc5d218df04c0a282935f332e5611 | 2,098 | py | Python | python_reference/sparsemax.py | AndreasMadsen/course-02456-sparsemax | 629f7bb9576b79783655a49c3f46bbcc7f970df7 | [
"MIT"
] | 17 | 2016-11-07T09:46:37.000Z | 2022-03-30T01:29:08.000Z | python_reference/sparsemax.py | AndreasMadsen/course-02456-sparsemax | 629f7bb9576b79783655a49c3f46bbcc7f970df7 | [
"MIT"
] | 9 | 2016-10-15T07:38:07.000Z | 2016-11-25T21:08:49.000Z | python_reference/sparsemax.py | AndreasMadsen/course-02456-sparsemax | 629f7bb9576b79783655a49c3f46bbcc7f970df7 | [
"MIT"
] | 7 | 2016-11-05T17:32:04.000Z | 2021-06-23T11:32:44.000Z | import numpy as np
def forward(z):
"""forward pass for sparsemax
this will process a 2d-array $z$, where axis 1 (each row) is assumed to be
the the z-vector.
"""
# sort z
z_sorted = np.sort(z, axis=1)[:, ::-1]
# calculate k(z)
z_cumsum = np.cumsum(z_sorted, axis=1)
k = np.arange... | 28.351351 | 100 | 0.607245 |
0398a8f03f61f847853e631cd7b21b0fcf957e42 | 1,369 | py | Python | tests/st/ops/ascend/vector/test_col2im_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/st/ops/ascend/vector/test_col2im_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/st/ops/ascend/vector/test_col2im_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | """
################################################
Testcase_PrepareCondition:
Testcase_TestSteps:
Testcase_ExpectedResult:
"""
import os
from tests.common.base import TestBase
from tests.common.test_run.ascend.col2im_run import col2im_run
############################################################
# TestCase= c... | 29.12766 | 119 | 0.511322 |
0398beacaf48888bfc103508affc595a9fcae531 | 2,639 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/help/countries_list.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/help/countries_list.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/help/countries_list.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.795181 | 103 | 0.617658 |
0398dd3a237d21c86cc5605f0f24ce2ef4f17777 | 1,924 | py | Python | geoq/maps/migrations/0002_auto_20200417_1123.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 471 | 2015-01-05T15:16:26.000Z | 2022-03-28T05:06:11.000Z | geoq/maps/migrations/0002_auto_20200417_1123.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 109 | 2015-01-06T20:00:58.000Z | 2022-03-11T23:17:53.000Z | geoq/maps/migrations/0002_auto_20200417_1123.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 100 | 2015-01-05T15:16:39.000Z | 2021-12-01T12:13:13.000Z | # Generated by Django 3.0.5 on 2020-04-17 15:23
from django.db import migrations, models
from django.conf import settings
import django.contrib.gis.db.models.fields
import django.db.models.deletion
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('maps', '0001_initial'),
... | 50.631579 | 239 | 0.630457 |
03991371f6960748e4dcbd4707606d879fe50fc5 | 36,505 | py | Python | Lib/site-packages/kivy/app.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 9 | 2016-09-03T07:20:01.000Z | 2020-05-21T14:44:48.000Z | Lib/site-packages/kivy/app.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 1 | 2017-05-30T20:45:15.000Z | 2017-05-30T20:45:15.000Z | Lib/site-packages/kivy/app.py | Aakash10399/simple-health-glucheck | 1f7c4ff7778a44f09b1c8cb0089fef51dc26cea2 | [
"bzip2-1.0.6"
] | 4 | 2016-09-10T15:27:54.000Z | 2020-03-27T22:05:31.000Z | '''
Application
===========
The :class:`App` class is the base for creating Kivy applications.
Think of it as your main entry point into the Kivy run loop. In most
cases, you subclass this class and make your own app. You create an
instance of your specific app class and then, when you are ready to
start the applicati... | 34.799809 | 79 | 0.62753 |
03992a1cd4651f3b164363b672d0bcb6c9b52fb7 | 4,186 | py | Python | sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/aio/_question_answering_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # 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 may ... | 49.247059 | 180 | 0.705925 |
0399322e12fc1ecf11714e2ca438e63433e7fe4a | 430 | py | Python | mathParser/tokens.py | StoryScriptorg/SSLLVM | c5e8a47697dc900bc9153425626a3587cf83efc9 | [
"MIT"
] | 3 | 2021-06-28T10:57:23.000Z | 2021-12-10T00:28:38.000Z | mathParser/tokens.py | StoryScriptorg/SSLLVM | c5e8a47697dc900bc9153425626a3587cf83efc9 | [
"MIT"
] | null | null | null | mathParser/tokens.py | StoryScriptorg/SSLLVM | c5e8a47697dc900bc9153425626a3587cf83efc9 | [
"MIT"
] | null | null | null | from enum import Enum
from dataclasses import dataclass
from typing import Any
class TokenType(Enum):
NUMBER = 0
PLUS = 1
MINUS = 2
MULTIPLY = 3
DIVIDE = 4
MODULO = 5
LPAREN = 6
RPAREN = 7
STRING = 8
POWER = 9
@dataclass
class Token:
type: TokenType
value: Any = None
... | 16.538462 | 84 | 0.613953 |
03993f827a8f56feb5153df5003637995ce60cf9 | 10,280 | py | Python | examples/dqn/dqn_main.py | aypan17/cule | 115a2572e21dcb69807368710a7a4a4fa6dd9b36 | [
"BSD-3-Clause"
] | null | null | null | examples/dqn/dqn_main.py | aypan17/cule | 115a2572e21dcb69807368710a7a4a4fa6dd9b36 | [
"BSD-3-Clause"
] | null | null | null | examples/dqn/dqn_main.py | aypan17/cule | 115a2572e21dcb69807368710a7a4a4fa6dd9b36 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import configparser
import errno
import logging
import os
import psutil
import re
import sys
import time
from pprint import pprint
from train import train
def add_parser_options(parser):
parser.add_argument('--num-ales', type=int, default=32, help='number of environments (default: 32)')
parser... | 60.828402 | 167 | 0.690564 |
0399459a4df37adc0118eb58a1c9d8d1b52fe5eb | 580 | py | Python | wizard_builder/migrations/0007_remove_conditional.py | SexualHealthInnovations/django-wizard-builder | f5effe8c462313f16be914b562dbea8ea796b672 | [
"BSD-3-Clause"
] | 16 | 2016-06-21T04:05:24.000Z | 2017-09-26T15:40:24.000Z | wizard_builder/migrations/0007_remove_conditional.py | SexualHealthInnovations/django-wizard-builder | f5effe8c462313f16be914b562dbea8ea796b672 | [
"BSD-3-Clause"
] | 141 | 2016-06-21T20:46:46.000Z | 2017-09-28T00:20:49.000Z | wizard_builder/migrations/0007_remove_conditional.py | project-callisto/django-wizard-builder | f5effe8c462313f16be914b562dbea8ea796b672 | [
"BSD-3-Clause"
] | 7 | 2017-10-04T22:52:18.000Z | 2018-05-31T17:14:39.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-08-02 20:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wizard_builder', '0006_many_sites'),
]
operations = [
migrations.RemoveField(
... | 21.481481 | 48 | 0.574138 |
0399514d2a1388b9f06857106462ee098b205343 | 6,503 | py | Python | ocrl/scripts/lqr_functions.py | hocherie/ocrl_hw2 | 1412e2b8392c93537351e8ee21b3049696289479 | [
"Apache-2.0"
] | 1 | 2020-04-30T00:55:05.000Z | 2020-04-30T00:55:05.000Z | ocrl/scripts/lqr_functions.py | hocherie/ocrl_hw2 | 1412e2b8392c93537351e8ee21b3049696289479 | [
"Apache-2.0"
] | null | null | null | ocrl/scripts/lqr_functions.py | hocherie/ocrl_hw2 | 1412e2b8392c93537351e8ee21b3049696289479 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
lqr controller for steering and speed control of ackerman system
"""
import math
import sys
import matplotlib.pyplot as plt
import numpy as np
import scipy.linalg as la
L = 0.335
max_steer = np.deg2rad(25)
class State:
def __init__(self, x=0.0, y=0.0, yaw=0.0, v=0.0):
self.x = ... | 24.915709 | 156 | 0.536214 |
0399525beaef8390ca9bfcaee0ede3e8750a413a | 92 | py | Python | tests/refactory_core_test.py | lmmx/refactory | 39e97528733f4cb2607a89184e3b0049f9784547 | [
"MIT"
] | null | null | null | tests/refactory_core_test.py | lmmx/refactory | 39e97528733f4cb2607a89184e3b0049f9784547 | [
"MIT"
] | 1 | 2022-02-07T22:18:30.000Z | 2022-02-07T22:18:30.000Z | tests/refactory_core_test.py | lmmx/refactory | 39e97528733f4cb2607a89184e3b0049f9784547 | [
"MIT"
] | null | null | null | import refactory
def test_load_package():
assert refactory.__package__ == "refactory"
| 15.333333 | 47 | 0.76087 |
03996c002aaed489691e6b9d817c387b1b95a240 | 197 | py | Python | posetta/data/__init__.py | gahjelle/posetta | 6e052c19a64b0bbdd0b9a7d3ac703000e615d53e | [
"MIT"
] | 2 | 2018-05-15T00:50:34.000Z | 2019-02-25T11:08:27.000Z | posetta/data/__init__.py | gahjelle/posetta | 6e052c19a64b0bbdd0b9a7d3ac703000e615d53e | [
"MIT"
] | 13 | 2018-07-06T08:52:52.000Z | 2018-12-07T13:49:34.000Z | posetta/data/__init__.py | gahjelle/posetta | 6e052c19a64b0bbdd0b9a7d3ac703000e615d53e | [
"MIT"
] | 2 | 2018-04-28T14:31:40.000Z | 2018-05-14T21:19:27.000Z | """Coordinate dataset
The CoordSet is a data structure that is used internally when translating
between different coordinate data formats.
"""
from posetta.data.coordset import CoordSet # noqa
| 21.888889 | 73 | 0.796954 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.