hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | 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 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringdate 2015-01-01 00:00:47 2022-03-31 23:42:18 ⌀ | max_issues_repo_issues_event_max_datetime stringdate 2015-01-01 17:43:30 2022-03-31 23:59:58 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 125 | 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cd5e1e26e39c56d3ae62b8fd2032ab324293acc8 | 526 | py | Python | lib/redis_set_get.py | InformaticsResearchCenter/ITeung | 2e3f76294c3affca07934293cdeb46d6d618180a | [
"MIT"
] | null | null | null | lib/redis_set_get.py | InformaticsResearchCenter/ITeung | 2e3f76294c3affca07934293cdeb46d6d618180a | [
"MIT"
] | 37 | 2020-03-22T23:21:14.000Z | 2020-09-16T15:07:06.000Z | lib/redis_set_get.py | InformaticsResearchCenter/ITeung | 2e3f76294c3affca07934293cdeb46d6d618180a | [
"MIT"
] | 1 | 2020-09-08T11:31:30.000Z | 2020-09-08T11:31:30.000Z | import redis
def set(key, value, expired):
#use None if don't want to use expired time
try:
r = redis.Redis()
r.set(name=key, value=value, ex=expired)
return True, None
except Exception as e:
return False, f'{e}'
def get(key):
#key to get value
r = redis.Redis()
... | 21.04 | 48 | 0.579848 |
cd5e82adedde50cba3e364b3ccb25d0a6e80401a | 18,185 | py | Python | FTDISPI.py | g-i-wilson/spi-tools | 1c961a97572a366235f9f3b0517d8201fa8be371 | [
"MIT"
] | 1 | 2022-03-22T20:44:01.000Z | 2022-03-22T20:44:01.000Z | FTDISPI.py | g-i-wilson/spi-tools | 1c961a97572a366235f9f3b0517d8201fa8be371 | [
"MIT"
] | null | null | null | FTDISPI.py | g-i-wilson/spi-tools | 1c961a97572a366235f9f3b0517d8201fa8be371 | [
"MIT"
] | null | null | null | from pyftdi.spi import SpiController
from pyftdi.gpio import GpioSyncController
import serial
import time
import sys
import JSONFile
dbg = False
def createByteList(addrList, dataList):
newBytes = []
for byte in addrList:
newBytes.append(byte)
for byte in dataList:
newBytes.append(byte)
... | 36.081349 | 144 | 0.534451 |
cd63c34fbdfbd183f707a4b54997655b51643809 | 3,417 | py | Python | src/onegov/gazette/views/groups.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/groups.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/gazette/views/groups.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from morepath import redirect
from onegov.core.security import Private
from onegov.gazette import _
from onegov.gazette import GazetteApp
from onegov.gazette.forms import EmptyForm
from onegov.gazette.layout import Layout
from onegov.user import UserGroup
from onegov.user import UserGroupCollection
from onegov.user.for... | 23.244898 | 66 | 0.605502 |
cd6412162ab8b14b43aaaa41358897ddfe50fe48 | 136 | py | Python | dlpt/__init__.py | damogranlabs/dlpt | e4cdbaf4b5496ed985eb255b17294aa7cf3d35e4 | [
"MIT"
] | 5 | 2021-08-09T19:39:06.000Z | 2022-03-22T11:21:29.000Z | dlpt/__init__.py | damogranlabs/dlpt | e4cdbaf4b5496ed985eb255b17294aa7cf3d35e4 | [
"MIT"
] | null | null | null | dlpt/__init__.py | damogranlabs/dlpt | e4cdbaf4b5496ed985eb255b17294aa7cf3d35e4 | [
"MIT"
] | null | null | null | from . import utils
from . import pth
from . import proc
from . import log
from . import json
from . import time
from . import importer
| 17 | 22 | 0.742647 |
cd64ffc5e28a3c1d060e7cdf2e73c1f3c1f202dd | 1,466 | py | Python | personal_utilities/fourier_filters.py | dbstein/personal_utilities | 3a4c7d2416b13a87f88fc0e400b299d648e1e541 | [
"Apache-2.0"
] | null | null | null | personal_utilities/fourier_filters.py | dbstein/personal_utilities | 3a4c7d2416b13a87f88fc0e400b299d648e1e541 | [
"Apache-2.0"
] | null | null | null | personal_utilities/fourier_filters.py | dbstein/personal_utilities | 3a4c7d2416b13a87f88fc0e400b299d648e1e541 | [
"Apache-2.0"
] | null | null | null | import numpy as np
class SimpleFourierFilter(object):
"""
Class to apply simple Fourier Filtration to a vector
Filter types:
'fraction' (requires kwarg: 'fraction' to be set)
'rule 36' (can set kwarg: 'power' but not necessary)
"""
def __init__(self, modes, filter_type, **kwargs):... | 34.093023 | 78 | 0.563438 |
cd67c54b1e46edcb715070c6ab83abb9ea55fa6d | 1,178 | py | Python | sloth/simple.py | codacy-badger/sloth | a4f2118b2f19e55271613d43c785aaf4ab030b5e | [
"MIT"
] | 1 | 2021-02-11T12:14:23.000Z | 2021-02-11T12:14:23.000Z | src/sloth/simple.py | Legorooj/sloth | 47f6358349f8545fc475efab19edd6efda3ffbcd | [
"MIT"
] | null | null | null | src/sloth/simple.py | Legorooj/sloth | 47f6358349f8545fc475efab19edd6efda3ffbcd | [
"MIT"
] | null | null | null | # ----------------------------------------------------------------------------
# Copyright (c) 2020 Legorooj <legorooj@protonmail.com>
# Copyright (c) 2020 FluffyKoalas <github.com/fluffykoalas>
# This file and all others in this project are licensed under the MIT license.
# Please see the LICENSE file in the root of t... | 32.722222 | 78 | 0.616299 |
cd682359aededb5fca5a5b75e857cce2e964a4f3 | 1,385 | py | Python | Final/P2Pchat.py | cainanBlack/csc321 | 9cebf9c3b61befda932732316b7406f1462c0bee | [
"MIT"
] | null | null | null | Final/P2Pchat.py | cainanBlack/csc321 | 9cebf9c3b61befda932732316b7406f1462c0bee | [
"MIT"
] | null | null | null | Final/P2Pchat.py | cainanBlack/csc321 | 9cebf9c3b61befda932732316b7406f1462c0bee | [
"MIT"
] | null | null | null | import netifaces
import argparse
import os
import zmq
import threading
def recieve(message):
ctx = zmq.Context.instance()
reciever = ctx.socket(zmq.SUB)
for last in range(1, 255):
reciever.connect("tcp://{0}.{1}:9000".format(message, last))
reciever.setsockopt(zmq.SUBSCRIBE, b'')
while T... | 26.634615 | 102 | 0.626715 |
cd68c200c93d96ecc3b7ad0ac3280311cd7d42ce | 1,822 | py | Python | src/playerprofile.py | MarinVlaic/AIBG | cf4960586bdb3c32f8e566c10f9f1e59e6f9ac2d | [
"MIT"
] | null | null | null | src/playerprofile.py | MarinVlaic/AIBG | cf4960586bdb3c32f8e566c10f9f1e59e6f9ac2d | [
"MIT"
] | null | null | null | src/playerprofile.py | MarinVlaic/AIBG | cf4960586bdb3c32f8e566c10f9f1e59e6f9ac2d | [
"MIT"
] | null | null | null | class PlayerProfile:
def __init__(self, id):
self.cities = []
self.resources = {
"SHEEP": 0,
"WOOD": 0,
"WHEAT": 0,
"CLAY": 0,
"IRON": 0
}
self.current_builder_intersection_position_id = None
self.id = id
sel... | 35.038462 | 110 | 0.593853 |
cd68c50658ac006c458874597809bf7939658dff | 83 | py | Python | examples/object/reference/change_list.py | zqmillet/kinopico_python_book | 0db4b0a904a1ba1b7e90cf971871e134941aeb65 | [
"MIT"
] | null | null | null | examples/object/reference/change_list.py | zqmillet/kinopico_python_book | 0db4b0a904a1ba1b7e90cf971871e134941aeb65 | [
"MIT"
] | null | null | null | examples/object/reference/change_list.py | zqmillet/kinopico_python_book | 0db4b0a904a1ba1b7e90cf971871e134941aeb65 | [
"MIT"
] | null | null | null | a = [1, 2, 3]
b = a
a[0] = 'gouliguojiashengsiyi'
print('a =', a)
print('b =', b)
| 11.857143 | 29 | 0.506024 |
cd6940cd949b8d012c79a302492e17dd59770ba1 | 2,267 | py | Python | source/CTRW.py | tangxiangong/ClassTop | fdafdafd165672ae464210fb8c66c70256d50956 | [
"MIT"
] | null | null | null | source/CTRW.py | tangxiangong/ClassTop | fdafdafd165672ae464210fb8c66c70256d50956 | [
"MIT"
] | null | null | null | source/CTRW.py | tangxiangong/ClassTop | fdafdafd165672ae464210fb8c66c70256d50956 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# @Time : 2021/12/1 13:27
import numpy as np
from numpy import random
import matplotlib.pyplot as plt
from trajectory import Trajectory
from rnd import stable_rnd, skewed_stable_rnd
class CTRW(Trajectory):
def __init__(self, t_len, ind_waiting, ind_jump, init_positi... | 27.313253 | 70 | 0.549625 |
cd6b149fb6473adbe7fd7149968a3e8e9f36d8bd | 901 | py | Python | src/conversion_spec_file_reader.py | Eldar1205/exchanger-python-demo-app | 6733ff6044555f8c4639dc6e25baf4ef51401fd9 | [
"MIT"
] | 7 | 2021-08-31T09:03:39.000Z | 2021-09-27T13:45:58.000Z | src/conversion_spec_file_reader.py | Eldar1205/exchanger-python-demo-app | 6733ff6044555f8c4639dc6e25baf4ef51401fd9 | [
"MIT"
] | null | null | null | src/conversion_spec_file_reader.py | Eldar1205/exchanger-python-demo-app | 6733ff6044555f8c4639dc6e25baf4ef51401fd9 | [
"MIT"
] | null | null | null | import aiofiles
import asyncstdlib
from pydantic.types import PositiveFloat
from conversion_parameters import ConversionParameters
from conversion_spec import ConversionSpec, Currency
from conversion_spec_provider import ConversionSpecProvider
class ConversionSpecFileReader(ConversionSpecProvider):
async def pro... | 37.541667 | 109 | 0.783574 |
cd6b1d33d27551aa6e7a920f48a0b7633b6280b3 | 3,931 | py | Python | Paris_G_1-2-3_v2.py | Gaspe-R/Rendez-vous-prefecture-Paris | e24d1bf0ae6ca5860ad858957c5e923c0ac3d85a | [
"MIT"
] | null | null | null | Paris_G_1-2-3_v2.py | Gaspe-R/Rendez-vous-prefecture-Paris | e24d1bf0ae6ca5860ad858957c5e923c0ac3d85a | [
"MIT"
] | null | null | null | Paris_G_1-2-3_v2.py | Gaspe-R/Rendez-vous-prefecture-Paris | e24d1bf0ae6ca5860ad858957c5e923c0ac3d85a | [
"MIT"
] | null | null | null | from sqlite3 import Date
from twilio.rest import Client
from datetime import datetime
from playsound import playsound
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
import csv
import time
################################ "PREFCTURE DE PARIS" ###########################... | 36.738318 | 126 | 0.522768 |
cd6d9b2b982fd93ff60ad7ad2c61547c26a40708 | 3,022 | py | Python | movo_common/si_utils/src/si_utils/my_tf_listener.py | ALAN-NUS/kinova_movo | 05a0451f5c563359ae0ffe3280e1df85caec9e55 | [
"BSD-3-Clause"
] | 1 | 2021-03-26T06:33:28.000Z | 2021-03-26T06:33:28.000Z | movo_common/si_utils/src/si_utils/my_tf_listener.py | ALAN-NUS/kinova_movo | 05a0451f5c563359ae0ffe3280e1df85caec9e55 | [
"BSD-3-Clause"
] | null | null | null | movo_common/si_utils/src/si_utils/my_tf_listener.py | ALAN-NUS/kinova_movo | 05a0451f5c563359ae0ffe3280e1df85caec9e55 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
import math
import tf
import geometry_msgs.msg
from geometry_msgs.msg import PoseStamped
from si_utils.lx_transformerROS import my_transformer
if __name__ == '__main__':
rospy.init_node('my_tf_listener')
listener = tf.TransformListener()
# my_trans = my_transformer()
... | 35.139535 | 122 | 0.634348 |
cd6e8efff351684ee42b6f8c78aec9644cacd755 | 8,661 | py | Python | acme_tiny.py | dennydai/docker-letsencrypt | 898fa70665d321e527c7fcc463a57a66dbbdab26 | [
"MIT"
] | 22 | 2015-12-06T06:19:43.000Z | 2016-03-10T06:44:34.000Z | acme_tiny.py | dennydai/docker-letsencrypt | 898fa70665d321e527c7fcc463a57a66dbbdab26 | [
"MIT"
] | 1 | 2016-09-11T07:38:45.000Z | 2016-09-11T10:50:26.000Z | acme_tiny.py | dennydai/docker-letsencrypt | 898fa70665d321e527c7fcc463a57a66dbbdab26 | [
"MIT"
] | 4 | 2015-12-22T01:25:16.000Z | 2016-01-14T13:24:27.000Z | #!/usr/bin/env python
import argparse, subprocess, json, os, os.path, urllib2, sys, base64, binascii, time, \
hashlib, re, copy, textwrap
#CA = "https://acme-staging.api.letsencrypt.org"
CA = "https://acme-v01.api.letsencrypt.org"
def get_crt(account_key, csr, acme_dir):
# helper function base64 encode for j... | 43.522613 | 221 | 0.592772 |
cd6f2ad698e4fc98b32ec95e10035f7d48a91c97 | 3,667 | py | Python | esb/Tags.py | sgbalogh/esb.py | 06e8f86b94d5dadc628a0fbd396212649328864d | [
"MIT"
] | null | null | null | esb/Tags.py | sgbalogh/esb.py | 06e8f86b94d5dadc628a0fbd396212649328864d | [
"MIT"
] | null | null | null | esb/Tags.py | sgbalogh/esb.py | 06e8f86b94d5dadc628a0fbd396212649328864d | [
"MIT"
] | null | null | null |
class Tags:
class Thematic:
ACC_NOTE = "account:note"
DELIMITER = "delimiter:thematic"
FAM_SIBLINGS = "fam:siblings"
FAM_CHILDREN = "fam:children"
FAM_PARENTS = "fam:parents"
FAM_SPOUSE = "fam:spouse"
META_NO_REMARK = "meta:no-remarks"
META_PARENT... | 35.95098 | 77 | 0.642214 |
cd6f36cb0dc0dd674280cb84b43ef766b0e9c395 | 14,691 | py | Python | Draft/08_compare_original_GBS_Exome_biallelic_variation_alle_count.py | peipeiwang6/Genomic_prediction_in_Switchgrass | 1fba3508c0d81d16e0629e3cf94ff4d174a85b13 | [
"MIT"
] | null | null | null | Draft/08_compare_original_GBS_Exome_biallelic_variation_alle_count.py | peipeiwang6/Genomic_prediction_in_Switchgrass | 1fba3508c0d81d16e0629e3cf94ff4d174a85b13 | [
"MIT"
] | null | null | null | Draft/08_compare_original_GBS_Exome_biallelic_variation_alle_count.py | peipeiwang6/Genomic_prediction_in_Switchgrass | 1fba3508c0d81d16e0629e3cf94ff4d174a85b13 | [
"MIT"
] | null | null | null | '''
imput1: exome capture, biallelic indel matrix
input2: exome capture, biallelic SNP matrix
input3: GBS, biallelic indel matrix
input4: GBS, biallelic SNP matrix
input5: allele count file for exome homozygous or heterozygous genotype
input6: allele count file for GBS homozygous or heterozygous genotype
input7: tetrap... | 39.176 | 327 | 0.571166 |
cd7225d8ec41e4d30a72fb83efb498273f5b3bbc | 132 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_frame.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 82 | 2016-06-29T17:24:43.000Z | 2021-04-16T06:49:17.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_frame.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/viper/calculators/calc_frame.py | PascalGuenther/gecko_sdk | 2e82050dc8823c9fe0e8908c1b2666fb83056230 | [
"Zlib"
] | 56 | 2016-08-02T10:50:50.000Z | 2021-07-19T08:57:34.000Z | from pyradioconfig.parts.bobcat.calculators.calc_frame import Calc_Frame_Bobcat
class calc_frame_viper(Calc_Frame_Bobcat):
pass | 33 | 79 | 0.863636 |
cd7529c73cff8550931b72e595537b4c1b291bee | 1,940 | py | Python | scripts/stats_wrapper.py | gpertea/regtools | a59d5dbd3268b0d83412e6fe81cf7e924c7bcb7c | [
"MIT"
] | 70 | 2015-08-05T21:32:51.000Z | 2021-11-26T13:26:33.000Z | scripts/stats_wrapper.py | gpertea/regtools | a59d5dbd3268b0d83412e6fe81cf7e924c7bcb7c | [
"MIT"
] | 145 | 2015-08-05T22:27:58.000Z | 2022-03-14T21:50:17.000Z | scripts/stats_wrapper.py | gpertea/regtools | a59d5dbd3268b0d83412e6fe81cf7e924c7bcb7c | [
"MIT"
] | 29 | 2015-08-01T02:19:40.000Z | 2021-12-16T20:02:40.000Z | import glob
import subprocess
import os
import argparse
import shutil
input_parser = argparse.ArgumentParser(
description="Run RegTools stats script",
)
input_parser.add_argument(
'tag',
help="Variant tag parameter used to run RegTools.",
)
args = input_parser.parse_args()
tag = args.tag
cwd = os.getcwd(... | 33.448276 | 107 | 0.676804 |
cd7892510c7f345ccc184879db2d6bb6e417c44a | 451 | py | Python | lib/model/utils/plt_loss.py | PhoneSix/Domain-Contrast | 5c674b581bce9beacf5bc0dd13113f33c4050495 | [
"MIT"
] | 4 | 2021-07-31T01:04:15.000Z | 2022-03-09T07:23:10.000Z | lib/model/utils/plt_loss.py | PhoneSix/Domain-Contrast | 5c674b581bce9beacf5bc0dd13113f33c4050495 | [
"MIT"
] | null | null | null | lib/model/utils/plt_loss.py | PhoneSix/Domain-Contrast | 5c674b581bce9beacf5bc0dd13113f33c4050495 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import os
def plt_loss(epoch, dir_, name, value):
if not os.path.exists(dir_):
os.makedirs(dir_)
axis = np.linspace(1,epoch,epoch)
label = '{}'.format(name)
fig = plt.figure()
plt.title(label)
plt.plot(axis, value)
# plt.legend()
... | 25.055556 | 47 | 0.62306 |
cd78d6e1151155e18754cebc1cc2d5b9e9efa63f | 3,267 | py | Python | ocellaris/utils/alarm.py | TormodLandet/Ocellaris | 6b4b2515fb881b1ed8d8fd8d8c23a8e1990ada58 | [
"Apache-2.0"
] | 1 | 2017-11-07T12:19:44.000Z | 2017-11-07T12:19:44.000Z | ocellaris/utils/alarm.py | TormodLandet/Ocellaris | 6b4b2515fb881b1ed8d8fd8d8c23a8e1990ada58 | [
"Apache-2.0"
] | null | null | null | ocellaris/utils/alarm.py | TormodLandet/Ocellaris | 6b4b2515fb881b1ed8d8fd8d8c23a8e1990ada58 | [
"Apache-2.0"
] | 2 | 2018-05-02T17:17:01.000Z | 2019-03-11T13:09:40.000Z | # Copyright (C) 2018-2019 Tormod Landet
# SPDX-License-Identifier: Apache-2.0
"""
A timeout context manager based on SIGALRM, Permits multiple
SIGALRM events to be queued.
Uses a `heapq` to store the objects to be called when an alarm signal is
raised, so that the next alarm is always at the top of the heap.
Note: SI... | 25.724409 | 94 | 0.653811 |
cd79597c4dc624f2537254fe68c7bb39e5b6003c | 2,549 | py | Python | apps/insar.py | giswqs/streamlit-insar | e2c0897f01aeff96cd119cce8cf6dd3d8fb0e455 | [
"MIT"
] | 5 | 2021-12-14T23:28:36.000Z | 2022-02-27T14:35:29.000Z | apps/insar.py | giswqs/streamlit-insar | e2c0897f01aeff96cd119cce8cf6dd3d8fb0e455 | [
"MIT"
] | null | null | null | apps/insar.py | giswqs/streamlit-insar | e2c0897f01aeff96cd119cce8cf6dd3d8fb0e455 | [
"MIT"
] | null | null | null | import folium
import altair as alt
import leafmap.foliumap as leafmap
import pandas as pd
import streamlit as st
def app():
st.title("InSAR")
option = st.radio("Choose an option", ("Marker Cluster", "Circle Marker"))
m = leafmap.Map(
center=[29.7029, -95.3335], latlon_control=False, zoom=16, he... | 25.747475 | 85 | 0.433503 |
cd7a330fb695d24e5d3e2270fbbe2e1e0d11d2dc | 2,105 | py | Python | solve_net.py | a1exwang/theano-cnn-intro | 5f6ecdcb2908afb34a7d94e69b1d1ab13beb3c62 | [
"MIT"
] | null | null | null | solve_net.py | a1exwang/theano-cnn-intro | 5f6ecdcb2908afb34a7d94e69b1d1ab13beb3c62 | [
"MIT"
] | null | null | null | solve_net.py | a1exwang/theano-cnn-intro | 5f6ecdcb2908afb34a7d94e69b1d1ab13beb3c62 | [
"MIT"
] | null | null | null | from utils import LOG_INFO
import numpy as np
def data_iterator(x, y, batch_size, shuffle=True):
indx = range(len(x))
if shuffle:
np.random.shuffle(indx)
for start_idx in range(0, len(x), batch_size):
end_idx = min(start_idx + batch_size, len(x))
yield x[start_idx: end_idx], y[sta... | 39.716981 | 116 | 0.443705 |
cd7b0a77a1f93e1e0546019ec5051874f1e448ee | 1,199 | py | Python | playground/test1.py | mathee92/unirentalz | 803c58628ebda002e2c127db11fbaddf181ef394 | [
"MIT"
] | null | null | null | playground/test1.py | mathee92/unirentalz | 803c58628ebda002e2c127db11fbaddf181ef394 | [
"MIT"
] | null | null | null | playground/test1.py | mathee92/unirentalz | 803c58628ebda002e2c127db11fbaddf181ef394 | [
"MIT"
] | null | null | null | # -----------
# User Instructions
#
# Modify the valid_month() function to verify
# whether the data a user enters is a valid
# month. If the passed in parameter 'month'
# is not a valid month, return None.
# If 'month' is a valid month, then return
# the name of the month with the first letter
# capitalized.
#
... | 18.734375 | 46 | 0.539616 |
cd7da929a4d4176f292520c09ac6f877772c0b49 | 2,274 | py | Python | hookio/logs.py | Marak/hook.io-sdk-python | 722b04eb0832ef712d5dcd491899996088e1aa8b | [
"Unlicense"
] | 1 | 2021-06-15T11:52:44.000Z | 2021-06-15T11:52:44.000Z | hookio/logs.py | Marak/hook.io-sdk-python | 722b04eb0832ef712d5dcd491899996088e1aa8b | [
"Unlicense"
] | null | null | null | hookio/logs.py | Marak/hook.io-sdk-python | 722b04eb0832ef712d5dcd491899996088e1aa8b | [
"Unlicense"
] | null | null | null | import sys
import weakref
import json
import logging
from .utils import opt_json, Response2JSONLinesIterator
from six import StringIO
log = logging.getLogger(__name__)
class Logs:
def __init__(self, client):
self.client = weakref.proxy(client)
def read(self, url, raw=False, raw_data=True, **opts):
... | 35.53125 | 87 | 0.575638 |
cd7e21c2d43aa6b5ca80b05a26cc762c012f19a7 | 228 | py | Python | data/__init__.py | opconty/keras_std | 26cbe25c525128a067a97157bca0b060f40e5ec8 | [
"Apache-2.0"
] | 18 | 2019-07-16T10:54:29.000Z | 2021-03-16T00:34:23.000Z | data/__init__.py | opconty/keras_std | 26cbe25c525128a067a97157bca0b060f40e5ec8 | [
"Apache-2.0"
] | 2 | 2019-08-26T11:40:12.000Z | 2019-12-07T13:18:48.000Z | data/__init__.py | opconty/keras_std | 26cbe25c525128a067a97157bca0b060f40e5ec8 | [
"Apache-2.0"
] | 8 | 2019-07-17T08:26:10.000Z | 2021-03-16T00:34:17.000Z | #-*- coding:utf-8 -*-
#'''
# Created on 19-7-16 下午2:14
#
# @Author: Greg Gao(laygin)
#'''
from .synth_text import SynthTextConfig, SynthTextDataset
from .icdar13 import IcdarConfig, IcdarDataset
from .img_aug import resize_image | 25.333333 | 57 | 0.736842 |
cd7f21d270d7885499684e88d3eb5ad2fac11de9 | 6,376 | py | Python | alberto/annotation/train.py | lettomobile/DeepPoseKit | a922d2d99cd55d0a3909c1f3f8b2bf8c377ff503 | [
"Apache-2.0"
] | 1 | 2021-11-01T02:08:00.000Z | 2021-11-01T02:08:00.000Z | alberto/annotation/train.py | albertoursino/DeepPoseKit | a922d2d99cd55d0a3909c1f3f8b2bf8c377ff503 | [
"Apache-2.0"
] | null | null | null | alberto/annotation/train.py | albertoursino/DeepPoseKit | a922d2d99cd55d0a3909c1f3f8b2bf8c377ff503 | [
"Apache-2.0"
] | null | null | null | from alberto.annotation import annotation_set
from pandas import np
from deepposekit.io import TrainingGenerator, DataGenerator
from deepposekit.augment import FlipAxis
import imgaug.augmenters as iaa
import imgaug as ia
from deepposekit.models import StackedHourglass
from deepposekit.models import load_model
import ... | 32.697436 | 132 | 0.606336 |
cd8237accaa927ddf6513747162736a47cc442f6 | 763 | py | Python | northpole/settings/local_staging.py | mhotwagner/northpole | 7d904d919aeb6a36549750ee0700578246896691 | [
"MIT"
] | null | null | null | northpole/settings/local_staging.py | mhotwagner/northpole | 7d904d919aeb6a36549750ee0700578246896691 | [
"MIT"
] | null | null | null | northpole/settings/local_staging.py | mhotwagner/northpole | 7d904d919aeb6a36549750ee0700578246896691 | [
"MIT"
] | null | null | null | from .base import *
from dotenv import load_dotenv
load_dotenv(dotenv_path='northpole/.staging.env', verbose=True)
ALLOWED_HOSTS = ['*']
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': os.get... | 25.433333 | 64 | 0.651376 |
cd836f4eaf2d0f0894b304e6d9d109cacae91338 | 12,587 | py | Python | bc4py/bip32/bip32.py | namuyan/bc4py | 6484d356096261d0d57e9e1f5ffeae1f9a9865f3 | [
"MIT"
] | 12 | 2018-09-19T14:02:09.000Z | 2020-01-27T16:20:14.000Z | bc4py/bip32/bip32.py | kumacoinproject/bc4py | 6484d356096261d0d57e9e1f5ffeae1f9a9865f3 | [
"MIT"
] | 1 | 2020-03-19T16:57:30.000Z | 2020-03-19T16:57:30.000Z | bc4py/bip32/bip32.py | namuyan/bc4py | 6484d356096261d0d57e9e1f5ffeae1f9a9865f3 | [
"MIT"
] | 6 | 2018-11-13T17:20:14.000Z | 2020-02-15T11:46:52.000Z | #!/usr/bin/env python
#
# Copyright 2014 Corgan Labs
# See LICENSE.txt for distribution terms
#
from bc4py.bip32.base58 import check_decode, check_encode
from bc4py_extension import PyAddress
from ecdsa.curves import SECP256k1
from ecdsa.keys import SigningKey, VerifyingKey, square_root_mod_prime as mod_sqrt
from ecds... | 37.573134 | 126 | 0.593072 |
cd83dd3751ba2089366bb8592c6a8484b3986736 | 1,167 | py | Python | lib/utils/useragent.py | cckuailong/pocsploit | fe4a3154e59d2bebd55ccfdf62f4f7efb21b5a2a | [
"MIT"
] | 106 | 2022-03-18T06:51:09.000Z | 2022-03-31T19:11:41.000Z | lib/utils/useragent.py | cckuailong/pocsploit | fe4a3154e59d2bebd55ccfdf62f4f7efb21b5a2a | [
"MIT"
] | 5 | 2022-03-27T07:37:32.000Z | 2022-03-31T13:56:11.000Z | lib/utils/useragent.py | cckuailong/pocsploit | fe4a3154e59d2bebd55ccfdf62f4f7efb21b5a2a | [
"MIT"
] | 30 | 2022-03-21T01:27:08.000Z | 2022-03-31T12:28:01.000Z | import random
from loguru import logger
from lib.vars.vars import conf, th, paths
from lib.vars.ua import UA_LIST
def get_random_agent():
return random.sample(UA_LIST, 1)[0]
def firefox():
return 'Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0'
def ie():
return 'Mozilla/5.0 (compatibl... | 28.463415 | 184 | 0.685518 |
cd865fa7395cf48130baac47f65fb9a0acdb8fa6 | 1,378 | py | Python | etapa 2/gaussJacobi.py | jlucartc/MetodosNumericos20182 | d5610b95945ed6ec9b9bae6cd96672f4d616c1b9 | [
"MIT"
] | null | null | null | etapa 2/gaussJacobi.py | jlucartc/MetodosNumericos20182 | d5610b95945ed6ec9b9bae6cd96672f4d616c1b9 | [
"MIT"
] | null | null | null | etapa 2/gaussJacobi.py | jlucartc/MetodosNumericos20182 | d5610b95945ed6ec9b9bae6cd96672f4d616c1b9 | [
"MIT"
] | null | null | null | import numpy as np
from sympy import *
from math import *
from timeit import default_timer as timer
start = None
end = None
def maxXi(Xn,X):
n = None
d = None
for i in range(Xn.shape[0]):
if(np.copy(Xn[i,0]) != 0):
nk = abs(np.copy(Xn[i,0]) - np.copy(X[i,0]))/abs(np.copy(Xn[i,0]))
... | 18.621622 | 78 | 0.523948 |
cd8770a9a9b49ceb88698ef2075f53487bd2aca7 | 8,139 | py | Python | custom_libs/Project2/plotter.py | drkostas/COSC522 | 5731576301daf99ca7c3d382fe3ea8b1398008ff | [
"MIT"
] | 1 | 2021-12-22T14:29:42.000Z | 2021-12-22T14:29:42.000Z | custom_libs/Project2/plotter.py | drkostas/COSC522 | 5731576301daf99ca7c3d382fe3ea8b1398008ff | [
"MIT"
] | 3 | 2021-10-13T02:14:30.000Z | 2021-11-24T05:28:32.000Z | custom_libs/Project2/plotter.py | drkostas/COSC522 | 5731576301daf99ca7c3d382fe3ea8b1398008ff | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
import numpy as np
class Plotter:
synth_tr: np.ndarray
synth_te: np.ndarray
pima_tr: np.ndarray
pima_te: np.ndarray
def __init__(self, synth_tr: np.ndarray, synth_te: np.ndarray, pima_tr: np.ndarray,
pim... | 44.966851 | 110 | 0.578327 |
cd887102450875f1d2f5fd98ea87c44fd4dd0888 | 303 | py | Python | Python/8/SquareSum/square_sum.py | hwakabh/codewars | 7afce5a7424d35abc55c350301ac134f2d3edd3d | [
"MIT"
] | null | null | null | Python/8/SquareSum/square_sum.py | hwakabh/codewars | 7afce5a7424d35abc55c350301ac134f2d3edd3d | [
"MIT"
] | 6 | 2020-02-21T17:01:59.000Z | 2021-05-04T07:04:41.000Z | Python/8/SquareSum/square_sum.py | hwakabh/codewars | 7afce5a7424d35abc55c350301ac134f2d3edd3d | [
"MIT"
] | null | null | null | import sys
def square_sum(numbers):
return sum([n ** 2 for n in numbers])
if __name__ == "__main__":
if len(sys.argv) == 1:
nums = [int(e) for e in input('>>> Enter the numbers with comma-separeted: ').split(',')]
print(square_sum(numbers=nums))
else:
sys.exit(1) | 23.307692 | 97 | 0.590759 |
cd88a71325bc436cee432caaafbbae9750fb46b0 | 5,710 | py | Python | spatial_ops/lazy_loader.py | LucaMarconato/spatial_ops | 86e5b8557db9efa2ca263098ed47c16de05fab00 | [
"MIT"
] | null | null | null | spatial_ops/lazy_loader.py | LucaMarconato/spatial_ops | 86e5b8557db9efa2ca263098ed47c16de05fab00 | [
"MIT"
] | null | null | null | spatial_ops/lazy_loader.py | LucaMarconato/spatial_ops | 86e5b8557db9efa2ca263098ed47c16de05fab00 | [
"MIT"
] | null | null | null | import os
import pickle
from abc import ABC, abstractmethod
import h5py
import numpy as np
from .folders import get_pickle_lazy_loader_data_path, hdf5_lazy_loader_data_path
from .unpickler import CustomUnpickler
class LazyLoaderAssociatedInstance:
# when implementing this method in a derived class add an unique... | 33.588235 | 117 | 0.680911 |
cd89017afbf663624d11e9b8f48f90440b465747 | 27,270 | py | Python | connector/binance/websockets.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | connector/binance/websockets.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | connector/binance/websockets.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | # @date 2020-01-31
# @author Frederic Scherma, All rights reserved without prejudices.
# @license Copyright (c) 2020 Dream Overflow
# Binance Websocket connector.
import json
import threading
import traceback
from autobahn.twisted.websocket import WebSocketClientFactory, WebSocketClientProtocol, connectWS
from twiste... | 37.510316 | 136 | 0.541584 |
cd8a35bcbfb312cda1686fb97584510659ede9ae | 669 | py | Python | Basic Data Structures/array/ListSlicing.py | rush2catch/algorithms-leetcode | 38a5e6aa33d48fa14fe09c50c28a2eaabd736e55 | [
"MIT"
] | null | null | null | Basic Data Structures/array/ListSlicing.py | rush2catch/algorithms-leetcode | 38a5e6aa33d48fa14fe09c50c28a2eaabd736e55 | [
"MIT"
] | null | null | null | Basic Data Structures/array/ListSlicing.py | rush2catch/algorithms-leetcode | 38a5e6aa33d48fa14fe09c50c28a2eaabd736e55 | [
"MIT"
] | null | null | null | def list_slicing(nums, row, col):
new_matrix = []
minimal = row * col
if nums is []:
return None
elif (len(nums) % minimal is 0) and (len(nums) >= minimal):
for r in range(row):
new_matrix.append(nums[r * col : (r + 1) * col])
return new_matrix
else:
retur... | 27.875 | 63 | 0.605381 |
cd8abd04dc151085122e27f4484b76ecb7ff52ac | 225 | py | Python | OnePy/sys_module/base_riskmanager.py | Chandlercjy/OnePyfx | 9bd43b721d3f7352495b6ccab76bd533a3d2e8f2 | [
"MIT"
] | 321 | 2017-07-09T09:25:45.000Z | 2022-03-29T16:51:35.000Z | OnePy/sys_module/base_riskmanager.py | sunzhouhong/OnePy | 4e225945de297ba1211035a7b95b5094cdddc2a7 | [
"MIT"
] | 7 | 2017-08-23T12:10:29.000Z | 2020-03-26T12:56:09.000Z | OnePy/sys_module/base_riskmanager.py | sunzhouhong/OnePy | 4e225945de297ba1211035a7b95b5094cdddc2a7 | [
"MIT"
] | 134 | 2017-07-26T22:29:18.000Z | 2022-03-23T09:22:10.000Z | from OnePy.sys_module.metabase_env import OnePyEnvBase
class RiskManagerBase(OnePyEnvBase):
def __init__(self):
self.env.risk_managers.update({self.__class__.__name__: self})
def run(self):
pass
| 17.307692 | 70 | 0.715556 |
cd8aca443ef9f431942f1f2a5e259a12ad32107f | 3,057 | py | Python | tests/geographic/duplicates/test_find_grid_duplicates.py | PEM-Humboldt/regi0 | 0d64587d5d87f57cddfc7a67bb8baf74cd70adf2 | [
"MIT"
] | null | null | null | tests/geographic/duplicates/test_find_grid_duplicates.py | PEM-Humboldt/regi0 | 0d64587d5d87f57cddfc7a67bb8baf74cd70adf2 | [
"MIT"
] | 15 | 2022-02-03T11:38:37.000Z | 2022-03-09T23:23:04.000Z | tests/geographic/duplicates/test_find_grid_duplicates.py | PEM-Humboldt/regi0 | 0d64587d5d87f57cddfc7a67bb8baf74cd70adf2 | [
"MIT"
] | null | null | null | """
Test cases for the regi0.geographic.duplicates.find_grid_duplicates function.
"""
import numpy as np
import pandas as pd
from regi0.geographic.duplicates import find_grid_duplicates
def test_records_bounds_high_res(records):
result = find_grid_duplicates(
records,
"scientificName",
re... | 21.082759 | 83 | 0.446189 |
cd8b45d655ef0b191b537030a3d9f0b1784aa23f | 772 | py | Python | kolibri/core/public/utils.py | FollonSaxBass/kolibri | 4cf820b14386aecc228fecff64c847bad407cbb1 | [
"MIT"
] | 2 | 2021-05-13T10:20:46.000Z | 2021-11-15T12:31:03.000Z | kolibri/core/public/utils.py | camellia26/kolibri | 7f1cb794c93f37e039be22f56a5ac1989ed22bde | [
"MIT"
] | 8 | 2021-05-21T15:31:24.000Z | 2022-02-24T15:02:14.000Z | kolibri/core/public/utils.py | camellia26/kolibri | 7f1cb794c93f37e039be22f56a5ac1989ed22bde | [
"MIT"
] | 1 | 2019-10-05T11:14:40.000Z | 2019-10-05T11:14:40.000Z | import platform
from django.core.exceptions import ObjectDoesNotExist
from morango.models import InstanceIDModel
import kolibri
def get_device_info():
"""Returns metadata information about the device"""
instance_model = InstanceIDModel.get_or_create_current_instance()[0]
try:
device_name = koli... | 28.592593 | 82 | 0.715026 |
cd8c005ad2ae492334e75e29d8ea3fae95bca95b | 1,372 | py | Python | mcpipy/cellcraft/config.py | cellcraft/cellcraft | 1cb2b152bb6433250cec43e2586f1b5d093ec6e5 | [
"MIT"
] | 2 | 2016-01-21T12:05:36.000Z | 2016-04-18T09:50:03.000Z | mcpipy/cellcraft/config.py | cellcraft/cellcraft | 1cb2b152bb6433250cec43e2586f1b5d093ec6e5 | [
"MIT"
] | 1 | 2016-05-13T13:08:28.000Z | 2016-05-13T13:08:28.000Z | mcpipy/cellcraft/config.py | cellcraft/cellcraft | 1cb2b152bb6433250cec43e2586f1b5d093ec6e5 | [
"MIT"
] | 3 | 2015-12-14T19:28:42.000Z | 2020-11-29T12:53:12.000Z | import os
import json
import logging
# cellcraft node
CELLCRAFT_NODE_URL="http://192.168.178.29:4534"
# path to cache where pickle files will be stored
PATH_RESOURCES='cellcraft/resources'
PATH_CACHE='cellcraft/resources/cache/'
PATH_TEST_CACHE='test/fixtures/cache/'
# path to fixtures
PATH_TO_FIXTURES="test/fixtu... | 24.070175 | 98 | 0.764577 |
cd8c4a556bdf6a751d59f1d67ef4d0688f0e6844 | 9,123 | py | Python | ftpsync/pyftpsync.py | wengzy/pyftpsync | db6decb02bf3535fe87d90b45a6cc974dd356b04 | [
"MIT"
] | 86 | 2015-03-02T17:40:03.000Z | 2022-03-14T03:41:40.000Z | ftpsync/pyftpsync.py | wengzy/pyftpsync | db6decb02bf3535fe87d90b45a6cc974dd356b04 | [
"MIT"
] | 63 | 2015-04-12T19:01:52.000Z | 2022-01-19T00:57:51.000Z | ftpsync/pyftpsync.py | wengzy/pyftpsync | db6decb02bf3535fe87d90b45a6cc974dd356b04 | [
"MIT"
] | 25 | 2015-04-12T18:07:25.000Z | 2021-04-25T15:20:24.000Z | # -*- coding: utf-8 -*-
"""
Simple folder synchronization using FTP.
(c) 2012-2021 Martin Wendt; see https://github.com/mar10/pyftpsync
Licensed under the MIT license: https://www.opensource.org/licenses/mit-license.php
Usage examples:
> pyftpsync.py --help
> pyftpsync.py upload . ftps://example.com/myfo... | 31.350515 | 90 | 0.574044 |
cd8d8365ca2301a760424dae1ee2e706688adc1f | 9,678 | py | Python | main/views.py | QingShuiXiFan/Style-Transfer | f79951323cdfd0c72f2157623209d9067376306b | [
"Apache-2.0"
] | null | null | null | main/views.py | QingShuiXiFan/Style-Transfer | f79951323cdfd0c72f2157623209d9067376306b | [
"Apache-2.0"
] | null | null | null | main/views.py | QingShuiXiFan/Style-Transfer | f79951323cdfd0c72f2157623209d9067376306b | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render, render_to_response, redirect
from django.http import HttpResponse, HttpResponseRedirect, JsonResponse, FileResponse
from django.urls import reverse
import os
from django.contrib.auth import authenticate, login, logout # 两个默认的用户认证和管理应用中的方法
from django.contrib import auth
from django... | 36.247191 | 198 | 0.615726 |
cd8e00f631a120690eef589a528899913c4b3443 | 781 | py | Python | edj/Spot_square.py | CircuitLaunch/Spot_Bootcamp | 47735ce474a59c5478099f6095b68c46b77d3da6 | [
"BSD-3-Clause"
] | null | null | null | edj/Spot_square.py | CircuitLaunch/Spot_Bootcamp | 47735ce474a59c5478099f6095b68c46b77d3da6 | [
"BSD-3-Clause"
] | null | null | null | edj/Spot_square.py | CircuitLaunch/Spot_Bootcamp | 47735ce474a59c5478099f6095b68c46b77d3da6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from Spot import *
import time
from bosdyn.client import math_helpers
if __name__ == '__main__':
spot = Spot()
try:
# It's ALIVE!
spot.power_on()
spot.move_to(1.0, 0.0, 0.0, math_helpers.Quat(), duration=5.0)
time.sleep(5.0)
spot.move_to(0.0, 1... | 21.694444 | 71 | 0.577465 |
cd8f015fd57b190763452236dbe2f747d3309b7f | 837 | py | Python | tests/test_set.py | maxslarsson/tennis-probability | f26021b305e2b8abd87acad846454f7ce02e9199 | [
"MIT"
] | null | null | null | tests/test_set.py | maxslarsson/tennis-probability | f26021b305e2b8abd87acad846454f7ce02e9199 | [
"MIT"
] | null | null | null | tests/test_set.py | maxslarsson/tennis-probability | f26021b305e2b8abd87acad846454f7ce02e9199 | [
"MIT"
] | null | null | null | import pytest
from tennis_probability import set, InvalidInput, InvalidProbability, NegativeNumber
def test_set():
assert set(0, 0, 0) == 0
assert set(0, 0, 0.50) == 0.5
assert set(0, 0, 1) == 1
# Test valid inputs
assert set(5, 3, 0.13) == 0.008146509339015371
assert set(2, 2, 0.37) == 0.024... | 27.9 | 84 | 0.628435 |
cd90fb8f4961d4f54d2eb80fcec8b04e412e1af3 | 626 | py | Python | sources/classic/messaging_kombu/handlers.py | variasov/classic_messaging_kombu | c4191f3d1f788a39f50dc137eca1b67f3ee2af20 | [
"MIT"
] | 1 | 2021-11-12T08:19:53.000Z | 2021-11-12T08:19:53.000Z | sources/classic/messaging_kombu/handlers.py | variasov/classic_messaging_kombu | c4191f3d1f788a39f50dc137eca1b67f3ee2af20 | [
"MIT"
] | null | null | null | sources/classic/messaging_kombu/handlers.py | variasov/classic_messaging_kombu | c4191f3d1f788a39f50dc137eca1b67f3ee2af20 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Dict, Any, Callable
from kombu import Message
from classic.components import component
MessageBody = Dict[str, Any]
@component
class MessageHandler(ABC):
@abstractmethod
def handle(self, message: Message, body: MessageBody):
pass
@component... | 18.969697 | 58 | 0.680511 |
cd937e31435e325df9a3ac8d8fa5487807539935 | 1,440 | py | Python | byceps/services/shop/order/event_service.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 33 | 2018-01-16T02:04:51.000Z | 2022-03-22T22:57:29.000Z | byceps/services/shop/order/event_service.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 7 | 2019-06-16T22:02:03.000Z | 2021-10-02T13:45:31.000Z | byceps/services/shop/order/event_service.py | GSH-LAN/byceps | ab8918634e90aaa8574bd1bb85627759cef122fe | [
"BSD-3-Clause"
] | 14 | 2019-06-01T21:39:24.000Z | 2022-03-14T17:56:43.000Z | """
byceps.services.shop.order.event_service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from __future__ import annotations
from datetime import datetime
from typing import Sequence
from ....database import db
from .d... | 26.181818 | 76 | 0.690972 |
cd95b58b744f084920dc507989ebf490290a8ec2 | 637 | py | Python | app/models/columns/suit.py | abcnever/euchre-game | 5446e345e0dfdcf83d5fe87c3d2cedc31b3ae669 | [
"MIT"
] | 1 | 2018-12-31T05:38:56.000Z | 2018-12-31T05:38:56.000Z | app/models/columns/suit.py | abcnever/euchre-game | 5446e345e0dfdcf83d5fe87c3d2cedc31b3ae669 | [
"MIT"
] | 4 | 2018-11-03T15:51:13.000Z | 2019-01-12T21:09:23.000Z | app/models/columns/suit.py | abcnever/euchre-game | 5446e345e0dfdcf83d5fe87c3d2cedc31b3ae669 | [
"MIT"
] | null | null | null | from attr import attrs, attrib
import enum
from .enum import EnumColumn
class Suit(EnumColumn):
class Enum(enum.Enum):
@attrs(frozen=True)
class _Suit():
suit_name = attrib()
ascii_icon = attrib()
spades = _Suit(
suit_name="Spades",
ascii_i... | 21.233333 | 40 | 0.486656 |
cd977d3ad4e8e4d9141853e4e08a51d0ffa0f771 | 1,881 | py | Python | dataset.py | sreza1/Diabetic-Retinopathy-Detection | 75f10423ef161d3040756253a8ba0b9012e391b7 | [
"MIT"
] | null | null | null | dataset.py | sreza1/Diabetic-Retinopathy-Detection | 75f10423ef161d3040756253a8ba0b9012e391b7 | [
"MIT"
] | null | null | null | dataset.py | sreza1/Diabetic-Retinopathy-Detection | 75f10423ef161d3040756253a8ba0b9012e391b7 | [
"MIT"
] | null | null | null | import config
import os
import pandas as pd
import numpy as np
from torch.utils.data import Dataset, DataLoader
from PIL import Image
from tqdm import tqdm
class DRDataset(Dataset):
def __init__(self, images_folder, path_to_csv, train=True, transform=None):
super().__init__()
self.data = pd.read_cs... | 29.857143 | 84 | 0.617757 |
cd988eff24525966178311b4c694188e2f3b5038 | 507 | py | Python | server/server.py | Filipos27/Celebrity_classification | 802474516b9ecaee70c4019600572bbbbd8b582a | [
"MIT"
] | null | null | null | server/server.py | Filipos27/Celebrity_classification | 802474516b9ecaee70c4019600572bbbbd8b582a | [
"MIT"
] | null | null | null | server/server.py | Filipos27/Celebrity_classification | 802474516b9ecaee70c4019600572bbbbd8b582a | [
"MIT"
] | null | null | null | from flask import Flask, request, jsonify
import util
app= Flask(__name__)
@app.route("/classify_image",methods=["GET","POST"])
def classify_image():
image_data=request.form["image_data"]
response=jsonify(util.classify_image(image_data))
response.headers.add("Access-Control-Allow-Origin","*")
... | 28.166667 | 77 | 0.710059 |
cd99a356df7305e9c0faf645726124d17a3abcde | 41 | py | Python | app.py | blogsley/blogsley-flask-site | 40df6641cce8336d790549b7edac4f83d8b8fb8e | [
"MIT"
] | 1 | 2020-12-18T03:52:25.000Z | 2020-12-18T03:52:25.000Z | app.py | blogsley/blogsley-flask-site | 40df6641cce8336d790549b7edac4f83d8b8fb8e | [
"MIT"
] | 3 | 2020-05-04T07:46:54.000Z | 2022-02-10T19:39:19.000Z | app.py | blogsley/blogsley-flask-site | 40df6641cce8336d790549b7edac4f83d8b8fb8e | [
"MIT"
] | null | null | null | from blogsley_site.app import create_app
| 20.5 | 40 | 0.878049 |
cd9a0d84b5dfdc848833f7aaab7d4b2009ed8946 | 421 | py | Python | awards/migrations/0003_project_project_photo.py | kimutaiamos/Gold-Awwards | 1bf12cf0cdbf250251664f067c5397160fa5ed41 | [
"MIT"
] | null | null | null | awards/migrations/0003_project_project_photo.py | kimutaiamos/Gold-Awwards | 1bf12cf0cdbf250251664f067c5397160fa5ed41 | [
"MIT"
] | null | null | null | awards/migrations/0003_project_project_photo.py | kimutaiamos/Gold-Awwards | 1bf12cf0cdbf250251664f067c5397160fa5ed41 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-12-12 18:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awards', '0002_profile_profile_photo'),
]
operations = [
migrations.AddField(
model_name='project',
name='project_phot... | 22.157895 | 79 | 0.615202 |
cd9a1323c7a15a9388bdc8532ce60de3beb414fa | 7,827 | py | Python | tests/e2e/performance/csi_tests/test_pvc_bulk_clone_performance.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | 1 | 2021-03-12T09:01:36.000Z | 2021-03-12T09:01:36.000Z | tests/e2e/performance/csi_tests/test_pvc_bulk_clone_performance.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | 1 | 2021-08-30T20:06:00.000Z | 2021-09-30T20:05:46.000Z | tests/e2e/performance/csi_tests/test_pvc_bulk_clone_performance.py | annagitel/ocs-ci | 284fe04aeb6e3d6cb70c99e65fec8ff1b1ea1dd5 | [
"MIT"
] | null | null | null | """
Test to measure pvc scale creation time. Total pvc count would be 50, 1 clone per PVC
Total number of clones in bulk will be 50
"""
import logging
import pytest
from ocs_ci.utility import utils
from ocs_ci.ocs.perftests import PASTest
from ocs_ci.framework.testlib import performance
from ocs_ci.helpers import help... | 38.747525 | 118 | 0.614028 |
269506ce70f1d96fec0d9578b84d16a8d1ec4d2d | 72 | py | Python | back/app/models/__init__.py | davidroeca/simple_graphql | a6b2b20b6458b6b2fa9363a542015ab42761bd98 | [
"MIT"
] | null | null | null | back/app/models/__init__.py | davidroeca/simple_graphql | a6b2b20b6458b6b2fa9363a542015ab42761bd98 | [
"MIT"
] | null | null | null | back/app/models/__init__.py | davidroeca/simple_graphql | a6b2b20b6458b6b2fa9363a542015ab42761bd98 | [
"MIT"
] | null | null | null | from .database import db
from .user import User
from .post import Post
| 14.4 | 24 | 0.777778 |
269573fa22001d4ea70efb720d1a7ce5724057f7 | 3,520 | py | Python | tools/noise_reduction.py | 8igfive/MyASR | 565267d9df4b56cfad5107632146aab8150a962d | [
"MIT"
] | null | null | null | tools/noise_reduction.py | 8igfive/MyASR | 565267d9df4b56cfad5107632146aab8150a962d | [
"MIT"
] | null | null | null | tools/noise_reduction.py | 8igfive/MyASR | 565267d9df4b56cfad5107632146aab8150a962d | [
"MIT"
] | null | null | null | import argparse
from genericpath import exists
import os
import time
import re
from tqdm import tqdm
import numpy as np
from scipy.io import wavfile
from wiener_scalart import wienerScalart
TIME = time.strftime("%Y-%m-%d_%H:%M:%S", time.localtime())
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))
WORKPLACE_DI... | 40.930233 | 132 | 0.65142 |
2696d944b45b7b26bd7dbbe253779f41871a415a | 7,779 | py | Python | islandGen.py | Popcorn05/IslandGen | a06821c1db8f33befb1fb3db32fd2e18d323a23a | [
"MIT"
] | null | null | null | islandGen.py | Popcorn05/IslandGen | a06821c1db8f33befb1fb3db32fd2e18d323a23a | [
"MIT"
] | null | null | null | islandGen.py | Popcorn05/IslandGen | a06821c1db8f33befb1fb3db32fd2e18d323a23a | [
"MIT"
] | null | null | null | #Import libraries
import random
import os
import noise
import numpy
import math
import sys
from chunks import Chunks as chk
from PIL import Image
import subprocess
from scipy.misc import toimage
import threading
random.seed(os.urandom(6))
#Delete old chunks
filelist = [ f for f in os.listdir("world/") if f.endswith... | 33.530172 | 202 | 0.549556 |
26978b08939270913183c7dd0c609cfa2e52874f | 4,363 | py | Python | reagent/gym/tests/test_gym_replay_buffer.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | 1,156 | 2019-10-02T12:15:31.000Z | 2022-03-31T16:01:27.000Z | reagent/gym/tests/test_gym_replay_buffer.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | 448 | 2019-10-03T13:40:52.000Z | 2022-03-28T07:49:15.000Z | reagent/gym/tests/test_gym_replay_buffer.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | 214 | 2019-10-13T13:28:33.000Z | 2022-03-24T04:11:52.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
import numpy.testing as npt
from reagent.core.parameters import ProblemDomain
from reagent.gym.envs import Gym
from reagent.gym.envs.wrappers.simple_minigrid import SimpleObsWrapper
from reagent.gym.utils impo... | 33.821705 | 86 | 0.60165 |
26982c5744b84289c1df298a112687956cf70fd9 | 515 | py | Python | Dataset/Leetcode/train/46/372.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/46/372.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/train/46/372.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | class Solution(object):
def XXX(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
def dfs(res, state, n):
if n == 0:
res.append(list(state))
return
for a in nums:
if a not in... | 23.409091 | 40 | 0.365049 |
269836dc4bbab3746b4c28419c5eabb4308cb54c | 37 | py | Python | parser/__init__.py | jbudis/dante | 90177c33825d5f9ce3fba5463092fbcf20b72fe2 | [
"Apache-2.0"
] | 4 | 2018-09-28T14:50:47.000Z | 2021-08-09T12:46:12.000Z | parser/__init__.py | jbudis/dante | 90177c33825d5f9ce3fba5463092fbcf20b72fe2 | [
"Apache-2.0"
] | 6 | 2019-01-02T13:08:31.000Z | 2021-03-25T21:45:40.000Z | parser/__init__.py | jbudis/dante | 90177c33825d5f9ce3fba5463092fbcf20b72fe2 | [
"Apache-2.0"
] | 1 | 2017-12-12T10:38:26.000Z | 2017-12-12T10:38:26.000Z | from parser.readfile import ReadFile
| 18.5 | 36 | 0.864865 |
2698d48d436f6968997ba06d73587a502b5f3874 | 535 | py | Python | main.py | Cynicism-lab/hhu-daily-health-common | 1959beee61f2895166ac0be92b5817cbe278ef51 | [
"MIT"
] | 14 | 2021-02-03T14:38:15.000Z | 2022-02-05T08:48:41.000Z | main.py | zhang-zimin/nanwenguidaka | e426ecee8758d70b20cf2a77dc87a6f949196927 | [
"MIT"
] | 4 | 2021-04-15T15:14:29.000Z | 2022-03-15T02:29:04.000Z | main.py | zhang-zimin/nanwenguidaka | e426ecee8758d70b20cf2a77dc87a6f949196927 | [
"MIT"
] | 52 | 2021-02-03T14:38:17.000Z | 2022-03-29T09:19:12.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import requests
from datetime import timezone
from datetime import timedelta
from datetime import datetime
import hhu
import os
# In[2]:
utc_time = datetime.utcnow().replace(tzinfo=timezone.utc)
sh_tz = timezone(timedelta(hours=8),name='Asia/Shanghai')
beijing_now = ... | 17.258065 | 57 | 0.736449 |
269a18ede77adaabe0e01c16057d910f3519fa89 | 30,573 | py | Python | depparse.py | viadee/eric | 680508cc5bf2d322638c6cf2c466a06c3c1f33d4 | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | 4 | 2020-04-07T07:05:02.000Z | 2020-09-23T14:23:16.000Z | depparse.py | viadee/eric | 680508cc5bf2d322638c6cf2c466a06c3c1f33d4 | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | null | null | null | depparse.py | viadee/eric | 680508cc5bf2d322638c6cf2c466a06c3c1f33d4 | [
"BSD-3-Clause-Clear",
"Apache-2.0",
"CC0-1.0",
"BSD-3-Clause"
] | 1 | 2021-12-27T03:00:44.000Z | 2021-12-27T03:00:44.000Z | import pickle
import stanza
import test_stuff
from datetime import datetime
from dictionary import cd, dictionary, nlp_dictionary, ph_outcome, ph_key, ph_value, ph_dvalue, ph_subject
import eric_nlp
#does not do preprocessing
def depparse(sentences, pipeline):
output = ["OUTPUT:\n"]
roots = dict()
for sen... | 40.387054 | 384 | 0.603735 |
269ad28a75a19ae401ecbe624997f530c5904d6d | 706 | py | Python | ch03/simple_cbow_pytorch.py | tomy-0000/deep-learning-from-scratch-2 | 3d3d7fd614b8021499ffc103199be5e32622717e | [
"MIT"
] | null | null | null | ch03/simple_cbow_pytorch.py | tomy-0000/deep-learning-from-scratch-2 | 3d3d7fd614b8021499ffc103199be5e32622717e | [
"MIT"
] | null | null | null | ch03/simple_cbow_pytorch.py | tomy-0000/deep-learning-from-scratch-2 | 3d3d7fd614b8021499ffc103199be5e32622717e | [
"MIT"
] | null | null | null | # coding: utf-8
import torch.nn as nn
class SimpleCBOW(nn.Module):
def __init__(self, vocab_size, hidden_size):
super(SimpleCBOW, self).__init__()
V, H = vocab_size, hidden_size
self.in_layer = nn.Linear(V, H, bias=False)
self.out_layer = nn.Linear(H, V, bias=False)
self.... | 27.153846 | 54 | 0.609065 |
269c16b6afd598ff0e05a59d38e14e46ebde748b | 7,814 | py | Python | modules/input_output.py | nicolasying/WordNet-Embeddings | a6a5782dca97376e487df41fb83542729f284197 | [
"MIT"
] | null | null | null | modules/input_output.py | nicolasying/WordNet-Embeddings | a6a5782dca97376e487df41fb83542729f284197 | [
"MIT"
] | null | null | null | modules/input_output.py | nicolasying/WordNet-Embeddings | a6a5782dca97376e487df41fb83542729f284197 | [
"MIT"
] | null | null | null | # coding=utf-8
#! /usr/bin/env python3.4
"""
MIT License
Copyright (c) 2018 NLX-Group
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... | 36.344186 | 126 | 0.572562 |
269c9b7326d9d1d9ee7b7fac3ea362f209cd1e0f | 1,599 | py | Python | tests/test_formats.py | antmicro/raviewer | 7529664d37e994d4c2f4c450a5577b79d73c4bb0 | [
"Apache-2.0"
] | 12 | 2021-11-18T09:38:34.000Z | 2022-03-24T19:33:44.000Z | tests/test_formats.py | antmicro/raviewer | 7529664d37e994d4c2f4c450a5577b79d73c4bb0 | [
"Apache-2.0"
] | 1 | 2022-02-14T12:07:02.000Z | 2022-03-21T19:29:11.000Z | tests/test_formats.py | antmicro/raviewer | 7529664d37e994d4c2f4c450a5577b79d73c4bb0 | [
"Apache-2.0"
] | null | null | null | """Module for testing formats on resources entities"""
from raviewer.src.core import (get_displayable, load_image, parse_image)
from terminaltables import AsciiTable
from raviewer.image.color_format import AVAILABLE_FORMATS
import os
import pkg_resources
import time
import pytest
@pytest.fixture
def formats():
r... | 31.352941 | 79 | 0.590994 |
269e4231c77fb4d48c447cd279a2ecdca59c4ba8 | 702 | py | Python | kqueen_ui/utils/wrappers.py | Richard-Barrett/kqueen-ui | f6b41edddd5130e5cd79773640942e9a824bbae1 | [
"MIT"
] | null | null | null | kqueen_ui/utils/wrappers.py | Richard-Barrett/kqueen-ui | f6b41edddd5130e5cd79773640942e9a824bbae1 | [
"MIT"
] | null | null | null | kqueen_ui/utils/wrappers.py | Richard-Barrett/kqueen-ui | f6b41edddd5130e5cd79773640942e9a824bbae1 | [
"MIT"
] | null | null | null | from flask import request
from flask import redirect
from flask import session
from flask import url_for
from functools import wraps
def login_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
if not session.get('user', {}).get('id', None):
return redirect(url_for('ui.login',... | 29.25 | 77 | 0.660969 |
269f222cd807eb64aa23f3a0beb347f29492e7b2 | 4,089 | py | Python | dqc/utils/safeops.py | Jaikinator/dqc | 47c964c7d1323a35f4f69521d40476c41843810e | [
"Apache-2.0"
] | 39 | 2021-05-31T17:01:23.000Z | 2022-03-23T19:20:35.000Z | dqc/utils/safeops.py | Jaikinator/dqc | 47c964c7d1323a35f4f69521d40476c41843810e | [
"Apache-2.0"
] | 14 | 2021-09-01T13:39:11.000Z | 2022-03-13T16:45:39.000Z | dqc/utils/safeops.py | Jaikinator/dqc | 47c964c7d1323a35f4f69521d40476c41843810e | [
"Apache-2.0"
] | 6 | 2021-07-16T09:08:29.000Z | 2022-02-24T01:13:54.000Z | import math
import torch
from typing import Union, Optional, Tuple
from dqc.utils.datastruct import ZType
eps = 1e-12
########################## safe operations ##########################
def safepow(a: torch.Tensor, p: torch.Tensor, eps: float = 1e-12) -> torch.Tensor:
if torch.any(a < 0):
raise Runtime... | 36.837838 | 106 | 0.595011 |
269fd1b0bc7030c4e1f6c761faa1320701f6d9dc | 4,713 | py | Python | extra_envs/extra_envs/envs/point.py | Fanshaoliu/safe_rl | 16ab54bebb70a86a80e1bfadb62656afb1547965 | [
"MIT"
] | 13 | 2021-06-19T03:19:36.000Z | 2022-03-29T10:44:37.000Z | extra_envs/extra_envs/envs/point.py | Fanshaoliu/safe_rl | 16ab54bebb70a86a80e1bfadb62656afb1547965 | [
"MIT"
] | 5 | 2021-06-16T20:06:51.000Z | 2021-12-14T22:55:54.000Z | extra_envs/extra_envs/envs/point.py | Fanshaoliu/safe_rl | 16ab54bebb70a86a80e1bfadb62656afb1547965 | [
"MIT"
] | 4 | 2021-11-03T13:30:08.000Z | 2022-01-05T11:16:47.000Z | import numpy as np
import gym
from gym import spaces
from gym.utils import seeding
class PointEnv(gym.Env):
metadata = {'render.modes': ['human', 'rgb_array'],
'video.frames_per_second' : 30}
def __init__(self, mass=1., target_dist=5., xlim=2.5, cost_smoothing=0.):
self.mass = mass
... | 38.317073 | 92 | 0.569064 |
26a2b53d4301d0838e61a2558348848ec6cc08bb | 2,855 | py | Python | src/model/model_basic.py | trungnt13/digisami_journal | 671486d0fe7b65cad80daf8e8b96d475245c5fed | [
"Apache-2.0"
] | null | null | null | src/model/model_basic.py | trungnt13/digisami_journal | 671486d0fe7b65cad80daf8e8b96d475245c5fed | [
"Apache-2.0"
] | null | null | null | src/model/model_basic.py | trungnt13/digisami_journal | 671486d0fe7b65cad80daf8e8b96d475245c5fed | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function, division, absolute_import
from odin import nnet as N, backend as K
import tensorflow as tf
@N.ModelDescriptor
def fnn(X, gender, topic, y, nb_classes):
f = N.Sequence([
N.Flatten(outdim=2),
N.Dense(num_units=1024, b_init=None),
N.BatchNorm(activation... | 31.722222 | 64 | 0.62732 |
26a4b307dfc5e770b6a75ad04eed2871c82ad2a0 | 174 | py | Python | Python/CrashCourse/mongodb-quickstart-course/src/starter_code_snake_bnb/src/infrastructure/state.py | Mujtaba-Biyabani/Research | 211f57812786a151ce8c3b1c3ed379fd1ba4e2f9 | [
"Unlicense"
] | 52 | 2017-12-06T10:44:05.000Z | 2021-11-24T10:44:16.000Z | Python/CrashCourse/mongodb-quickstart-course/src/starter_code_snake_bnb/src/infrastructure/state.py | Mujtaba-Biyabani/Research | 211f57812786a151ce8c3b1c3ed379fd1ba4e2f9 | [
"Unlicense"
] | 8 | 2018-01-29T08:32:34.000Z | 2019-01-02T05:56:51.000Z | Python/CrashCourse/mongodb-quickstart-course/src/starter_code_snake_bnb/src/infrastructure/state.py | Mujtaba-Biyabani/Research | 211f57812786a151ce8c3b1c3ed379fd1ba4e2f9 | [
"Unlicense"
] | 125 | 2018-11-20T07:56:22.000Z | 2022-03-16T06:32:42.000Z | active_account = None
def reload_account():
global active_account
if not active_account:
return
# TODO: pull owner account from the database.
pass
| 15.818182 | 49 | 0.683908 |
26a6c6bf63ea22f6476519c7dcbec3b7eb479136 | 550 | py | Python | generators/activerecord/templates/models/abstract_model.py | afeiship/gx | 9a3b566f64147eb1b6ffc753e2ebdf676f8ddef6 | [
"MIT"
] | null | null | null | generators/activerecord/templates/models/abstract_model.py | afeiship/gx | 9a3b566f64147eb1b6ffc753e2ebdf676f8ddef6 | [
"MIT"
] | null | null | null | generators/activerecord/templates/models/abstract_model.py | afeiship/gx | 9a3b566f64147eb1b6ffc753e2ebdf676f8ddef6 | [
"MIT"
] | null | null | null | from orator import Model
import pendulum
class AbstractModel(Model):
__guarded__ = []
@classmethod
def find_or_new_by(cls, options):
entity = cls.find_by(options)
if not entity:
entity = cls()
for k in options:
v = options[k]
setattr... | 22 | 44 | 0.589091 |
26a919609f85889cbb4dc125397fcb5ff64f815f | 220 | py | Python | blank/build.py | davidbelliott/whitgl | bfa1a33b0059b722a773e513653ff802c8dc7d6f | [
"MIT"
] | 26 | 2016-01-09T16:46:53.000Z | 2021-05-17T02:41:13.000Z | blank/build.py | davidbelliott/whitgl | bfa1a33b0059b722a773e513653ff802c8dc7d6f | [
"MIT"
] | null | null | null | blank/build.py | davidbelliott/whitgl | bfa1a33b0059b722a773e513653ff802c8dc7d6f | [
"MIT"
] | 3 | 2016-02-19T06:05:19.000Z | 2021-03-10T02:19:35.000Z | import os
import sys
joinp = os.path.join
sys.path.insert(0, 'whitgl')
sys.path.insert(0, joinp('whitgl', 'input'))
import build
sys.path.insert(0, 'input')
import ninja_syntax
build.do_game('Game', '', ['png','ogg'])
| 18.333333 | 44 | 0.690909 |
26aabfb0114adf3aa767a0e26c7a937d741efc5e | 9,018 | py | Python | factom_core/blocks/entry_credit_block.py | sourcery-ai-bot/factom-core | 186dca550d98d758e9f8dab878e6382153efeaf3 | [
"MIT"
] | null | null | null | factom_core/blocks/entry_credit_block.py | sourcery-ai-bot/factom-core | 186dca550d98d758e9f8dab878e6382153efeaf3 | [
"MIT"
] | null | null | null | factom_core/blocks/entry_credit_block.py | sourcery-ai-bot/factom-core | 186dca550d98d758e9f8dab878e6382153efeaf3 | [
"MIT"
] | null | null | null | import hashlib
import struct
from dataclasses import dataclass, field
from typing import Dict, List, Union
from factom_core.block_elements.balance_increase import BalanceIncrease
from factom_core.block_elements.chain_commit import ChainCommit
from factom_core.block_elements.entry_commit import EntryCommit
from factom_... | 36.216867 | 118 | 0.622422 |
26aacebd7375e02a1085b024169371e35da36aab | 59 | py | Python | project1/tests/q0.py | ucsb-int5/int5-f19-notebooks | 5b3d1ee6964d9357f211f4706787403ec5a3079c | [
"MIT"
] | 1 | 2019-10-02T21:43:12.000Z | 2019-10-02T21:43:12.000Z | project1/tests/q0.py | ucsb-int5/int5-f19-notebooks | 5b3d1ee6964d9357f211f4706787403ec5a3079c | [
"MIT"
] | 3 | 2019-12-14T06:20:14.000Z | 2019-12-14T07:12:33.000Z | project1/tests/q0.py | ucsb-int5/int5-f19-notebooks | 5b3d1ee6964d9357f211f4706787403ec5a3079c | [
"MIT"
] | 3 | 2019-10-02T18:36:06.000Z | 2019-12-03T18:16:45.000Z | test = { 'name': 'q0',
'points': 0,
'suites': []} | 19.666667 | 24 | 0.389831 |
26ab3cad8e013a6c3ea0f8a7d1ac3f6bf89a579f | 24,208 | py | Python | tests/core/inst_utils.py | cornell-brg/lizard | 7f9a78a913e64b5cfdee3a26223539ad225bd6da | [
"BSD-3-Clause"
] | 50 | 2019-05-22T08:43:15.000Z | 2022-03-21T23:58:50.000Z | tests/core/inst_utils.py | cornell-brg/lizard | 7f9a78a913e64b5cfdee3a26223539ad225bd6da | [
"BSD-3-Clause"
] | 1 | 2019-07-27T18:51:52.000Z | 2019-08-02T01:20:22.000Z | tests/core/inst_utils.py | cornell-brg/lizard | 7f9a78a913e64b5cfdee3a26223539ad225bd6da | [
"BSD-3-Clause"
] | 11 | 2019-12-26T06:00:48.000Z | 2022-03-27T02:29:35.000Z | #=========================================================================
# inst_utils
#=========================================================================
# Includes helper functions to simplify creating assembly tests.
from pymtl import *
from tests.context import lizard
#------------------------------------... | 33.207133 | 80 | 0.527801 |
26ab7ad4f1a2c561a6b79626d7ff5c41db51de8f | 365 | py | Python | python/concepts/compile-runtime.py | shanavas786/coding-fu | 2f29781ab793b5932a951259afffbbe0078e8a8a | [
"CC0-1.0"
] | 1 | 2021-02-12T03:49:13.000Z | 2021-02-12T03:49:13.000Z | python/concepts/compile-runtime.py | shanavas786/coding-fu | 2f29781ab793b5932a951259afffbbe0078e8a8a | [
"CC0-1.0"
] | null | null | null | python/concepts/compile-runtime.py | shanavas786/coding-fu | 2f29781ab793b5932a951259afffbbe0078e8a8a | [
"CC0-1.0"
] | null | null | null | def func(arg1, arg2=dict()):
print('entering func')
# arg3 is evaluated at compile time of inner
# so it capture arg3 as {}
def inner(arg3=arg2):
# arg1 is evaluted when inner is called
# so it uses the value of arg1 at that time
# whic is None
print("arg1", arg1, "arg3", arg3)
arg1 = arg2 ... | 20.277778 | 47 | 0.635616 |
26ac0f2a19c349ef5a8b08d5da941091d8465553 | 487 | py | Python | alpinelib/aws/aws_lambda.py | nbcnews/alpinelib | 8e0d065611b69fdc431ca30ca1a257516670bcf9 | [
"MIT"
] | null | null | null | alpinelib/aws/aws_lambda.py | nbcnews/alpinelib | 8e0d065611b69fdc431ca30ca1a257516670bcf9 | [
"MIT"
] | null | null | null | alpinelib/aws/aws_lambda.py | nbcnews/alpinelib | 8e0d065611b69fdc431ca30ca1a257516670bcf9 | [
"MIT"
] | null | null | null | import boto3
from .. import logging
logger = logging.getFormattedLogger()
lambda_client = boto3.client('lambda', region_name='us-west-2')
def invoke(function_name, message):
try:
response = lambda_client.invoke(
FunctionName=function_name,
InvocationType='Event',
Payl... | 24.35 | 77 | 0.648871 |
26ad9a93696193c618815ae5d8967a74a464da8c | 766 | py | Python | test/test_lazy.py | sixty-north/python-transducers | 575357e3a17ff3b4c757967afd396bf0ea042c08 | [
"MIT"
] | 54 | 2015-10-02T02:45:36.000Z | 2021-06-22T04:40:33.000Z | test/test_lazy.py | sixty-north/python-transducers | 575357e3a17ff3b4c757967afd396bf0ea042c08 | [
"MIT"
] | 3 | 2017-06-11T13:39:18.000Z | 2017-06-12T06:07:24.000Z | test/test_lazy.py | sixty-north/python-transducers | 575357e3a17ff3b4c757967afd396bf0ea042c08 | [
"MIT"
] | 9 | 2015-10-28T23:36:50.000Z | 2019-01-11T13:47:05.000Z | import unittest
from transducer.functional import compose
from transducer.lazy import transduce
from transducer.transducers import (mapping, filtering, taking, dropping_while, distinct)
class TestComposedTransducers(unittest.TestCase):
def test_chained_transducers(self):
result = transduce(transducer=com... | 31.916667 | 89 | 0.574413 |
26adf150baad599be77596f054bbe7e015db202c | 2,246 | py | Python | cmake_pc_hooks/cppcheck.py | Takishima/cmake-pre-commit-hooks | a6d96865602f68f413f7f368aa1dbbb8bf495109 | [
"Apache-2.0"
] | 2 | 2021-08-10T21:48:05.000Z | 2022-02-28T11:46:51.000Z | cmake_pc_hooks/cppcheck.py | Takishima/cmake-pre-commit-hooks | a6d96865602f68f413f7f368aa1dbbb8bf495109 | [
"Apache-2.0"
] | null | null | null | cmake_pc_hooks/cppcheck.py | Takishima/cmake-pre-commit-hooks | a6d96865602f68f413f7f368aa1dbbb8bf495109 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 Damien Nguyen
#
# 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... | 29.946667 | 116 | 0.662066 |
26aec7ce88a039f97165462d31ff1b237e27b183 | 4,468 | py | Python | django-todo-list/tasks/models.py | HimadriP/Orderly | e9464756c585e385f23436fc79acd2064b443432 | [
"MIT"
] | 1 | 2019-07-29T19:52:29.000Z | 2019-07-29T19:52:29.000Z | django-todo-list/tasks/models.py | HimadriP/Orderly | e9464756c585e385f23436fc79acd2064b443432 | [
"MIT"
] | null | null | null | django-todo-list/tasks/models.py | HimadriP/Orderly | e9464756c585e385f23436fc79acd2064b443432 | [
"MIT"
] | null | null | null | from django.db import models
from django.conf import settings
from django.core.urlresolvers import reverse_lazy
from django.utils import timezone
from django.forms.util import to_current_timezone
from model_utils import Choices
class TimeStampedModel(models.Model):
"""
An abstract model for the common fields ... | 36.622951 | 78 | 0.530215 |
26af8dafdbc00b0bb2091823b9a4a72611dc7cfc | 521 | py | Python | apps/boards/apps.py | julianwachholz/thefarland | c7259311fafb60beba167422eefd0d0c5d362514 | [
"WTFPL"
] | null | null | null | apps/boards/apps.py | julianwachholz/thefarland | c7259311fafb60beba167422eefd0d0c5d362514 | [
"WTFPL"
] | null | null | null | apps/boards/apps.py | julianwachholz/thefarland | c7259311fafb60beba167422eefd0d0c5d362514 | [
"WTFPL"
] | null | null | null | from django.apps import AppConfig
from django.db.models.signals import post_save, post_delete
from . import signals
class BoardsAppConfig(AppConfig):
name = 'apps.boards'
def ready(self):
Board = self.get_model('Board')
Thread = self.get_model('Thread')
Post = self.get_model('Post')
... | 30.647059 | 70 | 0.71785 |
26af8f12a06f8edb90f5fc54b553edce179f388f | 2,445 | py | Python | danmu.py | wjhtime/douyu_danmu_python | 432198f86bc9f6facd7ef531f301e8c7c8a9285f | [
"MIT"
] | 4 | 2018-12-15T10:35:20.000Z | 2019-06-04T20:20:32.000Z | danmu.py | wjhtime/douyu_danmu_python | 432198f86bc9f6facd7ef531f301e8c7c8a9285f | [
"MIT"
] | null | null | null | danmu.py | wjhtime/douyu_danmu_python | 432198f86bc9f6facd7ef531f301e8c7c8a9285f | [
"MIT"
] | 2 | 2019-04-29T08:20:08.000Z | 2020-05-19T09:51:19.000Z | '''
利用斗鱼弹幕 api
尝试抓取斗鱼tv指定房间的弹幕
'''
import multiprocessing
import socket
import time
import re
import signal
# 构造socket连接,和斗鱼api服务器相连接
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
host = socket.gethostbyname("openbarrage.douyutv.com")
port = 8601
client.connect((host, port))
# 弹幕查询正则表达式
danmu_re = re.co... | 21.447368 | 75 | 0.578323 |
26afa6ab00539bb702ecf9ce1071e801dd9694da | 3,828 | py | Python | 03_spider_douyin/spider_douyin.py | theThreeKingdom/python-exercises | fc08a7bbb9d6b53d5761b9e1017f293bff4e26db | [
"Apache-2.0"
] | null | null | null | 03_spider_douyin/spider_douyin.py | theThreeKingdom/python-exercises | fc08a7bbb9d6b53d5761b9e1017f293bff4e26db | [
"Apache-2.0"
] | null | null | null | 03_spider_douyin/spider_douyin.py | theThreeKingdom/python-exercises | fc08a7bbb9d6b53d5761b9e1017f293bff4e26db | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/4/1 0:48
# @Author : Nixin
# @Email : nixin@foxmail.com
# @File : spider_douyin.py
# @Software: PyCharm
import requests, re, sys, os, time, random, socket
import http.client
from bs4 import BeautifulSoup
def get_html(url, data=None):
header = {
'Accept': '... | 33.876106 | 163 | 0.562696 |
26b0dec6991fd98013cf8dc45f05ed08b2f7cb49 | 479 | py | Python | hooks/relations/juju-info/requires.py | xenefix/RoutingPolicyRule | fb0c815c3fc049f63491a3ca56416c8ba0fe692c | [
"Apache-2.0"
] | null | null | null | hooks/relations/juju-info/requires.py | xenefix/RoutingPolicyRule | fb0c815c3fc049f63491a3ca56416c8ba0fe692c | [
"Apache-2.0"
] | null | null | null | hooks/relations/juju-info/requires.py | xenefix/RoutingPolicyRule | fb0c815c3fc049f63491a3ca56416c8ba0fe692c | [
"Apache-2.0"
] | null | null | null | from charms.reactive import RelationBase
from charms.reactive import scopes
from charms.reactive import hook
from charms.reactive import when
class TestRelation(RelationBase):
scope = scopes.GLOBAL
@hook('{requires:test}-relation-joined')
def joined(self):
self.set_state('{relation_name}.ready')
... | 26.611111 | 73 | 0.707724 |
26b107fd23e87c597f676bc069f5e3b5b448d1e3 | 593 | py | Python | suricata-4.1.4/python/suricata/ctl/test_filestore.py | runtest007/dpdk_surcata_4.1.1 | 5abf91f483b418b5d9c2dd410b5c850d6ed95c5f | [
"MIT"
] | 77 | 2019-06-17T07:05:07.000Z | 2022-03-07T03:26:27.000Z | suricata-4.1.4/python/suricata/ctl/test_filestore.py | clockdad/DPDK_SURICATA-4_1_1 | 974cc9eb54b0b1ab90eff12a95617e3e293b77d3 | [
"MIT"
] | 22 | 2019-07-18T02:32:10.000Z | 2022-03-24T03:39:11.000Z | suricata-4.1.4/python/suricata/ctl/test_filestore.py | clockdad/DPDK_SURICATA-4_1_1 | 974cc9eb54b0b1ab90eff12a95617e3e293b77d3 | [
"MIT"
] | 49 | 2019-06-18T03:31:56.000Z | 2022-03-13T05:23:10.000Z | from __future__ import print_function
import unittest
import filestore
class PruneTestCase(unittest.TestCase):
def test_parse_age(self):
self.assertEqual(filestore.parse_age("1s"), 1)
self.assertEqual(filestore.parse_age("1m"), 60)
self.assertEqual(filestore.parse_age("1h"), 3600)
... | 31.210526 | 71 | 0.706577 |
26b279e2de1f9a9dd6eeef9e0736a69c9c2cc2f9 | 1,027 | py | Python | chmap/examples/development/example109_store-creds.py | predsci/CHD | 35f29d1b62861f4ffed57b38d18689b282664bcf | [
"Apache-2.0"
] | 3 | 2021-06-29T00:23:47.000Z | 2021-09-17T18:29:05.000Z | chmap/examples/development/example109_store-creds.py | predsci/CHD | 35f29d1b62861f4ffed57b38d18689b282664bcf | [
"Apache-2.0"
] | null | null | null | chmap/examples/development/example109_store-creds.py | predsci/CHD | 35f29d1b62861f4ffed57b38d18689b282664bcf | [
"Apache-2.0"
] | 1 | 2021-12-08T06:26:18.000Z | 2021-12-08T06:26:18.000Z | # This is a little bit clunky, but is a better solution than writing passwords into
import os
from cryptography.fernet import Fernet
# cred_dir = os.path.join(os.path.dirname(os.getcwd()), "settings")
cred_dir = '/Users/cdowns/work/imac_local/CoronalHoles/mysql_credentials'
key_file = os.path.join(cred_dir, "e_key.bi... | 31.121212 | 83 | 0.728335 |
26b4086be5d9ece68d83031748858af8aef6a984 | 663 | py | Python | indjections/packages/django-allauth.py | pandichef/indjections | e8f0e62cf648607ed50330ac69dd12e9fc0cf710 | [
"BSD-2-Clause"
] | 7 | 2020-07-20T00:33:15.000Z | 2020-07-24T04:14:53.000Z | indjections/packages/django-allauth.py | pandichef/indjections | e8f0e62cf648607ed50330ac69dd12e9fc0cf710 | [
"BSD-2-Clause"
] | 17 | 2020-07-20T03:17:06.000Z | 2020-07-27T07:36:25.000Z | indjections/packages/django-allauth.py | pandichef/indjections | e8f0e62cf648607ed50330ac69dd12e9fc0cf710 | [
"BSD-2-Clause"
] | null | null | null | settings = """
try:
AUTHENTICATION_BACKENDS += [
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.AuthenticationBackend",
]
except NameError:
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
"allauth.account.auth_backends.Aut... | 24.555556 | 62 | 0.680241 |
26b4665a5f013ded26bc910df476a322704eda91 | 475 | py | Python | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/logcat/pagefactory/logcat_template_path.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 6 | 2018-11-26T08:42:52.000Z | 2020-06-01T08:33:48.000Z | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/logcat/pagefactory/logcat_template_path.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | null | null | null | teamcat_service/docker_build/target/one_step_build/teamcat/doraemon/logcat/pagefactory/logcat_template_path.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 1 | 2019-01-22T06:45:36.000Z | 2019-01-22T06:45:36.000Z | #coding=utf-8
'''
Created on 2015-10-10
@author: Devuser
'''
class LogcatPagePath(object):
left_nav_template_path="home/home_left_nav.html"
logger_page_path="logcat/logcat_index.html"
logger_list_page="logcat/logcat_list_page.html"
logger_list_controll="logcat/logcat_loger_list_controll.html"
... | 19 | 65 | 0.751579 |
26b56046672f411c1c88bcbb0a2ebddb8ba65691 | 176 | py | Python | competitive-programming/kattis/heimavinna.py | sanchopanca/coding-for-pleasure | fed1910e8a5a4241bd55aed333afd79b4405a71d | [
"MIT"
] | null | null | null | competitive-programming/kattis/heimavinna.py | sanchopanca/coding-for-pleasure | fed1910e8a5a4241bd55aed333afd79b4405a71d | [
"MIT"
] | null | null | null | competitive-programming/kattis/heimavinna.py | sanchopanca/coding-for-pleasure | fed1910e8a5a4241bd55aed333afd79b4405a71d | [
"MIT"
] | null | null | null | s = 0
problems = input().strip().split(';')
for p in problems:
if '-' in p:
a, b = map(int, p.split('-'))
s += b - a + 1
else:
s += 1
print(s)
| 16 | 37 | 0.420455 |
26b76d047c1414efdb3d56d1cf6e2c55efd68449 | 745 | py | Python | icepll.py | carlosedp/fusesoc-generators | 4ee343ce0013952bd89d6986bfb5ed861b2cf6b2 | [
"MIT"
] | null | null | null | icepll.py | carlosedp/fusesoc-generators | 4ee343ce0013952bd89d6986bfb5ed861b2cf6b2 | [
"MIT"
] | null | null | null | icepll.py | carlosedp/fusesoc-generators | 4ee343ce0013952bd89d6986bfb5ed861b2cf6b2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from fusesoc.capi2.generator import Generator
import subprocess
class IcepllGenerator(Generator):
def run(self):
fin = self.config.get('freq_in', 12)
fout = self.config.get('freq_out', 60)
module = self.config.get('module', False)
filename = self.config.... | 31.041667 | 79 | 0.555705 |
26b7cad7376280941d68826426ca4c361383c494 | 351 | py | Python | templates/checkcel/BrasExplor_Pictures_template.py | mboudet/braskoload | 8f39f2d68638a683e0d8e5065b33a218afe370cb | [
"MIT"
] | null | null | null | templates/checkcel/BrasExplor_Pictures_template.py | mboudet/braskoload | 8f39f2d68638a683e0d8e5065b33a218afe370cb | [
"MIT"
] | null | null | null | templates/checkcel/BrasExplor_Pictures_template.py | mboudet/braskoload | 8f39f2d68638a683e0d8e5065b33a218afe370cb | [
"MIT"
] | null | null | null | from checkcel import Checkplate
from checkcel.validators import SetValidator, NoValidator
from collections import OrderedDict
class MyTemplate(Checkplate):
validators = OrderedDict([
("name@Population", NoValidator()),
("Picture", NoValidator()),
("Type", SetValidator(valid_values=["whole ... | 29.25 | 74 | 0.706553 |
26bc7d495f1e995a46390a4be5f8a0a4a460b0ab | 2,823 | py | Python | src/shark/poker/player.py | twoodruff01/shark | 6c183de1993492b614eff332548f5c0f57facda2 | [
"Apache-2.0"
] | null | null | null | src/shark/poker/player.py | twoodruff01/shark | 6c183de1993492b614eff332548f5c0f57facda2 | [
"Apache-2.0"
] | null | null | null | src/shark/poker/player.py | twoodruff01/shark | 6c183de1993492b614eff332548f5c0f57facda2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Thomas Woodruff
# 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... | 37.144737 | 106 | 0.616366 |
26bd34791b254cf4bcb5957b49692dda6546cfa1 | 1,059 | py | Python | BUNKURO/BUNKURO.py | kantoku-code/Fusion360_BUNKURO | 0c83f2ab57f03c83fcad98b85b59792360f7a804 | [
"MIT"
] | 1 | 2022-03-18T13:06:57.000Z | 2022-03-18T13:06:57.000Z | BUNKURO/BUNKURO.py | kantoku-code/Fusion360_BUNKURO | 0c83f2ab57f03c83fcad98b85b59792360f7a804 | [
"MIT"
] | null | null | null | BUNKURO/BUNKURO.py | kantoku-code/Fusion360_BUNKURO | 0c83f2ab57f03c83fcad98b85b59792360f7a804 | [
"MIT"
] | null | null | null | # Author-kantoku
# Description-コンポーネント毎に分割してクローン作るよ!
# Fusion360API Python
import adsk.core
import traceback
try:
from . import config
from .apper import apper
from .commands.BUNKUROCore import BUNKUROCore
# Create our addin definition object
my_addin = apper.FusionApp(config.app_name, config.co... | 23.021739 | 75 | 0.634561 |
26bd97f61aa8677a52c1050fed16514074e239fd | 2,004 | py | Python | hp_steam_data/src/main.py | wangzhefeng/data-analysis | e502ac49ae1bc8287243e1faf51c467cc4d4187c | [
"MIT"
] | null | null | null | hp_steam_data/src/main.py | wangzhefeng/data-analysis | e502ac49ae1bc8287243e1faf51c467cc4d4187c | [
"MIT"
] | null | null | null | hp_steam_data/src/main.py | wangzhefeng/data-analysis | e502ac49ae1bc8287243e1faf51c467cc4d4187c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import os
PROJECT_PATH = "/mnt/e/dev/test/hp_steam_data/"
DATA_PATH = os.path.join(PROJECT_PATH, "data")
RESULT_PATH = os.path.join(PROJECT_PATH, "result")
def get_origin_data():
"""
origin data
"""
# raw data
... | 36.436364 | 151 | 0.733034 |
26be0d11d5b6b76d30765326da6c34a562d5f111 | 621 | py | Python | stock_experiment_sbb_with_vectors_of_ones.py | dvirg/auctions | da706f3d11b9582c7f811de9f50b96b43ac8cbd0 | [
"MIT"
] | 1 | 2021-11-20T19:27:45.000Z | 2021-11-20T19:27:45.000Z | stock_experiment_sbb_with_vectors_of_ones.py | dvirg/auctions | da706f3d11b9582c7f811de9f50b96b43ac8cbd0 | [
"MIT"
] | null | null | null | stock_experiment_sbb_with_vectors_of_ones.py | dvirg/auctions | da706f3d11b9582c7f811de9f50b96b43ac8cbd0 | [
"MIT"
] | null | null | null | #!python3
"""
Simulation experiment for our AAAI 2020 paper, with recipes that are vectors of ones.
Comparing McAfee's double auction to our SBB auctions.
Author: Dvir Gilor
Since: 2020-08
"""
from experiment_stock import experiment
from mcafee_protocol import mcafee_trade_reduction
from trade_reduction_protocol ... | 27 | 97 | 0.84219 |
26be6c749fedecdd29350e7dc06917fe50136ca1 | 556 | py | Python | Modulo-02/ex058/ex058.py | Matheus-Henrique-Burey/Curso-de-Python | 448aebaab96527affa1e45897a662bb0407c11c6 | [
"MIT"
] | null | null | null | Modulo-02/ex058/ex058.py | Matheus-Henrique-Burey/Curso-de-Python | 448aebaab96527affa1e45897a662bb0407c11c6 | [
"MIT"
] | null | null | null | Modulo-02/ex058/ex058.py | Matheus-Henrique-Burey/Curso-de-Python | 448aebaab96527affa1e45897a662bb0407c11c6 | [
"MIT"
] | null | null | null | from random import randint
print('=-' * 15)
print('ADIVINHE EM QUE NUMERO ESTOU PENÇANDO')
print('=-' * 15)
pc = randint(0, 10)
num = 11
cont = 0
while pc != num:
num = int(input('Sera que voce consegue acertar o numero que pensei, entre 0, 10: '))
if num == pc:
print('PARABES!!! VOCE ACERTOU')
e... | 23.166667 | 89 | 0.546763 |
26c07cd4c709d13692e520d5fa627ce985733c5a | 3,172 | py | Python | sfc_models/examples/scripts/deprecated/ex20170108_model_PC.py | MachineLP/SFC_models | d438a4e3e88534a206c761cda7a3f6a58ac3a0ac | [
"Apache-2.0"
] | 21 | 2016-11-03T12:30:50.000Z | 2022-03-24T06:54:14.000Z | sfc_models/examples/scripts/deprecated/ex20170108_model_PC.py | MachineLP/SFC_models | d438a4e3e88534a206c761cda7a3f6a58ac3a0ac | [
"Apache-2.0"
] | 1 | 2019-04-02T02:01:27.000Z | 2019-04-07T21:07:10.000Z | sfc_models/examples/scripts/deprecated/ex20170108_model_PC.py | MachineLP/SFC_models | d438a4e3e88534a206c761cda7a3f6a58ac3a0ac | [
"Apache-2.0"
] | 12 | 2016-11-03T12:30:57.000Z | 2021-09-14T23:08:23.000Z | """
ex20170108_model_PC.py
Create Model PC (Godley & Lavoie Chapter 4).
Copyright 2017 Brian Romanchuk
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-... | 39.65 | 122 | 0.669294 |
26c4a3b8183960d6aad7bfb1532a7a0f533eda4e | 4,087 | py | Python | flask_simpleview/__init__.py | jackwardell/Flask-SimpleView | 813d5dbe6353f77016c893caff526abae8487492 | [
"Apache-2.0"
] | null | null | null | flask_simpleview/__init__.py | jackwardell/Flask-SimpleView | 813d5dbe6353f77016c893caff526abae8487492 | [
"Apache-2.0"
] | null | null | null | flask_simpleview/__init__.py | jackwardell/Flask-SimpleView | 813d5dbe6353f77016c893caff526abae8487492 | [
"Apache-2.0"
] | null | null | null | import re
import flask
import flask.views
from functools import wraps
def camel_case_to_snake_case(word):
"""very simple mechanism for turning CamelCase words into snake_case"""
return re.sub(r"(?<!^)(?=[A-Z])", "_", word).lower()
def camel_case_to_slug_case(word):
"""very simple mechanism for turning ... | 28.381944 | 84 | 0.62711 |
26c5a0a8bb014c980c7a75f56eb95838d11757a4 | 2,287 | py | Python | qingcloud/cli/iaas_client/actions/cluster/deploy_app_version.py | knktc/qingcloud-cli | 2be8bba43e08bd7a76e1326ece871386cc9b5b55 | [
"Apache-2.0"
] | 11 | 2015-05-27T19:52:36.000Z | 2021-04-15T09:07:39.000Z | qingcloud/cli/iaas_client/actions/cluster/deploy_app_version.py | knktc/qingcloud-cli | 2be8bba43e08bd7a76e1326ece871386cc9b5b55 | [
"Apache-2.0"
] | 7 | 2017-07-19T05:05:03.000Z | 2019-04-25T07:18:04.000Z | qingcloud/cli/iaas_client/actions/cluster/deploy_app_version.py | knktc/qingcloud-cli | 2be8bba43e08bd7a76e1326ece871386cc9b5b55 | [
"Apache-2.0"
] | 19 | 2016-03-15T07:31:47.000Z | 2021-07-26T09:31:33.000Z | # =========================================================================
# Copyright 2012-present Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compliance with the Licens... | 40.122807 | 91 | 0.567118 |
26c5a8a0093950f0c391d5d30211cf53ae6f042f | 5,022 | py | Python | padevents/events.py | muffin-rice/pad-cogs | 820ecf08f9569a3d7cf3264d0eb9567264b42edf | [
"MIT"
] | 2 | 2020-09-25T01:57:21.000Z | 2020-10-02T13:46:48.000Z | padevents/events.py | muffin-rice/pad-cogs | 820ecf08f9569a3d7cf3264d0eb9567264b42edf | [
"MIT"
] | 43 | 2020-08-29T06:16:39.000Z | 2020-10-29T12:00:15.000Z | padevents/events.py | muffin-rice/pad-cogs | 820ecf08f9569a3d7cf3264d0eb9567264b42edf | [
"MIT"
] | 6 | 2020-08-31T04:37:55.000Z | 2020-10-19T05:09:17.000Z | import datetime
from datetime import timedelta
from typing import Callable, Collection, TYPE_CHECKING
import pytz
from tsutils.formatting import normalize_server_name
from tsutils.time import JP_TIMEZONE, KR_TIMEZONE, NA_TIMEZONE
from padevents.enums import DungeonType, EventLength
if TYPE_CHECKING:
from dbcog.m... | 36.656934 | 107 | 0.666866 |
26c624cf265c7c07d22297b36c515787f4a26b33 | 92 | py | Python | proton_decay_study/config/__init__.py | HEP-DL/proton_decay_study | e7b087a123b893254401f897100f656588bf0c19 | [
"MIT"
] | 2 | 2018-01-02T02:58:50.000Z | 2021-11-17T07:26:25.000Z | proton_decay_study/config/__init__.py | HEP-DL/proton_decay_study | e7b087a123b893254401f897100f656588bf0c19 | [
"MIT"
] | 415 | 2017-04-27T21:16:01.000Z | 2022-03-27T23:01:21.000Z | proton_decay_study/config/__init__.py | HEP-DL/proton_decay_study | e7b087a123b893254401f897100f656588bf0c19 | [
"MIT"
] | 2 | 2018-01-03T18:38:45.000Z | 2019-10-03T19:27:29.000Z |
class Config(object):
"""
Represents configuration of network training
"""
pass
| 11.5 | 48 | 0.663043 |
26c6baf54f78e9c92b1e52fb48aafcc91b720d02 | 1,409 | py | Python | server/getSert.py | sviridovt/WIE | 9af6d3dff7e774f5e332e6c77eadde815d4c375d | [
"MIT"
] | 1 | 2021-09-03T11:36:02.000Z | 2021-09-03T11:36:02.000Z | server/getSert.py | sviridovt/WIE | 9af6d3dff7e774f5e332e6c77eadde815d4c375d | [
"MIT"
] | null | null | null | server/getSert.py | sviridovt/WIE | 9af6d3dff7e774f5e332e6c77eadde815d4c375d | [
"MIT"
] | 1 | 2021-09-03T11:36:04.000Z | 2021-09-03T11:36:04.000Z | # allows to import RSA lib from different dir
import sys
# inserts path to access RSA encryption lib
# sys.path.insert(0, '../RSAEncryption')
import socket
import json
from libs.communication import sendEncrypted, recvEncrypted, sendData, readData
from libs.RSAKeys import readPrivateKey
from libs.EncryptedSocket imp... | 21.029851 | 79 | 0.675656 |
26c71f804645b9d738d4394f797c6533de859d14 | 7,085 | py | Python | code/billiard_game_multi_ball.py | ifsheldon/billiard_game | 1ce13d39158734efd76e617bba2bb319d5498c3f | [
"BSD-2-Clause"
] | null | null | null | code/billiard_game_multi_ball.py | ifsheldon/billiard_game | 1ce13d39158734efd76e617bba2bb319d5498c3f | [
"BSD-2-Clause"
] | null | null | null | code/billiard_game_multi_ball.py | ifsheldon/billiard_game | 1ce13d39158734efd76e617bba2bb319d5498c3f | [
"BSD-2-Clause"
] | null | null | null | import taichi as ti
import numpy as np
from functools import partial
from itertools import combinations
from billiard_game_dual_ball import normalize_vector, two_ball_collides, calc_next_pos_and_velocity, \
calc_after_collision_velocity, rectify_positions_in_collision, rectify_positions_and_velocities
# Constants... | 44.006211 | 203 | 0.651941 |