hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
26c6d3dc79c51eac0baadcc61f39d7c3b322a898 | 2,079 | py | Python | _posts/images/doConvert.py | mianli/mianli.GitHub.io | 6ab193670fb714e2817c64609f8d9e34d3628ca0 | [
"Apache-2.0"
] | null | null | null | _posts/images/doConvert.py | mianli/mianli.GitHub.io | 6ab193670fb714e2817c64609f8d9e34d3628ca0 | [
"Apache-2.0"
] | null | null | null | _posts/images/doConvert.py | mianli/mianli.GitHub.io | 6ab193670fb714e2817c64609f8d9e34d3628ca0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding: UTF-8 -*-
import os
import time
import subprocess
import shutil
import sys
os.chdir(sys.path[0])
print(os.getcwd())
cacheFolder = os.getcwd() + "/temp/"
cacheFile = cacheFolder + "temp"
caches = []
generalSize = "640X640"
if(len(sys.argv) > 1) :
wishSize = 640 * int(sys.argv[1]... | 25.9875 | 112 | 0.593074 | #!/usr/bin/env python
#-*- coding: UTF-8 -*-
import os
import time
import subprocess
import shutil
import sys
os.chdir(sys.path[0])
print(os.getcwd())
cacheFolder = os.getcwd() + "/temp/"
cacheFile = cacheFolder + "temp"
caches = []
generalSize = "640X640"
if(len(sys.argv) > 1) :
wishSize = 640 * int(sys.argv[1]... | 1,530 | 0 | 138 |
ad9b07576281a042d8aad9bfcdd0adced10ac6e5 | 5,537 | py | Python | Back-End/Python/External Libraries/Flask/Flask-Extensions/Flask-Admin/examples_01/flask_admin_/form/fields.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 25 | 2021-04-28T02:51:26.000Z | 2022-03-24T13:58:04.000Z | Back-End/Python/External Libraries/Flask/Flask-Extensions/Flask-Admin/examples_01/flask_admin_/form/fields.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 1 | 2022-03-03T23:33:41.000Z | 2022-03-03T23:35:41.000Z | Back-End/Python/External Libraries/Flask/Flask-Extensions/Flask-Admin/examples_01/flask_admin_/form/fields.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 15 | 2021-05-30T01:35:20.000Z | 2022-03-25T12:38:25.000Z | # Note taken from --> https://gist.github.com/JungeAlexander/6ce0a5213f3af56d7369 & https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder/11158224#11158224
import os, sys, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirn... | 35.267516 | 182 | 0.579917 | # Note taken from --> https://gist.github.com/JungeAlexander/6ce0a5213f3af56d7369 & https://stackoverflow.com/questions/714063/importing-modules-from-parent-folder/11158224#11158224
import os, sys, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirn... | 4,060 | 629 | 173 |
7d855948e033681544c624f9db202049a09935ef | 4,275 | py | Python | tests/test_chi_ssa_23.py | MAYANK25402/city-scrapers | 08f92ec5b68682a8120eee1a13c4a03fe0335b9e | [
"MIT"
] | 255 | 2018-03-06T20:12:03.000Z | 2022-03-05T03:06:45.000Z | tests/test_chi_ssa_23.py | MAYANK25402/city-scrapers | 08f92ec5b68682a8120eee1a13c4a03fe0335b9e | [
"MIT"
] | 514 | 2018-02-02T16:12:50.000Z | 2022-03-21T20:07:35.000Z | tests/test_chi_ssa_23.py | MAYANK25402/city-scrapers | 08f92ec5b68682a8120eee1a13c4a03fe0335b9e | [
"MIT"
] | 342 | 2018-02-03T04:05:37.000Z | 2022-03-18T16:34:58.000Z | from datetime import datetime
from os.path import dirname, join
import pytest
from city_scrapers_core.constants import COMMISSION, PASSED, TENTATIVE
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from scrapy.settings import Settings
from city_scrapers.spiders.chi_ssa_23 import Ch... | 27.941176 | 78 | 0.633684 | from datetime import datetime
from os.path import dirname, join
import pytest
from city_scrapers_core.constants import COMMISSION, PASSED, TENTATIVE
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from scrapy.settings import Settings
from city_scrapers.spiders.chi_ssa_23 import Ch... | 2,912 | 0 | 270 |
aa6af1b7ac40407373d7abd8d55f9fb09c26ff8a | 604 | py | Python | test/tail.py | ubirch/visitor-counter | 97168d7252376358477c52bd956626596119526d | [
"Apache-2.0"
] | null | null | null | test/tail.py | ubirch/visitor-counter | 97168d7252376358477c52bd956626596119526d | [
"Apache-2.0"
] | null | null | null | test/tail.py | ubirch/visitor-counter | 97168d7252376358477c52bd956626596119526d | [
"Apache-2.0"
] | null | null | null |
import subprocess
filename = "../data/crackdump-01.csv"
read()
| 20.827586 | 43 | 0.541391 |
import subprocess
filename = "../data/crackdump-01.csv"
def filterLine(line):
filteredLine = ""
for c in line:
if(c >= ' ' and c <= '~'):
filteredLine = filteredLine + c
return filteredLine
def readlines():
with open(filename, 'r') as reader:
for line in reader.readlines(... | 469 | 0 | 69 |
ced0bd786362d194b6e5055700dffd67c232fe8c | 11,263 | py | Python | src/scep/Client/message.py | bikram990/PyScep | bf5ddae43a461c9aecf7f9fce357ba2ad6df19d7 | [
"MIT"
] | 3 | 2021-06-24T11:19:17.000Z | 2021-12-15T02:23:27.000Z | src/scep/Client/message.py | bikram990/PyScep | bf5ddae43a461c9aecf7f9fce357ba2ad6df19d7 | [
"MIT"
] | 1 | 2022-01-03T14:36:52.000Z | 2022-01-09T02:50:03.000Z | src/scep/Client/message.py | bikram990/PyScep | bf5ddae43a461c9aecf7f9fce357ba2ad6df19d7 | [
"MIT"
] | 1 | 2021-06-08T15:46:31.000Z | 2021-06-08T15:46:31.000Z | import logging
from base64 import b64encode
from asn1crypto.cms import CMSAttribute, ContentInfo, IssuerAndSerialNumber
from cryptography.hazmat.primitives.asymmetric import padding
from .asn1 import SCEPCMSAttributeType
from .cryptoutils import digest_for_data, decrypt, digest_function_for_type
from .enums import M... | 42.026119 | 176 | 0.61671 | import logging
from base64 import b64encode
from asn1crypto.cms import CMSAttribute, ContentInfo, IssuerAndSerialNumber
from cryptography.hazmat.primitives.asymmetric import padding
from .asn1 import SCEPCMSAttributeType
from .cryptoutils import digest_for_data, decrypt, digest_function_for_type
from .enums import M... | 8,375 | 2,336 | 46 |
3f9b82a60b325ff4ad25578193bed486a87eb7a4 | 966 | py | Python | test_sort.py | hairizuanbinnoorazman/python-stuff | 4cbaf88494d64f3c84d6d6bb17be71227950df33 | [
"MIT"
] | null | null | null | test_sort.py | hairizuanbinnoorazman/python-stuff | 4cbaf88494d64f3c84d6d6bb17be71227950df33 | [
"MIT"
] | null | null | null | test_sort.py | hairizuanbinnoorazman/python-stuff | 4cbaf88494d64f3c84d6d6bb17be71227950df33 | [
"MIT"
] | null | null | null | import pytest
from sort import *
@pytest.mark.parametrize(
"input,expected",
[
pytest.param(
[4], [4]
),
pytest.param(
[5, 7, 6, 4], [4, 5, 6, 7]
),
],
)
@pytest.mark.parametrize(
"input,expected",
[
pytest.param(
[4], ... | 17.563636 | 38 | 0.473085 | import pytest
from sort import *
@pytest.mark.parametrize(
"input,expected",
[
pytest.param(
[4], [4]
),
pytest.param(
[5, 7, 6, 4], [4, 5, 6, 7]
),
],
)
def test_bubble_sort(input, expected):
answer = bubble_sort(input)
assert answer == exp... | 233 | 0 | 66 |
0c7b6fdf670903eeac00b2bdebeaac77c27ff620 | 1,874 | py | Python | src/scs_host/sys/host_serial.py | south-coast-science/scs_host_cpc | 08b4a28c022936462b60823cca136ba6746eac57 | [
"MIT"
] | null | null | null | src/scs_host/sys/host_serial.py | south-coast-science/scs_host_cpc | 08b4a28c022936462b60823cca136ba6746eac57 | [
"MIT"
] | null | null | null | src/scs_host/sys/host_serial.py | south-coast-science/scs_host_cpc | 08b4a28c022936462b60823cca136ba6746eac57 | [
"MIT"
] | null | null | null | """
Created on 26 Dec 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/port
"""
import serial
import time
from scs_core.sys.serial import Serial
from scs_host.lock.lock import Lock
# ---------------------------------------... | 27.15942 | 118 | 0.419424 | """
Created on 26 Dec 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black/port
"""
import serial
import time
from scs_core.sys.serial import Serial
from scs_host.lock.lock import Lock
# ---------------------------------------... | 619 | 0 | 106 |
421d48f13d55918c30bd53643b1115a143584398 | 1,324 | py | Python | utils_nlp/eval/evaluate_summarization.py | Anita1017/nlp-recipes | d4358193184cc0c80df04142f6e9773c47d2b0a4 | [
"MIT"
] | 4,407 | 2019-10-29T21:35:19.000Z | 2022-03-31T13:56:37.000Z | utils_nlp/eval/evaluate_summarization.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 134 | 2019-10-30T23:38:59.000Z | 2022-03-01T11:42:53.000Z | utils_nlp/eval/evaluate_summarization.py | shubham9g17/nlp-recipes | a5cd2303187239799ae0b1597a7c16eb99a97108 | [
"MIT"
] | 726 | 2019-10-31T15:21:52.000Z | 2022-03-31T10:18:22.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
from random import random, seed
from bertsum.others.utils import test_rouge
def get_rouge(predictions, targets, temp_dir, random_seed=42):
"""
function to get the rouge metric for the prediction and the reference.
Args:
... | 32.292683 | 82 | 0.688822 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
from random import random, seed
from bertsum.others.utils import test_rouge
def get_rouge(predictions, targets, temp_dir, random_seed=42):
"""
function to get the rouge metric for the prediction and the reference.
Args:
... | 211 | 0 | 27 |
a8422046d80155739467dee424ad8228f58634f6 | 1,045 | py | Python | BS01-flask-bootstrap-table-demo/app/__init__.py | AngelLiang/Flask-Demos | cf0a74885b873cb2583b3870ccdf3508d3af602e | [
"MIT"
] | 3 | 2020-06-17T05:44:48.000Z | 2021-09-11T02:49:38.000Z | BS01-flask-bootstrap-table-demo/app/__init__.py | AngelLiang/Flask-Demos | cf0a74885b873cb2583b3870ccdf3508d3af602e | [
"MIT"
] | 3 | 2021-06-08T20:57:03.000Z | 2022-02-23T14:54:59.000Z | BS01-flask-bootstrap-table-demo/app/__init__.py | AngelLiang/Flask-Demos | cf0a74885b873cb2583b3870ccdf3508d3af602e | [
"MIT"
] | 6 | 2020-06-17T05:44:56.000Z | 2022-03-29T12:53:05.000Z | from flask import Flask
from .extensions import db
from .models import Tree
app = Flask(__name__)
db.init_app(app)
db.app = app
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
# Create in-memory database
# app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://data.sqlite'
from .v... | 23.222222 | 64 | 0.578947 | from flask import Flask
from .extensions import db
from .models import Tree
app = Flask(__name__)
db.init_app(app)
db.app = app
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
# Create in-memory database
# app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite://data.sqlite'
from .v... | 629 | 0 | 45 |
32feddd1d879cfa016bcef15524fa0b4df1a3d41 | 406 | py | Python | eeyore/stats/cov.py | papamarkou/eeyore | 4cd9b5a619cd095035aa93f348d1c937629aa8a3 | [
"MIT"
] | 6 | 2020-04-22T18:56:46.000Z | 2021-09-09T15:57:48.000Z | eeyore/stats/cov.py | papamarkou/eeyore | 4cd9b5a619cd095035aa93f348d1c937629aa8a3 | [
"MIT"
] | 19 | 2019-11-14T21:22:21.000Z | 2020-10-31T16:18:36.000Z | eeyore/stats/cov.py | scidom/eeyore | 4cd9b5a619cd095035aa93f348d1c937629aa8a3 | [
"MIT"
] | null | null | null | import torch
# https://discuss.pytorch.org/t/covariance-and-gradient-support/16217
| 25.375 | 69 | 0.583744 | import torch
# https://discuss.pytorch.org/t/covariance-and-gradient-support/16217
def cov(x, rowvar=False):
if x.dim() > 2:
raise ValueError('x has more than 2 dimensions')
if x.dim() < 2:
x = x.view(1, -1)
if not rowvar and x.size(0) != 1:
x = x.t()
x_ctr = x - torch.mean(x,... | 299 | 0 | 23 |
3078f6f7a835d165214af69930e334c0ce683c2e | 93 | py | Python | followers/apps.py | IanSeng/CMPUT404_PROJECT | 80acd2c57de4b091e0e66ad9f5f2df17801bf09e | [
"W3C-20150513"
] | 25 | 2020-08-30T19:28:01.000Z | 2022-02-18T19:18:14.000Z | followers/apps.py | IanSeng/CMPUT404_PROJECT | 80acd2c57de4b091e0e66ad9f5f2df17801bf09e | [
"W3C-20150513"
] | 81 | 2021-02-14T02:35:52.000Z | 2021-04-10T21:14:27.000Z | followers/apps.py | IanSeng/CMPUT404_PROJECT | 80acd2c57de4b091e0e66ad9f5f2df17801bf09e | [
"W3C-20150513"
] | 27 | 2020-09-06T08:00:49.000Z | 2022-02-01T06:15:08.000Z | from django.apps import AppConfig
| 15.5 | 33 | 0.763441 | from django.apps import AppConfig
class FollowersConfig(AppConfig):
name = 'followers'
| 0 | 35 | 23 |
82faabdefdf53899c72da40e04e2176c3d052adf | 212 | py | Python | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/compileall/compileall_path.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/compileall/compileall_path.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | WEEKS/CD_Sata-Structures/_MISC/misc-examples/python3-book-examples/compileall/compileall_path.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | null | null | null | # Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# end_pymotw_header
import compileall
import sys
sys.path[:] = ["examples", "notthere"]
print("sys.path =", sys.path)
compileall.compile_path()
| 16.307692 | 55 | 0.70283 | # Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# end_pymotw_header
import compileall
import sys
sys.path[:] = ["examples", "notthere"]
print("sys.path =", sys.path)
compileall.compile_path()
| 0 | 0 | 0 |
4b6a26436e528da9c6f39cd1f33f242f904440ad | 1,424 | py | Python | main.py | DwaraknathT/Diffusion-Models | dea059cbd7745aad1c535c0ee06fb15db0e3dd59 | [
"MIT"
] | 2 | 2022-03-18T18:46:31.000Z | 2022-03-23T08:36:06.000Z | main.py | DwaraknathT/Diffusion-Models | dea059cbd7745aad1c535c0ee06fb15db0e3dd59 | [
"MIT"
] | null | null | null | main.py | DwaraknathT/Diffusion-Models | dea059cbd7745aad1c535c0ee06fb15db0e3dd59 | [
"MIT"
] | null | null | null | import yaml
import argparse
from datasets import get_dataset
from diffusion.trainers import get_trainer
# The first arg parser parses out only the --config argument, this argument is used to
# load a yaml file containing key-values that override the defaults for the main parser below
config_parser = parser = argparse.... | 30.297872 | 93 | 0.711376 | import yaml
import argparse
from datasets import get_dataset
from diffusion.trainers import get_trainer
# The first arg parser parses out only the --config argument, this argument is used to
# load a yaml file containing key-values that override the defaults for the main parser below
config_parser = parser = argparse.... | 599 | 0 | 23 |
ab981234bd684eb515c2af0b043fcf592ef55044 | 15,143 | py | Python | pysnmp/CIENA-CES-ACL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CIENA-CES-ACL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CIENA-CES-ACL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CIENA-CES-ACL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CIENA-CES-ACL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:31:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 132.833333 | 2,830 | 0.783861 | #
# PySNMP MIB module CIENA-CES-ACL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CIENA-CES-ACL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:31:34 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | 0 | 0 | 0 |
c903af9ef97633a516d28b47dfa7db93f03ab9a0 | 1,218 | py | Python | src/terial/classifier/opensurfaces/resize.py | keunhong/photoshape | 6e795512e059bc5a6bdac748fda961f66d51c6f6 | [
"PostgreSQL"
] | 81 | 2018-10-10T06:55:41.000Z | 2022-03-01T04:18:23.000Z | src/terial/classifier/opensurfaces/resize.py | keunhong/photoshape | 6e795512e059bc5a6bdac748fda961f66d51c6f6 | [
"PostgreSQL"
] | 17 | 2018-10-22T04:50:59.000Z | 2022-02-12T00:29:11.000Z | src/terial/classifier/opensurfaces/resize.py | keunhong/photoshape | 6e795512e059bc5a6bdac748fda961f66d51c6f6 | [
"PostgreSQL"
] | 16 | 2018-11-20T06:57:32.000Z | 2021-12-24T07:09:37.000Z | import argparse
from functools import partial
from multiprocessing import Pool
from pathlib import Path
from PIL import Image
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument(dest='base_dir', type=Path)
parser.add_argument(dest='out_dir', type=Path)
args = parser.parse_args()
if __name... | 27.066667 | 64 | 0.65353 | import argparse
from functools import partial
from multiprocessing import Pool
from pathlib import Path
from PIL import Image
from tqdm import tqdm
parser = argparse.ArgumentParser()
parser.add_argument(dest='base_dir', type=Path)
parser.add_argument(dest='out_dir', type=Path)
args = parser.parse_args()
def resize_... | 822 | 0 | 46 |
7185ca21d2152e85a78bb4b577624ecfce010843 | 1,153 | py | Python | helpers/getPrice.py | v1s1t0r999/Novell | 4499e5c0634b12dfbd5b5e8ba671b579b7ac5be9 | [
"MIT"
] | 8 | 2021-08-13T03:00:34.000Z | 2021-08-22T05:08:03.000Z | helpers/getPrice.py | v1s1t0r999/Novell | 4499e5c0634b12dfbd5b5e8ba671b579b7ac5be9 | [
"MIT"
] | 9 | 2021-08-15T20:27:59.000Z | 2021-09-06T20:22:36.000Z | helpers/getPrice.py | v1s1t0r999/Novell | 4499e5c0634b12dfbd5b5e8ba671b579b7ac5be9 | [
"MIT"
] | 9 | 2021-08-14T16:43:04.000Z | 2021-09-07T19:14:33.000Z | import requests
from helpers.logHelper import logger
symbolNamePairs = {
"BITCOIN": "BTC",
"ETHEREUM": "ETH",
"DOGECOIN": "DOGE",
}
setting = settings()
| 25.622222 | 83 | 0.616652 | import requests
from helpers.logHelper import logger
symbolNamePairs = {
"BITCOIN": "BTC",
"ETHEREUM": "ETH",
"DOGECOIN": "DOGE",
}
class settings:
def __init__(self):
self.endpoint = "https://api.binance.com"
setting = settings()
def request(method, path, params=None):
... | 845 | -6 | 127 |
aff4de3fc4484ab22adaf2ed2a6838f63f81a8ff | 5,721 | py | Python | vmpy/streams.py | sladkovm/Velometria.py | 22c97723f3b5ba5342a6178535f48cc426daac2f | [
"MIT"
] | 2 | 2016-09-04T09:26:03.000Z | 2017-07-27T05:52:06.000Z | vmpy/streams.py | sladkovm/Velometria.py | 22c97723f3b5ba5342a6178535f48cc426daac2f | [
"MIT"
] | 4 | 2016-08-03T17:54:12.000Z | 2016-08-09T20:11:45.000Z | vmpy/streams.py | sladkovm/Velometria_py | 22c97723f3b5ba5342a6178535f48cc426daac2f | [
"MIT"
] | null | null | null | """Operation on Streams that leave the shape of the stream unchanged"""
import numpy as np
import pandas as pd
from vmpy.utils import cast_array_to_original_type
# FTP based 7-zones with left bind edge set to -0.001
POWER_ZONES_THRESHOLD = [-0.001, 0.55, 0.75, 0.9, 1.05, 1.2, 1.5, 10.0]
POWER_ZONES_THRESHOLD_DESC = ... | 28.044118 | 103 | 0.650586 | """Operation on Streams that leave the shape of the stream unchanged"""
import numpy as np
import pandas as pd
from vmpy.utils import cast_array_to_original_type
# FTP based 7-zones with left bind edge set to -0.001
POWER_ZONES_THRESHOLD = [-0.001, 0.55, 0.75, 0.9, 1.05, 1.2, 1.5, 10.0]
POWER_ZONES_THRESHOLD_DESC = ... | 0 | 0 | 0 |
9ba8c51d46d3e3446c3291a3adefab5e9344eac3 | 1,577 | py | Python | arividam/djangocms_news/cms_plugins.py | c4sc/arividam | b728322d59ec48d6811ed7a709157a594e5653d4 | [
"MIT"
] | 3 | 2016-05-26T06:03:11.000Z | 2016-07-09T07:12:22.000Z | arividam/djangocms_news/cms_plugins.py | c4sc/arividam | b728322d59ec48d6811ed7a709157a594e5653d4 | [
"MIT"
] | 33 | 2016-05-26T05:33:00.000Z | 2017-12-06T12:08:17.000Z | arividam/djangocms_news/cms_plugins.py | c4sc/arividam | b728322d59ec48d6811ed7a709157a594e5653d4 | [
"MIT"
] | null | null | null | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from django.utils.translation import ugettext_lazy as _
from cms.models import Page
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from arividam.ut... | 32.183673 | 93 | 0.701966 | from cms.plugin_base import CMSPluginBase
from cms.plugin_pool import plugin_pool
from cms.models.pluginmodel import CMSPlugin
from django.utils.translation import ugettext_lazy as _
from cms.models import Page
from django.conf import settings
from django.contrib.sites.shortcuts import get_current_site
from arividam.ut... | 688 | 319 | 46 |
b4817a06e5f0a3ae68d8d96eca0ab9f4ed6b270c | 1,212 | py | Python | util/update.py | suchak1/hyperdrive | 8bc78af179de8d2b26968683d3248840f7470d4c | [
"MIT"
] | 20 | 2020-11-03T10:20:32.000Z | 2022-03-01T13:28:39.000Z | util/update.py | suchak1/hyperdrive | 8bc78af179de8d2b26968683d3248840f7470d4c | [
"MIT"
] | 70 | 2020-11-05T08:06:57.000Z | 2022-03-31T11:20:59.000Z | util/update.py | suchak1/hyperdrive | 8bc78af179de8d2b26968683d3248840f7470d4c | [
"MIT"
] | 5 | 2021-04-07T05:26:40.000Z | 2022-02-25T15:26:02.000Z | import os
import re
import requests
import subprocess
filename = 'requirements.txt'
new_packages = []
with open(filename, 'r') as file:
pattern = '(.*) == (.*)'
packages = re.findall(pattern, file.read())
for package, version in packages:
response = requests.get(f'https://pypi.org/pypi... | 33.666667 | 75 | 0.546205 | import os
import re
import requests
import subprocess
filename = 'requirements.txt'
new_packages = []
with open(filename, 'r') as file:
pattern = '(.*) == (.*)'
packages = re.findall(pattern, file.read())
for package, version in packages:
response = requests.get(f'https://pypi.org/pypi... | 0 | 0 | 0 |
b7ba00d67a5f1b17de35a1d6768295104c0874fb | 222 | py | Python | subarrrayDivision.py | sanjaykaswan/HackerRank | 23cebf02bfacea50d5982ce889b76025312c5c61 | [
"MIT"
] | null | null | null | subarrrayDivision.py | sanjaykaswan/HackerRank | 23cebf02bfacea50d5982ce889b76025312c5c61 | [
"MIT"
] | null | null | null | subarrrayDivision.py | sanjaykaswan/HackerRank | 23cebf02bfacea50d5982ce889b76025312c5c61 | [
"MIT"
] | 1 | 2020-10-05T11:55:48.000Z | 2020-10-05T11:55:48.000Z | n = int(input())
num = list(map(int , input().split()))
d,m = map(int , input().split())
c= 0
for i in range(0,n-m+1):
d_ = 0
for j in range(0,m):
d_ += num[i+j]
if d_ == d:
c += 1
print(c) | 14.8 | 38 | 0.463964 | n = int(input())
num = list(map(int , input().split()))
d,m = map(int , input().split())
c= 0
for i in range(0,n-m+1):
d_ = 0
for j in range(0,m):
d_ += num[i+j]
if d_ == d:
c += 1
print(c) | 0 | 0 | 0 |
58a7e0d66eb0c7383e5fc0b4dcbd11f6f7eace49 | 4,222 | py | Python | tests/wrappers/test_multioutput.py | bpkwee/metrics | 3aba057ad9ff87183aaaf5988b8ccfdab81b2095 | [
"Apache-2.0"
] | null | null | null | tests/wrappers/test_multioutput.py | bpkwee/metrics | 3aba057ad9ff87183aaaf5988b8ccfdab81b2095 | [
"Apache-2.0"
] | null | null | null | tests/wrappers/test_multioutput.py | bpkwee/metrics | 3aba057ad9ff87183aaaf5988b8ccfdab81b2095 | [
"Apache-2.0"
] | null | null | null | from collections import namedtuple
from functools import partial
import pytest
import torch
from sklearn.metrics import accuracy_score
from sklearn.metrics import r2_score as sk_r2score
from tests.helpers import seed_all
from tests.helpers.testers import BATCH_SIZE, NUM_BATCHES, NUM_CLASSES, MetricTester
from torchme... | 34.048387 | 114 | 0.681431 | from collections import namedtuple
from functools import partial
import pytest
import torch
from sklearn.metrics import accuracy_score
from sklearn.metrics import r2_score as sk_r2score
from tests.helpers import seed_all
from tests.helpers.testers import BATCH_SIZE, NUM_BATCHES, NUM_CLASSES, MetricTester
from torchme... | 261 | 0 | 27 |
691178639c6d8f94470bbd96184c210f322e6490 | 9,225 | py | Python | oldp/apps/references/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | 3 | 2020-06-27T08:19:35.000Z | 2020-12-27T17:46:02.000Z | oldp/apps/references/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | oldp/apps/references/models.py | ImgBotApp/oldp | 575dc6f711dde3470d910e21c9440ee9b79a69ed | [
"MIT"
] | null | null | null | import hashlib
import json
import logging
import re
import uuid
from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from oldp.apps.cases.models import Case
from oldp.apps.laws.models import Law
logger = logging.getLogger(__name__)
class ReferenceMarker(mo... | 30.04886 | 157 | 0.617344 | import hashlib
import json
import logging
import re
import uuid
from django.db import models
from django.db.models.signals import pre_save
from django.dispatch import receiver
from oldp.apps.cases.models import Case
from oldp.apps.laws.models import Law
logger = logging.getLogger(__name__)
class ReferenceMarker(mo... | 4,473 | 28 | 654 |
1b56f073718e33f60f9ca4b06328c7693d89ada9 | 136 | py | Python | apt-flash.py | apt-flash/apt-flash | 9ea6ebf016988f51407005b7e3d234b4807612d4 | [
"MIT"
] | null | null | null | apt-flash.py | apt-flash/apt-flash | 9ea6ebf016988f51407005b7e3d234b4807612d4 | [
"MIT"
] | null | null | null | apt-flash.py | apt-flash/apt-flash | 9ea6ebf016988f51407005b7e3d234b4807612d4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
if os.geteuid() != 0:
exit('This script requires root privileges.\nPlease try again with sudo.')
| 19.428571 | 78 | 0.698529 | #!/usr/bin/env python3
import os
if os.geteuid() != 0:
exit('This script requires root privileges.\nPlease try again with sudo.')
| 0 | 0 | 0 |
c71155e531dae239fa04c8b65a3d46aaeb1df3cc | 2,962 | py | Python | avg_embedding_means.py | lidalei/Real-Time-Voice-Cloning | 25d39c31b96d6c5b1783b36d9c09bb2a450ddaee | [
"MIT"
] | 1 | 2019-11-07T14:07:23.000Z | 2019-11-07T14:07:23.000Z | avg_embedding_means.py | lidalei/Real-Time-Voice-Cloning | 25d39c31b96d6c5b1783b36d9c09bb2a450ddaee | [
"MIT"
] | null | null | null | avg_embedding_means.py | lidalei/Real-Time-Voice-Cloning | 25d39c31b96d6c5b1783b36d9c09bb2a450ddaee | [
"MIT"
] | null | null | null | import argparse
from pathlib import Path
import typing
import numpy as np
import scipy.spatial.distance
from encoder.inference import Model as EncoderModel
from synthesizer.inference import Synthesizer
_NUM_ENROLLMENTS = 3
_NUM_VERIFICATIONS = 5
_WAV_FODLER = Path('/Users/dalei/Downloads/VCTK-Corpus/wav48')
_TXT_FO... | 38.973684 | 118 | 0.667792 | import argparse
from pathlib import Path
import typing
import numpy as np
import scipy.spatial.distance
from encoder.inference import Model as EncoderModel
from synthesizer.inference import Synthesizer
_NUM_ENROLLMENTS = 3
_NUM_VERIFICATIONS = 5
_WAV_FODLER = Path('/Users/dalei/Downloads/VCTK-Corpus/wav48')
_TXT_FO... | 2,440 | 0 | 23 |
6a36a28b6799120be05f798a21f49d9d39daf42b | 1,813 | py | Python | dist-packages/cupshelpers/__init__.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | dist-packages/cupshelpers/__init__.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | dist-packages/cupshelpers/__init__.py | Jianwei-Wang/python2.7_lib | 911b8e81512e5ac5f13e669ab46f7693ed897378 | [
"PSF-2.0"
] | null | null | null | ## system-config-printer
## Copyright (C) 2008, 2011 Red Hat, Inc.
## Authors:
## Tim Waugh <twaugh@redhat.com>
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Lice... | 29.721311 | 82 | 0.669608 | ## system-config-printer
## Copyright (C) 2008, 2011 Red Hat, Inc.
## Authors:
## Tim Waugh <twaugh@redhat.com>
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the Lice... | 30 | 0 | 45 |
8ac61c5c2a642c55b26c0a95260c48d9f0ec3980 | 9,600 | py | Python | kinto/tests/core/test_cache.py | swhgoon/kinto | 10001d44bb08e4fbc74da31a41a4eaa461e0fd7f | [
"Apache-2.0"
] | null | null | null | kinto/tests/core/test_cache.py | swhgoon/kinto | 10001d44bb08e4fbc74da31a41a4eaa461e0fd7f | [
"Apache-2.0"
] | null | null | null | kinto/tests/core/test_cache.py | swhgoon/kinto | 10001d44bb08e4fbc74da31a41a4eaa461e0fd7f | [
"Apache-2.0"
] | 1 | 2020-07-15T04:27:08.000Z | 2020-07-15T04:27:08.000Z | import mock
import time
import redis
from pyramid import testing
from kinto.core.utils import sqlalchemy
from kinto.core.storage import exceptions
from kinto.core.cache import (CacheBase, postgresql as postgresql_backend,
redis as redis_backend, memory as memory_backend,
... | 32.542373 | 79 | 0.638646 | import mock
import time
import redis
from pyramid import testing
from kinto.core.utils import sqlalchemy
from kinto.core.storage import exceptions
from kinto.core.cache import (CacheBase, postgresql as postgresql_backend,
redis as redis_backend, memory as memory_backend,
... | 7,397 | 1,608 | 167 |
6afe9bb9c57f5f20486a9a35bab9902e2d952b02 | 3,910 | py | Python | tests/analysis/test_is_linear.py | alinavalinav/finn | e443a5859066a410a63c08dcfec4a90527ca24be | [
"BSD-3-Clause"
] | 1 | 2021-01-29T14:39:48.000Z | 2021-01-29T14:39:48.000Z | tests/analysis/test_is_linear.py | alinavalinav/finn | e443a5859066a410a63c08dcfec4a90527ca24be | [
"BSD-3-Clause"
] | null | null | null | tests/analysis/test_is_linear.py | alinavalinav/finn | e443a5859066a410a63c08dcfec4a90527ca24be | [
"BSD-3-Clause"
] | 1 | 2022-03-07T02:57:55.000Z | 2022-03-07T02:57:55.000Z | # Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | 45.465116 | 80 | 0.693606 | # Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | 2,148 | 0 | 46 |
edf87f46fcc29e95f2f84b8cfba5416c27e3878e | 1,746 | py | Python | uwstyle/webbrowser/driver.py | TakamiChie/UWStyleMethods | 7635852ff902988843dbf17ddc29ea5f8350e6bf | [
"MIT"
] | 2 | 2019-01-24T00:13:46.000Z | 2020-09-30T22:59:32.000Z | uwstyle/webbrowser/driver.py | TakamiChie/UWStyleMethods | 7635852ff902988843dbf17ddc29ea5f8350e6bf | [
"MIT"
] | 5 | 2019-01-27T17:47:55.000Z | 2019-02-05T01:58:17.000Z | uwstyle/webbrowser/driver.py | TakamiChie/UWStyleMethods | 7635852ff902988843dbf17ddc29ea5f8350e6bf | [
"MIT"
] | null | null | null | from selenium import webdriver as seledriver
class WebDriver(object):
"""
The base class for controlling the browser in the webbrowser class.
Selenium Webdriver wrapper class.
"""
def __init__(self, options = None):
"""
Initialize Class
Parameters
----
options: str|list
arguments o... | 22.384615 | 107 | 0.650057 | from selenium import webdriver as seledriver
class WebDriver(object):
"""
The base class for controlling the browser in the webbrowser class.
Selenium Webdriver wrapper class.
"""
def __init__(self, options = None):
"""
Initialize Class
Parameters
----
options: str|list
arguments o... | 44 | 0 | 24 |
eb369cd06803c8f52ecb564772f3688e3b56e158 | 3,074 | py | Python | examples/data_feed/feeder.py | B3K7/mygeotab-python | ef0064543b6d859044e815c629a0f7998e479247 | [
"Apache-2.0"
] | 40 | 2015-08-20T16:13:52.000Z | 2022-01-07T13:30:27.000Z | examples/data_feed/feeder.py | B3K7/mygeotab-python | ef0064543b6d859044e815c629a0f7998e479247 | [
"Apache-2.0"
] | 227 | 2015-08-20T17:41:07.000Z | 2022-01-15T01:57:26.000Z | examples/data_feed/feeder.py | B3K7/mygeotab-python | ef0064543b6d859044e815c629a0f7998e479247 | [
"Apache-2.0"
] | 17 | 2016-05-12T16:06:32.000Z | 2022-01-10T19:03:40.000Z | # -*- coding: utf-8 -*-
from collections import defaultdict
import click
from mygeotab import API, dates
from mygeotab.ext import feed
@click.command(help="A console data feeder example")
@click.argument("database", nargs=1, required=True)
@click.option("--user", "-u", prompt=True, help="A MyGeotab username")
@cl... | 32.702128 | 99 | 0.599545 | # -*- coding: utf-8 -*-
from collections import defaultdict
import click
from mygeotab import API, dates
from mygeotab.ext import feed
class ExceptionDataFeedListener(feed.DataFeedListener):
def __init__(self, api):
"""
A simple Data Feed listener for Exception Event data
:param api: T... | 255 | 2,075 | 45 |
436776e2a237f4bbde5b9774d3036d52e8647ff0 | 13,211 | py | Python | offline/orchestrator.py | JoshBClemons/gesture_recognition | d1ddc6d086bf93b36a430fbcae0af14b9c584e92 | [
"MIT"
] | null | null | null | offline/orchestrator.py | JoshBClemons/gesture_recognition | d1ddc6d086bf93b36a430fbcae0af14b9c584e92 | [
"MIT"
] | null | null | null | offline/orchestrator.py | JoshBClemons/gesture_recognition | d1ddc6d086bf93b36a430fbcae0af14b9c584e92 | [
"MIT"
] | null | null | null | from config import Config
import psycopg2
from psycopg2.extras import Json, DictCursor
import pdb
import pandas as pd
import os
import time
import cv2
from gesture_recognition import featurizer
def orchestrator():
"""Pull frames with confidence, accurate predictions from database and use them to generate new model... | 51.807843 | 233 | 0.660737 | from config import Config
import psycopg2
from psycopg2.extras import Json, DictCursor
import pdb
import pandas as pd
import os
import time
import cv2
from gesture_recognition import featurizer
def orchestrator():
"""Pull frames with confidence, accurate predictions from database and use them to generate new model... | 0 | 0 | 0 |
007bbb746348f00e9c4355aa7932c325a9e58bb7 | 4,535 | py | Python | tasks/scan.py | KodaneFlash/hawk | de614df1fc50cc817be06e9902965dd2d65f9197 | [
"MIT"
] | null | null | null | tasks/scan.py | KodaneFlash/hawk | de614df1fc50cc817be06e9902965dd2d65f9197 | [
"MIT"
] | null | null | null | tasks/scan.py | KodaneFlash/hawk | de614df1fc50cc817be06e9902965dd2d65f9197 | [
"MIT"
] | null | null | null | import nmap
import sys
import os
import multiprocessing
import socket
from colorama import Fore, Back, Style
scanner = nmap.PortScanner()
| 43.605769 | 170 | 0.53914 | import nmap
import sys
import os
import multiprocessing
import socket
from colorama import Fore, Back, Style
scanner = nmap.PortScanner()
def scanStatus(host, inputed):
try:
scanner.scan(host, '1', '-v -sT')
except KeyboardInterrupt:
sys.exit('\n^C\n')
except Exception as e:
e =... | 4,267 | 0 | 116 |
3eb34fa6cb8beeae879580c7a63d82608bf47010 | 1,490 | py | Python | world/exploration/migrations/0043_auto_20181122_1409.py | tellg/arxcode | f04340f9466c31f59bc13b8e1afd4f5734da4848 | [
"MIT"
] | 5 | 2019-03-16T08:26:53.000Z | 2019-11-27T15:42:16.000Z | world/exploration/migrations/0043_auto_20181122_1409.py | tellg/arxcode | f04340f9466c31f59bc13b8e1afd4f5734da4848 | [
"MIT"
] | 7 | 2018-09-29T05:08:15.000Z | 2021-06-10T21:35:32.000Z | world/exploration/migrations/0043_auto_20181122_1409.py | tellg/arxcode | f04340f9466c31f59bc13b8e1afd4f5734da4848 | [
"MIT"
] | 7 | 2018-09-19T21:11:29.000Z | 2019-11-19T12:46:14.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-22 14:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| 40.27027 | 149 | 0.636242 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-22 14:09
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dominion', '0035_auto_20180831_0922'),
('explorati... | 0 | 1,277 | 23 |
dca5bd39d6d0f512d47fb32d7d9113e50f17f9eb | 3,977 | py | Python | tests/large/test_mode_replay.py | arjunkhunti-crest/eventgen | 3c551aa9fe53717797ff0bf9cf7d2f094b801bf2 | [
"Apache-2.0"
] | null | null | null | tests/large/test_mode_replay.py | arjunkhunti-crest/eventgen | 3c551aa9fe53717797ff0bf9cf7d2f094b801bf2 | [
"Apache-2.0"
] | null | null | null | tests/large/test_mode_replay.py | arjunkhunti-crest/eventgen | 3c551aa9fe53717797ff0bf9cf7d2f094b801bf2 | [
"Apache-2.0"
] | null | null | null | import re
import time
from datetime import datetime, timedelta
def test_mode_replay(eventgen_test_helper):
"""Test normal replay mode settings"""
events = eventgen_test_helper("eventgen_replay.conf").get_events()
# assert the event length is the same as sample file size
assert len(events) == 12
pa... | 42.308511 | 110 | 0.70606 | import re
import time
from datetime import datetime, timedelta
def test_mode_replay(eventgen_test_helper):
"""Test normal replay mode settings"""
events = eventgen_test_helper("eventgen_replay.conf").get_events()
# assert the event length is the same as sample file size
assert len(events) == 12
pa... | 0 | 0 | 0 |
5eeddddcee7e0edc3a2f862f662a93f9dbfdb494 | 516 | py | Python | build_pipeline/250_invalidate_cdn.py | undefinedvalue/statdev | 4e71961bd9f8e6ee49de4ddc539033ace47967a7 | [
"MIT"
] | null | null | null | build_pipeline/250_invalidate_cdn.py | undefinedvalue/statdev | 4e71961bd9f8e6ee49de4ddc539033ace47967a7 | [
"MIT"
] | null | null | null | build_pipeline/250_invalidate_cdn.py | undefinedvalue/statdev | 4e71961bd9f8e6ee49de4ddc539033ace47967a7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Invalidates CDNs so the caches are refreshed
import boto3
import os
import time
| 27.157895 | 78 | 0.536822 | #!/usr/bin/env python
# Invalidates CDNs so the caches are refreshed
import boto3
import os
import time
def build(src_dir, dst_dir, opts):
distribution_id = os.environ['CF_DIST_ID']
cf = boto3.client('cloudfront')
cf.create_invalidation(DistributionId=distribution_id,
Invalidat... | 386 | 0 | 23 |
478fa499138e17cac8e71a56b7291ffca49ce6ae | 4,089 | py | Python | powersimdata/tests/test_mocks.py | c-voegele/PowerSimData | 5b1500e573f00a34571316796ff442bfa753871a | [
"MIT"
] | 27 | 2021-02-20T20:55:31.000Z | 2022-02-07T17:27:14.000Z | powersimdata/tests/test_mocks.py | c-voegele/PowerSimData | 5b1500e573f00a34571316796ff442bfa753871a | [
"MIT"
] | 147 | 2021-01-21T03:55:09.000Z | 2022-03-28T19:28:03.000Z | powersimdata/tests/test_mocks.py | c-voegele/PowerSimData | 5b1500e573f00a34571316796ff442bfa753871a | [
"MIT"
] | 27 | 2021-02-03T18:24:47.000Z | 2022-01-26T08:56:17.000Z | import pandas as pd
import pytest
from powersimdata.tests.mock_grid import MockGrid
from powersimdata.tests.mock_scenario import MockScenario
from powersimdata.tests.mock_scenario_info import MockScenarioInfo
period_num = 4
# plant_id is the index
mock_plant = {
"plant_id": [101, 102, 103, 104, 105, 106],
"b... | 33.243902 | 88 | 0.657863 | import pandas as pd
import pytest
from powersimdata.tests.mock_grid import MockGrid
from powersimdata.tests.mock_scenario import MockScenario
from powersimdata.tests.mock_scenario_info import MockScenarioInfo
period_num = 4
# plant_id is the index
mock_plant = {
"plant_id": [101, 102, 103, 104, 105, 106],
"b... | 3,004 | 6 | 424 |
98c1eb817cab95bc96bf3fec5e9194d3bc60bf96 | 2,575 | py | Python | Chap09/inheritance.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | Chap09/inheritance.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | Chap09/inheritance.py | RiddhiDamani/Python | 06cba66aeafd9dc0fa849ec2112c0786a3e8f001 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
# Class inheritance is the fundamental part of OOP
# allows you to extend your class by deriving properties/variables and methods from parent classes.
# no longer providing default values.
# it is bcz this is going to be the base class and it's ... | 30.654762 | 108 | 0.617087 | #!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
# Class inheritance is the fundamental part of OOP
# allows you to extend your class by deriving properties/variables and methods from parent classes.
class Animal:
# no longer providing default values.
# it is bcz this is going to be the base ... | 1,434 | -10 | 298 |
5eee50537386ae39b316d1fd68278deb85410400 | 550 | py | Python | mixer/helper/reader_helper.py | Jwuthri/GtfsTools | d0db0c89588f936f02d4e6cccb70034ec1e4b9b1 | [
"MIT"
] | 2 | 2017-10-30T07:27:02.000Z | 2021-11-09T18:50:13.000Z | mixer/helper/reader_helper.py | Jwuthri/GtfsTools | d0db0c89588f936f02d4e6cccb70034ec1e4b9b1 | [
"MIT"
] | 1 | 2017-02-24T20:50:10.000Z | 2017-02-24T22:40:33.000Z | mixer/helper/reader_helper.py | Jwuthri/GtfsTools | d0db0c89588f936f02d4e6cccb70034ec1e4b9b1 | [
"MIT"
] | null | null | null | """Here are the db connection."""
import importlib
import logging
from mixer.settings import db_type
from mixer.glogger import logger
class Reader(object):
"""Helper to gen the reader class."""
def __init__(self, db_name):
"""Constructor."""
DB = getattr(
importlib.... | 25 | 61 | 0.583636 | """Here are the db connection."""
import importlib
import logging
from mixer.settings import db_type
from mixer.glogger import logger
class Reader(object):
"""Helper to gen the reader class."""
def __init__(self, db_name):
"""Constructor."""
DB = getattr(
importlib.... | 0 | 0 | 0 |
3fe2fe671496f997af36a47fd5c43e2d207766db | 1,964 | py | Python | Logistic-Regression-Insurance-claim-prediction/code.py | ChandrakantKate/ga-learner-dsmp-repo | e6c53282bbd42c8055c18a2f1203ea76eafa102a | [
"MIT"
] | null | null | null | Logistic-Regression-Insurance-claim-prediction/code.py | ChandrakantKate/ga-learner-dsmp-repo | e6c53282bbd42c8055c18a2f1203ea76eafa102a | [
"MIT"
] | null | null | null | Logistic-Regression-Insurance-claim-prediction/code.py | ChandrakantKate/ga-learner-dsmp-repo | e6c53282bbd42c8055c18a2f1203ea76eafa102a | [
"MIT"
] | null | null | null | # --------------
# import the libraries
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
import warnings
warnings.filterwarnings('ignore')
# Code starts here
df = pd.read_csv(path)
print(df.head())
X = df.drop('insuranceclaim',axis=1)
y = df['insurancecl... | 21.347826 | 82 | 0.709267 | # --------------
# import the libraries
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.model_selection import train_test_split
import warnings
warnings.filterwarnings('ignore')
# Code starts here
df = pd.read_csv(path)
print(df.head())
X = df.drop('insuranceclaim',axis=1)
y = df['insurancecl... | 0 | 0 | 0 |
1755f9e2f59a10f2dae8d950fcd4b40d9bc268b5 | 3,763 | py | Python | Recover Binary Search Tree.py | JazzikPeng/Algorithm-in-Python | 915135b1cdd02a6bb8d7068a54b2f497b2ec31d4 | [
"MIT"
] | 3 | 2018-02-05T06:15:57.000Z | 2019-04-07T23:33:07.000Z | Recover Binary Search Tree.py | JazzikPeng/Algorithm-in-Python | 915135b1cdd02a6bb8d7068a54b2f497b2ec31d4 | [
"MIT"
] | null | null | null | Recover Binary Search Tree.py | JazzikPeng/Algorithm-in-Python | 915135b1cdd02a6bb8d7068a54b2f497b2ec31d4 | [
"MIT"
] | null | null | null | # Definition for a binary tree node.
# Do in order traversal. The in order traversal is monotonically increase
# O(1) Space, can not use iterative method or recursive solution, both use space
# class Solution(object):
# first = TreeNode(None)
# second = TreeNode(None)
# prev = TreeNode(None)
# def re... | 32.439655 | 80 | 0.459208 | # Definition for a binary tree node.
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
# Do in order traversal. The in order traversal is monotonically increase
# O(1) Space, can not use iterative method or recursive solution, both use space
# c... | 73 | 2,737 | 93 |
8f8abd51d28441a8163759ad81bbc9edd88b368d | 1,370 | py | Python | utils/CreateTemplate.py | ausaafnabi/ML-OverRPC-API | b2ddbfac3f4c4f5ae97e030be7e4a4dfcd4d6635 | [
"MIT"
] | 1 | 2020-06-23T17:02:09.000Z | 2020-06-23T17:02:09.000Z | utils/CreateTemplate.py | ausaafnabi/ML-OverRPC-API | b2ddbfac3f4c4f5ae97e030be7e4a4dfcd4d6635 | [
"MIT"
] | 7 | 2020-03-31T06:46:14.000Z | 2020-04-12T11:25:39.000Z | utils/CreateTemplate.py | ausaafnabi/ML-OverRPC-API | b2ddbfac3f4c4f5ae97e030be7e4a4dfcd4d6635 | [
"MIT"
] | 1 | 2020-03-31T07:24:01.000Z | 2020-03-31T07:24:01.000Z | import os
from utils.Template_directory import *
from utils.utilities import *
import sys
sys.path.append('../')
from core.Renderer.FileRenderer import Renderer
layer1 = [Experiment,Production]
layer1_names = ['Experiment','Production']
Files = File
| 33.414634 | 75 | 0.658394 | import os
from utils.Template_directory import *
from utils.utilities import *
import sys
sys.path.append('../')
from core.Renderer.FileRenderer import Renderer
layer1 = [Experiment,Production]
layer1_names = ['Experiment','Production']
Files = File
def GetCurrentDirectory():
currentDirectory = os.getcwd()
ret... | 1,011 | 0 | 96 |
3235e687d4bb817652eb1ff22833902799497e16 | 332 | py | Python | 1-10/problem7.py | anpe9592/projectEuler | 628ae8877bca496d55b95bd55525478bede6e753 | [
"MIT"
] | null | null | null | 1-10/problem7.py | anpe9592/projectEuler | 628ae8877bca496d55b95bd55525478bede6e753 | [
"MIT"
] | null | null | null | 1-10/problem7.py | anpe9592/projectEuler | 628ae8877bca496d55b95bd55525478bede6e753 | [
"MIT"
] | null | null | null | # problem7.py
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
# What is the 10 001st prime number?
i = 1
z = 1
while i < 10002:
z += 1
if z > 1:
for j in range(2, z):
if z % j == 0:
break
else:
i += ... | 18.444444 | 102 | 0.490964 | # problem7.py
# By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
# What is the 10 001st prime number?
i = 1
z = 1
while i < 10002:
z += 1
if z > 1:
for j in range(2, z):
if z % j == 0:
break
else:
i += ... | 0 | 0 | 0 |
c3dabb085af97c158d1e88e44c42684ccc05417d | 2,859 | py | Python | setup.py | ShivanshShalabh/zoomobot- | e2cf7a7bba5515248e5754702bb3daba626b615f | [
"MIT"
] | null | null | null | setup.py | ShivanshShalabh/zoomobot- | e2cf7a7bba5515248e5754702bb3daba626b615f | [
"MIT"
] | null | null | null | setup.py | ShivanshShalabh/zoomobot- | e2cf7a7bba5515248e5754702bb3daba626b615f | [
"MIT"
] | null | null | null | import re
import os
if __name__ == '__main__':
# Check if file with name Cache.txt exists
if os.path.isfile('Cache.txt'):
# If file exists, delete it
os.remove('Cache.txt')
# Create file with name Cache.txt
name = input('Enter your name (Enter -1 to skip): ')
while not name:
... | 37.618421 | 138 | 0.582721 | import re
import os
def isValidHexaCode(str):
# Regex to check valid
# hexadecimal color code.
regex = "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"
# Compile the ReGex
p = re.compile(regex)
# If the string is empty
# return false
if(str == None):
return False
# Return if the str... | 382 | 0 | 23 |
366737a828415b6bfb9f1a6b95aefbecdab7cc3d | 2,259 | py | Python | Examples/scripts/vector_scalar.py | jenkayco/hacknostics | 4f980b17a2648cb6547cd2d8b442ae23253ab5e6 | [
"MIT"
] | 2 | 2019-06-04T20:10:46.000Z | 2021-06-07T21:10:39.000Z | Examples/scripts/vector_scalar.py | jenkayco/hacknostics | 4f980b17a2648cb6547cd2d8b442ae23253ab5e6 | [
"MIT"
] | 2 | 2019-06-05T03:08:06.000Z | 2019-06-05T15:38:01.000Z | Examples/scripts/vector_scalar.py | jenkayco/hacknostics | 4f980b17a2648cb6547cd2d8b442ae23253ab5e6 | [
"MIT"
] | 2 | 2019-06-05T03:11:35.000Z | 2019-06-05T05:33:45.000Z | #================================================#
# vector_scalar.py
# based on: gsn_vec_scal_1.ncl,
# gsn_vec_scal_2.ncl,
# gsn_vec_scal_3.ncl
#================================================#
from pathlib import Path
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
impo... | 37.65 | 88 | 0.536963 | #================================================#
# vector_scalar.py
# based on: gsn_vec_scal_1.ncl,
# gsn_vec_scal_2.ncl,
# gsn_vec_scal_3.ncl
#================================================#
from pathlib import Path
import numpy as np
import xarray as xr
import matplotlib.pyplot as plt
impo... | 0 | 0 | 0 |
fa4414908dbefc98c70ceea38be4dd04bef4dd48 | 2,691 | py | Python | command_cop.py | jperras/command_cop | 4b2c4f3020b6bdac1ed2973c5c8b2c1ba1b69b21 | [
"MIT"
] | 1 | 2019-09-15T14:04:09.000Z | 2019-09-15T14:04:09.000Z | command_cop.py | jperras/command_cop | 4b2c4f3020b6bdac1ed2973c5c8b2c1ba1b69b21 | [
"MIT"
] | null | null | null | command_cop.py | jperras/command_cop | 4b2c4f3020b6bdac1ed2973c5c8b2c1ba1b69b21 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
###
# Copyright 2019 Joël Perras <joel@nerderati.com>
# 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
... | 38.442857 | 105 | 0.719064 | # -*- encoding: utf-8 -*-
###
# Copyright 2019 Joël Perras <joel@nerderati.com>
# 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
... | 0 | 0 | 0 |
898fd9f2849e86df31a1eb44887c52a2fa952bac | 1,143 | py | Python | config.py | amour-lee/NewsProject | 85fcd3798e84657d13583b0d0344c993aeb87790 | [
"MIT"
] | null | null | null | config.py | amour-lee/NewsProject | 85fcd3798e84657d13583b0d0344c993aeb87790 | [
"MIT"
] | null | null | null | config.py | amour-lee/NewsProject | 85fcd3798e84657d13583b0d0344c993aeb87790 | [
"MIT"
] | null | null | null | from redis import StrictRedis
import logging
# 准备配置类
class Config(object):
"""app配置类"""
# DEBUG = True
# 配置MySQL:指定数据库位置
SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@mysql@127.0.0.1:3306/information_new'
# 禁用追踪mysql:因为mysql的性能差,如果再去追踪mysql的所有的修改,会再次浪费性能
SQLALCHEMY_TRACK_MODIFICATIONS = False
... | 21.566038 | 87 | 0.688539 | from redis import StrictRedis
import logging
# 准备配置类
class Config(object):
"""app配置类"""
# DEBUG = True
# 配置MySQL:指定数据库位置
SQLALCHEMY_DATABASE_URI = 'mysql://root:mysql@mysql@127.0.0.1:3306/information_new'
# 禁用追踪mysql:因为mysql的性能差,如果再去追踪mysql的所有的修改,会再次浪费性能
SQLALCHEMY_TRACK_MODIFICATIONS = False
... | 0 | 0 | 0 |
9c575a1207706993c411a4d5dde64251de3cb91a | 1,952 | py | Python | forms.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | null | null | null | forms.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | null | null | null | forms.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | 2 | 2020-07-16T22:02:13.000Z | 2020-11-22T21:16:28.000Z | from datetime import datetime
from flask_wtf import Form
from wtforms import (
BooleanField,
DateTimeField,
SelectField,
SelectMultipleField,
StringField,
)
from wtforms.validators import DataRequired, URL
from constants import GENRES, STATES
| 35.490909 | 78 | 0.697746 | from datetime import datetime
from flask_wtf import Form
from wtforms import (
BooleanField,
DateTimeField,
SelectField,
SelectMultipleField,
StringField,
)
from wtforms.validators import DataRequired, URL
from constants import GENRES, STATES
class ShowForm(Form):
artist_id = StringField("arti... | 0 | 1,617 | 69 |
7194658629832659b219bf86a0f106db81b3b79b | 2,074 | py | Python | src/controllers/joint_space_feedforward_controller.py | MatthiasDR96/industrial_robotics_simulator | 9039e7a581ce97c583c73294e9937664de90530b | [
"MIT"
] | 1 | 2020-10-21T15:32:41.000Z | 2020-10-21T15:32:41.000Z | src/controllers/joint_space_feedforward_controller.py | MatthiasDR96/industrial_robotics_simulator | 9039e7a581ce97c583c73294e9937664de90530b | [
"MIT"
] | null | null | null | src/controllers/joint_space_feedforward_controller.py | MatthiasDR96/industrial_robotics_simulator | 9039e7a581ce97c583c73294e9937664de90530b | [
"MIT"
] | null | null | null | import math
import numpy as np
""" A controller class which implements a joint feedforward
controller by compensating for the desired acceleration torque and the desired gravity torque."""
| 31.424242 | 111 | 0.62729 | import math
import numpy as np
""" A controller class which implements a joint feedforward
controller by compensating for the desired acceleration torque and the desired gravity torque."""
class Control:
def __init__(self, arm):
# Bind arm
self.arm = arm
# Control type
self.con... | 773 | 1,086 | 23 |
203ff959bd2a258325fc3617c59e0ffe1dab56f5 | 27,305 | py | Python | research/a2n/train.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 939 | 2019-08-28T06:50:30.000Z | 2022-03-30T02:37:07.000Z | research/a2n/train.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 80 | 2019-09-01T19:47:30.000Z | 2022-02-02T20:38:38.000Z | research/a2n/train.py | srihari-humbarwadi/neural-structured-learning | 345b8d644dd7745179263bf6dc9aeb8a921528f4 | [
"Apache-2.0"
] | 196 | 2019-09-01T19:38:53.000Z | 2022-02-08T01:25:57.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 40.814649 | 105 | 0.680718 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 393 | 23 | 98 |
82acf4203f61f66b6891f1f5647271a4ce386876 | 1,414 | py | Python | Betsy/Betsy/modules/cluster_genes_by_kmeans.py | jefftc/changlab | 11da8c415afefcba0b0216238387c75aeb3a56ac | [
"MIT"
] | 9 | 2017-01-13T02:38:41.000Z | 2021-04-08T00:44:39.000Z | Betsy/Betsy/modules/cluster_genes_by_kmeans.py | jefftc/changlab | 11da8c415afefcba0b0216238387c75aeb3a56ac | [
"MIT"
] | null | null | null | Betsy/Betsy/modules/cluster_genes_by_kmeans.py | jefftc/changlab | 11da8c415afefcba0b0216238387c75aeb3a56ac | [
"MIT"
] | 4 | 2017-01-05T16:25:25.000Z | 2019-12-12T20:07:38.000Z | from Module import AbstractModule
| 31.422222 | 74 | 0.630127 | from Module import AbstractModule
class Module(AbstractModule):
def __init__(self):
AbstractModule.__init__(self)
def run(
self, network, in_data, out_attributes, user_options, num_cores,
out_path):
import os
import shutil
from genomicode import filelib
... | 1,268 | 8 | 103 |
8276054130b6223eb6e4eaa348d70760cd57a8e8 | 1,419 | py | Python | scrapfishin/queries.py | SupahNoob/scrapfishin | 8163ee40a348ff45d2dd0384acf948c4fff87fa3 | [
"MIT"
] | null | null | null | scrapfishin/queries.py | SupahNoob/scrapfishin | 8163ee40a348ff45d2dd0384acf948c4fff87fa3 | [
"MIT"
] | null | null | null | scrapfishin/queries.py | SupahNoob/scrapfishin | 8163ee40a348ff45d2dd0384acf948c4fff87fa3 | [
"MIT"
] | null | null | null | from typing import Iterable
import sqlalchemy as sa
from scrapfishin.models import Recipe
def grocery_list(
s: sa.orm.Session,
recipes: Iterable[Recipe]
) -> str:
"""
Format an iterable of Recipes into a Grocery List.
Parameters
----------
s : sqlalchemy.orm.Session
database ses... | 21.830769 | 70 | 0.549683 | from typing import Iterable
import sqlalchemy as sa
from scrapfishin.models import Recipe
def grocery_list(
s: sa.orm.Session,
recipes: Iterable[Recipe]
) -> str:
"""
Format an iterable of Recipes into a Grocery List.
Parameters
----------
s : sqlalchemy.orm.Session
database ses... | 0 | 0 | 0 |
9ab7a8ab803317414b2c748a2679e0808435230a | 2,345 | py | Python | ndg/security/server/test/config/attributeauthority/sitea/attributeauthorityapp.py | cedadev/ndg_security_server | 6873cc0de1a01ad05ddcbeb3f074a33923dc1ca1 | [
"BSD-3-Clause"
] | null | null | null | ndg/security/server/test/config/attributeauthority/sitea/attributeauthorityapp.py | cedadev/ndg_security_server | 6873cc0de1a01ad05ddcbeb3f074a33923dc1ca1 | [
"BSD-3-Clause"
] | null | null | null | ndg/security/server/test/config/attributeauthority/sitea/attributeauthorityapp.py | cedadev/ndg_security_server | 6873cc0de1a01ad05ddcbeb3f074a33923dc1ca1 | [
"BSD-3-Clause"
] | 1 | 2017-12-05T17:31:08.000Z | 2017-12-05T17:31:08.000Z | #!/usr/bin/env python
"""NDG Security Attribute Authority test harness for unit test site 'A'
NERC Data Grid Project
"""
__author__ = "P J Kershaw"
__date__ = "24/09/08"
__copyright__ = "(C) 2009 Science and Technology Facilities Council"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = "$Id$"
from os import ... | 33.028169 | 76 | 0.557356 | #!/usr/bin/env python
"""NDG Security Attribute Authority test harness for unit test site 'A'
NERC Data Grid Project
"""
__author__ = "P J Kershaw"
__date__ = "24/09/08"
__copyright__ = "(C) 2009 Science and Technology Facilities Council"
__contact__ = "Philip.Kershaw@stfc.ac.uk"
__revision__ = "$Id$"
from os import ... | 0 | 0 | 0 |
688e52d3ed32eaeadd847a7afafdb32a45017795 | 2,836 | py | Python | clients/python/tyckiting_client/ai/stettin.py | CarstenWalther/space-tyckiting | 8398f080332c78c7f246289947fdda49558e0f12 | [
"MIT"
] | 1 | 2017-02-04T14:13:44.000Z | 2017-02-04T14:13:44.000Z | clients/python/tyckiting_client/ai/stettin.py | CarstenWalther/space-tyckiting | 8398f080332c78c7f246289947fdda49558e0f12 | [
"MIT"
] | null | null | null | clients/python/tyckiting_client/ai/stettin.py | CarstenWalther/space-tyckiting | 8398f080332c78c7f246289947fdda49558e0f12 | [
"MIT"
] | null | null | null | import random
from tyckiting_client.ai import base
from tyckiting_client import actions
from tyckiting_client.ai.strategies import pipelineEscaping
from tyckiting_client.ai.strategies import scanning
from tyckiting_client.ai.strategies import uncertainTracking
'''
Rules:
like robin but in certain situations endangere... | 34.585366 | 94 | 0.627997 | import random
from tyckiting_client.ai import base
from tyckiting_client import actions
from tyckiting_client.ai.strategies import pipelineEscaping
from tyckiting_client.ai.strategies import scanning
from tyckiting_client.ai.strategies import uncertainTracking
'''
Rules:
like robin but in certain situations endangere... | 2,353 | 1 | 104 |
8a8b53191890167d24f5bf11c407382590852801 | 2,581 | py | Python | faces.py | Sxela/PythonSnippets | 6a91e2c6080330195aedc04c7b9c36636cb488ff | [
"MIT"
] | null | null | null | faces.py | Sxela/PythonSnippets | 6a91e2c6080330195aedc04c7b9c36636cb488ff | [
"MIT"
] | null | null | null | faces.py | Sxela/PythonSnippets | 6a91e2c6080330195aedc04c7b9c36636cb488ff | [
"MIT"
] | 1 | 2021-11-20T06:26:19.000Z | 2021-11-20T06:26:19.000Z | """
Code related to face detection and manipulation
"""
#pip install facenet_pytorch
from facenet_pytorch import MTCNN
mtcnn = MTCNN(image_size=256, margin=80)
# simplest ye olde trustworthy MTCNN for face detection with landmarks
# my version of isOdd, should make a separate repo for it :D
# the actual scaler... | 31.096386 | 118 | 0.678032 | """
Code related to face detection and manipulation
"""
#pip install facenet_pytorch
from facenet_pytorch import MTCNN
mtcnn = MTCNN(image_size=256, margin=80)
# simplest ye olde trustworthy MTCNN for face detection with landmarks
def detect(img):
# Detect faces
batch_boxes, batch_probs, batch_... | 1,574 | 0 | 89 |
719922355fdc1bd4f77e6d2055a74f97ffa8ac71 | 621 | py | Python | src/ansys/templates/python/pyace_flask/{{cookiecutter.__project_name_slug}}/src/blueprints/health.py | pyansys/pyansys-templates | dbbcc7e89c1014bb68e065bf70af30c10ecfadb6 | [
"MIT"
] | null | null | null | src/ansys/templates/python/pyace_flask/{{cookiecutter.__project_name_slug}}/src/blueprints/health.py | pyansys/pyansys-templates | dbbcc7e89c1014bb68e065bf70af30c10ecfadb6 | [
"MIT"
] | 16 | 2022-03-18T09:17:10.000Z | 2022-03-28T06:52:05.000Z | src/ansys/templates/python/pyace_flask/{{cookiecutter.__project_name_slug}}/src/blueprints/health.py | pyansys/ansys-templates | f7def562e23c5c8db51c17d56a7c34f62f77077d | [
"MIT"
] | 1 | 2022-03-16T18:23:12.000Z | 2022-03-16T18:23:12.000Z | {%- if cookiecutter.copyright != "None" -%}
# Copyright (c) {% now "utc", '%Y' %}, {{ cookiecutter.copyright }}. Unauthorised use, distribution or duplication is prohibited
{% endif %}
"""
{{ cookiecutter.project_name }}.
{{ cookiecutter.library_name }}
"""
from flask import Blueprint, jsonify
from observability.log... | 25.875 | 128 | 0.689211 | {%- if cookiecutter.copyright != "None" -%}
# Copyright (c) {% now "utc", '%Y' %}, {{ cookiecutter.copyright }}. Unauthorised use, distribution or duplication is prohibited
{% endif %}
"""
{{ cookiecutter.project_name }}.
{{ cookiecutter.library_name }}
"""
from flask import Blueprint, jsonify
from observability.log... | 0 | 0 | 0 |
6fc60e43f1a5c92d6bfc4dc8ba0dc775c230b8ca | 9,953 | py | Python | tests/test_news.py | Paule3569/feuersoftware | fe2bc9f71a45d4b9232df8d3fe8d50239c775296 | [
"MIT"
] | 1 | 2021-04-29T10:57:48.000Z | 2021-04-29T10:57:48.000Z | tests/test_news.py | Paule3569/feuersoftware | fe2bc9f71a45d4b9232df8d3fe8d50239c775296 | [
"MIT"
] | null | null | null | tests/test_news.py | Paule3569/feuersoftware | fe2bc9f71a45d4b9232df8d3fe8d50239c775296 | [
"MIT"
] | 1 | 2018-08-28T14:30:02.000Z | 2018-08-28T14:30:02.000Z | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import os
import pytest
from mock import patch
sys.path.insert(0, os.path.abspath('./'))
from feuersoftware import PublicAPI
TOKEN = '2xgRoQfoMGb4IveCDJIZqOO1l8hZZ5jT5mAw7SSk1otrFSq50IA2HIYB3luEpv7Vw8BWwG'\
'Y2zV96VUkOF3FCZs2OP03qaTWF3CDrUHOKndvLIFTTgx... | 40.958848 | 128 | 0.683412 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import sys
import os
import pytest
from mock import patch
sys.path.insert(0, os.path.abspath('./'))
from feuersoftware import PublicAPI
TOKEN = '2xgRoQfoMGb4IveCDJIZqOO1l8hZZ5jT5mAw7SSk1otrFSq50IA2HIYB3luEpv7Vw8BWwG'\
'Y2zV96VUkOF3FCZs2OP03qaTWF3CDrUHOKndvLIFTTgx... | 7,805 | 0 | 264 |
abcd1e3a4b4fa40687d4d76ca3859663c28333f4 | 1,266 | py | Python | strangeflix/provider/migrations/0013_auto_20201027_1642.py | samsoldeinstein/webster2020 | 9795635e806caa261bb33d629f3d1f2bd603638c | [
"MIT"
] | 6 | 2020-11-02T16:40:56.000Z | 2020-11-07T06:59:00.000Z | strangeflix/provider/migrations/0013_auto_20201027_1642.py | samsoldeinstein/webster2020 | 9795635e806caa261bb33d629f3d1f2bd603638c | [
"MIT"
] | null | null | null | strangeflix/provider/migrations/0013_auto_20201027_1642.py | samsoldeinstein/webster2020 | 9795635e806caa261bb33d629f3d1f2bd603638c | [
"MIT"
] | 2 | 2020-11-03T05:20:25.000Z | 2020-11-03T05:38:47.000Z | # Generated by Django 3.1.2 on 2020-10-27 11:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 38.363636 | 242 | 0.629542 | # Generated by Django 3.1.2 on 2020-10-27 11:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('provider', '0012_reportc... | 0 | 1,086 | 23 |
b831d0118bd1cb0ebd9c4bf798fd205bc356bfe5 | 4,952 | py | Python | result_service_gui/services/dashboard_adapter.py | abdulfahad66/result-service-gui | 214342dd6d00f1173bfe90f8429c7d6c9947783b | [
"Apache-2.0"
] | null | null | null | result_service_gui/services/dashboard_adapter.py | abdulfahad66/result-service-gui | 214342dd6d00f1173bfe90f8429c7d6c9947783b | [
"Apache-2.0"
] | null | null | null | result_service_gui/services/dashboard_adapter.py | abdulfahad66/result-service-gui | 214342dd6d00f1173bfe90f8429c7d6c9947783b | [
"Apache-2.0"
] | null | null | null | """Module for events adapter."""
import copy
import logging
import os
from typing import List
from aiohttp import ClientSession
from aiohttp import hdrs
from aiohttp import web
from multidict import MultiDict
EVENTS_HOST_SERVER = os.getenv("EVENTS_HOST_SERVER", "localhost")
EVENTS_HOST_PORT = os.getenv("EVENTS_HOST_P... | 37.515152 | 86 | 0.539782 | """Module for events adapter."""
import copy
import logging
import os
from typing import List
from aiohttp import ClientSession
from aiohttp import hdrs
from aiohttp import web
from multidict import MultiDict
EVENTS_HOST_SERVER = os.getenv("EVENTS_HOST_SERVER", "localhost")
EVENTS_HOST_PORT = os.getenv("EVENTS_HOST_P... | 0 | 0 | 0 |
5dd8c1a13aa126acef031096fe6c5f2daa3b4777 | 1,726 | py | Python | scripts/feots_compare.py | schoonovernumerics/FEOTs | d8bf24d0e0c23a9ee65e2be6a75f5dbc83d3e5ad | [
"BSD-3-Clause"
] | null | null | null | scripts/feots_compare.py | schoonovernumerics/FEOTs | d8bf24d0e0c23a9ee65e2be6a75f5dbc83d3e5ad | [
"BSD-3-Clause"
] | 13 | 2017-08-03T22:30:25.000Z | 2019-01-23T16:32:28.000Z | scripts/feots_compare.py | schoonovernumerics/FEOTS | d8bf24d0e0c23a9ee65e2be6a75f5dbc83d3e5ad | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
DOC="""feots_compare
feots_compare is use to compare two FEOTS NetCDF output files and report simple statistics.
Currently feots_compare will generate a histogram of log_{10}( |f_1 - f_2| ) where f_1 and
f_2 are tracer fields from two FEOTS output files.
Usage:
feots_compare absdiff <file1> <fi... | 27.83871 | 103 | 0.648899 | #!/usr/bin/python3
DOC="""feots_compare
feots_compare is use to compare two FEOTS NetCDF output files and report simple statistics.
Currently feots_compare will generate a histogram of log_{10}( |f_1 - f_2| ) where f_1 and
f_2 are tracer fields from two FEOTS output files.
Usage:
feots_compare absdiff <file1> <fi... | 870 | 0 | 69 |
c9e98295e343002fd25fd863b2b291218a72484e | 4,292 | py | Python | opendc-web/opendc-web-api/opendc/util/rest.py | Koen1999/opendc | f9b43518d2d50f33077734537a477539fca9f5b7 | [
"MIT"
] | null | null | null | opendc-web/opendc-web-api/opendc/util/rest.py | Koen1999/opendc | f9b43518d2d50f33077734537a477539fca9f5b7 | [
"MIT"
] | 4 | 2020-11-27T16:27:58.000Z | 2020-12-28T23:00:08.000Z | opendc-web/opendc-web-api/opendc/util/rest.py | Koen1999/opendc | f9b43518d2d50f33077734537a477539fca9f5b7 | [
"MIT"
] | null | null | null | import importlib
import json
import os
from oauth2client import client, crypt
from opendc.util import exceptions, parameter_checker
from opendc.util.exceptions import ClientError
class Request:
"""WebSocket message to REST request mapping."""
def __init__(self, message=None):
""""Initialize a Reques... | 30.225352 | 104 | 0.608574 | import importlib
import json
import os
from oauth2client import client, crypt
from opendc.util import exceptions, parameter_checker
from opendc.util.exceptions import ClientError
class Request:
"""WebSocket message to REST request mapping."""
def __init__(self, message=None):
""""Initialize a Reques... | 0 | 0 | 0 |
aee06431ad2ec6bcfc0d5ab724b78f72227eea3a | 49,614 | py | Python | Scripts/simulation/statistics/ranked_statistic.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/statistics/ranked_statistic.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/statistics/ranked_statistic.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\statistics\ranked_statistic.py
# Compiled at: 2020-08-11 17:51:45
# Size of source mod 2**32: 58267 ... | 57.892649 | 781 | 0.617023 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\statistics\ranked_statistic.py
# Compiled at: 2020-08-11 17:51:45
# Size of source mod 2**32: 58267 ... | 20,168 | 18,954 | 981 |
739d41393a77764cb1e6c4ffc79168adc816618e | 280 | py | Python | main.py | umutykaya/yelp_business_search_api | aee604733f69b88c94121db652745a8243cd1e6a | [
"MIT"
] | null | null | null | main.py | umutykaya/yelp_business_search_api | aee604733f69b88c94121db652745a8243cd1e6a | [
"MIT"
] | null | null | null | main.py | umutykaya/yelp_business_search_api | aee604733f69b88c94121db652745a8243cd1e6a | [
"MIT"
] | null | null | null | # Import utils submodule
import api.api
# Decide to start seeing other people
api.api.we_need_to_talk(break_up=False)
import api
# Create instance of MyClass
my_instance = api.AppClass(value='class attribute value')
# Print out class attribute value
print(my_instance.attribute) | 25.454545 | 57 | 0.807143 | # Import utils submodule
import api.api
# Decide to start seeing other people
api.api.we_need_to_talk(break_up=False)
import api
# Create instance of MyClass
my_instance = api.AppClass(value='class attribute value')
# Print out class attribute value
print(my_instance.attribute) | 0 | 0 | 0 |
785be2e4d3c1bf71b5bc23604da19bfa5ca45d21 | 2,421 | py | Python | autolens/point/fit_point/point_dataset.py | Jammy2211/AutoLens | bc132a21d1a52248f08f198474e29f985e365d85 | [
"MIT"
] | null | null | null | autolens/point/fit_point/point_dataset.py | Jammy2211/AutoLens | bc132a21d1a52248f08f198474e29f985e365d85 | [
"MIT"
] | 10 | 2017-12-22T11:39:33.000Z | 2018-01-30T09:13:16.000Z | autolens/point/fit_point/point_dataset.py | Jammy2211/AutoLens | bc132a21d1a52248f08f198474e29f985e365d85 | [
"MIT"
] | null | null | null | import numba
import autogalaxy as ag
from autolens.point.point_dataset import PointDataset
from autolens.point.point_solver import PointSolver
from autolens.point.fit_point.fluxes import FitFluxes
from autolens.point.fit_point.positions_image import FitPositionsImage
from autolens.point.fit_point.positions_so... | 32.28 | 89 | 0.615035 | import numba
import autogalaxy as ag
from autolens.point.point_dataset import PointDataset
from autolens.point.point_solver import PointSolver
from autolens.point.fit_point.fluxes import FitFluxes
from autolens.point.fit_point.positions_image import FitPositionsImage
from autolens.point.fit_point.positions_so... | 1,896 | 73 | 24 |
88257a5631f85a303cf369ae7a877f11db6c90b8 | 2,642 | py | Python | pysptools/examples/ex_hematite_v2.py | ctherien/pysptools | fbcd3ecaa7ab27f0158b28b4327537c3e75db160 | [
"Apache-2.0"
] | 35 | 2016-03-20T15:25:07.000Z | 2022-03-29T04:05:56.000Z | pysptools/examples/ex_hematite_v2.py | ctherien/pysptools | fbcd3ecaa7ab27f0158b28b4327537c3e75db160 | [
"Apache-2.0"
] | 12 | 2016-03-24T13:38:52.000Z | 2021-04-06T07:11:19.000Z | pysptools/examples/ex_hematite_v2.py | ctherien/pysptools | fbcd3ecaa7ab27f0158b28b4327537c3e75db160 | [
"Apache-2.0"
] | 14 | 2016-03-21T17:26:46.000Z | 2022-01-18T08:39:27.000Z | """
Plot a quartz class map for a drill core HSI cube.
"""
from __future__ import print_function
import os
import os.path as osp
import matplotlib.pyplot as plt
import numpy as np
import pysptools.util as util
import pysptools.eea as eea
import pysptools.abundance_maps as amp
if __name__ ==... | 28.408602 | 106 | 0.641938 | """
Plot a quartz class map for a drill core HSI cube.
"""
from __future__ import print_function
import os
import os.path as osp
import matplotlib.pyplot as plt
import numpy as np
import pysptools.util as util
import pysptools.eea as eea
import pysptools.abundance_maps as amp
def parse_ENVI_header(... | 797 | 0 | 100 |
54026340f4cf4ce095dffe423dda6e49920ea4bc | 546 | py | Python | task/task1.py | SofyaGrobova/lab14 | 7d0e8b8d56acc9c6b86e9e0303b53762f470be3b | [
"MIT"
] | null | null | null | task/task1.py | SofyaGrobova/lab14 | 7d0e8b8d56acc9c6b86e9e0303b53762f470be3b | [
"MIT"
] | null | null | null | task/task1.py | SofyaGrobova/lab14 | 7d0e8b8d56acc9c6b86e9e0303b53762f470be3b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
if __name__ == '__main__':
print(func(5, 3)())
print(func(8, 10, 1)())
print(func(3, 5, 0)())
print(func(2, 2, 1)())
| 21 | 73 | 0.47619 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math
def func(a, b, type=0):
def func2():
if type == 0:
res = a * b / 2
res = f'Для значений {a}, {b} площадь треугольника = {res}'
return res
elif type == 1:
res = a * b
res = f'Для ... | 388 | 0 | 23 |
d8d1c0f3e83aa3b5a43247e7f58ad9de5aa9b287 | 2,477 | py | Python | get_premium/tests.py | BarunBlog/Link_People | 1ffd07bc5b31a715133c99efbbb478efe18d632b | [
"MIT"
] | null | null | null | get_premium/tests.py | BarunBlog/Link_People | 1ffd07bc5b31a715133c99efbbb478efe18d632b | [
"MIT"
] | null | null | null | get_premium/tests.py | BarunBlog/Link_People | 1ffd07bc5b31a715133c99efbbb478efe18d632b | [
"MIT"
] | null | null | null | '''from django.contrib.auth import get_user_model
from django.test import TestCase #an extension of Python’s TestCase
from django.urls import reverse, resolve
from django.test import Client
from .models import PremiumBlog
from .views import (
BlogListView,
BlogDetailView,
)
class CustomUserTests(TestCa... | 30.207317 | 72 | 0.644732 | '''from django.contrib.auth import get_user_model
from django.test import TestCase #an extension of Python’s TestCase
from django.urls import reverse, resolve
from django.test import Client
from .models import PremiumBlog
from .views import (
BlogListView,
BlogDetailView,
)
class CustomUserTests(TestCa... | 0 | 0 | 0 |
406e78c5faea77fb778787c685d5a2bd4b6c7a1d | 4,208 | py | Python | acme/utils/observers/action_metrics_test.py | wookayin/acme | 71b2ab8577a118c103718f034fa62c5ad2c0fd97 | [
"Apache-2.0"
] | null | null | null | acme/utils/observers/action_metrics_test.py | wookayin/acme | 71b2ab8577a118c103718f034fa62c5ad2c0fd97 | [
"Apache-2.0"
] | null | null | null | acme/utils/observers/action_metrics_test.py | wookayin/acme | 71b2ab8577a118c103718f034fa62c5ad2c0fd97 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 32.875 | 77 | 0.643774 | # Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 3,050 | 22 | 196 |
03e5c1084cdb72e0eb5d8f98d04c7100f12e582e | 31,595 | py | Python | SMPyBandits/Policies/DoublingTrickWrapper.py | balbok0/SMPyBandits | c8ff765687989e0c20ab42c2e2e1d8440923225b | [
"MIT"
] | 309 | 2018-03-03T22:07:59.000Z | 2022-03-26T08:15:58.000Z | Policies/DoublingTrickWrapper.py | 98k-bot/SMPyBandits | 35e675bde29dafbec68288fcfcd14ef3b0f058b2 | [
"MIT"
] | 125 | 2018-02-27T22:54:03.000Z | 2021-11-05T10:50:15.000Z | Policies/DoublingTrickWrapper.py | 98k-bot/SMPyBandits | 35e675bde29dafbec68288fcfcd14ef3b0f058b2 | [
"MIT"
] | 60 | 2018-04-30T20:54:24.000Z | 2022-02-21T22:41:46.000Z | # -*- coding: utf-8 -*-
r""" A policy that acts as a wrapper on another policy `P`, assumed to be *horizon dependent* (has to known :math:`T`), by implementing a "doubling trick":
- starts to assume that :math:`T=T_0=1000`, and run the policy :math:`P(T_0)`, from :math:`t=1` to :math:`t=T_0`,
- if :math:`t > T_0`, the... | 47.297904 | 346 | 0.65963 | # -*- coding: utf-8 -*-
r""" A policy that acts as a wrapper on another policy `P`, assumed to be *horizon dependent* (has to known :math:`T`), by implementing a "doubling trick":
- starts to assume that :math:`T=T_0=1000`, and run the policy :math:`P(T_0)`, from :math:`t=1` to :math:`t=T_0`,
- if :math:`t > T_0`, the... | 2,754 | 0 | 221 |
2fa4bbb8ea840af3c1d5538c76d509d8cce1d549 | 738 | py | Python | LM-1221 intro-python-xml/py-primer-1/concat_sol.py | russellpope/devnet-express-dc | 4bdb2194abdee2fc950c2ff20e607aa4af9b68b5 | [
"Apache-2.0"
] | null | null | null | LM-1221 intro-python-xml/py-primer-1/concat_sol.py | russellpope/devnet-express-dc | 4bdb2194abdee2fc950c2ff20e607aa4af9b68b5 | [
"Apache-2.0"
] | null | null | null | LM-1221 intro-python-xml/py-primer-1/concat_sol.py | russellpope/devnet-express-dc | 4bdb2194abdee2fc950c2ff20e607aa4af9b68b5 | [
"Apache-2.0"
] | null | null | null | myVarRed= "Red"
myVarBlue= "Blue"
print("Roses are Red. " + "Violets are Blue.")
print("Roses are " + myVarRed + ". Violets are " + myVarBlue)
myStr = "Roses are Red. " + "Violets are Blue."
varStr = "Roses are " + myVarRed + ". Violets are " + myVarBlue
print(myStr)
print(varStr)
name = "Joe"
feet= 6
inches= 2
p... | 25.448276 | 94 | 0.601626 | myVarRed= "Red"
myVarBlue= "Blue"
print("Roses are Red. " + "Violets are Blue.")
print("Roses are " + myVarRed + ". Violets are " + myVarBlue)
myStr = "Roses are Red. " + "Violets are Blue."
varStr = "Roses are " + myVarRed + ". Violets are " + myVarBlue
print(myStr)
print(varStr)
name = "Joe"
feet= 6
inches= 2
p... | 0 | 0 | 0 |
842007e2d61d97d0fa4ac492f9400db322530dc3 | 35 | py | Python | haul3/haul/platforms/android/__init__.py | hotkeymuc/haul | 22533491e3a22ce9fabd81f281282a09880b400c | [
"MIT"
] | 2 | 2021-07-04T13:00:50.000Z | 2022-03-19T21:39:06.000Z | haul3/haul/platforms/android/__init__.py | hotkeymuc/haul | 22533491e3a22ce9fabd81f281282a09880b400c | [
"MIT"
] | null | null | null | haul3/haul/platforms/android/__init__.py | hotkeymuc/haul | 22533491e3a22ce9fabd81f281282a09880b400c | [
"MIT"
] | null | null | null | __all__ = [
'builder_android',
] | 11.666667 | 20 | 0.628571 | __all__ = [
'builder_android',
] | 0 | 0 | 0 |
353c5aebfd3ddcbd66eae6f02131a97bfbbcb204 | 168 | py | Python | notmuchtask/cli/globals.py | neuhalje/notmuch-task | 096231e841b5996c85dd3f50bee02d26989a0505 | [
"0BSD",
"MIT"
] | 7 | 2019-06-11T10:39:09.000Z | 2022-01-18T17:53:33.000Z | notmuchtask/cli/globals.py | neuhalje/notmuch-task | 096231e841b5996c85dd3f50bee02d26989a0505 | [
"0BSD",
"MIT"
] | 1 | 2021-11-03T14:43:27.000Z | 2021-11-03T14:43:27.000Z | notmuchtask/cli/globals.py | neuhalje/notmuch-task | 096231e841b5996c85dd3f50bee02d26989a0505 | [
"0BSD",
"MIT"
] | null | null | null | from configparser import RawConfigParser
CONTEXT = Context()
| 16.8 | 50 | 0.732143 | from configparser import RawConfigParser
class Context(object):
def set_config(self, config: RawConfigParser):
self.config = config
CONTEXT = Context()
| 54 | 1 | 49 |
f7bbd0a87756108eeffd6e1b15b2b36e5c8c7aed | 434 | py | Python | setup.py | jab/hip | a42c11e6a77190809e37c2337c50b86baca2c9d9 | [
"MIT"
] | null | null | null | setup.py | jab/hip | a42c11e6a77190809e37c2337c50b86baca2c9d9 | [
"MIT"
] | null | null | null | setup.py | jab/hip | a42c11e6a77190809e37c2337c50b86baca2c9d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import re
import unasync # requires pip>=10.0 for PEP 518 support
from setuptools import setup
# Get the version (borrowed from SQLAlchemy)
base_path = os.path.dirname(__file__)
with open(os.path.join(base_path, "src", "urllib3", "__init__.py")) as fp:
version = re.match(r".*__v... | 27.125 | 78 | 0.705069 | #!/usr/bin/env python
import os
import re
import unasync # requires pip>=10.0 for PEP 518 support
from setuptools import setup
# Get the version (borrowed from SQLAlchemy)
base_path = os.path.dirname(__file__)
with open(os.path.join(base_path, "src", "urllib3", "__init__.py")) as fp:
version = re.match(r".*__v... | 0 | 0 | 0 |
ee0e2a8c1e86cb0392c34b96fcd74204d4f78e8a | 308 | py | Python | amplification/tasks/__init__.py | rmoehn/amplification | fd1bed7c4fb7df4b017b900aa91d185dbe55519c | [
"MIT"
] | 8 | 2020-02-18T03:16:06.000Z | 2022-03-06T15:44:21.000Z | amplification/tasks/__init__.py | PenroseTiles/amplification | ef33a91db0e43ee085443205a2b784666214a121 | [
"MIT"
] | null | null | null | amplification/tasks/__init__.py | PenroseTiles/amplification | ef33a91db0e43ee085443205a2b784666214a121 | [
"MIT"
] | 2 | 2020-03-01T06:11:48.000Z | 2021-03-25T21:44:08.000Z | from amplification.tasks.equals import EqualsTask
from amplification.tasks.graph import GraphTask, MidpointTask
from amplification.tasks.sum import SumTask
from amplification.tasks.eval import EvalTask, EvalSumTask
from amplification.tasks.iterate import IterTask
from amplification.tasks.sat import SatTask
| 44 | 61 | 0.87013 | from amplification.tasks.equals import EqualsTask
from amplification.tasks.graph import GraphTask, MidpointTask
from amplification.tasks.sum import SumTask
from amplification.tasks.eval import EvalTask, EvalSumTask
from amplification.tasks.iterate import IterTask
from amplification.tasks.sat import SatTask
| 0 | 0 | 0 |
49e49460de4690f51b58645fac52eb85f273af88 | 468 | py | Python | tests/14_class_based_test.py | MaximeBarroin/test-ci-niveau-3 | cb0d7feda257f7ac3199d696dcbe735791d342f8 | [
"MIT"
] | null | null | null | tests/14_class_based_test.py | MaximeBarroin/test-ci-niveau-3 | cb0d7feda257f7ac3199d696dcbe735791d342f8 | [
"MIT"
] | null | null | null | tests/14_class_based_test.py | MaximeBarroin/test-ci-niveau-3 | cb0d7feda257f7ac3199d696dcbe735791d342f8 | [
"MIT"
] | null | null | null | class TestSimpleClass(object):
"""
Classes can still be used to organize collections of test cases, with
each test being a Method on the Class, rather than a standalone function.
"""
x = 1
y = 2
| 27.529412 | 77 | 0.647436 | class TestSimpleClass(object):
"""
Classes can still be used to organize collections of test cases, with
each test being a Method on the Class, rather than a standalone function.
"""
x = 1
y = 2
def regular_method(self):
print("\n(This is a regular, non-test-case method.)")
de... | 194 | 0 | 54 |
6cbfe283c09e5b6fcb128a6b0257ddfdd443c402 | 967 | py | Python | tests/test_config.py | evanyerburgh/pybo | d26bb298992276949227b8c4c596f2c209cbb507 | [
"Apache-2.0"
] | null | null | null | tests/test_config.py | evanyerburgh/pybo | d26bb298992276949227b8c4c596f2c209cbb507 | [
"Apache-2.0"
] | null | null | null | tests/test_config.py | evanyerburgh/pybo | d26bb298992276949227b8c4c596f2c209cbb507 | [
"Apache-2.0"
] | null | null | null | # coding: utf8
from pybo import Config
from pathlib import Path
| 35.814815 | 112 | 0.672182 | # coding: utf8
from pybo import Config
from pathlib import Path
def test_config():
config = Config()
# default config filename
assert config.filename.name == 'pybo.yaml' # config.filename is a Path object
# paths for trie content
main, custom = config.get_tok_data_paths('POS')
# each profil... | 879 | 0 | 23 |
7ffea491a3bbb3f79f3e942d8d09033126c952f0 | 262 | py | Python | src/c_function.py | Command-Master/MCCC | a49440bfd8542002aee35d41bee093dc8b51d781 | [
"MIT"
] | 6 | 2021-01-15T03:49:01.000Z | 2021-11-02T10:43:22.000Z | src/c_function.py | Command-Master/MCCC | a49440bfd8542002aee35d41bee093dc8b51d781 | [
"MIT"
] | null | null | null | src/c_function.py | Command-Master/MCCC | a49440bfd8542002aee35d41bee093dc8b51d781 | [
"MIT"
] | null | null | null | from globals_consts import NAMESPACE, cname | 23.818182 | 68 | 0.671756 | from globals_consts import NAMESPACE, cname
class Function:
size = 1
def cast(self):
raise NotImplementedError('liken\'t cast function pointers')
def __init__(self, args, ret_type):
self.args = args
self.ret_type = ret_type | 135 | 61 | 23 |
601709bc965d0c99ca67dea3094943e5837a89d1 | 423 | py | Python | city_scrapers/spiders/wayne_cow.py | just-hugo/city-scrapers-det | 76b52f11506c99e19b7fcaf135cc7570257a2b62 | [
"MIT"
] | 1 | 2020-10-01T18:27:59.000Z | 2020-10-01T18:27:59.000Z | city_scrapers/spiders/wayne_cow.py | just-hugo/city-scrapers-det | 76b52f11506c99e19b7fcaf135cc7570257a2b62 | [
"MIT"
] | 9 | 2019-11-30T21:33:24.000Z | 2021-04-07T19:26:47.000Z | city_scrapers/spiders/wayne_cow.py | just-hugo/city-scrapers-det | 76b52f11506c99e19b7fcaf135cc7570257a2b62 | [
"MIT"
] | 5 | 2019-12-20T17:29:10.000Z | 2021-02-14T01:32:26.000Z | from city_scrapers_core.spiders import CityScrapersSpider
from city_scrapers.mixins.wayne_commission import WayneCommissionMixin
| 32.538462 | 84 | 0.777778 | from city_scrapers_core.spiders import CityScrapersSpider
from city_scrapers.mixins.wayne_commission import WayneCommissionMixin
class WayneCommitteeWholeSpider(WayneCommissionMixin, CityScrapersSpider):
name = "wayne_cow"
agency = "Wayne County Government"
start_urls = [
"https://www.waynecounty... | 0 | 269 | 23 |
c65c404008e35e66385951320b626f514aff10e0 | 6,971 | py | Python | detection_3d/tools/pylatex_tools.py | coolzhangfeng/lidar_dynamic_objects_detection | 8d64cc75202208549adef6c854bbb03c2b3c465a | [
"MIT"
] | 1 | 2020-11-07T01:42:12.000Z | 2020-11-07T01:42:12.000Z | detection_3d/tools/pylatex_tools.py | coolzhangfeng/lidar_dynamic_objects_detection | 8d64cc75202208549adef6c854bbb03c2b3c465a | [
"MIT"
] | null | null | null | detection_3d/tools/pylatex_tools.py | coolzhangfeng/lidar_dynamic_objects_detection | 8d64cc75202208549adef6c854bbb03c2b3c465a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__copyright__ = """
Copyright (c) 2020 Tananaev Denis
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, cop... | 37.278075 | 107 | 0.677091 | #!/usr/bin/env python
__copyright__ = """
Copyright (c) 2020 Tananaev Denis
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, cop... | 0 | 0 | 0 |
a9fb228073ab41e1a635258e8d29d33c452c0848 | 483 | py | Python | pandas/tests/indexes/conftest.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | 6 | 2020-09-10T15:03:25.000Z | 2021-04-01T22:48:33.000Z | pandas/tests/indexes/conftest.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | 1 | 2020-04-05T16:02:27.000Z | 2020-04-05T16:02:27.000Z | pandas/tests/indexes/conftest.py | naomi172839/pandas | c5f11ab79e5553a28a91fc7036c8dcbfc8cbc697 | [
"BSD-3-Clause"
] | 4 | 2020-02-07T05:05:32.000Z | 2020-05-11T06:06:17.000Z | import pytest
@pytest.fixture(params=[None, False])
def sort(request):
"""
Valid values for the 'sort' parameter used in the Index
setops methods (intersection, union, etc.)
Caution:
Don't confuse this one with the "sort" fixture used
for DataFrame.append or concat. That one has
... | 25.421053 | 59 | 0.656315 | import pytest
@pytest.fixture(params=[None, False])
def sort(request):
"""
Valid values for the 'sort' parameter used in the Index
setops methods (intersection, union, etc.)
Caution:
Don't confuse this one with the "sort" fixture used
for DataFrame.append or concat. That one has
... | 0 | 0 | 0 |
37b1f19266734c9c1a9e6de7cf06f8e23a8796a7 | 3,414 | py | Python | yardstick/tests/unit/common/messaging/test_payloads.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 28 | 2017-02-07T07:46:42.000Z | 2021-06-30T08:11:06.000Z | yardstick/tests/unit/common/messaging/test_payloads.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 6 | 2018-01-18T08:00:54.000Z | 2019-04-11T04:51:41.000Z | yardstick/tests/unit/common/messaging/test_payloads.py | upfront710/yardstick | 2c3898f2ca061962cedbfc7435f78b59aa39b097 | [
"Apache-2.0"
] | 46 | 2016-12-13T10:05:47.000Z | 2021-02-18T07:33:06.000Z | # Copyright (c) 2018 Intel Corporation
#
# 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 i... | 41.13253 | 76 | 0.702402 | # Copyright (c) 2018 Intel Corporation
#
# 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 i... | 2,208 | 170 | 308 |
73f61a2414248de653696a251d78ce78694bfc78 | 5,258 | py | Python | fileprocess/mergefile/filebuf.py | edonyzpc/toolkitem | 3a09ebf45eee8ecd9ff0e441392d5fc746b996e5 | [
"MIT"
] | 3 | 2015-04-20T08:17:09.000Z | 2020-07-07T15:22:06.000Z | fileprocess/mergefile/filebuf.py | edonyzpc/toolkitem | 3a09ebf45eee8ecd9ff0e441392d5fc746b996e5 | [
"MIT"
] | 24 | 2015-11-14T14:54:59.000Z | 2017-10-23T15:14:45.000Z | fileprocess/mergefile/filebuf.py | edonyzpc/toolkitem | 3a09ebf45eee8ecd9ff0e441392d5fc746b996e5 | [
"MIT"
] | 1 | 2017-02-28T06:35:44.000Z | 2017-02-28T06:35:44.000Z | # -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------. \ .'_ (`-')----. ,... | 35.288591 | 90 | 0.386649 | # -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------. \ .'_ (`-')----. ,... | 1,163 | 0 | 26 |
e82d465500d9c28a0dec8c45feff5a27425e0085 | 6,085 | py | Python | solr-admin-app/solr_admin/views/synonym_view.py | sumesh-aot/namex | 53e11aed5ea550b71b7b983f1b57b65db5a06766 | [
"Apache-2.0"
] | 4 | 2018-10-05T23:41:05.000Z | 2019-06-19T16:17:50.000Z | solr-admin-app/solr_admin/views/synonym_view.py | sumesh-aot/namex | 53e11aed5ea550b71b7b983f1b57b65db5a06766 | [
"Apache-2.0"
] | 635 | 2018-05-31T04:12:46.000Z | 2022-03-31T18:45:42.000Z | solr-admin-app/solr_admin/views/synonym_view.py | rarmitag/namex | 1b308bf96130619d4a61d44e075cc7ab177dc6cd | [
"Apache-2.0"
] | 71 | 2018-05-14T20:47:55.000Z | 2022-03-31T23:08:30.000Z |
import re
from wtforms import validators
from solr_admin import keycloak
from solr_admin import models
from solr_admin import solr
from solr_admin.models import synonym_audit
# The customized ModelView that is used for working with the synonyms.
from solr_admin.services.get_stems import get_stems
from solr_admin.s... | 34.185393 | 117 | 0.708463 |
import re
from wtforms import validators
from solr_admin import keycloak
from solr_admin import models
from solr_admin import solr
from solr_admin.models import synonym_audit
# The customized ModelView that is used for working with the synonyms.
from solr_admin.services.get_stems import get_stems
from solr_admin.s... | 3,224 | 1,770 | 199 |
1af7590f916bd3c3dd5e8addcc07a4b7e95fd3b0 | 1,963 | py | Python | src/sgd.py | jmarrietar/suncet | 43868f7863e329e2db94f07e983f547add1bc495 | [
"MIT"
] | 413 | 2020-12-01T19:10:19.000Z | 2022-03-30T21:03:34.000Z | src/sgd.py | amalbinessa/suncet | 731547d727b8c94d06c08a7848b4955de3a70cea | [
"MIT"
] | 25 | 2021-05-03T01:26:39.000Z | 2022-03-24T01:13:08.000Z | src/sgd.py | amalbinessa/suncet | 731547d727b8c94d06c08a7848b4955de3a70cea | [
"MIT"
] | 57 | 2021-04-30T20:05:42.000Z | 2022-02-25T19:01:17.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
from torch.optim import Optimizer
| 32.716667 | 83 | 0.532348 | # Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import torch
from torch.optim import Optimizer
class SGD(Optimizer):
def __init__(self, params, lr, momentum=0, we... | 1,618 | 75 | 23 |
f673acd60723c0325469403a0d884d2a910fe005 | 1,512 | py | Python | ks8-2/server/controllers/todo.py | nabbott2008/ks | 888b7dfc4541199f31eef74edaca477f3ce48e6e | [
"MIT"
] | 225 | 2017-11-20T21:21:37.000Z | 2022-03-10T14:15:17.000Z | ks8-2/server/controllers/todo.py | cglacet/ks | 7e5331218cff0bed4342c0f0318ff91cf2ecbd67 | [
"MIT"
] | 12 | 2017-11-23T10:56:11.000Z | 2019-09-04T08:19:13.000Z | ks8-2/server/controllers/todo.py | cglacet/ks | 7e5331218cff0bed4342c0f0318ff91cf2ecbd67 | [
"MIT"
] | 93 | 2017-11-02T09:33:24.000Z | 2022-02-28T11:29:01.000Z | 'todo list controller'
import json
from flask import request
from flask import jsonify
from flask import current_app
import data.database as database
def list_items():
'GET todo list'
current_app.logger.info('todo controller called, func: list')
db = database.Database(current_app.config['CONN_STRING'])
... | 24 | 72 | 0.666667 | 'todo list controller'
import json
from flask import request
from flask import jsonify
from flask import current_app
import data.database as database
def list_items():
'GET todo list'
current_app.logger.info('todo controller called, func: list')
db = database.Database(current_app.config['CONN_STRING'])
... | 0 | 0 | 0 |
c515e211deadee410b0cb9289bd5dd7e0a11e5ad | 311 | py | Python | models/__init__.py | Louis-udm/Word-Grounded-Graph-Convolutional-Network | 4c90bff0ec8bcdd8994154eead0efb5a3caefca7 | [
"MIT"
] | null | null | null | models/__init__.py | Louis-udm/Word-Grounded-Graph-Convolutional-Network | 4c90bff0ec8bcdd8994154eead0efb5a3caefca7 | [
"MIT"
] | null | null | null | models/__init__.py | Louis-udm/Word-Grounded-Graph-Convolutional-Network | 4c90bff0ec8bcdd8994154eead0efb5a3caefca7 | [
"MIT"
] | null | null | null | """
The model package
"""
from models.gcn import GCN_2Layers
from models.mlp import MLP_1h, MLP_2h
from models.wgcn import WGCN, WGCN_embedding_classifier, WGCN_VocabEmbedding
__all__ = [
"MLP_1h",
"MLP_2h",
"GCN_2Layers",
"WGCN",
"WGCN_embedding_classifier",
"WGCN_VocabEmbedding",
]
| 18.294118 | 76 | 0.713826 | """
The model package
"""
from models.gcn import GCN_2Layers
from models.mlp import MLP_1h, MLP_2h
from models.wgcn import WGCN, WGCN_embedding_classifier, WGCN_VocabEmbedding
__all__ = [
"MLP_1h",
"MLP_2h",
"GCN_2Layers",
"WGCN",
"WGCN_embedding_classifier",
"WGCN_VocabEmbedding",
]
| 0 | 0 | 0 |
0d9377f8193646dade6cba7c117254caa1149f09 | 2,746 | py | Python | day14/day14.py | andreaskaempf/adventofcode2021 | 6a72c64e8258cf4e69b5d4602ae194cd27492017 | [
"MIT"
] | null | null | null | day14/day14.py | andreaskaempf/adventofcode2021 | 6a72c64e8258cf4e69b5d4602ae194cd27492017 | [
"MIT"
] | null | null | null | day14/day14.py | andreaskaempf/adventofcode2021 | 6a72c64e8258cf4e69b5d4602ae194cd27492017 | [
"MIT"
] | null | null | null | # Advent of Code 2021, Day 14
#
# Apply character insertion rules to a sequence of characters,
# runs out of memory if you try to build up character strings,
# so had to build dictionary of pairs of characters.
#
# AK, 14/12/2021
import time
t0 = time.time()
# Input file name
f = 'sample.txt'
f = 'input.txt'
# Read ... | 26.403846 | 76 | 0.593955 | # Advent of Code 2021, Day 14
#
# Apply character insertion rules to a sequence of characters,
# runs out of memory if you try to build up character strings,
# so had to build dictionary of pairs of characters.
#
# AK, 14/12/2021
import time
t0 = time.time()
# Input file name
f = 'sample.txt'
f = 'input.txt'
# Read ... | 1,450 | 0 | 22 |
45bef6004eaadfa841b8189d4d5bb21998043cc2 | 9,636 | py | Python | train/inflammation-classifier.py | JorisRoels/mri-inflammation-prediction | 37e9d0e6f3b0a20a6b35667b1e2741b60280c2a4 | [
"MIT"
] | null | null | null | train/inflammation-classifier.py | JorisRoels/mri-inflammation-prediction | 37e9d0e6f3b0a20a6b35667b1e2741b60280c2a4 | [
"MIT"
] | null | null | null | train/inflammation-classifier.py | JorisRoels/mri-inflammation-prediction | 37e9d0e6f3b0a20a6b35667b1e2741b60280c2a4 | [
"MIT"
] | null | null | null | '''
This script illustrates training of an inflammation classifier for patches along SI joints
'''
import argparse
import os
import shutil
import pytorch_lightning as pl
from torch.utils.data import DataLoader
from neuralnets.util.io import print_frm
from neuralnets.util.tools import set_seed
from neuralnets.util.augm... | 50.450262 | 121 | 0.642798 | '''
This script illustrates training of an inflammation classifier for patches along SI joints
'''
import argparse
import os
import shutil
import pytorch_lightning as pl
from torch.utils.data import DataLoader
from neuralnets.util.io import print_frm
from neuralnets.util.tools import set_seed
from neuralnets.util.augm... | 1,450 | 0 | 46 |
fa3a4d39bf525419dd2000248d3378e487b7e58d | 51 | py | Python | examples/one/rule_1.py | ayushpallav/anthill | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | 14 | 2020-05-22T20:57:29.000Z | 2021-08-19T14:56:32.000Z | examples/one/rule_1.py | ayushpallav/apple-pie | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | 2 | 2021-01-04T05:05:08.000Z | 2021-01-04T05:11:08.000Z | examples/one/rule_1.py | ayushpallav/apple-pie | 740b8fce4281dfc4ca587c21a2d37741c649d870 | [
"MIT"
] | null | null | null | print("-----------------rule_1------------------")
| 25.5 | 50 | 0.215686 | print("-----------------rule_1------------------")
| 0 | 0 | 0 |
0cd13ee9792d2b275510c09e2c2a14904a1130ee | 456 | py | Python | web/flask_test/flask_test.py | nciefeiniu/python-test | d81fcfff8cdec724c3010d6b7a77aabad7f90595 | [
"Apache-2.0"
] | null | null | null | web/flask_test/flask_test.py | nciefeiniu/python-test | d81fcfff8cdec724c3010d6b7a77aabad7f90595 | [
"Apache-2.0"
] | null | null | null | web/flask_test/flask_test.py | nciefeiniu/python-test | d81fcfff8cdec724c3010d6b7a77aabad7f90595 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route('/hello/<name>')
@app.route('/user/<username>', methods=['POST','GET'])
@app.route('/test/<num>')
if __name__ == '__main__':
app.run()
| 20.727273 | 54 | 0.690789 | from flask import Flask
from flask import render_template
app = Flask(__name__)
@app.route('/hello/<name>')
def hello_world(name):
return render_template('hello.html', name=name)
@app.route('/user/<username>', methods=['POST','GET'])
def show_user_profile(username):
# show the user profile for that user
... | 154 | 0 | 66 |
d96b97a3673f37466a8c9eb623e60075bc2cd115 | 3,727 | py | Python | tests/propagators/test_binary_propagator.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 61 | 2017-09-27T02:50:17.000Z | 2022-03-22T12:13:37.000Z | tests/propagators/test_binary_propagator.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 82 | 2017-07-11T13:47:33.000Z | 2022-03-22T10:10:38.000Z | tests/propagators/test_binary_propagator.py | rlopes-ki/python-sensor | 07e827f9982b2a0c482e8eab82d1a420923efd5e | [
"MIT"
] | 27 | 2017-09-11T16:22:32.000Z | 2022-03-11T17:21:49.000Z | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021
from instana.propagators.binary_propagator import BinaryPropagator
from instana.span_context import SpanContext
import unittest
| 51.054795 | 114 | 0.622485 | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2021
from instana.propagators.binary_propagator import BinaryPropagator
from instana.span_context import SpanContext
import unittest
class TestBinaryPropagator(unittest.TestCase):
def setUp(self):
self.bp = BinaryPropagator()
def test_injec... | 3,270 | 25 | 238 |
0e2ca74fbdb064638c6b006fa12bbc8faacd1af7 | 618 | py | Python | pyBoard v1.1(STM32F405)/3.拓展实验/2.RGB灯带/main.py | 01studio-lab/MicroPython_Examples | f06a1bee398674ceafebed2aac88d8413cc8abad | [
"MIT"
] | 73 | 2020-05-02T13:48:27.000Z | 2022-03-26T13:15:10.000Z | pyBoard v1.1(STM32F405)/3.拓展实验/2.RGB灯带/main.py | 01studio-lab/MicroPython_Examples | f06a1bee398674ceafebed2aac88d8413cc8abad | [
"MIT"
] | null | null | null | pyBoard v1.1(STM32F405)/3.拓展实验/2.RGB灯带/main.py | 01studio-lab/MicroPython_Examples | f06a1bee398674ceafebed2aac88d8413cc8abad | [
"MIT"
] | 50 | 2020-05-15T13:57:28.000Z | 2022-03-30T14:03:33.000Z |
'''
实验名称:RGB灯带
版本:v1.0
日期:2019.7
作者:01Studio
说明:RGB灯带控制。
'''
from ws2812 import WS2812
from colors import *
from machine import Pin
import pyb
#定义灯带连接引脚,Y11接口
LED = Pin('Y11',Pin.OUT,value=0)
#构建RGB灯带对象,定义控制引脚和灯珠数量
strip = WS2812(spi_bus=LED, led_count=30)
#灯带填色函数,灯珠数量为led_count
#清空RGB灯带颜色
strip.show(fill_color(E... | 15.073171 | 41 | 0.699029 |
'''
实验名称:RGB灯带
版本:v1.0
日期:2019.7
作者:01Studio
说明:RGB灯带控制。
'''
from ws2812 import WS2812
from colors import *
from machine import Pin
import pyb
#定义灯带连接引脚,Y11接口
LED = Pin('Y11',Pin.OUT,value=0)
#构建RGB灯带对象,定义控制引脚和灯珠数量
strip = WS2812(spi_bus=LED, led_count=30)
#灯带填色函数,灯珠数量为led_count
def fill_color(color):
data=[]
... | 94 | 0 | 22 |
fcccc0b2a1e1b7db9084f5867072305324db2292 | 5,307 | py | Python | test/test_prettyprinter.py | plotnick/prettyprinter | edde630011ad5eada6476366a2b2da422f4a9d74 | [
"MIT"
] | null | null | null | test/test_prettyprinter.py | plotnick/prettyprinter | edde630011ad5eada6476366a2b2da422f4a9d74 | [
"MIT"
] | null | null | null | test/test_prettyprinter.py | plotnick/prettyprinter | edde630011ad5eada6476366a2b2da422f4a9d74 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import unittest
from cStringIO import StringIO
from format import format
from prettyprinter import *
from bindings import bindings
import printervars
if __name__ == "__main__":
unittest.main()
| 34.914474 | 80 | 0.44658 | from __future__ import with_statement
import unittest
from cStringIO import StringIO
from format import format
from prettyprinter import *
from bindings import bindings
import printervars
class PrettyPrinterTest(unittest.TestCase):
roads = ["Elm", "Cottonwood"]
town = ["Boston"]
def ppEquals(self, result,... | 4,727 | 321 | 23 |
d520b024353774f21173e09b7db4a18cc61c1f22 | 11,522 | py | Python | updates.py | stephenangelico/shed | 9df18b1681366c1add9de0ec1abb4b85e1c99300 | [
"MIT"
] | 12 | 2015-01-12T15:44:46.000Z | 2020-07-10T06:35:36.000Z | updates.py | stephenangelico/shed | 9df18b1681366c1add9de0ec1abb4b85e1c99300 | [
"MIT"
] | 2 | 2021-11-06T02:09:30.000Z | 2022-01-23T07:22:09.000Z | updates.py | stephenangelico/shed | 9df18b1681366c1add9de0ec1abb4b85e1c99300 | [
"MIT"
] | 8 | 2016-10-12T20:17:10.000Z | 2022-03-26T08:18:34.000Z | #!/usr/bin/python3
# requires system Python and the python3-apt package
import textwrap
from collections import OrderedDict # Starting with Python 3.7, we could just use vanilla dicts
import apt # ImportError? apt install python3-apt
HELP_INFO = """Top-level package manager
This tool lists all packages that aren't ma... | 41.297491 | 126 | 0.67523 | #!/usr/bin/python3
# requires system Python and the python3-apt package
import textwrap
from collections import OrderedDict # Starting with Python 3.7, we could just use vanilla dicts
import apt # ImportError? apt install python3-apt
def describe(pkg):
# Python 3.7 equivalent:
# return {"Name": pkg.name, "Installed"... | 1,846 | 0 | 115 |
e2c8923a8f3465ac1f6e6f808251f566f4c248ff | 4,987 | py | Python | model.py | govinsprabhu/Behavioral_Cloning | 6b4bf27e6669707824aaa73b83b8da9e5a1d18b8 | [
"MIT"
] | null | null | null | model.py | govinsprabhu/Behavioral_Cloning | 6b4bf27e6669707824aaa73b83b8da9e5a1d18b8 | [
"MIT"
] | null | null | null | model.py | govinsprabhu/Behavioral_Cloning | 6b4bf27e6669707824aaa73b83b8da9e5a1d18b8 | [
"MIT"
] | null | null | null | import csv
import cv2
import numpy as np
from keras.models import Sequential, load_model
from keras.layers import Flatten, Dense, Lambda, Cropping2D, Dropout
from keras.layers.convolutional import Conv2D
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
lines = []
path = 'C:/... | 35.119718 | 173 | 0.648286 | import csv
import cv2
import numpy as np
from keras.models import Sequential, load_model
from keras.layers import Flatten, Dense, Lambda, Cropping2D, Dropout
from keras.layers.convolutional import Conv2D
from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
lines = []
def get_data(p... | 3,725 | 0 | 68 |
f7907661b240e64761abf5f915f0c3ced1efa2dc | 8,462 | py | Python | sharper/flaskapp/helper.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | sharper/flaskapp/helper.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | sharper/flaskapp/helper.py | sluggard6/bgirl | 3c9fa895189ef16442694830d0c05cf60ee5187b | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
"""
flskapp/helper.py
~~~~~~~~~~~~~~
Flask框架帮助方法
"""
import os
from random import randint
import traceback
import urllib2
from sharper.util.string import random_number
from flask import get_flashed_messages, request, jsonify, current_app, logging, session
import sys
from ..lib.error ... | 24.527536 | 107 | 0.60494 | # -*- coding:utf-8 -*-
"""
flskapp/helper.py
~~~~~~~~~~~~~~
Flask框架帮助方法
"""
import os
from random import randint
import traceback
import urllib2
from sharper.util.string import random_number
from flask import get_flashed_messages, request, jsonify, current_app, logging, session
import sys
from ..lib.error ... | 3,805 | 0 | 552 |
95ceeda69677ea47c26fa6c65cda51757e65fe34 | 10,410 | py | Python | src/modify_log.py | mattiafrak/Processes-Predictions-with-MP-A-Priori-Knowledge | 7e1bb94bb2fc535972a351f543be4f0ad8475275 | [
"MIT"
] | null | null | null | src/modify_log.py | mattiafrak/Processes-Predictions-with-MP-A-Priori-Knowledge | 7e1bb94bb2fc535972a351f543be4f0ad8475275 | [
"MIT"
] | null | null | null | src/modify_log.py | mattiafrak/Processes-Predictions-with-MP-A-Priori-Knowledge | 7e1bb94bb2fc535972a351f543be4f0ad8475275 | [
"MIT"
] | null | null | null | """
Here timestamps are updated in order to have elapsed times following a particular pattern/rule
Author: Mattia Fraccaro
"""
import csv
import time
from datetime import datetime, timedelta
from random import *
| 47.534247 | 173 | 0.397214 | """
Here timestamps are updated in order to have elapsed times following a particular pattern/rule
Author: Mattia Fraccaro
"""
import csv
import time
from datetime import datetime, timedelta
from random import *
class ModifyLog:
log_name = '50x5_3W'
difflist = []
timestamps_list = []
csvfile = open... | 0 | 10,173 | 23 |
555ed55160246b66953bd0e607e4ba2a8294241c | 4,630 | py | Python | bq_data_access/v1/pairwise.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 13 | 2016-01-14T02:43:10.000Z | 2020-11-25T20:43:05.000Z | bq_data_access/v1/pairwise.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 84 | 2015-11-20T02:03:33.000Z | 2021-10-14T19:24:24.000Z | bq_data_access/v1/pairwise.py | isb-cgc/ISB-CGC-Webapp | 52ed5366ee295e938108a4687bad551a8dee6b34 | [
"Apache-2.0"
] | 5 | 2015-11-25T19:29:53.000Z | 2019-09-04T17:37:52.000Z | #
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 ... | 31.712329 | 88 | 0.649892 | #
# Copyright 2015-2019, Institute for Systems Biology
#
# 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 ... | 3,304 | 173 | 72 |
560c7f23e196225c88dd9191928c23898f056340 | 2,347 | py | Python | tests/TestModules/HExample_model.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 3 | 2017-06-02T19:26:27.000Z | 2021-06-14T04:25:45.000Z | tests/TestModules/HExample_model.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 8 | 2016-08-24T07:04:07.000Z | 2017-05-26T16:22:47.000Z | tests/TestModules/HExample_model.py | levilucio/SyVOLT | 7526ec794d21565e3efcc925a7b08ae8db27d46a | [
"MIT"
] | 1 | 2019-10-31T06:00:23.000Z | 2019-10-31T06:00:23.000Z |
from core.himesis import Himesis
import cPickle as pickle
from uuid import UUID
| 39.779661 | 90 | 0.536003 |
from core.himesis import Himesis
import cPickle as pickle
from uuid import UUID
class HExample_model(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HExample_model.
"""
# Flag this instance as compiled now
self.is_compiled = True
... | 0 | 2,241 | 23 |
7b1d970012536ca4aca54342f04b8d16bdf1ea02 | 783 | py | Python | tests/test_hover.py | ponty/discogui | c3dda104bcf5188252848938b2ebdaeeae4d1470 | [
"BSD-2-Clause"
] | 5 | 2018-11-19T14:35:28.000Z | 2020-01-20T17:18:30.000Z | tests/test_hover.py | ponty/discogui | c3dda104bcf5188252848938b2ebdaeeae4d1470 | [
"BSD-2-Clause"
] | null | null | null | tests/test_hover.py | ponty/discogui | c3dda104bcf5188252848938b2ebdaeeae4d1470 | [
"BSD-2-Clause"
] | null | null | null | from easyprocess import EasyProcess
from pyvirtualdisplay.smartdisplay import SmartDisplay
from discogui.hover import active_rectangles
| 27 | 66 | 0.592593 | from easyprocess import EasyProcess
from pyvirtualdisplay.smartdisplay import SmartDisplay
from discogui.hover import active_rectangles
def test_zenity():
with SmartDisplay() as disp:
with EasyProcess(["zenity", "--warning"]):
disp.waitgrab()
ls = active_rectangles()
a... | 574 | 0 | 69 |
100c4a9136eb4bb23e2157a31502b9018a9a3418 | 17,040 | py | Python | tickettemplate/ttadmin.py | t-kenji/trac-ticket-template-plugin | 71f58052eb555393922da0d8295454cad6a3bce0 | [
"BSD-3-Clause"
] | null | null | null | tickettemplate/ttadmin.py | t-kenji/trac-ticket-template-plugin | 71f58052eb555393922da0d8295454cad6a3bce0 | [
"BSD-3-Clause"
] | null | null | null | tickettemplate/ttadmin.py | t-kenji/trac-ticket-template-plugin | 71f58052eb555393922da0d8295454cad6a3bce0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Richard Liao <richard.liao.i@gmail.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from __future__ import with_statement
import inspect
import textwrap
impor... | 33.742574 | 83 | 0.564906 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2013 Richard Liao <richard.liao.i@gmail.com>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
from __future__ import with_statement
import inspect
import textwrap
impor... | 7,111 | 8,580 | 23 |
79f1e8f31fc56c489b60eecbe30ff8b8e3035435 | 1,383 | py | Python | test-sum.py | eliteraspberries/python-libnu | 869945fc3f0d4c7ebbc9a4e66f3aa6700472b0f3 | [
"0BSD"
] | null | null | null | test-sum.py | eliteraspberries/python-libnu | 869945fc3f0d4c7ebbc9a4e66f3aa6700472b0f3 | [
"0BSD"
] | null | null | null | test-sum.py | eliteraspberries/python-libnu | 869945fc3f0d4c7ebbc9a4e66f3aa6700472b0f3 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python
import functools
import numpy
import hypothesis
import hypothesis.extra.numpy
import hypothesis.strategies
import libnu.sum
from test import eq
arrays = functools.partial(
hypothesis.extra.numpy.arrays,
dtype=numpy.float32,
unique=True,
)
floats = hypothesis.strategies.floats(-1.0... | 23.844828 | 65 | 0.677513 | #!/usr/bin/env python
import functools
import numpy
import hypothesis
import hypothesis.extra.numpy
import hypothesis.strategies
import libnu.sum
from test import eq
arrays = functools.partial(
hypothesis.extra.numpy.arrays,
dtype=numpy.float32,
unique=True,
)
floats = hypothesis.strategies.floats(-1.0... | 577 | 0 | 88 |