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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
53735060a44421f6599286e1ee690d79eff0b6dd | 1,544 | py | Python | 0_python/06_while.py | ProGabe/teals | 7ebf0b6e6f81d8a4c44baa7b5d3a9d95267ec1e3 | [
"MIT"
] | null | null | null | 0_python/06_while.py | ProGabe/teals | 7ebf0b6e6f81d8a4c44baa7b5d3a9d95267ec1e3 | [
"MIT"
] | 9 | 2019-11-21T13:12:47.000Z | 2021-02-02T14:52:52.000Z | 0_python/06_while.py | ProGabe/teals | 7ebf0b6e6f81d8a4c44baa7b5d3a9d95267ec1e3 | [
"MIT"
] | 2 | 2021-01-25T03:38:30.000Z | 2021-03-07T23:54:53.000Z | '''
Comparisons and boolean are important, and they will continue to be throughout all your
programming tasks.
The while loop allows you to continue to execute statements 'while' some condition is true.
while <expr> :
<statements>
<expr> here is just like in the if statement. It needs ... | 31.510204 | 100 | 0.693653 | '''
Comparisons and boolean are important, and they will continue to be throughout all your
programming tasks.
The while loop allows you to continue to execute statements 'while' some condition is true.
while <expr> :
<statements>
<expr> here is just like in the if statement. It needs ... | 0 | 0 | 0 |
2ef7830e6a0ad2802cf80b19922ebd149f65ef83 | 8,443 | py | Python | practical_exam/exam_scheduling/migrations/0001_initial.py | SanchithHegde/university-practical-exam | 3633a92ea7fd9d74c84d3ff9603aca22e351df56 | [
"Apache-2.0",
"MIT"
] | null | null | null | practical_exam/exam_scheduling/migrations/0001_initial.py | SanchithHegde/university-practical-exam | 3633a92ea7fd9d74c84d3ff9603aca22e351df56 | [
"Apache-2.0",
"MIT"
] | 7 | 2020-12-28T08:42:33.000Z | 2022-03-28T07:57:29.000Z | practical_exam/exam_scheduling/migrations/0001_initial.py | SanchithHegde/university-practical-exam | 3633a92ea7fd9d74c84d3ff9603aca22e351df56 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-12-29T13:34:29.000Z | 2020-12-29T13:34:29.000Z | # Generated by Django 3.1.3 on 2020-11-28 17:56
from django.db import migrations, models
import django.db.models.deletion
| 54.121795 | 202 | 0.618145 | # Generated by Django 3.1.3 on 2020-11-28 17:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='College',
fields=[
... | 0 | 8,296 | 23 |
4f24df8bfd2d16486964c8f19407870f55b665c5 | 282 | py | Python | examples/basics/ex_color_image.py | indigits/indigits-vision | 317fbf70c558e8f9563c3d0ba3bebbc5f84af622 | [
"Apache-2.0"
] | 2 | 2021-11-02T10:09:47.000Z | 2021-12-10T04:23:14.000Z | examples/basics/ex_color_image.py | indigits/indigits-vision | 317fbf70c558e8f9563c3d0ba3bebbc5f84af622 | [
"Apache-2.0"
] | null | null | null | examples/basics/ex_color_image.py | indigits/indigits-vision | 317fbf70c558e8f9563c3d0ba3bebbc5f84af622 | [
"Apache-2.0"
] | null | null | null | '''
Shows how to create single color images
'''
import cv2
from cr import vision as vision
image = vision.single_color_image(500, 500, vision.GOLD)
cv2.imshow('image', image)
cv2.waitKey()
image = vision.single_color_image(500, 500, 128)
cv2.imshow('image', image)
cv2.waitKey()
| 18.8 | 56 | 0.741135 | '''
Shows how to create single color images
'''
import cv2
from cr import vision as vision
image = vision.single_color_image(500, 500, vision.GOLD)
cv2.imshow('image', image)
cv2.waitKey()
image = vision.single_color_image(500, 500, 128)
cv2.imshow('image', image)
cv2.waitKey()
| 0 | 0 | 0 |
d41d9957cc7391d82ab7d8df423136d9fff41011 | 187 | py | Python | check_fib.py | chidanandpujar/python_pyez_scripts | 55beba4528c41b747508a0187c0438081ebde5b0 | [
"Unlicense"
] | null | null | null | check_fib.py | chidanandpujar/python_pyez_scripts | 55beba4528c41b747508a0187c0438081ebde5b0 | [
"Unlicense"
] | null | null | null | check_fib.py | chidanandpujar/python_pyez_scripts | 55beba4528c41b747508a0187c0438081ebde5b0 | [
"Unlicense"
] | null | null | null |
if __name__ == "__main__":
n = int(input("Entert the Fibonacci range:"))
check_fib(n) | 18.7 | 50 | 0.508021 | def check_fib(n):
a,b=0,1
while(b<=n):
print(b);
a,b=b,a+b
if __name__ == "__main__":
n = int(input("Entert the Fibonacci range:"))
check_fib(n) | 65 | 0 | 23 |
e9b1fe2c416081d49c6cee76351d3abbeff04eb5 | 1,481 | py | Python | GUI/cure/app/auth.py | bofh-m3/CURE | 85cc6c479f8c693385730bc230648d2962ed96a7 | [
"MIT"
] | 1 | 2021-03-12T15:57:49.000Z | 2021-03-12T15:57:49.000Z | GUI/cure/app/auth.py | bofh-m3/CURE | 85cc6c479f8c693385730bc230648d2962ed96a7 | [
"MIT"
] | null | null | null | GUI/cure/app/auth.py | bofh-m3/CURE | 85cc6c479f8c693385730bc230648d2962ed96a7 | [
"MIT"
] | 2 | 2019-12-16T13:26:24.000Z | 2021-12-21T12:45:52.000Z | from ldap3 import Server, Connection, ALL
from datetime import datetime as livetime
from app.models import User
| 37.025 | 155 | 0.584065 | from ldap3 import Server, Connection, ALL
from datetime import datetime as livetime
from app.models import User
def login_check(username, password):
try:
domain_username = 'xx\\{}'.format(username)
search_base = 'DC=xx,DC=yy'
search_filter = "(&(objectClass=user)(sAMAccountName={}... | 1,339 | 0 | 25 |
ec22886012b390072d7ced81894b2097f0da2eb0 | 8,813 | py | Python | src/evensampling/sampler.py | theosanderson/evensampling | baf0722093f44b5b8fbca7a27cec27c01fb9fb28 | [
"MIT"
] | null | null | null | src/evensampling/sampler.py | theosanderson/evensampling | baf0722093f44b5b8fbca7a27cec27c01fb9fb28 | [
"MIT"
] | null | null | null | src/evensampling/sampler.py | theosanderson/evensampling | baf0722093f44b5b8fbca7a27cec27c01fb9fb28 | [
"MIT"
] | null | null | null | from ortools.sat.python import cp_model
import pandas as pd
from collections import defaultdict
import sys
log = ""
| 47.38172 | 155 | 0.702598 | from ortools.sat.python import cp_model
import pandas as pd
from collections import defaultdict
import sys
log = ""
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
global log
log = log +"\n" + " ".join(args)
class Variables(object):
pass
class Input(object):
pass
class Opt... | 7,081 | 1,499 | 114 |
44e017fef8f4110d495a6279d3eb601c90e7185e | 1,332 | py | Python | tests/hypotests/test_parameters.py | scikit-hep/statutils | 636d305c1e9d76dea2613ac0ce085789821ee9ad | [
"BSD-3-Clause"
] | 36 | 2019-11-28T10:28:17.000Z | 2022-03-12T02:12:26.000Z | tests/hypotests/test_parameters.py | scikit-hep/hepstats | 76361cabbf3810ea9a951bb90dc45e17ff464406 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 31 | 2019-11-21T13:35:10.000Z | 2022-01-05T16:17:33.000Z | tests/hypotests/test_parameters.py | scikit-hep/hepstats | 76361cabbf3810ea9a951bb90dc45e17ff464406 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 3 | 2020-03-22T13:28:01.000Z | 2021-08-29T05:13:28.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import zfit
from hepstats.hypotests.parameters import POI, POIarray
| 21.142857 | 55 | 0.566817 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
import numpy as np
import zfit
from hepstats.hypotests.parameters import POI, POIarray
def test_pois():
mean = zfit.Parameter("mu", 1.2, 0.1, 2)
p0 = POI(mean, 0)
p1 = POI(mean, 1.0)
values = np.linspace(0.0, 1.0, 10)
pn = POIarray(mean, v... | 1,164 | 0 | 23 |
f626b1e2c602b892540f6932da70649ff2dad5bd | 176 | py | Python | transformer_2/layers/__init__.py | mingruimingrui/Transformer2 | 2b44289ee7c7312d699f2261c1e4ebccce0f21e2 | [
"MIT"
] | null | null | null | transformer_2/layers/__init__.py | mingruimingrui/Transformer2 | 2b44289ee7c7312d699f2261c1e4ebccce0f21e2 | [
"MIT"
] | 1 | 2020-06-01T02:13:10.000Z | 2020-06-01T02:13:10.000Z | transformer_2/layers/__init__.py | mingruimingrui/Transformer2 | 2b44289ee7c7312d699f2261c1e4ebccce0f21e2 | [
"MIT"
] | null | null | null | from transformer_2.layers.multihead_attention import MultiheadAttention
from transformer_2.layers.transistor import Transistor
__all__ = ['MultiheadAttention', 'Transistor']
| 29.333333 | 71 | 0.852273 | from transformer_2.layers.multihead_attention import MultiheadAttention
from transformer_2.layers.transistor import Transistor
__all__ = ['MultiheadAttention', 'Transistor']
| 0 | 0 | 0 |
af6c70822c84b21709be983f75787f7f4d18d3e6 | 650 | py | Python | solutions/python/2017/compareIntegers.py | lucifer1198/Codesignal | 07d6d6457b8b3a9f1c51118b0e8e44cce66ee039 | [
"MIT"
] | 2 | 2020-12-21T22:09:26.000Z | 2021-01-01T15:40:01.000Z | solutions/python/2017/compareIntegers.py | nsu1210/Codesignal | 07d6d6457b8b3a9f1c51118b0e8e44cce66ee039 | [
"MIT"
] | null | null | null | solutions/python/2017/compareIntegers.py | nsu1210/Codesignal | 07d6d6457b8b3a9f1c51118b0e8e44cce66ee039 | [
"MIT"
] | 1 | 2021-01-28T18:15:02.000Z | 2021-01-28T18:15:02.000Z | """
Compare two integers given as strings.
Example
For a = "12" and b = "13", the output should be
compareIntegers(a, b) = "less";
For a = "875" and b = "799", the output should be
compareIntegers(a, b) = "greater";
For a = "1000" and b = "1000", the output should be
compareIntegers(a, b) = "equal".
"""
| 20.3125 | 64 | 0.572308 | """
Compare two integers given as strings.
Example
For a = "12" and b = "13", the output should be
compareIntegers(a, b) = "less";
For a = "875" and b = "799", the output should be
compareIntegers(a, b) = "greater";
For a = "1000" and b = "1000", the output should be
compareIntegers(a, b) = "equal".
"""
def compare... | 295 | 0 | 46 |
ab255686cadd6df0238a81a0ddc3afea306d18f0 | 6,927 | py | Python | back/flaskProject/src/nytimes_api.py | johnymarin/finance-news | 79aa805247196a37ad202465d212254c147d30f3 | [
"MIT"
] | null | null | null | back/flaskProject/src/nytimes_api.py | johnymarin/finance-news | 79aa805247196a37ad202465d212254c147d30f3 | [
"MIT"
] | null | null | null | back/flaskProject/src/nytimes_api.py | johnymarin/finance-news | 79aa805247196a37ad202465d212254c147d30f3 | [
"MIT"
] | null | null | null | # This code parses date/times, so please
#
# pip install python-dateutil
#
# To use this code, make sure you
#
# import json
#
# and then, to convert JSON from a string, do
#
# result = article_model_from_dict(json.loads(json_string))
from enum import Enum
from dataclasses import dataclass
from typing impo... | 31.921659 | 228 | 0.654107 | # This code parses date/times, so please
#
# pip install python-dateutil
#
# To use this code, make sure you
#
# import json
#
# and then, to convert JSON from a string, do
#
# result = article_model_from_dict(json.loads(json_string))
from enum import Enum
from dataclasses import dataclass
from typing impo... | 4,936 | 1,125 | 342 |
d7c79e6dae51cb0161b8b1bc1e2b55fb03db60de | 21 | py | Python | src/geocurrency/core/settings.py | OpenPrunus/geocurrency | 23cc075377d47ac631634cd71fd0e7d6b0a57bad | [
"MIT"
] | 5 | 2021-01-28T16:45:49.000Z | 2021-08-15T06:47:17.000Z | src/geocurrency/core/settings.py | OpenPrunus/geocurrency | 23cc075377d47ac631634cd71fd0e7d6b0a57bad | [
"MIT"
] | 8 | 2020-10-01T15:12:45.000Z | 2021-10-05T14:45:33.000Z | src/geocurrency/core/settings.py | OpenPrunus/geocurrency | 23cc075377d47ac631634cd71fd0e7d6b0a57bad | [
"MIT"
] | 2 | 2021-01-28T16:43:16.000Z | 2021-10-05T14:25:25.000Z | MAX_PAGE_SIZE = 1000
| 10.5 | 20 | 0.809524 | MAX_PAGE_SIZE = 1000
| 0 | 0 | 0 |
f397c395f7d81787db1aff5190abe273b30f066d | 9,185 | py | Python | python/subactivity_lstm.py | atul107/grammar-activity-prediction | 983f973717884a60ef4b4ecb7bf56e671aefb332 | [
"MIT"
] | 20 | 2018-02-23T02:51:00.000Z | 2021-05-25T20:32:43.000Z | python/subactivity_lstm.py | atul107/grammar-activity-prediction | 983f973717884a60ef4b4ecb7bf56e671aefb332 | [
"MIT"
] | 3 | 2019-01-21T07:40:46.000Z | 2019-10-19T18:47:09.000Z | python/subactivity_lstm.py | RomeroBarata/grammar-activity-prediction | 983f973717884a60ef4b4ecb7bf56e671aefb332 | [
"MIT"
] | 7 | 2018-02-23T16:08:46.000Z | 2021-01-25T04:48:19.000Z | """
Created on Feb 27, 2017
@author: Siyuan Huang
Training and Testing Code for Subactivity LSTM
"""
from __future__ import print_function
import numpy as np
import json
import h5py
import glob
import scipy.io
import os
from keras.preprocessing import sequence
from keras.preprocessing.image import ImageDataGenerato... | 40.10917 | 125 | 0.67534 | """
Created on Feb 27, 2017
@author: Siyuan Huang
Training and Testing Code for Subactivity LSTM
"""
from __future__ import print_function
import numpy as np
import json
import h5py
import glob
import scipy.io
import os
from keras.preprocessing import sequence
from keras.preprocessing.image import ImageDataGenerato... | 8,332 | 0 | 184 |
ac9be42efa50a2b269ab3e80ffad7871b5abea1c | 2,936 | py | Python | sdk/python/pulumi_azure/apimanagement/api.py | Frassle/pulumi-azure | 593dd1020b09b83422928913d06bf91538926155 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/apimanagement/api.py | Frassle/pulumi-azure | 593dd1020b09b83422928913d06bf91538926155 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/apimanagement/api.py | Frassle/pulumi-azure | 593dd1020b09b83422928913d06bf91538926155 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
from .. import utilities, tables
class API(pulumi.CustomResource):
"""
Manages an API Mana... | 36.7 | 304 | 0.679496 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import pulumi
import pulumi.runtime
from .. import utilities, tables
class API(pulumi.CustomResource):
"""
Manages an API Mana... | 175 | 0 | 54 |
74882e7b15d7e82ec405efce346bea93ba3ab0c6 | 40 | py | Python | crawler/twitter/__init__.py | deepettas/algotrading-api | 264f53973d323a4165f080f4fa9247c1d9faa0bd | [
"MIT"
] | 1 | 2019-09-16T13:23:44.000Z | 2019-09-16T13:23:44.000Z | crawler/twitter/__init__.py | deepettas/algotrading-api | 264f53973d323a4165f080f4fa9247c1d9faa0bd | [
"MIT"
] | null | null | null | crawler/twitter/__init__.py | deepettas/algotrading-api | 264f53973d323a4165f080f4fa9247c1d9faa0bd | [
"MIT"
] | 1 | 2019-09-17T13:24:27.000Z | 2019-09-17T13:24:27.000Z | from .crawler import start_tweet_crawler | 40 | 40 | 0.9 | from .crawler import start_tweet_crawler | 0 | 0 | 0 |
c5266d4250e9b5166a7a6adfe81befd18b722ba0 | 795 | py | Python | backend/migrations/versions/123ewrwerwe.py | Sean1572/audino | d234ba9027ce86d62156234aa925cc698e9f949a | [
"MIT"
] | null | null | null | backend/migrations/versions/123ewrwerwe.py | Sean1572/audino | d234ba9027ce86d62156234aa925cc698e9f949a | [
"MIT"
] | 35 | 2020-12-21T23:42:01.000Z | 2021-02-07T10:28:52.000Z | backend/migrations/versions/123ewrwerwe.py | Sean1572/audino | d234ba9027ce86d62156234aa925cc698e9f949a | [
"MIT"
] | null | null | null | """empty message
Revision ID: 611965970ba7
Revises: fbf389ef5017
Create Date: 2020-12-01 11:01:05.140699
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '123ewrwerwe'
down_revision = '611965970ba7'
branch_labels = None
depends_on = None
| 24.84375 | 83 | 0.695597 | """empty message
Revision ID: 611965970ba7
Revises: fbf389ef5017
Create Date: 2020-12-01 11:01:05.140699
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '123ewrwerwe'
down_revision = '611965970ba7'
branch_labels = None
depends_on = None
def upgrade():
# #... | 451 | 0 | 46 |
d64458a23d19d3bc1590b839d00d22a2602f40d0 | 929 | py | Python | pycaret/tests/test_nlp.py | fanugroho/pycaret | ea79606035488aa9b4f3978b9446630094be52f1 | [
"MIT"
] | null | null | null | pycaret/tests/test_nlp.py | fanugroho/pycaret | ea79606035488aa9b4f3978b9446630094be52f1 | [
"MIT"
] | null | null | null | pycaret/tests/test_nlp.py | fanugroho/pycaret | ea79606035488aa9b4f3978b9446630094be52f1 | [
"MIT"
] | null | null | null | import os, sys
sys.path.insert(0, os.path.abspath(".."))
import pytest
import pycaret.nlp
import pycaret.datasets
if __name__ == "__main__":
test()
| 21.113636 | 74 | 0.638321 | import os, sys
sys.path.insert(0, os.path.abspath(".."))
import pytest
import pycaret.nlp
import pycaret.datasets
def test():
# loading dataset
data = pycaret.datasets.get_data('kiva')
data = data.head(1000)
# init setup
nlp1 = pycaret.nlp.setup(data = data, target = 'en', session_id = 123)
... | 748 | 0 | 23 |
907c52573da4b45cb640fcfb3ddb635f7c4c26cd | 46,031 | py | Python | tests/integration/roster/test_mlb_roster.py | atklaus/sportsreference | 22a45ea83ce1608c3176f00d4f414d5b9463605c | [
"MIT"
] | null | null | null | tests/integration/roster/test_mlb_roster.py | atklaus/sportsreference | 22a45ea83ce1608c3176f00d4f414d5b9463605c | [
"MIT"
] | null | null | null | tests/integration/roster/test_mlb_roster.py | atklaus/sportsreference | 22a45ea83ce1608c3176f00d4f414d5b9463605c | [
"MIT"
] | null | null | null | # coding=utf-8
import mock
import os
import pandas as pd
import pytest
from flexmock import flexmock
from sportsreference import utils
from sportsreference.mlb.roster import Player, Roster
from sportsreference.mlb.teams import Team
YEAR = 2017
| 36.61973 | 78 | 0.509027 | # coding=utf-8
import mock
import os
import pandas as pd
import pytest
from flexmock import flexmock
from sportsreference import utils
from sportsreference.mlb.roster import Player, Roster
from sportsreference.mlb.teams import Team
YEAR = 2017
def read_file(filename):
filepath = os.path.join(os.path.dirname(__f... | 44,621 | 1,031 | 138 |
b2a326780aa13035ef8756c3c4f4672a9ff5edbb | 1,489 | py | Python | instruments/hp_4395A.py | Vrekrer/magdynlab | f5149d3213a37c7c18f39876c3e2367fc7deb9e8 | [
"MIT"
] | 6 | 2015-08-02T03:02:55.000Z | 2022-01-30T18:32:49.000Z | instruments/hp_4395A.py | Vrekrer/magdynlab | f5149d3213a37c7c18f39876c3e2367fc7deb9e8 | [
"MIT"
] | null | null | null | instruments/hp_4395A.py | Vrekrer/magdynlab | f5149d3213a37c7c18f39876c3e2367fc7deb9e8 | [
"MIT"
] | 4 | 2017-07-06T16:29:53.000Z | 2020-09-13T00:09:54.000Z | # coding=utf-8
# Author: Diego González Chávez
# email : diegogch@cbpf.br / diego.gonzalez.chavez@gmail.com
#
# This class controls the:
# Network/Spectrum/Impedance Analyzer
# HP / Agilent : 4395A
#
# TODO:
# Clean code
# Make documentation
import time as _time
import numpy as _np
from .instruments_base import Instr... | 28.634615 | 76 | 0.64137 | # coding=utf-8
# Author: Diego González Chávez
# email : diegogch@cbpf.br / diego.gonzalez.chavez@gmail.com
#
# This class controls the:
# Network/Spectrum/Impedance Analyzer
# HP / Agilent : 4395A
#
# TODO:
# Clean code
# Make documentation
import time as _time
import numpy as _np
from .instruments_base import Instr... | 899 | 11 | 138 |
881d4d17d563fd5580d8b1a2bfc7c58b30a69ea7 | 5,708 | py | Python | source/astroNS/nodes/core/network/processor.py | pyastroNS/astroNS | 35687267179467e4cb7ea59ac119c5f0f182107f | [
"MIT"
] | null | null | null | source/astroNS/nodes/core/network/processor.py | pyastroNS/astroNS | 35687267179467e4cb7ea59ac119c5f0f182107f | [
"MIT"
] | null | null | null | source/astroNS/nodes/core/network/processor.py | pyastroNS/astroNS | 35687267179467e4cb7ea59ac119c5f0f182107f | [
"MIT"
] | null | null | null | """
Processor is a node that calculates how long it takes to process a message.
"""
import pandas as pd
import uuid
from heapq import heappush, heappop
from numpy import random
from simpy.core import Environment
from nodes.core.base import BaseNode
from typing import Dict, List, Tuple, Any, Callable, Optional, Union... | 39.638889 | 137 | 0.557288 | """
Processor is a node that calculates how long it takes to process a message.
"""
import pandas as pd
import uuid
from heapq import heappush, heappop
from numpy import random
from simpy.core import Environment
from nodes.core.base import BaseNode
from typing import Dict, List, Tuple, Any, Callable, Optional, Union... | 0 | 0 | 0 |
e26133561a6a1fbea9a0c907133569d903786fa4 | 749 | py | Python | ex102.py | ezequielwish/Python3 | a4489d49e6919649437cb9e682614240701e2b68 | [
"MIT"
] | 1 | 2022-01-24T02:01:32.000Z | 2022-01-24T02:01:32.000Z | ex102.py | ezequielwish/Python3 | a4489d49e6919649437cb9e682614240701e2b68 | [
"MIT"
] | null | null | null | ex102.py | ezequielwish/Python3 | a4489d49e6919649437cb9e682614240701e2b68 | [
"MIT"
] | null | null | null | # Crie um programa que tenha uma função fatorial() que receba dois parâmetros: o primeiro que indique
# o número a calcular e outro chamado show, que será um valor lógico (opcional) indicando se será
# mostrado ou não na tela o processo de cálculo do fatorial.
def factorial(number, show=False):
"""
Calcula o f... | 29.96 | 101 | 0.600801 | # Crie um programa que tenha uma função fatorial() que receba dois parâmetros: o primeiro que indique
# o número a calcular e outro chamado show, que será um valor lógico (opcional) indicando se será
# mostrado ou não na tela o processo de cálculo do fatorial.
def factorial(number, show=False):
"""
Calcula o f... | 0 | 0 | 0 |
19b856dca041dce8c861ac05d622a4a776ae4abb | 4,466 | py | Python | Python for kids a playfull introduction to programming.py | eldiego77cp/Proyectos-Python | 0c7458da77ad6ff4927b1a64af32a2b7579dab08 | [
"MIT"
] | null | null | null | Python for kids a playfull introduction to programming.py | eldiego77cp/Proyectos-Python | 0c7458da77ad6ff4927b1a64af32a2b7579dab08 | [
"MIT"
] | null | null | null | Python for kids a playfull introduction to programming.py | eldiego77cp/Proyectos-Python | 0c7458da77ad6ff4927b1a64af32a2b7579dab08 | [
"MIT"
] | null | null | null | '''
Programming Puzzles
The following are a few experiments you can try yourself. The
answers can be found at http://python-for-kids.com/.
#1: Favorites
Make a list of your favorite hobbies and give the list the variable
name games. Now make a list of your favorite foods and name the
variable foods. Join the two lists... | 23.260417 | 69 | 0.71451 | '''
Programming Puzzles
The following are a few experiments you can try yourself. The
answers can be found at http://python-for-kids.com/.
#1: Favorites
Make a list of your favorite hobbies and give the list the variable
name games. Now make a list of your favorite foods and name the
variable foods. Join the two lists... | 0 | 0 | 0 |
9474527efac6e81672b5752560074b095631b530 | 152 | py | Python | sdmxthon/__init__.py | Meaningful-Data/sdmxthon | d6c187bab1ddecf49a12bccb6bf737bc3f08ac72 | [
"Apache-2.0"
] | 1 | 2021-05-25T17:04:49.000Z | 2021-05-25T17:04:49.000Z | sdmxthon/__init__.py | Meaningful-Data/sdmxthon | d6c187bab1ddecf49a12bccb6bf737bc3f08ac72 | [
"Apache-2.0"
] | 2 | 2021-06-23T11:32:40.000Z | 2021-12-01T17:44:19.000Z | sdmxthon/__init__.py | Meaningful-Data/sdmxthon | d6c187bab1ddecf49a12bccb6bf737bc3f08ac72 | [
"Apache-2.0"
] | null | null | null | from sdmxthon.api.api import read_sdmx, get_datasets, get_pandas_df, xml_to_csv
__all__ = ['read_sdmx', 'get_datasets', 'get_pandas_df', 'xml_to_csv']
| 38 | 79 | 0.782895 | from sdmxthon.api.api import read_sdmx, get_datasets, get_pandas_df, xml_to_csv
__all__ = ['read_sdmx', 'get_datasets', 'get_pandas_df', 'xml_to_csv']
| 0 | 0 | 0 |
bb7e2900eb01ada6e415649fe237535fe71c3e2b | 1,287 | py | Python | backend/migrations/0001_initial.py | arunikayadav42/Backend | 5364884f178e2a338b321b4a63a19fbc55212fe2 | [
"MIT"
] | 2 | 2018-11-22T21:09:56.000Z | 2018-11-26T07:41:14.000Z | backend/migrations/0001_initial.py | arunikayadav42/Backend | 5364884f178e2a338b321b4a63a19fbc55212fe2 | [
"MIT"
] | 11 | 2018-10-21T03:18:55.000Z | 2022-02-10T09:34:44.000Z | backend/migrations/0001_initial.py | arunikayadav42/Backend | 5364884f178e2a338b321b4a63a19fbc55212fe2 | [
"MIT"
] | 4 | 2018-11-30T19:14:05.000Z | 2018-12-22T07:10:16.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-19 20:33
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 37.852941 | 137 | 0.618493 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-10-19 20:33
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations... | 0 | 1,044 | 23 |
17e9da9e47849dae3b304051cc092e4923a5cc81 | 3,803 | py | Python | pypy/module/__builtin__/compiling.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/module/__builtin__/compiling.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/module/__builtin__/compiling.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | """
Implementation of the interpreter-level compile/eval builtins.
"""
from pypy.interpreter.pycode import PyCode
from pypy.interpreter.baseobjspace import W_Root, ObjSpace
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import NoneNotWrapped
def compile(space, w_source, filename, mod... | 39.206186 | 77 | 0.666053 | """
Implementation of the interpreter-level compile/eval builtins.
"""
from pypy.interpreter.pycode import PyCode
from pypy.interpreter.baseobjspace import W_Root, ObjSpace
from pypy.interpreter.error import OperationError
from pypy.interpreter.gateway import NoneNotWrapped
def compile(space, w_source, filename, mod... | 0 | 0 | 0 |
42c893b813155db07feb4f8417afe80450d4d66d | 46 | py | Python | kao_romkan/__init__.py | cloew/KaoRomKan | 6f5c3ad8caef140d2ef99265fce1d5439e201d29 | [
"MIT"
] | null | null | null | kao_romkan/__init__.py | cloew/KaoRomKan | 6f5c3ad8caef140d2ef99265fce1d5439e201d29 | [
"MIT"
] | null | null | null | kao_romkan/__init__.py | cloew/KaoRomKan | 6f5c3ad8caef140d2ef99265fce1d5439e201d29 | [
"MIT"
] | null | null | null | from .rom_kan_converter import RomKanConverter | 46 | 46 | 0.913043 | from .rom_kan_converter import RomKanConverter | 0 | 0 | 0 |
05588e659c3bf8642adeb90c73dd6bf68ac4beaf | 772 | py | Python | mozdns/view/views.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 22 | 2015-01-16T01:36:32.000Z | 2020-06-08T00:46:18.000Z | mozdns/view/views.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 8 | 2015-12-28T18:56:19.000Z | 2019-04-01T17:33:48.000Z | mozdns/view/views.py | jlin/inventory | c098c98e570c3bf9fadfd811eb75e1213f6ea428 | [
"BSD-3-Clause"
] | 13 | 2015-01-13T20:56:22.000Z | 2022-02-23T06:01:17.000Z | # Create your views here.
from mozdns.views import MozdnsDeleteView
from mozdns.views import MozdnsCreateView
from mozdns.views import MozdnsDetailView
from mozdns.views import MozdnsUpdateView
from mozdns.views import MozdnsListView
from mozdns.view.models import View
from mozdns.view.forms import ViewForm
class Vi... | 21.444444 | 49 | 0.746114 | # Create your views here.
from mozdns.views import MozdnsDeleteView
from mozdns.views import MozdnsCreateView
from mozdns.views import MozdnsDetailView
from mozdns.views import MozdnsUpdateView
from mozdns.views import MozdnsListView
from mozdns.view.models import View
from mozdns.view.forms import ViewForm
class Vie... | 0 | 79 | 23 |
27572eaea555c50a9ce8333aca8a01965587bb7c | 295 | py | Python | dataTools/dataRedditRepo.py | maximkha/nlpStat | 6549dc118cbb77008769efcf6d4754a3f3cd0f60 | [
"MIT"
] | 1 | 2020-03-26T01:08:09.000Z | 2020-03-26T01:08:09.000Z | dataTools/dataRedditRepo.py | maximkha/nlpStat | 6549dc118cbb77008769efcf6d4754a3f3cd0f60 | [
"MIT"
] | null | null | null | dataTools/dataRedditRepo.py | maximkha/nlpStat | 6549dc118cbb77008769efcf6d4754a3f3cd0f60 | [
"MIT"
] | null | null | null | import csv
#DEPRECATED
# data from: https://github.com/linanqiu/reddit-dataset | 24.583333 | 55 | 0.630508 | import csv
#DEPRECATED
# data from: https://github.com/linanqiu/reddit-dataset
def get(name):
print("Getting: " + name)
lines = [l.rstrip() for l in open(name)]
reader = csv.reader(lines, skipinitialspace=True)
text = ""
for r in reader:
text += r[1]
return text | 194 | 0 | 22 |
e354330042bb894f6a890e7031e0eb7ccc53d8d9 | 1,397 | py | Python | tests/make_test_stubs.py | yoelcortes/fluids | bf0400d00ab72da52d051335be2664db3771cb11 | [
"MIT"
] | 218 | 2016-01-04T07:44:46.000Z | 2022-03-30T08:06:36.000Z | tests/make_test_stubs.py | yoelcortes/fluids | bf0400d00ab72da52d051335be2664db3771cb11 | [
"MIT"
] | 47 | 2016-04-20T06:06:10.000Z | 2022-03-04T14:45:39.000Z | tests/make_test_stubs.py | yoelcortes/fluids | bf0400d00ab72da52d051335be2664db3771cb11 | [
"MIT"
] | 65 | 2016-01-29T03:28:01.000Z | 2022-01-26T16:17:05.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
tests = ['test_drag', 'test_control_valve', 'test_two_phase', 'test_two_phase_voidage', 'test_separator', 'test_piping', 'test_packed_bed', 'test_compressible', 'test_core', 'test_safety_valve', 'test_open_flow', 'test_filters', 'test_flow_meter', 'te... | 39.914286 | 436 | 0.685039 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
tests = ['test_drag', 'test_control_valve', 'test_two_phase', 'test_two_phase_voidage', 'test_separator', 'test_piping', 'test_packed_bed', 'test_compressible', 'test_core', 'test_safety_valve', 'test_open_flow', 'test_filters', 'test_flow_meter', 'te... | 0 | 0 | 0 |
771af2fe0282930c4667fd9094eab037eaadcad4 | 3,221 | py | Python | admin/test_bioreflib.py | eli-cipriano/BioRefine | aeb427e8f42b74cd36a38937a8e1408ba1ae872c | [
"MIT"
] | null | null | null | admin/test_bioreflib.py | eli-cipriano/BioRefine | aeb427e8f42b74cd36a38937a8e1408ba1ae872c | [
"MIT"
] | 5 | 2020-11-13T01:14:49.000Z | 2020-11-30T22:10:05.000Z | admin/test_bioreflib.py | eli-cipriano/BioRefine | aeb427e8f42b74cd36a38937a8e1408ba1ae872c | [
"MIT"
] | null | null | null | import unittest
import bioreflib as brf
import os
# os.system('clear')
if __name__ == '__main__':
unittest.main()
| 35.01087 | 72 | 0.573424 | import unittest
import bioreflib as brf
import os
# os.system('clear')
class TestBioRefine(unittest.TestCase):
def test_dicts(self):
brf.write_json() # sometimes germ comes out as a biogas side...
dicts = brf.call_json()
# print(dicts['MATERIALS']['biogas']['sides'])
# print(dic... | 2,923 | 18 | 158 |
3cfe8d7655d8d60887d4510515eb041c68435cf8 | 9,240 | py | Python | app/routes.py | joyliao07/stock_portfolio | 65a0a27e204340427e54ce5a88440bea28bede5d | [
"MIT"
] | 1 | 2019-02-27T01:51:35.000Z | 2019-02-27T01:51:35.000Z | app/routes.py | joyliao07/stock_portfolio | 65a0a27e204340427e54ce5a88440bea28bede5d | [
"MIT"
] | 10 | 2018-12-06T03:30:30.000Z | 2021-09-08T00:51:06.000Z | app/routes.py | joyliao07/stock_portfolio | 65a0a27e204340427e54ce5a88440bea28bede5d | [
"MIT"
] | null | null | null | """This module defines the routes of stocks app."""
from . import app
from .auth import login_required
# 3rd Party Requirements
from flask import render_template, abort, redirect, url_for, session, g, request, flash
from sqlalchemy.exc import IntegrityError, DBAPIError
# Models
from .models import Company, db, Portfo... | 30.394737 | 128 | 0.6171 | """This module defines the routes of stocks app."""
from . import app
from .auth import login_required
# 3rd Party Requirements
from flask import render_template, abort, redirect, url_for, session, g, request, flash
from sqlalchemy.exc import IntegrityError, DBAPIError
# Models
from .models import Company, db, Portfo... | 47 | 0 | 31 |
0c4961697df1d5ec49886b392ef9163275d6a931 | 449 | py | Python | old_code/plt_font.py | yuguiyang/python_demo | 1be2406bfc920e22a0f92bf10d9a3665984067ba | [
"Apache-2.0"
] | null | null | null | old_code/plt_font.py | yuguiyang/python_demo | 1be2406bfc920e22a0f92bf10d9a3665984067ba | [
"Apache-2.0"
] | null | null | null | old_code/plt_font.py | yuguiyang/python_demo | 1be2406bfc920e22a0f92bf10d9a3665984067ba | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 10 16:24:02 2017
@author: hexo
"""
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
#引用Windows中的字体
font_set = FontProperties(fname=r'C:\Windows\Fonts\simsun.ttc', size=15)
plt.figure(u'中文')
plt.plot([1,2,3,4],[-2,-1,0,1])
plt.title... | 18.708333 | 72 | 0.721604 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 10 16:24:02 2017
@author: hexo
"""
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
#引用Windows中的字体
font_set = FontProperties(fname=r'C:\Windows\Fonts\simsun.ttc', size=15)
plt.figure(u'中文')
plt.plot([1,2,3,4],[-2,-1,0,1])
plt.title... | 0 | 0 | 0 |
2bdfea61bdffd87d5a288a584fb1f4ba06e258ec | 10,705 | py | Python | py/datacentric/storage/mongo/temporal_mongo_query.py | datacentricorg/datacentric-py | 40113ddfb68e62d98b880b3c7427db5cc9fbd8cd | [
"Apache-2.0"
] | 1 | 2020-02-03T18:32:42.000Z | 2020-02-03T18:32:42.000Z | py/datacentric/storage/mongo/temporal_mongo_query.py | datacentricorg/datacentric-py | 40113ddfb68e62d98b880b3c7427db5cc9fbd8cd | [
"Apache-2.0"
] | null | null | null | py/datacentric/storage/mongo/temporal_mongo_query.py | datacentricorg/datacentric-py | 40113ddfb68e62d98b880b3c7427db5cc9fbd8cd | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013-present The DataCentric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 44.053498 | 118 | 0.61149 | # Copyright (C) 2013-present The DataCentric Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 565 | 0 | 54 |
daffcbf5aaaf7fe7d3046b4d0b95eb33a413eeca | 3,320 | py | Python | policy_gradient/replay_util.py | niksaz/dota2-expert-demo | b46ce6fc2c9223f07d91db78633c7d20c36f4653 | [
"MIT"
] | 17 | 2018-12-26T10:18:35.000Z | 2021-11-04T02:49:29.000Z | policy_gradient/replay_util.py | niksaz/dota2-expert-demo | b46ce6fc2c9223f07d91db78633c7d20c36f4653 | [
"MIT"
] | null | null | null | policy_gradient/replay_util.py | niksaz/dota2-expert-demo | b46ce6fc2c9223f07d91db78633c7d20c36f4653 | [
"MIT"
] | 5 | 2019-01-26T06:10:15.000Z | 2021-11-04T02:49:30.000Z | import json
import numpy as np
import math
from dotaenv.bot_util import vectorize_observation
| 25.9375 | 71 | 0.581325 | import json
import numpy as np
import math
from dotaenv.bot_util import vectorize_observation
def read_replay(file='data/replay.json'):
observations = []
actions = []
rewards = []
with open(file, 'r') as replay:
lines = replay.readlines()
steps = list(zip(lines[0::2], lines[1::2]))
... | 3,106 | 0 | 115 |
6daea32653f8bd677262df36032b5d33bb969a65 | 273 | py | Python | Ex024.py | Fernando-Rodrigo/Exercicios | 04fe641220f36df85a754b2944d60f245cf6cabd | [
"MIT"
] | 1 | 2022-03-14T20:49:04.000Z | 2022-03-14T20:49:04.000Z | Ex024.py | Fernando-Rodrigo/Exercicios | 04fe641220f36df85a754b2944d60f245cf6cabd | [
"MIT"
] | null | null | null | Ex024.py | Fernando-Rodrigo/Exercicios | 04fe641220f36df85a754b2944d60f245cf6cabd | [
"MIT"
] | null | null | null | # coding=utf-8
nome = str(input('Digite o nome da cidade onde mora para saber se tem Santo no nome ')).strip()
u = nome.upper()
n = u.find('SANTO')
if n == 0:
print('O nome da cidade tem Santo no início.')
else:
print('O nome da cidade não tem Santo no início.')
| 24.818182 | 95 | 0.655678 | # coding=utf-8
nome = str(input('Digite o nome da cidade onde mora para saber se tem Santo no nome ')).strip()
u = nome.upper()
n = u.find('SANTO')
if n == 0:
print('O nome da cidade tem Santo no início.')
else:
print('O nome da cidade não tem Santo no início.')
| 0 | 0 | 0 |
8378725a634758607485c91261de0bb52a535b7d | 2,000 | py | Python | tests/format_test.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 52 | 2021-09-24T17:52:34.000Z | 2022-03-29T22:55:02.000Z | tests/format_test.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 90 | 2021-09-29T04:23:29.000Z | 2022-03-31T21:23:02.000Z | tests/format_test.py | allenai/tango | 80c90caefae4ad1c3f8472718ddada912cd8fcf9 | [
"Apache-2.0"
] | 8 | 2021-11-13T01:56:22.000Z | 2022-02-27T03:29:42.000Z | from typing import Dict, Iterable, Optional
import pytest
from tango.common.testing import TangoTestCase
from tango.format import _OPEN_FUNCTIONS, DillFormat, JsonFormat, TextFormat
| 39.215686 | 76 | 0.6575 | from typing import Dict, Iterable, Optional
import pytest
from tango.common.testing import TangoTestCase
from tango.format import _OPEN_FUNCTIONS, DillFormat, JsonFormat, TextFormat
class TestFormat(TangoTestCase):
@pytest.mark.parametrize("compress", _OPEN_FUNCTIONS.keys())
def test_dill_format(self, compr... | 1,387 | 405 | 23 |
356632435cb248d71f8d00c00961603f3cf140e3 | 3,233 | py | Python | muk_utils/models/res_config_settings.py | alexhong121/odoo_model | 4eff41c672bd03084eaa6eae81c8f3d359c2fb8d | [
"MIT"
] | null | null | null | muk_utils/models/res_config_settings.py | alexhong121/odoo_model | 4eff41c672bd03084eaa6eae81c8f3d359c2fb8d | [
"MIT"
] | null | null | null | muk_utils/models/res_config_settings.py | alexhong121/odoo_model | 4eff41c672bd03084eaa6eae81c8f3d359c2fb8d | [
"MIT"
] | 1 | 2021-05-05T07:59:08.000Z | 2021-05-05T07:59:08.000Z | ###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Utils
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Genera... | 38.951807 | 90 | 0.539746 | ###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Utils
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Genera... | 931 | 1,273 | 23 |
fe4e745b4502ca6e5f3678c79b9f51923237c340 | 740 | py | Python | app/__init__.py | Jwilson1172/DS-Unit-3-Sprint-3-Productization-and-Cloud | c09c8942fe9263e6da15665a781e677dd336734b | [
"MIT"
] | null | null | null | app/__init__.py | Jwilson1172/DS-Unit-3-Sprint-3-Productization-and-Cloud | c09c8942fe9263e6da15665a781e677dd336734b | [
"MIT"
] | null | null | null | app/__init__.py | Jwilson1172/DS-Unit-3-Sprint-3-Productization-and-Cloud | c09c8942fe9263e6da15665a781e677dd336734b | [
"MIT"
] | null | null | null | # web_app/__init__.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from app.routes.home_routes import home_routes
from app.routes.book_routes import book_routes
db = SQLAlchemy()
migrate = Migrate()
# app factory structure
db = SQLAlchemy()
migrate = Migrate()
... | 21.764706 | 70 | 0.72973 | # web_app/__init__.py
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from app.routes.home_routes import home_routes
from app.routes.book_routes import book_routes
db = SQLAlchemy()
migrate = Migrate()
# app factory structure
def create_app():
app = Flask(__nam... | 154 | 0 | 22 |
96ffad2a3f8eb7be50d407273b18100a6483ffb3 | 201 | py | Python | russian/teste.py | DiegoBrian/Flashcards | 1d80dbe2943ce33964095ea856f251ab5c1725d2 | [
"MIT"
] | 1 | 2018-11-21T11:17:51.000Z | 2018-11-21T11:17:51.000Z | russian/teste.py | DiegoBrian/Flashcards | 1d80dbe2943ce33964095ea856f251ab5c1725d2 | [
"MIT"
] | 15 | 2018-12-07T10:50:14.000Z | 2022-03-11T23:33:32.000Z | russian/teste.py | DiegoBrian/Flashcards | 1d80dbe2943ce33964095ea856f251ab5c1725d2 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from chinese.models import *
from language.views_common import *
import datetime
import json
| 18.272727 | 57 | 0.830846 | from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from chinese.models import *
from language.views_common import *
import datetime
import json
| 0 | 0 | 0 |
1b9d073ba0e3965d911dcc4df8427d3af640978e | 140 | py | Python | pysal/contrib/spint/__init__.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/contrib/spint/__init__.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | pysal/contrib/spint/__init__.py | cubensys/pysal | 8d50990f6e6603ba79ae1a887a20a1e3a0734e51 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-07-19T01:46:17.000Z | 2021-07-19T01:46:17.000Z | import gravity
from gravity import Gravity, Production, Attraction, Doubly
import dispersion
import utils
import vec_SA
import count_model
| 20 | 59 | 0.85 | import gravity
from gravity import Gravity, Production, Attraction, Doubly
import dispersion
import utils
import vec_SA
import count_model
| 0 | 0 | 0 |
1c12ba2c7a47631dcf8b150f1599de4937fbd817 | 18,928 | py | Python | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | trilearn/graph/junction_tree.py | melmasri/trilearn | cbda999140881a5f0e01d75a54d5ff55201a33e7 | [
"Apache-2.0"
] | null | null | null | """
Functions related to junction trees.
"""
import networkx as nx
import numpy as np
import trilearn.graph.junction_tree_expander as jte
def is_junction_tree(tree):
""" Checks the junction tree property of tree.
Args:
tree (NetworkX graph): A junction tree.
Returns:
bool: True if tre... | 28.722307 | 153 | 0.564877 | """
Functions related to junction trees.
"""
import networkx as nx
import numpy as np
import trilearn.graph.junction_tree_expander as jte
class JunctionTree(nx.Graph):
def __init__(self, data=None, **attr):
nx.Graph.__init__(self, data, **attr)
self.log_nus = {}
self.separators = None
... | 2,903 | 2,305 | 115 |
786d6680e8bc76680a86b1a6bab1f765db8a8fad | 748 | py | Python | src/write/environment/Environment.py | cqpancoast/solaria | c2f60e1102e9ac1ea5350302653ce2b92e6e25c0 | [
"MIT"
] | null | null | null | src/write/environment/Environment.py | cqpancoast/solaria | c2f60e1102e9ac1ea5350302653ce2b92e6e25c0 | [
"MIT"
] | null | null | null | src/write/environment/Environment.py | cqpancoast/solaria | c2f60e1102e9ac1ea5350302653ce2b92e6e25c0 | [
"MIT"
] | null | null | null | from src.writing.draft.Draft import Draft
from src.writing.editor.Editor import Editor
class Environment(object):
"""TEMPLATE CLASS for Environments.
An Environment must be able to put Drafts and their Editors
together to form Draft-Editor complexes. It must then allow a writer
to use the Editor to a... | 31.166667 | 74 | 0.679144 | from src.writing.draft.Draft import Draft
from src.writing.editor.Editor import Editor
class Environment(object):
"""TEMPLATE CLASS for Environments.
An Environment must be able to put Drafts and their Editors
together to form Draft-Editor complexes. It must then allow a writer
to use the Editor to a... | 0 | 0 | 0 |
8eeeb760ec1c14eb749f848c89f24dced0a84ea4 | 10,744 | py | Python | lib.py | fuyuanli/FuYuanDNS | e9fdd4b495792777f2d9cc17ba2a196d238ba247 | [
"MIT"
] | 1 | 2019-03-26T19:01:20.000Z | 2019-03-26T19:01:20.000Z | lib.py | fuyuanli/FuYuanDNS | e9fdd4b495792777f2d9cc17ba2a196d238ba247 | [
"MIT"
] | null | null | null | lib.py | fuyuanli/FuYuanDNS | e9fdd4b495792777f2d9cc17ba2a196d238ba247 | [
"MIT"
] | 1 | 2019-03-26T19:01:23.000Z | 2019-03-26T19:01:23.000Z | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import ipaddress
| 43.148594 | 93 | 0.486318 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import ipaddress
class DNSPacket:
def __init__(self, data):
self.data = data
self.dnsType = int(str("0x"+str(self.data[-3:-2])[4:6]), 16)
self.dnsClass = int(str("0x"+str(self.data[-1:])[4:6]), 16)
self.domainName = self.getDomianName()
... | 10,221 | -5 | 464 |
622b77c1210d6f687fdecb00a8f611c5cb5da916 | 2,035 | py | Python | server/routers/internal/santander_cycles.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | 1 | 2022-03-10T12:46:11.000Z | 2022-03-10T12:46:11.000Z | server/routers/internal/santander_cycles.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | 2 | 2022-03-02T12:11:24.000Z | 2022-03-02T12:11:31.000Z | server/routers/internal/santander_cycles.py | mitchLui/css_boeing_hackathon_2-22 | ded74fb3ea0cd1fbfa7539f091e6f3d4b8663234 | [
"MIT"
] | null | null | null | import requests
import xmltodict # convert xml to json
import json
import haversine as hs # used for distance calculations between coordinates
from typing import List
SANTANDER_URL = "https://tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml"
COST_PER_HALF_AN_HOUR = "2.00"
if __name__ == "__ma... | 35.086207 | 94 | 0.619656 | import requests
import xmltodict # convert xml to json
import json
import haversine as hs # used for distance calculations between coordinates
from typing import List
SANTANDER_URL = "https://tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml"
COST_PER_HALF_AN_HOUR = "2.00"
class SantanderCycles... | 1,503 | 3 | 104 |
bc8b53cc2ba3d94cb5666e99be507f08b45f60e5 | 7,264 | py | Python | pywicta/denoising/rejection_criteria.py | jeremiedecock/pywi-cta | 1185f7dfa48d60116472c12ffc423be78a250fc9 | [
"MIT"
] | null | null | null | pywicta/denoising/rejection_criteria.py | jeremiedecock/pywi-cta | 1185f7dfa48d60116472c12ffc423be78a250fc9 | [
"MIT"
] | 1 | 2018-03-23T15:44:10.000Z | 2018-03-23T15:44:10.000Z | pywicta/denoising/rejection_criteria.py | jeremiedecock/pywi-cta | 1185f7dfa48d60116472c12ffc423be78a250fc9 | [
"MIT"
] | 1 | 2018-10-02T08:34:53.000Z | 2018-10-02T08:34:53.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | 39.693989 | 145 | 0.619493 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Jérémie DECOCK (http://www.jdhp.org)
# This script is provided under the terms and conditions of the MIT license:
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (th... | 2,202 | 0 | 81 |
94630ffd836801a53195314e1140b8277bcda371 | 1,713 | py | Python | migrations/versions/0161_email_branding.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0161_email_branding.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0161_email_branding.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """
Revision ID: 0161_email_branding
Revises: 0160_another_letter_org
Create Date: 2018-01-30 15:35:12.016574
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0161_email_branding"
down_revision = "0160_another_letter_org"
| 29.033898 | 93 | 0.647402 | """
Revision ID: 0161_email_branding
Revises: 0160_another_letter_org
Create Date: 2018-01-30 15:35:12.016574
"""
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
revision = "0161_email_branding"
down_revision = "0160_another_letter_org"
def upgrade():
op.create_table(
... | 1,383 | 0 | 46 |
35b437405d59f5b58843b2361dbb0e1a0e00d7ee | 3,741 | py | Python | pipeline.py | kayersIPM/python-cdk-template | e114457ccd12fbdbd436f19eb23ff05a455e3b57 | [
"MIT-0"
] | 59 | 2021-08-09T16:57:38.000Z | 2022-03-29T11:26:35.000Z | pipeline.py | kayersIPM/python-cdk-template | e114457ccd12fbdbd436f19eb23ff05a455e3b57 | [
"MIT-0"
] | null | null | null | pipeline.py | kayersIPM/python-cdk-template | e114457ccd12fbdbd436f19eb23ff05a455e3b57 | [
"MIT-0"
] | 11 | 2021-11-13T23:00:58.000Z | 2022-03-30T04:49:51.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, c... | 41.566667 | 91 | 0.682972 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, c... | 2,438 | 103 | 23 |
91537e13eea1a2fb0371c822106fed46f8070f6d | 28,987 | py | Python | evaluation.py | RichardHGL/knowledge_representation_pytorch | 2bdbc255c4a3b63c2eef276dba696537c0da4c30 | [
"MIT"
] | 327 | 2018-03-26T14:00:04.000Z | 2022-03-27T07:48:50.000Z | evaluation.py | moonlightlong/knowledge_representation_pytorch | 26446f26ac16d57927da29c123718f244085dec4 | [
"MIT"
] | 15 | 2018-03-26T15:16:15.000Z | 2021-06-11T05:28:21.000Z | evaluation.py | moonlightlong/knowledge_representation_pytorch | 26446f26ac16d57927da29c123718f244085dec4 | [
"MIT"
] | 99 | 2018-03-27T05:03:42.000Z | 2021-11-30T06:17:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-12-15 16:03:42
# @Author : jimmy (jimmywangheng@qq.com)
# @Link : http://sdcs.sysu.edu.cn
# @Version : $Id$
import os
import numpy as np
import time
import datetime
import random
import multiprocessing
import math
from itertools import groupby
from ... | 33.433679 | 116 | 0.723945 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-12-15 16:03:42
# @Author : jimmy (jimmywangheng@qq.com)
# @Link : http://sdcs.sysu.edu.cn
# @Version : $Id$
import os
import numpy as np
import time
import datetime
import random
import multiprocessing
import math
from itertools import groupby
from ... | 27,159 | 104 | 674 |
f2e8994e884007fbbbb75528efa2a1f835da3ee9 | 287 | py | Python | data/modules/graphic/sprites/container.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | data/modules/graphic/sprites/container.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | data/modules/graphic/sprites/container.py | Sheidaas/gamee | 434db4648e1719a648b8784f201b03b4c8e243c3 | [
"CC-BY-3.0"
] | null | null | null | import pygame
| 23.916667 | 49 | 0.655052 | import pygame
class ContainerSprite(pygame.sprite.DirtySprite):
def __init__(self, image, object_id):
pygame.sprite.Sprite.__init__(self)
self.object_id = object_id
self.image = image
self.small_position = (0, 0)
self.big_position = (0, 0)
| 194 | 28 | 50 |
7f8600f205551b7b6cf9613d7df13b0fd531f43f | 487 | py | Python | bitcoinkeyaddr.py | lugaxker/bitcoinkeyaddr | 457f5c8f171fba6301816eaccf0b799040ee4bb0 | [
"MIT"
] | null | null | null | bitcoinkeyaddr.py | lugaxker/bitcoinkeyaddr | 457f5c8f171fba6301816eaccf0b799040ee4bb0 | [
"MIT"
] | null | null | null | bitcoinkeyaddr.py | lugaxker/bitcoinkeyaddr | 457f5c8f171fba6301816eaccf0b799040ee4bb0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if sys.version_info < (3, 5):
sys.exit("Error: Must be using Python 3.5 or higher")
import imp
imp.load_module('bitcoinkeyaddr', *imp.find_module('lib'))
imp.load_module('bitcoinkeyaddr_gui', *imp.find_module('gui'))
from PyQt5.QtWidgets import QApplicati... | 25.631579 | 62 | 0.714579 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if sys.version_info < (3, 5):
sys.exit("Error: Must be using Python 3.5 or higher")
import imp
imp.load_module('bitcoinkeyaddr', *imp.find_module('lib'))
imp.load_module('bitcoinkeyaddr_gui', *imp.find_module('gui'))
from PyQt5.QtWidgets import QApplicati... | 0 | 0 | 0 |
f1203ebdd97fe1e62e9aa493de52058d676395d9 | 7,365 | py | Python | src/olympia/discovery/tests/test_serializers.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 843 | 2016-02-09T13:00:37.000Z | 2022-03-20T19:17:06.000Z | src/olympia/discovery/tests/test_serializers.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 10,187 | 2016-02-05T23:51:05.000Z | 2022-03-31T15:24:44.000Z | src/olympia/discovery/tests/test_serializers.py | covariant/addons-server | 41e6ee9e426facb19a1e1ca8d40277cb6f94a7da | [
"BSD-3-Clause"
] | 551 | 2016-02-08T20:32:16.000Z | 2022-03-15T16:49:24.000Z | from django.test.utils import override_settings
import pytest
from rest_framework.test import APIRequestFactory
from olympia import amo
from olympia.amo.tests import addon_factory, TestCase
from olympia.discovery.models import DiscoveryItem
from olympia.discovery.serializers import DiscoverySerializer
from olympia.tr... | 45.184049 | 88 | 0.611948 | from django.test.utils import override_settings
import pytest
from rest_framework.test import APIRequestFactory
from olympia import amo
from olympia.amo.tests import addon_factory, TestCase
from olympia.discovery.models import DiscoveryItem
from olympia.discovery.serializers import DiscoverySerializer
from olympia.tr... | 6,729 | 266 | 23 |
18ee572762624f93ac53b3241f3e7bee31e6f61b | 16,889 | py | Python | Visualize/utils.py | oldpaws/AI3601_RL_Final_Project_MAGAIL | 6e53d5c4ad21c9e3907e6d14b20c04b3287800cf | [
"MIT"
] | null | null | null | Visualize/utils.py | oldpaws/AI3601_RL_Final_Project_MAGAIL | 6e53d5c4ad21c9e3907e6d14b20c04b3287800cf | [
"MIT"
] | null | null | null | Visualize/utils.py | oldpaws/AI3601_RL_Final_Project_MAGAIL | 6e53d5c4ad21c9e3907e6d14b20c04b3287800cf | [
"MIT"
] | null | null | null | """
This file implements the calculation of available features independently. For usage, you should call
`subscribe_features` firstly, then retrive the corresponding observation adapter by define observation space
observation_space = gym.spaces.Dict(subscribe_features(`
dict(
distance_to_center=(stack_size... | 40.501199 | 112 | 0.593937 | """
This file implements the calculation of available features independently. For usage, you should call
`subscribe_features` firstly, then retrive the corresponding observation adapter by define observation space
observation_space = gym.spaces.Dict(subscribe_features(`
dict(
distance_to_center=(stack_size... | 8,979 | 4,767 | 183 |
ff1d7997c0c885b781804fc22b72cd916481a8da | 2,808 | py | Python | treelearn/treelearn/__init__.py | DouglasOrr/Snippets | 026e15a422b518ee7d9ce4849f971c4403ad9fe8 | [
"MIT"
] | null | null | null | treelearn/treelearn/__init__.py | DouglasOrr/Snippets | 026e15a422b518ee7d9ce4849f971c4403ad9fe8 | [
"MIT"
] | 1 | 2020-04-11T18:07:19.000Z | 2020-04-11T18:07:19.000Z | treelearn/treelearn/__init__.py | DouglasOrr/Snippets | 026e15a422b518ee7d9ce4849f971c4403ad9fe8 | [
"MIT"
] | null | null | null | import collections
### HyperOptimization Parameters ###
Scalar = collections.namedtuple("Scalar", ("scale", "default", "min", "max"))
Either = collections.namedtuple("Either", ("alternatives",))
### Execution ###
Command = collections.namedtuple("Command", ("shell", "chdir", "options"))
def command(shell, chdir = ... | 35.544304 | 91 | 0.652778 | import collections
### HyperOptimization Parameters ###
Scalar = collections.namedtuple("Scalar", ("scale", "default", "min", "max"))
Either = collections.namedtuple("Either", ("alternatives",))
def linear(default, min = None, max = None):
return Scalar("linear", default, min, max)
def logarithmic(default, min ... | 177 | 0 | 69 |
01b032947b95d719979139b1ca49727c44c3f5cb | 3,010 | py | Python | tests/test_performance/test_reversed.py | Theodikes/listchaining | 3d63aea066a2a7c0c68e9c260eefc67ef67889e2 | [
"MIT"
] | 3 | 2021-07-22T13:34:53.000Z | 2021-07-27T12:28:04.000Z | tests/test_performance/test_reversed.py | Theodikes/listchaining | 3d63aea066a2a7c0c68e9c260eefc67ef67889e2 | [
"MIT"
] | null | null | null | tests/test_performance/test_reversed.py | Theodikes/listchaining | 3d63aea066a2a7c0c68e9c260eefc67ef67889e2 | [
"MIT"
] | null | null | null | import listchaining
from random import randint
from time import time
from typing import Union
from .utils import check_result_of_multiple_runs, get_percentage_difference
random_array = [randint(53454, 6565656) for _ in range(randint(1000000, 2000000))]
@check_result_of_multiple_runs(number_of_runs=20)
@check_res... | 39.605263 | 120 | 0.78505 | import listchaining
from random import randint
from time import time
from typing import Union
from .utils import check_result_of_multiple_runs, get_percentage_difference
random_array = [randint(53454, 6565656) for _ in range(randint(1000000, 2000000))]
def get_reversed_method_execution_time(array: list) -> Union[in... | 2,435 | 0 | 111 |
c65991ab6b28df522a4166fe9e33e47799614c92 | 3,390 | py | Python | active_mail_filter/simple_db.py | kfrodgers/active-mail-filter | cd453e6a995659c1aea796695ea52c11420fc0f7 | [
"BSD-2-Clause"
] | null | null | null | active_mail_filter/simple_db.py | kfrodgers/active-mail-filter | cd453e6a995659c1aea796695ea52c11420fc0f7 | [
"BSD-2-Clause"
] | null | null | null | active_mail_filter/simple_db.py | kfrodgers/active-mail-filter | cd453e6a995659c1aea796695ea52c11420fc0f7 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2016, Kevin Rodgers
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
import redis
from uuid import uuid4
UUID = 'uuid'
| 26.904762 | 112 | 0.575221 | # Copyright (c) 2016, Kevin Rodgers
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
import redis
from uuid import uuid4
UUID = 'uuid'
class SimpleRedisDb(object):
def __init__(self, host, key, port=6379):
"""
:param host: database host
:p... | 134 | 3,047 | 23 |
de061e0c32ee55dc79321bdaf74a5efb8664aeb8 | 937 | py | Python | _scripts/checkdb_eq.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 2 | 2015-07-19T02:55:06.000Z | 2021-07-07T02:38:26.000Z | _scripts/checkdb_eq.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 5 | 2017-03-11T16:30:26.000Z | 2021-04-10T16:42:10.000Z | _scripts/checkdb_eq.py | Erotemic/hotspotter | 3cfa4015798e21385455b937f9083405c4b3cf53 | [
"Apache-2.0"
] | 10 | 2015-07-19T03:05:42.000Z | 2021-08-24T14:48:59.000Z | from __future__ import print_function, division
from os.path import join, normpath, exists, dirname
# on baker street
local_work = "D:/data/work"
remote_work = "Z:/data/work"
standard_dbs = ['GZ_ALL', 'HSDB_zebra_with_mothers']
for dbname in standard_dbs:
chip_rpath = join(dbname, '_hsdb', 'chip_table.csv')
... | 26.027778 | 58 | 0.676628 | from __future__ import print_function, division
from os.path import join, normpath, exists, dirname
# on baker street
local_work = "D:/data/work"
remote_work = "Z:/data/work"
def checktext(rpath):
fpath1 = normpath(join(local_work, rpath))
fpath2 = normpath(join(remote_work, rpath))
text1 = open(fpath1,... | 381 | 0 | 23 |
2e38132a2a8e3f0b2241467ab65649fb565714a6 | 5,425 | py | Python | bot/utilities.py | sivaksiv/bot-new | e2c6b70f9e8e70a14159d2f9aabc22f03de67fc5 | [
"MIT"
] | null | null | null | bot/utilities.py | sivaksiv/bot-new | e2c6b70f9e8e70a14159d2f9aabc22f03de67fc5 | [
"MIT"
] | null | null | null | bot/utilities.py | sivaksiv/bot-new | e2c6b70f9e8e70a14159d2f9aabc22f03de67fc5 | [
"MIT"
] | null | null | null | #! /usr/bin/python
"""
utilities.py file contains supporting functions for bot.py
"""
import re
import requests
import os
from ciscosparkapi import CiscoSparkAPI
from case import CaseDetail
spark_token = os.environ.get("SPARK_BOT_TOKEN")
spark = CiscoSparkAPI(access_token=spark_token)
#
# Supporting functions
#
#... | 27.261307 | 108 | 0.686452 | #! /usr/bin/python
"""
utilities.py file contains supporting functions for bot.py
"""
import re
import requests
import os
from ciscosparkapi import CiscoSparkAPI
from case import CaseDetail
spark_token = os.environ.get("SPARK_BOT_TOKEN")
spark = CiscoSparkAPI(access_token=spark_token)
#
# Supporting functions
#
#... | 4,088 | 0 | 352 |
68a9ae13d251f5e5f6174813086eccde33d8f2e0 | 2,187 | py | Python | marverDashboard.py | Diomede81/Events_Reporting_Dashboard | 03a74ceaf77889a60d2fe6eeee2803819527d731 | [
"MIT"
] | null | null | null | marverDashboard.py | Diomede81/Events_Reporting_Dashboard | 03a74ceaf77889a60d2fe6eeee2803819527d731 | [
"MIT"
] | null | null | null | marverDashboard.py | Diomede81/Events_Reporting_Dashboard | 03a74ceaf77889a60d2fe6eeee2803819527d731 | [
"MIT"
] | 1 | 2017-12-15T22:31:40.000Z | 2017-12-15T22:31:40.000Z | import json
import os
from datetime import datetime, date, timedelta
import MySQLdb
from flask import Flask
from flask import render_template,request
from settings.config import *
app = Flask(__name__)
db = MySQLdb.connect(host=os.getenv('MYSQL_HOST',DATABASE_HOST),
user=os.getenv('MYSQL_USER',... | 32.161765 | 139 | 0.666209 | import json
import os
from datetime import datetime, date, timedelta
import MySQLdb
from flask import Flask
from flask import render_template,request
from settings.config import *
class DateTimeEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, datetime):
return o.isoformat()
... | 1,433 | 19 | 115 |
cf21c35d1c925d9ca6e72a00d6eec277e5f09335 | 258 | py | Python | musestudio/__init__.py | miguelascifo/MuseStudio | 10e4beb8a6e478fdc66bc55b0ede9c082ec88025 | [
"MIT"
] | 1 | 2021-11-16T13:42:29.000Z | 2021-11-16T13:42:29.000Z | musestudio/__init__.py | miguelascifo/MuseStudio | 10e4beb8a6e478fdc66bc55b0ede9c082ec88025 | [
"MIT"
] | null | null | null | musestudio/__init__.py | miguelascifo/MuseStudio | 10e4beb8a6e478fdc66bc55b0ede9c082ec88025 | [
"MIT"
] | 1 | 2021-11-16T13:42:33.000Z | 2021-11-16T13:42:33.000Z | from .convert_raw import to_df, to_mne_eeg
from .export_bids_files import create_bids_path, export_bids
from .import_bids_files import import_bids
from .import_raw_files import read_raw_xdf, read_raw_xdf_dir
from .view import search_streams, start_streaming
| 43 | 60 | 0.872093 | from .convert_raw import to_df, to_mne_eeg
from .export_bids_files import create_bids_path, export_bids
from .import_bids_files import import_bids
from .import_raw_files import read_raw_xdf, read_raw_xdf_dir
from .view import search_streams, start_streaming
| 0 | 0 | 0 |
1c07feb5b78810d762dbaad72c92b976456e48b5 | 1,428 | py | Python | var/spack/repos/builtin/packages/r-affycompatible/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2019-11-28T10:14:14.000Z | 2019-11-28T10:14:14.000Z | var/spack/repos/builtin/packages/r-affycompatible/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-affycompatible/package.py | robertsawko/spack | 135cf4835f5b646c4aaa0e2eb5552c80fc3a5ce8 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2017-01-21T17:19:32.000Z | 2017-01-21T17:19:32.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAffycompatible(RPackage):
"""Affymetrix GeneChip software compatibility.
This pac... | 44.625 | 78 | 0.726891 | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAffycompatible(RPackage):
"""Affymetrix GeneChip software compatibility.
This pac... | 0 | 0 | 0 |
aa85d9b10c57a753c3c4175a63a6a82799f44ebd | 3,874 | py | Python | nz_crawl_demo/day3/bs4/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day3/bs4/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day3/bs4/demo3.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | from bs4 import BeautifulSoup
html = """
<table class="tablelist" cellpadding="0" cellspacing="0">
<tbody>
<tr class="h">
<td class="l" width="374">职位名称</td>
<td>职位类别</td>
<td>人数</td>
<td>地点</td>
<td>发布时间</td>
</tr>
<tr class="even... | 32.283333 | 189 | 0.513165 | from bs4 import BeautifulSoup
html = """
<table class="tablelist" cellpadding="0" cellspacing="0">
<tbody>
<tr class="h">
<td class="l" width="374">职位名称</td>
<td>职位类别</td>
<td>人数</td>
<td>地点</td>
<td>发布时间</td>
</tr>
<tr class="even... | 0 | 0 | 0 |
30f69ad47e5f44bfcf76b618fb7dc3a7778978b0 | 1,140 | py | Python | arrays/2d_ds.py | franloza/hackerrank | e66f5f5c4c1c7c0fe93146d29140692cd71625b7 | [
"MIT"
] | null | null | null | arrays/2d_ds.py | franloza/hackerrank | e66f5f5c4c1c7c0fe93146d29140692cd71625b7 | [
"MIT"
] | null | null | null | arrays/2d_ds.py | franloza/hackerrank | e66f5f5c4c1c7c0fe93146d29140692cd71625b7 | [
"MIT"
] | null | null | null | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the hourglassSum function below.
# Read from input
# if __name__ == '__main__':
# fptr = open(os.environ['OUTPUT_PATH'], 'w')
#
# arr = []
#
# for _ in range(6):
# arr.append(list(map(int, input().rstrip().split())... | 23.265306 | 92 | 0.469298 | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the hourglassSum function below.
def hourglassSum(arr):
hourglass_sums = []
for i in range(len(arr)-2):
for j in range(len(arr[i])-2):
hourglass_sums.append(sum(arr[i][j:j+3]) + arr[i+1][j+1] + sum(arr[i+2][... | 220 | 0 | 22 |
146ccc7629853048229494b92ded9f6d03e1b709 | 7,940 | py | Python | src/vtra/preprocess/convert_hazard_data.py | oi-analytics/oia-transport-archive | f89cb686704fe76c1665697b35d14caccf37f3a1 | [
"PostgreSQL"
] | 1 | 2021-03-31T02:59:50.000Z | 2021-03-31T02:59:50.000Z | src/vtra/preprocess/convert_hazard_data.py | oi-analytics/oia-transport-archive | f89cb686704fe76c1665697b35d14caccf37f3a1 | [
"PostgreSQL"
] | null | null | null | src/vtra/preprocess/convert_hazard_data.py | oi-analytics/oia-transport-archive | f89cb686704fe76c1665697b35d14caccf37f3a1 | [
"PostgreSQL"
] | 1 | 2022-02-24T16:51:47.000Z | 2022-02-24T16:51:47.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue July 17 10:20:55 2018
@authors: Raghav Pant, Tom Russell, elcok
"""
import os
import subprocess
import json
import sys
from vtra.utils import load_config
import fiona
import fiona.crs
import rasterio
import numpy as np
import pandas as pd
def convert_geotiff_to_vector... | 28.768116 | 125 | 0.648363 | # -*- coding: utf-8 -*-
"""
Created on Tue July 17 10:20:55 2018
@authors: Raghav Pant, Tom Russell, elcok
"""
import os
import subprocess
import json
import sys
from vtra.utils import load_config
import fiona
import fiona.crs
import rasterio
import numpy as np
import pandas as pd
def glofris_data_details(file_na... | 4,862 | 0 | 92 |
52d8c34adfb0d62eff8742e01f23528bb9164724 | 415 | py | Python | setup.py | LMML-Team/rnn-music | 3e0627cd695b135f80b718c2b65cc879e8164b6f | [
"MIT"
] | null | null | null | setup.py | LMML-Team/rnn-music | 3e0627cd695b135f80b718c2b65cc879e8164b6f | [
"MIT"
] | null | null | null | setup.py | LMML-Team/rnn-music | 3e0627cd695b135f80b718c2b65cc879e8164b6f | [
"MIT"
] | null | null | null | from distutils.core import setup
from setuptools import find_packages
try:
import mido
except ImportError:
print("Warning: `mido` must be installed in order to use `rnn_music`")
setup(name='rnn_music',
version='1.0',
description='Generates music',
author='Petar Griggs (@Anonymission)',
... | 24.411765 | 74 | 0.679518 | from distutils.core import setup
from setuptools import find_packages
try:
import mido
except ImportError:
print("Warning: `mido` must be installed in order to use `rnn_music`")
setup(name='rnn_music',
version='1.0',
description='Generates music',
author='Petar Griggs (@Anonymission)',
... | 0 | 0 | 0 |
9ad4e08f36380c2e5f375198b11550f55d82aaf8 | 3,259 | py | Python | ros/src/tl_detector/light_classification/tl_classifier.py | aadeshnpn/CarND-Capstone | 2d31d986325bf96d732a718c5a1feca89700ce61 | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | aadeshnpn/CarND-Capstone | 2d31d986325bf96d732a718c5a1feca89700ce61 | [
"MIT"
] | null | null | null | ros/src/tl_detector/light_classification/tl_classifier.py | aadeshnpn/CarND-Capstone | 2d31d986325bf96d732a718c5a1feca89700ce61 | [
"MIT"
] | null | null | null | import os
from styx_msgs.msg import TrafficLight
import numpy as np
import rospy
import torch
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
import cv2
| 40.7375 | 88 | 0.626266 | import os
from styx_msgs.msg import TrafficLight
import numpy as np
import rospy
import torch
import torchvision
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
import cv2
class TLClassifier(object):
def __init__(self, pymodel_file='tlight.pt'):
#TODO load classifier
self.cu... | 1,113 | 1,927 | 23 |
55b1e827227e9cc2579910010d9b1349576b9bd2 | 18,422 | py | Python | src/networks.py | fugashy/deep_learning_from_scratch | c5e9227cbf1a770101adb2a9f0f7e6c69acf497d | [
"MIT"
] | null | null | null | src/networks.py | fugashy/deep_learning_from_scratch | c5e9227cbf1a770101adb2a9f0f7e6c69acf497d | [
"MIT"
] | null | null | null | src/networks.py | fugashy/deep_learning_from_scratch | c5e9227cbf1a770101adb2a9f0f7e6c69acf497d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys, os
from collections import OrderedDict
sys.path.append(os.pardir)
import numpy as np
import pickle
from src import (
activations, differentiations, losses, layers
)
class MultiLayerNet:
u"""
任意の層を持つニューラルネットワーク
"""
def __init__(
self, input_size, ... | 31.92721 | 91 | 0.542178 | # -*- coding: utf-8 -*-
import sys, os
from collections import OrderedDict
sys.path.append(os.pardir)
import numpy as np
import pickle
from src import (
activations, differentiations, losses, layers
)
def create(config_dict):
network_type = config_dict['type']
if network_type == 'multi_layer_network':
... | 7,976 | 4,372 | 326 |
0ecead66b693db7b9b91cf9a2e31d643d1853b7f | 1,059 | py | Python | Assorted_Snippets/python/socket_prototyping/server_makefile.py | KyleKing/My-Programming-Sketchbook | 3d69b0b2cb3bef4ff3ff83154b2c2560079bcb01 | [
"MIT"
] | 7 | 2016-05-27T15:54:57.000Z | 2021-05-07T03:02:21.000Z | Assorted_Snippets/python/socket_prototyping/server_makefile.py | KyleKing/My-Programming-Sketchbook | 3d69b0b2cb3bef4ff3ff83154b2c2560079bcb01 | [
"MIT"
] | 10 | 2015-07-11T03:39:56.000Z | 2021-04-10T01:03:29.000Z | Assorted_Snippets/python/socket_prototyping/server_makefile.py | KyleKing/My-Programming-Sketchbook | 3d69b0b2cb3bef4ff3ff83154b2c2560079bcb01 | [
"MIT"
] | null | null | null | """Based on https://stackoverflow.com/q/59978887/3219667.
Update: not working. May want to revisit
"""
import socket
from loguru import logger
HOST = '127.0.0.1'
PORT = 65439
ACK_TEXT = 'text_received'
if __name__ == '__main__':
main()
| 24.068182 | 79 | 0.566572 | """Based on https://stackoverflow.com/q/59978887/3219667.
Update: not working. May want to revisit
"""
import socket
from loguru import logger
HOST = '127.0.0.1'
PORT = 65439
ACK_TEXT = 'text_received'
def main():
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
sock.setsockopt(socket... | 787 | 0 | 23 |
7ca0f088acdeb42080a4db65a5c97f9c26bb7b77 | 1,516 | py | Python | train_ik.py | meaten/MotionAug | ac7d5fa3e5ade1dffca8db50c1281e9a4a747b62 | [
"MIT"
] | 24 | 2022-03-18T08:03:11.000Z | 2022-03-30T05:11:26.000Z | train_ik.py | meaten/MotionAug | ac7d5fa3e5ade1dffca8db50c1281e9a4a747b62 | [
"MIT"
] | 1 | 2022-03-28T06:39:46.000Z | 2022-03-29T03:40:01.000Z | train_ik.py | meaten/MotionAug | ac7d5fa3e5ade1dffca8db50c1281e9a4a747b62 | [
"MIT"
] | null | null | null | import os
import subprocess
import argparse
timeout = 60 * 60 * 8
bvh_dir = "data/bvh/hdm05_aligned_split/"
args = parse_args()
num_workers = args.num_workers
num_thread = args.num_threads
keyword = args.act_class
base_cmd = ["python3", "mpi_run.py",
"--arg_file", f"args/ik_fanshape_{keyword}.txt",
... | 32.255319 | 87 | 0.661609 | import os
import subprocess
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--act_class', type=str)
parser.add_argument('--num_threads', type=int, default=5)
parser.add_argument('--num_workers', type=int, default=30)
args = parser.parse_args()
return a... | 257 | 0 | 23 |
fe7d6f4093965bc8e0b52ca5e3e33746c80e0940 | 863 | py | Python | tests/test_locale_convert.py | matthew-brett/sphinx-book-theme | 823e1a40a461958fd67d7f75f41aec8bbd00464b | [
"BSD-3-Clause"
] | 1 | 2020-04-28T11:52:03.000Z | 2020-04-28T11:52:03.000Z | tests/test_locale_convert.py | matthew-brett/sphinx-book-theme | 823e1a40a461958fd67d7f75f41aec8bbd00464b | [
"BSD-3-Clause"
] | 31 | 2020-03-11T20:51:58.000Z | 2020-04-28T21:01:11.000Z | tests/test_locale_convert.py | matthew-brett/sphinx-book-theme | 823e1a40a461958fd67d7f75f41aec8bbd00464b | [
"BSD-3-Clause"
] | 3 | 2020-03-19T07:09:16.000Z | 2020-04-22T21:30:30.000Z | from sphinx_book_theme._compile_translations import convert_json
| 43.15 | 83 | 0.683662 | from sphinx_book_theme._compile_translations import convert_json
def test_convert(tmp_path, monkeypatch):
# Generate folder structures needed
path_translation = tmp_path / "assets" / "translations"
path_jsons = path_translation / "jsons"
path_compiled = tmp_path / "theme" / "sphinx_book_theme" / "stat... | 774 | 0 | 23 |
2408651f34dc131b3f8b28ce96157a0d9577504d | 511 | py | Python | setup.py | toddsifleet/equals | fb2b2a027e5389fdeb2f59e9acbdcacb8a8cdfb4 | [
"MIT"
] | 38 | 2015-03-18T21:45:33.000Z | 2020-12-22T11:13:05.000Z | setup.py | toddsifleet/equals | fb2b2a027e5389fdeb2f59e9acbdcacb8a8cdfb4 | [
"MIT"
] | 8 | 2015-02-12T04:06:37.000Z | 2022-02-10T08:30:08.000Z | setup.py | toddsifleet/equals | fb2b2a027e5389fdeb2f59e9acbdcacb8a8cdfb4 | [
"MIT"
] | 4 | 2015-02-25T16:54:00.000Z | 2016-09-07T20:10:09.000Z | from setuptools import setup
import equals
with open('README.rst') as f:
long_description = f.read()
setup(
description='Python Fuzzy Matchers',
long_description=long_description,
name='equals',
version=equals.__version__,
author='Todd Sifleet',
author_email='todd.siflet@gmail.com',
p... | 25.55 | 106 | 0.706458 | from setuptools import setup
import equals
with open('README.rst') as f:
long_description = f.read()
setup(
description='Python Fuzzy Matchers',
long_description=long_description,
name='equals',
version=equals.__version__,
author='Todd Sifleet',
author_email='todd.siflet@gmail.com',
p... | 0 | 0 | 0 |
7ad3a85969ac52e4c6aedb12277c91520ecca100 | 729 | py | Python | verificacaodeNotas.py | DevMarcus007/Programas_de_Teste_Para_Avaliacao | 20edb0a45d0afbe35282d8049940403b84b852a0 | [
"MIT"
] | null | null | null | verificacaodeNotas.py | DevMarcus007/Programas_de_Teste_Para_Avaliacao | 20edb0a45d0afbe35282d8049940403b84b852a0 | [
"MIT"
] | null | null | null | verificacaodeNotas.py | DevMarcus007/Programas_de_Teste_Para_Avaliacao | 20edb0a45d0afbe35282d8049940403b84b852a0 | [
"MIT"
] | null | null | null | #Verificação da média de 4 notas, e informação sobre Aprovação do aluno. Com retorno ao início
print('*'*28)
print('CURSO SISTEMAS DE INFORMAÇÃO')
print('*'*28)
m=0
while True:
name = (input('Nome do Aluno: '))
c = 1
while c <=4:
n=float(input(f'{c}ª Nota: '))
m=m+n
c+=1
... | 27 | 94 | 0.558299 | #Verificação da média de 4 notas, e informação sobre Aprovação do aluno. Com retorno ao início
print('*'*28)
print('CURSO SISTEMAS DE INFORMAÇÃO')
print('*'*28)
m=0
while True:
name = (input('Nome do Aluno: '))
c = 1
while c <=4:
n=float(input(f'{c}ª Nota: '))
m=m+n
c+=1
... | 0 | 0 | 0 |
58844052e38560172bb8e8863c013b71d8c0fc51 | 2,539 | py | Python | LB-Sandwich-on-Alicloud/base_config/config.py | yeukb/skillets | 262f51915f06a17c05cda0fbcda92b43cee4b8b5 | [
"MIT"
] | null | null | null | LB-Sandwich-on-Alicloud/base_config/config.py | yeukb/skillets | 262f51915f06a17c05cda0fbcda92b43cee4b8b5 | [
"MIT"
] | null | null | null | LB-Sandwich-on-Alicloud/base_config/config.py | yeukb/skillets | 262f51915f06a17c05cda0fbcda92b43cee4b8b5 | [
"MIT"
] | null | null | null | import requests
import xml.etree.ElementTree as ET
import argparse
import urllib3
import subprocess
import sys
from python_terraform import Terraform
#def install(package):
# subprocess.call([sys.executable, "-m", "pip", "install", package])
#
#install('python_terraform')
#try:
# from python_terraform import T... | 30.963415 | 123 | 0.72627 | import requests
import xml.etree.ElementTree as ET
import argparse
import urllib3
import subprocess
import sys
from python_terraform import Terraform
#def install(package):
# subprocess.call([sys.executable, "-m", "pip", "install", package])
#
#install('python_terraform')
#try:
# from python_terraform import T... | 0 | 0 | 0 |
0b3d3c044fff670c76cfb5582d7032f6d89c62ee | 5,476 | py | Python | relevanceai/operations/cluster/partial.py | RelevanceAI/RelevanceAI | a0542f35153d9c842f3d2cd0955d6b07f6dfc07b | [
"Apache-2.0"
] | 21 | 2021-11-23T13:01:36.000Z | 2022-03-23T03:45:30.000Z | relevanceai/operations/cluster/partial.py | RelevanceAI/RelevanceAI | a0542f35153d9c842f3d2cd0955d6b07f6dfc07b | [
"Apache-2.0"
] | 217 | 2021-11-23T00:11:01.000Z | 2022-03-30T08:11:49.000Z | relevanceai/operations/cluster/partial.py | RelevanceAI/RelevanceAI | a0542f35153d9c842f3d2cd0955d6b07f6dfc07b | [
"Apache-2.0"
] | 4 | 2022-01-04T01:48:30.000Z | 2022-02-11T03:19:32.000Z | from typing import Union, Optional, List, Dict, Any
from relevanceai.utils.decorators.analytics import track
from relevanceai.operations.cluster.utils import ClusterUtils
| 30.254144 | 95 | 0.578159 | from typing import Union, Optional, List, Dict, Any
from relevanceai.utils.decorators.analytics import track
from relevanceai.operations.cluster.utils import ClusterUtils
class PartialClusterOps(ClusterUtils):
@track
def partial_fit_documents(
self,
vector_fields: List[Any],
documents:... | 0 | 5,281 | 23 |
2a3b25822ddb748b5facad12d660bb3d9fcf2a00 | 4,116 | py | Python | Project/UI/ContentTypes/SongUploadContent.py | ShirAvneri/RTDataLearningProject | bd3d6a29e22ab368b2012dd12c90ce95fc2a932e | [
"MIT"
] | null | null | null | Project/UI/ContentTypes/SongUploadContent.py | ShirAvneri/RTDataLearningProject | bd3d6a29e22ab368b2012dd12c90ce95fc2a932e | [
"MIT"
] | null | null | null | Project/UI/ContentTypes/SongUploadContent.py | ShirAvneri/RTDataLearningProject | bd3d6a29e22ab368b2012dd12c90ce95fc2a932e | [
"MIT"
] | 1 | 2021-09-21T08:37:48.000Z | 2021-09-21T08:37:48.000Z | import threading
import time
from PySide6.QtCore import QThread, Signal, Slot
from PySide6.QtGui import QTextCursor, QColor
from PySide6.QtWidgets import QPlainTextEdit
from Project.ChordDetector.ChordDetection.chroma_chord_detection import chord_detection_prefilepath
from Project.UI.CommonWidgets.CommonButtons impor... | 35.179487 | 99 | 0.656463 | import threading
import time
from PySide6.QtCore import QThread, Signal, Slot
from PySide6.QtGui import QTextCursor, QColor
from PySide6.QtWidgets import QPlainTextEdit
from Project.ChordDetector.ChordDetection.chroma_chord_detection import chord_detection_prefilepath
from Project.UI.CommonWidgets.CommonButtons impor... | 3,220 | 351 | 69 |
7b41c8203cbc700b396908e1c1340197f0411876 | 2,001 | py | Python | hpass/encryption.py | hekaiyou/hpass | d9854a5389306c1ed89d085824cc3a4bb0619de0 | [
"MIT"
] | null | null | null | hpass/encryption.py | hekaiyou/hpass | d9854a5389306c1ed89d085824cc3a4bb0619de0 | [
"MIT"
] | null | null | null | hpass/encryption.py | hekaiyou/hpass | d9854a5389306c1ed89d085824cc3a4bb0619de0 | [
"MIT"
] | null | null | null | import random
import hmac
import base64
from hashlib import sha256
| 30.318182 | 111 | 0.523238 | import random
import hmac
import base64
from hashlib import sha256
def random_password(length):
base_char = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'I', 'H', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'i', 'h', 'j', 'k', 'l'... | 1,790 | 0 | 138 |
e830353a34e0cc635fa5ab4d37e70572aad53a48 | 1,109 | py | Python | 2020/07/17.py | frankpiva/leetcode | 85540af1fd72ad9e92c5a6ad253b1aaeec5065d9 | [
"MIT"
] | null | null | null | 2020/07/17.py | frankpiva/leetcode | 85540af1fd72ad9e92c5a6ad253b1aaeec5065d9 | [
"MIT"
] | null | null | null | 2020/07/17.py | frankpiva/leetcode | 85540af1fd72ad9e92c5a6ad253b1aaeec5065d9 | [
"MIT"
] | null | null | null | """
Top K Frequent Elements
Given a non-empty array of integers, return the k most frequent elements.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
Example 2:
Input: nums = [1], k = 1
Output: [1]
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Your algorithm's tim... | 27.04878 | 111 | 0.603246 | """
Top K Frequent Elements
Given a non-empty array of integers, return the k most frequent elements.
Example 1:
Input: nums = [1,1,1,2,2,3], k = 2
Output: [1,2]
Example 2:
Input: nums = [1], k = 1
Output: [1]
Note:
You may assume k is always valid, 1 ≤ k ≤ number of unique elements.
Your algorithm's tim... | 405 | -6 | 48 |
2d095a60b83e20c7358961b49564ab9fdab362ff | 3,657 | py | Python | tb3_autonomy/python/tb3_behaviors/vision.py | xpharry/turtlebot3_behavior_demos | 992c50d310c493e450d584ee38b128ef55b0d2e0 | [
"MIT"
] | 41 | 2021-04-18T01:35:18.000Z | 2022-03-29T02:29:45.000Z | tb3_autonomy/python/tb3_behaviors/vision.py | xpharry/turtlebot3_behavior_demos | 992c50d310c493e450d584ee38b128ef55b0d2e0 | [
"MIT"
] | 2 | 2021-05-29T13:17:45.000Z | 2021-05-29T18:33:01.000Z | tb3_autonomy/python/tb3_behaviors/vision.py | xpharry/turtlebot3_behavior_demos | 992c50d310c493e450d584ee38b128ef55b0d2e0 | [
"MIT"
] | 9 | 2021-04-23T03:35:46.000Z | 2022-03-29T10:23:56.000Z | """
Vision behaviors for TurtleBot3
"""
import cv2
import cv_bridge
import rospy
import py_trees
from sensor_msgs.msg import Image
import matplotlib.pyplot as plt
# Define HSV color space thresholds
hsv_threshold_dict = {
"red": ((0, 220, 0), (30, 255, 255)),
"green": ((40, 220, 0), (80, 255, 255)),
"blue... | 35.504854 | 99 | 0.621274 | """
Vision behaviors for TurtleBot3
"""
import cv2
import cv_bridge
import rospy
import py_trees
from sensor_msgs.msg import Image
import matplotlib.pyplot as plt
# Define HSV color space thresholds
hsv_threshold_dict = {
"red": ((0, 220, 0), (30, 255, 255)),
"green": ((40, 220, 0), (80, 255, 255)),
"blue... | 634 | 0 | 81 |
04493683e5cc3d4e6f17af8d5a55203823785bbe | 5,984 | py | Python | google/cloud/asset_v1p2beta1/proto/asset_service_pb2_grpc.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1p2beta1/proto/asset_service_pb2_grpc.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1p2beta1/proto/asset_service_pb2_grpc.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.asset_v1p2beta1.proto import (
asset_service_pb2 as google_dot_cloud_dot_asset__v1p2beta1_dot_proto_dot_asset__service__pb2,
)
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class Asse... | 49.866667 | 140 | 0.758523 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.cloud.asset_v1p2beta1.proto import (
asset_service_pb2 as google_dot_cloud_dot_asset__v1p2beta1_dot_proto_dot_asset__service__pb2,
)
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
class Asse... | 2,060 | 0 | 23 |
73ebb7d4665072fe84700143216ebb0e6489b42f | 2,030 | py | Python | lbng/xorriso.py | adrian15/live-wrapper | 4c908cd1682f5d15912810a33c71c35a54fc7115 | [
"BSD-2-Clause"
] | 1 | 2016-01-05T17:29:13.000Z | 2016-01-05T17:29:13.000Z | lbng/xorriso.py | adrian15/live-wrapper | 4c908cd1682f5d15912810a33c71c35a54fc7115 | [
"BSD-2-Clause"
] | null | null | null | lbng/xorriso.py | adrian15/live-wrapper | 4c908cd1682f5d15912810a33c71c35a54fc7115 | [
"BSD-2-Clause"
] | null | null | null | # live-build-ng - Live-Build NG
# (C) Iain R. Learmonth 2015 <irl@debian.org>
# See COPYING for terms of usage, modification and redistribution.
#
# lbng/xorriso.py - xorriso helpers
"""
The lbng.xorriso module provides helpers for calling xorriso as part of the
image creation process.
.. note::
This module requi... | 31.71875 | 79 | 0.594581 | # live-build-ng - Live-Build NG
# (C) Iain R. Learmonth 2015 <irl@debian.org>
# See COPYING for terms of usage, modification and redistribution.
#
# lbng/xorriso.py - xorriso helpers
"""
The lbng.xorriso module provides helpers for calling xorriso as part of the
image creation process.
.. note::
This module requi... | 803 | 0 | 54 |
a88444b5d8e21a787190b016f91431fb59c4aa07 | 8,030 | py | Python | brane-ide/kernels/bscript/bscript_kernel/driver_pb2.py | romnn/brane | 03752edd85a09a5ffb817b9f6a0fa03c8e9b277a | [
"Apache-2.0"
] | null | null | null | brane-ide/kernels/bscript/bscript_kernel/driver_pb2.py | romnn/brane | 03752edd85a09a5ffb817b9f6a0fa03c8e9b277a | [
"Apache-2.0"
] | null | null | null | brane-ide/kernels/bscript/bscript_kernel/driver_pb2.py | romnn/brane | 03752edd85a09a5ffb817b9f6a0fa03c8e9b277a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: driver.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | 33.319502 | 608 | 0.759402 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: driver.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | 0 | 0 | 0 |
db9db768de1234f47a531a57cf25915256070863 | 1,684 | py | Python | datacamp-master/22-introduction-to-time-series-analysis-in-python/03-autoregressive-ar-models/07-estimate-order-of-model-pacf.py | vitthal10/datacamp | 522d2b192656f7f6563bf6fc33471b048f1cf029 | [
"MIT"
] | 1 | 2021-01-31T20:51:10.000Z | 2021-01-31T20:51:10.000Z | 22-introduction-to-time-series-analysis-in-python/03-autoregressive-ar-models/07-estimate-order-of-model-pacf.py | AndreasFerox/DataCamp | 41525d7252f574111f4929158da1498ee1e73a84 | [
"MIT"
] | null | null | null | 22-introduction-to-time-series-analysis-in-python/03-autoregressive-ar-models/07-estimate-order-of-model-pacf.py | AndreasFerox/DataCamp | 41525d7252f574111f4929158da1498ee1e73a84 | [
"MIT"
] | 1 | 2021-08-08T05:09:52.000Z | 2021-08-08T05:09:52.000Z | '''
Estimate Order of Model: PACF
One useful tool to identify the order of an AR model is to look at the Partial Autocorrelation Function (PACF). In this exercise, you will simulate two time series, an AR(1) and an AR(2), and calculate the sample PACF for each. You will notice that for an AR(1), the PACF should have a... | 31.773585 | 444 | 0.75772 | '''
Estimate Order of Model: PACF
One useful tool to identify the order of an AR model is to look at the Partial Autocorrelation Function (PACF). In this exercise, you will simulate two time series, an AR(1) and an AR(2), and calculate the sample PACF for each. You will notice that for an AR(1), the PACF should have a... | 0 | 0 | 0 |
ee4edb51e31c2c2fc17e7203d12af29e83814fd7 | 16,717 | py | Python | utils/Player.py | mrccniv/Platformer-AI-preing1-Project | 2fbb579d6ee478dc2eade85f741bcc9ee1fdb0f2 | [
"MIT"
] | 1 | 2022-02-14T09:12:51.000Z | 2022-02-14T09:12:51.000Z | utils/Player.py | mrccniv/Platformer-AI-preing1-Project | 2fbb579d6ee478dc2eade85f741bcc9ee1fdb0f2 | [
"MIT"
] | null | null | null | utils/Player.py | mrccniv/Platformer-AI-preing1-Project | 2fbb579d6ee478dc2eade85f741bcc9ee1fdb0f2 | [
"MIT"
] | null | null | null | import pygame
import random
import math
import sys
import numpy as np
from utils.Brain import Brain
from utils.settings import *
import names
# Classe de joueur
| 40.872861 | 158 | 0.536759 | import pygame
import random
import math
import sys
import numpy as np
from utils.Brain import Brain
from utils.settings import *
import names
# Classe de joueur
class Player(Brain):
def __init__(self, name="no_name", displaySprites=True):
Brain.__init__(self)
self.name = names.get_first_name() if... | 15,262 | 1,305 | 23 |
75c2498655ef34c9876c09c77e6bdae5a9a7366a | 3,912 | py | Python | Prototype 1/RoutingOldv2.py | Taechasit1001/AU_SeniorProject_1 | 1eea2fa0c9f195f45f5b6a48b7ffd232fcf1d293 | [
"MIT"
] | null | null | null | Prototype 1/RoutingOldv2.py | Taechasit1001/AU_SeniorProject_1 | 1eea2fa0c9f195f45f5b6a48b7ffd232fcf1d293 | [
"MIT"
] | null | null | null | Prototype 1/RoutingOldv2.py | Taechasit1001/AU_SeniorProject_1 | 1eea2fa0c9f195f45f5b6a48b7ffd232fcf1d293 | [
"MIT"
] | null | null | null |
from PySide6.QtCore import *
from PySide6.QtGui import *
from PySide6.QtWidgets import *
import mido
# global variables
voiceMap = []
outPort = []
inPort = []
levelMap = [0, 31, 63, 95, 127]
| 30.325581 | 79 | 0.623978 |
from PySide6.QtCore import *
from PySide6.QtGui import *
from PySide6.QtWidgets import *
import mido
# global variables
voiceMap = []
outPort = []
inPort = []
levelMap = [0, 31, 63, 95, 127]
class reverbLevelCtrl:
reverbLevel = 0
msg = mido.Message.from_bytes([0xB0, 0x07, 0x00])
def onRevChanged(s... | 3,279 | 272 | 161 |
d47b83cfa5c20b4107312cfc97030d9d6a8f351b | 4,980 | py | Python | nlptk/duplicates/shingles/k_shingles.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/duplicates/shingles/k_shingles.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | nlptk/duplicates/shingles/k_shingles.py | GarryGaller/nlp_toolkit | df98ee25f8a1f4379e751fdd4fd9f5389ffbfd1b | [
"MIT"
] | null | null | null | # Сегалович, Зеленков Сравнительный анализ методов определения нечетких дубликатов для Web-документов
# http://rcdl2007.pereslavl.ru/papers/paper_65_v1.pdf
from pprint import pprint
from collections import Counter
import binascii
import math
def compare_dice(a,b):
'''мера Дайса 2nt/na + nb.'''
a = set(a)
... | 24.411765 | 103 | 0.576908 | # Сегалович, Зеленков Сравнительный анализ методов определения нечетких дубликатов для Web-документов
# http://rcdl2007.pereslavl.ru/papers/paper_65_v1.pdf
from pprint import pprint
from collections import Counter
import binascii
import math
def compare_dice(a,b):
'''мера Дайса 2nt/na + nb.'''
a = set(a)
... | 948 | 0 | 69 |
cfb397f33eef305efde044ad8f3fe007d06d4741 | 12,615 | py | Python | tests/test_providers.py | nvlbg/gepify | 2e937535e2835f6bd47cd8a6026dc7fe2c6c58ca | [
"MIT"
] | 7 | 2016-07-01T00:27:02.000Z | 2019-07-27T18:07:22.000Z | tests/test_providers.py | nvlbg/gepify | 2e937535e2835f6bd47cd8a6026dc7fe2c6c58ca | [
"MIT"
] | 5 | 2016-08-13T10:40:43.000Z | 2021-04-30T20:44:54.000Z | tests/test_providers.py | nvlbg/gepify | 2e937535e2835f6bd47cd8a6026dc7fe2c6c58ca | [
"MIT"
] | null | null | null | from unittest import mock, TestCase
from gepify.providers import songs, playlists, youtube, soundcloud
from werkzeug.contrib.cache import SimpleCache
import json
import time
import os
| 38.815385 | 79 | 0.653428 | from unittest import mock, TestCase
from gepify.providers import songs, playlists, youtube, soundcloud
from werkzeug.contrib.cache import SimpleCache
import json
import time
import os
class SongsTestCase(TestCase):
def setUp(self):
songs.cache = SimpleCache()
def test_get_song_if_song_is_not_in_cache... | 8,999 | 2,767 | 654 |
fdf26171be314fdef6c6a86880791a3772947938 | 262 | py | Python | algorithm/subsets/sol.py | shuding/leetcode-sol | 4757870f9ccff7cb72bd7fdb134c7435fc076e3d | [
"MIT"
] | 2 | 2015-12-10T07:26:15.000Z | 2016-05-24T10:32:06.000Z | algorithm/subsets/sol.py | quietshu/leetcode-sol | 4757870f9ccff7cb72bd7fdb134c7435fc076e3d | [
"MIT"
] | null | null | null | algorithm/subsets/sol.py | quietshu/leetcode-sol | 4757870f9ccff7cb72bd7fdb134c7435fc076e3d | [
"MIT"
] | 1 | 2020-05-23T02:50:09.000Z | 2020-05-23T02:50:09.000Z | # @param S, a list of integer
# @return a list of lists of integer
| 21.833333 | 51 | 0.458015 | class Solution:
# @param S, a list of integer
# @return a list of lists of integer
def subsets(self, S):
ans = [[]]
S.sort()
for s in S:
ans = ans + map(lambda x: x + [s], ans)
return ans
| 145 | -6 | 48 |
ba6859b68776d3b4a528d8870ed3f994edb845d3 | 14,262 | py | Python | sss_object_detection/scripts/sim_tf_lines.py | ShounakCy/smarc_perception | 37de967be6246dbfd588608d7cbf77112c785ed3 | [
"BSD-3-Clause"
] | null | null | null | sss_object_detection/scripts/sim_tf_lines.py | ShounakCy/smarc_perception | 37de967be6246dbfd588608d7cbf77112c785ed3 | [
"BSD-3-Clause"
] | null | null | null | sss_object_detection/scripts/sim_tf_lines.py | ShounakCy/smarc_perception | 37de967be6246dbfd588608d7cbf77112c785ed3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rospy
import numpy as np
import tf
import tf2_ros
import tf2_geometry_msgs
from nav_msgs.msg import Odometry
from vision_msgs.msg import ObjectHypothesisWithPose, Detection2DArray, Detection2D
from visualization_msgs.msg import Marker, MarkerArray
from std_msgs.msg import ColorRGBA
from ge... | 41.947059 | 141 | 0.650049 | #!/usr/bin/env python
import rospy
import numpy as np
import tf
import tf2_ros
import tf2_geometry_msgs
from nav_msgs.msg import Odometry
from vision_msgs.msg import ObjectHypothesisWithPose, Detection2DArray, Detection2D
from visualization_msgs.msg import Marker, MarkerArray
from std_msgs.msg import ColorRGBA
from ge... | 10,012 | 3,568 | 47 |
169f9c8edab47ec16880a28518bbf46727a59e02 | 427 | py | Python | detection/migrations/0006_file_name.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | 1 | 2021-08-01T00:17:56.000Z | 2021-08-01T00:17:56.000Z | detection/migrations/0006_file_name.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | 8 | 2021-03-30T13:17:39.000Z | 2022-03-12T00:28:19.000Z | detection/migrations/0006_file_name.py | omid-taj/Deepfake-Detection-Website | 8ba5cb5dda05df884a25120e7b2faffe900ca251 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-06 16:48
from django.db import migrations, models
| 22.473684 | 95 | 0.611241 | # Generated by Django 3.0.6 on 2020-05-06 16:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('detection', '0005_auto_20200506_0800'),
]
operations = [
migrations.AddField(
model_name='file',
name='name',
... | 0 | 313 | 23 |
c3b5e8b4c93fd023284385a4a696f9d207d93ace | 857 | py | Python | example.py | BaptisteLafoux/aztec_tiling | 413acd8751b8178942e91fbee32987f02bc5c695 | [
"MIT"
] | null | null | null | example.py | BaptisteLafoux/aztec_tiling | 413acd8751b8178942e91fbee32987f02bc5c695 | [
"MIT"
] | null | null | null | example.py | BaptisteLafoux/aztec_tiling | 413acd8751b8178942e91fbee32987f02bc5c695 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 22:20:17 2020
@author: baptistelafoux
"""
import shuffling_algorithm as sa
import matplotlib.pyplot as plt
import numpy as np
grid = {}
target_order = 75
curr_order = 1
while curr_order < target_order:
grid = sa.enlarge_grid(grid, cu... | 17.854167 | 57 | 0.656943 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 30 22:20:17 2020
@author: baptistelafoux
"""
import shuffling_algorithm as sa
import matplotlib.pyplot as plt
import numpy as np
grid = {}
target_order = 75
curr_order = 1
while curr_order < target_order:
grid = sa.enlarge_grid(grid, cu... | 0 | 0 | 0 |
8d9f1176d54f8fb08f3b6a1df5907c5bf55f97d3 | 42 | py | Python | event_detector/gttm/word_cloud/__init__.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/word_cloud/__init__.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | event_detector/gttm/word_cloud/__init__.py | MahdiFarnaghi/gtm | adbec372786262607291f901a444a0ebe9e98b48 | [
"Apache-2.0"
] | null | null | null | from .wordcloud import generate_wordcloud
| 21 | 41 | 0.880952 | from .wordcloud import generate_wordcloud
| 0 | 0 | 0 |
bbd316f47c40f65d6b6963c13209cc43089cb1d8 | 5,747 | py | Python | iostat.py | tsuiter/salt-beacon-iostat | db87ad82e41a5627e2856928032e5d3e208158fc | [
"Apache-2.0"
] | null | null | null | iostat.py | tsuiter/salt-beacon-iostat | db87ad82e41a5627e2856928032e5d3e208158fc | [
"Apache-2.0"
] | null | null | null | iostat.py | tsuiter/salt-beacon-iostat | db87ad82e41a5627e2856928032e5d3e208158fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Beacon to transmit exceeding diskstat threshold
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
import re
# Import Salt libs
import salt.utils
# Import Py3 compat
from salt.ext.six.moves import zip
log = logging.getLogger(__name__)
__virtualname_... | 31.404372 | 208 | 0.667653 | # -*- coding: utf-8 -*-
'''
Beacon to transmit exceeding diskstat threshold
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
import re
# Import Salt libs
import salt.utils
# Import Py3 compat
from salt.ext.six.moves import zip
log = logging.getLogger(__name__)
__virtualname_... | 5,276 | 0 | 138 |
7084cd92cd4b110c4522cd5771ba1fada0fba253 | 17,622 | py | Python | restraintlib/lib/deoxyribose_purine.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | null | null | null | restraintlib/lib/deoxyribose_purine.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | 1 | 2021-11-11T18:45:10.000Z | 2021-11-11T18:45:10.000Z | restraintlib/lib/deoxyribose_purine.py | mkowiel/restraintlib | 32de01d67ae290a45f3199e90c729acc258a6249 | [
"BSD-3-Clause"
] | null | null | null | DEOXYRIBOSE_PURINE_PDB_CODES = ['DA', 'DG']
DEOXYRIBOSE_PURINE_ALL_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_GAMMA_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_BASE_FUNC_OF_TORSION_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB... | 59.938776 | 213 | 0.607139 | DEOXYRIBOSE_PURINE_PDB_CODES = ['DA', 'DG']
DEOXYRIBOSE_PURINE_ALL_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_GAMMA_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB_CODES
DEOXYRIBOSE_PURINE_BASE_FUNC_OF_TORSION_CHI_PDB_CODES = DEOXYRIBOSE_PURINE_PDB... | 0 | 0 | 0 |
4a359b003d512ba7af0d82521f488c17a277d0a6 | 25,817 | py | Python | modules/stats.py | gmiranda/HTPC-Manager | 1db44826bb5344374c427d3c4ba1ca6b81910b13 | [
"MIT"
] | 1 | 2020-08-27T11:41:12.000Z | 2020-08-27T11:41:12.000Z | modules/stats.py | gmiranda/HTPC-Manager | 1db44826bb5344374c427d3c4ba1ca6b81910b13 | [
"MIT"
] | 4 | 2020-08-25T21:08:18.000Z | 2020-08-30T19:50:51.000Z | modules/stats.py | gmiranda/HTPC-Manager | 1db44826bb5344374c427d3c4ba1ca6b81910b13 | [
"MIT"
] | 2 | 2020-08-25T15:37:37.000Z | 2020-08-29T16:47:02.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import json
from datetime import datetime
import socket
import platform
import subprocess
import cherrypy
import htpc
import logging
import os
import requests
from htpc.auth2 import require, member_of
logger = logging.getLogger('modules.stats')
# Move to anot... | 37.524709 | 256 | 0.511988 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import json
from datetime import datetime
import socket
import platform
import subprocess
import cherrypy
import htpc
import logging
import os
import requests
from htpc.auth2 import require, member_of
logger = logging.getLogger('modules.stats')
# Move to anot... | 20,847 | 3,084 | 23 |
0e4c8f67dc3c5c812235842db515867eaa954ca8 | 3,446 | py | Python | back_corr.py | rathsidd/MAT-I | 2484d20854451b6966b17691b1f65315977971e7 | [
"MIT"
] | 1 | 2020-06-22T19:33:55.000Z | 2020-06-22T19:33:55.000Z | back_corr.py | rathsidd/MAT-I | 2484d20854451b6966b17691b1f65315977971e7 | [
"MIT"
] | null | null | null | back_corr.py | rathsidd/MAT-I | 2484d20854451b6966b17691b1f65315977971e7 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import scipy as scp
import matplotlib as mpl
from skimage import morphology
import cv2
import matplotlib.pyplot as pyplot
%matplotlib inline
def bckgrnd_correc_rect(image, row_len, col_len):
"""Background correction using a rectangular structuring element. This function uses ... | 37.868132 | 113 | 0.741149 | import numpy as np
import pandas as pd
import scipy as scp
import matplotlib as mpl
from skimage import morphology
import cv2
import matplotlib.pyplot as pyplot
%matplotlib inline
def bckgrnd_correc_rect(image, row_len, col_len):
"""Background correction using a rectangular structuring element. This function uses ... | 0 | 0 | 0 |
b6f6cba04c95192eedb8de4a8cd97764c5fedc28 | 15,739 | py | Python | app.py | explojoe/elektronika_bot | a27c75ecfe677dcefeb5bb492435e7011bd15ef4 | [
"MIT"
] | null | null | null | app.py | explojoe/elektronika_bot | a27c75ecfe677dcefeb5bb492435e7011bd15ef4 | [
"MIT"
] | null | null | null | app.py | explojoe/elektronika_bot | a27c75ecfe677dcefeb5bb492435e7011bd15ef4 | [
"MIT"
] | null | null | null | import os
import random
import time
import json
import datetime
from random import randint
from pyfiglet import figlet_format
from flask import Flask, g, session, redirect, request, url_for, jsonify
from requests_oauthlib import OAuth2Session
OAUTH2_CLIENT_ID = '456608429843283998' #os.environ['OAUTH2_CLIENT_ID']
OAUT... | 32.995807 | 165 | 0.595781 | import os
import random
import time
import json
import datetime
from random import randint
from pyfiglet import figlet_format
from flask import Flask, g, session, redirect, request, url_for, jsonify
from requests_oauthlib import OAuth2Session
OAUTH2_CLIENT_ID = '456608429843283998' #os.environ['OAUTH2_CLIENT_ID']
OAUT... | 13,110 | 0 | 135 |
43e559c3212ebd2c48d54b34c2fd24dbd598e563 | 179 | py | Python | debutizer/commands/upload_targets/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | 2 | 2022-03-08T01:53:20.000Z | 2022-03-08T01:53:26.000Z | debutizer/commands/upload_targets/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | 64 | 2021-10-19T01:03:43.000Z | 2022-01-02T18:42:46.000Z | debutizer/commands/upload_targets/__init__.py | velovix/debutizer | a56f269881e70cd50feea32134b2fa0e0d93a20c | [
"BSD-3-Clause"
] | null | null | null | from .abstract import UploadTarget
from .ppa import PPAUploadTarget
from .s3 import S3UploadTarget
__all__ = [
"UploadTarget",
"PPAUploadTarget",
"S3UploadTarget",
]
| 17.9 | 34 | 0.73743 | from .abstract import UploadTarget
from .ppa import PPAUploadTarget
from .s3 import S3UploadTarget
__all__ = [
"UploadTarget",
"PPAUploadTarget",
"S3UploadTarget",
]
| 0 | 0 | 0 |
ccbd96f0c329f8c4da87b45db578d6d222da2a6e | 288 | py | Python | chest.py | empea-careercriminal/the_pool | 2e20cf0ce08087b491760f284ce76ea181d97c0d | [
"MIT"
] | null | null | null | chest.py | empea-careercriminal/the_pool | 2e20cf0ce08087b491760f284ce76ea181d97c0d | [
"MIT"
] | null | null | null | chest.py | empea-careercriminal/the_pool | 2e20cf0ce08087b491760f284ce76ea181d97c0d | [
"MIT"
] | 3 | 2021-04-05T15:25:05.000Z | 2021-04-05T15:25:18.000Z | class Chest(object):
"""Take in items and handle opening and closing of chests and loot.
* Treasure Chest
* Storage Chest
"""
| 24 | 71 | 0.614583 | class Chest(object):
"""Take in items and handle opening and closing of chests and loot.
* Treasure Chest
* Storage Chest
"""
def __init__(self, name, content, key, type):
self.name = name
self.content = content
def open_chest(self):
pass
| 93 | 0 | 53 |
019380f6bd455c7bd4774660d695153598ded6cc | 2,954 | py | Python | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/reservation/collection.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.utils import normalize_for_url
from onegov.reservation.models import Resource
from uuid import uuid4
any_type = object()
class ResourceCollection(object):
""" Manages a list of resources.
"""
| 32.108696 | 79 | 0.649628 | from onegov.core.utils import normalize_for_url
from onegov.reservation.models import Resource
from uuid import uuid4
any_type = object()
class ResourceCollection(object):
""" Manages a list of resources.
"""
def __init__(self, libres_context):
assert hasattr(libres_context, 'get_service'), """... | 2,490 | 0 | 242 |
e8be864a21312e28a9f4e1e7ee852395b169aa2e | 5,974 | py | Python | labs7_med_dash_project/rx_info/views.py | Lambda-School-Labs/CS10-medical-dashboard | 71a0acf4c45aab976797db60a3acf60c739e7e3e | [
"MIT"
] | 3 | 2018-09-13T22:49:33.000Z | 2018-09-27T23:35:43.000Z | labs7_med_dash_project/rx_info/views.py | Lambda-School-Labs/CS10-medical-dashboard | 71a0acf4c45aab976797db60a3acf60c739e7e3e | [
"MIT"
] | null | null | null | labs7_med_dash_project/rx_info/views.py | Lambda-School-Labs/CS10-medical-dashboard | 71a0acf4c45aab976797db60a3acf60c739e7e3e | [
"MIT"
] | 2 | 2018-09-20T21:04:11.000Z | 2019-03-21T21:44:15.000Z | from django.shortcuts import render
from . import forms
from .models import rx_claim
import pandas as pd
#from .models import rx_claim, CSVrxData
# Home page
# Background code page
# Local pharmay search page
# PBM search page
# Pharmacy results page
| 47.03937 | 145 | 0.718279 | from django.shortcuts import render
from . import forms
from .models import rx_claim
import pandas as pd
#from .models import rx_claim, CSVrxData
# Home page
def home(request):
return render(request, 'rx_info/home.html', {})
# Background code page
def background(request):
return render(request, 'rx_info/back... | 5,584 | 0 | 133 |
dfa21a96b8679ded9b510b90b3f0263256f25c92 | 583 | py | Python | tan-rad.py | sprightlyManifesto/cadQuery2 | 207a1ff2420210460539400dfd1945e8b7245497 | [
"MIT"
] | 1 | 2021-05-31T00:08:02.000Z | 2021-05-31T00:08:02.000Z | tan-rad.py | sprightlyManifesto/cadQuery2 | 207a1ff2420210460539400dfd1945e8b7245497 | [
"MIT"
] | null | null | null | tan-rad.py | sprightlyManifesto/cadQuery2 | 207a1ff2420210460539400dfd1945e8b7245497 | [
"MIT"
] | null | null | null | from cadquery import *
from math import sin,cos,pi
cutAngle = 100
cutBase = 1
cutWidth = 8
cutRad = 0.2
x1,y1 = -cutBase/2 , 0
theta = pi*(cutAngle/2)/180
rtheta = (pi/2 - theta)
log(rtheta*180/pi)
x2,y2 = (-cutRad * sin(rtheta) + x1 , cutRad - cutRad * cos(rtheta))
x3,y3 = -cutWidth/2, (cutWidth/2- y2)*sin(rtheta... | 27.761905 | 102 | 0.662093 | from cadquery import *
from math import sin,cos,pi
cutAngle = 100
cutBase = 1
cutWidth = 8
cutRad = 0.2
x1,y1 = -cutBase/2 , 0
theta = pi*(cutAngle/2)/180
rtheta = (pi/2 - theta)
log(rtheta*180/pi)
x2,y2 = (-cutRad * sin(rtheta) + x1 , cutRad - cutRad * cos(rtheta))
x3,y3 = -cutWidth/2, (cutWidth/2- y2)*sin(rtheta... | 0 | 0 | 0 |
e43c667878c1fb44376c0d94679f2dd468266a63 | 1,102 | py | Python | src/trw/datasets/utils.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | 3 | 2019-07-04T01:20:41.000Z | 2020-01-27T02:36:12.000Z | src/trw/datasets/utils.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | null | null | null | src/trw/datasets/utils.py | civodlu/trw | b9a1cf045f61d6df9c65c014ef63b4048972dcdc | [
"MIT"
] | 2 | 2020-10-19T13:46:06.000Z | 2021-12-27T02:18:10.000Z | import numpy as np
import torch
from PIL.Image import Image
from PIL import Image
import torchvision
| 29 | 95 | 0.678766 | import numpy as np
import torch
from PIL.Image import Image
from PIL import Image
import torchvision
def pic_to_tensor(pic: Image) -> torch.Tensor:
assert isinstance(pic, Image), 'image must be a PIL Image'
i = np.array(pic)
if len(i.shape) == 2:
i = np.reshape(i, [i.shape[0], i.shape[1], 1])
... | 929 | 0 | 69 |