hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4fb845600533c4c6fef196fe5a45b98890f4ad78 | 306 | py | Python | sympy/matrices/benchmarks/bench_matrix.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2020-09-09T20:40:17.000Z | 2020-09-09T20:40:17.000Z | sympy/matrices/benchmarks/bench_matrix.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 14 | 2018-02-08T10:11:03.000Z | 2019-04-16T10:32:46.000Z | sympy/matrices/benchmarks/bench_matrix.py | utkarshdeorah/sympy | dcdf59bbc6b13ddbc329431adf72fcee294b6389 | [
"BSD-3-Clause"
] | 1 | 2022-02-04T13:50:29.000Z | 2022-02-04T13:50:29.000Z | from sympy.core.numbers import Integer
from sympy.matrices.dense import (eye)
i3 = Integer(3)
M = eye(100)
| 13.909091 | 45 | 0.689542 | from sympy.core.numbers import Integer
from sympy.matrices.dense import (eye, zeros)
i3 = Integer(3)
M = eye(100)
def timeit_Matrix__getitem_ii():
M[3, 3]
def timeit_Matrix__getitem_II():
M[i3, i3]
def timeit_Matrix__getslice():
M[:, :]
def timeit_Matrix_zeronm():
zeros(100, 100)
| 0 | 0 | 0 | 0 | 0 | 95 | 0 | 7 | 92 |
ae59bc59a3c000aa9e99c9afdee88976bbd03879 | 1,815 | py | Python | dl.py | idriskuti2/hate-speech-and-offensive-language | 773ffc0bf5d8f89a87bef55e8c9e7a1895a64931 | [
"MIT"
] | null | null | null | dl.py | idriskuti2/hate-speech-and-offensive-language | 773ffc0bf5d8f89a87bef55e8c9e7a1895a64931 | [
"MIT"
] | null | null | null | dl.py | idriskuti2/hate-speech-and-offensive-language | 773ffc0bf5d8f89a87bef55e8c9e7a1895a64931 | [
"MIT"
] | null | null | null |
# tokenizer for DL models
#df is the dataframe with the columns name and labels for training tokenizer
#funtion for pad seq
#input train dataframe and test dataframe and tokenizer
#takes train dataframe and test dataframe as inputs and returns their enoding
#compile model and train it
#function to predict labels
#take... | 44.268293 | 88 | 0.741598 |
# tokenizer for DL models
#df is the dataframe with the columns name and labels for training tokenizer
def tokens(df):
from keras.preprocessing.text import Tokenizer
token = Tokenizer(num_words = None,char_level = True)
token.fit_on_texts(df.name)
return token
#funtion for pad seq
#input train datafram... | 0 | 0 | 0 | 0 | 0 | 1,343 | 0 | 0 | 110 |
3c06a16a4277eb5653bbff6679e902cdf22582e3 | 415 | py | Python | post/migrations/0026_auto_20191205_2351.py | abhiabhi94/blog | 0da1522361e47af3bbfba974f801277e14c7a397 | [
"MIT"
] | null | null | null | post/migrations/0026_auto_20191205_2351.py | abhiabhi94/blog | 0da1522361e47af3bbfba974f801277e14c7a397 | [
"MIT"
] | 12 | 2019-09-11T18:37:19.000Z | 2019-09-16T21:51:35.000Z | post/migrations/0026_auto_20191205_2351.py | abhiabhi94/blog | 0da1522361e47af3bbfba974f801277e14c7a397 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-12-05 18:21
| 21.842105 | 64 | 0.585542 | # Generated by Django 2.2.5 on 2019-12-05 18:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('post', '0025_auto_20191205_2335'),
]
# operations = [
# migrations.AlterField(
# model_name='post',
# name='date_pub... | 0 | 0 | 0 | 301 | 0 | 0 | 0 | 19 | 46 |
e1c203759ad6b945a525a9f9c63e5084472e1500 | 731 | py | Python | material/sources/workflows/plot_data.py | JuliaSprenger/PhD_thesis | 723082726f7bc8550ccfbff5da320ab9cb573ecf | [
"CC-BY-4.0"
] | null | null | null | material/sources/workflows/plot_data.py | JuliaSprenger/PhD_thesis | 723082726f7bc8550ccfbff5da320ab9cb573ecf | [
"CC-BY-4.0"
] | null | null | null | material/sources/workflows/plot_data.py | JuliaSprenger/PhD_thesis | 723082726f7bc8550ccfbff5da320ab9cb573ecf | [
"CC-BY-4.0"
] | null | null | null | import sys, neo
import matplotlib.pyplot as plt
def load_neo_block(filename):
""" Load data from file into Neo """
with neo.get_io(filename) as io:
return io.read_block()
def plot_analogsignal(block, filename):
""" Plot first AnalogSignal of Neo """
anasig = block.segments[0].analogsignals[0]
... | 29.24 | 69 | 0.701778 | import sys, neo
import matplotlib.pyplot as plt
def load_neo_block(filename):
""" Load data from file into Neo """
with neo.get_io(filename) as io:
return io.read_block()
def plot_analogsignal(block, filename):
""" Plot first AnalogSignal of Neo """
anasig = block.segments[0].analogsignals[0]
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d2b2b4a612fac6c8281caac858fa53063a09a750 | 311 | py | Python | tests/test_compat.py | jhermann/cookiecutter | 81927bb627cfbdc7b0a4c609d82e416f5433617e | [
"BSD-3-Clause"
] | 1 | 2020-09-08T01:56:44.000Z | 2020-09-08T01:56:44.000Z | tests/test_compat.py | jhermann/cookiecutter | 81927bb627cfbdc7b0a4c609d82e416f5433617e | [
"BSD-3-Clause"
] | null | null | null | tests/test_compat.py | jhermann/cookiecutter | 81927bb627cfbdc7b0a4c609d82e416f5433617e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_compat
------------
Tests for `cookiecutter.compat` module.
"""
| 15.55 | 51 | 0.697749 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_compat
------------
Tests for `cookiecutter.compat` module.
"""
from cookiecutter.compat import which
def test_existing_command():
assert which('cookiecutter')
def test_non_existing_command():
assert not which('stringthatisntashellcommand')
| 0 | 0 | 0 | 0 | 0 | 103 | 0 | 16 | 69 |
5da782da081908514144200c805c1fa4935830c6 | 4,011 | py | Python | core/management/commands/users_and_groups.py | alex-cots/prevention-point | e64813227846c0e23ed41128602bc16eac40c3b7 | [
"MIT"
] | null | null | null | core/management/commands/users_and_groups.py | alex-cots/prevention-point | e64813227846c0e23ed41128602bc16eac40c3b7 | [
"MIT"
] | null | null | null | core/management/commands/users_and_groups.py | alex-cots/prevention-point | e64813227846c0e23ed41128602bc16eac40c3b7 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import Group, User
DEFAULT_DEV_ENV_PASS = "password123"
INTERNAL_PROVIDER_PERMISSIONS = [
"add_insurer",
"change_insurer",
"view_insurer",
"add_participant",
"change_participant",
"view_participant",
"add_program",
"change_program",
"view_program",
... | 25.06875 | 85 | 0.681127 | from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group, User, Permission
DEFAULT_DEV_ENV_PASS = "password123"
INTERNAL_PROVIDER_PERMISSIONS = [
"add_insurer",
"change_insurer",
"view_insurer",
"add_participant",
... | 0 | 0 | 0 | 222 | 0 | 886 | 0 | 68 | 136 |
cff3a29d49b6fbb871b93b7df0f4d112b336e314 | 976 | py | Python | mysite/greenhouse/migrations/0002_auto_20171009_2345.py | martinloland/greenhouse | 53ac2f99f20ea0e3b2fd694d6aca317cce7cfea7 | [
"MIT"
] | 1 | 2020-02-11T20:44:53.000Z | 2020-02-11T20:44:53.000Z | mysite/greenhouse/migrations/0002_auto_20171009_2345.py | martinloland/greenhouse | 53ac2f99f20ea0e3b2fd694d6aca317cce7cfea7 | [
"MIT"
] | null | null | null | mysite/greenhouse/migrations/0002_auto_20171009_2345.py | martinloland/greenhouse | 53ac2f99f20ea0e3b2fd694d6aca317cce7cfea7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-09 21:45
from __future__ import unicode_literals
| 29.575758 | 96 | 0.581967 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-09 21:45
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('greenhouse', '0001_initial'),
]
operations = [
migrations.Add... | 0 | 0 | 0 | 789 | 0 | 0 | 0 | 19 | 50 |
47cdc0d74b9cf2dab14e552edd43713678f0fc2a | 1,395 | py | Python | webvulsca.py | aditya-dk7/WEBMINE | 2ddd326dd53e931438ed071c68c9abe7521cd4f8 | [
"MIT"
] | null | null | null | webvulsca.py | aditya-dk7/WEBMINE | 2ddd326dd53e931438ed071c68c9abe7521cd4f8 | [
"MIT"
] | null | null | null | webvulsca.py | aditya-dk7/WEBMINE | 2ddd326dd53e931438ed071c68c9abe7521cd4f8 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import argparse
try:
from bin import banner
from bin import trim_url
banner.print_banner()
parser = argparse.ArgumentParser(prog='webvulsca.py', usage='%(prog)s [options]', add_help=False,
formatter_class=CapitalisedHelpFormatter)
parser... | 34.02439 | 120 | 0.63871 | #!/usr/bin/python3
import argparse
try:
from bin import banner
from bin import trim_url
banner.print_banner()
class CapitalisedHelpFormatter(argparse.HelpFormatter):
def add_usage(self, usage, actions, groups, prefix=None):
if prefix is None:
prefix = 'Usage: '
... | 0 | 0 | 0 | 282 | 0 | 0 | 0 | 0 | 27 |
a3c5a4f99aeaad3262a6320d3c7bdd8c05e8918f | 4,332 | py | Python | rpiScripts/MissionControl/MissionSimulation.py | aborger/RockSatX2020-KauIda | 4ee505c7dfac1a9f14a86f17e273fbdaa2af8319 | [
"MIT"
] | 1 | 2020-04-03T23:41:04.000Z | 2020-04-03T23:41:04.000Z | MissionControl/MissionSimulation.py | Cizlin/RockSatX2020-KauIda | 0aa47d279c8efdb883bd5294b57aed0439f61ed5 | [
"MIT"
] | 1 | 2021-04-02T03:53:32.000Z | 2021-04-02T03:53:32.000Z | rpiScripts/MissionControl/MissionSimulation.py | aborger/RockSatX2020-KauIda | 4ee505c7dfac1a9f14a86f17e273fbdaa2af8319 | [
"MIT"
] | 3 | 2020-03-15T02:05:17.000Z | 2020-05-19T17:56:56.000Z | # The following code has been modified from that provided at github.com/piborg/diablo
# by Garrisen Cizmich
# To run this program (or any other program with I2C control), you must perform the following:
# Open Terminal.
# Type "ps aux | grep ManualMotorControl.py" without the quotes and press Enter.
# Find the process... | 52.192771 | 169 | 0.69783 | # The following code has been modified from that provided at github.com/piborg/diablo
# by Garrisen Cizmich
# To run this program (or any other program with I2C control), you must perform the following:
# Open Terminal.
# Type "ps aux | grep ManualMotorControl.py" without the quotes and press Enter.
# Find the process... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
b2b8f1d053605e52fe95c85f6682c9eed9d2327c | 16,443 | py | Python | ActPackMan.py | UM-LoCoLab/NeuroLocoMiddleware | 0dfedeed8d6d8a41518b357b33ee92324b5029c3 | [
"MIT"
] | null | null | null | ActPackMan.py | UM-LoCoLab/NeuroLocoMiddleware | 0dfedeed8d6d8a41518b357b33ee92324b5029c3 | [
"MIT"
] | null | null | null | ActPackMan.py | UM-LoCoLab/NeuroLocoMiddleware | 0dfedeed8d6d8a41518b357b33ee92324b5029c3 | [
"MIT"
] | null | null | null | """ An object that wraps the Dephy ActPack """
import numpy as np
# Dephy library import
# Version of the ActPackMan library
__version__="1.0.0"
# See ActPackState for all available data
labels = [ # matches varsToStream
"State time",
"Motor angle", "Motor velocity", "Motor acceleration",
"Motor vol... | 42.053708 | 146 | 0.688378 | """ An object that wraps the Dephy ActPack """
import os, sys
import time
import csv
import traceback
import numpy as np
import h5py
import deprecated
from enum import Enum
from math import isfinite
from os.path import realpath
# Dephy library import
from flexsea import fxUtils as fxu # pylint: disable=no-name-in-mo... | 26 | 0 | 0 | 15,103 | 0 | 0 | 0 | 4 | 408 |
722a6ad423777dd45c70d0f4dcf63df45f53933c | 2,445 | py | Python | ask_amy/core/default_home_skill.py | dphiggs01/ask_amy | ee3db434c0d467935e7e7d09312dcd891475c8a5 | [
"Apache-2.0"
] | 1 | 2020-06-16T23:42:03.000Z | 2020-06-16T23:42:03.000Z | ask_amy/core/default_home_skill.py | dphiggs01/ask_amy | ee3db434c0d467935e7e7d09312dcd891475c8a5 | [
"Apache-2.0"
] | null | null | null | ask_amy/core/default_home_skill.py | dphiggs01/ask_amy | ee3db434c0d467935e7e7d09312dcd891475c8a5 | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging.getLogger()
| 35.955882 | 86 | 0.617996 | import logging
import json
import boto3
from ask_amy.core.object_dictionary import ObjectDictionary
logger = logging.getLogger()
class DefaultHomeSkill(ObjectDictionary):
def __init__(self, dialog_dict=None):
super().__init__(dialog_dict)
self._event = None
self._intent_name = None
... | 0 | 0 | 0 | 2,291 | 0 | 0 | 0 | 19 | 89 |
be4349ed9e073c244822c04f5cd84caa23c22f66 | 4,504 | py | Python | APIs/Oauth/server.py | clarencejlee/jdp | d3d31db0138ff06f2f5ec592d85317941af4f280 | [
"MIT"
] | null | null | null | APIs/Oauth/server.py | clarencejlee/jdp | d3d31db0138ff06f2f5ec592d85317941af4f280 | [
"MIT"
] | null | null | null | APIs/Oauth/server.py | clarencejlee/jdp | d3d31db0138ff06f2f5ec592d85317941af4f280 | [
"MIT"
] | null | null | null | from sanic import Sanic
from intuitlib.client import AuthClient
from quickbooks import QuickBooks
from sqlalchemy.ext.asyncio import create_async_engine
from contextvars import ContextVar
from sanic_cors import CORS
app = Sanic("qb_app")
CORS(app)
_base_model_session_ctx = ContextVar("session")
bind = create_asy... | 32.875912 | 329 | 0.726465 | from sanic import Sanic
from sanic.response import text, json
import json as Json
from intuitlib.client import AuthClient
from quickbooks import QuickBooks
from quickbooks.objects.customer import Customer
from quickbooks.objects.invoice import Invoice
from quickbooks.objects.account import Account
from quickbooks.obje... | 0 | 3,158 | 0 | 9 | 0 | 0 | 0 | 216 | 357 |
10159755670bacd2367c21749b4f8afd9c31d726 | 1,114 | py | Python | operators/klusterlet/python/pulumi_pulumi_kubernetes_crds_operators_klusterlet/_tables.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | operators/klusterlet/python/pulumi_pulumi_kubernetes_crds_operators_klusterlet/_tables.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | 2 | 2020-09-18T17:12:23.000Z | 2020-12-30T19:40:56.000Z | operators/klusterlet/python/pulumi_pulumi_kubernetes_crds_operators_klusterlet/_tables.py | pulumi/pulumi-kubernetes-crds | 372c4c0182f6b899af82d6edaad521aa14f22150 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
SNAKE_TO_CAMEL_CASE_TABLE = {
"api_version": "apiVersion",
"ca_bundle": "caBundle",
"cluster_name": "clusterName",
"external_server_ur_ls": "external... | 37.133333 | 80 | 0.725314 | # coding=utf-8
# *** WARNING: this file was generated by crd2pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
SNAKE_TO_CAMEL_CASE_TABLE = {
"api_version": "apiVersion",
"ca_bundle": "caBundle",
"cluster_name": "clusterName",
"external_server_ur_ls": "external... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7461d1fe563f3b22042df37716c6f28291b87b63 | 803 | py | Python | algorithm/merge_sort.py | csunny/algorithm | 51ac81377c8baec0183976a387281e78b7f2192d | [
"MIT"
] | 21 | 2018-08-15T14:09:03.000Z | 2022-01-10T02:03:55.000Z | algorithm/merge_sort.py | Valuebai/algorithm | 51ac81377c8baec0183976a387281e78b7f2192d | [
"MIT"
] | 1 | 2019-05-29T08:33:14.000Z | 2019-05-29T08:33:14.000Z | algorithm/merge_sort.py | Valuebai/algorithm | 51ac81377c8baec0183976a387281e78b7f2192d | [
"MIT"
] | 7 | 2018-11-13T06:01:34.000Z | 2021-01-25T06:50:47.000Z | #!/usr/bin/env python3
"""
This document is created by magic at 2018/8/17
This is impletement of merge sort
"""
def merge(left, right):
"""
:param left:
:param right:
:return:
"""
tmp = []
i, j = 0, 0
while i < len(left) and j < len(right):
if left[i] < right[j]:
... | 16.06 | 46 | 0.510585 | #!/usr/bin/env python3
"""
This document is created by magic at 2018/8/17
This is impletement of merge sort
归并排序
"""
def merge_sort(values):
n = len(values)
if n <= 1:
return values
key = int(n / 2)
left = merge_sort(values[:key])
right = merge_sort(values[key:])
return merge(left... | 48 | 0 | 0 | 0 | 0 | 186 | 0 | 0 | 23 |
980a2ec6a0284522b9f5bbb6e46d93d1181fe63e | 859 | py | Python | test/test_i2c.py | DuncanBetts/Pykarbon | 76ab192830327948f2365ebad8f266d3e0a769a2 | [
"BSD-3-Clause"
] | 4 | 2020-01-06T17:26:26.000Z | 2021-12-16T09:36:03.000Z | test/test_i2c.py | DuncanBetts/Pykarbon | 76ab192830327948f2365ebad8f266d3e0a769a2 | [
"BSD-3-Clause"
] | 2 | 2020-03-27T20:59:21.000Z | 2020-06-26T15:31:49.000Z | test/test_i2c.py | DuncanBetts/Pykarbon | 76ab192830327948f2365ebad8f266d3e0a769a2 | [
"BSD-3-Clause"
] | 1 | 2020-03-10T14:11:03.000Z | 2020-03-10T14:11:03.000Z | ''' Test pykarbon.i2c functions '''
| 19.088889 | 90 | 0.658906 | ''' Test pykarbon.i2c functions '''
import pykarbon.i2c as pki
def test_read():
device_id = 0x21
register = 0x99
print("Trying to read register 0x{:X} from device 0x{:X}".format(register, device_id))
dev = pki.Device(device_id)
dev.write(register, 0x78)
val = dev.read(register)
assert ... | 0 | 0 | 0 | 0 | 0 | 724 | 0 | 5 | 91 |
58762a0fa98899d1254c6006e1b14e186574c425 | 1,094 | py | Python | Tornato WebSocket Raspberry/server_test.py | serfalle/watney | a9c9eceec34f2ebb2e856ac4e5d76771a07c45b7 | [
"MIT"
] | null | null | null | Tornato WebSocket Raspberry/server_test.py | serfalle/watney | a9c9eceec34f2ebb2e856ac4e5d76771a07c45b7 | [
"MIT"
] | null | null | null | Tornato WebSocket Raspberry/server_test.py | serfalle/watney | a9c9eceec34f2ebb2e856ac4e5d76771a07c45b7 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
#import os.path
#import tornado.httpserver
#import tornado.websocket
#import tornado.ioloop
#import tornado.web
import RPi.GPIO as GPIO
import time
#Initialize Raspberry PI GPIO
GPIO.setmode(GPIO.BOARD)
# GPIO.setup(11, GPIO.OUT)
# GPIO.setup(13, GPIO.OUT)
# GPIO.setup(16, GPIO.OUT)
GPIO.setup(18,... | 19.192982 | 54 | 0.637112 | #! /usr/bin/python3
#import os.path
#import tornado.httpserver
#import tornado.websocket
#import tornado.ioloop
#import tornado.web
import RPi.GPIO as GPIO
import time
#Initialize Raspberry PI GPIO
GPIO.setmode(GPIO.BOARD)
# GPIO.setup(11, GPIO.OUT)
# GPIO.setup(13, GPIO.OUT)
# GPIO.setup(16, GPIO.OUT)
GPIO.setup(18,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
883bc1e1165eeb3c79916c5de9201be72c38adad | 1,151 | py | Python | accounting/accounting/doctype/journal_entry/journal_entry.py | shariquerik/accounting | 74867a71918a99500fb78c75652841bcb8e509a1 | [
"MIT"
] | 3 | 2021-02-21T16:24:26.000Z | 2021-06-25T07:38:08.000Z | accounting/accounting/doctype/journal_entry/journal_entry.py | shariquerik/accounting | 74867a71918a99500fb78c75652841bcb8e509a1 | [
"MIT"
] | null | null | null | accounting/accounting/doctype/journal_entry/journal_entry.py | shariquerik/accounting | 74867a71918a99500fb78c75652841bcb8e509a1 | [
"MIT"
] | 1 | 2021-03-10T06:59:09.000Z | 2021-03-10T06:59:09.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Shariq and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
| 32.885714 | 88 | 0.768897 | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Shariq and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import _
from frappe.utils import flt
from accounting.accounting.general_ledger import mak... | 0 | 0 | 0 | 774 | 0 | 0 | 0 | 83 | 133 |
b0782e5ae73bda994cd0667e5ea5f29a598165c5 | 496 | py | Python | website/templatetags/website_tool.py | munisisazade/demo_programs | ec80b6f7eb0161c124d0512f5075779714726b2d | [
"MIT"
] | null | null | null | website/templatetags/website_tool.py | munisisazade/demo_programs | ec80b6f7eb0161c124d0512f5075779714726b2d | [
"MIT"
] | null | null | null | website/templatetags/website_tool.py | munisisazade/demo_programs | ec80b6f7eb0161c124d0512f5075779714726b2d | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
| 24.8 | 82 | 0.645161 | from django import template
register = template.Library()
@register.filter
def get_youtube_embed_url(url):
if url:
result = 'https://www.youtube.com/embed/' + url[-11:]
return result
else:
return 'https://www.youtube.com/embed/hb04Nh7GxmE'
@register.filter
def get_youtube_video_image... | 0 | 391 | 0 | 0 | 0 | 0 | 0 | 0 | 46 |
b2f6a3162ecb3b76cf526741670af5ae31368d35 | 1,779 | py | Python | tyrannosaurus/clean.py | dmyersturnbull/template-python | 6cab7028ef56905c1711af5aa56a202646cdfbb0 | [
"Apache-2.0"
] | 63 | 2020-05-06T21:48:01.000Z | 2022-03-24T21:10:20.000Z | tyrannosaurus/clean.py | dmyersturnbull/template-python | 6cab7028ef56905c1711af5aa56a202646cdfbb0 | [
"Apache-2.0"
] | 119 | 2020-05-07T23:07:24.000Z | 2022-03-28T18:04:52.000Z | tyrannosaurus/clean.py | dmyersturnbull/template-python | 6cab7028ef56905c1711af5aa56a202646cdfbb0 | [
"Apache-2.0"
] | 6 | 2020-05-16T05:36:47.000Z | 2022-02-24T13:47:23.000Z | """
Module that cleans up temporary files.
Original source: https://github.com/dmyersturnbull/tyrannosaurus
Copyright 20202021 Douglas Myers-Turnbull
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 ... | 32.944444 | 88 | 0.665542 | """
Module that cleans up temporary files.
Original source: https://github.com/dmyersturnbull/tyrannosaurus
Copyright 2020–2021 Douglas Myers-Turnbull
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... | 3 | 0 | 0 | 1,075 | 0 | 0 | 0 | 85 | 134 |
db73c434907f9ee1d843201cfa4734dbabc39cb2 | 1,859 | py | Python | 2-Roofline-acquiring/scripts/drawBigRoofLine.py | intellistream/PC-AMP | 8525c72048b880f58f2f612a7c00b342f7105386 | [
"Apache-2.0"
] | null | null | null | 2-Roofline-acquiring/scripts/drawBigRoofLine.py | intellistream/PC-AMP | 8525c72048b880f58f2f612a7c00b342f7105386 | [
"Apache-2.0"
] | null | null | null | 2-Roofline-acquiring/scripts/drawBigRoofLine.py | intellistream/PC-AMP | 8525c72048b880f58f2f612a7c00b342f7105386 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import groupLine as groupLine
if __name__ == "__main__":
main()
| 24.460526 | 89 | 0.496503 | #!/usr/bin/env python3
import groupLine as groupLine
import csv
def readRoofLineFromCSV(a):
print('load'+a)
with open(a, 'r') as f:
reader = csv.reader(f)
#reader = [each for each in csv.DictReader(f, delimiter=',')]
result = list(reader)
rows=len(result)
print('rows=',ro... | 0 | 0 | 0 | 0 | 0 | 1,694 | 0 | -11 | 66 |
348b7c6223410c74d8425b5e0b361523518b495b | 2,411 | py | Python | examples/python/akamai_publish_dir.py | gaofubin/ccu_and_eccu_publish | 85d016374e7079ad3b707f55538e910c23e822f8 | [
"Apache-2.0"
] | 2 | 2017-05-27T09:30:53.000Z | 2017-12-12T10:49:26.000Z | examples/python/akamai_publish_dir.py | gaofubin/ccu_and_eccu_publish | 85d016374e7079ad3b707f55538e910c23e822f8 | [
"Apache-2.0"
] | 1 | 2021-06-01T21:45:15.000Z | 2021-06-01T21:45:15.000Z | examples/python/akamai_publish_dir.py | gaofubin/ccu_and_eccu_publish | 85d016374e7079ad3b707f55538e910c23e822f8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
if __name__ == '__main__':
main()
| 31.311688 | 126 | 0.674409 | #!/usr/bin/env python
import requests
from suds.client import Client
import base64
from cStringIO import StringIO
import xml.etree.ElementTree as ET
import datetime
import argparse
import urlparse
import logging
import settings
def eccu_doc_for_purge_dir(path_to_purge):
root = ET.Element('eccu')
parent = ro... | 0 | 0 | 0 | 512 | 0 | 1,559 | 0 | -14 | 292 |
35ba198f899ecc366a25323aff89667364d2490e | 1,629 | py | Python | tests/NFToken/test_transfer_reverts.py | 1Blackdiamondsc/nftoken | 8c36a9dd2b82d2e654c311836e27da01c5c83c9a | [
"MIT"
] | 56 | 2019-09-25T08:14:14.000Z | 2022-03-26T04:40:26.000Z | tests/NFToken/test_transfer_reverts.py | 1Blackdiamondsc/nftoken | 8c36a9dd2b82d2e654c311836e27da01c5c83c9a | [
"MIT"
] | 2 | 2019-09-26T14:14:38.000Z | 2020-02-27T13:07:35.000Z | tests/NFToken/test_transfer_reverts.py | 1Blackdiamondsc/nftoken | 8c36a9dd2b82d2e654c311836e27da01c5c83c9a | [
"MIT"
] | 20 | 2020-08-09T16:01:59.000Z | 2022-03-31T15:58:29.000Z | #!/usr/bin/python3
import brownie
def test_check_bounds(accounts, nft):
"""check bounds"""
with brownie.reverts("dev: index out of bounds"):
nft.transferRange(accounts[2], 0, 1000, {"from": accounts[0]})
with brownie.reverts("dev: index out of bounds"):
nft.transferRange(accounts[2], 1000... | 35.413043 | 76 | 0.658686 | #!/usr/bin/python3
import brownie
def test_check_bounds(accounts, nft):
"""check bounds"""
with brownie.reverts("dev: index out of bounds"):
nft.transferRange(accounts[2], 0, 1000, {"from": accounts[0]})
with brownie.reverts("dev: index out of bounds"):
nft.transferRange(accounts[2], 1000... | 0 | 0 | 0 | 0 | 0 | 268 | 0 | 0 | 46 |
f243b7aca3ad9e9c7d93acad85c1a64cc53bfafe | 281 | py | Python | data/topQuartile.py | nidishrajendran/computational-politeness | 1da61e2858a7a364235f710594be8db4cad98487 | [
"Apache-2.0"
] | null | null | null | data/topQuartile.py | nidishrajendran/computational-politeness | 1da61e2858a7a364235f710594be8db4cad98487 | [
"Apache-2.0"
] | null | null | null | data/topQuartile.py | nidishrajendran/computational-politeness | 1da61e2858a7a364235f710594be8db4cad98487 | [
"Apache-2.0"
] | null | null | null | import csv
filename="wikipedia.annotated.csv"
f = open(filename)
csv_f = csv.reader(f)
text_corpus=[]
csv_f.next()
for row in csv_f:
text_corpus.append((row[2],float(row[-1])))
text_corpus.sort(key=lambda l: l[1])
top=[]
for i in range(len(text_corpus)/4):
top.append(i)
| 18.733333 | 47 | 0.69395 | import csv
filename="wikipedia.annotated.csv"
f = open(filename)
csv_f = csv.reader(f)
text_corpus=[]
csv_f.next()
for row in csv_f:
text_corpus.append((row[2],float(row[-1])))
text_corpus.sort(key=lambda l: l[1])
top=[]
for i in range(len(text_corpus)/4):
top.append(i)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1b9a1749895599beb2238c48964e842213a937eb | 13,857 | py | Python | coffee/visitors/utilities.py | coneoproject/COFFEE | 70c1e66a4e4e39d3bf75274505a16901af110751 | [
"BSD-3-Clause"
] | 12 | 2015-03-28T12:44:05.000Z | 2020-08-10T17:00:32.000Z | coffee/visitors/utilities.py | coneoproject/COFFEE | 70c1e66a4e4e39d3bf75274505a16901af110751 | [
"BSD-3-Clause"
] | 89 | 2015-01-05T13:30:30.000Z | 2019-09-11T18:49:20.000Z | coffee/visitors/utilities.py | coneoproject/COFFEE | 70c1e66a4e4e39d3bf75274505a16901af110751 | [
"BSD-3-Clause"
] | 7 | 2015-01-23T13:37:50.000Z | 2018-09-10T07:46:02.000Z | from __future__ import absolute_import, print_function, division
__all__ = ["ReplaceSymbols", "CheckUniqueness", "Uniquify", "Evaluate",
"EstimateFlops", "ProjectExpansion", "Reconstructor"]
| 34.729323 | 92 | 0.59479 | from __future__ import absolute_import, print_function, division
from six.moves import map, range
import itertools
import operator
from copy import deepcopy
from collections import OrderedDict, defaultdict
import numpy as np
from coffee.visitor import Visitor
from coffee.base import Sum, Sub, Prod, Div, ArrayInit, Sp... | 0 | 91 | 0 | 13,125 | 0 | 0 | 0 | 91 | 339 |
0e65323f36681f67d04629420463eda986666286 | 6,522 | py | Python | River_Crossing_Problem/River_Crossing_Problem.py | Nurl4n/Artificial-Intelligence | b6716558d083375cfb7d44b4083dd02ae4836b9f | [
"MIT"
] | null | null | null | River_Crossing_Problem/River_Crossing_Problem.py | Nurl4n/Artificial-Intelligence | b6716558d083375cfb7d44b4083dd02ae4836b9f | [
"MIT"
] | null | null | null | River_Crossing_Problem/River_Crossing_Problem.py | Nurl4n/Artificial-Intelligence | b6716558d083375cfb7d44b4083dd02ae4836b9f | [
"MIT"
] | null | null | null | """
Created on Sat Feb 8 2021 - 13:28
Mastan Abdulkhaligli (CONTACT) 21403007
Okan Sen 21202377
Asadullah Farooqi
Nurlan Farzaliyev 21503756
Utku Baris Yuksek 21602412
This program solves the river crossing problem of the cannibals and missionaries using NDS.
The homework consists of 6 missionaries, 6... | 35.835165 | 140 | 0.647807 | """
Created on Sat Feb 8 2021 - 13:28
Mastan Abdulkhaligli (CONTACT) 21403007
Okan Sen 21202377
Asadullah Farooqi
Nurlan Farzaliyev 21503756
Utku Baris Yuksek 21602412
This program solves the river crossing problem of the cannibals and missionaries using NDS.
The homework consists of 6 missionaries, 6... | 0 | 0 | 0 | 3,802 | 0 | 810 | 0 | -8 | 123 |
3171dee40956da9b1e31f5653339f746f30db14a | 9,747 | py | Python | cde-root/usr/local/apps/inkscape/share/inkscape/extensions/funcplot.py | NirBenTalLab/proorigami-cde-package | 273379075830a9b94d3f2884661a54f853777ff6 | [
"MIT"
] | null | null | null | cde-root/usr/local/apps/inkscape/share/inkscape/extensions/funcplot.py | NirBenTalLab/proorigami-cde-package | 273379075830a9b94d3f2884661a54f853777ff6 | [
"MIT"
] | null | null | null | cde-root/usr/local/apps/inkscape/share/inkscape/extensions/funcplot.py | NirBenTalLab/proorigami-cde-package | 273379075830a9b94d3f2884661a54f853777ff6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Copyright (C) 2006 Georg Wiora, xorx@quarkbox.de
Copyright (C) 2006 Johan Engelen, johan@shouraizou.nl
Copyright (C) 2005 Aaron Spike, aaron@ekips.org
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... | 43.32 | 105 | 0.510721 | #!/usr/bin/env python
'''
Copyright (C) 2006 Georg Wiora, xorx@quarkbox.de
Copyright (C) 2006 Johan Engelen, johan@shouraizou.nl
Copyright (C) 2005 Aaron Spike, aaron@ekips.org
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... | 0 | 0 | 0 | 5,659 | 0 | 2,929 | 0 | 12 | 112 |
9a25d471c8382b7216b61e782bffc52457ada247 | 1,729 | py | Python | src/partitionMetaData.py | DiegosNore/Telematica4 | 21c3b94ff3bef86125ffa4dd859d51cf505dc92d | [
"MIT"
] | null | null | null | src/partitionMetaData.py | DiegosNore/Telematica4 | 21c3b94ff3bef86125ffa4dd859d51cf505dc92d | [
"MIT"
] | null | null | null | src/partitionMetaData.py | DiegosNore/Telematica4 | 21c3b94ff3bef86125ffa4dd859d51cf505dc92d | [
"MIT"
] | null | null | null |
"""
This gets the meta-data containing filenames, location in MB on where to start
and the filesize
This is embedded in an iterative loop over process rank to decide which files
and or chunks of files to send to each process
Initial plan was to include the MPI send/recv here.
Kept this part wrapped to make more modu... | 29.305085 | 97 | 0.733372 |
"""
This gets the meta-data containing filenames, location in MB on where to start
and the filesize
This is embedded in an iterative loop over process rank to decide which files
and or chunks of files to send to each process
Initial plan was to include the MPI send/recv here.
Kept this part wrapped to make more modu... | 0 | 0 | 0 | 0 | 0 | 1,329 | 0 | -11 | 68 |
173756061f8381c015ce5da417a3fc408f250090 | 7,368 | py | Python | soen691_clustering_project/kd_tree.py | jeanlst/soen691-clustering-project | 08353cbe192330e606cdd854df99f93b468f0f66 | [
"MIT"
] | null | null | null | soen691_clustering_project/kd_tree.py | jeanlst/soen691-clustering-project | 08353cbe192330e606cdd854df99f93b468f0f66 | [
"MIT"
] | 5 | 2020-03-24T16:53:45.000Z | 2021-02-03T20:53:33.000Z | soen691_clustering_project/kd_tree.py | jeanlst/soen691-clustering-project | 08353cbe192330e606cdd854df99f93b468f0f66 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" KDTree class."""
| 35.941463 | 120 | 0.59677 | # -*- coding: utf-8 -*-
""" KDTree class."""
import numpy as np
from utils import squared_euclidean_distance
class Node:
def __init__(self, values=None, payload=None, left=None, right=None, disc=None, parent=None):
self.values = values # Data point that is presented as list of coodinates.
self.... | 0 | 0 | 0 | 6,674 | 0 | 487 | 0 | 20 | 137 |
7d9bc63ca132c346b6bddc9ff4e112fc2cd35b7d | 1,920 | py | Python | setup.py | TopDeveloper-333/chinesetts | 0d84bd9596392922bdb1ecc91fb6bb7cbf3be720 | [
"Apache-2.0"
] | null | null | null | setup.py | TopDeveloper-333/chinesetts | 0d84bd9596392922bdb1ecc91fb6bb7cbf3be720 | [
"Apache-2.0"
] | null | null | null | setup.py | TopDeveloper-333/chinesetts | 0d84bd9596392922bdb1ecc91fb6bb7cbf3be720 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: XuMing <xuming624@qq.com>
# Brief:
from __future__ import print_function
from setuptools import setup, find_packages
from parrots import __version__
long_description = '''
## Usage
### install
* pip3 install parrots
* Or
```
git clone https://github.com/shibing624/parrots.git
cd p... | 21.818182 | 117 | 0.636458 | # -*- coding: utf-8 -*-
# Author: XuMing <xuming624@qq.com>
# Brief:
from __future__ import print_function
from setuptools import setup, find_packages
from parrots import __version__
long_description = '''
## Usage
### install
* pip3 install parrots
* Or
```
git clone https://github.com/shibing624/parrots.git
cd p... | 63 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c3f7442ba4ac9cc82c0956fbed65e15da1ed9cc1 | 9,813 | py | Python | gpRegression.py | martinpilat/gp-surrogate | 08cc142fb93dd015d4468396b69dda877a9b8272 | [
"MIT"
] | 5 | 2017-01-19T14:20:37.000Z | 2021-12-19T02:30:19.000Z | gpRegression.py | martinpilat/gp-surrogate | 08cc142fb93dd015d4468396b69dda877a9b8272 | [
"MIT"
] | 1 | 2019-06-08T02:27:34.000Z | 2022-01-24T15:54:07.000Z | gpRegression.py | martinpilat/gp-surrogate | 08cc142fb93dd015d4468396b69dda877a9b8272 | [
"MIT"
] | null | null | null | from deap import tools, base, creator, gp
import pandas as pd
import operator
import random
import numpy as np
import benchmarks
import algo
import argparse
import json
# decription of the benchmarks
benchmark_description = [
{'name': 'keijzer-6',
'variables': 1,
'pset': benchmarks.get_primitive_set_for... | 35.298561 | 120 | 0.664934 | from deap import tools, base, creator, gp
import pandas as pd
import operator
import math
import random
import numpy as np
import benchmarks
import algo
import argparse
import json
# decription of the benchmarks
benchmark_description = [
{'name': 'keijzer-6',
'variables': 1,
'pset': benchmarks.get_primi... | 0 | 0 | 0 | 0 | 0 | 469 | 0 | -10 | 67 |
ff3f05de1f57e008aa833eceea3d0a0fffd80cd9 | 6,417 | py | Python | opentamp/src/test/test_core/test_util_classes/test_common_predicates.py | Algorithmic-Alignment-Lab/openTAMP-legacy | 3b7c3be164cc968ad77a928286d6460cd70a670e | [
"MIT"
] | 2 | 2022-03-09T19:48:20.000Z | 2022-03-26T17:31:07.000Z | opentamp/src/test/test_core/test_util_classes/test_common_predicates.py | Algorithmic-Alignment-Lab/OpenTAMP | eecb950bd273da8cbed4394487630e8453f2c242 | [
"MIT"
] | null | null | null | opentamp/src/test/test_core/test_util_classes/test_common_predicates.py | Algorithmic-Alignment-Lab/OpenTAMP | eecb950bd273da8cbed4394487630e8453f2c242 | [
"MIT"
] | null | null | null | import unittest
from sco import expr
import numpy as np
N = 10
## exprs for testing
e1 = expr.Expr(lambda x: np.array([x]))
e2 = expr.Expr(lambda x: np.power(x, 2))
if __name__ is "__main__":
unittest.main()
| 40.613924 | 103 | 0.570827 | import unittest
from core.internal_repr import parameter
from core.util_classes.matrix import Vector2d
from core.util_classes import common_predicates
from core.util_classes.openrave_body import OpenRAVEBody
from core.util_classes import items
from errors_exceptions import PredicateException
from sco import expr
import... | 0 | 0 | 0 | 5,828 | 0 | 0 | 0 | 172 | 199 |
dba2be82c37b9f2b86ccd6dadd05e085c377f170 | 1,217 | py | Python | blueblog/blueprints/auth.py | authetic-x/Bluelog | 003e5cd866598171b8e0e37e5a94eac1010e9970 | [
"MIT"
] | 1 | 2020-07-29T16:46:32.000Z | 2020-07-29T16:46:32.000Z | blueblog/blueprints/auth.py | authetic-x/Bluelog | 003e5cd866598171b8e0e37e5a94eac1010e9970 | [
"MIT"
] | null | null | null | blueblog/blueprints/auth.py | authetic-x/Bluelog | 003e5cd866598171b8e0e37e5a94eac1010e9970 | [
"MIT"
] | null | null | null | from flask import Blueprint
auth_bp = Blueprint('auth', __name__) | 32.891892 | 77 | 0.658998 | from flask import Blueprint, redirect, url_for, flash, render_template
from flask_login import login_user, current_user, logout_user, login_required
from blueblog.models import Admin
from blueblog.forms import LoginForm
from blueblog.utils import redirect_back
auth_bp = Blueprint('auth', __name__)
@auth_bp.route('/l... | 0 | 871 | 0 | 0 | 0 | 0 | 0 | 145 | 134 |
a6b2569d360b3574cb959c379487f7596f43faed | 79 | py | Python | src/__main__.py | TestowanieAutomatyczneUG/projekt-i-Darkstaron123 | fe8c1e74eb73267ebb985bd030714250bb7adf67 | [
"MIT"
] | null | null | null | src/__main__.py | TestowanieAutomatyczneUG/projekt-i-Darkstaron123 | fe8c1e74eb73267ebb985bd030714250bb7adf67 | [
"MIT"
] | null | null | null | src/__main__.py | TestowanieAutomatyczneUG/projekt-i-Darkstaron123 | fe8c1e74eb73267ebb985bd030714250bb7adf67 | [
"MIT"
] | null | null | null | from menuClass import MenuClass
MenuClass().menu(MenuClass().chooseLanguage())
| 26.333333 | 46 | 0.810127 | from menuClass import MenuClass
MenuClass().menu(MenuClass().chooseLanguage())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c07f4039682a2f7f235497500249f2edee162ebf | 3,186 | py | Python | test/test_kutil.py | jommy99/pypeerassets | 2daa3facd55ef2523ab35ae8257449d90a4b6b40 | [
"BSD-3-Clause"
] | 10 | 2017-02-08T03:31:47.000Z | 2020-01-19T10:34:46.000Z | test/test_kutil.py | d5000/pypeerassets | f8028528817667354c5b6c1355a9a891f60d9ca8 | [
"BSD-3-Clause"
] | 57 | 2016-11-08T18:46:53.000Z | 2020-04-06T17:32:06.000Z | test/test_kutil.py | d5000/pypeerassets | f8028528817667354c5b6c1355a9a891f60d9ca8 | [
"BSD-3-Clause"
] | 18 | 2016-11-06T13:50:43.000Z | 2021-12-26T13:37:03.000Z | from os import urandom
from pypeerassets.kutil import Kutil
def test_key_generation():
'''test privkey/pubkey generation.'''
mykey = Kutil(network="ppc")
assert isinstance(mykey.privkey, str)
assert isinstance(mykey.pubkey, str)
def test_key_generation_from_seed():
'''check if key generation ... | 30.634615 | 111 | 0.701193 | import pytest
from os import urandom
from decimal import Decimal
import time
from btcpy.structs.transaction import Locktime
from btcpy.structs.sig import P2pkhSolver
from pypeerassets.kutil import Kutil
from pypeerassets.provider import Explorer
from pypeerassets.networks import net_query
from pypeerassets.transactio... | 0 | 0 | 0 | 0 | 0 | 1,094 | 0 | 195 | 200 |
078f21bd10238877206e4f11cccc3d558aeb3455 | 3,447 | py | Python | scheduler/migrations/0001_initial.py | Fredy/UCSP-Scheduler | d064c6e348c984e828105c084c1df9a00554df1b | [
"MIT"
] | null | null | null | scheduler/migrations/0001_initial.py | Fredy/UCSP-Scheduler | d064c6e348c984e828105c084c1df9a00554df1b | [
"MIT"
] | 4 | 2020-02-11T21:28:24.000Z | 2021-06-10T17:37:00.000Z | scheduler/migrations/0001_initial.py | Fredy/UCSP-Scheduler | d064c6e348c984e828105c084c1df9a00554df1b | [
"MIT"
] | 1 | 2021-06-22T16:27:15.000Z | 2021-06-22T16:27:15.000Z | # Generated by Django 2.0.1 on 2018-01-08 23:05
| 40.081395 | 116 | 0.553525 | # Generated by Django 2.0.1 on 2018-01-08 23:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Career',
fields=[
... | 0 | 0 | 0 | 3,300 | 0 | 0 | 0 | 30 | 68 |
8e4eb6364f836ad634b566eac891bd0fb97af242 | 124 | py | Python | secrets.py | guilherme-batalheiro/spotify-youtube-playlist | 6fe5b79e405b9ecdf6619f0da9cccb13d4a0e11f | [
"MIT"
] | 1 | 2021-06-13T23:38:09.000Z | 2021-06-13T23:38:09.000Z | secrets.py | guilherme-batalheiro/spotify-youtube-playlist | 6fe5b79e405b9ecdf6619f0da9cccb13d4a0e11f | [
"MIT"
] | null | null | null | secrets.py | guilherme-batalheiro/spotify-youtube-playlist | 6fe5b79e405b9ecdf6619f0da9cccb13d4a0e11f | [
"MIT"
] | null | null | null | CLIENT_ID = ""
CLIENT_SECRET = ""
API_KEY = ""
PLAYLIST_ID = ""
PLAYLIST_NAME = ""
REDIRECT_URI = "http://localhost:8080"
| 13.777778 | 38 | 0.66129 | CLIENT_ID = ""
CLIENT_SECRET = ""
API_KEY = ""
PLAYLIST_ID = ""
PLAYLIST_NAME = ""
REDIRECT_URI = "http://localhost:8080"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6bbbfa36bc230c140555c1b39b93a51dc3c6a383 | 162 | py | Python | raki2.py | Dyavathrocky/rocky | 693833e61ce9317ab003ca61d4654c6b3806cd22 | [
"Apache-2.0"
] | null | null | null | raki2.py | Dyavathrocky/rocky | 693833e61ce9317ab003ca61d4654c6b3806cd22 | [
"Apache-2.0"
] | null | null | null | raki2.py | Dyavathrocky/rocky | 693833e61ce9317ab003ca61d4654c6b3806cd22 | [
"Apache-2.0"
] | null | null | null | #raki2 if + for loop
while True :
print('please type your name ')
name = input()
if name == 'your name':
break
print ('thank you')
| 20.25 | 36 | 0.537037 | #raki2 if + for loop
while True :
print('please type your name ')
name = input()
if name == 'your name':
break
print ('thank you')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1a21eae812969876e34f4acd3f746c4b9b0add33 | 313 | py | Python | PythonExercicios/ex035.py | marcoantonio97/Curso-de-Python | b99c6c75e2b845086203b84a71a4013c0658dc44 | [
"MIT"
] | null | null | null | PythonExercicios/ex035.py | marcoantonio97/Curso-de-Python | b99c6c75e2b845086203b84a71a4013c0658dc44 | [
"MIT"
] | null | null | null | PythonExercicios/ex035.py | marcoantonio97/Curso-de-Python | b99c6c75e2b845086203b84a71a4013c0658dc44 | [
"MIT"
] | null | null | null | seg1 = float(input('Segmento 1: '))
seg2 = float(input('Segmento 2: '))
seg3 = float(input('Segmento 3: '))
if seg1 < seg2 + seg3 and seg2 < seg1 + seg3 and seg3 < seg1 + seg2:
print('Os segmentos informados PODEM forma um tringulo')
else:
print('Os segmentos informados NO PODEM forma um tringulo.')
| 34.777778 | 68 | 0.683706 | seg1 = float(input('Segmento 1: '))
seg2 = float(input('Segmento 2: '))
seg3 = float(input('Segmento 3: '))
if seg1 < seg2 + seg3 and seg2 < seg1 + seg3 and seg3 < seg1 + seg2:
print('Os segmentos informados PODEM forma um triângulo')
else:
print('Os segmentos informados NÃO PODEM forma um triângulo.')
| 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
45fa1da32d87b2e16bb64c8ebb847084648f1a54 | 27,818 | py | Python | test/test_fitmodel.py | laenan8466/DeerLab | 94f1942da1b506e0661a8e7e4901bb5ba6d69143 | [
"MIT"
] | null | null | null | test/test_fitmodel.py | laenan8466/DeerLab | 94f1942da1b506e0661a8e7e4901bb5ba6d69143 | [
"MIT"
] | null | null | null | test/test_fitmodel.py | laenan8466/DeerLab | 94f1942da1b506e0661a8e7e4901bb5ba6d69143 | [
"MIT"
] | null | null | null |
import numpy as np
from numpy import inf
import deerlab as dl
from deerlab import dipolarkernel, whitegaussnoise, fitmodel
from deerlab.dd_models import dd_gauss
from deerlab.bg_models import bg_exp, bg_hom3d
from deerlab.ex_models import ex_4pdeer, ex_5pdeer, ex_7pdeer, ex_ovl4pdeer
import deerlab as dl
from... | 35.30203 | 99 | 0.4418 |
import numpy as np
from numpy import inf
import deerlab as dl
from deerlab import dipolarkernel, whitegaussnoise, fitmodel
from deerlab.dd_models import dd_gauss
from deerlab.bg_models import bg_exp, bg_hom3d
from deerlab.ex_models import ex_4pdeer, ex_5pdeer, ex_7pdeer, ex_ovl4pdeer
import deerlab as dl
from... | 0 | 0 | 0 | 0 | 0 | 3,783 | 0 | 0 | 125 |
148bf84fd662a3c560ec40dfdde5ffbe54d8dd36 | 5,883 | py | Python | tfrecorder/utils.py | Samad999777/tensorflow-recorder | 3797da3e730137d467f812612ac8dc0c1b1f8a6e | [
"Apache-2.0"
] | null | null | null | tfrecorder/utils.py | Samad999777/tensorflow-recorder | 3797da3e730137d467f812612ac8dc0c1b1f8a6e | [
"Apache-2.0"
] | null | null | null | tfrecorder/utils.py | Samad999777/tensorflow-recorder | 3797da3e730137d467f812612ac8dc0c1b1f8a6e | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 30.015306 | 78 | 0.681965 | # Lint as: python3
# Copyright 2020 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bc28ef409add741238f88d2578aed9a0ff248a1c | 1,186 | py | Python | setup.py | codasus/django-sqlcipher | 636f33acd5dbbaac8ba1fa8a0ad24a36893e01da | [
"MIT"
] | 3 | 2015-05-18T11:39:26.000Z | 2018-01-09T00:30:35.000Z | setup.py | benjaoming/django-sqlcipher | 636f33acd5dbbaac8ba1fa8a0ad24a36893e01da | [
"MIT"
] | 5 | 2015-04-26T12:22:17.000Z | 2021-12-06T02:25:24.000Z | setup.py | codasus/django-sqlcipher | 636f33acd5dbbaac8ba1fa8a0ad24a36893e01da | [
"MIT"
] | 8 | 2016-04-24T13:28:53.000Z | 2021-12-05T04:59:57.000Z | from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
import os
root = os.path.dirname(os.path.abspath(__file__))
os.chdir(root)
VERSION = '0.1.1'
# Make data go to the right place.
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042... | 31.210526 | 104 | 0.693086 | from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
import os
root = os.path.dirname(os.path.abspath(__file__))
os.chdir(root)
VERSION = '0.1.1'
# Make data go to the right place.
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
300eb4063a0864ebae171f2b08b23a4121006c60 | 298 | py | Python | src/setup.py | Darthone/Informed-Finance-Canary | 1fe398c1c157ca09c591be95e6a2f317ad1add8c | [
"MIT"
] | 1 | 2018-03-07T08:27:48.000Z | 2018-03-07T08:27:48.000Z | src/setup.py | Darthone/Informed-Finance-Canary | 1fe398c1c157ca09c591be95e6a2f317ad1add8c | [
"MIT"
] | null | null | null | src/setup.py | Darthone/Informed-Finance-Canary | 1fe398c1c157ca09c591be95e6a2f317ad1add8c | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='ifc',
version='0.1',
description='informed finance canary',
url='https://github.com/Darthone/bug-free-octo-parakeet',
author='Dario Marasco',
author_email='',
license='MIT',
packages=['ifc'],
zip_safe=False)
| 24.833333 | 63 | 0.624161 | from setuptools import setup
setup(name='ifc',
version='0.1',
description='informed finance canary',
url='https://github.com/Darthone/bug-free-octo-parakeet',
author='Dario Marasco',
author_email='',
license='MIT',
packages=['ifc'],
zip_safe=False)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c13a2aff2c1dcf0f00186cf3b26f7aafcf3f7bca | 13,390 | py | Python | JarvisAI/JarvisAI/__init__.py | tusharrex/jervissd | db236f3709f8f5a1bb902b3fef390662d17ba9bf | [
"MIT"
] | 1 | 2021-04-18T17:30:38.000Z | 2021-04-18T17:30:38.000Z | JarvisAI/JarvisAI/__init__.py | tusharrex/jervissd | db236f3709f8f5a1bb902b3fef390662d17ba9bf | [
"MIT"
] | null | null | null | JarvisAI/JarvisAI/__init__.py | tusharrex/jervissd | db236f3709f8f5a1bb902b3fef390662d17ba9bf | [
"MIT"
] | null | null | null | import os
try:
import pyaudio
except Exception as e:
try:
os.system("pipwin install pyaudio")
except Exception as e:
try:
os.system("pip install pyaudio")
except Exception as e:
print("Exception occur ", e)
print("Install pyaudio manually")
# imp... | 36.785714 | 118 | 0.609485 | import speech_recognition as sr
import os
from gtts import gTTS
from playsound import playsound
import sys
import configparser
import random
try:
import pyaudio
except Exception as e:
try:
os.system("pipwin install pyaudio")
except Exception as e:
try:
os.system("pip install pya... | 0 | 0 | 0 | 10,552 | 0 | 0 | 0 | 516 | 575 |
08c674e00fc2d98470e098cf04fe72aae43c8fdb | 3,217 | py | Python | src/nuclipy/scanner.py | prasant-paudel/nuclei-python | 53174821f93e4e5a48708b6ac832cf2f74bfa63d | [
"MIT"
] | 2 | 2022-01-06T10:59:22.000Z | 2022-03-11T07:16:32.000Z | src/nuclipy/scanner.py | prasant-paudel/nuclei-python | 53174821f93e4e5a48708b6ac832cf2f74bfa63d | [
"MIT"
] | 1 | 2021-08-18T19:15:24.000Z | 2021-12-25T14:49:50.000Z | src/nuclipy/scanner.py | prasant-paudel/nuclei-python | 53174821f93e4e5a48708b6ac832cf2f74bfa63d | [
"MIT"
] | 1 | 2021-07-26T07:03:23.000Z | 2021-07-26T07:03:23.000Z |
PKG_ROOT = __file__.strip(__name__ + '.py')
| 38.297619 | 126 | 0.573205 | from .colors import Colors
from .helper import Helper
from .template import Template
from os.path import exists, join
from os import listdir
from threading import Thread
from time import sleep
PKG_ROOT = __file__.strip(__name__ + '.py')
class Scanner:
def __init__(self, args) -> None:
self.a... | 0 | 0 | 0 | 2,945 | 0 | 0 | 0 | 39 | 186 |
966a83aac5a08aea49b21fa1a407cdcb530dfca9 | 321 | py | Python | app/server/utils/print.py | hsadler/zentype2 | 08694727d65531b2c7bd0cea97f53c5a270d0f51 | [
"MIT"
] | null | null | null | app/server/utils/print.py | hsadler/zentype2 | 08694727d65531b2c7bd0cea97f53c5a270d0f51 | [
"MIT"
] | null | null | null | app/server/utils/print.py | hsadler/zentype2 | 08694727d65531b2c7bd0cea97f53c5a270d0f51 | [
"MIT"
] | null | null | null |
# Console print helper
import pprint
INDENT = 2
pp = pprint.PrettyPrinter(indent=INDENT)
| 12.84 | 40 | 0.65109 |
# Console print helper
import simplejson as json
import pprint
INDENT = 2
pp = pprint.PrettyPrinter(indent=INDENT)
def ppp(to_print, as_json=False):
print('')
if as_json:
print(
json.dumps(
to_print,
sort_keys=True,
indent=INDENT,
separators=(',', ': ')
)
)
else:
pp.pprint(to_print... | 0 | 0 | 0 | 0 | 0 | 178 | 0 | 4 | 46 |
727ddac1a935fd802cf1d21453aa5811aaa49d18 | 3,464 | py | Python | ietf/utils/html.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 2 | 2022-03-12T04:37:08.000Z | 2022-03-13T00:48:39.000Z | ietf/utils/html.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 39 | 2021-05-31T21:10:14.000Z | 2022-03-07T16:07:14.000Z | ietf/utils/html.py | hassanakbar4/ietfdb | cabee059092ae776015410640226064331c293b7 | [
"BSD-3-Clause"
] | 2 | 2021-10-05T12:48:20.000Z | 2021-11-08T11:38:35.000Z | # Copyright The IETF Trust 2010-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Taken from http://code.google.com/p/soclone/source/browse/trunk/soclone/utils/html.py
"""Utilities for working with HTML."""
import bleach
import lxml.etree
import lxml.html
acceptable_tags = ('a', 'abbr', 'acronym', 'address', 'b', ... | 35.346939 | 128 | 0.591801 | # Copyright The IETF Trust 2010-2020, All Rights Reserved
# -*- coding: utf-8 -*-
# Taken from http://code.google.com/p/soclone/source/browse/trunk/soclone/utils/html.py
"""Utilities for working with HTML."""
import bleach
import copy
import html2text
import lxml.etree
import lxml.html
import lxml.html.clean
import ... | 0 | 214 | 0 | 708 | 0 | 458 | 0 | 24 | 317 |
578d4068bb7b7e852f8e0d0606c224b34df9e793 | 6,262 | py | Python | src/primaires/communication/editeurs/messagerie/edt_brouillons.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 14 | 2015-08-21T19:15:21.000Z | 2017-11-26T13:59:17.000Z | src/primaires/communication/editeurs/messagerie/edt_brouillons.py | vincent-lg/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 20 | 2015-09-29T20:50:45.000Z | 2018-06-21T12:58:30.000Z | src/primaires/communication/editeurs/messagerie/edt_brouillons.py | vlegoff/tsunami | 36b3b974f6eefbf15cd5d5f099fc14630e66570b | [
"BSD-3-Clause"
] | 3 | 2015-05-02T19:42:03.000Z | 2018-09-06T10:55:00.000Z | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | 42.598639 | 80 | 0.584478 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | 52 | 0 | 0 | 4,299 | 0 | 0 | 0 | 176 | 134 |
6c02ec3ca439da3c9175834e941930690307b524 | 115 | py | Python | src/horas/admin.py | eljav/autoshop | 0da37aca4669a26470b2750ba8c969eb8aef2fce | [
"bzip2-1.0.6"
] | null | null | null | src/horas/admin.py | eljav/autoshop | 0da37aca4669a26470b2750ba8c969eb8aef2fce | [
"bzip2-1.0.6"
] | 34 | 2019-08-20T19:45:08.000Z | 2021-04-08T20:08:37.000Z | src/horas/admin.py | eljav/autoshop | 0da37aca4669a26470b2750ba8c969eb8aef2fce | [
"bzip2-1.0.6"
] | 3 | 2019-08-19T20:18:04.000Z | 2020-10-11T20:57:13.000Z | from django.contrib import admin
from .models import Hora
# Register your models here.
admin.site.register(Hora) | 16.428571 | 32 | 0.791304 | from django.contrib import admin
from .models import Hora
# Register your models here.
admin.site.register(Hora) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7b7de1db2318260a2c765acf2a3d28b6cbd246bf | 4,643 | py | Python | models/decoder.py | CuiRuikai/mfm-net | 8fc67543fe6ec63cd93102c5ca78bd19d1926fdd | [
"MIT"
] | null | null | null | models/decoder.py | CuiRuikai/mfm-net | 8fc67543fe6ec63cd93102c5ca78bd19d1926fdd | [
"MIT"
] | null | null | null | models/decoder.py | CuiRuikai/mfm-net | 8fc67543fe6ec63cd93102c5ca78bd19d1926fdd | [
"MIT"
] | null | null | null | import torch.nn as nn
| 35.442748 | 171 | 0.59832 | import torch
import torch.nn as nn
from timm.models.layers import DropPath, trunc_normal_
class Mlp(nn.Module):
def __init__(self, in_features, hidden_features=None, out_features=None, act_layer=nn.GELU, drop=0.):
super().__init__()
out_features = out_features or in_features
hidden_featur... | 0 | 0 | 0 | 4,457 | 0 | 0 | 0 | 24 | 137 |
d81b8f66ed4d90118a6d388087781f9947445f0c | 1,338 | py | Python | test_categorytpl.py | hrbonz/pelican-category_template | 9c0cd974860df1fbf477bbddf8dad4521ac91eeb | [
"BSD-3-Clause"
] | 1 | 2021-03-18T18:50:02.000Z | 2021-03-18T18:50:02.000Z | test_categorytpl.py | hrbonz/pelican-category_template | 9c0cd974860df1fbf477bbddf8dad4521ac91eeb | [
"BSD-3-Clause"
] | null | null | null | test_categorytpl.py | hrbonz/pelican-category_template | 9c0cd974860df1fbf477bbddf8dad4521ac91eeb | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
if __name__ == '__main__':
unittest.main()
| 35.210526 | 78 | 0.670404 | # -*- coding: utf-8 -*-
import os
import unittest
from pelican.contents import Article
from pelican.generators import Generator
from pelican.settings import DEFAULT_CONFIG
from categorytpl import category_template
class TestCategoryTpl(unittest.TestCase):
def setUp(self):
settings = DEFAULT_CONFIG.copy()... | 0 | 0 | 0 | 1,051 | 0 | 0 | 0 | 64 | 135 |
ebca08dadb304b097a6b0204483f95af9c5bc3da | 2,265 | py | Python | parse.py | alk-gmathews/trello-retro-with-votes-json-to-csv | acd94fc9a478989a3228af721a4fb6f04a69294b | [
"MIT"
] | null | null | null | parse.py | alk-gmathews/trello-retro-with-votes-json-to-csv | acd94fc9a478989a3228af721a4fb6f04a69294b | [
"MIT"
] | null | null | null | parse.py | alk-gmathews/trello-retro-with-votes-json-to-csv | acd94fc9a478989a3228af721a4fb6f04a69294b | [
"MIT"
] | 1 | 2021-07-05T13:41:34.000Z | 2021-07-05T13:41:34.000Z | import json
from collections import defaultdict
board = None
with open('trello.json', 'r') as file:
board = json.loads(file.read())
cards = board['cards']
lists = board['lists']
list_id_to_name = {}
list_names_to_pos = {}
for _list in lists:
if _list['closed']:
continue
list_id_to_name[_list['id'... | 24.095745 | 76 | 0.537307 | import json
from collections import defaultdict
board = None
with open('trello.json', 'r') as file:
board = json.loads(file.read())
cards = board['cards']
lists = board['lists']
list_id_to_name = {}
list_names_to_pos = {}
for _list in lists:
if _list['closed']:
continue
list_id_to_name[_list['id'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6558334052447ee7e295ad9d7c2bdc5fa362b967 | 2,664 | py | Python | tests/components/atag/test_config_flow.py | twrecked/core | d3ae8a938cdea9b6e0d443c91c37ac3dbbd459ab | [
"Apache-2.0"
] | 2 | 2020-03-06T14:18:59.000Z | 2020-03-06T14:24:43.000Z | tests/components/atag/test_config_flow.py | twrecked/core | d3ae8a938cdea9b6e0d443c91c37ac3dbbd459ab | [
"Apache-2.0"
] | 5 | 2021-02-08T20:55:25.000Z | 2022-03-12T00:51:18.000Z | tests/components/atag/test_config_flow.py | twrecked/core | d3ae8a938cdea9b6e0d443c91c37ac3dbbd459ab | [
"Apache-2.0"
] | 2 | 2020-11-04T07:40:01.000Z | 2021-09-13T21:44:03.000Z | """Tests for the Atag config flow."""
from homeassistant.const import CONF_DEVICE, CONF_EMAIL, CONF_HOST, CONF_PORT
FIXTURE_USER_INPUT = {
CONF_HOST: "127.0.0.1",
CONF_EMAIL: "test@domain.com",
CONF_PORT: 10000,
}
FIXTURE_COMPLETE_ENTRY = FIXTURE_USER_INPUT.copy()
FIXTURE_COMPLETE_ENTRY[CONF_DEVICE] = "dev... | 35.052632 | 77 | 0.710586 | """Tests for the Atag config flow."""
from pyatag import AtagException
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.atag import DOMAIN
from homeassistant.const import CONF_DEVICE, CONF_EMAIL, CONF_HOST, CONF_PORT
from tests.async_mock import PropertyMock, patch
from tests.co... | 0 | 0 | 2,000 | 0 | 0 | 0 | 0 | 120 | 204 |
c44b2c32bd30a9b9ad2c2a0aaa59b86e408fe8b2 | 3,294 | py | Python | tests/integration/routes/test_thank_you.py | pricem14pc/eq-questionnaire-runner | 54cc2947ba181a2673ea1fb7cf6b4acdd609e06b | [
"MIT"
] | 3 | 2020-09-28T13:21:21.000Z | 2021-05-05T14:14:51.000Z | tests/integration/routes/test_thank_you.py | pricem14pc/eq-questionnaire-runner | 54cc2947ba181a2673ea1fb7cf6b4acdd609e06b | [
"MIT"
] | 402 | 2019-11-06T17:23:03.000Z | 2022-03-31T16:03:35.000Z | tests/integration/routes/test_thank_you.py | pricem14pc/eq-questionnaire-runner | 54cc2947ba181a2673ea1fb7cf6b4acdd609e06b | [
"MIT"
] | 10 | 2020-03-03T14:23:27.000Z | 2022-01-31T12:21:21.000Z |
ACCOUNT_SERVICE_SURVEYS_URL = "/surveys/todo"
| 31.371429 | 90 | 0.611415 | from tests.integration.integration_test_case import IntegrationTestCase
ACCOUNT_SERVICE_SURVEYS_URL = "/surveys/todo"
class TestThankYou(IntegrationTestCase):
def test_thank_you_page_no_sign_out(self):
self.launchSurvey("test_currency")
# We fill in our answers
form_data = {
... | 0 | 0 | 0 | 3,151 | 0 | 0 | 0 | 50 | 45 |
6f4d3a6e07d543d13c0881bb6299e182863a87d1 | 13,008 | py | Python | backend/ventserver/protocols/server.py | raavilagoo/Test | e2de25cc4b6fcbffe3f98f4a7ce1644fa8b6bb16 | [
"Apache-2.0"
] | null | null | null | backend/ventserver/protocols/server.py | raavilagoo/Test | e2de25cc4b6fcbffe3f98f4a7ce1644fa8b6bb16 | [
"Apache-2.0"
] | null | null | null | backend/ventserver/protocols/server.py | raavilagoo/Test | e2de25cc4b6fcbffe3f98f4a7ce1644fa8b6bb16 | [
"Apache-2.0"
] | null | null | null | """Sans-I/O ventilator backend server protocol."""
from typing import Union, Tuple
from ventserver.protocols import backend
# Events
SendEvent = Union[backend.Announcement, backend.OutputEvent]
def make_serial_receive(
serial_receive: bytes,
time: float
) -> ReceiveEvent:
"""Make a Rec... | 33.099237 | 80 | 0.659978 | """Sans-I/O ventilator backend server protocol."""
from typing import Optional, Union, Tuple
import logging
import time as _time
import attr
from ventserver.protocols import backend
from ventserver.protocols import events
from ventserver.protocols import frontend
from ventserver.protocols import mcu
from ventserver.... | 0 | 11,485 | 0 | 0 | 0 | 0 | 0 | 144 | 427 |
e6333129d472fb03f1f709a1259c3babb9e72cb2 | 4,400 | py | Python | dev/evals.py | astrockragh/IceCube | eba09e9f9a3c351dbf05496821bcd7d29ac0261c | [
"MIT"
] | null | null | null | dev/evals.py | astrockragh/IceCube | eba09e9f9a3c351dbf05496821bcd7d29ac0261c | [
"MIT"
] | null | null | null | dev/evals.py | astrockragh/IceCube | eba09e9f9a3c351dbf05496821bcd7d29ac0261c | [
"MIT"
] | 2 | 2021-03-03T20:39:38.000Z | 2021-06-09T11:58:00.000Z | '''Module to make metrics for evaluating reco'''
import tensorflow as tf
sig=((tf.TensorSpec(shape=(None, 5), dtype=tf.float64, name=None),
tf.SparseTensorSpec(tf.TensorShape([None, None]), tf.float64),
tf.TensorSpec(shape=(None,), dtype=tf.int64, name=None)),
tf.TensorSpec(shape=(None, 6), dtype=tf.flo... | 46.808511 | 209 | 0.632955 | '''Module to make metrics for evaluating reco'''
import numpy as np
import matplotlib.pyplot as plt
import tensorflow_probability as tfp
import tensorflow as tf
def angle(pred, true):
pred, true=tf.cast(pred, tf.float32), tf.cast(true, tf.float32)
return tf.math.acos(
tf.clip_by_value(
... | 0 | 0 | 0 | 0 | 0 | 3,817 | 0 | 22 | 224 |
9f6cb68ccb70d3fbbcb73bb54d2a17ac2b0176cb | 706 | py | Python | PYTHON/stack.py | shiningflash/Advance-Data-Structure | 87f1813c5bcfb2ad77b8f1f2d8f0259d3f87371a | [
"MIT"
] | 3 | 2020-11-09T18:36:48.000Z | 2020-12-31T03:51:08.000Z | PYTHON/stack.py | shiningflash/data-structure | 87f1813c5bcfb2ad77b8f1f2d8f0259d3f87371a | [
"MIT"
] | null | null | null | PYTHON/stack.py | shiningflash/data-structure | 87f1813c5bcfb2ad77b8f1f2d8f0259d3f87371a | [
"MIT"
] | 3 | 2020-10-11T19:13:56.000Z | 2021-06-20T19:01:04.000Z |
if __name__ == '__main__':
s = Stack()
print(s)
print(s.is_empty())
s.push(1)
s.push(2)
print(s)
s.push(3)
print(s)
print(s.top())
print(s.pop())
print(s)
"""
[]
True
[1, 2]
[1, 2, 3]
3
3
[1, 2]
""" | 15.688889 | 37 | 0.490085 | class Stack:
def __init__(self):
self.items = []
def is_empty(self):
# return len(self.items) == 0
return not self.items
def push(self, item):
self.items.append(item)
def pop(self):
return self.items.pop()
def top(self):
ret... | 0 | 0 | 0 | 432 | 0 | 0 | 0 | 0 | 22 |
5e8766f199a76d5f61165aff99ba7d6c204fcf47 | 7,675 | py | Python | dnppy/landsat/atsat_bright_temp.py | NASA-DEVELOP/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 65 | 2015-09-10T12:59:56.000Z | 2022-02-27T22:09:03.000Z | dnppy/landsat/atsat_bright_temp.py | snowzm/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 40 | 2015-04-08T19:23:30.000Z | 2015-08-04T15:53:11.000Z | dnppy/landsat/atsat_bright_temp.py | snowzm/dnppy | 8f7ef6f0653f5a4ea730ee557c72a2c89c06ce0b | [
"NASA-1.3"
] | 45 | 2015-08-14T19:09:38.000Z | 2022-02-15T18:53:16.000Z |
#standard imports
import arcpy
import os
from dnppy import core
from landsat_metadata import landsat_metadata
if arcpy.CheckExtension('Spatial')=='Available':
arcpy.CheckOutExtension('Spatial')
arcpy.env.overwriteOutput = True
__all__=['atsat_bright_temp_8', # complete
'atsat_bright_temp_457'] ... | 41.042781 | 107 | 0.658893 |
#standard imports
import arcpy
import os
from dnppy import core
from landsat_metadata import landsat_metadata
if arcpy.CheckExtension('Spatial')=='Available':
arcpy.CheckOutExtension('Spatial')
arcpy.env.overwriteOutput = True
__all__=['atsat_bright_temp_8', # complete
'atsat_bright_temp_457'] ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f6ed7954829d0c833b7ffebb733cfc9cfe3e0834 | 865 | py | Python | feature-detection/face-detection.py | woosal1337/cv2 | cae4ad1e3ba4259507acde4db74559a726b09281 | [
"MIT"
] | 39 | 2021-11-08T13:35:10.000Z | 2022-01-20T19:45:17.000Z | feature-detection/face-detection.py | woosal1337/cv2 | cae4ad1e3ba4259507acde4db74559a726b09281 | [
"MIT"
] | null | null | null | feature-detection/face-detection.py | woosal1337/cv2 | cae4ad1e3ba4259507acde4db74559a726b09281 | [
"MIT"
] | 2 | 2021-11-17T01:24:39.000Z | 2022-02-02T00:40:33.000Z | from cv2 import cv2
face_cascade = cv2.CascadeClassifier("../haarcascades/haarcascade_frontalface_default.xml")
cap = cv2.VideoCapture("../assets/video.mp4")
while True:
ret, frame = cap.read()
if ret:
frame = cv2.resize(frame, None, fx=1 / 2, fy=1 / 2, interpolation=cv2.INTER_AREA)
image_... | 26.212121 | 93 | 0.595376 | from cv2 import cv2
face_cascade = cv2.CascadeClassifier("../haarcascades/haarcascade_frontalface_default.xml")
cap = cv2.VideoCapture("../assets/video.mp4")
while True:
ret, frame = cap.read()
if ret:
frame = cv2.resize(frame, None, fx=1 / 2, fy=1 / 2, interpolation=cv2.INTER_AREA)
image_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2c75829b224a4cff2b5c1cf9866f9cfaaecfa60e | 619 | py | Python | problems/problem_63.py | jamesjiang52/Project-Euler | 38825a010066a283b96111c30f876dad1eda859f | [
"MIT"
] | null | null | null | problems/problem_63.py | jamesjiang52/Project-Euler | 38825a010066a283b96111c30f876dad1eda859f | [
"MIT"
] | null | null | null | problems/problem_63.py | jamesjiang52/Project-Euler | 38825a010066a283b96111c30f876dad1eda859f | [
"MIT"
] | null | null | null | if __name__ == '__main__':
import sys
sys.path.insert(0, 'C:\\Users\\James Jiang\\Documents\\Project Euler')
from progress import Progress
answers_list = ['dummy']
with open('C:\\Users\\James Jiang\\Documents\\Project Euler\\answers.txt') as answers:
for line in answers:
answers_list.append(int(lin... | 29.47619 | 86 | 0.638126 | if __name__ == '__main__':
import sys
sys.path.insert(0, 'C:\\Users\\James Jiang\\Documents\\Project Euler')
from progress import Progress
answers_list = ['dummy']
with open('C:\\Users\\James Jiang\\Documents\\Project Euler\\answers.txt') as answers:
for line in answers:
answers_list.append(int(lin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e84a6df0f62b99ce8ca9c24577dc72da81d4ba85 | 12,906 | py | Python | UserInput.py | SebastianRuffert/JUMP | afb65c24acd3cc50fffacdf17dd1a7712811d55b | [
"MIT"
] | null | null | null | UserInput.py | SebastianRuffert/JUMP | afb65c24acd3cc50fffacdf17dd1a7712811d55b | [
"MIT"
] | null | null | null | UserInput.py | SebastianRuffert/JUMP | afb65c24acd3cc50fffacdf17dd1a7712811d55b | [
"MIT"
] | null | null | null | __author__ = 'Justin Scholz'
__copyright__ = "Copyright 2015 - 2017, Justin Scholz"
def recognize_user_input(user_choice: str, possibilities: [], default_answer=None):
"""
:param default_answer: the default answer that is returned if user just hits enter
:param user_choice: what the user entered
:p... | 46.258065 | 126 | 0.621726 | __author__ = 'Justin Scholz'
__copyright__ = "Copyright 2015 - 2017, Justin Scholz"
def recognize_user_input_yes_or_no(user_choice: str, default: bool):
user_input_understood = False
yes = str
no = str
user_choice_answer = "x"
if default:
yes = ""
no = "no"
elif not default:
... | 0 | 0 | 0 | 0 | 0 | 2,110 | 0 | 0 | 115 |
5045df5217a708a3d716ab05350e08dc818bbdcc | 1,857 | py | Python | sleep_tracker.py | lsun20/chronodexpy | 828ccc79de2915231bfa0b04f38bd688f386ee25 | [
"MIT"
] | 9 | 2019-11-11T19:32:16.000Z | 2022-01-26T05:15:17.000Z | sleep_tracker.py | lsun20/chronodexpy | 828ccc79de2915231bfa0b04f38bd688f386ee25 | [
"MIT"
] | null | null | null | sleep_tracker.py | lsun20/chronodexpy | 828ccc79de2915231bfa0b04f38bd688f386ee25 | [
"MIT"
] | 1 | 2020-03-28T17:15:40.000Z | 2020-03-28T17:15:40.000Z | import matplotlib.pyplot as plt
import os
import matplotlib.dates as mdates
from datetime import datetime
# read in timetable
dates = []
sleep = []
for file in os.listdir("./data"):
if file.endswith(".txt"):
dates.append(file.rstrip('.txt'))
with open(str('./data/'+file), "r") as filestream:
... | 33.160714 | 80 | 0.576737 | import matplotlib.pyplot as plt
import numpy as np
import os
import matplotlib.dates as mdates
from datetime import datetime
# read in timetable
dates = []
sleep = []
for file in os.listdir("./data"):
if file.endswith(".txt"):
dates.append(file.rstrip('.txt'))
with open(str('./data/'+file), "r") ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
e774e535ece9d0e2fde5785451b94e745db6bcdd | 7,361 | py | Python | library/pyjamas/HTTPRequest.py | certik/pyjamas | 5bb72e63e50f09743ac986f4c9690ba50c499ba9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-09-19T09:14:16.000Z | 2018-09-19T09:14:16.000Z | library/pyjamas/HTTPRequest.py | emk/pyjamas | d7633919d1ec9cd4a36675e356c7e5de71ac2a67 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | library/pyjamas/HTTPRequest.py | emk/pyjamas | d7633919d1ec9cd4a36675e356c7e5de71ac2a67 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-08-13T20:32:25.000Z | 2019-08-13T20:32:25.000Z | # This is the gtk-dependent HTTPRequest module.
# For the pyjamas/javascript version, see platform/HTTPRequestPyJS.py
import sys
if sys.platform not in ['mozilla', 'ie6', 'opera', 'oldmoz', 'safari']:
handlers = {}
| 39.154255 | 101 | 0.57859 | # This is the gtk-dependent HTTPRequest module.
# For the pyjamas/javascript version, see platform/HTTPRequestPyJS.py
import sys
import pygwt
from __pyjamas__ import JS
if sys.platform not in ['mozilla', 'ie6', 'opera', 'oldmoz', 'safari']:
from __pyjamas__ import get_main_frame
import pyjd
handlers = {}
cla... | 0 | 0 | 0 | 6,997 | 0 | 0 | 0 | 3 | 142 |
0e348e145324d34335dd9da51aaf32684646bb95 | 3,589 | py | Python | snipsmopidy/snipsmopidy.py | mihanich/snips-skill-mopidy | ac425b4ef0ece49c321b8d9dc97bb400b050fce0 | [
"MIT"
] | 1 | 2018-06-28T16:16:43.000Z | 2018-06-28T16:16:43.000Z | snipsmopidy/snipsmopidy.py | mihanich/snips-skill-mopidy | ac425b4ef0ece49c321b8d9dc97bb400b050fce0 | [
"MIT"
] | 1 | 2018-03-26T14:55:14.000Z | 2018-03-28T01:33:01.000Z | snipsmopidy/snipsmopidy.py | mihanich/snips-skill-mopidy | ac425b4ef0ece49c321b8d9dc97bb400b050fce0 | [
"MIT"
] | 5 | 2018-03-25T10:49:48.000Z | 2019-03-26T20:48:49.000Z | # -*-: coding utf-8 -*-
""" Mopidy skill for Snips. """
from __future__ import unicode_literals
GAIN = 4
| 30.159664 | 82 | 0.608526 | # -*-: coding utf-8 -*-
""" Mopidy skill for Snips. """
from __future__ import unicode_literals
from mopidyclient import MopidyClient
GAIN = 4
class SnipsMopidy:
"""Mopidy skill for Snips.
:param mopidy_host: The hostname of the Mopidy http server
"""
def __init__(self, mopidy_host='127.0.0.1', l... | 0 | 0 | 0 | 3,418 | 0 | 0 | 0 | 16 | 46 |
b62347b25f3df66e2bdca1ca1249e6afc15f56ca | 6,806 | py | Python | okl4_kernel/okl4_2.1.1-patch.9/tools/pyelf/elf/util.py | CyberQueenMara/baseband-research | e1605537e10c37e161fff1a3416b908c9894f204 | [
"MIT"
] | 77 | 2018-12-31T22:12:09.000Z | 2021-12-31T22:56:13.000Z | okl4_kernel/okl4_2.1.1-patch.9/tools/pyelf/elf/util.py | CyberQueenMara/baseband-research | e1605537e10c37e161fff1a3416b908c9894f204 | [
"MIT"
] | null | null | null | okl4_kernel/okl4_2.1.1-patch.9/tools/pyelf/elf/util.py | CyberQueenMara/baseband-research | e1605537e10c37e161fff1a3416b908c9894f204 | [
"MIT"
] | 24 | 2019-01-20T15:51:52.000Z | 2021-12-25T18:29:13.000Z | ##############################################################################
# Copyright (c) 2007 Open Kernel Labs, Inc. (Copyright Holder).
# All rights reserved.
#
# 1. Redistribution and use of OKL4 (Software) in source and binary
# forms, with or without modification, are permitted provided that the
# following ... | 41.248485 | 78 | 0.682192 | ##############################################################################
# Copyright (c) 2007 Open Kernel Labs, Inc. (Copyright Holder).
# All rights reserved.
#
# 1. Redistribution and use of OKL4 (Software) in source and binary
# forms, with or without modification, are permitted provided that the
# following ... | 0 | 0 | 0 | 2,920 | 0 | 0 | 0 | 0 | 115 |
81709a84502a9df5fc20f568d06fb946c97408e6 | 588 | py | Python | python/pyglet/text_draw.py | initrunlevel0/sns | 9736a43ad305ca5973de28ef7101d4fe30dd3e74 | [
"MIT"
] | null | null | null | python/pyglet/text_draw.py | initrunlevel0/sns | 9736a43ad305ca5973de28ef7101d4fe30dd3e74 | [
"MIT"
] | null | null | null | python/pyglet/text_draw.py | initrunlevel0/sns | 9736a43ad305ca5973de28ef7101d4fe30dd3e74 | [
"MIT"
] | null | null | null | import pyglet
window = pyglet.window.Window()
label = pyglet.text.Label('Hello, world',
font_name='Times New Roman',
font_size=36,
x=window.width//2, y=window.height//2,
anchor_x='center', anchor_y='center')
pyglet.... | 25.565217 | 64 | 0.54932 | import pyglet
from pyglet.gl import *
window = pyglet.window.Window()
label = pyglet.text.Label('Hello, world',
font_name='Times New Roman',
font_size=36,
x=window.width//2, y=window.height//2,
anchor_x='center', an... | 0 | 211 | 0 | 0 | 0 | 0 | 0 | 2 | 45 |
df960ee530b8b03aac5bac59ed6b0dc64feb24d1 | 2,150 | py | Python | CommandTestDetector.py | evertonscoelho/SpaceCode-Reconhecimento | 5c1874e10e07423784f9a97da2a52c76910a2c68 | [
"BSD-3-Clause"
] | null | null | null | CommandTestDetector.py | evertonscoelho/SpaceCode-Reconhecimento | 5c1874e10e07423784f9a97da2a52c76910a2c68 | [
"BSD-3-Clause"
] | null | null | null | CommandTestDetector.py | evertonscoelho/SpaceCode-Reconhecimento | 5c1874e10e07423784f9a97da2a52c76910a2c68 | [
"BSD-3-Clause"
] | null | null | null | import cv2
import time
import os
import Command
path = os.path.dirname(os.path.abspath(__file__))
pathTeste = path+"/test/"
arqTestInput = open(pathTeste+"testInput.txt", 'r')
textTestInput = arqTestInput.readlines()
for folder in textTestInput:
splitFolder = folder.split(",")
nameFolder = splitFolder... | 36.440678 | 165 | 0.679535 | import cv2
import numpy as np
import time
import os
import Command
path = os.path.dirname(os.path.abspath(__file__))
pathTeste = path+"/test/"
arqTestInput = open(pathTeste+"testInput.txt", 'r')
textTestInput = arqTestInput.readlines()
for folder in textTestInput:
splitFolder = folder.split(",")
name... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 23 |
5814db0ff4fa24f9ddaf2ddd15d996da1407b2ad | 2,519 | py | Python | lolbot.py | aule/fullmoon | 808d96d1a01921acec4b1357e29c4976853adce4 | [
"BSD-3-Clause"
] | null | null | null | lolbot.py | aule/fullmoon | 808d96d1a01921acec4b1357e29c4976853adce4 | [
"BSD-3-Clause"
] | null | null | null | lolbot.py | aule/fullmoon | 808d96d1a01921acec4b1357e29c4976853adce4 | [
"BSD-3-Clause"
] | null | null | null |
HOST = ""
PORT = 6667
DEBUG_FLAG = False
| 27.086022 | 131 | 0.476776 | import sys
import socket
import string
import re
HOST = ""
PORT = 6667
DEBUG_FLAG = False
class Bot(object):
class BadBot(Exception):
pass
linegrep = re.compile(
r"(:((?P<user>\S+)!)?(?P<address>\S+)\s+)?(?P<command>\S+)\s*(?P<params>((?<=\s)[^:\s]\S*\s*)*)((?<=\s):(?P<tail>[^\r]*))?"
)... | 0 | 0 | 0 | 2,403 | 0 | 0 | 0 | -39 | 111 |
8a5651f2020dab4ead46419b25f56cf5455b2cfa | 3,902 | py | Python | wrappers/python_2-7/launcher.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | wrappers/python_2-7/launcher.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | wrappers/python_2-7/launcher.py | UpperLEFTY/worldpay-within-sdk | 5651b9b4be08faa83ba46735b2ce14d5fcbb515f | [
"MIT"
] | null | null | null | #!/usr/bin/python
## Python Launcher
| 33.637931 | 162 | 0.606612 | #!/usr/bin/python
## Python Launcher
import platform
import sys
from subprocess import call
import subprocess
import logging
class Config(object):
def __init__(self, requiredOSs, requiredArchs):
self.requiredOSs = requiredOSs
self.requiredArchs = requiredArchs
# Arch can be { 'arm', 'ia32',... | 0 | 0 | 0 | 3,719 | 0 | 0 | 0 | -22 | 156 |
94772accd54dbb41e49587bef892a2d0d6fb8f76 | 456 | py | Python | src/train.py | PVirie/aknowthai | 922ab4a7a5c799e67073d36a5366daac76beda43 | [
"MIT"
] | 9 | 2016-11-16T14:25:23.000Z | 2021-06-10T15:40:40.000Z | src/train.py | PVirie/aknowthai | 922ab4a7a5c799e67073d36a5366daac76beda43 | [
"MIT"
] | null | null | null | src/train.py | PVirie/aknowthai | 922ab4a7a5c799e67073d36a5366daac76beda43 | [
"MIT"
] | 2 | 2019-05-23T09:15:42.000Z | 2020-04-27T03:10:00.000Z | import gen
import network as ann
words, imgs = gen.get_tuples(range(100, 10100))
word_mat, img_mat = gen.prepare_input_tensors(words, imgs)
print "Input images >>", img_mat.shape
print "Input labels >>", word_mat.shape
nn = ann.Network([100, img_mat.shape[1], img_mat.shape[2]], word_mat.shape, gen.get_default_total... | 35.076923 | 121 | 0.752193 | import gen
import network as ann
words, imgs = gen.get_tuples(range(100, 10100))
word_mat, img_mat = gen.prepare_input_tensors(words, imgs)
print "Input images >>", img_mat.shape
print "Input labels >>", word_mat.shape
nn = ann.Network([100, img_mat.shape[1], img_mat.shape[2]], word_mat.shape, gen.get_default_total... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
368ad90c779cfebcf639bd33b3bc81f22dc66d52 | 2,597 | py | Python | src/year_2021/day_3/puzzle.py | saiyalamarty/advent-of-code | e3ef525d06859515451d5ac7125004536d8ef985 | [
"MIT"
] | null | null | null | src/year_2021/day_3/puzzle.py | saiyalamarty/advent-of-code | e3ef525d06859515451d5ac7125004536d8ef985 | [
"MIT"
] | null | null | null | src/year_2021/day_3/puzzle.py | saiyalamarty/advent-of-code | e3ef525d06859515451d5ac7125004536d8ef985 | [
"MIT"
] | null | null | null | """Advent of Code 2021 - Day 3"""
import statistics
def filter_numbers(numbers: list[str], position: int, value: str) -> list[str]:
"""
Filters the list of numbers based on the bit value at a given position
:param numbers: List of numbers as strings
:param position: The bit position to check
... | 22.582609 | 79 | 0.618406 | """Advent of Code 2021 - Day 3"""
import os
import statistics
from copy import deepcopy
def main():
# Read contents of input (as a file) with a context manager
file_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), 'input.data')
)
with open(file_path, "r") as input_file:
... | 0 | 0 | 0 | 0 | 0 | 1,280 | 0 | -8 | 114 |
92c0859ed2de31e353af4f789b76813e50e48747 | 359 | py | Python | src/aapns/config.py | michaelaw320/aapns | 84ce5774b85ac7e17497711da38ef8a29dff5ee8 | [
"Apache-2.0"
] | 6 | 2017-05-15T08:01:35.000Z | 2019-09-20T08:03:28.000Z | src/aapns/config.py | michaelaw320/aapns | 84ce5774b85ac7e17497711da38ef8a29dff5ee8 | [
"Apache-2.0"
] | 20 | 2019-09-25T05:18:57.000Z | 2020-11-02T01:16:27.000Z | src/aapns/config.py | HDE/aapns | 84ce5774b85ac7e17497711da38ef8a29dff5ee8 | [
"Apache-2.0"
] | 2 | 2020-08-02T21:44:27.000Z | 2022-01-25T09:03:49.000Z |
PRODUCTION_HOST = "api.push.apple.com"
SANDBOX_HOST = "api.development.push.apple.com"
DEFAULT_PORT = 443
ALT_PORT = 2197
MAX_NOTIFICATION_PAYLOAD_SIZE_VOIP = 5120
MAX_NOTIFICATION_PAYLOAD_SIZE_OTHER = 4096
| 18.894737 | 50 | 0.743733 | from enum import Enum
class Priority(Enum):
"""
Enum defining the priority of the notification
"""
immediately = 10
normal = 5
PRODUCTION_HOST = "api.push.apple.com"
SANDBOX_HOST = "api.development.push.apple.com"
DEFAULT_PORT = 443
ALT_PORT = 2197
MAX_NOTIFICATION_PAYLOAD_SIZE_VOIP = 5120
MAX_... | 0 | 0 | 0 | 104 | 0 | 0 | 0 | 0 | 45 |
82d17f2054e7b6850c024f8a3fb99b970dc5d47a | 3,760 | py | Python | tests/test_many_to_many.py | 5thsymphony/sqlalchemy-to-ormar | 9b732739355c39e2d5237af7cb4c1aa15e7f356f | [
"MIT"
] | 5 | 2021-04-10T13:01:11.000Z | 2021-08-02T21:28:37.000Z | tests/test_many_to_many.py | 5thsymphony/sqlalchemy-to-ormar | 9b732739355c39e2d5237af7cb4c1aa15e7f356f | [
"MIT"
] | 1 | 2021-04-29T17:22:10.000Z | 2021-05-03T16:40:40.000Z | tests/test_many_to_many.py | 5thsymphony/sqlalchemy-to-ormar | 9b732739355c39e2d5237af7cb4c1aa15e7f356f | [
"MIT"
] | 1 | 2022-02-02T20:27:24.000Z | 2022-02-02T20:27:24.000Z | from databases import Database
from sqlalchemy import (Column, ForeignKey, Integer, MetaData, Table, create_engine)
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
Database_URL = "sqlite:///test.db"
engine = create_engine(Database_URL)
database = Database(Database_URL)
metadata = Met... | 32.695652 | 87 | 0.696543 | import pytest
from databases import Database
from sqlalchemy import (
Column,
ForeignKey,
Integer,
MetaData,
String,
Table,
create_engine,
)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy_to_ormar import ormar_model_str_repr, ... | 0 | 984 | 0 | 543 | 0 | 1,350 | 0 | 101 | 182 |
0d6a13710253e6cea37d42e8ad242eb10d247fac | 1,919 | py | Python | python/rikai/internal/reflection.py | askintution/rikai | 53a72a19beafc4097a816efb9cddd063e107e67a | [
"Apache-2.0"
] | 1 | 2022-02-18T07:53:29.000Z | 2022-02-18T07:53:29.000Z | python/rikai/internal/reflection.py | askintution/rikai | 53a72a19beafc4097a816efb9cddd063e107e67a | [
"Apache-2.0"
] | null | null | null | python/rikai/internal/reflection.py | askintution/rikai | 53a72a19beafc4097a816efb9cddd063e107e67a | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Rikai Authors
#
# 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... | 31.983333 | 76 | 0.659719 | # Copyright 2021 Rikai Authors
#
# 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... | 0 | 0 | 0 | 0 | 0 | 126 | 0 | 0 | 23 |
52ddfd988bb4596bf51a1096bdfbb4c4c176323a | 7,181 | py | Python | mapproxy/test/helper.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | mapproxy/test/helper.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | mapproxy/test/helper.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | 31.221739 | 89 | 0.617323 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | 0 | 816 | 0 | 3,696 | 0 | 1,055 | 0 | 27 | 362 |
46081e6da1d5842bd8ab3307236398b766956429 | 3,507 | py | Python | fidesctl/src/fidesctl/core/generate_dataset.py | landunexplored/fides | 2195445cd4eea7a19233fb99b18340c78ba12164 | [
"Apache-2.0"
] | null | null | null | fidesctl/src/fidesctl/core/generate_dataset.py | landunexplored/fides | 2195445cd4eea7a19233fb99b18340c78ba12164 | [
"Apache-2.0"
] | null | null | null | fidesctl/src/fidesctl/core/generate_dataset.py | landunexplored/fides | 2195445cd4eea7a19233fb99b18340c78ba12164 | [
"Apache-2.0"
] | null | null | null | """Module that generates valid dataset manifest files from various data sources."""
from typing import Dict, List
import sqlalchemy
from sqlalchemy.engine import Engine
from fideslang import manifests
from fideslang.models import Dataset, DatasetCollection, DatasetField
from .utils import get_db_engine, echo_green
... | 34.722772 | 94 | 0.626747 | """Module that generates valid dataset manifest files from various data sources."""
from typing import Dict, List
import sqlalchemy
from sqlalchemy.engine import Engine
from fideslang import manifests
from fideslang.models import Dataset, DatasetCollection, DatasetField
from .utils import get_db_engine, echo_green
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee715b6ce8da6364145bed59bcaa63a640d4fadb | 6,531 | py | Python | eto/fluent/jobs.py | eto-ai/etosdk | 77d21e49a0781d58e7292854cf9d6efff67e0a1e | [
"Apache-2.0"
] | 9 | 2021-12-14T04:05:30.000Z | 2022-01-05T20:41:43.000Z | eto/fluent/jobs.py | eto-ai/etosdk | 77d21e49a0781d58e7292854cf9d6efff67e0a1e | [
"Apache-2.0"
] | 7 | 2021-12-14T00:20:41.000Z | 2022-02-19T19:37:17.000Z | eto/fluent/jobs.py | eto-ai/etosdk | 77d21e49a0781d58e7292854cf9d6efff67e0a1e | [
"Apache-2.0"
] | null | null | null | """Eto SDK fluent API for managing jobs"""
import time
from typing import Iterable, Union
import pandas as pd
from eto._internal.model.job import Job
from eto.connectors.coco import CocoConnector, CocoSource
from eto.connectors.rikai import RikaiConnector
from eto.fluent.client import get_api
def ingest_coco(
da... | 33.152284 | 117 | 0.647527 | """Eto SDK fluent API for managing jobs"""
import time
from typing import Iterable, Union
import pandas as pd
from eto._internal.model.dataset_details import DatasetDetails
from eto._internal.model.job import Job
from eto.connectors.coco import CocoConnector, CocoSource
from eto.connectors.rikai import RikaiConnector... | 0 | 0 | 0 | 0 | 0 | 1,133 | 0 | 41 | 69 |
01b627a0693331274e6003f99e0cec9ca8472b38 | 46 | py | Python | aerosandbox/geometry/airfoil/airfoil_database/__init__.py | scivm/AeroSandbox | 616c579e49bc13c3023364773705eaac7df10da7 | [
"MIT"
] | 1 | 2021-04-07T08:59:31.000Z | 2021-04-07T08:59:31.000Z | aerosandbox/geometry/airfoil/airfoil_database/__init__.py | scivm/AeroSandbox | 616c579e49bc13c3023364773705eaac7df10da7 | [
"MIT"
] | null | null | null | aerosandbox/geometry/airfoil/airfoil_database/__init__.py | scivm/AeroSandbox | 616c579e49bc13c3023364773705eaac7df10da7 | [
"MIT"
] | 1 | 2021-09-11T03:28:45.000Z | 2021-09-11T03:28:45.000Z | # Just so this appears as an importable module | 46 | 46 | 0.804348 | # Just so this appears as an importable module | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6fbc7d07cf6b1dd0f2547443564c84bf88dce2a1 | 2,946 | py | Python | vedacore/hooks/logger.py | jie311/vedadet | aaf3b3bc3c7944aba1cc28138165d403023a9152 | [
"Apache-2.0"
] | 424 | 2020-10-19T03:56:49.000Z | 2022-03-28T02:47:39.000Z | vedacore/hooks/logger.py | jie311/vedadet | aaf3b3bc3c7944aba1cc28138165d403023a9152 | [
"Apache-2.0"
] | 72 | 2020-11-27T17:10:00.000Z | 2022-03-17T02:40:53.000Z | vedacore/hooks/logger.py | jie311/vedadet | aaf3b3bc3c7944aba1cc28138165d403023a9152 | [
"Apache-2.0"
] | 116 | 2020-11-03T02:31:17.000Z | 2022-03-08T08:20:48.000Z | # adapted from https://github.com/open-mmlab/mmcv or
# https://github.com/open-mmlab/mmdetection
| 32.373626 | 77 | 0.553971 | # adapted from https://github.com/open-mmlab/mmcv or
# https://github.com/open-mmlab/mmdetection
from collections import OrderedDict
from vedacore.misc import registry
from .base_hook import BaseHook
@registry.register_module('hook')
class LoggerHook(BaseHook):
def __init__(self, interval=1, by_epoch=True):
... | 0 | 2,721 | 0 | 0 | 0 | 0 | 0 | 37 | 90 |
778d64c8fcaafcba774f308d0852767335b61181 | 1,138 | py | Python | test.py | karthik540/BeatSite | 9bfbae9add93d25c151eeebe85dee294b1ea2e44 | [
"MIT"
] | 2 | 2019-05-30T12:24:45.000Z | 2021-06-14T02:35:39.000Z | test.py | karthik540/BeatSite | 9bfbae9add93d25c151eeebe85dee294b1ea2e44 | [
"MIT"
] | null | null | null | test.py | karthik540/BeatSite | 9bfbae9add93d25c151eeebe85dee294b1ea2e44 | [
"MIT"
] | null | null | null | from flask import Flask
app = Flask(__name__)
# Set the secret key to some random bytes. Keep this really secret!
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
if __name__ == "__main__":
app.run(debug= True)
| 25.863636 | 86 | 0.605448 | from flask import Flask, session, redirect, url_for, escape, request , render_template
app = Flask(__name__)
# Set the secret key to some random bytes. Keep this really secret!
app.secret_key = b'_5#y2L"F4Q8z\n\xec]/'
@app.route('/')
def index():
session['username'] = "asd"
if 'username' in session:
data = {
... | 0 | 796 | 0 | 0 | 0 | 0 | 0 | 63 | 69 |
ed18fcd8fcdfc6420f5485c386ae37e6d73aad54 | 824 | py | Python | path-sum-ii/path-sum-ii.py | rams1996/Trees | b7d6a92ed76a9e4d01bfe7f85debb7ca2b350ac9 | [
"MIT"
] | null | null | null | path-sum-ii/path-sum-ii.py | rams1996/Trees | b7d6a92ed76a9e4d01bfe7f85debb7ca2b350ac9 | [
"MIT"
] | null | null | null | path-sum-ii/path-sum-ii.py | rams1996/Trees | b7d6a92ed76a9e4d01bfe7f85debb7ca2b350ac9 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
| 28.413793 | 72 | 0.504854 | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def pathSum(self, root: TreeNode, sum: int) -> List[List[int]]:
result=[]
def helper(root,total,tempLi... | 255 | 0 | 0 | 505 | 0 | 0 | 0 | 0 | 23 |
b988fedeb92e2d25711a9d024b5260fb52eb4398 | 923 | py | Python | Node/Bluetooth_to_broker.py | ICLab41208/MQTT-bluetooth-Node | 28b4574015fa60f2856bc77063808abf9c6f5f14 | [
"MIT"
] | null | null | null | Node/Bluetooth_to_broker.py | ICLab41208/MQTT-bluetooth-Node | 28b4574015fa60f2856bc77063808abf9c6f5f14 | [
"MIT"
] | null | null | null | Node/Bluetooth_to_broker.py | ICLab41208/MQTT-bluetooth-Node | 28b4574015fa60f2856bc77063808abf9c6f5f14 | [
"MIT"
] | null | null | null | import time
import Adafruit_DHT
import bluetooth
bd_addr = "DC:A6:32:37:EE:FC" # Server bluetooth address
port = 1
sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect((bd_addr, port))
DHT_SENSOR = Adafruit_DHT.DHT11
DHT_PIN = 4
while True:
humidity, temperature = Adafruit_DHT.read_retry(DHT_SENSOR,... | 27.147059 | 97 | 0.576381 | import time
import Adafruit_DHT
import bluetooth
import sys
bd_addr = "DC:A6:32:37:EE:FC" # Server bluetooth address
port = 1
sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )
sock.connect((bd_addr, port))
DHT_SENSOR = Adafruit_DHT.DHT11
DHT_PIN = 4
while True:
humidity, temperature = Adafruit_DHT.read_retry(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
0a222c85a5636dccad27221867b995dfebca2a43 | 13,654 | py | Python | spec/spec_ftypes.py | localmed/flowp | 034130017ba64f14a1c3eeeebe506039b653931a | [
"BSD-3-Clause"
] | null | null | null | spec/spec_ftypes.py | localmed/flowp | 034130017ba64f14a1c3eeeebe506039b653931a | [
"BSD-3-Clause"
] | null | null | null | spec/spec_ftypes.py | localmed/flowp | 034130017ba64f14a1c3eeeebe506039b653931a | [
"BSD-3-Clause"
] | null | null | null |
################# CORE #################
############### ADAPTERS ###############
############## CONVERTERS ##############
########### OTHER STRUCTURES ###########
| 32.432304 | 85 | 0.598213 | from unittest import mock
from flowp import ftypes
import types
class Behavior:
pass
class expect:
pass
def when(*args):
pass
################# CORE #################
class Ftypes(Behavior):
def it_have_object_interface(self):
ftypes.Object.type
ftypes.Object.iscallable
fty... | 0 | 41 | 0 | 13,067 | 0 | 4 | 0 | -2 | 365 |
0f1f323351281e8911069e5bcf24f51dfa4b42dc | 2,459 | py | Python | wisdem/test/test_commonse/test_frustum.py | johnjasa/WISDEM | a4571e71cb5b9869c81790f8abb1bb7fba8fdb02 | [
"Apache-2.0"
] | 81 | 2015-01-19T18:17:31.000Z | 2022-03-17T07:14:43.000Z | wisdem/test/test_commonse/test_frustum.py | johnjasa/WISDEM | a4571e71cb5b9869c81790f8abb1bb7fba8fdb02 | [
"Apache-2.0"
] | 159 | 2015-02-05T01:54:52.000Z | 2022-03-30T22:44:39.000Z | wisdem/test/test_commonse/test_frustum.py | johnjasa/WISDEM | a4571e71cb5b9869c81790f8abb1bb7fba8fdb02 | [
"Apache-2.0"
] | 70 | 2015-01-02T15:22:39.000Z | 2022-02-11T00:33:07.000Z | import unittest
import numpy as np
myones = np.ones((100,))
rb = 4.0
rt = 2.0
t = 0.1
h = 3.0
if __name__ == "__main__":
result = unittest.TextTestRunner().run(suite())
if result.wasSuccessful():
exit(0)
else:
exit(1)
| 37.830769 | 116 | 0.625458 | import unittest
import numpy as np
import numpy.testing as npt
import wisdem.commonse.frustum as f
from wisdem.commonse import eps
myones = np.ones((100,))
rb = 4.0
rt = 2.0
t = 0.1
h = 3.0
class TestFrustum(unittest.TestCase):
def testFrustumVol(self):
V = np.pi / 3 * h * (rb ** 2 + rt ** 2 + rb * rt)... | 0 | 0 | 0 | 1,972 | 0 | 92 | 0 | 30 | 112 |
700a1f13bef20aee623ecc8417388cbc1e33299f | 5,255 | py | Python | Schlaege.py | schliesserm/fnt | d5d5f6b2e769a21e87e53f98a9a5790adb5d0c0f | [
"MIT"
] | null | null | null | Schlaege.py | schliesserm/fnt | d5d5f6b2e769a21e87e53f98a9a5790adb5d0c0f | [
"MIT"
] | null | null | null | Schlaege.py | schliesserm/fnt | d5d5f6b2e769a21e87e53f98a9a5790adb5d0c0f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 13 22:46:41 2020
@author: D071127
"""
# encoding: utf-8
import platform
platform.architecture()
import sys
from psycopg2 import connect
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
con = None
con = connect(user='postgres', host='localhost'... | 37.805755 | 365 | 0.732445 | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 13 22:46:41 2020
@author: D071127
"""
# encoding: utf-8
import platform
platform.architecture()
import sys
from psycopg2 import connect
import sys
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
con = None
con = connect(user='postgres', host... | 56 | 0 | 0 | 0 | 0 | 246 | 0 | -9 | 73 |
2118efe8c27fd2b05499fee0cdd67a5973af6aaf | 4,796 | py | Python | wrappers/python/virgil_crypto_lib/foundation/_c_bridge/_vscf_seed_entropy_source.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 26 | 2018-12-17T13:45:25.000Z | 2022-01-16T20:00:04.000Z | wrappers/python/virgil_crypto_lib/foundation/_c_bridge/_vscf_seed_entropy_source.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 4 | 2019-01-03T12:08:52.000Z | 2021-12-02T05:21:13.000Z | wrappers/python/virgil_crypto_lib/foundation/_c_bridge/_vscf_seed_entropy_source.py | odidev/virgil-crypto-c | 3d5d5cb19fdcf81eab08cdc63647f040117ecbd8 | [
"BSD-3-Clause"
] | 8 | 2019-01-24T08:22:06.000Z | 2022-02-07T11:37:00.000Z | # Copyright (C) 2015-2021 Virgil Security, Inc.
#
# 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
# notice, this li... | 48.444444 | 121 | 0.775855 | # Copyright (C) 2015-2021 Virgil Security, Inc.
#
# 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
# notice, this li... | 0 | 0 | 0 | 2,922 | 0 | 0 | 0 | 103 | 157 |
335c8cf7254d39e7499c5dcb933e2a2509b027fd | 2,759 | py | Python | Chapter06/chapter6/linear_estimator.py | CrazyNicolas/PyTorch-1.x-Reinforcement-Learning-Cookbook | 614ee6055039e2b4f91fc762c6bc5c92aee3ee83 | [
"MIT"
] | 1 | 2020-06-11T07:41:35.000Z | 2020-06-11T07:41:35.000Z | Chapter06/chapter6/linear_estimator.py | AmazingDD/PyTorch-1.x-Reinforcement-Learning-Cookbook | 1cca7e0218c2683a730b1c4a66681e68023657ef | [
"MIT"
] | null | null | null | Chapter06/chapter6/linear_estimator.py | AmazingDD/PyTorch-1.x-Reinforcement-Learning-Cookbook | 1cca7e0218c2683a730b1c4a66681e68023657ef | [
"MIT"
] | 1 | 2020-07-20T16:20:41.000Z | 2020-07-20T16:20:41.000Z | '''
Source codes for PyTorch 1.0 Reinforcement Learning (Packt Publishing)
Chapter 6: Scaling up Learning with Function Approximation
Author: Yuxi (Hayden) Liu
'''
if __name__ == "__main__":
estimator = Estimator(10, 2, 1)
s1 = [0.5, 0.1]
print(estimator.get_feature(s1))
s_list = [[1, 2], [2, 2], ... | 29.351064 | 82 | 0.594056 | '''
Source codes for PyTorch 1.0 Reinforcement Learning (Packt Publishing)
Chapter 6: Scaling up Learning with Function Approximation
Author: Yuxi (Hayden) Liu
'''
import torch
from torch.autograd import Variable
import math
class Estimator():
def __init__(self, n_feat, n_state, n_action, lr=0.05):
self.... | 0 | 0 | 0 | 2,083 | 0 | 0 | 0 | -5 | 90 |
5f6ddc994f2f4dfdc7d6c8652bdc1e7e290743d4 | 3,924 | py | Python | main.py | adriapr/crowdairway | 4b67425c5733e931b18c7b6113d72ad0e3c42f47 | [
"MIT"
] | null | null | null | main.py | adriapr/crowdairway | 4b67425c5733e931b18c7b6113d72ad0e3c42f47 | [
"MIT"
] | 1 | 2020-05-26T09:30:08.000Z | 2020-05-26T09:30:09.000Z | main.py | adriapr/crowdairway | 4b67425c5733e931b18c7b6113d72ad0e3c42f47 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Main script for reproducing results of the paper "Crowdsourcing Airway Segmentation"
Authors: Veronika Cheplygina, Adria Perez-Rovira
URL: https://github.com/adriapr/crowdairway
"""
import data as crowddata
import analysis as crowdanalysis
import figures as crowdfigures
import tables as ... | 33.254237 | 139 | 0.737768 | # -*- coding: utf-8 -*-
"""
Main script for reproducing results of the paper "Crowdsourcing Airway Segmentation"
Authors: Veronika Cheplygina, Adria Perez-Rovira
URL: https://github.com/adriapr/crowdairway
"""
import data as crowddata
import analysis as crowdanalysis
import figures as crowdfigures
import tables as ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59ae7155cac84ac306d5158373691295f5bd082a | 6,576 | py | Python | flask_app/backend_jobs/recognition_pipeline/pipeline_lib/firestore_database.py | googleinterns/ellipsis-step-internship | a3ada4f34f0c903fc543103398246469e5716769 | [
"Apache-2.0"
] | 4 | 2020-08-17T08:47:59.000Z | 2020-12-14T08:57:15.000Z | flask_app/backend_jobs/recognition_pipeline/pipeline_lib/firestore_database.py | googleinterns/ellipsis-step-internship | a3ada4f34f0c903fc543103398246469e5716769 | [
"Apache-2.0"
] | 11 | 2020-08-25T14:27:59.000Z | 2021-02-17T12:35:03.000Z | flask_app/backend_jobs/recognition_pipeline/pipeline_lib/firestore_database.py | googleinterns/ellipsis-step-internship | a3ada4f34f0c903fc543103398246469e5716769 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | 46.309859 | 100 | 0.676247 | """
Copyright 2020 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | 0 | 0 | 0 | 5,484 | 0 | 0 | 0 | 142 | 155 |
d44a24ac90ce2944740c39d3659adc20ce19066c | 3,121 | py | Python | src/ralph_scrooge/tests/plugins/cost/test_support.py | ar4s/ralph_pricing | 40127e9450edc91ba0be725d63bf691dde16a137 | [
"Apache-2.0"
] | 4 | 2016-05-06T19:28:53.000Z | 2018-01-26T21:13:40.000Z | src/ralph_scrooge/tests/plugins/cost/test_support.py | ar4s/ralph_pricing | 40127e9450edc91ba0be725d63bf691dde16a137 | [
"Apache-2.0"
] | 283 | 2015-01-07T15:06:34.000Z | 2019-08-08T10:43:47.000Z | src/ralph_scrooge/tests/plugins/cost/test_support.py | ar4s/ralph_pricing | 40127e9450edc91ba0be725d63bf691dde16a137 | [
"Apache-2.0"
] | 16 | 2015-01-27T10:33:20.000Z | 2020-06-25T07:04:21.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
| 32.852632 | 72 | 0.53124 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from datetime import date
from decimal import Decimal as D
from ralph_scrooge import models
from ralph_scrooge.plugins.cost.support import Suppo... | 0 | 0 | 0 | 2,653 | 0 | 0 | 0 | 136 | 157 |
4377becb5592e3e2c47083bd8c60e4cde469b48d | 116 | py | Python | matplotlib/1.py | MiracleWong/PythonBasic | cb8ec59dc646842b41966ea4ea4b1ee66a342eee | [
"MIT"
] | null | null | null | matplotlib/1.py | MiracleWong/PythonBasic | cb8ec59dc646842b41966ea4ea4b1ee66a342eee | [
"MIT"
] | null | null | null | matplotlib/1.py | MiracleWong/PythonBasic | cb8ec59dc646842b41966ea4ea4b1ee66a342eee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
plt.plot([1,2,3,2,1,2,3,4,5,6,5,4,3,2,1])
plt.show()
| 19.333333 | 41 | 0.603448 | # -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
plt.plot([1,2,3,2,1,2,3,4,5,6,5,4,3,2,1])
plt.show()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9087bf58f1d7f591d304d818e5e353951cc4ab97 | 1,146 | py | Python | Imaging/Core/Testing/Python/TestOpenClose3D.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 1,755 | 2015-01-03T06:55:00.000Z | 2022-03-29T05:23:26.000Z | Imaging/Core/Testing/Python/TestOpenClose3D.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 29 | 2015-04-23T20:58:30.000Z | 2022-03-02T16:16:42.000Z | Imaging/Core/Testing/Python/TestOpenClose3D.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 1,044 | 2015-01-05T22:48:27.000Z | 2022-03-31T02:38:26.000Z | #!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Tst the OpenClose3D filter.
# Image pipeline
reader = vtk.vtkPNGReader()
reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/fullhead15.png")
thresh = vtk.vtkImageThreshold()
thresh.SetInputConnection(reader.Ge... | 31.833333 | 105 | 0.804538 | #!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Tst the OpenClose3D filter.
# Image pipeline
reader = vtk.vtkPNGReader()
reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/fullhead15.png")
thresh = vtk.vtkImageThreshold()
thresh.SetInputConnection(reader.Ge... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f99cc54e5f70292d0ccf4510acced7be6930f300 | 604 | py | Python | ccapi/requests/productoption/getoptions.py | stcstores/ccapi | cc137efa7344b8552e122d30899616bfdbd6af0b | [
"MIT"
] | 1 | 2018-09-11T11:53:22.000Z | 2018-09-11T11:53:22.000Z | ccapi/requests/productoption/getoptions.py | stcstores/ccapi | cc137efa7344b8552e122d30899616bfdbd6af0b | [
"MIT"
] | 24 | 2018-09-11T13:57:53.000Z | 2022-03-18T10:18:36.000Z | ccapi/requests/productoption/getoptions.py | stcstores/ccapi | cc137efa7344b8552e122d30899616bfdbd6af0b | [
"MIT"
] | 1 | 2018-09-12T12:04:58.000Z | 2018-09-12T12:04:58.000Z | """GetOptions request.
Gets list of available product options.
"""
| 25.166667 | 72 | 0.680464 | """GetOptions request.
Gets list of available product options.
"""
from ccapi.cc_objects import ProductOption, ProductOptions
from ..apirequest import APIRequest
class GetOptions(APIRequest):
"""Wrapper for GetOptions request."""
uri = "Handlers/ProductOption/getOptions.ashx"
def process_response(sel... | 0 | 0 | 0 | 415 | 0 | 0 | 0 | 51 | 69 |
2a4555abaff02f13cca6b3a2ea112e70651ba632 | 945 | py | Python | linear_regression.py | jeeeevs/keras-tensorflow | 1f15f2afa77e368e6adc827e018542fff3c53c7c | [
"Apache-2.0"
] | null | null | null | linear_regression.py | jeeeevs/keras-tensorflow | 1f15f2afa77e368e6adc827e018542fff3c53c7c | [
"Apache-2.0"
] | null | null | null | linear_regression.py | jeeeevs/keras-tensorflow | 1f15f2afa77e368e6adc827e018542fff3c53c7c | [
"Apache-2.0"
] | null | null | null | from keras.callbacks import TensorBoard
from keras.callbacks import ModelCheckpoint
from keras.models import Sequential
from keras.layers.core import Dense, Activation
import numpy as np
from time import time
from keras.models import load_model
m = .3
c = 7
x_train = np.linspace(1, 100, 1000)
y_train = m * x_train + ... | 27.794118 | 99 | 0.749206 | from keras.callbacks import TensorBoard
from keras.callbacks import ModelCheckpoint
from keras.models import Sequential
from keras.layers.core import Dense, Activation
import numpy as np
from time import time
from keras.models import load_model
m = .3
c = 7
x_train = np.linspace(1, 100, 1000)
y_train = m * x_train + ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
47d73e6d22fc711d542dff51c88af0689038a102 | 169 | py | Python | website/apps/pages/urls.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | 1 | 2017-03-14T08:08:31.000Z | 2017-03-14T08:08:31.000Z | website/apps/pages/urls.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | website/apps/pages/urls.py | stahlnow/stahlnow | 265dd46c54f68173071d1c86218201d6e618ceeb | [
"MIT"
] | null | null | null | from django.conf.urls import url
from pages.views import PageDetailView
urlpatterns = [
url(r'(?P<slug>[-_\w]+)/$', PageDetailView.as_view(), name='page_detail'),
] | 28.166667 | 78 | 0.704142 | from django.conf.urls import url
from pages.views import PageDetailView
urlpatterns = [
url(r'(?P<slug>[-_\w]+)/$', PageDetailView.as_view(), name='page_detail'),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0c7fe6b4f6b96c9b6e70c77e50900e61233ab33f | 5,237 | py | Python | rl/algorithms/simple.py | jrobine/smaller-world-models | 2b1a9a0f83668207d8516a95f14131c358a18302 | [
"MIT"
] | null | null | null | rl/algorithms/simple.py | jrobine/smaller-world-models | 2b1a9a0f83668207d8516a95f14131c358a18302 | [
"MIT"
] | null | null | null | rl/algorithms/simple.py | jrobine/smaller-world-models | 2b1a9a0f83668207d8516a95f14131c358a18302 | [
"MIT"
] | null | null | null | from typing import NamedTuple, TypeVar
from rl.modelbased.env_model import EnvModel
__all__ = ['SimulatedPolicyLearning']
M = TypeVar('M', bound=EnvModel)
B = TypeVar('B')
T = TypeVar('T', bound=NamedTuple)
| 38.792593 | 108 | 0.696582 | from typing import Callable, Generic, NamedTuple, TypeVar
from gym.vector import VectorEnv
from rl.agents.base import Agent
from rl.algorithms.base import Algorithm
from rl.modelbased.env_model import EnvModel
from rl.modelbased.simulated_env import SimulatedEnv
from rl.utils.sampler import EnvSampler
__all__ = ['Si... | 0 | 1,292 | 0 | 3,491 | 0 | 0 | 0 | 109 | 135 |
ca5776b464af0a149d4960c3df4a1d336580bacc | 3,350 | py | Python | tests/flytekit/unit/cli/pyflyte/test_run.py | aeioulisa/flytekit | 14b3a4ced183a66d0a87c06c19f71e5a1400a6a3 | [
"Apache-2.0"
] | null | null | null | tests/flytekit/unit/cli/pyflyte/test_run.py | aeioulisa/flytekit | 14b3a4ced183a66d0a87c06c19f71e5a1400a6a3 | [
"Apache-2.0"
] | null | null | null | tests/flytekit/unit/cli/pyflyte/test_run.py | aeioulisa/flytekit | 14b3a4ced183a66d0a87c06c19f71e5a1400a6a3 | [
"Apache-2.0"
] | null | null | null | import os
WORKFLOW_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), "workflow.py")
| 28.632479 | 105 | 0.540597 | import os
import pathlib
import pytest
from click.testing import CliRunner
from flytekit.clis.sdk_in_container import pyflyte
from flytekit.clis.sdk_in_container.run import get_entities_in_file
WORKFLOW_FILE = os.path.join(os.path.dirname(os.path.realpath(__file__)), "workflow.py")
def test_pyflyte_run_wf():
r... | 0 | 1,540 | 0 | 0 | 0 | 1,404 | 0 | 74 | 227 |
bfd90e82999857f0391cf17d2d7435b76ce61625 | 1,274 | py | Python | fda/averages.py | githubLewis/Football-data-analysis | 76588c4406ea9c8eeba04caa9eb4dd5f07b5382e | [
"MIT"
] | null | null | null | fda/averages.py | githubLewis/Football-data-analysis | 76588c4406ea9c8eeba04caa9eb4dd5f07b5382e | [
"MIT"
] | null | null | null | fda/averages.py | githubLewis/Football-data-analysis | 76588c4406ea9c8eeba04caa9eb4dd5f07b5382e | [
"MIT"
] | null | null | null | import Teams
import datetime as dt
import matplotlib.pyplot as plt
from constants import _Const
import dataLoader
CONST = _Const()
# Inputs
input_date = input("Date (dd/mm/yy format): ")
avg_window_sz = input("Window size for rolling average: ")
stop_date = dt.datetime.strptime(input_date, '%d/%m/%y')
avg_window = i... | 30.333333 | 60 | 0.725275 | import Teams
import csv
import datetime as dt
import numpy as np
import matplotlib.pyplot as plt
from collections import OrderedDict
from constants import _Const
import dataLoader
CONST = _Const()
# Inputs
input_date = input("Date (dd/mm/yy format): ")
avg_window_sz = input("Window size for rolling average: ")
stop_d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 66 |
6d2eedc18b84d7997f556667488235eb9478434c | 417 | py | Python | create_dataset/urls.py | danmcelroy/VoSeq | e22bd5d971154170bf3f4f24b684b95a12418637 | [
"BSD-3-Clause"
] | 2 | 2019-08-20T04:16:12.000Z | 2020-08-25T02:05:12.000Z | create_dataset/urls.py | danmcelroy/VoSeq | e22bd5d971154170bf3f4f24b684b95a12418637 | [
"BSD-3-Clause"
] | 65 | 2016-09-27T23:14:51.000Z | 2022-03-19T14:17:58.000Z | create_dataset/urls.py | danmcelroy/VoSeq | e22bd5d971154170bf3f4f24b684b95a12418637 | [
"BSD-3-Clause"
] | 4 | 2018-07-02T16:57:44.000Z | 2021-03-23T02:12:15.000Z | from django.conf.urls import url
from . import views
app_name = 'create_dataset'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^results/$', views.generate_results, name='generate-dataset-results'),
url(r'^results/(?P<dataset_id>[0-9]+)/$', views.results, name='create-dataset-results'),
... | 34.75 | 98 | 0.676259 | from django.conf.urls import url
from . import views
app_name = 'create_dataset'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^results/$', views.generate_results, name='generate-dataset-results'),
url(r'^results/(?P<dataset_id>[0-9]+)/$', views.results, name='create-dataset-results'),
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a8e688c05d9a6fd93cb539372e5345a5d310a6a7 | 3,715 | py | Python | submissions/sub5/noisy_parameter_sweep_htcondor.py | Fermilab-Quantum-Science/Z2Sim-public | dfbefffd933aa2e39a0cb9f668b424596dfa7d35 | [
"MIT"
] | 2 | 2021-11-02T17:28:30.000Z | 2021-11-17T17:14:02.000Z | submissions/sub5/noisy_parameter_sweep_htcondor.py | Fermilab-Quantum-Science/Z2Sim-public | dfbefffd933aa2e39a0cb9f668b424596dfa7d35 | [
"MIT"
] | null | null | null | submissions/sub5/noisy_parameter_sweep_htcondor.py | Fermilab-Quantum-Science/Z2Sim-public | dfbefffd933aa2e39a0cb9f668b424596dfa7d35 | [
"MIT"
] | 1 | 2022-02-23T16:12:16.000Z | 2022-02-23T16:12:16.000Z | """noisy_parameter_sweep_htcondor.py
NOTE: Jobs parameters (sweep values, repetitions) must be modified directly in
this script. This script is configured to be dispatched based on a single
int $(Process) passed in by the htcondor submission.
"""
import argparse
import os
import numpy as np
import time
from z2_sim.s... | 31.752137 | 98 | 0.699596 | """noisy_parameter_sweep_htcondor.py
NOTE: Jobs parameters (sweep values, repetitions) must be modified directly in
this script. This script is configured to be dispatched based on a single
int $(Process) passed in by the htcondor submission.
"""
import argparse
import os
import numpy as np
import time
from z2_sim.s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a58f0785a78bb2fb26fcd4787fa4b06d5b40cfe8 | 2,714 | py | Python | droprateshow.py | abramhindle/droprates | abfa2bc49ecacd5281bd4b2561fd9972142a0702 | [
"Apache-2.0"
] | 1 | 2020-10-17T18:12:59.000Z | 2020-10-17T18:12:59.000Z | droprateshow.py | abramhindle/droprates | abfa2bc49ecacd5281bd4b2561fd9972142a0702 | [
"Apache-2.0"
] | null | null | null | droprateshow.py | abramhindle/droprates | abfa2bc49ecacd5281bd4b2561fd9972142a0702 | [
"Apache-2.0"
] | null | null | null | import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
if __name__ == "__main__":
with open('droprate.pickle', 'rb') as f:
result = pickle.load(f)
rates = sorted(list(set([x[0] for x in result])))
ns = sorted(list(set([x[1] for x in result])))
... | 35.246753 | 87 | 0.579587 | import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
def ciPlot(rate,sub):
fig,ax = plt.subplots(dpi=300, figsize=(6,4))
ax.set_title("95%% Confidence Interval of %s percent droprate" % rate)
ax.set_xlabel("Trials")
ax.set_ylabel("Successes")
ax.grid(w... | 0 | 0 | 0 | 0 | 0 | 1,873 | 0 | 0 | 78 |