hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1870837065c2d59767ac87f0794c2623d41c90f1 | 309 | py | Python | app/register.py | zhangshanwen/flask_demo | ee712902c06b8b3cfdadab8bc2f7d64173e1d5f4 | [
"Unlicense"
] | 3 | 2020-03-24T07:19:09.000Z | 2021-08-18T07:52:29.000Z | app/register.py | zhangshanwen/flask_demo | ee712902c06b8b3cfdadab8bc2f7d64173e1d5f4 | [
"Unlicense"
] | null | null | null | app/register.py | zhangshanwen/flask_demo | ee712902c06b8b3cfdadab8bc2f7d64173e1d5f4 | [
"Unlicense"
] | 2 | 2020-04-20T09:05:09.000Z | 2020-12-11T18:55:45.000Z | # register blue print
| 28.090909 | 70 | 0.747573 | # register blue print
def register(app):
# need import your view example user
from controller.user import login_bp, users_bp, user, users, login
from controller.sms import sms_bp, sms
app.register_blueprint(sms_bp)
app.register_blueprint(login_bp)
app.register_blueprint(users_bp)
| 0 | 0 | 0 | 0 | 0 | 262 | 0 | 0 | 23 |
177f3be88aeb768b3b249e241046ce9b3b2e8a2d | 43 | py | Python | vispy/visuals/glsl/__init__.py | hmaarrfk/vispy | 7f3f6f60c8462bb8a3a8fa03344a2e6990b86eb2 | [
"BSD-3-Clause"
] | 2,617 | 2015-01-02T07:52:18.000Z | 2022-03-29T19:31:15.000Z | vispy/visuals/glsl/__init__.py | hmaarrfk/vispy | 7f3f6f60c8462bb8a3a8fa03344a2e6990b86eb2 | [
"BSD-3-Clause"
] | 1,674 | 2015-01-01T00:36:08.000Z | 2022-03-31T19:35:56.000Z | graphViz/vispy/visuals/glsl/__init__.py | onecklam/ethereum-graphviz | 6993accf0cb85e23013bf7ae6b04145724a6dbd2 | [
"Apache-2.0"
] | 719 | 2015-01-10T14:25:00.000Z | 2022-03-02T13:24:56.000Z | """Repository of common GLSL functions."""
| 21.5 | 42 | 0.72093 | """Repository of common GLSL functions."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bc8c2ad025fa95a5e6a222f67cdd03e9f84c37f1 | 1,426 | py | Python | dwc/bing_wallpaper_changer.py | habereet/Desktop-Wallpaper-Changer | 55b87726550b802989b1d91858640da1ffc5005c | [
"MIT"
] | null | null | null | dwc/bing_wallpaper_changer.py | habereet/Desktop-Wallpaper-Changer | 55b87726550b802989b1d91858640da1ffc5005c | [
"MIT"
] | null | null | null | dwc/bing_wallpaper_changer.py | habereet/Desktop-Wallpaper-Changer | 55b87726550b802989b1d91858640da1ffc5005c | [
"MIT"
] | null | null | null | import datetime
# get today's date
date = str(datetime.date.today())
| 31.688889 | 78 | 0.680224 | import datetime
from os import path
from urllib.request import urlopen
from xml.dom import minidom
from utils import save_image, set_wallpaper_permanent
# get today's date
date = str(datetime.date.today())
def picpath_bing(xmldoc, saveDir, SHOW_DEBUG):
# Parsing the XML File
for element in xmldoc.getElement... | 0 | 0 | 0 | 0 | 0 | 1,146 | 0 | 49 | 158 |
c4fb6540b048213aefe5ed766d65e24a3481ca62 | 2,834 | py | Python | ChatBot/MSG_Template/text/address.py | LeeChunHao2000/Hi-Blockchain | 1be8db74561c690cf195e933dd5ad8c4d0126fba | [
"MIT"
] | 1 | 2020-10-25T03:14:05.000Z | 2020-10-25T03:14:05.000Z | ChatBot/MSG_Template/text/address.py | LeeChunHao2000/Hi-Blockchain | 1be8db74561c690cf195e933dd5ad8c4d0126fba | [
"MIT"
] | null | null | null | ChatBot/MSG_Template/text/address.py | LeeChunHao2000/Hi-Blockchain | 1be8db74561c690cf195e933dd5ad8c4d0126fba | [
"MIT"
] | null | null | null |
# text_get_search_bitcoin_address('1CVyyJ6C8z3t5g25BJ8sBSqpwXTdz3HKiy') | 44.28125 | 243 | 0.600565 | import requests
from linebot.models import *
def text_get_search_ethereum_address(address):
if len(address) != 42:
return TextSendMessage(
text = f'| Hi BlockChain |\n\n'
f'地址長度必須為 42'
)
try:
data = requests.get(f'https://api.etherscan.io/api?module=accoun... | 174 | 0 | 0 | 0 | 0 | 2,608 | 0 | 1 | 95 |
10b337e2921c112a280da662a171712acc229c9e | 3,255 | py | Python | iocage/cli/snapremove.py | krcNAS/iocage | 13d87e92f8ba186b6c8b7f64a948f26a05586430 | [
"BSD-2-Clause"
] | null | null | null | iocage/cli/snapremove.py | krcNAS/iocage | 13d87e92f8ba186b6c8b7f64a948f26a05586430 | [
"BSD-2-Clause"
] | null | null | null | iocage/cli/snapremove.py | krcNAS/iocage | 13d87e92f8ba186b6c8b7f64a948f26a05586430 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014-2017, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 38.294118 | 79 | 0.64639 | # Copyright (c) 2014-2017, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 0 | 1,743 | 0 | 0 | 0 | 0 | 0 | -7 | 68 |
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 | 2,917 | 0 | 0 | 0 | 211 | 124 |
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
"""
| 16.888889 | 32 | 0.769737 | """
HTTPクライアントや認証、環境設定などの共通処理用ディレクトリ
"""
from . import config
from . import auth
from . import utils
from . import locust
from .locust import AppLocust
| 84 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 110 |
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... | 0 | 0 | 0 | 9,252 | 0 | 1,072 | 0 | 0 | 69 |
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 |
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... | 0 | 0 | 0 | 3,504 | 0 | 0 | 0 | -17 | 225 |
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 Djan... | 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... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
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... | 0 | 0 | 0 | 0 | 0 | 132 | 0 | 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
# 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-b32-mlm")... | 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... | 0 | 0 | 0 | 0 | 0 | 420 | 0 | -12 | 45 |
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 typing
__all__ = [
"Boss",
"ELF",
"ElysianRealm",
"MemorialArena",
"MemorialBattle",
"OldAbyss",
"SuperstringAbyss",
]
REMEMBRANCE_SIGILS: typing.Dict[int, typing.Tuple[str, int]] = {
119301: ("The MOTH Ins... | 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... | 6 | 2,767 | 0 | 5,424 | 0 | 0 | 0 | 36 | 366 |
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 | 0 | 0 | 0 | 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
import logging
logging.basicConfig(level="INFO", format='%(asctime)s - %(name)s - %(message)s')
cfg = {
'namespace': "GyCetklhSNcgsCKVKXxSuCUZP4M80z9NRxU1pwfb2XwGhg==",
'name': 'lpbc1', # name of lpbc
'upmu': 'L1', # name + other info for uPMU
'rate':... | 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... | 0 | 0 | 0 | 2,218 | 0 | 0 | 0 | 1 | 67 |
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 | 0 | 0 | 0 | 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 |
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... | 0 | 1,586 | 0 | 55 | 0 | 0 | 0 | -6 | 237 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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 pytest_bdd import scenarios
scenarios("")
| 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... | 0 | 2,209 | 0 | 0 | 0 | 0 | 0 | 67 | 318 |
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 | 0 | 0 | 0 | 0 | 54 | 133 |
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... | 0 | 15,449 | 0 | 0 | 0 | 0 | 0 | 370 | 559 |
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
from astropy.tests.helper import pytest
slow = pytest.mark.slow
__all__ = ('test_angular_tpcf1', )
fixed_seed = 43
| 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... | 0 | 0 | 0 | 0 | 0 | 3,378 | 0 | 92 | 297 |
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... | 206 | 0 | 0 | 0 | 0 | 0 | 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
# 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')
#
# @src.triggers.after_save
# de... | 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')
#
# @... | 0 | 378 | 0 | 161 | 0 | 0 | 0 | 9 | 46 |
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... | 0 | 803 | 0 | 0 | 0 | 0 | 0 | 19 | 199 |
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 | 5,328 | 0 | 0 | 0 | 23 | 67 |
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 | from os import listdir
import matplotlib.pyplot as plt
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)
txt = open(file,'r') ... | 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 | 0 | 0 | 0 | 0 | -15 | 44 |
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 | 0 | 0 | 0 | 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 pulumi
import pulumi.runtime
from typing import Optional, Sequence
from .. import _utilities, _tables
__all__ = [
'GetNatGat... | 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... | 0 | 4,747 | 0 | 653 | 0 | 0 | 0 | 15 | 69 |
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
'''
zipfile has a method call extractall().
extractall(self, path=None, members=None, pwd=None)
Extract all memb... | 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)
... | 0 | 0 | 0 | 0 | 0 | 434 | 0 | -7 | 75 |
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 | 0 | 0 | 0 | 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 rospy
DEFAULT_SENSOR_QUEUE_SIZE = 10
if __name__ == "__main__":
rospy.init_node("object_recorder", anonymous=False)
recorder = ObjectRecorderNode().run()
| 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_... | 0 | 0 | 0 | 3,103 | 0 | 0 | 0 | 127 | 177 |
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:
try:
from typing_extensions import Literal
except ImportError:
import pytest
from .fixtures import (PYTHON_38, PYTHON_39)
skip_before_3_8 = pytest.mark.skipif(not PYTHON_38, reason="feature exists only in p... | 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,
... | 0 | 9,339 | 0 | 0 | 0 | 0 | 0 | 506 | 233 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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 Exception,e:
... | 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... | 111 | 0 | 0 | 0 | 0 | 597 | 0 | 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
| 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):
... | 0 | 260 | 0 | 2,631 | 0 | 0 | 0 | 20 | 155 |
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
| 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 | 0 | 0 | 622 | 0 | 0 | 0 | 19 | 46 |
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 PyQt5.QtWidgets import (QApplication)
MAIN = {'EMAIL': 'EMAIL;TYPE=HOME,INTERNET', 'TEL': 'TEL;TYPE=CELL', 'X-JABBER': 'X-JABBER'}
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Contacts()
sys.exit(app.exec_())
| 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)... | 3 | 0 | 0 | 7,871 | 0 | 42 | 0 | 201 | 181 |
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 | import os
plugin_dir = os.path.dirname(os.path.abspath(__file__))
| 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... | 138 | 259 | 0 | 0 | 0 | 0 | 0 | 14 | 67 |
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
try:
except ImportError:
pass
try:
except ImportError:
pass
# Don't need since files are installed in package
# def test_setPath():
# from BurstCube.utils import setPath
# assert(not setPath())
| 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
... | 0 | 543 | 0 | 0 | 0 | 4,741 | 0 | 86 | 441 |
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
"""
if __name__ == "__main__":
checkpoint_path = "/search/odin/haiyang/fairseq_exp/e2e_trans/fairseq/demo/cp"
# item = ["asr_baseline_lr03_noise02/checkpoint17.pt",
# "asr_our_fuen_03_noise02/c... | 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... | 27 | 0 | 0 | 726 | 0 | 325 | 0 | -28 | 113 |
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... | 0 | 0 | 0 | 0 | 0 | 52 | 0 | 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
from flask_apscheduler import APScheduler
from keras.models import load_model
import gdown
from flask import Flask
disease_map = {
0: 'Apple: Apple Scab',
1: 'Apple: Black Rot',
2: 'Apple: Cedar Rust',
3: 'Apple: Healthy',
4: 'Blueberry: Healthy',
5: 'Cherry: Powdery Mildew',
6: '... | 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... | 23 | 3,719 | 0 | 0 | 0 | 1,353 | 0 | 97 | 290 |
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
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)
print(beta_sum) # linh... | 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 | 0 | 0 | 0 | 0 | -3 | 22 |
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 src.utils import read_config, check_env_vars
check_env_vars()
CONFIG = read_config(config_path=os.getenv('CONFIG_PATH'))
neptune.init(project_qualified_name=CONFIG.project)
RAW_DATA_PATH = CONFIG.data.raw_data_path
FEATURES_DATA_PATH = CONFIG.data.features_data_path
FEATURE_NAME = 'v0'... | 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... | 0 | 0 | 0 | 0 | 0 | 3,817 | 0 | 112 | 181 |
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 homeassistant.components.sensor import (SensorDeviceClass, SensorEntityDescription, SensorStateClass)
from homeassistant.const import (ELECTRIC_CURRENT_AMPERE, ELECTRIC_POTENTIAL_VOLT, ENERGY_WATT_HOUR, PERCENTAGE, POWER_WATT, SIGNAL_STR... | 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 | 136 | 525 | 598 | 0 | 0 | 0 | 320 | 247 |
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 | 0 | 0 | 0 | 0 | 0 | 0 |
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 +... | 0 | 0 | 0 | 0 | 0 | 298 | 0 | 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
| 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... | 0 | 0 | 0 | 0 | 0 | 2,453 | 0 | 158 | 343 |
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... | 0 | 0 | 0 | 19,266 | 0 | 0 | 0 | -6 | 244 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 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 logging
import os
from typing import Union, Dict, List
from teams_logger import TeamsHandler, Office365CardFormatter
from pigeons.filter import TeamsFilter
def init_logger(
endpoint: Union[str, Dict[str, str]],
endpoint_key: str = None,
name: str = None,
level: int = logging.INFO,
log_to_... | 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... | 0 | 0 | 0 | 0 | 0 | 858 | 0 | -36 | 180 |
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 | 0 | 0 | 0 | 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 | 0 | 0 | 0 | 0 | 0 | 0 |
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... | 0 | 0 | 0 | 0 | 0 | 494 | 0 | 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
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 = "adrenoceptor",
plat... | 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 | 0 | 1,659 | 0 | 0 | -2 | 45 |
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
__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=false&format=tsv&namespa... | 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=... | 0 | 0 | 0 | 0 | 0 | 592 | 0 | 2 | 45 |
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... | 246 | 0 | 0 | 7,076 | 0 | 166 | 0 | 0 | 98 |
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
... | 0 | 0 | 0 | 784 | 0 | 0 | 0 | 151 | 135 |
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 | 0 | 0 | 0 | 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)
| 32 | 0 | 0 | 0 | 0 | 0 | 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
def test_heap_initialization_empty_heap(empty_heap):
"""Test that there's nothing initialized."""
from binheap import BinHeap
assert isinstance(empty_heap, BinHeap)
def test_heap_type_error():
"""Ensure TypeError if we pass anything but a list or None."""
fr... | 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 | 577 | 0 | 0 | 0 | 0 | 0 | -8 | 91 |
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 logging
import os
import boto3
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.environ["fg_name"]
boto_session = boto3.Session(region_name=region)
features... | 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... | 0 | 0 | 0 | 0 | 0 | 2,174 | 0 | -35 | 133 |
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
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()
test_plot_galaxy_basic()
test_... | 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... | 0 | 0 | 0 | 0 | 0 | 1,025 | 0 | 10 | 137 |
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 |
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()
| 0 | 52 | 0 | 74 | 0 | 0 | 0 | 18 | 121 |
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 | 0 | 0 | 0 | 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.internet import reactor
from django.conf import settings
#from src import comsys
#store all i... | 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 ... | 0 | 0 | 0 | 2,644 | 0 | 0 | 0 | 64 | 152 |
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 | 0 | 0 | 0 | 0 | 5 | 22 |
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
env = gym.make('CartPole-v0')
render = Tru... | 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... | 0 | 0 | 0 | 1,421 | 0 | 212 | 0 | 3 | 68 |
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 | 0 | 0 | 0 | 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 | import os
import os.path
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/", which is also where app's main file resides
# therefore we can use the path to this file to get the path to the d... | 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... | 0 | 0 | 0 | 5,571 | 0 | 1,181 | 0 | 22 | 202 |
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 numpy as np
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:
res_base = 'results/' + dataset + prefix
RM... | 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 | 0 | 0 | 0 | 0 | -33 | 88 |
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 re
_DATABASE_URI_RE = re.compile(r"(?P<driver>(?P<db_type>sqlite|postgresql)(\+.*)?):\/\/(?P<host>[^/]*)\/(?P<db>.+)")
| 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... | 0 | 2,954 | 0 | 0 | 0 | 1,935 | 0 | -22 | 523 |
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... | 0 | 0 | 0 | 0 | 0 | 3,735 | 0 | 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 | 0 | 0 | 0 | 0 | -4 | 66 |
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 | 0 | 0 | 0 | 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
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... | 0 | 0 | 0 | 0 | 0 | 1,186 | 0 | -2 | 45 |
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(('--'... | 0 | 0 | 0 | 0 | 0 | 211 | 0 | 0 | 46 |
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 networkx as nx
import json
import os
import yaml
loader = yaml.Loader
topology = nx.Graph()
LABEL_END = "_erlang"
with open("../Yml/topology.yml") as file:
data = yaml.l... | 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... | 0 | 0 | 0 | 0 | 0 | 266 | 0 | -14 | 72 |
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
from torch.autograd import Variable
import matplotlib.pyplot as plt
parser = argparse.ArgumentParser()
parser.add_argument("--dataset_dir", type=str, default='./data_scene_flow/training', help="whe... | 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... | 0 | 0 | 0 | 0 | 0 | 878 | 0 | 39 | 133 |
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
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... | 0 | 938 | 0 | 4,034 | 0 | 0 | 0 | 25 | 223 |
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"""
| 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 | 1,771 | 0 | 0 | 0 | 150 | 113 |
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.
from aiohttp import web
routes = web.RouteTableDef()
| 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... | 0 | 3,859 | 0 | 0 | 0 | 186 | 0 | 105 | 246 |
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 | 0 | 0 | 0 | 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
| 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... | 0 | 0 | 0 | 2,340 | 0 | 0 | 0 | 194 | 177 |
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... | 0 | 0 | 0 | 0 | 0 | 2,933 | 0 | 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
ENTITIES: tuple[RokuSelectEntityDescription, ...] = (
RokuSelectEntityDescription(
key="application",
name="Application",
icon="mdi:application",
set_fn=_launch_application,
value_fn=_get_application... | 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... | 0 | 941 | 1,623 | 202 | 0 | 624 | 0 | 305 | 520 |
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
| 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'),
... | 4 | 0 | 0 | 1,284 | 0 | 0 | 0 | 41 | 90 |
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 threading
import time
import flask as f
app = f.Flask(__name__, template_folder='.')
app.cache = {}
app.init_time = time.time()
app.bounded_semaphore = threading.BoundedSemaphore(12)
app.client_bsemaphores = {}
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=False, threaded=True, port=20001... | 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... | 0 | 2,143 | 0 | 0 | 0 | 0 | 0 | -18 | 204 |
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.client import ClientTimeout
DEFAULT_TIMEOUT = ClientTimeout(total=5)
# https://julien.danjou.info/python-and-fast-http-clients/
| 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... | 0 | 1,616 | 0 | 0 | 0 | 0 | 0 | 284 | 220 |
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 | 0 | 0 | 0 | 0 | 0 | 0 |
c83bfccda0abdcdc1651e2979f30056869ad5f16 | 931 | py | Python | Day 1 - Chronal Calibration/frequency_change_calc.py | orfeasa/advent-of-code-2018 | 359d83057006ce2c67c25dbc61988d385d6953a3 | [
"MIT"
] | null | null | null | Day 1 - Chronal Calibration/frequency_change_calc.py | orfeasa/advent-of-code-2018 | 359d83057006ce2c67c25dbc61988d385d6953a3 | [
"MIT"
] | null | null | null | Day 1 - Chronal Calibration/frequency_change_calc.py | orfeasa/advent-of-code-2018 | 359d83057006ce2c67c25dbc61988d385d6953a3 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
frequency_changes = read_input("input.txt")
duplicate = find_duplicate(frequency_changes)
if duplicate is not None:
print(f"First frequency repeated: {duplicate}")
| 25.861111 | 55 | 0.629431 | from typing import List, Optional
def read_input(input_file) -> List:
frequency_changes = []
with open(input_file) as f:
for line in f.readlines():
frequency_changes.append(int(line))
return frequency_changes
def find_duplicate(frequency_changes) -> Optional[int]:
sums = set()
... | 0 | 0 | 0 | 0 | 0 | 636 | 0 | 12 | 68 |
17fbe14142177514c71e1ad98c64718335e01987 | 249 | py | Python | Consu/tryagain.py | JoaoCarabetta/transparencia-unicamp | a8b9f6783cbda1a71aac3e32828909fcee52b2a7 | [
"MIT"
] | null | null | null | Consu/tryagain.py | JoaoCarabetta/transparencia-unicamp | a8b9f6783cbda1a71aac3e32828909fcee52b2a7 | [
"MIT"
] | null | null | null | Consu/tryagain.py | JoaoCarabetta/transparencia-unicamp | a8b9f6783cbda1a71aac3e32828909fcee52b2a7 | [
"MIT"
] | null | null | null | # organize links files and try to download it again
with open ('links.txt', 'r') as f:
links = f.read()
links = links.split('.pdf')
links = [l + '.pdf' for l in links]
for l in links:
import downloadall as down
down.download_pdf(l, "extra")
| 17.785714 | 51 | 0.662651 | # organize links files and try to download it again
with open ('links.txt', 'r') as f:
links = f.read()
links = links.split('.pdf')
links = [l + '.pdf' for l in links]
for l in links:
import downloadall as down
down.download_pdf(l, "extra")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
16a0827d2bcb1b45d246780daa127c3c35e8cbba | 847 | py | Python | meeting/models.py | SlapBass/nx-portal | ee262079db1e5230a24ebbc205e44926f11f8da9 | [
"Apache-2.0"
] | 5 | 2019-10-04T04:46:44.000Z | 2019-10-09T10:02:01.000Z | meeting/models.py | SlapBass/nx-portal | ee262079db1e5230a24ebbc205e44926f11f8da9 | [
"Apache-2.0"
] | 9 | 2019-10-06T07:15:09.000Z | 2020-09-24T02:19:40.000Z | meeting/models.py | SlapBass/nx-portal | ee262079db1e5230a24ebbc205e44926f11f8da9 | [
"Apache-2.0"
] | 1 | 2020-06-19T13:26:08.000Z | 2020-06-19T13:26:08.000Z |
# Create your models here.
| 29.206897 | 83 | 0.736718 | import uuid
from django.db import models
# Create your models here.
class Meeting(models.Model):
mtg_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
name = models.CharField(max_length = 255)
start = models.DateField()
end = models.DateField()
on_start = models.BooleanF... | 0 | 0 | 0 | 706 | 0 | 0 | 0 | -3 | 113 |
1313df16f8c5d9d9e1be83de8dba3f629f19d78a | 754 | py | Python | wrapanapi/systems/__init__.py | kedark3/wrapanapi | 47123c8697273c86eff92f161ee2e48b64446c0f | [
"MIT"
] | null | null | null | wrapanapi/systems/__init__.py | kedark3/wrapanapi | 47123c8697273c86eff92f161ee2e48b64446c0f | [
"MIT"
] | 1 | 2018-11-07T11:57:36.000Z | 2018-11-07T12:06:07.000Z | wrapanapi/systems/__init__.py | kedark3/wrapanapi | 47123c8697273c86eff92f161ee2e48b64446c0f | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .ec2 import EC2System
from .google import GoogleCloudSystem
from .hawkular import HawkularSystem
from .lenovo import LenovoSystem
from .msazure import AzureSystem
from .nuage import NuageSystem
from .openstack import OpenstackSystem
from .openstack_infra import OpenstackInfr... | 34.272727 | 93 | 0.812997 | from __future__ import absolute_import
from .ec2 import EC2System
from .google import GoogleCloudSystem
from .hawkular import HawkularSystem
from .lenovo import LenovoSystem
from .msazure import AzureSystem
from .nuage import NuageSystem
from .openstack import OpenstackSystem
from .openstack_infra import OpenstackInfr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5ef304c711a863611a70cc6b126ae4fd2521847e | 1,021 | py | Python | test/customHookTest.py | FXTD-ODYSSEY/QBinder | b4b288e7c0ef09d2382e3d6678a5c41950257b76 | [
"MIT"
] | 13 | 2020-11-29T15:02:57.000Z | 2022-02-11T03:12:25.000Z | test/customHookTest.py | FXTD-ODYSSEY/QBinder | b4b288e7c0ef09d2382e3d6678a5c41950257b76 | [
"MIT"
] | 8 | 2020-11-30T02:47:56.000Z | 2021-05-19T03:44:16.000Z | test/customHookTest.py | FXTD-ODYSSEY/QtConfig | 978cddf26c0305677b65b04d206138970cb73762 | [
"MIT"
] | 2 | 2020-11-30T01:59:19.000Z | 2021-12-17T06:44:54.000Z | # -*- coding: utf-8 -*-
"""
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
__author__ = "timmyliang"
__email__ = "820472580@qq.com"
__date__ = "2021-01-30 22:16:52"
import os
import sys
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
DI... | 17.016667 | 44 | 0.691479 | # -*- coding: utf-8 -*-
"""
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
__author__ = "timmyliang"
__email__ = "820472580@qq.com"
__date__ = "2021-01-30 22:16:52"
import os
import sys
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
DI... | 0 | 109 | 0 | -2 | 0 | 164 | 0 | 26 | 139 |
482e6fc6d6fd84e5774da7b783b841d887d2d0f2 | 4,524 | py | Python | SUL2/example_eager/detector/data_reader.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 18 | 2017-12-19T07:55:17.000Z | 2020-03-12T11:07:45.000Z | SUL2/example_eager/detector/data_reader.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 1 | 2019-04-18T10:31:41.000Z | 2019-05-23T06:47:24.000Z | SUL2/example_eager/detector/data_reader.py | ddddwee1/SULT | 0ff31b602d20dd8bc5cf4a6f4f5bc193d636e784 | [
"WTFPL"
] | 5 | 2018-06-06T00:51:48.000Z | 2020-03-12T11:07:46.000Z | import cv2
if __name__=='__main__':
img = cv2.imread('img_7.jpg')
annot = load_annot('gt_img_7.txt')
img, annot = process_image(img, annot)
img, conf, xywh = annot_to_grid(img, annot, 16)
annot = grid_to_annot(conf, xywh, 16)
img = draw(img, annot)
cv2.imshow('img',img)
cv2.waitKey(0)
| 26.928571 | 80 | 0.623121 | import random
import cv2
import numpy as np
import glob
def load_annot(fname):
# annot : [x1, y1, x2, y2]
f = open(fname)
annots = []
for i in f:
i = i.strip()
i = i.split(',')
annot = [int(i[0]), int(i[1]), int(i[2]), int(i[3])]
if annot[2]-annot[0]<=1 or annot[3]-annot[1]<=1:
continue
else:
an... | 0 | 0 | 0 | 0 | 0 | 3,973 | 0 | -21 | 276 |