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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e0a6695f8736118c0d94424f036096c59ed23de3 | 4,556 | py | Python | tests/test_VirtualPIPoint_calculus.py | ldariva/PIconnect | b0258e7d5b3039c859295d1faf7f0170f3f3db04 | [
"MIT"
] | null | null | null | tests/test_VirtualPIPoint_calculus.py | ldariva/PIconnect | b0258e7d5b3039c859295d1faf7f0170f3f3db04 | [
"MIT"
] | null | null | null | tests/test_VirtualPIPoint_calculus.py | ldariva/PIconnect | b0258e7d5b3039c859295d1faf7f0170f3f3db04 | [
"MIT"
] | null | null | null | """Test VirtualPIPoint calculus."""
# Copyright 2017 Hugo van den Berg, Stijn de Jong
# 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 ri... | 37.966667 | 88 | 0.672739 | """Test VirtualPIPoint calculus."""
# Copyright 2017 Hugo van den Berg, Stijn de Jong
# 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 ri... | 0 | 0 | 0 |
370abdcb9c5f5eaa3c13d892c2a4d878510b4b2b | 152 | py | Python | src/common/__init__.py | ktanakaj/locust-sample | 5b629c591e8ec9b49d509861d7f7198391be0243 | [
"MIT"
] | 7 | 2020-12-01T09:10:00.000Z | 2022-03-11T09:28:51.000Z | src/common/__init__.py | ktanakaj/locust-sample | 5b629c591e8ec9b49d509861d7f7198391be0243 | [
"MIT"
] | null | null | null | src/common/__init__.py | ktanakaj/locust-sample | 5b629c591e8ec9b49d509861d7f7198391be0243 | [
"MIT"
] | 4 | 2020-08-04T21:32:22.000Z | 2021-10-10T09:09:42.000Z | """
HTTPクライアントや認証、環境設定などの共通処理用ディレクトリ
"""
from . import config
from . import auth
from . import utils
from . import locust
from .locust import AppLocust
| 16.888889 | 32 | 0.769737 | """
HTTPクライアントや認証、環境設定などの共通処理用ディレクトリ
"""
from . import config
from . import auth
from . import utils
from . import locust
from .locust import AppLocust
| 0 | 0 | 0 |
c192a3260750e01ff234d720f65208ffeb4244e3 | 12,411 | py | Python | common/human.py | wuyenlin/thesis | 045dc33d681adb5eabab69850ed52d54fa0ba6d9 | [
"BSD-3-Clause"
] | 2 | 2021-08-11T14:16:57.000Z | 2022-02-03T14:52:18.000Z | common/human.py | wuyenlin/thesis | 045dc33d681adb5eabab69850ed52d54fa0ba6d9 | [
"BSD-3-Clause"
] | null | null | null | common/human.py | wuyenlin/thesis | 045dc33d681adb5eabab69850ed52d54fa0ba6d9 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import cmath
import torch
def rot(euler: tuple) -> torch.tensor:
"""
General rotation matrix
:param euler: (a, b, r) rotation in rad in ZYX
:return R: a rotation matrix R
"""
from math import sin, cos
a, b, r = euler[0], euler[1], euler[2]
row1 = torch.tensor([c... | 37.838415 | 112 | 0.505922 | import numpy as np
import cmath
import torch
def rot(euler: tuple) -> torch.tensor:
"""
General rotation matrix
:param euler: (a, b, r) rotation in rad in ZYX
:return R: a rotation matrix R
"""
from math import sin, cos
a, b, r = euler[0], euler[1], euler[2]
row1 = torch.tensor([c... | 6,953 | 0 | 153 |
17c8142102879456649c890220b311be866fafa2 | 3,760 | py | Python | pcwg/core/uncertainty.py | lcameron05/PCWG | 8ae8ea7d644aa5bec0d1651101d83d8f17994f4b | [
"MIT"
] | 14 | 2015-01-15T12:40:51.000Z | 2019-06-14T16:10:08.000Z | pcwg/core/uncertainty.py | lzhiwen3090/PCWG | 795e3ea267c7b87187dce04721c91a9d9c7999a7 | [
"MIT"
] | 121 | 2015-01-06T11:31:25.000Z | 2018-05-29T21:13:23.000Z | pcwg/core/uncertainty.py | lzhiwen3090/PCWG | 795e3ea267c7b87187dce04721c91a9d9c7999a7 | [
"MIT"
] | 26 | 2015-01-15T12:41:09.000Z | 2019-04-11T14:45:32.000Z | import pandas as pd
import numpy as np
import datetime
import math
import binning
from ..core.status import Status
config = Config()
analysis = Analysis(config)
| 29.84127 | 204 | 0.710638 | import pandas as pd
import numpy as np
import datetime
import math
import binning
from ..core.status import Status
class Config:
def __init__(self):
self.inputTimeSeriesPath = "test.dat"
self.timeStamp = "Date & Time Stamp"
self.actualPower = "Power"
self.inputHubWindSpeed = "WindSpeed"
self.dateForm... | 3,388 | 20 | 188 |
017c4886b53db2a500cdf1e0f77b63e9c4effdfe | 564 | py | Python | tests/test_sell_stats.py | randomecho/trending-on-the-bay | 9fae6ac312728e2de0ec9d698f2ded0c52462f1a | [
"BSD-3-Clause"
] | 4 | 2018-07-24T22:12:08.000Z | 2020-11-23T00:55:29.000Z | tests/test_sell_stats.py | randomecho/trending-on-the-bay | 9fae6ac312728e2de0ec9d698f2ded0c52462f1a | [
"BSD-3-Clause"
] | 1 | 2020-01-16T17:42:30.000Z | 2020-01-19T01:40:51.000Z | tests/test_sell_stats.py | randomecho/trending-on-the-bay | 9fae6ac312728e2de0ec9d698f2ded0c52462f1a | [
"BSD-3-Clause"
] | null | null | null | import pytest
import sell_stats
| 19.448276 | 48 | 0.725177 | import pytest
import sell_stats
def test_get_nothing_on_empty_results():
result = sell_stats.generate_stats([])
assert result is None
def test_calculate_average_on_empty_list():
result = sell_stats.calculate_average([])
assert result == 0.0
def test_calculate_average_on_short_list():
sales =... | 436 | 0 | 92 |
54f65294913834cdb0df9058f17209401f82fb25 | 2,052 | py | Python | test/test_check_contact_information.py | Haytay42/python_training | bcc29505ad769547d48ffcb9f29ebe4cd04a4552 | [
"Apache-2.0"
] | null | null | null | test/test_check_contact_information.py | Haytay42/python_training | bcc29505ad769547d48ffcb9f29ebe4cd04a4552 | [
"Apache-2.0"
] | null | null | null | test/test_check_contact_information.py | Haytay42/python_training | bcc29505ad769547d48ffcb9f29ebe4cd04a4552 | [
"Apache-2.0"
] | null | null | null | import re
import allure
from model.contact import Contact
| 54 | 155 | 0.698343 | import re
import allure
from model.contact import Contact
def test_check_contact_information(app, db):
with allure.step('Given a non-empty contact list from db'):
old_contacts = db.get_contact_list()
with allure.step('When i get contact information lists from home page and edit page'):
contact... | 1,898 | 0 | 92 |
d3cb4f370b6e1f7b0d2fffa4c39c43669201c631 | 5,088 | py | Python | src/mofa/settings.py | uu-mofa/mofa | a1fcd014c3f27572c9e5888d27799c5afda19a40 | [
"Apache-2.0"
] | null | null | null | src/mofa/settings.py | uu-mofa/mofa | a1fcd014c3f27572c9e5888d27799c5afda19a40 | [
"Apache-2.0"
] | 5 | 2020-06-06T01:07:51.000Z | 2021-06-09T18:52:55.000Z | src/mofa/settings.py | uu-mofa/mofa | a1fcd014c3f27572c9e5888d27799c5afda19a40 | [
"Apache-2.0"
] | null | null | null | # This program has been developed by students from the bachelor Computer Science at Utrecht University within the
# Software and Game project course
# ©Copyright Utrecht University Department of Information and Computing Sciences.
"""
Django settings for mofa project.
Generated by 'django-admin startproject' using Dja... | 31.214724 | 113 | 0.696737 | # This program has been developed by students from the bachelor Computer Science at Utrecht University within the
# Software and Game project course
# ©Copyright Utrecht University Department of Information and Computing Sciences.
"""
Django settings for mofa project.
Generated by 'django-admin startproject' using Dja... | 0 | 0 | 0 |
df92567caa8a7a35d31ca591c16e1e5acf9c0882 | 1,010 | py | Python | packages/conan/recipes/pybind11/test_package/conanfile.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | 3 | 2019-07-02T20:05:35.000Z | 2021-09-14T17:35:25.000Z | packages/conan/recipes/pybind11/test_package/conanfile.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | null | null | null | packages/conan/recipes/pybind11/test_package/conanfile.py | boberfly/aswf-docker | 96fa383baa4584b0d389df4759b7cdb832a57873 | [
"Apache-2.0"
] | null | null | null | from conans import ConanFile, CMake, tools
import os
| 34.827586 | 71 | 0.556436 | from conans import ConanFile, CMake, tools
import os
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch", "python"
generators = "cmake", "cmake_find_package"
def build(self):
cmake = CMake(self)
cmake.definitions["PYTHON_EXECUTABLE"] = os.path.join(
... | 755 | 178 | 23 |
4cbeec00f9e0b7b5e40a89c412a779cda681b5ba | 705 | py | Python | Python/IntegerPartition.py | patres270/AlgoLib | 8b697e1e9348c559dcabdb6665e1031264c1032a | [
"MIT"
] | 19 | 2018-10-01T15:01:43.000Z | 2022-03-01T01:28:23.000Z | Python/IntegerPartition.py | patres270/AlgoLib | 8b697e1e9348c559dcabdb6665e1031264c1032a | [
"MIT"
] | 95 | 2018-10-01T14:43:45.000Z | 2018-12-19T14:20:22.000Z | Python/IntegerPartition.py | patres270/AlgoLib | 8b697e1e9348c559dcabdb6665e1031264c1032a | [
"MIT"
] | 93 | 2018-10-01T14:54:28.000Z | 2020-10-02T08:51:29.000Z | """ The (Linear) Integer Partition Problem into k equal parts """
l = [7, 3, 2, 1, 5, 4, 8]
k = 3
n = len(l)
mat = [[l[0] for j in range(k)] for i in range(n)]
div = [[0 for i in range(k)] for i in range(n)]
for i in range(n):
mat[i][0] = sum(l[:i+1])
for i in range(1, k):
for j in range(1, n):
x = l... | 24.310345 | 65 | 0.489362 | """ The (Linear) Integer Partition Problem into k equal parts """
l = [7, 3, 2, 1, 5, 4, 8]
k = 3
n = len(l)
mat = [[l[0] for j in range(k)] for i in range(n)]
div = [[0 for i in range(k)] for i in range(n)]
def partition(n, k, li):
if (k>0) :
print(l[div[n][k]+1:li])
partition(div[n][k], k-1, div... | 132 | 0 | 23 |
ec3ced45eb7da8c175ca8b806073574b0efb9fe7 | 969 | py | Python | model/model.py | rdverse/ReproMultiModal | 6d47c71f72eb33ffb6e5065f6457fb2a9753ef50 | [
"MIT"
] | null | null | null | model/model.py | rdverse/ReproMultiModal | 6d47c71f72eb33ffb6e5065f6457fb2a9753ef50 | [
"MIT"
] | null | null | null | model/model.py | rdverse/ReproMultiModal | 6d47c71f72eb33ffb6e5065f6457fb2a9753ef50 | [
"MIT"
] | null | null | null |
from transformers import ViltProcessor, ViltModel
from PIL import Image
import requests
import os
# prepare image and text
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
text = "hello world"
processor = ViltProcessor.from_pretrained("dandelin/vilt... | 32.3 | 66 | 0.733746 |
from transformers import ViltProcessor, ViltModel
from PIL import Image
import requests
import os
# prepare image and text
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
text = "hello world"
processor = ViltProcessor.from_pretrained("dandelin/vilt... | 420 | 0 | 23 |
39c8373300c538be91c5b8f1731eae360adae5af | 10,611 | py | Python | genshin/models/honkai/chronicle/modes.py | thesadru/genshin.py | 806b8d0dd059a06605e66dead917fdf550a552bc | [
"MIT"
] | 63 | 2021-10-04T19:53:54.000Z | 2022-03-30T07:21:03.000Z | genshin/models/honkai/chronicle/modes.py | thesadru/genshin.py | 806b8d0dd059a06605e66dead917fdf550a552bc | [
"MIT"
] | 17 | 2021-11-16T20:42:52.000Z | 2022-03-31T10:11:52.000Z | genshin/models/honkai/chronicle/modes.py | thesadru/genshin.py | 806b8d0dd059a06605e66dead917fdf550a552bc | [
"MIT"
] | 10 | 2021-10-16T22:41:41.000Z | 2022-02-19T17:55:23.000Z | """Honkai battle chronicle models."""
from __future__ import annotations
import datetime
import re
import typing
import pydantic
from genshin.models.honkai import battlesuit
from genshin.models.model import Aliased, APIModel, Unique
__all__ = [
"Boss",
"ELF",
"ElysianRealm",
"MemorialArena",
"Me... | 31.208824 | 93 | 0.642352 | """Honkai battle chronicle models."""
from __future__ import annotations
import datetime
import re
import typing
import pydantic
from genshin.models.honkai import battlesuit
from genshin.models.model import Aliased, APIModel, Unique
__all__ = [
"Boss",
"ELF",
"ElysianRealm",
"MemorialArena",
"Me... | 1,967 | 0 | 314 |
f86415a35f76cb2fc5a2f66bc46800d925c1720f | 487 | py | Python | data_processing/__main__.py | cprohoda/gene_modelling | a2be12d865fc00118cf51d7c0f85508a6d646479 | [
"MIT"
] | null | null | null | data_processing/__main__.py | cprohoda/gene_modelling | a2be12d865fc00118cf51d7c0f85508a6d646479 | [
"MIT"
] | null | null | null | data_processing/__main__.py | cprohoda/gene_modelling | a2be12d865fc00118cf51d7c0f85508a6d646479 | [
"MIT"
] | null | null | null | import download_genomes
import process_Gnomon
import generate_gene_map
import gene_clustering
from gene_modelling_utils import resolve_args
if __name__=='__main__':
args = resolve_args()
if 'download_genomes' in args.scripts:
download_genomes.main()
if 'process_Gnomon' in args.scripts:
proc... | 30.4375 | 45 | 0.743326 | import download_genomes
import process_Gnomon
import generate_gene_map
import gene_clustering
from gene_modelling_utils import resolve_args
if __name__=='__main__':
args = resolve_args()
if 'download_genomes' in args.scripts:
download_genomes.main()
if 'process_Gnomon' in args.scripts:
proc... | 0 | 0 | 0 |
38f0d0b4c766e580fe7e8ceb48fd1cd1422123f7 | 2,703 | py | Python | python/examples/energise/lpbc.py | sguduguntla/xboswave | 3a23a298354650dae9e086260fc1503d840d2f2a | [
"BSD-3-Clause"
] | 9 | 2019-02-08T01:35:14.000Z | 2021-11-11T14:56:00.000Z | python/examples/energise/lpbc.py | sguduguntla/xboswave | 3a23a298354650dae9e086260fc1503d840d2f2a | [
"BSD-3-Clause"
] | 26 | 2019-02-25T16:57:02.000Z | 2019-08-05T20:44:52.000Z | python/examples/energise/lpbc.py | sguduguntla/xboswave | 3a23a298354650dae9e086260fc1503d840d2f2a | [
"BSD-3-Clause"
] | 5 | 2019-02-05T20:04:40.000Z | 2021-09-14T05:54:03.000Z | from pyxbos.process import run_loop
from pyxbos.drivers import pbc
import logging
logging.basicConfig(level="INFO", format='%(asctime)s - %(name)s - %(message)s')
import random
class democontroller(pbc.LPBCProcess):
"""
To implement a LPBC, subclass pbc.LPBCProcess
and implement the step() method as docume... | 32.963415 | 101 | 0.520533 | from pyxbos.process import run_loop
from pyxbos.drivers import pbc
import logging
logging.basicConfig(level="INFO", format='%(asctime)s - %(name)s - %(message)s')
import random
class democontroller(pbc.LPBCProcess):
"""
To implement a LPBC, subclass pbc.LPBCProcess
and implement the step() method as docume... | 252 | 0 | 26 |
0ac81c440689399298896abbc4943283307f0249 | 188 | py | Python | raiutils/raiutils/__init__.py | ezherdeva/responsible-ai-toolbox | 70895df616ca6f78ec83740e7705f641ef32c127 | [
"MIT"
] | 119 | 2021-12-02T21:00:47.000Z | 2022-03-31T06:44:31.000Z | raiutils/raiutils/__init__.py | ezherdeva/responsible-ai-toolbox | 70895df616ca6f78ec83740e7705f641ef32c127 | [
"MIT"
] | 293 | 2021-11-30T16:45:49.000Z | 2022-03-31T23:57:13.000Z | raiutils/raiutils/__init__.py | ezherdeva/responsible-ai-toolbox | 70895df616ca6f78ec83740e7705f641ef32c127 | [
"MIT"
] | 28 | 2021-12-07T17:28:04.000Z | 2022-03-31T07:47:11.000Z | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
"""Responsible AI Utilities package."""
from .version import name, version
__name__ = name
__version__ = version
| 18.8 | 39 | 0.760638 | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
"""Responsible AI Utilities package."""
from .version import name, version
__name__ = name
__version__ = version
| 0 | 0 | 0 |
41e31b0de89f626a35cce3d4a568f2b7e5698914 | 2,003 | py | Python | helpers/copyleaks.py | lechien73/Python-Plagiarism-Checker | dfe7f995000a29108657724feb5baab135539805 | [
"MIT"
] | null | null | null | helpers/copyleaks.py | lechien73/Python-Plagiarism-Checker | dfe7f995000a29108657724feb5baab135539805 | [
"MIT"
] | null | null | null | helpers/copyleaks.py | lechien73/Python-Plagiarism-Checker | dfe7f995000a29108657724feb5baab135539805 | [
"MIT"
] | null | null | null | import requests
import json
from datetime import datetime, timedelta
import dateutil.parser
import pytz
API_SERVER_URI = 'https://api.copyleaks.com'
IDENTITY_SERVER_URI = 'https://id.copyleaks.com'
USER_AGENT = 'python-sdk/3.0'
| 26.012987 | 118 | 0.614079 | import requests
import json
from datetime import datetime, timedelta
import dateutil.parser
import pytz
API_SERVER_URI = 'https://api.copyleaks.com'
IDENTITY_SERVER_URI = 'https://id.copyleaks.com'
USER_AGENT = 'python-sdk/3.0'
class Products:
BUSINESSES = 'businesses'
EDUCATION = 'education'
class Copyl... | 962 | 762 | 46 |
03965cf3856e7c7bbd150ac2bc53fb4196e56802 | 212 | py | Python | unittesting-with-python/__init__.py | edchelstephens/python-unittest | 2f9ad0abc2d90ca77333ca893961f8ca3e02f864 | [
"BSD-3-Clause"
] | null | null | null | unittesting-with-python/__init__.py | edchelstephens/python-unittest | 2f9ad0abc2d90ca77333ca893961f8ca3e02f864 | [
"BSD-3-Clause"
] | null | null | null | unittesting-with-python/__init__.py | edchelstephens/python-unittest | 2f9ad0abc2d90ca77333ca893961f8ca3e02f864 | [
"BSD-3-Clause"
] | null | null | null | """Unit testing with python coding as following Plurasight course*
* Unit Testing with Python
https://app.pluralsight.com/library/courses/ec92942a-62c7-466e-ba92-56201eaf900f/table-of-contents
By Emily Bache
""" | 35.333333 | 98 | 0.801887 | """Unit testing with python coding as following Plurasight course*
* Unit Testing with Python
https://app.pluralsight.com/library/courses/ec92942a-62c7-466e-ba92-56201eaf900f/table-of-contents
By Emily Bache
""" | 0 | 0 | 0 |
4ccdb02ecb7baac2f4c9a3052a3a1b767643a2c3 | 2,952 | py | Python | src/helpers/propagation.py | Lakoc/bachelor_thesis | 685a81901ac19a318237772f24df1b1e94772b26 | [
"MIT"
] | null | null | null | src/helpers/propagation.py | Lakoc/bachelor_thesis | 685a81901ac19a318237772f24df1b1e94772b26 | [
"MIT"
] | null | null | null | src/helpers/propagation.py | Lakoc/bachelor_thesis | 685a81901ac19a318237772f24df1b1e94772b26 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.special import logsumexp
import params
def forward_backward(lls, tr, ip):
"""
Inputs:
lls - matrix of per-frame log HMM state output probabilities
tr - transition probability matrix
ip - vector of initial state probabilities (i.e. statrting in the state)... | 36 | 105 | 0.612127 | import numpy as np
from scipy.special import logsumexp
import params
def forward_backward(lls, tr, ip):
"""
Inputs:
lls - matrix of per-frame log HMM state output probabilities
tr - transition probability matrix
ip - vector of initial state probabilities (i.e. statrting in the state)... | 0 | 0 | 0 |
9737389767fd2d3ddf8d32577a0fb79b3e62bb17 | 2,667 | py | Python | tests/test_wordle.py | nickdelgrosso/wordguess | 80812c8884be347711d8b9292c60878775610801 | [
"MIT"
] | null | null | null | tests/test_wordle.py | nickdelgrosso/wordguess | 80812c8884be347711d8b9292c60878775610801 | [
"MIT"
] | null | null | null | tests/test_wordle.py | nickdelgrosso/wordguess | 80812c8884be347711d8b9292c60878775610801 | [
"MIT"
] | null | null | null | from typing import List
from pytest import fixture
from pytest_bdd import scenarios, given, when, then
from pytest_bdd.parsers import parse
from game import Game
from puzzle import HintType, Puzzle
from dictionary import Dictionary
@fixture(scope="session")
scenarios("")
@given(
parse('a puzzle where the co... | 24.027027 | 90 | 0.626922 | from typing import List
from pytest import fixture
from pytest_bdd import scenarios, given, when, then
from pytest_bdd.parsers import parse
from game import Game
from puzzle import HintType, Puzzle
from dictionary import Dictionary
@fixture(scope="session")
def dictionary() -> Dictionary:
return Dictionary.from... | 742 | 0 | 176 |
56d93c8f8ef8a731ce31391ecebf864dbe365fd2 | 7,724 | py | Python | Out_of_Sample.py | GatorSense/DREN | c84bc57b00d9b44e240f56ade4e6beab4d449288 | [
"MIT"
] | 4 | 2021-03-09T14:19:21.000Z | 2022-03-01T17:52:06.000Z | Out_of_Sample.py | GatorSense/DREN | c84bc57b00d9b44e240f56ade4e6beab4d449288 | [
"MIT"
] | null | null | null | Out_of_Sample.py | GatorSense/DREN | c84bc57b00d9b44e240f56ade4e6beab4d449288 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 11:27:49 2020
@author: cmccurley
"""
"""
***********************************************************************
* File: Out_of_Sample.py
*
* Desc: This file contains code for out-of-sample embedding methods.
*
* Written by: Connor H. McCurle... | 36.262911 | 221 | 0.526541 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 16 11:27:49 2020
@author: cmccurley
"""
"""
***********************************************************************
* File: Out_of_Sample.py
*
* Desc: This file contains code for out-of-sample embedding methods.
*
* Written by: Connor H. McCurle... | 0 | 0 | 0 |
c96d83ce0a12cd16f4ed022c6e6aba134ec17558 | 17,093 | py | Python | sdk/python/tests/integration/registration/test_sql_registry.py | gojektech/feast | da763c6766cd7bec801312849e884b9dc8f8fb51 | [
"Apache-2.0"
] | 18 | 2018-12-10T09:47:10.000Z | 2018-12-17T15:38:33.000Z | sdk/python/tests/integration/registration/test_sql_registry.py | gojektech/feast | da763c6766cd7bec801312849e884b9dc8f8fb51 | [
"Apache-2.0"
] | 7 | 2018-12-10T10:42:43.000Z | 2018-12-14T15:58:46.000Z | sdk/python/tests/integration/registration/test_sql_registry.py | gojektech/feast | da763c6766cd7bec801312849e884b9dc8f8fb51 | [
"Apache-2.0"
] | 2 | 2018-12-11T02:53:44.000Z | 2018-12-11T07:30:32.000Z | # Copyright 2021 The Feast Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 35.243299 | 140 | 0.694787 | # Copyright 2021 The Feast Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 14,181 | 0 | 154 |
0d6454a08540e5fff13b94e7f9908d44de5576e4 | 4,075 | py | Python | halotools/mock_observables/two_point_clustering/tests/test_angular_tpcf.py | mclaughlin6464/halotools_old | 96fbdf5fc156160f19ccd4ae3ee964f831d26fa6 | [
"BSD-3-Clause"
] | null | null | null | halotools/mock_observables/two_point_clustering/tests/test_angular_tpcf.py | mclaughlin6464/halotools_old | 96fbdf5fc156160f19ccd4ae3ee964f831d26fa6 | [
"BSD-3-Clause"
] | null | null | null | halotools/mock_observables/two_point_clustering/tests/test_angular_tpcf.py | mclaughlin6464/halotools_old | 96fbdf5fc156160f19ccd4ae3ee964f831d26fa6 | [
"BSD-3-Clause"
] | null | null | null | """ Module providing unit-testing for the `~halotools.mock_observables.angular_tpcf` function.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from astropy.tests.helper import pytest
from astropy.utils.misc import NumpyRNGContext
from ..angular_tpcf import ang... | 35.745614 | 94 | 0.746258 | """ Module providing unit-testing for the `~halotools.mock_observables.angular_tpcf` function.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
from astropy.tests.helper import pytest
from astropy.utils.misc import NumpyRNGContext
from ..angular_tpcf import ang... | 3,378 | 0 | 184 |
030274025da61b592fa7ac270311c2eb8c7e5fe6 | 1,983 | py | Python | src/constants.py | LunaLovegoood/traffic-flow | 1ae7eab2944f5013f45c7e105409b3a0965aa658 | [
"MIT"
] | null | null | null | src/constants.py | LunaLovegoood/traffic-flow | 1ae7eab2944f5013f45c7e105409b3a0965aa658 | [
"MIT"
] | null | null | null | src/constants.py | LunaLovegoood/traffic-flow | 1ae7eab2944f5013f45c7e105409b3a0965aa658 | [
"MIT"
] | null | null | null | # Traffic flow
#
# Copyright (c) 2018 Yurii Khomiak
#
# 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, copy, modify, merg... | 38.134615 | 80 | 0.793747 | # Traffic flow
#
# Copyright (c) 2018 Yurii Khomiak
#
# 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, copy, modify, merg... | 0 | 0 | 0 |
b478ba193b136f21d191f214a6c9c78e3b2983a3 | 1,418 | py | Python | examples/lc_engine/rpc_api/view.py | billyrrr/onto | 72733d36a2583ae4758f7cf33a5229b79773702b | [
"MIT"
] | 1 | 2020-10-04T10:01:45.000Z | 2020-10-04T10:01:45.000Z | examples/lc_engine/rpc_api/view.py | billyrrr/onto | 72733d36a2583ae4758f7cf33a5229b79773702b | [
"MIT"
] | null | null | null | examples/lc_engine/rpc_api/view.py | billyrrr/onto | 72733d36a2583ae4758f7cf33a5229b79773702b | [
"MIT"
] | null | null | null | from onto.context import Context as CTX
CTX.load()
engine = CTX.services.engine
from onto.view import Mediator
# class TodoMediatorLc(Mediator):
#
# from onto.source.leancloud import hook
# from onto.sink.json_rpc import sink
#
# src = hook('Todo')
# snk = sink(uri=f'{JSONRPC_URI}/todo')
#
# @... | 27.803922 | 95 | 0.659379 | from onto.context import Context as CTX
CTX.load()
engine = CTX.services.engine
from onto.view import Mediator
# class TodoMediatorLc(Mediator):
#
# from onto.source.leancloud import hook
# from onto.sink.json_rpc import sink
#
# src = hook('Todo')
# snk = sink(uri=f'{JSONRPC_URI}/todo')
#
# @... | 332 | 207 | 23 |
16a046334a309051b2a34de21f6bdc78beac5bda | 2,798 | py | Python | cookbook_se/recipes/basic/folders.py | EngHabu/flytesnacks | a0afd958084d5da305857eaf548aebb7e245fe43 | [
"Apache-2.0"
] | null | null | null | cookbook_se/recipes/basic/folders.py | EngHabu/flytesnacks | a0afd958084d5da305857eaf548aebb7e245fe43 | [
"Apache-2.0"
] | null | null | null | cookbook_se/recipes/basic/folders.py | EngHabu/flytesnacks | a0afd958084d5da305857eaf548aebb7e245fe43 | [
"Apache-2.0"
] | null | null | null | """
Work with folders
---------------------
Please also see the entry on files. After files, folders are the other fundamental operating system primitive users might find themselves working with. The Flyte IDL's support of folders take the form of `multi-part blobs <https://github.com/lyft/flyteidl/blob/cee566b2e6e109... | 35.871795 | 343 | 0.725876 | """
Work with folders
---------------------
Please also see the entry on files. After files, folders are the other fundamental operating system primitive users might find themselves working with. The Flyte IDL's support of folders take the form of `multi-part blobs <https://github.com/lyft/flyteidl/blob/cee566b2e6e109... | 536 | 0 | 44 |
58f582ac9ee691f711d6057da7d433824b43c00c | 14,199 | py | Python | src/ntupledicts/analyze.py | cqpancoast/ntupledicts | c7c1265a47ed95c2be751fd333399fe16ff96e17 | [
"MIT"
] | 1 | 2020-05-12T14:39:44.000Z | 2020-05-12T14:39:44.000Z | src/ntupledicts/analyze.py | cqpancoast/ntupledicts | c7c1265a47ed95c2be751fd333399fe16ff96e17 | [
"MIT"
] | null | null | null | src/ntupledicts/analyze.py | cqpancoast/ntupledicts | c7c1265a47ed95c2be751fd333399fe16ff96e17 | [
"MIT"
] | null | null | null | """Analyzes the contents of ntuple dicts, track property dicts, and
value lists.
Do things like get the efficiency of an ntuple dict, bin values and
take a measure on each set of binned values, and create custom value
lists that wouldn't be found in the original ntuple.
Also contains a function for finding the error ... | 38.375676 | 78 | 0.651736 | """Analyzes the contents of ntuple dicts, track property dicts, and
value lists.
Do things like get the efficiency of an ntuple dict, bin values and
take a measure on each set of binned values, and create custom value
lists that wouldn't be found in the original ntuple.
Also contains a function for finding the error ... | 0 | 0 | 0 |
aef701599b5a9c5d839b2ecffb4cfa59e4d4d856 | 1,541 | py | Python | plot_pose.py | lottegr/project_simulation | b95d88114a3d2611073d1977393884062f63bdab | [
"Apache-2.0"
] | null | null | null | plot_pose.py | lottegr/project_simulation | b95d88114a3d2611073d1977393884062f63bdab | [
"Apache-2.0"
] | null | null | null | plot_pose.py | lottegr/project_simulation | b95d88114a3d2611073d1977393884062f63bdab | [
"Apache-2.0"
] | null | null | null | import os
from os import listdir
import matplotlib.pyplot as plt
import numpy as np
plots = {}
plotnames_x = []
plotnames_y = []
plotnames_rot = []
for file in listdir():
# read .txt files
if file.endswith('_x.txt'):
name = file[:-4]
plots[name] = []
plotnames_x.append(name)
... | 20.276316 | 48 | 0.556781 | import os
from os import listdir
import matplotlib.pyplot as plt
import numpy as np
plots = {}
plotnames_x = []
plotnames_y = []
plotnames_rot = []
for file in listdir():
# read .txt files
if file.endswith('_x.txt'):
name = file[:-4]
plots[name] = []
plotnames_x.append(name)
... | 0 | 0 | 0 |
4432f0facfe2a07043ff9b9cb7ad150ade37cc5e | 2,784 | py | Python | src/database_metrics/db_actions.py | benjaminysmith/operations | 9b802aa08c5782161c15be3462cc3edb180f7f41 | [
"MIT"
] | 1 | 2020-10-12T09:05:41.000Z | 2020-10-12T09:05:41.000Z | src/database_metrics/db_actions.py | benjaminysmith/operations | 9b802aa08c5782161c15be3462cc3edb180f7f41 | [
"MIT"
] | 21 | 2020-04-02T21:20:58.000Z | 2021-06-16T22:22:42.000Z | src/database_metrics/db_actions.py | benjaminysmith/operations | 9b802aa08c5782161c15be3462cc3edb180f7f41 | [
"MIT"
] | 14 | 2017-10-09T14:25:02.000Z | 2022-03-07T20:54:48.000Z | """Methods which send SQL queries to the MariaDB docker database."""
from docker.models.containers import Container, ExecResult
def _get_epidata_db_size(container: Container) -> ExecResult:
"""
Query the size of the epidata database in megabytes.
Parameters
----------
container: Container
... | 32.372093 | 97 | 0.682471 | """Methods which send SQL queries to the MariaDB docker database."""
from docker.models.containers import Container, ExecResult
def _get_epidata_db_size(container: Container) -> ExecResult:
"""
Query the size of the epidata database in megabytes.
Parameters
----------
container: Container
... | 0 | 0 | 0 |
dc1af8b13488ec8a5a9dfed2f507ed24c6b49d4c | 7,756 | py | Python | sdk/python/pulumi_azure/network/get_nat_gateway.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/network/get_nat_gateway.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure/network/get_nat_gateway.py | suresh198526/pulumi-azure | bf27206a38d7a5c58b3c2c57ec8769fe3d0fc5d7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 39.571429 | 231 | 0.668773 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... | 3,029 | 35 | 127 |
3f9698ccdf78f0c0a4065ad4ef64eeb855d0b55f | 1,068 | py | Python | Automation/ZIP Password Cracker/zipPasswordCracker.py | abdulnsheikh/Projects-in-Python | fdd3f9f54edcabf93fdd76abf35d725e4b12229e | [
"MIT"
] | null | null | null | Automation/ZIP Password Cracker/zipPasswordCracker.py | abdulnsheikh/Projects-in-Python | fdd3f9f54edcabf93fdd76abf35d725e4b12229e | [
"MIT"
] | null | null | null | Automation/ZIP Password Cracker/zipPasswordCracker.py | abdulnsheikh/Projects-in-Python | fdd3f9f54edcabf93fdd76abf35d725e4b12229e | [
"MIT"
] | null | null | null | # Abdulnaser Sheikh
# https://www.linkedin.com/in/abdulnasersheikh/
# ZIP password cracker
# This script iterates through a user provided dictionary and finds the password for the encrypted
import zipfile
'''
zipfile has a method call extractall().
extractall(self, path=None, members=None, pwd=None)
... | 28.105263 | 100 | 0.695693 | # Abdulnaser Sheikh
# https://www.linkedin.com/in/abdulnasersheikh/
# ZIP password cracker
# This script iterates through a user provided dictionary and finds the password for the encrypted
import zipfile
'''
zipfile has a method call extractall().
extractall(self, path=None, members=None, pwd=None)
... | 434 | 0 | 50 |
44007846c6e0089c65f9e18400fd97516bf6d806 | 1,046 | py | Python | Python/convert_librispeech.py | kaiidams/NeMoOnnxSharp | 8726afe9ecccfca02ddd99c2b2989e0ea077bfe7 | [
"Apache-2.0"
] | 2 | 2022-01-01T09:51:01.000Z | 2022-01-12T07:19:32.000Z | Python/convert_librispeech.py | kaiidams/NeMoOnnxSharp | 8726afe9ecccfca02ddd99c2b2989e0ea077bfe7 | [
"Apache-2.0"
] | 1 | 2022-01-11T05:20:08.000Z | 2022-01-11T12:51:39.000Z | Python/convert_librispeech.py | kaiidams/NeMoOnnxSharp | 8726afe9ecccfca02ddd99c2b2989e0ea077bfe7 | [
"Apache-2.0"
] | 1 | 2022-02-07T09:27:49.000Z | 2022-02-07T09:27:49.000Z | import os
import sys
import soundfile as sf
import librosa
id1, id2 = 61, 70968
input_dir = os.path.join(sys.argv[1], "test-clean", str(id1), str(id2))
output_dir = os.path.join("..", "test_data")
transcript_file = os.path.join(input_dir, "%d-%d.trans.txt" % (id1, id2))
output_file = os.path.join(output_dir, "transcri... | 38.740741 | 75 | 0.615679 | import os
import sys
import soundfile as sf
import librosa
id1, id2 = 61, 70968
input_dir = os.path.join(sys.argv[1], "test-clean", str(id1), str(id2))
output_dir = os.path.join("..", "test_data")
transcript_file = os.path.join(input_dir, "%d-%d.trans.txt" % (id1, id2))
output_file = os.path.join(output_dir, "transcri... | 0 | 0 | 0 |
350318491fb8be0b8b2e1257366f69d00d7d6120 | 3,638 | py | Python | scripts/object_recorder_node.py | LAAS-HRI/uwds3 | 42390f62ed5701a32710341b01faa10efc448078 | [
"MIT"
] | 2 | 2020-08-19T06:15:14.000Z | 2021-05-23T09:55:18.000Z | scripts/object_recorder_node.py | LAAS-HRI/uwds3 | 42390f62ed5701a32710341b01faa10efc448078 | [
"MIT"
] | 5 | 2021-01-06T09:00:35.000Z | 2021-01-20T13:22:19.000Z | scripts/object_recorder_node.py | LAAS-HRI/uwds3 | 42390f62ed5701a32710341b01faa10efc448078 | [
"MIT"
] | 2 | 2020-11-18T17:34:43.000Z | 2021-05-23T16:14:17.000Z | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import uuid
import rospy
import cv2
import os
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
from pyuwds3.reasoning.detection.foreground_detector import ForegroundDetector
from pyuwds3.reasoning.tracking.multi_object_tracker import MultiObjectTracker, iou_... | 39.543478 | 135 | 0.565421 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import uuid
import rospy
import cv2
import os
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
from pyuwds3.reasoning.detection.foreground_detector import ForegroundDetector
from pyuwds3.reasoning.tracking.multi_object_tracker import MultiObjectTracker, iou_... | 57 | 3,046 | 23 |
2119bb49d791fd19f9849d3d0d096ecbdfc0f8dc | 10,510 | py | Python | tests/test_runtime_type_checker.py | PJCampi/runtime-type-checker | bccbc098f5bccbe19000a2c14e549311a5c2bd05 | [
"MIT"
] | 4 | 2021-02-25T12:47:28.000Z | 2021-12-22T08:04:01.000Z | tests/test_runtime_type_checker.py | PJCampi/runtime-type-checker | bccbc098f5bccbe19000a2c14e549311a5c2bd05 | [
"MIT"
] | 3 | 2020-10-25T13:36:20.000Z | 2021-06-15T11:03:41.000Z | tests/test_runtime_type_checker.py | PJCampi/runtime-type-checker | bccbc098f5bccbe19000a2c14e549311a5c2bd05 | [
"MIT"
] | 1 | 2020-10-23T00:55:21.000Z | 2020-10-23T00:55:21.000Z | try:
from collections.abc import Sequence as Sequence_co, Callable as Callable_co
except ImportError:
from collections import Sequence as Sequence_co, Callable as Callable_co
from datetime import datetime
from typing import (
Any,
Callable,
ClassVar,
Collection,
Dict,
List,
Mapping,
... | 49.11215 | 117 | 0.631684 | try:
from collections.abc import Sequence as Sequence_co, Callable as Callable_co
except ImportError:
from collections import Sequence as Sequence_co, Callable as Callable_co
from datetime import datetime
from typing import (
Any,
Callable,
ClassVar,
Collection,
Dict,
List,
Mapping,
... | 897 | 0 | 88 |
9115550b1ea2b72a2c72b7dd92ed8a184f5501bd | 124 | py | Python | repeticion/ejercicio2.py | alejandrosuarez28/talleres_programacion- | 8b2ea146b29f3bd85f54ed2c23ec299a29aea6c5 | [
"MIT"
] | null | null | null | repeticion/ejercicio2.py | alejandrosuarez28/talleres_programacion- | 8b2ea146b29f3bd85f54ed2c23ec299a29aea6c5 | [
"MIT"
] | null | null | null | repeticion/ejercicio2.py | alejandrosuarez28/talleres_programacion- | 8b2ea146b29f3bd85f54ed2c23ec299a29aea6c5 | [
"MIT"
] | null | null | null | """
entradas
salidas
"""
i=0
l=[]
for i in range(1,101,2):
if(i%7!=0):
l.append(i)
continue
print(l)
| 8.857143 | 24 | 0.491935 | """
entradas
salidas
"""
i=0
l=[]
for i in range(1,101,2):
if(i%7!=0):
l.append(i)
continue
print(l)
| 0 | 0 | 0 |
1260472ad2d7c428bcc06ab04643dd619374aa61 | 3,219 | py | Python | micro_dl/utils/normalize.py | JohannaRahm/microDL | 2d2cb8c4d69b124cc879daa237915e98c5fed112 | [
"MIT"
] | null | null | null | micro_dl/utils/normalize.py | JohannaRahm/microDL | 2d2cb8c4d69b124cc879daa237915e98c5fed112 | [
"MIT"
] | null | null | null | micro_dl/utils/normalize.py | JohannaRahm/microDL | 2d2cb8c4d69b124cc879daa237915e98c5fed112 | [
"MIT"
] | null | null | null | """Image normalization related functions"""
import numpy as np
import sys
from skimage.exposure import equalize_adapthist
def zscore(input_image, im_mean=None, im_std=None):
"""
Performs z-score normalization. Adds epsilon in denominator for robustness
:param np.array input_image: input image for intensi... | 37 | 78 | 0.713576 | """Image normalization related functions"""
import numpy as np
import sys
from skimage.exposure import equalize_adapthist
def zscore(input_image, im_mean=None, im_std=None):
"""
Performs z-score normalization. Adds epsilon in denominator for robustness
:param np.array input_image: input image for intensi... | 0 | 0 | 0 |
48903eaded7111aae31ec1d6d2db9b18bfac8249 | 1,018 | py | Python | support/changepassword.py | zhuwanjun2008/fortress | 3f0dbc7c14277baa88a3214fc63df3dda1ddcf66 | [
"BSD-2-Clause"
] | 3 | 2015-12-16T08:55:22.000Z | 2017-09-11T14:15:37.000Z | support/changepassword.py | zhuwanjun2008/fortress | 3f0dbc7c14277baa88a3214fc63df3dda1ddcf66 | [
"BSD-2-Clause"
] | null | null | null | support/changepassword.py | zhuwanjun2008/fortress | 3f0dbc7c14277baa88a3214fc63df3dda1ddcf66 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
#coding=utf-8
import sys
import pexpect
import random
if __name__ == '__main__':
try:
newPassword = changepassword('用户名','sudo 密码')
print "IP:xxx.xxx.xxx.xxx"
print "Port:端口"
print "UserName:用户名"
print "NewPassword: %s" %(newPassword)
except Exceptio... | 24.238095 | 110 | 0.665029 | #!/usr/bin/python
#coding=utf-8
import sys
import pexpect
import random
def changepassword(username,sudopasswd):
#生成12位随机字符串作为新密码
newpassword = ''.join(random.sample('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890',16))
commandline = 'sudo passwd ' + username
child = pexpect... | 678 | 0 | 23 |
62e277e6e8be1dc29bec83ab54a7aded5e60861a | 1,888 | py | Python | tests/summarize_schedules/test_calendar_summarizer.py | yoppinews/yoppinews-schedule-bot | c824fc490b75d037d132615ebe6bedab363290a3 | [
"MIT"
] | null | null | null | tests/summarize_schedules/test_calendar_summarizer.py | yoppinews/yoppinews-schedule-bot | c824fc490b75d037d132615ebe6bedab363290a3 | [
"MIT"
] | 1 | 2019-06-30T14:45:48.000Z | 2019-07-01T15:46:34.000Z | tests/summarize_schedules/test_calendar_summarizer.py | yoppinews/yoppinews-schedule-bot | c824fc490b75d037d132615ebe6bedab363290a3 | [
"MIT"
] | 1 | 2019-06-29T14:19:35.000Z | 2019-06-29T14:19:35.000Z | import logging
import datetime
from src.summarize_schedules.calendar_summarizer import GoogleCalendarSummarizer
| 35.622642 | 116 | 0.529661 | import logging
import datetime
from src.summarize_schedules.calendar_summarizer import GoogleCalendarSummarizer
def test_grouping():
s = GoogleCalendarSummarizer({}, datetime.timezone(datetime.timedelta(hours=0)), logging.Logger(name='hoge'))
events = [
{
'kind': 'calendar#event',
... | 1,749 | 0 | 23 |
736bb228c419656432ba12aee0a6bdc6da4eace1 | 3,176 | py | Python | src/envs/base.py | anindex/drqn-study | ab357178bbe6a1e09eda0f19583e8e8444bf4a54 | [
"MIT"
] | null | null | null | src/envs/base.py | anindex/drqn-study | ab357178bbe6a1e09eda0f19583e8e8444bf4a54 | [
"MIT"
] | null | null | null | src/envs/base.py | anindex/drqn-study | ab357178bbe6a1e09eda0f19583e8e8444bf4a54 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
from os.path import join
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
from gym.spaces.box import Box
| 39.209877 | 162 | 0.652393 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
from os.path import join
import numpy as np
from collections import deque
import matplotlib.pyplot as plt
from gym.spaces.box import Box
class Env(object):
def __init__(self, **kwargs):
... | 2,597 | 294 | 23 |
24879290c56c5365ad80f6857920a14e73c0feca | 736 | py | Python | tasks/migrations/0003_tagcount.py | geterodyn/todo_app | 5e6b50c618e0bc363c1909bab202c943e1f50c64 | [
"Unlicense"
] | null | null | null | tasks/migrations/0003_tagcount.py | geterodyn/todo_app | 5e6b50c618e0bc363c1909bab202c943e1f50c64 | [
"Unlicense"
] | null | null | null | tasks/migrations/0003_tagcount.py | geterodyn/todo_app | 5e6b50c618e0bc363c1909bab202c943e1f50c64 | [
"Unlicense"
] | null | null | null | # Generated by Django 2.1.5 on 2019-04-24 17:05
from django.db import migrations, models
| 30.666667 | 114 | 0.588315 | # Generated by Django 2.1.5 on 2019-04-24 17:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tasks', '0002_auto_20190423_2220'),
]
operations = [
migrations.CreateModel(
name='TagCount',
fields=[
... | 0 | 622 | 23 |
52fc283109f8aadfa3dac7e735839ecb686aee3f | 8,579 | py | Python | contacts/qtui.py | nim65s/scripts | 2c61bd77bfca6ae6437654e43ad2bc95d611360a | [
"BSD-2-Clause"
] | null | null | null | contacts/qtui.py | nim65s/scripts | 2c61bd77bfca6ae6437654e43ad2bc95d611360a | [
"BSD-2-Clause"
] | null | null | null | contacts/qtui.py | nim65s/scripts | 2c61bd77bfca6ae6437654e43ad2bc95d611360a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import sys
from datetime import datetime
from pathlib import Path
from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import (QAction, QApplication, QDialog, QFileDialog, QGridLayout, QLabel,
QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, qApp)... | 38.470852 | 113 | 0.56277 | #!/usr/bin/env python3
import sys
from datetime import datetime
from pathlib import Path
from PyQt5.QtCore import QSize
from PyQt5.QtWidgets import (QAction, QApplication, QDialog, QFileDialog, QGridLayout, QLabel,
QLineEdit, QMainWindow, QPushButton, QTableWidget, QTableWidgetItem, qApp)... | 7,500 | 13 | 472 |
1fc2268d42bd8d1562963c28aba9f46676acf8a9 | 453 | py | Python | plugins/meme_image/ori/__init__.py | su226/IdhagnBot | a5db1b6ab69fdf67fd6e53a63b34c6bc863d6609 | [
"MIT"
] | 2 | 2022-02-14T06:37:05.000Z | 2022-03-30T12:18:15.000Z | plugins/meme_image/ori/__init__.py | su226/IdhagnBot | a5db1b6ab69fdf67fd6e53a63b34c6bc863d6609 | [
"MIT"
] | null | null | null | plugins/meme_image/ori/__init__.py | su226/IdhagnBot | a5db1b6ab69fdf67fd6e53a63b34c6bc863d6609 | [
"MIT"
] | null | null | null | from ..util import register, circle
from PIL import Image
import os
plugin_dir = os.path.dirname(os.path.abspath(__file__))
@register(["ori", "拥抱光明", "奥日", "奥里"], "制作Ori拥抱光明图", '''\
/ori - 机器人拥抱光明
/ori <对方> - 对方拥抱光明
可以使用头像,也可以使用图片链接''')
| 28.3125 | 59 | 0.682119 | from ..util import register, circle
from PIL import Image
import os
plugin_dir = os.path.dirname(os.path.abspath(__file__))
@register(["ori", "拥抱光明", "奥日", "奥里"], "制作Ori拥抱光明图", '''\
/ori - 机器人拥抱光明
/ori <对方> - 对方拥抱光明
可以使用头像,也可以使用图片链接''')
async def ori(self: Image.Image) -> Image.Image:
self = circle(self).resize((10... | 192 | 0 | 22 |
77c77bc4ad1ad00e5f816e75ff0d24ab4930037c | 6,061 | py | Python | BurstCube/tests/test_bcSim.py | nkasmanoff/Simulation | 38d47db79cebe8504a03424c564f2207ae2275ac | [
"MIT"
] | null | null | null | BurstCube/tests/test_bcSim.py | nkasmanoff/Simulation | 38d47db79cebe8504a03424c564f2207ae2275ac | [
"MIT"
] | 15 | 2017-04-06T18:52:39.000Z | 2019-08-15T17:48:40.000Z | BurstCube/tests/test_bcSim.py | nkasmanoff/Simulation | 38d47db79cebe8504a03424c564f2207ae2275ac | [
"MIT"
] | 3 | 2017-06-13T17:54:29.000Z | 2018-09-16T15:43:24.000Z | #!/usr/bin/env python
import numpy as np
from numpy.testing import assert_allclose
from astropy.tests.helper import pytest
from pkg_resources import resource_filename
try:
from BurstCube.bcSim import simFile
except ImportError:
pass
try:
from BurstCube.bcSim import simFiles
except ImportError:
pass
... | 31.732984 | 78 | 0.509322 | #!/usr/bin/env python
import numpy as np
from numpy.testing import assert_allclose
from astropy.tests.helper import pytest
from pkg_resources import resource_filename
try:
from BurstCube.bcSim import simFile
except ImportError:
pass
try:
from BurstCube.bcSim import simFiles
except ImportError:
pass
... | 5,220 | 0 | 298 |
28ccac1fca404c53c4f7548262297cd26400f412 | 2,267 | py | Python | demo/eval/eval_cp.py | haiyangxue/fairseq | b142ceec20d69130aea823054b193a0d04a780e3 | [
"MIT"
] | null | null | null | demo/eval/eval_cp.py | haiyangxue/fairseq | b142ceec20d69130aea823054b193a0d04a780e3 | [
"MIT"
] | null | null | null | demo/eval/eval_cp.py | haiyangxue/fairseq | b142ceec20d69130aea823054b193a0d04a780e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# xuehaiyang: xuehaiyang@sogou-inc.com
#
"""
Eval Test
"""
import sys
import os
import threading
if __name__ == "__main__":
checkpoint_path = "/search/odin/haiyang/fairseq_exp/e2e_trans/fairseq/demo/cp"
# item = ["asr_baseline_lr03_noise02/checkpoint17.pt",
... | 35.421875 | 158 | 0.644023 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# xuehaiyang: xuehaiyang@sogou-inc.com
#
"""
Eval Test
"""
import sys
import os
import threading
class DecodeThread(threading.Thread):
def __init__(self, gpu_id, cp, checkpoint_path,task):
super(DecodeThread, self).__init__()
# 调用父类的构造方法
sel... | 982 | 16 | 126 |
847829959f694a51f00294bfa8adb20519b805ba | 1,966 | py | Python | htmlgenerator/html5Symbols.py | bossiernesto/python-snipplets | 26e3e7f651d782abc57389b6b88b4bafeb79540f | [
"BSD-3-Clause"
] | null | null | null | htmlgenerator/html5Symbols.py | bossiernesto/python-snipplets | 26e3e7f651d782abc57389b6b88b4bafeb79540f | [
"BSD-3-Clause"
] | null | null | null | htmlgenerator/html5Symbols.py | bossiernesto/python-snipplets | 26e3e7f651d782abc57389b6b88b4bafeb79540f | [
"BSD-3-Clause"
] | null | null | null | import html4Symbols
REMOVED_SYMBOLS = ['acronym','applet','basefont','big','center','dir','font','frame','frameset','noframes','strike','tt']
NEW_ELEMENTS = [
'canvas',
'audio' ,
'video',
'source',
'embed',
'track',
'datalist', #Specifies a list of pre-defined options for input controls
'keygen', #Defines a key-pa... | 43.688889 | 121 | 0.767548 | import html4Symbols
def diff(a, b):
b = set(b)
return [aa for aa in a if aa not in b]
REMOVED_SYMBOLS = ['acronym','applet','basefont','big','center','dir','font','frame','frameset','noframes','strike','tt']
NEW_ELEMENTS = [
'canvas',
'audio' ,
'video',
'source',
'embed',
'track',
'datalist', #Specifies a... | 52 | 0 | 23 |
8a7bbcba3cae31a04163d754796f97b951de90f3 | 36,468 | py | Python | app.py | Aashrut/Agent-Crop | 65c5b0750ad7560b0752063781c459840a5c75b5 | [
"MIT"
] | 1 | 2021-04-19T20:04:48.000Z | 2021-04-19T20:04:48.000Z | app.py | Aashrut/Agent-Crop | 65c5b0750ad7560b0752063781c459840a5c75b5 | [
"MIT"
] | null | null | null | app.py | Aashrut/Agent-Crop | 65c5b0750ad7560b0752063781c459840a5c75b5 | [
"MIT"
] | null | null | null | import os
import shutil
import time
from flask_apscheduler import APScheduler
import numpy as np
import pandas as pd
from keras.preprocessing.image import ImageDataGenerator
from keras.models import load_model
from PIL import Image
import gdown
from flask import Flask, render_template, request, redirect, flash, send_fr... | 95.465969 | 626 | 0.732121 | import os
import shutil
import time
from flask_apscheduler import APScheduler
import numpy as np
import pandas as pd
from keras.preprocessing.image import ImageDataGenerator
from keras.models import load_model
from PIL import Image
import gdown
from flask import Flask, render_template, request, redirect, flash, send_fr... | 4,878 | 0 | 137 |
d787f0e56c15baf3c0db08292191840210fcca7d | 1,037 | py | Python | scripts/test_etm_beta_theta_tensors.py | lffloyd/reddit-topic-modelling | b34d7095cdd3ee66dfd95f8319f078449213e26f | [
"MIT"
] | 1 | 2022-03-15T03:52:50.000Z | 2022-03-15T03:52:50.000Z | scripts/test_etm_beta_theta_tensors.py | lffloyd/reddit-topic-modelling | b34d7095cdd3ee66dfd95f8319f078449213e26f | [
"MIT"
] | 15 | 2021-04-26T22:31:02.000Z | 2021-05-02T18:45:07.000Z | scripts/test_etm_beta_theta_tensors.py | lffloyd/reddit-topic-modelling | b34d7095cdd3ee66dfd95f8319f078449213e26f | [
"MIT"
] | null | null | null | import torch.tensor
import joblib
import numpy as np
tensor_dict = joblib.load("TENSORS_FILE")
print(tensor_dict["beta"]) # tensor obtido a partir de model.get_beta() no ETM
print(tensor_dict["beta"].size()) # dimensoes do tensor parecem ser KxV (topicos x vocabulario)
beta_sum = torch.sum(tensor_dict["beta"], 1)
pri... | 37.035714 | 95 | 0.756027 | import torch.tensor
import joblib
import numpy as np
tensor_dict = joblib.load("TENSORS_FILE")
print(tensor_dict["beta"]) # tensor obtido a partir de model.get_beta() no ETM
print(tensor_dict["beta"].size()) # dimensoes do tensor parecem ser KxV (topicos x vocabulario)
beta_sum = torch.sum(tensor_dict["beta"], 1)
pri... | 0 | 0 | 0 |
61b35e5d9ad710221eacf98083e96ec8cd15726e | 4,488 | py | Python | src/features/feature_extraction_v0.py | neptune-ai/kaggle-ieee-fraud-detection | 0e55ad18baf3e2f3b42d40812da9f147d9d38417 | [
"MIT"
] | 3 | 2020-04-20T14:45:33.000Z | 2021-06-11T16:27:44.000Z | src/features/feature_extraction_v0.py | neptune-ai/kaggle-ieee-fraud-detection | 0e55ad18baf3e2f3b42d40812da9f147d9d38417 | [
"MIT"
] | null | null | null | src/features/feature_extraction_v0.py | neptune-ai/kaggle-ieee-fraud-detection | 0e55ad18baf3e2f3b42d40812da9f147d9d38417 | [
"MIT"
] | 2 | 2020-04-20T14:45:34.000Z | 2021-06-11T16:27:46.000Z | import os
import neptune
from neptunecontrib.versioning.data import log_data_version
from neptunecontrib.api.utils import get_filepaths
from src.features.const import V0_CAT_COLS
from src.utils import read_config, check_env_vars
from src.features.utils import load_and_merge
check_env_vars()
CONFIG = read_config(conf... | 46.268041 | 115 | 0.659091 | import os
import neptune
from neptunecontrib.versioning.data import log_data_version
from neptunecontrib.api.utils import get_filepaths
from src.features.const import V0_CAT_COLS
from src.utils import read_config, check_env_vars
from src.features.utils import load_and_merge
check_env_vars()
CONFIG = read_config(conf... | 3,817 | 0 | 92 |
464cd7e5f313d4710c1b606074c32932196c0775 | 5,641 | py | Python | homeassistant/components/goalzero/sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 4 | 2021-07-11T09:11:00.000Z | 2022-02-27T14:43:50.000Z | homeassistant/components/goalzero/sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 1,016 | 2019-06-18T21:27:47.000Z | 2020-03-06T11:09:58.000Z | homeassistant/components/goalzero/sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 3 | 2022-01-02T18:49:54.000Z | 2022-01-25T02:03:54.000Z | """Support for Goal Zero Yeti Sensors."""
from __future__ import annotations
from typing import cast
from goalzero import Yeti
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEnt... | 31.691011 | 84 | 0.696153 | """Support for Goal Zero Yeti Sensors."""
from __future__ import annotations
from typing import cast
from goalzero import Yeti
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEnt... | 0 | 0 | 0 |
acf0d6ea1d23ab2cf63abd4584f0762b83c1a7ae | 587 | py | Python | module_generator/WallGen.py | fengjixuchui/HiddenWall | 720b3e58c813b60ac5b3f0ae24484bf8f3881cd1 | [
"BSD-3-Clause"
] | 335 | 2019-04-23T02:31:38.000Z | 2022-03-30T07:52:28.000Z | module_generator/WallGen.py | fengjixuchui/HiddenWall | 720b3e58c813b60ac5b3f0ae24484bf8f3881cd1 | [
"BSD-3-Clause"
] | 2 | 2019-04-21T19:37:23.000Z | 2019-05-12T22:50:47.000Z | module_generator/WallGen.py | fengjixuchui/HiddenWall | 720b3e58c813b60ac5b3f0ae24484bf8f3881cd1 | [
"BSD-3-Clause"
] | 60 | 2019-05-06T22:36:35.000Z | 2022-03-17T03:18:59.000Z | #!/usr/bin/python3
# WallGen v0.2'/'
#You nd yaml, pyyaml modules...
from util import parser
template_filename=""
rules_filename=""
# Get argvs of user's input
template_filename,rules_filename = parser.arguments()
# load rules of firewall at directory rules
try:
rules_wall=parser.Get_config(rules_filename)
exce... | 23.48 | 57 | 0.730835 | #!/usr/bin/python3
# WallGen v0.2'/'
#You nd yaml, pyyaml modules...
from util import parser
template_filename=""
rules_filename=""
# Get argvs of user's input
template_filename,rules_filename = parser.arguments()
# load rules of firewall at directory rules
try:
rules_wall=parser.Get_config(rules_filename)
exce... | 0 | 0 | 0 |
95955863794899075890565975fd2a548340be0a | 2,003 | py | Python | tests/app/test_main.py | t0xic0der/duffy | 3cbe651f288692573648748932edd5c4db814063 | [
"MIT"
] | 8 | 2018-01-15T15:55:52.000Z | 2021-12-15T18:28:18.000Z | tests/app/test_main.py | CentOS/duffy | cdc5f060fa7889e8ef42d683f52673c19f68c4ea | [
"MIT"
] | 112 | 2018-04-25T10:42:25.000Z | 2022-03-31T08:23:10.000Z | tests/app/test_main.py | t0xic0der/duffy | 3cbe651f288692573648748932edd5c4db814063 | [
"MIT"
] | 21 | 2017-10-19T02:52:16.000Z | 2021-12-15T18:28:19.000Z | from html.parser import HTMLParser
from unittest import mock
import pytest
from duffy.app.main import app, init_model
from duffy.exceptions import DuffyConfigurationError
from ..util import noop_context
@pytest.mark.client_auth_as(None)
@pytest.mark.asyncio
| 31.793651 | 85 | 0.659011 | from html.parser import HTMLParser
from unittest import mock
import pytest
from duffy.app.main import app, init_model
from duffy.exceptions import DuffyConfigurationError
from ..util import noop_context
@pytest.mark.client_auth_as(None)
@pytest.mark.asyncio
class TestMain:
api_paths = (
"/api/v1/chassi... | 861 | 857 | 22 |
0a576f91fbfbb77555cad7cba4a720dead37d441 | 411 | py | Python | write_list.py | AskingSteam5779/my-programming-progress | 77e6de2e7aed98ebd677d8e371a9b5b59bda3f26 | [
"MIT"
] | null | null | null | write_list.py | AskingSteam5779/my-programming-progress | 77e6de2e7aed98ebd677d8e371a9b5b59bda3f26 | [
"MIT"
] | null | null | null | write_list.py | AskingSteam5779/my-programming-progress | 77e6de2e7aed98ebd677d8e371a9b5b59bda3f26 | [
"MIT"
] | null | null | null | # This program saves a list of strings to a file.
# Call the main function.
main()
| 21.631579 | 57 | 0.574209 | # This program saves a list of strings to a file.
def main():
# Create a list of strings.
cities = ['New York', 'Boston', 'Atlanta', 'Dallas']
# Open a file for writing.
outfile = open('cities.txt', 'w')
# Write the list to the file.
for item in cities:
outfile.write(item +... | 298 | 0 | 25 |
1c565d6f4ce5c047edf511942923817f7bbf7673 | 2,987 | py | Python | tests/sonic_package_manager/test_database.py | monipko/sonic-utilities | ad801bfb81633812b4aa25f45bdd555a27121845 | [
"Apache-2.0"
] | 1 | 2021-02-03T06:28:38.000Z | 2021-02-03T06:28:38.000Z | tests/sonic_package_manager/test_database.py | monipko/sonic-utilities | ad801bfb81633812b4aa25f45bdd555a27121845 | [
"Apache-2.0"
] | 2 | 2021-03-15T04:15:40.000Z | 2021-05-13T23:44:23.000Z | tests/sonic_package_manager/test_database.py | monipko/sonic-utilities | ad801bfb81633812b4aa25f45bdd555a27121845 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import pytest
from sonic_package_manager.database import PackageEntry
from sonic_package_manager.errors import (
PackageNotFoundError,
PackageAlreadyExistsError,
PackageManagerError
)
from sonic_package_manager.version import Version
| 33.188889 | 68 | 0.744225 | #!/usr/bin/env python
import pytest
from sonic_package_manager.database import PackageEntry
from sonic_package_manager.errors import (
PackageNotFoundError,
PackageAlreadyExistsError,
PackageManagerError
)
from sonic_package_manager.version import Version
def test_database_get_package(fake_db):
swss... | 2,453 | 0 | 253 |
449750c20d440cbd2b61071de2e56250e02e26ea | 21,266 | py | Python | AcousticNLOSReconstruction.py | computational-imaging/AcousticNLOS | babd679b74240e8dd10fd48b3b3aa61590513c76 | [
"MIT"
] | 44 | 2019-05-13T02:34:55.000Z | 2022-03-15T03:21:04.000Z | AcousticNLOSReconstruction.py | computational-imaging/AcousticNLOS | babd679b74240e8dd10fd48b3b3aa61590513c76 | [
"MIT"
] | 4 | 2020-04-13T22:56:39.000Z | 2020-08-03T17:15:49.000Z | AcousticNLOSReconstruction.py | computational-imaging/AcousticNLOS | babd679b74240e8dd10fd48b3b3aa61590513c76 | [
"MIT"
] | 18 | 2019-04-05T14:39:49.000Z | 2021-01-15T07:21:57.000Z | '''
MIT License
Copyright (c) 2018 Stanford Computational Imaging Lab
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, copy, mo... | 42.27833 | 136 | 0.560472 | '''
MIT License
Copyright (c) 2018 Stanford Computational Imaging Lab
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, copy, mo... | 18,575 | 12 | 374 |
0b992308e1ed908796f2be508a44c2a32c9fa75a | 2,015 | py | Python | tests/settings.py | winhamwr/celery | 249a270301ddb9b025cf8d00400bb442df9cae62 | [
"BSD-3-Clause"
] | 1 | 2017-12-26T06:29:37.000Z | 2017-12-26T06:29:37.000Z | tests/settings.py | winhamwr/celery | 249a270301ddb9b025cf8d00400bb442df9cae62 | [
"BSD-3-Clause"
] | null | null | null | tests/settings.py | winhamwr/celery | 249a270301ddb9b025cf8d00400bb442df9cae62 | [
"BSD-3-Clause"
] | null | null | null | # Django settings for testproj project.
import os
import sys
# import source code dir
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))
SITE_ID = 300
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ROOT_URLCONF = "urls"
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
TEST_RUN... | 25.833333 | 71 | 0.58263 | # Django settings for testproj project.
import os
import sys
# import source code dir
sys.path.insert(0, os.getcwd())
sys.path.insert(0, os.path.join(os.getcwd(), os.pardir))
SITE_ID = 300
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ROOT_URLCONF = "urls"
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
TEST_RUN... | 0 | 0 | 0 |
32e1a2ddc4a88bccebccd7f98de0d5e6aa9ae107 | 1,673 | py | Python | nomad/confirm_range_of_ra_swatches.py | henryroe/PyNOMAD | cb3fc35a1e1244b9694bea224a23079e1b42c3b7 | [
"MIT"
] | 1 | 2016-01-30T17:40:05.000Z | 2016-01-30T17:40:05.000Z | nomad/confirm_range_of_ra_swatches.py | henryroe/PyNOMAD | cb3fc35a1e1244b9694bea224a23079e1b42c3b7 | [
"MIT"
] | null | null | null | nomad/confirm_range_of_ra_swatches.py | henryroe/PyNOMAD | cb3fc35a1e1244b9694bea224a23079e1b42c3b7 | [
"MIT"
] | null | null | null | import nomad
import numpy as np
# This was a one-time use script to confirm that the RA swatch ranges are >= and <.
# Found:
# LOW MATCH:
# 0021 18.0 18.0 18.2499899074
# LOW MATCH:
# 0064 15.25 15.25 15.4999305556
# LOW MATCH:
# 73 4.75 4.75 4.99976037037
# before I then cut off the run. Good enough for me, showin... | 47.8 | 127 | 0.658697 | import nomad
import numpy as np
# This was a one-time use script to confirm that the RA swatch ranges are >= and <.
# Found:
# LOW MATCH:
# 0021 18.0 18.0 18.2499899074
# LOW MATCH:
# 0064 15.25 15.25 15.4999305556
# LOW MATCH:
# 73 4.75 4.75 4.99976037037
# before I then cut off the run. Good enough for me, showin... | 0 | 0 | 0 |
2ae12b7f647214049ca7b5b292c5c6f510ae0e57 | 2,969 | py | Python | pigeons/dispatcher.py | obss/pigeons | 3965310c8ea45d2948b2ffd42d0369f9baaa4ab4 | [
"MIT"
] | 10 | 2021-07-16T12:51:14.000Z | 2022-01-26T06:30:12.000Z | pigeons/dispatcher.py | obss/pigeons | 3965310c8ea45d2948b2ffd42d0369f9baaa4ab4 | [
"MIT"
] | null | null | null | pigeons/dispatcher.py | obss/pigeons | 3965310c8ea45d2948b2ffd42d0369f9baaa4ab4 | [
"MIT"
] | 1 | 2021-07-16T12:55:06.000Z | 2021-07-16T12:55:06.000Z | import json
import logging
import os
import sys
import traceback
from typing import Union, Dict, List
import requests
from teams_logger import TeamsHandler, Office365CardFormatter
import validators
from pigeons.filter import TeamsFilter
def init_logger(
endpoint: Union[str, Dict[str, str]],
endpoint_key: s... | 28.548077 | 82 | 0.675648 | import json
import logging
import os
import sys
import traceback
from typing import Union, Dict, List
import requests
from teams_logger import TeamsHandler, Office365CardFormatter
import validators
from pigeons.filter import TeamsFilter
def _check_url(endpoint):
assert validators.url(endpoint)
response = r... | 858 | 0 | 69 |
50c050f18309deb51e73ce3224e567b25cf735dd | 184 | py | Python | Python/prime.py | Mario263/Hacktoberfest_2021 | 57965f48d3b19d25d2c0b75525eab4c4dce0157a | [
"MIT"
] | 16 | 2021-10-15T08:41:52.000Z | 2022-01-02T11:14:30.000Z | python/prime.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 5 | 2021-10-17T06:04:41.000Z | 2021-10-30T16:45:40.000Z | python/prime.py | kuwarkapur/Hacktoberfest-2022 | efaafeba5ce51d8d2e2d94c6326cc20bff946f17 | [
"MIT"
] | 43 | 2021-10-15T14:03:48.000Z | 2022-03-09T21:32:46.000Z |
n = int(input("Enter a number: "))
statement = "is a prime number."
for x in range(2,n):
if n%x == 0:
statement = 'is not a prime number.'
print(n,statement)
| 16.727273 | 45 | 0.559783 |
n = int(input("Enter a number: "))
statement = "is a prime number."
for x in range(2,n):
if n%x == 0:
statement = 'is not a prime number.'
print(n,statement)
| 0 | 0 | 0 |
74c74df9e30677e1fc4afb8b9fee835b3c9af638 | 545 | py | Python | test/timing_sequence_test-1.1.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | null | null | null | test/timing_sequence_test-1.1.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 1 | 2019-10-22T21:28:31.000Z | 2019-10-22T21:39:12.000Z | test/timing_sequence_test-1.1.py | bopopescu/Lauecollect | 60ae2b05ea8596ba0decf426e37aeaca0bc8b6be | [
"MIT"
] | 2 | 2019-06-06T15:06:46.000Z | 2020-07-20T02:03:22.000Z | """Friedrich Schotte, May 1, 2015 - May 1, 2015"""
from ftplib import FTP
from io import BytesIO
from struct import pack
data = ""
data += pack(">bbHIII",0x03,0x000,0x0001,0xF0FFB044,0x00000001,0x00000000)
data += pack(">bbHIII",0x03,0x000,0x0001,0xF0FFB044,0x00000001,0x00000001)
##file("/tmp/sequence.bin","w").write(... | 28.684211 | 74 | 0.713761 | """Friedrich Schotte, May 1, 2015 - May 1, 2015"""
from ftplib import FTP
from io import BytesIO
from struct import pack
data = ""
data += pack(">bbHIII",0x03,0x000,0x0001,0xF0FFB044,0x00000001,0x00000000)
data += pack(">bbHIII",0x03,0x000,0x0001,0xF0FFB044,0x00000001,0x00000001)
##file("/tmp/sequence.bin","w").write(... | 0 | 0 | 0 |
fa90cc48e78e78714511977af568ffa417925b68 | 2,433 | py | Python | app/steps/dirlistcollection.py | BartekSzpak/adversary | 231caf58722a5641dd08afe354f2760e89699f3a | [
"Apache-2.0",
"CC0-1.0"
] | 22 | 2019-06-08T11:00:02.000Z | 2021-09-10T10:22:20.000Z | app/steps/dirlistcollection.py | BartekSzpak/adversary | 231caf58722a5641dd08afe354f2760e89699f3a | [
"Apache-2.0",
"CC0-1.0"
] | 39 | 2019-04-28T13:28:58.000Z | 2020-07-28T00:49:45.000Z | app/steps/dirlistcollection.py | BartekSzpak/adversary | 231caf58722a5641dd08afe354f2760e89699f3a | [
"Apache-2.0",
"CC0-1.0"
] | 11 | 2019-04-29T00:58:35.000Z | 2021-06-28T02:18:48.000Z | from plugins.adversary.app.commands import cmd
from plugins.adversary.app.operation.operation import Step, OPFile, OPHost, OPRat, OPVar
class DirListCollection(Step):
"""
Description:
This step enumerates files on the target machine. Specifically, it looks for files with 'password' or
'admin' ... | 41.237288 | 116 | 0.572955 | from plugins.adversary.app.commands import cmd
from plugins.adversary.app.operation.operation import Step, OPFile, OPHost, OPRat, OPVar
class DirListCollection(Step):
"""
Description:
This step enumerates files on the target machine. Specifically, it looks for files with 'password' or
'admin' ... | 1,291 | 0 | 78 |
2af6b203f8eac468fccd056e0a981d487776d2ed | 732 | py | Python | Python/1. Python Basics/mit-6.00.1-python solutions/lec10memo1.py | okara83/Becoming-a-Data-Scientist | f09a15f7f239b96b77a2f080c403b2f3e95c9650 | [
"MIT"
] | null | null | null | Python/1. Python Basics/mit-6.00.1-python solutions/lec10memo1.py | okara83/Becoming-a-Data-Scientist | f09a15f7f239b96b77a2f080c403b2f3e95c9650 | [
"MIT"
] | null | null | null | Python/1. Python Basics/mit-6.00.1-python solutions/lec10memo1.py | okara83/Becoming-a-Data-Scientist | f09a15f7f239b96b77a2f080c403b2f3e95c9650 | [
"MIT"
] | 2 | 2022-02-09T15:41:33.000Z | 2022-02-11T07:47:40.000Z | # lec10memo1.py
# Code shown in Lecture 10, memo 1
# An iterative "Pythonic" search procedure:
# The recursive way:
# A recursive "Pythonic" binary search procedure:
| 22.875 | 54 | 0.61612 | # lec10memo1.py
# Code shown in Lecture 10, memo 1
# An iterative "Pythonic" search procedure:
def search(list, element):
for e in list:
if e == element:
return True
return False
# The recursive way:
def rSearch(list,element):
if element == list[0]:
return True
if len(lis... | 494 | 0 | 66 |
1208cf3503244dd5e67249f8e7c7157816f24bbb | 3,230 | py | Python | utils/load_image.py | gwaygenomics/single-cell-classifier | 9d43dfb15bae9dd66a3e9fce502c6cb878b31d08 | [
"CC-BY-4.0"
] | 5 | 2019-11-04T16:07:59.000Z | 2022-01-05T13:35:29.000Z | utils/load_image.py | gwaygenomics/single-cell-classifier | 9d43dfb15bae9dd66a3e9fce502c6cb878b31d08 | [
"CC-BY-4.0"
] | 32 | 2019-11-04T15:42:07.000Z | 2020-01-14T09:49:51.000Z | utils/load_image.py | gwaygenomics/single-cell-classifier | 9d43dfb15bae9dd66a3e9fce502c6cb878b31d08 | [
"CC-BY-4.0"
] | 6 | 2019-11-04T13:45:54.000Z | 2020-01-31T15:37:55.000Z | #%%
import tarfile
from io import BytesIO
from PIL import Image
import os
from pathlib import Path
import pandas as pd
basefolder_loc = Path(__file__).parents[1]
TARFILE = tarfile.open(
os.path.join(basefolder_loc, "1.download-data", "data", "training.tar.gz"),
"r:gz",
)
def load_img(
target: str = "adr... | 29.907407 | 113 | 0.590712 | #%%
import tarfile
from io import BytesIO
from PIL import Image
import os
from pathlib import Path
import pandas as pd
basefolder_loc = Path(__file__).parents[1]
TARFILE = tarfile.open(
os.path.join(basefolder_loc, "1.download-data", "data", "training.tar.gz"),
"r:gz",
)
def load_img(
target: str = "adr... | 0 | 0 | 0 |
c399003153798693f91d55f073c89f03f120b091 | 1,353 | py | Python | src/indra_cogex/resources/__init__.py | kkaris/indra_cogex | 46c9e0cdbad3d2e6e9a6ffd6f23ac8caeb048bc4 | [
"BSD-2-Clause"
] | null | null | null | src/indra_cogex/resources/__init__.py | kkaris/indra_cogex | 46c9e0cdbad3d2e6e9a6ffd6f23ac8caeb048bc4 | [
"BSD-2-Clause"
] | null | null | null | src/indra_cogex/resources/__init__.py | kkaris/indra_cogex | 46c9e0cdbad3d2e6e9a6ffd6f23ac8caeb048bc4 | [
"BSD-2-Clause"
] | null | null | null | """Resource files for INDRA CoGEx."""
from pathlib import Path
from typing import List
__all__ = [
"ensure_disprot",
]
HERE = Path(__file__).parent.resolve()
#: URL for downloading most recent version of DisProt
DISPROT_URL = "https://www.disprot.org/api/search?release=current&show_ambiguous=true&show_obsolete=... | 26.529412 | 151 | 0.686622 | """Resource files for INDRA CoGEx."""
from pathlib import Path
from typing import List
__all__ = [
"ensure_disprot",
]
HERE = Path(__file__).parent.resolve()
#: URL for downloading most recent version of DisProt
DISPROT_URL = "https://www.disprot.org/api/search?release=current&show_ambiguous=true&show_obsolete=... | 592 | 0 | 23 |
a2176ded2f50275f340dd2eaac78be339b7986ce | 2,988 | py | Python | tests/test_fifo.py | David-Durst/aetherling | 91bcf0579608ccbf7d42a7bddf90ccd4257d6571 | [
"MIT"
] | 10 | 2018-04-03T01:51:16.000Z | 2022-02-07T04:27:26.000Z | tests/test_fifo.py | David-Durst/aetherling | 91bcf0579608ccbf7d42a7bddf90ccd4257d6571 | [
"MIT"
] | 19 | 2018-05-20T00:43:31.000Z | 2021-03-18T20:36:52.000Z | tests/test_fifo.py | David-Durst/aetherling | 91bcf0579608ccbf7d42a7bddf90ccd4257d6571 | [
"MIT"
] | 1 | 2018-07-11T23:36:43.000Z | 2018-07-11T23:36:43.000Z | from aetherling.modules.fifo import DefineFIFO
from magma import *
from magma.bitutils import *
from magma.simulator.coreir_simulator import CoreIRSimulator
from magma.scope import Scope
| 32.835165 | 75 | 0.6834 | from aetherling.modules.fifo import DefineFIFO
from magma import *
from magma.bitutils import *
from magma.simulator.coreir_simulator import CoreIRSimulator
from magma.scope import Scope
def test_fifo_write_then_read():
width = 5
num_in = 2
time_per_element = 3
test_vals = [i for i in range(num_in * ti... | 2,754 | 0 | 46 |
6a08064688533dfc31b50755b203256a2dca8ff2 | 7,963 | py | Python | src/spyne_smev/smev256/__init__.py | barsgroup/m3-spyne-smev | 356d190a0f341f3b91d626eba81875cde8ff12f2 | [
"MIT"
] | 7 | 2015-10-22T02:57:33.000Z | 2021-08-08T16:46:48.000Z | src/spyne_smev/smev256/__init__.py | barsgroup/m3-spyne-smev | 356d190a0f341f3b91d626eba81875cde8ff12f2 | [
"MIT"
] | 2 | 2017-05-01T05:31:41.000Z | 2020-03-18T16:26:43.000Z | src/spyne_smev/smev256/__init__.py | barsgroup/m3-spyne-smev | 356d190a0f341f3b91d626eba81875cde8ff12f2 | [
"MIT"
] | 8 | 2015-10-22T02:57:47.000Z | 2021-11-08T08:28:32.000Z | # -*- coding: utf-8 -*-
"""
:Created: 3/12/14
:Author: timic
"""
import datetime
import os
from lxml import etree
from .._base import BaseSmev, BaseSmevWsdl
from .._utils import EmptyCtx, el_name_with_ns
from .. fault import ApiError as _ApiError
from .. import _xmlns as ns
from model import MessageType, ServiceTyp... | 37.739336 | 79 | 0.625518 | # -*- coding: utf-8 -*-
"""
:Created: 3/12/14
:Author: timic
"""
import datetime
import os
from lxml import etree
from .._base import BaseSmev, BaseSmevWsdl
from .._utils import EmptyCtx, el_name_with_ns
from .. fault import ApiError as _ApiError
from .. import _xmlns as ns
from model import MessageType, ServiceTyp... | 1,511 | 134 | 129 |
f60bce46a00d02c11097e70e69debbf6f0ca2a36 | 1,960 | py | Python | backend/api/models/OrganizationStatus.py | amichard/tfrs | ed3973016cc5c2ae48999d550a23b41a5ddad807 | [
"Apache-2.0"
] | 18 | 2017-05-10T21:55:11.000Z | 2021-03-01T16:41:32.000Z | backend/api/models/OrganizationStatus.py | amichard/tfrs | ed3973016cc5c2ae48999d550a23b41a5ddad807 | [
"Apache-2.0"
] | 1,167 | 2017-03-04T00:18:43.000Z | 2022-03-03T22:31:51.000Z | backend/api/models/OrganizationStatus.py | amichard/tfrs | ed3973016cc5c2ae48999d550a23b41a5ddad807 | [
"Apache-2.0"
] | 48 | 2017-03-09T17:19:39.000Z | 2022-02-24T16:38:17.000Z | """
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | 39.2 | 208 | 0.693367 | """
REST API Documentation for the NRS TFRS Credit Trading Application
The Transportation Fuels Reporting System is being designed to streamline compliance reporting for transportation fuel suppliers in accordance with the Renewable & Low Carbon Fuel Requirements Regulation.
OpenAPI spec version: v1
... | 31 | 753 | 23 |
d5cb94b11f9ff17b4651e3516a729c496a370961 | 454 | py | Python | EPIC_Earth_View_Movie.py | andrewcchoi/nasa-epic-earth-view | ef41f881145df9af203fa0e04ab55daccbdf1a24 | [
"MIT"
] | null | null | null | EPIC_Earth_View_Movie.py | andrewcchoi/nasa-epic-earth-view | ef41f881145df9af203fa0e04ab55daccbdf1a24 | [
"MIT"
] | null | null | null | EPIC_Earth_View_Movie.py | andrewcchoi/nasa-epic-earth-view | ef41f881145df9af203fa0e04ab55daccbdf1a24 | [
"MIT"
] | null | null | null | import os
import datetime as dt
import moviepy.video.io.ImageSequenceClip
image_folder = 'images/natural'
fps = 15
beg = dt.datetime.now()
image_files = [image_folder + '/' + img for img in os.listdir(image_folder) if img.endswith(".png")]
print(image_files)
clip = moviepy.video.io.ImageSequenceClip.ImageSe... | 30.266667 | 101 | 0.729075 | import os
import datetime as dt
import moviepy.video.io.ImageSequenceClip
image_folder = 'images/natural'
fps = 15
beg = dt.datetime.now()
image_files = [image_folder + '/' + img for img in os.listdir(image_folder) if img.endswith(".png")]
print(image_files)
clip = moviepy.video.io.ImageSequenceClip.ImageSe... | 0 | 0 | 0 |
f8bf640cd6012214c5598d26c71a5de205c90d2c | 225 | py | Python | lab2.6/task2.py | etozhekimm/lab2 | 6c1ac46cfa01b63821edfce9615c239a6424938c | [
"MIT"
] | null | null | null | lab2.6/task2.py | etozhekimm/lab2 | 6c1ac46cfa01b63821edfce9615c239a6424938c | [
"MIT"
] | null | null | null | lab2.6/task2.py | etozhekimm/lab2 | 6c1ac46cfa01b63821edfce9615c239a6424938c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == "__main__":
diction = {1: 'Атос', 2: 'Портос', 3: 'Арамис'}
print(diction)
diction_swap = {v:k for k, v in diction.items()}
print(diction_swap)
| 20.454545 | 52 | 0.586667 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == "__main__":
diction = {1: 'Атос', 2: 'Портос', 3: 'Арамис'}
print(diction)
diction_swap = {v:k for k, v in diction.items()}
print(diction_swap)
| 0 | 0 | 0 |
a308f8d1d47d2abc83e0292aef72fa86ac39ace8 | 2,942 | py | Python | old/test_binheap.py | kurtrm/data_structures_rev | 58f425a877898a45595de9c57c7eb8e087a0c3a2 | [
"MIT"
] | null | null | null | old/test_binheap.py | kurtrm/data_structures_rev | 58f425a877898a45595de9c57c7eb8e087a0c3a2 | [
"MIT"
] | null | null | null | old/test_binheap.py | kurtrm/data_structures_rev | 58f425a877898a45595de9c57c7eb8e087a0c3a2 | [
"MIT"
] | null | null | null | """Test min heap."""
import pytest
import random
@pytest.fixture
def empty_heap():
"""Instantiate a heap for testing."""
from binheap import BinHeap
min_heap = BinHeap()
return min_heap
@pytest.fixture
def random_heap():
"""Generate a list for use in a heap."""
from binheap import BinHeap
... | 26.990826 | 74 | 0.673691 | """Test min heap."""
import pytest
import random
@pytest.fixture
def empty_heap():
"""Instantiate a heap for testing."""
from binheap import BinHeap
min_heap = BinHeap()
return min_heap
@pytest.fixture
def random_heap():
"""Generate a list for use in a heap."""
from binheap import BinHeap
... | 0 | 0 | 0 |
645946e3ba18fb5fbca359ea8e8fe5bb0aa3802d | 2,773 | py | Python | repos/serving/lambdas/functions/byoc_inference/lambda_function.py | aws-samples/sagemaker-project-mlops-byoc | e4d170a12842d0a36a8ae19a5b7a21495eb9659d | [
"MIT-0"
] | 1 | 2022-03-03T10:59:23.000Z | 2022-03-03T10:59:23.000Z | repos/serving/lambdas/functions/byoc_inference/lambda_function.py | aws-samples/sagemaker-project-mlops-byoc | e4d170a12842d0a36a8ae19a5b7a21495eb9659d | [
"MIT-0"
] | 3 | 2022-03-02T14:13:10.000Z | 2022-03-02T14:13:35.000Z | repos/serving/lambdas/functions/byoc_inference/lambda_function.py | aws-samples/sagemaker-project-mlops-byoc | e4d170a12842d0a36a8ae19a5b7a21495eb9659d | [
"MIT-0"
] | null | null | null | import json
import logging
import os
import boto3
import pandas as pd
import numpy as np
import base64
import io
logger = logging.getLogger()
client = boto3.client("sagemaker-runtime")
region = os.environ["region"]
endpoint_name = os.environ["endpoint_name"]
content_type = os.environ["content_type"]
fg_name = os.en... | 30.141304 | 112 | 0.586729 | import json
import logging
import os
import boto3
import pandas as pd
import numpy as np
import base64
import io
logger = logging.getLogger()
client = boto3.client("sagemaker-runtime")
region = os.environ["region"]
endpoint_name = os.environ["endpoint_name"]
content_type = os.environ["content_type"]
fg_name = os.en... | 2,174 | 0 | 23 |
cea539f27e627244797dfcac627684c765a85aa6 | 1,550 | py | Python | tests/test_galaxy.py | K-Monty/galaxy-model | 9515d7c87c31e68338466d2044d8e9c679bf8648 | [
"MIT"
] | null | null | null | tests/test_galaxy.py | K-Monty/galaxy-model | 9515d7c87c31e68338466d2044d8e9c679bf8648 | [
"MIT"
] | null | null | null | tests/test_galaxy.py | K-Monty/galaxy-model | 9515d7c87c31e68338466d2044d8e9c679bf8648 | [
"MIT"
] | null | null | null | import os
import sys
import matplotlib.pyplot as plt
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
'..')))
from galaxy_model.galaxy import Galaxy # noqa
gal = Galaxy()
if __name__ == "__main__":
test_add_and_remove_coords()
te... | 27.192982 | 74 | 0.607742 | import os
import sys
import matplotlib.pyplot as plt
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__),
'..')))
from galaxy_model.galaxy import Galaxy # noqa
gal = Galaxy()
def test_add_and_remove_coords():
gal.add_coord([0.5, 0.5], [10, 10... | 1,025 | 0 | 115 |
3898932c37e07695e58bef4864d2b744aca15abb | 315 | py | Python | python/abstract.py | mythnc/lab | 9f69482a063e3cfce2ce8832c2ef1425658c31b9 | [
"MIT"
] | null | null | null | python/abstract.py | mythnc/lab | 9f69482a063e3cfce2ce8832c2ef1425658c31b9 | [
"MIT"
] | null | null | null | python/abstract.py | mythnc/lab | 9f69482a063e3cfce2ce8832c2ef1425658c31b9 | [
"MIT"
] | null | null | null | from abc import ABCMeta, abstractmethod
if __name__ == "__main__":
c = Concrete()
| 13.125 | 39 | 0.593651 | from abc import ABCMeta, abstractmethod
class Base(metaclass=ABCMeta):
@abstractmethod
def foo(self):
pass
@abstractmethod
def bar(self):
pass
class Concrete(Base):
def foo(self):
pass
def bar(self):
pass
if __name__ == "__main__":
c = Concrete()
| 24 | 102 | 99 |
f4c55c59ccadb33157dc8d96a789cf989419b67f | 198 | py | Python | urionlinejudge/2242.py | andraantariksa/code-exercise-answer | 69b7dbdc081cdb094cb110a72bc0c9242d3d344d | [
"MIT"
] | 1 | 2019-11-06T15:17:48.000Z | 2019-11-06T15:17:48.000Z | urionlinejudge/2242.py | andraantariksa/code-exercise-answer | 69b7dbdc081cdb094cb110a72bc0c9242d3d344d | [
"MIT"
] | null | null | null | urionlinejudge/2242.py | andraantariksa/code-exercise-answer | 69b7dbdc081cdb094cb110a72bc0c9242d3d344d | [
"MIT"
] | 1 | 2018-11-13T08:43:26.000Z | 2018-11-13T08:43:26.000Z | '''input
huaauhahhuahau
'''
inp = input('')
vowel = ""
for i in inp:
if i == "a" or i == "i" or i == "u" or i == "e" or i == "o":
vowel += i
if vowel == vowel[::-1]:
print("S")
else:
print("N") | 16.5 | 61 | 0.484848 | '''input
huaauhahhuahau
'''
inp = input('')
vowel = ""
for i in inp:
if i == "a" or i == "i" or i == "u" or i == "e" or i == "o":
vowel += i
if vowel == vowel[::-1]:
print("S")
else:
print("N") | 0 | 0 | 0 |
6c92492e4a8c8822fae1ea471197782e04ce09da | 3,686 | py | Python | src/irc/connection.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/irc/connection.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | src/irc/connection.py | abbacode/avaloria | 02e1805ac6e74543c96408b7951429f94bc140ca | [
"ClArtistic"
] | null | null | null | """
This connects to an IRC network/channel and launches an 'bot' onto it.
The bot then pipes what is being said between the IRC channel and one or
more Evennia channels.
"""
# TODO: This is deprecated!
from twisted.words.protocols import irc
from twisted.internet import protocol
from twisted.internet import ... | 36.137255 | 93 | 0.604178 | """
This connects to an IRC network/channel and launches an 'bot' onto it.
The bot then pipes what is being said between the IRC channel and one or
more Evennia channels.
"""
# TODO: This is deprecated!
from twisted.words.protocols import irc
from twisted.internet import protocol
from twisted.internet import ... | 1,103 | 1,550 | 48 |
26d56a0d35f928e050c9f5928e0dffe22d8f679c | 1,978 | py | Python | regression/era/obsjson.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 41 | 2018-12-07T23:10:50.000Z | 2022-02-19T03:01:49.000Z | regression/era/obsjson.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 59 | 2019-01-04T15:43:30.000Z | 2022-03-31T09:48:15.000Z | regression/era/obsjson.py | b8raoult/magics | eb2c86ec6e392e89c90044128dc671f22283d6ad | [
"ECL-2.0",
"Apache-2.0"
] | 13 | 2019-01-07T14:36:33.000Z | 2021-09-06T14:48:36.000Z | # (C) Copyright 1996-2016 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergov... | 28.257143 | 87 | 0.664813 | # (C) Copyright 1996-2016 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergov... | 0 | 0 | 0 |
71d925effb9fdf2c1354c3f979d27f1f8fb69e39 | 3,961 | py | Python | cartpole_pg_agent.py | vmaini/reinforcement_learning | 9921c46f59fab9dae2420780ea4766356b3f02a5 | [
"MIT"
] | 2 | 2017-06-27T06:19:45.000Z | 2017-09-28T08:41:50.000Z | cartpole_pg_agent.py | vmaini/reinforcement_learning | 9921c46f59fab9dae2420780ea4766356b3f02a5 | [
"MIT"
] | null | null | null | cartpole_pg_agent.py | vmaini/reinforcement_learning | 9921c46f59fab9dae2420780ea4766356b3f02a5 | [
"MIT"
] | null | null | null | # source: https://github.com/awjuliani/DeepRL-Agents/blob/master/Vanilla-Policy.ipynb
# https://medium.com/@awjuliani/super-simple-reinforcement-learning-tutorial-part-2-ded33892c724
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
import gym
import matplotlib as plt
env = gym.make('C... | 36.33945 | 113 | 0.627367 | # source: https://github.com/awjuliani/DeepRL-Agents/blob/master/Vanilla-Policy.ipynb
# https://medium.com/@awjuliani/super-simple-reinforcement-learning-tutorial-part-2-ded33892c724
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
import gym
import matplotlib as plt
env = gym.make('C... | 1,614 | -7 | 72 |
c38ef90318ff1f556750cd7eb2869feb2ad9a46c | 39 | py | Python | bqspec/__version__.py | orisano/bqspec | a9b955107638130a4c7f5f711f0964a077302788 | [
"MIT"
] | 7 | 2017-12-15T04:45:27.000Z | 2018-03-20T09:45:24.000Z | bqspec/__version__.py | orisano/bqspec | a9b955107638130a4c7f5f711f0964a077302788 | [
"MIT"
] | null | null | null | bqspec/__version__.py | orisano/bqspec | a9b955107638130a4c7f5f711f0964a077302788 | [
"MIT"
] | 1 | 2018-07-01T07:10:31.000Z | 2018-07-01T07:10:31.000Z | # coding: utf-8
__version__ = "0.3.3"
| 9.75 | 21 | 0.615385 | # coding: utf-8
__version__ = "0.3.3"
| 0 | 0 | 0 |
6b8445c78a7afc600dcffb462c08215366ac1e18 | 14,144 | py | Python | src/gui.py | chrismonit/chroma_clade | 34df5fdb736bc5d4b8513e0cc10279a3afc5a26b | [
"Apache-2.0"
] | 2 | 2019-11-10T13:49:23.000Z | 2019-11-21T19:05:53.000Z | src/gui.py | chrismonit/chroma_clade | 34df5fdb736bc5d4b8513e0cc10279a3afc5a26b | [
"Apache-2.0"
] | null | null | null | src/gui.py | chrismonit/chroma_clade | 34df5fdb736bc5d4b8513e0cc10279a3afc5a26b | [
"Apache-2.0"
] | 2 | 2019-11-15T14:48:00.000Z | 2020-01-27T23:53:55.000Z | from tkinter import *
import tkinter.filedialog
import os
import os.path
from check_input import Input, InputError
import chroma_clade
from PIL import Image, ImageTk
# colour choices:
#https://sashat.me/2017/01/11/list-of-20-simple-distinct-colors/
# py2app saves data files in "<project>.app/Contents/Resources/", whi... | 36.929504 | 138 | 0.685167 | from tkinter import *
import tkinter.filedialog
import os
import os.path
from check_input import Input, InputError
import chroma_clade
from PIL import Image, ImageTk
# colour choices:
#https://sashat.me/2017/01/11/list-of-20-simple-distinct-colors/
# py2app saves data files in "<project>.app/Contents/Resources/", whi... | 5,792 | 960 | 114 |
22383638b8f0461e6aea6176ae0607327af1dd94 | 913 | py | Python | summarize_fdy.py | gabrielcbenedito/IGMC | 9a10fd7f1ebe665bea9666e30e3197017349ed66 | [
"MIT"
] | null | null | null | summarize_fdy.py | gabrielcbenedito/IGMC | 9a10fd7f1ebe665bea9666e30e3197017349ed66 | [
"MIT"
] | null | null | null | summarize_fdy.py | gabrielcbenedito/IGMC | 9a10fd7f1ebe665bea9666e30e3197017349ed66 | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import re
import numpy as np
import pdb
from scipy import stats
line_num = -1
seed_range = range(1, 6)
datasets = ['yahoo_music', 'douban', 'flixster']
prefixs = ['_s']
print()
for prefix in prefixs:
print('Results of ' + prefix)
for dataset in datasets:
... | 26.852941 | 72 | 0.566265 | from __future__ import print_function
import os
import re
import numpy as np
import pdb
from scipy import stats
line_num = -1
seed_range = range(1, 6)
datasets = ['yahoo_music', 'douban', 'flixster']
prefixs = ['_s']
print()
for prefix in prefixs:
print('Results of ' + prefix)
for dataset in datasets:
... | 0 | 0 | 0 |
a6ad8363ff53e2c8fb806b0c323638f31f0dc41f | 5,531 | py | Python | _lib/db.py | boazin/backslash | 4633edbbe1a0387901d9d0a749154169d4dbfcce | [
"BSD-3-Clause"
] | null | null | null | _lib/db.py | boazin/backslash | 4633edbbe1a0387901d9d0a749154169d4dbfcce | [
"BSD-3-Clause"
] | null | null | null | _lib/db.py | boazin/backslash | 4633edbbe1a0387901d9d0a749154169d4dbfcce | [
"BSD-3-Clause"
] | null | null | null | import random
import sys
import time
import re
import os
from contextlib import contextmanager
from uuid import uuid4
import logbook
import click
from .bootstrapping import requires_env
_DATABASE_URI_RE = re.compile(r"(?P<driver>(?P<db_type>sqlite|postgresql)(\+.*)?):\/\/(?P<host>[^/]*)\/(?P<db>.+)")
@click.group... | 27.381188 | 139 | 0.651238 | import random
import sys
import time
import re
import os
from contextlib import contextmanager
from uuid import uuid4
import logbook
import click
from .bootstrapping import requires_env
_DATABASE_URI_RE = re.compile(r"(?P<driver>(?P<db_type>sqlite|postgresql)(\+.*)?):\/\/(?P<host>[^/]*)\/(?P<db>.+)")
@click.group... | 4,607 | 0 | 312 |
53db6a4b79d1aec8d8ee60cfe868e83138d3bdfa | 4,603 | py | Python | bankari/bankari.py | peterburdette/Bankari | fbd9c76ef4b9573a4f4d8c3cde6243ef5215c9f4 | [
"MIT"
] | null | null | null | bankari/bankari.py | peterburdette/Bankari | fbd9c76ef4b9573a4f4d8c3cde6243ef5215c9f4 | [
"MIT"
] | null | null | null | bankari/bankari.py | peterburdette/Bankari | fbd9c76ef4b9573a4f4d8c3cde6243ef5215c9f4 | [
"MIT"
] | null | null | null | # Bank Program
import sqlite3
import os.path
# Gets the directory path where the db is located and links the program to the db
dirPath = os.path.dirname(os.path.abspath(__file__))
db = os.path.join(dirPath, "bankari.db")
conn = sqlite3.connect(db)
source = conn.execute(''' SELECT user, checking, savings FROM... | 36.244094 | 135 | 0.605475 | # Bank Program
import sqlite3
import os.path
# Gets the directory path where the db is located and links the program to the db
dirPath = os.path.dirname(os.path.abspath(__file__))
db = os.path.join(dirPath, "bankari.db")
conn = sqlite3.connect(db)
source = conn.execute(''' SELECT user, checking, savings FROM... | 3,735 | 0 | 138 |
59e655bf2059d815f9b1fc55627909c7825174ec | 28,061 | py | Python | dev/feature_extraction/cpc/ida_cpc_extract.py | syreal17/Cardinal | 453d0b913acce74124bdd8ca21a774e409466552 | [
"MIT"
] | 23 | 2016-06-27T15:55:31.000Z | 2021-03-17T03:02:46.000Z | dev/feature_extraction/cpc/ida_cpc_extract.py | syreal17/cardinality_chains | 453d0b913acce74124bdd8ca21a774e409466552 | [
"MIT"
] | 1 | 2016-06-28T09:11:55.000Z | 2017-01-22T02:16:12.000Z | dev/feature_extraction/cpc/ida_cpc_extract.py | syreal17/Cardinal | 453d0b913acce74124bdd8ca21a774e409466552 | [
"MIT"
] | 4 | 2016-06-28T09:29:50.000Z | 2019-02-20T09:15:24.000Z | # -----------------------------------------------------------------------------
# A Three-Pronged Approach to Exploring the Limits of Static Malware Analyses:
# Callsite Parameter Cardinality (CPC) Counting: ida_cpc_extract.py
#
# The driver for ennumerating CPC for a Linux AMD64 binary using IDA Pro.
#
# Luke Jones (l... | 37.019789 | 105 | 0.589893 | # -----------------------------------------------------------------------------
# A Three-Pronged Approach to Exploring the Limits of Static Malware Analyses:
# Callsite Parameter Cardinality (CPC) Counting: ida_cpc_extract.py
#
# The driver for ennumerating CPC for a Linux AMD64 binary using IDA Pro.
#
# Luke Jones (l... | 0 | 0 | 0 |
e6f30d29fbbab14fdbc3e0405a8fafb26a2dd880 | 3,359 | py | Python | backend/tracks/schema.py | rushi444/music-cloud-fullstack | cfeb5348fd1823fdcbc0e6c9308c6ec1be743854 | [
"MIT"
] | null | null | null | backend/tracks/schema.py | rushi444/music-cloud-fullstack | cfeb5348fd1823fdcbc0e6c9308c6ec1be743854 | [
"MIT"
] | null | null | null | backend/tracks/schema.py | rushi444/music-cloud-fullstack | cfeb5348fd1823fdcbc0e6c9308c6ec1be743854 | [
"MIT"
] | 1 | 2020-05-21T05:03:06.000Z | 2020-05-21T05:03:06.000Z | import graphene
from graphene_django import DjangoObjectType
from graphql import GraphQLError
from django.db.models import Q
from .models import Track, Like
from users.schema import UserType
| 26.242188 | 71 | 0.646323 | import graphene
from graphene_django import DjangoObjectType
from graphql import GraphQLError
from django.db.models import Q
from .models import Track, Like
from users.schema import UserType
class TrackType(DjangoObjectType):
class Meta:
model = Track
class LikeType(DjangoObjectType):
class Meta:
... | 1,748 | 1,227 | 184 |
f52c9ae81ba7689e804e5861b8378b03f0fc311c | 19,646 | py | Python | ClassifyMembranes/train_gpu_randomforest.py | Rhoana/rhoana | b4027a57451d175ea02c2c7ef472cf9c4e1a0efc | [
"MIT"
] | 26 | 2015-01-08T08:30:10.000Z | 2021-07-08T06:21:35.000Z | ClassifyMembranes/train_gpu_randomforest.py | andudu/rhoana | b4027a57451d175ea02c2c7ef472cf9c4e1a0efc | [
"MIT"
] | null | null | null | ClassifyMembranes/train_gpu_randomforest.py | andudu/rhoana | b4027a57451d175ea02c2c7ef472cf9c4e1a0efc | [
"MIT"
] | 11 | 2015-01-23T23:30:26.000Z | 2019-02-06T21:56:33.000Z | ############################################################
# GPU Implementation of Random Forest Classifier - Training
# v0.1
# Seymour Knowles-Barley
############################################################
# Based on c code from:
# http://code.google.com/p/randomforest-matlab/
# License: GPLv2
#################... | 30.793103 | 125 | 0.670467 | ############################################################
# GPU Implementation of Random Forest Classifier - Training
# v0.1
# Seymour Knowles-Barley
############################################################
# Based on c code from:
# http://code.google.com/p/randomforest-matlab/
# License: GPLv2
#################... | 0 | 0 | 0 |
2de88d849da99ad3c064866d929d8675f8c9ccfc | 1,309 | py | Python | bioinformatics/analysis/rnaseq/circRNA/splicing_exon_label.py | bioShaun/omsCabinet | 741179a06cbd5200662cd03bc2e0115f4ad06917 | [
"MIT"
] | null | null | null | bioinformatics/analysis/rnaseq/circRNA/splicing_exon_label.py | bioShaun/omsCabinet | 741179a06cbd5200662cd03bc2e0115f4ad06917 | [
"MIT"
] | null | null | null | bioinformatics/analysis/rnaseq/circRNA/splicing_exon_label.py | bioShaun/omsCabinet | 741179a06cbd5200662cd03bc2e0115f4ad06917 | [
"MIT"
] | null | null | null | import fire
import pandas as pd
if __name__ == '__main__':
fire.Fire(splicing_exon_position)
| 32.725 | 73 | 0.617265 | import fire
import pandas as pd
def splicing_exon_position(circ_bed, transcritp_bed, outfile):
circ_df = pd.read_table(circ_bed)
tr_df = pd.read_table(transcritp_bed, header=None)
tr_total_exon = tr_df.loc[:, [3, 9]]
tr_total_exon.columns = ['isoformName', 'isoform_exon']
circ_df = circ_df.merge(t... | 1,186 | 0 | 23 |
a6f498ea3a74c7fa28634d898fe8906901a914d6 | 1,392 | py | Python | setup.py | manibhushan05/flask-boilerplate | 26f26691c57dd984ded0e5357b757c7c0542cd1c | [
"MIT"
] | null | null | null | setup.py | manibhushan05/flask-boilerplate | 26f26691c57dd984ded0e5357b757c7c0542cd1c | [
"MIT"
] | 1 | 2021-03-31T19:24:53.000Z | 2021-03-31T19:24:53.000Z | setup.py | karajrish/flask-boilerplate | 584da59e3eb3c39261b5b435ef7eaf92bf127aeb | [
"MIT"
] | null | null | null | import os
from codecs import open
from setuptools import find_packages, setup
import backend
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(ROOT_DIR, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
install_requires = read_requirements('requirements.txt')
dev_r... | 27.294118 | 71 | 0.686782 | import os
from codecs import open
from setuptools import find_packages, setup
import backend
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(ROOT_DIR, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
def is_pkg(line):
return line and not line.startswith(('--'... | 211 | 0 | 46 |
6bc9edf8f92bc2f73aa2c428e5ccb33ebc5c268d | 3,753 | py | Python | core/rest.py | cybernetisk/internsystem | b81faa0deef08153032e56d5740173e5a6cf3ad9 | [
"MIT"
] | null | null | null | core/rest.py | cybernetisk/internsystem | b81faa0deef08153032e56d5740173e5a6cf3ad9 | [
"MIT"
] | 38 | 2017-12-21T10:10:54.000Z | 2022-03-07T20:54:37.000Z | core/rest.py | cybernetisk/internsystem | b81faa0deef08153032e56d5740173e5a6cf3ad9 | [
"MIT"
] | 6 | 2018-06-01T21:04:34.000Z | 2020-01-14T15:26:26.000Z | from rest_framework import viewsets, filters, permissions
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from django_filters.rest_framework import DjangoFilterBackend
from core.serializers import (
CardCreateSerializer,
Car... | 35.074766 | 97 | 0.692513 | from rest_framework import viewsets, filters, permissions
from rest_framework import status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from django_filters.rest_framework import DjangoFilterBackend
from core.serializers import (
CardCreateSerializer,
Car... | 1,883 | 1,180 | 92 |
5561fa8b6240ab84bbddf708e0dc8c76c0e123dc | 3,505 | py | Python | Python/parser.py | sixseconds/gcngan_ceons | 8f65c4ec62a4b6557d021d5f35437c81c7eb14fb | [
"MIT"
] | null | null | null | Python/parser.py | sixseconds/gcngan_ceons | 8f65c4ec62a4b6557d021d5f35437c81c7eb14fb | [
"MIT"
] | null | null | null | Python/parser.py | sixseconds/gcngan_ceons | 8f65c4ec62a4b6557d021d5f35437c81c7eb14fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3-64
from __future__ import absolute_import, division, print_function, unicode_literals
# Install TensorFlow
import numpy as np
import networkx as nx
import json
import os
import sys
import yaml
loader = yaml.Loader
topology = nx.Graph()
LABEL_END = "_erlang"
with open("../Yml/topology.y... | 33.701923 | 85 | 0.495863 | #!/usr/bin/env python3-64
from __future__ import absolute_import, division, print_function, unicode_literals
# Install TensorFlow
import numpy as np
import networkx as nx
import json
import os
import sys
import yaml
loader = yaml.Loader
topology = nx.Graph()
LABEL_END = "_erlang"
with open("../Yml/topology.y... | 266 | 0 | 27 |
e71c59bcf29e9be77b7b288bb8d9c12d82094ae2 | 576 | py | Python | tests/behavioural/features/steps/thread_state.py | uk-gov-mirror/ONSdigital.ras-secure-message | 741eed651eea47dd1a13c7c93b1b1796584cdf2b | [
"MIT"
] | null | null | null | tests/behavioural/features/steps/thread_state.py | uk-gov-mirror/ONSdigital.ras-secure-message | 741eed651eea47dd1a13c7c93b1b1796584cdf2b | [
"MIT"
] | null | null | null | tests/behavioural/features/steps/thread_state.py | uk-gov-mirror/ONSdigital.ras-secure-message | 741eed651eea47dd1a13c7c93b1b1796584cdf2b | [
"MIT"
] | null | null | null | from behave import given, when
from flask import json
@when("the last returned thread is closed")
@given("the last returned thread is closed")
def step_impl_the_response_message_thread_is_closed(context):
"""close the conversation of the last saved message"""
thread_id = context.bdd_helper.single_message_resp... | 44.307692 | 86 | 0.722222 | from behave import given, when
from flask import json
@when("the last returned thread is closed")
@given("the last returned thread is closed")
def step_impl_the_response_message_thread_is_closed(context):
"""close the conversation of the last saved message"""
thread_id = context.bdd_helper.single_message_resp... | 0 | 0 | 0 |
967db48275cd689d7619979d1c99f2f9b3bbae02 | 5,618 | py | Python | inference_match.py | HorvathAndreaAnett/edlsm_pytorch | bd288392c8b8f8b79eb324bbb608242949225055 | [
"MIT"
] | 21 | 2019-01-21T12:58:57.000Z | 2022-01-05T23:09:45.000Z | inference_match.py | HorvathAndreaAnett/edlsm_pytorch | bd288392c8b8f8b79eb324bbb608242949225055 | [
"MIT"
] | 3 | 2019-02-25T03:34:21.000Z | 2020-05-18T04:27:59.000Z | inference_match.py | HorvathAndreaAnett/edlsm_pytorch | bd288392c8b8f8b79eb324bbb608242949225055 | [
"MIT"
] | 5 | 2019-05-11T18:53:46.000Z | 2022-03-15T18:17:40.000Z | from __future__ import print_function
import os
import numpy as np
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
from PIL import Image
import matplotlib.pyplot as plt
from src.nets_test import *
parser... | 33.640719 | 146 | 0.684941 | from __future__ import print_function
import os
import numpy as np
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import datasets, transforms
from PIL import Image
import matplotlib.pyplot as plt
from src.nets_test import *
parser... | 878 | 0 | 45 |
19cdfa193628a0bc4ac92173e00e954e0a54d5c9 | 5,278 | py | Python | graphs/utils.py | rodrigues882013/fraud-detection | bf69fdd06bc7577a7d3cefabc807c791988bf80a | [
"MIT"
] | 2 | 2017-04-30T13:14:09.000Z | 2019-09-15T18:25:51.000Z | graphs/utils.py | rodrigues882013/fraud-detection | bf69fdd06bc7577a7d3cefabc807c791988bf80a | [
"MIT"
] | null | null | null | graphs/utils.py | rodrigues882013/fraud-detection | bf69fdd06bc7577a7d3cefabc807c791988bf80a | [
"MIT"
] | 1 | 2020-05-19T17:12:53.000Z | 2020-05-19T17:12:53.000Z |
import logging
from fraud_detection.settings import FILE_DIRS
logger = logging.getLogger(__name__)
| 26.128713 | 103 | 0.56044 |
import logging
from fraud_detection.settings import FILE_DIRS
logger = logging.getLogger(__name__)
class DuplicateEdgeError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class NodeDoesntExistError(Exception):
def __init__(self, v... | 1,246 | 3,728 | 198 |
86d238c00d3c34056da3f687ab5eccbb8a672e99 | 2,077 | py | Python | tests/unit/test_query.py | NarrativeScience/cubejs-client-async | e175cb9e86109501e2aea36ab29f0f6bcd05251f | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_query.py | NarrativeScience/cubejs-client-async | e175cb9e86109501e2aea36ab29f0f6bcd05251f | [
"BSD-3-Clause"
] | 1 | 2021-06-22T21:45:14.000Z | 2021-06-22T21:45:14.000Z | tests/unit/test_query.py | NarrativeScience/cubejs-client-async | e175cb9e86109501e2aea36ab29f0f6bcd05251f | [
"BSD-3-Clause"
] | null | null | null | """Contains tests for the query module"""
import unittest
from cubejsclientasync import (
Cube,
DateRange,
Order,
Query,
TimeDimension,
TimeGranularity,
)
from cubejsclientasync.enums import FilterOperator
from cubejsclientasync.filters import And, Filter
class QueryTests(unittest.TestCase):... | 30.544118 | 83 | 0.424169 | """Contains tests for the query module"""
import unittest
from cubejsclientasync import (
Cube,
DateRange,
Order,
Query,
TimeDimension,
TimeGranularity,
)
from cubejsclientasync.enums import FilterOperator
from cubejsclientasync.filters import And, Filter
class QueryTests(unittest.TestCase):... | 0 | 0 | 0 |
48702bb3dcdd685caaf8d78176aebc371c1aaae1 | 4,532 | py | Python | network_health_service/network_health_service/routes.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 12 | 2021-04-06T06:27:18.000Z | 2022-03-18T10:52:29.000Z | network_health_service/network_health_service/routes.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 6 | 2022-01-04T13:32:16.000Z | 2022-03-28T21:13:59.000Z | network_health_service/network_health_service/routes.py | kkkkv/tgnms | a3b8fd8a69b647a614f9856933f05e50a4affadf | [
"MIT"
] | 7 | 2021-09-27T13:14:42.000Z | 2022-03-28T16:24:15.000Z | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import enum
import functools
import json
from collections import defaultdict
from datetime import datetime
from typing import Any, Iterable, Dict
from aiohttp import web
from sqlalchemy import insert, select
from tglib.clients import APISe... | 35.131783 | 87 | 0.555163 | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
import enum
import functools
import json
from collections import defaultdict
from datetime import datetime
from typing import Any, Iterable, Dict
from aiohttp import web
from sqlalchemy import insert, select
from tglib.clients import APISe... | 186 | 0 | 23 |
0c69098d833bd70e903dc01d1010f62d18c7d077 | 1,243 | py | Python | monitoringHisto/setup.py | juliozinga/FIWARELab-monitoringAPI | 5a411de0a59f4408b4ed1a7e58b550b227e4975c | [
"Apache-2.0"
] | null | null | null | monitoringHisto/setup.py | juliozinga/FIWARELab-monitoringAPI | 5a411de0a59f4408b4ed1a7e58b550b227e4975c | [
"Apache-2.0"
] | null | null | null | monitoringHisto/setup.py | juliozinga/FIWARELab-monitoringAPI | 5a411de0a59f4408b4ed1a7e58b550b227e4975c | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
install_requires=required,
name='monitoringHisto',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# htt... | 28.25 | 79 | 0.703138 | from setuptools import setup
with open('requirements.txt') as f:
required = f.read().splitlines()
setup(
install_requires=required,
name='monitoringHisto',
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# htt... | 0 | 0 | 0 |
854b93c2250ff2f69b5704c0d399c783cbe54b08 | 2,758 | py | Python | test-drivers/wecall_test_drivers/ascii_quality_recalibration_runner.py | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 8 | 2018-10-08T15:47:21.000Z | 2021-11-09T07:13:05.000Z | test-drivers/wecall_test_drivers/ascii_quality_recalibration_runner.py | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 4 | 2018-11-05T09:16:27.000Z | 2020-04-09T12:32:56.000Z | test-drivers/wecall_test_drivers/ascii_quality_recalibration_runner.py | dylex/wecall | 35d24cefa4fba549e737cd99329ae1b17dd0156b | [
"MIT"
] | 4 | 2019-09-03T15:46:39.000Z | 2021-06-04T07:28:33.000Z | # All content Copyright (C) 2018 Genomics plc
from wecall.bamutils.sequence_quality import SequenceQuality
import pysam
from wecall.bamutils.sample_bank import SampleBank
from wecall_test_drivers.ascii_wecall_runner import DEFAULT_SAMPLE_NAME
from wecall_test_drivers.base_test import BaseTest
from wecall_test_drivers.v... | 43.09375 | 89 | 0.716461 | # All content Copyright (C) 2018 Genomics plc
from wecall.bamutils.sequence_quality import SequenceQuality
import pysam
from wecall.bamutils.sample_bank import SampleBank
from wecall_test_drivers.ascii_wecall_runner import DEFAULT_SAMPLE_NAME
from wecall_test_drivers.base_test import BaseTest
from wecall_test_drivers.v... | 2,235 | 25 | 103 |
b1453fd2c7333904abfca834cc09339e75648c4e | 6,207 | py | Python | sprint4v3.py | foreverLTG/OpenCV-logo-detect | 4ff047afcc92173ccbdd9e14164139a144dcde12 | [
"MIT"
] | null | null | null | sprint4v3.py | foreverLTG/OpenCV-logo-detect | 4ff047afcc92173ccbdd9e14164139a144dcde12 | [
"MIT"
] | null | null | null | sprint4v3.py | foreverLTG/OpenCV-logo-detect | 4ff047afcc92173ccbdd9e14164139a144dcde12 | [
"MIT"
] | null | null | null | import cv2
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import numpy as np
# import image
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from sklearn import svm
from sklearn import metrics
from sklearn.ensemble import RandomForestCla... | 31.190955 | 110 | 0.534236 | import cv2
from matplotlib import pyplot as plt
import matplotlib.image as mpimg
import numpy as np
# import image
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets
from sklearn import svm
from sklearn import metrics
from sklearn.ensemble import RandomForestCla... | 2,933 | 0 | 173 |
9120a4fe9cef22a66a221c4f0b53edba765f9e05 | 4,841 | py | Python | homeassistant/components/roku/select.py | DerFlob/hass-core | 19d8b8a6ff2e312b1698ce05a9bd543c6cbe2b1a | [
"Apache-2.0"
] | 3 | 2020-11-27T06:26:27.000Z | 2020-12-09T14:55:16.000Z | homeassistant/components/roku/select.py | DerFlob/hass-core | 19d8b8a6ff2e312b1698ce05a9bd543c6cbe2b1a | [
"Apache-2.0"
] | 18 | 2021-11-24T06:26:13.000Z | 2022-03-31T06:25:15.000Z | homeassistant/components/roku/select.py | AjayShanker-geek/core | 2242b023d383c5e8debfa813abe0871de4d30b06 | [
"Apache-2.0"
] | 3 | 2021-11-14T13:29:33.000Z | 2021-12-27T17:05:22.000Z | """Support for Roku selects."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from rokuecp import Roku
from rokuecp.models import Device as RokuDevice
from homeassistant.components.select import SelectEntity, SelectEntityDescription
from homeassi... | 27.662857 | 88 | 0.676307 | """Support for Roku selects."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from rokuecp import Roku
from rokuecp.models import Device as RokuDevice
from homeassistant.components.select import SelectEntity, SelectEntityDescription
from homeassi... | 1,374 | 0 | 138 |
60a74c0531b2f28c2558158fd8ce49a7eb78ea27 | 18,844 | py | Python | neuro_flow/storage/in_memory.py | neuromation/neuro-flow | c29d61247a4afa3b341474d226e08e976f59345c | [
"Apache-2.0"
] | 3 | 2020-08-27T09:02:15.000Z | 2020-09-29T09:19:57.000Z | neuro_flow/storage/in_memory.py | neuromation/neuro-flow | c29d61247a4afa3b341474d226e08e976f59345c | [
"Apache-2.0"
] | 31 | 2020-08-05T12:55:24.000Z | 2020-09-28T18:07:33.000Z | neuro_flow/storage/in_memory.py | neuromation/neuro-flow | c29d61247a4afa3b341474d226e08e976f59345c | [
"Apache-2.0"
] | null | null | null | from dataclasses import replace
import datetime
import secrets
from neuro_sdk import ResourceNotFound
from typing import (
AbstractSet,
AsyncIterator,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Type,
Union,
)
from yarl import URL
from neuro_flow.storage.base import (
... | 31.938983 | 86 | 0.579229 | from dataclasses import replace
import datetime
import secrets
from neuro_sdk import ResourceNotFound
from typing import (
AbstractSet,
AsyncIterator,
Dict,
Iterable,
List,
Mapping,
Optional,
Sequence,
Type,
Union,
)
from yarl import URL
from neuro_flow.storage.base import (
... | 16,316 | 202 | 1,589 |
d712a4e85f78a3a56c212418b18932c9eb98ea2e | 1,466 | py | Python | web/core/migrations/0002_auto_20200124_1010.py | GuillaumeCaillou/carbure | 92b31e83dbbf53dd0b482ad0a25960713a4a4490 | [
"MIT"
] | 4 | 2020-03-22T18:13:12.000Z | 2021-01-25T10:33:31.000Z | web/core/migrations/0002_auto_20200124_1010.py | GuillaumeCaillou/carbure | 92b31e83dbbf53dd0b482ad0a25960713a4a4490 | [
"MIT"
] | 20 | 2020-07-06T14:33:14.000Z | 2022-03-15T16:54:17.000Z | web/core/migrations/0002_auto_20200124_1010.py | GuillaumeCaillou/carbure | 92b31e83dbbf53dd0b482ad0a25960713a4a4490 | [
"MIT"
] | 4 | 2020-04-03T12:19:12.000Z | 2021-06-15T12:20:57.000Z | # Generated by Django 3.0.2 on 2020-01-24 10:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 36.65 | 178 | 0.599591 | # Generated by Django 3.0.2 on 2020-01-24 10:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('core', '0001_initial'),
... | 0 | 1,288 | 23 |
4183446c632bae5b094ad27ce44abe8161078a8a | 2,651 | py | Python | app.py | 84KaliPleXon3/Smhdk | 7eca622c8d922d8abd35de286718f3839593b889 | [
"MIT"
] | 11 | 2019-02-13T11:53:40.000Z | 2022-03-15T01:11:54.000Z | app.py | p4kl0nc4t/Smhdk | d8ad969452193cbd211cdcc6501cd53fc0320ac3 | [
"MIT"
] | 40 | 2019-06-08T16:26:50.000Z | 2020-05-31T15:18:21.000Z | app.py | 84KaliPleXon3/Smhdk | 7eca622c8d922d8abd35de286718f3839593b889 | [
"MIT"
] | 1 | 2019-10-19T23:58:10.000Z | 2019-10-19T23:58:10.000Z | import base64 as b64
import re
import threading
import time
import flask as f
import requests
import samehadaku as s
app = f.Flask(__name__, template_folder='.')
app.cache = {}
app.init_time = time.time()
app.bounded_semaphore = threading.BoundedSemaphore(12)
app.client_bsemaphores = {}
@app.before_request
@app.... | 25.737864 | 77 | 0.596002 | import base64 as b64
import re
import threading
import time
import flask as f
import requests
import samehadaku as s
app = f.Flask(__name__, template_folder='.')
app.cache = {}
app.init_time = time.time()
app.bounded_semaphore = threading.BoundedSemaphore(12)
app.client_bsemaphores = {}
@app.before_request
def bef... | 2,042 | 0 | 110 |
28efa3aae4bd985d36f0f1ce789fca1d3010d712 | 2,263 | py | Python | holobot/framework/network/http_client_pool.py | rexor12/holobot | 89b7b416403d13ccfeee117ef942426b08d3651d | [
"MIT"
] | 1 | 2021-05-24T00:17:46.000Z | 2021-05-24T00:17:46.000Z | holobot/framework/network/http_client_pool.py | rexor12/holobot | 89b7b416403d13ccfeee117ef942426b08d3651d | [
"MIT"
] | 41 | 2021-03-24T22:50:09.000Z | 2021-12-17T12:15:13.000Z | holobot/framework/network/http_client_pool.py | rexor12/holobot | 89b7b416403d13ccfeee117ef942426b08d3651d | [
"MIT"
] | null | null | null | from aiohttp import ClientSession
from aiohttp.client import ClientTimeout
from aiohttp.web_exceptions import HTTPError, HTTPForbidden, HTTPNotFound
from holobot.sdk.ioc.decorators import injectable
from holobot.sdk.lifecycle import StartableInterface
from holobot.sdk.logging import LogInterface
from holobot.sdk.networ... | 44.372549 | 109 | 0.716306 | from aiohttp import ClientSession
from aiohttp.client import ClientTimeout
from aiohttp.web_exceptions import HTTPError, HTTPForbidden, HTTPNotFound
from holobot.sdk.ioc.decorators import injectable
from holobot.sdk.lifecycle import StartableInterface
from holobot.sdk.logging import LogInterface
from holobot.sdk.networ... | 1,360 | 45 | 164 |
08d78e3e6a0dbbf6a835f0043cdf77106087c861 | 13,773 | py | Python | members/assets.py | louking/members | ee204211812e00945f9e2b09cfa130cc9d3e6558 | [
"Apache-2.0"
] | 1 | 2020-12-07T02:52:01.000Z | 2020-12-07T02:52:01.000Z | members/assets.py | louking/members | ee204211812e00945f9e2b09cfa130cc9d3e6558 | [
"Apache-2.0"
] | 496 | 2020-02-12T15:48:26.000Z | 2022-03-23T11:17:27.000Z | members/assets.py | louking/members | ee204211812e00945f9e2b09cfa130cc9d3e6558 | [
"Apache-2.0"
] | null | null | null | ###########################################################################################
# assets - javascript and css asset handling
#
# Date Author Reason
# ---- ------ ------
# 03/04/20 Lou King Create
#
# Copyright 2020 Lou King. All righ... | 50.822878 | 136 | 0.643723 | ###########################################################################################
# assets - javascript and css asset handling
#
# Date Author Reason
# ---- ------ ------
# 03/04/20 Lou King Create
#
# Copyright 2020 Lou King. All righ... | 0 | 0 | 0 |