hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38613dd189f81dfb63a70406958935bebfb29887 | 589 | py | Python | src/accounts/migrations/0003_auto_20170805_1012.py | balaji319/Q-A-app- | a33eab4605942a8429ea85da72061abde2defb1e | [
"MIT"
] | null | null | null | src/accounts/migrations/0003_auto_20170805_1012.py | balaji319/Q-A-app- | a33eab4605942a8429ea85da72061abde2defb1e | [
"MIT"
] | null | null | null | src/accounts/migrations/0003_auto_20170805_1012.py | balaji319/Q-A-app- | a33eab4605942a8429ea85da72061abde2defb1e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-05 04:42
from __future__ import unicode_literals
| 28.047619 | 188 | 0.65365 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-05 04:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20170803_1446'),
]
operations = [
migrations.AlterFie... | 0 | 0 | 0 | 410 | 0 | 0 | 0 | 19 | 46 |
14f858b4edd77eb78d71efa839cce2b57e5872e6 | 10,615 | py | Python | xcrypto/xcrypto.py | azweb76/x-crypto | a90c0e7149d7365e82c2133f68a4fc683855ee5c | [
"MIT"
] | 1 | 2019-03-19T18:19:33.000Z | 2019-03-19T18:19:33.000Z | xcrypto/xcrypto.py | azweb76/x-crypto | a90c0e7149d7365e82c2133f68a4fc683855ee5c | [
"MIT"
] | 1 | 2020-12-16T22:11:55.000Z | 2020-12-16T22:11:55.000Z | xcrypto/xcrypto.py | azweb76/x-crypto | a90c0e7149d7365e82c2133f68a4fc683855ee5c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import base64
import platform
import logging
log = logging.getLogger(name=__name__)
if platform.system() != 'Windows':
from Crypto import Random
from Crypto import Random
from Crypto.Cipher import AES
BLOCK_SIZE = 16
DEFAULT_KEY_PATH = '~/.ssh/id_rsa'
_keys = {}
... | 29.242424 | 88 | 0.599906 | #!/usr/bin/env python
# coding: utf-8
import argparse
import base64
import glob
import os
import platform
import re
import sys
import tempfile
import json
import time
import logging
from pymongo import MongoClient
import requests
log = logging.getLogger(name=__name__)
if platform.system() != 'Windows':
from Cr... | 0 | 0 | 0 | 0 | 106 | 8,101 | 0 | -62 | 689 |
8e13600e086bc5b40baaa6af76bea54dbb26f1c7 | 254 | py | Python | osp/test/corpus/syllabus/test_log_path.py | davidmcclure/open-syllabus-project | 078cfd4c5a257fbfb0901d43bfbc6350824eed4e | [
"Apache-2.0"
] | 220 | 2016-01-22T21:19:02.000Z | 2022-01-25T04:33:55.000Z | osp/test/corpus/syllabus/test_log_path.py | davidmcclure/open-syllabus-project | 078cfd4c5a257fbfb0901d43bfbc6350824eed4e | [
"Apache-2.0"
] | 14 | 2016-01-23T14:34:39.000Z | 2016-09-19T19:58:37.000Z | osp/test/corpus/syllabus/test_log_path.py | davidmcclure/open-syllabus-project | 078cfd4c5a257fbfb0901d43bfbc6350824eed4e | [
"Apache-2.0"
] | 14 | 2016-02-03T13:47:48.000Z | 2019-03-27T13:09:05.000Z |
from osp.corpus.syllabus import Syllabus
def test_log_path(mock_osp):
"""
Syllabus#log_path should return the .log file path.
"""
path = mock_osp.add_file()
syllabus = Syllabus(path)
assert syllabus.log_path == path+'.log'
| 15.875 | 55 | 0.669291 |
from osp.corpus.syllabus import Syllabus
def test_log_path(mock_osp):
"""
Syllabus#log_path should return the .log file path.
"""
path = mock_osp.add_file()
syllabus = Syllabus(path)
assert syllabus.log_path == path+'.log'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
80bb7fed3aabf0b674314f1bde732f8e77644ddb | 10,915 | py | Python | relancer-exp/original_notebooks/toramky_automobile-dataset/auto-imports-beginner-level-analysis.py | Chenguang-Zhu/relancer | bf1a175b77b7da4cff12fbc5de17dd55246d264d | [
"Apache-2.0"
] | 1 | 2022-03-05T22:27:49.000Z | 2022-03-05T22:27:49.000Z | relancer-exp/original_notebooks/toramky_automobile-dataset/auto-imports-beginner-level-analysis.py | Chenguang-Zhu/relancer | bf1a175b77b7da4cff12fbc5de17dd55246d264d | [
"Apache-2.0"
] | null | null | null | relancer-exp/original_notebooks/toramky_automobile-dataset/auto-imports-beginner-level-analysis.py | Chenguang-Zhu/relancer | bf1a175b77b7da4cff12fbc5de17dd55246d264d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Title : 1985 Auto Imports Database Analyses
# <img src='Large10.jpg'>
# ## <font color='green'>Data Dictionary</font>
# ### Input variables
#
# 01. **symboling**: [its assigned insurance risk rating -> [-3, -2, -1, 0, 1, 2, 3]]
# 02. **normalized-losses**: ... | 20.950096 | 271 | 0.647091 | #!/usr/bin/env python
# coding: utf-8
# # Title : 1985 Auto Imports Database Analyses
# <img src='Large10.jpg'>
# ## <font color='green'>Data Dictionary</font>
# ### Input variables
#
# 01. **symboling**: [its assigned insurance risk rating -> [-3, -2, -1, 0, 1, 2, 3]]
# 02. **normalized-losses**: ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
82e078877509947328d3525d632d333624a78bb6 | 7,315 | py | Python | main.py | DangVietH/DHB | 4118a07d701701a72cc7dd88698b1a2138fb6b25 | [
"MIT"
] | 3 | 2021-12-01T07:09:33.000Z | 2022-01-22T16:48:14.000Z | main.py | DangVietH/DHB | 4118a07d701701a72cc7dd88698b1a2138fb6b25 | [
"MIT"
] | null | null | null | main.py | DangVietH/DHB | 4118a07d701701a72cc7dd88698b1a2138fb6b25 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
from motor.motor_asyncio import AsyncIOMotorClient
import json
with open('config.json') as f:
config_var = json.load(f)
cluster = AsyncIOMotorClient(config_var['mango_link'])
cursor = cluster["custom_prefix"]["prefix"]
bcursor = cluster['bot']['blacklist']
in... | 40.414365 | 206 | 0.648804 | import discord
from discord.ext import commands
from motor.motor_asyncio import AsyncIOMotorClient
import json
with open('config.json') as f:
config_var = json.load(f)
class CustomHelp(commands.HelpCommand):
def get_ending_note(self):
return f'Use help [command] for more info on a command. \nYou can... | 6 | 2,441 | 3,272 | 396 | 0 | 0 | 0 | 0 | 161 |
a4d192fc80da3a2cae7bcd04675f7528921ccd70 | 3,143 | py | Python | courses/demo/code/imjaysigpayatinlay.py | jimmahoney/umber | 0507a30a81415441408c26951c76c740a6945d86 | [
"MIT"
] | 6 | 2018-04-18T14:05:39.000Z | 2022-01-29T04:23:46.000Z | courses/demo/code/imjaysigpayatinlay.py | jimmahoney/umber | 0507a30a81415441408c26951c76c740a6945d86 | [
"MIT"
] | null | null | null | courses/demo/code/imjaysigpayatinlay.py | jimmahoney/umber | 0507a30a81415441408c26951c76c740a6945d86 | [
"MIT"
] | 2 | 2019-05-25T16:09:49.000Z | 2022-01-12T09:26:12.000Z | """
imjayigpayatinlay.py
Jim's pig latin
See ./readme.md.
Here are tests based on the design constraints,
in roughly order of increasing difficulty.
--- tests --------------------------------------
>>> text_to_piglatin("apple") # word starts with vowel
'appleway'
>>> text_to_piglatin("cat") ... | 28.315315 | 79 | 0.624881 | """
imjayigpayatinlay.py
Jim's pig latin
See ./readme.md.
Here are tests based on the design constraints,
in roughly order of increasing difficulty.
--- tests --------------------------------------
>>> text_to_piglatin("apple") # word starts with vowel
'appleway'
>>> text_to_piglatin("cat") ... | 80 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6346937aad6c4e772409a7163d0cba3165257ae3 | 2,934 | py | Python | models/squeezenet.py | csruiliu/pytorch_cifar | 6d3c80092255571c2d5f497ed036148a4202c08e | [
"MIT"
] | null | null | null | models/squeezenet.py | csruiliu/pytorch_cifar | 6d3c80092255571c2d5f497ed036148a4202c08e | [
"MIT"
] | null | null | null | models/squeezenet.py | csruiliu/pytorch_cifar | 6d3c80092255571c2d5f497ed036148a4202c08e | [
"MIT"
] | null | null | null | import torch.nn as nn
| 38.103896 | 90 | 0.640423 | import torch
import torch.nn as nn
class FireBLK(nn.Module):
def __init__(self, in_chn, s1x1_chn, e1x1_chn, e3x3_chn):
super(FireBLK, self).__init__()
self.conv1 = nn.Conv2d(in_chn, s1x1_chn, kernel_size=1, stride=1)
self.relu1 = nn.ReLU(inplace=True)
self.bn1 = nn.BatchNorm2d(s1x1... | 0 | 0 | 0 | 2,851 | 0 | 0 | 0 | -9 | 68 |
5a088c628b2c99e37d458fe0e1cf22c51c5360d6 | 863 | py | Python | Fduers/alumni/migrations/0002_auto_20210721_2315.py | bblss123/ALUMNI | 294ecf066137070f4b28923e8cd03f74eeddb345 | [
"MIT"
] | 1 | 2021-07-11T00:39:46.000Z | 2021-07-11T00:39:46.000Z | Fduers/alumni/migrations/0002_auto_20210721_2315.py | bblss123/ALUMNI | 294ecf066137070f4b28923e8cd03f74eeddb345 | [
"MIT"
] | null | null | null | Fduers/alumni/migrations/0002_auto_20210721_2315.py | bblss123/ALUMNI | 294ecf066137070f4b28923e8cd03f74eeddb345 | [
"MIT"
] | 3 | 2021-07-10T11:55:45.000Z | 2021-07-21T13:25:12.000Z | # Generated by Django 3.2.5 on 2021-07-21 15:15
| 28.766667 | 117 | 0.565469 | # Generated by Django 3.2.5 on 2021-07-21 15:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('alumni', '0001_auto_20210721_1622'),
]
operations = [
migrations.CreateModel(
name='StudentSheet',
fields=[
... | 30 | 0 | 0 | 739 | 0 | 0 | 0 | 19 | 46 |
4614fe0cf402069b594647bc85117a84e7c17ab6 | 8,781 | py | Python | xo.py | adelnobel/JS-games | 8555038af889dc68f6e8d9528677f52b23e04954 | [
"MIT"
] | null | null | null | xo.py | adelnobel/JS-games | 8555038af889dc68f6e8d9528677f52b23e04954 | [
"MIT"
] | null | null | null | xo.py | adelnobel/JS-games | 8555038af889dc68f6e8d9528677f52b23e04954 | [
"MIT"
] | null | null | null | import random
import copy
import json
import time
import sys
players = [QLearnerModelAgent(), RandomAgent()]
game = XOGame()
'''print players[1].observe([[['X', 'O', 'X'],['O', 'O', '.'],['.', 'X', '.']], 'O'], 0, game)
sys.exit(0)'''
totalx = 0
totalo = 0
total_games = 10000
for x in range(2):
for i in rang... | 34.300781 | 193 | 0.603918 | import random
import copy
import json
import time
import sys
class AbstractGame:
def getNextStateFromStateAndAction(self, state, action):
return NotImplemented
def getInitialState(self, state, action):
return NotImplemented
def isTerminalState(self, state):
return NotImplemented
... | 0 | 0 | 0 | 7,193 | 0 | 0 | 0 | 0 | 161 |
9ec709631ecb032aa4f2882cfbd62aba2b9ec496 | 1,032 | py | Python | 08_Graphs/clone_graph.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 61 | 2018-02-18T08:16:31.000Z | 2022-02-17T17:18:57.000Z | 08_Graphs/clone_graph.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 1 | 2018-02-23T20:06:18.000Z | 2019-12-29T18:52:20.000Z | 08_Graphs/clone_graph.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 30 | 2018-03-28T19:02:23.000Z | 2021-07-06T20:00:14.000Z | # Clone Graph
# https://www.interviewbit.com/problems/clone-graph/
#
# Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Definition for a undirected graph node
# class U... | 27.891892 | 99 | 0.560078 | # Clone Graph
# https://www.interviewbit.com/problems/clone-graph/
#
# Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Definition for a undirected graph node
# class U... | 0 | 0 | 0 | 586 | 0 | 0 | 0 | 0 | 23 |
1e2d3f92f07964c30f7467323c5e6dbff303b6a5 | 14,413 | py | Python | channels/casacinema.py | sodicarus/channels | d77402f4f460ea6daa66959aa5384aaffbff70b5 | [
"MIT"
] | null | null | null | channels/casacinema.py | sodicarus/channels | d77402f4f460ea6daa66959aa5384aaffbff70b5 | [
"MIT"
] | null | null | null | channels/casacinema.py | sodicarus/channels | d77402f4f460ea6daa66959aa5384aaffbff70b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# streamondemand-.- XBMC Plugin
# Canale casacinema
# ------------------------------------------------------------
__channel__ = "casacinema"
host = 'https://www.casacinema.news'
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT ... | 38.744624 | 177 | 0.499202 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# streamondemand-.- XBMC Plugin
# Canale casacinema
# ------------------------------------------------------------
import re
import urlparse
from core import httptools
from core import config
from core import logger
from core impo... | 12 | 0 | 0 | 0 | 0 | 12,060 | 0 | 19 | 434 |
dac5059e88a06cdb5eeb8ff58c8d261a98379b43 | 330 | py | Python | src/konfetti/_compat.py | samarcan/konfetti | 77bd06ae0971e854a0241b5b097d004d3c81e3de | [
"MIT"
] | 23 | 2019-07-01T09:31:46.000Z | 2021-07-19T11:38:47.000Z | src/konfetti/_compat.py | samarcan/konfetti | 77bd06ae0971e854a0241b5b097d004d3c81e3de | [
"MIT"
] | 33 | 2019-06-30T17:08:16.000Z | 2022-02-10T12:23:57.000Z | src/konfetti/_compat.py | kiwicom/kwonfig | f80d175301e0a2ad3178e6ded60a6a3d8525d9d9 | [
"MIT"
] | 2 | 2019-07-23T13:02:19.000Z | 2020-01-09T16:20:30.000Z | try:
# Python 2 old-style classes
from types import ClassType as class_type # type: ignore
class_types = (class_type, type)
string_types = (unicode, str) # type: ignore # pylint: disable=undefined-variable
except ImportError:
class_types = (type,) # type: ignore
string_types = (str,) # typ... | 33 | 87 | 0.681818 | try:
# Python 2 old-style classes
from types import ClassType as class_type # type: ignore
class_types = (class_type, type)
string_types = (unicode, str) # type: ignore # pylint: disable=undefined-variable
except ImportError:
class_types = (type,) # type: ignore
string_types = (str,) # typ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
46a717df7e8b20444e1582efee3fa56389463899 | 3,000 | py | Python | src/h5_eq.py | whoDisGuy/testGit | cff4d7fcfa1940d8517ed696e8a1f62c40bf55ef | [
"Apache-2.0"
] | 7 | 2019-05-17T18:30:32.000Z | 2021-07-27T05:58:15.000Z | src/h5_eq.py | whoDisGuy/testGit | cff4d7fcfa1940d8517ed696e8a1f62c40bf55ef | [
"Apache-2.0"
] | 2 | 2021-03-12T16:12:00.000Z | 2021-03-12T19:11:58.000Z | src/h5_eq.py | whoDisGuy/testGit | cff4d7fcfa1940d8517ed696e8a1f62c40bf55ef | [
"Apache-2.0"
] | 4 | 2019-11-25T04:13:46.000Z | 2021-11-03T21:12:26.000Z | """
This is an equality comparator for hdf5 files.
"""
import h5py
import itertools
import numpy
import sys
def files_match(filename1, filename2):
"Checks that two files have the same HDF5 structure."
f1 = h5py.File(filename1, mode='r')
f2 = h5py.File(filename2, mode='r')
for k in iter(f1):
# s... | 33.333333 | 73 | 0.556 | """
This is an equality comparator for hdf5 files.
"""
import h5py
import itertools
import numpy
import sys
def files_match(filename1, filename2):
"Checks that two files have the same HDF5 structure."
f1 = h5py.File(filename1, mode='r')
f2 = h5py.File(filename2, mode='r')
for k in iter(f1):
# s... | 0 | 0 | 0 | 0 | 0 | 572 | 0 | 0 | 69 |
351069ad2a17934bd167e0d90d05d7585b01ace1 | 370 | py | Python | pandas.py | GalacticalEdge/Python-test | e48209926ab78798c3ad9bc9bb925f4dc37e3ce6 | [
"MIT"
] | null | null | null | pandas.py | GalacticalEdge/Python-test | e48209926ab78798c3ad9bc9bb925f4dc37e3ce6 | [
"MIT"
] | null | null | null | pandas.py | GalacticalEdge/Python-test | e48209926ab78798c3ad9bc9bb925f4dc37e3ce6 | [
"MIT"
] | null | null | null |
print("This is pandas basics")
brics = pd.DataFrame(dict)
print(brics)
| 24.666667 | 68 | 0.594595 | def pandas():
import pandas as pd
print("This is pandas basics")
def my_function(pandas):
dict = {"country": ["Brazil", "India", "China", "South Africa"],
"capital": ["Brasilia", "New Dehli", "Beijing", "Pretoria"],
"area": [8.516, 3.286, 9.597, 1.221],
"population": [200.4, 1252, 1357, ... | 0 | 0 | 0 | 0 | 0 | 252 | 0 | 0 | 45 |
218c4ad1f0199158a731dbd92606423cca0783ce | 266 | py | Python | apps/sizes/urls.py | JuanJoseStone/shoe-app | b9eb10e59877d6eb0582b65cf1b91cdd47bdcdb0 | [
"MIT"
] | null | null | null | apps/sizes/urls.py | JuanJoseStone/shoe-app | b9eb10e59877d6eb0582b65cf1b91cdd47bdcdb0 | [
"MIT"
] | null | null | null | apps/sizes/urls.py | JuanJoseStone/shoe-app | b9eb10e59877d6eb0582b65cf1b91cdd47bdcdb0 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import index, store, update
urlpatterns = [
path('tallas/', index, name='sizes.index'),
path('crear-nueva-talla/', store, name='sizes.store'),
path('actualizar-talla/<id>/', update, name='sizes.update'),
] | 33.25 | 65 | 0.657895 | from django.urls import path
from .views import index, store, update
urlpatterns = [
path('tallas/', index, name='sizes.index'),
path('crear-nueva-talla/', store, name='sizes.store'),
path('actualizar-talla/<id>/', update, name='sizes.update'),
] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
860829354f9a0ed2e4c4d242cf31435bb059d1f5 | 180 | py | Python | solutions/05_5_solutions.py | glemaitre/pyparis-2018-sklearn | 2ef0158aa13babb2d7317cea0e8930bd7ad145b2 | [
"CC0-1.0"
] | 71 | 2018-11-13T13:29:24.000Z | 2021-07-03T15:47:37.000Z | solutions/05_5_solutions.py | JL1829/pyparis-2018-sklearn | 2ef0158aa13babb2d7317cea0e8930bd7ad145b2 | [
"CC0-1.0"
] | 1 | 2018-11-14T22:22:17.000Z | 2018-11-14T22:22:17.000Z | solutions/05_5_solutions.py | JL1829/pyparis-2018-sklearn | 2ef0158aa13babb2d7317cea0e8930bd7ad145b2 | [
"CC0-1.0"
] | 20 | 2018-11-08T15:43:19.000Z | 2022-01-14T08:32:29.000Z | from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import KBinsDiscretizer
pipe_cat = OneHotEncoder(handle_unknown='ignore')
pipe_num = KBinsDiscretizer()
| 30 | 50 | 0.855556 | from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import KBinsDiscretizer
pipe_cat = OneHotEncoder(handle_unknown='ignore')
pipe_num = KBinsDiscretizer()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f74aa16bcbbe64cf11dada7ce248b0c66a7d6273 | 7,409 | py | Python | Tests.py | agamia/RegExpBuilder | 087231288d8a6d81b7152d3adbe8ab466710d347 | [
"MIT"
] | 1 | 2015-07-26T10:45:14.000Z | 2015-07-26T10:45:14.000Z | Tests.py | agamia/RegExpBuilder | 087231288d8a6d81b7152d3adbe8ab466710d347 | [
"MIT"
] | null | null | null | Tests.py | agamia/RegExpBuilder | 087231288d8a6d81b7152d3adbe8ab466710d347 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 34.621495 | 75 | 0.570792 | import unittest
from RegExpBuilder import RegExpBuilder
class Test(unittest.TestCase):
def test_startOfLine(self):
regex = RegExpBuilder()
regex.startOfLine()
regex.exactly(1).of("p")
regex = regex.getRegExp()
self.assertTrue(regex.match("p") is not None)
... | 0 | 0 | 0 | 7,275 | 0 | 0 | 0 | 18 | 48 |
7c314aaf179065acba8767f7396f7f66b271bd40 | 10,363 | py | Python | mayan/apps/documents/tests/mixins.py | O2Graphics/Mayan-EDMS | e11e6f47240f3c536764be66828dbe6428dceb41 | [
"Apache-2.0"
] | null | null | null | mayan/apps/documents/tests/mixins.py | O2Graphics/Mayan-EDMS | e11e6f47240f3c536764be66828dbe6428dceb41 | [
"Apache-2.0"
] | 5 | 2021-03-19T22:56:45.000Z | 2022-03-12T00:08:43.000Z | mayan/apps/documents/tests/mixins.py | halsten/mayan-edms | 10372daede6e6dea0bea67eb98767e3be6fbf86f | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
__all__ = ('DocumentTestMixin',)
| 32.690852 | 84 | 0.652031 | from __future__ import unicode_literals
import os
from django.conf import settings
from mayan.apps.converter.classes import Layer
from mayan.apps.converter.layers import layer_saved_transformations
from ..literals import PAGE_RANGE_ALL
from ..models import DocumentType
from .literals import (
TEST_DOCUMENT_TYP... | 0 | 0 | 0 | 9,477 | 0 | 0 | 0 | 461 | 343 |
d4eeaae82d0677299d93393b7dbfd5ec50fa75bd | 9,698 | py | Python | stackalytics/processor/user_processor.py | wzshiming/stackalytics | f71fd28cbb081a2edd19a84f4a7d16645b0557b3 | [
"Apache-2.0"
] | null | null | null | stackalytics/processor/user_processor.py | wzshiming/stackalytics | f71fd28cbb081a2edd19a84f4a7d16645b0557b3 | [
"Apache-2.0"
] | null | null | null | stackalytics/processor/user_processor.py | wzshiming/stackalytics | f71fd28cbb081a2edd19a84f4a7d16645b0557b3 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | 32.543624 | 79 | 0.627243 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the ... | 0 | 0 | 0 | 0 | 0 | 4,587 | 0 | 9 | 253 |
4647d83a3fc2d253b88c2a3de48912dfba68a706 | 2,675 | py | Python | mapel/elections/not_in_the_package/__all_elections.py | kaszperro/mapel | d4e6486ee97f5d5a5a737c581ba3f9f874ebcef3 | [
"MIT"
] | null | null | null | mapel/elections/not_in_the_package/__all_elections.py | kaszperro/mapel | d4e6486ee97f5d5a5a737c581ba3f9f874ebcef3 | [
"MIT"
] | null | null | null | mapel/elections/not_in_the_package/__all_elections.py | kaszperro/mapel | d4e6486ee97f5d5a5a737c581ba3f9f874ebcef3 | [
"MIT"
] | null | null | null |
from itertools import product
from mapel.voting.models_main import store_ordinal_election
from mapel.voting.metrics.main_ordinal_distances import compute_swap_bf_distance
from mapel.voting.objects.OrdinalElection import OrdinalElection
try:
from sympy.utilities.iterables import multiset_permutations
except:
... | 29.076087 | 109 | 0.598505 | import math
import random as rand
from itertools import product
import numpy as np
from mapel.voting.models_main import store_ordinal_election
from mapel.voting.metrics.main_ordinal_distances import compute_swap_bf_distance
from mapel.voting.objects.OrdinalElection import OrdinalElection
try:
from sympy.utilitie... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -13 | 66 |
38df7c5cd95cbbb56c3536b5e923d8adc7367e40 | 244 | py | Python | budgets/urls.py | saks/hb | 6f103efc90adcb00c8ec1bed9868c20f85273b37 | [
"MIT"
] | 3 | 2016-06-23T09:32:38.000Z | 2016-07-28T03:33:55.000Z | budgets/urls.py | saks/hb | 6f103efc90adcb00c8ec1bed9868c20f85273b37 | [
"MIT"
] | 76 | 2016-07-24T09:59:11.000Z | 2022-02-10T08:53:09.000Z | budgets/urls.py | saks/hb | 6f103efc90adcb00c8ec1bed9868c20f85273b37 | [
"MIT"
] | 2 | 2016-06-14T12:54:33.000Z | 2016-07-27T10:43:32.000Z | from django.conf.urls import url, include
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'budget-detail', views.BudgetViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
]
| 18.769231 | 54 | 0.75 | from django.conf.urls import url, include
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'budget-detail', views.BudgetViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7d8d6c75da789901a3f4519300039cd24febd94d | 2,939 | py | Python | cngi/vis/chansmooth.py | FedeMPouzols/cngi_prototype | 421a99c460f4092b79120f5bec122de7ce9b8b96 | [
"Apache-2.0"
] | null | null | null | cngi/vis/chansmooth.py | FedeMPouzols/cngi_prototype | 421a99c460f4092b79120f5bec122de7ce9b8b96 | [
"Apache-2.0"
] | null | null | null | cngi/vis/chansmooth.py | FedeMPouzols/cngi_prototype | 421a99c460f4092b79120f5bec122de7ce9b8b96 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 AUI, Inc. Washington DC, USA
#
# 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 ... | 39.716216 | 141 | 0.672678 | # Copyright 2020 AUI, Inc. Washington DC, USA
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2b471b0cbd7f5fcad09c10e922fd96c5315dbf27 | 2,083 | py | Python | setup.py | gburca/ccs-py | c69b6c7f8a899f6747b8632541ef1a4159a2baab | [
"MIT"
] | 1 | 2019-09-26T17:15:47.000Z | 2019-09-26T17:15:47.000Z | setup.py | gburca/ccs-py | c69b6c7f8a899f6747b8632541ef1a4159a2baab | [
"MIT"
] | null | null | null | setup.py | gburca/ccs-py | c69b6c7f8a899f6747b8632541ef1a4159a2baab | [
"MIT"
] | 1 | 2021-11-29T18:34:17.000Z | 2021-11-29T18:34:17.000Z |
from setuptools import find_packages, setup
# TODO random links...
# https://docs.pytest.org/en/latest/goodpractices.html?highlight=src#tests-outside-application-code
# https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure
# https://realpython.com/pypi-publish-python-package/
# https://github.com/navdeep... | 34.147541 | 101 | 0.68459 | import os
from setuptools import find_packages, setup
# TODO random links...
# https://docs.pytest.org/en/latest/goodpractices.html?highlight=src#tests-outside-application-code
# https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure
# https://realpython.com/pypi-publish-python-package/
# https://github.c... | 0 | 0 | 0 | 0 | 0 | 165 | 0 | -12 | 45 |
7bc62174da0347378856083fbfac273d9acce3b0 | 950 | py | Python | Codefights/arcade/python-arcade/level-8/50.Float-Range/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codefights/arcade/python-arcade/level-8/50.Float-Range/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codefights/arcade/python-arcade/level-8/50.Float-Range/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python3
from solution1 import floatRange as f
qa = [
(-0.9, 0.45, 0.2,
[-0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3]),
(1.5, 1.5, 10,
[]),
(1, 2, 1.5,
[1]),
(-21.11, 21.11, 1.11,
[-21.11, -20, -18.89, -17.78, -16.67, -15.56, -14.45, -13.34, -12.23, -11.12, -10.01, -8.9, -7.79, -6.68, ... | 31.666667 | 276 | 0.432632 | # Python3
from solution1 import floatRange as f
qa = [
(-0.9, 0.45, 0.2,
[-0.9, -0.7, -0.5, -0.3, -0.1, 0.1, 0.3]),
(1.5, 1.5, 10,
[]),
(1, 2, 1.5,
[1]),
(-21.11, 21.11, 1.11,
[-21.11, -20, -18.89, -17.78, -16.67, -15.56, -14.45, -13.34, -12.23, -11.12, -10.01, -8.9, -7.79, -6.68, ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0b7659df9470327d36152b5032fae0a1013ce854 | 8,418 | py | Python | osu/match.py | brandonnly/Vaughan-Esports-VetoBot | 3d68de5cff9d686805e8c27cfcf847547ca384a6 | [
"MIT"
] | 1 | 2021-06-14T03:27:30.000Z | 2021-06-14T03:27:30.000Z | osu/match.py | brandonnly/Vaughan-Esports-VetoBot | 3d68de5cff9d686805e8c27cfcf847547ca384a6 | [
"MIT"
] | 22 | 2021-03-08T18:54:39.000Z | 2022-03-25T03:07:52.000Z | osu/match.py | brandonnly/Vaughan-Esports-VetoBot | 3d68de5cff9d686805e8c27cfcf847547ca384a6 | [
"MIT"
] | null | null | null |
import discord
| 36.441558 | 80 | 0.518532 | import asyncio
from typing import List
import discord
import discord.ext
from osu.game import Game
from settings import tourney_name, rulebook_url, footer_icon, footer_note, \
veto_timeout, newline
from utils.checks import beatmapCheck, playerCheck
class Match:
"""
Represents an osu! match
"""
... | 0 | 2,928 | 3,698 | 1,513 | 0 | 0 | 0 | 106 | 156 |
a794b0500bf950de132acda17b870d8057781c4f | 4,138 | py | Python | songmam/security.py | codustry/songmam | b461799f69428e4fd5e47e1c234d28a75832e76a | [
"0BSD"
] | 7 | 2020-11-13T02:31:04.000Z | 2021-11-20T10:48:47.000Z | songmam/security.py | codustry/songmam | b461799f69428e4fd5e47e1c234d28a75832e76a | [
"0BSD"
] | 108 | 2020-11-18T07:01:30.000Z | 2022-03-30T14:06:24.000Z | songmam/security.py | codustry/songmam | b461799f69428e4fd5e47e1c234d28a75832e76a | [
"0BSD"
] | 1 | 2021-11-20T10:48:51.000Z | 2021-11-20T10:48:51.000Z | from typing import Dict, Optional
import hashlib
import hmac
import json
import re
import arrow
from pydantic import conint
RequestContent = Dict
def verify_signed_request(
signed_request,
app_secret,
acceptable_freshness_sec: Optional[conint(ge=0)] = None,
) -> Optional[RequestContent]:
"""
V... | 32.84127 | 358 | 0.692605 | from typing import Dict, Optional
import base64
import hashlib
import hmac
import json
import re
import arrow
from pydantic import conint
def base64_url_decode(inp) -> bytes:
padding_factor = (4 - len(inp) % 4) % 4
inp += "=" * padding_factor
return base64.b64decode(inp.translate(dict(zip(map(ord, "-_")... | 0 | 1,497 | 0 | 395 | 0 | 167 | 0 | -8 | 69 |
a5433c0179ab08ab86a644229d3418a26c3d39cf | 2,419 | py | Python | x7/view/undo.py | gribbg/x7-view | 53a07b651a08eae63f019b388584cfffceeb2ccb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | x7/view/undo.py | gribbg/x7-view | 53a07b651a08eae63f019b388584cfffceeb2ccb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | x7/view/undo.py | gribbg/x7-view | 53a07b651a08eae63f019b388584cfffceeb2ccb | [
"BSD-2-Clause",
"MIT"
] | null | null | null | """
Undo/redo framework for anim.edit
"""
__all__ = ['Command', 'CommandDummy', 'CommandStack', 'CommandEditCP']
| 22.607477 | 89 | 0.598181 | """
Undo/redo framework for anim.edit
"""
from x7.geom.typing import *
from x7.geom.model import ControlPoint
__all__ = ['Command', 'CommandDummy', 'CommandStack', 'CommandEditCP']
class Command(object):
"""ABC for Command pattern"""
def __init__(self):
pass
def description(self):
unus... | 0 | 110 | 0 | 2,029 | 0 | 0 | 0 | 24 | 137 |
ee4bbc2966794561fd56c51f176ce8a7aa870d4e | 16,626 | py | Python | gcn/lib/varann/utils/fpvariants.py | kalon33/divine | 2db92c093d98722f011224140e652c162a4f4336 | [
"Intel"
] | 11 | 2018-11-09T15:47:14.000Z | 2021-08-18T18:05:11.000Z | gcn/lib/varann/utils/fpvariants.py | kalon33/divine | 2db92c093d98722f011224140e652c162a4f4336 | [
"Intel"
] | 5 | 2018-08-31T15:07:20.000Z | 2020-03-30T18:52:04.000Z | gcn/lib/varann/utils/fpvariants.py | kalon33/divine | 2db92c093d98722f011224140e652c162a4f4336 | [
"Intel"
] | 1 | 2019-04-18T13:42:30.000Z | 2019-04-18T13:42:30.000Z | #
# COPYRIGHT (C) 2012-2013 TCS Ltd
#
"""
.. module:: fpvariants
:platform: Unix, Windows, MacOSX
:synopsis: Module to list out variants downstream to frameshift/stopgain
mutation also present in same chromatid.
.. moduleauthor:: Kunal Kundu (kunal@atc.tcs.com); modified by changjin.hong@gmail.c... | 44.100796 | 86 | 0.424275 | #
# COPYRIGHT (C) 2012-2013 TCS Ltd
#
"""
.. module:: fpvariants
:platform: Unix, Windows, MacOSX
:synopsis: Module to list out variants downstream to frameshift/stopgain
mutation also present in same chromatid.
.. moduleauthor:: Kunal Kundu (kunal@atc.tcs.com); modified by changjin.hong@gmail.c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
96f37f02743750f7af6ed70b5ecd8e70840445ee | 6,096 | py | Python | boston_keras_explorer.py | xblaauw/dense_neural_network_explorer | f6492fe9ccb7e7a86b77cf6805b505bf3ec34151 | [
"CC0-1.0"
] | null | null | null | boston_keras_explorer.py | xblaauw/dense_neural_network_explorer | f6492fe9ccb7e7a86b77cf6805b505bf3ec34151 | [
"CC0-1.0"
] | null | null | null | boston_keras_explorer.py | xblaauw/dense_neural_network_explorer | f6492fe9ccb7e7a86b77cf6805b505bf3ec34151 | [
"CC0-1.0"
] | null | null | null | import pandas as pd
import streamlit as st
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from tensorflow.keras.models import load_model
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.callbacks imp... | 40.912752 | 233 | 0.692257 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import streamlit as st
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from tensorflow import keras
from tensorflow.keras.models ... | 0 | 0 | 0 | 0 | 0 | 1,287 | 0 | 81 | 261 |
af034f9e1cc91dfba9323339fdb9ccd9e84b946b | 5,892 | py | Python | src/quakestats/sdk.py | LaudateCorpus1/quakestats | d4e44d593e6c7334628d34b5ec648ade5976003e | [
"MIT"
] | 21 | 2018-04-24T09:33:01.000Z | 2022-03-05T10:53:45.000Z | src/quakestats/sdk.py | brabiega/quakestats | 1628720350a1e4e40ebebdb7988785663892f0be | [
"MIT"
] | 42 | 2018-04-13T18:09:19.000Z | 2021-08-05T20:23:22.000Z | src/quakestats/sdk.py | LaudateCorpus1/quakestats | d4e44d593e6c7334628d34b5ec648ade5976003e | [
"MIT"
] | 8 | 2018-06-12T18:07:39.000Z | 2021-08-28T02:26:17.000Z | import logging
logger = logging.getLogger(__name__)
| 32.021739 | 107 | 0.629667 | import logging
from typing import (
Iterator,
List,
Optional,
Tuple,
)
from quakestats.core.game.qlmatch import (
FullMatchInfo,
)
from quakestats.core.q3parser.api import (
Q3ParserAPI,
)
from quakestats.core.q3toql.api import (
Q3toQLAPI,
QuakeGame,
)
from quakestats.core.ql import (
... | 0 | 0 | 0 | 5,111 | 0 | 0 | 0 | 461 | 266 |
310e4bae73897220c7c37458d7f26084bd19b439 | 708 | py | Python | examples/obsolete_legacy/destroyNetworks.py | dasec/ForTrace | b8187522a2c83fb661e5a1a5f403da8f40a31ead | [
"MIT"
] | 1 | 2022-03-31T14:01:51.000Z | 2022-03-31T14:01:51.000Z | examples/obsolete_legacy/destroyNetworks.py | dasec/ForTrace | b8187522a2c83fb661e5a1a5f403da8f40a31ead | [
"MIT"
] | null | null | null | examples/obsolete_legacy/destroyNetworks.py | dasec/ForTrace | b8187522a2c83fb661e5a1a5f403da8f40a31ead | [
"MIT"
] | 1 | 2022-03-31T14:02:30.000Z | 2022-03-31T14:02:30.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 Reinhard Stampp
# This file is part of fortrace - http://fortrace.fbi.h-da.de
# See the file 'docs/LICENSE' for copying permission.
"""This python script destroy the networks local and internet using libvirt.
"""
from __future__ import absolute... | 21.454545 | 76 | 0.710452 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 Reinhard Stampp
# This file is part of fortrace - http://fortrace.fbi.h-da.de
# See the file 'docs/LICENSE' for copying permission.
"""This python script destroy the networks local and internet using libvirt.
"""
from __future__ import absolute... | 0 | 0 | 0 | 0 | 0 | 21 | 0 | 68 | 75 |
584a62300dfe29fa5ed29a2bd483da0701c06f57 | 3,900 | py | Python | challenge4.py | pviafore/AdventOfCode2020 | 380e682558b22679639f72c178dd09114db0cbd6 | [
"MIT"
] | null | null | null | challenge4.py | pviafore/AdventOfCode2020 | 380e682558b22679639f72c178dd09114db0cbd6 | [
"MIT"
] | null | null | null | challenge4.py | pviafore/AdventOfCode2020 | 380e682558b22679639f72c178dd09114db0cbd6 | [
"MIT"
] | 1 | 2021-12-09T09:54:54.000Z | 2021-12-09T09:54:54.000Z |
import common.input_data as input_data
PASSPORTS: list[str] = input_data.read("input/input4.txt")
if __name__ == "__main__":
print(f"Number of valid passports: "
f"{get_number_of_valid_passports(PASSPORTS)}")
print(f"Number of data-valid passports: "
f"{get_number_of_valid_data_passports... | 36.792453 | 78 | 0.624359 | import itertools
import re
from collections import defaultdict
from dataclasses import dataclass
from typing import Iterable, Optional
import common.input_data as input_data
@dataclass
class Passport: # pylint: disable=R0902
birth_year: Optional[str]
issue_year: Optional[str]
expiration_year: Optional[str... | 0 | 2,241 | 0 | 0 | 0 | 1,074 | 0 | 25 | 225 |
c2591b8a605722a1287d38e7b61896da829e1d72 | 824 | py | Python | http/server.py | jbaines-r7/staystaystay | e52a8e2b6ff3a55f763f3a0c6823928b9ae36b75 | [
"BSD-3-Clause"
] | 6 | 2022-02-11T02:55:59.000Z | 2022-02-15T03:32:05.000Z | http/server.py | jbaines-r7/staystaystay | e52a8e2b6ff3a55f763f3a0c6823928b9ae36b75 | [
"BSD-3-Clause"
] | null | null | null | http/server.py | jbaines-r7/staystaystay | e52a8e2b6ff3a55f763f3a0c6823928b9ae36b75 | [
"BSD-3-Clause"
] | null | null | null | from http.server import HTTPServer, SimpleHTTPRequestHandler
import ssl
import os
import argparse
if __name__ == '__main__':
top_parser = argparse.ArgumentParser(description='Simple HTTPS server')
top_parser.add_argument('--port', action="store", dest="port", type=int, help="The port to listen on", default="443")... | 39.238095 | 120 | 0.740291 | from http.server import HTTPServer, SimpleHTTPRequestHandler
import ssl
import os
import argparse
if __name__ == '__main__':
top_parser = argparse.ArgumentParser(description='Simple HTTPS server')
top_parser.add_argument('--port', action="store", dest="port", type=int, help="The port to listen on", default="443")... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6c35fb4807906e4b5cc5a68f0dbba87b2301c758 | 443 | py | Python | Android/logdel.py | y007at/meghadoot | e95628cbff11e1e7802c75758af8e2ae2d7b1d20 | [
"MIT"
] | null | null | null | Android/logdel.py | y007at/meghadoot | e95628cbff11e1e7802c75758af8e2ae2d7b1d20 | [
"MIT"
] | null | null | null | Android/logdel.py | y007at/meghadoot | e95628cbff11e1e7802c75758af8e2ae2d7b1d20 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys, os, re;
dTs = 0
oldTs=-1
for l in sys.stdin:
l2=l.rstrip()
t = l2.split(' ')
if len(t) < 2:
continue
ts = t[1].split(':')
tsInMs = (int(ts[0])*3600 + int(ts[1])*60 + float(ts[2]))*1000
#print '%f -- %s ffffffffffffff\n' % ( tsInMs, t[1])
if (oldTs > 0):
d... | 16.407407 | 64 | 0.51693 | #!/usr/bin/python
import sys, os, re;
dTs = 0
oldTs=-1
for l in sys.stdin:
l2=l.rstrip()
t = l2.split(' ')
if len(t) < 2:
continue
ts = t[1].split(':')
tsInMs = (int(ts[0])*3600 + int(ts[1])*60 + float(ts[2]))*1000
#print '%f -- %s ffffffffffffff\n' % ( tsInMs, t[1])
if (oldTs > 0):
d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3f4a61cf35c7e50780cf901c36dd6887a92cbc8c | 5,966 | py | Python | build/lib/Py_FS/wrapper/nature_inspired/CS_test.py | rishavpramanik/Feature-Selection | afe96cb8271f1e86a77075d19ec107c37afbbff3 | [
"MIT"
] | 31 | 2020-11-17T10:42:22.000Z | 2022-03-27T11:20:13.000Z | build/lib/Py_FS/wrapper/nature_inspired/CS_test.py | rishavpramanik/Feature-Selection | afe96cb8271f1e86a77075d19ec107c37afbbff3 | [
"MIT"
] | 11 | 2020-10-21T18:05:12.000Z | 2022-03-25T18:54:53.000Z | build/lib/Py_FS/wrapper/nature_inspired/CS_test.py | rishavpramanik/Feature-Selection | afe96cb8271f1e86a77075d19ec107c37afbbff3 | [
"MIT"
] | 23 | 2020-11-18T14:01:09.000Z | 2022-03-31T04:36:33.000Z | """
Programmer: Trinav Bhattacharyya
Date of Development: 18/10/2020
This code has been developed according to the procedures mentioned in the following research article:
X.-S. Yang, S. Deb, Cuckoo search via Levy flights, in: Proc. of
World Congress on Nature & Biologically Inspired Computing (NaBIC 2009),
December 20... | 45.19697 | 182 | 0.56051 | """
Programmer: Trinav Bhattacharyya
Date of Development: 18/10/2020
This code has been developed according to the procedures mentioned in the following research article:
X.-S. Yang, S. Deb, “Cuckoo search via Levy flights”, in: Proc. of
World Congress on Nature & Biologically Inspired Computing (NaBIC 2009),
December ... | 6 | 0 | 0 | 4,955 | 0 | 0 | 0 | 239 | 157 |
1fa9401be7270550a0df0f48cc0049a5bf73787e | 2,852 | py | Python | src/main/python/fontspecs.py | sourcery-ai-bot/retcom | 7879ddc86990b61c32b4a531a4db12515935ab74 | [
"MIT"
] | 10 | 2021-02-28T11:45:40.000Z | 2022-03-20T02:24:55.000Z | src/main/python/fontspecs.py | sourcery-ai-bot/retcom | 7879ddc86990b61c32b4a531a4db12515935ab74 | [
"MIT"
] | 2 | 2021-05-29T19:03:37.000Z | 2022-01-14T18:20:03.000Z | src/main/python/fontspecs.py | sourcery-ai-bot/retcom | 7879ddc86990b61c32b4a531a4db12515935ab74 | [
"MIT"
] | 6 | 2021-02-22T17:19:26.000Z | 2021-09-13T12:47:58.000Z |
HALF2FULLWIDTH = dict((i, i + 0xFEE0) for i in range(0x21, 0x7F))
FULL2HALFWIDTH = dict((i + 0xFEE0, i) for i in range(0x21, 0x7F))
if __name__ == "__main__":
text = 'This is a test\nABCDEFGHIJKLMNOPQRSTUVW'
fontSpec = fetchFontSpec('/Library/Fonts/Courier New.ttf')
print(getTextDimensions(text, 12, fontS... | 26.407407 | 68 | 0.596424 | from fontTools.ttLib import TTFont
from fontTools.ttLib.tables._c_m_a_p import CmapSubtable
def fetchFontSpec(path):
font = TTFont(path)
cmap = font['cmap']
t = cmap.getcmap(3,1).cmap
s = font.getGlyphSet()
unitsPerEm = font['head'].unitsPerEm
return {
'font' : font,
't' : t,
... | 0 | 0 | 0 | 977 | 0 | 1,212 | 0 | 48 | 182 |
0081a1dac15339b1b7886f2b9a79a88cdd4843b6 | 105 | py | Python | src/elections_lk/parliamentary/ELECTION_YEAR_LIST.py | nuuuwan/elections_lk | 08835e420788271b6d6df190a19eb791c0c1c69e | [
"MIT"
] | 5 | 2019-10-18T04:57:44.000Z | 2020-09-11T08:19:43.000Z | src/elections_lk/parliamentary/ELECTION_YEAR_LIST.py | nuuuwan/elections_lk | 08835e420788271b6d6df190a19eb791c0c1c69e | [
"MIT"
] | null | null | null | src/elections_lk/parliamentary/ELECTION_YEAR_LIST.py | nuuuwan/elections_lk | 08835e420788271b6d6df190a19eb791c0c1c69e | [
"MIT"
] | null | null | null | ELECTION_YEAR_LIST = [
1989,
1994,
2000,
2001,
2004,
2010,
2015,
2020,
]
| 9.545455 | 22 | 0.47619 | ELECTION_YEAR_LIST = [
1989,
1994,
2000,
2001,
2004,
2010,
2015,
2020,
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d1aed4610f072e1117443a2c1854df92fdf0c18c | 8,052 | py | Python | src/openeo_classification/classify.py | openEOPlatform/openeo-classification | 2e593a0760c210d78454a6a4cd54e0c78cda8b22 | [
"Apache-2.0"
] | null | null | null | src/openeo_classification/classify.py | openEOPlatform/openeo-classification | 2e593a0760c210d78454a6a4cd54e0c78cda8b22 | [
"Apache-2.0"
] | 2 | 2022-03-31T12:19:19.000Z | 2022-03-31T14:35:39.000Z | src/openeo_classification/classify.py | openEOPlatform/openeo-classification | 2e593a0760c210d78454a6a4cd54e0c78cda8b22 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
from explore import all_crop_codes
from pathlib import Path
# TODO: invalid reference (https://github.com/openEOPlatform/openeo-classification/issues/2)
df = pd.read_csv("resources/training_data/final_features.csv",index_col=0)
print(df.head())
## Other class mag iig niet op Other cereals gaan tra... | 41.292308 | 144 | 0.643194 | import pandas as pd
from sklearn.model_selection import train_test_split, GridSearchCV
from sklearn.metrics import accuracy_score, precision_recall_fscore_support, confusion_matrix,plot_confusion_matrix, ConfusionMatrixDisplay
from catboost import CatBoostClassifier
import matplotlib.pyplot as plt
from explore import ... | 0 | 0 | 0 | 0 | 0 | 2,480 | 0 | 168 | 179 |
69990cfc9621ec7083d9cf51ca5e92ac2a42610b | 5,567 | py | Python | opp/baseline_lrrf_upper.py | heeryoncho/sensors2018cnnhar | 2c0ae84b83a95bd5b5ab13df0fb3f5e8529df91f | [
"MIT"
] | 10 | 2018-09-25T07:55:30.000Z | 2020-05-08T15:01:56.000Z | opp/baseline_lrrf_upper.py | heeryoncho/sensors2018cnnhar | 2c0ae84b83a95bd5b5ab13df0fb3f5e8529df91f | [
"MIT"
] | null | null | null | opp/baseline_lrrf_upper.py | heeryoncho/sensors2018cnnhar | 2c0ae84b83a95bd5b5ab13df0fb3f5e8529df91f | [
"MIT"
] | 5 | 2018-12-12T16:40:26.000Z | 2020-10-29T01:24:07.000Z | from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
import select_data as sd
'''
See paper: Sensors 2018, 18(4), 1055; https://doi.org/10.3390/s18041055
"Divide and Conquer-Base... | 29.146597 | 96 | 0.60679 | from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
import select_data as sd
'''
See paper: Sensors 2018, 18(4), 1055; https://doi.org/10.3390/s18041055
"Divide and Conquer-Base... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a2a781d8bedfa1ae1938c4a0ce6bae02332448f | 3,108 | py | Python | eva-server/src/test_web_service_rate_limiting.py | sundarvenkata-EBI/eva-ws | 8ee7a17d4715301ed7344df3bd309dcbda0e0c3d | [
"Apache-2.0"
] | 2 | 2019-04-04T17:29:05.000Z | 2019-08-20T04:29:53.000Z | eva-server/src/test_web_service_rate_limiting.py | sundarvenkata-EBI/eva-ws | 8ee7a17d4715301ed7344df3bd309dcbda0e0c3d | [
"Apache-2.0"
] | 45 | 2016-09-06T12:32:20.000Z | 2022-02-22T17:15:16.000Z | eva-server/src/test_web_service_rate_limiting.py | sundarvenkata-EBI/eva-ws | 8ee7a17d4715301ed7344df3bd309dcbda0e0c3d | [
"Apache-2.0"
] | 18 | 2016-09-16T12:30:00.000Z | 2021-06-25T08:34:56.000Z | # Copyright 2019 EMBL - European Bioinformatics Institute
#
# 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... | 37.902439 | 119 | 0.630309 | # Copyright 2019 EMBL - European Bioinformatics Institute
#
# 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... | 0 | 0 | 0 | 0 | 0 | 1,065 | 0 | 4 | 137 |
08d99fd3dce63ad10aa7a19c511695bf54345399 | 506 | py | Python | TSpy/stack2D.py | jtrebosc/JTutils | 124941a3e9101a82209b5f9b01a1276182baa9b4 | [
"BSD-3-Clause"
] | 2 | 2018-06-19T19:37:38.000Z | 2022-01-29T15:38:51.000Z | TSpy/stack2D.py | jtrebosc/JTutils | 124941a3e9101a82209b5f9b01a1276182baa9b4 | [
"BSD-3-Clause"
] | 2 | 2020-02-16T23:35:25.000Z | 2022-02-21T10:32:11.000Z | TSpy/stack2D.py | jtrebosc/JTutils | 124941a3e9101a82209b5f9b01a1276182baa9b4 | [
"BSD-3-Clause"
] | 2 | 2022-01-29T15:38:52.000Z | 2022-03-05T10:25:21.000Z | # -*- coding: utf-8 -*-
import sys
import os
import JTutils
if len(sys.argv)>1:
destproc = sys.argv[1]
else: destproc = "999"
if len(sys.argv) >2:
showRES = sys.argv[2]
else: showRES = "y"
data2d = CURDATA()
data1d = data2d[:]
data1d[2] = destproc
fulld2d = JTutils.fullpath(data2d)
fulld1d = JTutils.fullp... | 16.322581 | 60 | 0.677866 | # -*- coding: utf-8 -*-
import sys
import os
import os.path
import subprocess
import JTutils
if len(sys.argv)>1:
destproc = sys.argv[1]
else: destproc = "999"
if len(sys.argv) >2:
showRES = sys.argv[2]
else: showRES = "y"
data2d = CURDATA()
data1d = data2d[:]
data1d[2] = destproc
fulld2d = JTutils.fullpat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 44 |
3fd0bdd71e7a55eb15e5ccd5845880f21f01b43f | 434 | py | Python | version_query/__init__.py | mbdevpl/version-query | 7131b643e405351b6d0123059d3f3ec4154faf39 | [
"Apache-2.0"
] | 9 | 2017-11-23T11:20:54.000Z | 2021-02-18T10:34:30.000Z | version_query/__init__.py | mbdevpl/version-query | 7131b643e405351b6d0123059d3f3ec4154faf39 | [
"Apache-2.0"
] | 7 | 2018-08-31T21:13:41.000Z | 2020-11-15T14:26:59.000Z | version_query/__init__.py | mbdevpl/version-query | 7131b643e405351b6d0123059d3f3ec4154faf39 | [
"Apache-2.0"
] | 5 | 2019-07-16T00:30:09.000Z | 2021-06-16T07:37:18.000Z | """Initialization of version_query package."""
__all__ = ['VersionComponent', 'Version',
'query_folder', 'query_caller', 'query_version_str', 'predict_git_repo',
'predict_caller', 'predict_version_str']
from .version import VersionComponent, Version
from .query import query_folder, query_caller,... | 39.454545 | 83 | 0.771889 | """Initialization of version_query package."""
__all__ = ['VersionComponent', 'Version',
'query_folder', 'query_caller', 'query_version_str', 'predict_git_repo',
'predict_caller', 'predict_version_str']
from .version import VersionComponent, Version
from .query import query_folder, query_caller,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
65d30c8e6e67f70bee892b75356503589b1b4429 | 3,046 | py | Python | lib/hmmlearn/_utils.py | markrl/hmmlearn | b2b4f9e5b54a737330844caae9ff9102910d34f3 | [
"BSD-3-Clause"
] | null | null | null | lib/hmmlearn/_utils.py | markrl/hmmlearn | b2b4f9e5b54a737330844caae9ff9102910d34f3 | [
"BSD-3-Clause"
] | null | null | null | lib/hmmlearn/_utils.py | markrl/hmmlearn | b2b4f9e5b54a737330844caae9ff9102910d34f3 | [
"BSD-3-Clause"
] | null | null | null | """Private utilities."""
import numpy as np
# from sklearn.utils.validation import NotFittedError
# Copied from scikit-learn 0.19.
def _validate_covars(covars, covariance_type, n_components):
"""Do basic checks on matrix covariance sizes and values."""
from scipy import linalg
if covariance_type == 'sphe... | 42.305556 | 76 | 0.586014 | """Private utilities."""
import numpy as np
# from sklearn.utils.validation import NotFittedError
# Copied from scikit-learn 0.19.
def _validate_covars(covars, covariance_type, n_components):
"""Do basic checks on matrix covariance sizes and values."""
from scipy import linalg
if covariance_type == 'sphe... | 0 | 0 | 0 | 0 | 0 | 257 | 0 | 0 | 22 |
9f9bc41f165ced95e2acc47ecfd23d84f83165df | 18,140 | py | Python | main/views.py | geosoco/coding_experiment | bd17b703c3ba7a3de59ffc846fbcbbdb42fa8a77 | [
"MIT"
] | null | null | null | main/views.py | geosoco/coding_experiment | bd17b703c3ba7a3de59ffc846fbcbbdb42fa8a77 | [
"MIT"
] | null | null | null | main/views.py | geosoco/coding_experiment | bd17b703c3ba7a3de59ffc846fbcbbdb42fa8a77 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required, permission_required
from django.template.context_processors import csrf
from django.shortcuts import render, render_to_response, get_object_or_404
from django.http i... | 28.167702 | 163 | 0.699559 | from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required, permission_required
from django.template.context_processors import csrf
from django.shortcuts import render, render_to_response, get_object_or_404
from django.http i... | 0 | 131 | 0 | 1,686 | 0 | 7,617 | 0 | -2 | 458 |
29c8d246831a423c1d2c3af70d49942d02739f00 | 5,149 | py | Python | rsscraper/feeds/tests/test_views.py | Sunno/rsscraper | a9897d507980ec4525e8521188cf76203829caca | [
"MIT"
] | null | null | null | rsscraper/feeds/tests/test_views.py | Sunno/rsscraper | a9897d507980ec4525e8521188cf76203829caca | [
"MIT"
] | null | null | null | rsscraper/feeds/tests/test_views.py | Sunno/rsscraper | a9897d507980ec4525e8521188cf76203829caca | [
"MIT"
] | null | null | null | import pytest
pytestmark = pytest.mark.django_db
| 27.832432 | 78 | 0.632938 | import pytest
from django.conf import settings
from django.urls import reverse, resolve
from django.test import RequestFactory, Client
from django.http import Http404
from rsscraper.feeds.models import Feed, FeedItem
from rsscraper.feeds.views import FeedDetailView, FeedItemDetailView,\
FeedDeleteView
from rsscrap... | 0 | 0 | 0 | 3,982 | 0 | 647 | 0 | 195 | 270 |
9534719b3e125dbac0b54b5caf8f320f2ae78a02 | 108 | py | Python | Subprocess/sub1.py | Anilkumar95/python-75-hackathon | 0cc9304e46ceace826090614b46d8048a068d106 | [
"MIT"
] | null | null | null | Subprocess/sub1.py | Anilkumar95/python-75-hackathon | 0cc9304e46ceace826090614b46d8048a068d106 | [
"MIT"
] | null | null | null | Subprocess/sub1.py | Anilkumar95/python-75-hackathon | 0cc9304e46ceace826090614b46d8048a068d106 | [
"MIT"
] | 2 | 2019-01-27T16:59:48.000Z | 2019-01-29T13:07:40.000Z | # subprocess to return the information of the directory
import subprocess
subprocess.call('dir',shell=True)
| 27 | 55 | 0.814815 | # subprocess to return the information of the directory
import subprocess
subprocess.call('dir',shell=True)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f8f5f6dae01564157f684e47ebce54601fd84ad3 | 19,845 | py | Python | calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py | nghiadt16/CALplus | 68c108e6abf7eeac4937b870dc7462dd6ee2fcc3 | [
"Apache-2.0"
] | null | null | null | calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py | nghiadt16/CALplus | 68c108e6abf7eeac4937b870dc7462dd6ee2fcc3 | [
"Apache-2.0"
] | 4 | 2017-04-05T16:14:07.000Z | 2018-12-14T14:19:15.000Z | calplus/tests/unit/v1/compute/drivers/test_openstack_driver.py | nghiadt16/CALplus | 68c108e6abf7eeac4937b870dc7462dd6ee2fcc3 | [
"Apache-2.0"
] | 2 | 2017-04-18T16:53:58.000Z | 2018-12-04T05:42:51.000Z | """ OpenstackDriver for Compute
based on BaseDriver for Compute Resource
"""
fake_config_driver = {
'os_auth_url': 'http://controller:5000/v2_0',
'os_username': 'test',
'os_password': 'veryhard',
'os_project_name': 'demo',
'os_endpoint_url': 'http://controller:9696',
'os_driver_name': 'def... | 35.500894 | 75 | 0.638045 | """ OpenstackDriver for Compute
based on BaseDriver for Compute Resource
"""
import mock
from keystoneauth1.exceptions.base import ClientException
from calplus.tests import base
from calplus.v1.compute.drivers.openstack import OpenstackDriver
fake_config_driver = {
'os_auth_url': 'http://controller:5000/v2... | 0 | 0 | 0 | 18,909 | 0 | 0 | 0 | 78 | 160 |
d2e027362d4fedcab9c1fae25130ea86473b654e | 1,409 | py | Python | disco/util/functional.py | Lymia/rowboat | 391e1eab0323e4fc295404f367e62136265e9a60 | [
"MIT"
] | 6 | 2018-07-20T04:07:51.000Z | 2021-01-15T04:52:34.000Z | disco/util/functional.py | Lymia/rowboat | 391e1eab0323e4fc295404f367e62136265e9a60 | [
"MIT"
] | 1 | 2018-11-05T22:47:43.000Z | 2020-10-04T09:45:42.000Z | disco/util/functional.py | Lymia/rowboat | 391e1eab0323e4fc295404f367e62136265e9a60 | [
"MIT"
] | 6 | 2018-07-20T03:19:30.000Z | 2021-11-05T22:51:18.000Z |
NO_MORE_SENTINEL = object()
def one_or_many(f):
"""
Wraps a function so that it will either take a single argument, or a variable
number of args.
"""
return _f
| 20.42029 | 81 | 0.569198 | from six.moves import range
NO_MORE_SENTINEL = object()
def take(seq, count):
"""
Take count many elements from a sequence or generator.
Args
----
seq : sequnce or generator
The sequnce to take elements from.
count : int
The number of elments to take.
"""
for _ in ran... | 0 | 0 | 0 | 0 | 600 | 500 | 0 | 6 | 117 |
936d6aaa28edcd78d8154908db637a8124ec7f29 | 154 | py | Python | python/vital/__init__.py | mwoehlke-kitware/kwiver | 614a488bd2b7fe551ac75eec979766d882709791 | [
"BSD-3-Clause"
] | 176 | 2015-07-31T23:33:37.000Z | 2022-03-21T23:42:44.000Z | python/vital/__init__.py | mwoehlke-kitware/kwiver | 614a488bd2b7fe551ac75eec979766d882709791 | [
"BSD-3-Clause"
] | 1,276 | 2015-05-03T01:21:27.000Z | 2022-03-31T15:32:20.000Z | python/vital/__init__.py | mwoehlke-kitware/kwiver | 614a488bd2b7fe551ac75eec979766d882709791 | [
"BSD-3-Clause"
] | 85 | 2015-01-25T05:13:38.000Z | 2022-01-14T14:59:37.000Z | import warnings
warnings.warn(
'`import vital` is deprecated, use import kwiver.vital instead',
UserWarning
)
| 19.25 | 68 | 0.727273 | import warnings
warnings.warn(
'`import vital` is deprecated, use import kwiver.vital instead',
UserWarning
)
from kwiver.vital import * # NOQA
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 31 |
cb406c3cdc7290f5ffc3b2d571e3f9b27f5b35a6 | 2,002 | py | Python | gvapi/cli.py | TitaniumHocker/gvapi | 3848b0ff21f2c6d55501e2c4ebff1669fcd8cfea | [
"MIT"
] | 1 | 2021-01-18T09:07:13.000Z | 2021-01-18T09:07:13.000Z | gvapi/cli.py | TitaniumHocker/gvapi | 3848b0ff21f2c6d55501e2c4ebff1669fcd8cfea | [
"MIT"
] | 8 | 2020-07-09T06:40:16.000Z | 2021-04-24T01:49:51.000Z | gvapi/cli.py | TitaniumHocker/gvapi | 3848b0ff21f2c6d55501e2c4ebff1669fcd8cfea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""", CLI- gvapi"""
| 31.777778 | 99 | 0.663337 | # -*- coding: utf-8 -*-
"""Модуль, описывающий CLI-утилиту пакета gvapi"""
import sys
from os import environ
from pathlib import Path
from hashlib import md5
import pickle
import click
from gvapi import Hero, errors
@click.command()
@click.option('-g', '--god', required=False, default=environ.get('GVAPI_GOD'), help='... | 652 | 1,466 | 0 | 0 | 0 | 0 | 0 | -13 | 177 |
93f28a3589207ee43e53a4354028a0d0083de144 | 15,726 | py | Python | ecmwf_inmet/py/ecmwf_download.py | beneduzi/METEO | 5e3446b9ab1111ed88eab16252fcc84225abd6ed | [
"Apache-2.0"
] | 1 | 2018-08-09T16:23:40.000Z | 2018-08-09T16:23:40.000Z | ecmwf_inmet/py/ecmwf_download.py | beneduzi/METEO | 5e3446b9ab1111ed88eab16252fcc84225abd6ed | [
"Apache-2.0"
] | null | null | null | ecmwf_inmet/py/ecmwf_download.py | beneduzi/METEO | 5e3446b9ab1111ed88eab16252fcc84225abd6ed | [
"Apache-2.0"
] | null | null | null | from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
server.retrieve({
"class": "ei",
"dataset": "interim",
"date": "1979-01-01/to/1979-12-31",
"expver": "1",
"grid": "0.75/0.75",
"levtype": "sfc",
"param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168... | 28.855046 | 102 | 0.50248 | from ecmwfapi import ECMWFDataServer
server = ECMWFDataServer()
server.retrieve({
"class": "ei",
"dataset": "interim",
"date": "1979-01-01/to/1979-12-31",
"expver": "1",
"grid": "0.75/0.75",
"levtype": "sfc",
"param": "34.128/49.128/134.128/143.128/164.128/165.128/166.128/167.128/168... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
85a4186e3b7d83eabbe11a7f409d3bb4baf221bc | 9,949 | py | Python | apps/cms/urls.py | 1786016767jjk/pj | 17de9e2ab2bac842abf7ad4605c00dcb1a7d079f | [
"Apache-2.0"
] | null | null | null | apps/cms/urls.py | 1786016767jjk/pj | 17de9e2ab2bac842abf7ad4605c00dcb1a7d079f | [
"Apache-2.0"
] | null | null | null | apps/cms/urls.py | 1786016767jjk/pj | 17de9e2ab2bac842abf7ad4605c00dcb1a7d079f | [
"Apache-2.0"
] | null | null | null | #
from flask import Blueprint
bp = Blueprint('cms', __name__, url_prefix="/cms")
def loginDecotor(func):
""""""
return inner
#
#
# token
#
#
bp.add_url_rule('/resetpwd/', endpoint='resetpwd', view_func=ResetPwd.as_view('resetpwd'))
bp.add_url_rule('/resetemail/', endpoint='resetemail', v... | 30.425076 | 98 | 0.633129 | # 后台
from flask import Blueprint
from flask.views import MethodView
from flask import render_template, session, g
from apps.cms.forms import UserForm, ResetPwdForm, ResetEailForm, ResetEmailSendCode,URL
from flask import request, jsonify
from apps.common.baseResp import *
from ext import db, mail
from flask_mail import... | 1,203 | 6,281 | 0 | 1,632 | 0 | 100 | 0 | 319 | 853 |
bb2eabe8086251aa300894c724e1c7358f5d19af | 10,180 | py | Python | resources/usr/local/lib/python2.7/dist-packages/sklearn/utils/linear_assignment_.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/local/lib/python2.7/dist-packages/sklearn/utils/linear_assignment_.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/local/lib/python2.7/dist-packages/sklearn/utils/linear_assignment_.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 1 | 2020-05-28T23:01:44.000Z | 2020-05-28T23:01:44.000Z | """
Solve the unique lowest-cost assignment problem using the
Hungarian algorithm (also known as Munkres algorithm).
"""
# Based on original code by Brain Clapper, adapted to numpy by Gael Varoquaux
# Copyright (c) 2008 Brian M. Clapper <bmc@clapper.org>, Gael Varoquaux
# Author: Brian M. Clapper, Gael Varoquaux
# LI... | 35.347222 | 79 | 0.558251 | """
Solve the unique lowest-cost assignment problem using the
Hungarian algorithm (also known as Munkres algorithm).
"""
# Based on original code by Brain Clapper, adapted to numpy by Gael Varoquaux
# Copyright (c) 2008 Brian M. Clapper <bmc@clapper.org>, Gael Varoquaux
# Author: Brian M. Clapper, Gael Varoquaux
# LI... | 0 | 0 | 0 | 8,149 | 0 | 0 | 0 | 0 | 22 |
b32f1fcd2ed12feff6ea6a9bb82744f2bda3549f | 897 | py | Python | predict.py | Thesharing/lfesm | e956ed76f5a85259000742db093726d4b4c51751 | [
"Apache-2.0"
] | 6 | 2020-01-31T13:14:11.000Z | 2021-05-16T11:43:17.000Z | predict.py | Thesharing/lfesm | e956ed76f5a85259000742db093726d4b4c51751 | [
"Apache-2.0"
] | 5 | 2020-11-16T06:23:31.000Z | 2022-01-04T10:17:16.000Z | predict.py | Thesharing/lfesm | e956ed76f5a85259000742db093726d4b4c51751 | [
"Apache-2.0"
] | 4 | 2020-11-04T02:42:57.000Z | 2022-03-21T06:36:20.000Z | import logging
import sys
import time
import torch
from model import MatchModel
from data import TripletTextDataset
from util import seed_all
logging.disable(sys.maxsize)
start_time = time.time()
input_path = "./data/test/test.json"
output_path = "./data/test/output.txt"
if len(sys.argv) == 3:
input_path = sys... | 20.386364 | 55 | 0.720178 | import logging
import sys
import time
import torch
from model import MatchModel
from data import TripletTextDataset
from util import seed_all
logging.disable(sys.maxsize)
start_time = time.time()
input_path = "./data/test/test.json"
output_path = "./data/test/output.txt"
if len(sys.argv) == 3:
input_path = sys... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
744d1261d11c6824d5c1990f03db65e2dab3b1a9 | 423 | py | Python | paper_oh_maser.py | e-koch/VLA_Lband | 8fca7b2de0b88ce5c5011b34bf3936c69338d0b0 | [
"MIT"
] | 1 | 2021-03-08T23:19:12.000Z | 2021-03-08T23:19:12.000Z | paper_oh_maser.py | e-koch/VLA_Lband | 8fca7b2de0b88ce5c5011b34bf3936c69338d0b0 | [
"MIT"
] | null | null | null | paper_oh_maser.py | e-koch/VLA_Lband | 8fca7b2de0b88ce5c5011b34bf3936c69338d0b0 | [
"MIT"
] | null | null | null |
'''
Analysis and figures for research notes
Requires running OH_1665_narrowchannel_imaging
'''
from os.path import join as osjoin
from paths import c_path
# Masking and moment-making scripts
# Make velocity corrected cubes
execfile(osjoin(c_path, "Lines/OH_maser_luminosity.py"))
execfile(osjoin(c_path, "Lines/OH_... | 22.263158 | 73 | 0.794326 |
'''
Analysis and figures for research notes
Requires running OH_1665_narrowchannel_imaging
'''
from os.path import join as osjoin
from paths import c_path
# Masking and moment-making scripts
# Make velocity corrected cubes
execfile(osjoin(c_path, "Lines/OH_maser_luminosity.py"))
execfile(osjoin(c_path, "Lines/OH_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
462ad1bc8800602d01c097ab6883424598622ad8 | 2,142 | py | Python | Ene-Jun-2020/almaguer-constante-juan-de-dios/Parcial1/Practica3/Ejercicio2/comp.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ene-Jun-2020/almaguer-constante-juan-de-dios/Parcial1/Practica3/Ejercicio2/comp.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ene-Jun-2020/almaguer-constante-juan-de-dios/Parcial1/Practica3/Ejercicio2/comp.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z |
if __name__ == '__main__':
#se crean los diferentes archivos que formaran parte del directorio
root = directory('/')
etc = directory('/etc')
var = directory('/var')
usr = directory('/usr')
include = directory('/include')
home = directory('/home')
users = directory('/users')
sal... | 23.032258 | 71 | 0.634454 | import abc
class archivoComponent(metaclass=abc.ABCMeta):
@abc.abstractmethod
def path(self):
pass
def get_Name(self):
return self.name # Nombre del archivo
def get_Type(self):
return self.type # Directorio o archivo
class directory(archivoComponent):
def __init__(sel... | 0 | 31 | 0 | 1,203 | 0 | 0 | 0 | -11 | 114 |
08cd1f1319f3109fd20c7687a9bac69fb3bca05f | 581 | py | Python | info_security/lab7/lab7_test.py | smithros/kpi-stuff | 60da5f960ab6ab3d1c2b0ea451d4d113c333d7ad | [
"MIT"
] | 21 | 2021-01-20T19:49:31.000Z | 2021-12-15T20:26:18.000Z | info_security/lab7/lab7_test.py | smithros/kpi-stuff | 60da5f960ab6ab3d1c2b0ea451d4d113c333d7ad | [
"MIT"
] | 1 | 2021-03-13T17:24:41.000Z | 2021-05-28T18:33:49.000Z | info_security/lab7/lab7_test.py | smithros/kpi-stuff | 60da5f960ab6ab3d1c2b0ea451d4d113c333d7ad | [
"MIT"
] | 3 | 2021-02-16T17:41:16.000Z | 2022-03-25T13:18:04.000Z |
if __name__ == '__main__':
print(enc_test())
print(dec_test())
| 20.034483 | 54 | 0.48537 | import time
def enc_test():
y = []
for i in range(1, 101):
(pb, pr) = rsa.newkeys(1024)
t1 = time.time()
rsa.encrypt(bytes("a" * i, 'utf-8'), pb)
t2 = time.time()
y.append(t2 - t1)
return y
def dec_test():
y = []
for i in range(1, 5):
(pb, pr) = rsa... | 0 | 0 | 0 | 0 | 0 | 449 | 0 | -10 | 68 |
d0fec10afe3bb9093452151a9d44d48f51be9668 | 1,237 | py | Python | apps/pages/views/PagesView.py | Nelson-Morais/HA-OOAD | 82bd00ba7ab5f11f43bc90b505ee8afd0b86c7b5 | [
"Apache-2.0"
] | null | null | null | apps/pages/views/PagesView.py | Nelson-Morais/HA-OOAD | 82bd00ba7ab5f11f43bc90b505ee8afd0b86c7b5 | [
"Apache-2.0"
] | null | null | null | apps/pages/views/PagesView.py | Nelson-Morais/HA-OOAD | 82bd00ba7ab5f11f43bc90b505ee8afd0b86c7b5 | [
"Apache-2.0"
] | null | null | null | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 31.717949 | 61 | 0.753436 | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | 0 | 0 | 0 | 232 | 0 | 0 | 0 | 22 | 67 |
c444adea26dfc14584493a3e75526f91bcf3521b | 6,304 | py | Python | nsrdb_wrapper/wrapper.py | P-Tillmann/nsrdb_wrapper | f3bf8deb8dae09c7fba7ff8e19377090d431a28f | [
"MIT"
] | 1 | 2021-04-26T01:18:58.000Z | 2021-04-26T01:18:58.000Z | nsrdb_wrapper/wrapper.py | P-Tillmann/nsrdb_wrapper | f3bf8deb8dae09c7fba7ff8e19377090d431a28f | [
"MIT"
] | null | null | null | nsrdb_wrapper/wrapper.py | P-Tillmann/nsrdb_wrapper | f3bf8deb8dae09c7fba7ff8e19377090d431a28f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""module containg the API wrapper"""
| 42.594595 | 79 | 0.576459 | # -*- coding: utf-8 -*-
"""module containg the API wrapper"""
import io
import requests
import yaml
from pysolar import solar
import pandas as pd
class EndpointWrapper:
"""Base class for endpoint wrapper
The usage of the API requires an API key that can be requested for free at:
"https://developer.nrel.... | 0 | 0 | 0 | 6,108 | 0 | 0 | 0 | -26 | 157 |
5435b2a3fdc22b0749ebfcb7b84af3f0482d7ddf | 1,529 | py | Python | tests/sentry/api/endpoints/test_organization_api_key_index.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/sentry/api/endpoints/test_organization_api_key_index.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/api/endpoints/test_organization_api_key_index.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
| 31.204082 | 91 | 0.697842 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from sentry.testutils import APITestCase
class OrganizationApiKeyIndex(APITestCase):
def test_org_admin_can_access(self):
self.login_as(user=self.user)
organization = self.create_organization(name="foo", owner=s... | 0 | 0 | 0 | 1,378 | 0 | 0 | 0 | 42 | 69 |
939740ae11092dcd27714477128b1a74a1d75911 | 14,070 | py | Python | tools/client_mods.py | fadams/emscripten | 42fb486c53d627b203b77af6e5d0c088c0ad03ad | [
"MIT"
] | 1 | 2021-06-02T19:42:13.000Z | 2021-06-02T19:42:13.000Z | tools/client_mods.py | TheGoozah/emscripten | 42fb486c53d627b203b77af6e5d0c088c0ad03ad | [
"MIT"
] | null | null | null | tools/client_mods.py | TheGoozah/emscripten | 42fb486c53d627b203b77af6e5d0c088c0ad03ad | [
"MIT"
] | 1 | 2019-10-22T12:25:11.000Z | 2019-10-22T12:25:11.000Z |
# Handlers
handlers = [PreciseF32, Pthreads]
# client-side asm code modification
| 75.240642 | 229 | 0.524094 |
class PreciseF32:
name = 'PRECISE_F32 == 2'
@staticmethod
def get(settings, minified):
if settings.PRECISE_F32 == 2:
# Potentially-modifiable code, load as text, modify, then execute. This lets you
# patch the code on the client machine right before it is executed, perhaps based
# on infor... | 0 | 13,544 | 0 | 97 | 0 | 275 | 0 | 0 | 69 |
9cca714f558e27cda0fba8243b08966f6db03dee | 1,739 | py | Python | src/repositioning/rectpack_utils.py | PeterJackNaylor/CellularHeatmaps | 52829685683b6f3315b62246a77cc2206326e2b3 | [
"Apache-2.0"
] | null | null | null | src/repositioning/rectpack_utils.py | PeterJackNaylor/CellularHeatmaps | 52829685683b6f3315b62246a77cc2206326e2b3 | [
"Apache-2.0"
] | 2 | 2022-01-13T03:57:02.000Z | 2022-03-12T01:01:45.000Z | src/repositioning/rectpack_utils.py | PeterJackNaylor/CellularHeatmaps | 52829685683b6f3315b62246a77cc2206326e2b3 | [
"Apache-2.0"
] | 1 | 2020-10-12T07:56:51.000Z | 2020-10-12T07:56:51.000Z |
## not commented
| 29.474576 | 79 | 0.567568 |
import skimage as sk
import numpy as np
from rectpack import newPacker
## not commented
def get_rectangles(labeled):
rect = []
dic = {}
cc = sk.measure.regionprops(labeled)
for cc_i in sk.measure.regionprops(labeled):
x, y, w, h = cc_i.bbox
#removing object around
dic[cc_i.la... | 0 | 0 | 0 | 0 | 0 | 1,575 | 0 | 5 | 139 |
b25c3be4003dde5c47d2c685f495cd4a2be40846 | 1,306 | py | Python | web-app/backend/emotion/main/utils.py | syzroy/4099-Emotion-Analyser | de5b0fc28f97fbe7c55cf50413587fd55ae572ea | [
"MIT"
] | 1 | 2019-09-02T09:18:19.000Z | 2019-09-02T09:18:19.000Z | web-app/backend/emotion/main/utils.py | syzroy/4099-Emotion-Analyser | de5b0fc28f97fbe7c55cf50413587fd55ae572ea | [
"MIT"
] | null | null | null | web-app/backend/emotion/main/utils.py | syzroy/4099-Emotion-Analyser | de5b0fc28f97fbe7c55cf50413587fd55ae572ea | [
"MIT"
] | 1 | 2020-03-31T22:48:55.000Z | 2020-03-31T22:48:55.000Z | """
Created on Sep 22, 2018
@author: Yizhe Sun
"""
from redis import Redis
from rq import Queue
import sqlalchemy as db
from .config import DATABASE_URI
# Initialise the task queue for background tasks
q = Queue(connection=Redis())
# connect to database
engine = db.create_engine(DATABASE_URI)
connection = engine.co... | 22.517241 | 72 | 0.735069 | """
Created on Sep 22, 2018
@author: Yizhe Sun
"""
import os
import uuid
from werkzeug.utils import secure_filename
from redis import Redis
from rq import Queue
import sqlalchemy as db
from .config import ALLOWED_EXTENSIONS, DATABASE_URI
# Initialise the task queue for background tasks
q = Queue(connection=Redis()... | 0 | 0 | 0 | 0 | 0 | 370 | 0 | 19 | 156 |
2797deca1ca8da22e7f9a8002dd57f085389265e | 418 | py | Python | src/helpers/config.py | juanmanuelcarrera/parking-butler | c856328660ef1ac5eab735c87d8d8a7e4cbc1a06 | [
"MIT"
] | null | null | null | src/helpers/config.py | juanmanuelcarrera/parking-butler | c856328660ef1ac5eab735c87d8d8a7e4cbc1a06 | [
"MIT"
] | null | null | null | src/helpers/config.py | juanmanuelcarrera/parking-butler | c856328660ef1ac5eab735c87d8d8a7e4cbc1a06 | [
"MIT"
] | null | null | null |
import argparse
import warnings
import json
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-c", "--conf", required=True,
help="path to the JSON configuration file")
args = vars(ap.parse_args())
# filter warnings, load the configuration and initialize the Dro... | 26.125 | 68 | 0.760766 |
import argparse
import warnings
import json
# construct the argument parser and parse the arguments
ap = argparse.ArgumentParser()
ap.add_argument("-c", "--conf", required=True,
help="path to the JSON configuration file")
args = vars(ap.parse_args())
# filter warnings, load the configuration and initialize the Dro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bf109e0c551b87d0b71ffe96454f6c41544ec2c6 | 13,815 | py | Python | acoular/tests/unsupported/validationOfBeamformerFuncsPOSTAcoularIntegration.py | ishine/acoular | 4d790517adb38dc012b1f06966262b94f3625358 | [
"BSD-3-Clause"
] | 294 | 2015-03-24T09:19:12.000Z | 2022-03-11T02:59:11.000Z | acoular/tests/unsupported/validationOfBeamformerFuncsPOSTAcoularIntegration.py | haoshimaster/acoular | 3f630abde2ffbe1183aefceba2c4f7faa586656a | [
"BSD-3-Clause"
] | 45 | 2015-11-06T15:15:22.000Z | 2022-03-18T07:05:30.000Z | acoular/tests/unsupported/validationOfBeamformerFuncsPOSTAcoularIntegration.py | haoshimaster/acoular | 3f630abde2ffbe1183aefceba2c4f7faa586656a | [
"BSD-3-Clause"
] | 100 | 2015-05-05T15:18:57.000Z | 2022-03-21T09:48:05.000Z | # -*- coding: utf-8 -*-
"""
This script is a help for checking if the new NUMBA functions are correctly
integrated into acoular.
One has to make a savefile (see 'all_bfWeave.sav') for both, the old acoular
version an the new one. In section '#%% Compare Weave vs Numba' both versions
are compared.
This scri... | 54.176471 | 122 | 0.723127 | # -*- coding: utf-8 -*-
"""
This script is a help for checking if the new NUMBA functions are correctly
integrated into acoular.
One has to make a savefile (see 'all_bfWeave.sav') for both, the old acoular
version an the new one. In section '#%% Compare Weave vs Numba' both versions
are compared.
This scri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 |
d2ae69bc034f36afb7b38bac01799b44bd61dd97 | 152 | py | Python | privacy_analytics/templatetags/analytics_tags.py | milesmcc/django-privacy-analytics | f1de9f69a432e0dc2a53fa1d79a87ab8db1ef38a | [
"Apache-2.0"
] | 7 | 2019-09-27T01:24:50.000Z | 2021-07-28T01:50:52.000Z | privacy_analytics/templatetags/analytics_tags.py | milesmcc/django-privacy-analytics | f1de9f69a432e0dc2a53fa1d79a87ab8db1ef38a | [
"Apache-2.0"
] | 5 | 2020-05-11T00:48:46.000Z | 2022-01-06T22:56:12.000Z | privacy_analytics/templatetags/analytics_tags.py | milesmcc/django-privacy-analytics | f1de9f69a432e0dc2a53fa1d79a87ab8db1ef38a | [
"Apache-2.0"
] | 1 | 2020-05-08T14:10:26.000Z | 2020-05-08T14:10:26.000Z | from django import template
register = template.Library() | 21.714286 | 32 | 0.723684 | from django import template
register = template.Library()
@register.filter(name='percent')
def percent(value, arg=2):
return format(value, f'.2%') | 0 | 71 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
9d641f04475017401d9e5d2db08c78113653302f | 504 | py | Python | wandb/vendor/prompt_toolkit/styles/__init__.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | wandb/vendor/prompt_toolkit/styles/__init__.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | wandb/vendor/prompt_toolkit/styles/__init__.py | dreamflasher/client | c8267f1c6b8b6970172d622bb8fbf7cc773d78b2 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """
Styling for prompt_toolkit applications.
"""
from __future__ import unicode_literals
#: The default built-in style.
#: (For backwards compatibility, when Pygments is installed, this includes the
#: default Pygments style.)
try:
except ImportError:
DEFAULT_STYLE = style_from_dict(DEFAULT_STYLE_EXTENSIONS)
else... | 22.909091 | 78 | 0.769841 | """
Styling for prompt_toolkit applications.
"""
from __future__ import unicode_literals
from .base import *
from .defaults import *
from .from_dict import *
from .from_pygments import *
from .utils import *
#: The default built-in style.
#: (For backwards compatibility, when Pygments is installed, this includes the... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 137 |
31649d15480677618ebc918eff888ce116981683 | 101 | py | Python | paperboy/storage/sqla/models/base.py | chris-aeviator/paperboy | 604c912c3530cd37fb07dcf22321d9dde15465ee | [
"Apache-2.0"
] | 233 | 2018-11-01T09:17:08.000Z | 2022-03-22T08:27:24.000Z | paperboy/storage/sqla/models/base.py | chris-aeviator/paperboy | 604c912c3530cd37fb07dcf22321d9dde15465ee | [
"Apache-2.0"
] | 99 | 2018-10-17T21:48:42.000Z | 2021-05-07T08:33:36.000Z | paperboy/storage/sqla/models/base.py | chris-aeviator/paperboy | 604c912c3530cd37fb07dcf22321d9dde15465ee | [
"Apache-2.0"
] | 29 | 2018-11-01T11:33:08.000Z | 2022-01-12T22:12:19.000Z | from sqlalchemy.ext.declarative import declarative_base
# Base sqlalchemy
Base = declarative_base()
| 20.2 | 55 | 0.831683 | from sqlalchemy.ext.declarative import declarative_base
# Base sqlalchemy
Base = declarative_base()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0e0936779cc398669e650f09a8ab60fb3932dc26 | 812 | py | Python | ddb/feature/certs/__init__.py | gfi-centre-ouest/docker-devbox-ddb | 1597d85ef6e9e8322cce195a454de54186ce9ec7 | [
"MIT"
] | 4 | 2020-06-11T20:54:47.000Z | 2020-09-22T13:07:17.000Z | ddb/feature/certs/__init__.py | gfi-centre-ouest/docker-devbox-ddb | 1597d85ef6e9e8322cce195a454de54186ce9ec7 | [
"MIT"
] | 113 | 2019-11-07T00:40:36.000Z | 2021-01-18T12:50:16.000Z | ddb/feature/certs/__init__.py | inetum-orleans/docker-devbox-ddb | 20c713cf7bfcaf289226a17a9648c17d16003b4d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 23.2 | 90 | 0.657635 | # -*- coding: utf-8 -*-
from typing import Iterable, ClassVar
from .actions import GenerateCertAction, RemoveCertAction, GenerateSignerCertificateAction
from .schema import CertsSchema
from ..feature import Feature
from ..schema import FeatureSchema
from ...action import Action
class CertsFeature(Feature):
"""
... | 0 | 329 | 0 | 179 | 0 | 0 | 0 | 123 | 156 |
3d26adc045ecff7837f3edc5c641cba3f07d7b28 | 884 | py | Python | ZeroMQ/filecode/examples/Python/mdclient2.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | 1 | 2021-05-12T12:49:15.000Z | 2021-05-12T12:49:15.000Z | ZeroMQ/filecode/examples/Python/mdclient2.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | null | null | null | ZeroMQ/filecode/examples/Python/mdclient2.py | JailbreakFox/LightWeightRepository | 710dc8cacf934930b8f91b2cfe93cba0f1765094 | [
"BSD-2-Clause"
] | 1 | 2021-11-21T08:12:19.000Z | 2021-11-21T08:12:19.000Z | """
Majordomo Protocol client example. Uses the mdcli API to hide all MDP aspects
Author : Min RK <benjaminrk@gmail.com>
"""
if __name__ == '__main__':
main()
| 23.263158 | 77 | 0.58371 | """
Majordomo Protocol client example. Uses the mdcli API to hide all MDP aspects
Author : Min RK <benjaminrk@gmail.com>
"""
import sys
from mdcliapi2 import MajorDomoClient
def main():
verbose = '-v' in sys.argv
client = MajorDomoClient("tcp://localhost:5555", verbose)
requests = 100000
for i in xr... | 0 | 0 | 0 | 0 | 0 | 645 | 0 | 5 | 68 |
340bd8e908daf1b4227501dae63234bb8f104c28 | 76 | py | Python | en/002/python/main.py | franciscogomes2020/exercises | 8b33c4b9349a9331e4002a8225adc2a482c70024 | [
"MIT"
] | null | null | null | en/002/python/main.py | franciscogomes2020/exercises | 8b33c4b9349a9331e4002a8225adc2a482c70024 | [
"MIT"
] | null | null | null | en/002/python/main.py | franciscogomes2020/exercises | 8b33c4b9349a9331e4002a8225adc2a482c70024 | [
"MIT"
] | null | null | null | # Make a program that reads a person's name and displays a welcome message.
| 38 | 75 | 0.776316 | # Make a program that reads a person's name and displays a welcome message.
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
434b2838d4b5d030630c2f84bbd4f7ff92b35960 | 287 | py | Python | agents/__init__.py | RobertSamoilescu/RL_CarRacing | c1b4c3bed00fd1630e68f32a02798034df57c73a | [
"MIT"
] | null | null | null | agents/__init__.py | RobertSamoilescu/RL_CarRacing | c1b4c3bed00fd1630e68f32a02798034df57c73a | [
"MIT"
] | null | null | null | agents/__init__.py | RobertSamoilescu/RL_CarRacing | c1b4c3bed00fd1630e68f32a02798034df57c73a | [
"MIT"
] | null | null | null | from . import ppo
AGENTS = {
"PPO": ppo.PPOAlgo,
}
| 23.916667 | 69 | 0.658537 | from . import ppo
AGENTS = {
"PPO": ppo.PPOAlgo,
}
def get_agent(cfg, envs, acmodel, agent_data, **kwargs):
assert hasattr(cfg, "name") and cfg.name in AGENTS,\
"Please provide a valid Agent name."
return AGENTS[cfg.name](cfg, envs, acmodel, agent_data, **kwargs)
| 0 | 0 | 0 | 0 | 0 | 207 | 0 | 0 | 23 |
b1a308d0e6300ba0b686d9f9e4a380145b4d49c3 | 3,482 | py | Python | modules/packages/models/package_progress.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | modules/packages/models/package_progress.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | 11 | 2019-11-12T23:26:45.000Z | 2021-06-10T17:37:23.000Z | modules/packages/models/package_progress.py | heolin123/funcrowd | 20167783de208394c09ed0429a5f02ec6dd79c42 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 32.542056 | 88 | 0.643021 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from typing import Optional
from django.apps import apps
from django.db import models
from modules.packages.consts import UserPackageStatus, USER_PACKAGE_STATUSES
from modules.packages.models.utils import get_reward_token
from users.models.end_workers ... | 0 | 764 | 0 | 2,356 | 0 | 0 | 0 | 137 | 158 |
b158d445d96aa69598d9339ae15e06072dc20d02 | 11,495 | py | Python | tests/server/test_pipeline.py | DiamondLightSource/SuRVoS2 | 42bacfb6a5cc267f38ca1337e51a443eae1a9d2b | [
"MIT"
] | 4 | 2017-10-10T14:47:16.000Z | 2022-01-14T05:57:50.000Z | tests/server/test_pipeline.py | DiamondLightSource/SuRVoS2 | 42bacfb6a5cc267f38ca1337e51a443eae1a9d2b | [
"MIT"
] | 1 | 2022-01-11T21:11:12.000Z | 2022-01-12T08:22:34.000Z | tests/server/test_pipeline.py | DiamondLightSource/SuRVoS2 | 42bacfb6a5cc267f38ca1337e51a443eae1a9d2b | [
"MIT"
] | 2 | 2018-03-06T06:31:29.000Z | 2019-03-04T03:33:18.000Z | import pytest
import survos2.frontend.control
from survos2.server.superseg import sr_predict
# def test_analyzers(self, datamodel):
# DataModel = datamodel
# add data to workspace
# result = survos.run_command(
# "analyzer", "create", uri=None, workspace=DataModel.g.current_work... | 33.031609 | 87 | 0.559113 | import os
import h5py
import numpy as np
import pytest
from torch.testing import assert_allclose
from loguru import logger
from skimage.data import binary_blobs
import survos
import survos2.frontend.control
from survos2.frontend.control import Launcher
from survos2.entity.pipeline import Patch
import survos2.fronten... | 0 | 2,416 | 0 | 7,750 | 0 | 0 | 0 | 224 | 423 |
3aa21e24712a069ba32436e7ab15d7fe21bfae02 | 1,102 | py | Python | examples/hex_variation.py | danoneata/pydiagrams | aae37e7b37ad973e5ac05cbd3078acd5f3d67662 | [
"MIT"
] | null | null | null | examples/hex_variation.py | danoneata/pydiagrams | aae37e7b37ad973e5ac05cbd3078acd5f3d67662 | [
"MIT"
] | null | null | null | examples/hex_variation.py | danoneata/pydiagrams | aae37e7b37ad973e5ac05cbd3078acd5f3d67662 | [
"MIT"
] | null | null | null | import math
import random
random.seed(1337)
h = math.sqrt(3) / 2
h1 = math.cos(math.pi / 3)
dia = hex_variation(12).line_width(0.02).rotate_by(1 / 4)
dia.render("examples/output/hex-variation.png", height=512)
dia.render_svg("examples/output/hex-variation.svg", height=512)
| 22.489796 | 79 | 0.62069 | import math
import random
from itertools import product
from chalk import *
random.seed(1337)
h = math.sqrt(3) / 2
h1 = math.cos(math.pi / 3)
def hexagon_tile():
arc1 = arc(0.5, -math.pi / 3, math.pi / 3)
return (
arc1.translate(-1, 0)
+ vrule(2 * h)
+ arc1.rotate_by(1 / 2).trans... | 0 | 0 | 0 | 0 | 0 | 674 | 0 | 6 | 138 |
0f41fcca594cde4bea6054e0fb361166b60f9ef2 | 5,736 | py | Python | restkit/tee.py | gelnior/restkit | 6a8507afde15d576318ce24134016511b5e14331 | [
"MIT"
] | null | null | null | restkit/tee.py | gelnior/restkit | 6a8507afde15d576318ce24134016511b5e14331 | [
"MIT"
] | null | null | null | restkit/tee.py | gelnior/restkit | 6a8507afde15d576318ce24134016511b5e14331 | [
"MIT"
] | 1 | 2019-04-28T11:04:14.000Z | 2019-04-28T11:04:14.000Z | # -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
"""
TeeInput replace old FileInput. It use a file
if size > MAX_BODY or memory. It's now possible to rewind
read or restart etc ... It's based on TeeInput from Gunicorn.
"""
try:
from io ... | 26.43318 | 62 | 0.529114 | # -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
"""
TeeInput replace old FileInput. It use a file
if size > MAX_BODY or memory. It's now possible to rewind
read or restart etc ... It's based on TeeInput from Gunicorn.
"""
import copy
impor... | 0 | 0 | 0 | 5,242 | 0 | 0 | 0 | -23 | 161 |
06d2fa4c56be71f6ae3666f53cd2c7a0b628410a | 2,187 | py | Python | facturador/stock/migrations/0001_initial.py | crodriguezud/Facturador | 1a1e08072ae1d54f3f7963cdd202444618a0fa2e | [
"Apache-2.0"
] | null | null | null | facturador/stock/migrations/0001_initial.py | crodriguezud/Facturador | 1a1e08072ae1d54f3f7963cdd202444618a0fa2e | [
"Apache-2.0"
] | 9 | 2020-06-05T17:25:18.000Z | 2022-03-11T23:15:36.000Z | facturador/stock/migrations/0001_initial.py | crodriguezud/Facturador | 1a1e08072ae1d54f3f7963cdd202444618a0fa2e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-10-18 02:51
from __future__ import unicode_literals
| 35.852459 | 114 | 0.565615 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-10-18 02:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | 0 | 0 | 0 | 1,975 | 0 | 0 | 0 | 30 | 68 |
727938e2377b0190e840295ad04a019d8a40f2ca | 1,158 | py | Python | logging/example_1.py | Adeon18/Youtube_templates | 7743c7997ff5cb799479060a5e28c55c8683c0ab | [
"MIT"
] | 2 | 2021-06-13T04:42:31.000Z | 2022-02-15T11:21:30.000Z | logging/example_1.py | Adeon18/Youtube_templates | 7743c7997ff5cb799479060a5e28c55c8683c0ab | [
"MIT"
] | null | null | null | logging/example_1.py | Adeon18/Youtube_templates | 7743c7997ff5cb799479060a5e28c55c8683c0ab | [
"MIT"
] | 4 | 2022-01-21T14:57:03.000Z | 2022-02-22T15:56:18.000Z | """
Example 1 of logging usage
"""
import logging
logging.basicConfig(filename="logs.log", filemode="w", level=logging.DEBUG)
def process1():
"""
Process 1, okay?
"""
logging.info("Process 1 is complete...")
return
def process2():
"""
Process 2, okay?
"""
logging.info("Process 2 i... | 24.125 | 109 | 0.587219 | """
Example 1 of logging usage
"""
import logging
logging.basicConfig(filename="logs.log", filemode="w", level=logging.DEBUG)
def process1():
"""
Process 1, okay?
"""
logging.info("Process 1 is complete...")
return
def process2():
"""
Process 2, okay?
"""
logging.info("Process 2 i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
54be46a1b64278806802c13adc0ae2773bade670 | 3,426 | py | Python | src/collectors/kafka_consumer_lag/test/testkafka_consumer_lag.py | hermdog/Diamond | 0f3eb04327d6d3ed5e53a9967d6c9d2c09714a47 | [
"MIT"
] | 1,795 | 2015-01-05T11:14:55.000Z | 2022-03-25T12:07:15.000Z | src/collectors/kafka_consumer_lag/test/testkafka_consumer_lag.py | hermdog/Diamond | 0f3eb04327d6d3ed5e53a9967d6c9d2c09714a47 | [
"MIT"
] | 671 | 2015-01-02T05:57:27.000Z | 2022-03-29T22:39:05.000Z | src/collectors/kafka_consumer_lag/test/testkafka_consumer_lag.py | hermdog/Diamond | 0f3eb04327d6d3ed5e53a9967d6c9d2c09714a47 | [
"MIT"
] | 793 | 2015-01-03T01:39:02.000Z | 2022-02-18T05:12:27.000Z | #!/usr/bin/python
# coding=utf-8
##########################################################################
##########################################################################
| 36.446809 | 79 | 0.60829 | #!/usr/bin/python
# coding=utf-8
##########################################################################
from test import CollectorTestCase
from test import get_collector_config
from mock import patch, Mock
from diamond.collector import Collector
from kafka_consumer_lag import KafkaConsumerLagCollector
##########... | 0 | 2,635 | 0 | 382 | 0 | 0 | 0 | 89 | 135 |
d3faec563d67b070235463605ad4839ea763f4f9 | 2,964 | py | Python | PyPoll/PyPoll - main.py | bigbluey/HW-3-Python | a561a964936fd491f024faedd5cfe73ae0673421 | [
"MIT"
] | null | null | null | PyPoll/PyPoll - main.py | bigbluey/HW-3-Python | a561a964936fd491f024faedd5cfe73ae0673421 | [
"MIT"
] | null | null | null | PyPoll/PyPoll - main.py | bigbluey/HW-3-Python | a561a964936fd491f024faedd5cfe73ae0673421 | [
"MIT"
] | 4 | 2020-03-26T00:58:26.000Z | 2021-03-20T16:54:51.000Z | # Unit 3 | Assignment - Py Me Up, Charlie (PyPoll)
# Import Modules/Dependencies
import os
import csv
# Variables
total_votes = 0
khan_votes = 0
correy_votes = 0
li_votes = 0
otooley_votes = 0
# Set Path For File
csvpath = os.path.join('.', 'PyPoll', 'Resources', 'election_data.csv')
# Open & Read CSV File
with ope... | 32.933333 | 84 | 0.601552 | # Unit 3 | Assignment - Py Me Up, Charlie (PyPoll)
# Import Modules/Dependencies
import os
import csv
# Variables
total_votes = 0
khan_votes = 0
correy_votes = 0
li_votes = 0
otooley_votes = 0
# Set Path For File
csvpath = os.path.join('.', 'PyPoll', 'Resources', 'election_data.csv')
# Open & Read CSV File
with ope... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dbf3d8a40c5c82b896ece9454b8cd8a0a454e1d4 | 741 | py | Python | example.py | LuneZ99/aircv | 00a54939d9082f106cf3d9521d19d423a001f710 | [
"MIT"
] | null | null | null | example.py | LuneZ99/aircv | 00a54939d9082f106cf3d9521d19d423a001f710 | [
"MIT"
] | null | null | null | example.py | LuneZ99/aircv | 00a54939d9082f106cf3d9521d19d423a001f710 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: hzsunshx
# Created: 2015-03-23 14:42
"""
sift
"""
import aircv as ac
if __name__ == '__main__':
# sift_test()
# tmpl_test()
| 20.027027 | 108 | 0.605938 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: hzsunshx
# Created: 2015-03-23 14:42
"""
sift
"""
import aircv as ac
def sift_test():
t1 = ac.imread("testdata/1s.png")
t2 = ac.imread("testdata/2s.png")
print(ac.sift_count(t1), ac.sift_count(t2))
result = ac.find_sift(t1, t2, min_match_co... | 0 | 0 | 0 | 0 | 0 | 498 | 0 | 0 | 46 |
919e86283caab7ca91a759c0ce531a5b70fb2fa8 | 2,821 | py | Python | platonpm/_utils/chains.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platonpm/_utils/chains.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | platonpm/_utils/chains.py | shinnng/platon.py | 3197fac3839896290210da04dd0d45f0bdc731ce | [
"MIT"
] | null | null | null | from typing import (TYPE_CHECKING)
from urllib import (parse)
from platon_typing import (URI, HexStr)
from platon_utils import (remove_0x_prefix)
if TYPE_CHECKING:
BLOCK = "block"
BIP122_URL_REGEX = (
"^"
"blockchain://"
"(?P<chain_id>[a-zA-Z0-9]{64})"
"/"
"(?P<resource_type>block|transaction)... | 24.318966 | 97 | 0.661822 | import re
from typing import (
TYPE_CHECKING,
Any,
Tuple,
)
from urllib import (
parse,
)
from platon_typing import (
URI,
BlockNumber,
HexStr,
)
from platon_utils import (
add_0x_prefix,
is_integer,
remove_0x_prefix,
)
from hexbytes import (
HexBytes,
)
from platonpm.const... | 0 | 0 | 0 | 0 | 0 | 1,076 | 0 | 149 | 254 |
03ceb0b6e019ecba5d6a23be7dd791e978329e4a | 513 | py | Python | terrascript/resource/vmware/vmc.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/resource/vmware/vmc.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/resource/vmware/vmc.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/resource/vmware/vmc.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:30:35 UTC)
__all__ = [
"vmc_cluster",
"vmc_public_ip",
"vmc_sddc",
"vmc_site_recovery",
"vmc_srm_node",
]
| 15.545455 | 73 | 0.727096 | # terrascript/resource/vmware/vmc.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:30:35 UTC)
import terrascript
class vmc_cluster(terrascript.Resource):
pass
class vmc_public_ip(terrascript.Resource):
pass
class vmc_sddc(terrascript.Resource):
pass
class vmc_site_recovery(terrascri... | 0 | 0 | 0 | 146 | 0 | 0 | 0 | -3 | 137 |
f01e331f4e61c9d3c7700f80a2d47be855d796ce | 8,512 | py | Python | frugy/cli.py | MicroTCA-Tech-Lab/frugy | a83ce6f7850d4babfd6d89d5284a93ea252dd647 | [
"BSD-3-Clause"
] | 2 | 2022-03-30T10:03:57.000Z | 2022-03-31T09:54:33.000Z | frugy/cli.py | MicroTCA-Tech-Lab/frugy | a83ce6f7850d4babfd6d89d5284a93ea252dd647 | [
"BSD-3-Clause"
] | null | null | null | frugy/cli.py | MicroTCA-Tech-Lab/frugy | a83ce6f7850d4babfd6d89d5284a93ea252dd647 | [
"BSD-3-Clause"
] | 2 | 2020-09-14T01:40:00.000Z | 2021-03-26T09:39:59.000Z | ###########################################################################
# ____ _____________ __ __ __ _ _____ ___ _ #
# / __ \/ ____/ ___/\ \/ / | \/ (_)__ _ _ __|_ _/ __| /_\ (R) #
# / / / / __/ \__ \ \ / | |\/| | / _| '_/ _ \| || (__ / _ \ #
# / /_/ / /___... | 35.915612 | 115 | 0.492951 | ###########################################################################
# ____ _____________ __ __ __ _ _____ ___ _ #
# / __ \/ ____/ ___/\ \/ / | \/ (_)__ _ _ __|_ _/ __| /_\ (R) #
# / / / / __/ \__ \ \ / | |\/| | / _| '_/ _ \| || (__ / _ \ #
# / /_/ / /___... | 0 | 0 | 0 | 0 | 0 | 7,155 | 0 | 117 | 359 |
832ccfa9b0a05ad9848d788ce21e677fccac394a | 4,846 | py | Python | tests/tasks/test_ietf.py | kellerza/data-playbook | 382c369505a5cb0c28bd786ebdda51c05417165c | [
"Apache-2.0"
] | 3 | 2018-07-06T08:34:46.000Z | 2021-05-27T23:29:04.000Z | tests/tasks/test_ietf.py | kellerza/data-playbook | 382c369505a5cb0c28bd786ebdda51c05417165c | [
"Apache-2.0"
] | null | null | null | tests/tasks/test_ietf.py | kellerza/data-playbook | 382c369505a5cb0c28bd786ebdda51c05417165c | [
"Apache-2.0"
] | null | null | null | """Tests for ietf.py"""
from pathlib import Path
from dataplaybook.const import ATable
import dataplaybook.tasks.ietf as ietf
def test_extract_standards():
"""Test starting from string."""
txt = "IEEE 802.3ah"
std = list(ietf.extract_standards(txt))
assert std == ["IEEE 802.3ah"]
txt = "draft-i... | 29.017964 | 87 | 0.596574 | """Tests for ietf.py"""
from pathlib import Path
from dataplaybook.const import ATable
import dataplaybook.tasks.ietf as ietf
def test_extract_standards():
"""Test starting from string."""
txt = "IEEE 802.3ah"
std = list(ietf.extract_standards(txt))
assert std == ["IEEE 802.3ah"]
txt = "draft-i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
131dd41376eac41f09c396cfda9b8df21680c1b7 | 9,761 | py | Python | create_model/extra_functions.py | yokoyang/img-class | 2b1e12ee88dbbc5c3a52732a527721e92e30f89e | [
"MIT"
] | 1 | 2018-03-30T10:43:42.000Z | 2018-03-30T10:43:42.000Z | create_model/extra_functions.py | yokoyang/img-class | 2b1e12ee88dbbc5c3a52732a527721e92e30f89e | [
"MIT"
] | null | null | null | create_model/extra_functions.py | yokoyang/img-class | 2b1e12ee88dbbc5c3a52732a527721e92e30f89e | [
"MIT"
] | null | null | null | from __future__ import division
import os
import shapely
import shapely.geometry
import shapely.affinity
import pandas as pd
import csv
import sys
import cv2
import shapely.wkt
import shapely.affinity
import numpy as np
import skimage.color as color
# dirty hacks from SO to allow loading of big cvs's
# without decr... | 32.003279 | 124 | 0.660281 | from __future__ import division
from shapely.wkt import loads as wkt_loads
import os
import shapely
import shapely.geometry
import shapely.affinity
import h5py
import pandas as pd
import tifffile as tiff
from numba import jit, njit
from tqdm import tqdm
from collections import defaultdict
import csv
import sys
impor... | 0 | 0 | 0 | 0 | 0 | 6,387 | 0 | 78 | 384 |
5594d119164310c7b2a4f58c10117ec8d9a336c8 | 15,147 | py | Python | othello_gui.py | Mamin78/Othello | 5b72d5a3cf9959cf0c0faf82bd561558fa9c7195 | [
"MIT"
] | 2 | 2021-02-27T04:15:07.000Z | 2021-06-12T12:54:15.000Z | othello_gui.py | Mamin78/Othello | 5b72d5a3cf9959cf0c0faf82bd561558fa9c7195 | [
"MIT"
] | null | null | null | othello_gui.py | Mamin78/Othello | 5b72d5a3cf9959cf0c0faf82bd561558fa9c7195 | [
"MIT"
] | null | null | null |
import othello as oth
LIGHT_FONT = ("Nexa light", 12)
BOLD_FONT = ("Nexa Bold", 11)
CELL_LENGTH = 60
COL_ROW_NAME_LENGTH = 40
DELAY = 1.5
CRED2 = '\33[91m'
CYELLOW2 = '\33[93m'
CURRENT_NUMB_CALL = 0
if __name__ == '__main__':
game_logic_instance = oth.GameLogic()
game_logic_instance.create_board()
Oth... | 44.16035 | 122 | 0.542484 | import tkinter
import time
import othello as oth
LIGHT_FONT = ("Nexa light", 12)
BOLD_FONT = ("Nexa Bold", 11)
CELL_LENGTH = 60
COL_ROW_NAME_LENGTH = 40
DELAY = 1.5
CRED2 = '\33[91m'
CYELLOW2 = '\33[93m'
CURRENT_NUMB_CALL = 0
class OthelloBoard:
def __init__(self):
# creat an instance from tkinter libra... | 0 | 0 | 0 | 14,668 | 0 | 68 | 0 | -17 | 90 |
86d20777b2ed3207b88d46e6a3e0dbf651c40267 | 2,962 | py | Python | aws_lambda_builders/workflows/java_maven/workflow.py | zhuhaow/aws-lambda-builders | ca658b37ed5242bfec82e01e33046b22484585cd | [
"Apache-2.0"
] | null | null | null | aws_lambda_builders/workflows/java_maven/workflow.py | zhuhaow/aws-lambda-builders | ca658b37ed5242bfec82e01e33046b22484585cd | [
"Apache-2.0"
] | null | null | null | aws_lambda_builders/workflows/java_maven/workflow.py | zhuhaow/aws-lambda-builders | ca658b37ed5242bfec82e01e33046b22484585cd | [
"Apache-2.0"
] | null | null | null | """
Java Maven Workflow
"""
| 41.71831 | 116 | 0.749156 | """
Java Maven Workflow
"""
from aws_lambda_builders.workflow import BaseWorkflow, Capability
from aws_lambda_builders.actions import CopySourceAction, CleanUpAction
from aws_lambda_builders.workflows.java.actions import JavaCopyDependenciesAction, JavaMoveDependenciesAction
from aws_lambda_builders.workflows.java.util... | 0 | 0 | 0 | 2,273 | 0 | 0 | 0 | 460 | 200 |
822e0b2171de91130444d64d989588c4d313302f | 6,152 | py | Python | monthly_github_stats/monthly_github_stats.py | amashinchi-rc/useful-stats-scripts | fba66f32aa76c9d2a72a12b4837395cad675b916 | [
"MIT"
] | null | null | null | monthly_github_stats/monthly_github_stats.py | amashinchi-rc/useful-stats-scripts | fba66f32aa76c9d2a72a12b4837395cad675b916 | [
"MIT"
] | null | null | null | monthly_github_stats/monthly_github_stats.py | amashinchi-rc/useful-stats-scripts | fba66f32aa76c9d2a72a12b4837395cad675b916 | [
"MIT"
] | null | null | null | import argparse
import os
from collections import OrderedDict
from datetime import datetime
from github import Github
if __name__ == "__main__":
print("Running...\n")
# Variable to let us know how long this takes...
begin_time = datetime.now()
# Setup arguments
parser = argparse.ArgumentParser(... | 32.041667 | 76 | 0.592165 | import argparse
import csv
import os
from collections import OrderedDict
from datetime import datetime
from github import Github
def write_to_csv_file(target_file, row_data, write_type='a'):
with open(target_file, write_type, encoding='utf-8') as f:
writer = csv.writer(f, delimiter=',')
writer.wri... | 0 | 0 | 0 | 0 | 0 | 199 | 0 | -11 | 45 |
79351b76f3c2c94f18584a4c999397dcf10ca5a6 | 2,055 | py | Python | helpsessions/helpclient.py | philip-w-howard/smallprojects | 36f11a83eecf0e807aeb43d4a6b6e5d308a8491c | [
"MIT"
] | null | null | null | helpsessions/helpclient.py | philip-w-howard/smallprojects | 36f11a83eecf0e807aeb43d4a6b6e5d308a8491c | [
"MIT"
] | null | null | null | helpsessions/helpclient.py | philip-w-howard/smallprojects | 36f11a83eecf0e807aeb43d4a6b6e5d308a8491c | [
"MIT"
] | null | null | null | #!/usr/bin/python
import socket
import json
import os
import pwd
UDP_IP = "127.0.0.1"
UDP_PORT = 5006
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Internet UDP
user = pwd.getpwuid( os.getuid() ).pw_name
print "Running as", user
session_list = []
while (True) :
display_menu()
cmd = raw_input("a... | 24.759036 | 85 | 0.571776 | #!/usr/bin/python
import socket
import json
import os
import pwd
UDP_IP = "127.0.0.1"
UDP_PORT = 5006
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Internet UDP
user = pwd.getpwuid( os.getuid() ).pw_name
print "Running as", user
session_list = []
def display_menu() :
global session_list
print "... | 0 | 0 | 0 | 0 | 0 | 1,027 | 0 | 0 | 69 |
624976a4ec765c206fec24a3590b440ea79fa4c2 | 3,206 | py | Python | sql_queries.py | tomgtqq/DEND-P1-Data-Modeling-With-Postgres | 98ed83b216c4907e91fbd3a2aa8dfdf1716bcc96 | [
"MIT"
] | null | null | null | sql_queries.py | tomgtqq/DEND-P1-Data-Modeling-With-Postgres | 98ed83b216c4907e91fbd3a2aa8dfdf1716bcc96 | [
"MIT"
] | null | null | null | sql_queries.py | tomgtqq/DEND-P1-Data-Modeling-With-Postgres | 98ed83b216c4907e91fbd3a2aa8dfdf1716bcc96 | [
"MIT"
] | null | null | null | # DROP TABLES
songplay_table_drop = "DROP TABLE IF EXISTS songplays;"
user_table_drop = "DROP TABLE IF EXISTS users;"
song_table_drop = "DROP TABLE IF EXISTS songs;"
artist_table_drop = "DROP TABLE IF EXISTS artists;"
time_table_drop = "DROP TABLE IF EXISTS time;"
# CREATE TABLES
songplay_table_create = ("""
CR... | 26.941176 | 124 | 0.66282 | # DROP TABLES
songplay_table_drop = "DROP TABLE IF EXISTS songplays;"
user_table_drop = "DROP TABLE IF EXISTS users;"
song_table_drop = "DROP TABLE IF EXISTS songs;"
artist_table_drop = "DROP TABLE IF EXISTS artists;"
time_table_drop = "DROP TABLE IF EXISTS time;"
# CREATE TABLES
songplay_table_create = ("""
CR... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7eed9eb57ee802bdc652bc04319682d22ca98996 | 1,134 | py | Python | tests/test_tcfl_tc_run_zephyr_testcase_yaml.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 24 | 2018-08-21T18:04:48.000Z | 2022-02-07T22:50:06.000Z | tests/test_tcfl_tc_run_zephyr_testcase_yaml.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 16 | 2018-08-21T18:03:52.000Z | 2022-03-01T17:15:42.000Z | tests/test_tcfl_tc_run_zephyr_testcase_yaml.py | sriiora/tcf | e607ce04f97dbb4910d94428c0600a6a7145a825 | [
"Apache-2.0"
] | 29 | 2018-08-22T19:40:59.000Z | 2021-12-21T11:13:23.000Z | #! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable = missing-docstring
import os
import commonl.testing
import tcfl.tc
import tcfl.tc_zephyr_sanity
import tcfl.tl
srcdir = os.path.dirname(__file__)
ttbd = commonl.testing.test_ttbd(config_files = ... | 27 | 66 | 0.714286 | #! /usr/bin/python3
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable = missing-docstring
import os
import commonl.testing
import tcfl.tc
import tcfl.tc_zephyr_sanity
import tcfl.tl
srcdir = os.path.dirname(__file__)
ttbd = commonl.testing.test_ttbd(config_files = ... | 0 | 445 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
473903c138a01c75f3bc885ba25bec415a77c323 | 3,007 | py | Python | tests/pollinotify_test.py | jdstmporter/python-polled-inotify | 4fd76f825584618a4eec13a9a069b2058909113b | [
"Python-2.0"
] | null | null | null | tests/pollinotify_test.py | jdstmporter/python-polled-inotify | 4fd76f825584618a4eec13a9a069b2058909113b | [
"Python-2.0"
] | null | null | null | tests/pollinotify_test.py | jdstmporter/python-polled-inotify | 4fd76f825584618a4eec13a9a069b2058909113b | [
"Python-2.0"
] | null | null | null | '''
Created on 30 Jun 2014
@author: julianporter
'''
import unittest
if __name__=='__main__':
unittest.main(exit=False)
| 28.913462 | 135 | 0.625208 | '''
Created on 30 Jun 2014
@author: julianporter
'''
import random
import unittest
import multiprocessing
import collections
import tempfile
import time
import os
import sys
from .actions import EventGenerator, EventObserver
class TestInotify(unittest.TestCase):
def __init__(self,methodName='r... | 0 | 0 | 0 | 2,633 | 0 | 10 | 0 | -20 | 236 |
de2a4613735abb7a7a8083705fe34705699a472f | 4,103 | py | Python | peripheral/supc_44082/config/supc.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | peripheral/supc_44082/config/supc.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | peripheral/supc_44082/config/supc.py | Unitek-KL/csp | 2ac7ba59465f23959e51d2f16a5712b57b79ef5f | [
"0BSD"
] | null | null | null | # coding: utf-8
"""*****************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | 50.654321 | 102 | 0.690958 | # coding: utf-8
"""*****************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* re... | 0 | 0 | 0 | 0 | 0 | 2,555 | 0 | 0 | 22 |
9fe02b5c7ab9649151577119dacbc9b792016db1 | 843 | py | Python | users/models.py | adit-negi/cowin-alerts-app | af34f717ba52677bd78852a0dd37b40ebe244760 | [
"MIT"
] | 3 | 2021-05-10T09:07:03.000Z | 2021-05-10T13:50:18.000Z | users/models.py | adit-negi/cowin_app | af34f717ba52677bd78852a0dd37b40ebe244760 | [
"MIT"
] | null | null | null | users/models.py | adit-negi/cowin_app | af34f717ba52677bd78852a0dd37b40ebe244760 | [
"MIT"
] | null | null | null | # Create your models here.
| 35.125 | 86 | 0.715302 | from django.db import models
from django.contrib.auth.models import AbstractUser, BaseUserManager, PermissionsMixin
class User(AbstractUser):
EMAIL_VERIFIED = 0
OTP_VERIFIED = 1
NOT_VERIFIED = 2
AUTH_VERIFICATION_STATUS = (
(EMAIL_VERIFIED, 'Email is verified'),
(OTP_VERIFIED, 'Phone n... | 0 | 0 | 0 | 678 | 0 | 0 | 0 | 72 | 66 |
2c466c708c541ca4822f44073f7aa49737cec171 | 1,221 | py | Python | data/external/repositories_2to3/166417/Restaurant-Revenue-Prediction-master/Ari/testing_grounds/feat_drop.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/166417/Restaurant-Revenue-Prediction-master/Ari/testing_grounds/feat_drop.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | null | null | null | data/external/repositories_2to3/166417/Restaurant-Revenue-Prediction-master/Ari/testing_grounds/feat_drop.py | Keesiu/meta-kaggle | 87de739aba2399fd31072ee81b391f9b7a63f540 | [
"MIT"
] | 1 | 2019-12-04T08:23:33.000Z | 2019-12-04T08:23:33.000Z | import numpy as np
import pandas as pd
###############################################################################
# Load data
df_train = pd.read_csv("train_numerical_head.csv")
df_train.head()
feats = df_train.drop(str(42), axis=1)
X_train = feats.values #features
y_train = df_train[str(42)].values #tar... | 26.543478 | 80 | 0.504505 | import numpy as np
import pandas as pd
###############################################################################
# Load data
df_train = pd.read_csv("train_numerical_head.csv")
df_train.head()
feats = df_train.drop(str(42), axis=1)
X_train = feats.values #features
y_train = df_train[str(42)].values #tar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f4fc34568ccb368c4a16b56bbfc71da72a5b445 | 5,219 | py | Python | http2_adapter/adapter.py | tokers/HTTP2Adapter | 647b89b121bdb81526e5403b870f7c6b743273ce | [
"Apache-2.0"
] | 1 | 2018-03-11T07:40:56.000Z | 2018-03-11T07:40:56.000Z | http2_adapter/adapter.py | tokers/requests-http2-adapter | 647b89b121bdb81526e5403b870f7c6b743273ce | [
"Apache-2.0"
] | null | null | null | http2_adapter/adapter.py | tokers/requests-http2-adapter | 647b89b121bdb81526e5403b870f7c6b743273ce | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
http/2 adapter implements
~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
DEFAULT_POOLBLOCK = False
DEFAULT_POOLSIZE = 10
DEFAULT_RETRIES = 0
DEFAULT_POOL_TIMEOUT = None
| 34.793333 | 88 | 0.674075 | # -*- coding: utf-8 -*-
"""
http/2 adapter implements
~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import requests
from requests.exceptions import InvalidSchema as _SchemaError
from urllib3.poolmanager import PoolManager, proxy_from_url
from ... | 0 | 0 | 0 | 4,213 | 0 | 0 | 0 | 376 | 357 |
a300cdbf5cee9d5d8e188c81f0b01ca66643a577 | 1,797 | py | Python | entifyfishing_client/models/time.py | kairntech/entifyfishing-client | 10a86166cf7895d681fe7e4adf0f01622b48dcb8 | [
"Apache-2.0"
] | null | null | null | entifyfishing_client/models/time.py | kairntech/entifyfishing-client | 10a86166cf7895d681fe7e4adf0f01622b48dcb8 | [
"Apache-2.0"
] | null | null | null | entifyfishing_client/models/time.py | kairntech/entifyfishing-client | 10a86166cf7895d681fe7e4adf0f01622b48dcb8 | [
"Apache-2.0"
] | null | null | null | from typing import TypeVar
T = TypeVar("T", bound="Time")
| 24.616438 | 63 | 0.556483 | from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="Time")
@attr.s(auto_attribs=True)
class Time:
""" """
time: str
calendarmodel: Union[Unset, str] = UNSET
timezone: Union[Unset, int] = UNSET
before: Union[Unset, int] = UNSET... | 0 | 1,643 | 0 | 0 | 0 | 0 | 0 | 25 | 69 |
9f7b0e91ebce4cb8675698ab3b1b610b51b83f9a | 5,958 | py | Python | system_tests/local/azure_tests.py | diaperrash/cloudify-azure-plugin | dc495c294931168b012b60427e36e5a0738f2292 | [
"Apache-2.0"
] | null | null | null | system_tests/local/azure_tests.py | diaperrash/cloudify-azure-plugin | dc495c294931168b012b60427e36e5a0738f2292 | [
"Apache-2.0"
] | null | null | null | system_tests/local/azure_tests.py | diaperrash/cloudify-azure-plugin | dc495c294931168b012b60427e36e5a0738f2292 | [
"Apache-2.0"
] | null | null | null | ########
# Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 35.254438 | 79 | 0.608761 | ########
# Copyright (c) 2016 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 0 | 3,321 | 0 | 1,694 | 0 | 0 | 0 | 33 | 92 |
59bff530cc8176721921e73716d3a3b26e9618b1 | 269 | py | Python | _solutions/advanced/oop/oop_relations_d.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/advanced/oop/oop_relations_d.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/advanced/oop/oop_relations_d.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null |
result = []
for astronaut in DATA:
for i, mission in enumerate(astronaut.pop('missions'), start=1):
for field,value in mission.items():
column_name = f'mission{i}_{field}'
astronaut[column_name] = value
result.append(astronaut)
| 29.888889 | 68 | 0.635688 |
result = []
for astronaut in DATA:
for i, mission in enumerate(astronaut.pop('missions'), start=1):
for field,value in mission.items():
column_name = f'mission{i}_{field}'
astronaut[column_name] = value
result.append(astronaut)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |