hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c29bcd86e6781ce824c906c328d7722ed0ab4ea3 | 1,260 | py | Python | elo.py | bowersd/elo | 1f072b4630bc78549b32ff90484403341c3169c4 | [
"MIT"
] | null | null | null | elo.py | bowersd/elo | 1f072b4630bc78549b32ff90484403341c3169c4 | [
"MIT"
] | null | null | null | elo.py | bowersd/elo | 1f072b4630bc78549b32ff90484403341c3169c4 | [
"MIT"
] | null | null | null | import numpy as np
def new_result(team1, team2, result):
"""add a new [result, opponent] to team1"""
return team1.append([result, team2])
def spread(e1, e2, c):
"""points spread between e1, e2"""
#recommend c between 25 (football, 10 pts = 1.5 scores) and ~15
return (e1-e2)/c
def pwin... | 28.636364 | 110 | 0.574603 | import numpy as np
def new_result(team1, team2, result):
"""add a new [result, opponent] to team1"""
return team1.append([result, team2])
def spread(e1, e2, c):
"""points spread between e1, e2"""
#recommend c between 25 (football, 10 pts = 1.5 scores) and ~15
return (e1-e2)/c
def pwin... | 28 | 0 | 25 |
3f38845ee93e4c716c401470ab35dcc7255ab24b | 401 | py | Python | tests/integration/test_status.py | isabella232/callisto | 182b9c3a56d13fbb3f8f199a984b4c4be6c17e9f | [
"MIT"
] | 84 | 2020-02-18T14:58:35.000Z | 2022-03-04T22:34:46.000Z | tests/integration/test_status.py | wrike/callisto | 182b9c3a56d13fbb3f8f199a984b4c4be6c17e9f | [
"MIT"
] | 6 | 2020-07-13T19:31:07.000Z | 2022-03-30T15:35:23.000Z | tests/integration/test_status.py | isabella232/callisto | 182b9c3a56d13fbb3f8f199a984b4c4be6c17e9f | [
"MIT"
] | 9 | 2021-03-08T10:17:29.000Z | 2022-03-04T12:21:53.000Z | from __future__ import annotations
import pytest
from aiohttp import web
@pytest.mark.asyncio
| 25.0625 | 73 | 0.745636 | from __future__ import annotations
import pytest
from aiohttp import web
@pytest.mark.asyncio
async def test_status_on_start(run_test_server, aiohttp_test_client):
app, server = await run_test_server()
client = aiohttp_test_client(server)
resp = await client.get('/api/v1/status')
data = await resp.j... | 282 | 0 | 22 |
3400879055ec234e78f4b60dd93f643180827122 | 296 | py | Python | decode.py | keithieopia/numberstation | c20a68f188eeb6283bc95805bfa18a1fddb94ff0 | [
"MIT"
] | null | null | null | decode.py | keithieopia/numberstation | c20a68f188eeb6283bc95805bfa18a1fddb94ff0 | [
"MIT"
] | null | null | null | decode.py | keithieopia/numberstation | c20a68f188eeb6283bc95805bfa18a1fddb94ff0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
import sys
print "\n----- DECODE -----"
for line in sys.stdin:
line = line.strip()
for number in line.split(' '):
number = int(number) % 127
char = chr(number)
sys.stdout.write(char)
sys.stdout.flush()
print "\n------------------"
| 16.444444 | 32 | 0.527027 | #!/usr/bin/env python2
import sys
print "\n----- DECODE -----"
for line in sys.stdin:
line = line.strip()
for number in line.split(' '):
number = int(number) % 127
char = chr(number)
sys.stdout.write(char)
sys.stdout.flush()
print "\n------------------"
| 0 | 0 | 0 |
9604f2646509064a4bddcb064a2563b057233501 | 8,353 | py | Python | bcs-ui/backend/resources/utils/kube_client.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | bcs-ui/backend/resources/utils/kube_client.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | bcs-ui/backend/resources/utils/kube_client.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 37.79638 | 118 | 0.682629 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 1,023 | 0 | 103 |
d3302eeae1595c24a7508bc28cd35be21ac7bff8 | 351 | py | Python | src/api/schema.py | mp5maker/djangoninja | ba87bbf0b62a6842087e6cc4de087456bde3a06b | [
"MIT"
] | null | null | null | src/api/schema.py | mp5maker/djangoninja | ba87bbf0b62a6842087e6cc4de087456bde3a06b | [
"MIT"
] | 5 | 2020-06-05T19:24:11.000Z | 2022-03-11T23:33:29.000Z | src/api/schema.py | mp5maker/djangoninja | ba87bbf0b62a6842087e6cc4de087456bde3a06b | [
"MIT"
] | null | null | null | from graphene import List
from graphene_django.types import DjangoObjectType
from articles.models import Article | 25.071429 | 51 | 0.757835 | from graphene import List
from graphene_django.types import DjangoObjectType
from articles.models import Article
class ArticleType(DjangoObjectType):
class Meta:
model = Article
class ArticleListQuery(object):
all_articles = List(ArticleType)
def resolve_all_articles(self, info, **kwargs):
... | 63 | 129 | 46 |
a9f34eeba88d12faca320cf39966f610133e0ead | 904 | py | Python | dexp/processing/filters/kernels/wiener.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 16 | 2021-04-21T14:09:19.000Z | 2022-03-22T02:30:59.000Z | dexp/processing/filters/kernels/wiener.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 28 | 2021-04-15T17:43:08.000Z | 2022-03-29T16:08:35.000Z | dexp/processing/filters/kernels/wiener.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 3 | 2022-02-08T17:41:30.000Z | 2022-03-18T15:32:27.000Z | from dexp.utils.backends import Backend
def wiener_kernel(kernel, alpha: float = 1e-3, frequency_domain: bool = False, dtype=None):
"""Computes the Wiener filter for a given kernel and alpha parameter.
Parameters
----------
kernel : kernel
alpha : alpha parameter
frequency_domain : if True th... | 26.588235 | 91 | 0.644912 | from dexp.utils.backends import Backend
def wiener_kernel(kernel, alpha: float = 1e-3, frequency_domain: bool = False, dtype=None):
"""Computes the Wiener filter for a given kernel and alpha parameter.
Parameters
----------
kernel : kernel
alpha : alpha parameter
frequency_domain : if True th... | 0 | 0 | 0 |
2738737cdd0170a985bd79b3407572ad27f5a31a | 1,158 | py | Python | products/migrations/0001_initial.py | nkmrohit/python | bd644d51909cda548684b5da98eab998564f3568 | [
"Apache-2.0"
] | null | null | null | products/migrations/0001_initial.py | nkmrohit/python | bd644d51909cda548684b5da98eab998564f3568 | [
"Apache-2.0"
] | null | null | null | products/migrations/0001_initial.py | nkmrohit/python | bd644d51909cda548684b5da98eab998564f3568 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.4 on 2019-01-06 09:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 35.090909 | 118 | 0.596718 | # Generated by Django 2.1.4 on 2019-01-06 09:12
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 0 | 978 | 23 |
d32b33501aa89439bebce71f2b22012411383d73 | 7,421 | py | Python | neuralprocesses/coders/aggregate.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | neuralprocesses/coders/aggregate.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | neuralprocesses/coders/aggregate.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | import lab as B
import numpy as np
from plum import convert, Union
from .. import _dispatch
from ..aggregate import Aggregate, AggregateInput
from ..datadims import data_dims
from ..util import (
register_module,
register_composite_coder,
split,
split_dimension,
merge_dimensions,
select,
)
__a... | 26.598566 | 88 | 0.623366 | import lab as B
import numpy as np
from plum import convert, Union
from .. import _dispatch
from ..aggregate import Aggregate, AggregateInput
from ..datadims import data_dims
from ..util import (
register_module,
register_composite_coder,
split,
split_dimension,
merge_dimensions,
select,
)
__a... | 4,625 | 0 | 411 |
f47372ef37b490f2d37118ac595c009aadce78a0 | 7,827 | py | Python | tests/ds/test_esa_cci_ftp.py | strawpants/cate | eeef7da204b2f5c6dab1a90cb240aa5158c44513 | [
"MIT"
] | null | null | null | tests/ds/test_esa_cci_ftp.py | strawpants/cate | eeef7da204b2f5c6dab1a90cb240aa5158c44513 | [
"MIT"
] | null | null | null | tests/ds/test_esa_cci_ftp.py | strawpants/cate | eeef7da204b2f5c6dab1a90cb240aa5158c44513 | [
"MIT"
] | 1 | 2019-02-14T13:49:37.000Z | 2019-02-14T13:49:37.000Z | import os
import os.path
from datetime import datetime
from unittest import TestCase
import cate.core.ds as io
from cate.conf import get_data_stores_path
from cate.core.ds import DATA_STORE_REGISTRY
from cate.ds.esa_cci_ftp import FileSetDataStore, set_default_data_store
| 41.412698 | 133 | 0.679698 | import os
import os.path
from datetime import datetime
from unittest import TestCase
import cate.core.ds as io
from cate.conf import get_data_stores_path
from cate.core.ds import DATA_STORE_REGISTRY
from cate.ds.esa_cci_ftp import FileSetDataStore, set_default_data_store
class EsaCciFtpTest(TestCase):
def test_s... | 6,395 | 850 | 305 |
5cbc1deb6671805e2ef54871acad6157c762c562 | 837 | py | Python | WGA/insertsizeX.py | lerminin/microbiology-phd-code | 541726c72890a4a46f231388d6b898d9b0b5ad12 | [
"MIT"
] | null | null | null | WGA/insertsizeX.py | lerminin/microbiology-phd-code | 541726c72890a4a46f231388d6b898d9b0b5ad12 | [
"MIT"
] | null | null | null | WGA/insertsizeX.py | lerminin/microbiology-phd-code | 541726c72890a4a46f231388d6b898d9b0b5ad12 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import math
insert_sizes = []
with open('insertsize.sam', 'rt') as sam:
for sam_line in sam:
try:
sam_parts = sam_line.split('\t')
sam_flags = int(sam_parts[1])
if sam_flags & 2: # read mapped in proper pair
insert_size = int(sam_... | 29.892857 | 64 | 0.630824 | #!/usr/bin/env python3
import math
def get_percentile(sorted_list, percentile):
rank = int(math.ceil(percentile / 100.0 * len(sorted_list)))
if rank == 0:
return sorted_list[0]
return sorted_list[rank - 1]
insert_sizes = []
with open('insertsize.sam', 'rt') as sam:
for sam_line in sam:
... | 169 | 0 | 23 |
973f02acb015b67154a59ae4275f5963c606f987 | 3,346 | py | Python | ObitSystem/Obit/share/scripts/MKPlotSpec.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 5 | 2019-08-26T06:53:08.000Z | 2020-10-20T01:08:59.000Z | ObitSystem/Obit/share/scripts/MKPlotSpec.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | null | null | null | ObitSystem/Obit/share/scripts/MKPlotSpec.py | sarrvesh/Obit | e4ce6029e9beb2a8c0316ee81ea710b66b2b7986 | [
"Linux-OpenIB"
] | 8 | 2017-08-29T15:12:32.000Z | 2022-03-31T12:16:08.000Z | # Plot Spectrum at a list of positions in a FITS ImageMF
# On either raw (no PBCor) or PBCorImageMF.py PB corrected
name = 'Abell_194' # Base of plot name
inFile = 'Abell_194.fits'; fdisk=0 # Input file on cwd
# Specify positions (name, ra, dec)
srcpos = [ \
('core', '01:26:00.597', '-01:20:43.71'), \... | 30.418182 | 78 | 0.609982 | # Plot Spectrum at a list of positions in a FITS ImageMF
# On either raw (no PBCor) or PBCorImageMF.py PB corrected
name = 'Abell_194' # Base of plot name
inFile = 'Abell_194.fits'; fdisk=0 # Input file on cwd
# Specify positions (name, ra, dec)
srcpos = [ \
('core', '01:26:00.597', '-01:20:43.71'), \... | 0 | 0 | 0 |
b71d0e7b89e8675ea23c6f697db2da6785182141 | 17,111 | py | Python | grr/server/flows/general/collectors_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/server/flows/general/collectors_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | grr/server/flows/general/collectors_test.py | panhania/grr | fe16a7311a528e31fe0e315a880e98273b8df960 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Test the collector flows.
To reduce the size of this module, additional collector flow tests are split out
into collectors_*_test.py files.
"""
import os
import mock
import psutil
from grr import config
from grr.client.client_actions import standard
from grr.lib import flags
from grr.lib im... | 39.978972 | 80 | 0.681258 | #!/usr/bin/env python
"""Test the collector flows.
To reduce the size of this module, additional collector flow tests are split out
into collectors_*_test.py files.
"""
import os
import mock
import psutil
from grr import config
from grr.client.client_actions import standard
from grr.lib import flags
from grr.lib im... | 8,140 | 0 | 246 |
598ad46f9ed7a9f341549519393c11cb5213ea01 | 984 | py | Python | app/app.py | mohsenasm/flask-api-demo | f4dae8f063b5ebf2d920f5bd39927adc9e5d3dca | [
"MIT"
] | null | null | null | app/app.py | mohsenasm/flask-api-demo | f4dae8f063b5ebf2d920f5bd39927adc9e5d3dca | [
"MIT"
] | null | null | null | app/app.py | mohsenasm/flask-api-demo | f4dae8f063b5ebf2d920f5bd39927adc9e5d3dca | [
"MIT"
] | null | null | null | from flask import Flask
from flask_restful import Api
from flask_apispec import FlaskApiSpec
from resources import HelloWorld, Car
from models import db
from resources import CarByName
if __name__ == '__main__':
app = create_app()
app.run(port=7654, host='0.0.0.0', debug=True)
| 22.363636 | 91 | 0.677846 | from flask import Flask
from flask_restful import Api
from flask_apispec import FlaskApiSpec
from resources import HelloWorld, Car
from models import db
from resources import CarByName
def create_app():
app = Flask(__name__)
# Config
app.config['SQLALCHEMY_ECHO'] = False
app.config['SECRET_KEY'] = ... | 670 | 0 | 23 |
0c0097cb817d34746c8b64ef5f1efb9b703a758d | 2,384 | py | Python | cert_issuer/revoker.py | bloxberg-org/cert-issuer | 5dbdefaa8423ebf8dffb95c6492fc30ddebfd335 | [
"MIT"
] | 2 | 2019-12-19T18:18:45.000Z | 2019-12-19T18:19:23.000Z | cert_issuer/revoker.py | bloxberg-org/cert-issuer | 5dbdefaa8423ebf8dffb95c6492fc30ddebfd335 | [
"MIT"
] | 13 | 2020-01-14T09:59:06.000Z | 2020-02-16T12:38:26.000Z | cert_issuer/revoker.py | BlockcertsSmartContract/cert-issuer | b5fa4373a5c0ce3ebdf0b409118b95544375ed9b | [
"MIT"
] | 1 | 2021-01-14T10:40:31.000Z | 2021-01-14T10:40:31.000Z | """
Base class for building blockchain transactions to issue Blockchain Certificates.
"""
import logging
import json
from pycoin.serialize import h2b
from cert_issuer.errors import BroadcastError
MAX_TX_RETRIES = 5
| 29.073171 | 111 | 0.663591 | """
Base class for building blockchain transactions to issue Blockchain Certificates.
"""
import logging
import json
from pycoin.serialize import h2b
from cert_issuer.errors import BroadcastError
MAX_TX_RETRIES = 5
def ensure_string(value):
if isinstance(value, str):
return value
return value.decod... | 822 | 1,248 | 92 |
266cfd207d8cf337a6e31a3d4b895f4c95a06a55 | 1,053 | py | Python | bin/dht.py | ChatchaiJ/zabbix-dht22 | d4a01de8ad1649be816253af5fb8e42496202865 | [
"MIT"
] | null | null | null | bin/dht.py | ChatchaiJ/zabbix-dht22 | d4a01de8ad1649be816253af5fb8e42496202865 | [
"MIT"
] | null | null | null | bin/dht.py | ChatchaiJ/zabbix-dht22 | d4a01de8ad1649be816253af5fb8e42496202865 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import sys
import time
import Adafruit_DHT
temperature_file = "/tmp/dht.temperature"
humidity_file = "/tmp/dht.humidity"
run_file = "/tmp/dht-run.pid"
sensor = Adafruit_DHT.AM2302
pin = 22
if os.path.isfile(run_file):
pid = read_runpid()
exe = "/proc/{}/exe".format(pid... | 20.25 | 64 | 0.604938 | #!/usr/bin/python
import os
import sys
import time
import Adafruit_DHT
temperature_file = "/tmp/dht.temperature"
humidity_file = "/tmp/dht.humidity"
run_file = "/tmp/dht-run.pid"
sensor = Adafruit_DHT.AM2302
pin = 22
def write_runpid():
pid = os.getpid()
str = '{}'.format(pid)
file = open(run... | 197 | 0 | 46 |
337cf994ee30b9189011921219057f70a6938217 | 9,157 | py | Python | pypage/_html.py | Superjomn/pypage | 5096af2381c5a901136d390572dd3047c0befb43 | [
"Apache-2.0"
] | 1 | 2018-03-25T13:03:54.000Z | 2018-03-25T13:03:54.000Z | pypage/_html.py | Superjomn/pypage | 5096af2381c5a901136d390572dd3047c0befb43 | [
"Apache-2.0"
] | null | null | null | pypage/_html.py | Superjomn/pypage | 5096af2381c5a901136d390572dd3047c0befb43 | [
"Apache-2.0"
] | null | null | null | import os
import sys
import html
from flask import Flask, render_template
INDENT = ' '
class Page(Tag):
'''
include a <html>
'''
@page_switch_gstate
@property
@property
@page_switch_gstate
def display(self, host='0.0.0.0', port=8081, tpl_dir='template', args={}):
... | 29.069841 | 226 | 0.568854 | import os
import sys
import html
from flask import Flask, render_template
INDENT = ' '
def repr_(s):
s = repr(s)
return '"' + s[1:-1] + '"'
class State(object):
gstate = None
def __init__(self):
self.main_queue = []
self.indent = 0
self.stack = [self.main_queue]
... | 5,399 | 1,202 | 378 |
7b1896c116bb1fca172923eb365fae274a036bd0 | 1,821 | py | Python | ListNode.py | yunzhan2014/leetcodePractice | 40ed63bcd9fe7a2eff1b4c54ce52f029143279d5 | [
"MIT"
] | null | null | null | ListNode.py | yunzhan2014/leetcodePractice | 40ed63bcd9fe7a2eff1b4c54ce52f029143279d5 | [
"MIT"
] | null | null | null | ListNode.py | yunzhan2014/leetcodePractice | 40ed63bcd9fe7a2eff1b4c54ce52f029143279d5 | [
"MIT"
] | null | null | null | from typing import List
| 24.608108 | 67 | 0.463482 | from typing import List
class ListNode:
def __init__(self, val=0, next=None) -> None:
self.val = val
self.next = next
class LinkList:
def __init__(self) -> None:
self.head = None
def add(self, *node):
if not node:
print("Please input node val")
... | 516 | 1,203 | 72 |
c011c3b5ec8497bf0151fb9c92c2e7101da1fea4 | 1,416 | py | Python | basic/mycore/logmsg.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | basic/mycore/logmsg.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | basic/mycore/logmsg.py | fplust/python3-cookbook | 0eaca2e3631bb69deaf466c32023bbb2093513da | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: sample
Filter(logname),只允许来自logname或其子日志的消息通过
app.net是app的子日志
消息传播propagate和分层记录器:消息会传播给父记录器
log.propagate属性获取是否传播标志
"""
import logging
import logging.handlers as handlers
import logging.config as config
__author__ = 'Xiong Neng'
logging... | 26.716981 | 97 | 0.639831 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: sample
Filter(logname),只允许来自logname或其子日志的消息通过
app.net是app的子日志
消息传播propagate和分层记录器:消息会传播给父记录器
log.propagate属性获取是否传播标志
"""
import logging
import logging.handlers as handlers
import logging.config as config
__author__ = 'Xiong Neng'
logging... | 744 | 12 | 99 |
ea095a43b4ddfbd4f9d8cec2de95c45d21aeed6f | 1,568 | py | Python | gui_core.py | andycasey/narrowband-fourier-filter | dd7a1f697f95d967262804260430ea3d28595df1 | [
"MIT"
] | null | null | null | gui_core.py | andycasey/narrowband-fourier-filter | dd7a1f697f95d967262804260430ea3d28595df1 | [
"MIT"
] | null | null | null | gui_core.py | andycasey/narrowband-fourier-filter | dd7a1f697f95d967262804260430ea3d28595df1 | [
"MIT"
] | null | null | null | # coding: utf-8
""" Matplotlib figure functionality for the Traits GUI. """
from __future__ import division, print_function
__author__ = "Andy Casey <arc@ast.cam.ac.uk>"
# Third-party
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.backends.backend_wx import NavigationToolb... | 30.745098 | 80 | 0.712372 | # coding: utf-8
""" Matplotlib figure functionality for the Traits GUI. """
from __future__ import division, print_function
__author__ = "Andy Casey <arc@ast.cam.ac.uk>"
# Third-party
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg
from matplotlib.backends.backend_wx import NavigationToolb... | 96 | 0 | 54 |
f3a7ab02720f61c992d66eaeb499b7ed5982fec3 | 3,314 | py | Python | yolov5-coreml-tflite-converter/tflite/tf_metadata/input_metadata_writer.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_metadata/input_metadata_writer.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | yolov5-coreml-tflite-converter/tflite/tf_metadata/input_metadata_writer.py | SchweizerischeBundesbahnen/sbb-ml-models | 485356aeb0a277907c160d435f7f654154046a70 | [
"MIT"
] | null | null | null | from tflite_support import metadata_schema_py_generated as _metadata_fb
from constants import IMAGE_NAME, IOU_NAME, CONF_NAME, NORMALIZED_SUFFIX, QUANTIZED_SUFFIX
from tf_metadata.metadata_utils import MetadataHelper
| 45.39726 | 193 | 0.646047 | from tflite_support import metadata_schema_py_generated as _metadata_fb
from constants import IMAGE_NAME, IOU_NAME, CONF_NAME, NORMALIZED_SUFFIX, QUANTIZED_SUFFIX
from tf_metadata.metadata_utils import MetadataHelper
class InputMetadataWriter(MetadataHelper):
def __init__(self, input_order, img_size, normalized,... | 2,917 | 21 | 157 |
9400ae0c2a63c58b7f5acadb97e29bed0e18a486 | 37 | py | Python | ctaAnalysis/tools/__init__.py | sergiohcdna/ctaAnalysis | 1e4924fafa7e90f7d31abc5a60c2a8da796d95ad | [
"BSD-3-Clause"
] | null | null | null | ctaAnalysis/tools/__init__.py | sergiohcdna/ctaAnalysis | 1e4924fafa7e90f7d31abc5a60c2a8da796d95ad | [
"BSD-3-Clause"
] | 13 | 2021-02-05T00:19:53.000Z | 2021-11-23T03:54:12.000Z | ctadmtool/tools/__init__.py | sergiohcdna/ctadmtool | d509d51033855de5fb54d0c9be5fda84a2ed629e | [
"BSD-3-Clause"
] | 3 | 2020-12-16T15:26:57.000Z | 2021-08-17T17:23:40.000Z | # Sergio, 2020
__all__ = ['misc']
| 9.25 | 18 | 0.567568 | # Sergio, 2020
__all__ = ['misc']
| 0 | 0 | 0 |
325c5c8856fcecf4145f1fd3a4d98ecc4b6316f0 | 3,208 | py | Python | dlkit/handcar/id/objects.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 2 | 2018-02-23T12:16:11.000Z | 2020-10-08T17:54:24.000Z | dlkit/handcar/id/objects.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 87 | 2017-04-21T18:57:15.000Z | 2021-12-13T19:43:57.000Z | dlkit/handcar/id/objects.py | UOC/dlkit | a9d265db67e81b9e0f405457464e762e2c03f769 | [
"MIT"
] | 1 | 2018-03-01T16:44:25.000Z | 2018-03-01T16:44:25.000Z | # -*- coding: utf-8 -*-
# This module contains all the Object classes used by the MIT Core Concept
# Catalog (MC3) Handcar based implementation of the OSID Id Service.
from ...abstract_osid.id import objects as abc_id_objects
from ..osid import objects as osid_objects
from .. import settings
from ..primitives import ... | 34.869565 | 139 | 0.61783 | # -*- coding: utf-8 -*-
# This module contains all the Object classes used by the MIT Core Concept
# Catalog (MC3) Handcar based implementation of the OSID Id Service.
from ...abstract_osid.id import objects as abc_id_objects
from ..osid import objects as osid_objects
from .. import settings
from ..primitives import ... | 313 | 0 | 27 |
8c56c7778e3d3ca390901a23125a7ad8c3c8efc4 | 295 | py | Python | surnames/constants.py | mleila/surname_predictor | 76ad33bd8c5a0bf3e10c6f7808d5deb2b7e75558 | [
"MIT"
] | null | null | null | surnames/constants.py | mleila/surname_predictor | 76ad33bd8c5a0bf3e10c6f7808d5deb2b7e75558 | [
"MIT"
] | null | null | null | surnames/constants.py | mleila/surname_predictor | 76ad33bd8c5a0bf3e10c6f7808d5deb2b7e75558 | [
"MIT"
] | null | null | null | # dataframe column names
SURNAME = 'surname'
ORIGIN = 'nationality'
# split types
TRAIN = 'train'
VALID = 'val'
TEST = 'test'
# special tokens
START_TOKEN = '<start>'
END_TOKEN = '<end>'
MASK_TOKEN = '<mask>'
UNK_TOKEN = '<unk>'
# data dictionary keys
X_DATA = 'x_data'
Y_TARGET = 'y_target'
| 15.526316 | 24 | 0.677966 | # dataframe column names
SURNAME = 'surname'
ORIGIN = 'nationality'
# split types
TRAIN = 'train'
VALID = 'val'
TEST = 'test'
# special tokens
START_TOKEN = '<start>'
END_TOKEN = '<end>'
MASK_TOKEN = '<mask>'
UNK_TOKEN = '<unk>'
# data dictionary keys
X_DATA = 'x_data'
Y_TARGET = 'y_target'
| 0 | 0 | 0 |
016a58877a8d91c56314f3013d344fa95000512f | 1,931 | py | Python | src/qfit/remove_duplicates.py | sakibh/qfit-3.0 | fcc9d56b21d2d16ffb2796da0d48003649a31909 | [
"MIT"
] | null | null | null | src/qfit/remove_duplicates.py | sakibh/qfit-3.0 | fcc9d56b21d2d16ffb2796da0d48003649a31909 | [
"MIT"
] | null | null | null | src/qfit/remove_duplicates.py | sakibh/qfit-3.0 | fcc9d56b21d2d16ffb2796da0d48003649a31909 | [
"MIT"
] | null | null | null | """Delete duplicate atom entries"""
import numpy as np
import argparse
import logging
import os
import sys
import time
from string import ascii_uppercase
from . import Structure
from .structure import residue_type
from .structure.residue import _RotamerResidue
from .structure.rotamers import ROTAMERS
| 31.655738 | 74 | 0.625583 | """Delete duplicate atom entries"""
import numpy as np
import argparse
import logging
import os
import sys
import time
from string import ascii_uppercase
from . import Structure
from .structure import residue_type
from .structure.residue import _RotamerResidue
from .structure.rotamers import ROTAMERS
def parse_args():... | 1,582 | 0 | 46 |
71cfdf0afcbd0f1da08e9e27344b801abf853d7f | 1,641 | py | Python | doc/scripts/cts.py | joepatmckenna/fem | 18b3e3cb0b83f7a4eb464c84f09f00673ea2fcb3 | [
"MIT"
] | null | null | null | doc/scripts/cts.py | joepatmckenna/fem | 18b3e3cb0b83f7a4eb464c84f09f00673ea2fcb3 | [
"MIT"
] | null | null | null | doc/scripts/cts.py | joepatmckenna/fem | 18b3e3cb0b83f7a4eb464c84f09f00673ea2fcb3 | [
"MIT"
] | null | null | null | from scipy.linalg import solve
from scipy.special import erf as erf
import matplotlib.pyplot as plt
import numpy as np
n = 20
dt, T = 1., int(1e4)
l = np.int(np.ceil(T / dt))
sqrt_dt = np.sqrt(dt)
sqrt_2 = np.sqrt(2)
rat = sqrt_dt / sqrt_2
w = np.random.uniform(-0.5, 0.5, size=(n, n))
w[np.diag_indices_from(w)] -= 2... | 20.012195 | 79 | 0.549055 | from scipy.linalg import solve
from scipy.special import erf as erf
import matplotlib.pyplot as plt
import numpy as np
n = 20
dt, T = 1., int(1e4)
l = np.int(np.ceil(T / dt))
sqrt_dt = np.sqrt(dt)
sqrt_2 = np.sqrt(2)
rat = sqrt_dt / sqrt_2
w = np.random.uniform(-0.5, 0.5, size=(n, n))
w[np.diag_indices_from(w)] -= 2... | 518 | 0 | 23 |
47153e4f3910187d299ca8e599918d5ac05186be | 251 | py | Python | dataview/testapi/views.py | srkama/haysolr | 0195f5fc113e416a4cabf3f5ceb1ba55901e4aaa | [
"Apache-2.0"
] | null | null | null | dataview/testapi/views.py | srkama/haysolr | 0195f5fc113e416a4cabf3f5ceb1ba55901e4aaa | [
"Apache-2.0"
] | null | null | null | dataview/testapi/views.py | srkama/haysolr | 0195f5fc113e416a4cabf3f5ceb1ba55901e4aaa | [
"Apache-2.0"
] | null | null | null | # Create your views here.
from django.shortcuts import render
from .froms import SampleSearchForm
| 22.818182 | 60 | 0.737052 | # Create your views here.
from django.shortcuts import render
from .froms import SampleSearchForm
def index(request):
form = SampleSearchForm(request.GET)
results = form.search()
return render(request,'index.html', {'samples':results})
| 128 | 0 | 23 |
4e1933358b9560b15caf019fc50fb29bbee92a56 | 547 | py | Python | structure_api/avg_df.py | vanducng/learning-spark | b7e93361b1ae37fbcd718c4d7034b8355b65fd94 | [
"MIT"
] | null | null | null | structure_api/avg_df.py | vanducng/learning-spark | b7e93361b1ae37fbcd718c4d7034b8355b65fd94 | [
"MIT"
] | null | null | null | structure_api/avg_df.py | vanducng/learning-spark | b7e93361b1ae37fbcd718c4d7034b8355b65fd94 | [
"MIT"
] | null | null | null | from pyspark.sql import SparkSession
from pyspark.sql.functions import avg
spark = SparkSession\
.builder\
.appName("SparkApp")\
.master("local[*]")\
.getOrCreate()
# Create a DataFrame using SparkSession
data_df = spark.createDataFrame([("Brooke", 20), ("Denny", 31), ("Jules", 30), ("... | 32.176471 | 124 | 0.66362 | from pyspark.sql import SparkSession
from pyspark.sql.functions import avg
spark = SparkSession\
.builder\
.appName("SparkApp")\
.master("local[*]")\
.getOrCreate()
# Create a DataFrame using SparkSession
data_df = spark.createDataFrame([("Brooke", 20), ("Denny", 31), ("Jules", 30), ("... | 0 | 0 | 0 |
a663960c1739bc8ef160b45aee91ec709b69de9f | 2,950 | py | Python | mobile_platform/scan_black/test.py | tkuiclab/wrs2018 | d7556a09d265f17ec461571b73271a4d97df397c | [
"MIT"
] | 3 | 2020-02-17T12:56:22.000Z | 2020-09-30T11:17:03.000Z | mobile_platform/scan_black/test.py | i-am-neet/wrs2020 | 3b388eac6832f2559c59fa0c1f7732589c5eff0c | [
"MIT"
] | 12 | 2019-05-14T12:24:02.000Z | 2020-03-24T14:00:48.000Z | mobile_platform/scan_black/test.py | i-am-neet/wrs2020 | 3b388eac6832f2559c59fa0c1f7732589c5eff0c | [
"MIT"
] | 8 | 2020-02-17T12:55:59.000Z | 2021-07-22T12:24:15.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-+
import sys
sys.path.insert(1,'/usr/local/lib/python3.5/dist-packages')
import numpy as np
import cv2
INNER_X = 100
INNER_Y = 30
OUTER_X = 150
OUTER_Y = 60
RANGE = 20
if __name__ == "__main__":
main() | 33.522727 | 121 | 0.477966 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-+
import sys
sys.path.insert(1,'/usr/local/lib/python3.5/dist-packages')
import numpy as np
import cv2
INNER_X = 100
INNER_Y = 30
OUTER_X = 150
OUTER_Y = 60
RANGE = 20
def main():
cap = cv2.VideoCapture(0)
while(True):
# Capture frame... | 2,654 | 0 | 25 |
d883291bc2bbbb898330f761e0a95b399364a7cc | 2,618 | py | Python | isplutils/data_siamese.py | 18845635368/multicard | 7e16dc70b69efde5e462ba49916adbea32aa6f53 | [
"Apache-2.0"
] | null | null | null | isplutils/data_siamese.py | 18845635368/multicard | 7e16dc70b69efde5e462ba49916adbea32aa6f53 | [
"Apache-2.0"
] | null | null | null | isplutils/data_siamese.py | 18845635368/multicard | 7e16dc70b69efde5e462ba49916adbea32aa6f53 | [
"Apache-2.0"
] | null | null | null | """
Video Face Manipulation Detection Through Ensemble of CNNs
Image and Sound Processing Lab - Politecnico di Milano
Nicolò Bonettini
Edoardo Daniele Cannas
Sara Mandelli
Luca Bondi
Paolo Bestagini
"""
from typing import List
import albumentations as A
import pandas as pd
from albumentations.pytorch import ToTensor... | 33.139241 | 119 | 0.618029 | """
Video Face Manipulation Detection Through Ensemble of CNNs
Image and Sound Processing Lab - Politecnico di Milano
Nicolò Bonettini
Edoardo Daniele Cannas
Sara Mandelli
Luca Bondi
Paolo Bestagini
"""
from typing import List
import albumentations as A
import pandas as pd
from albumentations.pytorch import ToTensor... | 727 | 1,470 | 23 |
150dc44042c03b128ac4b49331e9ff6154ff9474 | 390 | py | Python | src/nlplib/core/base.py | rectangletangle/nlplib | 7dcc0daf050a73c03b7d7f0257ad0b862586a6e3 | [
"BSD-2-Clause"
] | 1 | 2015-11-18T12:59:52.000Z | 2015-11-18T12:59:52.000Z | src/nlplib/core/base.py | rectangletangle/nlplib | 7dcc0daf050a73c03b7d7f0257ad0b862586a6e3 | [
"BSD-2-Clause"
] | null | null | null | src/nlplib/core/base.py | rectangletangle/nlplib | 7dcc0daf050a73c03b7d7f0257ad0b862586a6e3 | [
"BSD-2-Clause"
] | null | null | null |
from nlplib.general.represent import represented_nonliterally
__all__ = ['Base']
class Base :
''' A base class for all of the core classes. '''
| 24.375 | 109 | 0.684615 |
from nlplib.general.represent import represented_nonliterally
__all__ = ['Base']
class Base :
''' A base class for all of the core classes. '''
def __repr__ (self, *args, **kw) :
# This method can take arguments so subclasses can use the same logic for building their own specific
# represen... | 210 | 0 | 27 |
dfcbcd2d73ef45a209524fcae2dd34a83f28b792 | 12,118 | py | Python | mi/dataset/parser/test/test_presf_abc_dcl.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/test/test_presf_abc_dcl.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/test/test_presf_abc_dcl.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
@package mi.dataset.parser.test.test_presf_abc_dcl
@file marine-integrations/mi/dataset/parser/test/test_presf_abc_dcl.py
@author Christopher Fortin
@brief Test code for a presf_abc_dcl data parser
"""
import os
from nose.plugins.attrib import attr
from mi.core.log import get_logger
log =... | 40.259136 | 102 | 0.598531 | #!/usr/bin/env python
"""
@package mi.dataset.parser.test.test_presf_abc_dcl
@file marine-integrations/mi/dataset/parser/test/test_presf_abc_dcl.py
@author Christopher Fortin
@brief Test code for a presf_abc_dcl data parser
"""
import os
from nose.plugins.attrib import attr
from mi.core.log import get_logger
log =... | 1,279 | 0 | 54 |
ee71d0a931e1ad83e0f5772c1ab5eb430a7795f4 | 92 | py | Python | yeti/core/indicators/__init__.py | Darkheir/TibetanBrownBear | c3843daa4f84730e733c2dde1cda7739e6cdad8e | [
"Apache-2.0"
] | null | null | null | yeti/core/indicators/__init__.py | Darkheir/TibetanBrownBear | c3843daa4f84730e733c2dde1cda7739e6cdad8e | [
"Apache-2.0"
] | null | null | null | yeti/core/indicators/__init__.py | Darkheir/TibetanBrownBear | c3843daa4f84730e733c2dde1cda7739e6cdad8e | [
"Apache-2.0"
] | null | null | null | from . import indicator_base
from . import indicator
from . import regex
from . import yara
| 18.4 | 28 | 0.782609 | from . import indicator_base
from . import indicator
from . import regex
from . import yara
| 0 | 0 | 0 |
74eccbf460275ab0094db55c36be373789e51107 | 4,674 | py | Python | wal_e/log_help.py | fdr/heroku-wal-e | 0145e81611e06328de228d2ac4820f3afae2f5c1 | [
"BSD-3-Clause"
] | 1 | 2022-02-15T18:18:43.000Z | 2022-02-15T18:18:43.000Z | wal_e/log_help.py | fdr/heroku-wal-e | 0145e81611e06328de228d2ac4820f3afae2f5c1 | [
"BSD-3-Clause"
] | null | null | null | wal_e/log_help.py | fdr/heroku-wal-e | 0145e81611e06328de228d2ac4820f3afae2f5c1 | [
"BSD-3-Clause"
] | null | null | null | """
A module to assist with using the Python logging module
"""
import errno
import logging
import logging.handlers
import os
import time
def configure(*args, **kwargs):
"""
Borrowed from logging.basicConfig
Uses the UTCFormatter instead of the regular Formatter
Also, opts you into syslogging.
... | 29.961538 | 80 | 0.60077 | """
A module to assist with using the Python logging module
"""
import errno
import logging
import logging.handlers
import os
import time
class UTCFormatter(logging.Formatter):
# Undocumented, seemingly still in 2.7 (see
# http://od-eon.com/blogs/stefan/logging-utc-timestamps-python/)
converter = time.... | 1,184 | 1,761 | 46 |
5210b1901d945e9a11aa2f5a6efe75f6dbdb368b | 12,560 | py | Python | aether-client-library/aether/client/__init__.py | eHealthAfrica/aether | 6845d7eeebd4ae57332f73d74db3617e00032204 | [
"Apache-2.0"
] | 14 | 2018-08-09T20:57:16.000Z | 2020-10-11T12:22:18.000Z | aether-client-library/aether/client/__init__.py | eHealthAfrica/aether | 6845d7eeebd4ae57332f73d74db3617e00032204 | [
"Apache-2.0"
] | 148 | 2018-07-24T10:52:29.000Z | 2022-02-10T09:06:44.000Z | aether-client-library/aether/client/__init__.py | eHealthAfrica/aether | 6845d7eeebd4ae57332f73d74db3617e00032204 | [
"Apache-2.0"
] | 6 | 2018-07-25T13:33:10.000Z | 2019-09-23T03:02:09.000Z | # Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... | 39.873016 | 95 | 0.621258 | # Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... | 10,161 | 146 | 361 |
8c8cfd328504be103ff94c746740ccfadc6e6ba8 | 6,574 | py | Python | src/twcrawl/crawler.py | hohl/twcrawl | d4979840f4a9e5dc8683a617aeacf7e8a6a23045 | [
"MIT"
] | null | null | null | src/twcrawl/crawler.py | hohl/twcrawl | d4979840f4a9e5dc8683a617aeacf7e8a6a23045 | [
"MIT"
] | null | null | null | src/twcrawl/crawler.py | hohl/twcrawl | d4979840f4a9e5dc8683a617aeacf7e8a6a23045 | [
"MIT"
] | null | null | null | import asyncio
import json
import logging
import sys
from abc import ABC, abstractmethod
from typing import List, TypeVar, Generic, Union, NoReturn, Iterator, Iterable
from sqlalchemy import and_, or_
from .models import session_scope, Session
from .twitter import *
T = TypeVar("T")
class BaseCrawler(ABC, Generic[T]... | 36.320442 | 94 | 0.607241 | import asyncio
import json
import logging
import sys
from abc import ABC, abstractmethod
from typing import List, TypeVar, Generic, Union, NoReturn, Iterator, Iterable
from sqlalchemy import and_, or_
from .models import session_scope, Session
from .twitter import *
T = TypeVar("T")
class BaseCrawler(ABC, Generic[T]... | 3,490 | 0 | 297 |
269f61e18c4134b49bd22df66189d87c3b769436 | 1,341 | py | Python | src/exams/signals.py | GiomarOsorio/another-e-learning-platform | 5cfc76420eb3466691f5187c915c179afb13199a | [
"MIT"
] | null | null | null | src/exams/signals.py | GiomarOsorio/another-e-learning-platform | 5cfc76420eb3466691f5187c915c179afb13199a | [
"MIT"
] | 8 | 2020-06-25T22:16:20.000Z | 2022-03-12T00:39:27.000Z | src/exams/signals.py | GiomarOsorio/another-e-learning-platform | 5cfc76420eb3466691f5187c915c179afb13199a | [
"MIT"
] | null | null | null | from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_save
from django.dispatch import receiver
from courses.models import (
Content,
CourseUserRelations,
)
from .models import Exam
from .models import ExamUserRelations
@receiver(post_save, sender=Content)
@receive... | 34.384615 | 72 | 0.649515 | from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_save
from django.dispatch import receiver
from courses.models import (
Content,
CourseUserRelations,
)
from .models import Exam
from .models import ExamUserRelations
@receiver(post_save, sender=Content)
def conten... | 936 | 0 | 44 |
e9a1306d6a782d59aad5f7711f4de67d6c9b0f65 | 4,057 | py | Python | doop/tle.py | nimbus-bp-1729/doop | 376d57b9c3134b08b78fdf872c65b2d494385ee7 | [
"MIT"
] | null | null | null | doop/tle.py | nimbus-bp-1729/doop | 376d57b9c3134b08b78fdf872c65b2d494385ee7 | [
"MIT"
] | null | null | null | doop/tle.py | nimbus-bp-1729/doop | 376d57b9c3134b08b78fdf872c65b2d494385ee7 | [
"MIT"
] | null | null | null | from math import pi, pow
from datetime import datetime, timedelta, timezone
from doop.constants import Earth
from collections import namedtuple
from enum import IntFlag
ID = namedtuple("ID", "launch_year launch_number piece")
Object = namedtuple("Object", "name number classification")
EphemerisType = IntFlag("Epheme... | 26.00641 | 103 | 0.559527 | from math import pi, pow
from datetime import datetime, timedelta, timezone
from doop.constants import Earth
from collections import namedtuple
from enum import IntFlag
ID = namedtuple("ID", "launch_year launch_number piece")
Object = namedtuple("Object", "name number classification")
EphemerisType = IntFlag("Epheme... | 284 | 0 | 46 |
96bf398610fa4b48c649630a3587b553008546de | 5,900 | py | Python | util/logging/logger.py | joelouismarino/generalized_filtering | f1032d62761c498e5206c0a2b07a012c8223b3de | [
"MIT"
] | 40 | 2018-08-28T05:40:25.000Z | 2022-03-23T09:25:46.000Z | util/logging/logger.py | joelouismarino/generalized_filtering | f1032d62761c498e5206c0a2b07a012c8223b3de | [
"MIT"
] | 2 | 2018-11-03T18:57:17.000Z | 2020-10-06T23:36:44.000Z | util/logging/logger.py | joelouismarino/generalized_filtering | f1032d62761c498e5206c0a2b07a012c8223b3de | [
"MIT"
] | 8 | 2018-09-14T19:58:47.000Z | 2021-02-20T01:54:44.000Z | import os
import torch
from time import strftime
from util.optimization import load_sched
from log_util import set_gpu_recursive, get_last_epoch, update_metric, best_performance
| 40.972222 | 121 | 0.612881 | import os
import torch
from time import strftime
from util.optimization import load_sched
from log_util import set_gpu_recursive, get_last_epoch, update_metric, best_performance
class Logger(object):
def __init__(self, run_config):
"""
Initialize logs, either from existing experiment or create ne... | 773 | 4,925 | 23 |
3d7dd15c50610db8a0d116ee9bdca1196589e3f8 | 771 | py | Python | embeds/bin.py | kaniblu/vhda | 35941097ef552568c29f66cc55d8ce1927f34978 | [
"MIT"
] | 3 | 2021-01-12T05:43:20.000Z | 2021-03-05T17:03:06.000Z | embeds/bin.py | kaniblu/vhda | 35941097ef552568c29f66cc55d8ce1927f34978 | [
"MIT"
] | null | null | null | embeds/bin.py | kaniblu/vhda | 35941097ef552568c29f66cc55d8ce1927f34978 | [
"MIT"
] | null | null | null | __all__ = ["BinaryEmbeddings"]
from dataclasses import dataclass, field
import numpy as np
from gensim.models import KeyedVectors
from .embeddings import Embeddings
@dataclass
| 21.416667 | 77 | 0.671855 | __all__ = ["BinaryEmbeddings"]
from dataclasses import dataclass, field
import numpy as np
from gensim.models import KeyedVectors
from .embeddings import Embeddings
@dataclass
class BinaryEmbeddings(Embeddings):
path: str
_w2v: KeyedVectors = field(init=False, default=None)
def __post_init__(self):
... | 307 | 261 | 22 |
ae1da8ecac817ec988e5a00fe09bc2fb5b5778e3 | 3,856 | py | Python | sw/1.0/ostur_controller/Ostur.py | alvarop/ostur | 6e56a3f53ac3ca09c12586cd35d0b829dd3d6e78 | [
"MIT"
] | 7 | 2017-11-30T20:22:02.000Z | 2021-01-03T02:22:52.000Z | sw/1.0/ostur_controller/Ostur.py | alvarop/ostur | 6e56a3f53ac3ca09c12586cd35d0b829dd3d6e78 | [
"MIT"
] | null | null | null | sw/1.0/ostur_controller/Ostur.py | alvarop/ostur | 6e56a3f53ac3ca09c12586cd35d0b829dd3d6e78 | [
"MIT"
] | 1 | 2018-02-26T02:53:14.000Z | 2018-02-26T02:53:14.000Z | '''
Ostur Cheese Cave Controller Logger
'''
import serial
import sys
import time
from datetime import datetime
| 29.212121 | 75 | 0.571317 | '''
Ostur Cheese Cave Controller Logger
'''
import serial
import sys
import time
from datetime import datetime
class InvalidRelayException(Exception):
pass
class Ostur:
DEBUG = False
# Hardcoding until we can read values back from device
__CMD_MAX_STR_LEN = 1024
def __init__(self, serial_de... | 3,229 | 466 | 46 |
13e16d24168aa4bc3a5045fef015708e7fefe50a | 2,590 | py | Python | src/python/gudhi/point_cloud/dtm.py | yuichi-ike/gudhi-devel | 97e889f34e929f3c2306803b6c37b57926bd1245 | [
"MIT"
] | null | null | null | src/python/gudhi/point_cloud/dtm.py | yuichi-ike/gudhi-devel | 97e889f34e929f3c2306803b6c37b57926bd1245 | [
"MIT"
] | null | null | null | src/python/gudhi/point_cloud/dtm.py | yuichi-ike/gudhi-devel | 97e889f34e929f3c2306803b6c37b57926bd1245 | [
"MIT"
] | null | null | null | # This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
# See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
# Author(s): Marc Glisse
#
# Copyright (C) 2020 Inria
#
# Modification(s):
# - YYYY/MM Author: Description of the modification... | 36.478873 | 112 | 0.599228 | # This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
# See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
# Author(s): Marc Glisse
#
# Copyright (C) 2020 Inria
#
# Modification(s):
# - YYYY/MM Author: Description of the modification... | 54 | 0 | 27 |
aafa8b1b4621d4e3e6267e970f97d0d9477edc5e | 161 | py | Python | 1 Semestre/Analise e Projeto de Algoritmos (Mauricio)/Aula 8 Estrutura de Controle (Repeticao)/Exercicio 3.py | LukasHeidern/Univem-Aulas | 3e7f24eb90a0bfe2af8d49ead958cf4d7072257c | [
"MIT"
] | null | null | null | 1 Semestre/Analise e Projeto de Algoritmos (Mauricio)/Aula 8 Estrutura de Controle (Repeticao)/Exercicio 3.py | LukasHeidern/Univem-Aulas | 3e7f24eb90a0bfe2af8d49ead958cf4d7072257c | [
"MIT"
] | null | null | null | 1 Semestre/Analise e Projeto de Algoritmos (Mauricio)/Aula 8 Estrutura de Controle (Repeticao)/Exercicio 3.py | LukasHeidern/Univem-Aulas | 3e7f24eb90a0bfe2af8d49ead958cf4d7072257c | [
"MIT"
] | null | null | null |
num = int(input("Digite o numero:"))
print(f"Divisores de {num} -",end=" ")
for i in range(1, (num//2) + 1):
if num % i == 0:
print(f"{i}",end=" ") | 23 | 38 | 0.503106 |
num = int(input("Digite o numero:"))
print(f"Divisores de {num} -",end=" ")
for i in range(1, (num//2) + 1):
if num % i == 0:
print(f"{i}",end=" ") | 0 | 0 | 0 |
95294ab081fc0b2769f2d33d172149c71b9fc808 | 1,878 | py | Python | net_cut/net_cut.py | viccsneto/python_ethical_hacking | a16765b3c18272dcb61a77cc14e78431f626eb11 | [
"MIT"
] | null | null | null | net_cut/net_cut.py | viccsneto/python_ethical_hacking | a16765b3c18272dcb61a77cc14e78431f626eb11 | [
"MIT"
] | null | null | null | net_cut/net_cut.py | viccsneto/python_ethical_hacking | a16765b3c18272dcb61a77cc14e78431f626eb11 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import netfilterqueue
import sys
import optparse
DEFAULT_QUEUE_NUM = 0
exit_code = 0
dropped_packet_count = 0
parser = optparse.OptionParser()
parser.add_option("-q", "--queue-num", dest="queue_num", default=DEFAULT_QUEUE_NUM, help="IPTables Queue Num")
parser.add_option("-s",... | 31.830508 | 143 | 0.722577 | #!/usr/bin/env python3
import subprocess
import netfilterqueue
import sys
import optparse
DEFAULT_QUEUE_NUM = 0
exit_code = 0
dropped_packet_count = 0
parser = optparse.OptionParser()
parser.add_option("-q", "--queue-num", dest="queue_num", default=DEFAULT_QUEUE_NUM, help="IPTables Queue Num")
parser.add_option("-s",... | 772 | 0 | 119 |
e32c58c97c4ff497019f49a9328b267e2620aeed | 2,231 | py | Python | python/app/plugins/http/Weblogic/CVE_2019_2618.py | taomujian/linbing | fe772a58f41e3b046b51a866bdb7e4655abaf51a | [
"MIT"
] | 351 | 2020-02-26T05:23:26.000Z | 2022-03-26T12:39:19.000Z | python/app/plugins/http/Weblogic/CVE_2019_2618.py | taomujian/linbing | fe772a58f41e3b046b51a866bdb7e4655abaf51a | [
"MIT"
] | 15 | 2020-03-26T07:31:49.000Z | 2022-03-09T02:12:17.000Z | python/app/plugins/http/Weblogic/CVE_2019_2618.py | taomujian/linbing | fe772a58f41e3b046b51a866bdb7e4655abaf51a | [
"MIT"
] | 99 | 2020-02-28T07:30:46.000Z | 2022-03-16T16:41:09.000Z | #!/usr/bin/env python3
from app.lib.utils.request import request
from app.lib.utils.common import get_useragent
if __name__ == "__main__":
CVE_2019_2618 = CVE_2019_2618_BaseVerify('http://127.0.0.1:7001')
print(CVE_2019_2618.check())
| 36.57377 | 240 | 0.57463 | #!/usr/bin/env python3
from app.lib.utils.request import request
from app.lib.utils.common import get_useragent
class CVE_2019_2618_BaseVerify:
def __init__(self, url):
self.info = {
'name': 'CVE-2019-2618',
'description': 'Weblogic File Upload Vulnerability, 受影响版本: Weblogic 10.3.6... | 992 | 1,007 | 23 |
d449ed0b3fbab952801199527dde633eb20b3eaa | 10,631 | py | Python | rumi/processing/test_demand.py | prayas-energy/Rumi | fd7f0cf4eba08b4efa1a643217caff7f876fb394 | [
"Apache-2.0"
] | 1 | 2021-11-24T07:22:15.000Z | 2021-11-24T07:22:15.000Z | rumi/processing/test_demand.py | prayas-energy/Rumi | fd7f0cf4eba08b4efa1a643217caff7f876fb394 | [
"Apache-2.0"
] | null | null | null | rumi/processing/test_demand.py | prayas-energy/Rumi | fd7f0cf4eba08b4efa1a643217caff7f876fb394 | [
"Apache-2.0"
] | 1 | 2022-02-09T11:11:35.000Z | 2022-02-09T11:11:35.000Z | # Copyright 2021 Prayas Energy Group(https://www.prayaspune.org/peg/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 43.569672 | 84 | 0.508419 | # Copyright 2021 Prayas Energy Group(https://www.prayaspune.org/peg/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 9,447 | 0 | 414 |
072688e3c77eb588671a0b65a0cbdc9e38f17317 | 2,805 | py | Python | psycopg2-master/tests/test_errors.py | HabeshaQueen/Gallery-App | 17f7932e0db95a4750bcccf2302efc2c4cdbca4a | [
"Unlicense"
] | null | null | null | psycopg2-master/tests/test_errors.py | HabeshaQueen/Gallery-App | 17f7932e0db95a4750bcccf2302efc2c4cdbca4a | [
"Unlicense"
] | null | null | null | psycopg2-master/tests/test_errors.py | HabeshaQueen/Gallery-App | 17f7932e0db95a4750bcccf2302efc2c4cdbca4a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# test_errors.py - unit test for psycopg2.errors module
#
# Copyright (C) 2018-2019 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software... | 32.241379 | 73 | 0.693405 | #!/usr/bin/env python
# test_errors.py - unit test for psycopg2.errors module
#
# Copyright (C) 2018-2019 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software... | 1,356 | 17 | 153 |
89514c5395dbbbfa4247af56024e46d7ae08d8d0 | 467 | py | Python | google_apis/build/check_internal.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | google_apis/build/check_internal.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 113 | 2015-05-04T09:58:14.000Z | 2022-01-31T19:35:03.000Z | google_apis/build/check_internal.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""google_api's auto-internal gyp integration.
Takes one argument, a path. Prints 1 if the path exists, 0 if not.
"""
from __fut... | 21.227273 | 72 | 0.715203 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""google_api's auto-internal gyp integration.
Takes one argument, a path. Prints 1 if the path exists, 0 if not.
"""
from __fut... | 0 | 0 | 0 |
c0bcc4af37f58824d46a99b31f274f1522b50b73 | 1,994 | py | Python | coq/doc/tools/coqrst/notations/TacticNotationsVisitor.py | reichel3/TacTok | c344e76263de04311af8a0030c07aec95d87f71c | [
"MIT"
] | 7 | 2020-11-23T02:45:36.000Z | 2022-03-18T03:03:33.000Z | coq/doc/tools/coqrst/notations/TacticNotationsVisitor.py | reichel3/TacTok | c344e76263de04311af8a0030c07aec95d87f71c | [
"MIT"
] | 4 | 2021-02-23T03:03:51.000Z | 2021-11-13T00:07:38.000Z | coq/doc/tools/coqrst/notations/TacticNotationsVisitor.py | reichel3/TacTok | c344e76263de04311af8a0030c07aec95d87f71c | [
"MIT"
] | 2 | 2021-01-19T17:56:28.000Z | 2022-03-28T04:39:41.000Z | # Generated from TacticNotations.g by ANTLR 4.7
from antlr4 import *
if __name__ is not None and "." in __name__:
from .TacticNotationsParser import TacticNotationsParser
else:
from TacticNotationsParser import TacticNotationsParser
# This class defines a complete generic visitor for a parse tree produced by T... | 33.79661 | 99 | 0.768305 | # Generated from TacticNotations.g by ANTLR 4.7
from antlr4 import *
if __name__ is not None and "." in __name__:
from .TacticNotationsParser import TacticNotationsParser
else:
from TacticNotationsParser import TacticNotationsParser
# This class defines a complete generic visitor for a parse tree produced by T... | 723 | 26 | 257 |
62941d3702260ceaa3821d90ec0322e63b7e46c3 | 335 | py | Python | leetcode/1941_check_if_all_characters_have_equal_number_of_occurrences.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | 3 | 2018-05-10T09:56:49.000Z | 2020-11-07T18:09:42.000Z | leetcode/1941_check_if_all_characters_have_equal_number_of_occurrences.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | leetcode/1941_check_if_all_characters_have_equal_number_of_occurrences.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import Counter
if __name__ == '__main__':
solution = Solution()
assert solution.areOccurrencesEqual('abcabc')
assert not solution.areOccurrencesEqual('aaabb')
| 20.9375 | 52 | 0.674627 | # -*- coding: utf-8 -*-
from collections import Counter
class Solution:
def areOccurrencesEqual(self, s: str) -> bool:
return len(set(Counter(s).values())) == 1
if __name__ == '__main__':
solution = Solution()
assert solution.areOccurrencesEqual('abcabc')
assert not solution.areOccurrences... | 75 | -6 | 49 |
d5671e122aab6c9af0eb8a1d60cab4c0433d82bd | 6,280 | py | Python | count/plot.py | rsspp/experiments | b2d341afc514c05c51c165803d4b7ed153ab3716 | [
"BSD-3-Clause"
] | 4 | 2019-12-17T18:20:42.000Z | 2020-05-24T05:50:13.000Z | count/plot.py | rsspp/experiments | b2d341afc514c05c51c165803d4b7ed153ab3716 | [
"BSD-3-Clause"
] | 6 | 2020-04-15T17:09:29.000Z | 2021-05-03T13:24:04.000Z | count/plot.py | rsspp/experiments | b2d341afc514c05c51c165803d4b7ed153ab3716 | [
"BSD-3-Clause"
] | null | null | null | from common import *
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.lines import Line2D
import matplotlib.ticker as ticker
import os
from matplotlib import container
from common import *
from collections import OrderedDict
from matplotlib.markers import Marker... | 33.763441 | 226 | 0.619745 | from common import *
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.lines import Line2D
import matplotlib.ticker as ticker
import os
from matplotlib import container
from common import *
from collections import OrderedDict
from matplotlib.markers import Marker... | 0 | 0 | 0 |
100530c3926985002bd78d1a4aff73fdf7b9828b | 1,978 | py | Python | .history/Hackerrank/set_intersection_operation_20200518113131.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | 1 | 2020-05-18T17:50:00.000Z | 2020-05-18T17:50:00.000Z | Hackerrank/Python/set_intersection_operation.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | null | null | null | Hackerrank/Python/set_intersection_operation.py | EvanthiosPapadopoulos/Python3 | ab773fd458e365c1510f98ecac65965234c881e8 | [
"MIT"
] | null | null | null | '''
A&B.png
.intersection()
The .intersection() operator returns the intersection of a set and the set of elements in an iterable.
Sometimes, the & operator is used in place of the .intersection() operator, but it only operates on the set of elements in set.
The set is immutable to the .intersection() operation (or & ... | 33.525424 | 234 | 0.72548 | '''
A&B.png
.intersection()
The .intersection() operator returns the intersection of a set and the set of elements in an iterable.
Sometimes, the & operator is used in place of the .intersection() operator, but it only operates on the set of elements in set.
The set is immutable to the .intersection() operation (or & ... | 0 | 0 | 0 |
bf47b796015dc3bc7e17058c2132d1bf7f75995c | 8,908 | py | Python | fuzzysets/plot.py | StiliyanDr/fuzzy-sets | 9355ac5da7d96ea32675ea96fb116ce8dfd5cf91 | [
"MIT"
] | 1 | 2021-09-22T13:40:25.000Z | 2021-09-22T13:40:25.000Z | fuzzysets/plot.py | StiliyanDr/fuzzy-sets | 9355ac5da7d96ea32675ea96fb116ce8dfd5cf91 | [
"MIT"
] | null | null | null | fuzzysets/plot.py | StiliyanDr/fuzzy-sets | 9355ac5da7d96ea32675ea96fb116ce8dfd5cf91 | [
"MIT"
] | 1 | 2021-12-04T00:11:15.000Z | 2021-12-04T00:11:15.000Z | import matplotlib.pyplot as plt
import numpy as np
from fuzzysets import utils
from fuzzysets.sets.base import FuzzySet
from fuzzysets.sets.continuous import ContinuousFuzzySet
from fuzzysets.sets.finite import FiniteFuzzySet
from fuzzysets.tfn import TriangularFuzzyNumber as TFN
_X_LIMITS = (0., 10.)
_Y_LABEL = "... | 29.496689 | 71 | 0.515828 | import matplotlib.pyplot as plt
import numpy as np
from fuzzysets import utils
from fuzzysets.sets.base import FuzzySet
from fuzzysets.sets.continuous import ContinuousFuzzySet
from fuzzysets.sets.finite import FiniteFuzzySet
from fuzzysets.tfn import TriangularFuzzyNumber as TFN
_X_LIMITS = (0., 10.)
_Y_LABEL = "... | 4,011 | 0 | 276 |
d2a8652e68e85f32cc0ef8b2d7c29417fe523b2a | 1,564 | py | Python | training/callbacks/disentangle_unsupervied.py | Jav1d/Generative_Models | b7578b5277488ebd212a50d1c22a5c9708f4c311 | [
"MIT"
] | null | null | null | training/callbacks/disentangle_unsupervied.py | Jav1d/Generative_Models | b7578b5277488ebd212a50d1c22a5c9708f4c311 | [
"MIT"
] | null | null | null | training/callbacks/disentangle_unsupervied.py | Jav1d/Generative_Models | b7578b5277488ebd212a50d1c22a5c9708f4c311 | [
"MIT"
] | null | null | null |
import tensorflow as tf
from evaluation.unsupervised_metrics.disentangle_api import unsupervised_metrics
from utils.data_and_files.file_utils import log
| 31.918367 | 87 | 0.631714 |
import tensorflow as tf
from evaluation.unsupervised_metrics.disentangle_api import unsupervised_metrics
from utils.data_and_files.file_utils import log
class DisentanglementUnsuperviedMetrics(tf.keras.callbacks.Callback):
def __init__(
self,
ground_truth_data,
representation... | 1,230 | 48 | 130 |
4000a6497fae11555dcee307721066b3e7f2440c | 659 | py | Python | tests/test_casters.py | trym-inc/top-secret | dd5681a682745e2fedc9e80cca99445d143d18e9 | [
"MIT"
] | null | null | null | tests/test_casters.py | trym-inc/top-secret | dd5681a682745e2fedc9e80cca99445d143d18e9 | [
"MIT"
] | null | null | null | tests/test_casters.py | trym-inc/top-secret | dd5681a682745e2fedc9e80cca99445d143d18e9 | [
"MIT"
] | null | null | null | import pytest
from top_secret import CastError
from top_secret.cast_handlers import bool_cast_handler
| 23.535714 | 54 | 0.532625 | import pytest
from top_secret import CastError
from top_secret.cast_handlers import bool_cast_handler
def test_bool_cast_handler():
for value, expected in (
('false', False),
('fAlSE', False),
('0', False),
('no', False),
(False, False),
('T... | 508 | 0 | 46 |
2d7fc283d267eb1239d51d95254dae0dd1793386 | 526 | py | Python | projects/forms.py | Muia23/Tunzoo | 1c4aafc8e5e1033c76e2a707e2923d1da1a19fab | [
"Unlicense"
] | null | null | null | projects/forms.py | Muia23/Tunzoo | 1c4aafc8e5e1033c76e2a707e2923d1da1a19fab | [
"Unlicense"
] | null | null | null | projects/forms.py | Muia23/Tunzoo | 1c4aafc8e5e1033c76e2a707e2923d1da1a19fab | [
"Unlicense"
] | null | null | null | from django import forms
from .models import Kura,Post,Comment | 26.3 | 66 | 0.593156 | from django import forms
from .models import Kura,Post,Comment
class PostForm(forms.ModelForm):
class Meta:
model = Post
fields = ['name','url','description','screenshot','techs']
widgets = {
'techs': forms.CheckboxSelectMultiple(),
}
class PigaKura(forms.ModelForm):
... | 0 | 383 | 81 |
c0fc9d0c0d08a050eb767e998e266ec9f2cf3bbb | 4,220 | py | Python | lvreuse/analysis/performance/unvail_mass_contours.py | mvernacc/lvreuse | e2ac6aca334b49b0d4f5f881861cb42ce86dd130 | [
"MIT"
] | 7 | 2019-10-01T04:21:23.000Z | 2022-03-22T15:20:38.000Z | lvreuse/analysis/performance/unvail_mass_contours.py | mvernacc/lvreuse | e2ac6aca334b49b0d4f5f881861cb42ce86dd130 | [
"MIT"
] | null | null | null | lvreuse/analysis/performance/unvail_mass_contours.py | mvernacc/lvreuse | e2ac6aca334b49b0d4f5f881861cb42ce86dd130 | [
"MIT"
] | 6 | 2019-10-01T04:21:24.000Z | 2021-02-15T17:07:10.000Z | """Plot contours of first stage unvaiable mass vs recovery hardware factor and recovery propellant factor."""
import os.path
from collections import namedtuple
import numpy as np
from matplotlib import pyplot as plt
from lvreuse.performance.unavail_mass import unavail_mass
fontsize = 15
if __name__ == '__main_... | 36.37931 | 117 | 0.609953 | """Plot contours of first stage unvaiable mass vs recovery hardware factor and recovery propellant factor."""
import os.path
from collections import namedtuple
import numpy as np
from matplotlib import pyplot as plt
from lvreuse.performance.unavail_mass import unavail_mass
fontsize = 15
def main():
plot_contou... | 3,816 | 0 | 69 |
62f9e0cd2165187d330bdb9d1f77fc07f08139d7 | 23 | py | Python | heima/register.py | teashell/test | 2855ec7f757660deb6a309d2d6672aa5d8fbf09a | [
"MIT"
] | null | null | null | heima/register.py | teashell/test | 2855ec7f757660deb6a309d2d6672aa5d8fbf09a | [
"MIT"
] | null | null | null | heima/register.py | teashell/test | 2855ec7f757660deb6a309d2d6672aa5d8fbf09a | [
"MIT"
] | null | null | null | print('版本1.0终于完成了!!!')
| 11.5 | 22 | 0.608696 | print('版本1.0终于完成了!!!')
| 0 | 0 | 0 |
7272413d89891daa3d79e7ec3ce1c5f269d502a5 | 1,063 | py | Python | salt/serializers/python.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-21T00:18:25.000Z | 2021-07-11T07:35:26.000Z | salt/serializers/python.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 86 | 2017-01-27T11:54:46.000Z | 2020-05-20T06:25:26.000Z | salt/serializers/python.py | byteskeptical/salt | 637fe0b04f38b2274191b005d73b3c6707d7f400 | [
"Apache-2.0"
] | 12 | 2015-01-05T09:50:42.000Z | 2019-08-19T01:43:40.000Z | # -*- coding: utf-8 -*-
'''
salt.serializers.python
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 2016.3.0
Implements a Python serializer (via pprint.format)
'''
from __future__ import absolute_import, unicode_literals
import pprint
try:
import simplejson as _json
except ImportError:
import j... | 24.159091 | 79 | 0.658514 | # -*- coding: utf-8 -*-
'''
salt.serializers.python
~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 2016.3.0
Implements a Python serializer (via pprint.format)
'''
from __future__ import absolute_import, unicode_literals
import pprint
try:
import simplejson as _json
except ImportError:
import j... | 0 | 0 | 0 |
9855771e77c842d03deab1f80cc752646725a238 | 11,139 | py | Python | rkquery.py | zacharyvoase/rkquery | 698fd771d4e4875e11f1a0d414034088bd121910 | [
"Unlicense"
] | 1 | 2021-11-15T09:39:06.000Z | 2021-11-15T09:39:06.000Z | rkquery.py | zacharyvoase/rkquery | 698fd771d4e4875e11f1a0d414034088bd121910 | [
"Unlicense"
] | null | null | null | rkquery.py | zacharyvoase/rkquery | 698fd771d4e4875e11f1a0d414034088bd121910 | [
"Unlicense"
] | null | null | null | """
rkQuery is a library for programmatically building Riak search queries. It aims
to be easy to use, powerful, and protect from injection attacks that would be
possible with simple string interpolation.
Just start playing around with the ``Q`` object:
>>> from rkquery import Q
>>> Q("some literal")
<Q: ... | 27.708955 | 79 | 0.601939 | """
rkQuery is a library for programmatically building Riak search queries. It aims
to be easy to use, powerful, and protect from injection attacks that would be
possible with simple string interpolation.
Just start playing around with the ``Q`` object:
>>> from rkquery import Q
>>> Q("some literal")
<Q: ... | 4,466 | 1,850 | 665 |
17510c3b5823b2accbd61421ad2ec64f6400c60e | 2,250 | py | Python | src/classifier.py | kumar-neelabh/OCC-Medical-Imaging | dac1eeec6d4ffa1a03ea7c2f3c524922135d0447 | [
"MIT"
] | 1 | 2019-06-18T16:50:02.000Z | 2019-06-18T16:50:02.000Z | src/classifier.py | kumar-neelabh/OCC-Medical-Imaging | dac1eeec6d4ffa1a03ea7c2f3c524922135d0447 | [
"MIT"
] | null | null | null | src/classifier.py | kumar-neelabh/OCC-Medical-Imaging | dac1eeec6d4ffa1a03ea7c2f3c524922135d0447 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_curve
from sklearn.metrics import confusion_matrix
class Classifier:
'''
An extension to the original Deep SVDD to enable classification of test cases.
optim_thresh(): get the threshold at which your met... | 30.821918 | 116 | 0.654222 | import numpy as np
import torch
from sklearn.metrics import accuracy_score
from sklearn.metrics import roc_curve
from sklearn.metrics import confusion_matrix
class Classifier:
'''
An extension to the original Deep SVDD to enable classification of test cases.
optim_thresh(): get the threshold at which your met... | 1,599 | 0 | 135 |
18a53a8dfe122f01cb3df9630c28d959c726ec6d | 2,175 | py | Python | examples/grpc/python/generated/system_api_pb2_grpc.py | niclaslind/signalbroker-server | afb80514dcbabe561ac2da42adc08843a15c37c5 | [
"Apache-2.0"
] | 17 | 2020-06-20T11:29:43.000Z | 2022-03-21T05:53:06.000Z | examples/grpc/python/generated/system_api_pb2_grpc.py | niclaslind/signalbroker-server | afb80514dcbabe561ac2da42adc08843a15c37c5 | [
"Apache-2.0"
] | 2 | 2020-07-09T10:22:50.000Z | 2020-09-01T14:46:40.000Z | examples/grpc/python/generated/system_api_pb2_grpc.py | niclaslind/signalbroker-server | afb80514dcbabe561ac2da42adc08843a15c37c5 | [
"Apache-2.0"
] | 3 | 2020-07-17T20:04:36.000Z | 2022-01-24T14:19:46.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import common_pb2 as common__pb2
| 33.984375 | 74 | 0.747126 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import common_pb2 as common__pb2
class SystemServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
... | 1,210 | 777 | 69 |
75b6600aee5b2cca86d627adb98aae7e7ba450c1 | 230 | py | Python | rooms/templatetags/custom_template_tags.py | pawelkonior/idoctor_2 | 58e2835cea813921fbaa47cc0d65b93e4539d5b0 | [
"Beerware"
] | 1 | 2021-07-12T10:22:29.000Z | 2021-07-12T10:22:29.000Z | rooms/templatetags/custom_template_tags.py | pawelkonior/idoctor_2 | 58e2835cea813921fbaa47cc0d65b93e4539d5b0 | [
"Beerware"
] | null | null | null | rooms/templatetags/custom_template_tags.py | pawelkonior/idoctor_2 | 58e2835cea813921fbaa47cc0d65b93e4539d5b0 | [
"Beerware"
] | 1 | 2021-07-01T10:37:12.000Z | 2021-07-01T10:37:12.000Z | from django import template
register = template.Library()
@register.simple_tag
| 15.333333 | 37 | 0.595652 | from django import template
register = template.Library()
@register.simple_tag
def make_color(val=None):
colors = {
1: 'success',
2: 'info',
3: 'warning'
}
return colors.get(val, 'success')
| 126 | 0 | 22 |
87abab63c3ad42b3d3f549da610833111b19ed37 | 650 | py | Python | build/lib.linux-x86_64-2.7/django_es/__init__.py | GuillaumeCisco/django-es | 967937fe75e633baca8482d6a396ff2e31a293ae | [
"BSD-3-Clause"
] | 5 | 2017-01-19T13:08:11.000Z | 2020-05-18T09:39:14.000Z | django_es/__init__.py | GuillaumeCisco/django-es | 967937fe75e633baca8482d6a396ff2e31a293ae | [
"BSD-3-Clause"
] | null | null | null | django_es/__init__.py | GuillaumeCisco/django-es | 967937fe75e633baca8482d6a396ff2e31a293ae | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.contrib.admin.decorators import register
from django.utils.module_loading import autodiscover_modules
from elasticsearch import Elasticsearch
__author__ = 'guillaume'
# cache es_instance
es_instance = getattr(settings, 'ES_CLIENT', Elasticsearch())
# This import need to b... | 26 | 72 | 0.795385 | from django.conf import settings
from django.contrib.admin.decorators import register
from django.utils.module_loading import autodiscover_modules
from elasticsearch import Elasticsearch
__author__ = 'guillaume'
# cache es_instance
es_instance = getattr(settings, 'ES_CLIENT', Elasticsearch())
# This import need to b... | 56 | 0 | 23 |
4db2717e5a83ee36aaf7eb15f8fea36ec1b425b7 | 322 | py | Python | beginner_contest/131/D.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | beginner_contest/131/D.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | beginner_contest/131/D.py | FGtatsuro/myatcoder | 25a3123be6a6311e7d1c25394987de3e35575ff4 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(input())
jobs = [0] * n
for i in range(n):
jobs[i] = tuple(map(int, input().split()))
jobs = sorted(jobs, key=lambda x: x[1])
_sum = 0
for j in jobs:
_sum += j[0]
if _sum > j[1]:
print('No')
sys.exit(0)
print('Yes'... | 18.941176 | 46 | 0.571429 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
n = int(input())
jobs = [0] * n
for i in range(n):
jobs[i] = tuple(map(int, input().split()))
jobs = sorted(jobs, key=lambda x: x[1])
_sum = 0
for j in jobs:
_sum += j[0]
if _sum > j[1]:
print('No')
sys.exit(0)
print('Yes'... | 0 | 0 | 0 |
5fae8505dd8a0a74027ce2619e6d4180d42d19a9 | 2,483 | py | Python | Gquadruplex_cgcc.py | TaliaferroLab/AnalysisScripts | 3df37d2f8fca9bc402afe5ea870c42200fca1ed3 | [
"MIT"
] | null | null | null | Gquadruplex_cgcc.py | TaliaferroLab/AnalysisScripts | 3df37d2f8fca9bc402afe5ea870c42200fca1ed3 | [
"MIT"
] | null | null | null | Gquadruplex_cgcc.py | TaliaferroLab/AnalysisScripts | 3df37d2f8fca9bc402afe5ea870c42200fca1ed3 | [
"MIT"
] | 1 | 2021-10-30T07:37:19.000Z | 2021-10-30T07:37:19.000Z | #Usage: python Gquadruplex_cgcc.py <fasta> <windowsize> <output> <class> <region>
import re
import sys
from Bio import SeqIO
import numpy as np
scores, medianscores, maxscores = iteratefasta(sys.argv[1], sys.argv[2])
with open(sys.argv[3], 'a') as outfile:
'''
for score in scores:
cGcCscore, binnumber = score[0],... | 28.215909 | 107 | 0.653645 | #Usage: python Gquadruplex_cgcc.py <fasta> <windowsize> <output> <class> <region>
import re
import sys
from Bio import SeqIO
import numpy as np
def getscore(seq):
#Given a sequence, calculate its cG/cC score.
#First, get the longest consecutive substring of Gs and of Cs
#http://stackoverflow.com/questions/18776238... | 1,798 | 0 | 46 |
c8e4c5ec8f8c318472c3a85298e440748b16d8ef | 6,698 | py | Python | variflight.py | chengqidexue/VariFlightSpider | 57a39401676df2cd3f1c053f54b43437429e67ed | [
"MIT"
] | null | null | null | variflight.py | chengqidexue/VariFlightSpider | 57a39401676df2cd3f1c053f54b43437429e67ed | [
"MIT"
] | null | null | null | variflight.py | chengqidexue/VariFlightSpider | 57a39401676df2cd3f1c053f54b43437429e67ed | [
"MIT"
] | 1 | 2021-01-02T14:15:26.000Z | 2021-01-02T14:15:26.000Z | import datetime
import time
import requests
import json
import xundaili
from lxml import etree
class VariFlightSpider(object):
'''
获得所有的航班列表
:return: list 访问的航班url列表
'''
'''
爬取航班页面,用xpath找到下一个需要跳转的页面
//a[@class="searchlist_innerli"]/@href
/schedule/HRB-HGH-3U2014.html?AE71649A58c77=... | 35.62766 | 185 | 0.550761 | import datetime
import time
import requests
import json
import xundaili
from lxml import etree
class VariFlightSpider(object):
def __init__(self):
self.start_url = 'http://www.variflight.com'
self.file_name = datetime.datetime.now().strftime('%Y-%m-%d')+"-flight.json" #写入的文件名 2020-12-08-flight.... | 6,022 | 0 | 179 |
5e921f94a9420f9bdd5b5ae8ad7b356439d7536a | 3,782 | py | Python | zun/scheduler/client/query.py | wanghuiict/zun | 2f4a3a2ba06d7ca83002418d4003ee5dece70952 | [
"Apache-2.0"
] | 83 | 2016-09-14T22:06:26.000Z | 2022-01-27T03:49:52.000Z | zun/scheduler/client/query.py | wanghuiict/zun | 2f4a3a2ba06d7ca83002418d4003ee5dece70952 | [
"Apache-2.0"
] | 2 | 2017-06-22T21:58:47.000Z | 2019-04-10T03:17:44.000Z | zun/scheduler/client/query.py | wanghuiict/zun | 2f4a3a2ba06d7ca83002418d4003ee5dece70952 | [
"Apache-2.0"
] | 54 | 2016-09-29T10:16:02.000Z | 2022-01-28T19:12:49.000Z | # Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 39.395833 | 79 | 0.655738 | # Copyright (c) 2014 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 2,592 | 0 | 81 |
8ba0f85d7303e1ffde0721293edaae838e243d27 | 2,083 | py | Python | tests/test_integration_tests.py | kitmccoll/lattice_mc | 37ff69fb30182fa40bf36b4e1cd367698f5181dc | [
"MIT"
] | 24 | 2017-05-30T13:11:30.000Z | 2022-03-18T09:41:17.000Z | tests/test_integration_tests.py | kitmccoll/lattice_mc | 37ff69fb30182fa40bf36b4e1cd367698f5181dc | [
"MIT"
] | 5 | 2017-10-18T09:19:04.000Z | 2020-08-10T11:38:34.000Z | tests/test_integration_tests.py | kitmccoll/lattice_mc | 37ff69fb30182fa40bf36b4e1cd367698f5181dc | [
"MIT"
] | 5 | 2017-10-17T13:51:27.000Z | 2022-03-02T13:46:21.000Z | import unittest
import lattice_mc
import random
import numpy as np
if __name__ == '__main__':
unittest.main()
| 44.319149 | 102 | 0.635622 | import unittest
import lattice_mc
import random
import numpy as np
class IntegrationTestCase( unittest.TestCase ):
def test_simulation_runs_with_selected_sites( self ):
a, b, c, = 4, 4, 4
spacing = 1.0
n_atoms = 32
selected_sites = 'L'
number_of_jumps = 10
s = latti... | 1,865 | 26 | 77 |
0b80185147d689b6bafb48449707093945268d4d | 255 | py | Python | .bin/pinger.py | asadboi123/ldriveheroku | 0fc5afbc03ce57783bf59bed342ba2135a9a3583 | [
"MIT"
] | 50 | 2021-01-02T12:23:57.000Z | 2022-03-11T23:00:48.000Z | .bin/pinger.py | asadboi123/ldriveheroku | 0fc5afbc03ce57783bf59bed342ba2135a9a3583 | [
"MIT"
] | 2 | 2021-02-10T08:58:51.000Z | 2021-02-20T16:24:01.000Z | .bin/pinger.py | asadboi123/ldriveheroku | 0fc5afbc03ce57783bf59bed342ba2135a9a3583 | [
"MIT"
] | 229 | 2021-01-03T11:05:11.000Z | 2022-03-28T21:47:22.000Z | import os
import time
import requests
url = os.environ.get("PINGER")
if url:
if url.endswith("/"):
url = url[:-1]
while True:
time.sleep(int(os.environ.get("PINGER_INTERVAL", 900)))
requests.get("%s/api/v1/ping" % (url))
| 19.615385 | 63 | 0.6 | import os
import time
import requests
url = os.environ.get("PINGER")
if url:
if url.endswith("/"):
url = url[:-1]
while True:
time.sleep(int(os.environ.get("PINGER_INTERVAL", 900)))
requests.get("%s/api/v1/ping" % (url))
| 0 | 0 | 0 |
53e6ab3be4642b1203b53267c2bec46a13d6ee2d | 739 | py | Python | src/sentry/eventtypes/base.py | mastacheata/sentry | cc4536901db0323d1e6433416abf1d0ecd977d61 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/eventtypes/base.py | mastacheata/sentry | cc4536901db0323d1e6433416abf1d0ecd977d61 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/eventtypes/base.py | mastacheata/sentry | cc4536901db0323d1e6433416abf1d0ecd977d61 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.utils.strings import truncatechars, strip
| 21.114286 | 63 | 0.61705 | from __future__ import absolute_import
from sentry.utils.strings import truncatechars, strip
class BaseEvent(object):
id = None
def __init__(self, data):
self.data = data
def has_metadata(self):
raise NotImplementedError
def get_metadata(self):
raise NotImplementedError
c... | 416 | 181 | 46 |
74cbe07a3a7e894ff8aa4c4edc9a779ab7607cc3 | 3,028 | py | Python | day-14-higher-lower/main.py | Janell-Huyck/100-Days-of-Code | c73326d779d8555d8dbbcdee3ce600807ec3bb73 | [
"MIT"
] | 1 | 2021-11-28T23:34:01.000Z | 2021-11-28T23:34:01.000Z | day-14-higher-lower/main.py | Janell-Huyck/100-Days-of-Code | c73326d779d8555d8dbbcdee3ce600807ec3bb73 | [
"MIT"
] | null | null | null | day-14-higher-lower/main.py | Janell-Huyck/100-Days-of-Code | c73326d779d8555d8dbbcdee3ce600807ec3bb73 | [
"MIT"
] | null | null | null | import random
import os
from art import logo, vs
from game-data import data
score = 0
start_game()
| 24.819672 | 84 | 0.689894 | import random
import os
from art import logo, vs
from game-data import data
score = 0
def reset_screen():
os.system('cls||clear')
print(logo)
def print_instructions():
print("""
Higher Lower is a guessing game based on your best guess for
which of two people or things have more followers on Instagram,
... | 2,650 | 0 | 276 |
69eafb8d22c418aeedbdbbb18aa070ccd5c5354c | 1,041 | py | Python | tests/test_conversion.py | tommyjcarpenter/osmtogeojson | 2e11abfb25d870d6fcf38af0fb3dff3ab458fbf1 | [
"MIT"
] | 1 | 2019-04-17T10:23:15.000Z | 2019-04-17T10:23:15.000Z | tests/test_conversion.py | tommyjcarpenter/osmtogeojson | 2e11abfb25d870d6fcf38af0fb3dff3ab458fbf1 | [
"MIT"
] | 7 | 2019-04-17T10:22:56.000Z | 2020-07-09T18:51:30.000Z | tests/test_conversion.py | tommyjcarpenter/osmtogeojson | 2e11abfb25d870d6fcf38af0fb3dff3ab458fbf1 | [
"MIT"
] | 1 | 2019-04-25T16:51:06.000Z | 2019-04-25T16:51:06.000Z | import json
import unittest
from osmtogeojson import osmtogeojson
if __name__ == '__main__':
unittest.main() | 33.580645 | 89 | 0.698367 | import json
import unittest
from osmtogeojson import osmtogeojson
class ConversionTest(unittest.TestCase):
# We want to see the differences
maxDiff = None
def test_relation_with_different_member_types_becomes_GeometryCollection(self):
self.compare_files("geomcollection_overpass.json", "geomcolle... | 699 | 205 | 23 |
f7857465790d57abdd66554c20541c5a3f396f52 | 102 | py | Python | ideias/genetica/her_mendeliana_simples.py | ppedraum/logica_programacao | 548654b2e55d9e895d98a90be06baf88719e9833 | [
"MIT"
] | null | null | null | ideias/genetica/her_mendeliana_simples.py | ppedraum/logica_programacao | 548654b2e55d9e895d98a90be06baf88719e9833 | [
"MIT"
] | null | null | null | ideias/genetica/her_mendeliana_simples.py | ppedraum/logica_programacao | 548654b2e55d9e895d98a90be06baf88719e9833 | [
"MIT"
] | null | null | null | pai = input("genótipo do pai: ")
mae = input("genótipo da mãe: ")
if pai="AA":
print("dominante") | 20.4 | 32 | 0.617647 | pai = input("genótipo do pai: ")
mae = input("genótipo da mãe: ")
if pai="AA":
print("dominante") | 0 | 0 | 0 |
f05e0a1120f454645e9fd4bfcde547c11c9b107f | 16,735 | py | Python | foreman_hostgroup.py | Nosmoht/ansible-module-foreman | d5509cc74025c842fb1c63aae4e1d36c31ce026d | [
"Apache-2.0"
] | 53 | 2016-05-05T03:36:17.000Z | 2022-01-04T18:02:05.000Z | foreman_hostgroup.py | Nosmoht/ansible-module-foreman | d5509cc74025c842fb1c63aae4e1d36c31ce026d | [
"Apache-2.0"
] | 29 | 2016-03-11T15:29:21.000Z | 2020-10-22T02:56:18.000Z | foreman_hostgroup.py | Nosmoht/ansible-module-foreman | d5509cc74025c842fb1c63aae4e1d36c31ce026d | [
"Apache-2.0"
] | 33 | 2016-03-01T18:48:35.000Z | 2021-01-16T13:55:09.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Foreman hostgroup resources.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | 36.942605 | 120 | 0.610696 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage Foreman hostgroup resources.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | 11,727 | 0 | 69 |
6e48ac02cf53f8c3f3573cd7979b2391d412eac4 | 1,393 | py | Python | cdd/tests/test_source_transformer.py | offscale/cdd-python | 535018ec31fa086b5e79832499f26c6f129daaac | [
"Apache-2.0",
"MIT"
] | 4 | 2021-05-28T14:50:58.000Z | 2022-03-01T23:22:14.000Z | cdd/tests/test_source_transformer.py | SamuelMarks/doctrans | 7e5305cfcc20e6dd75b710c564dde6f1ecb0c1a2 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-02-19T04:13:38.000Z | 2021-02-19T04:13:38.000Z | cdd/tests/test_source_transformer.py | offscale/cdd-python | 535018ec31fa086b5e79832499f26c6f129daaac | [
"Apache-2.0",
"MIT"
] | 3 | 2020-09-09T21:23:09.000Z | 2021-02-13T07:53:07.000Z | """
Tests for source_transformer
"""
from ast import ClassDef
from unittest import TestCase
from unittest.mock import patch
from cdd.pure_utils import PY_GTE_3_9
from cdd.tests.utils_for_tests import unittest_main
class TestSourceTransformer(TestCase):
"""
Tests for source_transformer
"""
def test_... | 25.796296 | 81 | 0.573582 | """
Tests for source_transformer
"""
from ast import ClassDef
from unittest import TestCase
from unittest.mock import patch
from cdd.pure_utils import PY_GTE_3_9
from cdd.tests.utils_for_tests import unittest_main
class TestSourceTransformer(TestCase):
"""
Tests for source_transformer
"""
def test_... | 0 | 0 | 0 |
67c079fe61654bcc40a15be4e82c92072b4f95a1 | 3,930 | py | Python | deamon.py | wilgaboury/goodwill-sniper | 34db23139bfd5225771f8ad430fc8bef1b9c86c2 | [
"MIT"
] | 1 | 2021-09-04T09:14:26.000Z | 2021-09-04T09:14:26.000Z | deamon.py | wilgaboury/goodwill-sniper | 34db23139bfd5225771f8ad430fc8bef1b9c86c2 | [
"MIT"
] | null | null | null | deamon.py | wilgaboury/goodwill-sniper | 34db23139bfd5225771f8ad430fc8bef1b9c86c2 | [
"MIT"
] | null | null | null | import sqlite3
import json
import datetime
import pause
import utils
import math
import socket
import time
from dateutil.parser import parse
from multiprocessing.connection import Listener
from selenium.webdriver import Firefox
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Se... | 36.728972 | 201 | 0.643257 | import sqlite3
import json
import datetime
import pause
import utils
import math
import socket
import time
from dateutil.parser import parse
from multiprocessing.connection import Listener
from selenium.webdriver import Firefox
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Se... | 2,243 | 0 | 92 |
a2050956d8e55d2d0d412a408621ed775ae75401 | 2,035 | py | Python | api/management/commands/run_agency_importer.py | dziban303/SpaceLaunchNow-Server | 212565e97983bdf7159e9de06999fddc46967dbd | [
"Apache-2.0"
] | null | null | null | api/management/commands/run_agency_importer.py | dziban303/SpaceLaunchNow-Server | 212565e97983bdf7159e9de06999fddc46967dbd | [
"Apache-2.0"
] | null | null | null | api/management/commands/run_agency_importer.py | dziban303/SpaceLaunchNow-Server | 212565e97983bdf7159e9de06999fddc46967dbd | [
"Apache-2.0"
] | null | null | null | import requests
from api.models import *
from django.core.management import BaseCommand
from api.utils.utilities import get_agency_type
| 32.301587 | 89 | 0.594103 | import requests
from api.models import *
from django.core.management import BaseCommand
from api.utils.utilities import get_agency_type
def get_agency_data():
Agency.objects.all().delete()
results = requests.get("http://launchlibrary.net/1.3/agency?limit=1000")
agencies = results.json()['agencies']
f... | 1,759 | 67 | 69 |
ccb51afea35290ddb56b93bb5c41b3a85018da52 | 18,817 | py | Python | devilry/devilry_admin/tests/dashboard/test_overview.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | devilry/devilry_admin/tests/dashboard/test_overview.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | devilry/devilry_admin/tests/dashboard/test_overview.py | aless80/devilry-django | 416c262e75170d5662542f15e2d7fecf5ab84730 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from django.conf import settings
from django.test import TestCase, RequestFactory
from django_cradmin import cradmin_testhelpers
from model_mommy import mommy
from devilry.devilry_account.models import PermissionGroup
from devilry.devilry_admin.views.dashboard import overview
| 56.848943 | 106 | 0.652442 | import unittest
from django.conf import settings
from django.test import TestCase, RequestFactory
from django_cradmin import cradmin_testhelpers
from model_mommy import mommy
from devilry.devilry_account.models import PermissionGroup
from devilry.devilry_admin.views.dashboard import overview
class TestOverviewSubjec... | 17,438 | 1,061 | 23 |
8fcc1099511bc3c065f1a4aeef4738b1f149ca31 | 3,108 | py | Python | core_scripts/config_parse/config_parse.py | Nijta/project-NN-Pytorch-scripts | 06a50ab072613fb60b8b8e1cea85c4aa8e75549d | [
"BSD-3-Clause"
] | 150 | 2020-06-04T00:02:50.000Z | 2022-03-30T03:32:56.000Z | core_scripts/config_parse/config_parse.py | Nijta/project-NN-Pytorch-scripts | 06a50ab072613fb60b8b8e1cea85c4aa8e75549d | [
"BSD-3-Clause"
] | 15 | 2020-06-17T04:08:33.000Z | 2022-03-01T03:42:25.000Z | core_scripts/config_parse/config_parse.py | Nijta/project-NN-Pytorch-scripts | 06a50ab072613fb60b8b8e1cea85c4aa8e75549d | [
"BSD-3-Clause"
] | 23 | 2020-06-16T03:28:35.000Z | 2022-03-15T03:46:13.000Z | #!/usr/bin/env python
"""
config_parse
Configuration parser
"""
from __future__ import absolute_import
import os
import sys
import configparser
import core_scripts.other_tools.list_tools as nii_list_tools
import core_scripts.other_tools.display as nii_display
__author__ = "Xin Wang"
__email__ = "wangxin@nii.ac.jp"... | 32.041237 | 74 | 0.583333 | #!/usr/bin/env python
"""
config_parse
Configuration parser
"""
from __future__ import absolute_import
import os
import sys
import configparser
import core_scripts.other_tools.list_tools as nii_list_tools
import core_scripts.other_tools.display as nii_display
__author__ = "Xin Wang"
__email__ = "wangxin@nii.ac.jp"... | 0 | 0 | 0 |
2e04d572b5203b979dc04c82efd41ddcca243b21 | 225 | py | Python | worf_web/worf/css/data_create.py | The4thIdeaHackathon/worf | cc6585529745fd04d41a5563e84e1f93e8d3a9d3 | [
"Unlicense"
] | null | null | null | worf_web/worf/css/data_create.py | The4thIdeaHackathon/worf | cc6585529745fd04d41a5563e84e1f93e8d3a9d3 | [
"Unlicense"
] | null | null | null | worf_web/worf/css/data_create.py | The4thIdeaHackathon/worf | cc6585529745fd04d41a5563e84e1f93e8d3a9d3 | [
"Unlicense"
] | null | null | null | maps={}
maps['닭갈비']=[]
maps['닭갈비'].append(["고수닭갈비",{'lat':35.8430711,'lon':127.1279931}])
maps['닭갈비'].append(["춘천닭갈비",{'lat':35.8430713,'lon':127.1279933}])
maps['닭갈비'].append(["황제춘천닭갈비",{'lat':35.8430712,'lon':127.1279929}]) | 45 | 68 | 0.631111 | maps={}
maps['닭갈비']=[]
maps['닭갈비'].append(["고수닭갈비",{'lat':35.8430711,'lon':127.1279931}])
maps['닭갈비'].append(["춘천닭갈비",{'lat':35.8430713,'lon':127.1279933}])
maps['닭갈비'].append(["황제춘천닭갈비",{'lat':35.8430712,'lon':127.1279929}]) | 0 | 0 | 0 |
f626ef085756d90783bf070370e4e5b0071ab708 | 2,061 | py | Python | opteryx/storage/cache/memory_cache.py | mabel-dev/mabel-sql | 1a39253333233f5181be78b9e3c45aea1eb2afe3 | [
"Apache-2.0"
] | 1 | 2022-02-05T18:36:09.000Z | 2022-02-05T18:36:09.000Z | opteryx/storage/cache/memory_cache.py | mabel-dev/mabel-sql | 1a39253333233f5181be78b9e3c45aea1eb2afe3 | [
"Apache-2.0"
] | 43 | 2021-12-29T22:33:49.000Z | 2022-03-25T20:12:07.000Z | opteryx/storage/cache/memory_cache.py | mabel-dev/mabel-sql | 1a39253333233f5181be78b9e3c45aea1eb2afe3 | [
"Apache-2.0"
] | 1 | 2022-01-26T21:44:15.000Z | 2022-01-26T21:44:15.000Z | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 36.803571 | 87 | 0.665696 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 816 | 324 | 23 |
dc358a9f802d15441b604dd329c57bb2f459e75f | 3,564 | py | Python | setup.py | benchmarking-suite/benchmarking-controller | 98171af05ff765c4f68d13373381660119eb1ee4 | [
"Apache-2.0"
] | null | null | null | setup.py | benchmarking-suite/benchmarking-controller | 98171af05ff765c4f68d13373381660119eb1ee4 | [
"Apache-2.0"
] | null | null | null | setup.py | benchmarking-suite/benchmarking-controller | 98171af05ff765c4f68d13373381660119eb1ee4 | [
"Apache-2.0"
] | null | null | null | # Benchmarking Suite
# Copyright 2014-2017 Engineering Ingegneria Informatica S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 35.287129 | 118 | 0.682099 | # Benchmarking Suite
# Copyright 2014-2017 Engineering Ingegneria Informatica S.p.A.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 746 | 0 | 26 |
013b24a516199a9acbbbe5fac8bdb56b3845ff3d | 1,646 | py | Python | tests/core/test_workers.py | SSripilaipong/otscrape | 73ad2ea3d20841cf5d81b37180a1f21c48e87480 | [
"MIT"
] | null | null | null | tests/core/test_workers.py | SSripilaipong/otscrape | 73ad2ea3d20841cf5d81b37180a1f21c48e87480 | [
"MIT"
] | null | null | null | tests/core/test_workers.py | SSripilaipong/otscrape | 73ad2ea3d20841cf5d81b37180a1f21c48e87480 | [
"MIT"
] | null | null | null | import pytest
import otscrape as ot
import time
@pytest.mark.slow
@pytest.mark.integration
@pytest.mark.ot_mp
@pytest.mark.slow
@pytest.mark.integration
@pytest.mark.ot_mp
| 24.939394 | 102 | 0.606926 | import pytest
import otscrape as ot
import time
class ContentPage(ot.DataPage):
data = ot.Raw()
add_one = ot.Lambda(lambda t: t + 1)
class ListingPage(ot.DataPage):
page = ot.DictPath('/page')
children = ot.Chain([ot.DictPath('/children'), ot.Map(ContentPage)])
@pytest.mark.slow
@pytest.mark.inte... | 1,191 | 186 | 90 |
8009d2fe2177a1c7fb979b28371d421d5527fcee | 188 | py | Python | apps/intro/urls.py | mrtaalebi/sitigo | cce8b4f5299b58d7365789ead416d4568b443743 | [
"Apache-2.0"
] | null | null | null | apps/intro/urls.py | mrtaalebi/sitigo | cce8b4f5299b58d7365789ead416d4568b443743 | [
"Apache-2.0"
] | 8 | 2020-02-12T01:02:15.000Z | 2022-03-11T23:53:39.000Z | apps/intro/urls.py | mrtaalebi/sitigo | cce8b4f5299b58d7365789ead416d4568b443743 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from django.urls import path, include
from apps.intro import views
app_name = "intro"
urlpatterns = [
url(r'^$', views.homepage, name='homepage'),
]
| 18.8 | 48 | 0.718085 | from django.conf.urls import url
from django.urls import path, include
from apps.intro import views
app_name = "intro"
urlpatterns = [
url(r'^$', views.homepage, name='homepage'),
]
| 0 | 0 | 0 |
e1c62234d52d393f70ba6356876af4dbbfe2af48 | 2,347 | py | Python | src/utils/utilities.py | carlomazzaferro/numerai_easy_ml | 43ecda98cc1ed5f675912e990ad75bcf49590512 | [
"BSD-3-Clause"
] | 6 | 2018-05-09T04:50:34.000Z | 2021-12-28T12:22:08.000Z | src/utils/utilities.py | parrondo/numerai_easy_ml | 43ecda98cc1ed5f675912e990ad75bcf49590512 | [
"BSD-3-Clause"
] | null | null | null | src/utils/utilities.py | parrondo/numerai_easy_ml | 43ecda98cc1ed5f675912e990ad75bcf49590512 | [
"BSD-3-Clause"
] | 2 | 2017-09-03T10:31:17.000Z | 2019-12-12T05:59:26.000Z | import os
import pandas
import glob
import json
from src.utils import definitions
import matplotlib.pyplot as plt
from sklearn import metrics
| 26.077778 | 118 | 0.635279 | import os
import pandas
import glob
import json
from src.utils import definitions
import matplotlib.pyplot as plt
from sklearn import metrics
def upload_predictions(df):
pass
def scoring(preds, model_type, targs):
preds = [i[0] for i in preds]
targs = [i[0] for i in targs]
as_df = pandas.DataFrame... | 1,988 | 0 | 207 |
000c669132896ab4b233ea35186d256adfb0cf4c | 1,960 | py | Python | elisa_4_keymap.py | christianbitter/Elisa | efb2e155f42cd0c648a2c6c5c67393284f553c51 | [
"MIT"
] | 1 | 2019-07-24T19:57:53.000Z | 2019-07-24T19:57:53.000Z | elisa_4_keymap.py | christianbitter/Elisa | efb2e155f42cd0c648a2c6c5c67393284f553c51 | [
"MIT"
] | null | null | null | elisa_4_keymap.py | christianbitter/Elisa | efb2e155f42cd0c648a2c6c5c67393284f553c51 | [
"MIT"
] | null | null | null | # auth: christian bitter
# desc: in this tutorial we register key events and display some text accordingly
# specifically, we are going to listen for the 4 arrow keys
import pygame
from pygame.locals import K_LEFT, K_RIGHT, K_DOWN, K_UP, QUIT
if not pygame.font:
print("Pygame - fonts not loaded")
if not pyg... | 25.454545 | 81 | 0.661224 | # auth: christian bitter
# desc: in this tutorial we register key events and display some text accordingly
# specifically, we are going to listen for the 4 arrow keys
import pygame
from pygame.locals import K_LEFT, K_RIGHT, K_DOWN, K_UP, QUIT
if not pygame.font:
print("Pygame - fonts not loaded")
if not pyg... | 277 | 0 | 23 |
0ff7b46df9e126b5b2c2b88eb28ddfeae187a1e1 | 10,063 | py | Python | rich_text.py | ThePaperTop/rich-text | a10c124e0ead94949f6ef67ae097b9cf37918f45 | [
"MIT"
] | null | null | null | rich_text.py | ThePaperTop/rich-text | a10c124e0ead94949f6ef67ae097b9cf37918f45 | [
"MIT"
] | null | null | null | rich_text.py | ThePaperTop/rich-text | a10c124e0ead94949f6ef67ae097b9cf37918f45 | [
"MIT"
] | null | null | null | from enums import enum
from fontlist import FontList
from datetime import datetime
__all_fonts__ = FontList.all()
font_roles = enum(title=0,
body=1,
mono=2,
cursive=3,
inherit=-1)
if __name__ == "__main__":
import lipsum
block_sty... | 33.101974 | 75 | 0.428799 | from enums import enum
from fontlist import FontList
from datetime import datetime
__all_fonts__ = FontList.all()
class FontFamily(object):
def __init__(self, font_name):
self.all = __all_fonts__.by_partial_name(font_name)
try:
self.regular = [
font for font in self.al... | 7,497 | 3 | 555 |
cebc3b4479681cc9d95fe3c06dc0136edf95edcb | 1,629 | py | Python | tests/api/rating_change_tests.py | ericbrandwein/CodeforcesAPI | 12ae641910a3308033584dc518bb2fc0173e56f3 | [
"MIT"
] | null | null | null | tests/api/rating_change_tests.py | ericbrandwein/CodeforcesAPI | 12ae641910a3308033584dc518bb2fc0173e56f3 | [
"MIT"
] | null | null | null | tests/api/rating_change_tests.py | ericbrandwein/CodeforcesAPI | 12ae641910a3308033584dc518bb2fc0173e56f3 | [
"MIT"
] | null | null | null | """
This module provides classes for testing RatingChange object
"""
import unittest
from codeforces import RatingChange
if __name__ == '__main__':
unittest.main()
| 29.089286 | 78 | 0.626765 | """
This module provides classes for testing RatingChange object
"""
import unittest
from codeforces import RatingChange
class RatingChangeTests(unittest.TestCase):
def setUp(self):
self.rating = RatingChange()
def test_load_from_dict(self):
d = {
"contestId": 1,
"c... | 1,330 | 22 | 104 |
312249c4565121034d3b98d883e39d378e737909 | 8,361 | py | Python | mars/lib/filesystem/arrow.py | wjsi/mars | a69fb19edfe748d4393b90ff2c4941a76c084596 | [
"Apache-2.0"
] | 1 | 2022-02-02T03:03:48.000Z | 2022-02-02T03:03:48.000Z | mars/lib/filesystem/arrow.py | wjsi/mars | a69fb19edfe748d4393b90ff2c4941a76c084596 | [
"Apache-2.0"
] | null | null | null | mars/lib/filesystem/arrow.py | wjsi/mars | a69fb19edfe748d4393b90ff2c4941a76c084596 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.692946 | 86 | 0.63246 | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 5,729 | 220 | 464 |
30259fce527c13406f1130e23e88fc151f23ca85 | 7,421 | py | Python | utils.py | ericlearning/generative-pix2pix | 96323c9418be9886295e95b3fa9f66fd7c8de60e | [
"MIT"
] | 4 | 2019-05-07T10:27:09.000Z | 2022-01-09T11:13:14.000Z | utils.py | ericlearning/generative-pix2pix | 96323c9418be9886295e95b3fa9f66fd7c8de60e | [
"MIT"
] | null | null | null | utils.py | ericlearning/generative-pix2pix | 96323c9418be9886295e95b3fa9f66fd7c8de60e | [
"MIT"
] | null | null | null | import os
import cv2
import glob
import torch
import imageio
import numpy as np
import pandas as pd
import seaborn as sn
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from scipy.io import wavfile
from PIL import Image
from losses.losses im... | 31.713675 | 151 | 0.695863 | import os
import cv2
import glob
import torch
import imageio
import numpy as np
import pandas as pd
import seaborn as sn
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from scipy.io import wavfile
from PIL import Image
from losses.losses im... | 6,749 | 0 | 345 |
e3918fd80eee0b068dc9a9677ed899c09e21a3e7 | 343 | py | Python | unbrake-api/unbrake_api/management/commands/check_all.py | fga-eps-mds/2019.1-Simulador-de-Frenagem | a7452511fa7059121cd9035a7b21f3cd8fec1548 | [
"MIT"
] | 9 | 2019-03-23T02:56:08.000Z | 2019-08-29T21:32:00.000Z | unbrake-api/unbrake_api/management/commands/check_all.py | fga-eps-mds/2019.1-Simulador-de-Frenagem | a7452511fa7059121cd9035a7b21f3cd8fec1548 | [
"MIT"
] | 260 | 2019-03-23T01:07:29.000Z | 2022-03-29T16:31:48.000Z | unbrake-api/unbrake_api/management/commands/check_all.py | fga-eps-mds/2019.1-Simulador-de-Frenagem | a7452511fa7059121cd9035a7b21f3cd8fec1548 | [
"MIT"
] | 2 | 2019-05-07T03:39:58.000Z | 2019-09-09T07:02:11.000Z | '''
Link check_all script to a manage.py command
'''
from django.core.management import BaseCommand
from ._script import run_script
class Command(BaseCommand):
'''
Run general script for checking
'''
help = "Run general script for checking"
| 20.176471 | 46 | 0.688047 | '''
Link check_all script to a manage.py command
'''
from django.core.management import BaseCommand
from ._script import run_script
class Command(BaseCommand):
'''
Run general script for checking
'''
help = "Run general script for checking"
def handle(self, *args, **options):
run_script(... | 56 | 0 | 27 |
ba6104851df8b7dbbd940824e5d111a5cd3626f2 | 1,369 | py | Python | Fundamentals/Exercises/Objects_and_Classes_Exercise/7_articles.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | 2 | 2022-03-04T11:39:03.000Z | 2022-03-13T07:13:23.000Z | Fundamentals/Exercises/Objects_and_Classes_Exercise/7_articles.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | null | null | null | Fundamentals/Exercises/Objects_and_Classes_Exercise/7_articles.py | tankishev/Python | 60e511fc901f136b88c681f77f209fe2f8c46447 | [
"MIT"
] | null | null | null | # Create a class called Article. The __init__ method should accept 3 arguments: title: str, content: str, and author: str.
# The class should also have 4 methods:
# • edit(new_content: str) - changes the old content to the new one
# • change_author(new_author: str) - changes the old author with the new one
# • rename(... | 32.595238 | 123 | 0.680058 | # Create a class called Article. The __init__ method should accept 3 arguments: title: str, content: str, and author: str.
# The class should also have 4 methods:
# • edit(new_content: str) - changes the old content to the new one
# • change_author(new_author: str) - changes the old author with the new one
# • rename(... | 367 | -7 | 157 |
5612b8bf357afbf7097afadabcace8dc11dbcac7 | 776 | py | Python | testmain.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | null | null | null | testmain.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | null | null | null | testmain.py | tinapiao/Software-IC-Automation | 74b23cd94aa6e4658b110e93b5deb635e014f3a6 | [
"BSD-3-Clause"
] | null | null | null | import os
# import bag package
import bag
from bag.io import read_yaml
#import scripts_dsn.diffamp_simple as diffamp
# import BAG demo Python modules
import xbase_demo.core as demo_core
import xbase_demo.demo_layout.core as layout_core
import bag_testbenches.scripts_dsn.CML as diffamp
from bag_testbenches.verificatio... | 25.866667 | 78 | 0.784794 | import os
# import bag package
import bag
from bag.io import read_yaml
#import scripts_dsn.diffamp_simple as diffamp
# import BAG demo Python modules
import xbase_demo.core as demo_core
import xbase_demo.demo_layout.core as layout_core
import bag_testbenches.scripts_dsn.CML as diffamp
from bag_testbenches.verificatio... | 0 | 0 | 0 |
74f7160c1501666d3cdea448d3c8bdd00531cf84 | 9,218 | py | Python | pysnake/game.py | otov4its/pysnake | dbfe36e464b660cddb4193a493fc0e37e55a251f | [
"MIT"
] | null | null | null | pysnake/game.py | otov4its/pysnake | dbfe36e464b660cddb4193a493fc0e37e55a251f | [
"MIT"
] | null | null | null | pysnake/game.py | otov4its/pysnake | dbfe36e464b660cddb4193a493fc0e37e55a251f | [
"MIT"
] | null | null | null | import sys
import time
import curses
import pickle
from collections import deque
import copy
from .arena import Arena, BlockEfir, BlockSnake, BlockFood, BlockBorder
from . import settings, windows
from .exeptions import *
| 32.921429 | 117 | 0.597201 | import sys
import time
import curses
import pickle
from collections import deque
import copy
from .arena import Arena, BlockEfir, BlockSnake, BlockFood, BlockBorder
from . import settings, windows
from .exeptions import *
class Zoom(object):
def __init__(self, factor=settings.ZOOM_FACTOR):
self.factor = ... | 5,557 | 3,390 | 46 |
43477ef136eb9caeaed5c8abb2f9095bf7fc9b7d | 2,630 | py | Python | facegan/process/align_images.py | AmrMKayid/FaceGAN | 5cf3b8e5aeab2d340b653f48e78b4fa524cd92dc | [
"MIT"
] | null | null | null | facegan/process/align_images.py | AmrMKayid/FaceGAN | 5cf3b8e5aeab2d340b653f48e78b4fa524cd92dc | [
"MIT"
] | null | null | null | facegan/process/align_images.py | AmrMKayid/FaceGAN | 5cf3b8e5aeab2d340b653f48e78b4fa524cd92dc | [
"MIT"
] | null | null | null | import os
from glob import glob
from pathlib import Path
from typing import Union, List
import numpy as np
from tensorflow.keras.utils import get_file
from facegan import ROOT_PATH
from facegan.ffhq.face_alignment import image_align
from facegan.ffhq.landmarks_detector import LandmarksDetector
from facegan.utils.util... | 31.686747 | 90 | 0.656654 | import os
from glob import glob
from pathlib import Path
from typing import Union, List
import numpy as np
from tensorflow.keras.utils import get_file
from facegan import ROOT_PATH
from facegan.ffhq.face_alignment import image_align
from facegan.ffhq.landmarks_detector import LandmarksDetector
from facegan.utils.util... | 2,104 | 162 | 23 |
48daaff3ad555072b6d61c02b1aa3fa8fa591168 | 1,201 | py | Python | services/jobs/jobs/schema.py | eodcgmbh/openeo-openshift-driver | c4f256a6cd3eac358cbe32f6fcc734dc69c7b115 | [
"Apache-2.0"
] | null | null | null | services/jobs/jobs/schema.py | eodcgmbh/openeo-openshift-driver | c4f256a6cd3eac358cbe32f6fcc734dc69c7b115 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:29:22.000Z | 2022-03-11T23:44:17.000Z | services/jobs/jobs/schema.py | eodcgmbh/openeo-openshift-driver | c4f256a6cd3eac358cbe32f6fcc734dc69c7b115 | [
"Apache-2.0"
] | null | null | null | from marshmallow import Schema, fields
| 41.413793 | 70 | 0.72856 | from marshmallow import Schema, fields
class JobSchema(Schema):
job_id = fields.Str(attribute="id", required=True)
title = fields.Str(required=False)
description = fields.Str(required=False)
status = fields.Str(required=False)
submitted = fields.DateTime(attribute="created_at", required=True)
u... | 0 | 1,115 | 46 |
44bcc8573d3ef61acd2992fbec25472214e1d267 | 232 | py | Python | 2. Programming Fundamentals With Python (May 2021)/02.Exercise - basic syntax, conditional statements and loops/08_mutate_strings.py | kzborisov/SoftUni | ccb2b8850adc79bfb2652a45124c3ff11183412e | [
"MIT"
] | 1 | 2021-02-07T07:51:12.000Z | 2021-02-07T07:51:12.000Z | 2. Programming Fundamentals With Python (May 2021)/02.Exercise - basic syntax, conditional statements and loops/08_mutate_strings.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | 2. Programming Fundamentals With Python (May 2021)/02.Exercise - basic syntax, conditional statements and loops/08_mutate_strings.py | kzborisov/softuni | 9c5b45c74fa7d9748e9b3ea65a5ae4e15c142751 | [
"MIT"
] | null | null | null | # Task 08. Mutate Strings
str_1 = input()
str_2 = input()
new_str = list(str_1)
for ch in range(len(str_2)):
if new_str[ch] == str_2[ch]:
continue
else:
new_str[ch] = str_2[ch]
print(''.join(new_str))
| 16.571429 | 32 | 0.590517 | # Task 08. Mutate Strings
str_1 = input()
str_2 = input()
new_str = list(str_1)
for ch in range(len(str_2)):
if new_str[ch] == str_2[ch]:
continue
else:
new_str[ch] = str_2[ch]
print(''.join(new_str))
| 0 | 0 | 0 |
f8cedaadc800e2b2b6a932e58c4355077ba66714 | 263 | py | Python | tests/algorithm_collection/mathematics/test_iterative_logarithm.py | nocotan/algorithm_collection | c55460416cb935998aac9e56108ed4fa5afa8880 | [
"Apache-2.0"
] | 2 | 2021-03-19T13:15:06.000Z | 2021-06-15T12:18:12.000Z | tests/algorithm_collection/mathematics/test_iterative_logarithm.py | nocotan/algorithm_collection | c55460416cb935998aac9e56108ed4fa5afa8880 | [
"Apache-2.0"
] | 4 | 2021-03-09T15:34:20.000Z | 2021-03-16T12:33:44.000Z | tests/algorithm_collection/mathematics/test_iterative_logarithm.py | nocotan/algorithm_collection_py | c55460416cb935998aac9e56108ed4fa5afa8880 | [
"Apache-2.0"
] | null | null | null | import unittest
from algorithm_collection.mathematics import iterative_logarithm
| 26.3 | 64 | 0.749049 | import unittest
from algorithm_collection.mathematics import iterative_logarithm
class TestIterativeLogarithm(unittest.TestCase):
def test_iterative_logarithm(self):
n = 100
base = 5
self.assertEqual(iterative_logarithm(n, base), 2)
| 105 | 27 | 49 |
daf7bbf528eecfc39806ad1df5f4173a2638a8c5 | 8,329 | py | Python | ci/github/views.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 29 | 2016-11-29T15:15:56.000Z | 2021-09-08T04:04:53.000Z | ci/github/views.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 108 | 2016-11-29T17:29:00.000Z | 2022-03-21T21:00:10.000Z | ci/github/views.py | andrsd/civet | ac9ffffdea987437a5eb75779b9c7fe681e1ba85 | [
"Apache-2.0"
] | 11 | 2016-11-29T15:15:53.000Z | 2020-05-15T12:22:55.000Z |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 37.859091 | 126 | 0.660944 |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 5,729 | 0 | 91 |
a25e232751b5f51be5c187bec639e23262562e0c | 2,207 | py | Python | tools/create_sns_topic.py | shawn-rusaw/aws-lambda-fsm-workflows | 9fcf5af14bf0f4500d4a7e7b3e0eda00423c1d42 | [
"Apache-2.0"
] | 21 | 2017-01-26T21:23:57.000Z | 2021-08-07T02:56:49.000Z | tools/create_sns_topic.py | shawn-rusaw/aws-lambda-fsm-workflows | 9fcf5af14bf0f4500d4a7e7b3e0eda00423c1d42 | [
"Apache-2.0"
] | 151 | 2016-11-29T05:09:33.000Z | 2021-05-19T22:47:58.000Z | tools/create_sns_topic.py | shawn-rusaw/aws-lambda-fsm-workflows | 9fcf5af14bf0f4500d4a7e7b3e0eda00423c1d42 | [
"Apache-2.0"
] | 17 | 2016-11-29T05:07:58.000Z | 2021-05-04T21:22:29.000Z | #!/usr/bin/env python
# Copyright 2016-2020 Workiva Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 31.084507 | 78 | 0.772089 | #!/usr/bin/env python
# Copyright 2016-2020 Workiva Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 0 | 0 | 0 |