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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b37a36165d8a565e7ef58c73d3865778e5624f9f | 1,378 | py | Python | project/tests/test_referral.py | TobiasPrt/Smartphoniker-shop | 6b74a3cc1c81db7a56d70609dbca29ddeec3053f | [
"MIT"
] | 2 | 2020-05-11T08:46:45.000Z | 2020-05-11T09:09:57.000Z | project/tests/test_referral.py | TobiasPrt/Smartphoniker-shop | 6b74a3cc1c81db7a56d70609dbca29ddeec3053f | [
"MIT"
] | 4 | 2021-02-19T13:31:53.000Z | 2022-02-20T13:34:10.000Z | project/tests/test_referral.py | TobiasPrt/Smartphoniker-shop | 6b74a3cc1c81db7a56d70609dbca29ddeec3053f | [
"MIT"
] | 5 | 2020-04-27T16:25:39.000Z | 2020-06-07T16:03:15.000Z | from project.server.config import RAIDER_CONFIG
from project.server.shop.actions import track_payment, perform_post_complete_actions
| 37.243243 | 105 | 0.683599 | from project.server.config import RAIDER_CONFIG
from project.server.shop.actions import track_payment, perform_post_complete_actions
class TestReferral:
def test_raider_config(self, app):
assert RAIDER_CONFIG['host']
assert RAIDER_CONFIG['track_token']
assert RAIDER_CONFIG['defau... | 1,102 | -2 | 141 |
e48abadfedd490282f6f93a8ddaa2ed4547c2067 | 622 | py | Python | EbfWriterLib.py | fermi-lat/EbfWriter | ede39be090864de859e21103bd862839cbf4116a | [
"BSD-3-Clause"
] | null | null | null | EbfWriterLib.py | fermi-lat/EbfWriter | ede39be090864de859e21103bd862839cbf4116a | [
"BSD-3-Clause"
] | null | null | null | EbfWriterLib.py | fermi-lat/EbfWriter | ede39be090864de859e21103bd862839cbf4116a | [
"BSD-3-Clause"
] | null | null | null | #$Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/EbfWriter/EbfWriterLib.py,v 1.3 2009/11/13 23:20:55 jrb Exp $
| 36.588235 | 119 | 0.646302 | #$Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/EbfWriter/EbfWriterLib.py,v 1.3 2009/11/13 23:20:55 jrb Exp $
def generate(env, **kw):
if not kw.get('depsOnly', 0):
env.Tool('addLibrary', library = ['EbfWriter'])
if env['PLATFORM']=='win32' and env.get('CONTAINERNAME','')=='GlastRelease':
... | 458 | 0 | 44 |
3f090c825452547dfa25b58d3c0bf2f6280faf90 | 826 | py | Python | source_code/3-2-download.py | VickyMin1994/easy-scraping-tutorial | 75b7ffc79da397afa95342022c29cd72520f155f | [
"MIT"
] | 708 | 2017-12-29T05:32:34.000Z | 2022-03-25T14:29:05.000Z | source_code/3-2-download.py | VickyMin1994/easy-scraping-tutorial | 75b7ffc79da397afa95342022c29cd72520f155f | [
"MIT"
] | 6 | 2018-01-06T07:58:31.000Z | 2020-10-26T15:57:46.000Z | source_code/3-2-download.py | VickyMin1994/easy-scraping-tutorial | 75b7ffc79da397afa95342022c29cd72520f155f | [
"MIT"
] | 609 | 2017-12-29T10:04:20.000Z | 2022-03-23T18:32:37.000Z | import os
os.makedirs('./img/', exist_ok=True)
IMAGE_URL = "https://mofanpy.com/static/img/description/learning_step_flowchart.png"
urllib_download()
print('download image1')
request_download()
print('download image2')
chunk_download()
print('download image3')
| 23.6 | 84 | 0.670702 | import os
os.makedirs('./img/', exist_ok=True)
IMAGE_URL = "https://mofanpy.com/static/img/description/learning_step_flowchart.png"
def urllib_download():
from urllib.request import urlretrieve
urlretrieve(IMAGE_URL, './img/image1.png') # whole document
def request_download():
import requests
... | 489 | 0 | 69 |
f618f30d898e855661bab363571158a5c6d1619b | 1,448 | py | Python | test/test_basic.py | ajnelson-nist/OWL-RL | a77e1791b88b54aace609bc6000aac14c7add4ff | [
"W3C-20150513"
] | 94 | 2015-01-12T15:37:57.000Z | 2022-02-16T15:29:20.000Z | test/test_basic.py | ajnelson-nist/OWL-RL | a77e1791b88b54aace609bc6000aac14c7add4ff | [
"W3C-20150513"
] | 44 | 2015-10-05T15:12:12.000Z | 2022-02-23T11:57:19.000Z | test/test_basic.py | ajnelson-nist/OWL-RL | a77e1791b88b54aace609bc6000aac14c7add4ff | [
"W3C-20150513"
] | 24 | 2015-02-16T15:06:00.000Z | 2022-01-18T22:35:36.000Z | from rdflib import Graph, Namespace
from rdflib.namespace import RDF
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
import owlrl
RELS = Namespace("http://example.org/relatives#")
| 29.55102 | 95 | 0.68163 | from rdflib import Graph, Namespace
from rdflib.namespace import RDF
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
import owlrl
RELS = Namespace("http://example.org/relatives#")
def test_basic():
# create an RDF graph, load a simple OWL ontology and data
g = Graph()
... | 1,203 | 0 | 23 |
6ea45be4843a9d0b375de22e509a1fc5e871aee5 | 404 | py | Python | test/test_add_contact_to_group.py | dmatveev-issart/python_training | fd88d11ded7e3e591899aa3ceaa99d0f0193e0c8 | [
"Apache-2.0"
] | null | null | null | test/test_add_contact_to_group.py | dmatveev-issart/python_training | fd88d11ded7e3e591899aa3ceaa99d0f0193e0c8 | [
"Apache-2.0"
] | null | null | null | test/test_add_contact_to_group.py | dmatveev-issart/python_training | fd88d11ded7e3e591899aa3ceaa99d0f0193e0c8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from model.contact import Contact
import random
| 33.666667 | 64 | 0.737624 | # -*- coding: utf-8 -*-
from model.contact import Contact
import random
def test_add_contact_to_group(app, db):
contacts_list = db.get_contact_list()
index = len(contacts_list)
contact = random.choice(contacts_list)
app.contact.add_contact_to_group_by_id(contact.id)
#print("added = ", db.get_conta... | 309 | 0 | 23 |
57d4a2b839f3a26c63aaace92e459f0761066e9d | 7,481 | py | Python | virtual_box_tools/host_configuration.py | FunTimeCoding/virtualbox-tools | bc6b4ad90d711fda64f76275f65e6c01ae3caa3f | [
"MIT"
] | 4 | 2017-08-05T10:51:34.000Z | 2019-06-24T02:56:31.000Z | virtual_box_tools/host_configuration.py | FunTimeCoding/virtualbox-tools | bc6b4ad90d711fda64f76275f65e6c01ae3caa3f | [
"MIT"
] | null | null | null | virtual_box_tools/host_configuration.py | FunTimeCoding/virtualbox-tools | bc6b4ad90d711fda64f76275f65e6c01ae3caa3f | [
"MIT"
] | 1 | 2017-08-05T09:23:51.000Z | 2017-08-05T09:23:51.000Z | from argparse import ArgumentDefaultsHelpFormatter
from collections import OrderedDict
from os.path import expanduser, isfile
from sys import exit as system_exit, argv
from virtual_box_tools.custom_argument_parser import CustomArgumentParser
from virtual_box_tools.yaml_config import YamlConfig
from yaml import load, d... | 33.850679 | 79 | 0.604197 | from argparse import ArgumentDefaultsHelpFormatter
from collections import OrderedDict
from os.path import expanduser, isfile
from sys import exit as system_exit, argv
from virtual_box_tools.custom_argument_parser import CustomArgumentParser
from virtual_box_tools.yaml_config import YamlConfig
from yaml import load, d... | 6,735 | 398 | 23 |
63f105f4ce40e1dfa2fcab6b3de4699cbf199fe8 | 1,598 | py | Python | survey/features/page_objects/accounts.py | ericazhou7/uSurvey | 1236f33355662957e7e1e769dde1811b910673a5 | [
"BSD-3-Clause"
] | 5 | 2016-08-25T12:48:54.000Z | 2018-08-16T22:49:43.000Z | survey/features/page_objects/accounts.py | ericazhou7/uSurvey | 1236f33355662957e7e1e769dde1811b910673a5 | [
"BSD-3-Clause"
] | 2 | 2016-08-11T06:43:56.000Z | 2016-12-08T09:11:36.000Z | survey/features/page_objects/accounts.py | ericazhou7/uSurvey | 1236f33355662957e7e1e769dde1811b910673a5 | [
"BSD-3-Clause"
] | 7 | 2016-09-16T11:03:44.000Z | 2020-10-28T22:01:20.000Z | # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from survey.features.page_objects.base import PageObject
from survey.features.page_objects.root import AboutPage, HomePage
from lettuce.django import django_url
| 30.730769 | 80 | 0.69587 | # vim: ai ts=4 sts=4 et sw=4 encoding=utf-8
from survey.features.page_objects.base import PageObject
from survey.features.page_objects.root import AboutPage, HomePage
from lettuce.django import django_url
class ResetPasswordPage(PageObject):
url = '/accounts/reset_password/'
def is_change_password_form_visb... | 1,006 | 314 | 69 |
1ccbbad3d2e24da899bb1e19744c8c8cb1aae1c3 | 6,655 | py | Python | happ.py | yethranayeh/Daily-Mood-Rater | 0bf2ee688d066dd01bb388e00172a2d9e15ec043 | [
"MIT"
] | null | null | null | happ.py | yethranayeh/Daily-Mood-Rater | 0bf2ee688d066dd01bb388e00172a2d9e15ec043 | [
"MIT"
] | null | null | null | happ.py | yethranayeh/Daily-Mood-Rater | 0bf2ee688d066dd01bb388e00172a2d9e15ec043 | [
"MIT"
] | 1 | 2021-10-04T10:18:04.000Z | 2021-10-04T10:18:04.000Z | # Credits
# "faces" icon created by Vector Valley, PK from the Noun Project
# https://thenounproject.com/term/faces/4127357/
import sys, mood_db, json
from datetime import datetime
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QWidget
from PyQt5.QtGui import QIcon, QPalette, QColor
from interfac... | 39.378698 | 252 | 0.632006 | # Credits
# "faces" icon created by Vector Valley, PK from the Noun Project
# https://thenounproject.com/term/faces/4127357/
import sys, mood_db, json
from datetime import datetime
from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QWidget
from PyQt5.QtGui import QIcon, QPalette, QColor
from interfac... | 5,339 | 10 | 211 |
ac69101e3fa1b98949a2121985c8eb222eafe06e | 15,564 | py | Python | samples/digitrec/digitrec_main.py | zzzDavid/heterocl | 977aae575d54a30c5bf6d869e8f71bdc815cf7e9 | [
"Apache-2.0"
] | 236 | 2019-05-19T01:48:11.000Z | 2022-03-31T09:03:54.000Z | samples/digitrec/digitrec_main.py | zzzDavid/heterocl | 977aae575d54a30c5bf6d869e8f71bdc815cf7e9 | [
"Apache-2.0"
] | 248 | 2019-05-17T19:18:36.000Z | 2022-03-30T21:25:47.000Z | samples/digitrec/digitrec_main.py | AlgaPeng/heterocl-2 | b5197907d1fe07485466a63671a2a906a861c939 | [
"Apache-2.0"
] | 85 | 2019-05-17T20:09:27.000Z | 2022-02-28T20:19:00.000Z | # -*- coding: utf-8 -*-
"""
HeteroCL Tutorial : K-Nearest-Neighbor Digit Recognition
========================================================
**Author**: Yi-Hsiang Lai (seanlatias@github)
HeteroCL is a domain-specific language (DSL) based on TVM that supports
heterogeneous backend devices. Moreover, HeteroCL also sup... | 37.960976 | 83 | 0.587831 | # -*- coding: utf-8 -*-
"""
HeteroCL Tutorial : K-Nearest-Neighbor Digit Recognition
========================================================
**Author**: Yi-Hsiang Lai (seanlatias@github)
HeteroCL is a domain-specific language (DSL) based on TVM that supports
heterogeneous backend devices. Moreover, HeteroCL also sup... | 3,212 | 0 | 45 |
363f7c40b5d9c31f1a5a5d929926532b5504ef4e | 1,072 | py | Python | Project 1/Codes/main2.py | snehanyk05/Statistical-Pattern-Recognition | da457705a11713782a4522e0f2cfb801d5287e64 | [
"MIT"
] | null | null | null | Project 1/Codes/main2.py | snehanyk05/Statistical-Pattern-Recognition | da457705a11713782a4522e0f2cfb801d5287e64 | [
"MIT"
] | null | null | null | Project 1/Codes/main2.py | snehanyk05/Statistical-Pattern-Recognition | da457705a11713782a4522e0f2cfb801d5287e64 | [
"MIT"
] | null | null | null | from utils.mnist_reader import *
import pca
import lda
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
Xtrain_m, Ytrain = load_mnist('data/fashion', kind='train')
Xtest_m, Ytest = load_mnist('data/fashion', kind='t10k')
classifier = KNeighborsClassifier(n_neighbors=... | 26.8 | 102 | 0.716418 | from utils.mnist_reader import *
import pca
import lda
import numpy as np
from sklearn.neighbors import KNeighborsClassifier
def score(classifier, X, Y, type1):
P = classifier.predict(X)
return np.round(np.mean(P == Y),4)
Xtrain_m, Ytrain = load_mnist('data/fashion', kind='tra... | 91 | 0 | 23 |
f6bdfba3beb10ee1c632bff22572c7d8363a6a89 | 1,051 | py | Python | projetinhos/ex#45 - GAME pedra papel tesoura.py | dani-fn/Projetinhos_Python | 692ff0a7f57d8f8f2e28f7b2c38bb6401e013bdb | [
"MIT"
] | null | null | null | projetinhos/ex#45 - GAME pedra papel tesoura.py | dani-fn/Projetinhos_Python | 692ff0a7f57d8f8f2e28f7b2c38bb6401e013bdb | [
"MIT"
] | null | null | null | projetinhos/ex#45 - GAME pedra papel tesoura.py | dani-fn/Projetinhos_Python | 692ff0a7f57d8f8f2e28f7b2c38bb6401e013bdb | [
"MIT"
] | null | null | null | from random import choice
from time import sleep
from sys import exit
print('''Suas opções:
\033[30m[ 1 ] PEDRA
[ 2 ] PAPEL
[ 3 ] TESOURA\33[m''')
jogada = int(input('Qual a sua jogada? '))
if jogada == 1:
jogada = 'PEDRA'
elif jogada == 2:
jogada = 'PAPEL'
elif jogada == 3:
jogada = 'TESOURA'
... | 29.194444 | 72 | 0.602284 | from random import choice
from time import sleep
from sys import exit
print('''Suas opções:
\033[30m[ 1 ] PEDRA
[ 2 ] PAPEL
[ 3 ] TESOURA\33[m''')
jogada = int(input('Qual a sua jogada? '))
if jogada == 1:
jogada = 'PEDRA'
elif jogada == 2:
jogada = 'PAPEL'
elif jogada == 3:
jogada = 'TESOURA'
... | 0 | 0 | 0 |
a42fa9f0cfa3541087006e749001845830cb5828 | 1,588 | py | Python | Medium/Palendrome/main.py | darthjamil/LeetStuff | e32bcb180f2a36cbd12d97998680929c593573d0 | [
"CC0-1.0"
] | null | null | null | Medium/Palendrome/main.py | darthjamil/LeetStuff | e32bcb180f2a36cbd12d97998680929c593573d0 | [
"CC0-1.0"
] | null | null | null | Medium/Palendrome/main.py | darthjamil/LeetStuff | e32bcb180f2a36cbd12d97998680929c593573d0 | [
"CC0-1.0"
] | null | null | null | chars_to_remove = [',', '.', '!', ':', ';', '-', ' ', '?']
if __name__ == '__main__':
tests = [
"", # false
"lotion", # false
"racecar", # true
"Racecar", # true
"Step on no p ets", # true
"No lemon no melons", # false
"Eva - can I see bees in a cave?", #... | 26.915254 | 82 | 0.554156 | chars_to_remove = [',', '.', '!', ':', ';', '-', ' ', '?']
def get_longest_palendromes(text):
if not text: return []
if len(text) <= 2: return [text]
palendromes = []
for window_size in range(len(text), 1, -1):
num_shifts = len(text) - window_size
for start_index in range(0, num_shif... | 694 | 0 | 92 |
05a28ae40a3d94b62f58af8eb1973a1e1d7d3bac | 34,199 | py | Python | debt_manager_backend/debt_manager_backend_api/tests.py | GeorgeS1995/debt_manager_backend | b7dad55e5a86a87619ab528eea81a2e59f9ffbaf | [
"MIT"
] | null | null | null | debt_manager_backend/debt_manager_backend_api/tests.py | GeorgeS1995/debt_manager_backend | b7dad55e5a86a87619ab528eea81a2e59f9ffbaf | [
"MIT"
] | 7 | 2020-11-19T19:55:24.000Z | 2021-09-22T18:47:38.000Z | debt_manager_backend/debt_manager_backend_api/tests.py | GeorgeS1995/debt_manager_backend | b7dad55e5a86a87619ab528eea81a2e59f9ffbaf | [
"MIT"
] | null | null | null | import json
from django.contrib.auth import get_user_model
from rest_framework.test import APITestCase, APIClient
from oauth2_provider.models import AccessToken, Application
from django.utils import timezone
from .models import Currency, Debtor, Transaction, CurrencyOwner
from rest_framework.reverse import reverse
from... | 38.125975 | 120 | 0.584695 | import json
from django.contrib.auth import get_user_model
from rest_framework.test import APITestCase, APIClient
from oauth2_provider.models import AccessToken, Application
from django.utils import timezone
from .models import Currency, Debtor, Transaction, CurrencyOwner
from rest_framework.reverse import reverse
from... | 31,871 | 121 | 1,407 |
74eba63c8e0962eba857ab3f9dc8dde68140756b | 1,656 | py | Python | Search/DStarGrid.py | jabbala/AI-for-Robotics | 8fdb2549138f470baf4ecf61d74752622389d222 | [
"MIT"
] | 1 | 2022-01-29T10:25:28.000Z | 2022-01-29T10:25:28.000Z | Search/DStarGrid.py | jabbala/AI-for-Robotics | 8fdb2549138f470baf4ecf61d74752622389d222 | [
"MIT"
] | 2 | 2022-01-29T16:20:27.000Z | 2022-01-29T19:30:08.000Z | Search/DStarGrid.py | jabbala/AI-for-Robotics | 8fdb2549138f470baf4ecf61d74752622389d222 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Localization_1D.py: Localizing robot in Two dimensional space"""
__author__ ="Gunasekar Jabbala"
__credits__ =["Daniel Ingram", "Udacity", " AtsushiSakai"]
import random
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animatio... | 29.571429 | 84 | 0.520531 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Localization_1D.py: Localizing robot in Two dimensional space"""
__author__ ="Gunasekar Jabbala"
__credits__ =["Daniel Ingram", "Udacity", " AtsushiSakai"]
import random
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animatio... | 716 | 0 | 22 |
d04a77a78c1f367bfaf7d3b3e933407afd2256ec | 39,105 | py | Python | SUAVE/Tutorials-2.5.0/tut_mission_B737.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/Tutorials-2.5.0/tut_mission_B737.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | SUAVE/Tutorials-2.5.0/tut_mission_B737.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | # tut_mission_B737.py
#
# Created: Aug 2014, SUAVE Team
# Modified: Aug 2017, SUAVE Team
# Mar 2020, E. Botero
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
# General Python Imports
import numpy... | 40.314433 | 100 | 0.554763 | # tut_mission_B737.py
#
# Created: Aug 2014, SUAVE Team
# Modified: Aug 2017, SUAVE Team
# Mar 2020, E. Botero
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
# General Python Imports
import numpy... | 0 | 0 | 0 |
f7a587abc392d6fc3e8aa9b34ccf761cac91630c | 7,048 | py | Python | python/ccxt/static_dependencies/ecdsa/der.py | orikalinski/ccxt_new | 318caa4f8db7ffb719edab2c060a0989d2a9cd28 | [
"MIT"
] | 26 | 2018-12-10T07:16:35.000Z | 2022-03-15T03:15:54.000Z | python/ccxt/static_dependencies/ecdsa/der.py | orikalinski/ccxt_new | 318caa4f8db7ffb719edab2c060a0989d2a9cd28 | [
"MIT"
] | 4 | 2020-09-07T14:47:15.000Z | 2021-05-10T17:47:05.000Z | python/ccxt/static_dependencies/ecdsa/der.py | orikalinski/ccxt_new | 318caa4f8db7ffb719edab2c060a0989d2a9cd28 | [
"MIT"
] | 13 | 2019-03-13T14:54:30.000Z | 2021-10-14T10:11:49.000Z | from __future__ import division
import binascii
import base64
from six import int2byte, b, integer_types, text_type
# SEQUENCE([1, STRING(secexp), cont[0], OBJECT(curvename), cont[1], BINTSTRING)
# signatures: (from RFC3279)
# ansi-X9-62 OBJECT IDENTIFIER ::= {
# iso(1) member-body(2) us(84... | 31.605381 | 97 | 0.617054 | from __future__ import division
import binascii
import base64
from six import int2byte, b, integer_types, text_type
class UnexpectedDER(Exception):
pass
def encode_constructed(tag, value):
return int2byte(0xa0+tag) + encode_length(len(value)) + value
def encode_integer(r):
assert r >= 0 # can't supp... | 5,542 | 19 | 437 |
557230df224a88d7d7ea836b63a9e13606869a07 | 45 | py | Python | app/core/enums.py | behibobo/openvpn_monitoring | a2b7b2c440ddd1a94f6c3a21d41e847498364e3d | [
"MIT"
] | null | null | null | app/core/enums.py | behibobo/openvpn_monitoring | a2b7b2c440ddd1a94f6c3a21d41e847498364e3d | [
"MIT"
] | null | null | null | app/core/enums.py | behibobo/openvpn_monitoring | a2b7b2c440ddd1a94f6c3a21d41e847498364e3d | [
"MIT"
] | 1 | 2021-11-20T19:30:29.000Z | 2021-11-20T19:30:29.000Z | # add your enums here
from enum import Enum
| 11.25 | 21 | 0.755556 | # add your enums here
from enum import Enum
| 0 | 0 | 0 |
810a2b09dcfd4d9a59685a2093ec4bd2cb86493d | 8,250 | py | Python | fst/romanian/operations.py | ytsvetko/loanwords | dfe83ef9ccc5b6d70b87a9da0414e6737b922ab3 | [
"Apache-2.0"
] | null | null | null | fst/romanian/operations.py | ytsvetko/loanwords | dfe83ef9ccc5b6d70b87a9da0414e6737b922ab3 | [
"Apache-2.0"
] | null | null | null | fst/romanian/operations.py | ytsvetko/loanwords | dfe83ef9ccc5b6d70b87a9da0414e6737b922ab3 | [
"Apache-2.0"
] | 1 | 2019-01-15T03:34:27.000Z | 2019-01-15T03:34:27.000Z | # -*- coding: utf-8 -*-
import phone_transducer as pt
import itertools
def phone_substitution_transducer(add_meta_arc=True):
"""Substitute similar phones (optionally)."""
max_node = 0
t = pt.Transducer()
for l in pt.abc.ALL_SYMS:
t.add_arc(0, 0, l, l)
for s_ar, s_sw, subst_cost in pt.abc.AR_SW_SIMILA... | 32.868526 | 107 | 0.658303 | # -*- coding: utf-8 -*-
import phone_transducer as pt
import itertools
def phone_substitution_transducer(add_meta_arc=True):
"""Substitute similar phones (optionally)."""
def DetectViolation(l_ar, l_sw, group):
if l_ar == pt.abc.EPSILON or l_sw == pt.abc.EPSILON:
return False
if group[l_ar] != group... | 164 | 0 | 24 |
43837eef051b992f7a3209fc2a3a764a3e2dc1d2 | 626 | py | Python | 2-Work_queues/new_task.py | MaiconMares/RabbitMQ-Distributed-Programming | de7e8192847fc3afd9234b113eb7d88c275d1e25 | [
"MIT"
] | null | null | null | 2-Work_queues/new_task.py | MaiconMares/RabbitMQ-Distributed-Programming | de7e8192847fc3afd9234b113eb7d88c275d1e25 | [
"MIT"
] | null | null | null | 2-Work_queues/new_task.py | MaiconMares/RabbitMQ-Distributed-Programming | de7e8192847fc3afd9234b113eb7d88c275d1e25 | [
"MIT"
] | null | null | null | import pika, sys
# Inicia a conexão e cria o canal de conexao
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
# Cria a fila se ela não existir
channel.queue_declare(queue='task_queue', durable=True)
message = ' '.join(sys.argv[1:]) or 'Hello World...'
chan... | 28.454545 | 76 | 0.645367 | import pika, sys
# Inicia a conexão e cria o canal de conexao
connection = pika.BlockingConnection(pika.ConnectionParameters('localhost'))
channel = connection.channel()
# Cria a fila se ela não existir
channel.queue_declare(queue='task_queue', durable=True)
message = ' '.join(sys.argv[1:]) or 'Hello World...'
chan... | 0 | 0 | 0 |
6a37fd58b3ae0d0d668d59059a6bb1a2aec10c05 | 4,301 | py | Python | tests/components/version/test_sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | tests/components/version/test_sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/version/test_sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """The test for the version sensor platform."""
from __future__ import annotations
from typing import Any
from unittest.mock import patch
from pyhaversion import HaVersionChannel, HaVersionSource
from pyhaversion.exceptions import HaVersionException
import pytest
from homeassistant.components.version.const import (
... | 31.859259 | 78 | 0.656126 | """The test for the version sensor platform."""
from __future__ import annotations
from typing import Any
from unittest.mock import patch
from pyhaversion import HaVersionChannel, HaVersionSource
from pyhaversion.exceptions import HaVersionException
import pytest
from homeassistant.components.version.const import (
... | 0 | 0 | 0 |
8c7cbbd7dace0cec34238f26bec2d9cc4b8fb586 | 685 | py | Python | String Manipulation/SpecialStringAgain.py | WinterSoldier13/interview-preparation-kit | 64e56725c1a8af17c209bb3191227935b05f6227 | [
"MIT"
] | 175 | 2019-12-08T19:48:20.000Z | 2022-03-24T07:38:08.000Z | String Manipulation/SpecialStringAgain.py | WinterSoldier13/interview-preparation-kit | 64e56725c1a8af17c209bb3191227935b05f6227 | [
"MIT"
] | 40 | 2019-12-07T08:11:41.000Z | 2020-10-09T08:11:22.000Z | String Manipulation/SpecialStringAgain.py | WinterSoldier13/interview-preparation-kit | 64e56725c1a8af17c209bb3191227935b05f6227 | [
"MIT"
] | 95 | 2019-12-07T06:25:31.000Z | 2022-03-03T20:12:45.000Z | #!/bin/python3
import os
import itertools as it
# Complete the substrCount function below.
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
s = input()
result = substrCount(n, s)
fptr.write(str(result) + '\n')
fptr.close()
| 21.40625 | 54 | 0.491971 | #!/bin/python3
import os
import itertools as it
# Complete the substrCount function below.
def substrCount(n, s):
if n == 1:
return 1
s = [list(g) for k, g in it.groupby(s)]
res = sum([int(len(i)*(len(i)+1)/2) for i in s])
for i in range(len(s)):
if i == 0 or i == l... | 349 | 0 | 23 |
a3f0273346a8278f04244a2c77ce314bff0cac57 | 1,586 | py | Python | tests/kiss_test_classes.py | xssfox/kiss | 3d8b39f3e0dbf866b2530dcfac2df177c6fd07e3 | [
"Apache-2.0"
] | 76 | 2015-01-18T01:45:47.000Z | 2022-02-01T00:04:02.000Z | tests/kiss_test_classes.py | xssfox/kiss | 3d8b39f3e0dbf866b2530dcfac2df177c6fd07e3 | [
"Apache-2.0"
] | 10 | 2015-04-04T02:19:30.000Z | 2021-08-30T18:27:34.000Z | tests/kiss_test_classes.py | xssfox/kiss | 3d8b39f3e0dbf866b2530dcfac2df177c6fd07e3 | [
"Apache-2.0"
] | 38 | 2015-03-12T04:14:30.000Z | 2022-03-20T14:03:45.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for KISS Classes."""
import logging
import random
import unittest
import aprs
from .context import kiss
from . import constants
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>' # NOQA pylint: disable=R0801
__copyright__ = 'Copyright 2017 Greg Albrecht and ... | 32.367347 | 93 | 0.688525 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for KISS Classes."""
import logging
import random
import unittest
import aprs
from .context import kiss
from . import constants
__author__ = 'Greg Albrecht W2GMD <oss@undef.net>' # NOQA pylint: disable=R0801
__copyright__ = 'Copyright 2017 Greg Albrecht and ... | 53 | 0 | 26 |
ae8d6e961774823174c508eb00e995d52646126f | 3,166 | py | Python | cpp_linter/__init__.py | DingXuefeng/cpp-linter-action | 9a09cb0d0c17a3c9e074afe31560261590053721 | [
"MIT"
] | 20 | 2021-04-28T16:01:18.000Z | 2022-03-27T09:39:02.000Z | cpp_linter/__init__.py | DingXuefeng/cpp-linter-action | 9a09cb0d0c17a3c9e074afe31560261590053721 | [
"MIT"
] | 39 | 2021-08-15T09:52:02.000Z | 2022-03-31T14:57:42.000Z | cpp_linter/__init__.py | 2bndy5/cpp-linter-action | b5962ce34397bce2b0f88772b22b65b5a5295fe5 | [
"MIT"
] | 9 | 2021-05-18T19:46:35.000Z | 2022-03-21T21:59:05.000Z | """The Base module of the `cpp_linter` package. This holds the objects shared by
multiple modules."""
import io
import os
import logging
FOUND_RICH_LIB = False
try:
from rich.logging import RichHandler
FOUND_RICH_LIB = True
logging.basicConfig(
format="%(name)s: %(message)s",
handlers=[Ri... | 31.66 | 84 | 0.659823 | """The Base module of the `cpp_linter` package. This holds the objects shared by
multiple modules."""
import io
import os
import logging
FOUND_RICH_LIB = False
try:
from rich.logging import RichHandler
FOUND_RICH_LIB = True
logging.basicConfig(
format="%(name)s: %(message)s",
handlers=[Ri... | 0 | 0 | 0 |
68f66e3580307c10734ba594d88113b536300087 | 1,530 | py | Python | my_pygame/count_down.py | francis-clairicia/Py-Game-Case | af2da857f2ef758051ad3c174d77f5a2deab935d | [
"MIT"
] | 6 | 2022-02-10T09:07:56.000Z | 2022-02-10T10:36:18.000Z | my_pygame/count_down.py | francis-clairicia/Py-Game-Case | af2da857f2ef758051ad3c174d77f5a2deab935d | [
"MIT"
] | null | null | null | my_pygame/count_down.py | francis-clairicia/Py-Game-Case | af2da857f2ef758051ad3c174d77f5a2deab935d | [
"MIT"
] | null | null | null | # -*- coding: Utf-8 -*
from .text import Text
from .window import Window
| 28.867925 | 83 | 0.596078 | # -*- coding: Utf-8 -*
from .text import Text
from .window import Window
class CountDown(Text):
__slots__ = ("__seconds", "__master", "__callback")
def __init__(self, master: Window, seconds: int, format="{seconds}", **kwargs):
Text.__init__(self, **kwargs)
self.__seconds = int(seconds)
... | 1,213 | 220 | 23 |
aec52a7bf75a868b756e99d1088d88e4bc17b122 | 1,475 | py | Python | aioftx/options/stats/schemas.py | metta-team/aioftx | f5bd028e8bf40c55c1d4632802b792be113e0978 | [
"MIT"
] | null | null | null | aioftx/options/stats/schemas.py | metta-team/aioftx | f5bd028e8bf40c55c1d4632802b792be113e0978 | [
"MIT"
] | null | null | null | aioftx/options/stats/schemas.py | metta-team/aioftx | f5bd028e8bf40c55c1d4632802b792be113e0978 | [
"MIT"
] | null | null | null | import datetime
from aioftx.http import PaginatedRequest, PaginatedResponse
from pydantic import BaseModel, Field
""" Option Volume """
""" Option Interest """
| 21.071429 | 85 | 0.776271 | import datetime
from aioftx.http import PaginatedRequest, PaginatedResponse
from pydantic import BaseModel, Field
""" Option Volume """
class OptionVolume(BaseModel):
contracts: float
underlying_total: float
class Get24hrOptionVolumeRequest(PaginatedRequest):
path = "/options/24hr_options_volumes"
c... | 0 | 1,023 | 276 |
fb28cc7206b054d20152f2e4309c053d11766a3f | 12,557 | py | Python | ecg/deprecated/scrape_metagenomes_from_jgi.py | ELIFE-ASU/ecg | f41f1374be638e85974b8443584dbf3378d59979 | [
"MIT"
] | 2 | 2019-08-15T09:57:10.000Z | 2021-06-03T00:52:50.000Z | ecg/deprecated/scrape_metagenomes_from_jgi.py | ELIFE-ASU/ecg | f41f1374be638e85974b8443584dbf3378d59979 | [
"MIT"
] | 20 | 2019-06-12T09:09:52.000Z | 2020-02-04T20:57:26.000Z | ecg/deprecated/scrape_metagenomes_from_jgi.py | ELIFE-ASU/ecg | f41f1374be638e85974b8443584dbf3378d59979 | [
"MIT"
] | 2 | 2019-07-18T06:11:42.000Z | 2019-09-05T00:07:00.000Z | ## jgi_metagenome_scraping
"""
Scrape individual metagenome EC numbers from JGI.
`scrape_metagenomes_from_jgi` is the only function meant to be called directly.
Usage:
scrape_metagenomes_from_jgi.py SAVE_DIR
scrape_metagenomes_from_jgi.py SAVE_DIR [--database=<db>]
scrape_metagenomes_from_jgi.py SAVE_DIR [--home... | 36.18732 | 200 | 0.720076 | ## jgi_metagenome_scraping
"""
Scrape individual metagenome EC numbers from JGI.
`scrape_metagenomes_from_jgi` is the only function meant to be called directly.
Usage:
scrape_metagenomes_from_jgi.py SAVE_DIR
scrape_metagenomes_from_jgi.py SAVE_DIR [--database=<db>]
scrape_metagenomes_from_jgi.py SAVE_DIR [--home... | 2,149 | 0 | 23 |
b589448870108b8384d02ffae142be9ddd6ea762 | 932 | py | Python | 2018/25a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | 8 | 2016-12-01T19:41:50.000Z | 2021-12-21T18:50:55.000Z | 2018/25a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | null | null | null | 2018/25a.py | msullivan/advent-of-code | ba4b0c3e229bca0f632d51d18ad72ecddd2405da | [
"MIT"
] | 3 | 2018-12-23T06:58:47.000Z | 2021-12-20T10:09:15.000Z | #!/usr/bin/env python3
from collections import defaultdict, deque
import sys
import re
#from dataclasses import dataclass
if __name__ == '__main__':
sys.exit(main(sys.argv))
| 25.189189 | 84 | 0.522532 | #!/usr/bin/env python3
from collections import defaultdict, deque
import sys
import re
#from dataclasses import dataclass
def extract(s):
return [int(x) for x in re.findall(r'-?\d+', s)]
def dist(x, y):
return abs(x[0] - y[0]) + abs(x[1] - y[1]) + abs(x[2] - y[2]) + abs(x[3] - y[3])
def main(args):
data... | 683 | 0 | 69 |
a7a47765269246e3ee6f028960d3264b45404abc | 1,729 | py | Python | demo/demo/views.py | dresl/django-fullcalendar | 4ba0bf0c207cad306ae7a14a324fa06f7a4e9f25 | [
"MIT"
] | 48 | 2015-01-10T08:01:27.000Z | 2021-03-12T06:16:43.000Z | demo/demo/views.py | dresl/django-fullcalendar | 4ba0bf0c207cad306ae7a14a324fa06f7a4e9f25 | [
"MIT"
] | 4 | 2015-02-13T23:02:31.000Z | 2021-05-02T19:18:49.000Z | demo/demo/views.py | dresl/django-fullcalendar | 4ba0bf0c207cad306ae7a14a324fa06f7a4e9f25 | [
"MIT"
] | 48 | 2015-01-07T11:37:27.000Z | 2022-02-23T20:17:04.000Z | from django.shortcuts import render
from django.http import HttpResponse
from fullcalendar.models import CalendarEvent
from fullcalendar.util import events_to_json, calendar_options
# This is just an example for this demo. You may get this value
# from a separate file or anywhere you want
OPTIONS = """{ timeFormat:... | 39.295455 | 112 | 0.522846 | from django.shortcuts import render
from django.http import HttpResponse
from fullcalendar.models import CalendarEvent
from fullcalendar.util import events_to_json, calendar_options
# This is just an example for this demo. You may get this value
# from a separate file or anywhere you want
OPTIONS = """{ timeFormat:... | 270 | 0 | 46 |
530c2f9293926aa63cfcce49afc28e2239fcd4aa | 1,587 | py | Python | module/passive/certificate.py | b1ackc4t/getdomain | 0d1d31c9abf1d3293d113bff46c400b246434807 | [
"Apache-2.0"
] | null | null | null | module/passive/certificate.py | b1ackc4t/getdomain | 0d1d31c9abf1d3293d113bff46c400b246434807 | [
"Apache-2.0"
] | null | null | null | module/passive/certificate.py | b1ackc4t/getdomain | 0d1d31c9abf1d3293d113bff46c400b246434807 | [
"Apache-2.0"
] | 1 | 2021-11-24T09:22:38.000Z | 2021-11-24T09:22:38.000Z | import urllib.request
import urllib.parse
import re
import asyncio
import aiohttp
from lib.base import *
if __name__ == '__main__':
main('hubu.edu.cn')
| 31.74 | 157 | 0.563327 | import urllib.request
import urllib.parse
import re
import asyncio
import aiohttp
from lib.base import *
class Certificate():
def __init__(self, domain):
self.domain_list = []
self.domain = domain
self.headers = request_headers
async def get_crtsh(self):
timeout = aiohttp.Clie... | 1,314 | -1 | 126 |
ae308e8e420aba056d73d23e2f934b06bd7ba0d8 | 3,180 | py | Python | optimizers/JAYA.py | VicZH/Evolutionary-Algorithm-Racing | e14eba3e5a2ea63cbbbd0ce4b7df514853cc6d22 | [
"MIT"
] | null | null | null | optimizers/JAYA.py | VicZH/Evolutionary-Algorithm-Racing | e14eba3e5a2ea63cbbbd0ce4b7df514853cc6d22 | [
"MIT"
] | null | null | null | optimizers/JAYA.py | VicZH/Evolutionary-Algorithm-Racing | e14eba3e5a2ea63cbbbd0ce4b7df514853cc6d22 | [
"MIT"
] | null | null | null | """ JAYA Algorithm """
import random
import numpy
from solution import solution
| 35.730337 | 85 | 0.556604 | """ JAYA Algorithm """
import random
import numpy
from solution import solution
class JAYA(solution):
def __init__(self, objf, sol_shift, lb, ub, dim, PopSize, EvlNum):
# Worst position initialization
self.Worst_pos = numpy.zeros(dim)
self.Worst_score = float(0)
self.dim = dim
... | 3,019 | 0 | 80 |
ec4662db7a4542545474574d7ddb566d0e09dd09 | 1,830 | py | Python | news_providers/rtve.py | zlotny/memorias-del-olvido | 28d56626196f098ca9a24192776be176d3fcc92b | [
"MIT"
] | null | null | null | news_providers/rtve.py | zlotny/memorias-del-olvido | 28d56626196f098ca9a24192776be176d3fcc92b | [
"MIT"
] | null | null | null | news_providers/rtve.py | zlotny/memorias-del-olvido | 28d56626196f098ca9a24192776be176d3fcc92b | [
"MIT"
] | null | null | null | """
News provider for the site rtve.es
Checks specifically the Alzheimer tag. Only checks news, not videos or audios
"""
from datetime import datetime
from textwrap import dedent
from lxml import html
from lxml.cssselect import CSSSelector
import requests
URL = 'http://www.rtve.es/temas/alzheimer/1060/'
SITE... | 29.047619 | 100 | 0.636066 | """
News provider for the site rtve.es
Checks specifically the Alzheimer tag. Only checks news, not videos or audios
"""
from datetime import datetime
from textwrap import dedent
from lxml import html
from lxml.cssselect import CSSSelector
import requests
URL = 'http://www.rtve.es/temas/alzheimer/1060/'
SITE... | 0 | 0 | 0 |
5468d3f3d83ae8dd42338b73c251c1856f9d5005 | 3,870 | py | Python | CalcMIRExtinction.py | rclevy/Scripts | ca169bfc437e9cfa81e37a8f7e0c68a8f58b972e | [
"MIT"
] | 1 | 2021-03-02T03:36:21.000Z | 2021-03-02T03:36:21.000Z | CalcMIRExtinction.py | rclevy/Scripts | ca169bfc437e9cfa81e37a8f7e0c68a8f58b972e | [
"MIT"
] | null | null | null | CalcMIRExtinction.py | rclevy/Scripts | ca169bfc437e9cfa81e37a8f7e0c68a8f58b972e | [
"MIT"
] | null | null | null | #calculate the extinction between two bands
#from Rieke & Lebofsky 1985 Table 3
import argparse
parser=argparse.ArgumentParser(
prog = 'CalcMIRExtinction',
formatter_class=argparse.RawDescriptionHelpFormatter,
description='''Calculate the MIR extinction and flux ratios between two wavelengths or bands based on Rie... | 41.612903 | 174 | 0.721447 | #calculate the extinction between two bands
#from Rieke & Lebofsky 1985 Table 3
import argparse
parser=argparse.ArgumentParser(
prog = 'CalcMIRExtinction',
formatter_class=argparse.RawDescriptionHelpFormatter,
description='''Calculate the MIR extinction and flux ratios between two wavelengths or bands based on Rie... | 0 | 0 | 0 |
44ac96babfa68c0e1d298fcb2807992be9c96dfa | 2,992 | py | Python | ruterstop/tests/test_cli.py | stigok/ruterstop | 589f7b7c8330573e0e854a367024a0dbd45db20d | [
"MIT"
] | 8 | 2019-10-31T13:21:25.000Z | 2021-07-31T14:22:30.000Z | ruterstop/tests/test_cli.py | stigok/ruterstop | 589f7b7c8330573e0e854a367024a0dbd45db20d | [
"MIT"
] | 20 | 2019-10-30T22:23:27.000Z | 2020-06-18T07:28:43.000Z | ruterstop/tests/test_cli.py | stigok/ruterstop | 589f7b7c8330573e0e854a367024a0dbd45db20d | [
"MIT"
] | null | null | null | import json
import os
from io import StringIO
from unittest import TestCase
from unittest.mock import patch
from freezegun import freeze_time
import ruterstop
| 35.619048 | 88 | 0.60361 | import json
import os
from io import StringIO
from unittest import TestCase
from unittest.mock import patch
from freezegun import freeze_time
import ruterstop
def run(args):
out = StringIO()
ruterstop.main(["TEST"] + args, stdout=out)
lines = out.getvalue().split("\n")
return lines
class CommandLi... | 2,598 | 24 | 207 |
a120e8501846c30b37428e9d17ab5732b30e759a | 1,057 | py | Python | analytic_diffuse/tests/test_against_integrators.py | steven-murray/analytic_diffuse | b82fea27da4c476b4d04c2a0d8959e5af38bdd09 | [
"MIT"
] | null | null | null | analytic_diffuse/tests/test_against_integrators.py | steven-murray/analytic_diffuse | b82fea27da4c476b4d04c2a0d8959e5af38bdd09 | [
"MIT"
] | null | null | null | analytic_diffuse/tests/test_against_integrators.py | steven-murray/analytic_diffuse | b82fea27da4c476b4d04c2a0d8959e5af38bdd09 | [
"MIT"
] | null | null | null | from analytic_diffuse import integrators, models, get_model, get_solution
import pytest
import numpy as np
@pytest.mark.parametrize(
'model,kwargs',
[('cosza', {}),
('polydome', {}),
('projgauss', {'a': 0.01}),
('projgauss', {'a': 2}),
('gauss_zenith', {'a': 0.01}),
('gauss_zenith', {... | 30.2 | 126 | 0.609272 | from analytic_diffuse import integrators, models, get_model, get_solution
import pytest
import numpy as np
@pytest.mark.parametrize(
'model,kwargs',
[('cosza', {}),
('polydome', {}),
('projgauss', {'a': 0.01}),
('projgauss', {'a': 2}),
('gauss_zenith', {'a': 0.01}),
('gauss_zenith', {... | 621 | 0 | 44 |
78fe3893c2d308f27b4e60a715c468bf051b4e78 | 1,075 | py | Python | bach/tests/unit/sql_models/test_model_escape_format.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 23 | 2021-11-10T21:37:42.000Z | 2022-03-30T11:46:19.000Z | bach/tests/unit/sql_models/test_model_escape_format.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | 163 | 2021-11-10T10:11:26.000Z | 2022-03-31T16:04:27.000Z | bach/tests/unit/sql_models/test_model_escape_format.py | objectiv/objectiv-analytics | 86ec1508f71c2d61ea7d67479800e4dc417a46e1 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2022 Objectiv B.V.
"""
import pytest
from sql_models.model import escape_format_string
pytestmark = [pytest.mark.db_independent] # mark all tests here as database independent.
def assert_escape_compare_value(value):
""" helper for test__escape_value. Assert that the escaped value, after formatting... | 37.068966 | 109 | 0.72186 | """
Copyright 2022 Objectiv B.V.
"""
import pytest
from sql_models.model import escape_format_string
pytestmark = [pytest.mark.db_independent] # mark all tests here as database independent.
def assert_escape_compare_value(value):
""" helper for test__escape_value. Assert that the escaped value, after formatting... | 517 | 0 | 23 |
88f7d4f26d1f59e448d93c7d68d03b86631a3b13 | 14,038 | py | Python | agent_configs.py | davidlarcher/WindAI | 129941f4a3eb1d632d326cd90b7a244ae1cc558e | [
"Apache-2.0"
] | null | null | null | agent_configs.py | davidlarcher/WindAI | 129941f4a3eb1d632d326cd90b7a244ae1cc558e | [
"Apache-2.0"
] | null | null | null | agent_configs.py | davidlarcher/WindAI | 129941f4a3eb1d632d326cd90b7a244ae1cc558e | [
"Apache-2.0"
] | null | null | null |
number_of_workers = 4
config_SAC = {
# "gamma": 0.5,
# === Model ===
# Use two Q-networks (instead of one) for action-value estimation.
# Note: Each Q-network will have its own target network.
"twin_q": True,
# Use a e.g. conv2D state preprocessing network before concatenating the
# result... | 43.732087 | 95 | 0.683146 |
number_of_workers = 4
config_SAC = {
# "gamma": 0.5,
# === Model ===
# Use two Q-networks (instead of one) for action-value estimation.
# Note: Each Q-network will have its own target network.
"twin_q": True,
# Use a e.g. conv2D state preprocessing network before concatenating the
# result... | 0 | 0 | 0 |
4a10c6af6f00d1fbef221397bb0f2553d1e966c5 | 4,251 | py | Python | server/catgenome/demo_scripts/reg_file.py | ismael-dev88/NGB | 7d5e74489968d3ec6edfbf65e1599b982d49141c | [
"MIT"
] | 1 | 2017-08-22T09:42:22.000Z | 2017-08-22T09:42:22.000Z | server/catgenome/demo_scripts/reg_file.py | react-dev26/NGB-master | b3646f92d7d9802d5bb83ac4b7a59031b2fe71a7 | [
"MIT"
] | null | null | null | server/catgenome/demo_scripts/reg_file.py | react-dev26/NGB-master | b3646f92d7d9802d5bb83ac4b7a59031b2fe71a7 | [
"MIT"
] | null | null | null | import requests
import json
import argparse
import sys
import os.path
import urlparse
import urllib
base_url = "http://localhost:8080/catgenome/restapi/{0}/register"
file_types = {
'vcf': "vcf",
'vcf.gz': "vcf",
'gff': "gene",
'gtf': "gene",
'gff.gz': "gene",
'gtf.gz': "gene",
'gff3': "gene",
'gff3.gz': "gene"... | 28.530201 | 133 | 0.677252 | import requests
import json
import argparse
import sys
import os.path
import urlparse
import urllib
base_url = "http://localhost:8080/catgenome/restapi/{0}/register"
file_types = {
'vcf': "vcf",
'vcf.gz': "vcf",
'gff': "gene",
'gtf': "gene",
'gff.gz': "gene",
'gtf.gz': "gene",
'gff3': "gene",
'gff3.gz': "gene"... | 3,640 | 0 | 115 |
416ea2402ef33ccc2bafa752d77c2a9d40e6a93c | 5,354 | py | Python | Python/keithley2400_old.py | ultpnml/ult_instruments | 3c9dd6b26e993bba3e20c7f91af6510152850cfd | [
"BSD-3-Clause"
] | null | null | null | Python/keithley2400_old.py | ultpnml/ult_instruments | 3c9dd6b26e993bba3e20c7f91af6510152850cfd | [
"BSD-3-Clause"
] | null | null | null | Python/keithley2400_old.py | ultpnml/ult_instruments | 3c9dd6b26e993bba3e20c7f91af6510152850cfd | [
"BSD-3-Clause"
] | null | null | null | #keithley2400.py
#Controls Keithley 2400 SourceMeter through RS232
#Assumes COM3, 9600 Baud, line feed as termination character
#Uses pyserial
#Dillon Wong 11/03/2018
import serial
import time
#Make decorator?
#Run voltage to 0 V in the event of an emergency.
| 37.180556 | 77 | 0.541651 | #keithley2400.py
#Controls Keithley 2400 SourceMeter through RS232
#Assumes COM3, 9600 Baud, line feed as termination character
#Uses pyserial
#Dillon Wong 11/03/2018
import serial
import time
class keithley2400:
def __init__(self, com_port = 'COM3'):
self.keithley = serial.Serial(com_port, 9600, timeout... | 4,794 | -2 | 291 |
8e7f45cb933884793bd562624866fb1a0f206505 | 2,940 | py | Python | src/KENN2/parsers.py | DanieleAlessandro/KENN2 | 949620ca1734e85239115954b88370393d97a42e | [
"BSD-3-Clause"
] | 6 | 2020-12-23T11:56:14.000Z | 2022-02-10T10:28:09.000Z | src/KENN2/parsers.py | DanieleAlessandro/KENN2 | 949620ca1734e85239115954b88370393d97a42e | [
"BSD-3-Clause"
] | null | null | null | src/KENN2/parsers.py | DanieleAlessandro/KENN2 | 949620ca1734e85239115954b88370393d97a42e | [
"BSD-3-Clause"
] | 1 | 2021-03-20T16:18:34.000Z | 2021-03-20T16:18:34.000Z | from KENN2.layers.residual.KnowledgeEnhancer import KnowledgeEnhancer
from KENN2.layers.Kenn import Kenn
from KENN2.layers.RelationalKENN import RelationalKENN
def unary_parser(knowledge_file, activation=lambda x: x, initial_clause_weight=0.5, save_training_data=False, **kwargs):
"""
Takes in input the knowle... | 36.296296 | 120 | 0.671088 | from KENN2.layers.residual.KnowledgeEnhancer import KnowledgeEnhancer
from KENN2.layers.Kenn import Kenn
from KENN2.layers.RelationalKENN import RelationalKENN
def unary_parser(knowledge_file, activation=lambda x: x, initial_clause_weight=0.5, save_training_data=False, **kwargs):
"""
Takes in input the knowle... | 0 | 0 | 0 |
46de5f09dfad2ee5f6d5bb815bcf5b31b7fbb004 | 11,983 | py | Python | deprecated/symbolic_regression/environment.py | jfrfonseca/symbolic_regression | 4639fafd92796df2f0696e04c354289915819d5e | [
"MIT"
] | null | null | null | deprecated/symbolic_regression/environment.py | jfrfonseca/symbolic_regression | 4639fafd92796df2f0696e04c354289915819d5e | [
"MIT"
] | null | null | null | deprecated/symbolic_regression/environment.py | jfrfonseca/symbolic_regression | 4639fafd92796df2f0696e04c354289915819d5e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""__init__.py: Basic requirements for the module."""
__license__ = "MIT"
__author__ = "José Fonseca"
__copyright__ = "Copyright (c) 2020 José F. R. Fonseca"
# ===================================================================================================... | 49.110656 | 137 | 0.64241 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""__init__.py: Basic requirements for the module."""
__license__ = "MIT"
__author__ = "José Fonseca"
__copyright__ = "Copyright (c) 2020 José F. R. Fonseca"
# ===================================================================================================... | 8,523 | 2,617 | 23 |
e680988d6aaf0548275678b6f6b2b8d6503554c9 | 2,014 | py | Python | utils/helpers.py | daniilpastukhov/serendipity_experiments | 5ff544937d1796dbb20e11137f364972935be967 | [
"MIT"
] | 1 | 2021-11-27T11:31:01.000Z | 2021-11-27T11:31:01.000Z | utils/helpers.py | daniilpastukhov/serendipity_experiments | 5ff544937d1796dbb20e11137f364972935be967 | [
"MIT"
] | null | null | null | utils/helpers.py | daniilpastukhov/serendipity_experiments | 5ff544937d1796dbb20e11137f364972935be967 | [
"MIT"
] | null | null | null | from typing import Union
import numpy as np
import pandas as pd
genres_cols = [f'feature{i + 1}' for i in range(18)]
def get_control_items(ratings, user_profiles=None, user_ids=None):
"""
Get control items of test users for evaluation purposes.
:param ratings: pd.DataFrame with columns <userId, movie... | 33.566667 | 108 | 0.704071 | from typing import Union
import numpy as np
import pandas as pd
genres_cols = [f'feature{i + 1}' for i in range(18)]
def get_movies_by_profile(movies_df, profile):
return movies_df[movies_df['movieId'].isin(profile[profile != 0].index.astype(int))][genres_cols].values
def get_average_genre(movies_df):
retu... | 360 | 0 | 92 |
76f4dd13926a55ca4c52282d54a40cecfd95d09b | 424 | py | Python | env/lib/python3.6/site-packages/dal_genericm2m_queryset_sequence/fields.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 1,368 | 2015-01-03T09:52:33.000Z | 2022-03-27T09:06:00.000Z | env/lib/python3.6/site-packages/dal_genericm2m_queryset_sequence/fields.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 919 | 2015-01-01T05:17:48.000Z | 2022-03-25T22:41:14.000Z | env/lib/python3.6/site-packages/dal_genericm2m_queryset_sequence/fields.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 469 | 2015-01-19T21:40:30.000Z | 2022-03-26T17:27:40.000Z | """Autocomplete fields for django-queryset-sequence and django-generic-m2m."""
from dal_genericm2m.fields import GenericM2MFieldMixin
from dal_queryset_sequence.fields import QuerySetSequenceModelMultipleField
class GenericM2MQuerySetSequenceField(GenericM2MFieldMixin,
QuerySet... | 38.545455 | 78 | 0.773585 | """Autocomplete fields for django-queryset-sequence and django-generic-m2m."""
from dal_genericm2m.fields import GenericM2MFieldMixin
from dal_queryset_sequence.fields import QuerySetSequenceModelMultipleField
class GenericM2MQuerySetSequenceField(GenericM2MFieldMixin,
QuerySet... | 0 | 0 | 0 |
c4b37fdc21aa0651b4df4a2e663ec94b39ffba86 | 866 | py | Python | day11/day11.py | alexmotoc/AoC17 | c496b1da3a5863b370e677b87b6f14c65863227c | [
"MIT"
] | null | null | null | day11/day11.py | alexmotoc/AoC17 | c496b1da3a5863b370e677b87b6f14c65863227c | [
"MIT"
] | null | null | null | day11/day11.py | alexmotoc/AoC17 | c496b1da3a5863b370e677b87b6f14c65863227c | [
"MIT"
] | null | null | null | import numpy as np
def direction_to_tuple(direction):
"""Returns the tuple coordinate offset from the start
hexagon given a certain direction"""
return {
'n' : (0, -1),
'ne' : (1, -1),
'se' : (1, 0),
's' : (0, 1),
'sw' : (-1, 1),
'nw' : (-1, 0)
}[direct... | 26.242424 | 70 | 0.572748 | import numpy as np
def direction_to_tuple(direction):
"""Returns the tuple coordinate offset from the start
hexagon given a certain direction"""
return {
'n' : (0, -1),
'ne' : (1, -1),
'se' : (1, 0),
's' : (0, 1),
'sw' : (-1, 1),
'nw' : (-1, 0)
}[direct... | 0 | 0 | 0 |
650a977c4f6d2e61a7d4ccccc3945bccef513242 | 2,708 | py | Python | kalmanjax/experiments/timings/timings_heteroscedastic.py | NajwaLaabid/kalman-jax | 7cd4d83f9c5a22008d2c565deefe3fa7ffd2005d | [
"Apache-2.0"
] | 88 | 2020-07-08T19:21:26.000Z | 2021-11-23T07:28:28.000Z | kalmanjax/experiments/timings/timings_heteroscedastic.py | NajwaLaabid/kalman-jax | 7cd4d83f9c5a22008d2c565deefe3fa7ffd2005d | [
"Apache-2.0"
] | 2 | 2020-08-25T23:27:30.000Z | 2020-11-05T13:35:31.000Z | kalmanjax/experiments/timings/timings_heteroscedastic.py | NajwaLaabid/kalman-jax | 7cd4d83f9c5a22008d2c565deefe3fa7ffd2005d | [
"Apache-2.0"
] | 13 | 2020-07-14T16:35:48.000Z | 2022-03-24T08:03:03.000Z | import sys
sys.path.insert(0, '../../')
import numpy as np
import time
from sde_gp import SDEGP
import approximate_inference as approx_inf
import priors
import likelihoods
import pickle
from sklearn.preprocessing import StandardScaler
plot_intermediate = False
print('loading data ...')
D = np.loadtxt('../heteroscedas... | 25.074074 | 97 | 0.695716 | import sys
sys.path.insert(0, '../../')
import numpy as np
import time
from sde_gp import SDEGP
import approximate_inference as approx_inf
import priors
import likelihoods
import pickle
from sklearn.preprocessing import StandardScaler
plot_intermediate = False
print('loading data ...')
D = np.loadtxt('../heteroscedas... | 0 | 0 | 0 |
e14ae797da7cdfead5044a3ae7590fc530ef4bf2 | 73 | py | Python | offpolicy/envs/__init__.py | Maxtoq/off-policy | e866f13a3d144a29552c38f104bcdfb411036138 | [
"MIT"
] | 76 | 2021-07-30T11:59:51.000Z | 2022-03-31T08:07:10.000Z | offpolicy/envs/__init__.py | jc-bao/off-policy | 15c44f126e506b3f455c60dddd424d2290dddf8d | [
"MIT"
] | 6 | 2021-12-02T11:22:29.000Z | 2022-03-25T04:17:09.000Z | offpolicy/envs/__init__.py | jc-bao/off-policy | 15c44f126e506b3f455c60dddd424d2290dddf8d | [
"MIT"
] | 20 | 2021-08-04T04:01:52.000Z | 2022-03-17T04:14:41.000Z |
from absl import flags
FLAGS = flags.FLAGS
FLAGS(['train_smac.py'])
| 14.6 | 25 | 0.69863 |
from absl import flags
FLAGS = flags.FLAGS
FLAGS(['train_smac.py'])
| 0 | 0 | 0 |
f035d33d3bc78944df327818a65f432c2ad063e7 | 9,599 | py | Python | dump1090.py | tedsluis/dump1090-tools | 95ef51e747a741568d9aa672223057dbf0f88401 | [
"0BSD"
] | 20 | 2016-07-23T23:24:21.000Z | 2021-04-08T07:59:53.000Z | dump1090.py | tedsluis/dump1090-tools | 95ef51e747a741568d9aa672223057dbf0f88401 | [
"0BSD"
] | 3 | 2016-12-19T19:47:42.000Z | 2017-05-18T12:25:18.000Z | dump1090.py | tedsluis/dump1090-tools | 95ef51e747a741568d9aa672223057dbf0f88401 | [
"0BSD"
] | 7 | 2016-02-28T17:42:15.000Z | 2017-06-26T22:39:35.000Z | # Copyright (c) 2015, Oliver Jowett <oliver@mutability.co.uk>
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND T... | 38.243028 | 125 | 0.538181 | # Copyright (c) 2015, Oliver Jowett <oliver@mutability.co.uk>
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND T... | 8,358 | 0 | 188 |
cf83ec7256b5b73effce336ff46f27cb99a8799f | 131 | py | Python | Python/1963 - O Filme.py | NadiaOliver/Uri-Judge-Iniciante | 4546a0f662b0d54c6f6076506771712646f2b6d8 | [
"MIT"
] | 21 | 2019-08-29T05:31:54.000Z | 2022-03-30T17:34:14.000Z | Python/1963 - O Filme.py | NadiaOliver/Uri-Judge-Iniciante | 4546a0f662b0d54c6f6076506771712646f2b6d8 | [
"MIT"
] | 2 | 2020-01-01T21:47:46.000Z | 2020-01-01T22:06:05.000Z | Python/1963 - O Filme.py | NadiaOliver/Uri-Judge-Iniciante | 4546a0f662b0d54c6f6076506771712646f2b6d8 | [
"MIT"
] | 14 | 2019-12-07T16:47:47.000Z | 2022-02-23T01:25:05.000Z | A, B = input().split(' ')
A = float(A)
B = float(B)
rate = B * 100
result_rate = rate / A
print('{:.2f}%'.format(result_rate-100)) | 18.714286 | 40 | 0.587786 | A, B = input().split(' ')
A = float(A)
B = float(B)
rate = B * 100
result_rate = rate / A
print('{:.2f}%'.format(result_rate-100)) | 0 | 0 | 0 |
f3ba574402bf2dd654dfe21c9a9c73410a9a5110 | 5,637 | py | Python | 7.py | HatsuneMikuV/PythonLearning | 34a7179ee20eb8ade50ce74b12732daea491e527 | [
"Apache-2.0"
] | null | null | null | 7.py | HatsuneMikuV/PythonLearning | 34a7179ee20eb8ade50ce74b12732daea491e527 | [
"Apache-2.0"
] | null | null | null | 7.py | HatsuneMikuV/PythonLearning | 34a7179ee20eb8ade50ce74b12732daea491e527 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: seven
Description :
Author : joe
date: 2019-07-23
-------------------------------------------------
Change Activity:
2019-07-23:
-------------------------------------------------... | 19.70979 | 56 | 0.573177 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: seven
Description :
Author : joe
date: 2019-07-23
-------------------------------------------------
Change Activity:
2019-07-23:
-------------------------------------------------... | 647 | 0 | 91 |
54ba12647bb645efc2b4c8dd060665332ed499a3 | 626 | py | Python | apps/shop/rest/views/base.py | mmasterenko/easy-shop | 0cb2abbc6070cd0a086badca48f2e9b5d708374a | [
"MIT"
] | null | null | null | apps/shop/rest/views/base.py | mmasterenko/easy-shop | 0cb2abbc6070cd0a086badca48f2e9b5d708374a | [
"MIT"
] | 3 | 2020-06-05T18:34:48.000Z | 2021-06-10T20:36:32.000Z | apps/shop/rest/views/base.py | mmasterenko/easy-shop | 0cb2abbc6070cd0a086badca48f2e9b5d708374a | [
"MIT"
] | null | null | null | from rest_framework.generics import ListCreateAPIView
from utils.rest_framework.generics import RetrieveUpdateDestroy
from apps.shop import models as shop_models
from apps.shop.rest import serializers as shop_serializers
| 31.3 | 67 | 0.822684 | from rest_framework.generics import ListCreateAPIView
from utils.rest_framework.generics import RetrieveUpdateDestroy
from apps.shop import models as shop_models
from apps.shop.rest import serializers as shop_serializers
class ProductListView(ListCreateAPIView):
serializer_class = shop_serializers.ProductSeriali... | 140 | 216 | 46 |
18a054eb8852ec3775d145f0bbcbe51e77a0335b | 1,522 | py | Python | gbe/views/admin_profile_view.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 1 | 2021-03-14T11:56:47.000Z | 2021-03-14T11:56:47.000Z | gbe/views/admin_profile_view.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | 180 | 2019-09-15T19:52:46.000Z | 2021-11-06T23:48:01.000Z | gbe/views/admin_profile_view.py | bethlakshmi/gbe-divio-djangocms-python2.7 | 6e9b2c894162524bbbaaf73dcbe927988707231d | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import get_object_or_404
from gbe.forms import ProfileAdminForm
from gbe.functions import validate_perms
from gbe.models import (
Profile,
UserMessage,
)
from gbetext import admin_note
from gbe.views import EditProfileView
| 35.395349 | 77 | 0.645861 | from django.shortcuts import get_object_or_404
from gbe.forms import ProfileAdminForm
from gbe.functions import validate_perms
from gbe.models import (
Profile,
UserMessage,
)
from gbetext import admin_note
from gbe.views import EditProfileView
class AdminProfileView(EditProfileView):
profile_form = Profi... | 1,030 | 215 | 23 |
0a1baafdd83c5d597fd8b54cc03f0f48b6ba3c44 | 825 | py | Python | var/spack/repos/builtin/packages/py-pyrsistent/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-08-13T15:24:33.000Z | 2021-10-18T18:38:19.000Z | var/spack/repos/builtin/packages/py-pyrsistent/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 6 | 2022-02-26T11:44:34.000Z | 2022-03-12T12:14:50.000Z | var/spack/repos/builtin/packages/py-pyrsistent/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-09-15T02:37:59.000Z | 2020-09-21T04:34:38.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPyrsistent(PythonPackage):
"""Pyrsistent is a number of persistent collections
(b... | 37.5 | 96 | 0.715152 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyPyrsistent(PythonPackage):
"""Pyrsistent is a number of persistent collections
(b... | 0 | 0 | 0 |
8b04672092fed0091f341196b4cdbc00f6bb13c5 | 487 | py | Python | OSSU/0.python-4-everyone/1.python-4-everybody/Assignments/Assignment 2.3.py | mohammedelzanaty/myRoad2BeFullStack | eea3a5edb6c6a999136b04fdaea6ce0c81137a58 | [
"MIT"
] | 2 | 2021-04-21T12:05:01.000Z | 2022-01-19T09:58:38.000Z | OSSU/0.python-4-everyone/1.python-4-everybody/Assignments/Assignment 2.3.py | mohammedelzanaty/myRoad2BeFullStack | eea3a5edb6c6a999136b04fdaea6ce0c81137a58 | [
"MIT"
] | 34 | 2019-12-26T11:21:42.000Z | 2022-02-27T19:55:10.000Z | OSSU/0.python-4-everyone/1.python-4-everybody/Assignments/Assignment 2.3.py | mohammedelzanaty/myRoad2BeFullStack | eea3a5edb6c6a999136b04fdaea6ce0c81137a58 | [
"MIT"
] | 2 | 2021-08-15T07:59:36.000Z | 2022-01-16T06:17:32.000Z | """
Write a program to prompt the user for hours and rate per hour using input to compute gross pay.
Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25).
You should use input to read a string and float() to convert the string to a number.
Do not worry about error checking or bad us... | 40.583333 | 97 | 0.718686 | """
Write a program to prompt the user for hours and rate per hour using input to compute gross pay.
Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25).
You should use input to read a string and float() to convert the string to a number.
Do not worry about error checking or bad us... | 0 | 0 | 0 |
f833e98fdfa02ba5b096db38cbe81374e1a09b3d | 5,753 | py | Python | Doc/sphinx-examples/tutorial/advanced_topics/src/using-python-scripting-1.py | mpartio/ecflow | ea4b89399d1e7b897ff48c59b1e885e6d53cc8d6 | [
"Apache-2.0"
] | 11 | 2020-08-07T14:42:45.000Z | 2021-10-21T01:59:59.000Z | Doc/sphinx-examples/tutorial/advanced_topics/src/using-python-scripting-1.py | CoollRock/ecflow | db61dddc84d3d2c7dd6af95fd799d717c6bc2a6d | [
"Apache-2.0"
] | 10 | 2020-08-07T14:36:27.000Z | 2022-02-22T06:51:24.000Z | Doc/sphinx-examples/tutorial/advanced_topics/src/using-python-scripting-1.py | CoollRock/ecflow | db61dddc84d3d2c7dd6af95fd799d717c6bc2a6d | [
"Apache-2.0"
] | 6 | 2020-08-07T14:34:38.000Z | 2022-01-10T12:06:27.000Z | # provides *examples* of add adding node attributes using the python API
# hence does *not* represent a real suite definition
from ecflow import *
if __name__ == "__main__":
# adding variables
suite = Suite("s1");
suite.add_variable(Variable("ECF_HOME", "/tmp/"))
suite.add_variable("ECF_URL_CMD",... | 35.732919 | 114 | 0.610986 | # provides *examples* of add adding node attributes using the python API
# hence does *not* represent a real suite definition
from ecflow import *
if __name__ == "__main__":
# adding variables
suite = Suite("s1");
suite.add_variable(Variable("ECF_HOME", "/tmp/"))
suite.add_variable("ECF_URL_CMD",... | 0 | 0 | 0 |
cb9f065b494dfb1c3b84272f0d8d605cdee8472f | 10,442 | py | Python | onionperf/util.py | amaleewilson/onionperf | 34da5e8c2aa764d70141972ea2520f881e90cb03 | [
"BSD-3-Clause"
] | 1 | 2020-05-07T16:58:22.000Z | 2020-05-07T16:58:22.000Z | onionperf/util.py | NullHypothesis/onionperf | 17b0cf422adc81d356d1db4aba46b495e9487d0b | [
"BSD-3-Clause"
] | null | null | null | onionperf/util.py | NullHypothesis/onionperf | 17b0cf422adc81d356d1db4aba46b495e9487d0b | [
"BSD-3-Clause"
] | null | null | null | '''
OnionPerf
Authored by Rob Jansen, 2015
See LICENSE for licensing information
'''
import sys, os, socket, logging, random, re, shutil, datetime, urllib.request, urllib.parse, urllib.error, gzip, lzma
from threading import Lock
from io import StringIO
from abc import ABCMeta, abstractmethod
LINEFORMATS = "k-,... | 32.940063 | 130 | 0.610132 | '''
OnionPerf
Authored by Rob Jansen, 2015
See LICENSE for licensing information
'''
import sys, os, socket, logging, random, re, shutil, datetime, urllib.request, urllib.parse, urllib.error, gzip, lzma
from threading import Lock
from io import StringIO
from abc import ABCMeta, abstractmethod
LINEFORMATS = "k-,... | 6,359 | 136 | 757 |
71362d28feb423ff1cb99dfe83169470a5de688e | 2,930 | py | Python | tests/common/test_run/reduce_max_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/common/test_run/reduce_max_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/common/test_run/reduce_max_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 43.731343 | 103 | 0.702048 | # Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 0 | 0 | 0 |
11e27d98b45733104de53ca0271c247a8e1acc05 | 1,460 | py | Python | tests/test_redis.py | rabibh/blackbox | c77dac14449a4a3d74ee3d2b00170b3085642bbf | [
"MIT"
] | 1 | 2021-09-11T04:35:06.000Z | 2021-09-11T04:35:06.000Z | tests/test_redis.py | rabibh/blackbox | c77dac14449a4a3d74ee3d2b00170b3085642bbf | [
"MIT"
] | null | null | null | tests/test_redis.py | rabibh/blackbox | c77dac14449a4a3d74ee3d2b00170b3085642bbf | [
"MIT"
] | null | null | null | import datetime
from pathlib import Path
import pytest
from blackbox.exceptions import MissingFields
from blackbox.handlers.databases import Redis
@pytest.fixture
def mock_valid_redis_config():
"""Mock valid Redis config."""
return {"password": "citrus", "host": "localhost", "port": "5432",
"id"... | 28.076923 | 100 | 0.714384 | import datetime
from pathlib import Path
import pytest
from blackbox.exceptions import MissingFields
from blackbox.handlers.databases import Redis
@pytest.fixture
def mock_valid_redis_config():
"""Mock valid Redis config."""
return {"password": "citrus", "host": "localhost", "port": "5432",
"id"... | 0 | 0 | 0 |
8d951dcb418550b15a4291b65f3b40e54aca4a56 | 3,677 | py | Python | src/eduid_webapp/reset_password/app.py | SUNET/eduid-webapp | 8e531f288d50d18a5c9182003fff2ab6670a44c3 | [
"BSD-3-Clause"
] | null | null | null | src/eduid_webapp/reset_password/app.py | SUNET/eduid-webapp | 8e531f288d50d18a5c9182003fff2ab6670a44c3 | [
"BSD-3-Clause"
] | 161 | 2017-04-13T07:56:38.000Z | 2021-03-12T13:46:38.000Z | src/eduid_webapp/reset_password/app.py | SUNET/eduid-webapp | 8e531f288d50d18a5c9182003fff2ab6670a44c3 | [
"BSD-3-Clause"
] | 3 | 2016-05-16T20:25:49.000Z | 2018-07-27T12:10:58.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2019 SUNET
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# noti... | 38.302083 | 102 | 0.758771 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2019 SUNET
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or
# without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright
# noti... | 551 | 16 | 49 |
fcc1488bbd67c283dec1d122c9037ea8a82166c5 | 1,084 | py | Python | events/feeds.py | NyntoFive/big-peach | a68742196c3edeb594723724a60ea00764d84aba | [
"MIT"
] | 4 | 2020-06-05T19:52:41.000Z | 2021-09-05T05:25:59.000Z | events/feeds.py | NyntoFive/big-peach | a68742196c3edeb594723724a60ea00764d84aba | [
"MIT"
] | 38 | 2020-01-30T05:14:22.000Z | 2021-09-22T18:44:34.000Z | events/feeds.py | NyntoFive/big-peach | a68742196c3edeb594723724a60ea00764d84aba | [
"MIT"
] | 9 | 2020-05-08T23:09:54.000Z | 2021-11-18T03:26:36.000Z | from django_ical.views import ICalFeed
from events.models import Event
from events import utils
| 26.439024 | 97 | 0.656827 | from django_ical.views import ICalFeed
from events.models import Event
from events import utils
class Calendar(ICalFeed):
product_id = '-//pyatl.dev//big-peach//EN'
timezone = str(utils._tz)
file_name = 'pyatl.ics'
title = 'PyATL Events'
description = 'Atlanta-area Python User Group (PyATL) events... | 514 | 450 | 23 |
b9ca33675abbbacc29b8c01ef2362c7c356e03eb | 1,142 | py | Python | infoblox_netmri/api/remote/models/settings_auth_audit_log_grid_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/settings_auth_audit_log_grid_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | infoblox_netmri/api/remote/models/settings_auth_audit_log_grid_remote.py | IngmarVG-IB/infoblox-netmri | b0c725fd64aee1890d83917d911b89236207e564 | [
"Apache-2.0"
] | null | null | null | from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class SettingsAuthAuditLogGridRemote(RemoteModel):
"""
| ``id:`` none
| ``attribute type:`` string
| ``created_at:`` none
| ``attribute type:`` string
| ``user_name:`` none... | 19.355932 | 62 | 0.464974 | from ..remote import RemoteModel
from infoblox_netmri.utils.utils import check_api_availability
class SettingsAuthAuditLogGridRemote(RemoteModel):
"""
| ``id:`` none
| ``attribute type:`` string
| ``created_at:`` none
| ``attribute type:`` string
| ``user_name:`` none... | 0 | 0 | 0 |
4dd171355d55f2814b3bd6db0c65a93da39358fc | 774 | py | Python | wallet/migrations/0001_initial.py | MohammadReza-Jafari/DangiDongi_api | c43ab95826da000b0a574a41b1ec0024ab0fa209 | [
"MIT"
] | null | null | null | wallet/migrations/0001_initial.py | MohammadReza-Jafari/DangiDongi_api | c43ab95826da000b0a574a41b1ec0024ab0fa209 | [
"MIT"
] | null | null | null | wallet/migrations/0001_initial.py | MohammadReza-Jafari/DangiDongi_api | c43ab95826da000b0a574a41b1ec0024ab0fa209 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-13 13:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
| 28.666667 | 144 | 0.645995 | # Generated by Django 3.1.3 on 2020-12-13 13:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 0 | 582 | 23 |
20e58b06f617e6e4242587abcc836e051a10f8de | 438 | py | Python | cyder/cydhcp/vlan/tests.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 6 | 2015-04-16T23:18:22.000Z | 2020-08-25T22:50:13.000Z | cyder/cydhcp/vlan/tests.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 267 | 2015-01-01T00:18:57.000Z | 2015-10-14T00:01:13.000Z | cyder/cydhcp/vlan/tests.py | drkitty/cyder | 1babc443cc03aa51fa3c1015bcd22f0ea2e5f0f8 | [
"BSD-3-Clause"
] | 5 | 2015-03-23T00:57:09.000Z | 2019-09-09T22:42:37.000Z | from cyder.base.tests import ModelTestMixin, TestCase
from cyder.cydhcp.vlan.models import Vlan
| 31.285714 | 66 | 0.648402 | from cyder.base.tests import ModelTestMixin, TestCase
from cyder.cydhcp.vlan.models import Vlan
class VlanTests(TestCase, ModelTestMixin):
@property
def objs(self):
"""Create objects for test_create_delete."""
return (
Vlan.objects.create(number=1, name='a'),
Vlan.objec... | 0 | 318 | 23 |
44a6ec9287a4beed4b6e37a37053d1de4a7883b6 | 1,262 | py | Python | sandbox/update_mullvad.py | thejoltjoker/python | 4517065e64d83947648e2aad206ac4ec786b166e | [
"MIT"
] | null | null | null | sandbox/update_mullvad.py | thejoltjoker/python | 4517065e64d83947648e2aad206ac4ec786b166e | [
"MIT"
] | null | null | null | sandbox/update_mullvad.py | thejoltjoker/python | 4517065e64d83947648e2aad206ac4ec786b166e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
update_mullvad.py
Description of update_mullvad.py.
"""
import requests
import platform
from bs4 import BeautifulSoup
from pprint import pprint
from urllib.parse import urlparse
from urllib.parse import urljoin
def main():
"""docstring for main"""
url = "https:... | 31.55 | 71 | 0.635499 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
update_mullvad.py
Description of update_mullvad.py.
"""
import requests
import platform
from bs4 import BeautifulSoup
from pprint import pprint
from urllib.parse import urlparse
from urllib.parse import urljoin
def main():
"""docstring for main"""
url = "https:... | 0 | 0 | 0 |
96e21665bf62437ea666f7cc8f9ff4fb5bf82206 | 7,711 | py | Python | integration/python/integration_api/models/identification.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | integration/python/integration_api/models/identification.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | integration/python/integration_api/models/identification.py | sumit4-ttn/SDK | b3ae385e5415e47ac70abd0b3fdeeaeee9aa7cff | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Integration API
The Hydrogen Integration API # noqa: E501
OpenAPI spec version: 1.2.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Identification(ob... | 28.349265 | 172 | 0.60498 | # coding: utf-8
"""
Hydrogen Integration API
The Hydrogen Integration API # noqa: E501
OpenAPI spec version: 1.2.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class Identification(ob... | 0 | 0 | 0 |
60745a50299a9b9f7974cc8068c13b6139ebbc2f | 8,603 | py | Python | pocsuite/lib/controller/controller.py | zx273983653/vulscan | 787397e267c4e6469522ee0abe55b3e98f968d4a | [
"MIT"
] | 582 | 2019-02-23T09:23:33.000Z | 2022-03-31T04:42:08.000Z | pocsuite/lib/controller/controller.py | git-wsf/vulscan | 112f8d6104daecfaaad579f73029a26d56aaa9b3 | [
"MIT"
] | 6 | 2019-03-20T10:37:48.000Z | 2020-03-10T06:20:07.000Z | pocsuite/lib/controller/controller.py | git-wsf/vulscan | 112f8d6104daecfaaad579f73029a26d56aaa9b3 | [
"MIT"
] | 183 | 2019-02-23T06:00:18.000Z | 2022-03-20T02:17:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014-2016 pocsuite developers (https://seebug.org)
See the file 'docs/COPYING' for copying permission
"""
import os
import time
import shutil
import tempfile
from textwrap import dedent
from pocsuite.lib.core.settings import REPORT_HTMLBASE
from pocsuite... | 39.645161 | 207 | 0.596536 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014-2016 pocsuite developers (https://seebug.org)
See the file 'docs/COPYING' for copying permission
"""
import os
import time
import shutil
import tempfile
from textwrap import dedent
from pocsuite.lib.core.settings import REPORT_HTMLBASE
from pocsuite... | 4,850 | 0 | 92 |
aef6ac6356129cbacc6e5028fb958d54b99597d4 | 4,813 | py | Python | state/spider.py | sijiangchen/COVID19VaccinationCasesInformationSystem | 1b42445ad128c5e1dabb8cdc4438055fe74420f5 | [
"MIT"
] | null | null | null | state/spider.py | sijiangchen/COVID19VaccinationCasesInformationSystem | 1b42445ad128c5e1dabb8cdc4438055fe74420f5 | [
"MIT"
] | null | null | null | state/spider.py | sijiangchen/COVID19VaccinationCasesInformationSystem | 1b42445ad128c5e1dabb8cdc4438055fe74420f5 | [
"MIT"
] | null | null | null | import os, django
import sys
path = os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(path)
# print(sys.path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
django.setup()
import requests
import datetime
from state import models
import re... | 37.310078 | 121 | 0.532516 | import os, django
import sys
path = os.path.dirname(os.path.abspath(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(path)
# print(sys.path)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")
django.setup()
import requests
import datetime
from state import models
import re... | 4,279 | 0 | 50 |
477de175dff03b26b912058178dc9609e3fd2255 | 120 | py | Python | gui/input/__init__.py | nerdinand/shooty-game | a2f35035bd1ed02676a8384ba6d04e4d7ec42d0c | [
"MIT"
] | null | null | null | gui/input/__init__.py | nerdinand/shooty-game | a2f35035bd1ed02676a8384ba6d04e4d7ec42d0c | [
"MIT"
] | null | null | null | gui/input/__init__.py | nerdinand/shooty-game | a2f35035bd1ed02676a8384ba6d04e4d7ec42d0c | [
"MIT"
] | null | null | null | from .direction_mapper import DirectionMapper
from .key_mapper import KeyMapper
from .mouse_handler import MouseHandler
| 30 | 45 | 0.875 | from .direction_mapper import DirectionMapper
from .key_mapper import KeyMapper
from .mouse_handler import MouseHandler
| 0 | 0 | 0 |
03cce93250383b2961e0f9fc38a1419b1a5b0483 | 3,523 | py | Python | swea/review_structure/tree.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | swea/review_structure/tree.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | swea/review_structure/tree.py | mrbartrns/swacademy_structure | 778f0546030385237c383d81ec37d5bd9ed1272d | [
"MIT"
] | null | null | null | # tree
| 28.642276 | 78 | 0.542435 | # tree
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def size(self):
left_size = self.left.size() if self.left else 0
right_size = self.right.size() if self.right else 0
return left_size + right_size + 1
def depth(... | 3,007 | -21 | 529 |
77df34d3981b39f04acc7dcb6777503d7a5ee010 | 1,014 | py | Python | DjangoTry/testDJ/main/templatetags/qr.py | PavelKoksharov/QR-BOOK | 8b05cecd7a3cffcec281f2e17da398ad9e4c5de5 | [
"MIT"
] | null | null | null | DjangoTry/testDJ/main/templatetags/qr.py | PavelKoksharov/QR-BOOK | 8b05cecd7a3cffcec281f2e17da398ad9e4c5de5 | [
"MIT"
] | null | null | null | DjangoTry/testDJ/main/templatetags/qr.py | PavelKoksharov/QR-BOOK | 8b05cecd7a3cffcec281f2e17da398ad9e4c5de5 | [
"MIT"
] | null | null | null | import qrcode
from django import template
register = template.Library()
# qr = generateQR()
import cv2
import time
@register.simple_tag(name='scan')
| 20.693878 | 63 | 0.59073 | import qrcode
from django import template
register = template.Library()
def generateQR(data="again?"):
qr = qrcode.make(data)
qr.save("Test.png")
return data
# qr = generateQR()
import cv2
import time
@register.simple_tag(name='scan')
def scanQR():
# initalize the camera
cap = cv2.VideoCapt... | 809 | 0 | 45 |
1e6a29b881ea0e527fc10b755160c6f6af4d900b | 6,605 | py | Python | samples/compute/manage_virtual_machine_scale_set.py | leigharubin/azure-samples-python-management | ed640755f5362e309ba66af22a3d0c67b008c708 | [
"MIT"
] | 47 | 2020-05-29T18:25:57.000Z | 2022-03-30T06:04:56.000Z | samples/compute/manage_virtual_machine_scale_set.py | leigharubin/azure-samples-python-management | ed640755f5362e309ba66af22a3d0c67b008c708 | [
"MIT"
] | 27 | 2020-05-13T06:37:24.000Z | 2022-03-01T07:58:34.000Z | samples/compute/manage_virtual_machine_scale_set.py | leigharubin/azure-samples-python-management | ed640755f5362e309ba66af22a3d0c67b008c708 | [
"MIT"
] | 67 | 2020-05-09T06:09:19.000Z | 2022-03-22T23:18:06.000Z | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os... | 31.303318 | 199 | 0.571688 | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os... | 5,974 | 0 | 23 |
18bdfa1765f31fe3d7392c4aee85c00b0db5abf2 | 179 | py | Python | examples/halflife3-bot/tokens.py | avinassh/PRAWOAuth2 | a7c9ab5a93666d8468c6bf8455a4bdff6cda6583 | [
"MIT"
] | 34 | 2015-07-08T19:40:40.000Z | 2021-04-13T20:05:01.000Z | examples/halflife3-bot/tokens.py | avinassh/PRAWOAuth2 | a7c9ab5a93666d8468c6bf8455a4bdff6cda6583 | [
"MIT"
] | 11 | 2015-07-09T15:50:42.000Z | 2016-11-11T16:07:02.000Z | examples/halflife3-bot/tokens.py | avinassh/PRAWOAuth2 | a7c9ab5a93666d8468c6bf8455a4bdff6cda6583 | [
"MIT"
] | 10 | 2015-07-09T15:46:07.000Z | 2020-04-07T13:20:26.000Z | import os
app_key = os.getenv('HL3_APP_KEY')
app_secret = os.getenv('HL3_APP_SECRET')
access_token = os.getenv('HL3_ACCESS_TOKEN')
refresh_token = os.getenv('HL3_REFRESH_TOKEN')
| 25.571429 | 46 | 0.782123 | import os
app_key = os.getenv('HL3_APP_KEY')
app_secret = os.getenv('HL3_APP_SECRET')
access_token = os.getenv('HL3_ACCESS_TOKEN')
refresh_token = os.getenv('HL3_REFRESH_TOKEN')
| 0 | 0 | 0 |
7738184e51d6e2790bf246b0d7ee85cf21c67aae | 2,333 | py | Python | Scripts/Miscellaneous/Movie_Recommeder/movie_recommendation.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 437 | 2020-09-24T13:57:39.000Z | 2022-03-30T12:45:56.000Z | Scripts/Miscellaneous/Movie_Recommeder/movie_recommendation.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 355 | 2020-09-24T13:53:16.000Z | 2022-03-27T04:20:40.000Z | Scripts/Miscellaneous/Movie_Recommeder/movie_recommendation.py | ShivangiPatel102/Python_and_the_Web | 6d3b55aef20feeda3cfff941d7bbdc26cbcc70d2 | [
"MIT"
] | 315 | 2020-09-24T18:41:19.000Z | 2022-03-07T05:53:01.000Z | import requests
if __name__ == "__main__":
movielist = input("Enter movies seprated by comma(,) - ").split(",")
recommendation_limit = input("Enter the limit of of recommended movies - ")
recommended_Movies = get_sorted_recommendations(movielist, recommendation_limit)
for movies in recommended_M... | 29.910256 | 87 | 0.660952 | import requests
def get_movies_from_tastedive(movieName, recom_limit):
baseurl = "https://tastedive.com/api/similar"
params_d = {}
params_d["q"] = movieName
params_d["k"] = "your_tastedive_API_key"
params_d["type"] = "movies"
params_d["limit"] = recom_limit
resp = requests.get(baseurl, par... | 1,803 | 0 | 138 |
76c5c29d967ba3fc5193b39785475c5c61e87815 | 4,751 | py | Python | modules/deprecated/Experiment.py | MarzioMonticelli/python-cryptonet | 598c6e61fd7165f3a03ffce3f1de9f69d8645681 | [
"MIT"
] | 19 | 2020-04-09T15:01:43.000Z | 2022-03-28T07:39:40.000Z | modules/deprecated/Experiment.py | MarzioMonticelli/python-cryptonet | 598c6e61fd7165f3a03ffce3f1de9f69d8645681 | [
"MIT"
] | 4 | 2020-04-22T14:19:53.000Z | 2021-05-25T13:12:57.000Z | modules/deprecated/Experiment.py | MarzioMonticelli/python-cryptonet | 598c6e61fd7165f3a03ffce3f1de9f69d8645681 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 27 11:00:02 2019
@author: marzio
"""
from tensorflow import keras
from tensorflow.keras import utils as tfku
import numpy as np
import os
import glob
import pandas as pd
import talos
from CryptoNet import mnist_model
from CryptoNet import util
ve... | 31.052288 | 86 | 0.548306 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 27 11:00:02 2019
@author: marzio
"""
from tensorflow import keras
from tensorflow.keras import utils as tfku
import numpy as np
import os
import glob
import pandas as pd
import talos
from CryptoNet import mnist_model
from CryptoNet import util
ve... | 3,623 | 222 | 23 |
0717a5942a02fad369f79c99a21c9a813467d75a | 20,408 | py | Python | reviewboard/hostingsvcs/codebasehq.py | davidt/reviewboard | 66b08d06aec9be921e737b99c5ab78acc8b7a6fe | [
"MIT"
] | 1 | 2019-08-20T03:39:04.000Z | 2019-08-20T03:39:04.000Z | reviewboard/hostingsvcs/codebasehq.py | davidt/reviewboard | 66b08d06aec9be921e737b99c5ab78acc8b7a6fe | [
"MIT"
] | 1 | 2019-08-20T03:39:45.000Z | 2019-08-20T03:39:45.000Z | reviewboard/hostingsvcs/codebasehq.py | davidt/reviewboard | 66b08d06aec9be921e737b99c5ab78acc8b7a6fe | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import logging
from xml.dom.minidom import parseString
from django import forms
from django.utils import six
from django.utils.six.moves.urllib.error import HTTPError, URLError
from django.utils.translation import ugettext_lazy as _, ugettext
from reviewboard.hostingsvcs.error... | 33.12987 | 79 | 0.55929 | from __future__ import unicode_literals
import logging
from xml.dom.minidom import parseString
from django import forms
from django.utils import six
from django.utils.six.moves.urllib.error import HTTPError, URLError
from django.utils.translation import ugettext_lazy as _, ugettext
from reviewboard.hostingsvcs.error... | 249 | 1,743 | 46 |
5e8a82acf4a31a8ff46d7a3a66efc104d1d6db3e | 5,463 | py | Python | Python/logs.py | orestismar/fun_place | 3b279756d867405d51877b8767e15b22b1ce1365 | [
"MIT"
] | null | null | null | Python/logs.py | orestismar/fun_place | 3b279756d867405d51877b8767e15b22b1ce1365 | [
"MIT"
] | 1 | 2022-03-14T22:43:23.000Z | 2022-03-14T22:43:23.000Z | Python/logs.py | orestismar/fun_place | 3b279756d867405d51877b8767e15b22b1ce1365 | [
"MIT"
] | null | null | null | """
Used to create loggers for modules within the namespace.
These loggers are the standard python.logging loggers which can be adapted/changed via the standard methods.
"""
import logging
import logging.handlers
import os
from directories import LOG_DIR
# Default logging format
FUNSPACE_LOG_FORMAT = '%(asctime)s %(... | 34.575949 | 114 | 0.692477 | """
Used to create loggers for modules within the namespace.
These loggers are the standard python.logging loggers which can be adapted/changed via the standard methods.
"""
import logging
import logging.handlers
import os
from directories import LOG_DIR
# Default logging format
FUNSPACE_LOG_FORMAT = '%(asctime)s %(... | 887 | 0 | 69 |
28aef4053ebddab7d114e3fe2ee42d4ca0419bb9 | 3,846 | py | Python | ss-stats.py | charlestang/shadowsocks-libev-multiuser-cli | 768d1215c256d6ad2af5f62bb3778e2f6ea3260e | [
"MIT"
] | null | null | null | ss-stats.py | charlestang/shadowsocks-libev-multiuser-cli | 768d1215c256d6ad2af5f62bb3778e2f6ea3260e | [
"MIT"
] | null | null | null | ss-stats.py | charlestang/shadowsocks-libev-multiuser-cli | 768d1215c256d6ad2af5f62bb3778e2f6ea3260e | [
"MIT"
] | null | null | null | import argparse
import json
import os
import re
import socket
import sqlite3
import sys
from datetime import datetime
from typing import List
import psutil
from psutil._common import sconn
def get_processes_by_name(name: str) -> List[psutil.Process]:
"""
根据进程名,获取进程列表
"""
res = []
for proc in psu... | 28.488889 | 104 | 0.604004 | import argparse
import json
import os
import re
import socket
import sqlite3
import sys
from datetime import datetime
from typing import List
import psutil
from psutil._common import sconn
def get_argparser() -> argparse.ArgumentParser:
parser = argparse.ArgumentParser(
description="ss-manager and ss-ser... | 581 | 0 | 69 |
9a0f8a62c583187d45e511411ac4fdeab12aac44 | 1,342 | py | Python | scripts/release_sdk_status/util.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | scripts/release_sdk_status/util.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | scripts/release_sdk_status/util.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | CERTIFICATION = '''
-----BEGIN CERTIFICATE-----
MIIDSDCCAjCgAwIBAgIUPMKpJ/j10eQrcQBNnkImIaOYHakwDQYJKoZIhvcNAQEL
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIxMDgwNTAwMzU1NloXDTIyMDgw
NTAwMzU1NlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEAxe/ZseXgOTVoF7uTjX5Leknk95jIoyGc+VlxA8BhzGOr
r4u6VNQZRCMq... | 46.275862 | 64 | 0.90313 | CERTIFICATION = '''
-----BEGIN CERTIFICATE-----
MIIDSDCCAjCgAwIBAgIUPMKpJ/j10eQrcQBNnkImIaOYHakwDQYJKoZIhvcNAQEL
BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIxMDgwNTAwMzU1NloXDTIyMDgw
NTAwMzU1NlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF
AAOCAQ8AMIIBCgKCAQEAxe/ZseXgOTVoF7uTjX5Leknk95jIoyGc+VlxA8BhzGOr
r4u6VNQZRCMq... | 94 | 0 | 23 |
86bbe9b0f0944221580d90d7605c911e8ac323be | 202 | py | Python | home/GroG/test.py | sola1993/inmoov | 34e7bb6e214bd9bf3eee808c19f0ab09ec79345f | [
"Apache-2.0"
] | 1 | 2021-02-24T17:05:52.000Z | 2021-02-24T17:05:52.000Z | home/GroG/test.py | sola1993/inmoov | 34e7bb6e214bd9bf3eee808c19f0ab09ec79345f | [
"Apache-2.0"
] | null | null | null | home/GroG/test.py | sola1993/inmoov | 34e7bb6e214bd9bf3eee808c19f0ab09ec79345f | [
"Apache-2.0"
] | 1 | 2020-06-03T20:48:47.000Z | 2020-06-03T20:48:47.000Z | # this is an embedded Python script it's really on GitHub
# and this is only a reference - so when it changes people
# will see the change on the webpage .. GOODTIMES !
pid = Runtime.start("pid","PID") | 40.4 | 58 | 0.727723 | # this is an embedded Python script it's really on GitHub
# and this is only a reference - so when it changes people
# will see the change on the webpage .. GOODTIMES !
pid = Runtime.start("pid","PID") | 0 | 0 | 0 |
090ab017b0d5feffad86fa3add52eba79cd8748a | 1,781 | py | Python | xrpc/error.py | andreycizov/python-xrpc | ed403ae74d5e89e0ebac68bcc58591d6b32742ff | [
"Apache-2.0"
] | null | null | null | xrpc/error.py | andreycizov/python-xrpc | ed403ae74d5e89e0ebac68bcc58591d6b32742ff | [
"Apache-2.0"
] | null | null | null | xrpc/error.py | andreycizov/python-xrpc | ed403ae74d5e89e0ebac68bcc58591d6b32742ff | [
"Apache-2.0"
] | null | null | null | # possible exceptions caused by the API calls
from datetime import datetime
from typing import Optional
from xrpc.util import time_now
# a callable raised an exception
# the call was made to a point that does not support given arguments
| 25.811594 | 89 | 0.699045 | # possible exceptions caused by the API calls
from datetime import datetime
from typing import Optional
from xrpc.util import time_now
class RPCError(Exception):
def __str__(self):
args = ', '.join(self.args)
return f'{self.__class__.__name__}({args})'
class UndecidedError(RPCError):
# We h... | 535 | 704 | 288 |
8216b5c540d8da374559fa003d0a014c80e46abd | 234 | py | Python | gglsbl3/util/__init__.py | Stefan-Code/gglsbl3 | 5d7497c83e838728d96eb54e0d50b5ffe54ff315 | [
"Apache-2.0"
] | 10 | 2015-05-08T19:22:07.000Z | 2016-03-16T14:41:39.000Z | gglsbl3/util/__init__.py | Stefan-Code/gglsbl3 | 5d7497c83e838728d96eb54e0d50b5ffe54ff315 | [
"Apache-2.0"
] | 8 | 2015-11-10T21:36:49.000Z | 2016-05-31T07:43:12.000Z | gglsbl3/util/__init__.py | Stefan-Code/gglsbl3 | 5d7497c83e838728d96eb54e0d50b5ffe54ff315 | [
"Apache-2.0"
] | 3 | 2015-12-08T00:52:38.000Z | 2021-07-27T18:31:07.000Z | """
This util package provides utility functions
that are used across the different gglsbl3 modules
e.g. string formatting
"""
from .format_utils import prettify_seconds, format_max_len
from .network_utils import int_to_ip, ip_to_int
| 29.25 | 58 | 0.824786 | """
This util package provides utility functions
that are used across the different gglsbl3 modules
e.g. string formatting
"""
from .format_utils import prettify_seconds, format_max_len
from .network_utils import int_to_ip, ip_to_int
| 0 | 0 | 0 |
52d95f8932a3fde3fd2fc88b6f39250bdaefbe40 | 49 | py | Python | spys1proxy/__init__.py | doubledare704/spys_one_proxy | cf0dfd1f5b87d2149ef58abbf61c39adc10f3934 | [
"MIT"
] | null | null | null | spys1proxy/__init__.py | doubledare704/spys_one_proxy | cf0dfd1f5b87d2149ef58abbf61c39adc10f3934 | [
"MIT"
] | null | null | null | spys1proxy/__init__.py | doubledare704/spys_one_proxy | cf0dfd1f5b87d2149ef58abbf61c39adc10f3934 | [
"MIT"
] | null | null | null | from .main import Spys
__all__ = [
'Spys'
]
| 8.166667 | 22 | 0.591837 | from .main import Spys
__all__ = [
'Spys'
]
| 0 | 0 | 0 |
f23046857bb43404e1738d7ebaa2061aeea0e376 | 4,579 | py | Python | tests/utils_test.py | bow/volt | 5940926e2e4a01b4ee32a10f7cc8b44a42530307 | [
"BSD-3-Clause"
] | 7 | 2015-06-23T11:33:11.000Z | 2022-02-02T10:41:04.000Z | tests/utils_test.py | bow/volt | 5940926e2e4a01b4ee32a10f7cc8b44a42530307 | [
"BSD-3-Clause"
] | 59 | 2016-09-12T21:04:50.000Z | 2021-11-25T21:57:10.000Z | tests/utils_test.py | bow/volt | 5940926e2e4a01b4ee32a10f7cc8b44a42530307 | [
"BSD-3-Clause"
] | 2 | 2017-03-16T00:12:07.000Z | 2017-05-05T13:05:11.000Z | # -*- coding: utf-8 -*-
"""
Tests for volt.utils
~~~~~~~~~~~~~~~~~~~~
"""
# (c) 2012-2020 Wibowo Arindrarto <contact@arindrarto.dev>
from pathlib import Path
import pytest
from pendulum.tz import local_timezone
from pendulum.tz.timezone import Timezone
from volt import exceptions as exc
from volt.utils impor... | 29.165605 | 88 | 0.588993 | # -*- coding: utf-8 -*-
"""
Tests for volt.utils
~~~~~~~~~~~~~~~~~~~~
"""
# (c) 2012-2020 Wibowo Arindrarto <contact@arindrarto.dev>
from pathlib import Path
import pytest
from pendulum.tz import local_timezone
from pendulum.tz.timezone import Timezone
from volt import exceptions as exc
from volt.utils impor... | 2,610 | 0 | 246 |
bce1e3c03b78df6780e7495f454c6223a623c9b6 | 1,903 | py | Python | onpolicy/algorithms/utils/mlp.py | btx0424/on-policy | 78e095be05a8596afcb4b7de8b3293844717fed6 | [
"MIT"
] | null | null | null | onpolicy/algorithms/utils/mlp.py | btx0424/on-policy | 78e095be05a8596afcb4b7de8b3293844717fed6 | [
"MIT"
] | null | null | null | onpolicy/algorithms/utils/mlp.py | btx0424/on-policy | 78e095be05a8596afcb4b7de8b3293844717fed6 | [
"MIT"
] | null | null | null | import torch.nn as nn
from .util import init, get_clones
"""MLP modules."""
| 33.982143 | 93 | 0.643195 | import torch.nn as nn
from .util import init, get_clones
"""MLP modules."""
class MLPLayer(nn.Module):
def __init__(self, input_dim, hidden_size, layer_N, use_orthogonal, use_ReLU):
super(MLPLayer, self).__init__()
self._layer_N = layer_N
active_func = [nn.Tanh(), nn.LeakyReLU()][use_ReLU... | 1,665 | 9 | 152 |
66ca7e7099d65cd5d65da4ed82f8eb8ebea1c97f | 1,562 | py | Python | src/ndforest_test.py | Thijs3/Anomaly-Detection-with-RS-Quadtree | 7389ba7c8359c22f7a00c4e0a1bc03534b0666b5 | [
"MIT"
] | null | null | null | src/ndforest_test.py | Thijs3/Anomaly-Detection-with-RS-Quadtree | 7389ba7c8359c22f7a00c4e0a1bc03534b0666b5 | [
"MIT"
] | null | null | null | src/ndforest_test.py | Thijs3/Anomaly-Detection-with-RS-Quadtree | 7389ba7c8359c22f7a00c4e0a1bc03534b0666b5 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from prettytable import PrettyTable
from sklearn.datasets import make_blobs, make_swiss_roll
from src.ndforest import NDForest
from sklearn import datasets
ct = 0.1
# DATASETS -----------------------------------------------------------------------------------------... | 33.234043 | 119 | 0.59283 | import numpy as np
import matplotlib.pyplot as plt
from prettytable import PrettyTable
from sklearn.datasets import make_blobs, make_swiss_roll
from src.ndforest import NDForest
from sklearn import datasets
ct = 0.1
def plot(data):
fig = plt.figure()
ax = plt.axes(projection='3d')
colors = np.array(['#ff... | 360 | 0 | 23 |
e4d62414686ed6aea9de1144747c552c551914f6 | 5,917 | py | Python | 10_Bayesian_optimization.py | theignorantzen/VLC-Pi | 66f50d9393429c55716c4c036240c44a4e601a98 | [
"MIT"
] | null | null | null | 10_Bayesian_optimization.py | theignorantzen/VLC-Pi | 66f50d9393429c55716c4c036240c44a4e601a98 | [
"MIT"
] | null | null | null | 10_Bayesian_optimization.py | theignorantzen/VLC-Pi | 66f50d9393429c55716c4c036240c44a4e601a98 | [
"MIT"
] | null | null | null | ## https://scikit-optimize.github.io/notebooks/bayesian-optimization.html
import numpy as np
import matplotlib.pyplot as plt
from skopt import gp_minimize
## Implemented in /home/sbn/anaconda2/lib/python2.7/site-packages/skopt/optimizer/base.py
## Implemented in /home/sbn/anaconda2/lib/python2.7/site-packages/skopt/... | 40.806897 | 312 | 0.637823 | ## https://scikit-optimize.github.io/notebooks/bayesian-optimization.html
import numpy as np
import matplotlib.pyplot as plt
from skopt import gp_minimize
## Implemented in /home/sbn/anaconda2/lib/python2.7/site-packages/skopt/optimizer/base.py
## Implemented in /home/sbn/anaconda2/lib/python2.7/site-packages/skopt/... | 1,627 | 0 | 88 |
12c873ed8700281840e7cd4493116c688cb0027b | 6,733 | py | Python | python_simple_cli_apps/mbti/predefined.py | vietcodecamp/vietcode2019 | 9785909961b185ca40c59ebcff0f29ccac757352 | [
"Apache-2.0"
] | 1 | 2019-07-22T20:32:31.000Z | 2019-07-22T20:32:31.000Z | python_simple_cli_apps/mbti/predefined.py | vietcodecamp/vietcode2018 | 9785909961b185ca40c59ebcff0f29ccac757352 | [
"MIT"
] | 2 | 2019-04-04T17:57:39.000Z | 2019-08-17T00:34:01.000Z | python_simple_cli_apps/mbti/predefined.py | vietcodecamp/vietcode2019 | 9785909961b185ca40c59ebcff0f29ccac757352 | [
"Apache-2.0"
] | null | null | null | import sys
import time
#Predefined ====================================================================
#caption------------------------------------------------------------------------
caption = '''
____ ____ ____________ ____________________ ___
| \ / | | ______ \ |_______... | 28.773504 | 135 | 0.611466 | import sys
import time
#Predefined ====================================================================
#caption------------------------------------------------------------------------
caption = '''
____ ____ ____________ ____________________ ___
| \ / | | ______ \ |_______... | 144 | 0 | 23 |
e55b2b66733074252c6fcc7e9fc2ee57371f880b | 179 | py | Python | gym_gridverse/__init__.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 6 | 2020-10-15T14:45:11.000Z | 2021-02-20T12:11:32.000Z | gym_gridverse/__init__.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 5 | 2021-01-20T15:34:29.000Z | 2022-03-18T18:52:53.000Z | gym_gridverse/__init__.py | DavidSlayback/gym-gridverse | b8916576a92489c030fb2c2060598c7f473f19f2 | [
"MIT"
] | 2 | 2021-01-11T18:48:49.000Z | 2021-01-26T15:45:38.000Z | """Top-level package for gym-gridverse."""
__author__ = """Andrea Baisero"""
__email__ = 'andrea.baisero@gmail.com'
__version__ = '0.0.1'
import gym_gridverse.gym # noqa: F401
| 22.375 | 42 | 0.709497 | """Top-level package for gym-gridverse."""
__author__ = """Andrea Baisero"""
__email__ = 'andrea.baisero@gmail.com'
__version__ = '0.0.1'
import gym_gridverse.gym # noqa: F401
| 0 | 0 | 0 |
7be2cfe34e92efe65b1c889ee1cc20443cd955e0 | 3,250 | py | Python | deepcut/utils.py | wannaphong/deepcut | e4f7779caa087c5ffbad3bc4e88f919e300d020c | [
"MIT"
] | 374 | 2017-06-24T11:55:10.000Z | 2022-03-29T06:44:43.000Z | deepcut/utils.py | wannaphong/deepcut | e4f7779caa087c5ffbad3bc4e88f919e300d020c | [
"MIT"
] | 61 | 2017-06-26T09:26:33.000Z | 2022-01-16T11:34:13.000Z | deepcut/utils.py | wannaphong/deepcut | e4f7779caa087c5ffbad3bc4e88f919e300d020c | [
"MIT"
] | 116 | 2017-06-25T15:11:11.000Z | 2022-03-29T06:44:47.000Z | #!/usr/bin/env python
# encoding: utf-8
import numpy as np
CHAR_TYPE = {
u'กขฃคฆงจชซญฎฏฐฑฒณดตถทธนบปพฟภมยรลวศษสฬอ': 'c',
u'ฅฉผฟฌหฮ': 'n',
u'ะาำิีืึุู': 'v', # า ะ ำ ิ ี ึ ื ั ู ุ
u'เแโใไ': 'w',
u'่้๊๋': 't', # วรรณยุกต์ ่ ้ ๊ ๋
u'์ๆฯ.': 's', # ์ ๆ ฯ .
u'0123456789๑๒๓๔๕๖๗๘๙': 'd',
u'"'... | 36.931818 | 85 | 0.449538 | #!/usr/bin/env python
# encoding: utf-8
import numpy as np
CHAR_TYPE = {
u'กขฃคฆงจชซญฎฏฐฑฒณดตถทธนบปพฟภมยรลวศษสฬอ': 'c',
u'ฅฉผฟฌหฮ': 'n',
u'ะาำิีืึุู': 'v', # า ะ ำ ิ ี ึ ื ั ู ุ
u'เแโใไ': 'w',
u'่้๊๋': 't', # วรรณยุกต์ ่ ้ ๊ ๋
u'์ๆฯ.': 's', # ์ ๆ ฯ .
u'0123456789๑๒๓๔๕๖๗๘๙': 'd',
u'"'... | 0 | 0 | 0 |
b5a89c532d13bcb9b7bdf6133f1b4e19c71f96b3 | 4,952 | py | Python | torchfcn/datasets/cityscape.py | 1xyz/pytorch-fcn-ext | 2a3bfd819f55200a11132981b38a6b7c964fa565 | [
"MIT"
] | null | null | null | torchfcn/datasets/cityscape.py | 1xyz/pytorch-fcn-ext | 2a3bfd819f55200a11132981b38a6b7c964fa565 | [
"MIT"
] | null | null | null | torchfcn/datasets/cityscape.py | 1xyz/pytorch-fcn-ext | 2a3bfd819f55200a11132981b38a6b7c964fa565 | [
"MIT"
] | null | null | null | import collections
import os.path as osp
import sys
import PIL.Image
import numpy as np
import torch
from torch.utils import data
from .transforms import ImageTransformType, FlipType, apply_transform
| 32.578947 | 115 | 0.515549 | import collections
import os.path as osp
import sys
import PIL.Image
import numpy as np
import torch
from torch.utils import data
from .transforms import ImageTransformType, FlipType, apply_transform
class CityScape(data.Dataset):
class_names = np.array([
'ego vehicle',
'rectification border',
... | 3,308 | 1,418 | 23 |
d241f4377e6413858bf514163adf7e002beefdb7 | 2,657 | py | Python | src/mcmc.py | yoshihidesawada/CompGAN | 3315170b907a382853e76f8be5207d7332171573 | [
"MIT"
] | 5 | 2020-11-17T06:50:30.000Z | 2022-03-11T13:40:49.000Z | src/mcmc.py | yoshihidesawada/CompGAN | 3315170b907a382853e76f8be5207d7332171573 | [
"MIT"
] | 1 | 2021-12-10T06:15:57.000Z | 2022-01-06T06:33:26.000Z | src/mcmc.py | yoshihidesawada/CompGAN | 3315170b907a382853e76f8be5207d7332171573 | [
"MIT"
] | null | null | null | import os
import sys
import numpy as np
import macro
| 29.853933 | 90 | 0.577719 | import os
import sys
import numpy as np
import macro
def metropolis_hastings(valences,chemical_formula,iteration):
# normalize and rounding
mean_vect = chemical_formula[chemical_formula>1.0e-6]
mean_sum = np.sum(mean_vect)
mean_vect = mean_vect/mean_sum
mean_vect = np.round(mean_vec... | 2,571 | 0 | 25 |
225bd91fe2e43a5247f95fb31de7c7fe1158984b | 146 | py | Python | nyumbax/apps.py | BwanaQ/nyumba-kumi | c264b0941c77a4d7175a2dc5380723bea1acf380 | [
"MIT"
] | null | null | null | nyumbax/apps.py | BwanaQ/nyumba-kumi | c264b0941c77a4d7175a2dc5380723bea1acf380 | [
"MIT"
] | null | null | null | nyumbax/apps.py | BwanaQ/nyumba-kumi | c264b0941c77a4d7175a2dc5380723bea1acf380 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 20.857143 | 56 | 0.760274 | from django.apps import AppConfig
class NyumbaxConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'nyumbax'
| 0 | 88 | 23 |
6e4e8e64ea6a83b1fbc6aa7a78acc58741254bef | 95 | py | Python | core/utils.py | dmodena/projetoextensao | fbb44489ff95a51fc2205fa24ff016f07bf148c7 | [
"MIT"
] | null | null | null | core/utils.py | dmodena/projetoextensao | fbb44489ff95a51fc2205fa24ff016f07bf148c7 | [
"MIT"
] | 1 | 2021-06-10T18:56:03.000Z | 2021-06-10T18:56:03.000Z | core/utils.py | dmodena/projetoextensao | fbb44489ff95a51fc2205fa24ff016f07bf148c7 | [
"MIT"
] | null | null | null | from django.conf import settings
| 19 | 36 | 0.810526 | from django.conf import settings
def static_files_url():
return settings.STATIC_FILES_URL
| 39 | 0 | 23 |
dbbe63d50ee140e50d39d1c1370c90463847404d | 3,312 | py | Python | tests/test_distillation_pipeline.py | anonymous-authors-2018/robotics-repo | 385d1f3b49f8d414ab90f53c6f06b56614ae83ba | [
"MIT"
] | 5 | 2019-08-21T22:57:21.000Z | 2021-01-01T21:15:26.000Z | tests/test_distillation_pipeline.py | BillChan226/POAR-SRL-4-Robot | a6a8052e105369656d34fffc4f7ca4475dcc38df | [
"MIT"
] | null | null | null | tests/test_distillation_pipeline.py | BillChan226/POAR-SRL-4-Robot | a6a8052e105369656d34fffc4f7ca4475dcc38df | [
"MIT"
] | 2 | 2019-11-26T11:41:12.000Z | 2021-08-30T16:00:27.000Z | import subprocess
import pytest
import os
import shutil
import time
from rl_baselines.student_eval import OnPolicyDatasetGenerator, mergeData, trainStudent
ENV_NAME = 'OmnirobotEnv-v0'
PATH_SRL = "srl_zoo/data/"
DEFAULT_SRL_TEACHERS = "ground_truth"
DEFAULT_SRL_STUDENT = "raw_pixels"
NUM_TIMESTEP = 25000
NUM_CPU = 4... | 38.964706 | 119 | 0.677838 | import subprocess
import pytest
import os
import shutil
import time
from rl_baselines.student_eval import OnPolicyDatasetGenerator, mergeData, trainStudent
ENV_NAME = 'OmnirobotEnv-v0'
PATH_SRL = "srl_zoo/data/"
DEFAULT_SRL_TEACHERS = "ground_truth"
DEFAULT_SRL_STUDENT = "raw_pixels"
NUM_TIMESTEP = 25000
NUM_CPU = 4... | 2,925 | 0 | 45 |
58c828f2ebb4f5f1081ed62952efae38b457c92a | 4,243 | py | Python | app/routes/score.py | Kumzy/cf-leaderboard-back | 2f99e0d37ef08e4965bbb6a98834e4162a439bbe | [
"Apache-2.0"
] | null | null | null | app/routes/score.py | Kumzy/cf-leaderboard-back | 2f99e0d37ef08e4965bbb6a98834e4162a439bbe | [
"Apache-2.0"
] | null | null | null | app/routes/score.py | Kumzy/cf-leaderboard-back | 2f99e0d37ef08e4965bbb6a98834e4162a439bbe | [
"Apache-2.0"
] | null | null | null | from app import app, db
from flask import jsonify, request
from flask_cors import cross_origin
from app.models.score import Score, ScoreSchema
from app.models.event import Event
from flask_jwt_extended import jwt_required
@app.route('/api/score', methods=['POST'])
@jwt_required()
@cross_origin()
@app.route('/api/scor... | 38.926606 | 77 | 0.625972 | from app import app, db
from flask import jsonify, request
from flask_cors import cross_origin
from app.models.score import Score, ScoreSchema
from app.models.event import Event
from flask_jwt_extended import jwt_required
@app.route('/api/score', methods=['POST'])
@jwt_required()
@cross_origin()
def post_score():
... | 3,714 | 0 | 66 |
bb8ceaa884c563fe9caafd43440a7e5f6d763548 | 4,292 | py | Python | tests/jumpgate-tests/network/test_subnet.py | wpf710/app-proxy | 3340cdb90fea8da26fc82211a1e14c5e43beeae0 | [
"MIT"
] | 10 | 2015-01-19T14:21:32.000Z | 2018-12-01T17:17:30.000Z | tests/jumpgate-tests/network/test_subnet.py | wpf710/app-proxy | 3340cdb90fea8da26fc82211a1e14c5e43beeae0 | [
"MIT"
] | 6 | 2015-01-19T14:29:43.000Z | 2015-07-02T11:09:32.000Z | tests/jumpgate-tests/network/test_subnet.py | wpf710/app-proxy | 3340cdb90fea8da26fc82211a1e14c5e43beeae0 | [
"MIT"
] | 7 | 2015-02-18T01:57:04.000Z | 2018-12-01T17:17:31.000Z | import unittest
import falcon
from falcon.testing import helpers
import mock
from jumpgate.network.drivers.sl import subnets
SUBNET_DICT = {'id': 10,
'networkIdentifier': '9.0.3.192',
'tenant_id': '6',
'cidr': 28,
'networkVlanId': 5,
'gateway... | 36.683761 | 70 | 0.627213 | import unittest
import falcon
from falcon.testing import helpers
import mock
from jumpgate.network.drivers.sl import subnets
SUBNET_DICT = {'id': 10,
'networkIdentifier': '9.0.3.192',
'tenant_id': '6',
'cidr': 28,
'networkVlanId': 5,
'gateway... | 1,624 | 2,200 | 69 |
d9b0440ec2fa27ee3ef0e790dd78385e959fe0f6 | 3,656 | py | Python | app/tests/api/api_v2/test_upload.py | qtdemo1/ibm-ops | 29f3d4ba406a1c39a007468977784d6c39f056bb | [
"Apache-2.0"
] | 1 | 2021-09-14T18:40:33.000Z | 2021-09-14T18:40:33.000Z | app/tests/api/api_v2/test_upload.py | qtdemo1/ibm-ops | 29f3d4ba406a1c39a007468977784d6c39f056bb | [
"Apache-2.0"
] | 7 | 2021-04-23T13:41:39.000Z | 2021-08-12T09:33:10.000Z | app/tests/api/api_v2/test_upload.py | qtdemo1/ibm-ops | 29f3d4ba406a1c39a007468977784d6c39f056bb | [
"Apache-2.0"
] | 5 | 2020-12-10T14:27:23.000Z | 2022-03-29T08:44:22.000Z | #!/usr/bin/env python3
#
# Copyright 2020 IBM
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 33.541284 | 74 | 0.669584 | #!/usr/bin/env python3
#
# Copyright 2020 IBM
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | 2,617 | 0 | 69 |
dbe3ed2bc9cbfeb8b92a6bfac14121aae4b02e33 | 3,283 | py | Python | POM/url.py | Mikhail-QA/HS | 8ddbc09a0d1493128f3af6b8078c295609908dd7 | [
"Apache-2.0"
] | null | null | null | POM/url.py | Mikhail-QA/HS | 8ddbc09a0d1493128f3af6b8078c295609908dd7 | [
"Apache-2.0"
] | null | null | null | POM/url.py | Mikhail-QA/HS | 8ddbc09a0d1493128f3af6b8078c295609908dd7 | [
"Apache-2.0"
] | null | null | null | import time
import allure
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
| 43.197368 | 118 | 0.695401 | import time
import allure
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
class UrlHomeSchool(object):
def __init__(self, driver):
self.driver = driver
@allure.step
def go_to_my_pr... | 2,791 | 473 | 23 |
f7d9a1de9bdba2047f0d19200ff51b8852a2bca8 | 1,559 | py | Python | Examples/Aerobraking.py | IrTrez/msp-examples | 463ed5e4fe703bf770f0e710266b0e0e112136f3 | [
"MIT"
] | null | null | null | Examples/Aerobraking.py | IrTrez/msp-examples | 463ed5e4fe703bf770f0e710266b0e0e112136f3 | [
"MIT"
] | null | null | null | Examples/Aerobraking.py | IrTrez/msp-examples | 463ed5e4fe703bf770f0e710266b0e0e112136f3 | [
"MIT"
] | null | null | null | from msp import msp, simtools
import time
import math
import numpy as np
DATAFILE = "runs/Aerobraking.csv"
ATMOSPHEREDATA = "densityModels/MarsDensity.csv"
SPEED = 2000 # __ times speed
RUNTIME = 300000
print("Total runtime will be:", RUNTIME, "s or:", RUNTIME/3600, "hours or:", RUNTIME/86400, "days")
# USE km AS ST... | 33.170213 | 99 | 0.748557 | from msp import msp, simtools
import time
import math
import numpy as np
DATAFILE = "runs/Aerobraking.csv"
ATMOSPHEREDATA = "densityModels/MarsDensity.csv"
SPEED = 2000 # __ times speed
RUNTIME = 300000
print("Total runtime will be:", RUNTIME, "s or:", RUNTIME/3600, "hours or:", RUNTIME/86400, "days")
# USE km AS ST... | 0 | 0 | 0 |
5ff606c1e731e0696b58ab84882b8bddd8a3dac1 | 1,631 | py | Python | test/unit/test_swift.py | thiagodasilva/file-connector | d2fb5e9d1b41e126214d77c11354ec8d8ab53b2a | [
"Apache-2.0"
] | null | null | null | test/unit/test_swift.py | thiagodasilva/file-connector | d2fb5e9d1b41e126214d77c11354ec8d8ab53b2a | [
"Apache-2.0"
] | null | null | null | test/unit/test_swift.py | thiagodasilva/file-connector | d2fb5e9d1b41e126214d77c11354ec8d8ab53b2a | [
"Apache-2.0"
] | 1 | 2021-12-29T11:37:07.000Z | 2021-12-29T11:37:07.000Z | # Copyright (c) 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 29.654545 | 69 | 0.625996 | # Copyright (c) 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 737 | 0 | 81 |
4830b6d455205e9d9e839a6a30abaee494c2a2d4 | 120 | py | Python | IPO/ipo7.py | ianramzy/high-school-assignments | 6d3ca52de5c6b80a1f0678ca73b78a3024e95f05 | [
"MIT"
] | null | null | null | IPO/ipo7.py | ianramzy/high-school-assignments | 6d3ca52de5c6b80a1f0678ca73b78a3024e95f05 | [
"MIT"
] | null | null | null | IPO/ipo7.py | ianramzy/high-school-assignments | 6d3ca52de5c6b80a1f0678ca73b78a3024e95f05 | [
"MIT"
] | null | null | null | mark = float(input('Mark?'))
outof = float(input('Out of?'))
print('Your mark is:',mark/outof*100,'%')
| 24 | 42 | 0.541667 | mark = float(input('Mark?'))
outof = float(input('Out of?'))
print('Your mark is:',mark/outof*100,'%')
| 0 | 0 | 0 |
72b3f1716188bf9834b32cd4bdf6f80f812f377d | 9,168 | py | Python | facts/monterey_upgrade_supported.py | n8felton/munki-facts | 175d40145041355df19078bc6287204e6557bb13 | [
"Apache-2.0"
] | 1 | 2019-07-16T21:57:53.000Z | 2019-07-16T21:57:53.000Z | facts/monterey_upgrade_supported.py | n8felton/munki-facts | 175d40145041355df19078bc6287204e6557bb13 | [
"Apache-2.0"
] | null | null | null | facts/monterey_upgrade_supported.py | n8felton/munki-facts | 175d40145041355df19078bc6287204e6557bb13 | [
"Apache-2.0"
] | null | null | null | '''Returns a fact to indicate if this machine can be upgraded to macOS 12 Monterey'''
# Based on
# https://github.com/hjuutilainen/adminscripts/blob/master/
# check-10.12-sierra-compatibility.py
# sysctl function by Michael Lynn
# https://gist.github.com/pudquick/581a71425439f2cf8f09
# IOKit bindings by Mich... | 32.168421 | 201 | 0.640816 | '''Returns a fact to indicate if this machine can be upgraded to macOS 12 Monterey'''
# Based on
# https://github.com/hjuutilainen/adminscripts/blob/master/
# check-10.12-sierra-compatibility.py
# sysctl function by Michael Lynn
# https://gist.github.com/pudquick/581a71425439f2cf8f09
# IOKit bindings by Mich... | 0 | 0 | 0 |