hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 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 3 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0102038c2ed44e9bc48bf591a5e56f785c7b1842 | 45,509 | py | Python | perf_timer.py | SleepingCatGames/perf_timer | e912ad7a9a2e32cd7c4b12f53162577e30a378ca | [
"MIT"
] | null | null | null | perf_timer.py | SleepingCatGames/perf_timer | e912ad7a9a2e32cd7c4b12f53162577e30a378ca | [
"MIT"
] | 1 | 2020-12-27T18:05:28.000Z | 2021-03-06T03:58:04.000Z | perf_timer.py | SleepingCatGames/perf_timer | e912ad7a9a2e32cd7c4b12f53162577e30a378ca | [
"MIT"
] | null | null | null | # Copyright (C) 2016 Jaedyn K. Draper
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, di... | 36.553414 | 252 | 0.623349 |
ac470b584c6cca0dde016b3388832d08f6777f06 | 27,161 | py | Python | tests/client/test_targeting.py | plastr/extrasolar-game | 1aad5971556d498e3617afe75f27e2f4132d4668 | [
"MIT",
"Unlicense"
] | null | null | null | tests/client/test_targeting.py | plastr/extrasolar-game | 1aad5971556d498e3617afe75f27e2f4132d4668 | [
"MIT",
"Unlicense"
] | null | null | null | tests/client/test_targeting.py | plastr/extrasolar-game | 1aad5971556d498e3617afe75f27e2f4132d4668 | [
"MIT",
"Unlicense"
] | null | null | null | # Copyright (c) 2010-2011 Lazy 8 Studios, LLC.
# All rights reserved.
import collections
from front.models import chips
from front import Constants, target_image_types
from front.callbacks import target_callbacks
from front.models import target as target_module
from front.lib import utils, db
from front.data import sc... | 56.467775 | 141 | 0.690254 |
e56aa3795968fe570a8cb2e38fbc57bd812862c4 | 769 | py | Python | router-map/data/migrations/0002_auto_20200817_1650.py | Swianka/router-map | fc338624633f001cffa29021e3b696f89b7c501f | [
"MIT"
] | null | null | null | router-map/data/migrations/0002_auto_20200817_1650.py | Swianka/router-map | fc338624633f001cffa29021e3b696f89b7c501f | [
"MIT"
] | null | null | null | router-map/data/migrations/0002_auto_20200817_1650.py | Swianka/router-map | fc338624633f001cffa29021e3b696f89b7c501f | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-08-17 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='device',
name='chassis_id',
field... | 27.464286 | 118 | 0.56567 |
83055cba745a658760be9084368002f631998252 | 619 | py | Python | Python/Vivan_Jaiswal_ThemeTogglerWindows10.py | BlackTimber-Labs/DemoPr | 6495b5307323ce17be5071006f1de90a1120edf4 | [
"MIT"
] | 10 | 2021-10-01T15:11:27.000Z | 2021-10-03T10:41:36.000Z | Python/Vivan_Jaiswal_ThemeTogglerWindows10.py | BlackTimber-Labs/DemoPr | 6495b5307323ce17be5071006f1de90a1120edf4 | [
"MIT"
] | 102 | 2021-10-01T14:49:50.000Z | 2021-10-31T17:30:15.000Z | Python/Vivan_Jaiswal_ThemeTogglerWindows10.py | BlackTimber-Labs/DemoPr | 6495b5307323ce17be5071006f1de90a1120edf4 | [
"MIT"
] | 88 | 2021-10-01T14:28:10.000Z | 2021-10-31T12:02:42.000Z | import subprocess
theme = input('Enter theme ([l]ight/[d]ark): ')
if theme == 'l':
allowlight = '1'
command = ['reg.exe', 'add', 'HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize', \
'/v', 'AppsUseLightTheme', '/t', 'REG_DWORD', '/d', allowlight, '/f']
subprocess.run(comm... | 38.6875 | 104 | 0.607431 |
4ad8c181f8bc82421036193afdeeab79c621388c | 2,238 | py | Python | meshgraphnets/plot_cfd.py | Study-Repos-Forks/deepmind-research | 11c2ab53e8afd24afa8904f22fd81b699bfbce6e | [
"Apache-2.0"
] | null | null | null | meshgraphnets/plot_cfd.py | Study-Repos-Forks/deepmind-research | 11c2ab53e8afd24afa8904f22fd81b699bfbce6e | [
"Apache-2.0"
] | null | null | null | meshgraphnets/plot_cfd.py | Study-Repos-Forks/deepmind-research | 11c2ab53e8afd24afa8904f22fd81b699bfbce6e | [
"Apache-2.0"
] | null | null | null | # pylint: disable=g-bad-file-header
# Copyright 2020 DeepMind Technologies Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | 32.911765 | 78 | 0.678731 |
5bbd46debb70205ffef5aa4fde8690c1de813067 | 11,069 | py | Python | train.py | ZzuGiser/yolov4-pytorch | d0526ef75fbc3aab8bca946c090d3a16668bb385 | [
"MIT"
] | 1 | 2020-12-21T14:11:56.000Z | 2020-12-21T14:11:56.000Z | train.py | ZzuGiser/yolov4-pytorch | d0526ef75fbc3aab8bca946c090d3a16668bb385 | [
"MIT"
] | null | null | null | train.py | ZzuGiser/yolov4-pytorch | d0526ef75fbc3aab8bca946c090d3a16668bb385 | [
"MIT"
] | null | null | null | #-------------------------------------#
# 对数据集进行训练
#-------------------------------------#
import os
import numpy as np
import time
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
fr... | 42.248092 | 149 | 0.545939 |
9babb7513346d9845f59e1fb36851674ca98c118 | 39 | py | Python | Python/Cisco-PCAP-Python/Session/utils/sapa.py | rainoverme002/Software-Developer-Interview-Preparation | e4d9d704d619c11c0eb6458dcb57761b5946cd82 | [
"MIT"
] | null | null | null | Python/Cisco-PCAP-Python/Session/utils/sapa.py | rainoverme002/Software-Developer-Interview-Preparation | e4d9d704d619c11c0eb6458dcb57761b5946cd82 | [
"MIT"
] | 2 | 2021-09-02T20:33:10.000Z | 2022-03-29T10:04:07.000Z | Python/Cisco-PCAP-Python/Session/utils/sapa.py | rainoverme002/Software-Developer-Interview-Preparation | e4d9d704d619c11c0eb6458dcb57761b5946cd82 | [
"MIT"
] | null | null | null | def say_hai():
print("Hai...")
| 13 | 19 | 0.461538 |
c454e83a3899e32577dce13b01650f8b05a0e871 | 5,923 | py | Python | tests/faidx_test.py | mckinsel/pysam | 0eca021826f830dcb6920c77e68d70e5570cf4a9 | [
"MIT"
] | null | null | null | tests/faidx_test.py | mckinsel/pysam | 0eca021826f830dcb6920c77e68d70e5570cf4a9 | [
"MIT"
] | null | null | null | tests/faidx_test.py | mckinsel/pysam | 0eca021826f830dcb6920c77e68d70e5570cf4a9 | [
"MIT"
] | null | null | null | import pysam
import unittest
import os
DATADIR = "pysam_data"
class TestFastaFile(unittest.TestCase):
sequences = {
'chr1':
b"CACTAGTGGCTCATTGTAAATGTGTGGTTTAACTCGTCCATGGCCCAGCATTAGGGAGCTGTGGACCCTGCAGCCTGGCTGTGGGGGCCGCAGTGGCTGAGGGGTGCAGAGCCGAGTCACGGGGTTGCCAGCACAGGGGCTTAACCTCTGGTGACTGCCAGAGCTGCTGG... | 67.306818 | 1,596 | 0.812088 |
d99042daaf7062ca1a4ad79395c01bbe8da53196 | 3,907 | py | Python | examples/machine_translation/transformer/export_model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/export_model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/machine_translation/transformer/export_model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | import os
import yaml
import argparse
from pprint import pprint
from attrdict import AttrDict
import paddle
import reader
from paddlenlp.transformers import InferTransformerModel, position_encoding_init
from paddlenlp.utils.log import logger
def parse_args():
parser = argparse.ArgumentParser()
parser.add_a... | 30.76378 | 115 | 0.644484 |
8bf3229055a01bf4dfff030936694ec73a670cac | 9,162 | py | Python | cinder/api/v3/router.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 3 | 2015-04-02T21:44:36.000Z | 2016-04-29T21:19:04.000Z | cinder/api/v3/router.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 28 | 2017-08-17T14:46:05.000Z | 2022-03-29T12:42:12.000Z | cinder/api/v3/router.py | lightsey/cinder | e03d68e42e57a63f8d0f3e177fb4287290612b24 | [
"Apache-2.0"
] | 4 | 2016-01-27T00:25:52.000Z | 2021-03-25T19:54:08.000Z | # Copyright 2011 OpenStack Foundation
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | 45.356436 | 78 | 0.586226 |
a7f3dcc412d350b966c6f870737f0fb4675d22c5 | 865 | py | Python | configs/config_cpp.py | ishine/g2pW | e4e25f0607f7499c2dd0ed9bcb35e60d7676d323 | [
"Apache-2.0"
] | 3 | 2022-03-24T08:31:45.000Z | 2022-03-29T16:46:07.000Z | configs/config_cpp.py | ishine/g2pW | e4e25f0607f7499c2dd0ed9bcb35e60d7676d323 | [
"Apache-2.0"
] | 1 | 2022-03-22T07:30:46.000Z | 2022-03-22T07:30:46.000Z | configs/config_cpp.py | ishine/g2pW | e4e25f0607f7499c2dd0ed9bcb35e60d7676d323 | [
"Apache-2.0"
] | 2 | 2022-03-23T00:54:24.000Z | 2022-03-24T08:31:47.000Z | root = './cpp_dataset/'
manual_seed = 1313
model_source = 'bert-base-chinese'
polyphonic_chars_path = root + 'POLYPHONIC_CHARS.txt'
window_size = 32
num_workers = 2
use_mask = True
use_conditional = True
param_conditional = {
'bias': True,
'char-linear': True,
'pos-linear': False,
'char+pos-second': Tr... | 23.378378 | 53 | 0.689017 |
3373144e6144d5f18e744ef7290717b9a17abd05 | 2,009 | py | Python | speaker.py | jeremyplichta/pi-halloween | a9cba48d5e3bc6f4a732344c3a6d0efe1f01aebe | [
"MIT"
] | null | null | null | speaker.py | jeremyplichta/pi-halloween | a9cba48d5e3bc6f4a732344c3a6d0efe1f01aebe | [
"MIT"
] | null | null | null | speaker.py | jeremyplichta/pi-halloween | a9cba48d5e3bc6f4a732344c3a6d0efe1f01aebe | [
"MIT"
] | null | null | null | import threading
import logging
from os import listdir
from os.path import isfile, join
import random
import time
import pexpect
import sys
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-10s) %(asctime)s %(message)s',
)
class Speaker(threading.Thread):
def ... | 30.907692 | 114 | 0.592832 |
a3b20b2a6a0a8dbfe4669d855a7cc985bd07f86c | 14,619 | py | Python | rllib/policy/policy.py | amitsadaphule/ray | 0b9fbc1c0f767e14b80e5bbf92b898ed6c9e1cff | [
"Apache-2.0"
] | null | null | null | rllib/policy/policy.py | amitsadaphule/ray | 0b9fbc1c0f767e14b80e5bbf92b898ed6c9e1cff | [
"Apache-2.0"
] | null | null | null | rllib/policy/policy.py | amitsadaphule/ray | 0b9fbc1c0f767e14b80e5bbf92b898ed6c9e1cff | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta, abstractmethod
import gym
import numpy as np
from ray.rllib.utils.annotations import DeveloperAPI
from ray.rllib.utils.exploration.exploration import Exploration
from ray.rllib.utils.from_config import from_config
# By convention, metrics from optimizing the loss can be reported in the
# `gra... | 35.656098 | 79 | 0.600725 |
2e04e3c7d278fef8fec79cf6ceb6bc82a3622b7a | 587 | py | Python | objname/bench_objname.py | AlanCristhian/objname | bf3b174ef0c2770eec6ab3e4dc3c61d0257fd303 | [
"MIT"
] | null | null | null | objname/bench_objname.py | AlanCristhian/objname | bf3b174ef0c2770eec6ab3e4dc3c61d0257fd303 | [
"MIT"
] | null | null | null | objname/bench_objname.py | AlanCristhian/objname | bf3b174ef0c2770eec6ab3e4dc3c61d0257fd303 | [
"MIT"
] | null | null | null | import time
import objname
def single_assignment() -> None:
start = time.monotonic()
for i in range(100_000):
a = objname.AutoName()
b = objname.AutoName()
c = objname.AutoName()
end = time.monotonic()
print(f"single_assignment {end - start:0.4g} seconds")
def unpack_sequenc... | 21.740741 | 58 | 0.62862 |
966abeff9421b047a803bef19d17bbc7b539bb9b | 310 | py | Python | Python/photocellTest.py | johnmwright/GaragePi | 8e2ee24fc53363a595669af873660d39068ee855 | [
"MIT"
] | 3 | 2015-02-10T16:11:01.000Z | 2018-02-13T01:02:55.000Z | Python/photocellTest.py | johnmwright/GaragePi | 8e2ee24fc53363a595669af873660d39068ee855 | [
"MIT"
] | null | null | null | Python/photocellTest.py | johnmwright/GaragePi | 8e2ee24fc53363a595669af873660d39068ee855 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# This script is a quick way to get light sensor values in a loop
# and verify the sensor logic
#
import RPi.GPIO as GPIO
import time
import PhotocellController as Lux
GPIO.setmode(GPIO.BCM)
LUX_PIN = 17
lux = Lux.PhotocellController(LUX_PIN)
while True:
print lux.resistanceTime() | 17.222222 | 65 | 0.754839 |
e53952af8ac5f968e2da9c9ba0ae3a6ad9803e70 | 4,534 | py | Python | cinder/api/v3/workers.py | cloudification-io/cinder | 23d76e01f2b4f3771b57fb287084a4884238b827 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | cinder/api/v3/workers.py | dFarui/cinder | b2922384054ddbd46e071fd07372a75a21d7f85d | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | cinder/api/v3/workers.py | dFarui/cinder | b2922384054ddbd46e071fd07372a75a21d7f85d | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | # Copyright (c) 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 41.218182 | 79 | 0.627261 |
f9ffd06064cc469ece8adf97df1fda1b1866b422 | 405 | py | Python | pythonbrasil/exercicios/repeticao/ER resp 50.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | pythonbrasil/exercicios/repeticao/ER resp 50.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | pythonbrasil/exercicios/repeticao/ER resp 50.py | adinsankofa/python | 8f2f26c77015c0baaa76174e004406b4115272c7 | [
"MIT"
] | null | null | null | '''
Sendo H= 1 + 1/2 + 1/3 + 1/4 + ... + 1/N, Faça um programa que calcule o
valor de H com N termos.
'''
### FATORIAL ###
n = int(input('Digite a quantidade de termos: '))
i = 1
fat = 1
print('H = {}/{}'.format(n,i), end=' + ')
while i < n+1:
fat *= i
i += 1
for j in range(2,n):
print('{... | 19.285714 | 72 | 0.474074 |
22252948e727034dfe2edbba4a033445b0ed993e | 4,538 | py | Python | python_ldpc/ldpc_encoder.py | iamviji/wimax_ldpc_lib | e07f102eb9eefb5c906345ec024aa08f7db871e9 | [
"MIT"
] | null | null | null | python_ldpc/ldpc_encoder.py | iamviji/wimax_ldpc_lib | e07f102eb9eefb5c906345ec024aa08f7db871e9 | [
"MIT"
] | null | null | null | python_ldpc/ldpc_encoder.py | iamviji/wimax_ldpc_lib | e07f102eb9eefb5c906345ec024aa08f7db871e9 | [
"MIT"
] | null | null | null |
import numpy as np
class ldpc_encoder:
""" LDPC Encoder
Initialize with the desired alist
alist -- string, filename of alist
"""
def __init__(self, alist, X, D, is_23B_rate):
self.H, self.N, self.M = self.create_H_from_alist(alist)
self.X = X
se... | 25.784091 | 80 | 0.461877 |
f0e711ac76216357cbc06d7fce15e41c001c0452 | 23,803 | py | Python | django/core/management/base.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 16 | 2019-08-10T12:24:06.000Z | 2020-05-21T09:11:14.000Z | django/core/management/base.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 12 | 2019-08-10T11:55:29.000Z | 2020-05-21T04:46:30.000Z | django/core/management/base.py | jpmallarino/django | 659d2421c7adbbcd205604002d521d82d6b0b465 | [
"BSD-3-Clause",
"0BSD"
] | 3 | 2019-08-20T13:29:34.000Z | 2020-01-30T22:05:10.000Z | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
import argparse
import os
import sys
from argparse import ArgumentParser, HelpFormatter
from io import TextIOBase
import django
from django.core import checks
from django.core.exceptio... | 35.055965 | 88 | 0.5969 |
df3dd926a642a5a5dc7139221a69990e69a11832 | 208 | py | Python | profiles_api/serializers.py | Irfan995/Rest-API | e06224d5bffd6e1c0dc2d67813b40876c2906c3b | [
"MIT"
] | null | null | null | profiles_api/serializers.py | Irfan995/Rest-API | e06224d5bffd6e1c0dc2d67813b40876c2906c3b | [
"MIT"
] | null | null | null | profiles_api/serializers.py | Irfan995/Rest-API | e06224d5bffd6e1c0dc2d67813b40876c2906c3b | [
"MIT"
] | null | null | null | from rest_framework import serializers
class HelloSerializer(serializers.Serializer):
'''
Serializes a name field for testing our APIView
'''
name = serializers.CharField(max_length=10)
| 23.111111 | 51 | 0.730769 |
5ef27fc2a85ee8816d441772167a1db48319e0e8 | 4,006 | py | Python | tests/actives/test_actives_sql_injection.py | indeedsecurity/ava-ce | 4483b301034a096b716646a470a6642b3df8ce61 | [
"Apache-2.0"
] | 2 | 2019-03-26T15:37:48.000Z | 2020-01-03T03:47:30.000Z | tests/actives/test_actives_sql_injection.py | indeedsecurity/ava-ce | 4483b301034a096b716646a470a6642b3df8ce61 | [
"Apache-2.0"
] | 2 | 2021-03-25T21:27:09.000Z | 2021-06-01T21:20:04.000Z | tests/actives/test_actives_sql_injection.py | indeedsecurity/ava-ce | 4483b301034a096b716646a470a6642b3df8ce61 | [
"Apache-2.0"
] | null | null | null | import pytest
from ava.actives.sql_injection import SqlInjectionCheck, SqlInjectionDifferentialCheck, SqlInjectionTimingCheck
@pytest.fixture
def response():
return type("Response", (object,), {})
class TestSqlInjectionCheck:
payloads = [
"'",
'"',
'(',
')',
"NULL",
... | 34.534483 | 111 | 0.531453 |
847784bd9a580e516bfe524a1809a70a296bec13 | 593 | py | Python | weasyl/sessions.py | akash143143/weasyl | be42a2313e657e97c4a48432379e37b6a3d4a4af | [
"Apache-2.0"
] | 1 | 2019-02-15T04:21:48.000Z | 2019-02-15T04:21:48.000Z | weasyl/sessions.py | akash143143/weasyl | be42a2313e657e97c4a48432379e37b6a3d4a4af | [
"Apache-2.0"
] | 254 | 2017-12-23T19:36:43.000Z | 2020-04-14T21:46:13.000Z | weasyl/sessions.py | TheWug/weasyl | a568a542cc58c11e30621fb672c701531d4306a8 | [
"Apache-2.0"
] | 1 | 2017-12-23T18:42:16.000Z | 2017-12-23T18:42:16.000Z | from libweasyl import security
from libweasyl.models.users import GuestSession, Session
USER_TOKEN_LENGTH = 64
GUEST_TOKEN_LENGTH = 20
def create_session(userid):
sess = Session(userid=userid)
sess.sessionid = security.generate_key(USER_TOKEN_LENGTH)
sess.create = True
sess.save = True
return se... | 21.962963 | 63 | 0.74199 |
4e18229fcf5d4d11a423bf4ba2e6ee9442717837 | 45,667 | py | Python | pyupdater/vendor/PyInstaller/utils/winmanifest.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | null | null | null | pyupdater/vendor/PyInstaller/utils/winmanifest.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | null | null | null | pyupdater/vendor/PyInstaller/utils/winmanifest.py | rsumner31/PyUpdater1 | d9658000472e57453267ee8fa174ae914dd8d33c | [
"BSD-2-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | 43.409696 | 101 | 0.544726 |
da443b776de7566d6bb824638d0d25d852a0ece3 | 2,201 | py | Python | Lattice/Liquid.py | jeffcarter-github/TensorFlow_MD | 0bbcce6bfbe376c1f3bcb374a3889a26a5afcc6e | [
"MIT"
] | null | null | null | Lattice/Liquid.py | jeffcarter-github/TensorFlow_MD | 0bbcce6bfbe376c1f3bcb374a3889a26a5afcc6e | [
"MIT"
] | null | null | null | Lattice/Liquid.py | jeffcarter-github/TensorFlow_MD | 0bbcce6bfbe376c1f3bcb374a3889a26a5afcc6e | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from scipy.spatial.distance import pdist
from TensorFlow_MD.utilities.constants import n_avogadro
class Liquid(object):
'''
Args:
density (float): density of fluid in g/ml
mass (float): mass of atom or p... | 33.348485 | 86 | 0.638801 |
46e137ded7bdce33baf587b08069c9aa43937161 | 1,919 | py | Python | timeflux/nodes/xarray.py | jonathanjfshaw/timeflux | a17100bce754bd6d85d2c9c65a95bfcc0e7fe219 | [
"MIT"
] | null | null | null | timeflux/nodes/xarray.py | jonathanjfshaw/timeflux | a17100bce754bd6d85d2c9c65a95bfcc0e7fe219 | [
"MIT"
] | null | null | null | timeflux/nodes/xarray.py | jonathanjfshaw/timeflux | a17100bce754bd6d85d2c9c65a95bfcc0e7fe219 | [
"MIT"
] | null | null | null | """XArray
This module contains nodes to handle XArray data.
"""
from timeflux.core.node import Node
class Transpose(Node):
"""Transpose dimensions of a DataArray.
This node reorders the dimensions of a DataArray object to ``dims``.
Attributes:
i (Port): default data input, expects DataArray.
... | 26.287671 | 111 | 0.637311 |
f021485b07f083c77415617c6206c56505aff774 | 11,713 | py | Python | tests/ut/python/parallel/test_auto_parallel_resnet_sharding_propagation.py | LottieWang/mindspore | 1331c7e432fb691d1cfa625ab7cc7451dcfc7ce0 | [
"Apache-2.0"
] | 1 | 2021-07-16T12:05:53.000Z | 2021-07-16T12:05:53.000Z | tests/ut/python/parallel/test_auto_parallel_resnet_sharding_propagation.py | LottieWang/mindspore | 1331c7e432fb691d1cfa625ab7cc7451dcfc7ce0 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/parallel/test_auto_parallel_resnet_sharding_propagation.py | LottieWang/mindspore | 1331c7e432fb691d1cfa625ab7cc7451dcfc7ce0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.717868 | 110 | 0.60514 |
c858ed27b103bed29d01942ee6a1a3074de48a6f | 230 | py | Python | examples/python-fabric/files/deploy.py | knick-knack/knick-knack | 29793bbe0ecd3a77fecd29c0dc676f0d65f911a0 | [
"MIT"
] | null | null | null | examples/python-fabric/files/deploy.py | knick-knack/knick-knack | 29793bbe0ecd3a77fecd29c0dc676f0d65f911a0 | [
"MIT"
] | null | null | null | examples/python-fabric/files/deploy.py | knick-knack/knick-knack | 29793bbe0ecd3a77fecd29c0dc676f0d65f911a0 | [
"MIT"
] | null | null | null | import sys
from fabric.api import *
from fabric.contrib import *
import {%= name %}
# Tell Fabric which tasks are exported by this file
__all__ = ['deploy_config']
@task(default=True)
def deploy_config():
print 'start here'
| 16.428571 | 51 | 0.726087 |
0e071fdc6b88d4449d6b79ab9fef0cb8d9b0a6be | 323 | py | Python | start/server/core/log.py | zach-waggoner/fullstack-tutorial | da62e59a9e8fea240b1e3c512c199ea4cc85d34d | [
"MIT"
] | null | null | null | start/server/core/log.py | zach-waggoner/fullstack-tutorial | da62e59a9e8fea240b1e3c512c199ea4cc85d34d | [
"MIT"
] | null | null | null | start/server/core/log.py | zach-waggoner/fullstack-tutorial | da62e59a9e8fea240b1e3c512c199ea4cc85d34d | [
"MIT"
] | null | null | null | from typing import Any
from django.core.management.color import color_style
from django.utils.log import ServerFormatter
class ColoredServerFormatter(ServerFormatter):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self.style = color_style(force_color=Tru... | 29.363636 | 58 | 0.739938 |
1f41298aa6256d9878f1c7ba91f6e91c9c619824 | 8,082 | py | Python | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/neighbors/tests/test_neighbors_pipeline.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/neighbors/tests/test_neighbors_pipeline.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/neighbors/tests/test_neighbors_pipeline.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """
This is testing the equivalence between some estimators with internal nearest
neighbors computations, and the corresponding pipeline versions with
KNeighborsTransformer or RadiusNeighborsTransformer to precompute the
neighbors.
"""
import numpy as np
from sklearn.utils._testing import assert_array_almost_equal
fr... | 36.405405 | 79 | 0.707622 |
4eb191fdadc1498ec40e6b25fab3560d9b315ef2 | 1,462 | py | Python | CS241 w11/prove11.py | carloswm85/2020-cs241 | 5cbc7912f47c79ae4c11d9326d38daeb6d0e0f70 | [
"Unlicense"
] | null | null | null | CS241 w11/prove11.py | carloswm85/2020-cs241 | 5cbc7912f47c79ae4c11d9326d38daeb6d0e0f70 | [
"Unlicense"
] | null | null | null | CS241 w11/prove11.py | carloswm85/2020-cs241 | 5cbc7912f47c79ae4c11d9326d38daeb6d0e0f70 | [
"Unlicense"
] | null | null | null | """
Purpose: This file is a starting point to help you practice list comprehensions.
"""
def get_part1_list():
"""
Returns a list of the squares of the numbers [0-99], e.g., 0, 1, 4, 9, 16, 25 ...]
"""
# TODO: Change this line to be a list comprehension
numbers = list_1 = [n ** 2 for n in range(10... | 27.074074 | 164 | 0.609439 |
34eaa5af0123771445600b17cb9a41dbabe1eceb | 5,461 | py | Python | docs/source/conf.py | dzhuliya/mpgaussfit | d56c309805497dc42b5d20db06adae0b1f6e5946 | [
"BSD-3-Clause"
] | 2 | 2021-11-12T03:08:41.000Z | 2022-03-29T19:02:05.000Z | docs/source/conf.py | dzhuliya/mpgaussfit | d56c309805497dc42b5d20db06adae0b1f6e5946 | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | dzhuliya/mpgaussfit | d56c309805497dc42b5d20db06adae0b1f6e5946 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 29.360215 | 79 | 0.652811 |
a567e29cb851801eaca322d570bd3e4da63fbff6 | 360 | py | Python | partd/pickle.py | dask/partd | efa78b4cb27ec450d9bff360e1bf9451c5ec0b17 | [
"BSD-3-Clause"
] | 87 | 2016-02-25T18:41:59.000Z | 2022-01-02T16:50:56.000Z | partd/pickle.py | dask/partd | efa78b4cb27ec450d9bff360e1bf9451c5ec0b17 | [
"BSD-3-Clause"
] | 41 | 2016-02-12T02:14:16.000Z | 2022-03-01T18:36:21.000Z | partd/pickle.py | dask/partd | efa78b4cb27ec450d9bff360e1bf9451c5ec0b17 | [
"BSD-3-Clause"
] | 27 | 2016-04-10T09:41:53.000Z | 2021-10-16T04:48:53.000Z | """
get/put functions that consume/produce Python lists using Pickle to serialize
"""
import pickle
from .encode import Encode
from functools import partial
def concat(lists):
return sum(lists, [])
Pickle = partial(Encode,
partial(pickle.dumps, protocol=pickle.HIGHEST_PROTOCOL),
... | 22.5 | 77 | 0.661111 |
5e2b7bf113d2286791dabc8d8d610b70fee5888d | 3,417 | py | Python | run_tests.py | xynthe/utility-contracts | 8bc8d07698c910b206227ef54f0e5bdfeb8c0896 | [
"MIT"
] | 1 | 2021-05-14T23:16:42.000Z | 2021-05-14T23:16:42.000Z | run_tests.py | xynthe/utility-contracts | 8bc8d07698c910b206227ef54f0e5bdfeb8c0896 | [
"MIT"
] | 1 | 2018-06-22T01:29:18.000Z | 2018-06-22T01:29:18.000Z | run_tests.py | Havven/utility-contracts | fe3af9aa42726aa7c47be7e38a34d92bc0553ba5 | [
"MIT"
] | 3 | 2020-03-01T03:36:42.000Z | 2021-05-16T08:29:15.000Z | #!/usr/local/bin/python3
import sys
import os
import subprocess
import time
from unittest import TestSuite, TestLoader, TextTestRunner
from utils.generalutils import load_test_settings, ganache_error_message
if __name__ == '__main__':
num_agents = "150"
eth_per_agent = "1000000000000"
print("Launching ga... | 38.829545 | 137 | 0.595844 |
43ea673ffbda882a4d71e65634436d395020337f | 1,408 | py | Python | BinarySearchProbs/KokoEatingBananas.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 12 | 2021-06-18T16:24:27.000Z | 2021-11-04T03:30:00.000Z | BinarySearchProbs/KokoEatingBananas.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 32 | 2021-10-01T07:15:00.000Z | 2021-11-05T15:35:53.000Z | BinarySearchProbs/KokoEatingBananas.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 21 | 2021-09-29T09:16:31.000Z | 2021-10-30T10:06:21.000Z | '''
Koko loves to eat bananas. There are n piles of bananas, the ith pile has piles[i] bananas. The guards have gone and will come back in h hours.
Koko can decide her bananas-per-hour eating speed of k. Each hour, she chooses some pile of bananas and eats k bananas from that pile. If the pile has less than k bananas,... | 25.142857 | 252 | 0.583097 |
127cec80557306c55e635c09ec58c437749db096 | 189 | py | Python | application/frontend/forms.py | communitiesuk/brownfield-sites-lint | 903826d831158cccd37d2287278c26b6b4a10ba4 | [
"MIT"
] | null | null | null | application/frontend/forms.py | communitiesuk/brownfield-sites-lint | 903826d831158cccd37d2287278c26b6b4a10ba4 | [
"MIT"
] | 8 | 2019-11-05T11:24:45.000Z | 2021-06-02T00:55:11.000Z | application/frontend/forms.py | communitiesuk/brownfield-sites-lint | 903826d831158cccd37d2287278c26b6b4a10ba4 | [
"MIT"
] | 1 | 2019-04-23T12:17:50.000Z | 2019-04-23T12:17:50.000Z | from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired
class UploadForm(FlaskForm):
upload = FileField('file', validators=[
FileRequired()
])
| 18.9 | 50 | 0.724868 |
bc58ad84bba56c694d1648be70633932afcf1d1d | 4,803 | py | Python | pymatgen/ext/cod.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | 1 | 2021-11-02T21:10:11.000Z | 2021-11-02T21:10:11.000Z | pymatgen/ext/cod.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | 5 | 2018-08-07T23:00:23.000Z | 2021-01-05T22:46:23.000Z | pymatgen/ext/cod.py | exenGT/pymatgen | a8ffb820ab8fc3f60251099e38c8888f45eae618 | [
"MIT"
] | 6 | 2019-04-26T18:50:41.000Z | 2020-03-29T17:58:34.000Z | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides classes to interface with the Crystallography Open
Database. If you use data from the COD, please cite the following works (as
stipulated by the COD developers)::
Merkys, A., Vaitkus, A., Butkus, ... | 35.058394 | 101 | 0.599001 |
a63b4f38d8e4667de9e9686131fb8649d63098d2 | 3,952 | py | Python | exp1.py | avengercelona/ydse_band | 4820a5bf2de21541c5971e728fdaa24e19345f5a | [
"MIT"
] | null | null | null | exp1.py | avengercelona/ydse_band | 4820a5bf2de21541c5971e728fdaa24e19345f5a | [
"MIT"
] | null | null | null | exp1.py | avengercelona/ydse_band | 4820a5bf2de21541c5971e728fdaa24e19345f5a | [
"MIT"
] | null | null | null | import numpy as np
import math as m
from matplotlib import pyplot as plt
from matplotlib.patches import Rectangle
from matplotlib.widgets import Slider, Button
def wvl2rgb(wavelength, gamma=0.8):
'''This converts a given wavelength of light to an
approximate RGB color value. The wavelength must be given
... | 30.875 | 115 | 0.610071 |
77a4e186e08954877a26e89e0d6eee45c4f5b0a5 | 3,957 | py | Python | main.py | bansheng/3D-R2N2-pytorch | ba43a2b52018886191221ae029854ed8941b8121 | [
"MIT"
] | 23 | 2019-05-29T11:41:56.000Z | 2022-03-08T08:04:13.000Z | main.py | bansheng/3D-R2N2-pytorch | ba43a2b52018886191221ae029854ed8941b8121 | [
"MIT"
] | 1 | 2021-07-21T11:24:30.000Z | 2021-07-21T11:24:30.000Z | main.py | bansheng/3D-R2N2-pytorch | ba43a2b52018886191221ae029854ed8941b8121 | [
"MIT"
] | 6 | 2019-09-29T06:40:21.000Z | 2022-03-08T08:04:14.000Z | #!/usr/bin/env python
import sys
if (sys.version_info < (3, 0)):
raise Exception(
"Please follow the installation instruction on 'https://github.com/chrischoy/3D-R2N2'")
import numpy as np
import argparse
import pprint
import logging
import multiprocessing as mp
# Theano
#import theano.sandbox.cuda
from ... | 31.656 | 100 | 0.644175 |
a0b5ea865cd755d6af7ed389e60454930a87411f | 5,508 | py | Python | scripts/makeBuildAlignments.py | adbailey4/signalAlign | 3293fad43b27c21669ada18c15af0c4e736b0133 | [
"MIT"
] | 46 | 2016-05-17T10:26:39.000Z | 2022-03-15T08:28:35.000Z | scripts/makeBuildAlignments.py | adbailey4/signalAlign | 3293fad43b27c21669ada18c15af0c4e736b0133 | [
"MIT"
] | 23 | 2016-06-15T04:12:00.000Z | 2021-05-05T20:04:48.000Z | scripts/makeBuildAlignments.py | adbailey4/signalAlign | 3293fad43b27c21669ada18c15af0c4e736b0133 | [
"MIT"
] | 21 | 2016-10-03T16:18:37.000Z | 2021-09-08T13:32:25.000Z | #!/usr/bin/env python
""" Make build alignments for starting a new HDP
"""
from __future__ import print_function
import glob
import os
import sys
import string
import pandas as pd
import numpy as np
from argparse import ArgumentParser
from random import shuffle
def parse_args():
parser = ArgumentParser(descriptio... | 44.064 | 112 | 0.616921 |
7124c72a639118f15066d769de61f16044098a1e | 11,891 | py | Python | Lib/idlelib/run.py | certik/python-3.3 | 7caa9aa12103810526ed7d99794f491d8e0cbd91 | [
"PSF-2.0"
] | null | null | null | Lib/idlelib/run.py | certik/python-3.3 | 7caa9aa12103810526ed7d99794f491d8e0cbd91 | [
"PSF-2.0"
] | null | null | null | Lib/idlelib/run.py | certik/python-3.3 | 7caa9aa12103810526ed7d99794f491d8e0cbd91 | [
"PSF-2.0"
] | 3 | 2015-05-20T14:18:45.000Z | 2021-06-28T15:52:33.000Z | import sys
import linecache
import time
import socket
import traceback
import _thread as thread
import threading
import queue
import tkinter
from idlelib import CallTips
from idlelib import AutoComplete
from idlelib import RemoteDebugger
from idlelib import RemoteObjectBrowser
from idlelib import StackViewer
from idl... | 33.308123 | 79 | 0.604911 |
89a677b62e2181764baf74c0cac4a47670746575 | 3,313 | py | Python | app/app/settings.py | clement-hamon/recipe-app-api | 5a82f05f9842d8427848942173edd3d4d2522e13 | [
"MIT"
] | null | null | null | app/app/settings.py | clement-hamon/recipe-app-api | 5a82f05f9842d8427848942173edd3d4d2522e13 | [
"MIT"
] | null | null | null | app/app/settings.py | clement-hamon/recipe-app-api | 5a82f05f9842d8427848942173edd3d4d2522e13 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.484615 | 91 | 0.686689 |
8cfa71e3683cda5522351b540eae032dc582ac98 | 500 | py | Python | hypergeo/binomial_distribution.py | jsleb333/hypergeometric_tail_inversion | 7141d2bfec97f8d2e162a389531f01ce6e931b7c | [
"MIT"
] | null | null | null | hypergeo/binomial_distribution.py | jsleb333/hypergeometric_tail_inversion | 7141d2bfec97f8d2e162a389531f01ce6e931b7c | [
"MIT"
] | null | null | null | hypergeo/binomial_distribution.py | jsleb333/hypergeometric_tail_inversion | 7141d2bfec97f8d2e162a389531f01ce6e931b7c | [
"MIT"
] | null | null | null | import numpy as np
from scipy.special import betainc
from scipy.optimize import bisect
def binomial_tail(k, m, p):
return betainc(m-k, k+1, 1-p) # Quite faster than scipy.stats.binom.cdf
def binomial_tail_inverse(k, m, delta):
# Note that one cannot use the regularized incomplete beta function 'betaincinv' ... | 38.461538 | 145 | 0.736 |
bbff34d3ef82468a50f068a9abcfb9de8cca1e5b | 2,857 | py | Python | python/threesixtygivingdei/sphinx/taxonomy.py | ThreeSixtyGiving/360-dei | 1b50dc134a1dfe506463fae3cf34d07536636241 | [
"CC-BY-4.0"
] | null | null | null | python/threesixtygivingdei/sphinx/taxonomy.py | ThreeSixtyGiving/360-dei | 1b50dc134a1dfe506463fae3cf34d07536636241 | [
"CC-BY-4.0"
] | 9 | 2021-07-22T10:11:14.000Z | 2021-07-22T11:34:15.000Z | python/threesixtygivingdei/sphinx/taxonomy.py | ThreeSixtyGiving/360-dei | 1b50dc134a1dfe506463fae3cf34d07536636241 | [
"CC-BY-4.0"
] | null | null | null |
import json
import os
from sphinx.directives.code import LiteralInclude
from docutils.parsers.rst import Directive, directives
from docutils import nodes
from myst_parser.main import to_docutils
taxonomy_data_file = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"..",
"..",
"..",
"ta... | 27.209524 | 106 | 0.585929 |
a8bc1a4533008aae2309c3d8456f6dc0d35de7ba | 12,978 | py | Python | sdk/python/kfp/dsl/artifact.py | deepk2u/pipelines | 4714919487788823dfc8a739ba00b69faffd7f3f | [
"Apache-2.0"
] | 1 | 2021-03-30T14:21:23.000Z | 2021-03-30T14:21:23.000Z | sdk/python/kfp/dsl/artifact.py | deepk2u/pipelines | 4714919487788823dfc8a739ba00b69faffd7f3f | [
"Apache-2.0"
] | 6 | 2019-08-20T18:59:22.000Z | 2019-08-21T16:42:18.000Z | sdk/python/kfp/dsl/artifact.py | deepk2u/pipelines | 4714919487788823dfc8a739ba00b69faffd7f3f | [
"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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.869318 | 80 | 0.689706 |
609f7d5a8b470ea87423628e2e7e9a6bc0a951bf | 19,860 | py | Python | cirq/protocols/json_serialization.py | m-szalay/Cirq | 1bd083a87fdf49212f347d88f15713e90cc72f8f | [
"Apache-2.0"
] | null | null | null | cirq/protocols/json_serialization.py | m-szalay/Cirq | 1bd083a87fdf49212f347d88f15713e90cc72f8f | [
"Apache-2.0"
] | null | null | null | cirq/protocols/json_serialization.py | m-szalay/Cirq | 1bd083a87fdf49212f347d88f15713e90cc72f8f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq Developers
#
# 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 ... | 37.260788 | 80 | 0.642749 |
ebc33ca715f3d83209e1c05c772311617bdc2fe2 | 2,083 | py | Python | rowboat/views/auth.py | blasph3m3/gh | d172de9482aa32d057c755ec48c47338805d5329 | [
"MIT"
] | 163 | 2017-05-09T17:24:34.000Z | 2022-02-04T15:58:02.000Z | rowboat/views/auth.py | blasph3m3/gh | d172de9482aa32d057c755ec48c47338805d5329 | [
"MIT"
] | 17 | 2017-05-13T14:34:14.000Z | 2018-01-08T05:23:44.000Z | rowboat/views/auth.py | blasph3m3/gh | d172de9482aa32d057c755ec48c47338805d5329 | [
"MIT"
] | 184 | 2017-05-13T08:23:05.000Z | 2022-02-11T06:04:23.000Z | from flask import Blueprint, g, current_app, session, jsonify, redirect, request
from requests_oauthlib import OAuth2Session
from rowboat.models.user import User
from rowboat.util.decos import authed
auth = Blueprint('auth', __name__, url_prefix='/api/auth')
def token_updater(token):
pass
def make_discord_ses... | 26.705128 | 88 | 0.68555 |
93dcabc795b1ae1d0a1a68e0a010658945c77f54 | 7,197 | py | Python | Data Call/assignment3.py | carloskame/Intelligence | c6e209f4ad4195b1bf1e633afbb21eb5d0b3bc27 | [
"Apache-2.0"
] | null | null | null | Data Call/assignment3.py | carloskame/Intelligence | c6e209f4ad4195b1bf1e633afbb21eb5d0b3bc27 | [
"Apache-2.0"
] | null | null | null | Data Call/assignment3.py | carloskame/Intelligence | c6e209f4ad4195b1bf1e633afbb21eb5d0b3bc27 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from datetime import timedelta
from sklearn.cluster import KMeans
import matplotlib.pyplot as plt
import matplotlib
matplotlib.style.use('ggplot') # Look Pretty
#
# INFO: This dataset has call records for 10 users tracked over the course of 3 years.
# Your job is to find out where the users likely... | 41.601156 | 133 | 0.722384 |
d9812c011e656d8efd1e36f40cce467c50612f8b | 867 | py | Python | mmdet/core/evaluation/__init__.py | 13952522076/mmdet | 5bd89c317e3b76211210e58ff64c708e56503f54 | [
"Apache-2.0"
] | 1 | 2020-09-09T23:23:54.000Z | 2020-09-09T23:23:54.000Z | mmdet/core/evaluation/__init__.py | 13952522076/mmdet | 5bd89c317e3b76211210e58ff64c708e56503f54 | [
"Apache-2.0"
] | null | null | null | mmdet/core/evaluation/__init__.py | 13952522076/mmdet | 5bd89c317e3b76211210e58ff64c708e56503f54 | [
"Apache-2.0"
] | null | null | null | from .class_names import (cityscapes_classes, coco_classes, dataset_aliases,
get_classes, imagenet_det_classes,
imagenet_vid_classes, voc_classes)
from .eval_hooks import DistEvalHook, EvalHook
from .mean_ap import average_precision, eval_map, print_map_summary
from .... | 51 | 102 | 0.735871 |
68bc89d730b08a265a8fdfd6b6a7bc7f3142fe21 | 5,623 | py | Python | tests/pytests/scenarios/blackout/conftest.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | tests/pytests/scenarios/blackout/conftest.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | tests/pytests/scenarios/blackout/conftest.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | import shutil
import textwrap
import time
import attr
import pytest
@attr.s
class BlackoutPillar:
pillar_state_tree = attr.ib(repr=False)
salt_cli = attr.ib(repr=False)
top_file = attr.ib(init=False)
minion_1_id = attr.ib(repr=False)
minion_1_pillar = attr.ib(init=False)
minion_2_id = attr.ib... | 31.768362 | 88 | 0.609461 |
f4765b6be80a3788ebd86f4154a82eb7088cbd77 | 1,566 | py | Python | src/deezer/resources/track.py | prndrbr/deezer-python | 2ba9f4e5188207d2305eea2629405e13c7ee68ab | [
"MIT"
] | null | null | null | src/deezer/resources/track.py | prndrbr/deezer-python | 2ba9f4e5188207d2305eea2629405e13c7ee68ab | [
"MIT"
] | null | null | null | src/deezer/resources/track.py | prndrbr/deezer-python | 2ba9f4e5188207d2305eea2629405e13c7ee68ab | [
"MIT"
] | null | null | null | from __future__ import annotations
import datetime as dt
from typing import TYPE_CHECKING
from ..dates import parse_date
from .artist import Artist
from .resource import Resource
if TYPE_CHECKING:
from .album import Album
class Track(Resource):
"""
To work with Deezer track objects.
Check the :dee... | 22.695652 | 76 | 0.663474 |
4ad23c91aaa8253eb5dbdb3834b5dab371c240fb | 857 | py | Python | scripts/wifi_captive_portal.py | harmony-tech/goSecure | 186e97aff9711cbfcd72a6ebd674708bce7980c8 | [
"CC0-1.0"
] | null | null | null | scripts/wifi_captive_portal.py | harmony-tech/goSecure | 186e97aff9711cbfcd72a6ebd674708bce7980c8 | [
"CC0-1.0"
] | null | null | null | scripts/wifi_captive_portal.py | harmony-tech/goSecure | 186e97aff9711cbfcd72a6ebd674708bce7980c8 | [
"CC0-1.0"
] | null | null | null | import mechanize
def captive_portal(wifi_ssid, cp_username, cp_password):
br = mechanize.Browser()
br.set_handle_equiv(True)
br.set_handle_gzip(True)
br.set_handle_redirect(True)
br.set_handle_referer(True)
br.set_handle_robots(False)
br.set_handle_refresh(mechanize._http.HTTPRefreshProc... | 23.162162 | 141 | 0.630105 |
d22459dfadecaf2dfcab274535ba74ebd077ffe2 | 9,642 | py | Python | Components/plark-game/plark_game/agents/basic/nn_agent.py | vakker/plark_ai_public | ea17b0f475b3c1927a7bb249eef8db54c2be093f | [
"Apache-2.0"
] | 2 | 2021-02-28T16:20:18.000Z | 2021-03-02T11:58:05.000Z | Components/plark-game/plark_game/agents/basic/nn_agent.py | vakker/plark_ai_public | ea17b0f475b3c1927a7bb249eef8db54c2be093f | [
"Apache-2.0"
] | 4 | 2021-02-26T16:06:27.000Z | 2021-03-03T09:51:59.000Z | Components/plark-game/plark_game/agents/basic/nn_agent.py | vakker/plark_ai_public | ea17b0f475b3c1927a7bb249eef8db54c2be093f | [
"Apache-2.0"
] | 6 | 2021-02-19T18:41:57.000Z | 2021-03-05T06:02:17.000Z | from plark_game.classes.agent import Agent
from plark_game.classes.observation import Observation
import numpy as np
import torch
import datetime
import os
import json
import csv
#One should never instantiate an NNAgent - one should always instantiate one of its
#subclasses
class NNAgent(Agent):
def __init__(s... | 35.579336 | 91 | 0.629537 |
d36d17a0d6392b0bef0ede71936667aa7d1d613f | 1,577 | py | Python | venv/Lib/site-packages/statsmodels/tsa/statespace/tests/test_forecasting.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 6,931 | 2015-01-01T11:41:55.000Z | 2022-03-31T17:03:24.000Z | venv/Lib/site-packages/statsmodels/tsa/statespace/tests/test_forecasting.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 6,137 | 2015-01-01T00:33:45.000Z | 2022-03-31T22:53:17.000Z | venv/Lib/site-packages/statsmodels/tsa/statespace/tests/test_forecasting.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 2,608 | 2015-01-02T21:32:31.000Z | 2022-03-31T07:38:30.000Z | r"""
Tests for forecasting-related features not tested elsewhere
"""
import numpy as np
import pandas as pd
import pytest
from numpy.testing import assert_allclose
from statsmodels.tsa.statespace import sarimax
@pytest.mark.parametrize('data', ['list', 'numpy', 'range', 'date', 'period'])
def test_append_multistep... | 31.54 | 78 | 0.629677 |
342166ab7948ddcadcedb6d7f35b58309e33788c | 1,388 | py | Python | bravado/http_client.py | analogue/swagger-py | ded3a811579ea4e0d1adb3582b90d8d941b7fb17 | [
"BSD-3-Clause"
] | null | null | null | bravado/http_client.py | analogue/swagger-py | ded3a811579ea4e0d1adb3582b90d8d941b7fb17 | [
"BSD-3-Clause"
] | 2 | 2016-12-14T07:33:33.000Z | 2017-05-11T13:40:48.000Z | bravado/http_client.py | Cloudlock/bravado | bacf49ea9d791ec9f564a3a141c77995d2f395b0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
APP_FORM = 'application/x-www-form-urlencoded'
MULT_FORM = 'multipart/form-data'
class HttpClient(object):
"""Interface for a minimal HTTP client that can retrieve Swagger specs
and perform HTTP calls to fulfill a Swagger operation.
"""
def request(self, request_params, operati... | 42.060606 | 78 | 0.670029 |
8e5619530a72ae6b732cbb0d2a43c838f0cffa6a | 10,258 | py | Python | edgedb/server/pgsql/compiler/typecomp.py | jonathanslenders/edgedb | 35ad66c4bd525cd9966f8029e5b385e888323f82 | [
"Apache-2.0"
] | 1 | 2021-12-15T09:34:48.000Z | 2021-12-15T09:34:48.000Z | edgedb/server/pgsql/compiler/typecomp.py | jonathanslenders/edgedb | 35ad66c4bd525cd9966f8029e5b385e888323f82 | [
"Apache-2.0"
] | null | null | null | edgedb/server/pgsql/compiler/typecomp.py | jonathanslenders/edgedb | 35ad66c4bd525cd9966f8029e5b385e888323f82 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... | 35.010239 | 78 | 0.456522 |
80a96c3a8cee971c836af9179b0ae75ed8979aff | 5,703 | py | Python | pandas/tests/window/test_dtypes.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 2 | 2022-02-27T04:02:18.000Z | 2022-03-01T03:48:47.000Z | pandas/tests/window/test_dtypes.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 1 | 2022-02-12T20:25:37.000Z | 2022-02-25T22:34:54.000Z | pandas/tests/window/test_dtypes.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 2 | 2022-02-27T04:02:19.000Z | 2022-03-01T03:49:21.000Z | import numpy as np
import pytest
from pandas.core.dtypes.common import pandas_dtype
from pandas import (
NA,
DataFrame,
Series,
)
import pandas._testing as tm
from pandas.core.base import DataError
# gh-12373 : rolling functions error on float32 data
# make sure rolling functions works for different dtyp... | 33.156977 | 88 | 0.4936 |
3ebf81676370a3413af1f6dc7bee453080f5db39 | 13,663 | py | Python | e-book/CreateE-book.py | inferno986return/Illustrated-Patience-Games-ebook | e8c9f6b4d4de78a371ed3f881941a51ecb9f3f2d | [
"CC0-1.0"
] | 6 | 2019-06-07T07:55:27.000Z | 2022-01-25T06:07:24.000Z | e-book/CreateE-book.py | inferno986return/Illustrated-Patience-Games-ebook | e8c9f6b4d4de78a371ed3f881941a51ecb9f3f2d | [
"CC0-1.0"
] | null | null | null | e-book/CreateE-book.py | inferno986return/Illustrated-Patience-Games-ebook | e8c9f6b4d4de78a371ed3f881941a51ecb9f3f2d | [
"CC0-1.0"
] | 1 | 2021-02-28T09:42:07.000Z | 2021-02-28T09:42:07.000Z | #!/usr/bin/env python
#CreateE-book.py - Combines GenMetadata.py and GenEpub.py into one easy script.
#GenMetadata.py - Generates the content.opf and toc.ncx files from the metadata.json file.
#opf = "OEBPS/content.opf"
#ncx = "OEBPS/toc.ncx"
#JSON extraction magic
import os
import time
import json
from collection... | 42.04 | 250 | 0.592915 |
793418f1650ecb662a5719ac2851e60525c44abc | 977 | py | Python | convert_tflite.py | YuBeomGon/object_detection | 4d204dfb12a829b55e09546526ed5237ece3167d | [
"Apache-2.0"
] | null | null | null | convert_tflite.py | YuBeomGon/object_detection | 4d204dfb12a829b55e09546526ed5237ece3167d | [
"Apache-2.0"
] | null | null | null | convert_tflite.py | YuBeomGon/object_detection | 4d204dfb12a829b55e09546526ed5237ece3167d | [
"Apache-2.0"
] | null | null | null | import argparse
import tensorflow as tf
def convert_tflite(saved_model_dir_path, out_path):
""" Convert exported graph to tflite model
Args:
saved_model_dir_path: exported graph directory path
out_path: converted tflite output file path
Returns:
None
"""
converter = tf.lite... | 31.516129 | 96 | 0.717503 |
1a5c1d10aed18c4f31dd8847242ae47c05386975 | 1,459 | py | Python | nodedge/blocks/autogen/operator/mod_block.py | Nodedge/nodedge | 5658269a1841f33b3c42d6f79b8b50411e105787 | [
"MIT"
] | 7 | 2020-03-25T19:54:56.000Z | 2021-06-09T04:43:58.000Z | nodedge/blocks/autogen/operator/mod_block.py | Nodedge/nodedge | 5658269a1841f33b3c42d6f79b8b50411e105787 | [
"MIT"
] | 9 | 2020-01-17T10:47:54.000Z | 2021-05-30T12:40:28.000Z | nodedge/blocks/autogen/operator/mod_block.py | nodedge/nodedge | 5658269a1841f33b3c42d6f79b8b50411e105787 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
from operator import mod
from typing import List
from nodedge.blocks.block import Block
from nodedge.blocks.block_config import BLOCKS_ICONS_PATH, registerNode
from nodedge.blocks.block_exception import EvaluationError
from nodedge.socket_type import SocketType
_LOG = logging.ge... | 28.057692 | 83 | 0.686086 |
7de3017b60d2a679e2c89f9709594ef3b2329987 | 735 | py | Python | grp_modules/util/log/visdom/plot_scalar.py | JGU-VC/activation-pattern-analysis | 14da42ad541ee4faf35d360a6e871fd44decd33d | [
"MIT"
] | null | null | null | grp_modules/util/log/visdom/plot_scalar.py | JGU-VC/activation-pattern-analysis | 14da42ad541ee4faf35d360a6e871fd44decd33d | [
"MIT"
] | null | null | null | grp_modules/util/log/visdom/plot_scalar.py | JGU-VC/activation-pattern-analysis | 14da42ad541ee4faf35d360a6e871fd44decd33d | [
"MIT"
] | null | null | null | import numpy as np
def plot_scalar(state, Y, X=None, title="Scalar", **kwargs):
if X is None:
X = state["main.examples_seen"]
# plotname & title
pname = "scalar-" + title
kwargs["title"] = title
# assure right format
if not isinstance(Y, np.ndarray):
Y = np.array(Y).reshape([... | 22.272727 | 60 | 0.557823 |
f5c90839f61494091f03fa8d3c7dbf158fab55a7 | 129 | py | Python | ado/apps/buses/admin.py | edderleonardo/ado | fa3478e3aa55b71e7627a9b5017fa2fbff196c31 | [
"BSD-3-Clause"
] | null | null | null | ado/apps/buses/admin.py | edderleonardo/ado | fa3478e3aa55b71e7627a9b5017fa2fbff196c31 | [
"BSD-3-Clause"
] | null | null | null | ado/apps/buses/admin.py | edderleonardo/ado | fa3478e3aa55b71e7627a9b5017fa2fbff196c31 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
from ado.apps.buses.models import Bus, Seat
admin.site.register(Bus)
admin.site.register(Seat)
| 21.5 | 43 | 0.806202 |
3137ef1b8ecfce856f761a91382f8a16c724f6ef | 552 | py | Python | test/test_help.py | gaenrique/uqcsbot | c79656f06ced4c9fd386f2439b546cc6031e7d5e | [
"MIT"
] | 38 | 2017-04-13T01:15:05.000Z | 2021-07-25T08:22:20.000Z | test/test_help.py | gaenrique/uqcsbot | c79656f06ced4c9fd386f2439b546cc6031e7d5e | [
"MIT"
] | 302 | 2017-04-13T01:20:26.000Z | 2021-04-06T07:08:29.000Z | test/test_help.py | gaenrique/uqcsbot | c79656f06ced4c9fd386f2439b546cc6031e7d5e | [
"MIT"
] | 54 | 2017-05-04T23:18:29.000Z | 2021-04-07T17:57:16.000Z | from test.conftest import MockUQCSBot, TEST_CHANNEL_ID
def test_help_help(uqcsbot: MockUQCSBot):
"""
Tests `!help help`
"""
uqcsbot.post_message(TEST_CHANNEL_ID, '!help help')
messages = uqcsbot.test_messages.get(TEST_CHANNEL_ID, [])
assert len(messages) == 2
assert messages[-1]['text'] ==... | 39.428571 | 91 | 0.599638 |
8c43084d48ddc13c35cedaba2974ba84ccef130d | 15,187 | py | Python | c7n/schema.py | coingraham/cloud-custodian | 907e4e789a0a67e8e196af38a66b4ba8352e0294 | [
"Apache-2.0"
] | null | null | null | c7n/schema.py | coingraham/cloud-custodian | 907e4e789a0a67e8e196af38a66b4ba8352e0294 | [
"Apache-2.0"
] | null | null | null | c7n/schema.py | coingraham/cloud-custodian | 907e4e789a0a67e8e196af38a66b4ba8352e0294 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2017 Capital One Services, 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 agreed ... | 35.903073 | 123 | 0.536116 |
11102618b9e6e3fe4b8acb04dfd9ba38dc04cdb5 | 17,804 | py | Python | cryptos/main.py | cfd2000/pybitcointool | 96e7843226d76cfe73b2ab0660cc89add490d76a | [
"MIT"
] | 230 | 2017-12-07T07:49:39.000Z | 2022-03-27T10:08:16.000Z | cryptos/main.py | cfd2000/pybitcointool | 96e7843226d76cfe73b2ab0660cc89add490d76a | [
"MIT"
] | 26 | 2017-12-19T15:09:57.000Z | 2022-02-25T14:13:56.000Z | cryptos/main.py | cfd2000/pybitcointool | 96e7843226d76cfe73b2ab0660cc89add490d76a | [
"MIT"
] | 145 | 2017-12-20T11:45:55.000Z | 2022-03-05T08:07:32.000Z | #!/usr/bin/python
from .py2specials import *
from .py3specials import *
import binascii
import hashlib
import re
import base64
import time
import random
import hmac
from .ripemd import *
# Elliptic curve parameters (secp256k1)
P = 2**256 - 2**32 - 977
N = 11579208923731619542357098500868790785283756427907490438260516... | 29.331137 | 108 | 0.6316 |
e2194de61eb0dc40c5f111a316814ffb36ca4f66 | 4,627 | py | Python | shingetsu/title.py | namuyan/saku | d2b7b2b0c61d5a5f33423541c56993d5f25f76b2 | [
"BSD-2-Clause"
] | null | null | null | shingetsu/title.py | namuyan/saku | d2b7b2b0c61d5a5f33423541c56993d5f25f76b2 | [
"BSD-2-Clause"
] | null | null | null | shingetsu/title.py | namuyan/saku | d2b7b2b0c61d5a5f33423541c56993d5f25f76b2 | [
"BSD-2-Clause"
] | null | null | null | """Title Utilities.
"""
#
# Copyright (c) 2005-2014 shinGETsu Project.
# 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
# no... | 27.05848 | 85 | 0.634969 |
5feef1aec23319488d2a499038c4aa0b080558cb | 152 | py | Python | pytoan/tree/decision_tree.py | toandaominh1997/pytoan | e0abf302960d44647ae8a4a5b9cc9c12e682e208 | [
"MIT"
] | 6 | 2019-06-10T16:04:23.000Z | 2020-11-28T11:26:19.000Z | pytoan/tree/decision_tree.py | toandaominh1997/pytoan | e0abf302960d44647ae8a4a5b9cc9c12e682e208 | [
"MIT"
] | null | null | null | pytoan/tree/decision_tree.py | toandaominh1997/pytoan | e0abf302960d44647ae8a4a5b9cc9c12e682e208 | [
"MIT"
] | 1 | 2020-01-04T11:36:56.000Z | 2020-01-04T11:36:56.000Z |
class DecisionNode(object):
def __init__(self):
pass
class DecisionTree(object):
def _build_tree(self, X, y):
pass
| 10.857143 | 32 | 0.585526 |
d747e39d25a7d20ada6d387d14897f3aaa1cb1dc | 124,921 | py | Python | torch/distributed/distributed_c10d.py | ZIZUN/pytorch | f565167fbdf607f3b0b95f077b11f2f78716c217 | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | torch/distributed/distributed_c10d.py | ZIZUN/pytorch | f565167fbdf607f3b0b95f077b11f2f78716c217 | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | torch/distributed/distributed_c10d.py | ZIZUN/pytorch | f565167fbdf607f3b0b95f077b11f2f78716c217 | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | import contextlib
import io
import logging
import os
import pickle
import time
import warnings
from datetime import timedelta
from typing import Callable, Dict, Optional, Tuple, Union
import torch
from torch._C._distributed_c10d import (
AllreduceCoalescedOptions,
AllreduceOptions,
AllToAllOptions,
Bar... | 38.723187 | 125 | 0.629838 |
eefe5ae363e611ea61310f695cfaf3a5a8f17142 | 8,048 | py | Python | PointNetGPD/model/pointnet.py | peter0749/PointNetGPD | 5e2be543057657f1faaef87e80074d392823e5df | [
"MIT"
] | null | null | null | PointNetGPD/model/pointnet.py | peter0749/PointNetGPD | 5e2be543057657f1faaef87e80074d392823e5df | [
"MIT"
] | null | null | null | PointNetGPD/model/pointnet.py | peter0749/PointNetGPD | 5e2be543057657f1faaef87e80074d392823e5df | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
class STN3d(nn.Module):
def __init__(self, num_points = 2500, input_chann = 3):
super(STN3d, self).__init__()
self.num_points = num_points
self.conv1 = torch.nn.Conv1d(... | 36.917431 | 117 | 0.572565 |
45a14116decead32ceda5d8d246aa7c7df62e192 | 1,695 | py | Python | vergeml/operations/resize.py | cclauss/vergeml | 3403574db9c1df232809ddf85bbc415c60d35c7c | [
"MIT"
] | 1 | 2018-11-05T02:02:14.000Z | 2018-11-05T02:02:14.000Z | vergeml/operations/resize.py | cclauss/vergeml | 3403574db9c1df232809ddf85bbc415c60d35c7c | [
"MIT"
] | null | null | null | vergeml/operations/resize.py | cclauss/vergeml | 3403574db9c1df232809ddf85bbc415c60d35c7c | [
"MIT"
] | null | null | null | from vergeml.img import ImageType
from vergeml.operation import OperationPlugin, operation
from vergeml.option import option
from PIL import Image
@operation('resize', topic="image", descr="Resize an image to a fixed size.")
@option('width', type=int, descr="Width of the new size.", validate='>0')
@option('height', ty... | 40.357143 | 115 | 0.646018 |
ca1de0fb15aba63ea15018ac88f7b355e4884cea | 339 | py | Python | packages/pycom/v1.18.2/esp32/stubs/crypto.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 18 | 2019-07-11T13:31:09.000Z | 2022-01-27T06:38:40.000Z | packages/pycom/v1.18.2/esp32/stubs/crypto.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 9 | 2019-09-01T21:44:49.000Z | 2022-02-04T20:55:08.000Z | packages/pycom/v1.18.2/esp32/stubs/crypto.py | TheVinhLuong102/micropy-stubs | 55ff1773008f7c4dfc3d70a403986486226eb6b3 | [
"MIT"
] | 6 | 2019-10-08T05:31:21.000Z | 2021-04-22T10:21:01.000Z | """
Module: 'crypto' on WiPy 07a52e4
"""
# MCU: (sysname='WiPy', nodename='WiPy', release='1.18.2', version='07a52e4-dirty on 2019-07-26', machine='WiPy with ESP32')
# Stubber: 1.2.0
class AES:
''
MODE_CBC = 2
MODE_CFB = 3
MODE_CTR = 6
MODE_ECB = 1
SEGMENT_128 = 128
SEGMENT_8 = 8
def getran... | 18.833333 | 124 | 0.610619 |
c3d1b76f992a8cb8b4d6d668e881a4453b8b63cc | 905 | py | Python | test_calc_avg_HR.py | cdong223/hr-sentiner-server | acaf712b910ee0c265d8fbba9af615a53e5c861b | [
"Unlicense"
] | null | null | null | test_calc_avg_HR.py | cdong223/hr-sentiner-server | acaf712b910ee0c265d8fbba9af615a53e5c861b | [
"Unlicense"
] | null | null | null | test_calc_avg_HR.py | cdong223/hr-sentiner-server | acaf712b910ee0c265d8fbba9af615a53e5c861b | [
"Unlicense"
] | null | null | null | import pytest
@pytest.mark.parametrize("list, expected", [
([110, 113, 90], 104),
([84], 84),
([95, 94], 94),
([61, 51], 56),
([114, 94, 130, 123], 115),
... | 31.206897 | 63 | 0.376796 |
bb8b8c8caa675a79ce5693bb5240c55e0094eeb8 | 154,357 | py | Python | tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py | crazystick/python-aiplatform | e29ca0cb38fb86be21c330a1c5e51828b14de125 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py | crazystick/python-aiplatform | e29ca0cb38fb86be21c330a1c5e51828b14de125 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py | crazystick/python-aiplatform | e29ca0cb38fb86be21c330a1c5e51828b14de125 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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... | 38.473829 | 130 | 0.682632 |
427fc6f66aa75b58d7bccfe82420d8d9ba26f6ca | 9,092 | py | Python | test/functional/example_test.py | JimmyNLose/Sant_rOyOS_SV | 829036a6770fee27bad506911b245e9161795568 | [
"OML"
] | null | null | null | test/functional/example_test.py | JimmyNLose/Sant_rOyOS_SV | 829036a6770fee27bad506911b245e9161795568 | [
"OML"
] | null | null | null | test/functional/example_test.py | JimmyNLose/Sant_rOyOS_SV | 829036a6770fee27bad506911b245e9161795568 | [
"OML"
] | 1 | 2020-06-13T18:41:58.000Z | 2020-06-13T18:41:58.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2019 Bitcoin Association
# Copyright (c) 2020* Jimmy N. Lose
# * Gregorian calendar years
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""An example functional test
The module-level docstrin... | 38.525424 | 118 | 0.66905 |
d6b0e88fa01f94bdc024962a83e4406e50943775 | 5,864 | py | Python | tfx/extensions/google_cloud_ai_platform/trainer/component.py | johnPertoft/tfx | c6335684a54651adbcbe50aa52918b9b9948326e | [
"Apache-2.0"
] | null | null | null | tfx/extensions/google_cloud_ai_platform/trainer/component.py | johnPertoft/tfx | c6335684a54651adbcbe50aa52918b9b9948326e | [
"Apache-2.0"
] | null | null | null | tfx/extensions/google_cloud_ai_platform/trainer/component.py | johnPertoft/tfx | c6335684a54651adbcbe50aa52918b9b9948326e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 53.309091 | 80 | 0.688608 |
1b3a804e22f62b4b0563622a4378b85f2ae7366b | 813 | py | Python | pinax/apps/tribes/urls.py | alibrahim/pinax | d05cc8d75795e0f63db974fa96b1baa3de331f91 | [
"MIT"
] | 1 | 2016-05-09T15:23:14.000Z | 2016-05-09T15:23:14.000Z | pinax/apps/tribes/urls.py | alibrahim/pinax | d05cc8d75795e0f63db974fa96b1baa3de331f91 | [
"MIT"
] | null | null | null | pinax/apps/tribes/urls.py | alibrahim/pinax | d05cc8d75795e0f63db974fa96b1baa3de331f91 | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import *
from tribes.models import Tribe
from groups.bridge import ContentBridge
bridge = ContentBridge(Tribe, 'tribes')
urlpatterns = patterns('tribes.views',
url(r'^$', 'tribes', name="tribe_list"),
url(r'^create/$', 'create', name="tribe_create"),
url(r'^your_tribes/$... | 36.954545 | 91 | 0.664207 |
a7c92d8d59370512c62f68733854e1f6eb93e0d5 | 2,987 | py | Python | examples/flaskr/flaskr/flaskr.py | vthriller/flask-kajiki | eadaa0aa45d23507066758b9e74091bddbc943c4 | [
"BSD-3-Clause"
] | null | null | null | examples/flaskr/flaskr/flaskr.py | vthriller/flask-kajiki | eadaa0aa45d23507066758b9e74091bddbc943c4 | [
"BSD-3-Clause"
] | null | null | null | examples/flaskr/flaskr/flaskr.py | vthriller/flask-kajiki | eadaa0aa45d23507066758b9e74091bddbc943c4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Flaskr
~~~~~~
A microblog example application written as Flask tutorial with
Flask and sqlite3.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
from sqlite3 import dbapi2 as sqlite3
from flask import Flask, request... | 26.433628 | 77 | 0.649146 |
aae478dfeaadc4d70beb4c3a212570923807f8c1 | 3,156 | py | Python | mcs_dtw/sound.py | CGuichardMasterDL/MCS_DTW | e3bc1fac3599774e1a5182bbd9e55bebdac44a94 | [
"MIT"
] | 2 | 2019-10-22T08:20:23.000Z | 2019-10-22T08:20:49.000Z | mcs_dtw/sound.py | CGuichardMasterDL/MCS_DTW | e3bc1fac3599774e1a5182bbd9e55bebdac44a94 | [
"MIT"
] | 1 | 2019-11-21T20:52:58.000Z | 2019-11-21T20:52:58.000Z | mcs_dtw/sound.py | CGuichardMasterDL/MCS_DTW | e3bc1fac3599774e1a5182bbd9e55bebdac44a94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Objet son -> contient la matrice mfcc d'un fichier audio.
+ des informations sur le fichier (locuteur etc) utiles pour l'étude
"""
#========== IMPORT ==========#
import pickle
import numpy
import librosa
#========== CLASSE ==========#
class Sound(object):
"""
Objet s... | 27.684211 | 98 | 0.547529 |
14086438c4e381e26d4670cbd18dd8ca1f083197 | 361 | py | Python | src/addlib/setup.py | idanmiara/addlib | de6399a6e1e0ba90d510dbf2d9996d603b6cd351 | [
"MIT"
] | null | null | null | src/addlib/setup.py | idanmiara/addlib | de6399a6e1e0ba90d510dbf2d9996d603b6cd351 | [
"MIT"
] | null | null | null | src/addlib/setup.py | idanmiara/addlib | de6399a6e1e0ba90d510dbf2d9996d603b6cd351 | [
"MIT"
] | null | null | null | from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
name = "addlib_py"
ext_modules = Extension(
name=name,
sources=["addlib_py.pyx"],
language="c++",
libraries=["addlib"],
library_dirs=["."],
include_dirs=["."]
)
setup(
name=name,
... | 20.055556 | 41 | 0.684211 |
88913250d7b514e4fe64c72934e12496d4adb6cc | 12,287 | py | Python | src/reporter/tests/test_1TNE1A.py | juliozinga/ngsi-timeseries-api | c4824377d97dc7f061a65118df07a3d22fe3a516 | [
"MIT"
] | null | null | null | src/reporter/tests/test_1TNE1A.py | juliozinga/ngsi-timeseries-api | c4824377d97dc7f061a65118df07a3d22fe3a516 | [
"MIT"
] | null | null | null | src/reporter/tests/test_1TNE1A.py | juliozinga/ngsi-timeseries-api | c4824377d97dc7f061a65118df07a3d22fe3a516 | [
"MIT"
] | 1 | 2020-06-14T19:57:59.000Z | 2020-06-14T19:57:59.000Z | from conftest import QL_URL, crate_translator as translator
from datetime import datetime
from reporter.tests.utils import insert_test_data
from utils.common import assert_equal_time_index_arrays
import pytest
import requests
entity_type = 'Room'
attr_name = 'temperature'
n_days = 6
def query_url(values=False):
... | 28.181193 | 80 | 0.569871 |
750f950d84e7758d72209b68dcb2eebcce0b7abc | 7,720 | py | Python | savefeat_source.py | munanning/MADA | bc004300d80c1fefe7293c9373732952c513c346 | [
"MIT"
] | 22 | 2021-09-03T03:19:24.000Z | 2022-03-11T02:45:20.000Z | savefeat_source.py | munanning/MADA | bc004300d80c1fefe7293c9373732952c513c346 | [
"MIT"
] | 5 | 2021-09-14T12:22:11.000Z | 2022-01-26T17:23:32.000Z | savefeat_source.py | munanning/MADA | bc004300d80c1fefe7293c9373732952c513c346 | [
"MIT"
] | 2 | 2021-11-18T08:29:48.000Z | 2022-01-06T09:00:27.000Z | import argparse
import os
import random
import shutil
import sys
import numpy as np
import torch
import torch.nn.functional as F
import yaml
# import torchvision.models as models
# import torchvision
# from visdom import Visdom
_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'utils')
sys.path.append... | 34.618834 | 118 | 0.573187 |
72080a9542b6a289bbca11ef1cc04d9a54888f27 | 39,304 | py | Python | src/mondrianforest_utils.py | AlbertoMoretto/mondrianforest | 6456729cdab652d4d04ffa107c91eab404826b99 | [
"MIT"
] | null | null | null | src/mondrianforest_utils.py | AlbertoMoretto/mondrianforest | 6456729cdab652d4d04ffa107c91eab404826b99 | [
"MIT"
] | null | null | null | src/mondrianforest_utils.py | AlbertoMoretto/mondrianforest | 6456729cdab652d4d04ffa107c91eab404826b99 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# contains a bunch of functions that are shared across multiple files
# ./mondrianforest_utils.py will give a detailed log
import sys
import math
import optparse
import cPickle as pickle
import numpy as np
import random
from itertools import izip
import scipy.io
import pandas as pd
from warnings ... | 43.574279 | 140 | 0.625178 |
2875e30ae590919307dac51c8108cd2fe9ec80fd | 9,782 | py | Python | ryu/app/my_arp_v3_topo_2.py | umkcdcrg01/ryu_openflow | 37ed5b88f7d119344e07c95314a7450235c037a8 | [
"Apache-2.0"
] | null | null | null | ryu/app/my_arp_v3_topo_2.py | umkcdcrg01/ryu_openflow | 37ed5b88f7d119344e07c95314a7450235c037a8 | [
"Apache-2.0"
] | null | null | null | ryu/app/my_arp_v3_topo_2.py | umkcdcrg01/ryu_openflow | 37ed5b88f7d119344e07c95314a7450235c037a8 | [
"Apache-2.0"
] | null | null | null | # Simple Arp Handler v3 for topology 2
# Jack Zhao
# s.zhao.j@gmail.com
from operator import attrgetter
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set... | 47.717073 | 150 | 0.608669 |
3799e9b3edba2aadaf194f45549a8fef25de8037 | 4,612 | py | Python | tests/splinter/pages/dummy.py | thomasmost/stere | f10ae1a40269c1642b9da49df06936fafb9b4a5b | [
"MIT"
] | null | null | null | tests/splinter/pages/dummy.py | thomasmost/stere | f10ae1a40269c1642b9da49df06936fafb9b4a5b | [
"MIT"
] | null | null | null | tests/splinter/pages/dummy.py | thomasmost/stere | f10ae1a40269c1642b9da49df06936fafb9b4a5b | [
"MIT"
] | null | null | null | from stere import Page
from stere.areas import Area, Repeating, RepeatingArea
from stere.fields import (
Button,
Checkbox,
Dropdown,
Field,
Input,
Link,
Root,
Text,
)
class CSSDropdown(Dropdown):
"""A Dropdown that's customized to hover over the element before attempting
a sele... | 34.162963 | 79 | 0.587598 |
1ce4e44054f8dab8b33b36b6151b5206ee81cffe | 3,809 | py | Python | TikTokDownload.py | makebl/TikTokDownload | 7cae7e7c391e35d8b9ead9d3274b560e99ec6dd4 | [
"MIT"
] | null | null | null | TikTokDownload.py | makebl/TikTokDownload | 7cae7e7c391e35d8b9ead9d3274b560e99ec6dd4 | [
"MIT"
] | null | null | null | TikTokDownload.py | makebl/TikTokDownload | 7cae7e7c391e35d8b9ead9d3274b560e99ec6dd4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Description:懒得优化这一块
@Date :2020/12/28 13:14:29
@Author :JohnserfSeed
@version :1.0
@License :(C)Copyright 2017-2020, Liugroup-NLPR-CASIA
@Mail :johnserfseed@gmail.com
'''
import requests,re,json,sys,getopt
from retrying import retry
... | 33.412281 | 188 | 0.527698 |
908841bce9c486d40b7ea0c9c16fed9e99d66c2c | 5,130 | py | Python | var/spack/repos/builtin/packages/tasmanian/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2018-11-27T03:39:44.000Z | 2021-09-06T15:50:35.000Z | var/spack/repos/builtin/packages/tasmanian/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-01-11T20:11:52.000Z | 2019-01-11T20:11:52.000Z | var/spack/repos/builtin/packages/tasmanian/package.py | HaochengLIU/spack | 26e51ff1705a4d6234e2a0cf734f93f7f95df5cb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2020-10-14T14:20:17.000Z | 2020-10-14T14:20:17.000Z | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Tasmanian(CMakePackage):
"""The Toolkit for Adaptive Stochastic Modeling and Non-Intrusive... | 40.714286 | 87 | 0.574464 |
96a4ee9d4aafd4699134882d35fa38e5299eaf2a | 228 | py | Python | pyeccodes/defs/mars/eswi/class_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 7 | 2020-04-14T09:41:17.000Z | 2021-08-06T09:38:19.000Z | pyeccodes/defs/mars/eswi/class_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | null | null | null | pyeccodes/defs/mars/eswi/class_table.py | ecmwf/pyeccodes | dce2c72d3adcc0cb801731366be53327ce13a00b | [
"Apache-2.0"
] | 3 | 2020-04-30T12:44:48.000Z | 2020-12-15T08:40:26.000Z | def load(h):
return ({'abbr': 'none', 'code': 0, 'title': 'not set, default'},
{'abbr': 'op', 'code': 80, 'title': 'SMHI Operational data'},
{'abbr': 're', 'code': 81, 'title': 'SMHI Research data'})
| 45.6 | 73 | 0.5 |
1accbcd85172db26d0e4e159d19841e9baa0a391 | 1,524 | py | Python | Medusa/matrix/addition.py | Akards/Medusa | 00f75e4baa6953e207e7766747a6dc6750c2796c | [
"MIT"
] | 1 | 2020-05-06T00:03:29.000Z | 2020-05-06T00:03:29.000Z | Medusa/matrix/addition.py | Akards/Parallel-Python | 00f75e4baa6953e207e7766747a6dc6750c2796c | [
"MIT"
] | 1 | 2020-05-06T02:19:42.000Z | 2020-05-06T02:19:42.000Z | Medusa/matrix/addition.py | Akards/Medusa | 00f75e4baa6953e207e7766747a6dc6750c2796c | [
"MIT"
] | null | null | null | import numpy as np
import multiprocessing as mp
from functools import partial
def add(A, B, proc_num):
"""
Returns added matrices A and B
Args:
A (np.array): a 2D matrix
B (np.array): another 2D matrix
proc_num (int): number of processors
Returns:
The sum of A + B
""... | 31.75 | 105 | 0.624672 |
39197f2f6a9933ae3d76e6d01f8717fe935bd201 | 874 | py | Python | crop.py | cyruschueng/love_bot | 9ec5bb6b55db77386361114287da8c83d2824daf | [
"MIT"
] | 17 | 2019-06-08T10:30:11.000Z | 2022-03-30T03:13:02.000Z | crop.py | cyruschueng/love_bot | 9ec5bb6b55db77386361114287da8c83d2824daf | [
"MIT"
] | 1 | 2019-06-15T09:50:22.000Z | 2019-06-15T09:50:22.000Z | crop.py | cyruschueng/love_bot | 9ec5bb6b55db77386361114287da8c83d2824daf | [
"MIT"
] | 6 | 2019-06-18T06:16:16.000Z | 2021-06-22T06:45:00.000Z | # -*- coding: utf-8 -*-
"""Utility functions for processing images for crop"""
import os
import sys,time
from PIL import Image,ImageEnhance
import imghdr
def cropit(file):
# im =Image.open('D:\ProgramData\Microsoft\Helpaup\jilv\WifiPhoto0820\IMG_0001.JPG')
imgType = imghdr.what(file)
if imgType!=... | 26.484848 | 89 | 0.592677 |
ee9784fba55dc8a51f48b1ae30ce7b387c1a8e68 | 14,833 | py | Python | google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py | jkasato/python-texttospeech | 9acf38c2def8022b67219c879ca0473ea7a2bf30 | [
"Apache-2.0"
] | null | null | null | google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py | jkasato/python-texttospeech | 9acf38c2def8022b67219c879ca0473ea7a2bf30 | [
"Apache-2.0"
] | null | null | null | google/cloud/texttospeech_v1beta1/services/text_to_speech/client.py | jkasato/python-texttospeech | 9acf38c2def8022b67219c879ca0473ea7a2bf30 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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 o... | 40.089189 | 106 | 0.624014 |
8e5a5c8452858f3970fc1a636fb682abcf01c56c | 945 | py | Python | primenumber.py | MathewsPeter/PythonProjects | 4ea83a317452f8abd2c9c1273753037de263f88f | [
"MIT"
] | null | null | null | primenumber.py | MathewsPeter/PythonProjects | 4ea83a317452f8abd2c9c1273753037de263f88f | [
"MIT"
] | null | null | null | primenumber.py | MathewsPeter/PythonProjects | 4ea83a317452f8abd2c9c1273753037de263f88f | [
"MIT"
] | null | null | null | from math import sqrt
def prime_normal(n):
if n <=2:
print("Not Prime")
return
for i in range(3,1+n//2):
if n%i == 0:
print("Not Prime")
return
print("Prime")
return
def prime_sqrtOptimised(n):
if n <=2:
print("Not Prime")
... | 18.529412 | 41 | 0.461376 |
eaa7b573c0e0623abc6b9c4325b117f37953c9de | 3,731 | py | Python | iBott/email_activities.py | ecrespo66/wsqsdd | 2c41efecb291fdbf88f8878ba5750b83d2ba7c6c | [
"Apache-2.0"
] | null | null | null | iBott/email_activities.py | ecrespo66/wsqsdd | 2c41efecb291fdbf88f8878ba5750b83d2ba7c6c | [
"Apache-2.0"
] | null | null | null | iBott/email_activities.py | ecrespo66/wsqsdd | 2c41efecb291fdbf88f8878ba5750b83d2ba7c6c | [
"Apache-2.0"
] | null | null | null | import smtplib
import ssl
from imap_tools import MailBox, Q, MailMessage
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from email.mime.application import MIMEApplication
from os.path import basename
import os
Query = Q
def download_attachments(self, download_folder, extension=No... | 33.017699 | 88 | 0.593943 |
b52120f33439840e0b2db451d1349c6e9f2bf7ad | 116 | py | Python | class9/exercise3/mytest/__init__.py | gleydsonm/pynet_ex | c7095b431d9d0de0e30f65d66a212a950afdb5d6 | [
"Apache-2.0"
] | null | null | null | class9/exercise3/mytest/__init__.py | gleydsonm/pynet_ex | c7095b431d9d0de0e30f65d66a212a950afdb5d6 | [
"Apache-2.0"
] | null | null | null | class9/exercise3/mytest/__init__.py | gleydsonm/pynet_ex | c7095b431d9d0de0e30f65d66a212a950afdb5d6 | [
"Apache-2.0"
] | null | null | null | from world import func1
from simple import func2
from whatever import func3
__all__ = ('func1', 'func2', 'func3')
| 16.571429 | 37 | 0.741379 |
11a876f911da031ace8a18eeb3cb75a08dd32e6c | 1,022 | py | Python | josephus/person/person.py | kriswangz/LearningTask | cc5a3446c5a09214a81c2dd0bfeb661ceaec8497 | [
"MIT"
] | 1 | 2020-04-19T16:19:37.000Z | 2020-04-19T16:19:37.000Z | josephus/person/person.py | kriswangz/LearningTask | cc5a3446c5a09214a81c2dd0bfeb661ceaec8497 | [
"MIT"
] | null | null | null | josephus/person/person.py | kriswangz/LearningTask | cc5a3446c5a09214a81c2dd0bfeb661ceaec8497 | [
"MIT"
] | null | null | null | from typing import List, Any
# 返回对象
class Person(object):
def __init__(self, name=None, age='0', gender=None) -> None:
self.name = name
self.age = age
self.gender = gender
def __eq__(self, obj) -> bool:
if self.name == obj.name and self.age == obj.age and self.gender == obj.g... | 22.217391 | 87 | 0.477495 |
f43fb3c322b60b795823735b0d60d339cdbea1e6 | 103 | py | Python | BOJ/10000~10999/10599.py | shinkeonkim/today-ps | f3e5e38c5215f19579bb0422f303a9c18c626afa | [
"Apache-2.0"
] | 2 | 2020-01-29T06:54:41.000Z | 2021-11-07T13:23:27.000Z | BOJ/10000~10999/10599.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | BOJ/10000~10999/10599.py | shinkeonkim/Today_PS | bb0cda0ee1b9c57e1cfa38355e29d0f1c6167a44 | [
"Apache-2.0"
] | null | null | null | while True:
a,b,c,d=map(int,input().split())
if a==b==c==d==0:
break
print(c-b,d-a) | 20.6 | 36 | 0.485437 |
7b082b60b3578e6c94479021ced3284a0ea903b6 | 9,070 | py | Python | tests/unit/wallet/test_headers.py | Leopere/lbry | af43b21ef6a5de5ce1fee21425bea6f8d6bf335f | [
"MIT"
] | null | null | null | tests/unit/wallet/test_headers.py | Leopere/lbry | af43b21ef6a5de5ce1fee21425bea6f8d6bf335f | [
"MIT"
] | null | null | null | tests/unit/wallet/test_headers.py | Leopere/lbry | af43b21ef6a5de5ce1fee21425bea6f8d6bf335f | [
"MIT"
] | null | null | null | from binascii import unhexlify
from torba.testcase import AsyncioTestCase
from torba.client.util import ArithUint256
from lbrynet.extras.wallet.ledger import Headers
class TestHeaders(AsyncioTestCase):
def test_deserialize(self):
self.maxDiff = None
h = Headers(':memory:')
h.io.write(HE... | 58.516129 | 100 | 0.792613 |
01aae3940d9fd72455584117b850aec6730d3309 | 3,443 | py | Python | poet_distributed/niches/box2d/box2d.py | umair-nasir14/poet | 5fd3c012b1135781d952a95564029d1cbe2ccf4f | [
"Apache-2.0"
] | 217 | 2019-04-02T09:05:56.000Z | 2022-03-15T10:41:00.000Z | poet_distributed/niches/box2d/box2d.py | umair-nasir14/poet | 5fd3c012b1135781d952a95564029d1cbe2ccf4f | [
"Apache-2.0"
] | 7 | 2019-04-09T21:46:50.000Z | 2022-03-23T07:54:23.000Z | poet_distributed/niches/box2d/box2d.py | umair-nasir14/poet | 5fd3c012b1135781d952a95564029d1cbe2ccf4f | [
"Apache-2.0"
] | 49 | 2019-04-08T23:35:09.000Z | 2022-03-23T04:35:40.000Z | # Copyright (c) 2020 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 35.494845 | 134 | 0.638397 |
a6ac127be2a7783f433d98defc458e84615faa47 | 2,336 | py | Python | zvmsdk/sdkwsgi/schemas/vswitch.py | jasealpers/python-zvm-sdk | feb19dd40915b1a6cad74e7ccda17bc76d015ea5 | [
"Apache-2.0"
] | 15 | 2019-08-14T20:15:17.000Z | 2020-09-28T01:09:48.000Z | zvmsdk/sdkwsgi/schemas/vswitch.py | jasealpers/python-zvm-sdk | feb19dd40915b1a6cad74e7ccda17bc76d015ea5 | [
"Apache-2.0"
] | 179 | 2019-09-05T03:53:10.000Z | 2020-10-09T07:21:40.000Z | zvmsdk/sdkwsgi/schemas/vswitch.py | jasealpers/python-zvm-sdk | feb19dd40915b1a6cad74e7ccda17bc76d015ea5 | [
"Apache-2.0"
] | 50 | 2019-06-14T16:51:53.000Z | 2020-08-27T05:36:38.000Z | # Copyright 2017,2018 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 33.855072 | 78 | 0.566781 |
4af3e8a3397db35a0d94f85e6d49852fa464cb71 | 30,743 | py | Python | lib/spack/spack/test/cmd/install.py | rvinaybharadwaj/spack | 03790a4f3609f1bedb7dee947c8712b0ab1e3348 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-09-02T11:55:57.000Z | 2020-09-02T11:55:57.000Z | lib/spack/spack/test/cmd/install.py | rvinaybharadwaj/spack | 03790a4f3609f1bedb7dee947c8712b0ab1e3348 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/test/cmd/install.py | rvinaybharadwaj/spack | 03790a4f3609f1bedb7dee947c8712b0ab1e3348 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-01-10T18:54:54.000Z | 2021-07-03T22:57:16.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import argparse
import os
import filecmp
import re
from six.moves import builtins
import time
import pytest
import llnl.... | 35.336782 | 91 | 0.661874 |
a00d494660071a3f539d79ccd7c4c9ca23ccd88d | 1,107 | py | Python | pepper_teleoperation/GUI_material/image_label.py | FraPorta/pepper_mediapipe_teleoperation | a42b094309e3db0d77e4c9a126683d960170d390 | [
"Apache-2.0"
] | null | null | null | pepper_teleoperation/GUI_material/image_label.py | FraPorta/pepper_mediapipe_teleoperation | a42b094309e3db0d77e4c9a126683d960170d390 | [
"Apache-2.0"
] | null | null | null | pepper_teleoperation/GUI_material/image_label.py | FraPorta/pepper_mediapipe_teleoperation | a42b094309e3db0d77e4c9a126683d960170d390 | [
"Apache-2.0"
] | null | null | null | import Tkinter as tk
# import tkFileDialog as filedialog
# import ttk
# import time
from PIL import Image, ImageTk
from itertools import count, cycle
class ImageLabel(tk.Label):
"""
A Label that displays images, and plays them if they are gifs
:im: A PIL Image instance or a string filename
"""
de... | 24.065217 | 65 | 0.551942 |
2eeac6dabaebcdf71bc10c040a51dc21e49c1fb2 | 238 | py | Python | crds/tests/__init__.py | sean-lockwood/crds | f071f59deca98aac4bee04d688805a127761f3d2 | [
"BSD-3-Clause"
] | null | null | null | crds/tests/__init__.py | sean-lockwood/crds | f071f59deca98aac4bee04d688805a127761f3d2 | [
"BSD-3-Clause"
] | 1 | 2019-04-11T18:19:16.000Z | 2019-04-11T18:19:16.000Z | crds/tests/__init__.py | sean-lockwood/crds | f071f59deca98aac4bee04d688805a127761f3d2 | [
"BSD-3-Clause"
] | null | null | null | def tstmod(module):
"""Wrap test_config.tstmod to configure standard options throughout CRDS test_config."""
import doctest
# doctest.ELLIPSIS_MARKER = '-etc-'
return doctest.testmod(module, optionflags=doctest.ELLIPSIS)
| 34 | 92 | 0.743697 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.