hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f85fe3d0fc0972e2f4e39bd88f70e4c006132765 | 14,977 | py | Python | various_types_of_self_citation/main.py | KasyanovPavel/wos_api_usecases | 6f87e46d45eaffe1bb98c63ae63a8818160d3273 | [
"MIT"
] | null | null | null | various_types_of_self_citation/main.py | KasyanovPavel/wos_api_usecases | 6f87e46d45eaffe1bb98c63ae63a8818160d3273 | [
"MIT"
] | null | null | null | various_types_of_self_citation/main.py | KasyanovPavel/wos_api_usecases | 6f87e46d45eaffe1bb98c63ae63a8818160d3273 | [
"MIT"
] | 1 | 2021-07-28T16:47:58.000Z | 2021-07-28T16:47:58.000Z | import requests
from apikey import apikey # Your API key, it's better not to store it in the program
# Enter the WoS search query to evaluate its self-citation percentage:
search_query = '(TS=("self citation*" or selfcitation*)) AND (TP==("HIGHLY CITED PAPERS"))'
headers = {
'X-APIKey': apikey
}
endpoint = "ht... | 61.130612 | 237 | 0.686252 | import requests
from apikey import apikey # Your API key, it's better not to store it in the program
# Enter the WoS search query to evaluate its self-citation percentage:
search_query = '(TS=("self citation*" or selfcitation*)) AND (TP==("HIGHLY CITED PAPERS"))'
headers = {
'X-APIKey': apikey
}
endpoint = "ht... | 13,480 | -7 | 327 |
e704606e17552b1dc7f3698e2abe2715af86b384 | 3,867 | py | Python | src/fbsrankings/service/service.py | mikee385/fbsrankings | 2b50e26a302b53c21cd8f5c965943d6fbf0680a1 | [
"MIT"
] | null | null | null | src/fbsrankings/service/service.py | mikee385/fbsrankings | 2b50e26a302b53c21cd8f5c965943d6fbf0680a1 | [
"MIT"
] | null | null | null | src/fbsrankings/service/service.py | mikee385/fbsrankings | 2b50e26a302b53c21cd8f5c965943d6fbf0680a1 | [
"MIT"
] | null | null | null | from abc import ABCMeta
from types import TracebackType
from typing import ContextManager
from typing import List
from typing import Optional
from typing import Type
from typing import TypeVar
from typing_extensions import Literal
from typing_extensions import Protocol
from fbsrankings.common import Command
from fbsr... | 31.696721 | 87 | 0.709853 | from abc import ABCMeta
from types import TracebackType
from typing import ContextManager
from typing import List
from typing import Optional
from typing import Type
from typing import TypeVar
from typing_extensions import Literal
from typing_extensions import Protocol
from fbsrankings.common import Command
from fbsr... | 2,252 | 315 | 153 |
9c23ac4cd76abc536a947f4db42f36183636e6ef | 3,243 | py | Python | xpresso/binders/_body/openapi/discriminated.py | yezz123/xpresso | 89ba9f3d164b0d76cbe085e09e39d4bca2315b59 | [
"MIT"
] | 4 | 2022-02-07T05:12:51.000Z | 2022-02-28T12:34:57.000Z | xpresso/binders/_body/openapi/discriminated.py | yezz123/xpresso | 89ba9f3d164b0d76cbe085e09e39d4bca2315b59 | [
"MIT"
] | 2 | 2022-01-25T02:05:02.000Z | 2022-01-25T02:38:59.000Z | xpresso/binders/_body/openapi/discriminated.py | yezz123/xpresso | 89ba9f3d164b0d76cbe085e09e39d4bca2315b59 | [
"MIT"
] | null | null | null | import inspect
import sys
import typing
from dataclasses import dataclass
if sys.version_info < (3, 9):
from typing_extensions import Annotated, get_args, get_origin
else:
from typing import Annotated, get_origin, get_args
from di.typing import get_markers_from_parameter
from xpresso._utils.typing import mod... | 36.852273 | 85 | 0.670984 | import inspect
import sys
import typing
from dataclasses import dataclass
if sys.version_info < (3, 9):
from typing_extensions import Annotated, get_args, get_origin
else:
from typing import Annotated, get_origin, get_args
from di.typing import get_markers_from_parameter
from xpresso._utils.typing import mod... | 2,261 | 351 | 44 |
acd2ea12491c5b1f25bd235a0238c6e418dc7018 | 3,227 | py | Python | scripts/particle_sym.py | mihranmashhud/PolyMarine | f959016b4505356213f10bdf0ff1b2157f719c87 | [
"MIT"
] | 1 | 2022-03-10T21:06:51.000Z | 2022-03-10T21:06:51.000Z | scripts/particle_sym.py | Mrugank-Upadhyay/PolyMarine | f959016b4505356213f10bdf0ff1b2157f719c87 | [
"MIT"
] | null | null | null | scripts/particle_sym.py | Mrugank-Upadhyay/PolyMarine | f959016b4505356213f10bdf0ff1b2157f719c87 | [
"MIT"
] | 1 | 2022-03-10T21:02:04.000Z | 2022-03-10T21:02:04.000Z | from operator import itemgetter
import time
import math
import random
import numpy as np
import datetime
from osgeo import ogr, osr
latlongToAlbers = getCoordConverter(4326,5070)
albersToLatlong = getCoordConverter(5070,4326)
start_date = datetime.datetime(1992,1,1)
end_date = datetime.datetime(2017,12,31)
current_d... | 31.637255 | 99 | 0.654168 | from operator import itemgetter
import time
import math
import random
import numpy as np
import datetime
from osgeo import ogr, osr
def getCoordConverter(src='', targ=''):
srcproj = osr.SpatialReference()
srcproj.ImportFromEPSG(src)
targproj = osr.SpatialReference()
if isinstance(targ, str):
ta... | 1,364 | 0 | 116 |
b6e4e3028a5fc99b70a4292e1c382b359d9f11a6 | 30 | py | Python | example_pkg/__init__.py | IoC-Sunderland/Example-Package-Structure | 3664c780a52d73ac93cb6bab83c1506c0a9c08c9 | [
"MIT"
] | null | null | null | example_pkg/__init__.py | IoC-Sunderland/Example-Package-Structure | 3664c780a52d73ac93cb6bab83c1506c0a9c08c9 | [
"MIT"
] | null | null | null | example_pkg/__init__.py | IoC-Sunderland/Example-Package-Structure | 3664c780a52d73ac93cb6bab83c1506c0a9c08c9 | [
"MIT"
] | null | null | null | from .example import my_func
| 15 | 29 | 0.8 | from .example import my_func
| 0 | 0 | 0 |
7da0f36bf0c0b92c2f4f845c1893cc78ea890b2b | 591 | py | Python | PythonClient/reinforcement_learning/airgym/envs/xbox/xboxtest.py | zewuzheng17/Carintercept | 58a18ac84631fa03ec245dcdefdcc0ead6f84d67 | [
"MIT"
] | null | null | null | PythonClient/reinforcement_learning/airgym/envs/xbox/xboxtest.py | zewuzheng17/Carintercept | 58a18ac84631fa03ec245dcdefdcc0ead6f84d67 | [
"MIT"
] | null | null | null | PythonClient/reinforcement_learning/airgym/envs/xbox/xboxtest.py | zewuzheng17/Carintercept | 58a18ac84631fa03ec245dcdefdcc0ead6f84d67 | [
"MIT"
] | 1 | 2022-03-22T06:16:25.000Z | 2022-03-22T06:16:25.000Z | import time
from Xboxcmd import *
import pygame
pygame.init()
pygame.joystick.init()
#查看现在有几个遥控器
joycount = pygame.joystick.get_count()
print("joycount:"+str(joycount))
#连接第一个控制器
joystick = pygame.joystick.Joystick(0)
while True:
#接收事件
pygame.event.get()
axis = get_axis(joystick=joystick)
button = ... | 18.46875 | 42 | 0.690355 | import time
from Xboxcmd import *
import pygame
pygame.init()
pygame.joystick.init()
#查看现在有几个遥控器
joycount = pygame.joystick.get_count()
print("joycount:"+str(joycount))
#连接第一个控制器
joystick = pygame.joystick.Joystick(0)
while True:
#接收事件
pygame.event.get()
axis = get_axis(joystick=joystick)
button = ... | 0 | 0 | 0 |
a33569915e92987b4fd6add1ae4a92db8c9fd19a | 3,836 | py | Python | fourth.py | yk7333/DIP | 7e8df6631d89a6bce61e45d5f9ddc671ed050732 | [
"MIT"
] | 1 | 2021-06-02T13:28:39.000Z | 2021-06-02T13:28:39.000Z | fourth.py | yk7333/DIP | 7e8df6631d89a6bce61e45d5f9ddc671ed050732 | [
"MIT"
] | null | null | null | fourth.py | yk7333/DIP | 7e8df6631d89a6bce61e45d5f9ddc671ed050732 | [
"MIT"
] | 2 | 2021-03-28T11:15:19.000Z | 2021-11-08T12:22:17.000Z | '''
@author:yk7333
last modified:2021-4-7
language:python
'''
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
import os
if __name__ == "__main__":
os.chdir("C:\\Users\\m\\Desktop\\第四次作业")
for i in range(3,8,2): #3,5,7
img=read("test2.tif") ... | 33.068966 | 103 | 0.585506 | '''
@author:yk7333
last modified:2021-4-7
language:python
'''
import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
import os
def show(img,name="img"):
cv.imshow(name,img)
cv.waitKey(0)
cv.destroyAllWindows()
def read(path):
return cv.imread(path,0)
def save(name,src):
ret... | 1,918 | 0 | 219 |
0f7190955ffa54728d61c5c858685f6df3393455 | 339 | py | Python | gists/forma_incorreta.py | cassioeskelsen/precisamos-falar-de-di-ioc-python | b7a08f887d4a6c56e8e2465087dc33687e837f34 | [
"MIT"
] | 2 | 2022-02-03T15:49:09.000Z | 2022-03-10T01:20:07.000Z | gists/forma_incorreta.py | cassioeskelsen/precisamos-falar-de-di-ioc-python | b7a08f887d4a6c56e8e2465087dc33687e837f34 | [
"MIT"
] | null | null | null | gists/forma_incorreta.py | cassioeskelsen/precisamos-falar-de-di-ioc-python | b7a08f887d4a6c56e8e2465087dc33687e837f34 | [
"MIT"
] | null | null | null | from pymongo import MongoClient
if __name__ == '__main__':
print(CustomerRepository().get_customers())
| 24.214286 | 65 | 0.666667 | from pymongo import MongoClient
class CustomerRepository:
def get_customers(self):
mongo_client = MongoClient('mongodb://localhost:27017/')
collection = mongo_client['erp']["customer"]
return list(collection.find({}))
if __name__ == '__main__':
print(CustomerRepository()... | 165 | 4 | 54 |
41e59c4093b29b325db70120ed587aceb09b82c7 | 2,219 | py | Python | main.py | RememberTheAir/tg-github-updates | bad529415f4f2de2748f6c8ea5af5b81ab261a6c | [
"MIT"
] | 4 | 2020-03-02T10:13:27.000Z | 2020-11-11T18:24:19.000Z | main.py | RememberTheAir/tg-github-updates | bad529415f4f2de2748f6c8ea5af5b81ab261a6c | [
"MIT"
] | 3 | 2020-03-26T09:52:38.000Z | 2021-05-17T06:14:50.000Z | main.py | RememberTheAir/tg-github-updates | bad529415f4f2de2748f6c8ea5af5b81ab261a6c | [
"MIT"
] | 3 | 2020-05-17T02:25:14.000Z | 2020-09-30T15:46:47.000Z | import os
import json
import logging
import logging.config
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import Filters
from config import config
from jobs import JOBS_CALLBACKS
import utils as u
logger = logging.getLogger(__name__)
load_logging_config()... | 29.586667 | 132 | 0.703921 | import os
import json
import logging
import logging.config
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import Filters
from config import config
from jobs import JOBS_CALLBACKS
import utils as u
def load_logging_config(config_file_path='logging.json'):
... | 1,675 | 0 | 119 |
d4c3e9e40cb29b97068cc11b38b7b15678c17a95 | 10,056 | py | Python | scripts/checker.py | drycc/stacks | 11612170603d108451a58254c9ab0064a827c636 | [
"Apache-2.0"
] | null | null | null | scripts/checker.py | drycc/stacks | 11612170603d108451a58254c9ab0064a827c636 | [
"Apache-2.0"
] | 48 | 2022-03-02T02:14:35.000Z | 2022-03-30T00:07:47.000Z | scripts/checker.py | drycc/stacks | 11612170603d108451a58254c9ab0064a827c636 | [
"Apache-2.0"
] | 2 | 2022-02-14T06:25:55.000Z | 2022-02-16T05:38:57.000Z | import os
import re
import json
import requests
from datetime import datetime
github_headers = {'Authorization': 'token %s' % os.environ.get("GITHUB_TOKEN")}
repo_info_table = {
"vouch-proxy": {
"name": "vouch-proxy",
"type": "github",
"owner": "vouch",
"match": "^v[0-9]{1,}\.[0-9]... | 28.731429 | 99 | 0.423528 | import os
import re
import json
import requests
from datetime import datetime
github_headers = {'Authorization': 'token %s' % os.environ.get("GITHUB_TOKEN")}
repo_info_table = {
"vouch-proxy": {
"name": "vouch-proxy",
"type": "github",
"owner": "vouch",
"match": "^v[0-9]{1,}\.[0-9]... | 3,325 | 0 | 92 |
2ef6a7ce8c173936acfa269bb9cf748f58336568 | 106 | py | Python | utils/__init__.py | rshube/music-vae | 56b9ffdf759aa7d97ce7cf35dee54fd35d6cfc65 | [
"MIT"
] | null | null | null | utils/__init__.py | rshube/music-vae | 56b9ffdf759aa7d97ce7cf35dee54fd35d6cfc65 | [
"MIT"
] | null | null | null | utils/__init__.py | rshube/music-vae | 56b9ffdf759aa7d97ce7cf35dee54fd35d6cfc65 | [
"MIT"
] | null | null | null | from .args import ArgsWrapper
from .dataset import Dataset
from .consts import DATA_PATH, TRAINING_DATASET | 35.333333 | 47 | 0.849057 | from .args import ArgsWrapper
from .dataset import Dataset
from .consts import DATA_PATH, TRAINING_DATASET | 0 | 0 | 0 |
ed5fa4746cd554bdb85545c30a4da0fac95423f4 | 440 | py | Python | Tests/test.py | jkruse27/Foxhound | 08a746a5335c2b71aad2fb08c86d1795ac24d476 | [
"MIT"
] | null | null | null | Tests/test.py | jkruse27/Foxhound | 08a746a5335c2b71aad2fb08c86d1795ac24d476 | [
"MIT"
] | null | null | null | Tests/test.py | jkruse27/Foxhound | 08a746a5335c2b71aad2fb08c86d1795ac24d476 | [
"MIT"
] | null | null | null | from Dataset import *
from datetime import *
import time
dataset = Dataset('TestData/Dados.csv')
begin_date = datetime.strptime('2021-08-2 12:00',"%Y-%m-%d %H:%M")
end_date = datetime.strptime('2021-08-7 12:00',"%Y-%m-%d %H:%M")
main_var = 'TU-11C:SS-HLS-Ax48NW5:Level-Mon'
start = time.time()
delays, corrs, names = ... | 24.444444 | 77 | 0.7 | from Dataset import *
from datetime import *
import time
dataset = Dataset('TestData/Dados.csv')
begin_date = datetime.strptime('2021-08-2 12:00',"%Y-%m-%d %H:%M")
end_date = datetime.strptime('2021-08-7 12:00',"%Y-%m-%d %H:%M")
main_var = 'TU-11C:SS-HLS-Ax48NW5:Level-Mon'
start = time.time()
delays, corrs, names = ... | 0 | 0 | 0 |
99049aa52546cdb02a79df162cd3e4c306b133ba | 315 | py | Python | textX-LS/core/tests/test_utils.py | goto40/textX-LS | a6b357186f7adaf7c30aed4d543ae8d149c80a25 | [
"MIT"
] | null | null | null | textX-LS/core/tests/test_utils.py | goto40/textX-LS | a6b357186f7adaf7c30aed4d543ae8d149c80a25 | [
"MIT"
] | null | null | null | textX-LS/core/tests/test_utils.py | goto40/textX-LS | a6b357186f7adaf7c30aed4d543ae8d149c80a25 | [
"MIT"
] | null | null | null | import pytest
from textx_ls_core import utils
@pytest.mark.parametrize("uri, expected_ext", [
(None, ''),
('', ''),
('/test/path/file.txt', 'txt'),
('Textxfile', 'Textxfile')
])
| 22.5 | 47 | 0.657143 | import pytest
from textx_ls_core import utils
@pytest.mark.parametrize("uri, expected_ext", [
(None, ''),
('', ''),
('/test/path/file.txt', 'txt'),
('Textxfile', 'Textxfile')
])
def test_get_file_extension(uri, expected_ext):
ext = utils.get_file_extension(uri)
assert ext == expected_ext
| 97 | 0 | 22 |
b75127cedc1c587e657854e2855292dbcfd3ea83 | 387 | py | Python | setup.py | isears/openmrsapi | 50e5329b1ecc74f8e4d94f71e4b0e0207ac705d6 | [
"MIT"
] | 1 | 2018-10-28T10:14:22.000Z | 2018-10-28T10:14:22.000Z | setup.py | isears/openmrsapi | 50e5329b1ecc74f8e4d94f71e4b0e0207ac705d6 | [
"MIT"
] | null | null | null | setup.py | isears/openmrsapi | 50e5329b1ecc74f8e4d94f71e4b0e0207ac705d6 | [
"MIT"
] | null | null | null |
from setuptools import setup
setup(
name='openmrsapi',
version='0.1',
description='a library for interacting with openmrs api in python',
url='https://github.com/isears/openmrsapi',
author='Isaac Sears',
author_email='isaac.j.sears@gmail.com',
license='MIT',
packages=['openmrsapi'],
... | 22.764706 | 71 | 0.653747 |
from setuptools import setup
setup(
name='openmrsapi',
version='0.1',
description='a library for interacting with openmrs api in python',
url='https://github.com/isears/openmrsapi',
author='Isaac Sears',
author_email='isaac.j.sears@gmail.com',
license='MIT',
packages=['openmrsapi'],
... | 0 | 0 | 0 |
4e019d4a52876ce74dbd2768087cd44e8e77eb8b | 101 | py | Python | run.py | SPK-RPI/FlaskBlog | 45c816a3720988e151b59dd5fbe5abab71e25fcc | [
"MIT"
] | null | null | null | run.py | SPK-RPI/FlaskBlog | 45c816a3720988e151b59dd5fbe5abab71e25fcc | [
"MIT"
] | null | null | null | run.py | SPK-RPI/FlaskBlog | 45c816a3720988e151b59dd5fbe5abab71e25fcc | [
"MIT"
] | null | null | null | from blogposts import app
if __name__ == '__main__':
app.run(host='192.168.43.57',debug=True)
| 25.25 | 45 | 0.683168 | from blogposts import app
if __name__ == '__main__':
app.run(host='192.168.43.57',debug=True)
| 0 | 0 | 0 |
e6d23aba45b82cb0b235f7c6849de37983d83785 | 6,277 | py | Python | workers.py | Recursing/MySubredditsBot | 5ca0f7cf9c210acc82009001cfb9915a2b62a95f | [
"MIT"
] | 6 | 2020-05-26T10:02:28.000Z | 2021-12-07T18:11:51.000Z | workers.py | Recursing/MySubredditsBot | 5ca0f7cf9c210acc82009001cfb9915a2b62a95f | [
"MIT"
] | 3 | 2022-01-11T10:10:53.000Z | 2022-01-23T10:50:01.000Z | workers.py | Recursing/MySubredditsBot | 5ca0f7cf9c210acc82009001cfb9915a2b62a95f | [
"MIT"
] | null | null | null | import asyncio
import logging
import random
import time
from datetime import datetime
from typing import Any, Dict, Optional, Tuple
import reddit_adapter
import subscriptions_manager
import telegram_adapter
workers: Dict[Tuple[int, str], asyncio.Task[Any]] = {}
async def check_exceptions(refresh_period: int =... | 38.27439 | 93 | 0.641071 | import asyncio
import logging
import random
import time
from datetime import datetime
from typing import Any, Dict, Optional, Tuple
import reddit_adapter
import subscriptions_manager
import telegram_adapter
async def send_subscription_update(subreddit: str, chat_id: int, per_month: int):
# Send top unsent post f... | 4,698 | 0 | 138 |
c6b3d328f2d98b34f2cdd6bd4d215c9101ed10e3 | 7,039 | py | Python | instruments/triggering.py | gronchi/mpts | 5e33e885b099a337c0cadc78840dd2c216a6d9df | [
"MIT"
] | null | null | null | instruments/triggering.py | gronchi/mpts | 5e33e885b099a337c0cadc78840dd2c216a6d9df | [
"MIT"
] | null | null | null | instruments/triggering.py | gronchi/mpts | 5e33e885b099a337c0cadc78840dd2c216a6d9df | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implementation of the Trigger Unit communication."""
import logging
import re
import socket
_log = logging.getLogger(__name__)
physical_names = {
'A2_Delay': r'Simmer_delay(1uS)',
'A4_Delay': r'Burst_delay(1uS)',
'A4_Number': r'Burst_number',
'A4_Perio... | 35.913265 | 123 | 0.594687 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implementation of the Trigger Unit communication."""
import logging
import re
import socket
_log = logging.getLogger(__name__)
physical_names = {
'A2_Delay': r'Simmer_delay(1uS)',
'A4_Delay': r'Burst_delay(1uS)',
'A4_Number': r'Burst_number',
'A4_Perio... | 1,834 | 3,236 | 23 |
51d3878e39cd1b290a0eaeb08e3f64757d4ea419 | 108 | py | Python | .config/autokey/data/chromium/text-editing/c-e-move-end-of-line.py | tonyaldon/uconfig | e2966389dc4bdaf10ef86f1625faf1b2caf687c6 | [
"MIT"
] | 1 | 2021-01-14T19:10:38.000Z | 2021-01-14T19:10:38.000Z | .config/autokey/data/chromium/text-editing/c-e-move-end-of-line.py | tonyaldon/uconfig | e2966389dc4bdaf10ef86f1625faf1b2caf687c6 | [
"MIT"
] | null | null | null | .config/autokey/data/chromium/text-editing/c-e-move-end-of-line.py | tonyaldon/uconfig | e2966389dc4bdaf10ef86f1625faf1b2caf687c6 | [
"MIT"
] | 1 | 2021-01-14T19:10:40.000Z | 2021-01-14T19:10:40.000Z | store.set_global_value('hotkey', '<ctrl>+e')
engine.set_return_value('<end>')
engine.run_script('chromium')
| 27 | 44 | 0.75 | store.set_global_value('hotkey', '<ctrl>+e')
engine.set_return_value('<end>')
engine.run_script('chromium')
| 0 | 0 | 0 |
87ce95ba10a9e75ca88b201d1ff1e27dd415d9db | 30,083 | py | Python | latticegraph_designer/test/test_designer.py | luchko/latticegraph_designer | 7fd25a5bdc0fce070cd1328c5d6f7113b6ec91e2 | [
"MIT"
] | 24 | 2017-04-23T14:15:59.000Z | 2021-05-12T04:33:47.000Z | latticegraph_designer/test/test_designer.py | luchko/latticegraph_designer | 7fd25a5bdc0fce070cd1328c5d6f7113b6ec91e2 | [
"MIT"
] | null | null | null | latticegraph_designer/test/test_designer.py | luchko/latticegraph_designer | 7fd25a5bdc0fce070cd1328c5d6f7113b6ec91e2 | [
"MIT"
] | 8 | 2017-08-02T12:55:28.000Z | 2021-10-10T14:54:38.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Very weak testing of the basic functionality using unittest and QTest"""
from __future__ import division
__author__ = "Ivan Luchko (luchko.ivan@gmail.com)"
__version__ = "1.0a1"
__date__ = "Apr 4, 2017"
__copyright__ = "Copyright (c) 2017, Ivan Luchko and Project Cont... | 40.164219 | 90 | 0.630123 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Very weak testing of the basic functionality using unittest and QTest"""
from __future__ import division
__author__ = "Ivan Luchko (luchko.ivan@gmail.com)"
__version__ = "1.0a1"
__date__ = "Apr 4, 2017"
__copyright__ = "Copyright (c) 2017, Ivan Luchko and Project Cont... | 24,378 | 0 | 779 |
0e652ecfaead0fd3fcc5bf2bc1ba76e23ca4705a | 92 | py | Python | config_gen/admin.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 5 | 2016-10-31T17:46:17.000Z | 2022-02-02T00:40:49.000Z | config_gen/admin.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 33 | 2018-05-09T06:07:50.000Z | 2021-09-22T17:39:56.000Z | config_gen/admin.py | lkmhaqer/gtools-python | cff6d80525b78a4fadfb686566489fbe1687d889 | [
"MIT"
] | 1 | 2020-05-14T21:44:25.000Z | 2020-05-14T21:44:25.000Z | # file: config_gen/admin.py
from django.contrib import admin
# Register your models here.
| 15.333333 | 32 | 0.771739 | # file: config_gen/admin.py
from django.contrib import admin
# Register your models here.
| 0 | 0 | 0 |
f6645b849fb773b521114eed6a43f40cbba427a2 | 8,363 | py | Python | tests/integration/schema_registry/test_json_serializers.py | woodlee/confluent-kafka-python | c8a05dbd73e06ea310de7f28267fd4714f90ef8c | [
"Apache-2.0"
] | 1 | 2020-04-22T13:10:31.000Z | 2020-04-22T13:10:31.000Z | tests/integration/schema_registry/test_json_serializers.py | woodlee/confluent-kafka-python | c8a05dbd73e06ea310de7f28267fd4714f90ef8c | [
"Apache-2.0"
] | null | null | null | tests/integration/schema_registry/test_json_serializers.py | woodlee/confluent-kafka-python | c8a05dbd73e06ea310de7f28267fd4714f90ef8c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 32.667969 | 79 | 0.64044 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020 Confluent Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 235 | 6 | 49 |
2207e7f8080442f83f42de7f49c9eb73c34f4d8c | 2,041 | py | Python | pyexcel_io/utils.py | kit-cat/pyexcel-io | ec62f384ef814d51d95bf2fb15b8a9b239249691 | [
"BSD-3-Clause"
] | null | null | null | pyexcel_io/utils.py | kit-cat/pyexcel-io | ec62f384ef814d51d95bf2fb15b8a9b239249691 | [
"BSD-3-Clause"
] | null | null | null | pyexcel_io/utils.py | kit-cat/pyexcel-io | ec62f384ef814d51d95bf2fb15b8a9b239249691 | [
"BSD-3-Clause"
] | null | null | null | """
pyexcel_io.utils
~~~~~~~~~~~~~~~~~~~
utility functions
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
import pyexcel_io.constants as constants
XLS_PLUGIN = "pyexcel-xls"
XLSX_PLUGIN = "pyexcel-xlsx"
ODS_PLUGIN = "pyexcel-ods"
ODS3_P... | 27.958904 | 65 | 0.687898 | """
pyexcel_io.utils
~~~~~~~~~~~~~~~~~~~
utility functions
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
import pyexcel_io.constants as constants
XLS_PLUGIN = "pyexcel-xls"
XLSX_PLUGIN = "pyexcel-xlsx"
ODS_PLUGIN = "pyexcel-ods"
ODS3_P... | 306 | 0 | 23 |
6b829467b894c5cb437c1071179fbb9d72d5b88b | 11,431 | py | Python | test_cube_solution.py | noreallyimfine/Rubiks-Cube | 5d6bdffb2f1554453de94e5ea3efd2fc5db75a8a | [
"MIT"
] | 1 | 2020-07-08T14:14:26.000Z | 2020-07-08T14:14:26.000Z | test_cube_solution.py | noreallyimfine/Rubiks-Cube | 5d6bdffb2f1554453de94e5ea3efd2fc5db75a8a | [
"MIT"
] | null | null | null | test_cube_solution.py | noreallyimfine/Rubiks-Cube | 5d6bdffb2f1554453de94e5ea3efd2fc5db75a8a | [
"MIT"
] | null | null | null | import unittest
from cube import RubiksCube
# rename that class
# test solution funcs <- make sure the tests arent interfering with each other
# def test_bottom_layer_robustness(self, n=50):
# for _ in range(n):
# self.cube.initialize_cube()
# self.test_bottom_layer()
# ... | 47.235537 | 107 | 0.682442 | import unittest
from cube import RubiksCube
# rename that class
class CubeSolutionTests(unittest.TestCase):
def setUp(self):
self.cube = RubiksCube()
# test solution funcs <- make sure the tests arent interfering with each other
def bottom_face_tester(self):
self.assertTrue(all(self.cube.bot... | 9,959 | 22 | 400 |
6c005a2859950869af5dc5c3f85c80d99083f121 | 1,824 | py | Python | chap6/mysequence.py | marble-git/python-laoqi | 74c4bb5459113e54ce64443e5da5a9c6a3052d6a | [
"MIT"
] | null | null | null | chap6/mysequence.py | marble-git/python-laoqi | 74c4bb5459113e54ce64443e5da5a9c6a3052d6a | [
"MIT"
] | null | null | null | chap6/mysequence.py | marble-git/python-laoqi | 74c4bb5459113e54ce64443e5da5a9c6a3052d6a | [
"MIT"
] | null | null | null | #coding:utf-8
'''
filename:mysequence.py
chap:6
subject:20
conditions:inherit collections.abc.Sequence
新容器内的对象必须按照一定顺序排列
solution:class MySequence
'''
import collections
import numbers
class MySequence(collections.abc.Sequence):
'''必要方法 __getitem__,__len__'''
@staticmeth... | 25.690141 | 88 | 0.514803 | #coding:utf-8
'''
filename:mysequence.py
chap:6
subject:20
conditions:inherit collections.abc.Sequence
新容器内的对象必须按照一定顺序排列
solution:class MySequence
'''
import collections
import numbers
class MySequence(collections.abc.Sequence):
'''必要方法 __getitem__,__len__'''
def __init__(... | 165 | 0 | 105 |
dd363973ab415042f38d53ecd6eb3ea142076116 | 1,924 | py | Python | src/syncro/__main__.py | cav71/syncro | 2591dd1bd14b7b4bf2a8b2f0099c1d5140679d10 | [
"MIT"
] | null | null | null | src/syncro/__main__.py | cav71/syncro | 2591dd1bd14b7b4bf2a8b2f0099c1d5140679d10 | [
"MIT"
] | null | null | null | src/syncro/__main__.py | cav71/syncro | 2591dd1bd14b7b4bf2a8b2f0099c1d5140679d10 | [
"MIT"
] | null | null | null | """starts a sync remote server
"""
import os
import getpass
import pathlib
import logging
import click
from . import cli
import paramiko
import paramiko.sftp_client
import syncro.support as support
import syncro.cli as cli
logger = logging.getLogger(__name__)
@click.command()
@click.argument("host")
@click.op... | 22.904762 | 74 | 0.680873 | """starts a sync remote server
"""
import os
import getpass
import pathlib
import logging
import click
from . import cli
import paramiko
import paramiko.sftp_client
import syncro.support as support
import syncro.cli as cli
logger = logging.getLogger(__name__)
def add_arguments(parser):
parser.add_argument("h... | 674 | 0 | 69 |
487ca8a68ee1d0de5cfebc5f311c950769200bd2 | 2,777 | py | Python | maths/3n_plus_1.py | zhaiyu-cn/Python | 30de2de32983524cbdacdc4b8949f381ca2ca347 | [
"MIT"
] | null | null | null | maths/3n_plus_1.py | zhaiyu-cn/Python | 30de2de32983524cbdacdc4b8949f381ca2ca347 | [
"MIT"
] | null | null | null | maths/3n_plus_1.py | zhaiyu-cn/Python | 30de2de32983524cbdacdc4b8949f381ca2ca347 | [
"MIT"
] | null | null | null | from typing import List, Tuple
#fenzhi1xiugai
def n31(a: int) -> Tuple[List[int], int]:
"""
Returns the Collatz sequence and its length of any positive integer.
>>> n31(4)
([4, 2, 1], 3)
"""
if not isinstance(a, int):
raise TypeError("Must be int, not {}".format(type(a).__name__))
... | 18.513333 | 83 | 0.28556 | from typing import List, Tuple
#fenzhi1xiugai
def n31(a: int) -> Tuple[List[int], int]:
"""
Returns the Collatz sequence and its length of any positive integer.
>>> n31(4)
([4, 2, 1], 3)
"""
if not isinstance(a, int):
raise TypeError("Must be int, not {}".format(type(a).__name__))
... | 0 | 0 | 0 |
59c21007badf4ffd4068a898ea5b167e3df042ed | 1,949 | py | Python | trees/preprocessing.py | tejasvaidhyadev/PCFG_rules | 3138bb2aa7ea098478b4b318b6b1b1872ec6ecfb | [
"MIT"
] | 1 | 2021-04-18T16:35:47.000Z | 2021-04-18T16:35:47.000Z | trees/preprocessing.py | tejasvaidhyadev/PCFG_rules | 3138bb2aa7ea098478b4b318b6b1b1872ec6ecfb | [
"MIT"
] | null | null | null | trees/preprocessing.py | tejasvaidhyadev/PCFG_rules | 3138bb2aa7ea098478b4b318b6b1b1872ec6ecfb | [
"MIT"
] | null | null | null | from nltk import Tree
import nltk
import argparse
import pandas as pandas
import pandas as pd
parser = argparse.ArgumentParser()
parser.add_argument('--infile', default='./ptb-collins.merge.txt', help="preprocessing tree")
#parser.add_argument('--seed', type=int, default=2004, help="random seed for initialization... | 33.033898 | 107 | 0.554643 | from nltk import Tree
import nltk
import argparse
import pandas as pandas
import pandas as pd
def get_brac_ind(word):
for i, brac in enumerate(word):
if brac ==')':
return(i)
def rmsym(sym, tokens):
if sym in tokens:
if ')'in tokens:
index_barc = get_brac_ind(tokens.sp... | 408 | 0 | 45 |
c568f9e20ad8595c2d19bead8e9a491e14ea46ac | 6,792 | py | Python | fedjax/aggregators/walsh_hadamard.py | dedsec-9/fedjax | 1f577ab4d9aa494d2a73ed541efbb92eab350551 | [
"Apache-2.0"
] | null | null | null | fedjax/aggregators/walsh_hadamard.py | dedsec-9/fedjax | 1f577ab4d9aa494d2a73ed541efbb92eab350551 | [
"Apache-2.0"
] | null | null | null | fedjax/aggregators/walsh_hadamard.py | dedsec-9/fedjax | 1f577ab4d9aa494d2a73ed541efbb92eab350551 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 33.294118 | 80 | 0.687574 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 0 | 0 |
4638dc42bbd3edbdee5a59f874300563a19d6c35 | 939 | py | Python | sweeper/tests/test_scheduler.py | dominoFire/sweeper | 26c5497b81c8d0c50671f8ab75c1cf5c4c8191c9 | [
"MIT"
] | null | null | null | sweeper/tests/test_scheduler.py | dominoFire/sweeper | 26c5497b81c8d0c50671f8ab75c1cf5c4c8191c9 | [
"MIT"
] | null | null | null | sweeper/tests/test_scheduler.py | dominoFire/sweeper | 26c5497b81c8d0c50671f8ab75c1cf5c4c8191c9 | [
"MIT"
] | null | null | null | import sweeper.utils as utils
import unittest
from pprint import PrettyPrinter
from scheduler.manager import create_schedule_plan
from sweeper import Workflow
pp = PrettyPrinter(indent=1)
if __name__ == '__main__':
unittest.main()
| 33.535714 | 96 | 0.759318 | import sweeper.utils as utils
import unittest
from pprint import PrettyPrinter
from scheduler.manager import create_schedule_plan
from sweeper import Workflow
pp = PrettyPrinter(indent=1)
class SchedulerTest(unittest.TestCase):
def test(self):
wf = Workflow.read_workflow('examples/weird/workflow.yaml')
... | 632 | 18 | 49 |
3602939acb4e7b232af47d615a2aed96778a8add | 167 | py | Python | REST API - Tensorflow/config/config.py | mauryas/DataScienceTasks | 78cd4c47067101128de668a641b999d6fb406ab8 | [
"MIT"
] | null | null | null | REST API - Tensorflow/config/config.py | mauryas/DataScienceTasks | 78cd4c47067101128de668a641b999d6fb406ab8 | [
"MIT"
] | null | null | null | REST API - Tensorflow/config/config.py | mauryas/DataScienceTasks | 78cd4c47067101128de668a641b999d6fb406ab8 | [
"MIT"
] | null | null | null | BATCH_SIZE = 128
NUM_CLASSES = 10
EPOCHS = 20
# input image dimensions
IMG_ROWS, IMG_COLS = 28, 28
# set if false if you want to use trained weights
TO_TRAIN = True
| 16.7 | 49 | 0.742515 | BATCH_SIZE = 128
NUM_CLASSES = 10
EPOCHS = 20
# input image dimensions
IMG_ROWS, IMG_COLS = 28, 28
# set if false if you want to use trained weights
TO_TRAIN = True
| 0 | 0 | 0 |
047a54b42de14b71ab0ea40349265e16014ece76 | 1,782 | py | Python | exam/test_mcmc.py | odell/pyazr | 3ea6a1f28b034fb56527b1d5f33b544ea3e53893 | [
"MIT"
] | null | null | null | exam/test_mcmc.py | odell/pyazr | 3ea6a1f28b034fb56527b1d5f33b544ea3e53893 | [
"MIT"
] | null | null | null | exam/test_mcmc.py | odell/pyazr | 3ea6a1f28b034fb56527b1d5f33b544ea3e53893 | [
"MIT"
] | null | null | null | '''
Calculates the 13C(a,n) cross section
"Free" parameters:
* partial width BGP (1/2+, neutron)
* level energy (3/2+)
* partial width (3/2+, neutron)
* partial width (3/2+, alpha)
'''
import os
import sys
from multiprocessing import Pool
import emcee
import numpy as np
from s... | 33.622642 | 84 | 0.665544 | '''
Calculates the 13C(a,n) cross section
"Free" parameters:
* partial width BGP (1/2+, neutron)
* level energy (3/2+)
* partial width (3/2+, neutron)
* partial width (3/2+, alpha)
'''
import os
import sys
from multiprocessing import Pool
import emcee
import numpy as np
from s... | 0 | 0 | 0 |
40a3cc3ff516f442d1318816c63a4b6b1747419f | 886 | py | Python | tests/acceptance/test_FuzzerHeaders.py | AntonKuzminRussia/web-scout | 5b8fed2c5917c9ecc210052703a65f1204f4b347 | [
"MIT"
] | 6 | 2017-10-11T18:56:05.000Z | 2019-09-29T21:45:05.000Z | tests/acceptance/test_FuzzerHeaders.py | AntonKuzminRussia/web-scout | 5b8fed2c5917c9ecc210052703a65f1204f4b347 | [
"MIT"
] | 3 | 2021-03-31T19:17:30.000Z | 2021-12-13T20:16:23.000Z | tests/acceptance/test_FuzzerHeaders.py | AntonKuzminRussia/web-scout | 5b8fed2c5917c9ecc210052703a65f1204f4b347 | [
"MIT"
] | null | null | null | import subprocess
import os
import time
import re
runPath = os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + '/../../')
| 27.6875 | 82 | 0.602709 | import subprocess
import os
import time
import re
runPath = os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + '/../../')
class Test_FuzzerHeaders(object):
dict_path = '/tmp/wstest.dict'
headers_file_path = '/tmp/wstest.headers_file'
conf_file_path = "/tmp/wstest.conf_file"
def get_result... | 531 | 197 | 23 |
938061deb839871bf82a14d5f17af8030ecc81be | 1,070 | py | Python | benchmarks/test_memory.py | TheRakeshPurohit/wasmer-python | 2375974d9dc50a2caf29fdd9e07d49fd94537e03 | [
"MIT"
] | 900 | 2019-04-11T01:52:10.000Z | 2020-09-02T11:09:14.000Z | benchmarks/test_memory.py | TheRakeshPurohit/wasmer-python | 2375974d9dc50a2caf29fdd9e07d49fd94537e03 | [
"MIT"
] | 172 | 2019-04-15T18:04:55.000Z | 2020-09-01T15:20:06.000Z | benchmarks/test_memory.py | TheRakeshPurohit/wasmer-python | 2375974d9dc50a2caf29fdd9e07d49fd94537e03 | [
"MIT"
] | 28 | 2019-04-11T02:49:04.000Z | 2020-08-27T09:47:49.000Z | from wasmer import engine, wat2wasm, Store, Module, Instance
from wasmer_compiler_cranelift import Compiler
TEST_BYTES = wat2wasm(
"""
(module
(memory 16)
(export "memory" (memory 0)))
"""
)
| 24.318182 | 60 | 0.686916 | from wasmer import engine, wat2wasm, Store, Module, Instance
from wasmer_compiler_cranelift import Compiler
TEST_BYTES = wat2wasm(
"""
(module
(memory 16)
(export "memory" (memory 0)))
"""
)
def test_benchmark_memory_view_int8_get(benchmark):
store = Store(engine.JIT(Compiler))
mod... | 781 | 0 | 69 |
cde51dd207e4af6daac2687ccc96ff083f646eea | 84 | py | Python | min_cost.py | shahjaidev/xbin_gemini_baselines | 9476ed3d3877f911368b9156ca1d8801a5fc7307 | [
"BSD-3-Clause"
] | null | null | null | min_cost.py | shahjaidev/xbin_gemini_baselines | 9476ed3d3877f911368b9156ca1d8801a5fc7307 | [
"BSD-3-Clause"
] | 4 | 2020-09-25T22:40:36.000Z | 2022-02-09T23:38:58.000Z | min_cost.py | shahjaidev/xbin_gemini_baselines | 9476ed3d3877f911368b9156ca1d8801a5fc7307 | [
"BSD-3-Clause"
] | null | null | null |
A[p]= max( A[i]+ A[i:j]+ f(j,p) + f(i,p) ) +f(1,p)
for p in range(N):
| 7.636364 | 52 | 0.369048 |
A[p]= max( A[i]+ A[i:j]+ f(j,p) + f(i,p) ) +f(1,p)
for p in range(N):
| 0 | 0 | 0 |
54a1ba6b641654089ce1618dad8a300fe120c52f | 586 | py | Python | remove.py | bopde/Texter | 5a23a9b8c14a5abb12eac70fabe0e9c6d193ccba | [
"MIT"
] | null | null | null | remove.py | bopde/Texter | 5a23a9b8c14a5abb12eac70fabe0e9c6d193ccba | [
"MIT"
] | 1 | 2020-09-06T03:53:52.000Z | 2020-09-06T03:53:52.000Z | remove.py | bopde/Texter | 5a23a9b8c14a5abb12eac70fabe0e9c6d193ccba | [
"MIT"
] | 1 | 2020-09-06T03:51:44.000Z | 2020-09-06T03:51:44.000Z |
if __name__ == '__main__':
remove_lines()
print ("done")
| 25.478261 | 68 | 0.607509 |
def count_lines(file='no_line_script.txt'):
with open(file, 'r') as file:
for index, line in enumerate(file):
pass
file.close()
return index + 1
def remove_lines(original='mormon.txt', empty='no_line_script.txt'):
script = open(original, 'r')
empty_script = open(empty, 'w')
... | 473 | 0 | 46 |
7d096c77e2bec49b6480167c88cbec8fe681cdcf | 1,689 | py | Python | mushroom_rl/utils/pybullet/joints_helper.py | PuzeLiu/mushroom-rl | 99942b425e66b4ddcc26009d7105dde23841e95d | [
"MIT"
] | 344 | 2020-01-10T09:45:02.000Z | 2022-03-30T09:48:28.000Z | mushroom_rl/utils/pybullet/joints_helper.py | PuzeLiu/mushroom-rl | 99942b425e66b4ddcc26009d7105dde23841e95d | [
"MIT"
] | 44 | 2020-01-23T03:00:56.000Z | 2022-03-25T17:14:22.000Z | mushroom_rl/utils/pybullet/joints_helper.py | PuzeLiu/mushroom-rl | 99942b425e66b4ddcc26009d7105dde23841e95d | [
"MIT"
] | 93 | 2020-01-10T21:17:58.000Z | 2022-03-31T17:58:52.000Z | import numpy as np
from .observation import PyBulletObservationType
| 37.533333 | 69 | 0.680876 | import numpy as np
from .observation import PyBulletObservationType
class JointsHelper(object):
def __init__(self, client, indexer, observation_spec):
self._joint_pos_indexes = list()
self._joint_velocity_indexes = list()
joint_limits_low = list()
joint_limits_high = list()
... | 1,456 | 6 | 157 |
1cfba7204b23ca9912e9c8b564ad860ef2ead703 | 2,622 | py | Python | plenum/server/consensus/replica_service.py | Toktar/indy-plenum | 2f1f838332b0506f8dd8837ac341cba0cd3f7ff4 | [
"Apache-2.0"
] | null | null | null | plenum/server/consensus/replica_service.py | Toktar/indy-plenum | 2f1f838332b0506f8dd8837ac341cba0cd3f7ff4 | [
"Apache-2.0"
] | null | null | null | plenum/server/consensus/replica_service.py | Toktar/indy-plenum | 2f1f838332b0506f8dd8837ac341cba0cd3f7ff4 | [
"Apache-2.0"
] | null | null | null | from typing import List
from plenum.server.replica_freshness_checker import FreshnessChecker
from crypto.bls.bls_bft_replica import BlsBftReplica
from plenum.common.config_util import getConfig
from plenum.common.event_bus import InternalBus, ExternalBus
from plenum.common.messages.node_messages import Checkpoint
fro... | 52.44 | 102 | 0.670481 | from typing import List
from plenum.server.replica_freshness_checker import FreshnessChecker
from crypto.bls.bls_bft_replica import BlsBftReplica
from plenum.common.config_util import getConfig
from plenum.common.event_bus import InternalBus, ExternalBus
from plenum.common.messages.node_messages import Checkpoint
fro... | 1,544 | 0 | 27 |
75bd145742ea44d33d3e21c667730b8c00552cde | 126 | py | Python | verify/checker/agc050/d.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | 4 | 2020-09-23T07:11:41.000Z | 2022-02-02T09:08:21.000Z | verify/checker/agc050/d.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | 5 | 2021-08-29T18:23:01.000Z | 2021-11-20T03:53:19.000Z | verify/checker/agc050/d.py | naskya/testcase-generator | 02765184a275152e1d8c177f2028ca8db315cfee | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 15.75 | 36 | 0.492063 | def main() -> None:
N, K = map(int, input().split())
assert 1 <= K <= N <= 40
if __name__ == '__main__':
main()
| 64 | 0 | 22 |
08a9caf7d6dc3a83ef5b08f80bf1f2c48969b19c | 15,333 | py | Python | tmglow/utils/parallel.py | zabaras/deep-turbulence | 0daca5daada449d4ba16bce37b703e20b444b6bc | [
"MIT"
] | 20 | 2020-12-01T14:58:01.000Z | 2022-03-15T07:40:10.000Z | tmglow/utils/parallel.py | zabaras/deep-turbulence | 0daca5daada449d4ba16bce37b703e20b444b6bc | [
"MIT"
] | 2 | 2021-06-05T14:29:42.000Z | 2022-03-04T15:57:40.000Z | tmglow/utils/parallel.py | zabaras/deep-turbulence | 0daca5daada449d4ba16bce37b703e20b444b6bc | [
"MIT"
] | 4 | 2020-09-04T06:11:04.000Z | 2021-09-05T10:47:16.000Z | '''
Utilities for training TM-Glow in parallel as well as calculating
the loss in parallel on different GPUs for memory purposes.
Original Implementation by Zhang, Rutgers University
https://medium.com/huggingface/training-larger-batches-practical-tips-on-1-gpu-multi-gpu-distributed-setups-ec88c3e51255
=====
Distribut... | 42.239669 | 120 | 0.640579 | '''
Utilities for training TM-Glow in parallel as well as calculating
the loss in parallel on different GPUs for memory purposes.
Original Implementation by Zhang, Rutgers University
https://medium.com/huggingface/training-larger-batches-practical-tips-on-1-gpu-multi-gpu-distributed-setups-ec88c3e51255
=====
Distribut... | 8,347 | 203 | 337 |
f16f4e21ca23bc2e9efafc489ea9440792f4eb81 | 692 | py | Python | scripts/b2/attack.py | wwu-pdx/web-ctf | 82774af40f613e99568d44cd83ea564e4ee68711 | [
"MIT"
] | null | null | null | scripts/b2/attack.py | wwu-pdx/web-ctf | 82774af40f613e99568d44cd83ea564e4ee68711 | [
"MIT"
] | null | null | null | scripts/b2/attack.py | wwu-pdx/web-ctf | 82774af40f613e99568d44cd83ea564e4ee68711 | [
"MIT"
] | null | null | null | import requests
#possible creds generated by level
#one of them is valid for one of your web app
from credentials import creds
#url='http://YOUR_INTERNAL_IP/login'
urls=['http://10.138.0.58/login', 'http://10.138.0.59/login','http://10.138.0.60/login']
for url in urls:
for u in creds:
#prepare data for post... | 27.68 | 88 | 0.683526 | import requests
#possible creds generated by level
#one of them is valid for one of your web app
from credentials import creds
#url='http://YOUR_INTERNAL_IP/login'
urls=['http://10.138.0.58/login', 'http://10.138.0.59/login','http://10.138.0.60/login']
for url in urls:
for u in creds:
#prepare data for post... | 0 | 0 | 0 |
24ce65a8b75a7d0851bf08b90abe4613dff6d004 | 508 | py | Python | Diena_8_dictionaries/d8_s28_u1.py | MarisKuz/Python-RTU | 12261d06dc81fa0d98190ca0eb5133d43d517070 | [
"MIT"
] | 8 | 2020-08-31T16:10:54.000Z | 2021-11-24T06:37:37.000Z | Diena_8_dictionaries/d8_s28_u1.py | MarisKuz/Python-RTU | 12261d06dc81fa0d98190ca0eb5133d43d517070 | [
"MIT"
] | 8 | 2021-06-08T22:30:29.000Z | 2022-03-12T00:48:55.000Z | Diena_8_dictionaries/d8_s28_u1.py | MarisKuz/Python-RTU | 12261d06dc81fa0d98190ca0eb5133d43d517070 | [
"MIT"
] | 12 | 2020-09-28T17:06:52.000Z | 2022-02-17T12:12:46.000Z | from collections import Counter
text = "hubba bubba"
# def get_char_count(text):
# letters = {}
# for letter in text:
# letters[letter] = text.count(letter) # hidden loop in count
# return letters
print(get_char_count(text))
count = Counter(text)
print(count)
print(count.most_comm... | 20.32 | 74 | 0.596457 | from collections import Counter
text = "hubba bubba"
# def get_char_count(text):
# letters = {}
# for letter in text:
# letters[letter] = text.count(letter) # hidden loop in count
# return letters
def get_char_count(text):
res_dict = {}
for c in text:
if c in res_dic... | 159 | 0 | 23 |
5a6aa7950ba84c32fc870d83a6d609d56f3f0e05 | 3,665 | py | Python | unit_tests/test_file_accessor.py | LIN810116/neuroglancer-scripts | 803768d0d550261efa508896eabf55f964cb16c9 | [
"MIT"
] | 20 | 2017-09-19T10:18:06.000Z | 2022-02-28T23:08:48.000Z | unit_tests/test_file_accessor.py | stephen-zhouyang/neuroglancer-scripts | 3aa2591f3c9710fa0dae930e6270a3397345bf09 | [
"MIT"
] | 18 | 2017-09-27T11:20:22.000Z | 2022-02-08T09:12:18.000Z | unit_tests/test_file_accessor.py | stephen-zhouyang/neuroglancer-scripts | 3aa2591f3c9710fa0dae930e6270a3397345bf09 | [
"MIT"
] | 15 | 2017-03-17T12:56:28.000Z | 2022-02-16T17:59:58.000Z | # Copyright (c) 2018 Forschungszentrum Juelich GmbH
# Author: Yann Leprince <y.leprince@fz-juelich.de>
#
# This software is made available under the MIT licence, see LICENCE.txt.
import pathlib
import pytest
from neuroglancer_scripts.file_accessor import FileAccessor
from neuroglancer_scripts.accessor import (
D... | 35.931373 | 73 | 0.690859 | # Copyright (c) 2018 Forschungszentrum Juelich GmbH
# Author: Yann Leprince <y.leprince@fz-juelich.de>
#
# This software is made available under the MIT licence, see LICENCE.txt.
import pathlib
import pytest
from neuroglancer_scripts.file_accessor import FileAccessor
from neuroglancer_scripts.accessor import (
D... | 3,135 | 0 | 91 |
fc0bcb37fa10554fd99039b30774a06ba241b342 | 1,761 | py | Python | public/shader/220303_1752.py | pome-ta/soundShader4twigl | abdb42fbda96981e8c2d71696f4f76049796ffad | [
"MIT"
] | null | null | null | public/shader/220303_1752.py | pome-ta/soundShader4twigl | abdb42fbda96981e8c2d71696f4f76049796ffad | [
"MIT"
] | null | null | null | public/shader/220303_1752.py | pome-ta/soundShader4twigl | abdb42fbda96981e8c2d71696f4f76049796ffad | [
"MIT"
] | null | null | null | // シェーダー空手のやつ
//# https://thebookofshaders.com/05/kynd.png
#define BPM 90.0
const float PI = acos(-1.0);
const float TAU = PI * 2.0;
/* sound common */
float timeToBeat(float t) {return t / 60.0 * BPM;}
float beatToTime(float b) {return b / BPM * 60.0;}
float sine(float phase) {
return sin(TAU * phase);
}
float ... | 24.123288 | 93 | 0.508234 | // シェーダー空手のやつ
//# https://thebookofshaders.com/05/kynd.png
#define BPM 90.0
const float PI = acos(-1.0);
const float TAU = PI * 2.0;
/* sound common */
float timeToBeat(float t) {return t / 60.0 * BPM;}
float beatToTime(float b) {return b / BPM * 60.0;}
float sine(float phase) {
return sin(TAU * phase);
}
float ... | 0 | 0 | 0 |
5b92ff2f553aa52e41855cc180f1b6e34b52287c | 5,310 | py | Python | moto/ebs/responses.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | moto/ebs/responses.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | moto/ebs/responses.py | andormarkus/moto | 67cda6d7d6f42118ccd7e2170e7ff0a1f92fa6a6 | [
"Apache-2.0"
] | null | null | null | """Handles incoming ebs requests, invokes methods, returns responses."""
import json
from moto.core.responses import BaseResponse
from .models import ebs_backends
class EBSResponse(BaseResponse):
"""Handler for EBS requests and responses."""
@property
def ebs_backend(self):
"""Return backend ins... | 36.122449 | 130 | 0.593597 | """Handles incoming ebs requests, invokes methods, returns responses."""
import json
from moto.core.responses import BaseResponse
from .models import ebs_backends
class EBSResponse(BaseResponse):
"""Handler for EBS requests and responses."""
@property
def ebs_backend(self):
"""Return backend ins... | 1,916 | 0 | 135 |
cd1504154b866217ffd7e307fc7fa1ad19e62e68 | 2,285 | py | Python | test/test_ac.py | RL-Starterpack/rl-starterpack | af61d08eb00b0c960b103eb469a73ba2f47b9990 | [
"MIT"
] | 25 | 2020-11-23T15:26:04.000Z | 2021-07-21T09:24:16.000Z | test/test_ac.py | RL-Starterpack/rl-starterpack | af61d08eb00b0c960b103eb469a73ba2f47b9990 | [
"MIT"
] | null | null | null | test/test_ac.py | RL-Starterpack/rl-starterpack | af61d08eb00b0c960b103eb469a73ba2f47b9990 | [
"MIT"
] | 9 | 2021-03-28T07:45:48.000Z | 2022-03-22T12:43:10.000Z | import unittest
import torch.nn
from rl_starterpack import AC, OpenAIGym, experiment
| 40.803571 | 97 | 0.644201 | import unittest
import torch.nn
from rl_starterpack import AC, OpenAIGym, experiment
class TestAC(unittest.TestCase):
def test_cartpole(self):
env = OpenAIGym(level='CartPole', max_timesteps=100)
hidden_size = 16
actor_fn = (lambda: torch.nn.Sequential(
torch.nn.Linear(in_fe... | 2,109 | 11 | 77 |
b0411ae28aa8350a4d5efdcf252faf88416873a6 | 795 | py | Python | netmiko/centec/centec_os.py | josephwhite13/netmiko | c08c5ebb3484383f034e22b9576f88be07525f72 | [
"MIT"
] | 2 | 2021-07-15T17:55:55.000Z | 2021-07-25T23:56:12.000Z | netmiko/centec/centec_os.py | rockenwind/netmiko | 24291029d0cdd5af660475ac1093a2dcd1c08af2 | [
"MIT"
] | 1 | 2020-12-29T13:14:54.000Z | 2020-12-29T13:14:54.000Z | netmiko/centec/centec_os.py | rockenwind/netmiko | 24291029d0cdd5af660475ac1093a2dcd1c08af2 | [
"MIT"
] | 1 | 2022-01-28T00:51:41.000Z | 2022-01-28T00:51:41.000Z | """Centec OS Support"""
from netmiko.cisco_base_connection import CiscoBaseConnection
import time
| 25.645161 | 76 | 0.681761 | """Centec OS Support"""
from netmiko.cisco_base_connection import CiscoBaseConnection
import time
class CentecOSBase(CiscoBaseConnection):
def session_preparation(self):
"""Prepare the session after the connection has been established."""
self._test_channel_read(pattern=r"[>#]")
self.set_b... | 0 | 625 | 69 |
23f54cc870cf05d60c13ef1c334edaf8af01defa | 301 | py | Python | 40 Algorithm challenge/challenge 3.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | 1 | 2022-01-27T16:28:51.000Z | 2022-01-27T16:28:51.000Z | 40 Algorithm challenge/challenge 3.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | null | null | null | 40 Algorithm challenge/challenge 3.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | null | null | null | #Challenge 3
#The program asks the user to inputtheir surname and then their first name.
#The program then outputsthe user’s first name and then their surname separately.
name2 = input("please enter your surname: ")
name1 = input("please enter your first name: ")
print(name2)
print(name1)
| 30.1 | 82 | 0.744186 | #Challenge 3
#The program asks the user to inputtheir surname and then their first name.
#The program then outputsthe user’s first name and then their surname separately.
name2 = input("please enter your surname: ")
name1 = input("please enter your first name: ")
print(name2)
print(name1)
| 0 | 0 | 0 |
0b2070746fa1ea5966242d1e72b2c334bf6327ef | 37,346 | py | Python | importers/instagram.py | audacious-software/Passive-Data-Kit-External-Data | 2cfa93f31f53dcce8bb38f99144d993dd1cd4a9b | [
"Apache-2.0"
] | 1 | 2021-07-07T21:13:53.000Z | 2021-07-07T21:13:53.000Z | importers/instagram.py | audacious-software/Passive-Data-Kit-External-Data | 2cfa93f31f53dcce8bb38f99144d993dd1cd4a9b | [
"Apache-2.0"
] | 8 | 2020-11-18T15:29:17.000Z | 2022-02-24T20:38:27.000Z | importers/instagram.py | audacious-software/Passive-Data-Kit-External-Data | 2cfa93f31f53dcce8bb38f99144d993dd1cd4a9b | [
"Apache-2.0"
] | null | null | null | # pylint: disable=line-too-long
from __future__ import print_function
import json
import re
import traceback
import zipfile
import arrow
import pytz
from passive_data_kit.models import DataPoint
from passive_data_kit_external_data.models import annotate_field
from ..utils import hash_content, encrypt_content, cre... | 51.582873 | 270 | 0.695041 | # pylint: disable=line-too-long
from __future__ import print_function
import json
import re
import traceback
import zipfile
import arrow
import pytz
from passive_data_kit.models import DataPoint
from passive_data_kit_external_data.models import annotate_field
from ..utils import hash_content, encrypt_content, cre... | 36,402 | 0 | 552 |
cbbfc63bb3d1bd594dcc6409654a03119267b06e | 563 | py | Python | setup.py | GambitResearch/use_logging | 6d941fbf4c452fb56a919e5975a373aaaf65123e | [
"MIT"
] | 1 | 2018-04-23T14:01:08.000Z | 2018-04-23T14:01:08.000Z | setup.py | GambitResearch/use_logging | 6d941fbf4c452fb56a919e5975a373aaaf65123e | [
"MIT"
] | 1 | 2020-11-14T03:37:39.000Z | 2020-11-14T03:37:39.000Z | setup.py | GambitResearch/use_logging | 6d941fbf4c452fb56a919e5975a373aaaf65123e | [
"MIT"
] | null | null | null | from distutils.core import setup
import os
from setuptools import find_packages
DIR = os.path.dirname(__file__)
with open(os.path.join(DIR, "README.md")) as f:
readme = f.read().splitlines()
setup(
name='use_logging',
version='0.0.1',
packages=find_packages(include='use_logging*'),
url='https://github.com/Gamb... | 23.458333 | 53 | 0.726465 | from distutils.core import setup
import os
from setuptools import find_packages
DIR = os.path.dirname(__file__)
with open(os.path.join(DIR, "README.md")) as f:
readme = f.read().splitlines()
setup(
name='use_logging',
version='0.0.1',
packages=find_packages(include='use_logging*'),
url='https://github.com/Gamb... | 0 | 0 | 0 |
9312ffaac9b56887ad3243e2f099b34e9c902882 | 2,415 | py | Python | crawler/crawler_instance/constants/constant.py | msmannan00/Genesis-Auto-Crawler | c0cf79a0fc7a12e056108ffc24faf0d3baa949ad | [
"MIT"
] | 1 | 2020-03-02T17:19:50.000Z | 2020-03-02T17:19:50.000Z | crawler/crawler_instance/constants/constant.py | msmannan00/Genesis-Auto-Crawler | c0cf79a0fc7a12e056108ffc24faf0d3baa949ad | [
"MIT"
] | null | null | null | crawler/crawler_instance/constants/constant.py | msmannan00/Genesis-Auto-Crawler | c0cf79a0fc7a12e056108ffc24faf0d3baa949ad | [
"MIT"
] | null | null | null | from pathlib import Path
| 30.961538 | 113 | 0.735404 | from pathlib import Path
class RAW_PATH_CONSTANTS:
S_SIGWIN_PATH = str(Path(__file__).parent.parent.parent.parent.parent) + "/cygwin64/bin/bash.exe --login"
S_PROJECT_PATH = str(Path(__file__).parent.parent.parent.parent)
S_RAW_PATH = S_PROJECT_PATH + "/"
S_DATASET_PATH = "/crawler/crawler_services/r... | 0 | 2,320 | 69 |
880060e846ba0c4e439ab8b8472884c5df0da377 | 5,795 | py | Python | Bongard-LOGO_Baselines/models/classifier.py | simitii/Bongard-LOGO | 45a0ab244c809b32bcba139b7273b8ec5aa0708c | [
"MIT"
] | 5 | 2020-08-19T01:50:11.000Z | 2020-08-25T13:58:23.000Z | Bongard-LOGO_Baselines/models/classifier.py | simitii/Bongard-LOGO | 45a0ab244c809b32bcba139b7273b8ec5aa0708c | [
"MIT"
] | null | null | null | Bongard-LOGO_Baselines/models/classifier.py | simitii/Bongard-LOGO | 45a0ab244c809b32bcba139b7273b8ec5aa0708c | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
import models
import utils
from .models import register
@register('classifier')
@register('linear-classifier')
@register('nn-classifier')
@register('moco')
class MoCo(nn.Module):
"""
Build a MoCo model with: a query encoder, a key encoder, and a queue... | 30.824468 | 104 | 0.603451 | import math
import torch
import torch.nn as nn
import models
import utils
from .models import register
@register('classifier')
class Classifier(nn.Module):
def __init__(self, encoder, encoder_args,
classifier, classifier_args):
super().__init__()
self.encoder = models.make(... | 1,334 | 29 | 258 |
86930328405a67946a08f93b1eefb3fea203cf53 | 2,328 | py | Python | bigtop-packages/src/charm/hive/layer-hive/tests/02-smoke-test.py | sekikn2/bigtop | f183d9430b7c8c98d475a379d6980b16bcbb6c0b | [
"Apache-2.0"
] | 371 | 2015-01-19T05:42:51.000Z | 2022-03-27T14:46:52.000Z | bigtop-packages/src/charm/hive/layer-hive/tests/02-smoke-test.py | sekikn2/bigtop | f183d9430b7c8c98d475a379d6980b16bcbb6c0b | [
"Apache-2.0"
] | 491 | 2015-03-10T17:25:02.000Z | 2022-03-30T12:22:44.000Z | bigtop-packages/src/charm/hive/layer-hive/tests/02-smoke-test.py | sekikn2/bigtop | f183d9430b7c8c98d475a379d6980b16bcbb6c0b | [
"Apache-2.0"
] | 395 | 2015-01-02T20:53:01.000Z | 2022-03-21T08:49:08.000Z | #!/usr/bin/env python3
# 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 "Lic... | 38.163934 | 81 | 0.672251 | #!/usr/bin/env python3
# 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 "Lic... | 888 | 0 | 26 |
3bfe0be62167e97ac097f4e3fa534d9db53cec4b | 1,887 | py | Python | BlueKumquatAutoDiff/tests/test_simpleautodiff.py | cs107-blue-kumquat/cs107-FinalProject | 8fba44103ca0c48969b712de8bd8ac0e80ec3806 | [
"MIT"
] | null | null | null | BlueKumquatAutoDiff/tests/test_simpleautodiff.py | cs107-blue-kumquat/cs107-FinalProject | 8fba44103ca0c48969b712de8bd8ac0e80ec3806 | [
"MIT"
] | 10 | 2021-11-18T14:56:04.000Z | 2021-12-11T23:23:47.000Z | BlueKumquatAutoDiff/tests/test_simpleautodiff.py | cs107-blue-kumquat/cs107-FinalProject | 8fba44103ca0c48969b712de8bd8ac0e80ec3806 | [
"MIT"
] | 1 | 2021-11-18T08:38:35.000Z | 2021-11-18T08:38:35.000Z | import pytest
from BlueKumquatAutoDiff.autodiff import *
| 29.030769 | 69 | 0.585586 | import pytest
from BlueKumquatAutoDiff.autodiff import *
def test_init():
dict_val = {'x': 1,'y': 2}
list_functs = ['x * 8', 'x*y']
auto_diff_test = SimpleAutoDiff(dict_val, list_functs)
dict_val = {'x': 1}
list_functs = ['x * 8', 2]
with pytest.raises(TypeError):
auto_diff_test = SimpleAutoDiff(dict_val, li... | 1,687 | 0 | 138 |
2c283e5675178b2b85b5f4e137d34e9bb198f24c | 1,512 | py | Python | speed_friending_matcher/core/person.py | machinekoder/speed-friending-matcher | c1d63c44e198497662c561342b64f597cb8623e9 | [
"MIT"
] | 4 | 2018-05-04T15:44:09.000Z | 2019-03-17T04:54:20.000Z | speed_friending_matcher/core/person.py | machinekoder/speed-friending-and-dating-matcher | c1d63c44e198497662c561342b64f597cb8623e9 | [
"MIT"
] | 12 | 2017-10-21T10:42:28.000Z | 2019-02-27T10:33:04.000Z | speed_friending_matcher/core/person.py | machinekoder/speed-friending-matcher | c1d63c44e198497662c561342b64f597cb8623e9 | [
"MIT"
] | 8 | 2018-01-02T10:14:19.000Z | 2022-01-11T03:17:04.000Z | # -*- coding: utf-8 -*-
from aenum import Flag
from .results import Results
| 20.432432 | 70 | 0.578042 | # -*- coding: utf-8 -*-
from aenum import Flag
from .results import Results
class MatchingFlags(Flag):
no_flags = 0
match_all = 1
class Person(object):
def __init__(
self,
name,
number,
marked_numbers,
flags=MatchingFlags.no_flags,
email=None,
phon... | 967 | 421 | 46 |
569055396f68e7bd133e087451933a357b5e7f8c | 689 | py | Python | neura_hs/core/management/commands/update_db.py | ysaron/NeuraHS | 46b77feba459ef04c9adaebb2af11d6c0b5c9c87 | [
"MIT"
] | null | null | null | neura_hs/core/management/commands/update_db.py | ysaron/NeuraHS | 46b77feba459ef04c9adaebb2af11d6c0b5c9c87 | [
"MIT"
] | null | null | null | neura_hs/core/management/commands/update_db.py | ysaron/NeuraHS | 46b77feba459ef04c9adaebb2af11d6c0b5c9c87 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
import time
from core.services.update import Updater
| 32.809524 | 93 | 0.669086 | from django.core.management.base import BaseCommand
import time
from core.services.update import Updater
class Command(BaseCommand):
help = 'Update the card database'
def add_arguments(self, parser):
parser.add_argument('-r', '--rewrite', action='store_true', help='Rewrite all cards')
def handl... | 461 | 98 | 23 |
a6d758ca7000afd5d7e09cef42c9adc4d7d8629e | 347 | py | Python | tests/python/test_nltk.py | lcnja/modulefiles-1 | 2bbaf48089ef55f0a8247e6c365103f2b852feec | [
"Apache-2.0"
] | 6 | 2016-03-17T13:59:43.000Z | 2021-07-08T06:15:33.000Z | tests/python/test_nltk.py | lcnja/modulefiles-1 | 2bbaf48089ef55f0a8247e6c365103f2b852feec | [
"Apache-2.0"
] | null | null | null | tests/python/test_nltk.py | lcnja/modulefiles-1 | 2bbaf48089ef55f0a8247e6c365103f2b852feec | [
"Apache-2.0"
] | 2 | 2016-08-10T16:04:15.000Z | 2016-10-13T17:38:24.000Z | import nltk
import sys
sentence = """At eight o'clock on Thursday morning Arthur didn't feel very good."""
tokens = nltk.word_tokenize(sentence)
if tokens != ['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',
'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']:
sys.stderr.write("Error in token... | 31.545455 | 83 | 0.613833 | import nltk
import sys
sentence = """At eight o'clock on Thursday morning Arthur didn't feel very good."""
tokens = nltk.word_tokenize(sentence)
if tokens != ['At', 'eight', "o'clock", 'on', 'Thursday', 'morning',
'Arthur', 'did', "n't", 'feel', 'very', 'good', '.']:
sys.stderr.write("Error in token... | 0 | 0 | 0 |
82a5222a023194785deed9788f9a013c3fa11c0a | 84 | py | Python | vyperlogix/products/data.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/products/data.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/products/data.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | import os
_data_path_prefix = lambda name:os.sep.join(['www.VyperLogix.com',name])
| 21 | 72 | 0.761905 | import os
_data_path_prefix = lambda name:os.sep.join(['www.VyperLogix.com',name])
| 0 | 0 | 0 |
fb5560a1846af690e1d1431d238f8f3bb488cacc | 1,139 | py | Python | setup.py | ideonate/sammy | 8a8b9fae28899429c1ad1e51e4ff5d6f7f6047ec | [
"Apache-2.0"
] | null | null | null | setup.py | ideonate/sammy | 8a8b9fae28899429c1ad1e51e4ff5d6f7f6047ec | [
"Apache-2.0"
] | null | null | null | setup.py | ideonate/sammy | 8a8b9fae28899429c1ad1e51e4ff5d6f7f6047ec | [
"Apache-2.0"
] | null | null | null | import pathlib
import pkg_resources
from setuptools import setup, find_packages
with pathlib.Path('requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)
]
version = '0.4.2'
setup(
n... | 31.638889 | 76 | 0.67691 | import pathlib
import pkg_resources
from setuptools import setup, find_packages
with pathlib.Path('requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)
]
version = '0.4.2'
setup(
n... | 0 | 0 | 0 |
41f3cc563c60d973d5785841494c8b5887325556 | 1,241 | py | Python | iii_reproducibility/mlflow_tracking_example.py | production-ml-book-team/prod-ml-book | b6886f5f2a79ddac9accf6b056041deb08e47217 | [
"MIT"
] | null | null | null | iii_reproducibility/mlflow_tracking_example.py | production-ml-book-team/prod-ml-book | b6886f5f2a79ddac9accf6b056041deb08e47217 | [
"MIT"
] | null | null | null | iii_reproducibility/mlflow_tracking_example.py | production-ml-book-team/prod-ml-book | b6886f5f2a79ddac9accf6b056041deb08e47217 | [
"MIT"
] | 1 | 2020-03-01T06:04:02.000Z | 2020-03-01T06:04:02.000Z | import numpy
import sklearn.naive_bayes
import sklearn.feature_extraction.text
import sklearn.pipeline
# New additions
import mlflow.sklearn
mlflow.set_tracking_uri("http://atrium.datmo.com")
mlflow.set_experiment("training_module")
...
train_and_evaluate_model() | 33.540541 | 91 | 0.691378 | import numpy
import sklearn.naive_bayes
import sklearn.feature_extraction.text
import sklearn.pipeline
# New additions
import mlflow.sklearn
mlflow.set_tracking_uri("http://atrium.datmo.com")
mlflow.set_experiment("training_module")
...
def train_and_evaluate_model():
with mlflow.start_run():
# Load data... | 952 | 0 | 23 |
a669c97df041bcfe9de6ff7b4f23af94ace2cc3f | 811 | py | Python | dice_spider_2/spider/test_mysql_connector.py | guanxin0206/dice_crawler | 0b929b49911dc92d718905b2e1112c91e15ef2cd | [
"BSD-2-Clause"
] | 1 | 2017-04-05T23:34:06.000Z | 2017-04-05T23:34:06.000Z | dice_spider_2/spider/test_mysql_connector.py | guanxin0206/dice_crawler | 0b929b49911dc92d718905b2e1112c91e15ef2cd | [
"BSD-2-Clause"
] | null | null | null | dice_spider_2/spider/test_mysql_connector.py | guanxin0206/dice_crawler | 0b929b49911dc92d718905b2e1112c91e15ef2cd | [
"BSD-2-Clause"
] | null | null | null | '''
Created on Jun 14, 2017
@author: xinguan
'''
# import mysql.connector
import mysql.connector
create_dice_jobs = (
"CREATE TABLE IF NOT EXISTS `dice_jobs` ("
" `job_unique_id` varchar(50) NOT NULL,"
" `job_title` text NOT NULL,"
" `job_url` text NOT NULL,"
" `company` text NOT NULL,"
" ... | 24.575758 | 63 | 0.604192 | '''
Created on Jun 14, 2017
@author: xinguan
'''
# import mysql.connector
import mysql.connector
create_dice_jobs = (
"CREATE TABLE IF NOT EXISTS `dice_jobs` ("
" `job_unique_id` varchar(50) NOT NULL,"
" `job_title` text NOT NULL,"
" `job_url` text NOT NULL,"
" `company` text NOT NULL,"
" ... | 0 | 0 | 0 |
36c3ae068b1b22355b24edc20d0a52286b45a4ff | 1,922 | py | Python | src/utils.py | showmethecoin/upbit-trader | f29f0e6074c4cc2296ca098f7d53cac5dd780881 | [
"Apache-2.0"
] | 8 | 2021-04-30T08:30:21.000Z | 2022-03-08T13:35:36.000Z | src/utils.py | showmethecoin/upbit-trader | f29f0e6074c4cc2296ca098f7d53cac5dd780881 | [
"Apache-2.0"
] | 4 | 2021-04-30T09:39:35.000Z | 2021-05-08T15:24:08.000Z | src/utils.py | showmethecoin/upbit-trader | f29f0e6074c4cc2296ca098f7d53cac5dd780881 | [
"Apache-2.0"
] | 4 | 2021-11-24T06:53:40.000Z | 2022-03-21T04:20:31.000Z | # !/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import logging
import asyncio as aio
from multiprocessing import set_start_method
def get_logger(print_format: str = '[%(asctime)s.%(msecs)03d: %(levelname).1s %(filename)s:%(lineno)s] %(message)s',
date_format: str = '%Y-%m-%d %H:%M:%S',
... | 34.945455 | 116 | 0.664412 | # !/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import logging
import asyncio as aio
from multiprocessing import set_start_method
def get_logger(print_format: str = '[%(asctime)s.%(msecs)03d: %(levelname).1s %(filename)s:%(lineno)s] %(message)s',
date_format: str = '%Y-%m-%d %H:%M:%S',
... | 719 | 0 | 69 |
4632d1de447aed60d67507867bf7386bdd3879cb | 1,001 | py | Python | multivitamin/applications/utils.py | keishinkickback/multivitamin | edc49267fc5a25182da0e7c7c8bba398225437e5 | [
"Apache-2.0"
] | 8 | 2019-05-08T20:27:41.000Z | 2021-04-19T15:17:22.000Z | multivitamin/applications/utils.py | keishinkickback/multivitamin | edc49267fc5a25182da0e7c7c8bba398225437e5 | [
"Apache-2.0"
] | 9 | 2019-05-17T19:16:50.000Z | 2022-03-11T23:46:55.000Z | multivitamin/applications/utils.py | keishinkickback/multivitamin | edc49267fc5a25182da0e7c7c8bba398225437e5 | [
"Apache-2.0"
] | 4 | 2019-05-07T18:00:51.000Z | 2019-06-22T02:35:51.000Z | import os
def load_idmap(idmap_file):
"""Load tab-separated idmap file containing label index and label string
Args:
idmap_file (str): filepath to idmap
Returns:
dict: labelmap (key=index, value=string)
"""
if not os.path.exists(idmap_file):
raise FileExistsError(idmap_fi... | 26.342105 | 76 | 0.625375 | import os
def load_idmap(idmap_file):
"""Load tab-separated idmap file containing label index and label string
Args:
idmap_file (str): filepath to idmap
Returns:
dict: labelmap (key=index, value=string)
"""
if not os.path.exists(idmap_file):
raise FileExistsError(idmap_fi... | 468 | 0 | 23 |
c43cbd4a0728073a28c019995d9c2e09b5784273 | 5,055 | py | Python | gracebot/tests/test_VOEvent.py | Roald87/GraceDB | 5c7e6cc93a33b00c1c30ce040ef26326c003630d | [
"Apache-2.0"
] | 7 | 2019-05-16T20:08:11.000Z | 2021-10-07T03:15:00.000Z | gracebot/tests/test_VOEvent.py | Roald87/GraceDB | 5c7e6cc93a33b00c1c30ce040ef26326c003630d | [
"Apache-2.0"
] | 24 | 2019-07-07T06:14:12.000Z | 2021-09-21T18:50:50.000Z | gracebot/tests/test_VOEvent.py | Roald87/GraceDB | 5c7e6cc93a33b00c1c30ce040ef26326c003630d | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from unittest.mock import Mock, patch
import pytest
from pytest import approx
from functions import mpc_to_mly
from voevent import VOEventFromXml, VOEventFromEventId
import tests.voevent_test_data as test_data
import ligo
from ligo.gracedb.exceptions import HTTPError
@patch("ligo.grace... | 27.774725 | 88 | 0.680317 | from unittest import TestCase
from unittest.mock import Mock, patch
import pytest
from pytest import approx
from functions import mpc_to_mly
from voevent import VOEventFromXml, VOEventFromEventId
import tests.voevent_test_data as test_data
import ligo
from ligo.gracedb.exceptions import HTTPError
@patch("ligo.grace... | 3,731 | 42 | 619 |
942215801e0b0bade4c9c10887697c879a9d34b9 | 15,908 | py | Python | AccountPickup/tests/test_views.py | hhauer/myinfo | 210a2caeff570650462f8774385aa9223b3bc858 | [
"MIT"
] | 2 | 2015-08-04T21:17:09.000Z | 2019-11-16T23:41:56.000Z | AccountPickup/tests/test_views.py | hhauer/myinfo | 210a2caeff570650462f8774385aa9223b3bc858 | [
"MIT"
] | null | null | null | AccountPickup/tests/test_views.py | hhauer/myinfo | 210a2caeff570650462f8774385aa9223b3bc858 | [
"MIT"
] | 2 | 2020-11-03T15:45:04.000Z | 2021-08-30T11:29:44.000Z | __author__ = 'Justin McClure'
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from random import choice
from lib.api_calls import APIException
# Note: Wait view will probably be removed in the future
| 43.583562 | 109 | 0.651622 | __author__ = 'Justin McClure'
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from random import choice
from lib.api_calls import APIException
class AccountPickupViewsTestCase(TestCase):
fixtures = ['AccountPickup_views_test_data.json']
HOST = 'testserver'
INDEX = r... | 13,530 | 1,653 | 472 |
12233affe5ac6a1b618d714a3c6910e493a5a18b | 1,795 | py | Python | scrape.py | djsnipa1/python-shit | b14eddd1f6bbf90063829ab85ed4bde7adb54e55 | [
"MIT"
] | 3 | 2020-03-03T22:55:19.000Z | 2021-04-26T02:39:41.000Z | scrape.py | djsnipa1/python-shit | b14eddd1f6bbf90063829ab85ed4bde7adb54e55 | [
"MIT"
] | 2 | 2020-03-03T22:55:20.000Z | 2020-04-08T12:33:15.000Z | scrape.py | djsnipa1/python-shit | b14eddd1f6bbf90063829ab85ed4bde7adb54e55 | [
"MIT"
] | null | null | null | import requests
import lxml.html
import json
# tutorial from An Intro to Web Scraping With lxml and Python – Python Tips
# https://pythontips.com/2018/06/20/an-intro-to-web-scraping-with-lxml-and-python/
# html = requests.get("https://www.beatport.com/genre/psy-trance/13/top-100")
html = requests.get("https://store.s... | 29.42623 | 82 | 0.693036 | import requests
import lxml.html
import json
# tutorial from An Intro to Web Scraping With lxml and Python – Python Tips
# https://pythontips.com/2018/06/20/an-intro-to-web-scraping-with-lxml-and-python/
# html = requests.get("https://www.beatport.com/genre/psy-trance/13/top-100")
html = requests.get("https://store.s... | 0 | 0 | 0 |
8a70fe6634e3d7a0bb08218dc91468337036413b | 92 | py | Python | aenet/__init__.py | simaki/adaptive-enet | ecae8ad770b818c0ff51203e5a462e4dbf41beca | [
"BSD-3-Clause"
] | null | null | null | aenet/__init__.py | simaki/adaptive-enet | ecae8ad770b818c0ff51203e5a462e4dbf41beca | [
"BSD-3-Clause"
] | 12 | 2021-01-27T01:43:40.000Z | 2021-02-03T06:14:43.000Z | aenet/__init__.py | simaki/adaptive-enet | ecae8ad770b818c0ff51203e5a462e4dbf41beca | [
"BSD-3-Clause"
] | 1 | 2021-12-26T23:18:34.000Z | 2021-12-26T23:18:34.000Z | # flake8: noqa
from .aen import AdaptiveElasticNet
from .aencv import AdaptiveElasticNetCV
| 18.4 | 39 | 0.826087 | # flake8: noqa
from .aen import AdaptiveElasticNet
from .aencv import AdaptiveElasticNetCV
| 0 | 0 | 0 |
8963a0c9c703678e1b2a0261227cefe53355d690 | 1,331 | py | Python | simianpy/analysis/detectfixations.py | jselvan/simianpy | 5b2b162789e11bc89ca2179358ab682269e7df15 | [
"MIT"
] | null | null | null | simianpy/analysis/detectfixations.py | jselvan/simianpy | 5b2b162789e11bc89ca2179358ab682269e7df15 | [
"MIT"
] | null | null | null | simianpy/analysis/detectfixations.py | jselvan/simianpy | 5b2b162789e11bc89ca2179358ab682269e7df15 | [
"MIT"
] | null | null | null | from ..misc import binary_digitize
import numpy as np
import pandas as pd | 35.972973 | 113 | 0.676183 | from ..misc import binary_digitize
import numpy as np
import pandas as pd
def DetectFixations(eye_data, velocity_threshold=2, duration_threshold=None, sampling_rate=1e3, Filter=None):
if Filter is None:
velocity = eye_data.diff().abs()*sampling_rate
else:
velocity = (eye_data.apply(Filter).dif... | 1,234 | 0 | 23 |
b4b4904010fb89d55f0da4c6c0ace8c62a596c76 | 680 | py | Python | examples/reply.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/reply.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/reply.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | 1 | 2022-02-20T09:10:40.000Z | 2022-02-20T09:10:40.000Z | # This example requires the `message_content` privileged intent for access to message content.
import discord
intents = discord.Intents.default()
intents.message_content = True
client = MyClient(intents=intents)
client.run("TOKEN")
| 27.2 | 94 | 0.670588 | # This example requires the `message_content` privileged intent for access to message content.
import discord
class MyClient(discord.Client):
async def on_ready(self):
print(f"Logged in as {self.user} (ID: {self.user.id})")
print("------")
async def on_message(self, message: discord.Message)... | 357 | 10 | 76 |
11bcae79dbe3d4ab0b00e4eb06f7e6d850ed2b07 | 1,486 | py | Python | targetmodel.py | BXuan694/universalAdversarialPerturbation | ebca90f76b5d45715c98a1ff0b6f11df753b51c6 | [
"BSD-2-Clause"
] | 38 | 2019-01-19T09:43:13.000Z | 2022-01-05T09:47:02.000Z | targetmodel.py | BXuan694/universalAdversarialPerturbation | ebca90f76b5d45715c98a1ff0b6f11df753b51c6 | [
"BSD-2-Clause"
] | 3 | 2020-02-24T05:56:35.000Z | 2022-01-07T12:08:33.000Z | targetmodel.py | BXuan694/universalAdversarialPerturbation | ebca90f76b5d45715c98a1ff0b6f11df753b51c6 | [
"BSD-2-Clause"
] | 10 | 2019-02-19T10:05:57.000Z | 2021-06-07T08:02:36.000Z | import torch.nn as nn
from PIL import Image
from torch.utils.data import Dataset
import numpy as np
from transform_file import cut
root='/home/wang/Dataset/Caltech256/'
#root='/media/this/02ff0572-4aa8-47c6-975d-16c3b8062013/Caltech256/'
| 29.137255 | 93 | 0.611036 | import torch.nn as nn
from PIL import Image
from torch.utils.data import Dataset
import numpy as np
from transform_file import cut
root='/home/wang/Dataset/Caltech256/'
#root='/media/this/02ff0572-4aa8-47c6-975d-16c3b8062013/Caltech256/'
def default_loader(path):
return Image.open(path).convert('RGB')
class MyD... | 1,032 | 12 | 202 |
0a58b4051a93fb17bcd48c758537da77b9670348 | 14,519 | py | Python | appcenter/models.py | danielamitay/appcenter-rest-python | 240f71ce290d54f79b4e0814e068da6986abb34f | [
"MIT"
] | 10 | 2019-10-28T13:33:46.000Z | 2021-11-26T15:16:04.000Z | appcenter/models.py | danielamitay/appcenter-rest-python | 240f71ce290d54f79b4e0814e068da6986abb34f | [
"MIT"
] | 12 | 2020-12-09T14:38:31.000Z | 2022-02-23T11:13:37.000Z | appcenter/models.py | danielamitay/appcenter-rest-python | 240f71ce290d54f79b4e0814e068da6986abb34f | [
"MIT"
] | 10 | 2020-06-30T16:13:07.000Z | 2022-01-24T17:01:14.000Z | """Data type models"""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import datetime
import enum
from typing import Any, Dict, List, Optional
import deserialize
def iso8601parse(date_string: Optional[str]) -> Optional[datetime.datetime]:
"""Parse an ISO8601 date string into a datetim... | 25.83452 | 99 | 0.693574 | """Data type models"""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import datetime
import enum
from typing import Any, Dict, List, Optional
import deserialize
def iso8601parse(date_string: Optional[str]) -> Optional[datetime.datetime]:
"""Parse an ISO8601 date string into a datetim... | 2,205 | 9,684 | 812 |
e3f8e1d22bcafa358edf7f3c0244842cba8cf451 | 4,272 | py | Python | indexer/index_mapper.py | FadedCosine/POS-Guided-Neural-Text-Generation | 2b5c72d8f2e08cbf4fe0babc4a4f1db09b348505 | [
"Apache-2.0"
] | 2 | 2021-06-23T08:52:20.000Z | 2021-06-23T08:52:31.000Z | indexer/index_mapper.py | FadedCosine/POS-Guided-Neural-Text-Generation | 2b5c72d8f2e08cbf4fe0babc4a4f1db09b348505 | [
"Apache-2.0"
] | null | null | null | indexer/index_mapper.py | FadedCosine/POS-Guided-Neural-Text-Generation | 2b5c72d8f2e08cbf4fe0babc4a4f1db09b348505 | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
import collections
import re
import pickle
from basic_util.files import *
import argparse
if __name__ =='__main__':
parser = get_parser()
args = parser.parse_args()
imap = IMap(args.dir_path, args.base_name)
imap.learn_dic(args.count_names, args.check_names)
imap.... | 32.610687 | 96 | 0.59574 | import os
import pandas as pd
import collections
import re
import pickle
from basic_util.files import *
import argparse
def count(fl, targets=['input_context'], checks=['input_keyword'], vocab_size=10000):
cnter = collections.Counter()
s = set()
for filename in fl:
cur_df = pd.read_pickle(filename... | 3,619 | 205 | 92 |
bf31b720b525652222135f120c0a379b010899a7 | 294 | py | Python | profiles/migrations/New folder/0041_delete_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0041_delete_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | profiles/migrations/New folder/0041_delete_user.py | Rxavio/link | a0aa34b89a769cfaa20a92a04980e142e42eaa10 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-11-03 07:43
from django.db import migrations
| 17.294118 | 48 | 0.602041 | # Generated by Django 3.0.3 on 2020-11-03 07:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0040_auto_20201103_0801'),
]
operations = [
migrations.DeleteModel(
name='User',
),
]
| 0 | 188 | 23 |
c8677981f8f86e197f62a450212ec26939d05188 | 8,453 | py | Python | solaredge_influx/__main__.py | c0deaddict/solaredge-influx | f258b77f66ad53f67f25b62f4db7c33a935b6a00 | [
"MIT"
] | null | null | null | solaredge_influx/__main__.py | c0deaddict/solaredge-influx | f258b77f66ad53f67f25b62f4db7c33a935b6a00 | [
"MIT"
] | null | null | null | solaredge_influx/__main__.py | c0deaddict/solaredge-influx | f258b77f66ad53f67f25b62f4db7c33a935b6a00 | [
"MIT"
] | null | null | null | import argparse
import requests
from os import getenv
import sys
from influxdb import InfluxDBClient
from datetime import datetime, timedelta
solaredge_api_url = "https://monitoringapi.solaredge.com"
required_version = dict(release="1.0.0")
if __name__ == "__main__":
main()
| 32.891051 | 87 | 0.651603 | import argparse
import requests
from os import getenv
import sys
from influxdb import InfluxDBClient
from datetime import datetime, timedelta
solaredge_api_url = "https://monitoringapi.solaredge.com"
required_version = dict(release="1.0.0")
def api_request(api_key, path, params=dict()):
params = dict(**params,... | 7,881 | 0 | 276 |
eda9d93837af8aac0adf4e04bd2e1c6bad1a9773 | 811 | py | Python | QualificationRound/python/r.py | NavneelSinghal/HCLHackIITK | 91ceb865d1ff7c1ff109fbbbcfda8005d3b9cf93 | [
"MIT"
] | null | null | null | QualificationRound/python/r.py | NavneelSinghal/HCLHackIITK | 91ceb865d1ff7c1ff109fbbbcfda8005d3b9cf93 | [
"MIT"
] | null | null | null | QualificationRound/python/r.py | NavneelSinghal/HCLHackIITK | 91ceb865d1ff7c1ff109fbbbcfda8005d3b9cf93 | [
"MIT"
] | null | null | null | import urllib3
print(main())
| 27.965517 | 144 | 0.52651 | import urllib3
def main():
input1='https://mettl-arq.s3-ap-southeast-1.amazonaws.com/questions/iit-kanpur/cyber-security-hackathon/round1/problem1/defaulttestcase.txt'
try:
r = urllib3.PoolManager().request('GET', input1)
except:
return ({0:0}, 'the URL is incorrect')
# alternative 1:
... | 759 | 0 | 22 |
bb248d0321e754a4546fd7e0e3d830f91298fc50 | 1,301 | py | Python | src/lib/dynamo/migration.py | arnulfojr/sanic-persistance-patterns | c3c433014401725ab60f1dde3c35848f9ce3ef88 | [
"MIT"
] | null | null | null | src/lib/dynamo/migration.py | arnulfojr/sanic-persistance-patterns | c3c433014401725ab60f1dde3c35848f9ce3ef88 | [
"MIT"
] | null | null | null | src/lib/dynamo/migration.py | arnulfojr/sanic-persistance-patterns | c3c433014401725ab60f1dde3c35848f9ce3ef88 | [
"MIT"
] | null | null | null | from lib.dynamo.client import DynamoClientManager
async def table_exists(name: str) -> bool:
"""Check if table exists."""
async with DynamoClientManager() as dynamodb:
try:
await dynamodb.describe_table(TableName=name)
except dynamodb.exceptions.ResourceNotFoundException:
... | 27.680851 | 61 | 0.668716 | from lib.dynamo.client import DynamoClientManager
async def table_exists(name: str) -> bool:
"""Check if table exists."""
async with DynamoClientManager() as dynamodb:
try:
await dynamodb.describe_table(TableName=name)
except dynamodb.exceptions.ResourceNotFoundException:
... | 0 | 0 | 0 |
47dc8cafe5b06270c0674e3e4e16755e648fcdc1 | 1,140 | py | Python | lib/models/backbone/supernet.py | Kevoen/LightTrack | 0f4e0ffe7f4faaf39d637dcaa3a42e032b96f76c | [
"MIT"
] | 221 | 2021-04-16T11:23:55.000Z | 2022-03-30T03:52:44.000Z | lib/models/backbone/supernet.py | swan2015/LightTrack | e94368aa80e924f8720887aa8f4fc23db074d3e7 | [
"MIT"
] | 25 | 2021-04-16T11:37:20.000Z | 2021-12-25T17:29:21.000Z | lib/models/backbone/supernet.py | swan2015/LightTrack | e94368aa80e924f8720887aa8f4fc23db074d3e7 | [
"MIT"
] | 45 | 2021-04-30T07:10:15.000Z | 2022-03-16T08:15:40.000Z | import numpy as np
import torch
from lib.models.backbone.models.hypernet import _gen_supernet
def build_supernet_DP(flops_maximum=600):
"""Backbone with Dynamic output position"""
set_seed()
model, sta_num, size_factor = _gen_supernet(
flops_minimum=0,
flops_maximum=flops_maximum,
... | 22.8 | 61 | 0.657895 | import numpy as np
import torch
from lib.models.backbone.models.hypernet import _gen_supernet
def set_seed():
seed = 42
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
np.random.seed(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
def build_sup... | 497 | 0 | 46 |
130f82519e4ae3275d304a709e3078a731173f91 | 1,377 | py | Python | ktane/solverutils/morse.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | 1 | 2022-01-04T03:47:34.000Z | 2022-01-04T03:47:34.000Z | ktane/solverutils/morse.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | 4 | 2021-04-13T07:03:37.000Z | 2021-12-15T11:34:05.000Z | ktane/solverutils/morse.py | thecnoNSMB/ktane-mission-solver | 237d969a8acd21533b5fb18cc5a47dd03ba1cc7d | [
"MIT"
] | null | null | null | "Utilities for asking for and processing Morse Code signals."
from typing import Final
from ktane import ask
__all__ = ["valid_morse", "decode", "ask_word"]
MORSE_ALPHABET: Final = {
"a": ".-",
"b": "-...",
"c": "-.-.",
"d": "-..",
"e": ".",
"f": "..-.",
"g": "--.",
"h": "....",
... | 20.552239 | 73 | 0.424837 | "Utilities for asking for and processing Morse Code signals."
from typing import Final
from ktane import ask
__all__ = ["valid_morse", "decode", "ask_word"]
MORSE_ALPHABET: Final = {
"a": ".-",
"b": "-...",
"c": "-.-.",
"d": "-..",
"e": ".",
"f": "..-.",
"g": "--.",
"h": "....",
... | 0 | 0 | 0 |
a2dd565565e8f9a9e23f9aca3e491ce17adf4c0a | 657 | py | Python | osc_tui/flexibleGPU.py | outscale-mdr/osc-tui | 7d562c3f3ed88add27586bb0c3c14bee7053c37e | [
"BSD-3-Clause"
] | 5 | 2020-06-05T11:46:01.000Z | 2022-02-01T18:05:11.000Z | osc_tui/flexibleGPU.py | outscale-mdr/osc-tui | 7d562c3f3ed88add27586bb0c3c14bee7053c37e | [
"BSD-3-Clause"
] | 23 | 2020-04-29T19:26:49.000Z | 2022-03-07T09:21:34.000Z | osc_tui/flexibleGPU.py | outscale-mdr/osc-tui | 7d562c3f3ed88add27586bb0c3c14bee7053c37e | [
"BSD-3-Clause"
] | 10 | 2020-02-21T14:00:28.000Z | 2021-09-23T12:06:39.000Z | import npyscreen
import pyperclip
import createVm
import main
import popup
import selectableGrid
import virtualMachine
| 29.863636 | 78 | 0.643836 | import npyscreen
import pyperclip
import createVm
import main
import popup
import selectableGrid
import virtualMachine
class Grid(selectableGrid.SelectableGrid):
def __init__(self, screen, *args, **keywords):
super().__init__(screen, *args, **keywords)
self.col_titles = ["Id", "Generation", "Mode... | 440 | 21 | 76 |
62095d061138f576a9cac1b1bf00dee00d53a7c1 | 8,026 | py | Python | tests/acceptance/rfc1350_test.py | pedrudehuere/py3tftp | b43d993f73a9f9617f22f886a9d2d6b91884ed1c | [
"MIT"
] | 41 | 2016-02-28T08:01:30.000Z | 2022-03-12T14:53:34.000Z | tests/acceptance/rfc1350_test.py | pedrudehuere/otftp | b43d993f73a9f9617f22f886a9d2d6b91884ed1c | [
"MIT"
] | 15 | 2017-03-04T04:04:42.000Z | 2021-05-19T03:33:46.000Z | tests/acceptance/rfc1350_test.py | pedrudehuere/otftp | b43d993f73a9f9617f22f886a9d2d6b91884ed1c | [
"MIT"
] | 22 | 2017-03-29T07:50:09.000Z | 2021-12-24T22:02:27.000Z | import hashlib
import socket
import unittest
from io import BytesIO
from os import remove as rm
from os.path import exists
from time import sleep
import tests.test_helpers as h
if __name__ == '__main__':
unittest.main()
| 31.849206 | 79 | 0.567157 | import hashlib
import socket
import unittest
from io import BytesIO
from os import remove as rm
from os.path import exists
from time import sleep
import tests.test_helpers as h
class TestRRQ(unittest.TestCase):
@classmethod
def setUpClass(cls):
with open('LICENSE', 'rb') as f:
cls.license... | 6,890 | 837 | 69 |
b5f117895fcef3c40425dd579c4ad9c9fc4abb1b | 1,561 | py | Python | rvo/cli.py | noqqe/rvo | 423e1ea1aea0a2dc849ceae838e18896a13e7771 | [
"MIT"
] | 14 | 2016-05-04T13:56:10.000Z | 2019-08-01T14:31:33.000Z | rvo/cli.py | noqqe/rvo | 423e1ea1aea0a2dc849ceae838e18896a13e7771 | [
"MIT"
] | 12 | 2016-08-01T12:42:53.000Z | 2022-02-16T09:37:47.000Z | rvo/cli.py | noqqe/rvo | 423e1ea1aea0a2dc849ceae838e18896a13e7771 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
import sys
import pymongo
import os
import click
import datetime
import rvo.utils as utils
from rvo import __version__
import rvo.config
command_folder = os.path.join(os.path.dirname(__file__), 'commands')
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
# rvo command class
# bas... | 24.777778 | 80 | 0.627162 | #!/usr/bin/env python2.7
import sys
import pymongo
import os
import click
import datetime
import rvo.utils as utils
from rvo import __version__
import rvo.config
command_folder = os.path.join(os.path.dirname(__file__), 'commands')
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
# rvo command class
class ... | 702 | 17 | 98 |
3ff966cd61af5b1670e1b17560b12849204e6a21 | 2,423 | py | Python | python/config.py | NREL/dgen_globetrotter | afef63c75a0721e18d2c3748a73a6f5300d2054b | [
"BSD-3-Clause"
] | null | null | null | python/config.py | NREL/dgen_globetrotter | afef63c75a0721e18d2c3748a73a6f5300d2054b | [
"BSD-3-Clause"
] | null | null | null | python/config.py | NREL/dgen_globetrotter | afef63c75a0721e18d2c3748a73a6f5300d2054b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This module contains variables that can be changed, but are not exposed to non-expert users.
"""
import os
import multiprocessing
#==============================================================================
#==============================================================================
... | 49.44898 | 323 | 0.401156 | # -*- coding: utf-8 -*-
"""
This module contains variables that can be changed, but are not exposed to non-expert users.
"""
import os
import multiprocessing
#==============================================================================
#==============================================================================
... | 0 | 0 | 0 |
1d7828e5aaee6bca7ce83a37cb7af43c58b1cbd9 | 4,240 | py | Python | tsdata/models.py | caktus/Traffic-Stops | 2c6eda9477f1770c5ad1208a1937c3e828fbfb28 | [
"MIT"
] | 1 | 2021-12-10T14:58:11.000Z | 2021-12-10T14:58:11.000Z | tsdata/models.py | caktus/Traffic-Stops | 2c6eda9477f1770c5ad1208a1937c3e828fbfb28 | [
"MIT"
] | 5 | 2020-08-12T15:20:31.000Z | 2021-06-10T13:43:02.000Z | tsdata/models.py | caktus/Traffic-Stops | 2c6eda9477f1770c5ad1208a1937c3e828fbfb28 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
STATE_CHOICES = ((settings.NC_KEY, "North Carolina"),)
STATUS_CHOICES = (
("running", "Running"),
("error", "Error"),
("finished", "Finished"),
)
GEOGRAPHY_CHOICES = (
... | 34.754098 | 92 | 0.700708 | from django.conf import settings
from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
STATE_CHOICES = ((settings.NC_KEY, "North Carolina"),)
STATUS_CHOICES = (
("running", "Running"),
("error", "Error"),
("finished", "Finished"),
)
GEOGRAPHY_CHOICES = (
... | 638 | 3,113 | 115 |
08aa3d0ae0cea2ca611adaf32c844e2e0178cc1a | 12,695 | py | Python | pyrehol/__init__.py | fakeNetflix/uber-repo-pyrehol | 7c8b75e1780c7e85cb77748fbdf3cf6fa6c14294 | [
"MIT"
] | null | null | null | pyrehol/__init__.py | fakeNetflix/uber-repo-pyrehol | 7c8b75e1780c7e85cb77748fbdf3cf6fa6c14294 | [
"MIT"
] | null | null | null | pyrehol/__init__.py | fakeNetflix/uber-repo-pyrehol | 7c8b75e1780c7e85cb77748fbdf3cf6fa6c14294 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import cStringIO
import types
__name__ = 'pyrehol'
__author__ = 'James Brown <jbrown@uber.com>'
version_info = (0, 3)
__version__ = '.'.join(map(str, version_info))
INDENT_CHAR = ' '
PREDEFINED_SERVICES = frozenset([
'any', 'anystateless', 'all',
'AH', 'apcupsd', 'apc... | 35.460894 | 110 | 0.589681 | from __future__ import absolute_import
import cStringIO
import types
__name__ = 'pyrehol'
__author__ = 'James Brown <jbrown@uber.com>'
version_info = (0, 3)
__version__ = '.'.join(map(str, version_info))
INDENT_CHAR = ' '
PREDEFINED_SERVICES = frozenset([
'any', 'anystateless', 'all',
'AH', 'apcupsd', 'apc... | 3,780 | 5,408 | 397 |
6b990586083411f6986cff94ef38575c8d9185de | 691 | py | Python | Lib/site-packages/win32/test/test_win32print.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2022-02-25T13:46:54.000Z | 2022-02-25T13:46:54.000Z | Lib/site-packages/win32/test/test_win32print.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/win32/test/test_win32print.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2022-02-25T13:47:47.000Z | 2022-02-25T13:47:47.000Z | # Tests (scarce) for win32print module
import os
import unittest
import win32print as wprn
if __name__ == "__main__":
unittest.main()
| 26.576923 | 81 | 0.677279 | # Tests (scarce) for win32print module
import os
import unittest
import win32print as wprn
class Win32PrintTestCase(unittest.TestCase):
def setUp(self):
self.printer_idx = 0
self.printer_levels_all = list(range(1, 10))
self.local_printers = wprn.EnumPrinters(wprn.PRINTER_ENUM_LOCAL, None... | 449 | 23 | 76 |
1a6e55efc63a6e46a26098f90cb96d56d38f48aa | 7,070 | py | Python | modelvshuman/datasets/create_dataset.py | TizianThieringer/model-vs-human | 17729b8167520f682d93d55c340c27de07bb2681 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 158 | 2021-06-04T15:19:58.000Z | 2022-03-30T00:31:28.000Z | modelvshuman/datasets/create_dataset.py | TizianThieringer/model-vs-human | 17729b8167520f682d93d55c340c27de07bb2681 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 7 | 2021-07-20T03:57:34.000Z | 2022-02-01T11:00:47.000Z | modelvshuman/datasets/create_dataset.py | TizianThieringer/model-vs-human | 17729b8167520f682d93d55c340c27de07bb2681 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 14 | 2021-06-16T13:33:11.000Z | 2022-03-29T15:04:09.000Z | #!/usr/bin/env python3
"""
Create dataset and experiments.
A dataset is a directory with subdirectories, one subdir per class.
An experiment is a directory subdirectories, one subdir per participant.
"""
import os
from os.path import join as pjoin
from os import listdir as ld
import numpy as np
import shutil
import s... | 36.632124 | 121 | 0.599717 | #!/usr/bin/env python3
"""
Create dataset and experiments.
A dataset is a directory with subdirectories, one subdir per class.
An experiment is a directory subdirectories, one subdir per participant.
"""
import os
from os.path import join as pjoin
from os import listdir as ld
import numpy as np
import shutil
import s... | 3,615 | 0 | 46 |
989c61bb976af823ae52ec40394e5d1ec9e1e616 | 18,061 | py | Python | roxbot/cogs/voice.py | TBTerra/roxbot | 14ae7524201d6f795eefd33041c7a97b8868a521 | [
"MIT"
] | null | null | null | roxbot/cogs/voice.py | TBTerra/roxbot | 14ae7524201d6f795eefd33041c7a97b8868a521 | [
"MIT"
] | null | null | null | roxbot/cogs/voice.py | TBTerra/roxbot | 14ae7524201d6f795eefd33041c7a97b8868a521 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2017-2018 Roxanne Gibson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | 38.509595 | 173 | 0.71253 | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2017-2018 Roxanne Gibson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | 2,803 | 12,821 | 139 |
4b499df6f92f959afcd92c59e28a63a941fc08bc | 729 | py | Python | ebr_trackerbot/command/untrack.py | tomtom-international/ebr-trackerbot | 327e43a1708aa01ef2022a3d786a72eab9274872 | [
"Apache-2.0"
] | null | null | null | ebr_trackerbot/command/untrack.py | tomtom-international/ebr-trackerbot | 327e43a1708aa01ef2022a3d786a72eab9274872 | [
"Apache-2.0"
] | 12 | 2019-08-02T12:31:47.000Z | 2019-08-16T11:45:42.000Z | ebr_trackerbot/command/untrack.py | LaudateCorpus1/ebr-trackerbot | 327e43a1708aa01ef2022a3d786a72eab9274872 | [
"Apache-2.0"
] | 1 | 2021-09-14T04:04:36.000Z | 2021-09-14T04:04:36.000Z | """
Slack Bot Untrack Command
"""
import logging
from ebr_trackerbot.bot import register_command, get_storage
def untrack_command(text, result, payload, config, commands):
"""
Slack Bot Untrack Command
"""
logging.debug("Untrack command")
test = result.group(1)
get_storage()["delete_for_user"... | 26.035714 | 113 | 0.672154 | """
Slack Bot Untrack Command
"""
import logging
from ebr_trackerbot.bot import register_command, get_storage
def untrack_command(text, result, payload, config, commands):
"""
Slack Bot Untrack Command
"""
logging.debug("Untrack command")
test = result.group(1)
get_storage()["delete_for_user"... | 0 | 0 | 0 |
a4744648f99aed2d6c2a7a6e702f3a4e944b14f0 | 7,651 | py | Python | RecoEgamma/EgammaMCTools/test/pfClusterForCalibration.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoEgamma/EgammaMCTools/test/pfClusterForCalibration.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoEgamma/EgammaMCTools/test/pfClusterForCalibration.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # EGM skimmer
# Author: Rafael Lopes de Sa
import FWCore.ParameterSet.Config as cms
# Run with the 2017 detector
from Configuration.Eras.Era_Run2_2017_cff import Run2_2017
process = cms.Process('SKIM',Run2_2017)
# Import the standard packages for reconstruction and digitization
process.load('Configuration.StandardSe... | 67.114035 | 191 | 0.66671 | # EGM skimmer
# Author: Rafael Lopes de Sa
import FWCore.ParameterSet.Config as cms
# Run with the 2017 detector
from Configuration.Eras.Era_Run2_2017_cff import Run2_2017
process = cms.Process('SKIM',Run2_2017)
# Import the standard packages for reconstruction and digitization
process.load('Configuration.StandardSe... | 0 | 0 | 0 |
e86d0fe71bb121a1115b9c3ad10fc4dbf87a3968 | 409 | py | Python | runesanalyzer/tests.py | clemsciences/runes-analyzer | 0af8baaf604179c31dcbf28b1a023ca650a9ff34 | [
"MIT"
] | 5 | 2018-10-17T15:35:51.000Z | 2022-01-23T10:57:55.000Z | runesanalyzer/tests.py | clemsciences/runes-analyzer | 0af8baaf604179c31dcbf28b1a023ca650a9ff34 | [
"MIT"
] | 5 | 2018-06-25T16:06:00.000Z | 2018-09-09T13:50:16.000Z | runesanalyzer/tests.py | clemsciences/runes-analyzer | 0af8baaf604179c31dcbf28b1a023ca650a9ff34 | [
"MIT"
] | null | null | null | """
"""
import unittest
from runesanalyzer import data
__author__ = ["Clément Besnier <clemsciences@aol.com>", ]
| 27.266667 | 119 | 0.513447 | """
"""
import unittest
from runesanalyzer import data
__author__ = ["Clément Besnier <clemsciences@aol.com>", ]
class Tests(unittest.TestCase):
def test_elder_futhark(self):
self.assertListEqual(['ᚠ', 'ᚢ', 'ᚦ', 'ᚨ', 'ᚱ', 'ᚲ', 'ᚷ', 'ᚹ', 'ᚺ', 'ᚾ', 'ᛁ', 'ᛃ', 'ᛇ', 'ᛈ', 'ᛉ', 'ᛊ', 'ᛏ', 'ᛒ',
... | 281 | 10 | 49 |
baf69027186fe85ed22eec3cf5fd7e5276dfca83 | 3,759 | py | Python | spec_uploader.py | uk-gov-mirror/nhsdigital.api-platform | 4e634b70268a3509b3f53ea2c87e41eeececfeda | [
"MIT"
] | null | null | null | spec_uploader.py | uk-gov-mirror/nhsdigital.api-platform | 4e634b70268a3509b3f53ea2c87e41eeececfeda | [
"MIT"
] | 56 | 2020-03-31T09:03:19.000Z | 2021-07-28T02:07:50.000Z | spec_uploader.py | uk-gov-mirror/nhsdigital.api-platform | 4e634b70268a3509b3f53ea2c87e41eeececfeda | [
"MIT"
] | 1 | 2021-04-11T07:33:15.000Z | 2021-04-11T07:33:15.000Z | """
spec_uploader.py
A tool for uploading apigee specs
Usage:
spec_uploader.py <apigee_org> <specs_dir> -u <username> -p <password> [-t <apigee_token>]
spec_uploader.py (-h | --help)
Options:
-h --help Show this screen
-u Which username to log in with
-p Password for login
-t Acc... | 32.973684 | 124 | 0.597233 | """
spec_uploader.py
A tool for uploading apigee specs
Usage:
spec_uploader.py <apigee_org> <specs_dir> -u <username> -p <password> [-t <apigee_token>]
spec_uploader.py (-h | --help)
Options:
-h --help Show this screen
-u Which username to log in with
-p Password for login
-t Acc... | 2,575 | 0 | 46 |
2012588b8fb7495ab120e653910b9eb717841ec4 | 119 | py | Python | ekorpkit/models/transformer/__init__.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | 4 | 2022-02-26T10:54:16.000Z | 2022-02-26T11:01:56.000Z | ekorpkit/models/transformer/__init__.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | 1 | 2022-03-25T06:37:12.000Z | 2022-03-25T06:45:53.000Z | ekorpkit/models/transformer/__init__.py | entelecheia/eKorpKit | 9521ae4c4749419fa2b088d1b9e518e5927b7cb8 | [
"CC-BY-4.0"
] | null | null | null | from .simple import (
SimpleNER,
SimpleMultiLabel,
SimpleClassification,
)
from .simple_t5 import SimpleT5
| 17 | 31 | 0.739496 | from .simple import (
SimpleNER,
SimpleMultiLabel,
SimpleClassification,
)
from .simple_t5 import SimpleT5
| 0 | 0 | 0 |
6ef6bb588ed00ad965b37321174f6dabafe870a9 | 1,001 | py | Python | target_to_lines.py | crazydigger/ru_summarization_mbart | 9da680bd67f869de9094c26f7a8a8e6b4c1b06bf | [
"Apache-2.0"
] | 1 | 2021-09-02T06:46:31.000Z | 2021-09-02T06:46:31.000Z | target_to_lines.py | AlexKay28/summarus | 9da680bd67f869de9094c26f7a8a8e6b4c1b06bf | [
"Apache-2.0"
] | null | null | null | target_to_lines.py | AlexKay28/summarus | 9da680bd67f869de9094c26f7a8a8e6b4c1b06bf | [
"Apache-2.0"
] | 1 | 2021-01-04T02:22:57.000Z | 2021-01-04T02:22:57.000Z | import argparse
from allennlp.common.params import Params
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.models.archival import load_archive
from summarus.readers import *
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--archive-file... | 35.75 | 76 | 0.705295 | import argparse
from allennlp.common.params import Params
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.models.archival import load_archive
from summarus.readers import *
def target_to_lines(archive_file, input_file, output_file, lowercase=True):
archive = load_archive(arc... | 434 | 0 | 23 |
46d7bd2bfb36cc2efd9ae401ded0e3b065c81bac | 1,029 | py | Python | tempest/services/orchestration/json/dns_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/services/orchestration/json/dns_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/services/orchestration/json/dns_client.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | __author__ = 'sabe6191'
import json
import datetime
from tempest.common import rest_client
| 33.193548 | 77 | 0.60447 | __author__ = 'sabe6191'
import json
import datetime
from tempest.common import rest_client
class DnsClient(rest_client.RestClient):
def __init__(self, config, username, password, auth_url,
token_url ,tenant_name=None):
super(DnsClient, self).__init__(config, username, password, auth_ur... | 817 | 19 | 100 |
983fe14532b3a5a93ae1262c586285af92006ebf | 505 | py | Python | list_remove_duplicate.py | xiaoledeng/python-tiny-functions | bf31421f4ea06b71c26fcc3de7b2134060ed34dc | [
"MIT"
] | 1 | 2019-09-19T15:09:14.000Z | 2019-09-19T15:09:14.000Z | list_remove_duplicate.py | xiaoledeng/python-tiny-functions | bf31421f4ea06b71c26fcc3de7b2134060ed34dc | [
"MIT"
] | null | null | null | list_remove_duplicate.py | xiaoledeng/python-tiny-functions | bf31421f4ea06b71c26fcc3de7b2134060ed34dc | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
Date: 2019/11/27
Author: Xiao-Le Deng
Email: xiaoledeng at gmail.com
Function: remove duplicates in a given list
"""
# List1 = [1,1,1]
# List2 = ["John","John","John","Mark","David","David","Shalom","Shalom","Shalom"]
# print(list_remove_duplicate(List1))
# print... | 26.578947 | 82 | 0.706931 | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
"""
Date: 2019/11/27
Author: Xiao-Le Deng
Email: xiaoledeng at gmail.com
Function: remove duplicates in a given list
"""
def list_remove_duplicate(original_list):
format_list = list(set(original_list))
format_list.sort(key=original_list.index)
return forma... | 132 | 0 | 23 |
d1d3d70a9689a9253aab1fb4196730cfab689e31 | 618 | py | Python | neighbor/tests.py | olesigilai/neighborhood | d188323f45ea000320903cfc6b871abcf346e326 | [
"MIT",
"Unlicense"
] | null | null | null | neighbor/tests.py | olesigilai/neighborhood | d188323f45ea000320903cfc6b871abcf346e326 | [
"MIT",
"Unlicense"
] | null | null | null | neighbor/tests.py | olesigilai/neighborhood | d188323f45ea000320903cfc6b871abcf346e326 | [
"MIT",
"Unlicense"
] | null | null | null | from django.test import TestCase
from django.contrib.auth.models import User
from .models import healthservices,neighbourhood
import datetime as dt
# Create your tests here.
| 28.090909 | 63 | 0.726537 | from django.test import TestCase
from django.contrib.auth.models import User
from .models import healthservices,neighbourhood
import datetime as dt
# Create your tests here.
class neighbourhoodTestClass(TestCase):
def setUp(self):
self.kataret = neighbourhood(neighbourhood='kataret')
def test_instance... | 295 | 18 | 129 |
e09e9e063bc8a78a97ab704726d573106da2d907 | 1,223 | py | Python | setup.py | park-sungmoo/morfessor | b6356c877f4af28d90bda2373b3b71bd371a3273 | [
"BSD-2-Clause"
] | 2 | 2021-03-28T00:12:00.000Z | 2021-03-28T20:38:57.000Z | setup.py | park-sungmoo/morfessor | b6356c877f4af28d90bda2373b3b71bd371a3273 | [
"BSD-2-Clause"
] | null | null | null | setup.py | park-sungmoo/morfessor | b6356c877f4af28d90bda2373b3b71bd371a3273 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from codecs import open
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
main_py = open('morfessor/__init__.py', encoding='utf-8').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
requires = [
# 'progressbar',
]
setup(na... | 28.44186 | 74 | 0.591169 | #!/usr/bin/env python
from codecs import open
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
main_py = open('morfessor/__init__.py', encoding='utf-8').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
requires = [
# 'progressbar',
]
setup(na... | 0 | 0 | 0 |
5c07f3f58be4aba3c39cf1aebdf84f5e6d58c7f0 | 4,918 | py | Python | tests/docs_test.py | loganasherjones/yapconf | 0199d8b232fa50a590aac7dd5cc772efc1f7872c | [
"MIT"
] | 20 | 2018-01-30T14:32:40.000Z | 2020-08-04T21:31:37.000Z | tests/docs_test.py | loganasherjones/yapconf | 0199d8b232fa50a590aac7dd5cc772efc1f7872c | [
"MIT"
] | 95 | 2018-02-01T05:06:06.000Z | 2022-03-30T00:41:33.000Z | tests/docs_test.py | loganasherjones/yapconf | 0199d8b232fa50a590aac7dd5cc772efc1f7872c | [
"MIT"
] | 7 | 2018-02-06T21:15:24.000Z | 2021-11-04T16:39:20.000Z | # -*- coding: utf-8 -*-
from yapconf.docs import build_markdown_table
# flake8: noqa
| 27.943182 | 104 | 0.530907 | # -*- coding: utf-8 -*-
from yapconf.docs import build_markdown_table
# flake8: noqa
def test_build_markdown_table():
headers = {'foo': 'Foo', 'bar': 'Bar'}
rows = [
{
'bar': 'bar_value',
'foo': 'x',
},
{
'bar': 'bar_value2',
'foo': 'y',... | 4,784 | 0 | 45 |
168c20682896b2ca672a403ebe967cd8636d6ded | 10,132 | py | Python | src/core_modules/config.py | dngfx/MagicBot | 56abfce2aac28f36e24ebe00229625196b269907 | [
"WTFPL"
] | 1 | 2020-12-31T03:10:42.000Z | 2020-12-31T03:10:42.000Z | src/core_modules/config.py | dngfx/MagicBot | 56abfce2aac28f36e24ebe00229625196b269907 | [
"WTFPL"
] | 3 | 2020-10-12T21:27:28.000Z | 2021-08-12T09:46:55.000Z | src/core_modules/config.py | dngfx/MagicBot | 56abfce2aac28f36e24ebe00229625196b269907 | [
"WTFPL"
] | 1 | 2020-10-12T21:17:58.000Z | 2020-10-12T21:17:58.000Z | # --depends-on channel_access
# --depends-on check_mode
# --depends-on commands
# --depends-on permissions
import enum
from src import ModuleManager, utils
| 37.947566 | 85 | 0.554777 | # --depends-on channel_access
# --depends-on check_mode
# --depends-on commands
# --depends-on permissions
import enum
from src import ModuleManager, utils
class ConfigInvalidValue(Exception):
def __init__(self, message: str = None):
self.message = message
class ConfigSettingInexistent(Exception):
... | 9,037 | 580 | 351 |
41dbe518bd2b960e579c5e5fae4ea30bac2b30e3 | 6,597 | py | Python | src/pytest_mock_resources/patch/redshift/mock_s3_copy.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 49 | 2020-01-24T21:08:43.000Z | 2022-03-31T23:55:21.000Z | src/pytest_mock_resources/patch/redshift/mock_s3_copy.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 29 | 2020-03-11T19:07:50.000Z | 2022-03-30T16:49:06.000Z | src/pytest_mock_resources/patch/redshift/mock_s3_copy.py | schireson/pytest-mock-resources | a09fc18eeeac06c5589854ce200fa45f64c81cb5 | [
"MIT"
] | 10 | 2020-01-23T19:04:09.000Z | 2022-02-22T19:57:54.000Z | import binascii
import csv
import gzip
import io
import sys
from sqlalchemy import MetaData, Table
from pytest_mock_resources.compat import boto3
def _parse_s3_command(statement):
"""Format, Parse and call patched 'COPY' command."""
statement = strip(statement)
params = dict()
# deleting copy
... | 38.578947 | 100 | 0.609974 | import binascii
import csv
import gzip
import io
import sys
from sqlalchemy import MetaData, Table
from pytest_mock_resources.compat import boto3
def execute_mock_s3_copy_command(statement, engine):
params = _parse_s3_command(statement)
_mock_s3_copy(
table_name=params["table_name"],
schema... | 1,028 | 0 | 46 |
bd3b17572e5745406f81307baf82b51be3e01f17 | 682 | py | Python | src/iotools/__init__.py | chinarjoshi/polar-rover | b46ffc89352a0fb1520d86e00f5c24983fdbf79c | [
"MIT"
] | null | null | null | src/iotools/__init__.py | chinarjoshi/polar-rover | b46ffc89352a0fb1520d86e00f5c24983fdbf79c | [
"MIT"
] | null | null | null | src/iotools/__init__.py | chinarjoshi/polar-rover | b46ffc89352a0fb1520d86e00f5c24983fdbf79c | [
"MIT"
] | null | null | null | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from iotools.config import Config
db = SQLAlchemy()
bcrypt = Bcrypt()
login_manager = LoginManager()
login_manager.login_view = 'sessions.login'
login_manager.login_message_category = '... | 23.517241 | 48 | 0.777126 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_bcrypt import Bcrypt
from iotools.config import Config
db = SQLAlchemy()
bcrypt = Bcrypt()
login_manager = LoginManager()
login_manager.login_view = 'sessions.login'
login_manager.login_message_category = '... | 332 | 0 | 23 |