hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
91c4421633a0ddab2d35d03049dc7a5c7c016161 | 503 | py | Python | Algorithm - BOJ/Greedy/9009.py | kangjunseo/C- | eafdf57a22b3a794d09cab045d6d60c2842ba347 | [
"MIT"
] | 2 | 2021-08-30T12:37:57.000Z | 2021-11-29T05:42:05.000Z | Algorithm - BOJ/Greedy/9009.py | kangjunseo/C- | eafdf57a22b3a794d09cab045d6d60c2842ba347 | [
"MIT"
] | null | null | null | Algorithm - BOJ/Greedy/9009.py | kangjunseo/C- | eafdf57a22b3a794d09cab045d6d60c2842ba347 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
T = int(input())
fb = [0 for _ in range(50)]
fb[0], fb[1] = 1,1
for i in range(2,50): fb[i] = fb[i-1]+fb[i-2]
for _ in range(T):
N = int(input())
L = []
while N:
for i in range(50):
if fb[i]>N:
L.append(fb[i-1])
N-=... | 20.958333 | 45 | 0.409543 | import sys
input = sys.stdin.readline
T = int(input())
fb = [0 for _ in range(50)]
fb[0], fb[1] = 1,1
for i in range(2,50): fb[i] = fb[i-1]+fb[i-2]
for _ in range(T):
N = int(input())
L = []
while N:
for i in range(50):
if fb[i]>N:
L.append(fb[i-1])
N-=... | 0 | 0 | 0 |
b293cc0e890762ffd29d2a3f9b67a7d12e79d9a6 | 2,335 | py | Python | pyxel/packager.py | JUNE-9653/pyxel | 2d0c828757ea0183cfca526f78d0d72ae4b76753 | [
"MIT"
] | 1 | 2019-08-19T11:43:12.000Z | 2019-08-19T11:43:12.000Z | pyxel/packager.py | JUNE-9653/pyxel | 2d0c828757ea0183cfca526f78d0d72ae4b76753 | [
"MIT"
] | null | null | null | pyxel/packager.py | JUNE-9653/pyxel | 2d0c828757ea0183cfca526f78d0d72ae4b76753 | [
"MIT"
] | null | null | null | import glob
import os
import platform
import shutil
import sys
import pyxel
if __name__ == "__main__":
run()
| 26.83908 | 76 | 0.572591 | import glob
import os
import platform
import shutil
import sys
import pyxel
def run():
arg = sys.argv[1] if len(sys.argv) >= 2 else ""
name = ""
if not arg or arg.startswith("-"):
if arg == "-v" or arg == "--version":
print("Pyxel Packager {}".format(pyxel.VERSION))
retur... | 2,171 | 0 | 46 |
199b885044f89ef22f190b6b05b9d8c2d2de93a1 | 618 | py | Python | api/projeto/model/model.py | ldynczuki/iris-model-api | 0519f5d3d8158f7560326219bd2263a234ad0cbe | [
"MIT"
] | null | null | null | api/projeto/model/model.py | ldynczuki/iris-model-api | 0519f5d3d8158f7560326219bd2263a234ad0cbe | [
"MIT"
] | null | null | null | api/projeto/model/model.py | ldynczuki/iris-model-api | 0519f5d3d8158f7560326219bd2263a234ad0cbe | [
"MIT"
] | null | null | null | import pickle
import numpy as np
from projeto.settings import WEIGHTS_PATH
from loguru import logger
| 25.75 | 80 | 0.62945 | import pickle
import numpy as np
from projeto.settings import WEIGHTS_PATH
from loguru import logger
class Classificador():
def __init__(self):
self.model = pickle.load(open(WEIGHTS_PATH, 'rb'))
logger.debug(self.model)
def get_predict(self, sepal_length, sepal_width, petal_length,... | 100 | 396 | 23 |
3183e10ae3187fd9fc4435ab27745eddc0c1ddac | 8,584 | py | Python | falcon_heavy/core/types/primitive.py | NotJustAToy/falcon-heavy | 2e96f649daafc2707a01e38f403f1ce4268f4629 | [
"Apache-2.0"
] | 21 | 2020-01-02T10:44:42.000Z | 2022-02-11T14:27:05.000Z | falcon_heavy/core/types/primitive.py | NotJustAToy/falcon-heavy | 2e96f649daafc2707a01e38f403f1ce4268f4629 | [
"Apache-2.0"
] | 2 | 2020-02-13T21:06:56.000Z | 2020-09-27T16:47:25.000Z | falcon_heavy/core/types/primitive.py | NotJustAToy/falcon-heavy | 2e96f649daafc2707a01e38f403f1ce4268f4629 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2020 Not Just A Toy Corp.
#
# 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... | 32.270677 | 112 | 0.632339 | # Copyright 2019-2020 Not Just A Toy Corp.
#
# 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... | 4,553 | 0 | 324 |
5315b05e1aaa46313b3adc7b163dea8a2e872737 | 280 | py | Python | dashboard/modules/test/test_utils.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 21,382 | 2016-09-26T23:12:52.000Z | 2022-03-31T21:47:45.000Z | dashboard/modules/test/test_utils.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 19,689 | 2016-09-17T08:21:25.000Z | 2022-03-31T23:59:30.000Z | dashboard/modules/test/test_utils.py | firebolt55439/ray | 215300b070628c06f0106906fc6c03bd70ebf140 | [
"Apache-2.0"
] | 4,114 | 2016-09-23T18:54:01.000Z | 2022-03-31T15:07:32.000Z | import logging
import async_timeout
logger = logging.getLogger(__name__)
| 23.333333 | 58 | 0.746429 | import logging
import async_timeout
logger = logging.getLogger(__name__)
async def http_get(http_session, url, timeout_seconds=60):
with async_timeout.timeout(timeout_seconds):
async with http_session.get(url) as response:
return await response.json()
| 181 | 0 | 23 |
8148a4a8c9845dde838c0081397b352d71916831 | 350 | py | Python | portal/migrations/versions/1e09e871fb65_.py | uwcirg/true_nth_usa_portal | e2434731aed86f1c43f15d428dde8ffc28ac7e5f | [
"BSD-3-Clause"
] | 3 | 2017-01-15T10:11:57.000Z | 2018-10-02T23:46:44.000Z | portal/migrations/versions/1e09e871fb65_.py | uwcirg/true_nth_usa_portal | e2434731aed86f1c43f15d428dde8ffc28ac7e5f | [
"BSD-3-Clause"
] | 876 | 2016-04-04T20:45:11.000Z | 2019-02-28T00:10:36.000Z | portal/migrations/versions/1e09e871fb65_.py | uwcirg/truenth-portal | 459a0d157982f010175c50b9cccd860a61790370 | [
"BSD-3-Clause"
] | 9 | 2016-04-13T01:18:55.000Z | 2018-09-19T20:44:23.000Z | from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: 1e09e871fb65
Revises: ('0b4e7a8a7e64', '0701782c564d')
Create Date: 2019-03-28 23:08:21.960495
"""
# revision identifiers, used by Alembic.
revision = '1e09e871fb65'
down_revision = ('0b4e7a8a7e64', '0701782c564d')
| 15.217391 | 48 | 0.722857 | from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: 1e09e871fb65
Revises: ('0b4e7a8a7e64', '0701782c564d')
Create Date: 2019-03-28 23:08:21.960495
"""
# revision identifiers, used by Alembic.
revision = '1e09e871fb65'
down_revision = ('0b4e7a8a7e64', '0701782c564d')
def upgrade():
pas... | 6 | 0 | 46 |
24194b04dfeaa229134fca286dd617aacde90e9a | 2,915 | py | Python | student_gp/toxic_comment.py | IMsumitkumar/CommOn-Developers-Community | d15d4c0f725adbf1a7bcbbd7156d3edab3f4e740 | [
"MIT"
] | 1 | 2020-11-04T12:55:59.000Z | 2020-11-04T12:55:59.000Z | student_gp/toxic_comment.py | IMsumitkumar/CommOn-Developers-Community | d15d4c0f725adbf1a7bcbbd7156d3edab3f4e740 | [
"MIT"
] | null | null | null | student_gp/toxic_comment.py | IMsumitkumar/CommOn-Developers-Community | d15d4c0f725adbf1a7bcbbd7156d3edab3f4e740 | [
"MIT"
] | null | null | null | import os
import pickle
from asgiref.sync import sync_to_async
@sync_to_async
| 30.051546 | 81 | 0.677873 | import os
import pickle
from asgiref.sync import sync_to_async
@sync_to_async
def toxic_classifier(data):
data = [data]
modulePath = os.path.dirname(__file__)
toxic_vect = os.path.join(modulePath, 'pkl/toxic_vect.pkl')
toxic_model = os.path.join(modulePath, 'pkl/toxic_model.pkl')
severe_toxic_ve... | 2,814 | 0 | 22 |
31980498cb54b923b287a4a673e24a9c06cf51b9 | 2,751 | py | Python | owcsimpy/geoobjects/bases/paramline_py.py | ardimasp/owcsimpy | 155b0f26dd5e247cef9a84265256b0d70ba0b139 | [
"MIT"
] | null | null | null | owcsimpy/geoobjects/bases/paramline_py.py | ardimasp/owcsimpy | 155b0f26dd5e247cef9a84265256b0d70ba0b139 | [
"MIT"
] | null | null | null | owcsimpy/geoobjects/bases/paramline_py.py | ardimasp/owcsimpy | 155b0f26dd5e247cef9a84265256b0d70ba0b139 | [
"MIT"
] | null | null | null | import numpy as np
class ParamLine_py(object):
""" A 3D parametric line.
Parameters
----------
P0: ndarray(3,)
A tail point.
P1: ndarray(3,)
A head point.
Attributes
----------
P0
P1
u: ndarray(3,)
Show the direction of the parametric line
Example... | 22.735537 | 83 | 0.48964 | import numpy as np
class ParamLine_py(object):
""" A 3D parametric line.
Parameters
----------
P0: ndarray(3,)
A tail point.
P1: ndarray(3,)
A head point.
Attributes
----------
P0
P1
u: ndarray(3,)
Show the direction of the parametric line
Example... | 114 | 0 | 27 |
47d37e709d0ad25a0178922ce88835efb815d534 | 208 | py | Python | tests/classes/cellphone_name.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | 50 | 2021-08-18T08:08:04.000Z | 2022-03-20T07:23:26.000Z | tests/classes/cellphone_name.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | 1 | 2021-11-23T02:12:29.000Z | 2021-11-23T13:35:26.000Z | tests/classes/cellphone_name.py | Jesse-Yung/jsonclasses | d40c52aec42bcb978a80ceb98b93ab38134dc790 | [
"MIT"
] | 8 | 2021-07-01T02:39:15.000Z | 2021-12-10T02:20:18.000Z | from __future__ import annotations
from jsonclasses import jsonclass, types
@jsonclass
| 20.8 | 50 | 0.793269 | from __future__ import annotations
from jsonclasses import jsonclass, types
@jsonclass
class CellphoneName:
cellphone_name: str = types.str.tocap.required
cellphone_title: str = types.str.required
| 0 | 96 | 22 |
1f9ac96adf2671f27d6dc3e241d464406259f49c | 825 | py | Python | democelery/network/signals.py | alexdzul/democelery | 4627d155ccc3a6daf21ec4e4b8d554891446288d | [
"MIT"
] | 1 | 2021-12-02T05:29:37.000Z | 2021-12-02T05:29:37.000Z | democelery/network/signals.py | alexdzul/democelery | 4627d155ccc3a6daf21ec4e4b8d554891446288d | [
"MIT"
] | null | null | null | democelery/network/signals.py | alexdzul/democelery | 4627d155ccc3a6daf21ec4e4b8d554891446288d | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.db.models.signals import pre_save, post_save, post_delete
from django.dispatch import receiver
from .models import Post, Subscriber
from .functions import notify_new_content, notify_new_subscriber
@receiver(post_save, sender=Post)
def send_mail_to_subscriber(sen... | 30.555556 | 69 | 0.724848 | from django.contrib.auth.models import User
from django.db.models.signals import pre_save, post_save, post_delete
from django.dispatch import receiver
from .models import Post, Subscriber
from .functions import notify_new_content, notify_new_subscriber
@receiver(post_save, sender=Post)
def send_mail_to_subscriber(sen... | 0 | 0 | 0 |
aa678430fa7a985978185bacff538e9309826d62 | 217 | py | Python | web/sso/admin.py | kisawebkaist/kisaweb | 05883d4d81394d5055137f24a8a46d7c90191101 | [
"MIT"
] | 2 | 2020-11-06T10:32:52.000Z | 2021-11-05T06:56:08.000Z | web/sso/admin.py | zero-or-one/kisaweb | d88eca63b50fd2593a7d1aa23916a80437e84925 | [
"MIT"
] | 29 | 2020-10-09T18:29:11.000Z | 2022-03-12T14:23:36.000Z | web/sso/admin.py | kisawebkaist/kisaweb | 05883d4d81394d5055137f24a8a46d7c90191101 | [
"MIT"
] | 11 | 2020-10-26T03:59:47.000Z | 2021-10-04T07:03:44.000Z | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, Agreement
# Register your models here.
admin.site.register(User, UserAdmin)
admin.site.register(Agreement)
| 21.7 | 47 | 0.81106 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, Agreement
# Register your models here.
admin.site.register(User, UserAdmin)
admin.site.register(Agreement)
| 0 | 0 | 0 |
a342471396fe69a5d48b3288fe510c7425f390c9 | 2,415 | py | Python | lifoid/www/api/webhook.py | romaryd/lifoid | f0c96d2c58cc7980ef7a3747251928f6da9015f5 | [
"Apache-2.0"
] | 1 | 2018-06-27T07:04:24.000Z | 2018-06-27T07:04:24.000Z | lifoid/www/api/webhook.py | LifoidLabs/lifoid | f0c96d2c58cc7980ef7a3747251928f6da9015f5 | [
"Apache-2.0"
] | 5 | 2018-05-23T07:06:45.000Z | 2018-10-09T20:08:29.000Z | lifoid/www/api/webhook.py | LifoidLabs/lifoid | f0c96d2c58cc7980ef7a3747251928f6da9015f5 | [
"Apache-2.0"
] | 1 | 2019-03-25T17:34:28.000Z | 2019-03-25T17:34:28.000Z | import sys
import os
import json
import traceback
import importlib
from flask import request, make_response, Blueprint, abort
from lifoid.config import settings
from lifoid.logging.mixin import ServiceLogger
from lifoid.constants import E_GET, E_POST
from lifoid.events import process_event
from lifoid.exceptions import... | 36.044776 | 75 | 0.654658 | import sys
import os
import json
import traceback
import importlib
from flask import request, make_response, Blueprint, abort
from lifoid.config import settings
from lifoid.logging.mixin import ServiceLogger
from lifoid.constants import E_GET, E_POST
from lifoid.events import process_event
from lifoid.exceptions import... | 0 | 0 | 0 |
6bae8be3122dbc23198d933ed6ee8ad05824b27f | 118 | py | Python | service_account_auth/__init__.py | Wilduck/gclient-service-account-auth | 26e23a13b33546ff87df92fea387c680fab75e10 | [
"MIT"
] | 3 | 2015-02-11T08:52:35.000Z | 2020-03-08T06:07:39.000Z | service_account_auth/__init__.py | Wilduck/gclient-service-account-auth | 26e23a13b33546ff87df92fea387c680fab75e10 | [
"MIT"
] | 4 | 2015-01-23T02:33:39.000Z | 2016-03-14T20:52:46.000Z | service_account_auth/__init__.py | Wilduck/gclient-service-account-auth | 26e23a13b33546ff87df92fea387c680fab75e10 | [
"MIT"
] | 5 | 2015-02-11T08:52:44.000Z | 2018-03-05T00:50:57.000Z | # flake8: noqa
from .version import __version__
from .authorized_service import AuthorizedService, get_email_and_key
| 23.6 | 68 | 0.847458 | # flake8: noqa
from .version import __version__
from .authorized_service import AuthorizedService, get_email_and_key
| 0 | 0 | 0 |
e7e8c447861dcbf1adf101ce010eed6eb350f9c8 | 4,272 | py | Python | npc/character/tags/tag_container.py | Arent128/npc | c8a1e227a1d4d7c540c4f4427b611ffc290535ee | [
"MIT"
] | 13 | 2016-02-23T08:15:22.000Z | 2021-07-17T20:54:57.000Z | npc/character/tags/tag_container.py | Arent128/npc | c8a1e227a1d4d7c540c4f4427b611ffc290535ee | [
"MIT"
] | 1 | 2017-03-30T08:11:40.000Z | 2017-09-07T15:01:08.000Z | npc/character/tags/tag_container.py | Arent128/npc | c8a1e227a1d4d7c540c4f4427b611ffc290535ee | [
"MIT"
] | 1 | 2020-02-21T09:44:40.000Z | 2020-02-21T09:44:40.000Z | from collections import UserDict
from copy import copy
from . import *
class TagContainer(UserDict):
"""
Manages a coherent group of tags
Instances are callable. That syntax is the preferred way to get a tag, since
it will always return a tag object. Accessing an undeclared tag in this way
will r... | 26.04878 | 90 | 0.562734 | from collections import UserDict
from copy import copy
from . import *
class TagContainer(UserDict):
"""
Manages a coherent group of tags
Instances are callable. That syntax is the preferred way to get a tag, since
it will always return a tag object. Accessing an undeclared tag in this way
will r... | 0 | 0 | 0 |
889649b4ec4b2639ffc6d441632f708612e41430 | 6,096 | py | Python | ingv/get-ingv-data.py | danja/elfquake | 0c42a32ccc1d7008febf120eabe666fbdccff781 | [
"Apache-2.0"
] | 2 | 2019-04-24T01:57:04.000Z | 2020-05-26T22:28:55.000Z | ingv/get-ingv-data.py | danja/elfquake | 0c42a32ccc1d7008febf120eabe666fbdccff781 | [
"Apache-2.0"
] | null | null | null | ingv/get-ingv-data.py | danja/elfquake | 0c42a32ccc1d7008febf120eabe666fbdccff781 | [
"Apache-2.0"
] | null | null | null | #
# apologies for the camelCase - the previous version was in JS
import dateutil.parser
import datetime
from datetime import date, time
from time import sleep
import http.client
import xml.etree.ElementTree as ET
## ''Aquila 6 April 2009 > 5 mag
# 42.3476°N 13.3800°ECoordinates: 42.3476°N 13.3800°E[... | 39.329032 | 138 | 0.598753 | #
# apologies for the camelCase - the previous version was in JS
import dateutil.parser
import datetime
from datetime import date, time
from time import sleep
import http.client
import xml.etree.ElementTree as ET
## ''Aquila 6 April 2009 > 5 mag
# 42.3476°N 13.3800°ECoordinates: 42.3476°N 13.3800°E[... | 5,285 | -8 | 156 |
1bdd22b9e8687c784908307d90517dd91dd44dff | 23,507 | py | Python | test_model.py | IulianEmilTampu/OCT_SPLIT_PROPERLY_YOUR_DATA | 40708f54c2502b85b2acbfec35a7bcff5f031c92 | [
"MIT"
] | null | null | null | test_model.py | IulianEmilTampu/OCT_SPLIT_PROPERLY_YOUR_DATA | 40708f54c2502b85b2acbfec35a7bcff5f031c92 | [
"MIT"
] | null | null | null | test_model.py | IulianEmilTampu/OCT_SPLIT_PROPERLY_YOUR_DATA | 40708f54c2502b85b2acbfec35a7bcff5f031c92 | [
"MIT"
] | null | null | null | '''
Script that tests a trained models on its training dataset. It does the same
testing routine as the one in the overall utilities_models_tf.py script.
It saves
¤ the information about the test for easy later plotting
¤ ROC (per-class and overall using micro and macro average)
¤ PP curve (per-class and overall using ... | 40.599309 | 174 | 0.691836 | '''
Script that tests a trained models on its training dataset. It does the same
testing routine as the one in the overall utilities_models_tf.py script.
It saves
¤ the information about the test for easy later plotting
¤ ROC (per-class and overall using micro and macro average)
¤ PP curve (per-class and overall using ... | 0 | 0 | 0 |
82f29cec15ebbe4486ef10820f6f24ee0639831a | 300 | py | Python | yunionclient/api/cloudpermissions.py | yunionyun/python_yunionsdk | 40a567b80f6fb3ebc72d8cc6313b334a201b2f00 | [
"Apache-2.0"
] | 3 | 2021-09-22T11:34:08.000Z | 2022-03-13T04:55:17.000Z | yunionclient/api/cloudpermissions.py | yunionyun/python_yunionsdk | 40a567b80f6fb3ebc72d8cc6313b334a201b2f00 | [
"Apache-2.0"
] | 13 | 2019-06-06T08:25:41.000Z | 2021-07-16T07:26:10.000Z | yunionclient/api/cloudpermissions.py | yunionyun/python_yunionsdk | 40a567b80f6fb3ebc72d8cc6313b334a201b2f00 | [
"Apache-2.0"
] | 7 | 2019-03-31T05:43:36.000Z | 2021-03-04T09:59:05.000Z | from yunionclient.common import base
| 23.076923 | 53 | 0.753333 | from yunionclient.common import base
class Cloudpermission(base.ResourceBase):
pass
class CloudpermissionManager(base.StandaloneManager):
resource_class = Cloudpermission
keyword = 'cloudpermission'
keyword_plural = 'cloudpermissions'
_columns = ["Id", "Name", "Description"]
| 0 | 215 | 46 |
38fd0d779b303c1216b7bddcf77f090e5523b5f4 | 3,399 | py | Python | linguistic_features/connectives.py | iverinaivanova/Linguistic-Mechanisms-in-the-Section-Types-of-a-Research-Article | b9aad26d66a1b550f1734a76dd94b440e58b6125 | [
"Apache-2.0"
] | null | null | null | linguistic_features/connectives.py | iverinaivanova/Linguistic-Mechanisms-in-the-Section-Types-of-a-Research-Article | b9aad26d66a1b550f1734a76dd94b440e58b6125 | [
"Apache-2.0"
] | null | null | null | linguistic_features/connectives.py | iverinaivanova/Linguistic-Mechanisms-in-the-Section-Types-of-a-Research-Article | b9aad26d66a1b550f1734a76dd94b440e58b6125 | [
"Apache-2.0"
] | null | null | null | """The script retrieves explicit connectives marking temporal, comparison, contingency, and expansion relations
and prints the total number of these connectives per article section."""
import sys
import spacy
from collections import Counter
nlp = spacy.load("en_core_web_sm")
# The script below retrieves the c... | 53.952381 | 112 | 0.568108 | """The script retrieves explicit connectives marking temporal, comparison, contingency, and expansion relations
and prints the total number of these connectives per article section."""
import sys
import spacy
from collections import Counter
nlp = spacy.load("en_core_web_sm")
# The script below retrieves the c... | 0 | 0 | 0 |
c3eb3f79de238630fd3623659ca0acabe1a18ed6 | 7,079 | py | Python | apps/reports/metadata/basic.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | 1 | 2017-05-19T07:23:00.000Z | 2017-05-19T07:23:00.000Z | apps/reports/metadata/basic.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | apps/reports/metadata/basic.py | commtrack/commtrack-old-to-del | cc9c22754ac192a45483cef609bdcf09aa990340 | [
"BSD-3-Clause"
] | null | null | null | """
Basic metadata reports/queries
@author: dan myung (dmyung@dimagi.com)
create: 10/19/2009
Notes:
A place where oft reused queries off xformmanager.metadata can be referenced.
This is somewhat redundant with functionality already existent in the apps/reports/util.py file which already does
a basic metadata query.... | 41.156977 | 167 | 0.703772 | """
Basic metadata reports/queries
@author: dan myung (dmyung@dimagi.com)
create: 10/19/2009
Notes:
A place where oft reused queries off xformmanager.metadata can be referenced.
This is somewhat redundant with functionality already existent in the apps/reports/util.py file which already does
a basic metadata query.... | 0 | 0 | 0 |
7adf46f4dc4fd50dd8b98f3b3816828778eed8e7 | 7,795 | py | Python | src/skills/switch_skill.py | winkste/mp32_generic | 4231ac4a1c63a7479b79a5693516e3e86a1b8c69 | [
"MIT"
] | null | null | null | src/skills/switch_skill.py | winkste/mp32_generic | 4231ac4a1c63a7479b79a5693516e3e86a1b8c69 | [
"MIT"
] | null | null | null | src/skills/switch_skill.py | winkste/mp32_generic | 4231ac4a1c63a7479b79a5693516e3e86a1b8c69 | [
"MIT"
] | 2 | 2020-11-03T08:54:28.000Z | 2021-05-27T13:28:17.000Z | ################################################################################
# filename: switch_skill.py
# date: 07. Apr. 2021
# username: winkste
# name: Stephan Wink
# description: This module handles the input signal of a switch.
# In the first implementation it will only support polling of an
# ... | 38.975 | 107 | 0.493906 | ################################################################################
# filename: switch_skill.py
# date: 07. Apr. 2021
# username: winkste
# name: Stephan Wink
# description: This module handles the input signal of a switch.
# In the first implementation it will only support polling of an
# ... | 3,229 | 2,603 | 22 |
def7e890c66fcbef5ecfc97dcc5848e24c252ed5 | 14,062 | py | Python | vyper/parser/parser_utils.py | mpcnat/vyper | 731263c9bea826a167639989350688833f68c182 | [
"MIT"
] | null | null | null | vyper/parser/parser_utils.py | mpcnat/vyper | 731263c9bea826a167639989350688833f68c182 | [
"MIT"
] | null | null | null | vyper/parser/parser_utils.py | mpcnat/vyper | 731263c9bea826a167639989350688833f68c182 | [
"MIT"
] | null | null | null | from vyper.utils import GAS_IDENTITY, GAS_IDENTITYWORD
from vyper.exceptions import (
InvalidLiteralException,
TypeMismatchException
)
from vyper.parser.lll_node import (
LLLnode
)
from vyper.types import (
BaseType,
ByteArrayType,
ContractType,
NullType,
StructType,
MappingType,
... | 46.562914 | 148 | 0.59323 | from vyper.utils import GAS_IDENTITY, GAS_IDENTITYWORD
from vyper.exceptions import (
InvalidLiteralException,
TypeMismatchException
)
from vyper.parser.lll_node import (
LLLnode
)
from vyper.types import (
BaseType,
ByteArrayType,
ContractType,
NullType,
StructType,
MappingType,
... | 12,647 | 0 | 222 |
29ffcd6a05a2485e18fc7df508229e0ccd5838db | 180 | py | Python | st2common/tests/resources/loadableplugin/plugin/util/randomutil.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | 1 | 2020-11-09T21:05:33.000Z | 2020-11-09T21:05:33.000Z | st2common/tests/resources/loadableplugin/plugin/util/randomutil.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | 3 | 2021-03-25T23:57:10.000Z | 2021-03-26T00:01:05.000Z | st2common/tests/resources/loadableplugin/plugin/util/randomutil.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import random
from six.moves import range
| 22.5 | 65 | 0.783333 | from __future__ import absolute_import
import random
from six.moves import range
def get_random_numbers(count):
return [random.randrange(0, 1000) for idx in range(0, count)]
| 75 | 0 | 23 |
9ae424fea148a73e82ace7484199b2bc53457d2d | 367 | py | Python | rpi/kibawe_v2/routine.py | updewsprado/updews-datalogger | 862e39504119c9f6f8a4988ff2cd5ad39ed46863 | [
"Unlicense"
] | null | null | null | rpi/kibawe_v2/routine.py | updewsprado/updews-datalogger | 862e39504119c9f6f8a4988ff2cd5ad39ed46863 | [
"Unlicense"
] | null | null | null | rpi/kibawe_v2/routine.py | updewsprado/updews-datalogger | 862e39504119c9f6f8a4988ff2cd5ad39ed46863 | [
"Unlicense"
] | null | null | null | from xbeecoord import *
from time import sleep
import multiprocessing
reset()
sleep(5)
getRssi()
sleep(2)
wakeup()
startwait()
'''
def main():
reset()
sleep(5)
getRssi()
sleep(2)
wakeup()
startwait()
if __name__=='__main__':
p = multiprocessing.Process(target=main,name="routine")
p.start()
sleep(300)
p... | 11.46875 | 56 | 0.689373 | from xbeecoord import *
from time import sleep
import multiprocessing
reset()
sleep(5)
getRssi()
sleep(2)
wakeup()
startwait()
'''
def main():
reset()
sleep(5)
getRssi()
sleep(2)
wakeup()
startwait()
if __name__=='__main__':
p = multiprocessing.Process(target=main,name="routine")
p.start()
sleep(300)
p... | 0 | 0 | 0 |
95ae4165b2b8de19eb116db0c51a0d1f8417d350 | 14,185 | py | Python | rulesanml.py | asrivast28/FastSNAP | 3240484d863ae68d18e7198c8ad1e211463715a9 | [
"Apache-2.0"
] | null | null | null | rulesanml.py | asrivast28/FastSNAP | 3240484d863ae68d18e7198c8ad1e211463715a9 | [
"Apache-2.0"
] | null | null | null | rulesanml.py | asrivast28/FastSNAP | 3240484d863ae68d18e7198c8ad1e211463715a9 | [
"Apache-2.0"
] | null | null | null | ##
# @file rulesanml.py
# @author Ankit Srivastava <asrivast@gatech.edu>
#
# Copyright 2018 Georgia Institute of Technology
#
# 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.apa... | 46.661184 | 159 | 0.596052 | ##
# @file rulesanml.py
# @author Ankit Srivastava <asrivast@gatech.edu>
#
# Copyright 2018 Georgia Institute of Technology
#
# 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.apa... | 10,482 | 30 | 292 |
c319caa266be2ae157a2924b02ace1fdbaf862de | 16,853 | py | Python | tracformatter/trac/test.py | kbower/tracwikiconv | 6db4c856c8ab64beac666226519ae2e8d513c428 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T15:55:16.000Z | 2017-02-09T15:55:16.000Z | tracformatter/trac/test.py | kbower/tracwikiconv | 6db4c856c8ab64beac666226519ae2e8d513c428 | [
"BSD-3-Clause"
] | null | null | null | tracformatter/trac/test.py | kbower/tracwikiconv | 6db4c856c8ab64beac666226519ae2e8d513c428 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you sho... | 36.958333 | 81 | 0.587314 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you sho... | 5,256 | 18 | 355 |
e389c227339afdf6dc2a373f24acbfb741a5fdfe | 287 | py | Python | Lecture 18/Lecture18HWAssignment3.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | 1 | 2019-04-27T15:37:04.000Z | 2019-04-27T15:37:04.000Z | Lecture 18/Lecture18HWAssignment3.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | null | null | null | Lecture 18/Lecture18HWAssignment3.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | 1 | 2020-08-14T06:57:08.000Z | 2020-08-14T06:57:08.000Z | # WAP to accept a folder name from user and create zip file out of contents of it.
import shutil
if __name__ == "__main__":
main() | 28.7 | 82 | 0.696864 | # WAP to accept a folder name from user and create zip file out of contents of it.
import shutil
def main():
inputDirPath = input("Please enter directory name: ")
shutil.make_archive("outputZip", "zip", inputDirPath)
print("Archived!")
if __name__ == "__main__":
main() | 129 | 0 | 23 |
ed2fbd10346eec764cf27d2e4a1be3653c1425d8 | 2,174 | py | Python | pagarmecoreapi/models/create_price_bracket_request.py | pagarme/pagarme-core-api-python | c7b11ca78ab3e7e896e5b75048e6f72b511db00e | [
"MIT"
] | 6 | 2021-09-02T19:55:04.000Z | 2022-03-16T14:06:15.000Z | pagarmecoreapi/models/create_price_bracket_request.py | pagarme/pagarme-core-api-python | c7b11ca78ab3e7e896e5b75048e6f72b511db00e | [
"MIT"
] | 2 | 2021-10-11T22:48:15.000Z | 2022-01-24T18:24:23.000Z | pagarmecoreapi/models/create_price_bracket_request.py | pagarme/pagarme-core-api-python | c7b11ca78ab3e7e896e5b75048e6f72b511db00e | [
"MIT"
] | 2 | 2021-09-12T21:43:32.000Z | 2022-03-07T16:58:54.000Z | # -*- coding: utf-8 -*-
"""
pagarmecoreapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class CreatePriceBracketRequest(object):
"""Implementation of the 'CreatePriceBracketRequest' model.
Request for creating a price bracket
Attributes:
... | 28.605263 | 84 | 0.586937 | # -*- coding: utf-8 -*-
"""
pagarmecoreapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class CreatePriceBracketRequest(object):
"""Implementation of the 'CreatePriceBracketRequest' model.
Request for creating a price bracket
Attributes:
... | 0 | 0 | 0 |
985de2c940ad894eae35688847c4e07a0615981e | 1,987 | py | Python | rulelist/datastructure/attribute/attribute.py | HMProenca/RuleList | 4e500c3a9813aadb149286458f11460904fd15d4 | [
"MIT"
] | 8 | 2021-02-23T10:57:29.000Z | 2022-03-15T10:29:08.000Z | rulelist/datastructure/attribute/attribute.py | HMProenca/RuleList | 4e500c3a9813aadb149286458f11460904fd15d4 | [
"MIT"
] | 3 | 2021-02-26T21:54:24.000Z | 2021-06-09T13:28:10.000Z | rulelist/datastructure/attribute/attribute.py | HMProenca/RuleList | 4e500c3a9813aadb149286458f11460904fd15d4 | [
"MIT"
] | 2 | 2021-02-26T21:32:22.000Z | 2021-11-01T09:32:38.000Z | from dataclasses import dataclass, field
from typing import List, AnyStr, Iterator, Any, Dict
import numpy as np
import pandas as pd
from gmpy2 import mpz
@dataclass
class Item:
""" Describes an item of an attribute.
The item is the lowest level representation of the attribute. It is defined by at least one... | 32.57377 | 111 | 0.700554 | from dataclasses import dataclass, field
from typing import List, AnyStr, Iterator, Any, Dict
import numpy as np
import pandas as pd
from gmpy2 import mpz
@dataclass
class Item:
""" Describes an item of an attribute.
The item is the lowest level representation of the attribute. It is defined by at least one... | 87 | 0 | 27 |
2e818e22823029570921c6b84b3442ba2ae1d7e7 | 3,803 | py | Python | src/codexdb/prep/spider.py | itrummer/CodexDB | 15ab6268c95e8a283b69e17d5fa4cb7589580a27 | [
"MIT"
] | null | null | null | src/codexdb/prep/spider.py | itrummer/CodexDB | 15ab6268c95e8a283b69e17d5fa4cb7589580a27 | [
"MIT"
] | null | null | null | src/codexdb/prep/spider.py | itrummer/CodexDB | 15ab6268c95e8a283b69e17d5fa4cb7589580a27 | [
"MIT"
] | null | null | null | '''
Created on Sep 19, 2021
@author: immanueltrummer
'''
import argparse
import collections
import json
import pandas as pd
import sqlite3
def get_db_path(spider_dir, db_id):
""" Return path to SQLite database file.
Args:
spider_dir: path to SPIDER benchmark
db_id: database identifier
... | 31.429752 | 76 | 0.563765 | '''
Created on Sep 19, 2021
@author: immanueltrummer
'''
import argparse
import collections
import json
import pandas as pd
import sqlite3
def get_db_path(spider_dir, db_id):
""" Return path to SQLite database file.
Args:
spider_dir: path to SPIDER benchmark
db_id: database identifier
... | 0 | 0 | 0 |
8bcf8d4d1836ae3eb763677be00b8c2f9e1f2594 | 625 | py | Python | tests/test_layers/test_acc.py | wkcn/mobula | 4eec938d6477776f5f2d68bcf41de83fb8da5195 | [
"MIT"
] | 47 | 2017-07-15T02:13:18.000Z | 2022-01-01T09:37:59.000Z | tests/test_layers/test_acc.py | wkcn/mobula | 4eec938d6477776f5f2d68bcf41de83fb8da5195 | [
"MIT"
] | 3 | 2018-06-22T13:55:12.000Z | 2020-01-29T01:41:13.000Z | tests/test_layers/test_acc.py | wkcn/mobula | 4eec938d6477776f5f2d68bcf41de83fb8da5195 | [
"MIT"
] | 8 | 2017-09-03T12:42:54.000Z | 2020-09-27T03:38:59.000Z | import mobula.layers as L
import numpy as np
| 27.173913 | 87 | 0.4448 | import mobula.layers as L
import numpy as np
def test_acc():
X = np.array([[0, 1, 2],
[1, 2, 0],
[0, 1, 2],
[1, 2, 0]])
Y = np.array([1, 0, 2, 1]).reshape((-1, 1))
# top-k
# 1 [False, False, True, True]
# 2 [True, T... | 557 | 0 | 23 |
eb3850cf0a144d90bc658ea248d321d83bef0449 | 628 | py | Python | Webllistoerp/chat/migrations/0004_auto_20210601_0844.py | Prakhar-100/DjangoProject | 5030fabe038bd67af50364431705837aa0bde91b | [
"MIT"
] | null | null | null | Webllistoerp/chat/migrations/0004_auto_20210601_0844.py | Prakhar-100/DjangoProject | 5030fabe038bd67af50364431705837aa0bde91b | [
"MIT"
] | null | null | null | Webllistoerp/chat/migrations/0004_auto_20210601_0844.py | Prakhar-100/DjangoProject | 5030fabe038bd67af50364431705837aa0bde91b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-06-01 08:44
from django.conf import settings
from django.db import migrations, models
| 25.12 | 70 | 0.632166 | # Generated by Django 3.1.7 on 2021-06-01 08:44
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('chat', '0003_auto_20210531_1404'),
]
operations ... | 0 | 481 | 23 |
544879006a299eb76867b4e97ce8c0e45d8e4d68 | 235 | py | Python | python/ext_c.py | forember/lambd | 5550b741083e463cee60ce76bb181b4c063879a1 | [
"MIT"
] | null | null | null | python/ext_c.py | forember/lambd | 5550b741083e463cee60ce76bb181b4c063879a1 | [
"MIT"
] | null | null | null | python/ext_c.py | forember/lambd | 5550b741083e463cee60ce76bb181b4c063879a1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# vim: set sw=2 ts=2 sts=2 et :
'''Defines a comment
(@@ c.(This is a comment!) x z) -> (x z)
'''
from lambd import *
| 16.785714 | 42 | 0.595745 | # -*- coding: utf-8 -*-
# vim: set sw=2 ts=2 sts=2 et :
'''Defines a comment
(@@ c.(This is a comment!) x z) -> (x z)
'''
from lambd import *
def ext_parexpr(tree, extra_params, body):
body.pop(1)
tree[:] = parse_parexpr(body)
| 67 | 0 | 23 |
06ae4fcc8678e2badcda395c709576597bbf2d8c | 1,675 | py | Python | setup.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | 1 | 2021-01-14T16:44:48.000Z | 2021-01-14T16:44:48.000Z | setup.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | null | null | null | setup.py | martindevora/SHERLOCK | 5e7492552cbce29e960684a44fd6ad875c8cf60e | [
"MIT"
] | null | null | null | import setuptools
import os
with open("README.md", "r") as fh:
long_description = fh.read()
version = os.popen('git tag -l --sort -version:refname | head -n 1').read().split('\n', 1)[0]
setuptools.setup(
name="sherlockpipe", # Replace with your own username
version=version,
author="F.J. Pozuelos & M. ... | 34.183673 | 93 | 0.46806 | import setuptools
import os
with open("README.md", "r") as fh:
long_description = fh.read()
version = os.popen('git tag -l --sort -version:refname | head -n 1').read().split('\n', 1)[0]
setuptools.setup(
name="sherlockpipe", # Replace with your own username
version=version,
author="F.J. Pozuelos & M. ... | 0 | 0 | 0 |
26142f2ab17a6f041b7cf830d3dcd1a97d2eab8f | 96 | py | Python | views/__init__.py | brenns10/love | 1a2a60c510327d91eff9caf32a252141ae00a9eb | [
"MIT"
] | 4 | 2017-02-16T02:18:39.000Z | 2018-01-14T01:56:21.000Z | views/__init__.py | brenns10/love | 1a2a60c510327d91eff9caf32a252141ae00a9eb | [
"MIT"
] | 17 | 2017-02-16T17:19:53.000Z | 2018-01-08T01:43:05.000Z | views/__init__.py | brenns10/love | 1a2a60c510327d91eff9caf32a252141ae00a9eb | [
"MIT"
] | 4 | 2017-02-16T18:48:18.000Z | 2018-01-08T02:34:07.000Z | # -*- coding: utf-8 -*-
# flake8: noqa
from . import api
from . import tasks
from . import web
| 13.714286 | 23 | 0.635417 | # -*- coding: utf-8 -*-
# flake8: noqa
from . import api
from . import tasks
from . import web
| 0 | 0 | 0 |
22e987fdaffc1da25e1f0e351d6a5f530f8a1785 | 48 | py | Python | sensor/__init__.py | Boquete/smoger | ceb25137684334cba0625ca669c6e786c27bbb06 | [
"Apache-2.0"
] | 2 | 2018-03-13T18:22:18.000Z | 2018-03-24T16:48:26.000Z | sensor/__init__.py | Boquete/smoger | ceb25137684334cba0625ca669c6e786c27bbb06 | [
"Apache-2.0"
] | null | null | null | sensor/__init__.py | Boquete/smoger | ceb25137684334cba0625ca669c6e786c27bbb06 | [
"Apache-2.0"
] | null | null | null | default_app_config = 'sensor.apps.SmogerConfig'
| 24 | 47 | 0.833333 | default_app_config = 'sensor.apps.SmogerConfig'
| 0 | 0 | 0 |
cd97b5225dc818019efa0aa136acafab5f25c92c | 1,748 | py | Python | app/models.py | livra-ar/backend | eb052611bb9b2cfa360fa422ce059984b8d295fa | [
"BSD-2-Clause"
] | 1 | 2020-09-05T12:18:06.000Z | 2020-09-05T12:18:06.000Z | app/models.py | thamidurm/ar-content-platform-backend | eb052611bb9b2cfa360fa422ce059984b8d295fa | [
"BSD-2-Clause"
] | 3 | 2021-06-09T17:46:46.000Z | 2021-09-22T18:54:57.000Z | app/models.py | livra-ar/backend | eb052611bb9b2cfa360fa422ce059984b8d295fa | [
"BSD-2-Clause"
] | null | null | null |
import mongoengine
from mongoengine import fields, Document, ImproperlyConfigured
from creators.models import Creator | 34.27451 | 91 | 0.732838 |
import mongoengine
from mongoengine import fields, Document, ImproperlyConfigured
from creators.models import Creator
def make_ngrams(word, min_size=2):
length = len(word)
size_range = range(min_size, max(length, min_size) + 1)
return list(set(
word[i:i + size]
for size in size_range
... | 464 | 1,074 | 92 |
63a39dd2b74d99d3ae37afd2f983746c46666c93 | 67 | py | Python | lectures/code/list_filter.py | naskoch/python_course | 84adfd3f8d48ca3ad5837f7acc59d2fa051e95d3 | [
"MIT"
] | 4 | 2015-08-10T17:46:55.000Z | 2020-04-18T21:09:03.000Z | lectures/code/list_filter.py | naskoch/python_course | 84adfd3f8d48ca3ad5837f7acc59d2fa051e95d3 | [
"MIT"
] | null | null | null | lectures/code/list_filter.py | naskoch/python_course | 84adfd3f8d48ca3ad5837f7acc59d2fa051e95d3 | [
"MIT"
] | 2 | 2019-04-24T03:31:02.000Z | 2019-05-13T07:36:06.000Z | l = range(8)
print filter(lambda x: x % 2 == 0, l)
# [0, 2, 4, 6]
| 13.4 | 37 | 0.492537 | l = range(8)
print filter(lambda x: x % 2 == 0, l)
# [0, 2, 4, 6]
| 0 | 0 | 0 |
5df99fe4deec0c6b7e42e4e7c61cbe46113104c4 | 3,014 | py | Python | tests/pystrings/test_lineup_students.py | BrianLusina/PyCharm | 144dd4f6b2d254507237f46c8ee175c407fe053d | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/pystrings/test_lineup_students.py | BrianLusina/PyCharm | 144dd4f6b2d254507237f46c8ee175c407fe053d | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/pystrings/test_lineup_students.py | BrianLusina/PyCharm | 144dd4f6b2d254507237f46c8ee175c407fe053d | [
"Apache-2.0",
"MIT"
] | null | null | null | import unittest
from pystrings.lineup_students import lineup_students
s1 = "Tadashi Takahiro Takao Takashi Takayuki Takehiko Takeo Takeshi Takeshi"
lst1 = [
"Takehiko",
"Takayuki",
"Takahiro",
"Takeshi",
"Takeshi",
"Takashi",
"Tadashi",
"Takeo",
"Takao",
]
s2 = "Michio Miki Mikio... | 19.828947 | 747 | 0.585601 | import unittest
from pystrings.lineup_students import lineup_students
s1 = "Tadashi Takahiro Takao Takashi Takayuki Takehiko Takeo Takeshi Takeshi"
lst1 = [
"Takehiko",
"Takayuki",
"Takahiro",
"Takeshi",
"Takeshi",
"Takashi",
"Tadashi",
"Takeo",
"Takao",
]
s2 = "Michio Miki Mikio... | 149 | 10 | 103 |
2a7726202ca6d690fb3d53d3381336f8576ffc4e | 4,179 | py | Python | unittest/scripts/auto/py_shell/validation/plugin_cli_integration_norecord.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | null | null | null | unittest/scripts/auto/py_shell/validation/plugin_cli_integration_norecord.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | 1 | 2021-09-12T22:07:06.000Z | 2021-09-12T22:07:06.000Z | unittest/scripts/auto/py_shell/validation/plugin_cli_integration_norecord.py | mueller/mysql-shell | 29bafc5692bd536a12c4e41c54cb587375fe52cf | [
"Apache-2.0"
] | null | null | null | #@<OUT> CLI --help
The following objects provide command line operations:
cli_tester
CLI Integration Testing Plugin
cluster
Represents an InnoDB cluster.
dba
InnoDB cluster and replicaset management functions.
rs
Represents an InnoDB ReplicaSet.
shell
Gives access to ge... | 25.796296 | 81 | 0.734865 | #@<OUT> CLI --help
The following objects provide command line operations:
cli_tester
CLI Integration Testing Plugin
cluster
Represents an InnoDB cluster.
dba
InnoDB cluster and replicaset management functions.
rs
Represents an InnoDB ReplicaSet.
shell
Gives access to ge... | 0 | 0 | 0 |
36840bcc724e35743cfcc58a05740a503f98cad9 | 2,507 | py | Python | neurons/form/test/__init__.py | plq/neurons | f3627975daa3662e3a14265dca1150799ca0d27a | [
"BSD-3-Clause"
] | 4 | 2015-07-14T09:37:11.000Z | 2017-01-07T09:55:59.000Z | neurons/form/test/__init__.py | arskom/neurons | d969dbac6c10a5cc1da32031740883e450889414 | [
"BSD-3-Clause"
] | 3 | 2016-06-02T13:52:38.000Z | 2018-11-22T08:55:20.000Z | neurons/form/test/__init__.py | plq/neurons | f3627975daa3662e3a14265dca1150799ca0d27a | [
"BSD-3-Clause"
] | 7 | 2015-02-01T14:02:33.000Z | 2016-07-21T20:14:23.000Z | # encoding: utf8
#
# This file is part of the Neurons project.
# Copyright (c), Arskom Ltd. (arskom.com.tr),
# Burak Arslan <burak.arslan@arskom.com.tr>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | 38.569231 | 80 | 0.69645 | # encoding: utf8
#
# This file is part of the Neurons project.
# Copyright (c), Arskom Ltd. (arskom.com.tr),
# Burak Arslan <burak.arslan@arskom.com.tr>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | 763 | 0 | 23 |
64ebb7f5b6f18386008165ea0eb4a0ab3cd8a833 | 17,729 | py | Python | Fluid2d/core/operators.py | chenyg1119/fluid-simulation | f504042602fab54855177f20be2dfe1c7ee4f2d9 | [
"MIT"
] | null | null | null | Fluid2d/core/operators.py | chenyg1119/fluid-simulation | f504042602fab54855177f20be2dfe1c7ee4f2d9 | [
"MIT"
] | null | null | null | Fluid2d/core/operators.py | chenyg1119/fluid-simulation | f504042602fab54855177f20be2dfe1c7ee4f2d9 | [
"MIT"
] | null | null | null | from param import Param
from numpy import zeros, zeros_like, roll
from gmg.hierarchy import Gmg
import fortran_advection as fa
import fortran_operators as fo
import fortran_diag as fd
from fourier import Fourier
| 35.529058 | 79 | 0.504371 | from param import Param
from numpy import zeros, zeros_like, roll
from gmg.hierarchy import Gmg
import fortran_advection as fa
import fortran_operators as fo
import fortran_diag as fd
from fourier import Fourier
class Operators(Param):
def __init__(self, param, grid):
self.list_param = ['varname_list', '... | 7,809 | 9,684 | 23 |
c1ed7b55dbc27e47f041d53b097d4e35886d4daf | 779 | py | Python | storagedef/tests/test_session.py | gjo/storagedef | f5574378220369441c5480cb10d77f7b739e25be | [
"BSD-3-Clause"
] | null | null | null | storagedef/tests/test_session.py | gjo/storagedef | f5574378220369441c5480cb10d77f7b739e25be | [
"BSD-3-Clause"
] | null | null | null | storagedef/tests/test_session.py | gjo/storagedef | f5574378220369441c5480cb10d77f7b739e25be | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
| 31.16 | 74 | 0.657253 | # -*- coding: utf-8 -*-
import unittest
class SessionTestCase(unittest.TestCase):
def test_load_localmemory(self):
from ..session import Session
from ..engines.localmemory import LocalMemoryStorageEngine
session = Session.from_config({
'provider':
'storagedef.... | 640 | 20 | 77 |
658e89ebe4dc3efb089e3dfff25af7b188ed2930 | 1,922 | py | Python | python/gini.py | bpalmer4/code-snippets | e87f7baade69ff25e062f54d58b3f6f611c4c283 | [
"MIT"
] | null | null | null | python/gini.py | bpalmer4/code-snippets | e87f7baade69ff25e062f54d58b3f6f611c4c283 | [
"MIT"
] | null | null | null | python/gini.py | bpalmer4/code-snippets | e87f7baade69ff25e062f54d58b3f6f611c4c283 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
def gini(x):
"""Calculate the Gini coefficient for series of observed values (x).
where:
* x is the array of observed values (and all x are positive, non-zero values)
Note: x must be a numpy array or a pandas series
See: https://www.statsdirect.com/help/def... | 33.137931 | 84 | 0.631113 | import pandas as pd
import numpy as np
def gini(x):
"""Calculate the Gini coefficient for series of observed values (x).
where:
* x is the array of observed values (and all x are positive, non-zero values)
Note: x must be a numpy array or a pandas series
See: https://www.statsdirect.com/help/def... | 0 | 0 | 0 |
c9a2aaa41b86faa1fb98953ab14ca22b8ca32369 | 3,160 | py | Python | plugins/data/extract/link/referer-parser/sync_data.py | sniperkit/colly | 4d1ea7dfb014b9ef4857bd9f24cad223a723938f | [
"Apache-2.0"
] | 2 | 2020-11-07T14:45:16.000Z | 2020-12-19T20:26:15.000Z | plugins/data/extract/link/referer-parser/sync_data.py | sniperkit/colly | 4d1ea7dfb014b9ef4857bd9f24cad223a723938f | [
"Apache-2.0"
] | 5 | 2021-03-10T09:06:43.000Z | 2022-02-27T00:15:52.000Z | vendor/snowplow/referer-parser/sync_data.py | Jihun0109/marketing | c34f3a67cfbb2f7ea004cef9ac210c0eb5e4893c | [
"MIT"
] | 1 | 2019-09-20T20:44:02.000Z | 2019-09-20T20:44:02.000Z | #!/usr/bin/env python
# Copyright (c) 2013 Martin Katrenik, Snowplow Analytics Ltd. All rights reserved.
#
# This program is licensed to you under the Apache License Version 2.0,
# and you may not use this file except in compliance with the Apache
# License Version 2.0.
# You may obtain a copy of the Apache License Ve... | 30.384615 | 139 | 0.713291 | #!/usr/bin/env python
# Copyright (c) 2013 Martin Katrenik, Snowplow Analytics Ltd. All rights reserved.
#
# This program is licensed to you under the Apache License Version 2.0,
# and you may not use this file except in compliance with the Apache
# License Version 2.0.
# You may obtain a copy of the Apache License Ve... | 575 | 0 | 112 |
b273dda16cf9a97de8724449d86597cd23dc6400 | 14,414 | py | Python | equation.py | MoZhou1995/DeepPDE_ActorCritic | 9cc84b3f3c24318c72e9ac9b6fe8506f476c81bf | [
"MIT"
] | null | null | null | equation.py | MoZhou1995/DeepPDE_ActorCritic | 9cc84b3f3c24318c72e9ac9b6fe8506f476c81bf | [
"MIT"
] | null | null | null | equation.py | MoZhou1995/DeepPDE_ActorCritic | 9cc84b3f3c24318c72e9ac9b6fe8506f476c81bf | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from scipy.stats import multivariate_normal as normal
class Equation(object):
"""Base class for defining PDE related function."""
def w_tf(self, x, u):
"""Running cost in control problems."""
raise NotImplementedError
def Z_tf(self, x):
"... | 46.198718 | 180 | 0.580477 | import numpy as np
import tensorflow as tf
from scipy.stats import multivariate_normal as normal
class Equation(object):
"""Base class for defining PDE related function."""
def __init__(self, eqn_config):
self.dim = eqn_config.dim
self.gamma = eqn_config.discount
self.R = eqn_config.R
... | 11,610 | 0 | 1,241 |
1aad48197290a7a10b69c9b0eba6aad4a26e0194 | 476 | py | Python | core/handle_config.py | willdx/sensor_agent | 28eebc8cb17dc53b5657d3898a196724da882ac8 | [
"MIT"
] | null | null | null | core/handle_config.py | willdx/sensor_agent | 28eebc8cb17dc53b5657d3898a196724da882ac8 | [
"MIT"
] | null | null | null | core/handle_config.py | willdx/sensor_agent | 28eebc8cb17dc53b5657d3898a196724da882ac8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
File Name: handle_config.py
Author: WillDX
mail: xiang.dai@shuyun.com
Created Time: 2016年04月19日 星期二 09时36分58秒
'''
import json
from ConfigParser import ConfigParser
| 23.8 | 61 | 0.701681 | # -*- coding: utf-8 -*-
'''
File Name: handle_config.py
Author: WillDX
mail: xiang.dai@shuyun.com
Created Time: 2016年04月19日 星期二 09时36分58秒
'''
import json
from ConfigParser import ConfigParser
def handle(configfile,item_name):
#print "[configfile]:%s" % configfile
cp = ConfigParser()
cp.read(configfile)
... | 288 | 0 | 23 |
010a24de4b223fa7a4bf486d182055d2f5cfb459 | 88,207 | py | Python | main.py | JunweiLiang/Object_Detection_Tracking | f86caaec97669a6da56f1b402cca4e179a85d2f0 | [
"MIT"
] | 328 | 2019-05-27T03:09:02.000Z | 2022-03-31T05:12:04.000Z | main.py | AnjaliPC/Object_Detection_Tracking | f86caaec97669a6da56f1b402cca4e179a85d2f0 | [
"MIT"
] | 43 | 2019-06-05T14:04:09.000Z | 2022-01-25T03:16:39.000Z | main.py | AnjaliPC/Object_Detection_Tracking | f86caaec97669a6da56f1b402cca4e179a85d2f0 | [
"MIT"
] | 107 | 2019-05-27T06:26:38.000Z | 2022-03-25T03:32:58.000Z | # coding=utf-8
"""
main script for training and testing mask rcnn on MSCOCO/DIVA/MEVA dataset
multi gpu version
"""
import argparse
import cv2
import math
import json
import random
import operator
import time
import os
import pickle
import sys
import threading
# so here won"t have poll allocator info
os.environ["T... | 38.704256 | 131 | 0.612831 | # coding=utf-8
"""
main script for training and testing mask rcnn on MSCOCO/DIVA/MEVA dataset
multi gpu version
"""
import argparse
import cv2
import math
import json
import random
import operator
import time
import os
import pickle
import sys
import threading
# so here won"t have poll allocator info
os.environ["T... | 83,635 | 0 | 247 |
9c4d73291d6906245b28999c70a3f800826072e4 | 1,889 | py | Python | ingest/currency/currency.py | ourresearch/journalsdb | 169feb9be684eac59f3294dccdb319eb10fe1958 | [
"MIT"
] | 8 | 2021-02-01T21:00:20.000Z | 2022-01-25T09:51:24.000Z | ingest/currency/currency.py | ourresearch/journalsdb | 169feb9be684eac59f3294dccdb319eb10fe1958 | [
"MIT"
] | 43 | 2021-04-28T00:20:53.000Z | 2022-03-09T00:39:56.000Z | ingest/currency/currency.py | ourresearch/journalsdb | 169feb9be684eac59f3294dccdb319eb10fe1958 | [
"MIT"
] | null | null | null | import os
import pandas as pd
from app import app, db
from models.price import Currency
@app.cli.command("import_currency")
def import_currency():
"""
Loads up a provided CSV file of world currencies and extracts the unicode symbol
and text label associated with each currency. Loads these into the Curren... | 32.568966 | 98 | 0.670725 | import os
import pandas as pd
from app import app, db
from models.price import Currency
@app.cli.command("import_currency")
def import_currency():
"""
Loads up a provided CSV file of world currencies and extracts the unicode symbol
and text label associated with each currency. Loads these into the Curren... | 0 | 0 | 0 |
e161d2751528bb56774b08bbf120664eaeffc03a | 1,929 | py | Python | estimators/single_ix_stratification.py | saadlabyad/aslsd | 95a1cc660079972b45a77ec6dc587d9225489212 | [
"BSD-3-Clause"
] | null | null | null | estimators/single_ix_stratification.py | saadlabyad/aslsd | 95a1cc660079972b45a77ec6dc587d9225489212 | [
"BSD-3-Clause"
] | null | null | null | estimators/single_ix_stratification.py | saadlabyad/aslsd | 95a1cc660079972b45a77ec6dc587d9225489212 | [
"BSD-3-Clause"
] | null | null | null | # License: BSD 3 clause
import numpy as np
| 35.072727 | 75 | 0.567652 | # License: BSD 3 clause
import numpy as np
class SingleIxStratification:
def __init__(self, n_events_i, **kwargs):
self.n_events_i = n_events_i
self.n_exact = kwargs.get('n_exact', 10**4)
self.strata = kwargs.get('strata', None)
self.n_strata = kwargs.get('n_strata', Non... | 1,733 | 8 | 139 |
040a6ffedbd2b9090e96d29e4bad69ccbc0fc6f9 | 2,305 | py | Python | match/management/commands/rebuild_rankings.py | klobucar/statkeeper | 6083d686fd04ef628ef1fffbb3154374d886a3da | [
"MIT"
] | 1 | 2015-10-15T22:29:48.000Z | 2015-10-15T22:29:48.000Z | match/management/commands/rebuild_rankings.py | klobucar/statkeeper | 6083d686fd04ef628ef1fffbb3154374d886a3da | [
"MIT"
] | null | null | null | match/management/commands/rebuild_rankings.py | klobucar/statkeeper | 6083d686fd04ef628ef1fffbb3154374d886a3da | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from match.models import Ranking, Match, Game, ParticipantRole, t
| 40.438596 | 90 | 0.658568 | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from match.models import Ranking, Match, Game, ParticipantRole, t
class Command(BaseCommand):
help = 'Rebuilds all of the ratings from scratch.'
def handle(self, *args, **options):
# Clear out all of... | 2,021 | 84 | 23 |
7cdbc9bb02cf3f232c29d81fee332bc8cb2ff426 | 10,611 | py | Python | tests/integration/resources_permissions/test_modules_resources.py | aavcc/taiga-openshift | 7c33284573ceed38f755b8159ad83f3f68d2f7cb | [
"MIT"
] | null | null | null | tests/integration/resources_permissions/test_modules_resources.py | aavcc/taiga-openshift | 7c33284573ceed38f755b8159ad83f3f68d2f7cb | [
"MIT"
] | 12 | 2019-11-25T14:08:32.000Z | 2021-06-24T10:35:51.000Z | tests/integration/resources_permissions/test_modules_resources.py | threefoldtech/Threefold-Circles | cbc433796b25cf7af9a295af65d665a4a279e2d6 | [
"Apache-2.0"
] | 1 | 2018-06-07T10:58:15.000Z | 2018-06-07T10:58:15.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández ... | 46.336245 | 113 | 0.628499 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández ... | 8,852 | 0 | 160 |
cd2800c70b3b2e622fe1914ac86a58e45bb8462d | 5,068 | py | Python | rssdldmng/rssdldapi.py | alexpayne482/rssdldmng | 4428f10171902861702fc0f528d3d9576923541a | [
"MIT"
] | null | null | null | rssdldmng/rssdldapi.py | alexpayne482/rssdldmng | 4428f10171902861702fc0f528d3d9576923541a | [
"MIT"
] | 1 | 2019-11-25T15:54:02.000Z | 2019-11-25T15:54:02.000Z | rssdldmng/rssdldapi.py | alexpayne482/rssdldmng | 4428f10171902861702fc0f528d3d9576923541a | [
"MIT"
] | null | null | null | import logging
from rssdldmng.utils.restserver import RESTHttpServer
_LOGGER = logging.getLogger(__name__)
| 38.687023 | 112 | 0.545185 | import logging
from rssdldmng.utils.restserver import RESTHttpServer
_LOGGER = logging.getLogger(__name__)
class ApiServer(RESTHttpServer):
def __init__(self, port, mng):
self.routes = {
r'^/$': {'file': '/index.html', 'media_type': 'text/html'},
r'^\/(... | 4,570 | 11 | 371 |
c67749db26476426cc9820a06907a762ef3a4bc1 | 4,477 | py | Python | vimeoct/settings.py | nkawa/vimeo-coursetool | 729215fe23b1bf05918a38d21e585a7b8862e75a | [
"Apache-2.0"
] | null | null | null | vimeoct/settings.py | nkawa/vimeo-coursetool | 729215fe23b1bf05918a38d21e585a7b8862e75a | [
"Apache-2.0"
] | null | null | null | vimeoct/settings.py | nkawa/vimeo-coursetool | 729215fe23b1bf05918a38d21e585a7b8862e75a | [
"Apache-2.0"
] | null | null | null | """
Django settings for vimeoct project.
Generated by 'django-admin startproject' using Django 3.2.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from dotenv ... | 26.181287 | 91 | 0.715881 | """
Django settings for vimeoct project.
Generated by 'django-admin startproject' using Django 3.2.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from dotenv ... | 0 | 0 | 0 |
170b9d642252f24e9587f0ac465d2676a5e83e22 | 478 | py | Python | discord/ext/wizard/__init__.py | Makiyu-py/discord-ext-wizard | 59bd066ab451ee41d267aefe5f71e8485f6bc4a0 | [
"MIT"
] | 4 | 2021-04-02T16:16:50.000Z | 2021-08-03T13:21:45.000Z | discord/ext/wizard/__init__.py | Makiyu-py/discord-ext-wizard | 59bd066ab451ee41d267aefe5f71e8485f6bc4a0 | [
"MIT"
] | 7 | 2021-05-14T11:31:50.000Z | 2021-05-27T09:06:45.000Z | discord/ext/wizard/__init__.py | Makiyu-py/discord-ext-wizard | 59bd066ab451ee41d267aefe5f71e8485f6bc4a0 | [
"MIT"
] | 1 | 2021-05-18T23:58:23.000Z | 2021-05-18T23:58:23.000Z | from collections import namedtuple
_VersionInfo = namedtuple("_VersionInfo", "major minor patch")
version_info = _VersionInfo(0, 3, 0)
__version__ = ".".join(str(v) for v in version_info)
__license__ = "MIT"
__author__ = "FalseDev"
__title__ = "discord-ext-wizard"
__copyright__ = "Copyright 2021 {}".format(__author__... | 28.117647 | 66 | 0.738494 | from collections import namedtuple
_VersionInfo = namedtuple("_VersionInfo", "major minor patch")
version_info = _VersionInfo(0, 3, 0)
__version__ = ".".join(str(v) for v in version_info)
__license__ = "MIT"
__author__ = "FalseDev"
__title__ = "discord-ext-wizard"
__copyright__ = "Copyright 2021 {}".format(__author__... | 0 | 0 | 0 |
d2a1e5d665881867fbf743ab4d526c8f32e55e2d | 14,088 | py | Python | trans_ms/transport_management/doctype/transportation_order/transportation_order.py | mohsinalimat/transport | 3d32bd27f505f64b948f48d0bfc5c7ccaf61c4a2 | [
"MIT"
] | null | null | null | trans_ms/transport_management/doctype/transportation_order/transportation_order.py | mohsinalimat/transport | 3d32bd27f505f64b948f48d0bfc5c7ccaf61c4a2 | [
"MIT"
] | null | null | null | trans_ms/transport_management/doctype/transportation_order/transportation_order.py | mohsinalimat/transport | 3d32bd27f505f64b948f48d0bfc5c7ccaf61c4a2 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, Aakvatech Limited and contributors
# For license information, please see license.txt
# import frappe
from __future__ import unicode_literals
import frappe
import time
import datetime
from frappe.model.document import Document
from frappe import _
import json
from frappe.utils import nowdate
from ... | 37.870968 | 158 | 0.565233 | # Copyright (c) 2021, Aakvatech Limited and contributors
# For license information, please see license.txt
# import frappe
from __future__ import unicode_literals
import frappe
import time
import datetime
from frappe.model.document import Document
from frappe import _
import json
from frappe.utils import nowdate
from ... | 9,018 | 0 | 195 |
c94324dc07f3d22abb00e60ed1680dcaf4d026ca | 2,149 | py | Python | vc3/preprocess.py | ta1fukawa/vc-beta | c3a80c44be90f72bfe0bcac08f27c4882700c9b6 | [
"MIT"
] | null | null | null | vc3/preprocess.py | ta1fukawa/vc-beta | c3a80c44be90f72bfe0bcac08f27c4882700c9b6 | [
"MIT"
] | null | null | null | vc3/preprocess.py | ta1fukawa/vc-beta | c3a80c44be90f72bfe0bcac08f27c4882700c9b6 | [
"MIT"
] | null | null | null | import argparse
import pathlib
import sys
import torch
import torchaudio
import yaml
import common
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert wav to mel spectrogram')
parser.add_argument('wav_dir', type=pathlib.Path, help='path to directory of speaker directories co... | 33.578125 | 128 | 0.642624 | import argparse
import pathlib
import sys
import torch
import torchaudio
import yaml
import common
def main(wav_dir, mel_dir, embed_dir, encoder_path, config_path):
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
encoder = torch.load(encoder_path).to(device).eval()
config = yaml.l... | 1,091 | 0 | 23 |
6d53251e78bb7ec25c3252e40a239ccdb6143e6e | 5,948 | py | Python | docweb/views_wiki.py | pv/pydocweb | 05c7b69c3903e2bb90cca511f18f9c10d7926cc6 | [
"BSD-3-Clause"
] | 2 | 2016-07-26T17:13:00.000Z | 2017-12-13T12:46:46.000Z | docweb/views_wiki.py | pv/pydocweb | 05c7b69c3903e2bb90cca511f18f9c10d7926cc6 | [
"BSD-3-Clause"
] | null | null | null | docweb/views_wiki.py | pv/pydocweb | 05c7b69c3903e2bb90cca511f18f9c10d7926cc6 | [
"BSD-3-Clause"
] | null | null | null | import pydocweb.docweb.rst as rst
from pydocweb.docweb.utils import *
from pydocweb.docweb.models import *
from views_docstring import EditForm
#------------------------------------------------------------------------------
# Wiki
#------------------------------------------------------------------------------
WIKI_C... | 37.408805 | 118 | 0.535138 | import pydocweb.docweb.rst as rst
from pydocweb.docweb.utils import *
from pydocweb.docweb.models import *
from views_docstring import EditForm
#------------------------------------------------------------------------------
# Wiki
#------------------------------------------------------------------------------
WIKI_C... | 5,429 | 0 | 137 |
503a9f4c8fd00e62e81e2c3830c78b86686ae2d1 | 5,344 | py | Python | gym/searchingCoin.py | GodWriter/RL-Pytorch | 26f5b3ec4c12bd5c7c33d0a9b0952165c86330ae | [
"Apache-2.0"
] | null | null | null | gym/searchingCoin.py | GodWriter/RL-Pytorch | 26f5b3ec4c12bd5c7c33d0a9b0952165c86330ae | [
"Apache-2.0"
] | null | null | null | gym/searchingCoin.py | GodWriter/RL-Pytorch | 26f5b3ec4c12bd5c7c33d0a9b0952165c86330ae | [
"Apache-2.0"
] | null | null | null | import gym
import numpy
import random
import logging
from gym import spaces
from gym.utils import seeding
| 33.610063 | 87 | 0.549214 | import gym
import numpy
import random
import logging
from gym import spaces
from gym.utils import seeding
class GridEnv(gym.Env):
metadata = {'render.modes': ['human', 'rgb_array'],
'video.frames_per_second': 2}
def __init__(self):
self.states = [1, 2, 3, 4, 5, 6, 7, 8] # 状态空间
... | 5,224 | 239 | 23 |
31ed9358d47167d47cc2a9ef7b971f57e974edfd | 257 | py | Python | scheduled_bots/geneprotein/test_ChromosomeBot.py | turoger/scheduled-bots | 23fd30ccc242391151af3a1727f9fbf9dc95d433 | [
"MIT"
] | 6 | 2017-05-04T01:04:26.000Z | 2022-03-04T12:22:17.000Z | scheduled_bots/geneprotein/test_ChromosomeBot.py | turoger/scheduled-bots | 23fd30ccc242391151af3a1727f9fbf9dc95d433 | [
"MIT"
] | 55 | 2017-03-14T21:16:44.000Z | 2022-03-02T12:39:14.000Z | scheduled_bots/geneprotein/test_ChromosomeBot.py | turoger/scheduled-bots | 23fd30ccc242391151af3a1727f9fbf9dc95d433 | [
"MIT"
] | 13 | 2017-02-10T21:40:06.000Z | 2022-01-18T01:27:52.000Z | from datetime import datetime
from .ChromosomeBot import get_or_create
from ..geneprotein import organism_info
| 25.7 | 85 | 0.762646 | from datetime import datetime
from .ChromosomeBot import get_or_create
from ..geneprotein import organism_info
def test_get_or_create():
wdid = get_or_create("XII", "NC_001144.5", organism_info[559292], datetime.now())
assert wdid == 'Q27525657'
| 121 | 0 | 23 |
e30e6d26d59427ddc87d2537e60dbfb3b11c8932 | 569 | py | Python | neuronit/load/views.py | neuronit/pfa | 6483f23de3ac43ae1121760ab44a2cae1f2cc901 | [
"MIT"
] | null | null | null | neuronit/load/views.py | neuronit/pfa | 6483f23de3ac43ae1121760ab44a2cae1f2cc901 | [
"MIT"
] | null | null | null | neuronit/load/views.py | neuronit/pfa | 6483f23de3ac43ae1121760ab44a2cae1f2cc901 | [
"MIT"
] | null | null | null | from django.http import Http404
from django.shortcuts import render
from play.models import Game, Save
| 31.611111 | 92 | 0.657293 | from django.http import Http404
from django.shortcuts import render
from play.models import Game, Save
def load(request):
if request.method == "POST":
save = Save.objects.filter(name=request.POST.get("sel1")).first()
return render(request, 'play/play.html')
if request.user.is_authenticated():
... | 442 | 0 | 23 |
32b11fcdda72235ee222465e07bdb3c68d9c7cb7 | 3,006 | py | Python | src/app.py | colin-chang/md2html | 9fba39ee309c61515955090690b801fc37845e91 | [
"MIT"
] | 1 | 2020-01-06T10:07:17.000Z | 2020-01-06T10:07:17.000Z | src/app.py | colin-chang/md2html | 9fba39ee309c61515955090690b801fc37845e91 | [
"MIT"
] | null | null | null | src/app.py | colin-chang/md2html | 9fba39ee309c61515955090690b801fc37845e91 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import shutil
import os
import sys
import subprocess
from platform import system
input_arg = output_arg = None
if __name__ == "__main__":
if system() != 'Linux' and system() != 'Darwin':
print('only linux is supported currently')
else:
main()
| 31.978723 | 86 | 0.57352 | # -*- coding:utf-8 -*-
import shutil
import os
import sys
import subprocess
from platform import system
input_arg = output_arg = None
def main():
args = sys.argv
if len(args) < 3:
print('missing 2 required positional argument:"input","output"')
return
global input_arg, output_arg
in... | 2,641 | 0 | 69 |
a61f85fa9ce56be8d28765166b20414be4530278 | 2,571 | py | Python | church/cli.py | mdickinson/alonzo | a66d4c253c9f4338ebf1177a0b0e84bf7cc9c0f6 | [
"Apache-2.0"
] | null | null | null | church/cli.py | mdickinson/alonzo | a66d4c253c9f4338ebf1177a0b0e84bf7cc9c0f6 | [
"Apache-2.0"
] | null | null | null | church/cli.py | mdickinson/alonzo | a66d4c253c9f4338ebf1177a0b0e84bf7cc9c0f6 | [
"Apache-2.0"
] | null | null | null | """
To do:
- catch KeyboardInterrupt while evaluating
- show all?
- show statistics
- fix up exception handling; decorator?
"""
import cmd
from church.ast import ParseError
from church.environment import (
UndefinedNameError,
)
from church.eval import (
environment,
reduce,
Suspension,
)
from church.... | 23.587156 | 65 | 0.580319 | """
To do:
- catch KeyboardInterrupt while evaluating
- show all?
- show statistics
- fix up exception handling; decorator?
"""
import cmd
from church.ast import ParseError
from church.environment import (
UndefinedNameError,
)
from church.eval import (
environment,
reduce,
Suspension,
)
from church.... | 227 | 1,772 | 23 |
0fcac02991080919964d4007bc5b9504cc40cc8b | 730 | py | Python | aydin/it/classic_denoisers/test/test_dictionary.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 78 | 2021-11-08T16:11:23.000Z | 2022-03-27T17:51:04.000Z | aydin/it/classic_denoisers/test/test_dictionary.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 19 | 2021-11-08T17:15:40.000Z | 2022-03-30T17:46:55.000Z | aydin/it/classic_denoisers/test/test_dictionary.py | AhmetCanSolak/aydin | e8bc81ee88c96e0f34986df30a63c96468a45f70 | [
"BSD-3-Clause"
] | 7 | 2021-11-09T17:42:32.000Z | 2022-03-09T00:37:57.000Z | import pytest
from aydin.io.datasets import cropped_newyork
from aydin.it.classic_denoisers.demo.demo_2D_dictionary_fixed import (
demo_dictionary_fixed,
)
from aydin.it.classic_denoisers.demo.demo_2D_dictionary_learned import (
demo_dictionary_learned,
)
from aydin.it.classic_denoisers.dictionary_fixed import... | 29.2 | 84 | 0.816438 | import pytest
from aydin.io.datasets import cropped_newyork
from aydin.it.classic_denoisers.demo.demo_2D_dictionary_fixed import (
demo_dictionary_fixed,
)
from aydin.it.classic_denoisers.demo.demo_2D_dictionary_learned import (
demo_dictionary_learned,
)
from aydin.it.classic_denoisers.dictionary_fixed import... | 227 | 0 | 68 |
d1fae01ff815b39362b9f115804b8421474f2b1b | 600 | py | Python | big_data/maps/convert_rates_tsv_to_json.py | paulhtremblay/big-data | dfa2aa9877300a57e7a9368af59c07fcc5841b4f | [
"MIT"
] | null | null | null | big_data/maps/convert_rates_tsv_to_json.py | paulhtremblay/big-data | dfa2aa9877300a57e7a9368af59c07fcc5841b4f | [
"MIT"
] | 7 | 2020-06-05T18:13:25.000Z | 2022-03-11T23:19:48.000Z | big_data/maps/convert_rates_tsv_to_json.py | paulhtremblay/big-data | dfa2aa9877300a57e7a9368af59c07fcc5841b4f | [
"MIT"
] | 1 | 2020-11-25T18:24:37.000Z | 2020-11-25T18:24:37.000Z | import pprint
import json
pp = pprint.PrettyPrinter(indent = 4)
if __name__ == '__main__':
pp.pprint(main())
| 23.076923 | 71 | 0.506667 | import pprint
import json
pp = pprint.PrettyPrinter(indent = 4)
def convert(path):
with open(path, 'r') as read_obj:
line = 'init'
counter = 0
l = []
while line:
line = read_obj.readline()
counter += 1
if counter == 1:
continue
... | 440 | 0 | 46 |
4330ac10e234b0ed1e230392a489121eb2e4a3a4 | 610 | py | Python | 9/9-1-2.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 9/9-1-2.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 9/9-1-2.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | # coding:utf-8
restaurant = Restaurant('丽水云泉大酒店', 'duck')
print(restaurant.restaurant_name)
print(restaurant.cuisine_type)
restaurant.describe_restaurant()
restaurant.open_restaurant()
| 27.727273 | 59 | 0.72623 | # coding:utf-8
class Restaurant(object):
def __init__(self, restaurant_name, cuisine_type):
self.restaurant_name = restaurant_name
self.cuisine_type = cuisine_type
def describe_restaurant(self):
print("restaurant name is " + self.restaurant_name)
print("cuisine_type is " + self... | 298 | 102 | 23 |
534ab4de75347d1cad8852248bb5bb829a73b542 | 2,351 | py | Python | sprocket/util/hdf5.py | zhouming-hfut/sprocket | 68d4005284b72a891d0c0f81afabea087fc45960 | [
"MIT"
] | null | null | null | sprocket/util/hdf5.py | zhouming-hfut/sprocket | 68d4005284b72a891d0c0f81afabea087fc45960 | [
"MIT"
] | null | null | null | sprocket/util/hdf5.py | zhouming-hfut/sprocket | 68d4005284b72a891d0c0f81afabea087fc45960 | [
"MIT"
] | 1 | 2020-06-29T03:09:23.000Z | 2020-06-29T03:09:23.000Z | # -*- coding: utf-8 -*-
import os
import h5py
class HDF5(object):
"""HDF5 handler
Offer the hdf5 format file handler
Parameters
---------
fpath : str,
Path of hdf5 file
mode : str,
Open h5 as write and/or read mode
`a` : open as read/write (Default)
`w` : ope... | 22.825243 | 69 | 0.518503 | # -*- coding: utf-8 -*-
import os
import h5py
class HDF5(object):
"""HDF5 handler
Offer the hdf5 format file handler
Parameters
---------
fpath : str,
Path of hdf5 file
mode : str,
Open h5 as write and/or read mode
`a` : open as read/write (Default)
`w` : ope... | 1,006 | 0 | 54 |
24b126d6fe31cd3452fad67f497ed45acbd26584 | 2,370 | py | Python | neuronit/play/migrations/0019_auto_20170406_1114.py | neuronit/pfa | 6483f23de3ac43ae1121760ab44a2cae1f2cc901 | [
"MIT"
] | null | null | null | neuronit/play/migrations/0019_auto_20170406_1114.py | neuronit/pfa | 6483f23de3ac43ae1121760ab44a2cae1f2cc901 | [
"MIT"
] | null | null | null | neuronit/play/migrations/0019_auto_20170406_1114.py | neuronit/pfa | 6483f23de3ac43ae1121760ab44a2cae1f2cc901 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-04-06 09:14
from __future__ import unicode_literals
from django.db import migrations, models
| 40.862069 | 410 | 0.596624 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-04-06 09:14
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('play', '0018_auto_20170331_1014'),
]
operations = [
migrations.DeleteModel(
... | 0 | 2,192 | 23 |
3ddda6b61449da34e0f8e8b290c8f652cbcfea85 | 187 | py | Python | example.py | RangeHighGuestTeacher/Hello-World-Template | 34e786df22b29c92d0a44f79405e689f66c7d244 | [
"MIT"
] | null | null | null | example.py | RangeHighGuestTeacher/Hello-World-Template | 34e786df22b29c92d0a44f79405e689f66c7d244 | [
"MIT"
] | null | null | null | example.py | RangeHighGuestTeacher/Hello-World-Template | 34e786df22b29c92d0a44f79405e689f66c7d244 | [
"MIT"
] | null | null | null | print("Hello World")
########## Edit below this line
# print your name to the console
########## Edit above this line
# Once you've finished save and commit your changes to GitHub | 15.583333 | 61 | 0.657754 | print("Hello World")
########## Edit below this line
# print your name to the console
########## Edit above this line
# Once you've finished save and commit your changes to GitHub | 0 | 0 | 0 |
ca3eed6733efd71c4cd494c8c7e0014f4a43becf | 7,720 | py | Python | CBHelper-evaluateCallBack/lambda_function.py | aws-samples/amazon-connect-callback-helper | 9aff8bb69ae03d948d38cfa9b128d80c847b3a13 | [
"MIT-0"
] | 2 | 2021-12-18T00:15:09.000Z | 2022-03-26T09:49:25.000Z | CBHelper-evaluateCallBack/lambda_function.py | aws-samples/amazon-connect-callback-helper | 9aff8bb69ae03d948d38cfa9b128d80c847b3a13 | [
"MIT-0"
] | 1 | 2021-12-30T13:44:44.000Z | 2021-12-30T13:44:44.000Z | CBHelper-evaluateCallBack/lambda_function.py | aws-samples/amazon-connect-callback-helper | 9aff8bb69ae03d948d38cfa9b128d80c847b3a13 | [
"MIT-0"
] | null | null | null | ##CBWitness-EvaluateCallBack Function
import json
import boto3
import os
import datetime
import pytz
import base64
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key
#===============================
| 34.774775 | 163 | 0.630829 | ##CBWitness-EvaluateCallBack Function
import json
import boto3
import os
import datetime
import pytz
import base64
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key
def lambda_handler(event, context):
print(event)
CONTACTS_TABLE= os.environ['CONTACTS_TABLE']
contactPhon... | 7,289 | 0 | 188 |
946672f5a6656cc681f0ef3ce0dcf3df218f6871 | 284 | py | Python | passenger_wsgi.py | pilnujemy/foundation-manager | 1f1d6afcbb408c87a171bcbe3f9e58570eb478b6 | [
"BSD-3-Clause"
] | 1 | 2016-01-04T06:30:24.000Z | 2016-01-04T06:30:24.000Z | passenger_wsgi.py | pilnujemy/foundation-manager | 1f1d6afcbb408c87a171bcbe3f9e58570eb478b6 | [
"BSD-3-Clause"
] | 36 | 2015-11-27T14:17:34.000Z | 2016-07-14T10:23:52.000Z | passenger_wsgi.py | pilnujemy/foundation-manager | 1f1d6afcbb408c87a171bcbe3f9e58570eb478b6 | [
"BSD-3-Clause"
] | 1 | 2016-05-14T01:11:28.000Z | 2016-05-14T01:11:28.000Z | import sys, os
sys.path.append(os.getcwd())
import ConfigParser
cp = ConfigParser.ConfigParser();
cp.read('../.environ')
os.environ.update({key.upper():value for key, value in cp.items('env')})
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| 25.818182 | 73 | 0.757042 | import sys, os
sys.path.append(os.getcwd())
import ConfigParser
cp = ConfigParser.ConfigParser();
cp.read('../.environ')
os.environ.update({key.upper():value for key, value in cp.items('env')})
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| 0 | 0 | 0 |
4278806ab1065f5c0bd76d9bd9e691ed2d94f3c0 | 1,113 | py | Python | src/osyris/core/base.py | osyris-project/osyris | bff42d864a7d5d248f7023216e32fe97bc06dca6 | [
"BSD-3-Clause"
] | 2 | 2022-02-08T14:41:19.000Z | 2022-02-08T14:41:51.000Z | src/osyris/core/base.py | osyris-project/osyris | bff42d864a7d5d248f7023216e32fe97bc06dca6 | [
"BSD-3-Clause"
] | 20 | 2022-01-24T09:34:14.000Z | 2022-03-30T20:01:39.000Z | src/osyris/core/base.py | osyris-project/osyris | bff42d864a7d5d248f7023216e32fe97bc06dca6 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)
from .tools import make_label
import numpy as np
| 25.883721 | 83 | 0.625337 | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)
from .tools import make_label
import numpy as np
class Base:
def __repr__(self):
return str(self)
def __copy__(self):
return self.copy()
def __deepcopy__(self, mem... | 180 | 735 | 23 |
4032a6cd71d1138bf43cdaa8fa18e442760dd786 | 492 | py | Python | Fourteen/verify.py | tbjoern/adventofcode | 3fb8b4e18f03825c448d8935ab39b8bf08202d90 | [
"MIT"
] | null | null | null | Fourteen/verify.py | tbjoern/adventofcode | 3fb8b4e18f03825c448d8935ab39b8bf08202d90 | [
"MIT"
] | null | null | null | Fourteen/verify.py | tbjoern/adventofcode | 3fb8b4e18f03825c448d8935ab39b8bf08202d90 | [
"MIT"
] | null | null | null | muster = open("muster.txt", "r")
output = open("output.txt", "r")
mustervals = []
outputvals = []
for line in muster:
a,b,val = line.split(" ")
mustervals.append(int(val))
for line in output:
outputvals.append(int(line))
print len(mustervals)
print len(outputvals)
length = min(len(mustervals), len... | 21.391304 | 47 | 0.644309 | muster = open("muster.txt", "r")
output = open("output.txt", "r")
mustervals = []
outputvals = []
for line in muster:
a,b,val = line.split(" ")
mustervals.append(int(val))
for line in output:
outputvals.append(int(line))
print len(mustervals)
print len(outputvals)
length = min(len(mustervals), len... | 0 | 0 | 0 |
de7d0dd2eb661fd9591ad6ff497fdd859aff26f0 | 2,014 | py | Python | python_src/032.py | BurnySc2/leetcode-solutions | db86cc945f81d2b84891c5446f4887253011890e | [
"MIT"
] | null | null | null | python_src/032.py | BurnySc2/leetcode-solutions | db86cc945f81d2b84891c5446f4887253011890e | [
"MIT"
] | 1 | 2021-08-01T09:56:31.000Z | 2021-08-01T09:56:31.000Z | python_src/032.py | BurnySc2/leetcode-solutions | db86cc945f81d2b84891c5446f4887253011890e | [
"MIT"
] | null | null | null | """
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
https://leetcode.com/problems/longest-valid-parentheses/
"""
test_cases = ["(()", ")()())", "())()()()", "())((())()", "())((()))", "()(()", "))(()))()"]
results = [2, 4, 6, 6, 6,... | 35.964286 | 132 | 0.551639 | """
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
https://leetcode.com/problems/longest-valid-parentheses/
"""
class Solution:
def validParentheses(self, s: str) -> bool:
open_parentheses = 0
for i in s:
... | 337 | 1,005 | 23 |
81c4df0259303ed60ceeedb1ad263c6f1e994a54 | 1,294 | py | Python | setup.py | racitup/djangoshop-subscribe | ecc4ca1656a74cae279fa5af5fe1d6864d935cc1 | [
"BSD-3-Clause"
] | null | null | null | setup.py | racitup/djangoshop-subscribe | ecc4ca1656a74cae279fa5af5fe1d6864d935cc1 | [
"BSD-3-Clause"
] | null | null | null | setup.py | racitup/djangoshop-subscribe | ecc4ca1656a74cae279fa5af5fe1d6864d935cc1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup, find_packages
import shop_subscribe
with open('README.rst') as fd:
README = fd.read()
CLASSIFIERS = [
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Deve... | 29.409091 | 75 | 0.66306 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup, find_packages
import shop_subscribe
with open('README.rst') as fd:
README = fd.read()
CLASSIFIERS = [
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Deve... | 0 | 0 | 0 |
80311d17a08a43ab8a1c3dd590cb3604fb754b7a | 588 | py | Python | hardhat/recipes/perl/file_basedir.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/perl/file_basedir.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/perl/file_basedir.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | from ..base import GnuRecipe
| 34.588235 | 75 | 0.619048 | from ..base import GnuRecipe
class FileBaseDirRecipe(GnuRecipe):
def __init__(self, *args, **kwargs):
super(FileBaseDirRecipe, self).__init__(*args, **kwargs)
self.sha256 = '120a57ef78535e13e1465717b4056aff' \
'4ce69af1e31c67c65d1177a52169082b'
self.name = 'perl5-fil... | 495 | 14 | 49 |
1c8c055cc9d8cafce62eefcecb12eaad504ef9b2 | 13,934 | py | Python | pyathena/sqlalchemy_athena.py | l1x/PyAthena | 7aa94a85bf194b1c0c08048a1562bfb43ef6b3fb | [
"MIT"
] | null | null | null | pyathena/sqlalchemy_athena.py | l1x/PyAthena | 7aa94a85bf194b1c0c08048a1562bfb43ef6b3fb | [
"MIT"
] | null | null | null | pyathena/sqlalchemy_athena.py | l1x/PyAthena | 7aa94a85bf194b1c0c08048a1562bfb43ef6b3fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import math
import numbers
import re
import tenacity
from sqlalchemy import exc, util
from sqlalchemy.engine import Engine, reflection
from sqlalchemy.engine.default import DefaultDialect
from sqlalchemy.exc import NoSuchTableError, OperationalError
from sqlalchemy.sql.compiler import (
DDL... | 31.453725 | 95 | 0.600617 | # -*- coding: utf-8 -*-
import math
import numbers
import re
import tenacity
from sqlalchemy import exc, util
from sqlalchemy.engine import Engine, reflection
from sqlalchemy.engine.default import DefaultDialect
from sqlalchemy.exc import NoSuchTableError, OperationalError
from sqlalchemy.sql.compiler import (
DDL... | 9,969 | 1,622 | 765 |
d3da38f2d666dcc506c3bf9f7ca5edfd4290743f | 279 | py | Python | test.py | callumfrance/ThisPersonDoesNotExistAPI | 8aaf83a65f3d527be087610ee3758d665babf657 | [
"Apache-2.0",
"MIT"
] | 2 | 2020-11-05T19:01:03.000Z | 2021-01-19T19:58:48.000Z | test.py | callumfrance/ThisPersonDoesNotExistAPI | 8aaf83a65f3d527be087610ee3758d665babf657 | [
"Apache-2.0",
"MIT"
] | null | null | null | test.py | callumfrance/ThisPersonDoesNotExistAPI | 8aaf83a65f3d527be087610ee3758d665babf657 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-03-16T11:02:26.000Z | 2021-03-16T11:02:26.000Z | import asyncio
from thispersondoesnotexist import get_online_person, save_online_person
loop = asyncio.get_event_loop()
loop.run_until_complete(main()) | 19.928571 | 72 | 0.767025 | import asyncio
from thispersondoesnotexist import get_online_person, save_online_person
async def main():
# picture = await get_online_person()
# print(picture)
await save_online_person('test.png')
loop = asyncio.get_event_loop()
loop.run_until_complete(main()) | 101 | 0 | 23 |
bf99192e6c6314c0c50f380e59c48b9b0a88a055 | 1,502 | py | Python | python/lad/tests/test_lad.py | mirca/least-absolute-deviations | d6e8463e0bfd38000e4696c7048f5935df6b304e | [
"MIT"
] | 4 | 2018-07-14T02:56:25.000Z | 2019-10-12T10:12:30.000Z | python/lad/tests/test_lad.py | mirca/least-absolute-deviations | d6e8463e0bfd38000e4696c7048f5935df6b304e | [
"MIT"
] | 5 | 2018-06-10T13:11:39.000Z | 2019-03-19T16:14:59.000Z | python/lad/tests/test_lad.py | mirca/least-absolute-deviations | d6e8463e0bfd38000e4696c7048f5935df6b304e | [
"MIT"
] | 2 | 2019-03-19T16:11:17.000Z | 2019-07-01T08:46:53.000Z | import tensorflow as tf
import numpy as np
import pytest
from ..lad import lad, lad_polyfit
sess = tf.Session()
true_params = np.array([3, 10])
x = np.linspace(-1, 1, 10000)
y = np.random.laplace(loc=x * true_params[0] + true_params[1], scale=1.)
@pytest.mark.parametrize("yerr", [(None), (np.ones(len(y))), (np.std(... | 38.512821 | 103 | 0.627164 | import tensorflow as tf
import numpy as np
import pytest
from ..lad import lad, lad_polyfit
sess = tf.Session()
true_params = np.array([3, 10])
x = np.linspace(-1, 1, 10000)
y = np.random.laplace(loc=x * true_params[0] + true_params[1], scale=1.)
@pytest.mark.parametrize("yerr", [(None), (np.ones(len(y))), (np.std(... | 784 | 0 | 88 |
ba31972842ede1fcd2bfaff44d561f3756b6c72a | 2,319 | py | Python | venv/lib/python3.9/site-packages/pydata_google_auth/_webserver.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 32 | 2018-09-14T23:31:00.000Z | 2022-03-28T16:02:37.000Z | venv/lib/python3.9/site-packages/pydata_google_auth/_webserver.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 38 | 2018-08-14T20:52:52.000Z | 2022-03-10T21:02:35.000Z | venv/lib/python3.9/site-packages/pydata_google_auth/_webserver.py | qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 | 630dcef73e6a258b6e9a52f934e2dd912ce741f8 | [
"Apache-2.0"
] | 10 | 2018-08-19T01:39:34.000Z | 2022-02-28T14:26:33.000Z | """Helpers for running a local webserver to receive authorization code."""
import socket
from contextlib import closing
from pydata_google_auth import exceptions
LOCALHOST = "localhost"
DEFAULT_PORTS_TO_TRY = 100
def is_port_open(port):
"""Check if a port is open on localhost.
Based on StackOverflow answ... | 25.766667 | 78 | 0.641656 | """Helpers for running a local webserver to receive authorization code."""
import socket
from contextlib import closing
from pydata_google_auth import exceptions
LOCALHOST = "localhost"
DEFAULT_PORTS_TO_TRY = 100
def is_port_open(port):
"""Check if a port is open on localhost.
Based on StackOverflow answ... | 0 | 0 | 0 |
e16a1165292bbf1bedad6c78d031716220a41e24 | 5,380 | py | Python | campaigns/models.py | alimahdiyar/Developing-Community-Web | a663a687e0f286f197d4a7bf347f67cd130275f7 | [
"MIT"
] | 2 | 2018-06-02T12:30:00.000Z | 2018-07-19T14:41:39.000Z | campaigns/models.py | Developing-Community/Developing-Community-Web | a663a687e0f286f197d4a7bf347f67cd130275f7 | [
"MIT"
] | 5 | 2021-06-08T19:09:00.000Z | 2022-03-11T23:25:14.000Z | campaigns/models.py | Developing-Community/web | a663a687e0f286f197d4a7bf347f67cd130275f7 | [
"MIT"
] | 2 | 2018-05-27T14:58:34.000Z | 2018-05-27T15:03:04.000Z | from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils import timezone
from enumfields import Enum # Uses Ethan Furman's "enum34" backport
from enumfields import EnumField
from sorl.thumbnail import Imag... | 35.163399 | 115 | 0.686803 | from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils import timezone
from enumfields import Enum # Uses Ethan Furman's "enum34" backport
from enumfields import EnumField
from sorl.thumbnail import Imag... | 288 | 4,333 | 253 |
3b3e51bbf94b1d39d45c67a57ee1414456ec670b | 181,187 | py | Python | src/cplex/_internal/_pycplex.py | tfang94/paql-project | 0848d13a0f2489349d196a596cc1a1a1f2ee1bfe | [
"MIT"
] | 1 | 2021-04-28T21:30:39.000Z | 2021-04-28T21:30:39.000Z | src/cplex/_internal/_pycplex.py | tfang94/paql-project | 0848d13a0f2489349d196a596cc1a1a1f2ee1bfe | [
"MIT"
] | null | null | null | src/cplex/_internal/_pycplex.py | tfang94/paql-project | 0848d13a0f2489349d196a596cc1a1a1f2ee1bfe | [
"MIT"
] | 3 | 2021-04-25T16:51:47.000Z | 2022-02-03T21:04:34.000Z | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | 60.577399 | 1,804 | 0.802933 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | 87,161 | 9,077 | 11,590 |
22e20f03dc46b1e9d6eade314e381279b10a06e0 | 1,703 | py | Python | GenerIter/processor/Mix.py | GridPresence/GenerIter | f0b74cd6c1d1bb9a23fccb28fa8b972f9eeccaf8 | [
"MIT"
] | 7 | 2021-01-07T19:03:10.000Z | 2021-03-05T08:05:17.000Z | GenerIter/processor/Mix.py | GridPresence/GenerIter | f0b74cd6c1d1bb9a23fccb28fa8b972f9eeccaf8 | [
"MIT"
] | 2 | 2021-01-26T12:45:58.000Z | 2021-02-15T11:06:14.000Z | GenerIter/processor/Mix.py | GridPresence/GenerIter | f0b74cd6c1d1bb9a23fccb28fa8b972f9eeccaf8 | [
"MIT"
] | 1 | 2021-01-24T05:21:28.000Z | 2021-01-24T05:21:28.000Z | """
Generator class for some Process-based mixing algorithms.
Copyright 2020 Thomas Jackson Park & Jeremy Pavier
"""
import os
import random
import inspect
from pydub import AudioSegment
from GenerIter.process import Process
from GenerIter.util import debug, nextPowerOf2
import GenerIter.excepts as robox
| 30.410714 | 100 | 0.598356 | """
Generator class for some Process-based mixing algorithms.
Copyright 2020 Thomas Jackson Park & Jeremy Pavier
"""
import os
import random
import inspect
from pydub import AudioSegment
from GenerIter.process import Process
from GenerIter.util import debug, nextPowerOf2
import GenerIter.excepts as robox
class Mix(P... | 1,321 | -2 | 76 |
7f18aacd0cfd85d08e6a79111b1cccd0674a4fce | 19,492 | py | Python | misc/deep_learning_notes/Ch4_Recurrent_Networks/002_vanila_RNN_with_edf/edf.py | tmjnow/MoocX | 52c8450ff7ecc8450a8adc2457233d5777a3d5bb | [
"MIT"
] | 7 | 2017-06-13T05:24:15.000Z | 2022-01-09T01:10:28.000Z | misc/deep_learning_notes/Ch4_Recurrent_Networks/002_vanila_RNN_with_edf/edf.py | kinshuk4/Coursera | 52c8450ff7ecc8450a8adc2457233d5777a3d5bb | [
"MIT"
] | 11 | 2017-05-08T23:30:50.000Z | 2017-06-24T21:57:42.000Z | misc/deep_learning_notes/Ch4_Recurrent_Networks/002_vanila_RNN_with_edf/edf.py | kinshuk4/MoocX | 52c8450ff7ecc8450a8adc2457233d5777a3d5bb | [
"MIT"
] | 4 | 2017-10-05T12:56:53.000Z | 2020-06-14T17:01:32.000Z | import numpy as np
DT = np.float32
eps = 1e-12
# Globals
components = []
params = []
# Global forward/backward
# Optimization functions
# Values
# Parameters
# Xavier initializer
# Utility function for shape inference with broadcasting
#### Actual components
class Add: # Add with broadcasting
"""... | 30.314152 | 360 | 0.579776 | import numpy as np
DT = np.float32
eps = 1e-12
# Globals
components = []
params = []
# Global forward/backward
def Forward():
for c in components:
c.forward()
def Backward(loss):
for c in components:
if c.grad is not None: c.grad = DT(0)
loss.grad = np.ones_like(loss.value)
for c in... | 10,336 | -18 | 1,968 |
29d18b780f4ac7bfea32226a11abc78d881f754d | 881 | py | Python | jupyterprobe/memory_utils.py | vermashresth/jupyter-probe | cec35399dbe0d19d4264df02df305504bea0f695 | [
"MIT"
] | 8 | 2020-12-15T14:19:29.000Z | 2021-09-23T03:39:21.000Z | build/lib/jupyterprobe/memory_utils.py | vermashresth/jupyter-probe | cec35399dbe0d19d4264df02df305504bea0f695 | [
"MIT"
] | null | null | null | build/lib/jupyterprobe/memory_utils.py | vermashresth/jupyter-probe | cec35399dbe0d19d4264df02df305504bea0f695 | [
"MIT"
] | null | null | null | import os
import psutil
| 30.37931 | 80 | 0.634506 | import os
import psutil
def memory_usage_psutil(pid=None):
if pid is None:
pid = os.getpid()
process = psutil.Process(pid)
return process.memory_percent()
def get_memory_info_gpu_cpu():
res = {}
cpu = psutil.virtual_memory()
cpu_total = round(cpu[0]/2**30, 1)
cpu_used = round(cpu[3... | 811 | 0 | 46 |
2471ad588b4c0f46ff2f08f2c04ab2774fa69018 | 1,661 | py | Python | pymoira/utils.py | vasilvv/pymoira | 27facba223c220bf4c55d9b7e799a2ff951eef13 | [
"MIT"
] | 2 | 2015-11-13T23:03:12.000Z | 2015-12-19T02:43:20.000Z | pymoira/utils.py | vasilvv/pymoira | 27facba223c220bf4c55d9b7e799a2ff951eef13 | [
"MIT"
] | null | null | null | pymoira/utils.py | vasilvv/pymoira | 27facba223c220bf4c55d9b7e799a2ff951eef13 | [
"MIT"
] | 1 | 2019-10-23T06:26:13.000Z | 2019-10-23T06:26:13.000Z | #
## PyMoira client library
##
## This file contains the utility functions common for multiple modules.
#
import datetime
from .errors import UserError
def convertToMoiraValue(val):
"""Converts data from Python to Moira protocol representation."""
if type(val) == bool:
return '1' if val else '0'
... | 29.140351 | 93 | 0.635762 | #
## PyMoira client library
##
## This file contains the utility functions common for multiple modules.
#
import datetime
from .errors import UserError
def convertMoiraBool(val):
if val == '1':
return True
if val == '0':
return False
raise UserError("Invalid boolean value received from Moi... | 309 | 0 | 69 |
fa6009dfdc1734e54f9947589f388129abb13195 | 1,072 | py | Python | lambda/test.py | p1ass/emojic.ch | 5dace9d4ba6f6a46cfbd29746c74964ad8ba1822 | [
"MIT"
] | 14 | 2020-04-03T04:14:49.000Z | 2021-08-12T04:24:43.000Z | lambda/test.py | p1ass/emojic.ch | 5dace9d4ba6f6a46cfbd29746c74964ad8ba1822 | [
"MIT"
] | 78 | 2020-04-03T04:02:31.000Z | 2021-06-04T01:18:24.000Z | lambda/test.py | naoki-kishi/emojic.ch | 5dace9d4ba6f6a46cfbd29746c74964ad8ba1822 | [
"MIT"
] | 1 | 2020-05-09T12:24:08.000Z | 2020-05-09T12:24:08.000Z | import unittest
import base64
from detect_face import lambda_handler
# 顔があると200が返ってくる
# 顔がないと204が返ってくる
# 画像以外のファイルを拡張子を偽ってアップロードしてもダメ
if __name__ == "__main__":
unittest.main()
| 26.8 | 62 | 0.650187 | import unittest
import base64
from detect_face import lambda_handler
class TestLambdaHandler(unittest.TestCase):
def setUp(self):
self.IMAGE_DIRECTORY = "./test_images/"
def getResponse(self, filename):
with open(self.IMAGE_DIRECTORY + filename, "rb") as f:
img_binary = f.read()
... | 696 | 22 | 155 |
28112880e291a8479345abe72ce6130d81553134 | 3,232 | py | Python | mkt/api/base.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | mkt/api/base.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | mkt/api/base.py | oremj/zamboni | a751dc6d22f7af947da327b0a091cbab0a999f49 | [
"BSD-3-Clause"
] | null | null | null | import json
from django.core.exceptions import ObjectDoesNotExist
from tastypie import http
from tastypie.bundle import Bundle
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import ModelResource
import commonware.log
import oauth2
from translations.fields import PurifiedField, Translat... | 34.752688 | 78 | 0.626238 | import json
from django.core.exceptions import ObjectDoesNotExist
from tastypie import http
from tastypie.bundle import Bundle
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import ModelResource
import commonware.log
import oauth2
from translations.fields import PurifiedField, Translat... | 1,858 | 981 | 23 |
0ff92fee0b03da94feeb1de00edd583d81887727 | 953 | py | Python | instagramApp/migrations/0002_auto_20211016_1005.py | Tito-74/Instagram-App | b44f21fb0c7aa5f8e978194814e603b8f9c66592 | [
"MIT"
] | null | null | null | instagramApp/migrations/0002_auto_20211016_1005.py | Tito-74/Instagram-App | b44f21fb0c7aa5f8e978194814e603b8f9c66592 | [
"MIT"
] | null | null | null | instagramApp/migrations/0002_auto_20211016_1005.py | Tito-74/Instagram-App | b44f21fb0c7aa5f8e978194814e603b8f9c66592 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-16 07:05
from django.db import migrations, models
import django.db.models.deletion
| 32.862069 | 117 | 0.60021 | # Generated by Django 3.2.8 on 2021-10-16 07:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('instagramApp', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='post',
... | 0 | 806 | 23 |
bdbc3c77437b54a570ec5093b2f5ef0704bf1f22 | 929 | py | Python | tools/cardiac_py/DMD/JParser.py | paulkefer/cardioid | 59c07b714d8b066b4f84eb50487c36f6eadf634c | [
"MIT-0",
"MIT"
] | 33 | 2018-12-12T20:05:06.000Z | 2021-09-26T13:30:16.000Z | tools/cardiac_py/DMD/JParser.py | paulkefer/cardioid | 59c07b714d8b066b4f84eb50487c36f6eadf634c | [
"MIT-0",
"MIT"
] | 5 | 2019-04-25T11:34:43.000Z | 2021-11-14T04:35:37.000Z | tools/cardiac_py/DMD/JParser.py | paulkefer/cardioid | 59c07b714d8b066b4f84eb50487c36f6eadf634c | [
"MIT-0",
"MIT"
] | 15 | 2018-12-21T22:44:59.000Z | 2021-08-29T10:30:25.000Z | '''
Created on 27/02/2013
@author: butler
'''
import json
class JParser(object):
'''
Parser for json config file. As this is designed to be '
'''
def __init__(self, file_name):
'''
'''
self.file_name = file_name
"""
self.delta_t_ms
self.sample_rate
... | 23.225 | 60 | 0.518837 | '''
Created on 27/02/2013
@author: butler
'''
import json
class JParser(object):
'''
Parser for json config file. As this is designed to be '
'''
def __init__(self, file_name):
'''
'''
self.file_name = file_name
"""
self.delta_t_ms
self.sample_rate
... | 510 | 0 | 27 |
53582b3a4539df932cca9ee602fac6455a7e9b85 | 1,443 | py | Python | trade.py | chris-greening/coinbase-portfolio | c20226079d1236e71368860e6f24b01df789a3ed | [
"MIT"
] | null | null | null | trade.py | chris-greening/coinbase-portfolio | c20226079d1236e71368860e6f24b01df789a3ed | [
"MIT"
] | null | null | null | trade.py | chris-greening/coinbase-portfolio | c20226079d1236e71368860e6f24b01df789a3ed | [
"MIT"
] | null | null | null | import datetime
import pytz
from decimal import Decimal
| 40.083333 | 100 | 0.607069 | import datetime
import pytz
from decimal import Decimal
class Trade:
def __init__(self, coinbase_resp):
"""Parse response data from Coinbase API"""
self.coinbase_resp = coinbase_resp
self.parse_response()
def parse_response(self):
self.amount = Decimal(self.coinbase_... | 1,115 | 246 | 24 |
dfaaf65c142c6efc4c3a5d05426059f979f9b07b | 418 | py | Python | practice.py | narayanants/python-mega-course | 2ba2980ab21dfbed5f86f00695559f7831b5c566 | [
"MIT"
] | null | null | null | practice.py | narayanants/python-mega-course | 2ba2980ab21dfbed5f86f00695559f7831b5c566 | [
"MIT"
] | null | null | null | practice.py | narayanants/python-mega-course | 2ba2980ab21dfbed5f86f00695559f7831b5c566 | [
"MIT"
] | null | null | null | x = 1
y = 'Hello'
z = 10.123
d = x + z
print(d)
print(type(x))
print(type(y))
print(y.upper())
print(y.lower())
print(type(z))
a = [1,2,3,4,5,6,6,7,8]
print(len(a))
print(a.count(6))
b = list(range(10,100,10))
print(b)
stud_marks = {"Madhan":90, "Raj":25,"Mani":80}
print(stud_marks.keys())
print(stud_marks.va... | 11.611111 | 46 | 0.617225 | x = 1
y = 'Hello'
z = 10.123
d = x + z
print(d)
print(type(x))
print(type(y))
print(y.upper())
print(y.lower())
print(type(z))
a = [1,2,3,4,5,6,6,7,8]
print(len(a))
print(a.count(6))
b = list(range(10,100,10))
print(b)
stud_marks = {"Madhan":90, "Raj":25,"Mani":80}
print(stud_marks.keys())
print(stud_marks.va... | 0 | 0 | 0 |
7fb662a179c9be0efb6d3755e45803047f17796c | 1,347 | py | Python | telegram/main.py | hakierspejs/mierzyciel | bb680854fd351820c45415b8e85702ea60851b0d | [
"WTFPL"
] | null | null | null | telegram/main.py | hakierspejs/mierzyciel | bb680854fd351820c45415b8e85702ea60851b0d | [
"WTFPL"
] | null | null | null | telegram/main.py | hakierspejs/mierzyciel | bb680854fd351820c45415b8e85702ea60851b0d | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
import logging
import socket
import urllib.request
import time
LOGGER = logging.getLogger('mierzyciel.telegram')
if __name__ == '__main__':
fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logging.basicConfig(level='INFO', format=fmt)
main()
| 30.613636 | 78 | 0.604306 | #!/usr/bin/env python
import logging
import socket
import urllib.request
import time
LOGGER = logging.getLogger('mierzyciel.telegram')
def get_telegram_stats(chat_name):
s = urllib.request.urlopen('https://t.me/' + chat_name).read().decode()
prefix = '<div class="tgme_page_extra">'
line = [x for x in s.s... | 987 | 0 | 69 |
2cfaac913c747cb5c044f427f461fb959f263be3 | 4,312 | py | Python | tests/test_utils.py | dbluhm/aries-staticagent-python | 1f27f85cf72cc6a2e10a6495c85f2b21462362cd | [
"Apache-2.0"
] | 18 | 2019-06-20T18:19:36.000Z | 2022-01-17T04:30:18.000Z | tests/test_utils.py | dbluhm/aries-staticagent-python | 1f27f85cf72cc6a2e10a6495c85f2b21462362cd | [
"Apache-2.0"
] | 16 | 2019-06-20T18:24:49.000Z | 2021-05-19T17:38:40.000Z | tests/test_utils.py | dbluhm/aries-staticagent-python | 1f27f85cf72cc6a2e10a6495c85f2b21462362cd | [
"Apache-2.0"
] | 20 | 2019-06-20T16:54:13.000Z | 2021-12-03T00:08:37.000Z | """ Test utilities. """
import pytest
from aries_staticagent import utils, Message
from aries_staticagent.mtc import (
AUTHCRYPT_AFFIRMED,
AUTHCRYPT_DENIED,
ANONCRYPT_AFFIRMED,
ANONCRYPT_DENIED,
)
@pytest.fixture
def test_preprocess():
"""Test preprocessing decorator."""
@utils.preprocess... | 21.668342 | 81 | 0.666744 | """ Test utilities. """
import pytest
from aries_staticagent import utils, Message
from aries_staticagent.mtc import (
AUTHCRYPT_AFFIRMED,
AUTHCRYPT_DENIED,
ANONCRYPT_AFFIRMED,
ANONCRYPT_DENIED,
)
@pytest.fixture
def message():
yield Message.parse_obj(
{"@type": "doc_uri/protocol/0.1/tes... | 764 | 0 | 553 |
12015e477b8e55a091fff7f2d84582fa6e3275ff | 1,486 | py | Python | HLTriggerOffline/HeavyFlavor/python/heavyFlavorValidation_cfi.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | HLTriggerOffline/HeavyFlavor/python/heavyFlavorValidation_cfi.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | HLTriggerOffline/HeavyFlavor/python/heavyFlavorValidation_cfi.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
heavyFlavorValidation = cms.EDAnalyzer("HeavyFlavorValidation",
DQMFolder = cms.untracked.string("HLT/HeavyFlavor"),
TriggerProcessName = cms.untracked.string("HLT"),
TriggerPathName = cms.untracked.string("HLT_Mu5"),
TriggerSummaryRAW = cms.untracked.string("hl... | 55.037037 | 105 | 0.697174 | import FWCore.ParameterSet.Config as cms
heavyFlavorValidation = cms.EDAnalyzer("HeavyFlavorValidation",
DQMFolder = cms.untracked.string("HLT/HeavyFlavor"),
TriggerProcessName = cms.untracked.string("HLT"),
TriggerPathName = cms.untracked.string("HLT_Mu5"),
TriggerSummaryRAW = cms.untracked.string("hl... | 0 | 0 | 0 |
9809ab5317cd085c73700d8f77b21ca36ba30fc5 | 1,292 | py | Python | utils/config.py | ogrenenmakine/VCL-PL-Semi-Supervised-Learning-from-Noisy-Web-Data-with-Variational-Contrastive-Learning | baef25837ce7e073d03f69a095d1992aa18dd2d5 | [
"MIT"
] | null | null | null | utils/config.py | ogrenenmakine/VCL-PL-Semi-Supervised-Learning-from-Noisy-Web-Data-with-Variational-Contrastive-Learning | baef25837ce7e073d03f69a095d1992aa18dd2d5 | [
"MIT"
] | null | null | null | utils/config.py | ogrenenmakine/VCL-PL-Semi-Supervised-Learning-from-Noisy-Web-Data-with-Variational-Contrastive-Learning | baef25837ce7e073d03f69a095d1992aa18dd2d5 | [
"MIT"
] | null | null | null | """
Authors: Wouter Van Gansbeke, Simon Vandenhende
Licensed under the CC BY-NC 4.0 license (https://creativecommons.org/licenses/by-nc/4.0/)
"""
import os
import yaml
from easydict import EasyDict
from utils.utils import mkdir_if_missing
| 36.914286 | 92 | 0.706656 | """
Authors: Wouter Van Gansbeke, Simon Vandenhende
Licensed under the CC BY-NC 4.0 license (https://creativecommons.org/licenses/by-nc/4.0/)
"""
import os
import yaml
from easydict import EasyDict
from utils.utils import mkdir_if_missing
def create_config(config_file_env, config_file_exp, batch_size, epochs):
# C... | 1,029 | 0 | 24 |
24dea8c23635079d76503504a11ec99b74c28151 | 1,839 | py | Python | fuzzytools/matplotlib/lims.py | oscarpimentel/fuzzy-tools | edbde6a1e56c1c564cca609e4d0cc9cda906b992 | [
"MIT"
] | null | null | null | fuzzytools/matplotlib/lims.py | oscarpimentel/fuzzy-tools | edbde6a1e56c1c564cca609e4d0cc9cda906b992 | [
"MIT"
] | null | null | null | fuzzytools/matplotlib/lims.py | oscarpimentel/fuzzy-tools | edbde6a1e56c1c564cca609e4d0cc9cda906b992 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import division
from . import _C
import matplotlib.pyplot as plt
import numpy as np
from copy import copy, deepcopy
EXTENDED_PERCENT = 0.1
############################################################################################################################... | 35.365385 | 163 | 0.650353 | from __future__ import print_function
from __future__ import division
from . import _C
import matplotlib.pyplot as plt
import numpy as np
from copy import copy, deepcopy
EXTENDED_PERCENT = 0.1
############################################################################################################################... | 1,180 | 2 | 165 |
34463d3a7056ec3ca5a9a4b2f7a2cc3412f5557e | 1,127 | py | Python | emg_analyzer/argparse_utils.py | freeh4cker/emg_analyser | 63ab91aaa7c9b36959e1d1038c89108fbce821f5 | [
"BSD-3-Clause"
] | 1 | 2020-07-29T19:07:55.000Z | 2020-07-29T19:07:55.000Z | emg_analyzer/argparse_utils.py | freeh4cker/emg_analyser | 63ab91aaa7c9b36959e1d1038c89108fbce821f5 | [
"BSD-3-Clause"
] | 7 | 2017-12-16T23:25:18.000Z | 2018-01-24T22:04:09.000Z | emg_analyzer/argparse_utils.py | freeh4cker/emg_analyser | 63ab91aaa7c9b36959e1d1038c89108fbce821f5 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
# Copyright (c) 2017-2018 Bertrand Néron. All rights reserved. #
# Use of this source code is governed by a BSD-style license that can be #
# found in the LICENSE file. #
###############... | 40.25 | 86 | 0.568767 | ##########################################################################
# Copyright (c) 2017-2018 Bertrand Néron. All rights reserved. #
# Use of this source code is governed by a BSD-style license that can be #
# found in the LICENSE file. #
###############... | 0 | 0 | 0 |
0e91c58634a794d0f8effa722b00f5f2c6a299c5 | 852 | py | Python | main.py | pratyushravishankar/audio-recognition | 403a527906601b23716cc4b0136d4bf3ddcb3bc8 | [
"MIT"
] | null | null | null | main.py | pratyushravishankar/audio-recognition | 403a527906601b23716cc4b0136d4bf3ddcb3bc8 | [
"MIT"
] | null | null | null | main.py | pratyushravishankar/audio-recognition | 403a527906601b23716cc4b0136d4bf3ddcb3bc8 | [
"MIT"
] | null | null | null | import utils
from sklearn.model_selection import train_test_split
import lsh_random_projection as LSH
import pickle
build_model()
with open('lsh.pkl', 'rb') as input:
lsh = pickle.load(input)
# lsh.get()
| 24.342857 | 73 | 0.712441 | import utils
from sklearn.model_selection import train_test_split
import lsh_random_projection as LSH
import pickle
def build_model():
features = utils.load("data/fma_metadata/features.csv")
tracks = utils.load('data/fma_metadata/tracks.csv')
non_nulls_tracks = tracks[tracks['track']['genre_top'].notnul... | 589 | 0 | 46 |
13404955476ece8a5721e805c365b907490b523b | 3,264 | py | Python | pyprobml-master/examples/keras/vgg-keras.py | storopoli/Machine-Learning-Probalistic | f8617e7b81f4d6c71e72edc40ba11ac746794a95 | [
"MIT"
] | 1 | 2019-03-04T05:43:10.000Z | 2019-03-04T05:43:10.000Z | Old/examples/keras/vgg-keras.py | tywang89/pyprobml | 82cfdcb8daea653cda8f77e8737e585418476ca7 | [
"MIT"
] | null | null | null | Old/examples/keras/vgg-keras.py | tywang89/pyprobml | 82cfdcb8daea653cda8f77e8737e585418476ca7 | [
"MIT"
] | null | null | null | # Example of applying VGG16 classifier
# Based on Keras book sec 5.4.3.
from keras.applications.vgg16 import VGG16
from keras.applications.vgg16 import preprocess_input, decode_predictions
from keras.preprocessing import image
#import matplotlib.pyplot as plt
import numpy as np
#import urllib
#from keras.application... | 39.804878 | 141 | 0.747855 | # Example of applying VGG16 classifier
# Based on Keras book sec 5.4.3.
from keras.applications.vgg16 import VGG16
from keras.applications.vgg16 import preprocess_input, decode_predictions
from keras.preprocessing import image
#import matplotlib.pyplot as plt
import numpy as np
#import urllib
#from keras.application... | 0 | 0 | 0 |
e1e6b7f0ec0d3411bf4fc0e68ffd0e08d835ed25 | 2,056 | py | Python | spotify_api/__init__.py | nerd8622/Python-Spotify-API | 4f750bb0fff39da141a48c5c08396bd340cfe2fb | [
"MIT"
] | null | null | null | spotify_api/__init__.py | nerd8622/Python-Spotify-API | 4f750bb0fff39da141a48c5c08396bd340cfe2fb | [
"MIT"
] | null | null | null | spotify_api/__init__.py | nerd8622/Python-Spotify-API | 4f750bb0fff39da141a48c5c08396bd340cfe2fb | [
"MIT"
] | null | null | null | from .web_requests import safeGet
| 33.704918 | 129 | 0.601167 | from .web_requests import safeGet
class API:
def __init__(self, token):
self.url = lambda s: f"https://api.spotify.com/v1/{s}"
self.authHeader = {'Authorization': f'Bearer {token}'}
def get_album_tracks(self, a_id):
response = safeGet(self.url(f'albums/{a_id}/tracks'), {}, self.authHe... | 1,709 | -36 | 339 |