hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4fa517fc4aeda835e2192b711ae77906468916b6 | 581 | py | Python | setup.py | Icebreaker454/MRNet-1 | 6dca2619d0afcbd97decc3e36609c3baec83411a | [
"MIT"
] | null | null | null | setup.py | Icebreaker454/MRNet-1 | 6dca2619d0afcbd97decc3e36609c3baec83411a | [
"MIT"
] | null | null | null | setup.py | Icebreaker454/MRNet-1 | 6dca2619d0afcbd97decc3e36609c3baec83411a | [
"MIT"
] | null | null | null | from setuptools import find_packages
from setuptools import setup
import setuptools
from distutils.command.build import build as _build
import subprocess
REQUIRED_PACKAGES = [
"click",
"joblib",
"numpy",
"pandas",
"Pillow",
"scikit-learn",
"torch",
"torchvision",
"tqdm",
"goog... | 19.366667 | 87 | 0.683305 |
ed60244e88f157e1874be2616d47b7c73789d6d4 | 12,466 | py | Python | packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 765 | 2015-12-03T16:44:59.000Z | 2022-03-07T12:41:10.000Z | packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 1,815 | 2015-12-11T23:56:05.000Z | 2020-01-10T19:28:43.000Z | packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py | xiaobai/swift-lldb | 9238527ce430e6837108a16d2a91b147551fb83c | [
"Apache-2.0"
] | 284 | 2015-12-03T16:47:25.000Z | 2022-03-12T05:39:48.000Z | from __future__ import print_function
import json
import re
import gdbremote_testcase
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestGdbRemoteThreadsInStopReply(
gdbremote_testcase.GdbRemoteTestCaseBase):
mydir = TestBase.compu... | 39.955128 | 106 | 0.649045 |
1eaa5f668d125565989d90d736795e73e104a512 | 543 | py | Python | gammapy/utils/tests/test_array.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | gammapy/utils/tests/test_array.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | gammapy/utils/tests/test_array.py | watsonjj/gammapy | 8d2498c8f63f73d1fbe4ba81ab02d9e72552df67 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from ..array import array_stats_str, shape_2N
def test_array_stats_str():
actual = array_stats_str(np.pi, "pi")
assert actual == "pi : size = 1, min = 3.142, max = 3.142\n"
actual = array_stats_str([np.pi... | 30.166667 | 82 | 0.627993 |
7a5136c75ecebdfacaddf9b5436a0c77b0d5f028 | 4,934 | py | Python | kmhm-auto/kmhm_singleton.py | alephO/kmhm-auto | 5da47c3e44ccc088bed1147c3a078dcfc82d62e6 | [
"Apache-2.0"
] | null | null | null | kmhm-auto/kmhm_singleton.py | alephO/kmhm-auto | 5da47c3e44ccc088bed1147c3a078dcfc82d62e6 | [
"Apache-2.0"
] | null | null | null | kmhm-auto/kmhm_singleton.py | alephO/kmhm-auto | 5da47c3e44ccc088bed1147c3a078dcfc82d62e6 | [
"Apache-2.0"
] | null | null | null | # This file handles the singleton of the main bot logic
from constants import TMP_DICT
from chrome_api.pcdta import pcdta
from enum import Enum
from utils.logger import log_adapter
from utils.img_handler import img_handler
from db.sqlite_handler import dbHandler
from db.image_samples import image_sampler
import time
i... | 32.675497 | 99 | 0.556344 |
6fbbf647665e36a99084845ce59c35379e4be836 | 5,348 | py | Python | data.py | jiyzhang/bert-ner | ebd9d10c3ad019da030e32cac3f2c504e5f1b957 | [
"Apache-2.0"
] | null | null | null | data.py | jiyzhang/bert-ner | ebd9d10c3ad019da030e32cac3f2c504e5f1b957 | [
"Apache-2.0"
] | null | null | null | data.py | jiyzhang/bert-ner | ebd9d10c3ad019da030e32cac3f2c504e5f1b957 | [
"Apache-2.0"
] | null | null | null |
from pathlib import Path
import pickle
import numpy as np
from collections import Counter
DATADIR = Path("./data/wind")
def words(name):
return '{}.words.txt'.format(name)
def tags(name):
return '{}.tags.txt'.format(name)
def fwords(name):
return str(Path(DATADIR, '{}.words.txt'.format(name)))
def ftag... | 28.147368 | 107 | 0.563762 |
4b06f02f0cc195dbd4641d7c4af873111c812fbe | 5,477 | py | Python | src/JUNCTION_image.py | kwonbosung02/JuntionXseoul2019 | a205e09112f0e0b71b0d844989bb2c047cbec997 | [
"MIT"
] | 3 | 2019-07-09T11:28:26.000Z | 2020-07-13T04:57:44.000Z | src/JUNCTION_image.py | kwonbosung02/JuntionXseoul2019 | a205e09112f0e0b71b0d844989bb2c047cbec997 | [
"MIT"
] | null | null | null | src/JUNCTION_image.py | kwonbosung02/JuntionXseoul2019 | a205e09112f0e0b71b0d844989bb2c047cbec997 | [
"MIT"
] | null | null | null | #모듈 호출------------------------------------------------------------------------------
import cv2
import numpy as np
import time
import dlib
import pybind11
s_img = cv2.imread('test2.png',-1)##############::::
#많이 씀-------------------------------------------------------------------------------
prev_contours = 0
#얼굴 그릴... | 31.65896 | 90 | 0.503013 |
0834365c812e88fb92bd91d2315e67bc4a5a72b9 | 48,265 | py | Python | tests/unit/utils/test_thin.py | hvbarker/salt | 0b1e299b8983854bd55163439e4ac20d81a9dab7 | [
"Apache-2.0"
] | 1 | 2020-05-17T18:00:38.000Z | 2020-05-17T18:00:38.000Z | tests/unit/utils/test_thin.py | hvbarker/salt | 0b1e299b8983854bd55163439e4ac20d81a9dab7 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/test_thin.py | hvbarker/salt | 0b1e299b8983854bd55163439e4ac20d81a9dab7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
:codeauthor: :email:`Bo Maryniuk <bo@suse.de>`
"""
from __future__ import absolute_import, print_function, unicode_literals
import copy
import os
import shutil
import sys
import tempfile
import jinja2
import salt.exceptions
import salt.ext.six
import salt.utils.hashutils
import salt.ut... | 37.184129 | 114 | 0.555102 |
0a8f9e8905b0c060162277ed3effe15ffd39c0ac | 442 | py | Python | App/migrations/0006_auto_20180526_1053.py | NeverLeft/DjangoAXF | 9bdf731e2b5a607cbcf0d4faebb7e616daa1a0b4 | [
"Apache-2.0"
] | null | null | null | App/migrations/0006_auto_20180526_1053.py | NeverLeft/DjangoAXF | 9bdf731e2b5a607cbcf0d4faebb7e616daa1a0b4 | [
"Apache-2.0"
] | null | null | null | App/migrations/0006_auto_20180526_1053.py | NeverLeft/DjangoAXF | 9bdf731e2b5a607cbcf0d4faebb7e616daa1a0b4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-05-26 10:53
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('App', '0005_auto_20180526_1052'),
]
operations = [
migrations.RenameField(
... | 21.047619 | 49 | 0.617647 |
0d94c54bc997e9d31ff3e9896eddde832abc8cd9 | 1,336 | py | Python | cprint/cPrint.py | havelar/cPrintFormat | 4487481559fc78a34168550319ac4a02e7b84618 | [
"MIT"
] | null | null | null | cprint/cPrint.py | havelar/cPrintFormat | 4487481559fc78a34168550319ac4a02e7b84618 | [
"MIT"
] | null | null | null | cprint/cPrint.py | havelar/cPrintFormat | 4487481559fc78a34168550319ac4a02e7b84618 | [
"MIT"
] | null | null | null | from .src.cFormat import cFormat
def cprint(txt, color='black', bg=None, style='normal', end='\n', returning=False):
# Font Color process
if isinstance(color,str):
rgb = cFormat.colors.get(color.lower())
if rgb is None:
raise ValueError('Unkown color.')
elif isinstance(... | 35.157895 | 107 | 0.607784 |
8472e43d1f80829ce45afd353982c548cc09d678 | 651 | py | Python | Aula 37/Controller/linguagem_backend_controller.py | Katakhan/TrabalhosPython2 | ab47af0ff3c00922857578e58a1a149d9e65e229 | [
"MIT"
] | null | null | null | Aula 37/Controller/linguagem_backend_controller.py | Katakhan/TrabalhosPython2 | ab47af0ff3c00922857578e58a1a149d9e65e229 | [
"MIT"
] | null | null | null | Aula 37/Controller/linguagem_backend_controller.py | Katakhan/TrabalhosPython2 | ab47af0ff3c00922857578e58a1a149d9e65e229 | [
"MIT"
] | null | null | null | import sys
sys.path.append(r'C:\Users\900132\Desktop\GitHub\TrabalhosPython2\Aula 37')
from Dao.linguagem_backend_dao import BackDao
from Model.linguagem_backend import LinguagemBackend
class LinguagemBackendController:
dao = BackDao()
def listar_todos(self):
return self.dao.listar_todos()
def bu... | 28.304348 | 75 | 0.740399 |
0a31ca38e9ab8af82c929f39c27e42885c8ba17b | 476 | py | Python | tests/multi_lead_graphene_output/plot_bands.py | kmkolasinski/Bubel | dd0f66475c5d93060e48a6a46a8debf2f2a350d0 | [
"MIT"
] | null | null | null | tests/multi_lead_graphene_output/plot_bands.py | kmkolasinski/Bubel | dd0f66475c5d93060e48a6a46a8debf2f2a350d0 | [
"MIT"
] | null | null | null | tests/multi_lead_graphene_output/plot_bands.py | kmkolasinski/Bubel | dd0f66475c5d93060e48a6a46a8debf2f2a350d0 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Created on Thu Mar 5 14:16:21 2015
@author: Krzysztof Kolasinski
"""
import numpy as np
import matplotlib.pyplot as plt
import csv
file = "bands.dat"
data = np.loadtxt(file)
no_lines = np.size(data[0,:])
x = data[:,0]
for i in range(no_lines-1):
plt.plot(x,data[:,i+1],c='k',ls='-') ... | 19.04 | 45 | 0.617647 |
8c9a87a6619c9e4148e67b8b47f7bf949409a767 | 77,300 | py | Python | jina/flow/base.py | sakshamgurbhele/jina | 5565b55b233eaac9fc59e8361b3e18d78c4d9b15 | [
"Apache-2.0"
] | 1 | 2021-11-14T13:22:29.000Z | 2021-11-14T13:22:29.000Z | jina/flow/base.py | sakshamgurbhele/jina | 5565b55b233eaac9fc59e8361b3e18d78c4d9b15 | [
"Apache-2.0"
] | null | null | null | jina/flow/base.py | sakshamgurbhele/jina | 5565b55b233eaac9fc59e8361b3e18d78c4d9b15 | [
"Apache-2.0"
] | null | null | null | import argparse
import base64
import copy
import itertools
import json
import multiprocessing
import os
import re
import sys
import threading
import time
import uuid
from collections import OrderedDict
from contextlib import ExitStack
from typing import (
Optional,
Union,
Tuple,
List,
Set,
Dict,... | 41.648707 | 283 | 0.612393 |
2366d3b29e85a30dbf84e0b96269af504eb4c167 | 1,494 | py | Python | copper_sdk/activities.py | Agilicus/copper-sdk | dfdecd4aa76bdd47661fdd4bfada7781f8eae835 | [
"MIT"
] | 4 | 2021-01-03T07:40:01.000Z | 2021-09-03T09:21:02.000Z | copper_sdk/activities.py | Agilicus/copper-sdk | dfdecd4aa76bdd47661fdd4bfada7781f8eae835 | [
"MIT"
] | 5 | 2020-09-03T17:28:13.000Z | 2021-10-04T22:47:23.000Z | copper_sdk/activities.py | Agilicus/copper-sdk | dfdecd4aa76bdd47661fdd4bfada7781f8eae835 | [
"MIT"
] | 3 | 2020-09-02T14:54:46.000Z | 2021-09-02T18:12:45.000Z | from copper_sdk.base import BaseResource
class Activities(BaseResource):
def __init__(self, copper):
self.copper = copper
def get(self, id):
return self.copper.get(f'/activities/{id}')
def create(self, body=None):
if body is None:
body = {}
return self.copper... | 40.378378 | 162 | 0.630522 |
bc952f01badf96b7ea39053431fb4cfd9b7508ba | 7,553 | py | Python | OntoMapper.py | shadi-tabasi/IOPE | 330572bad72d2af92eb55388c65ae01b4a16b3fb | [
"CC0-1.0"
] | null | null | null | OntoMapper.py | shadi-tabasi/IOPE | 330572bad72d2af92eb55388c65ae01b4a16b3fb | [
"CC0-1.0"
] | null | null | null | OntoMapper.py | shadi-tabasi/IOPE | 330572bad72d2af92eb55388c65ae01b4a16b3fb | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
from rdflib.graph import Graph
from rdflib import URIRef
import Queries, OntoConcepts, UtilityFunctions
import unicodedata, os, time, sys
import random
def OntoMapper(AtelierURI, AtelierLabel):
StartTime = time.time()
# input parameters
OntoFileName = "onto.nt"
... | 56.789474 | 721 | 0.712962 |
721a3c28c6d44ac82f8a0131a17146a019a1f561 | 627 | py | Python | utility/hash_util.py | andradediego/blockchainpython | f1b08c93c226458b09dab2b4c5d76a8b4cd83bcf | [
"MIT"
] | null | null | null | utility/hash_util.py | andradediego/blockchainpython | f1b08c93c226458b09dab2b4c5d76a8b4cd83bcf | [
"MIT"
] | null | null | null | utility/hash_util.py | andradediego/blockchainpython | f1b08c93c226458b09dab2b4c5d76a8b4cd83bcf | [
"MIT"
] | null | null | null | import hashlib as hl
import json
# __all__ = ['hash_string_256', 'hash_block']
def hash_string_256(string):
"""Create a SHA256 hash for a given input string.
Arguments:
:string: The string which should be hashed.
"""
return hl.sha256(string).hexdigest()
def hash_block(block):
"""Hashes a block and returns ... | 27.26087 | 97 | 0.744817 |
6b792a85e194e54a157977988edcfc6e4bb7a3ba | 2,119 | py | Python | examples/py/asciichart.py | diwenshi61/ccxt | ebdda10e7c4ed8841d572f3bfe198b5f0e949cf6 | [
"MIT"
] | 24,910 | 2017-10-27T21:41:59.000Z | 2022-03-31T23:08:57.000Z | examples/py/asciichart.py | diwenshi61/ccxt | ebdda10e7c4ed8841d572f3bfe198b5f0e949cf6 | [
"MIT"
] | 8,201 | 2017-10-28T10:19:28.000Z | 2022-03-31T23:49:37.000Z | examples/py/asciichart.py | diwenshi61/ccxt | ebdda10e7c4ed8841d572f3bfe198b5f0e949cf6 | [
"MIT"
] | 6,632 | 2017-10-28T02:53:24.000Z | 2022-03-31T23:20:14.000Z | # -*- coding: utf-8 -*-
# This file is a copied implementation from my asciichart repository on GitHub
# https://github.com/kroitor/asciichart
from math import cos
# from math import sin
from math import pi
from math import floor
from math import ceil
def plot(series, cfg={}):
minimum = min(series)
maximum... | 32.6 | 109 | 0.563001 |
952b7c7c2a1d7e8d80506304efbdc9860d74e770 | 1,075 | py | Python | Day01-15/code/Day13/test2.py | EngrSaad2/Python-100-Days | ab0b26714b1df50d02a1433dc82f2a3fb025be5c | [
"Apache-2.0"
] | 6 | 2020-04-22T14:07:51.000Z | 2021-09-07T12:55:23.000Z | Day01-15/code/Day13/test2.py | 2462612540/Python-Language | a676d1274a04ff03f1aea0de9c58019d6ef8f5fe | [
"Apache-2.0"
] | 88 | 2019-10-31T12:30:02.000Z | 2020-08-14T12:17:12.000Z | Day01-15/code/Day13/test2.py | 2462612540/Python-Language | a676d1274a04ff03f1aea0de9c58019d6ef8f5fe | [
"Apache-2.0"
] | 4 | 2019-08-25T05:51:00.000Z | 2021-04-16T08:14:16.000Z | import time
from threading import Thread, Lock
class Account(object):
def __init__(self, balance=0):
self._balance = balance
self._lock = Lock()
@property
def balance(self):
return self._balance
def deposit(self, money):
# 当多个线程同时访问一个资源的时候 就有可能因为竞争资源导致资源的状态错误
... | 20.673077 | 51 | 0.567442 |
dffba646dfd75b93f251e8e785b419c52cef6312 | 11,522 | py | Python | homeassistant/components/homematicip_cloud/climate.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 4 | 2021-07-11T09:11:00.000Z | 2022-02-27T14:43:50.000Z | homeassistant/components/homematicip_cloud/climate.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 277 | 2021-10-04T06:39:33.000Z | 2021-12-28T22:04:17.000Z | homeassistant/components/homematicip_cloud/climate.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Support for HomematicIP Cloud climate devices."""
from __future__ import annotations
from typing import Any
from homematicip.aio.device import AsyncHeatingThermostat, AsyncHeatingThermostatCompact
from homematicip.aio.group import AsyncHeatingGroup
from homematicip.base.enums import AbsenceType
from homematicip.de... | 33.988201 | 96 | 0.658827 |
c949ca6b847923abbfa491c94050bab2e2263710 | 2,665 | py | Python | project_euler/001-050/08.py | floppp/programming_challenges | 42df1b72faf5ddf907296f90e9b14e014d2ea13b | [
"MIT"
] | null | null | null | project_euler/001-050/08.py | floppp/programming_challenges | 42df1b72faf5ddf907296f90e9b14e014d2ea13b | [
"MIT"
] | null | null | null | project_euler/001-050/08.py | floppp/programming_challenges | 42df1b72faf5ddf907296f90e9b14e014d2ea13b | [
"MIT"
] | null | null | null | '''
The four adjacent digits in the 1000-digit number that have the greatest
product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
668... | 55.520833 | 1,004 | 0.899812 |
7d4d02b7c7f85aebb5a24805f3e96d2c2247d0e6 | 1,843 | py | Python | stt.py | Goneiross/Yumiakui | 594f4445847112c5bb8e76ac63fb1b7c9b798902 | [
"MIT"
] | null | null | null | stt.py | Goneiross/Yumiakui | 594f4445847112c5bb8e76ac63fb1b7c9b798902 | [
"MIT"
] | null | null | null | stt.py | Goneiross/Yumiakui | 594f4445847112c5bb8e76ac63fb1b7c9b798902 | [
"MIT"
] | null | null | null | import json
from os.path import join, dirname
from ibm_watson import SpeechToTextV1
from ibm_watson.websocket import RecognizeCallback, AudioSource
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
STT_NAME = "GOOGLE"
def stt_init():
"""
Initialize choosen STT.
Supports IBM Watson and Go... | 32.333333 | 124 | 0.627238 |
5da3b6368220dffa8429831e9000ad7b94a2faf2 | 756 | py | Python | src/modules/encoder.py | andompesta/omnitext | da6467b6cd9086b2278f7a1560596261f125800e | [
"MIT"
] | null | null | null | src/modules/encoder.py | andompesta/omnitext | da6467b6cd9086b2278f7a1560596261f125800e | [
"MIT"
] | null | null | null | src/modules/encoder.py | andompesta/omnitext | da6467b6cd9086b2278f7a1560596261f125800e | [
"MIT"
] | null | null | null | from torch import nn, Tensor
from typing import Optional
from src.config import BaseConf
from src.modules import (
EncoderLayer
)
class Encoder(nn.Module):
def __init__(self, conf: BaseConf):
super(Encoder, self).__init__()
self.layer = nn.ModuleList([EncoderLayer(conf) for _ in range(conf.num... | 28 | 95 | 0.612434 |
3f780cc185e57aaf36a1d1174e5ac2c39d8e642d | 10,996 | py | Python | DjangoUeditor/views.py | niuwenju/minicms | 745f34304abbe30c88eba9f3878f70332b8deba3 | [
"MIT"
] | null | null | null | DjangoUeditor/views.py | niuwenju/minicms | 745f34304abbe30c88eba9f3878f70332b8deba3 | [
"MIT"
] | null | null | null | DjangoUeditor/views.py | niuwenju/minicms | 745f34304abbe30c88eba9f3878f70332b8deba3 | [
"MIT"
] | null | null | null | #coding:utf-8
from importlib import import_module
from django.http import HttpResponse
import settings as USettings
import os
import json
from django.views.decorators.csrf import csrf_exempt
import datetime,random
import urllib
def get_path_format_vars():
return {
"year":datetime.datetime.now().strftime("%... | 35.81759 | 148 | 0.651328 |
95d939e07728975669a564ebdc8daa88df65363e | 4,795 | py | Python | tests/test_api_interface.py | CSugarPrince/Historical-Forex-Predictor | f50eb317852e540c3dfb3199769ce0ba250bf741 | [
"MIT"
] | null | null | null | tests/test_api_interface.py | CSugarPrince/Historical-Forex-Predictor | f50eb317852e540c3dfb3199769ce0ba250bf741 | [
"MIT"
] | null | null | null | tests/test_api_interface.py | CSugarPrince/Historical-Forex-Predictor | f50eb317852e540c3dfb3199769ce0ba250bf741 | [
"MIT"
] | null | null | null | import unittest
from unittest.mock import patch, Mock
# appending to sys.path enables scripts in test folder to import code from
# parent directory where src files are located
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import api_interface
""" unittest design notes:
T... | 43.198198 | 126 | 0.63024 |
0b6e6a15e784a4fecbaacd2d7686ab8e1b4a8ffc | 1,801 | py | Python | 1_Crawler/1_newscrawler/newscrawler/spiders/konya.py | bap-project/SMM | e65e27b985a4aa108fdb5236bc63e70f423661bf | [
"MIT"
] | null | null | null | 1_Crawler/1_newscrawler/newscrawler/spiders/konya.py | bap-project/SMM | e65e27b985a4aa108fdb5236bc63e70f423661bf | [
"MIT"
] | null | null | null | 1_Crawler/1_newscrawler/newscrawler/spiders/konya.py | bap-project/SMM | e65e27b985a4aa108fdb5236bc63e70f423661bf | [
"MIT"
] | null | null | null | from scrapy.spiders import CrawlSpider, Rule
from scrapy.linkextractors import LinkExtractor
from scrapy.selector import HtmlXPathSelector
from datetime import datetime
from ..items import NewsItem
import pandas as pd
import re
class KonyaSpider(CrawlSpider):
name = "konya"
allowed_domains = ["https://www.bul... | 39.152174 | 138 | 0.57357 |
abb82ec2cbeafd64de91decca87cd91a9365520f | 42,033 | py | Python | irc/client.py | larsks/irc | 187e6b4dc4cce60c7bf972d53f54723189751711 | [
"MIT"
] | null | null | null | irc/client.py | larsks/irc | 187e6b4dc4cce60c7bf972d53f54723189751711 | [
"MIT"
] | null | null | null | irc/client.py | larsks/irc | 187e6b4dc4cce60c7bf972d53f54723189751711 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Internet Relay Chat (IRC) protocol client library.
This library is intended to encapsulate the IRC protocol in Python.
It provides an event-driven IRC client framework. It has
a fairly thorough support for the basic IRC protocol, CTCP, and DCC chat.
To best understand how to make an IRC ... | 31.135556 | 87 | 0.59872 |
e509f364e68d3eb4ba81036644ea86291d966415 | 338 | py | Python | aws_mock/requests/describe_key_pairs.py | enaydanov/aws_mock | 4ad3dca270ad164693e85741d5e92f845c34aa01 | [
"Apache-2.0"
] | null | null | null | aws_mock/requests/describe_key_pairs.py | enaydanov/aws_mock | 4ad3dca270ad164693e85741d5e92f845c34aa01 | [
"Apache-2.0"
] | 1 | 2021-10-21T21:06:29.000Z | 2021-10-21T21:06:29.000Z | aws_mock/requests/describe_key_pairs.py | bentsi/aws_mock | d6c1b963e02b4cd3602722e7135f4d65f6a71d3e | [
"Apache-2.0"
] | 1 | 2021-11-08T14:20:36.000Z | 2021-11-08T14:20:36.000Z | from aws_mock.lib import get_aws_mock_db, aws_response
@aws_response
def describe_key_pairs(key_name: str) -> dict | tuple[str, dict, int]:
if key_pair := get_aws_mock_db()["key"].find_one({"name": key_name}):
return {"items": [key_pair]}
return "responses/describe_key_pairs_not_found.xml", {"key_name... | 37.555556 | 84 | 0.718935 |
cbabcf3465df8f07bcc5fb6b9af57058b78523cc | 15,398 | py | Python | bloop.py | bondscripting/bloop | 7ee0bc16458670c7689dbc8aeed012c1fb9f307a | [
"MIT"
] | null | null | null | bloop.py | bondscripting/bloop | 7ee0bc16458670c7689dbc8aeed012c1fb9f307a | [
"MIT"
] | null | null | null | bloop.py | bondscripting/bloop | 7ee0bc16458670c7689dbc8aeed012c1fb9f307a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import math;
from PIL import Image, ImageDraw;
import sys;
import xml.etree.ElementTree as ET;
class BloopException(Exception):
pass;
def main():
try:
inputFileName = None;
outputFileName = "bloop.png";
args = {};
geometry = None;
numSamples = 1;
i = 1;
numArgs = len(sys.argv);
... | 25.706177 | 125 | 0.663723 |
fd680d3e7cd14b5027be1c9d05b9350a6bc76107 | 30,078 | py | Python | flax/wallet/trade_manager.py | ReadyNeutron/shitcoin-blockchain | 80add4e545ad22a317244f7fd958d118a5a75c5d | [
"Apache-2.0"
] | 174 | 2021-06-16T17:49:22.000Z | 2022-03-17T03:03:17.000Z | flax/wallet/trade_manager.py | ReadyNeutron/shitcoin-blockchain | 80add4e545ad22a317244f7fd958d118a5a75c5d | [
"Apache-2.0"
] | 49 | 2021-06-17T14:10:53.000Z | 2022-01-31T11:04:21.000Z | flax/wallet/trade_manager.py | ReadyNeutron/shitcoin-blockchain | 80add4e545ad22a317244f7fd958d118a5a75c5d | [
"Apache-2.0"
] | 80 | 2021-06-17T14:23:31.000Z | 2022-02-24T05:52:47.000Z | import logging
import time
import traceback
from pathlib import Path
from secrets import token_bytes
from typing import Any, Dict, List, Optional, Tuple
from blspy import AugSchemeMPL
from flax.types.blockchain_format.coin import Coin
from flax.types.blockchain_format.program import Program
from flax.types.blockchain... | 46.131902 | 118 | 0.60649 |
e764df28cf084a1afbbdb01417d393ab1012da3a | 8,256 | py | Python | ahds/tests/test_ahds.py | paulkorir/ahds | 813dd745f76165893d1dd43477a7653b5c02cdc0 | [
"Apache-2.0"
] | 6 | 2018-12-15T20:42:09.000Z | 2021-06-15T16:43:05.000Z | ahds/tests/test_ahds.py | paulkorir/ahds | 813dd745f76165893d1dd43477a7653b5c02cdc0 | [
"Apache-2.0"
] | 6 | 2019-04-08T09:59:53.000Z | 2021-09-21T20:18:13.000Z | ahds/tests/test_ahds.py | paulkorir/ahds | 813dd745f76165893d1dd43477a7653b5c02cdc0 | [
"Apache-2.0"
] | 1 | 2019-11-20T07:45:04.000Z | 2019-11-20T07:45:04.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
import os
import re
import sys
import ahds
from . import Py23FixTestCase, TEST_DATA_PATH
from ..ahds import parse_args, get_debug, get_literal, get_paths, set_file_and_paths, get_amira_file
from ..core import _str, _print
import numpy
def _parse_with_shle... | 37.527273 | 104 | 0.616037 |
4d1b39d2802f9be6877c954692d8a32b5ba76060 | 7,463 | py | Python | src/spodernet/spodernet/preprocessing/vocab.py | JD-AI-Research-Silicon-Valley/SACN | dba00fec88dd20b68a08f85c129ea878d56d0375 | [
"MIT"
] | 96 | 2018-11-13T02:40:07.000Z | 2022-03-10T02:05:20.000Z | SACN/src/spodernet/spodernet/preprocessing/vocab.py | zouguojian/KGEF | ffde1085339c0f304cf269cf7b57ae593ecbf8bf | [
"MIT"
] | 22 | 2018-11-16T12:35:41.000Z | 2022-01-09T10:35:45.000Z | SACN/src/spodernet/spodernet/preprocessing/vocab.py | zouguojian/KGEF | ffde1085339c0f304cf269cf7b57ae593ecbf8bf | [
"MIT"
] | 31 | 2019-01-21T17:52:04.000Z | 2022-02-25T07:10:39.000Z | from collections import Counter
import numpy as np
import os
import time
import datetime
import pickle
import urllib
import src.bashmagic.bashmagic
import time
import json
from src.spodernet.spodernet.utils.util import get_data_path, save_data, xavier_uniform_weight
from os.path import join
from src.spodernet.spoder... | 36.583333 | 149 | 0.575774 |
b1202101132aec237923723e17cb60daf096707b | 16,235 | py | Python | plots/psd_analysis.py | SAKEverse/sake-plot | a08973222109981b36d204a754d0bf34d95be192 | [
"Apache-2.0"
] | null | null | null | plots/psd_analysis.py | SAKEverse/sake-plot | a08973222109981b36d204a754d0bf34d95be192 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:21:18.000Z | 2021-11-30T16:21:18.000Z | plots/psd_analysis.py | SAKEverse/sake-plot | a08973222109981b36d204a754d0bf34d95be192 | [
"Apache-2.0"
] | null | null | null | ########## ------------------------------- IMPORTS ------------------------ ##########
import numpy as np
import pandas as pd
from scipy.stats import gaussian_kde
from beartype import beartype
from typing import TypeVar
PandasDf = TypeVar('pandas.core.frame.DataFrame')
from processing.stft import get_freq_index
#######... | 33.964435 | 131 | 0.623899 |
edc2dd8eb3b8ed3ce10e7a168444951ca62e1b14 | 13,431 | py | Python | tools/fidl/difl/comparator.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 210 | 2019-02-05T12:45:09.000Z | 2022-03-28T07:59:06.000Z | tools/fidl/difl/comparator.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 56 | 2021-06-03T03:16:25.000Z | 2022-03-20T01:07:44.000Z | tools/fidl/difl/comparator.py | wwjiang007/fuchsia-1 | 0db66b52b5bcd3e27c8b8c2163925309e8522f94 | [
"BSD-2-Clause"
] | 73 | 2019-03-06T18:55:23.000Z | 2022-03-26T12:04:51.000Z | # Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from difl.ir import *
import typing
__all__ = ['Comparator']
class Comparator:
def __init__(self):
self.identifier_shapes_match: typing.Dict[s... | 44.77 | 97 | 0.589755 |
9223b4eb6e7bcc67d48886b46d7f3df0cd8c7ad6 | 44,952 | py | Python | openmdao/jacobians/tests/test_jacobian.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | null | null | null | openmdao/jacobians/tests/test_jacobian.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | 2 | 2021-06-10T15:29:27.000Z | 2021-08-18T20:07:56.000Z | openmdao/jacobians/tests/test_jacobian.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | null | null | null | """ Test the Jacobian objects."""
import itertools
import sys
import unittest
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from openmdao.api import IndepVarComp, Group, Problem, \
ExplicitComponent, ImplicitComponent, ExecComp, \
NewtonSolver, S... | 36.576078 | 220 | 0.546427 |
351cfa60f3c37d069c6baf48cadf28efd1bd6e2c | 3,518 | py | Python | demo/webcam.py | Zhangyongtao123/maskrcnn_benchmark | 059f04c26df2c1bd19dd7360ee2487ce3461da37 | [
"MIT"
] | null | null | null | demo/webcam.py | Zhangyongtao123/maskrcnn_benchmark | 059f04c26df2c1bd19dd7360ee2487ce3461da37 | [
"MIT"
] | null | null | null | demo/webcam.py | Zhangyongtao123/maskrcnn_benchmark | 059f04c26df2c1bd19dd7360ee2487ce3461da37 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import argparse
import cv2
import os
from maskrcnn_benchmark.config import cfg
from predictor import COCODemo
import time
def main():
parser = argparse.ArgumentParser(description="PyTorch Object Detection Webcam Demo")
parser.add_argumen... | 31.981818 | 109 | 0.604321 |
d98ea976b4088f9cb5e791ed99f66d6b156bd56e | 7,901 | py | Python | code/face-detection/tools/wider_test.py | FRH-Code-Data/Appendix | 106a7c65c178d2b446e3bd8fb192ac2f4b7e323f | [
"CC-BY-4.0"
] | 5 | 2020-02-28T09:28:55.000Z | 2021-06-03T02:15:42.000Z | code/face-detection/tools/wider_test.py | FRH-Code-Data/Appendix | 106a7c65c178d2b446e3bd8fb192ac2f4b7e323f | [
"CC-BY-4.0"
] | 6 | 2020-03-08T22:58:13.000Z | 2022-03-12T00:15:14.000Z | code/face-detection/tools/wider_test.py | FRH-Code-Data/Appendix | 106a7c65c178d2b446e3bd8fb192ac2f4b7e323f | [
"CC-BY-4.0"
] | 3 | 2020-02-28T09:29:03.000Z | 2020-03-09T05:08:07.000Z | #-*- coding:utf-8 -*-
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import os
import torch
import argparse
import torch.nn as nn
import torch.utils.data as data
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
... | 32.64876 | 92 | 0.542463 |
2b5860397ec2c58d9f45fee3e3eebdc0358fad80 | 2,484 | py | Python | wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_argument_names.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 3,968 | 2017-08-23T21:27:19.000Z | 2022-03-31T22:00:19.000Z | wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_argument_names.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 2,725 | 2017-04-17T00:29:15.000Z | 2022-03-31T21:01:53.000Z | wandb/vendor/graphql-core-1.1/wandb_graphql/validation/rules/known_argument_names.py | borisgrafx/client | c079f7816947a3092b500751eb920fda3866985f | [
"MIT"
] | 351 | 2018-04-08T19:39:34.000Z | 2022-03-30T19:38:08.000Z | from ...error import GraphQLError
from ...language import ast
from ...utils.quoted_or_list import quoted_or_list
from ...utils.suggestion_list import suggestion_list
from .base import ValidationRule
def _unknown_arg_message(arg_name, field_name, type, suggested_args):
message = 'Unknown argument "{}" on field "{}... | 34.985915 | 100 | 0.551932 |
4cae1ed4ffee609363ee0126af570870c7592f44 | 12,536 | py | Python | src/lamplib/src/genny/tasks/run_tests.py | samanca/genny | 0e45d89f998f28e6227bedcce4e8d7d1b1d13d79 | [
"Apache-2.0"
] | null | null | null | src/lamplib/src/genny/tasks/run_tests.py | samanca/genny | 0e45d89f998f28e6227bedcce4e8d7d1b1d13d79 | [
"Apache-2.0"
] | 1 | 2021-09-06T20:06:24.000Z | 2021-09-06T20:06:24.000Z | src/lamplib/src/genny/tasks/run_tests.py | samanca/genny | 0e45d89f998f28e6227bedcce4e8d7d1b1d13d79 | [
"Apache-2.0"
] | null | null | null | import structlog
import os
import shutil
from typing import Callable, TypeVar, Tuple, Optional
from genny import curator, cmd_runner, toolchain
SLOG = structlog.get_logger(__name__)
# We rely on catch2 to report test failures, but it doesn't always do so.
# See https://github.com/catchorg/Catch2/issues/1210
# As a ... | 35.613636 | 230 | 0.650606 |
e27c1e9a5280b4f0dcf59f81e3a3092375e4ccf2 | 36,946 | py | Python | airflow/executors/kubernetes_executor.py | growbots/incubator-airflow | a8a4d322ee960ef51a03a87db44fe352abb910e6 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2020-09-30T01:06:15.000Z | 2021-08-07T09:16:21.000Z | airflow/executors/kubernetes_executor.py | growbots/incubator-airflow | a8a4d322ee960ef51a03a87db44fe352abb910e6 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-01T18:16:43.000Z | 2020-07-01T18:16:43.000Z | airflow/executors/kubernetes_executor.py | growbots/incubator-airflow | a8a4d322ee960ef51a03a87db44fe352abb910e6 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2019-07-04T02:46:30.000Z | 2019-07-15T00:56:09.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 45.166259 | 106 | 0.62724 |
be3256e2c236eeac4eed56c05fea9b64646894a7 | 2,485 | py | Python | docs/conf.py | dottinf/dimcli | 708e83675afa6279424487c5b7417f5393c480bb | [
"MIT"
] | 1 | 2020-04-15T06:16:33.000Z | 2020-04-15T06:16:33.000Z | docs/conf.py | dottinf/dimcli | 708e83675afa6279424487c5b7417f5393c480bb | [
"MIT"
] | null | null | null | docs/conf.py | dottinf/dimcli | 708e83675afa6279424487c5b7417f5393c480bb | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 35 | 93 | 0.652716 |
2857269d5f5356ac7c3829dea684674fac327bad | 10,427 | py | Python | animations/lm95p1.py | TristanCacqueray/demo-render | 4c8403e684165e5e75c046ee023c1f794a6650a8 | [
"Apache-2.0"
] | 9 | 2018-02-19T14:17:12.000Z | 2021-03-27T14:46:28.000Z | animations/lm95p1.py | TristanCacqueray/demo-render | 4c8403e684165e5e75c046ee023c1f794a6650a8 | [
"Apache-2.0"
] | null | null | null | animations/lm95p1.py | TristanCacqueray/demo-render | 4c8403e684165e5e75c046ee023c1f794a6650a8 | [
"Apache-2.0"
] | null | null | null | #!/bin/env python3
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 33.744337 | 127 | 0.48432 |
1e88a007449cf2b1d937e4a706a17048fc065695 | 1,114 | py | Python | data_management/toolboxes/scripts/BlankScript.py | conklinbd/solutions-geoprocessing-toolbox | 7afab793ea34b7e7cb7e32757e8a150b6637ffd2 | [
"Apache-2.0"
] | null | null | null | data_management/toolboxes/scripts/BlankScript.py | conklinbd/solutions-geoprocessing-toolbox | 7afab793ea34b7e7cb7e32757e8a150b6637ffd2 | [
"Apache-2.0"
] | null | null | null | data_management/toolboxes/scripts/BlankScript.py | conklinbd/solutions-geoprocessing-toolbox | 7afab793ea34b7e7cb7e32757e8a150b6637ffd2 | [
"Apache-2.0"
] | 1 | 2018-10-25T15:52:41.000Z | 2018-10-25T15:52:41.000Z | #-------------------------------------------------------------------------------
# Copyright 2010-2013 Esri
# 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/... | 39.785714 | 80 | 0.572711 |
b02a07090c51eff010d63aad505dd4d20f16e3eb | 22,191 | py | Python | emotion_recognition.py | junction-kabantchiki/emotion-recognition-using-speech | d7e51c96cbb7f93bfa07f501dfe2eaf799acfc9a | [
"MIT"
] | null | null | null | emotion_recognition.py | junction-kabantchiki/emotion-recognition-using-speech | d7e51c96cbb7f93bfa07f501dfe2eaf799acfc9a | [
"MIT"
] | null | null | null | emotion_recognition.py | junction-kabantchiki/emotion-recognition-using-speech | d7e51c96cbb7f93bfa07f501dfe2eaf799acfc9a | [
"MIT"
] | null | null | null | from data_extractor import load_data
from utils import extract_feature, AVAILABLE_EMOTIONS
from create_csv import write_emodb_csv, write_tess_ravdess_csv, write_custom_csv
from sklearn.metrics import accuracy_score, make_scorer, fbeta_score, mean_squared_error, mean_absolute_error
from sklearn.metrics import confusion... | 45.01217 | 236 | 0.619981 |
e3db7c6be470d4f05ae6f1a7b131a6f2459dd860 | 9,754 | py | Python | src/collect/fraudulous.py | ymentha14/emojis_dataset | 8c5565a39c2862c14dfe41c3b441e9d3e5896a27 | [
"MIT"
] | null | null | null | src/collect/fraudulous.py | ymentha14/emojis_dataset | 8c5565a39c2862c14dfe41c3b441e9d3e5896a27 | [
"MIT"
] | null | null | null | src/collect/fraudulous.py | ymentha14/emojis_dataset | 8c5565a39c2862c14dfe41c3b441e9d3e5896a27 | [
"MIT"
] | null | null | null | """
Fraudulous users detection
As many ways exist for a user input to be invalid (garbage repeated input, random words answering etc)
One need to either
(1): perform a workers selection on-the-fly (possible with mt2gf)
(2): accept all data in a first time and filter it afterwards
The second option was chosen f... | 31.566343 | 104 | 0.655526 |
e97517a4f084076d5a18c085ea6f1487fed1b18b | 3,459 | py | Python | mint/timelord/timelord_launcher.py | sai-genesis/rc1-test | 56e565952b283450c8589296f87c31b1c67b8502 | [
"Apache-2.0"
] | null | null | null | mint/timelord/timelord_launcher.py | sai-genesis/rc1-test | 56e565952b283450c8589296f87c31b1c67b8502 | [
"Apache-2.0"
] | null | null | null | mint/timelord/timelord_launcher.py | sai-genesis/rc1-test | 56e565952b283450c8589296f87c31b1c67b8502 | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import pathlib
import signal
import socket
import time
from typing import Dict, List
import pkg_resources
from mint.util.mint_logging import initialize_logging
from mint.util.config import load_config
from mint.util.default_root import DEFAULT_ROOT_PATH
from mint.util.setproctitle import... | 30.078261 | 100 | 0.65279 |
a4acc85c78bd01cfc10bfd7593f07e7260df76e0 | 1,753 | py | Python | test/test_deferred.py | tcdude/py-klondike-solver | 1eb45cd556f0c934c0a079eeb43e8a99d943c094 | [
"MIT"
] | 1 | 2020-02-26T18:20:46.000Z | 2020-02-26T18:20:46.000Z | test/test_deferred.py | tcdude/py-klondike-solver | 1eb45cd556f0c934c0a079eeb43e8a99d943c094 | [
"MIT"
] | 2 | 2020-03-17T11:11:32.000Z | 2021-03-20T19:18:23.000Z | test/test_deferred.py | tcdude/py-klondike-solver | 1eb45cd556f0c934c0a079eeb43e8a99d943c094 | [
"MIT"
] | null | null | null | """
Unit tests for the deferred module.
"""
from pyksolve import deferred
__author__ = 'Tiziano Bettio'
__license__ = 'MIT'
__version__ = '0.0.10'
__copyright__ = """
Copyright (c) 2020 Tiziano Bettio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documen... | 34.372549 | 78 | 0.733029 |
72db4c269839bf9fe2c9fc07bd3e57db4139356a | 2,568 | py | Python | blocc/forms.py | kelvin-daniel/neighborhood | ea4123ef5b42a9046f10a1d55827bd0b82dd4cd1 | [
"MIT"
] | null | null | null | blocc/forms.py | kelvin-daniel/neighborhood | ea4123ef5b42a9046f10a1d55827bd0b82dd4cd1 | [
"MIT"
] | null | null | null | blocc/forms.py | kelvin-daniel/neighborhood | ea4123ef5b42a9046f10a1d55827bd0b82dd4cd1 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from .models import *
from django.core.exceptions import ValidationError
def ForbiddenUsers(value):
forbidden_users = ['admin', 'css', 'js', 'authenticate', 'login', 'logout', 'administrator', 'root',
'email', 'user', 'join', 'sql', 'static', 'pyth... | 34.702703 | 112 | 0.716121 |
6089cb43cccc1563b954608ad7836fd9acf3c272 | 4,323 | py | Python | tests/platform/test_service_cart.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 15 | 2018-11-02T14:35:52.000Z | 2022-03-16T07:51:44.000Z | tests/platform/test_service_cart.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | 84 | 2018-11-02T12:50:32.000Z | 2022-03-22T01:25:54.000Z | tests/platform/test_service_cart.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | 13 | 2019-01-03T09:16:50.000Z | 2022-02-15T18:37:19.000Z | import uuid
import pytest
from commercetools.platform import models
from commercetools.platform.client import Client
def test_cart_get_by_id(ct_platform_client: Client, cart_draft):
cart = ct_platform_client.with_project_key("test").carts().post(cart_draft)
assert cart.id
@pytest.fixture
def cart_draft(c... | 31.554745 | 81 | 0.573907 |
1464d17e9cc0138c0d1aa361ecd223461d7127e5 | 135 | py | Python | iterpop/__init__.py | mmore500/iterpop | 7f93edd7405fa7363a1c7f80a5a0b22cfe5675ea | [
"MIT"
] | null | null | null | iterpop/__init__.py | mmore500/iterpop | 7f93edd7405fa7363a1c7f80a5a0b22cfe5675ea | [
"MIT"
] | null | null | null | iterpop/__init__.py | mmore500/iterpop | 7f93edd7405fa7363a1c7f80a5a0b22cfe5675ea | [
"MIT"
] | null | null | null | """Top-level package for iterpop."""
__author__ = """Matthew Andres Moreno"""
__email__ = 'm.more500@gmail.com'
__version__ = '0.4.0'
| 22.5 | 40 | 0.688889 |
f8edf2445364db26e513433ef3d656dd157ea6b2 | 714 | py | Python | api/migrations/0001_initial.py | Shelestov7/mi_trainee_task | 2db65806b1b1f491bf10a8d72738aaa57d84f8f5 | [
"MIT"
] | null | null | null | api/migrations/0001_initial.py | Shelestov7/mi_trainee_task | 2db65806b1b1f491bf10a8d72738aaa57d84f8f5 | [
"MIT"
] | 5 | 2021-03-19T03:07:37.000Z | 2021-09-22T18:59:51.000Z | api/migrations/0001_initial.py | Shelestov7/mi_trainee_task | 2db65806b1b1f491bf10a8d72738aaa57d84f8f5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.12 on 2020-05-10 12:09
import datetime
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Secret',
fields=[
... | 27.461538 | 120 | 0.612045 |
ec1c692894dff4568184f00256d8d4af6deb10e3 | 3,768 | py | Python | tests/test_others.py | surajpotnuru/sqllineage | fe66eb6dda781eb57dfe3d928432268657c1af4f | [
"MIT"
] | null | null | null | tests/test_others.py | surajpotnuru/sqllineage | fe66eb6dda781eb57dfe3d928432268657c1af4f | [
"MIT"
] | null | null | null | tests/test_others.py | surajpotnuru/sqllineage | fe66eb6dda781eb57dfe3d928432268657c1af4f | [
"MIT"
] | null | null | null | from sqllineage.runner import LineageRunner
from .helpers import helper
def test_use():
helper("USE db1")
def test_table_name_case():
helper(
"""insert overwrite table tab_a
select * from tab_b
union all
select * from TAB_B""",
{"tab_b"},
{"tab_a"},
)
def test_create():
hel... | 21.780347 | 85 | 0.647824 |
a29841920a226ecd4ffd903cc4e04a7966cad19c | 1,163 | py | Python | iot/synth.py | theacodes/google-cloud-python | 57dafcb78540e12c82f7ca0fc77d75edeb269390 | [
"Apache-2.0"
] | 1 | 2020-10-25T04:39:41.000Z | 2020-10-25T04:39:41.000Z | iot/synth.py | di/google-cloud-python | a0bd8d0565e2a682760a113c59ce12b872bce9ab | [
"Apache-2.0"
] | 4 | 2018-11-13T22:15:36.000Z | 2018-12-07T18:31:38.000Z | iot/synth.py | di/google-cloud-python | a0bd8d0565e2a682760a113c59ce12b872bce9ab | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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, s... | 34.205882 | 77 | 0.644024 |
469340d66ac5f1c53f9af95d519d5680b869631f | 66 | py | Python | ndgpy/data/__init__.py | asrvsn/ndgpy | 4302ec6767feec16286394361fd84d2fc4fe0cdf | [
"MIT"
] | null | null | null | ndgpy/data/__init__.py | asrvsn/ndgpy | 4302ec6767feec16286394361fd84d2fc4fe0cdf | [
"MIT"
] | null | null | null | ndgpy/data/__init__.py | asrvsn/ndgpy | 4302ec6767feec16286394361fd84d2fc4fe0cdf | [
"MIT"
] | null | null | null | from .base import *
from .streaming import *
from .shared import * | 22 | 24 | 0.742424 |
64a953ff2ed981cfbb3e9228631f465ec46e8273 | 1,431 | py | Python | pcdet/models/backbones_3d/vfe/mean_vfe.py | dleam/Associate-3Ddet-V2 | 85f19a6a9b128a8f91c831a27fdae4ffdeb2dc8c | [
"Apache-2.0"
] | 5 | 2021-08-13T16:20:49.000Z | 2021-12-30T10:40:02.000Z | pcdet/models/backbones_3d/vfe/mean_vfe.py | dleam/Associate-3Ddet-V2 | 85f19a6a9b128a8f91c831a27fdae4ffdeb2dc8c | [
"Apache-2.0"
] | 3 | 2021-09-27T14:10:57.000Z | 2021-12-25T05:37:47.000Z | pcdet/models/backbones_3d/vfe/mean_vfe.py | dleam/Associate-3Ddet-V2 | 85f19a6a9b128a8f91c831a27fdae4ffdeb2dc8c | [
"Apache-2.0"
] | null | null | null | import torch
from .vfe_template import VFETemplate
class MeanVFE(VFETemplate):
def __init__(self, model_cfg, num_point_features, **kwargs):
super().__init__(model_cfg=model_cfg)
self.num_point_features = num_point_features
def get_output_feature_dim(self):
return self.num_point_featu... | 38.675676 | 102 | 0.666667 |
6d84d129a41edba49f4ad67cee5a49b09038f6c4 | 2,523 | py | Python | nboost/database.py | kaykanloo/nboost | 8412ae449345180612eeb3d0d34f79e517fd2dca | [
"Apache-2.0"
] | 646 | 2019-11-12T19:57:12.000Z | 2022-03-30T01:54:58.000Z | nboost/database.py | kaykanloo/nboost | 8412ae449345180612eeb3d0d34f79e517fd2dca | [
"Apache-2.0"
] | 85 | 2019-11-10T18:17:36.000Z | 2021-10-15T11:20:21.000Z | nboost/database.py | kaykanloo/nboost | 8412ae449345180612eeb3d0d34f79e517fd2dca | [
"Apache-2.0"
] | 75 | 2019-11-23T19:30:32.000Z | 2022-03-27T18:15:08.000Z | import os
import time
from typing import Optional
from sqlite3 import Cursor
import sqlite3
from nboost import defaults
class Database:
def __init__(self, db_file: type(defaults.db_file) = defaults.db_file, **_):
os.makedirs(db_file.parent, exist_ok=True)
self.db_file = db_file
def new_row(se... | 29.682353 | 80 | 0.529132 |
5692dc922a0e2c74e645d7562d397d13b4ab812d | 872 | py | Python | goratings/interfaces/Storage.py | flovo/goratings | 50b5443b73daae64306e256205eabee8f4815c65 | [
"MIT"
] | 13 | 2020-07-02T16:43:12.000Z | 2021-12-12T00:12:48.000Z | goratings/interfaces/Storage.py | flovo/goratings | 50b5443b73daae64306e256205eabee8f4815c65 | [
"MIT"
] | 13 | 2020-07-05T10:06:42.000Z | 2022-02-27T10:03:24.000Z | goratings/interfaces/Storage.py | flovo/goratings | 50b5443b73daae64306e256205eabee8f4815c65 | [
"MIT"
] | 2 | 2020-07-04T11:19:37.000Z | 2021-01-15T16:46:32.000Z | import abc
from typing import Any, Dict
__all__ = ["Storage"]
class Storage(abc.ABC):
@abc.abstractmethod
def get(self, player_id: int) -> Any:
raise NotImplementedError
@abc.abstractmethod
def set(self, player_id: int, entry: Any) -> None:
raise NotImplementedError
@abc.abstrac... | 24.914286 | 65 | 0.682339 |
946c02234cfe66e218fe30a66dda5c7f421a6e95 | 1,507 | py | Python | tests/test_rows.py | dimagi/djtables | dfe5b9e2ea51fd42e528cbe4a7f23cdcfda59fad | [
"MIT"
] | 1 | 2020-09-15T22:17:11.000Z | 2020-09-15T22:17:11.000Z | tests/test_rows.py | adammck/djtables | 8fa279e7088123f00cca9c838fe028ebf327325e | [
"MIT"
] | null | null | null | tests/test_rows.py | adammck/djtables | 8fa279e7088123f00cca9c838fe028ebf327325e | [
"MIT"
] | 1 | 2019-09-29T04:19:21.000Z | 2019-09-29T04:19:21.000Z | #!/usr/bin/env python
# vim: et ts=4 sw=4
from nose.tools import raises
from djtables.table import Table
from djtables.column import Column
from djtables.row import Row
class TestTable(Table):
name = Column()
weapon = Column()
def test_accepts_dicts():
obj = {
'name': "Leonardo",
'we... | 19.828947 | 48 | 0.595222 |
299f5707ecff43da848a89b11466043368ed3e68 | 12,573 | py | Python | tests/test_participant_model.py | bountysource/www.gittip.com | 84cd36dd1da2eec54ebf0fe8c7c31d10ae5b933c | [
"CC0-1.0"
] | 4 | 2015-03-11T02:04:27.000Z | 2021-04-28T01:33:40.000Z | tests/test_participant_model.py | sigmavirus24/www.gittip.com | 112ea4e62aefad11c36954f0f979679ce057cf02 | [
"CC0-1.0"
] | null | null | null | tests/test_participant_model.py | sigmavirus24/www.gittip.com | 112ea4e62aefad11c36954f0f979679ce057cf02 | [
"CC0-1.0"
] | 3 | 2015-08-27T09:47:17.000Z | 2018-08-02T14:05:59.000Z | from __future__ import unicode_literals
import random
import datetime
from decimal import Decimal
import psycopg2
import pytz
from nose.tools import assert_raises
from gittip.testing import Harness
from gittip.models import Participant, Tip
from gittip.participant import Participant as OldParticipant
class Tests(Ha... | 35.820513 | 81 | 0.621809 |
524aab9c6660f8bfa2544c8ea56eb1354666036e | 2,047 | py | Python | openbook_common/management/commands/worker_health_check.py | TamaraAbells/okuna-api | f87d8e80d2f182c01dbce68155ded0078ee707e4 | [
"MIT"
] | 164 | 2019-07-29T17:59:06.000Z | 2022-03-19T21:36:01.000Z | openbook_common/management/commands/worker_health_check.py | TamaraAbells/okuna-api | f87d8e80d2f182c01dbce68155ded0078ee707e4 | [
"MIT"
] | 188 | 2019-03-16T09:53:25.000Z | 2019-07-25T14:57:24.000Z | openbook_common/management/commands/worker_health_check.py | TamaraAbells/okuna-api | f87d8e80d2f182c01dbce68155ded0078ee707e4 | [
"MIT"
] | 80 | 2019-08-03T17:49:08.000Z | 2022-02-28T16:56:33.000Z | from sys import exit
from logging import getLogger
from django.conf import settings
from django.core.management.base import BaseCommand
from openbook_common.utils.rq_helpers import RQStats
from openbook_common.helpers import send_alert_to_channel
from openbook.settings import RQ_QUEUES, FAILED_JOB_THRESHOLD
from ope... | 30.552239 | 77 | 0.595017 |
1dccadddf33e58ed304be2ee6361b3566d323dd2 | 31,577 | py | Python | cc_gen.py | skolchin/gbr | 3ec4b72e0352d36f38f5cd5815b69fac0b7a3e9c | [
"MIT"
] | 29 | 2019-10-10T22:51:55.000Z | 2022-03-09T05:57:59.000Z | cc_gen.py | skolchin/gbr | 3ec4b72e0352d36f38f5cd5815b69fac0b7a3e9c | [
"MIT"
] | 1 | 2020-12-07T06:51:50.000Z | 2020-12-08T16:59:20.000Z | cc_gen.py | skolchin/gbr | 3ec4b72e0352d36f38f5cd5815b69fac0b7a3e9c | [
"MIT"
] | 11 | 2020-12-09T01:44:38.000Z | 2022-03-20T17:40:02.000Z | #-------------------------------------------------------------------------------
# Name: Go board recognition project
# Purpose: OpenCV board extraction script
#
# Author: kol
#
# Created: 18.12.2019
# Copyright: (c) kol 2019
# Licence: MIT
#----------------------------------------------------... | 38.275152 | 122 | 0.557463 |
d546c133c5a4debefae43963128d7b51405be44b | 1,368 | py | Python | fiasko_bro/validators/code_inclusion.py | SerejkaSJ/fiasko_bro | dfb8c30109f317c1e5b6d211e002fd148695809e | [
"MIT"
] | 25 | 2018-01-24T10:45:35.000Z | 2020-12-05T21:47:20.000Z | fiasko_bro/validators/code_inclusion.py | SerejkaSJ/fiasko_bro | dfb8c30109f317c1e5b6d211e002fd148695809e | [
"MIT"
] | 110 | 2018-01-21T12:25:13.000Z | 2021-06-10T19:27:22.000Z | fiasko_bro/validators/code_inclusion.py | SerejkaSJ/fiasko_bro | dfb8c30109f317c1e5b6d211e002fd148695809e | [
"MIT"
] | 13 | 2017-12-12T22:19:01.000Z | 2019-01-29T18:08:05.000Z | from ..utils import code_helpers
def too_difficult_by_mccabe(project_folder, max_complexity, *args, **kwargs):
violations = []
for parsed_file in project_folder.get_parsed_py_files():
violations += code_helpers.get_mccabe_violations_for_file(parsed_file.path, max_complexity)
if violations:
... | 44.129032 | 116 | 0.708333 |
9d8c0c3bcef1cd9b3649ab8035459ffca7f6176f | 1,121 | py | Python | tests/conftest.py | ChrisPanopoulos/conda | fc81d4217f6c1804e983d1698f8b7cc5bc01874c | [
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | ChrisPanopoulos/conda | fc81d4217f6c1804e983d1698f8b7cc5bc01874c | [
"BSD-3-Clause"
] | null | null | null | tests/conftest.py | ChrisPanopoulos/conda | fc81d4217f6c1804e983d1698f8b7cc5bc01874c | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from pathlib import Path
import subprocess
import sys
import pytest
from conda.testing.fixtures import (
suppress_resource_warning,
tmpdir,
clear_subdir_cache,
)
win_default_shells = ["cmd.exe", "powershell... | 28.025 | 83 | 0.706512 |
3a5486b3be23ff4d13ec989d1159e5211d192684 | 2,081 | py | Python | juriscraper/opinions/united_states/state/vt_u.py | johnhawkinson/juriscraper | 7c0407849ce5b960b2412df7939db545c356a899 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states/state/vt_u.py | johnhawkinson/juriscraper | 7c0407849ce5b960b2412df7939db545c356a899 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states/state/vt_u.py | johnhawkinson/juriscraper | 7c0407849ce5b960b2412df7939db545c356a899 | [
"BSD-2-Clause"
] | 1 | 2021-03-03T00:03:16.000Z | 2021-03-03T00:03:16.000Z | """Scraper for the Supreme Court of Vermont
CourtID: vt
Court Short Name: VT
Author: Brian W. Carver
Date created: 18 Aug 2013
Reviewer: Mike Lissner
"""
from datetime import datetime
from six.moves.urllib.parse import urlsplit
from juriscraper.OpinionSite import OpinionSite
from lxml import html
class Site(Opinion... | 35.271186 | 99 | 0.611725 |
bcff88225903d8eae8a866d6e5b8f880e19b4fd4 | 907 | py | Python | cogs/greetings.py | aomayo77/psychic-octo-chainsaw | e516dadf656f52f813b7674a228a79c7353445fa | [
"MIT"
] | 2 | 2022-01-21T02:08:38.000Z | 2022-02-09T04:46:48.000Z | cogs/greetings.py | aomayo77/psychic-octo-chainsaw | e516dadf656f52f813b7674a228a79c7353445fa | [
"MIT"
] | 3 | 2022-01-08T00:18:19.000Z | 2022-02-17T03:17:54.000Z | cogs/greetings.py | aomayo77/psychic-octo-chainsaw | e516dadf656f52f813b7674a228a79c7353445fa | [
"MIT"
] | 2 | 2022-01-21T22:40:28.000Z | 2022-01-25T20:27:13.000Z | from discord.ext import commands
import discord
import sys
sys.dont_write_bytecode = True
class greetings(commands.Cog):
def __init__(self, bot):
self.bot = bot
self._last_member = None
@commands.Cog.listener()
async def on_member_join(self, member):
channel = member.guild.system_... | 29.258065 | 83 | 0.638368 |
2af99c115fb8ec4b999754d43fc348c43d44e0b1 | 3,700 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/crm/models/crm_team.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/crm/models/crm_team.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/crm/models/crm_team.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.tools.safe_eval import safe_eval
class Team(models.Model):
_name = 'crm.team'
_inherit = ['mail.alias.mixin', 'crm.team']
resource_calendar_id = fields.Many2o... | 45.679012 | 227 | 0.657297 |
523e744d753bf075090775f6c04c1663f024b90e | 2,691 | py | Python | tests/cholupdates/rank_1/downdate/test_downdate_seeger.py | marvinpfoertner/cholupdates | b102504cc096ba7f298bc5a881c35472d9111b83 | [
"MIT"
] | 6 | 2020-12-15T15:17:09.000Z | 2021-04-22T16:48:17.000Z | tests/cholupdates/rank_1/downdate/test_downdate_seeger.py | marvinpfoertner/cholupdates | b102504cc096ba7f298bc5a881c35472d9111b83 | [
"MIT"
] | 22 | 2020-12-15T17:08:32.000Z | 2022-03-20T10:15:04.000Z | tests/cholupdates/rank_1/downdate/test_downdate_seeger.py | marvinpfoertner/cholupdates | b102504cc096ba7f298bc5a881c35472d9111b83 | [
"MIT"
] | null | null | null | """Specific tests for the function :func:`cholupdates.rank_1.downdate_seeger`."""
import numpy as np
import pytest
import cholupdates
@pytest.mark.parametrize(
"impl", [None] + cholupdates.rank_1.downdate_seeger.available_impls
)
def test_memory_order(L: np.ndarray, v: np.ndarray, impl: str):
"""Assert that... | 36.364865 | 88 | 0.686734 |
2f6a0e7afb59166efab6b78e66c8caf501ad04b5 | 5,861 | py | Python | api/app/utils/mongo_utils.py | crtarsorg/glasomer.rs | 3b486241ea3d127dbe95c2c90210da51a38b0f29 | [
"CC0-1.0"
] | null | null | null | api/app/utils/mongo_utils.py | crtarsorg/glasomer.rs | 3b486241ea3d127dbe95c2c90210da51a38b0f29 | [
"CC0-1.0"
] | null | null | null | api/app/utils/mongo_utils.py | crtarsorg/glasomer.rs | 3b486241ea3d127dbe95c2c90210da51a38b0f29 | [
"CC0-1.0"
] | null | null | null | # coding=utf-8
import datetime
from bson import SON
import string
class MongoUtils:
def __init__(self, mongo):
self.mongo = mongo
self.collection_name = 'answers'
def save_to_database(self, data):
self._insert(data)
def _insert(self, data):
json_doc = {
'answ... | 31.510753 | 112 | 0.465791 |
6cce6198d1f8e9ebd964cd66441782c456047f52 | 286 | py | Python | Contributions/Roll_the_dice.py | OluSure/Hacktoberfest2021-1 | ad1bafb0db2f0cdeaae8f87abbaa716638c5d2ea | [
"MIT"
] | 215 | 2021-10-01T08:18:16.000Z | 2022-03-29T04:12:03.000Z | Contributions/Roll_the_dice.py | OluSure/Hacktoberfest2021-1 | ad1bafb0db2f0cdeaae8f87abbaa716638c5d2ea | [
"MIT"
] | 51 | 2021-10-01T08:16:42.000Z | 2021-10-31T13:51:51.000Z | Contributions/Roll_the_dice.py | OluSure/Hacktoberfest2021-1 | ad1bafb0db2f0cdeaae8f87abbaa716638c5d2ea | [
"MIT"
] | 807 | 2021-10-01T08:11:45.000Z | 2021-11-21T18:57:09.000Z | import random
min = 1
max = 6
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are....")
print(random.randint(min, max))
print(random.randint(min, max))
roll_again = input("Roll the dices again?")
| 20.428571 | 47 | 0.632867 |
46b4870e5130ab5fdc5295bc7e5ff7ba2c11ccd9 | 108 | py | Python | responsibleai/responsibleai/_tools/causal/__init__.py | ezherdeva/responsible-ai-toolbox | 70895df616ca6f78ec83740e7705f641ef32c127 | [
"MIT"
] | 119 | 2021-12-02T21:00:47.000Z | 2022-03-31T06:44:31.000Z | responsibleai/responsibleai/_tools/causal/__init__.py | ezherdeva/responsible-ai-toolbox | 70895df616ca6f78ec83740e7705f641ef32c127 | [
"MIT"
] | 293 | 2021-11-30T16:45:49.000Z | 2022-03-31T23:57:13.000Z | responsibleai/responsibleai/_tools/causal/__init__.py | ezherdeva/responsible-ai-toolbox | 70895df616ca6f78ec83740e7705f641ef32c127 | [
"MIT"
] | 28 | 2021-12-07T17:28:04.000Z | 2022-03-31T07:47:11.000Z | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
"""Utilities for causal module."""
| 21.6 | 37 | 0.740741 |
1bf4e63c02f7d6bc0f1666e156b43a3f038671bf | 391 | py | Python | everest/ptolemaic/datalike/primary/_primary.py | rsbyrne/everest | 1ec06301cdeb7c2b7d85daf6075d996c5529247e | [
"MIT"
] | 2 | 2020-12-17T02:27:28.000Z | 2020-12-17T23:50:13.000Z | everest/ptolemaic/datalike/primary/_primary.py | rsbyrne/everest | 1ec06301cdeb7c2b7d85daf6075d996c5529247e | [
"MIT"
] | 1 | 2020-12-07T10:14:45.000Z | 2020-12-07T10:14:45.000Z | everest/ptolemaic/datalike/primary/_primary.py | rsbyrne/everest | 1ec06301cdeb7c2b7d85daf6075d996c5529247e | [
"MIT"
] | 1 | 2020-10-22T11:16:50.000Z | 2020-10-22T11:16:50.000Z | ###############################################################################
''''''
###############################################################################
from . import _Datalike
class Primary(_Datalike):
...
###############################################################################
#########... | 26.066667 | 79 | 0.102302 |
f546adf3bdbb430348abf209bf7808a16f76677b | 573 | py | Python | plotly/validators/histogram2dcontour/_autocolorscale.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/histogram2dcontour/_autocolorscale.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/histogram2dcontour/_autocolorscale.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class AutocolorscaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name='autocolorscale',
parent_name='histogram2dcontour',
**kwargs
):
super(AutocolorscaleValidator, self).__init__(
... | 28.65 | 77 | 0.623037 |
d33020e252808d4eac94796f998e409754a9354f | 6,530 | py | Python | tests/test_tags.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | tests/test_tags.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | tests/test_tags.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python2
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
import re
import os
import sys
import unittest
import commonl.testing
import tcfl
import tcfl.tc
_src = os.path.abspath(__file__)
_srcdir = os.path.dirname(_src)
class _test(unittest.TestCase,
commonl.... | 28.893805 | 80 | 0.580858 |
121e02fff52791903c4202119461a1772c5cd5ab | 52 | py | Python | cruft/__main__.py | tdhopper/cruft | 37e46693ecdd3467bd01b022447e100163f4733a | [
"MIT"
] | 293 | 2020-08-18T05:52:45.000Z | 2022-03-31T20:39:43.000Z | cruft/__main__.py | tdhopper/cruft | 37e46693ecdd3467bd01b022447e100163f4733a | [
"MIT"
] | 102 | 2020-08-28T16:38:34.000Z | 2022-03-31T11:01:41.000Z | cruft/__main__.py | tdhopper/cruft | 37e46693ecdd3467bd01b022447e100163f4733a | [
"MIT"
] | 36 | 2020-08-28T16:34:10.000Z | 2022-03-31T21:55:53.000Z | from cruft import _cli
_cli.app(prog_name="cruft")
| 13 | 27 | 0.769231 |
2cdf3fd58f94a9ae1dc485458b8ea8f2134b99d8 | 6,953 | py | Python | python_code/client.py | nivertech/ethersecret | 1cae5bd62ff4dbbdcc572857fc2aeb19fab698fb | [
"Apache-2.0"
] | 1 | 2018-04-09T07:08:46.000Z | 2018-04-09T07:08:46.000Z | python_code/client.py | nivertech/ethersecret | 1cae5bd62ff4dbbdcc572857fc2aeb19fab698fb | [
"Apache-2.0"
] | 2 | 2017-03-29T11:58:02.000Z | 2017-03-29T20:42:17.000Z | python_code/client.py | nivertech/ethersecret | 1cae5bd62ff4dbbdcc572857fc2aeb19fab698fb | [
"Apache-2.0"
] | 4 | 2017-03-31T06:02:51.000Z | 2018-10-31T03:57:49.000Z | from pycoin.serialize import b2h, h2b
from pycoin import encoding
import rlp
from ethereum import tester, utils, abi, blocks, transactions
import requests
import json
import jsonrpc
import time
from ethereum.abi import ContractTranslator
from ethereum.utils import mk_contract_address
from eth_warpper import *
#impor... | 29.969828 | 99 | 0.649504 |
c1932e3ae23229bbca9058085709abed0caea4b9 | 245 | py | Python | openjij/utils/__init__.py | zeta1999/OpenJij | 0fe03f07af947f519a32ad58fe20423919651634 | [
"Apache-2.0"
] | 61 | 2019-01-05T13:37:10.000Z | 2022-03-11T02:11:08.000Z | openjij/utils/__init__.py | zeta1999/OpenJij | 0fe03f07af947f519a32ad58fe20423919651634 | [
"Apache-2.0"
] | 79 | 2019-01-29T09:55:20.000Z | 2022-02-19T04:06:20.000Z | openjij/utils/__init__.py | 29rou/OpenJij | c2579fba8710cf82b9e6761304f0042b365b595c | [
"Apache-2.0"
] | 21 | 2019-01-07T07:55:10.000Z | 2022-03-08T14:27:23.000Z | from .benchmark import solver_benchmark, residual_energy, time_to_solution, success_probability, se_residual_energy, se_success_probability, se_upper_tts, se_lower_tts
from .res_convertor import convert_response
import openjij.utils.graph_utils
| 61.25 | 167 | 0.885714 |
54db07d659377e33f356092f523863a15192bdab | 3,262 | py | Python | tbd/preprocessing.py | jiaweih/TBD | f9c2532b26f063ba72733ea5d18c1499a92376d5 | [
"MIT"
] | null | null | null | tbd/preprocessing.py | jiaweih/TBD | f9c2532b26f063ba72733ea5d18c1499a92376d5 | [
"MIT"
] | null | null | null | tbd/preprocessing.py | jiaweih/TBD | f9c2532b26f063ba72733ea5d18c1499a92376d5 | [
"MIT"
] | null | null | null | """Process the protein sequence into specified data format for modeling.
"""
import pickle
import pandas as pd
def set_length_limit(df, length_limit=40, verbose=True):
"""Return sequences of length above specified length_limit.
Args:
df (dataframe): dataframe of protein sequence
length_limit ... | 33.979167 | 79 | 0.681484 |
c8703af1afe6bb4c6a6cb54211bbe29122092514 | 20,073 | py | Python | torch/onnx/__init__.py | mcx/pytorch | b02b3f25dbffeead4f06d32e75dd4a282e8b0b5f | [
"Intel"
] | 1 | 2022-03-11T22:08:48.000Z | 2022-03-11T22:08:48.000Z | torch/onnx/__init__.py | sascristian/pytorch | f09c696ecda155c42006f85d2687445dfb24774f | [
"Intel"
] | null | null | null | torch/onnx/__init__.py | sascristian/pytorch | f09c696ecda155c42006f85d2687445dfb24774f | [
"Intel"
] | null | null | null | import torch._C as _C
from typing import Dict, Optional
TensorProtoDataType = _C._onnx.TensorProtoDataType
OperatorExportTypes = _C._onnx.OperatorExportTypes
TrainingMode = _C._onnx.TrainingMode
_CAFFE2_ATEN_FALLBACK = _C._onnx._CAFFE2_ATEN_FALLBACK
ONNX_ARCHIVE_MODEL_PROTO_NAME = "__MODEL_PROTO"
producer_name = "py... | 42.617834 | 112 | 0.608678 |
ead5b5bf57954074d7d6e8bb835c66e28446ee45 | 911 | py | Python | example/example_04.py | owlbarn/owl_onnx | 956f45dd80cc28d85f9b4c061e21c878f969eefd | [
"MIT"
] | 6 | 2019-09-16T20:42:42.000Z | 2019-10-30T11:51:14.000Z | example/example_04.py | owlbarn/owl_onnx | 956f45dd80cc28d85f9b4c061e21c878f969eefd | [
"MIT"
] | null | null | null | example/example_04.py | owlbarn/owl_onnx | 956f45dd80cc28d85f9b4c061e21c878f969eefd | [
"MIT"
] | 1 | 2019-10-26T15:46:26.000Z | 2019-10-26T15:46:26.000Z | #!/usr/bin/env python3
### Eval option 1: onnxruntime
import numpy as np
import onnxruntime as rt
sess = rt.InferenceSession("test.onnx")
# Note how the initializer works without usr providing input
pred_onx = sess.run(None, input_feed={})
print(pred_onx[0])
# The user can also provide her own input
input_x = s... | 26.028571 | 72 | 0.720088 |
ab197fbb530657e4f67b983c81a38d3d7ee3aa8e | 1,696 | py | Python | src/lib/zircon/rust/tools/gen_status.py | EnderNightLord-ChromeBook/zircon-rpi | b09b1eb3aa7a127c65568229fe10edd251869283 | [
"BSD-2-Clause"
] | 14 | 2020-10-25T05:48:36.000Z | 2021-09-20T02:46:20.000Z | src/lib/zircon/rust/tools/gen_status.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | null | null | null | src/lib/zircon/rust/tools/gen_status.py | DamieFC/fuchsia | f78a4a1326f4a4bb5834500918756173c01bab4f | [
"BSD-2-Clause"
] | 2 | 2020-10-25T01:13:49.000Z | 2020-10-26T02:32:13.000Z | #!/usr/bin/env python3.8
# Copyright 2016 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# A tool for autogenerating the mapping between Status and zx_status_t
# Usage: python gen_status.py zircon/system/public/zircon/err... | 29.241379 | 85 | 0.556604 |
b9216d4ada8df1351413aa3d61c6b4799a9d279d | 9,410 | py | Python | jobless/jobhandlers/slurm_backend.py | sjdv1982/cloudless | 05d7decaed6751cab43a468ea9bfc5961e89d259 | [
"MIT"
] | null | null | null | jobless/jobhandlers/slurm_backend.py | sjdv1982/cloudless | 05d7decaed6751cab43a468ea9bfc5961e89d259 | [
"MIT"
] | 1 | 2021-05-07T17:08:18.000Z | 2021-05-07T17:08:18.000Z | jobless/jobhandlers/slurm_backend.py | sjdv1982/cloudless | 05d7decaed6751cab43a468ea9bfc5961e89d259 | [
"MIT"
] | null | null | null | from . import Backend, SeamlessTransformationError, JoblessRemoteError
import asyncio
import sys, os, tempfile, shutil
import psutil
import json
import subprocess, tarfile
from functools import partial
import numpy as np
from io import BytesIO
import traceback
class SlurmBackend(Backend):
support_symlinks = True
... | 34.723247 | 131 | 0.586504 |
244dff6d0e554b85e25065c821609a3749c0c192 | 4,495 | py | Python | mkdocs/tests/search_tests.py | MahdiMajidzadeh/mkdocs | 8c668d972b92f49c6a6b0ffdcefcf10fd6dc5a4c | [
"BSD-2-Clause"
] | 4 | 2019-09-05T07:46:32.000Z | 2021-02-24T21:19:51.000Z | mkdocs/tests/search_tests.py | MahdiMajidzadeh/mkdocs | 8c668d972b92f49c6a6b0ffdcefcf10fd6dc5a4c | [
"BSD-2-Clause"
] | 10 | 2017-05-10T08:10:23.000Z | 2020-03-23T10:23:37.000Z | mkdocs/tests/search_tests.py | MahdiMajidzadeh/mkdocs | 8c668d972b92f49c6a6b0ffdcefcf10fd6dc5a4c | [
"BSD-2-Clause"
] | 38 | 2017-04-26T14:13:37.000Z | 2021-06-24T11:36:38.000Z | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import unittest
from mkdocs import nav
from mkdocs.contrib.legacy_search import search_index as search
from mkdocs.tests.base import dedent, markdown_to_toc, load_config
def strip_whitespace(string):
return string.replace("\n", "").re... | 29.188312 | 89 | 0.588877 |
6c3c897a1b47a24210e3fce062f6c556c8ffaca5 | 85,402 | py | Python | src/sage/combinat/rigged_configurations/rigged_configuration_element.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/rigged_configurations/rigged_configuration_element.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/rigged_configurations/rigged_configuration_element.py | UCD4IDS/sage | 43474c96d533fd396fe29fe0782d44dc7f5164f7 | [
"BSL-1.0"
] | null | null | null | r"""
Rigged Configuration Elements
A rigged configuration element is a sequence of
:class:`~sage.combinat.rigged_configurations.rigged_partition.RiggedPartition`
objects.
AUTHORS:
- Travis Scrimshaw (2010-09-26): Initial version
- Travis Scrimshaw (2012-10-25): Added virtual rigged configurations
"""
# ************... | 35.436515 | 165 | 0.503829 |
af638ebcf2be5669d3542a6629636f93e961f797 | 3,143 | py | Python | transformer.py | fangyihao/teamnet | 4f906b80f17626b0b2aedf9b6f495dbd0eb47dd6 | [
"Apache-2.0"
] | 1 | 2022-03-25T03:07:28.000Z | 2022-03-25T03:07:28.000Z | transformer.py | fangyihao/teamnet | 4f906b80f17626b0b2aedf9b6f495dbd0eb47dd6 | [
"Apache-2.0"
] | 1 | 2022-01-05T06:08:00.000Z | 2022-01-05T06:08:29.000Z | transformer.py | fangyihao/teamnet | 4f906b80f17626b0b2aedf9b6f495dbd0eb47dd6 | [
"Apache-2.0"
] | 1 | 2021-07-15T07:25:08.000Z | 2021-07-15T07:25:08.000Z | '''
Created on Jun 21, 2018
@author: fangy5
'''
# Imports we need.
import tensorflow as tf
import matplotlib.pyplot as plt
import numpy as np
import os
import collections
from tensor2tensor import models
from tensor2tensor import problems
from tensor2tensor.layers import common_layers
from tensor2tensor.utils import ... | 30.221154 | 106 | 0.773147 |
614f11e58d17ac1f2198ebd1a2050bc7905de66e | 741 | py | Python | setup.py | atbradley/eaccpf-indexer | da50970a0ffbc9b0eb892814ef07071ed5e843b2 | [
"Apache-2.0"
] | null | null | null | setup.py | atbradley/eaccpf-indexer | da50970a0ffbc9b0eb892814ef07071ed5e843b2 | [
"Apache-2.0"
] | null | null | null | setup.py | atbradley/eaccpf-indexer | da50970a0ffbc9b0eb892814ef07071ed5e843b2 | [
"Apache-2.0"
] | null | null | null | """
This file is subject to the terms and conditions defined in the
LICENSE file, which is part of this source code package.
"""
from pip.req import parse_requirements
from setuptools import setup, find_packages
# read metadata
with open('README.md', 'r') as f:
description = f.read()
version = '1.5.1'
# package ... | 28.5 | 109 | 0.731444 |
70793451c614c39edf0baa82c9faac06537e5b68 | 10,062 | py | Python | global_helpers/panther_oss_helpers.py | BatteryCandy/panther-analysis | a67ca63581fe328d3f2c7493f0cdb889acb3181f | [
"Apache-2.0"
] | 1 | 2020-10-21T08:14:49.000Z | 2020-10-21T08:14:49.000Z | global_helpers/panther_oss_helpers.py | georgeSkoumas/panther-analysis | 30b21c270504bf7c84f99207c9c6c2f6110843ae | [
"Apache-2.0"
] | null | null | null | global_helpers/panther_oss_helpers.py | georgeSkoumas/panther-analysis | 30b21c270504bf7c84f99207c9c6c2f6110843ae | [
"Apache-2.0"
] | null | null | null | """Utility functions provided to policies and rules during execution."""
from ipaddress import ip_network
import time
from typing import Any, Dict, Union, Sequence, Set
import boto3
_RESOURCE_TABLE = None # boto3.Table resource, lazily constructed
class BadLookup(Exception):
"""Error returned when a resource l... | 32.775244 | 97 | 0.645697 |
0e97d88bdf5dcebf95dd51db44ee373b1bb34cf0 | 4,016 | gyp | Python | third_party/domain_registry_provider/src/testing/gtest.gyp | x0rzkov/incubator-pagespeed-mod | d192f0e92bc6201474a9295f50aad625cde68889 | [
"Apache-2.0"
] | null | null | null | third_party/domain_registry_provider/src/testing/gtest.gyp | x0rzkov/incubator-pagespeed-mod | d192f0e92bc6201474a9295f50aad625cde68889 | [
"Apache-2.0"
] | null | null | null | third_party/domain_registry_provider/src/testing/gtest.gyp | x0rzkov/incubator-pagespeed-mod | d192f0e92bc6201474a9295f50aad625cde68889 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'gtest',
'type': 'static_library',
'sources': [
'gtest/include/gtest/gtest-death-test.h',... | 32.387097 | 76 | 0.522659 |
0fc515d8c2f1f66fb8b3599949e56caf4a009bd9 | 2,368 | py | Python | egs/librispeech/ASR/local/compute_fbank_musan.py | danpovey/icefall | 8469f9ae0a2d7686f04e558fba8ddfb5505109fc | [
"Apache-2.0"
] | 2 | 2021-09-02T02:32:11.000Z | 2021-11-01T07:14:15.000Z | egs/librispeech/ASR/local/compute_fbank_musan.py | danpovey/icefall | 8469f9ae0a2d7686f04e558fba8ddfb5505109fc | [
"Apache-2.0"
] | null | null | null | egs/librispeech/ASR/local/compute_fbank_musan.py | danpovey/icefall | 8469f9ae0a2d7686f04e558fba8ddfb5505109fc | [
"Apache-2.0"
] | 2 | 2021-09-02T14:17:20.000Z | 2022-02-28T07:18:34.000Z | #!/usr/bin/env python3
"""
This file computes fbank features of the musan dataset.
Its looks for manifests in the directory data/manifests.
The generated fbank features are saved in data/fbank.
"""
import logging
import os
from pathlib import Path
import torch
from lhotse import CutSet, Fbank, FbankConfig, LilcomHd... | 29.234568 | 83 | 0.658361 |
e8e6f285ecb9a6a9c506755f1330d843829f1354 | 23,590 | py | Python | official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_deeplab_merge.py | Lufeifeina/models | d7d260d4c690e5163070e21d75df372ab559ea23 | [
"Apache-2.0"
] | 1 | 2020-09-14T10:46:07.000Z | 2020-09-14T10:46:07.000Z | official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_deeplab_merge.py | Lufeifeina/models | d7d260d4c690e5163070e21d75df372ab559ea23 | [
"Apache-2.0"
] | null | null | null | official/vision/beta/projects/panoptic_maskrcnn/modeling/layers/panoptic_deeplab_merge.py | Lufeifeina/models | d7d260d4c690e5163070e21d75df372ab559ea23 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.458699 | 94 | 0.711149 |
bcd4cfba8e6ecf1dcbef319a2110a1a3639dee20 | 4,518 | py | Python | terminal.py | shivanshcoder/PyPromptCLI | 854ba97043638d84eb85eb88e8a3c3d0920346d0 | [
"MIT"
] | null | null | null | terminal.py | shivanshcoder/PyPromptCLI | 854ba97043638d84eb85eb88e8a3c3d0920346d0 | [
"MIT"
] | null | null | null | terminal.py | shivanshcoder/PyPromptCLI | 854ba97043638d84eb85eb88e8a3c3d0920346d0 | [
"MIT"
] | null | null | null | from prompt_toolkit.shortcuts import prompt
from prompt_toolkit.completion import WordCompleter, NestedCompleter
class BaseTerminal:
command_list = [
]
def __init__(self):
completer_dict = {}
#for commands in self.command_list:
# if not isinstance(commands, BaseComm... | 24.031915 | 83 | 0.517043 |
dfb7db97afd9d79fd8de8bf4cefa3ddf48a9dff3 | 1,815 | py | Python | tests/test_boilerplate.py | kronecker08/qxf2-page-object-model | 03383afffec73f4d3038c0e909462e7886227ecb | [
"MIT"
] | 207 | 2017-01-05T17:16:49.000Z | 2022-03-24T13:50:41.000Z | tests/test_boilerplate.py | kronecker08/qxf2-page-object-model | 03383afffec73f4d3038c0e909462e7886227ecb | [
"MIT"
] | 178 | 2018-01-08T22:12:47.000Z | 2022-03-03T14:32:43.000Z | tests/test_boilerplate.py | kronecker08/qxf2-page-object-model | 03383afffec73f4d3038c0e909462e7886227ecb | [
"MIT"
] | 162 | 2017-02-15T09:28:31.000Z | 2022-02-19T14:50:17.000Z | """
This test file will help you get started in writing a new test using our framework
"""
import os,sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from page_objects.PageFactory import PageFactory
from utils.Option_Parser import Option_Parser
import pytest
@pytest.mark.GUI
def test_b... | 31.842105 | 182 | 0.709642 |
7a329d0c5fdf5ab05052681aa310e15b9e8d6d1b | 155 | py | Python | 1064.py | gabzin/uri | 177bdf3f87bacfd924bd031a973b8db877379fe5 | [
"MIT"
] | 3 | 2021-09-21T18:50:20.000Z | 2021-12-14T13:07:31.000Z | 1064.py | gabzin/uri | 177bdf3f87bacfd924bd031a973b8db877379fe5 | [
"MIT"
] | null | null | null | 1064.py | gabzin/uri | 177bdf3f87bacfd924bd031a973b8db877379fe5 | [
"MIT"
] | null | null | null | pos=0
med=0.00
for i in range(6):
x=float(input())
if x>0:
pos+=1
med+=x
print(f"{pos} valores positivos")
print("%.1f"%(med/pos))
| 15.5 | 33 | 0.535484 |
43b83da2f5dfbe0e34ed220e1482735b8bae7b4d | 52,850 | py | Python | netbox/netbox/views/generic.py | royreznik/netbox | 7ec6b4ebb7478c7f1e52d3653b3f6f44a19a3fee | [
"Apache-2.0"
] | null | null | null | netbox/netbox/views/generic.py | royreznik/netbox | 7ec6b4ebb7478c7f1e52d3653b3f6f44a19a3fee | [
"Apache-2.0"
] | null | null | null | netbox/netbox/views/generic.py | royreznik/netbox | 7ec6b4ebb7478c7f1e52d3653b3f6f44a19a3fee | [
"Apache-2.0"
] | null | null | null | import logging
import re
from copy import deepcopy
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist, ValidationError
from django.db import transaction, IntegrityError
from django.db.models import Many... | 40.779321 | 125 | 0.56789 |
8a0a3521ea041a0795dc48b874f4cfc33084e76a | 1,220 | py | Python | starter/core/logging.py | ManfredBalvet/bomberjam-bot | 1929c7dfa888791e96f79b42329d4a809dfd85cd | [
"MIT"
] | null | null | null | starter/core/logging.py | ManfredBalvet/bomberjam-bot | 1929c7dfa888791e96f79b42329d4a809dfd85cd | [
"MIT"
] | null | null | null | starter/core/logging.py | ManfredBalvet/bomberjam-bot | 1929c7dfa888791e96f79b42329d4a809dfd85cd | [
"MIT"
] | 3 | 2021-03-08T01:12:29.000Z | 2021-12-28T04:42:53.000Z | import logging
from datetime import datetime
from pathlib import Path
LOGGING_CONFIGURED = False
def configure_file_logging(file_id):
"""
Configures the logger to log to a file.
:param file_id: An id to append to the file name. Useful when you run the same code but you want identifiable log files
:r... | 28.372093 | 123 | 0.715574 |
21cdf29ebd7ee3396a66f9398a61d30b700572ba | 360 | py | Python | federatedscope/cv/trainer/trainer.py | alibaba/FederatedScope | fcf6d237624769ea094cfd68803901622f14fc23 | [
"Apache-2.0"
] | 9 | 2022-03-24T07:59:37.000Z | 2022-03-31T06:47:52.000Z | federatedscope/cv/trainer/trainer.py | alibaba/FederatedScope | fcf6d237624769ea094cfd68803901622f14fc23 | [
"Apache-2.0"
] | 1 | 2022-03-28T13:52:17.000Z | 2022-03-28T13:52:17.000Z | federatedscope/cv/trainer/trainer.py | alibaba/FederatedScope | fcf6d237624769ea094cfd68803901622f14fc23 | [
"Apache-2.0"
] | null | null | null | from federatedscope.register import register_trainer
from federatedscope.core.trainers.trainer import GeneralTorchTrainer
class CVTrainer(GeneralTorchTrainer):
pass
def call_cv_trainer(trainer_type):
if trainer_type == 'cvtrainer':
trainer_builder = CVTrainer
return trainer_builder
registe... | 22.5 | 68 | 0.791667 |
63d44ee900a75ce221997e514e769dd1adb64e11 | 31,490 | py | Python | nevergrad/functions/control/core.py | microprediction/nevergrad | 5e4c00d74e84dfb0283ab3d35dd85fde0bb49c29 | [
"MIT"
] | null | null | null | nevergrad/functions/control/core.py | microprediction/nevergrad | 5e4c00d74e84dfb0283ab3d35dd85fde0bb49c29 | [
"MIT"
] | null | null | null | nevergrad/functions/control/core.py | microprediction/nevergrad | 5e4c00d74e84dfb0283ab3d35dd85fde0bb49c29 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
# Trained policies were extracted from https://github.com/modestyachts/ARS
# under their own license. See ARS_LICENSE fi... | 77.753086 | 127 | 0.693935 |
e1b961eff7506a3e7a5227f322f675ae731751cc | 141 | py | Python | autoload/leaderf/python/leaderf/__init__.py | sjwsl/LeaderF | d92d428379f56e65acf01c381a56031d71e50b58 | [
"Apache-2.0"
] | null | null | null | autoload/leaderf/python/leaderf/__init__.py | sjwsl/LeaderF | d92d428379f56e65acf01c381a56031d71e50b58 | [
"Apache-2.0"
] | null | null | null | autoload/leaderf/python/leaderf/__init__.py | sjwsl/LeaderF | d92d428379f56e65acf01c381a56031d71e50b58 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
if sys.version_info < (3, 0):
reload(sys)
sys.setdefaultencoding('utf-8')
| 15.666667 | 35 | 0.617021 |
e760788c5454f29f22e45b7013a679683b95c86e | 2,303 | py | Python | libqtile/scripts/shell.py | 1kyu/qtile | da93518b2ab924e803552decdb364d64de46088d | [
"MIT"
] | 2 | 2021-07-21T20:07:12.000Z | 2021-08-12T18:09:49.000Z | libqtile/scripts/shell.py | 1kyu/qtile | da93518b2ab924e803552decdb364d64de46088d | [
"MIT"
] | 1 | 2022-02-27T12:17:27.000Z | 2022-02-27T12:17:27.000Z | libqtile/scripts/shell.py | 1kyu/qtile | da93518b2ab924e803552decdb364d64de46088d | [
"MIT"
] | 1 | 2020-04-27T22:20:11.000Z | 2020-04-27T22:20:11.000Z | # Copyright (c) 2008, Aldo Cortesi. All rights reserved.
#
# 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,... | 35.430769 | 79 | 0.691272 |
41d7d39286c7260d088d75d29089ebe56ea56f17 | 1,224 | py | Python | test/unittests/use_cases/test_add_tag.py | MBlistein/spaced-repetition | c10281d43e928f8d1799076190f962f8e49a405b | [
"MIT"
] | null | null | null | test/unittests/use_cases/test_add_tag.py | MBlistein/spaced-repetition | c10281d43e928f8d1799076190f962f8e49a405b | [
"MIT"
] | null | null | null | test/unittests/use_cases/test_add_tag.py | MBlistein/spaced-repetition | c10281d43e928f8d1799076190f962f8e49a405b | [
"MIT"
] | null | null | null |
import unittest
from unittest.mock import Mock, patch
from spaced_repetition.domain.tag import TagCreator
from spaced_repetition.use_cases.add_tag import TagAdder
# pylint: disable=protected-access
class TestTagAdder(unittest.TestCase):
def setUp(self) -> None:
self.tag = TagCreator.create('new_tag')
... | 32.210526 | 73 | 0.702614 |
9b523e3806b021eb4257b9cc577c69791caea2aa | 3,115 | py | Python | pytorch_3T27T/utils/backer.py | HechengJin0/pytorch_3T27T | 17b723ff15d10b90acced128091553b1b3073c3a | [
"BSD-3-Clause"
] | null | null | null | pytorch_3T27T/utils/backer.py | HechengJin0/pytorch_3T27T | 17b723ff15d10b90acced128091553b1b3073c3a | [
"BSD-3-Clause"
] | null | null | null | pytorch_3T27T/utils/backer.py | HechengJin0/pytorch_3T27T | 17b723ff15d10b90acced128091553b1b3073c3a | [
"BSD-3-Clause"
] | 1 | 2021-11-03T16:20:15.000Z | 2021-11-03T16:20:15.000Z | #!/usr/bin/env python
# coding=utf-8
# Manages Paths for Saving Models and Logs
from pathlib import Path
from os.path import join as pjoin
import re
import datetime
import pytorch_3T27T as pkg
root = Path(pkg.__path__[0]).parent.absolute()
ETC_DIR = "etc"
LOG_DIR = "logs"
CHECKPOINT_DIR = "ckpts"
RUN_DIR = "runs"
... | 25.743802 | 76 | 0.656501 |
f2f2e1c7d2837d2b054b83e74f2132e6088b6e7a | 2,135 | py | Python | dlu/limitusers/templatetags/limitusers.py | yashrane015/django-limit-users | d7db7bbec3579964efa33b8facfc6d8a3930ead0 | [
"Apache-2.0"
] | 2 | 2015-06-07T21:33:12.000Z | 2022-02-16T02:24:16.000Z | dlu/limitusers/templatetags/limitusers.py | yashrane015/django-limit-users | d7db7bbec3579964efa33b8facfc6d8a3930ead0 | [
"Apache-2.0"
] | null | null | null | dlu/limitusers/templatetags/limitusers.py | yashrane015/django-limit-users | d7db7bbec3579964efa33b8facfc6d8a3930ead0 | [
"Apache-2.0"
] | 1 | 2020-10-01T02:45:33.000Z | 2020-10-01T02:45:33.000Z | from django import template
from django.conf import settings
from dlu.limitusers.models import User, DisabledUser
register = template.Library()
class RegsAvailableNode(template.Node):
def __init__(self, available, var_name = 'registrations_available'):
self.available = available
self.var_name = v... | 30.5 | 100 | 0.688525 |
31e56f79b3e8e9734cb8252fc9669660540a3d95 | 7,877 | py | Python | tests/test_monomial.py | E-G-C/algorithms | 5f1a7863818b016a62ff03a45980f7ec8a970a07 | [
"MIT"
] | 2 | 2022-03-05T17:08:14.000Z | 2022-03-10T07:15:58.000Z | tests/test_monomial.py | E-G-C/algorithms | 5f1a7863818b016a62ff03a45980f7ec8a970a07 | [
"MIT"
] | 18 | 2022-03-01T08:40:32.000Z | 2022-03-05T22:38:43.000Z | tests/test_monomial.py | E-G-C/algorithms | 5f1a7863818b016a62ff03a45980f7ec8a970a07 | [
"MIT"
] | 1 | 2022-03-09T14:43:50.000Z | 2022-03-09T14:43:50.000Z | from algorithms.maths.polynomial import Monomial
from fractions import Fraction
import math
import unittest
class TestSuite(unittest.TestCase):
def setUp(self):
self.m1 = Monomial({})
self.m2 = Monomial({1: 1}, 2)
self.m3 = Monomial({1: 2, 2: -1}, 1.5)
self.m4 = Monomial({1: 1, 2: 2, 3: -2}, 3)
self.m5 ... | 35.642534 | 77 | 0.65266 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.