hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0f1243eea047ef5906118e7ffee57622af60818f | 719 | py | Python | examples/read_eeprom.py | Galch/pysoem | 7dbc6c2aec9f26c7cff911c3aeef0fc73f6c71cc | [
"MIT"
] | 48 | 2018-05-17T09:25:59.000Z | 2022-03-18T08:54:36.000Z | examples/read_eeprom.py | Galch/pysoem | 7dbc6c2aec9f26c7cff911c3aeef0fc73f6c71cc | [
"MIT"
] | 52 | 2019-07-26T06:54:55.000Z | 2022-03-31T09:42:20.000Z | examples/read_eeprom.py | Galch/pysoem | 7dbc6c2aec9f26c7cff911c3aeef0fc73f6c71cc | [
"MIT"
] | 23 | 2019-03-07T02:37:47.000Z | 2022-03-18T08:53:45.000Z | """Prints name and description of available network adapters."""
import sys
if __name__ == '__main__':
print('script started')
if len(sys.argv) > 1:
read_eeprom_of_first_slave(sys.argv[1])
else:
print('give ifname as script argument')
| 21.147059 | 83 | 0.585535 | """Prints name and description of available network adapters."""
import sys
import pysoem
def read_eeprom_of_first_slave(ifname):
master = pysoem.Master()
master.open(ifname)
if master.config_init() > 0:
first_slave = master.slaves[0]
for i in range(0, 0x80, 2):
... | 0 | 0 | 0 | 0 | 0 | 413 | 0 | -8 | 45 |
8129a772f7f24252ee1ca4c2af3fd32a8236f8a3 | 380 | py | Python | scan_lib/neros.py | Lannix/ScanNet | 3a2783017ff7b9d53fd3610b28f46370c01b9145 | [
"Apache-2.0"
] | null | null | null | scan_lib/neros.py | Lannix/ScanNet | 3a2783017ff7b9d53fd3610b28f46370c01b9145 | [
"Apache-2.0"
] | null | null | null | scan_lib/neros.py | Lannix/ScanNet | 3a2783017ff7b9d53fd3610b28f46370c01b9145 | [
"Apache-2.0"
] | null | null | null |
CONSTANT_EPOH = 100
CONSTANT_EPOH_1 = 10
| 22.352941 | 80 | 0.715789 | from scan_lib import nero as n
CONSTANT_EPOH = 100
CONSTANT_EPOH_1 = 10
def go_to_HELL():
n.save_model(n.trening_model(0, CONSTANT_EPOH)) # предобучение и сохранение
for i in range(1,2000):
n.save_model(n.trening_model(1, CONSTANT_EPOH_1))
n.save_model(n.trening_model(2, CONSTANT_EPOH_1))
... | 46 | 0 | 0 | 0 | 0 | 256 | 0 | 9 | 45 |
9a8c6517db70701e563affe64146a10b0e74c08e | 2,034 | py | Python | tklife/__main__.py | Aesonus/TkLife | 8e8f585be7f522134b9a5746b22185c2394d3d8d | [
"MIT"
] | null | null | null | tklife/__main__.py | Aesonus/TkLife | 8e8f585be7f522134b9a5746b22185c2394d3d8d | [
"MIT"
] | 4 | 2021-05-02T17:33:19.000Z | 2021-05-16T18:53:51.000Z | tklife/__main__.py | Aesonus/TkLife | 8e8f585be7f522134b9a5746b22185c2394d3d8d | [
"MIT"
] | null | null | null | """Shows a sample tklife application"""
from .constants import PADX, PADY
PADDING = {
PADX: 6,
PADY: 6
}
App().mainloop() | 33.9 | 150 | 0.657325 | """Shows a sample tklife application"""
from tkinter import StringVar, Widget
from tkinter.constants import END
from tkinter.ttk import Button, Entry, Label
from .widgets import NewTable
from .constants import COLUMNSPAN, PADX, PADY
from .mixins import generate_event_for
from . import Main
from .arrange import Autogri... | 0 | 262 | 0 | 1,346 | 0 | 0 | 0 | 93 | 201 |
8cc875fd00221a9cb482a6ff240319c6dd13b16b | 9,868 | py | Python | aiida/tools/dbexporters/tcod_plugins/__init__.py | astamminger/aiida_core | b01ad8236f21804f273c9d2a0365ecee62255cbb | [
"BSD-2-Clause"
] | null | null | null | aiida/tools/dbexporters/tcod_plugins/__init__.py | astamminger/aiida_core | b01ad8236f21804f273c9d2a0365ecee62255cbb | [
"BSD-2-Clause"
] | null | null | null | aiida/tools/dbexporters/tcod_plugins/__init__.py | astamminger/aiida_core | b01ad8236f21804f273c9d2a0365ecee62255cbb | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 34.027586 | 90 | 0.631334 | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 0 | 7,907 | 0 | 1,057 | 0 | 0 | 0 | 0 | 23 |
d14b244e69a897030f5533e366ea8b8c35a26b69 | 11,778 | py | Python | edgedb/asyncio_client.py | ambv/edgedb-python | 28de03948f1281110f8d11884683e08e2b593e91 | [
"Apache-2.0"
] | null | null | null | edgedb/asyncio_client.py | ambv/edgedb-python | 28de03948f1281110f8d11884683e08e2b593e91 | [
"Apache-2.0"
] | null | null | null | edgedb/asyncio_client.py | ambv/edgedb-python | 28de03948f1281110f8d11884683e08e2b593e91 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 30.434109 | 79 | 0.616403 | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 0 | 0 | 6,280 | 3,411 | 0 | 893 | 0 | -11 | 405 |
86965314682fe859926efa3c62312c76b8803870 | 1,918 | py | Python | examples/test_trading.py | testnet-exchange/python-viabtc-api | be7be15944004498be8da9e4435020d97408a352 | [
"Apache-2.0"
] | 33 | 2018-07-31T07:50:15.000Z | 2020-08-04T13:51:40.000Z | examples/test_trading.py | urantialife/python-viabtc-api | be7be15944004498be8da9e4435020d97408a352 | [
"Apache-2.0"
] | 7 | 2018-08-23T14:48:11.000Z | 2019-07-15T02:17:12.000Z | examples/test_trading.py | urantialife/python-viabtc-api | be7be15944004498be8da9e4435020d97408a352 | [
"Apache-2.0"
] | 20 | 2018-08-08T16:29:41.000Z | 2020-08-04T13:51:43.000Z | import sys
from ViaBTCAPI.ViaBTCAPI import ViaBTCAPI
EXCHANGE_URL = "http://localhost:8080/"
USER_ID = 1
USER_ID_2 = 2
UPDATE_MONEY = 0.1
ORDER_PRICE = 0.1
if len(sys.argv) > 1:
EXCHANGE_URL = sys.argv[1]
api = ViaBTCAPI(EXCHANGE_URL)
# get consts from exchange
resp = api.market_list()
m = resp["result"][0]
mar... | 31.442623 | 91 | 0.717935 | import sys
from ViaBTCAPI.ViaBTCAPI import ViaBTCAPI
EXCHANGE_URL = "http://localhost:8080/"
USER_ID = 1
USER_ID_2 = 2
UPDATE_MONEY = 0.1
ORDER_PRICE = 0.1
if len(sys.argv) > 1:
EXCHANGE_URL = sys.argv[1]
api = ViaBTCAPI(EXCHANGE_URL)
# get consts from exchange
resp = api.market_list()
m = resp["result"][0]
mar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ea5282e356e5e5fd276625a31e5b9590f02122ed | 1,066 | py | Python | Speech Synthesis/SS.py | saber1malek/HelpMate | d69ee6cc1e67fca3e87fa6ea132a0569e4667994 | [
"MIT"
] | 3 | 2020-06-07T08:56:40.000Z | 2020-06-07T13:00:21.000Z | Speech Synthesis/SS.py | saber1malek/HelpMate | d69ee6cc1e67fca3e87fa6ea132a0569e4667994 | [
"MIT"
] | 1 | 2020-06-07T09:06:12.000Z | 2020-06-07T09:06:12.000Z | Speech Synthesis/SS.py | saber1malek/HelpMate | d69ee6cc1e67fca3e87fa6ea132a0569e4667994 | [
"MIT"
] | 1 | 2020-06-07T07:13:55.000Z | 2020-06-07T07:13:55.000Z | # HelpMate Speech Synthesis Connection 2020
from google.cloud import texttospeech
# Instantiates a client
client = texttospeech.TextToSpeechClient()
# Set the text input to be synthesized
synthesis_input = texttospeech.types.SynthesisInput(text="Hello, World!")
# Build the voice request, select the language code ("... | 35.533333 | 74 | 0.77955 | # HelpMate Speech Synthesis Connection 2020
from google.cloud import texttospeech
# Instantiates a client
client = texttospeech.TextToSpeechClient()
# Set the text input to be synthesized
synthesis_input = texttospeech.types.SynthesisInput(text="Hello, World!")
# Build the voice request, select the language code ("... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53010981e0eedacff4461e5e4a9beb5fada6a61c | 7,649 | py | Python | arbitrage/private_markets/anxpro.py | queenvictoria/bitcoin-arbitrage | 12b6304684416fa2a7b2bb61c19e87b4572577c1 | [
"Unlicense"
] | 2 | 2016-02-27T03:52:01.000Z | 2017-10-23T18:47:31.000Z | arbitrage/private_markets/anxpro.py | queenvictoria/bitcoin-arbitrage | 12b6304684416fa2a7b2bb61c19e87b4572577c1 | [
"Unlicense"
] | null | null | null | arbitrage/private_markets/anxpro.py | queenvictoria/bitcoin-arbitrage | 12b6304684416fa2a7b2bb61c19e87b4572577c1 | [
"Unlicense"
] | null | null | null | # Copyright (C) 2013, Maxime Biais <maxime@biais.org>
import urllib.request
import urllib.parse
import urllib.error
import urllib.request
import urllib.error
| 39.225641 | 95 | 0.577723 | # Copyright (C) 2013, Maxime Biais <maxime@biais.org>
from .market import Market
import time
import base64
import hmac
import urllib.request
import urllib.parse
import urllib.error
import urllib.request
import urllib.error
import urllib.parse
import hashlib
import sys
import json
import re
import logging
import config... | 0 | 0 | 0 | 7,258 | 0 | 0 | 0 | -80 | 312 |
f3f1716e28d3670b76dc0d585daaea68d8eeab2d | 2,442 | py | Python | zeus/migrations/0f81e9efc84a_add_pending_artifact.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 221 | 2017-07-03T17:29:21.000Z | 2021-12-07T19:56:59.000Z | zeus/migrations/0f81e9efc84a_add_pending_artifact.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 298 | 2017-07-04T18:08:14.000Z | 2022-03-03T22:24:51.000Z | zeus/migrations/0f81e9efc84a_add_pending_artifact.py | conrad-kronos/zeus | ddb6bc313e51fb22222b30822b82d76f37dbbd35 | [
"Apache-2.0"
] | 24 | 2017-07-15T13:46:45.000Z | 2020-08-16T16:14:45.000Z | """add_pending_artifact
Revision ID: 0f81e9efc84a
Revises: 61a1763b9c8d
Create Date: 2019-10-24 15:13:36.705288
"""
# revision identifiers, used by Alembic.
revision = "0f81e9efc84a"
down_revision = "61a1763b9c8d"
branch_labels = ()
depends_on = None
| 32.56 | 85 | 0.638411 | """add_pending_artifact
Revision ID: 0f81e9efc84a
Revises: 61a1763b9c8d
Create Date: 2019-10-24 15:13:36.705288
"""
import zeus.db.types
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "0f81e9efc84a"
down_revision = "61a1763b9c8d"
branch_labels = ()
depends_on = No... | 0 | 0 | 0 | 0 | 0 | 2,071 | 0 | 2 | 112 |
04fc4ab0e7caeb7ba6bcedac53f83e0735e59840 | 5,148 | py | Python | fixed_width.py | supakeen/fixed-width | 57e9ae06ee5d77f2390f8377a9b7842f3596b04e | [
"MIT"
] | null | null | null | fixed_width.py | supakeen/fixed-width | 57e9ae06ee5d77f2390f8377a9b7842f3596b04e | [
"MIT"
] | null | null | null | fixed_width.py | supakeen/fixed-width | 57e9ae06ee5d77f2390f8377a9b7842f3596b04e | [
"MIT"
] | null | null | null | """
Copyright 2021 supakeen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicens... | 27.677419 | 80 | 0.698718 | """
Copyright 2021 supakeen
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicens... | 0 | 0 | 0 | 3,585 | 0 | 0 | 0 | 1 | 299 |
67cbdb578387f31a0a05cd7f49b7dda4d7c9a62c | 172 | py | Python | 16-coroutine/example_16_1.py | hua372494277/fluent_python_example-code | 07577e3e3ca822ab0e769bbaa22477fd988edb36 | [
"MIT"
] | null | null | null | 16-coroutine/example_16_1.py | hua372494277/fluent_python_example-code | 07577e3e3ca822ab0e769bbaa22477fd988edb36 | [
"MIT"
] | null | null | null | 16-coroutine/example_16_1.py | hua372494277/fluent_python_example-code | 07577e3e3ca822ab0e769bbaa22477fd988edb36 | [
"MIT"
] | null | null | null |
my_coro = simple_coroutine()
next(my_coro)
my_coro.send(42) | 21.5 | 39 | 0.674419 | def simple_coroutine():
print('-> coroutine started')
x = yield
print('-> coroutine received: ', x)
my_coro = simple_coroutine()
next(my_coro)
my_coro.send(42) | 0 | 0 | 0 | 0 | 90 | 0 | 0 | 0 | 22 |
a6bb3f10026fd14c5e3cb38dc7884cfc0cad2c28 | 193 | py | Python | example_project/urls.py | justquick/django-sentry | 07988759144524ba49bc63b308663244d1a69d04 | [
"BSD-3-Clause"
] | 1 | 2016-03-21T18:56:31.000Z | 2016-03-21T18:56:31.000Z | example_project/urls.py | justquick/django-sentry | 07988759144524ba49bc63b308663244d1a69d04 | [
"BSD-3-Clause"
] | null | null | null | example_project/urls.py | justquick/django-sentry | 07988759144524ba49bc63b308663244d1a69d04 | [
"BSD-3-Clause"
] | null | null | null |
urlpatterns = patterns('',
url(r'^trigger-500$', 'sentry.tests.views.raise_exc', name='sentry-raise-exc'),
url(r'^', include('sentry.urls')),
)
| 27.571429 | 83 | 0.668394 | from django.conf.urls.defaults import *
urlpatterns = patterns('',
url(r'^trigger-500$', 'sentry.tests.views.raise_exc', name='sentry-raise-exc'),
url(r'^', include('sentry.urls')),
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 22 |
6ffdeaa033eaf21fe518e29893f1e57af448e9e1 | 2,012 | py | Python | cruft/_commands/utils/diff.py | appunni-dishq/cruft | afa89a2856008bec49b31a90b6e3dd3c1eee24a9 | [
"MIT"
] | null | null | null | cruft/_commands/utils/diff.py | appunni-dishq/cruft | afa89a2856008bec49b31a90b6e3dd3c1eee24a9 | [
"MIT"
] | null | null | null | cruft/_commands/utils/diff.py | appunni-dishq/cruft | afa89a2856008bec49b31a90b6e3dd3c1eee24a9 | [
"MIT"
] | null | null | null | from pathlib import Path
from subprocess import PIPE, run # nosec
from cruft import exceptions
def get_diff(repo0: Path, repo1: Path) -> str:
"""Compute the raw diff between two repositories."""
try:
diff = run(
_git_diff("--no-ext-diff", "--no-color", str(repo0), str(repo1)),
... | 42.808511 | 100 | 0.656064 | from pathlib import Path
from subprocess import PIPE, run # nosec
from typing import List
from cruft import exceptions
def _git_diff(*args: str) -> List[str]:
# https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---binary support for binary patch
return ["git", "-c", "diff.noprefix=", "diff", "--no... | 0 | 0 | 0 | 0 | 0 | 217 | 0 | 2 | 45 |
fe150d05608dcd1ad34cb5b7bf40af7c9cb0ade8 | 6,990 | py | Python | octopus/modules/doaj/models.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 2 | 2016-02-22T04:31:30.000Z | 2021-08-03T23:58:36.000Z | octopus/modules/doaj/models.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 9 | 2015-01-04T14:00:05.000Z | 2021-12-13T19:35:07.000Z | octopus/modules/doaj/models.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 3 | 2016-09-09T13:39:45.000Z | 2018-02-19T14:23:12.000Z |
BASE_ARTICLE_STRUCT = {
"fields": {
"id": {"coerce": "unicode"}, # Note that we'll leave these in for ease of use by the
"created_date": {"coerce": "utcdatetime"}, # caller, but we'll need to ignore them on the conversion
"last_updated": {"coerce": "utcdatetime"} # to the ... | 34.097561 | 109 | 0.425322 | from octopus.lib import dataobj
BASE_ARTICLE_STRUCT = {
"fields": {
"id": {"coerce": "unicode"}, # Note that we'll leave these in for ease of use by the
"created_date": {"coerce": "utcdatetime"}, # caller, but we'll need to ignore them on the conversion
"last_updated": {"coe... | 0 | 0 | 0 | 2,363 | 0 | 0 | 0 | 10 | 91 |
e33d9c4b1e510869e7210b59656c9fa8baeead13 | 959 | py | Python | h3m/rmg/dispatch_gen.py | dmitrystril/homm3tools | 5687f581a4eb5e7b0e8f48794d7be4e3b0a8cc8b | [
"MIT"
] | 113 | 2015-08-09T08:36:55.000Z | 2022-03-21T10:42:46.000Z | h3m/rmg/dispatch_gen.py | dmitrystril/homm3tools | 5687f581a4eb5e7b0e8f48794d7be4e3b0a8cc8b | [
"MIT"
] | 40 | 2015-08-23T06:36:34.000Z | 2022-01-03T21:19:40.000Z | h3m/rmg/dispatch_gen.py | dmitrystril/homm3tools | 5687f581a4eb5e7b0e8f48794d7be4e3b0a8cc8b | [
"MIT"
] | 27 | 2015-08-09T08:40:39.000Z | 2022-03-28T08:03:12.000Z |
def dispatch_gen(settings, rmgseed = 0):
"""
Short function that prepares map generation
and then dispatches to generation modules
"""
# Seed with a specific seed if one was provided
if rmgseed != 0:
print("seed:" + str(rmgseed))
seed(rmgseed)
module_name = "modules.%s.__init__" % settings.module_name
... | 31.966667 | 134 | 0.713243 | import sys
from random import *
def dispatch_gen(settings, rmgseed = 0):
"""
Short function that prepares map generation
and then dispatches to generation modules
"""
# Seed with a specific seed if one was provided
if rmgseed != 0:
print("seed:" + str(rmgseed))
seed(rmgseed)
module_name = "modules.%s._... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 44 |
82c564532f62f466d26f2f89f9095a93136b4581 | 1,793 | py | Python | openff/benchmark/analysis/metrics.py | openforcefield/openff-benchmark | e27320922e7583e313eaf32119de863d23842217 | [
"MIT"
] | 6 | 2021-01-27T14:06:57.000Z | 2022-03-01T12:54:42.000Z | openff/benchmark/analysis/metrics.py | openforcefield/openff-benchmark | e27320922e7583e313eaf32119de863d23842217 | [
"MIT"
] | 83 | 2020-07-31T18:10:47.000Z | 2022-03-07T22:59:24.000Z | openff/benchmark/analysis/metrics.py | openforcefield/openff-benchmark | e27320922e7583e313eaf32119de863d23842217 | [
"MIT"
] | 1 | 2022-03-03T04:06:32.000Z | 2022-03-03T04:06:32.000Z | #!/usr/bin/env python
"""
metrics.py
Metrics calculation for the analysis/report part of the openff-benchmark workflow
By: David F. Hahn
Version: Nov 25 2020
"""
import numpy as np
from rdkit import Chem
from rdkit.Chem import TorsionFingerprints
def calc_tfd(ref_mol, query_mol):
"""
Calculate Torsio... | 26.761194 | 82 | 0.636921 | #!/usr/bin/env python
"""
metrics.py
Metrics calculation for the analysis/report part of the openff-benchmark workflow
By: David F. Hahn
Version: Nov 25 2020
"""
import numpy as np
from rdkit import Chem
from rdkit.Chem import TorsionFingerprints
def calc_tfd(ref_mol, query_mol):
"""
Calculate Torsio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
54f7bd38aa77922afb64699b585c50bd6c3ab6db | 2,429 | py | Python | simple_rest_client_example/resources.py | allisson/pythonbrasil-2018-exemplos | e106ba6d4833185566d4d306e8c108c97987350c | [
"MIT"
] | 3 | 2018-10-17T12:34:12.000Z | 2021-06-18T01:00:33.000Z | simple_rest_client_example/resources.py | allisson/pythonbrasil-2018-exemplos | e106ba6d4833185566d4d306e8c108c97987350c | [
"MIT"
] | null | null | null | simple_rest_client_example/resources.py | allisson/pythonbrasil-2018-exemplos | e106ba6d4833185566d4d306e8c108c97987350c | [
"MIT"
] | 1 | 2018-10-22T12:52:34.000Z | 2018-10-22T12:52:34.000Z |
films_actions = {
'list': {
'method': 'GET',
'url': 'films'
},
'retrieve': {
'method': 'GET',
'url': 'films/{}',
},
'schema': {
'method': 'GET',
'url': 'films/schema',
},
}
people_actions = {
'list': {
'method': 'GET',
'url':... | 17.22695 | 63 | 0.532318 | from simple_rest_client.resource import AsyncResource, Resource
films_actions = {
'list': {
'method': 'GET',
'url': 'films'
},
'retrieve': {
'method': 'GET',
'url': 'films/{}',
},
'schema': {
'method': 'GET',
'url': 'films/schema',
},
}
people_a... | 0 | 0 | 0 | 552 | 0 | 0 | 0 | 42 | 298 |
2924a841e050929bf5200ad6aa6ce38ce0e83e43 | 2,035 | py | Python | examples/OLX/gen.py | godber/banky | a3c41b810b16cce737f0ca7e2f1a10a32c3a5d66 | [
"MIT"
] | null | null | null | examples/OLX/gen.py | godber/banky | a3c41b810b16cce737f0ca7e2f1a10a32c3a5d66 | [
"MIT"
] | null | null | null | examples/OLX/gen.py | godber/banky | a3c41b810b16cce737f0ca7e2f1a10a32c3a5d66 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Generates an EdX style XML question from the provided YAML question file.
'''
if __name__ == '__main__':
gen()
| 31.796875 | 85 | 0.69828 | #!/usr/bin/env python
'''
Generates an EdX style XML question from the provided YAML question file.
'''
from pathlib import Path
from random import sample
import click
import yaml
from lxml import etree
@click.command()
@click.argument('file_name')
def gen(file_name):
# Read and parse the YAML file containing th... | 0 | 1,767 | 0 | 0 | 0 | 0 | 0 | -11 | 134 |
e31990aebb31cb9c87884c60bbda3ef72156d0f7 | 695 | py | Python | AveriguaNBisiestosRangoTiempo.py | brown9804/Python_DiversosAlgortimos | e9ff0fbe761f24a49a30a513d50824ca56cafaa3 | [
"Apache-2.0"
] | 3 | 2018-06-28T21:06:53.000Z | 2018-07-01T20:39:30.000Z | AveriguaNBisiestosRangoTiempo.py | brown9804/Python_DiversosAlgortimos | e9ff0fbe761f24a49a30a513d50824ca56cafaa3 | [
"Apache-2.0"
] | null | null | null | AveriguaNBisiestosRangoTiempo.py | brown9804/Python_DiversosAlgortimos | e9ff0fbe761f24a49a30a513d50824ca56cafaa3 | [
"Apache-2.0"
] | null | null | null | #Python3
#Permite calcular cuantos aos han sido bisiestos en un rango de aos
###### DEFINICIONES ######
###### IMPLEMENTACION ######
an1 = int(input("Digite el ao mayor que desea comparar "))
an2 = int(input("Digite el ao menor "))
dif = an1 - an2
cont = 0
for indice in range (an2, an1+1):
if bis... | 26.730769 | 71 | 0.617266 | #Python3
#Permite calcular cuantos años han sido bisiestos en un rango de años
###### DEFINICIONES ######
def bisiesto(year):
if (year % 400 == 0) or ((year % 4 == 0) and (year % 100 != 0)):
return True
else:
return False
###### IMPLEMENTACION ######
an1 = int(input("Digite el año mayor que ... | 14 | 0 | 0 | 0 | 0 | 100 | 0 | 0 | 22 |
db4f23ef884783a4a230a932eac3a80a44e8dffd | 4,569 | py | Python | code/tasks/REGEX/trainers/executor.py | khanhptnk/iliad | 3eb4f11c1d3cdb6784fd2f78a83ce07f984d3825 | [
"MIT"
] | 7 | 2021-06-10T22:17:13.000Z | 2022-03-03T05:58:55.000Z | code/tasks/REGEX/trainers/executor.py | khanhptnk/iliad | 3eb4f11c1d3cdb6784fd2f78a83ce07f984d3825 | [
"MIT"
] | null | null | null | code/tasks/REGEX/trainers/executor.py | khanhptnk/iliad | 3eb4f11c1d3cdb6784fd2f78a83ce07f984d3825 | [
"MIT"
] | null | null | null | import sys
sys.path.append('..')
| 29.101911 | 78 | 0.516743 | import logging
import os
import sys
sys.path.append('..')
import itertools
import json
import random
import torch
from misc import util
class ExecutorTrainer(object):
def __init__(self, config):
self.config = config
self.random = random.Random(self.config.seed)
def do_rollout(self, batch, ... | 0 | 0 | 0 | 4,406 | 0 | 0 | 0 | -51 | 179 |
d5d37258f5db0c94fe2805ed35fc6221e3fda39b | 11,999 | py | Python | DICOM/ParametricMapsDictionary.py | QIB-Sheffield/WEASEL | e4dad345fd6f347cfac990708252844a7cbcd025 | [
"Apache-2.0"
] | 2 | 2021-02-10T09:07:15.000Z | 2021-03-16T17:05:24.000Z | DICOM/ParametricMapsDictionary.py | QIB-Sheffield/WEASEL | e4dad345fd6f347cfac990708252844a7cbcd025 | [
"Apache-2.0"
] | 102 | 2021-01-20T11:14:21.000Z | 2021-12-12T17:34:42.000Z | DICOM/ParametricMapsDictionary.py | QIB-Sheffield/WEASEL | e4dad345fd6f347cfac990708252844a7cbcd025 | [
"Apache-2.0"
] | 1 | 2021-01-29T09:28:05.000Z | 2021-01-29T09:28:05.000Z | """
This module is used in `SaveDICOM_Image.py` and used as the optional argument `parametric_map` in write functions of `Classes.py` and in "writeNewPixelArray" of `DeveloperTools.py`.
The functions in this module capture special versions of DICOM with unique parameters/attributes/values.
**How to use:** provide the... | 51.497854 | 215 | 0.685557 | """
This module is used in `SaveDICOM_Image.py` and used as the optional argument `parametric_map` in write functions of `Classes.py` and in "writeNewPixelArray" of `DeveloperTools.py`.
The functions in this module capture special versions of DICOM with unique parameters/attributes/values.
**How to use:** provide the... | 0 | 0 | 0 | 7,375 | 0 | 2,479 | 0 | 6 | 203 |
4f5dc02bbb6371303a2f5b9a9f2436c462178b54 | 670 | py | Python | templates/dags/example_dag.py | dfedde/terraform-aws-ecs-airflow | e928c9272d8735809341e1225551e00cb83270de | [
"MIT"
] | 42 | 2020-10-30T11:54:08.000Z | 2022-03-21T11:02:32.000Z | templates/dags/example_dag.py | dfedde/terraform-aws-ecs-airflow | e928c9272d8735809341e1225551e00cb83270de | [
"MIT"
] | 20 | 2020-11-18T15:12:08.000Z | 2022-02-07T15:36:54.000Z | templates/dags/example_dag.py | dfedde/terraform-aws-ecs-airflow | e928c9272d8735809341e1225551e00cb83270de | [
"MIT"
] | 24 | 2020-11-19T21:00:57.000Z | 2022-03-21T11:02:36.000Z | from datetime import datetime
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
args = {
"owner": "dataroots",
"start_date": datetime(2020, 10, 12),
}
with DAG(
dag_id="example_dag",
catchup=False,
max_active_runs=1,
default_args=args,
schedule_interval="*... | 19.142857 | 58 | 0.638806 | from datetime import timedelta, datetime
from airflow import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow import AirflowException
args = {
"owner": "dataroots",
"start_date": datetime(2020, 10, 12),
}
with DAG(
dag_id="example_dag",
catchup=False,
max_active_runs=1,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 22 |
d2d300c5b67883d38f70b2c1b58d33ec2b7b239c | 6,778 | py | Python | solver.py | aelkouk/rainfall_runoff | 7ab984c77abbef38c768fea9993b0cfecaca3e67 | [
"MIT"
] | null | null | null | solver.py | aelkouk/rainfall_runoff | 7ab984c77abbef38c768fea9993b0cfecaca3e67 | [
"MIT"
] | null | null | null | solver.py | aelkouk/rainfall_runoff | 7ab984c77abbef38c768fea9993b0cfecaca3e67 | [
"MIT"
] | null | null | null | # Purpose: Implement time stepping scheme to solve individual and coupled state equations
# Record of revisions:
# Date Programmer Description of change
# ======== ============= =====================
# 09-2020 A. Elkouk Original code
import numpy as np
# --------------------------------... | 30.669683 | 121 | 0.482001 | # Purpose: Implement time stepping scheme to solve individual and coupled state equations
# Record of revisions:
# Date Programmer Description of change
# ======== ============= =====================
# 09-2020 A. Elkouk Original code
import numpy as np
# --------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e7600c142bd7e27a405fac85062163bfc718090f | 134 | py | Python | mybitbank/libs/jsonrpc/authproxy.py | zonedoutspace/mybitbank | 85d28726117a3c1ca76be5772d30c9edae1df7f4 | [
"MIT"
] | 15 | 2015-08-29T12:35:59.000Z | 2018-02-06T06:26:26.000Z | mybitbank/libs/jsonrpc/authproxy.py | FireWalkerX/mybitbank | 945e604e5fee3914c7c98a25c2c34831ba0ad946 | [
"MIT"
] | null | null | null | mybitbank/libs/jsonrpc/authproxy.py | FireWalkerX/mybitbank | 945e604e5fee3914c7c98a25c2c34831ba0ad946 | [
"MIT"
] | 19 | 2015-02-03T21:32:51.000Z | 2021-11-06T12:08:26.000Z | from mybitbank.libs.bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
__all__ = ['AuthServiceProxy', 'JSONRPCException']
| 44.666667 | 82 | 0.843284 | from mybitbank.libs.bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
__all__ = ['AuthServiceProxy', 'JSONRPCException']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c316d4e0585be0a5ee8136f55d032f0e3e48ad80 | 51,673 | py | Python | pineboolib/plugins/sql/flmysql_myisam2.py | deavid/pineboo | acc96ab6d5b8bb182990af6dea4bf0986af15549 | [
"MIT"
] | 2 | 2015-09-19T16:54:49.000Z | 2016-09-12T08:06:29.000Z | pineboolib/plugins/sql/flmysql_myisam2.py | deavid/pineboo | acc96ab6d5b8bb182990af6dea4bf0986af15549 | [
"MIT"
] | 1 | 2017-08-14T17:07:14.000Z | 2017-08-15T00:22:47.000Z | pineboolib/plugins/sql/flmysql_myisam2.py | deavid/pineboo | acc96ab6d5b8bb182990af6dea4bf0986af15549 | [
"MIT"
] | 9 | 2015-01-15T18:15:42.000Z | 2019-05-05T18:53:00.000Z | """
Module for MYISAM2 driver.
"""
from pineboolib import logging
logger = logging.getLogger(__name__)
| 33.751143 | 128 | 0.482147 | """
Module for MYISAM2 driver.
"""
from PyQt5.Qt import qWarning, QApplication, QRegExp # type: ignore
from PyQt5.QtXml import QDomDocument # type: ignore
from PyQt5.QtWidgets import QMessageBox, QWidget # type: ignore
from pineboolib.core.utils.utils_base import auto_qt_translate_text
from pineboolib.application.u... | 38 | 0 | 0 | 50,631 | 0 | 0 | 0 | 494 | 422 |
93d72bc6802337a6844119c8802b8bf664d50346 | 2,501 | py | Python | doit/support/cmd/errors.py | i386x/doit | 61892904940b7ecf29af8ea815b731e242a945f7 | [
"MIT"
] | null | null | null | doit/support/cmd/errors.py | i386x/doit | 61892904940b7ecf29af8ea815b731e242a945f7 | [
"MIT"
] | null | null | null | doit/support/cmd/errors.py | i386x/doit | 61892904940b7ecf29af8ea815b731e242a945f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#! \file ./doit/support/cmd/errors.py
#! \author Ji Kuera, <sanczes@gmail.com>
#! \stamp 2016-02-15 13:19:12 (UTC+01:00, DST+00:00)
#! \project DoIt!: Tools and Libraries for Building DSLs
#! \license MIT
#! \version 0.0.0
#! \fdesc ... | 29.081395 | 79 | 0.652139 | # -*- coding: utf-8 -*-
#! \file ./doit/support/cmd/errors.py
#! \author Jiří Kučera, <sanczes@gmail.com>
#! \stamp 2016-02-15 13:19:12 (UTC+01:00, DST+00:00)
#! \project DoIt!: Tools and Libraries for Building DSLs
#! \license MIT
#! \version 0.0.0
#! \fdes... | 12 | 0 | 0 | 835 | 0 | 0 | 0 | 0 | 46 |
bc4091829f8438988183491e40582e30250e0759 | 4,364 | py | Python | nototools/notoconfig.py | dedbbs1/nototools | 428f149d7c235ac45fb9255414c77a3529e0c8bf | [
"Apache-2.0"
] | 156 | 2015-06-11T00:03:49.000Z | 2019-03-12T10:05:14.000Z | nototools/notoconfig.py | dedbbs1/nototools | 428f149d7c235ac45fb9255414c77a3529e0c8bf | [
"Apache-2.0"
] | 323 | 2015-06-09T21:26:40.000Z | 2019-04-09T11:09:52.000Z | nototools/notoconfig.py | twardoch/nototools | 546beddb96e8eb4d93fa0f4c60793bee56e346ac | [
"Apache-2.0"
] | 63 | 2015-06-09T19:21:58.000Z | 2019-03-27T21:52:30.000Z | #!/usr/bin/env python
# Copyright 2015 Google 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 required ... | 32.81203 | 78 | 0.681714 | #!/usr/bin/env python
# Copyright 2015 Google 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 required ... | 0 | 0 | 0 | 0 | 0 | 41 | 0 | 0 | 23 |
e0b252fafdf6487f16fd80918000aa7a03e2b15b | 541 | py | Python | src/assets/svg/clear_fill.py | Pure-Peace/vue-adaptive-template | a3f39258ac748eff84c894510cce0f8227358b88 | [
"MIT"
] | 7 | 2020-10-27T15:16:05.000Z | 2022-02-15T08:01:21.000Z | src/assets/svg/clear_fill.py | Pure-Peace/vue3-vite-ssr | 650b4aa24e4684b6a1d93fcf27bf744dfae60215 | [
"MIT"
] | 3 | 2021-03-10T19:59:12.000Z | 2021-08-31T19:46:45.000Z | src/assets/svg/clear_fill.py | Pure-Peace/vue-adaptive-template | a3f39258ac748eff84c894510cce0f8227358b88 | [
"MIT"
] | 1 | 2021-12-21T14:14:51.000Z | 2021-12-21T14:14:51.000Z | import os
import re
for svg in [file for file in os.listdir(os.getcwd()) if '.svg' in file]:
file_path = '{}/{}'.format(os.getcwd(), svg)
with open (file_path, 'r', encoding='utf-8') as svg_file:
content = svg_file.read()
target = re.search('fill=".*?"', content)
if target != None:
... | 38.642857 | 72 | 0.578558 | import os
import re
for svg in [file for file in os.listdir(os.getcwd()) if '.svg' in file]:
file_path = '{}/{}'.format(os.getcwd(), svg)
with open (file_path, 'r', encoding='utf-8') as svg_file:
content = svg_file.read()
target = re.search('fill=".*?"', content)
if target != None:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cf2818a4a563783db22a4d4eba9f7f379db5d084 | 419 | py | Python | decorators.py | oramirezperera/closures | 17aa68642448eaa607872e871d8785ecdfe23d8b | [
"MIT"
] | null | null | null | decorators.py | oramirezperera/closures | 17aa68642448eaa607872e871d8785ecdfe23d8b | [
"MIT"
] | null | null | null | decorators.py | oramirezperera/closures | 17aa68642448eaa607872e871d8785ecdfe23d8b | [
"MIT"
] | null | null | null |
random_func() | 22.052632 | 88 | 0.653938 | from datetime import datetime
def execution_time(func):
def wrapper():
initial_time = datetime.now()
func()
final_time = datetime.now()
time_elapsed = final_time - initial_time
print('The execution time was ' + str(time_elapsed.total_seconds()) + 'seconds')
return wrappe... | 0 | 58 | 0 | 0 | 0 | 269 | 0 | 8 | 68 |
44016d8febc11f65a98a21222676ac994b234bb7 | 5,863 | py | Python | pyzoo/zoo/chronos/model/prophet.py | cabuliwallah/analytics-zoo | 5e662bd01c5fc7eed412973119594cf2ecea8b11 | [
"Apache-2.0"
] | 1 | 2021-06-16T11:42:32.000Z | 2021-06-16T11:42:32.000Z | pyzoo/zoo/chronos/model/prophet.py | cabuliwallah/analytics-zoo | 5e662bd01c5fc7eed412973119594cf2ecea8b11 | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/chronos/model/prophet.py | cabuliwallah/analytics-zoo | 5e662bd01c5fc7eed412973119594cf2ecea8b11 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 40.157534 | 99 | 0.656149 | # Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 0 | 0 | 0 | 4,994 | 0 | 0 | 0 | 99 | 180 |
450ca3987d19aeeb31e66048ea9f05f4707a6a4e | 2,182 | py | Python | mdptools/utils/highlight.py | mholdg16/py-mdptools | ae986edc2097e97cb73331d66f0051ca9f5bd15c | [
"MIT"
] | 1 | 2021-12-15T13:22:48.000Z | 2021-12-15T13:22:48.000Z | mdptools/utils/highlight.py | mholdg16/py-mdptools | ae986edc2097e97cb73331d66f0051ca9f5bd15c | [
"MIT"
] | 2 | 2021-11-09T23:43:48.000Z | 2021-11-13T20:41:12.000Z | mdptools/utils/highlight.py | mholdg16/py-mdptools | ae986edc2097e97cb73331d66f0051ca9f5bd15c | [
"MIT"
] | null | null | null | # pylint: disable=too-few-public-methods,missing-docstring
highlight = Highlight()
| 22.968421 | 58 | 0.579285 | # pylint: disable=too-few-public-methods,missing-docstring
class COLORS_ENABLED:
RESET = "\033[0m"
BOLD = "\033[01m"
BLACK = "\033[30m"
RED = "\033[31m"
GREEN = "\033[32m"
ORANGE = "\033[33m"
BLUE = "\033[34m"
PURPLE = "\033[35m"
CYAN = "\033[36m"
LIGHTGREY = "\033[37m"
DARK... | 0 | 0 | 0 | 2,027 | 0 | 0 | 0 | 0 | 68 |
ef71623e2adac2944868d6fb2d5158e9f125310e | 35,571 | py | Python | interpro7dw/ebi/interpro/ftp/xmlfiles.py | ProteinsWebTeam/interpro7-dw | 5ff1886bb767964658574bd39b812d822a894163 | [
"Apache-2.0"
] | null | null | null | interpro7dw/ebi/interpro/ftp/xmlfiles.py | ProteinsWebTeam/interpro7-dw | 5ff1886bb767964658574bd39b812d822a894163 | [
"Apache-2.0"
] | 1 | 2020-08-14T23:15:24.000Z | 2020-08-14T23:15:24.000Z | interpro7dw/ebi/interpro/ftp/xmlfiles.py | ProteinsWebTeam/interpro7-dw | 5ff1886bb767964658574bd39b812d822a894163 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import MySQLdb
from interpro7dw.ebi.interpro import utils
_DC_STATUSES = {v: k for k, v in utils.DC_STATUSES.items()}
_TAGS = {
"cazy": "CAZY",
"cog": "COG",
"genprop": "GENPROP",
"ec": "EC",
"intenz": "EC",
"interpro": "INTERPRO",
"pfam": "PFAM",
"pdbe": "PDBE",... | 39.132013 | 79 | 0.519103 | # -*- coding: utf-8 -*-
import json
import gzip
import math
import multiprocessing as mp
import os
import re
import shutil
from tempfile import mkstemp
from typing import Optional, Sequence
from xml.dom.minidom import getDOMImplementation, parseString
from xml.parsers.expat import ExpatError
import cx_Oracle
import M... | 0 | 0 | 0 | 0 | 0 | 34,377 | 0 | 113 | 585 |
6857bd448442ddfa8d293e203ac7bc287e7f8c42 | 4,119 | py | Python | code/plotter_tests.py | twf2360/Newtons_Cradle | 84cab9b81765146d1453a68ee0f50f2a7e511c6b | [
"MIT"
] | null | null | null | code/plotter_tests.py | twf2360/Newtons_Cradle | 84cab9b81765146d1453a68ee0f50f2a7e511c6b | [
"MIT"
] | null | null | null | code/plotter_tests.py | twf2360/Newtons_Cradle | 84cab9b81765146d1453a68ee0f50f2a7e511c6b | [
"MIT"
] | null | null | null | import math
import numpy as np
from calculator import calculator
from plotter import plotter
from random import random
'''
in order to test the functions of the plotter class, data must be collected to plot
In order to test the simplest aspects - such as that total energy = pe+ke, and conservation of energy, the... | 41.606061 | 190 | 0.704783 | import pytest
import math
import numpy as np
from ball import ball
import matplotlib.pyplot as plt
import copy
from itertools import combinations
import sys
import pandas as pd
from calculator import calculator
import json
import dataframes
from plotter import plotter
from random import random
'''
in order... | 0 | 0 | 0 | 0 | 0 | 548 | 0 | -22 | 227 |
c67414731c3470e8d42acae5cbdf0fa8ded1e0a9 | 676 | py | Python | example/functions/add.py | osblinnikov/pytorch-binary | 61842542c94766ffa21b0fa3ea86a435f802b95f | [
"MIT"
] | 293 | 2018-08-17T14:29:28.000Z | 2022-02-28T12:35:48.000Z | example/functions/add.py | osblinnikov/pytorch-binary | 61842542c94766ffa21b0fa3ea86a435f802b95f | [
"MIT"
] | 1 | 2018-08-21T14:48:38.000Z | 2018-08-21T14:48:38.000Z | example/functions/add.py | osblinnikov/pytorch-binary | 61842542c94766ffa21b0fa3ea86a435f802b95f | [
"MIT"
] | 70 | 2018-08-21T03:39:38.000Z | 2022-03-01T07:21:08.000Z | # functions/add.py
| 29.391304 | 68 | 0.674556 | # functions/add.py
import torch
from torch.autograd import Function
from _ext import my_lib
class MyAddFunction(Function):
def forward(self, input1, input2):
output = input1.new()
if not input1.is_cuda:
my_lib.my_lib_add_forward(input1, input2, output)
else:
my_lib.... | 0 | 0 | 0 | 560 | 0 | 0 | 0 | 7 | 89 |
e8a4d6853804f4590a0288c9c5eca52412b23f32 | 31,243 | py | Python | augly/audio/transforms.py | Ierezell/AugLy | a7dca8c36bc05dbd7694373fe9b883d6ff720f56 | [
"MIT"
] | 1 | 2021-09-29T21:27:50.000Z | 2021-09-29T21:27:50.000Z | augly/audio/transforms.py | Ierezell/AugLy | a7dca8c36bc05dbd7694373fe9b883d6ff720f56 | [
"MIT"
] | null | null | null | augly/audio/transforms.py | Ierezell/AugLy | a7dca8c36bc05dbd7694373fe9b883d6ff720f56 | [
"MIT"
] | 1 | 2021-07-02T13:08:55.000Z | 2021-07-02T13:08:55.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
import augly.utils as utils
"""
Base Classes for Transforms
"""
"""
Non-Random Transforms
These classes below are essentially class-based versions of the augmentation
functions previously defined. These classes were developed such that they... | 35.223224 | 92 | 0.625964 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
import random
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
import augly.audio.functional as F
import augly.utils as utils
import numpy as np
from augly.audio.utils import RNGSeed
"""
Base Classes for Transforms
"""
c... | 0 | 0 | 0 | 29,920 | 0 | 0 | 0 | 65 | 572 |
e0ef9bce5e87aa31386e4253a0d246ce6c621dd9 | 2,663 | py | Python | python_code/easy/412_Fizz_Buzz_easy/solution.py | timshenkao/interview_coding_exercises | c531fa5e0c09faef976539275589e957fcb88393 | [
"Apache-2.0"
] | null | null | null | python_code/easy/412_Fizz_Buzz_easy/solution.py | timshenkao/interview_coding_exercises | c531fa5e0c09faef976539275589e957fcb88393 | [
"Apache-2.0"
] | null | null | null | python_code/easy/412_Fizz_Buzz_easy/solution.py | timshenkao/interview_coding_exercises | c531fa5e0c09faef976539275589e957fcb88393 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 - present, Timur Shenkao
# 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 required by appl... | 37.507042 | 117 | 0.579046 | # Copyright (c) 2021 - present, Timur Shenkao
# 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 required by appl... | 0 | 0 | 0 | 1,490 | 0 | 0 | 0 | 16 | 68 |
aa8755d6383871ea335e941c7857fa0ecccd50d3 | 1,458 | py | Python | heltour/tournament/migrations/0110_scheduledevent.py | lenguyenthanh/heltour | 13018b1905539de0b273370a76f6aa1d1ebbb01a | [
"MIT"
] | null | null | null | heltour/tournament/migrations/0110_scheduledevent.py | lenguyenthanh/heltour | 13018b1905539de0b273370a76f6aa1d1ebbb01a | [
"MIT"
] | null | null | null | heltour/tournament/migrations/0110_scheduledevent.py | lenguyenthanh/heltour | 13018b1905539de0b273370a76f6aa1d1ebbb01a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-08 18:16
from __future__ import unicode_literals
| 42.882353 | 138 | 0.613855 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-11-08 18:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('tournament', '0109_auto_20161108_0128'),
]
operatio... | 0 | 0 | 0 | 1,247 | 0 | 0 | 0 | 30 | 68 |
09cf4e8dc61f85f2ebaa498eb81cabb195f04722 | 3,358 | py | Python | Sketches/MH/Layout/Visualisation/Graph/RenderingParticle.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/MH/Layout/Visualisation/Graph/RenderingParticle.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/MH/Layout/Visualisation/Graph/RenderingParticle.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | 37.730337 | 114 | 0.611674 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | 0 | 0 | 0 | 2,254 | 0 | 0 | 0 | 15 | 68 |
3ccdf549310d1c10291d371e3807c060ab2fe1c2 | 2,130 | py | Python | bindings/python/benchmark.py | wangjia3015/marisa-trie | da2924831c1e8f90dae7223cfe7a2bc1bd8b5132 | [
"BSD-2-Clause"
] | 388 | 2016-01-28T15:16:43.000Z | 2022-03-28T08:18:07.000Z | bindings/python/benchmark.py | wangjia3015/marisa-trie | da2924831c1e8f90dae7223cfe7a2bc1bd8b5132 | [
"BSD-2-Clause"
] | 38 | 2016-02-12T14:51:12.000Z | 2022-02-12T09:10:25.000Z | bindings/python/benchmark.py | wangjia3015/marisa-trie | da2924831c1e8f90dae7223cfe7a2bc1bd8b5132 | [
"BSD-2-Clause"
] | 79 | 2016-03-16T15:47:50.000Z | 2022-03-15T22:21:08.000Z | import datetime
import marisa
import sys
time_begin = datetime.datetime.now()
keys = []
for line in sys.stdin:
keys.append(line.rstrip())
time_end = datetime.datetime.now()
print "input:", time_end - time_begin
time_begin = datetime.datetime.now()
dic = dict()
for i in range(len(keys)):
dic[keys[i]] = i
time_end ... | 25.97561 | 63 | 0.753052 | import datetime
import marisa
import sys
time_begin = datetime.datetime.now()
keys = []
for line in sys.stdin:
keys.append(line.rstrip())
time_end = datetime.datetime.now()
print "input:", time_end - time_begin
time_begin = datetime.datetime.now()
dic = dict()
for i in range(len(keys)):
dic[keys[i]] = i
time_end ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7f9c95359486993b762a90f03b356fc2e537a3c5 | 5,868 | py | Python | SPACE/random_concept_building.py | lkreiskoether/SPACE | ba7e697bd10c5881cd6a87f9f877664978436597 | [
"Apache-2.0"
] | null | null | null | SPACE/random_concept_building.py | lkreiskoether/SPACE | ba7e697bd10c5881cd6a87f9f877664978436597 | [
"Apache-2.0"
] | null | null | null | SPACE/random_concept_building.py | lkreiskoether/SPACE | ba7e697bd10c5881cd6a87f9f877664978436597 | [
"Apache-2.0"
] | 1 | 2021-10-05T09:07:36.000Z | 2021-10-05T09:07:36.000Z | """
Copyright 2021 Lukas Kreiskther
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | 54.333333 | 128 | 0.63514 | """
Copyright 2021 Lukas Kreisköther
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... | 2 | 0 | 0 | 5,109 | 0 | 0 | 0 | -26 | 133 |
3178a9110e2900570b8a0543edc4ea7b69019a8e | 13,724 | py | Python | examples/model_compression/distill_lstm/data.py | wzzju/PaddleNLP | 1757a4fc2a3cd5a45f75c6482746777752b414d8 | [
"Apache-2.0"
] | 1 | 2021-07-13T02:21:15.000Z | 2021-07-13T02:21:15.000Z | examples/model_compression/distill_lstm/data.py | wzzju/PaddleNLP | 1757a4fc2a3cd5a45f75c6482746777752b414d8 | [
"Apache-2.0"
] | null | null | null | examples/model_compression/distill_lstm/data.py | wzzju/PaddleNLP | 1757a4fc2a3cd5a45f75c6482746777752b414d8 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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
#
# U... | 36.403183 | 93 | 0.573302 | # -*- coding: utf-8 -*-
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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
#
# U... | 0 | 0 | 0 | 0 | 0 | 1,987 | 0 | -20 | 142 |
b3cfc2a4680ba5fb688c8c605dffbd3378abcff5 | 472 | py | Python | pametis/__init__.py | avnr/pametis | 1037c7b50e5825770f2296761f3a0ad3cb37eae4 | [
"MIT"
] | null | null | null | pametis/__init__.py | avnr/pametis | 1037c7b50e5825770f2296761f3a0ad3cb37eae4 | [
"MIT"
] | null | null | null | pametis/__init__.py | avnr/pametis | 1037c7b50e5825770f2296761f3a0ad3cb37eae4 | [
"MIT"
] | null | null | null | __all__ = [
'OPT',
'configure',
'reset',
'sitemap',
'PametisException',
'AmbiguousOptions',
'BadParam',
'PametisCacheError',
'BadDomain',
'CantRemove',
'Pametis_cache',
'Sql_cache',
'postgres',
'sqlite',
... | 19.666667 | 30 | 0.489407 | from .pametis import *
__all__ = [
'OPT',
'configure',
'reset',
'sitemap',
'PametisException',
'AmbiguousOptions',
'BadParam',
'PametisCacheError',
'BadDomain',
'CantRemove',
'Pametis_cache',
'Sql_cache',
'postgres'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 22 |
727b56502133746fee15b7edcec9513b698ea9ac | 513 | py | Python | proxy/parser.py | GavinHan/sina_weibo_crawler | 5fcbd4007fb8d2fad1aa3ad68b73aec6b7669b49 | [
"BSD-2-Clause"
] | 1 | 2016-03-15T16:21:28.000Z | 2016-03-15T16:21:28.000Z | proxy/parser.py | GavinHan/sina_weibo_crawler | 5fcbd4007fb8d2fad1aa3ad68b73aec6b7669b49 | [
"BSD-2-Clause"
] | null | null | null | proxy/parser.py | GavinHan/sina_weibo_crawler | 5fcbd4007fb8d2fad1aa3ad68b73aec6b7669b49 | [
"BSD-2-Clause"
] | null | null | null | #coding: utf-8
from pyquery import PyQuery as pq
page = '''
'''
doc = pq(page)
div = doc('div').find('.proxylistitem')
div.each(perser)
#print d('p') #<p>test 1</p><p>test 2</p>
#print d('p').html() #test 1
#print d('p').eq(1).html() #test 2 | 19.730769 | 65 | 0.608187 | #coding: utf-8
import re
from pyquery import PyQuery as pq
from lxml import etree
page = '''
'''
def perser(i):
node = pq(this)
#import pdb; pdb.set_trace()
ip = node.find('.tbBottomLine:first').html().strip()
port = node.find('.tbBottomLine:first').next().html().strip()
print ('%s:%s %s')%(ip,... | 18 | 0 | 0 | 0 | 0 | 203 | 0 | -11 | 67 |
a1b30ecc1b479a04796b2d974aafc93c7541b6f8 | 2,964 | py | Python | picoCTF-web/api/common.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 280 | 2016-03-23T05:16:07.000Z | 2022-03-25T10:45:33.000Z | picoCTF-web/api/common.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 384 | 2016-03-22T05:14:47.000Z | 2021-09-13T23:46:14.000Z | picoCTF-web/api/common.py | minhnq1618/picoCTF | f634f0e55be6b1a8552a33e4f94e7487142e8bce | [
"MIT"
] | 142 | 2016-03-15T16:27:21.000Z | 2022-02-23T23:41:28.000Z | """Classes and functions used by multiple modules in the system."""
import uuid
from hashlib import md5
import bcrypt
from voluptuous import Invalid, MultipleInvalid
def token():
"""
Generate a random but insecure token.
Returns:
The randomly generated token
"""
return str(uuid.uuid4().... | 23.903226 | 75 | 0.612686 | """Classes and functions used by multiple modules in the system."""
import uuid
from hashlib import md5
import bcrypt
from voluptuous import Invalid, MultipleInvalid
def token():
"""
Generate a random but insecure token.
Returns:
The randomly generated token
"""
return str(uuid.uuid4().... | 0 | 0 | 0 | 759 | 0 | 0 | 0 | 0 | 23 |
83823ad614f73f1c0d4cb2b4bbf506ba88b266f8 | 573 | py | Python | src/active_learner.py | shenw33/ML_DLD | e83b5237a6f8dce6f9b347258f04b59345c59678 | [
"BSD-3-Clause"
] | null | null | null | src/active_learner.py | shenw33/ML_DLD | e83b5237a6f8dce6f9b347258f04b59345c59678 | [
"BSD-3-Clause"
] | null | null | null | src/active_learner.py | shenw33/ML_DLD | e83b5237a6f8dce6f9b347258f04b59345c59678 | [
"BSD-3-Clause"
] | null | null | null | from keras import layers, optimizers
if __name__ == "__main__":
learning_cycle = 0
for _ in range(learning_cycle):
mymodel = train()
multi_step_inference()
new_exp()
query_new_data()
| 20.464286 | 45 | 0.710297 |
import numpy as np
import matplotlib.pyplot as plt
import os
from keras import layers, optimizers
from keras.models import Model, Sequential
from keras.layers import Dense, LSTM, Dropout
from keras import optimizers, regularizers
from tensorflow import keras
from tensorflow.keras import layers
from train_model import ... | 0 | 0 | 0 | 0 | 0 | 25 | 0 | 86 | 222 |
6bbbf7ab3429580d63cba356479214e356e08185 | 16 | py | Python | shapelet_features/shapelets/__init__.py | ratschlab/circEWS | b2b1f00dac4f5d46856a2c7abe2ca4f12d4c612d | [
"MIT"
] | 34 | 2020-03-17T16:42:00.000Z | 2022-03-29T15:53:24.000Z | shapelet_features/utils/__init__.py | ranxiao/circEWS | 1e52880c268f8f763bbc16763131634ffc217153 | [
"MIT"
] | 3 | 2020-07-30T22:37:10.000Z | 2021-08-10T00:02:30.000Z | shapelet_features/utils/__init__.py | ranxiao/circEWS | 1e52880c268f8f763bbc16763131634ffc217153 | [
"MIT"
] | 14 | 2020-04-22T01:13:54.000Z | 2021-11-27T20:23:41.000Z | # Do not REMOVE
| 8 | 15 | 0.6875 | # Do not REMOVE
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f706c175ce9374eac08af908306915c436098b21 | 239 | py | Python | gym_simpleflappy/__init__.py | jmathison/gym-simpleflappy | 54acd54346f0ba4a611120a9ebba69acf0bae8b5 | [
"MIT"
] | null | null | null | gym_simpleflappy/__init__.py | jmathison/gym-simpleflappy | 54acd54346f0ba4a611120a9ebba69acf0bae8b5 | [
"MIT"
] | null | null | null | gym_simpleflappy/__init__.py | jmathison/gym-simpleflappy | 54acd54346f0ba4a611120a9ebba69acf0bae8b5 | [
"MIT"
] | 1 | 2019-09-19T05:26:02.000Z | 2019-09-19T05:26:02.000Z | from gym.envs.registration import register
register(
id='SimpleFlappy-v0',
entry_point='gym_simpleflappy.envs:FlappyEnv',
)
register(
id='SimpleFlappyDistance-v0',
entry_point='gym_simpleflappy.envs:FlappyEnvDistance',
)
| 19.916667 | 58 | 0.757322 | from gym.envs.registration import register
register(
id='SimpleFlappy-v0',
entry_point='gym_simpleflappy.envs:FlappyEnv',
)
register(
id='SimpleFlappyDistance-v0',
entry_point='gym_simpleflappy.envs:FlappyEnvDistance',
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
96c6bc44c1be86be9f511ff65006a4d582768b84 | 10,154 | py | Python | gym_bandits/scoreboard.py | ThomasLecat/gym-bandits-environments | adafed5952e00f1601e8a5294078cf7a2e83c836 | [
"MIT"
] | 11 | 2018-06-10T18:20:26.000Z | 2021-09-02T03:25:29.000Z | gym_bandits/scoreboard.py | ThomasLecat/gym-bandits-environments | adafed5952e00f1601e8a5294078cf7a2e83c836 | [
"MIT"
] | null | null | null | gym_bandits/scoreboard.py | ThomasLecat/gym-bandits-environments | adafed5952e00f1601e8a5294078cf7a2e83c836 | [
"MIT"
] | 4 | 2019-05-07T17:41:26.000Z | 2020-10-08T21:02:40.000Z | from gym.scoreboard.registration import add_task, add_group
add_group(
id='bandits',
name='Bandits',
description='Various N-Armed Bandit environments'
)
add_task(
id='BanditTwoArmedDeterministicFixed-v0',
group='bandits',
experimental=True,
contributor='jkcooper2',
summary="Simplest b... | 38.755725 | 168 | 0.701792 | from gym.scoreboard.registration import add_task, add_group
add_group(
id='bandits',
name='Bandits',
description='Various N-Armed Bandit environments'
)
add_task(
id='BanditTwoArmedDeterministicFixed-v0',
group='bandits',
experimental=True,
contributor='jkcooper2',
summary="Simplest b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dbe5e2a057d822c9b7627e69b232caa21bca193c | 5,368 | py | Python | books/forms.py | burhan/hellowebbooks-website | 96ca56f6d32716e5ce694664c760aa6a7bfce419 | [
"MIT"
] | null | null | null | books/forms.py | burhan/hellowebbooks-website | 96ca56f6d32716e5ce694664c760aa6a7bfce419 | [
"MIT"
] | null | null | null | books/forms.py | burhan/hellowebbooks-website | 96ca56f6d32716e5ce694664c760aa6a7bfce419 | [
"MIT"
] | null | null | null |
# TODO: Might be good to update this later to update the username too so we aren't doing two database saves
PRODUCTS = [
('ebook', 'eBook Only'),
('paperback', 'Paperback'),
('video', 'Video'),
]
| 47.087719 | 126 | 0.698398 | from django import forms
from django.contrib.auth import forms as auth_forms
from django.contrib.auth.models import User
from books.widgets import NoNameTextInput
# TODO: Might be good to update this later to update the username too so we aren't doing two database saves
class EditEmailForm(forms.ModelForm):
clas... | 0 | 0 | 0 | 4,827 | 0 | 0 | 0 | 75 | 250 |
9cfd1b79359a086dbd7fc0769ab8bcefa649fbcf | 5,944 | py | Python | test_discretization/test_reduction_diff_by_class.py | wsgan001/AnomalyDetection | 397673dc6ce978361a3fc6f2fd34879f69bc962a | [
"MIT"
] | null | null | null | test_discretization/test_reduction_diff_by_class.py | wsgan001/AnomalyDetection | 397673dc6ce978361a3fc6f2fd34879f69bc962a | [
"MIT"
] | null | null | null | test_discretization/test_reduction_diff_by_class.py | wsgan001/AnomalyDetection | 397673dc6ce978361a3fc6f2fd34879f69bc962a | [
"MIT"
] | 1 | 2020-03-16T21:50:52.000Z | 2020-03-16T21:50:52.000Z | # -*- coding: utf-8 -*-
"""
It generates plots that shows similarity for anomalies in each dataset.
"""
import matplotlib
import nslkdd.preprocessing as preprocessing
import nslkdd.data.model as model
if __name__ == '__main__':
import time
start = time.time()
df_training_20, df_training_full, gmms_traini... | 33.965714 | 126 | 0.621803 | # -*- coding: utf-8 -*-
"""
It generates plots that shows similarity for anomalies in each dataset.
"""
import copy
import math
import numpy as np
import matplotlib
import matplotlib.mlab
import matplotlib.pyplot as plt
from matplotlib import gridspec
import nslkdd.preprocessing as preprocessing
import nslkdd.data.mo... | 0 | 0 | 0 | 0 | 0 | 4,959 | 0 | -2 | 202 |
84d6e4d646bae0fc1e7b329a0d2484ed91b465ac | 6,596 | py | Python | app/main.py | Ackaman/starter-snake-python | 450d24c72b9f3af6bffaef2369913bd4d827acf2 | [
"MIT"
] | null | null | null | app/main.py | Ackaman/starter-snake-python | 450d24c72b9f3af6bffaef2369913bd4d827acf2 | [
"MIT"
] | null | null | null | app/main.py | Ackaman/starter-snake-python | 450d24c72b9f3af6bffaef2369913bd4d827acf2 | [
"MIT"
] | null | null | null | import os
import bottle
# Moving towards a tail is safe as long as that snake does not have food witihn reach.
# If it is te only possible move, that move should be made anyway
# int x,y or tuple (NEXT STEP)
##Only looks for dead end
##def snake_head_area(snake_heads, my_head):
## avoid_heads = []
## ... | 27.831224 | 111 | 0.626289 | import json
import os
import random
import bottle
from api import ping_response, start_response, move_response, end_response
# Moving towards a tail is safe as long as that snake does not have food witihn reach.
# If it is te only possible move, that move should be made anyway
@bottle.route('/')
def index():
r... | 0 | 5,085 | 0 | 0 | 0 | 272 | 0 | 35 | 227 |
83b39d103baf95f5e28b9da6371e0b29b75f4428 | 17,696 | py | Python | pygsti/report/report.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | 1 | 2021-12-19T15:11:09.000Z | 2021-12-19T15:11:09.000Z | pygsti/report/report.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | null | null | null | pygsti/report/report.py | drewrisinger/pyGSTi | dd4ad669931c7f75e026456470cf33ac5b682d0d | [
"Apache-2.0"
] | null | null | null | """ Internal model of a report during generation """
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government ... | 42.640964 | 112 | 0.61415 | """ Internal model of a report during generation """
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government ... | 0 | 0 | 0 | 16,342 | 0 | 0 | 0 | 221 | 266 |
056e5bfd74cdb3c57ea5d1772797214b876ae034 | 6,878 | py | Python | function/tests/testTask/test_update.py | kohski/serverless_todo | 60e90caf86f5d921150193beac4acbd90752c814 | [
"MIT"
] | null | null | null | function/tests/testTask/test_update.py | kohski/serverless_todo | 60e90caf86f5d921150193beac4acbd90752c814 | [
"MIT"
] | 32 | 2021-02-25T01:18:20.000Z | 2021-03-03T23:42:27.000Z | function/tests/testTask/test_update.py | kohski/serverless_todo | 60e90caf86f5d921150193beac4acbd90752c814 | [
"MIT"
] | null | null | null | import boto3
import os
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(os.environ['TABLE_NAME'])
# ------------------------------------------
# valid pattern
# ------------------------------------------
# ------------------------------------------
# not found pattern
# ----... | 32.443396 | 109 | 0.486915 | import pytest
from datetime import datetime
from update import lambda_handler
import boto3
import os
import json
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(os.environ['TABLE_NAME'])
# ------------------------------------------
# valid pattern
# ----------------------------------------... | 81 | 5,425 | 0 | 0 | 0 | 443 | 0 | 2 | 203 |
339c00d28f3cce8e0930a2efcf6717be89f5a16d | 642 | py | Python | micron/tests/audiodevice.test.py | zhengyang-c/photonLauncher | 76215f47ccd1178f1826834533f5702c4b8f2c35 | [
"Apache-2.0"
] | 6 | 2015-11-26T15:03:38.000Z | 2020-10-05T14:08:54.000Z | micron/tests/audiodevice.test.py | zhengyang-c/photonLauncher | 76215f47ccd1178f1826834533f5702c4b8f2c35 | [
"Apache-2.0"
] | 7 | 2015-12-09T06:44:34.000Z | 2021-12-14T15:51:28.000Z | micron/tests/audiodevice.test.py | zhengyang-c/photonLauncher | 76215f47ccd1178f1826834533f5702c4b8f2c35 | [
"Apache-2.0"
] | 3 | 2016-07-25T10:43:21.000Z | 2021-12-07T14:12:47.000Z | #!/usr/bin/env python3
import pyaudio
import sys
sys.path.insert(0, "../")
from pwmaudio import noALSAerror
with noALSAerror():
p = pyaudio.PyAudio()
info = p.get_host_api_info_by_index(0)
print(p.get_host_api_count())
print(info)
numdevices = info.get('deviceCount')
for i in range(0, numdevi... | 33.789474 | 116 | 0.661994 | #!/usr/bin/env python3
import pyaudio
import sys
sys.path.insert(0, "../")
from pwmaudio import noALSAerror
with noALSAerror():
p = pyaudio.PyAudio()
info = p.get_host_api_info_by_index(0)
print(p.get_host_api_count())
print(info)
numdevices = info.get('deviceCount')
for i in range(0, numdevi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
38f4cfc7cbdf2d4521cd2cce0f4533e5bc58ff43 | 2,384 | py | Python | app/src/main/assets/code/controller/controller.py | tongjinlv/py_and | a069336c47dd233648fbbadee7275ef188696a44 | [
"Apache-2.0"
] | null | null | null | app/src/main/assets/code/controller/controller.py | tongjinlv/py_and | a069336c47dd233648fbbadee7275ef188696a44 | [
"Apache-2.0"
] | null | null | null | app/src/main/assets/code/controller/controller.py | tongjinlv/py_and | a069336c47dd233648fbbadee7275ef188696a44 | [
"Apache-2.0"
] | null | null | null | import imp
imp.load_source('controllerleds', '/data/data/com.matatalab.matatacode/run/controller/leds.py')
imp.load_source('controllermessage', '/data/data/com.matatalab.matatacode/run/controller/message.py')
imp.load_source('controllesensor', '/data/data/com.matatalab.matatacode/run/controller/sensor.py')
imp.load_sou... | 41.824561 | 116 | 0.75797 | import sys
import math
import random
import imp
from java import jclass
from controller.leds import leds
from controller.message import message
from controller.sensor import sensor
from controller.motion_sensor import motion_sensor
from controller.button import button
from controller.color_sensor import color_sensor
fr... | 27 | 0 | 0 | 949 | 0 | 0 | 0 | 160 | 309 |
9126ebac0a1ed3389e3b8adbc570ccd9cc668771 | 4,684 | py | Python | crowdstrike/src/crowdstrike/actor/importer.py | galonsososa/connectors | 6272128a2ca69ffca13cec63ff0f7bc55ee902a5 | [
"Apache-2.0"
] | null | null | null | crowdstrike/src/crowdstrike/actor/importer.py | galonsososa/connectors | 6272128a2ca69ffca13cec63ff0f7bc55ee902a5 | [
"Apache-2.0"
] | 2 | 2021-02-16T20:48:43.000Z | 2021-03-03T06:20:13.000Z | crowdstrike/src/crowdstrike/actor/importer.py | galonsososa/connectors | 6272128a2ca69ffca13cec63ff0f7bc55ee902a5 | [
"Apache-2.0"
] | 2 | 2021-02-16T20:45:11.000Z | 2021-03-03T05:47:53.000Z | # -*- coding: utf-8 -*-
"""OpenCTI CrowdStrike actor importer module."""
| 33.219858 | 105 | 0.638343 | # -*- coding: utf-8 -*-
"""OpenCTI CrowdStrike actor importer module."""
from typing import Any, Generator, List, Mapping, Optional
from crowdstrike_client.api.intel.actors import Actors
from crowdstrike_client.api.models import Response
from crowdstrike_client.api.models.actor import Actor
from pycti.connector.open... | 0 | 0 | 0 | 3,999 | 0 | 0 | 0 | 339 | 272 |
f6bfb6ffbc2d0285ca49b8bc43649c6454ef1f28 | 3,024 | py | Python | Sample.py | zerobounce-llc/zero-bounce-python-sdk-setup | 46dcdce9ece529e23d65fa92fb81f8ac19ce5c2e | [
"MIT"
] | null | null | null | Sample.py | zerobounce-llc/zero-bounce-python-sdk-setup | 46dcdce9ece529e23d65fa92fb81f8ac19ce5c2e | [
"MIT"
] | null | null | null | Sample.py | zerobounce-llc/zero-bounce-python-sdk-setup | 46dcdce9ece529e23d65fa92fb81f8ac19ce5c2e | [
"MIT"
] | null | null | null |
test()
| 29.076923 | 85 | 0.652116 | from datetime import date
from zerobouncesdk import zerobouncesdk, ZBApiException, \
ZBMissingApiKeyException
def test_validate():
try:
response = zerobouncesdk.validate(email="<EMAIL_TO_TEST>")
print("validate success response: " + str(response))
except ZBApiException as e:
print(... | 0 | 0 | 0 | 0 | 0 | 2,709 | 0 | 70 | 228 |
7bc2b1b8575ca1fb963e3e27a6dc57290ad35330 | 2,305 | py | Python | Software/Sensors/IAQ_SCD30.py | xJohnnyBravo/zephyrus-iaq | 31d39ae21080de55d39bc0dde6e49f5749d39477 | [
"MIT"
] | 2 | 2019-10-01T23:08:25.000Z | 2019-11-05T23:37:38.000Z | Software/Sensors/IAQ_SCD30.py | aaronjense/raspberrypi-indoor-air-quality-pcb | 7e1fc68b31dea88229866c8cbc6b221a4a679134 | [
"MIT"
] | 1 | 2019-11-14T02:28:30.000Z | 2019-11-14T02:28:30.000Z | Software/Sensors/IAQ_SCD30.py | aaronjense/raspberrypi-indoor-air-quality-pcb | 7e1fc68b31dea88229866c8cbc6b221a4a679134 | [
"MIT"
] | 6 | 2019-10-01T22:44:44.000Z | 2019-11-14T20:19:46.000Z | #!/usr/bin/python
#################################################################################
# MIT License
#
# Copyright (c) 2019 Aaron Jense, Amy Heidner, Dennis Heidner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation file... | 39.741379 | 82 | 0.6282 | #!/usr/bin/python
#################################################################################
# MIT License
#
# Copyright (c) 2019 Aaron Jense, Amy Heidner, Dennis Heidner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation file... | 0 | 0 | 0 | 847 | 0 | 0 | 0 | 16 | 96 |
64b668a6aa6c762d7927caa38bc992ca22f6db7c | 3,424 | py | Python | dc_gym/iroko_reward.py | matthieu637/iroko | 3905caa46328a7c011762f8a96a15fbde9826899 | [
"Apache-2.0"
] | 56 | 2018-12-01T00:11:27.000Z | 2022-03-08T04:10:10.000Z | dc_gym/iroko_reward.py | matthieu637/iroko | 3905caa46328a7c011762f8a96a15fbde9826899 | [
"Apache-2.0"
] | 33 | 2018-12-13T20:18:07.000Z | 2022-03-23T16:03:26.000Z | dc_gym/iroko_reward.py | matthieu637/iroko | 3905caa46328a7c011762f8a96a15fbde9826899 | [
"Apache-2.0"
] | 17 | 2019-02-19T05:31:23.000Z | 2022-03-14T15:20:00.000Z | import numpy as np
import logging
log = logging.getLogger(__name__)
def fairness_reward(actions, queues=None):
"""Compute Jain"s fairness index for a list of values.
See http://en.wikipedia.org/wiki/Fairness_measure for fairness equations.
@param values: list of values
@return fairness: JFI
"""
... | 29.264957 | 80 | 0.651577 | import numpy as np
import math
import logging
log = logging.getLogger(__name__)
def fairness_reward(actions, queues=None):
"""Compute Jain"s fairness index for a list of values.
See http://en.wikipedia.org/wiki/Fairness_measure for fairness equations.
@param values: list of values
@return fairness: JF... | 0 | 0 | 0 | 619 | 0 | 887 | 0 | -10 | 206 |
e25ff3df493ac431d6d60b22582cb70b4670f2a3 | 727 | py | Python | cellar/fs.py | JonathanHuot/cellarpy | 74fe9f144b63b891d6cda45f10f63d310c0d0f58 | [
"MIT"
] | null | null | null | cellar/fs.py | JonathanHuot/cellarpy | 74fe9f144b63b891d6cda45f10f63d310c0d0f58 | [
"MIT"
] | 4 | 2018-03-03T22:08:22.000Z | 2021-09-07T23:44:54.000Z | cellar/fs.py | JonathanHuot/cellarpy | 74fe9f144b63b891d6cda45f10f63d310c0d0f58 | [
"MIT"
] | 1 | 2017-06-08T13:01:02.000Z | 2017-06-08T13:01:02.000Z | # -*- coding: utf-8 -*-
| 25.964286 | 73 | 0.639615 | # -*- coding: utf-8 -*-
import os
def iswritable(directory):
if not os.path.exists(directory):
try:
os.makedirs(directory)
except:
return False
return os.access(directory, os.W_OK | os.X_OK | os.R_OK)
def static_file_path(root, filename):
root = os.path.abspath(ro... | 0 | 0 | 0 | 0 | 0 | 621 | 0 | -12 | 91 |
3c950daaa32f79dd0904fd8cf520966d77491761 | 371 | py | Python | ex043.py | GuilhermeAntony14/Estudando-Python | b020f6d2625e7fcc42d30658bcbd881b093434dd | [
"MIT"
] | null | null | null | ex043.py | GuilhermeAntony14/Estudando-Python | b020f6d2625e7fcc42d30658bcbd881b093434dd | [
"MIT"
] | null | null | null | ex043.py | GuilhermeAntony14/Estudando-Python | b020f6d2625e7fcc42d30658bcbd881b093434dd | [
"MIT"
] | null | null | null | print('vamos calcular seu IMC')
a = float(input('Sua altura: '))
p = float(input('Seu peso: '))
n = (p/(a**2))
print(f'Seu IMC e: {n:.1f}')
if n < 18.5:
print('Abaixo do peso.')
elif n <= 25 and n > 18.5:
print('Peso ideal.')
elif n < 30 and n > 25:
print('Sobrepeso.')
elif n <= 40 and 30 < n:
print('ob... | 23.1875 | 32 | 0.566038 | print('vamos calcular seu IMC')
a = float(input('Sua altura: '))
p = float(input('Seu peso: '))
n = (p/(a**2))
print(f'Seu IMC e: {n:.1f}')
if n < 18.5:
print('Abaixo do peso.')
elif n <= 25 and n > 18.5:
print('Peso ideal.')
elif n < 30 and n > 25:
print('Sobrepeso.')
elif n <= 40 and 30 < n:
print('ob... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e5bd5f40b426cef7283c560a2796fb22b549035d | 667 | py | Python | tests/test_data_cleanser.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 231 | 2016-05-30T02:34:45.000Z | 2022-03-28T17:00:29.000Z | tests/test_data_cleanser.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 77 | 2016-03-23T16:28:34.000Z | 2021-09-30T22:08:03.000Z | tests/test_data_cleanser.py | luisccalves/supplychainpy | 63a10b77ffdcc5bca71e815c70667c819d8f9af0 | [
"BSD-3-Clause"
] | 103 | 2016-08-10T19:53:09.000Z | 2022-03-16T16:34:38.000Z |
#logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
| 39.235294 | 104 | 0.728636 | from unittest import TestCase
import logging
from supplychainpy._helpers import _data_cleansing
from supplychainpy.sample_data.config import ABS_FILE_PATH
#logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
class TestCleanser(TestCase):
def test_incorrect_row_length(self... | 0 | 0 | 0 | 393 | 0 | 0 | 0 | 67 | 113 |
e738317c6f5cf90c7eb6eb5ab706d4e66f9a907d | 438 | py | Python | sikuli-ide/sample-scripts/mute.sikuli/mute.py | mgrundy/sikuli | 4adaab7880d2f3e14702ca7287ae9c9e4f4de9ab | [
"MIT"
] | 1,292 | 2015-01-09T17:48:46.000Z | 2022-03-30T20:08:15.000Z | sikuli-ide/sample-scripts/mute.sikuli/mute.py | mgrundy/sikuli | 4adaab7880d2f3e14702ca7287ae9c9e4f4de9ab | [
"MIT"
] | 31 | 2015-01-20T15:01:24.000Z | 2022-03-03T11:02:06.000Z | sikuli-ide/sample-scripts/mute.sikuli/mute.py | mgrundy/sikuli | 4adaab7880d2f3e14702ca7287ae9c9e4f4de9ab | [
"MIT"
] | 267 | 2015-02-08T19:51:25.000Z | 2022-03-19T22:16:01.000Z |
switchApp("System Preferences.app")
click("1273526123226.png")
click("1273526171905.png")
thumbs = findAll("1273527194228.png")
for t in list(thumbs)[:2]: # only take the first two
dragLeft(t) # off
#dragRight(t) # on
#dragToMute(t)
| 23.052632 | 58 | 0.691781 | def dragLeft(t):
dragDrop(t, t.getCenter().left(200))
def dragRight(t):
dragDrop(t, t.getCenter().right(200))
def dragToMute(t):
dragDrop(t, t.nearby().left().find("1273527108356.png"))
switchApp("System Preferences.app")
click("1273526123226.png")
click("1273526171905.png")
thumbs = findAll("1273527194228.pn... | 0 | 0 | 0 | 0 | 0 | 127 | 0 | 0 | 68 |
5a5a83ad47518f4946babfacb96a920c30542e02 | 4,869 | py | Python | pytest_func_cov/plugin.py | radug0314/pytest_func_cov | cc689ba68d083e69d399baad83189861a7adb199 | [
"MIT"
] | 4 | 2020-04-03T19:36:51.000Z | 2021-04-11T23:41:59.000Z | pytest_func_cov/plugin.py | RaduG/pytest_func_cov | cc689ba68d083e69d399baad83189861a7adb199 | [
"MIT"
] | 5 | 2020-02-23T20:37:04.000Z | 2021-07-07T07:53:39.000Z | pytest_func_cov/plugin.py | radug0314/pytest_func_cov | cc689ba68d083e69d399baad83189861a7adb199 | [
"MIT"
] | 1 | 2021-04-05T15:36:54.000Z | 2021-04-05T15:36:54.000Z |
def pytest_addoption(parser):
"""
Pytest hook - register command line arguments. We want to register the
--func_cov argument to explicitly pass the location of the package to
discover and the ignore_func_names ini setting.
Args:
parser:
"""
group = parser.getgroup("func_cov")
... | 30.622642 | 82 | 0.586979 | import os
import sys
from .tracking import FunctionIndexer, get_full_function_name
def pytest_addoption(parser):
"""
Pytest hook - register command line arguments. We want to register the
--func_cov argument to explicitly pass the location of the package to
discover and the ignore_func_names ini sett... | 0 | 0 | 0 | 3,739 | 0 | 209 | 0 | 17 | 113 |
df932a1d318345b8235882775e0cd92939917f5c | 1,968 | py | Python | lib/tests/test_runner.py | xuzhiying9510/ncflow | 3f6f4a5b2c13ac8f6375b097b35f6c55b18d212e | [
"Artistic-1.0-cl8"
] | 10 | 2021-02-09T19:25:46.000Z | 2022-03-29T13:49:23.000Z | lib/tests/test_runner.py | xuzhiying9510/ncflow | 3f6f4a5b2c13ac8f6375b097b35f6c55b18d212e | [
"Artistic-1.0-cl8"
] | null | null | null | lib/tests/test_runner.py | xuzhiying9510/ncflow | 3f6f4a5b2c13ac8f6375b097b35f6c55b18d212e | [
"Artistic-1.0-cl8"
] | 5 | 2020-12-23T15:24:40.000Z | 2022-01-06T09:42:38.000Z | #! /usr/bin/env python
from .toy_problem_test import ToyProblemTest
from .reconciliation_problem_test import ReconciliationProblemTest
from .reconciliation_problem_2_test import ReconciliationProblem2Test
from .recon3_test import Recon3Test
from .optgapc1_test import OptGapC1Test
from .optgapc2_test import OptGapC2Te... | 33.931034 | 102 | 0.723069 | #! /usr/bin/env python
from .toy_problem_test import ToyProblemTest
from .reconciliation_problem_test import ReconciliationProblemTest
from .reconciliation_problem_2_test import ReconciliationProblem2Test
from .recon3_test import Recon3Test
from .optgapc1_test import OptGapC1Test
from .optgapc2_test import OptGapC2Te... | 0 | 0 | 0 | 0 | 0 | 476 | 0 | 13 | 45 |
5eef5e446e1922c169ce5770f96bdb08b8933d69 | 17,847 | py | Python | openmdao/core/tests/test_getset_vars.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | 451 | 2015-07-20T11:52:35.000Z | 2022-03-28T08:04:56.000Z | openmdao/core/tests/test_getset_vars.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | 1,096 | 2015-07-21T03:08:26.000Z | 2022-03-31T11:59:17.000Z | openmdao/core/tests/test_getset_vars.py | friedenhe/OpenMDAO | db1d7e22a8bf9f66afa82ec3544b7244d5545f6d | [
"Apache-2.0"
] | 301 | 2015-07-16T20:02:11.000Z | 2022-03-28T08:04:39.000Z | """Test getting/setting variables and subjacs with promoted/relative/absolute names."""
import unittest
try:
from openmdao.vectors.petsc_vector import PETScVector
except ImportError:
PETScVector = None
if __name__ == '__main__':
unittest.main()
| 39.837054 | 292 | 0.518462 | """Test getting/setting variables and subjacs with promoted/relative/absolute names."""
import unittest
import numpy as np
from openmdao.api import Problem, Group, ExecComp, IndepVarComp, DirectSolver, ParallelGroup
from openmdao.utils.mpi import MPI
try:
from openmdao.vectors.petsc_vector import PETScVector
exce... | 0 | 2,501 | 0 | 14,890 | 0 | 0 | 0 | 81 | 112 |
c4ac532576ad2e3296ef052f13dff92d03c958af | 6,299 | py | Python | heltour/tournament/tests/test_views.py | lenguyenthanh/heltour | 13018b1905539de0b273370a76f6aa1d1ebbb01a | [
"MIT"
] | null | null | null | heltour/tournament/tests/test_views.py | lenguyenthanh/heltour | 13018b1905539de0b273370a76f6aa1d1ebbb01a | [
"MIT"
] | null | null | null | heltour/tournament/tests/test_views.py | lenguyenthanh/heltour | 13018b1905539de0b273370a76f6aa1d1ebbb01a | [
"MIT"
] | null | null | null |
# For now we just have sanity checks for the templates used
# This could be enhanced by verifying the context data
| 41.993333 | 123 | 0.699476 | from django.test import TestCase
from heltour.tournament.models import *
from django.core.urlresolvers import reverse
# For now we just have sanity checks for the templates used
# This could be enhanced by verifying the context data
def createCommonLeagueData():
team_count = 4
round_count = 3
board_count ... | 0 | 0 | 0 | 4,919 | 0 | 893 | 0 | 52 | 319 |
f99a17b230e8119aba628bdff0bc3af92b2d5225 | 765 | py | Python | tests/test_mass_fetch.py | dominik7680/py-skydb | ddf2c6c993cc75398bc3dfcf41954b6793bf3349 | [
"MIT"
] | 14 | 2020-11-23T17:05:27.000Z | 2022-03-22T01:52:09.000Z | tests/test_mass_fetch.py | dominik7680/py-skydb | ddf2c6c993cc75398bc3dfcf41954b6793bf3349 | [
"MIT"
] | 2 | 2020-11-25T12:00:24.000Z | 2020-12-09T18:10:50.000Z | tests/test_mass_fetch.py | dominik7680/py-skydb | ddf2c6c993cc75398bc3dfcf41954b6793bf3349 | [
"MIT"
] | 5 | 2020-12-09T15:57:11.000Z | 2022-01-30T13:17:14.000Z | from skydb import SkydbTable
from random import choice
from string import ascii_letters
table_name = ''.join([choice(ascii_letters) for i in range(20)])
print("Creating table")
table = SkydbTable(table_name, columns=['c1','c2','c3'], seed="some_random", verbose=1)
print("Added table successfully")
| 24.677419 | 87 | 0.678431 | from skydb import SkydbTable
from random import choice
from string import ascii_letters
table_name = ''.join([choice(ascii_letters) for i in range(20)])
import time
print("Creating table")
table = SkydbTable(table_name, columns=['c1','c2','c3'], seed="some_random", verbose=1)
print("Added table successfully")
def te... | 0 | 0 | 0 | 0 | 0 | 427 | 0 | -10 | 45 |
f47c4459ec95c272bab38550541eef155938f3cc | 1,733 | py | Python | api/tests/integration/tests/layout/template_layout.py | tsingdao-Tp/Indigo | b2d73faebb6a450e9b3d34fed553fad4f9d0012f | [
"Apache-2.0"
] | 204 | 2015-11-06T21:34:34.000Z | 2022-03-30T16:17:01.000Z | api/tests/integration/tests/layout/template_layout.py | tsingdao-Tp/Indigo | b2d73faebb6a450e9b3d34fed553fad4f9d0012f | [
"Apache-2.0"
] | 509 | 2015-11-05T13:54:43.000Z | 2022-03-30T22:15:30.000Z | api/tests/integration/tests/layout/template_layout.py | tsingdao-Tp/Indigo | b2d73faebb6a450e9b3d34fed553fad4f9d0012f | [
"Apache-2.0"
] | 89 | 2015-11-17T08:22:54.000Z | 2022-03-17T04:26:28.000Z | import os
import sys
import errno
sys.path.append('../../common')
if not os.path.exists(joinPathPy("out", __file__)):
try:
os.makedirs(joinPathPy("out", __file__))
except OSError as e:
if e.errno != errno.EEXIST:
raise
indigo = Indigo()
indigo.setOption("molfile-saving-skip-date",... | 31.509091 | 104 | 0.669359 | import os
import sys
import errno
import math
from math import *
sys.path.append('../../common')
from env_indigo import *
if not os.path.exists(joinPathPy("out", __file__)):
try:
os.makedirs(joinPathPy("out", __file__))
except OSError as e:
if e.errno != errno.EEXIST:
raise
indigo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 66 |
b76165b2825027823939347d4036fc0458906b68 | 605 | py | Python | src/tblink_rpc_utils/input_reader_yaml.py | tblink-rpc/tblink-rpc-utils | 48a731cb8c6201e1975ba18f43737228eb1f7dee | [
"Apache-2.0"
] | null | null | null | src/tblink_rpc_utils/input_reader_yaml.py | tblink-rpc/tblink-rpc-utils | 48a731cb8c6201e1975ba18f43737228eb1f7dee | [
"Apache-2.0"
] | null | null | null | src/tblink_rpc_utils/input_reader_yaml.py | tblink-rpc/tblink-rpc-utils | 48a731cb8c6201e1975ba18f43737228eb1f7dee | [
"Apache-2.0"
] | null | null | null | '''
Created on Oct 20, 2021
@author: mballance
'''
| 25.208333 | 58 | 0.66281 | '''
Created on Oct 20, 2021
@author: mballance
'''
from tblink_rpc_utils.idl_spec import IDLSpec
from tblink_rpc_utils.input_reader import InputReader
from tblink_rpc_utils.input_spec import InputSpec
from tblink_rpc_utils.yaml_idl_parser import YamlIDLParser
class InputReaderYaml(InputReader):
def __init__... | 0 | 0 | 0 | 321 | 0 | 0 | 0 | 121 | 111 |
9734061ff8c9ce101186289f0971e8af178cbcda | 518 | py | Python | escola/templatetags/markdown.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2019-03-15T18:04:24.000Z | 2019-03-15T18:04:24.000Z | escola/templatetags/markdown.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 22 | 2019-03-17T21:53:50.000Z | 2021-03-31T19:12:19.000Z | escola/templatetags/markdown.py | vini84200/medusa2 | 37cf33d05be8b0195b10845061ca893ba5e814dd | [
"MIT"
] | 1 | 2018-11-25T03:05:23.000Z | 2018-11-25T03:05:23.000Z | from django import template
register = template.Library()
| 28.777778 | 78 | 0.702703 | import misaka as m
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
from MedusaII.settings import MARKDOWNX_MARKDOWN_EXTENSIONS
register = template.Library()
@register.filter(is_safe=True)
@stringfilter
def md(value):
rendered_text... | 0 | 253 | 0 | 0 | 0 | 0 | 0 | 93 | 112 |
297983f1224fa368c806bb3709b78cd221f4c7f1 | 1,720 | py | Python | targetrsqueak-embedded.py | shiplift/RSqueakOnABoat | ac449758ddb7aef1721e65a13171547761dd6e39 | [
"BSD-3-Clause"
] | 44 | 2015-02-08T09:38:46.000Z | 2017-11-15T01:19:40.000Z | targetrsqueak-embedded.py | shiplift/RSqueakOnABoat | ac449758ddb7aef1721e65a13171547761dd6e39 | [
"BSD-3-Clause"
] | 112 | 2015-02-08T09:34:40.000Z | 2017-04-10T19:06:30.000Z | targetrsqueak-embedded.py | shiplift/RSqueakOnABoat | ac449758ddb7aef1721e65a13171547761dd6e39 | [
"BSD-3-Clause"
] | 7 | 2015-04-08T11:49:10.000Z | 2017-01-19T06:36:27.000Z | #! /usr/bin/env python
import sys
# This loads an image file in advance and includes it in the
# translation-output. At run-time, the defined selector is sent
# to the defined SmallInteger. This way we get an RPython
# "image" frozen into the executable, mmap'ed by the OS from
# there and loaded lazily when needed :-)... | 30.714286 | 85 | 0.73314 | #! /usr/bin/env python
import sys
from rpython.jit.codewriter.policy import JitPolicy
from rsqueakvm import model, objspace, interpreter, squeakimage
# This loads an image file in advance and includes it in the
# translation-output. At run-time, the defined selector is sent
# to the defined SmallInteger. This way we g... | 0 | 0 | 0 | 0 | 0 | 869 | 0 | 72 | 136 |
d5764f7267401bb5f87916e35baf7cbfc9aaaca4 | 96 | bzl | Python | tools/bzl/classpath.bzl | jinrongc1986/events-log | 37371e72e9604cc637d0a96ebc91e5a53d420e2c | [
"Apache-2.0"
] | null | null | null | tools/bzl/classpath.bzl | jinrongc1986/events-log | 37371e72e9604cc637d0a96ebc91e5a53d420e2c | [
"Apache-2.0"
] | null | null | null | tools/bzl/classpath.bzl | jinrongc1986/events-log | 37371e72e9604cc637d0a96ebc91e5a53d420e2c | [
"Apache-2.0"
] | null | null | null | load(
"@com_googlesource_gerrit_bazlets//tools:classpath.bzl",
"classpath_collector",
)
| 19.2 | 60 | 0.739583 | load(
"@com_googlesource_gerrit_bazlets//tools:classpath.bzl",
"classpath_collector",
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9daee1667658b8ded3cb5aa585437a23a6547b46 | 9,652 | py | Python | wrap/pyllbc/script/common/Stream.py | caochunxi/llbc | 2ff4af937f1635be67a7e24602d0a3e87c708ba7 | [
"MIT"
] | 83 | 2015-11-10T09:52:56.000Z | 2022-01-12T11:53:01.000Z | wrap/pyllbc/script/common/Stream.py | lailongwei/llbc | ec7e69bfa1f0afece8bb19dfa9a0a4578508a077 | [
"MIT"
] | 30 | 2017-09-30T07:43:20.000Z | 2022-01-23T13:18:48.000Z | wrap/pyllbc/script/common/Stream.py | caochunxi/llbc | 2ff4af937f1635be67a7e24602d0a3e87c708ba7 | [
"MIT"
] | 34 | 2015-11-14T12:37:44.000Z | 2021-12-16T02:38:36.000Z | # -*- coding: utf-8 -*-
import llbc
llbc.Stream = pyllbcStream
| 30.544304 | 129 | 0.623809 | # -*- coding: utf-8 -*-
import inspect
import llbc
class pyllbcStream(object):
"""
Stream class encapsulation, use to pack/unpack data sequence.
"""
def __init__(self, size=0, init_obj=None, endian=llbc.Endian.MachineEndian):
self.__c_obj = llbc.inl.NewPyStream(self, size, endian)
sel... | 0 | 1,607 | 0 | 7,940 | 0 | 0 | 0 | -7 | 46 |
793dabc069adbb525fbf397b7888dc9fdb942b2b | 2,036 | py | Python | src/BloomFilter/BloomFilter.py | shapovalovdev/AlgorythmsAndDataStructures | 34d5f38c089e0ba902813607f08847fbdc7361ab | [
"Apache-2.0"
] | null | null | null | src/BloomFilter/BloomFilter.py | shapovalovdev/AlgorythmsAndDataStructures | 34d5f38c089e0ba902813607f08847fbdc7361ab | [
"Apache-2.0"
] | null | null | null | src/BloomFilter/BloomFilter.py | shapovalovdev/AlgorythmsAndDataStructures | 34d5f38c089e0ba902813607f08847fbdc7361ab | [
"Apache-2.0"
] | null | null | null | #import hashlib
#from random import randint
# if __name__ == '__main__':
# dataset=["0123456789", "1234567890", "sdfsdfsdf", "sdf2143124", "hophey", "abirvaolg", "8901234567", "2356sdfqix,ed", "9012345678"]
# dataset2=["012345678932", "12345623e47890", "sdfdsfq1sdfsdf", "sdf2gs2143124", "qwerhophey", "atgxcv... | 32.83871 | 178 | 0.589391 | #import hashlib
#from random import randint
class BloomFilter:
def __init__(self, f_len):
self.filter_len = f_len
# создаём битовый массив длиной f_len ...
self.bloom_array=self.filter_len * [0]
def hash1(self, str1):
result=1
rand_int=17
for c in str1:
... | 114 | 0 | 0 | 1,049 | 0 | 0 | 0 | 0 | 22 |
6f4a2eae77a08e70580164954af371a9d61703ba | 5,170 | py | Python | ivolution/FacemovieThread.py | jlengrand/Ivolution | 2753d7120b11fb94a5ce84bfe4a134b5a437a5c7 | [
"BSD-3-Clause"
] | 4 | 2015-01-22T06:32:15.000Z | 2020-01-30T05:53:48.000Z | ivolution/FacemovieThread.py | jlengrand/Ivolution | 2753d7120b11fb94a5ce84bfe4a134b5a437a5c7 | [
"BSD-3-Clause"
] | null | null | null | ivolution/FacemovieThread.py | jlengrand/Ivolution | 2753d7120b11fb94a5ce84bfe4a134b5a437a5c7 | [
"BSD-3-Clause"
] | 7 | 2015-04-23T12:34:19.000Z | 2021-08-01T05:58:56.000Z | """
.. module:: Facemovie
:platform: Unix, Windows
:synopsis: Main class of the application. Contains the core image processing functions.Plays the role of a controller for the application, as it supports the communication layer.
.. moduleauthor:: Julien Lengrand-Lambert <jlengrand@gmail.com>
"""
| 40.077519 | 181 | 0.609284 | """
.. module:: Facemovie
:platform: Unix, Windows
:synopsis: Main class of the application. Contains the core image processing functions.Plays the role of a controller for the application, as it supports the communication layer.
.. moduleauthor:: Julien Lengrand-Lambert <jlengrand@gmail.com>
"""
import threadi... | 0 | 0 | 0 | 4,712 | 0 | 0 | 0 | 15 | 136 |
0c88166c936c8776b4331a148fd68ba27d214ba1 | 1,395 | py | Python | Q024_implement_queue_class_in_python.py | latika18/learning | a57c9aacc0157bf7c318f46c1e7c4971d1d55aea | [
"Unlicense"
] | null | null | null | Q024_implement_queue_class_in_python.py | latika18/learning | a57c9aacc0157bf7c318f46c1e7c4971d1d55aea | [
"Unlicense"
] | null | null | null | Q024_implement_queue_class_in_python.py | latika18/learning | a57c9aacc0157bf7c318f46c1e7c4971d1d55aea | [
"Unlicense"
] | null | null | null | #Question 24
#Implement a queue class in Python: It should support 3 APIs:
#queue.top(): prints current element at front of queue
#queue.pop(): takes out an element from front of queue
#queue.add(): adds a new element at end of stack
queue_1 = Queue()
queue_1.add(12)
queue_1.add(11)
queue_1.add(55)
queue_1.add(66)
qu... | 21.136364 | 61 | 0.653047 | #Question 24
#Implement a queue class in Python: It should support 3 APIs:
#queue.top(): prints current element at front of queue
#queue.pop(): takes out an element from front of queue
#queue.add(): adds a new element at end of stack
class Queue:
def __init__(self):
"""initialise a Queue class"""
se... | 0 | 0 | 0 | 571 | 0 | 0 | 0 | 0 | 22 |
7a93655ebac4268d033069e0c8e6ff264d96d3fb | 45 | py | Python | src/widget/user1/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | src/widget/user1/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | src/widget/user1/__init__.py | megemini/DataCastle2017 | 261134f760d8c1bbfc3e65e1362b7710e601947d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Just for test
""" | 11.25 | 23 | 0.466667 | # -*- coding: utf-8 -*-
"""
Just for test
""" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2366a81d98fc425ba641105e960fcc11a70e1e25 | 993 | py | Python | plot/Plot_thermal_conductiviy_V1.py | eastsheng/Thermal-conductivity | 8a26be22c58b3b3b6723c57c65f4bba93556f9e8 | [
"MIT"
] | 7 | 2020-06-10T05:38:17.000Z | 2022-03-11T10:33:57.000Z | plot/Plot_thermal_conductiviy_V1.py | eastsheng/Thermal-conductivity | 8a26be22c58b3b3b6723c57c65f4bba93556f9e8 | [
"MIT"
] | null | null | null | plot/Plot_thermal_conductiviy_V1.py | eastsheng/Thermal-conductivity | 8a26be22c58b3b3b6723c57c65f4bba93556f9e8 | [
"MIT"
] | 2 | 2020-04-24T09:36:25.000Z | 2022-03-11T10:33:58.000Z |
if __name__ == '__main__':
# tcfile = './Thermal_conductivity_Se.txt'
tcfile = './Thermal_conductivity_S.txt'
plt_tc(tcfile) | 24.825 | 96 | 0.678751 | import numpy as np
import matplotlib.pyplot as plt
def plt_tc(tcfile):
tc = np.loadtxt(tcfile)
# print(tc)
x = tc[:,0]/32.06
y = tc[:,1:4]
y_mean = np.mean(y,axis=1)
y_std = np.std(y,axis=1)
# print(y_mean,y_std)
plt.rc('font',family='Times New Roman',size=26)
fig, ax = plt.subplots(figsize=(8,6))
fig.sub... | 0 | 0 | 0 | 0 | 0 | 785 | 0 | 7 | 69 |
68a08329945e4e078a86db5c9188a879ac68c385 | 4,743 | py | Python | scripts/scatter_plots.py | tupleblog/bkkdreams-datathon | 54214356d42cecdc758803d958375bd7ee7dc169 | [
"MIT"
] | 1 | 2020-09-13T16:52:03.000Z | 2020-09-13T16:52:03.000Z | scripts/scatter_plots.py | tupleblog/bkkdreams-datathon | 54214356d42cecdc758803d958375bd7ee7dc169 | [
"MIT"
] | null | null | null | scripts/scatter_plots.py | tupleblog/bkkdreams-datathon | 54214356d42cecdc758803d958375bd7ee7dc169 | [
"MIT"
] | null | null | null | """
Scatter plot between
"""
import pandas as pd
from bokeh.io import output_notebook
output_notebook()
from bokeh.io import show, output_file
from bokeh.models import (ColumnDataSource, HoverTool, Span)
from bokeh.plotting import figure, save, output_file
def plot_vs_population(districts_budget_df):
"""
Fr... | 31.62 | 85 | 0.560826 | """
Scatter plot between
"""
import pandas as pd
import numpy as np
from numpy.random import random
from math import pi
from bokeh.io import output_notebook
output_notebook()
from bokeh.io import show, output_file
from bokeh.palettes import RdYlGn6
from bokeh.models import (
BasicTicker,
ColorBar,
LinearC... | 879 | 0 | 0 | 0 | 0 | 0 | 0 | 148 | 110 |
c175aa18424a015e81f4404dc8122dd28b20d6bf | 302 | py | Python | QISKIT/TDA/Qconfig_20_qubit.py | rsarkar-github/Quantum-Computing-Projects | 966c0465f98dca0091f09826e12eb57277faf3c0 | [
"MIT"
] | null | null | null | QISKIT/TDA/Qconfig_20_qubit.py | rsarkar-github/Quantum-Computing-Projects | 966c0465f98dca0091f09826e12eb57277faf3c0 | [
"MIT"
] | null | null | null | QISKIT/TDA/Qconfig_20_qubit.py | rsarkar-github/Quantum-Computing-Projects | 966c0465f98dca0091f09826e12eb57277faf3c0 | [
"MIT"
] | null | null | null | APItoken = 'ffb1bf6df27099919ca9ab63da88b1929016a7f7468d477f65241f61e1f457ab4' \
'f53c50ead0371ce632b283b5dc803fae33b34b3601053d2bde24f4ebc921b1b'
config = {
'url': 'https://q-console-api.mybluemix.net/api',
'hub': 'ibmq',
'group': 'qc-ware',
'project': 'default'
}
| 30.2 | 80 | 0.688742 | APItoken = 'ffb1bf6df27099919ca9ab63da88b1929016a7f7468d477f65241f61e1f457ab4' \
'f53c50ead0371ce632b283b5dc803fae33b34b3601053d2bde24f4ebc921b1b'
config = {
'url': 'https://q-console-api.mybluemix.net/api',
'hub': 'ibmq',
'group': 'qc-ware',
'project': 'default'
}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
de5c1f120fe34ee35b979c4f5b009fc460b748c4 | 1,906 | py | Python | os_faults/ansible/modules/iptables.py | Marie-Donnie/os-faults | 2f9eb760d240b9a03b7df5682b5b24cf35daacd0 | [
"Apache-2.0"
] | null | null | null | os_faults/ansible/modules/iptables.py | Marie-Donnie/os-faults | 2f9eb760d240b9a03b7df5682b5b24cf35daacd0 | [
"Apache-2.0"
] | null | null | null | os_faults/ansible/modules/iptables.py | Marie-Donnie/os-faults | 2f9eb760d240b9a03b7df5682b5b24cf35daacd0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# 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
# ... | 38.897959 | 75 | 0.629066 | #!/usr/bin/python
# 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
# ... | 0 | 0 | 0 | 0 | 0 | 1,228 | 0 | 19 | 54 |
91aa923768fc23db2b0a5d788c50eb978a3701bc | 15,766 | py | Python | python/pyspark/sql/tests/test_session.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2022-03-25T06:40:43.000Z | 2022-03-25T06:40:43.000Z | python/pyspark/sql/tests/test_session.py | nyingping/spark | ca7200b0008dc6101a252020e6c34ef7b72d81d6 | [
"Apache-2.0"
] | 6 | 2018-06-14T11:15:27.000Z | 2019-01-27T12:11:23.000Z | python/pyspark/sql/tests/test_session.py | nyingping/spark | ca7200b0008dc6101a252020e6c34ef7b72d81d6 | [
"Apache-2.0"
] | 1 | 2022-03-09T08:50:07.000Z | 2022-03-09T08:50:07.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 40.425641 | 99 | 0.639921 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 0 | 904 | 0 | 13,273 | 0 | 0 | 0 | 142 | 358 |
f10f0867880f642b6d0b6d7c51bd8255be411723 | 14,187 | py | Python | model/run_experiments.py | irenetrampoline/clustering-interval-censored | f6ab06a6cf3098ffe006d1b95d1b4f1d158b0bc4 | [
"MIT"
] | 1 | 2022-02-03T08:47:45.000Z | 2022-02-03T08:47:45.000Z | model/run_experiments.py | irenetrampoline/clustering-interval-censored | f6ab06a6cf3098ffe006d1b95d1b4f1d158b0bc4 | [
"MIT"
] | null | null | null | model/run_experiments.py | irenetrampoline/clustering-interval-censored | f6ab06a6cf3098ffe006d1b95d1b4f1d158b0bc4 | [
"MIT"
] | null | null | null | import sys
sys.path.append('../data')
sys.path.append('../plot')
if __name__=='__main__':
main() | 48.585616 | 229 | 0.584408 | import argparse
import numpy as np
import os
import sys
sys.path.append('../data')
sys.path.append('../plot')
import torch
from load import sigmoid, quadratic, chf, parkinsons, load_data_format
from data_utils import parse_data, change_missing
from plot_utils import plot_subtypes, plot_latent
from models import Subl... | 0 | 0 | 0 | 0 | 0 | 13,728 | 0 | 80 | 278 |
a53c8a2a5ad5aded053ad7c5fd27b412fc60a466 | 2,573 | py | Python | parsers/pdbparser.py | rigdenlab/conkit-web | bf50d28a73f43b9eb0e0c397ec1d0fd32547fdf1 | [
"BSD-3-Clause"
] | 1 | 2020-04-16T16:52:53.000Z | 2020-04-16T16:52:53.000Z | parsers/pdbparser.py | rigdenlab/conplot | 9b3129d9e1b7ed93da63c6fd31f9b50e63f2d4d9 | [
"BSD-3-Clause"
] | 47 | 2020-05-11T13:59:11.000Z | 2022-01-21T09:37:18.000Z | parsers/pdbparser.py | rigdenlab/conkit-web | bf50d28a73f43b9eb0e0c397ec1d0fd32547fdf1 | [
"BSD-3-Clause"
] | 5 | 2020-04-24T11:19:21.000Z | 2020-05-06T08:01:36.000Z | import itertools
VALID_AMINOACIDS = {"A", "R", "N", "D", "C", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "M", "F", "P", "O", "S", "U",
"T", "W", "Y", "V", "B", "Z", "X", "X", "J"}
def get_chain_contacts(chain):
"""Credits to Felix Simkovic; code taken from GitHub rigdenlab/conkit/conkit/io/... | 38.402985 | 119 | 0.585309 | from Bio.PDB import PDBParser as BioPDBParser
import io
import itertools
from operator import itemgetter
from utils.exceptions import InvalidFormat
VALID_AMINOACIDS = {"A", "R", "N", "D", "C", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "M", "F", "P", "O", "S", "U",
"T", "W", "Y", "V", "B", "Z", "... | 0 | 0 | 0 | 0 | 0 | 469 | 0 | 43 | 111 |
415c056f05afba92871ed1b11cf1af7a2b45bdd6 | 1,753 | py | Python | salmon/search/discogs.py | Junkbite/smoked-salmon | c7ee36dc9bba00707d8529af34b69e8c529d3615 | [
"Apache-2.0"
] | 42 | 2020-03-02T11:42:17.000Z | 2022-03-02T13:51:05.000Z | salmon/search/discogs.py | Junkbite/smoked-salmon | c7ee36dc9bba00707d8529af34b69e8c529d3615 | [
"Apache-2.0"
] | 20 | 2020-03-02T11:46:43.000Z | 2022-01-26T23:33:37.000Z | salmon/search/discogs.py | Junkbite/smoked-salmon | c7ee36dc9bba00707d8529af34b69e8c529d3615 | [
"Apache-2.0"
] | 16 | 2020-03-01T11:29:55.000Z | 2022-01-24T18:10:35.000Z | import re
SOURCES = {
"Vinyl": "Vinyl",
"File": "WEB",
"CD": "CD",
}
def sanitize_artist_name(name):
"""
Remove parenthentical number disambiguation bullshit from artist names,
as well as the asterisk stuff.
"""
name = re.sub(r" \(\d+\)$", "", name)
return re.sub(r"\*+$", "", nam... | 30.224138 | 79 | 0.553908 | import re
from salmon.search.base import IdentData, SearchMixin
from salmon.sources import DiscogsBase
SOURCES = {
"Vinyl": "Vinyl",
"File": "WEB",
"CD": "CD",
}
class Searcher(DiscogsBase, SearchMixin):
async def search_releases(self, searchstr, limit):
releases = {}
resp = await se... | 0 | 0 | 978 | 20 | 0 | 0 | 0 | 49 | 94 |
8e0d50b482773beb3ff48ba3c18ff76723f48d7c | 590 | py | Python | scripts/relay.py | MDooley47/jam-house | f67c98e2dc3edd32fa26f7f95df03a27b5e0b3ff | [
"Apache-2.0"
] | null | null | null | scripts/relay.py | MDooley47/jam-house | f67c98e2dc3edd32fa26f7f95df03a27b5e0b3ff | [
"Apache-2.0"
] | null | null | null | scripts/relay.py | MDooley47/jam-house | f67c98e2dc3edd32fa26f7f95df03a27b5e0b3ff | [
"Apache-2.0"
] | null | null | null | import RPi.GPIO as GPIO
| 16.857143 | 37 | 0.625424 | import RPi.GPIO as GPIO
class Relay:
def __init__(self, pin):
self.pin = int(pin)
GPIO.setup(self.pin, GPIO.OUT)
def close(self):
GPIO.output(self.pin, GPIO.LOW)
return
def open(self):
GPIO.output(self.pin, GPIO.HIGH)
return
def status(self):
return bool(GPIO.input(self.pin))
... | 0 | 0 | 0 | 543 | 0 | 0 | 0 | 0 | 23 |
d4a0efc7601cb3d5e6ec66f5f5af3b78a9158768 | 1,309 | py | Python | threaded_messages/listeners.py | MattBlack85/django-threaded-messages | da86dea6dd854f9ab37201d3953f9d028faa85e9 | [
"MIT"
] | null | null | null | threaded_messages/listeners.py | MattBlack85/django-threaded-messages | da86dea6dd854f9ab37201d3953f9d028faa85e9 | [
"MIT"
] | null | null | null | threaded_messages/listeners.py | MattBlack85/django-threaded-messages | da86dea6dd854f9ab37201d3953f9d028faa85e9 | [
"MIT"
] | 1 | 2021-01-06T14:41:13.000Z | 2021-01-06T14:41:13.000Z | import logging
from . import settings as sendgrid_settings
logger = logging.getLogger('threaded_messages')
if sendgrid_settings.THREADED_MESSAGES_USE_SENDGRID:
from sendgrid_parse_api.signals import email_received
else:
email_received = None
| 30.44186 | 98 | 0.663102 | import logging
from django.utils.html import strip_tags
from . import settings as sendgrid_settings
from .signals import message_composed
logger = logging.getLogger('threaded_messages')
if sendgrid_settings.THREADED_MESSAGES_USE_SENDGRID:
from sendgrid_parse_api.signals import email_received
else:
email_rec... | 0 | 0 | 0 | 0 | 0 | 928 | 0 | 35 | 91 |
4e5e61e419f37f8dd598086847f0c15a320b4ff7 | 15,814 | py | Python | fzutils/free_api_utils.py | superonesfazai/fzutils | a8aafaacd94af0001af2ab139f0aa8cbcb8b5eda | [
"MIT"
] | 11 | 2018-08-04T08:14:27.000Z | 2021-09-03T09:00:33.000Z | fzutils/free_api_utils.py | superonesfazai/fzutils | a8aafaacd94af0001af2ab139f0aa8cbcb8b5eda | [
"MIT"
] | null | null | null | fzutils/free_api_utils.py | superonesfazai/fzutils | a8aafaacd94af0001af2ab139f0aa8cbcb8b5eda | [
"MIT"
] | 8 | 2018-08-04T08:16:17.000Z | 2019-05-05T09:17:35.000Z | # coding:utf-8
'''
@author = super_fazai
@File : free_api_utils.py
@connect : superonesfazai@gmail.com
'''
"""
api
"""
import re
# from fzutils.ip_pools import tri_ip_pool
# from fzutils.spider.fz_requests import Requests
# from fzutils.common_utils import json_2_dict
# from fzutils.internet_utils import (
# ... | 33.014614 | 139 | 0.496775 | # coding:utf-8
'''
@author = super_fazai
@File : free_api_utils.py
@connect : superonesfazai@gmail.com
'''
"""
一些免费api 接口的封装
"""
from pprint import pprint
import re
# from fzutils.ip_pools import tri_ip_pool
# from fzutils.spider.fz_requests import Requests
# from fzutils.common_utils import json_2_dict
# from f... | 1,806 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 23 |
b24c57ae9801978655a2dd8c90c7f52a6c81983c | 377 | py | Python | tests/test_axpy_weather.py | AxxAxx/axpy_weather | 2714397968b55b63b784ce08a2df0ade08aa2008 | [
"MIT"
] | null | null | null | tests/test_axpy_weather.py | AxxAxx/axpy_weather | 2714397968b55b63b784ce08a2df0ade08aa2008 | [
"MIT"
] | null | null | null | tests/test_axpy_weather.py | AxxAxx/axpy_weather | 2714397968b55b63b784ce08a2df0ade08aa2008 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_axpy_weather
----------------------------------
Tests for `axpy_weather` module.
"""
| 13 | 42 | 0.599469 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_axpy_weather
----------------------------------
Tests for `axpy_weather` module.
"""
import sys
import unittest
from axpy_weather import axpy_weather
class TestAxpy_weather(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
... | 0 | 0 | 0 | 142 | 0 | 0 | 0 | -1 | 91 |
dad37465db8abb220a6642fa8e0c3fe096021b1a | 446 | py | Python | setup.py | GeorgianaElena/jupyterhub-configurator | f356175732d487c520415b84368b3368397d8b60 | [
"BSD-3-Clause"
] | null | null | null | setup.py | GeorgianaElena/jupyterhub-configurator | f356175732d487c520415b84368b3368397d8b60 | [
"BSD-3-Clause"
] | null | null | null | setup.py | GeorgianaElena/jupyterhub-configurator | f356175732d487c520415b84368b3368397d8b60 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="jupyterhub-configurator",
version="1.0",
packages=find_packages(),
license="3-BSD",
author="yuvipanda",
author_email="yuvipanda@gmail.com",
install_requires=["tornado", "aiohttp", "jupyterhub", "deepmerge", "pluggy"],
include_pack... | 27.875 | 82 | 0.686099 | from setuptools import setup, find_packages
setup(
name="jupyterhub-configurator",
version="1.0",
packages=find_packages(),
license="3-BSD",
author="yuvipanda",
author_email="yuvipanda@gmail.com",
install_requires=["tornado", "aiohttp", "jupyterhub", "deepmerge", "pluggy"],
include_pack... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
85bc4000ac9a7feae9aa1e58301dae7af7b354a8 | 2,767 | py | Python | src/austin_heller_repo/component_manager.py | AustinHellerRepo/ComponentManager | bd347d87cb0c19acf07419ba8e8c30d4fa6f6027 | [
"MIT"
] | null | null | null | src/austin_heller_repo/component_manager.py | AustinHellerRepo/ComponentManager | bd347d87cb0c19acf07419ba8e8c30d4fa6f6027 | [
"MIT"
] | null | null | null | src/austin_heller_repo/component_manager.py | AustinHellerRepo/ComponentManager | bd347d87cb0c19acf07419ba8e8c30d4fa6f6027 | [
"MIT"
] | null | null | null | from __future__ import annotations
try:
import urequests as requests
except ImportError:
try:
import ujson as json
except ImportError:
| 28.234694 | 152 | 0.729671 | from __future__ import annotations
from typing import List, Tuple, Dict
try:
import urequests as requests
except ImportError:
import requests
try:
import ujson as json
except ImportError:
import json
class MethodTypeEnum():
Get = 0
Post = 1
class ApiInterface():
def __init__(self, *, api_base_url: str):
... | 0 | 0 | 0 | 2,489 | 0 | 0 | 0 | -1 | 137 |
067659e95365ddba0dd9591d5eb66a3a527b4438 | 100 | py | Python | python/hackerrank/conditional code/which one is greater/task.py | 3keepmovingforward3/ENGR1102 | b4f38a70560fc695d70706279047b1dec9f5c7f4 | [
"MIT"
] | null | null | null | python/hackerrank/conditional code/which one is greater/task.py | 3keepmovingforward3/ENGR1102 | b4f38a70560fc695d70706279047b1dec9f5c7f4 | [
"MIT"
] | null | null | null | python/hackerrank/conditional code/which one is greater/task.py | 3keepmovingforward3/ENGR1102 | b4f38a70560fc695d70706279047b1dec9f5c7f4 | [
"MIT"
] | null | null | null |
# Start your code below (tip: Make sure to indent your code)
| 20 | 64 | 0.71 |
def greater_if_else(num1, num2):
# Start your code below (tip: Make sure to indent your code)
| 0 | 0 | 0 | 0 | 0 | 11 | 0 | 0 | 23 |
ca8820199ef0c7948e24a842fd58013d23375baa | 2,451 | py | Python | pmst/tests/test_component.py | talonchandler/pmst | c7d4d00a9a377726f8996cb416970037af92c40a | [
"MIT"
] | null | null | null | pmst/tests/test_component.py | talonchandler/pmst | c7d4d00a9a377726f8996cb416970037af92c40a | [
"MIT"
] | null | null | null | pmst/tests/test_component.py | talonchandler/pmst | c7d4d00a9a377726f8996cb416970037af92c40a | [
"MIT"
] | null | null | null | import sys
sys.path.append("../../")
# Plane source converges
| 35.014286 | 95 | 0.571195 | import sys
sys.path.append("../../")
from unittest import TestCase
from pmst.geometry import Point, Ray
from pmst.component import Lens
from pmst.microscope import Microscope
import pmst.source
import numpy as np
class TestPixel(TestCase):
def setUp(self):
origin = np.array((0, 0, 0))
normal = ... | 0 | 0 | 0 | 2,131 | 0 | 0 | 0 | 44 | 202 |
19c0a3b65b67a59f869878709be52202016b86ff | 3,021 | py | Python | src/bmeg/utils.py | bmeg/bmeg-etl | 3efa28a7775d6defd77457838e92817a2fbc9e99 | [
"MIT"
] | 1 | 2022-03-08T22:06:35.000Z | 2022-03-08T22:06:35.000Z | src/bmeg/utils.py | bmeg/bmeg-etl | 3efa28a7775d6defd77457838e92817a2fbc9e99 | [
"MIT"
] | 191 | 2018-07-09T20:49:34.000Z | 2021-02-09T18:44:28.000Z | src/bmeg/utils.py | bmeg/bmeg-etl | 3efa28a7775d6defd77457838e92817a2fbc9e99 | [
"MIT"
] | null | null | null | import inspect
def enforce_types(callable):
"""
From:
https://stackoverflow.com/questions/50563546/validating-detailed-types-in-python-dataclasses
"""
spec = inspect.getfullargspec(callable)
if inspect.isclass(callable):
callable.__init__ = decorate(callable.__init__)
return ... | 27.216216 | 96 | 0.586892 | import os
import inspect
import typing
import threading
from contextlib import suppress
from functools import wraps
def ensure_directory(*args):
path = os.path.join(*args)
if os.path.isfile(path):
raise Exception(
"Emitter output directory %s is a regular file", path)
if not os.path.e... | 6 | 111 | 0 | 0 | 0 | 2,178 | 0 | -9 | 371 |
aadac3c14b4d6bf52fd38741ccf5cbd8ff170fdc | 5,352 | py | Python | check_mariadb_slaves.py | flickerfly/check_mariadb_slaves | b9917c5a097a9806d19caee83c5644afab924366 | [
"MIT"
] | null | null | null | check_mariadb_slaves.py | flickerfly/check_mariadb_slaves | b9917c5a097a9806d19caee83c5644afab924366 | [
"MIT"
] | null | null | null | check_mariadb_slaves.py | flickerfly/check_mariadb_slaves | b9917c5a097a9806d19caee83c5644afab924366 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""MariaDB slave status checker"""
import sys
import argparse
def main(args=None):
"""starter method"""
if args is None:
args = sys.argv[1:]
parser = argparse.ArgumentParser(description='MariaDB slave status checker')
parser.add_argument('--hostname', default='localhos... | 33.873418 | 80 | 0.596599 | #!/usr/bin/env python
"""MariaDB slave status checker"""
import sys
import argparse
import MySQLdb
class NagiosPlugin(object):
"""Nagios Plugin base class"""
def __init__(self, warning, critical, *args, **kwargs):
self.warning = warning
self.critical = critical
def run_check(self):
... | 0 | 0 | 0 | 3,776 | 0 | 0 | 0 | -7 | 68 |
10099580e70302fbeaf41e9a358a3baf413b5d47 | 6,025 | py | Python | src/prg_state_ctrl.py | ccarr66/handwriting_gui | c5d8a8925ee37d874ee794a241e50974a7b9d921 | [
"MIT"
] | null | null | null | src/prg_state_ctrl.py | ccarr66/handwriting_gui | c5d8a8925ee37d874ee794a241e50974a7b9d921 | [
"MIT"
] | null | null | null | src/prg_state_ctrl.py | ccarr66/handwriting_gui | c5d8a8925ee37d874ee794a241e50974a7b9d921 | [
"MIT"
] | 1 | 2020-11-17T21:31:55.000Z | 2020-11-17T21:31:55.000Z | try:
import PIL.Image
except ModuleNotFoundError:
print('Required libraries not found, please install PIL')
if __name__ == "__main__":
raise Exception('Cannot be called as main script')
debug = True
#******************************************** Program state independent logic
filepathS... | 33.848315 | 137 | 0.601494 | import sys, os, platform
import ocr_image_analyzer as OCR
try:
import PIL.Image
import PIL.ImageTk
except ModuleNotFoundError:
print('Required libraries not found, please install PIL')
if __name__ == "__main__":
raise Exception('Cannot be called as main script')
debug = True
#***********... | 0 | 0 | 0 | 4,729 | 0 | 686 | 0 | 11 | 148 |
54692a530049e8154ae7b77f87421496fbec60bd | 1,013 | py | Python | 02_assignment/toolbox/Toolbox_Python02450/Scripts/ex10_2_1.py | LukaAvbreht/ML_projects | 8b36acdeb017ce8a57959c609b96111968852d5f | [
"MIT"
] | null | null | null | 02_assignment/toolbox/Toolbox_Python02450/Scripts/ex10_2_1.py | LukaAvbreht/ML_projects | 8b36acdeb017ce8a57959c609b96111968852d5f | [
"MIT"
] | null | null | null | 02_assignment/toolbox/Toolbox_Python02450/Scripts/ex10_2_1.py | LukaAvbreht/ML_projects | 8b36acdeb017ce8a57959c609b96111968852d5f | [
"MIT"
] | null | null | null | # exercise 10.2.1
from matplotlib.pyplot import figure, show
from scipy.io import loadmat
from toolbox_02450 import clusterplot
from scipy.cluster.hierarchy import linkage, fcluster, dendrogram
# Load Matlab data file and extract variables of interest
mat_data = loadmat('../Data/synth1.mat')
X = mat_data['X']
y = mat_... | 28.138889 | 75 | 0.755183 | # exercise 10.2.1
from matplotlib.pyplot import figure, show
from scipy.io import loadmat
from toolbox_02450 import clusterplot
from scipy.cluster.hierarchy import linkage, fcluster, dendrogram
# Load Matlab data file and extract variables of interest
mat_data = loadmat('../Data/synth1.mat')
X = mat_data['X']
y = mat_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
67bd1f4cc17ab520aed02257323fdafae66bc88e | 2,002 | py | Python | modules/network/PrefabGateOne.py | Jumpscale/rsal9 | e7ff7638ca53dafe872ce3030a379e8b65cb4831 | [
"Apache-2.0"
] | 1 | 2017-06-07T08:11:57.000Z | 2017-06-07T08:11:57.000Z | modules/network/PrefabGateOne.py | Jumpscale/rsal9 | e7ff7638ca53dafe872ce3030a379e8b65cb4831 | [
"Apache-2.0"
] | 106 | 2017-05-10T18:16:31.000Z | 2019-09-18T15:09:07.000Z | modules/network/PrefabGateOne.py | Jumpscale/rsal9 | e7ff7638ca53dafe872ce3030a379e8b65cb4831 | [
"Apache-2.0"
] | 5 | 2018-01-26T16:11:52.000Z | 2018-08-22T15:12:52.000Z | from js9 import j
app = j.tools.prefab._getBaseAppClass()
| 26 | 131 | 0.584915 | from js9 import j
app = j.tools.prefab._getBaseAppClass()
class PrefabGateOne(app):
NAME = "gateone"
def build(self, reset=False):
"""
Build Gateone
:param reset: reset build if already built before
:return:
"""
if self.doneCheck("build", reset):
r... | 0 | 0 | 0 | 1,919 | 0 | 0 | 0 | 0 | 23 |
d6055403ada75fdb58112230e49db04f73faeaa8 | 7,213 | py | Python | scripts/slave/recipe_modules/skia/resources/trigger_wait_ct_task.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipe_modules/skia/resources/trigger_wait_ct_task.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipe_modules/skia/resources/trigger_wait_ct_task.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T11:05:06.000Z | 2020-07-23T11:05:06.000Z | #!/usr/bin/env python
# Copyright (c) 2015 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.
"""Python utility that triggers and waits for tasks to complete on CTFE."""
import base64
import hashlib
import json
import math
i... | 33.087156 | 80 | 0.674338 | #!/usr/bin/env python
# Copyright (c) 2015 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.
"""Python utility that triggers and waits for tasks to complete on CTFE."""
import base64
import hashlib
import json
import math
i... | 0 | 152 | 0 | 21 | 0 | 2,509 | 0 | 0 | 116 |