hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7425b52a9b64e9c276d2c700fe346b94f2c87aa | 4,632 | py | Python | examples/compose/plot_compare_reduction.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 27 | 2015-01-22T22:30:09.000Z | 2022-02-15T07:33:06.000Z | examples/compose/plot_compare_reduction.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 29 | 2021-03-04T02:56:48.000Z | 2021-04-06T04:06:45.000Z | examples/compose/plot_compare_reduction.py | emarkou/scikit-learn | d73822f84f2832dcc25f0ff58769f60871a78025 | [
"BSD-3-Clause"
] | 25 | 2015-07-30T13:47:25.000Z | 2021-08-03T07:48:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
=================================================================
Selecting dimensionality reduction with Pipeline and GridSearchCV
=================================================================
This example constructs a pipeline that does dimensionality
reduction f... | 35.906977 | 79 | 0.689983 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_digits
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from sklearn.svm import LinearSVC
from sklearn.decomposition import PCA, NMF
from sklearn.feature_selection import SelectKBest, chi2
p... | true | true |
f7425c77f2e193ae8ca6cdc1f28da65eb219eabe | 583 | py | Python | server/async_client.py | infotraining-team/python-asyncio-2021-06-14 | 507bc4997e5038022b1844e3baa7276e81dd977e | [
"CC0-1.0"
] | null | null | null | server/async_client.py | infotraining-team/python-asyncio-2021-06-14 | 507bc4997e5038022b1844e3baa7276e81dd977e | [
"CC0-1.0"
] | null | null | null | server/async_client.py | infotraining-team/python-asyncio-2021-06-14 | 507bc4997e5038022b1844e3baa7276e81dd977e | [
"CC0-1.0"
] | 1 | 2021-06-26T08:39:01.000Z | 2021-06-26T08:39:01.000Z | import asyncio
import time
n = 0
async def monitor():
global n
while True:
await asyncio.sleep(1)
print(f"{n} req/sec")
n = 0
async def client(address, num):
global n
reader, writer = await asyncio.open_connection(*address)
while True:
writer.write(b'1000')
... | 21.592593 | 90 | 0.595197 | import asyncio
import time
n = 0
async def monitor():
global n
while True:
await asyncio.sleep(1)
print(f"{n} req/sec")
n = 0
async def client(address, num):
global n
reader, writer = await asyncio.open_connection(*address)
while True:
writer.write(b'1000')
... | true | true |
f7425d36fe0f6897968f289c5528c4b52be383e4 | 23,070 | py | Python | utils/check_repo.py | slowy07/transformers | 7223844df9738719ee335428a326cd712f506806 | [
"Apache-2.0"
] | 15 | 2021-08-10T01:10:44.000Z | 2022-01-20T15:23:49.000Z | utils/check_repo.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 1 | 2020-03-21T21:38:47.000Z | 2020-03-21T21:38:50.000Z | utils/check_repo.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 1 | 2021-04-02T20:42:10.000Z | 2021-04-02T20:42:10.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# 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... | 40.831858 | 141 | 0.687603 |
import importlib
import inspect
import os
import re
import warnings
from pathlib import Path
from transformers import is_flax_available, is_tf_available, is_torch_available
from transformers.file_utils import ENV_VARS_TRUE_VALUES
from transformers.models.auto import get_values
PATH_TO_TRANSFORMERS =... | true | true |
f7425dfef542a002ada91530f02a4bc313261b7a | 13,083 | py | Python | hcloud/images/client.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | 1 | 2019-10-23T01:00:08.000Z | 2019-10-23T01:00:08.000Z | hcloud/images/client.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | null | null | null | hcloud/images/client.py | usmannasir/hcloud-python | 2a90551fb1c4d9d8a6aea5d8b6601a7c1360494d | [
"MIT"
] | 1 | 2019-06-19T17:53:10.000Z | 2019-06-19T17:53:10.000Z | # -*- coding: utf-8 -*-
from hcloud.actions.client import BoundAction
from hcloud.core.client import BoundModelBase, ClientEntityBase, GetEntityByNameMixin
from hcloud.core.domain import add_meta_to_result
from hcloud.images.domain import Image
class BoundImage(BoundModelBase):
model = Image
def __init__(se... | 48.455556 | 281 | 0.610181 |
from hcloud.actions.client import BoundAction
from hcloud.core.client import BoundModelBase, ClientEntityBase, GetEntityByNameMixin
from hcloud.core.domain import add_meta_to_result
from hcloud.images.domain import Image
class BoundImage(BoundModelBase):
model = Image
def __init__(self, client, data):
... | true | true |
f7425f7f34377c2adc0023474c72890a47102ebe | 1,767 | py | Python | DP/PolicyEvaluation.py | junhyeokahn/RLBasicAlgorithm | 25e3e471336cb7855e28c0f9905e2214afdeb2e4 | [
"MIT"
] | 2 | 2019-08-21T04:56:10.000Z | 2020-09-05T19:55:32.000Z | DP/PolicyEvaluation.py | junhyeokahn/RLBasicAlgorithm | 25e3e471336cb7855e28c0f9905e2214afdeb2e4 | [
"MIT"
] | null | null | null | DP/PolicyEvaluation.py | junhyeokahn/RLBasicAlgorithm | 25e3e471336cb7855e28c0f9905e2214afdeb2e4 | [
"MIT"
] | 1 | 2020-11-08T07:31:56.000Z | 2020-11-08T07:31:56.000Z | import numpy as np
import sys
if "../" not in sys.path:
sys.path.append("../")
from lib.envs.gridworld import GridworldEnv
env = GridworldEnv()
def policy_eval(policy, env, discount_factor=1.0, theta=0.00001):
"""
Evaluate a policy given an environment and a full description of the
environment's dyn... | 29.949153 | 79 | 0.603282 | import numpy as np
import sys
if "../" not in sys.path:
sys.path.append("../")
from lib.envs.gridworld import GridworldEnv
env = GridworldEnv()
def policy_eval(policy, env, discount_factor=1.0, theta=0.00001):
V = np.zeros(env.nS)
while True:
delta=0
for s in range(env.nS):
... | true | true |
f7425fb763558cbbbafe06d31ae47cd2986b8150 | 1,759 | py | Python | venv/Scripts/rst2odt_prepstyles.py | sampaiowysk/GPTo | 592d1980f1a149961bbb1c7015bdaa9c97a75070 | [
"MIT"
] | null | null | null | venv/Scripts/rst2odt_prepstyles.py | sampaiowysk/GPTo | 592d1980f1a149961bbb1c7015bdaa9c97a75070 | [
"MIT"
] | null | null | null | venv/Scripts/rst2odt_prepstyles.py | sampaiowysk/GPTo | 592d1980f1a149961bbb1c7015bdaa9c97a75070 | [
"MIT"
] | null | null | null | #!C:\Users\DTI-GSAMPAIO\Python\Day of Data Science\GPTo\venv\Scripts\python.exe
# $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Fix a word-processor-generated styles.odt for odtwriter use: D... | 25.867647 | 79 | 0.642979 |
from lxml import etree
import sys
import zipfile
from tempfile import mkstemp
import shutil
import os
NAMESPACES = {
"style": "urn:oasis:names:tc:opendocument:xmlns:style:1.0",
"fo": "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
}
def prepstyle(filename):
zin = zipfile.ZipFi... | true | true |
f74260d61de5dfb3bc1367f0c5af7a24d8b5476e | 2,301 | py | Python | tests/test_rollardex.py | mandshaw/lethe | 05f3e8b7394c6fc6347af825366119db2c4cd3e0 | [
"MIT"
] | null | null | null | tests/test_rollardex.py | mandshaw/lethe | 05f3e8b7394c6fc6347af825366119db2c4cd3e0 | [
"MIT"
] | null | null | null | tests/test_rollardex.py | mandshaw/lethe | 05f3e8b7394c6fc6347af825366119db2c4cd3e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_lethe
----------------------------------
Tests for `lethe` module.
"""
import sys
import shutil
import unittest
from datetime import datetime
import os
from lethe.rollardex import Person, RollarDex
fixtures_dir = os.path.join(os.path.dirname(__file__), 'fixtur... | 35.953125 | 118 | 0.660582 |
import sys
import shutil
import unittest
from datetime import datetime
import os
from lethe.rollardex import Person, RollarDex
fixtures_dir = os.path.join(os.path.dirname(__file__), 'fixtures')
class TestRollarDex(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
d... | true | true |
f7426166945ee8e0b6912de1651615ba712c8029 | 14,180 | py | Python | osmnx/utils.py | pmartincalvo/osmnx | 15eddc0672f0ec951ada1b89eb417df44d35636e | [
"MIT"
] | 2 | 2020-01-31T21:25:32.000Z | 2020-01-31T21:30:15.000Z | osmnx/utils.py | pmartincalvo/osmnx | 15eddc0672f0ec951ada1b89eb417df44d35636e | [
"MIT"
] | null | null | null | osmnx/utils.py | pmartincalvo/osmnx | 15eddc0672f0ec951ada1b89eb417df44d35636e | [
"MIT"
] | null | null | null | import sys
import os
import datetime as dt
import unicodedata
import networkx as nx
import numpy as np
import logging as lg
from . import settings
def citation():
"""
Print the OSMnx package's citation information.
Boeing, G. 2017. OSMnx: New Methods for Acquiring, Constructing, Analyzing,
and Visual... | 34.33414 | 149 | 0.661918 | import sys
import os
import datetime as dt
import unicodedata
import networkx as nx
import numpy as np
import logging as lg
from . import settings
def citation():
cite = ("To cite OSMnx, use:\n\n"
"Boeing, G. 2017. OSMnx: New Methods for Acquiring, Constructing, Analyzing, "
"and Visualiz... | true | true |
f7426175423c4c4002baea3f82c2a60f03d5ce31 | 16,574 | py | Python | usbserial4a/pl2303serial4a.py | jacklinquan/usbserial4a | b78f6ca16336dae94eeebfd930b7db2abfda4162 | [
"MIT"
] | 31 | 2019-03-28T09:02:27.000Z | 2022-03-23T16:58:17.000Z | usbserial4a/pl2303serial4a.py | jacklinquan/usbserial4a | b78f6ca16336dae94eeebfd930b7db2abfda4162 | [
"MIT"
] | 11 | 2019-06-13T05:47:47.000Z | 2022-02-07T03:20:46.000Z | usbserial4a/pl2303serial4a.py | jacklinquan/usbserial4a | b78f6ca16336dae94eeebfd930b7db2abfda4162 | [
"MIT"
] | 16 | 2019-05-05T17:20:40.000Z | 2022-02-13T01:12:44.000Z | """Android USB serial PL2303 driver.
Classes:
Pl2303Serial
"""
from struct import pack, unpack
import time
from .utilserial4a import (
SerialBase,
SerialException,
to_bytes,
PortNotOpenError,
Timeout,
)
from usb4a import usb
class Pl2303Serial(SerialBase):
"""PL2303 serial port class."""
... | 29.438721 | 87 | 0.580669 |
from struct import pack, unpack
import time
from .utilserial4a import (
SerialBase,
SerialException,
to_bytes,
PortNotOpenError,
Timeout,
)
from usb4a import usb
class Pl2303Serial(SerialBase):
DEFAULT_BAUDRATE = 9600
USB_RECIP_INTERFACE = 0x01
PROLIFIC_VENDOR_READ_REQUEST = 0... | true | true |
f742618822a66ed5be2c23765bb3359ce3d21299 | 13,130 | py | Python | homeassistant/components/media_player/pandora.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/media_player/pandora.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 1 | 2017-03-10T22:17:06.000Z | 2017-03-10T22:17:06.000Z | homeassistant/components/media_player/pandora.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2018-06-03T11:14:44.000Z | 2018-11-04T18:18:12.000Z | """
Component for controlling Pandora stations through the pianobar client.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/media_player.pandora/
"""
import logging
import re
import os
import signal
from datetime import timedelta
import shutil
from homeass... | 35.582656 | 79 | 0.612338 |
import logging
import re
import os
import signal
from datetime import timedelta
import shutil
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.components.media_player import (
SUPPORT_NEXT_TRACK, SUPPORT_PAUSE, MEDIA_TYPE_MUSIC,
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_PLAY,
S... | true | true |
f74261f292bca121e0b70b754b47c49d8161b99b | 1,787 | py | Python | meiduo_mall/apps/meiduo_admin/login.py | zhengcongreal/meiduo_project- | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | null | null | null | meiduo_mall/apps/meiduo_admin/login.py | zhengcongreal/meiduo_project- | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | 1 | 2020-10-26T16:10:06.000Z | 2020-10-26T16:10:06.000Z | meiduo_mall/apps/meiduo_admin/login.py | zhengcongreal/meiduo_project | 5899a344859a0c1455e45ed4fb699d2ace08ba18 | [
"Apache-2.0"
] | null | null | null | from rest_framework_jwt.views import JSONWebTokenAPIView
from rest_framework_jwt.serializers import JSONWebTokenSerializer
from django.contrib.auth import authenticate
from rest_framework import serializers
from django.utils.translation import ugettext as _
from rest_framework_jwt.settings import api_settings
jwt_paylo... | 36.469388 | 70 | 0.644656 | from rest_framework_jwt.views import JSONWebTokenAPIView
from rest_framework_jwt.serializers import JSONWebTokenSerializer
from django.contrib.auth import authenticate
from rest_framework import serializers
from django.utils.translation import ugettext as _
from rest_framework_jwt.settings import api_settings
jwt_paylo... | true | true |
f742623c6bbba552f8cd52bd91bea5e26471d170 | 2,858 | py | Python | lib/spack/spack/compilers/arm.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | lib/spack/spack/compilers/arm.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | lib/spack/spack/compilers/arm.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
import spack.compiler
class Arm(spack.compiler.Compiler):
# Subclasses use possible names of C compiler
... | 25.517857 | 92 | 0.590623 |
import re
import spack.compiler
class Arm(spack.compiler.Compiler):
cc_names = ['armclang']
cxx_names = ['armclang++']
f77_names = ['armflang']
fc_names = ['armflang']
link_paths = {'cc': 'arm/armclang',
'cxx': 'arm/armclang++',
... | true | true |
f74262fd8a2fb5486bf6a19954a4f9143ca60948 | 329 | py | Python | urls.py | focusonecc/notification | 02206291804259fb5ddcdfafaddf0bede2cf7e29 | [
"MIT"
] | null | null | null | urls.py | focusonecc/notification | 02206291804259fb5ddcdfafaddf0bede2cf7e29 | [
"MIT"
] | 4 | 2017-12-25T12:32:42.000Z | 2018-01-02T13:17:40.000Z | notification/urls.py | focusonecc/common | d61631d5b1c068422dcf40be199972ed36fa26be | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from django.conf.urls import url
from notification.views import test_ios_notification, test_android_notification
urlpatterns = [
url(r'test/ios/$', test_ios_notification, name='test-ios-notification'),
url(r'test/android/$', test_android_notification, name='test-android-notification'... | 32.9 | 88 | 0.744681 |
from django.conf.urls import url
from notification.views import test_ios_notification, test_android_notification
urlpatterns = [
url(r'test/ios/$', test_ios_notification, name='test-ios-notification'),
url(r'test/android/$', test_android_notification, name='test-android-notification'),
] | true | true |
f74263860e16997242863747d4c844db70a0c2f6 | 9,764 | py | Python | actor/fighter.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | actor/fighter.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | actor/fighter.py | tamamiyasita/Roguelike-Tutorial-2020 | db4d4e5369010567bc39bdd404c4f3a7998670fd | [
"MIT"
] | null | null | null | import random
from constants import *
from util import dice, stop_watch
from anime.hit_anime import hit_particle, Hit_Anime
class Fighter:
def __init__(self, hp=0, defense=0, STR=0, DEX=0, INT=0, speed=10,
evasion=0, xp_reward=0, level=1,
# 物理:オレンジ, 火:赤, 氷:白, 雷:青, 酸:黄色, 毒:紫, 精神:ピ... | 29.95092 | 132 | 0.544756 | import random
from constants import *
from util import dice, stop_watch
from anime.hit_anime import hit_particle, Hit_Anime
class Fighter:
def __init__(self, hp=0, defense=0, STR=0, DEX=0, INT=0, speed=10,
evasion=0, xp_reward=0, level=1,
resist={"physical": 1, ... | true | true |
f742640f44a63c0e2d0de5704e13205416d0d0b2 | 9,861 | py | Python | catalog/pub/utils/toscaparser/nsdmodel.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 1 | 2019-09-25T05:38:42.000Z | 2019-09-25T05:38:42.000Z | catalog/pub/utils/toscaparser/nsdmodel.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 3 | 2021-02-03T08:59:39.000Z | 2022-03-18T02:18:12.000Z | catalog/pub/utils/toscaparser/nsdmodel.py | onap/modeling-etsicatalog | b16b4579ea80bf82fa497e4934b2bb8728845b58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 44.61991 | 140 | 0.607139 |
import functools
import logging
from catalog.pub.utils.toscaparser.basemodel import BaseInfoModel
from catalog.pub.utils.toscaparser.const import SDC_SERVICE_METADATA_SECTIONS
from catalog.pub.utils.toscaparser.servicemodel import SdcServiceModel
logger = logging.getLogger(__name__)
SECTIONS = (NS_TYPE,... | true | true |
f7426558082b6e4af0d77a8cd56c0bf307360a30 | 725 | py | Python | download_model.py | grausof/AgeGenderEmotion | 12b1fe331b69a4be98f8a8de46cc1c75a07e7f40 | [
"MIT"
] | null | null | null | download_model.py | grausof/AgeGenderEmotion | 12b1fe331b69a4be98f8a8de46cc1c75a07e7f40 | [
"MIT"
] | null | null | null | download_model.py | grausof/AgeGenderEmotion | 12b1fe331b69a4be98f8a8de46cc1c75a07e7f40 | [
"MIT"
] | null | null | null | #Download pretrained model
import os
import sys
import urllib2
def main(argv):
OUTPUT_PATH="./pretrain/"
if not os.path.isdir(OUTPUT_PATH):
os.mkdir(OUTPUT_PATH)
with open(OUTPUT_PATH+'agegender_age101_squeezenet.hdf5','wb') as f:
f.write(urllib2.urlopen("http://www.abars.biz/keras/agegender_age101_squeezenet.... | 31.521739 | 96 | 0.742069 |
import os
import sys
import urllib2
def main(argv):
OUTPUT_PATH="./pretrain/"
if not os.path.isdir(OUTPUT_PATH):
os.mkdir(OUTPUT_PATH)
with open(OUTPUT_PATH+'agegender_age101_squeezenet.hdf5','wb') as f:
f.write(urllib2.urlopen("http://www.abars.biz/keras/agegender_age101_squeezenet.hdf5").read())
f.close()... | true | true |
f74266a217719639ccbbd8175d107164013f4ba3 | 1,515 | py | Python | exchange/simulated.py | jp-quant/qfengine | f71c263becb82ee5b7022c17d7983b40d5df31bb | [
"MIT"
] | 3 | 2021-01-19T10:16:19.000Z | 2022-02-13T16:33:11.000Z | exchange/simulated.py | jp-quant/qfengine | f71c263becb82ee5b7022c17d7983b40d5df31bb | [
"MIT"
] | null | null | null | exchange/simulated.py | jp-quant/qfengine | f71c263becb82ee5b7022c17d7983b40d5df31bb | [
"MIT"
] | 2 | 2021-05-11T12:01:34.000Z | 2021-08-29T04:49:25.000Z | from qfengine.exchange.exchange import Exchange
import datetime
class SimulatedExchange(Exchange):
"""
The SimulatedExchange class is used to model a live
trading venue.
It exposes methods to inform a client class intance of
when the exchange is open to determine when orders can
be executed.
... | 30.3 | 63 | 0.59736 | from qfengine.exchange.exchange import Exchange
import datetime
class SimulatedExchange(Exchange):
def __init__(self, start_dt):
self.start_dt = start_dt
self.open_dt = datetime.time(9, 30)
self.close_dt = datetime.time(16, 00)
def is_open_at_datetime(self, dt):
... | true | true |
f74266af63c025e05006ca314930ea507ba7e6c7 | 17,304 | py | Python | scripts/linters/html_linter.py | siddharthmehta02/oppia | 973f777a6c5a8c3442846bda839e63856dfddf72 | [
"Apache-2.0"
] | 3 | 2020-12-26T12:43:16.000Z | 2021-04-08T15:46:02.000Z | scripts/linters/html_linter.py | siddharthmehta02/oppia | 973f777a6c5a8c3442846bda839e63856dfddf72 | [
"Apache-2.0"
] | null | null | null | scripts/linters/html_linter.py | siddharthmehta02/oppia | 973f777a6c5a8c3442846bda839e63856dfddf72 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2020 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 38.198675 | 80 | 0.598821 |
from __future__ import absolute_import
from __future__ import unicode_literals
import html.parser
import os
import re
import subprocess
from core import python_utils
from .. import common
from .. import concurrent_task_utils
class TagMismatchException(Exception):
pass
class CustomHTMLParser... | true | true |
f74267586f2af94468b20e150fca7dcb9abef5b1 | 1,569 | py | Python | Python3/1494-Parallel-Courses-II/soln.py | wyaadarsh/LeetCode-Solutions | 3719f5cb059eefd66b83eb8ae990652f4b7fd124 | [
"MIT"
] | 5 | 2020-07-24T17:48:59.000Z | 2020-12-21T05:56:00.000Z | Python3/1494-Parallel-Courses-II/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | null | null | null | Python3/1494-Parallel-Courses-II/soln.py | zhangyaqi1989/LeetCode-Solutions | 2655a1ffc8678ad1de6c24295071308a18c5dc6e | [
"MIT"
] | 2 | 2020-07-24T17:49:01.000Z | 2020-08-31T19:57:35.000Z | # This solution may be wrong
class Solution:
def minNumberOfSemesters(self, n: int, dependencies: List[List[int]], k: int) -> int:
graph = [[] for _ in range(n)]
memo_indegrees = [0] * n
for u, v in dependencies:
u -= 1
v -= 1
memo_indegrees[v] += 1
... | 34.866667 | 107 | 0.456342 |
class Solution:
def minNumberOfSemesters(self, n: int, dependencies: List[List[int]], k: int) -> int:
graph = [[] for _ in range(n)]
memo_indegrees = [0] * n
for u, v in dependencies:
u -= 1
v -= 1
memo_indegrees[v] += 1
graph[u].append(v)
... | true | true |
f742675e002deed92636b4dad618638699a30ac2 | 5,366 | py | Python | src/cactus/preprocessor/lastzRepeatMasking/cactus_lastzRepeatMask.py | adamnovak/cactus | 8cbeb88dd3459416a8eef0ec4ef8e23622ba2b01 | [
"MIT-0"
] | null | null | null | src/cactus/preprocessor/lastzRepeatMasking/cactus_lastzRepeatMask.py | adamnovak/cactus | 8cbeb88dd3459416a8eef0ec4ef8e23622ba2b01 | [
"MIT-0"
] | null | null | null | src/cactus/preprocessor/lastzRepeatMasking/cactus_lastzRepeatMask.py | adamnovak/cactus | 8cbeb88dd3459416a8eef0ec4ef8e23622ba2b01 | [
"MIT-0"
] | null | null | null | #!/usr/bin/env python3
## USE LASTZ TO SOFTMASK REPEATS OF A GIVEN FASTA SEQUENCE FILE.
import os
from sonLib.bioio import catFiles
from cactus.shared.common import cactus_call
from cactus.shared.common import RoundedJob
class RepeatMaskOptions:
def __init__(self,
fragment=200,
minPerio... | 46.258621 | 173 | 0.632501 |
red.common import cactus_call
from cactus.shared.common import RoundedJob
class RepeatMaskOptions:
def __init__(self,
fragment=200,
minPeriod=10,
lastzOpts="",
unmaskInput=False,
unmaskOutput=False,
proportionSampled=1.0):
self.fragm... | true | true |
f742676181fdba83b973d2076831baee8e43771f | 1,258 | py | Python | setup.py | ta4tsering/pedurma | 9b45466c230f1c108c1067686aef49c6cee99e3e | [
"MIT"
] | null | null | null | setup.py | ta4tsering/pedurma | 9b45466c230f1c108c1067686aef49c6cee99e3e | [
"MIT"
] | null | null | null | setup.py | ta4tsering/pedurma | 9b45466c230f1c108c1067686aef49c6cee99e3e | [
"MIT"
] | null | null | null | import re
import setuptools
from pathlib import Path
with open("README.md", "r") as fh:
long_description = fh.read()
def get_version(prop, project):
project = Path(__file__).parent / project / "__init__.py"
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), project.read_text()
)... | 29.952381 | 73 | 0.631161 | import re
import setuptools
from pathlib import Path
with open("README.md", "r") as fh:
long_description = fh.read()
def get_version(prop, project):
project = Path(__file__).parent / project / "__init__.py"
result = re.search(
r'{}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(prop), project.read_text()
)... | true | true |
f7426767471745f7e125b74e915093a93d0700b1 | 619 | py | Python | setup.py | tonysimpson/example-snap | a5c77e3fe9882915a40546a234a8246eacfac21e | [
"MIT"
] | null | null | null | setup.py | tonysimpson/example-snap | a5c77e3fe9882915a40546a234a8246eacfac21e | [
"MIT"
] | null | null | null | setup.py | tonysimpson/example-snap | a5c77e3fe9882915a40546a234a8246eacfac21e | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="treemaker",
version="0.0.1",
author="Tony Simpson",
author_email="agjasimpson@gmail.com",
description="Prints command line trees",
long_description=long_description,
long_descripti... | 28.136364 | 54 | 0.668821 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="treemaker",
version="0.0.1",
author="Tony Simpson",
author_email="agjasimpson@gmail.com",
description="Prints command line trees",
long_description=long_description,
long_descripti... | true | true |
f74267bc9a49eddb54e239c50dbc6759bf235367 | 1,600 | py | Python | am_driver/scripts/calculate_angle.py | vincent0628/mower | 99982d56ca3c7044f0010afbdc775b415a5ed46f | [
"MIT"
] | null | null | null | am_driver/scripts/calculate_angle.py | vincent0628/mower | 99982d56ca3c7044f0010afbdc775b415a5ed46f | [
"MIT"
] | null | null | null | am_driver/scripts/calculate_angle.py | vincent0628/mower | 99982d56ca3c7044f0010afbdc775b415a5ed46f | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import rospy
from sensor_msgs.msg import NavSatFix, Imu
from tf.transformations import euler_from_quaternion
from std_msgs.msg import Float64
from geometry_msgs.msg import Point, Twist
import math
import utm
import numpy as np
x, y, theta = 0.0, 0.0, 0.0
xx, yy = [], []
def newGPS(msg):
g... | 25 | 71 | 0.604375 |
import rospy
from sensor_msgs.msg import NavSatFix, Imu
from tf.transformations import euler_from_quaternion
from std_msgs.msg import Float64
from geometry_msgs.msg import Point, Twist
import math
import utm
import numpy as np
x, y, theta = 0.0, 0.0, 0.0
xx, yy = [], []
def newGPS(msg):
global x, xx, y, yy
... | true | true |
f7426806fb5a4df40025191f9dddb097b3a7a3ef | 39,976 | py | Python | test/functional/rpc_psbt.py | MrCryptoBeast/WWW | 857e860df0aa1bc7fde2ee6f5918ff32933beeb3 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | MrCryptoBeast/WWW | 857e860df0aa1bc7fde2ee6f5918ff32933beeb3 | [
"MIT"
] | null | null | null | test/functional/rpc_psbt.py | MrCryptoBeast/WWW | 857e860df0aa1bc7fde2ee6f5918ff32933beeb3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The worldwideweb Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the Partially Signed Transaction RPCs.
"""
from decimal import Decimal
from itertools import... | 61.125382 | 584 | 0.675555 |
from decimal import Decimal
from itertools import product
from test_framework.descriptors import descsum_create
from test_framework.key import ECKey
from test_framework.test_framework import worldwidewebTestFramework
from test_framework.util import (
assert_approx,
assert_equal,
assert_greater_than,
... | true | true |
f7426a3fc7edc99817a4e8e553fd51efbad90914 | 489 | py | Python | backend/src/baserow/contrib/database/tokens/exceptions.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | 839 | 2020-07-20T13:29:34.000Z | 2022-03-31T21:09:16.000Z | backend/src/baserow/contrib/database/tokens/exceptions.py | jacklicn/baserow | 978d9462ededbaa96674a6653028ba19876ea273 | [
"MIT"
] | 28 | 2020-08-07T09:23:58.000Z | 2022-03-01T22:32:40.000Z | backend/src/baserow/contrib/database/tokens/exceptions.py | jacklicn/baserow | 978d9462ededbaa96674a6653028ba19876ea273 | [
"MIT"
] | 79 | 2020-08-04T01:48:01.000Z | 2022-03-27T13:30:54.000Z | class TokenDoesNotExist(Exception):
"""Raised when the requested token does not exist."""
class TokenDoesNotBelongToUser(Exception):
"""Raised when a token does not belong to a user."""
class MaximumUniqueTokenTriesError(Exception):
"""
Raised when the maximum tries has been exceeded while generatin... | 25.736842 | 86 | 0.721881 | class TokenDoesNotExist(Exception):
class TokenDoesNotBelongToUser(Exception):
class MaximumUniqueTokenTriesError(Exception):
class NoPermissionToTable(Exception):
| true | true |
f7426a43de4bc79db10650975e3ae35c1b234ea4 | 24,182 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_scope_maps_operations.py | GabrielHobold/azure-sdk-for-python | 7248645bcb0d590eafdae6ffc9d25ec688a0ff68 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_scope_maps_operations.py | GabrielHobold/azure-sdk-for-python | 7248645bcb0d590eafdae6ffc9d25ec688a0ff68 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_06_01_preview/operations/_scope_maps_operations.py | GabrielHobold/azure-sdk-for-python | 7248645bcb0d590eafdae6ffc9d25ec688a0ff68 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 48.852525 | 188 | 0.675792 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class ScopeMapsOperations(object):
models = models
def __init... | true | true |
f7426acd9ed9d383a67a48a875aee6ad233e48fd | 440 | py | Python | pgAdmin/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/__init__.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/__init__.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/schemas/synonyms/tests/__init__.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | ##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
from pgadmin.util... | 27.5 | 74 | 0.497727 | true | true | |
f7426bb7b63089a7636636d8b6cebd792e58acab | 5,976 | py | Python | docs/conf.py | sho-87/pyutils_sh | 46b08775b92c294f2be1f53c63fb18932e8a56e0 | [
"MIT"
] | null | null | null | docs/conf.py | sho-87/pyutils_sh | 46b08775b92c294f2be1f53c63fb18932e8a56e0 | [
"MIT"
] | 2 | 2018-04-02T21:41:04.000Z | 2018-04-17T09:27:39.000Z | docs/conf.py | sho-87/pyutils_sh | 46b08775b92c294f2be1f53c63fb18932e8a56e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pyutils_sh documentation build configuration file, created by
# sphinx-quickstart on Thu Mar 15 22:24:38 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
#... | 29.294118 | 79 | 0.684739 |
import os
import re
import sys
sys.path.insert(0, os.path.abspath('../'))
from mock import Mock as MagicMock
class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()
MOCK_MODULES = ['numpy', 'matplotlib', 'matplotlib.pyplot', 'pandas']
sys.modules.up... | true | true |
f7426c1dd463a6af7dd4062199632feb129e506d | 3,186 | py | Python | tests/test_abi.py | DmitIv/EVMScriptParser | 2a565cffb9cd890b9ded1978727364270150a72a | [
"MIT"
] | null | null | null | tests/test_abi.py | DmitIv/EVMScriptParser | 2a565cffb9cd890b9ded1978727364270150a72a | [
"MIT"
] | null | null | null | tests/test_abi.py | DmitIv/EVMScriptParser | 2a565cffb9cd890b9ded1978727364270150a72a | [
"MIT"
] | null | null | null | """Tests of getting ABI from different sources."""
import os
from collections import namedtuple
import pytest
from evmscript_parser.core.ABI import get_cached_combined
from evmscript_parser.core.ABI.storage import CachedStorage, ABIKey
from evmscript_parser.core.decode import decode_function_call
CUR_DIR = os.path.d... | 28.446429 | 70 | 0.684557 | import os
from collections import namedtuple
import pytest
from evmscript_parser.core.ABI import get_cached_combined
from evmscript_parser.core.ABI.storage import CachedStorage, ABIKey
from evmscript_parser.core.decode import decode_function_call
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
INTERFACES = os.p... | true | true |
f7426cb1ed0289c2b03e24f5436c10e5dff16777 | 4,560 | py | Python | sudoku_solver.py | a-m-frantz/sudoku-solver | cb1ce01edf600ff9bb7b6b6d0d3938880765a49a | [
"MIT"
] | null | null | null | sudoku_solver.py | a-m-frantz/sudoku-solver | cb1ce01edf600ff9bb7b6b6d0d3938880765a49a | [
"MIT"
] | null | null | null | sudoku_solver.py | a-m-frantz/sudoku-solver | cb1ce01edf600ff9bb7b6b6d0d3938880765a49a | [
"MIT"
] | null | null | null | import time
import algorithms as alg
import puzzle as pzl
class ClueError(Exception):
"""Exception thrown when a puzzle doesn't have enough clues, less than 17, to solve it."""
def __init__(self, file_name, num_clues):
self.file_name = file_name
self.num_clues = num_clues
def parse_file(fil... | 32.340426 | 120 | 0.604167 | import time
import algorithms as alg
import puzzle as pzl
class ClueError(Exception):
def __init__(self, file_name, num_clues):
self.file_name = file_name
self.num_clues = num_clues
def parse_file(file_name):
infile = open(file_name)
file_contents = infile.read()
puzzle_list = [char... | true | true |
f7426d8f38f59f1c51eca58c8afb5231b14a069f | 115,701 | py | Python | statsmodels/discrete/discrete_model.py | bert9bert/statsmodels | 898ddfc483c45bb0f8e5156dd8506abda84c9b63 | [
"BSD-3-Clause"
] | 1 | 2017-11-13T17:13:04.000Z | 2017-11-13T17:13:04.000Z | statsmodels/discrete/discrete_model.py | bert9bert/statsmodels | 898ddfc483c45bb0f8e5156dd8506abda84c9b63 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/discrete/discrete_model.py | bert9bert/statsmodels | 898ddfc483c45bb0f8e5156dd8506abda84c9b63 | [
"BSD-3-Clause"
] | null | null | null | """
Limited dependent variable and qualitative variables.
Includes binary outcomes, count data, (ordered) ordinal data and limited
dependent variables.
General References
--------------------
A.C. Cameron and P.K. Trivedi. `Regression Analysis of Count Data`.
Cambridge, 1998
G.S. Madalla. `Limited-Dependent an... | 36.429786 | 401 | 0.579321 | from __future__ import division
__all__ = ["Poisson", "Logit", "Probit", "MNLogit", "NegativeBinomial"]
from statsmodels.compat.python import lmap, lzip, range
import numpy as np
from scipy.special import gammaln
from scipy import stats, special, optimize
import statsmodels.tools.tools as tools
from statsmodels.too... | true | true |
f7426e21f6e940d5d7943eee6255df17e7518ab5 | 6,857 | py | Python | tests/test_signature.py | Darel13712/typesentry | c5a43920716e06e721d1c06b0ffb4b80b4706c9c | [
"Apache-2.0"
] | 18 | 2017-02-02T19:04:56.000Z | 2022-01-21T12:45:39.000Z | tests/test_signature.py | Darel13712/typesentry | c5a43920716e06e721d1c06b0ffb4b80b4706c9c | [
"Apache-2.0"
] | 11 | 2017-01-28T00:43:15.000Z | 2021-02-16T11:37:14.000Z | tests/test_signature.py | Darel13712/typesentry | c5a43920716e06e721d1c06b0ffb4b80b4706c9c | [
"Apache-2.0"
] | 5 | 2017-08-05T10:11:41.000Z | 2021-11-28T21:15:07.000Z | #!/usr/bin/env python
# Copyright 2017 H2O.ai; Apache License Version 2.0; -*- encoding: utf-8 -*-
import pytest
import time
from tests import typed, py3only, TTypeError
# Stub
def foo():
return False
def test_func_0args0kws():
@typed()
def foo():
return True
assert foo()
with pytest.r... | 25.778195 | 79 | 0.552428 |
import pytest
import time
from tests import typed, py3only, TTypeError
def foo():
return False
def test_func_0args0kws():
@typed()
def foo():
return True
assert foo()
with pytest.raises(TTypeError) as e:
foo(1)
assert str(e.value) == "`foo()` doesn't take any arguments"
... | true | true |
f7426ea00976e99a807367df8f057a858b319b91 | 7,958 | py | Python | example/Bayesian/More advanced examples with FE models - Sfepy/material_homogenization.py | volpatto/UQpy | acbe1d6e655e98917f56b324f019881ea9ccca82 | [
"MIT"
] | 1 | 2020-09-03T12:10:39.000Z | 2020-09-03T12:10:39.000Z | example/Bayesian/More advanced examples with FE models - Sfepy/material_homogenization.py | volpatto/UQpy | acbe1d6e655e98917f56b324f019881ea9ccca82 | [
"MIT"
] | null | null | null | example/Bayesian/More advanced examples with FE models - Sfepy/material_homogenization.py | volpatto/UQpy | acbe1d6e655e98917f56b324f019881ea9ccca82 | [
"MIT"
] | 1 | 2021-04-04T14:17:55.000Z | 2021-04-04T14:17:55.000Z | #!/usr/bin/env python
# This code was adapted from http://sfepy.org/doc-devel/mat_optim.html.
from __future__ import print_function
from __future__ import absolute_import
import sys
sys.path.append('.')
import matplotlib as mlp
import matplotlib.pyplot as plt
from matplotlib.collections import PolyCollection
from mp... | 36.3379 | 93 | 0.574265 |
from __future__ import print_function
from __future__ import absolute_import
import sys
sys.path.append('.')
import matplotlib as mlp
import matplotlib.pyplot as plt
from matplotlib.collections import PolyCollection
from mpl_toolkits.mplot3d.art3d import Poly3DCollection, Line3DCollection
import numpy as np
from... | true | true |
f7426f0017f32ec75b885f227c879785e634d9bf | 1,032 | py | Python | runtests.py | gosuai/django-tinylinks | 6506f3950240542431787e1d18fe39ec73d767f2 | [
"MIT"
] | 11 | 2016-11-27T15:46:42.000Z | 2021-07-31T14:03:54.000Z | runtests.py | gosuai/django-tinylinks | 6506f3950240542431787e1d18fe39ec73d767f2 | [
"MIT"
] | 2 | 2016-12-27T19:53:59.000Z | 2017-05-26T07:12:02.000Z | runtests.py | gosuai/django-tinylinks | 6506f3950240542431787e1d18fe39ec73d767f2 | [
"MIT"
] | 5 | 2015-02-01T01:10:31.000Z | 2015-10-29T18:48:59.000Z | #!/usr/bin/env python
"""
This script is used to run tests, create a coverage report and output the
statistics at the end of the tox run.
To run this script just execute ``tox``
"""
import re
from fabric.api import local, warn
from fabric.colors import green, red
if __name__ == '__main__':
local('flake8 --ignore... | 38.222222 | 75 | 0.653101 |
import re
from fabric.api import local, warn
from fabric.colors import green, red
if __name__ == '__main__':
local('flake8 --ignore=E126 --ignore=W391 --statistics'
' --exclude=submodules,migrations,south_migrations,build,.tox .')
local('coverage run --source="tinylinks" manage.py test -v 2'
... | true | true |
f742704a41eabf26010f1d565068c7d4ce2d9bd4 | 2,698 | py | Python | example/exampleapp/settings.py | The-Politico/politico-civic-demography | 080bb964b64b06db7fd04386530e893ceed1cf98 | [
"MIT"
] | null | null | null | example/exampleapp/settings.py | The-Politico/politico-civic-demography | 080bb964b64b06db7fd04386530e893ceed1cf98 | [
"MIT"
] | null | null | null | example/exampleapp/settings.py | The-Politico/politico-civic-demography | 080bb964b64b06db7fd04386530e893ceed1cf98 | [
"MIT"
] | null | null | null | import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv('SECRET_KEY', 'SECRET')
DEBUG = True
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contri... | 25.214953 | 91 | 0.685322 | import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = os.getenv('SECRET_KEY', 'SECRET')
DEBUG = True
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contri... | true | true |
f7427169a65d13a6832b4c97e1dcd763825a3aab | 33,583 | bzl | Python | packages/typescript/internal/ts_project.bzl | matthewjh/rules_nodejs | 77b712b81041460389da88f063c62906b11047f9 | [
"Apache-2.0"
] | null | null | null | packages/typescript/internal/ts_project.bzl | matthewjh/rules_nodejs | 77b712b81041460389da88f063c62906b11047f9 | [
"Apache-2.0"
] | null | null | null | packages/typescript/internal/ts_project.bzl | matthewjh/rules_nodejs | 77b712b81041460389da88f063c62906b11047f9 | [
"Apache-2.0"
] | null | null | null | "ts_project rule"
load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo", "ExternalNpmPackageInfo", "declaration_info", "js_module_info", "run_node")
load("@build_bazel_rules_nodejs//internal/linker:link_node_modules.bzl", "module_mappings_aspect")
load("@build_bazel_rules_nodejs//internal/node:node.bzl",... | 44.71771 | 144 | 0.648781 |
load("@build_bazel_rules_nodejs//:providers.bzl", "DeclarationInfo", "ExternalNpmPackageInfo", "declaration_info", "js_module_info", "run_node")
load("@build_bazel_rules_nodejs//internal/linker:link_node_modules.bzl", "module_mappings_aspect")
load("@build_bazel_rules_nodejs//internal/node:node.bzl", "nodejs_binary")
... | true | true |
f74271ee9e3e73fc3412b9b20a3c52140869efb8 | 9,076 | py | Python | plugins/login.py | MANYDOWN/Check2 | f74c280f5959d3ff8f2482483f7db28267faa454 | [
"MIT"
] | null | null | null | plugins/login.py | MANYDOWN/Check2 | f74c280f5959d3ff8f2482483f7db28267faa454 | [
"MIT"
] | null | null | null | plugins/login.py | MANYDOWN/Check2 | f74c280f5959d3ff8f2482483f7db28267faa454 | [
"MIT"
] | null | null | null | #MIT License
#Copyright (c) 2021 subinps
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, dis... | 48.276596 | 422 | 0.660423 |
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from pyrogram import Client, filters
from config import Config
from utils import *
import os
from instaloader import Profile, TwoFactorAuthRequiredException, BadCredentialsException
from asyncio.exceptions import TimeoutError
U... | true | true |
f74272937512fdd4ba41abdf9c5400f15372b82a | 7,854 | py | Python | ExplicitIntegration/Integration/ode_cfl_1.py | robotsorcerer/LevelSetPy | 54064ee7fd0144e0d658dd4f6121cbc1fda664b9 | [
"MIT"
] | 4 | 2022-03-14T07:04:08.000Z | 2022-03-14T18:08:56.000Z | ExplicitIntegration/Integration/ode_cfl_1.py | robotsorcerer/LevelSetPy | 54064ee7fd0144e0d658dd4f6121cbc1fda664b9 | [
"MIT"
] | null | null | null | ExplicitIntegration/Integration/ode_cfl_1.py | robotsorcerer/LevelSetPy | 54064ee7fd0144e0d658dd4f6121cbc1fda664b9 | [
"MIT"
] | null | null | null | __all__ = ["odeCFL1"]
import cupy as cp
import numpy as np
from LevelSetPy.Utilities import *
from .ode_cfl_set import odeCFLset
from .ode_cfl_call import odeCFLcallPostTimestep
def odeCFL1(schemeFunc, tspan, y0, options=None, schemeData=None):
"""
odeCFL1: integrate a CFL constrained ODE (eg a PDE by method... | 44.88 | 95 | 0.567354 | __all__ = ["odeCFL1"]
import cupy as cp
import numpy as np
from LevelSetPy.Utilities import *
from .ode_cfl_set import odeCFLset
from .ode_cfl_call import odeCFLcallPostTimestep
def odeCFL1(schemeFunc, tspan, y0, options=None, schemeData=None):
small = 100 * eps
if not options:
options = ode... | true | true |
f74272e61f165c4f989d645e572aa9f777606d85 | 3,620 | py | Python | tests/superset_test_config.py | venter-zhu/incubator-superset | 329e72885c20d3a36f70dbe2909c4665f51ec92f | [
"Apache-2.0"
] | 1 | 2020-11-05T11:16:15.000Z | 2020-11-05T11:16:15.000Z | tests/superset_test_config.py | venter-zhu/incubator-superset | 329e72885c20d3a36f70dbe2909c4665f51ec92f | [
"Apache-2.0"
] | 38 | 2020-11-23T22:26:13.000Z | 2022-02-17T07:39:23.000Z | tests/superset_test_config.py | venter-zhu/incubator-superset | 329e72885c20d3a36f70dbe2909c4665f51ec92f | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.831776 | 95 | 0.75663 |
from copy import copy
from superset.config import *
from tests.superset_test_custom_template_processors import CustomPrestoTemplateProcessor
AUTH_USER_REGISTRATION_ROLE = "alpha"
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(DATA_DIR, "unittests.db")
DEBUG = True
SUPERSET_WEBSERVER_PORT = 808... | true | true |
f74272f2102efa9e33e0fb26dd4b0aa3c1827cfd | 56 | py | Python | pybio/torch/training/__init__.py | kiryteo/pytorch-bioimage-io | 53373c45d3833b35657914953aaac544ec794a7e | [
"MIT"
] | null | null | null | pybio/torch/training/__init__.py | kiryteo/pytorch-bioimage-io | 53373c45d3833b35657914953aaac544ec794a7e | [
"MIT"
] | null | null | null | pybio/torch/training/__init__.py | kiryteo/pytorch-bioimage-io | 53373c45d3833b35657914953aaac544ec794a7e | [
"MIT"
] | null | null | null | from pybio.torch.training.simple import simple_training
| 28 | 55 | 0.875 | from pybio.torch.training.simple import simple_training
| true | true |
f742730705505435f4472f6c28499babb770a1b9 | 4,658 | py | Python | test/test_gpu4.py | whong92/3D_DL | 3c15bca3cc87c3197d38a785f6d1146911a82921 | [
"MIT"
] | 35 | 2019-03-04T00:06:20.000Z | 2022-02-04T22:34:17.000Z | test/test_gpu4.py | 921kiyo/C530 | e64402575661a1e534cb8effe122d8fe8aed156e | [
"MIT"
] | 3 | 2021-03-12T13:12:26.000Z | 2022-01-17T08:47:49.000Z | test/test_gpu4.py | 921kiyo/C530 | e64402575661a1e534cb8effe122d8fe8aed156e | [
"MIT"
] | 12 | 2019-09-26T08:35:18.000Z | 2021-12-09T05:39:59.000Z | import sys
import os
import pathlib
import unittest
import coverage
import argparse
import subprocess
import site
# Ensure source directory is in python path
project_dir = str(pathlib.Path(__file__).parents[1].resolve())
sys.path.append(os.path.join(project_dir, 'src'))
# for keras
sys.path.append(project_dir)
""" -... | 35.830769 | 109 | 0.706526 | import sys
import os
import pathlib
import unittest
import coverage
import argparse
import subprocess
import site
project_dir = str(pathlib.Path(__file__).parents[1].resolve())
sys.path.append(os.path.join(project_dir, 'src'))
sys.path.append(project_dir)
parser = argparse.ArgumentParser(description='Run all Ocado... | true | true |
f742748602b33f51d0e900a1e4eefca8630ef688 | 6,549 | py | Python | examples/dataset.py | siqim/Machine-Learning-with-Graphs | 697d83bb206be0825ebaf0dad128b9eb24908705 | [
"MIT"
] | 13 | 2021-01-14T18:58:38.000Z | 2022-03-29T04:11:53.000Z | examples/dataset.py | siqim/Machine-Learning-with-Graphs | 697d83bb206be0825ebaf0dad128b9eb24908705 | [
"MIT"
] | null | null | null | examples/dataset.py | siqim/Machine-Learning-with-Graphs | 697d83bb206be0825ebaf0dad128b9eb24908705 | [
"MIT"
] | 6 | 2021-06-01T06:46:37.000Z | 2022-03-29T04:13:50.000Z | # -*- coding: utf-8 -*-
"""
Created on December 30, 2020
@author: Siqi Miao
"""
import torch
from torch_sparse import SparseTensor
import torch_geometric.transforms as T
from pathlib2 import Path
import scipy.io as sio
from sklearn.metrics import f1_score, accuracy_score
from sklearn.model_selection import train_te... | 37.422857 | 114 | 0.596427 |
import torch
from torch_sparse import SparseTensor
import torch_geometric.transforms as T
from pathlib2 import Path
import scipy.io as sio
from sklearn.metrics import f1_score, accuracy_score
from sklearn.model_selection import train_test_split
from skmultilearn.model_selection import iterative_train_test_split
fro... | true | true |
f74274e0418d689e587201a71f8ad10ffe2788e3 | 908 | py | Python | src/train.py | dendisuhubdy/deep_learning_project_skeleton | 325f6e7ec154d93550b0b1e9df8a8a063cedb10a | [
"BSD-3-Clause"
] | 1 | 2020-04-07T16:56:47.000Z | 2020-04-07T16:56:47.000Z | src/train.py | dendisuhubdy/deep_learning_project_skeleton | 325f6e7ec154d93550b0b1e9df8a8a063cedb10a | [
"BSD-3-Clause"
] | null | null | null | src/train.py | dendisuhubdy/deep_learning_project_skeleton | 325f6e7ec154d93550b0b1e9df8a8a063cedb10a | [
"BSD-3-Clause"
] | 1 | 2020-04-07T16:56:47.000Z | 2020-04-07T16:56:47.000Z | """
Copyrigt Dendi Suhubdy, 2018
All rights reserved
"""
from loss import loss_function
def train(args, model, optimizer, train_loader, device, epoch):
model.train()
train_loss = 0
for batch_idx, (data, _) in enumerate(train_loader):
data = data.to(device)
optimizer.zero_grad()
r... | 31.310345 | 75 | 0.585903 | from loss import loss_function
def train(args, model, optimizer, train_loader, device, epoch):
model.train()
train_loss = 0
for batch_idx, (data, _) in enumerate(train_loader):
data = data.to(device)
optimizer.zero_grad()
recon_batch, mu, logvar = model(data)
loss = loss_fu... | true | true |
f74274ed9c198191139ae6816119fd4ce465103b | 2,730 | py | Python | problem-146-lru-cache/lrucache.py | starovp/leetcode-sols | e4b660e1fd70ad3fc1fc54e8a224549d46295a26 | [
"MIT"
] | null | null | null | problem-146-lru-cache/lrucache.py | starovp/leetcode-sols | e4b660e1fd70ad3fc1fc54e8a224549d46295a26 | [
"MIT"
] | null | null | null | problem-146-lru-cache/lrucache.py | starovp/leetcode-sols | e4b660e1fd70ad3fc1fc54e8a224549d46295a26 | [
"MIT"
] | null | null | null | """
146. LRU Cache
Design and implement a data structure for Least Recently Used (LRU) cache.
It should support the following operations: get and put.
get(key) - Get the value (will always be positive) of the key if
the key exists in the cache, otherwise return -1.
put(key, value) - Set or insert the value if the ... | 30 | 85 | 0.627106 |
class DoubleNode:
def __init__(self, key, value):
self.prev = None
self.next = None
self.key = key
self.value = value
class LRUCache:
def __init__(self, capacity):
self.dict = {}
self.capacity = capacity
self.head = DoubleNode(0,0)
self.tail... | true | true |
f742775a538a6b1d8c32076b570e8b275b47bd38 | 3,029 | py | Python | leetcode/lessons/stack/133_clone_graph/__init__.py | wangkuntian/leetcode | e8dc9c8032c805a7d071ad19b94841ee8e52e834 | [
"MIT"
] | null | null | null | leetcode/lessons/stack/133_clone_graph/__init__.py | wangkuntian/leetcode | e8dc9c8032c805a7d071ad19b94841ee8e52e834 | [
"MIT"
] | 2 | 2020-03-24T18:00:21.000Z | 2020-03-26T11:33:51.000Z | leetcode/lessons/stack/133_clone_graph/__init__.py | wangkuntian/leetcode | e8dc9c8032c805a7d071ad19b94841ee8e52e834 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__project__ = 'leetcode'
__file__ = '__init__.py'
__author__ = 'king'
__time__ = '2020/2/23 21:09'
_ooOoo_
o8888888o
88" . "88
(| -_- |)
... | 22.437037 | 69 | 0.427204 |
class Node(object):
def __init__(self, val: int, neighbors: []):
if neighbors is None:
neighbors = [int]
self.val = val
self.neighbors = neighbors
class Solution(object):
def cloneGraph(self, node):
if not node:
return
cloned_start = Node(... | true | true |
f74277f949ce89661862baf2ef2fdd5c4d6c7ed4 | 8,601 | py | Python | plants/non_wood_biomass/non_wood_biomass.py | yinonbaron/biomass_distribution | 783a8d2f59754bde9b0ea802512b131abbe7d8a0 | [
"MIT"
] | 1 | 2021-05-17T13:55:48.000Z | 2021-05-17T13:55:48.000Z | plants/non_wood_biomass/non_wood_biomass.py | yinonbaron/biomass_distribution | 783a8d2f59754bde9b0ea802512b131abbe7d8a0 | [
"MIT"
] | null | null | null | plants/non_wood_biomass/non_wood_biomass.py | yinonbaron/biomass_distribution | 783a8d2f59754bde9b0ea802512b131abbe7d8a0 | [
"MIT"
] | 2 | 2018-01-10T08:53:35.000Z | 2021-05-17T13:55:50.000Z |
# coding: utf-8
# # Estimating the fraction of plant biomass which is not woody
# To estimate the total non-woody plant biomass, we rely on two methods. The first is to estimate the global average leaf and root mass fractions, and the second is by estimating the total biomass of roots and leaves.
#
# ## Method1 - fr... | 46.241935 | 444 | 0.76433 |
action_helper import *
fractions = pd.read_excel('non_wood_biomass_data.xlsx','Poorter',skiprows=1,index_col=0)
fractions
biomes = pd.read_excel('non_wood_biomass_data.xlsx','Erb',skiprows=1)
biomes
non_wood_frac = (fractions['LMF']+fractions['RMF'])/fractions.sum(axis=1)
tot_biomass = biomes.group... | true | true |
f742792c21e6a920b532f8bdbe99797aeaca732f | 866 | py | Python | Library Management System/Book.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | 1 | 2019-04-27T15:37:04.000Z | 2019-04-27T15:37:04.000Z | Library Management System/Book.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | null | null | null | Library Management System/Book.py | AtharvaJoshi21/PythonPOC | 6b95eb5bab7b28e9811e43b39e863faf2ee7565b | [
"MIT"
] | 1 | 2020-08-14T06:57:08.000Z | 2020-08-14T06:57:08.000Z | # Class definition for Book entity
class Book:
bookId = 1
def __init__(self, title, publisher, author, edition, publishedOn):
self.__title = title
self.__publisher = publisher
self.__author = author
self.__edition = edition
self.__publishedOn = publishedOn
self._... | 27.935484 | 157 | 0.630485 |
class Book:
bookId = 1
def __init__(self, title, publisher, author, edition, publishedOn):
self.__title = title
self.__publisher = publisher
self.__author = author
self.__edition = edition
self.__publishedOn = publishedOn
self.__bookId = Book.bookId
Book... | true | true |
f7427974904ce59d069adf181d643213b47ab89c | 3,732 | py | Python | tests/python/relay/test_pass_auto_quantize.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 2 | 2020-07-07T07:38:45.000Z | 2021-06-02T07:08:09.000Z | tests/python/relay/test_pass_auto_quantize.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 1 | 2020-07-29T07:29:17.000Z | 2020-07-29T07:29:17.000Z | tests/python/relay/test_pass_auto_quantize.py | jiangzoi/incubator-tvm | 144c6f45f7217b9df2f5605e06f0903e470ac11c | [
"Apache-2.0"
] | 1 | 2021-07-03T08:09:32.000Z | 2021-07-03T08:09:32.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.321429 | 71 | 0.672026 |
import numpy as np
import pytest
import tvm
from tvm import te
from tvm import relay
from tvm.relay import testing
from tvm.relay.expr import Call
def quantize_and_build(out):
f = relay.Function(relay.analysis.free_vars(out), out)
mod, params = testing.create_workload(f)
with relay.quant... | true | true |
f7427dd9bdecba8b955eab6d5b432ef7abfac7f4 | 1,630 | py | Python | modules/algo.py | Davidyz/AutoStacker | 9f637891b9379b166e41597bcd44a8011561beea | [
"MIT"
] | null | null | null | modules/algo.py | Davidyz/AutoStacker | 9f637891b9379b166e41597bcd44a8011561beea | [
"MIT"
] | null | null | null | modules/algo.py | Davidyz/AutoStacker | 9f637891b9379b166e41597bcd44a8011561beea | [
"MIT"
] | null | null | null | import numpy as np
from modules.imageRW import Image
from typing import Iterator, Optional, List
from __future__ import annotations
class InputException(Exception):
pass
def mean(images: Iterator[Image], group_size: int) -> Iterator[Image|None]:
stackImage: Image|None = None
while True:
try:
... | 30.185185 | 80 | 0.56135 | import numpy as np
from modules.imageRW import Image
from typing import Iterator, Optional, List
from __future__ import annotations
class InputException(Exception):
pass
def mean(images: Iterator[Image], group_size: int) -> Iterator[Image|None]:
stackImage: Image|None = None
while True:
try:
... | true | true |
f7427e3e091e4b7bc43db2bc2372dfafe57fa435 | 1,335 | py | Python | alipay/aop/api/response/AlipayFundCouponWufuLiveAcceptResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayFundCouponWufuLiveAcceptResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayFundCouponWufuLiveAcceptResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.CommonPrizeModelVo import CommonPrizeModelVo
class AlipayFundCouponWufuLiveAcceptResponse(AlipayResponse):
def __init__(self):
super(AlipayFundCouponWufu... | 31.046512 | 111 | 0.662172 |
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.CommonPrizeModelVo import CommonPrizeModelVo
class AlipayFundCouponWufuLiveAcceptResponse(AlipayResponse):
def __init__(self):
super(AlipayFundCouponWufuLiveAcceptResponse, self).__init__()
... | true | true |
f7427e4b9f5e9374b1ac340794143e370ea5f0c5 | 3,932 | py | Python | pyDNase/scripts/dnase_average_profile.py | zoi-mibtp/pyDNase | 047d2f89af6109a530505b370782c4841d710cbf | [
"MIT"
] | 34 | 2015-05-28T17:16:18.000Z | 2022-03-04T11:54:37.000Z | pyDNase/scripts/dnase_average_profile.py | zoi-mibtp/pyDNase | 047d2f89af6109a530505b370782c4841d710cbf | [
"MIT"
] | 39 | 2015-05-14T09:03:07.000Z | 2020-05-13T11:40:28.000Z | pyDNase/scripts/dnase_average_profile.py | zoi-mibtp/pyDNase | 047d2f89af6109a530505b370782c4841d710cbf | [
"MIT"
] | 24 | 2015-09-24T07:39:53.000Z | 2021-07-13T02:37:24.000Z | #!/usr/bin/env python
import argparse
import pyDNase
import numpy as np
import matplotlib as mpl
from clint.textui import progress, puts
#Required for headless operation
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import rcParams
parser = argparse.ArgumentParser(description='Plots average profile of... | 39.717172 | 154 | 0.698372 |
import argparse
import pyDNase
import numpy as np
import matplotlib as mpl
from clint.textui import progress, puts
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import rcParams
parser = argparse.ArgumentParser(description='Plots average profile of DNase (or Tn5 for ATAC-seq) activity surrounding a l... | true | true |
f7427e5e34c3f1de4190cb6c792627ffcae62126 | 49,211 | py | Python | nemo/collections/nlp/data/machine_translation/preproc_mt_data.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | 1 | 2021-08-19T03:20:44.000Z | 2021-08-19T03:20:44.000Z | nemo/collections/nlp/data/machine_translation/preproc_mt_data.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/data/machine_translation/preproc_mt_data.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 47.409441 | 144 | 0.578021 |
import glob
import json
import os
import pickle
import tarfile
import tempfile
import youtokentome as yttm
from joblib import Parallel, delayed
from omegaconf import ListConfig, OmegaConf
from pytorch_lightning import Trainer
from nemo.collections.common.tokenizers.sentencepiece_tokenizer import create... | true | true |
f7427f7da06fb74060284279677f278e898c0af0 | 281,502 | py | Python | tests/admin_views/tests.py | metamatik/django | 415ae960bb9f1bdae798023fdce3247d2c938eec | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/admin_views/tests.py | metamatik/django | 415ae960bb9f1bdae798023fdce3247d2c938eec | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/admin_views/tests.py | metamatik/django | 415ae960bb9f1bdae798023fdce3247d2c938eec | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-16T07:19:02.000Z | 2020-09-16T07:19:02.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import os
import re
import unittest
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETION, LogEntry
from... | 46.292057 | 119 | 0.65082 |
from __future__ import unicode_literals
import datetime
import json
import os
import re
import unittest
from django.contrib.admin import AdminSite, ModelAdmin
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.models import ADDITION, DELETION, LogEntry
from django.contrib.admin.o... | true | true |
f7427fa61a22e6628b60e173ba1711d321fff4d6 | 3,060 | py | Python | archiveOldVersions/generator_v02.py | remichartier/014_selfDrivingCarND_BehavioralCloningProject | 1dcaa7c5a937929d4481e5efbf7ccc856c04c4ff | [
"MIT"
] | 1 | 2021-02-23T08:28:54.000Z | 2021-02-23T08:28:54.000Z | archiveOldVersions/generator_v02.py | remichartier/014_selfDrivingCarND_BehavioralCloningProject | 1dcaa7c5a937929d4481e5efbf7ccc856c04c4ff | [
"MIT"
] | null | null | null | archiveOldVersions/generator_v02.py | remichartier/014_selfDrivingCarND_BehavioralCloningProject | 1dcaa7c5a937929d4481e5efbf7ccc856c04c4ff | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# History
# v01 : adaptation from the one given by Udacity to work
# v02 : adapt to commonFunctions_v10.py to use generator.
# Start adding again everything from model_v12.py (image augmentation)
import os
import csv
import cv2
import numpy as np
import sklearn
from math import ceil
from ... | 37.777778 | 102 | 0.715686 |
import os
import csv
import cv2
import numpy as np
import sklearn
from math import ceil
from random import shuffle
from sklearn.model_selection import train_test_split
from commonFunctions_v10 import get_lines_logfile
from commonFunctions_v10 import get_info_from_lines
from commonFunctions_v10 import flip_hor... | true | true |
f74280739b93896df5c5e31df783089f1d27e061 | 5,844 | py | Python | babelscan_unit_test.py | DanPorter/babelscan | 71fa43f13a8318efbcdb412c4fca533d4b6f9ec9 | [
"Apache-2.0"
] | null | null | null | babelscan_unit_test.py | DanPorter/babelscan | 71fa43f13a8318efbcdb412c4fca533d4b6f9ec9 | [
"Apache-2.0"
] | null | null | null | babelscan_unit_test.py | DanPorter/babelscan | 71fa43f13a8318efbcdb412c4fca533d4b6f9ec9 | [
"Apache-2.0"
] | null | null | null | """
Unit test for babelscan
"""
import numpy as np
import matplotlib.pyplot as plt
import babelscan
print('####################################################')
print('############## babelscan unit tests ################')
print('####################################################')
print('\n')
print(babelscan.mod... | 33.780347 | 150 | 0.648871 |
import numpy as np
import matplotlib.pyplot as plt
import babelscan
print('####################################################')
print('############## babelscan unit tests ################')
print('####################################################')
print('\n')
print(babelscan.module_info())
file = r"C:\Users\d... | true | true |
f742817e2fd6d96a23dbfc508965ac0583cd3f0c | 2,491 | py | Python | pytest_splunk_addon_ui_smartx/components/controls/toggle.py | artemrys/addon-factory-smartx-ui-test-library | a0ea68a2f90f5662eac383b74043f69e01830251 | [
"Apache-2.0"
] | 1 | 2021-03-29T07:03:15.000Z | 2021-03-29T07:03:15.000Z | pytest_splunk_addon_ui_smartx/components/controls/toggle.py | artemrys/addon-factory-smartx-ui-test-library | a0ea68a2f90f5662eac383b74043f69e01830251 | [
"Apache-2.0"
] | 181 | 2020-12-15T19:31:07.000Z | 2022-03-18T08:06:06.000Z | pytest_splunk_addon_ui_smartx/components/controls/toggle.py | splunk/addon-factory-smartx-ui-test-library | d1bb8d0ce728d53d3c15425c3b5a25e2e526d80e | [
"Apache-2.0"
] | 2 | 2022-02-01T18:39:37.000Z | 2022-03-27T16:51:40.000Z | #
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 31.531646 | 87 | 0.598956 |
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from ..base_component import Selector
from .base_control import BaseControl
class Toggle(BaseControl):
def __init__(self, browser, container):
super().__init__(browser, container)
... | true | true |
f7428198d951fefa1de0138e18e0fcbcfe3359f9 | 2,363 | py | Python | snake/utils.py | ishitajs/npc-cogs | 6664d5825fd150486ad026631540278b7f46eeb3 | [
"MIT"
] | 28 | 2020-10-19T17:55:04.000Z | 2022-03-13T04:43:12.000Z | snake/utils.py | ishitajs/npc-cogs | 6664d5825fd150486ad026631540278b7f46eeb3 | [
"MIT"
] | 46 | 2021-01-17T19:07:01.000Z | 2022-03-07T09:04:01.000Z | snake/utils.py | ishitajs/npc-cogs | 6664d5825fd150486ad026631540278b7f46eeb3 | [
"MIT"
] | 53 | 2020-11-25T15:54:21.000Z | 2022-03-26T16:03:50.000Z | import asyncio
import discord
from redbot.vendored.discord.ext import menus
from .game import Game
TRANS = {
0: "\N{BLACK LARGE SQUARE}",
1: "\N{RED APPLE}",
2: "\N{LARGE GREEN CIRCLE}",
3: "\N{LARGE GREEN SQUARE}",
}
GET_DIR = {
"w": "up",
"s": "down",
"a": "left",
"d": "right",
... | 27.8 | 86 | 0.590774 | import asyncio
import discord
from redbot.vendored.discord.ext import menus
from .game import Game
TRANS = {
0: "\N{BLACK LARGE SQUARE}",
1: "\N{RED APPLE}",
2: "\N{LARGE GREEN CIRCLE}",
3: "\N{LARGE GREEN SQUARE}",
}
GET_DIR = {
"w": "up",
"s": "down",
"a": "left",
"d": "right",
... | true | true |
f74281a04ea26f96fc74daf2aff9f5e83498dd76 | 2,556 | py | Python | src/HAnDS/qualitative_analysis.py | abhipec/hands | ff9658d4226c78b96c02ccf3b91b7d2699f0e4cf | [
"MIT"
] | 13 | 2019-05-02T01:44:04.000Z | 2022-02-21T13:39:47.000Z | src/HAnDS/qualitative_analysis.py | abhipec/hands | ff9658d4226c78b96c02ccf3b91b7d2699f0e4cf | [
"MIT"
] | 1 | 2021-06-01T13:04:51.000Z | 2021-06-08T16:07:35.000Z | src/HAnDS/qualitative_analysis.py | abhipec/hands | ff9658d4226c78b96c02ccf3b91b7d2699f0e4cf | [
"MIT"
] | 1 | 2019-12-26T07:24:03.000Z | 2019-12-26T07:24:03.000Z | """
Qualitative analysis of dataset generated using CADS vs NDS approach.
"""
import sys
import glob
import json
import gzip
def sentence_id(json_sentence):
"""
Return the unique if of a sentence.
"""
return '_'.join([
str(json_sentence['did']),
str(json_sentence['pid']),
str(j... | 36 | 80 | 0.554773 |
import sys
import glob
import json
import gzip
def sentence_id(json_sentence):
return '_'.join([
str(json_sentence['did']),
str(json_sentence['pid']),
str(json_sentence['sid'])
])
def parse_dataset(input_directory, restrict=None):
filepaths = sorted(glob.iglob(input_directory + '... | true | true |
f74281a2aca3dde534e168e52c00ec688047557d | 2,760 | py | Python | bindings/python/ensmallen/datasets/networkrepository/dbpediaoccupation.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/networkrepository/dbpediaoccupation.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/networkrepository/dbpediaoccupation.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph dbpedia-occupation.
The graph is automatically retrieved from the NetworkRepository repository.
References
---------------------
Please cite the following if you use the data:
```bib
@inproceedings{nr,
title = {The Network Data Repository wit... | 29.052632 | 94 | 0.660145 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def DbpediaOccupation(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/network... | true | true |
f742833d30a37adca0fa495770ff4c465783b02e | 8,762 | py | Python | app_filter.py | lestieve/ODATAF | de2c077a4e24ccc6783adf73fc8d7ae1c140bfe6 | [
"MIT"
] | null | null | null | app_filter.py | lestieve/ODATAF | de2c077a4e24ccc6783adf73fc8d7ae1c140bfe6 | [
"MIT"
] | null | null | null | app_filter.py | lestieve/ODATAF | de2c077a4e24ccc6783adf73fc8d7ae1c140bfe6 | [
"MIT"
] | null | null | null | from tkinter import *
from odf_query import *
from app_tools import *
from app_selector import *
from app_dictionary import _, load_dictionary
class AppFilter(Toplevel):
"""Window for managing a filter (for adding or modifying a filter)
Arguments:
Toplevel {Toplevel (tkinter)} -- Window ... | 52.467066 | 176 | 0.599863 | from tkinter import *
from odf_query import *
from app_tools import *
from app_selector import *
from app_dictionary import _, load_dictionary
class AppFilter(Toplevel):
def __init__(self, federation=None, app_parent=None, query_filters=[], query_tables=[], filter_index=None):
Toplevel.__init__(sel... | true | true |
f74283d3eae87159475da2719a6acfef86d9d988 | 987 | py | Python | sonic/config.py | jakhax/self-driving-with-a-raspberry-pi-car- | 351fd3d30306002d0bb2caafb4162a23f6af116e | [
"MIT"
] | 4 | 2018-12-13T07:53:49.000Z | 2021-06-27T03:50:46.000Z | sonic/config.py | jakhax/self-driving-with-a-raspberry-pi-car- | 351fd3d30306002d0bb2caafb4162a23f6af116e | [
"MIT"
] | 5 | 2018-12-04T05:33:13.000Z | 2022-03-11T23:35:08.000Z | sonic/config.py | jakhax/self-driving-with-a-raspberry-pi-car- | 351fd3d30306002d0bb2caafb4162a23f6af116e | [
"MIT"
] | 1 | 2020-04-17T23:17:16.000Z | 2020-04-17T23:17:16.000Z | """
CAR CONFIG
This file is read by your car application's manage.py script to change the car
performance.
EXMAPLE
-----------
import dk
cfg = dk.load_config(config_path='~/mycar/config.py')
print(cfg.CAMERA_RESOLUTION)
"""
import os
#PATHS
CAR_PATH = PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__))
DAT... | 18.622642 | 78 | 0.765957 |
import os
CAR_PATH = PACKAGE_PATH = os.path.dirname(os.path.realpath(__file__))
DATA_PATH = os.path.join(CAR_PATH, 'data')
MODELS_PATH = os.path.join(CAR_PATH, 'models')
DRIVE_LOOP_HZ = 20
MAX_LOOPS = 100000
CAMERA_RESOLUTION = (480, 640)
CAMERA_FRAMERATE = DRIVE_LOOP_HZ
STEERING_CHANNEL = 1
STEERING_LEFT_PW... | true | true |
f742842a1658aa53e43099e22f59c66037d345cb | 6,507 | py | Python | mmdet-v2/tools/third_party/useless/cocoutils/coco_check.py | li-phone/DetectionCompetition | a917f16790ec30358e3cfe1aa6e327a2070a1235 | [
"Apache-2.0"
] | null | null | null | mmdet-v2/tools/third_party/useless/cocoutils/coco_check.py | li-phone/DetectionCompetition | a917f16790ec30358e3cfe1aa6e327a2070a1235 | [
"Apache-2.0"
] | null | null | null | mmdet-v2/tools/third_party/useless/cocoutils/coco_check.py | li-phone/DetectionCompetition | a917f16790ec30358e3cfe1aa6e327a2070a1235 | [
"Apache-2.0"
] | null | null | null | import os
import json
import cv2 as cv
import numpy as np
from tqdm import tqdm
try:
from pandas import json_normalize
except:
from pandas.io.json import json_normalize
def load_dict(fname):
with open(fname, "r") as fp:
o = json.load(fp, )
return o
def save_dict(fname, d, mode='w', **kw... | 34.068063 | 115 | 0.52528 | import os
import json
import cv2 as cv
import numpy as np
from tqdm import tqdm
try:
from pandas import json_normalize
except:
from pandas.io.json import json_normalize
def load_dict(fname):
with open(fname, "r") as fp:
o = json.load(fp, )
return o
def save_dict(fname, d, mode='w', **kw... | true | true |
f742862ba0025cfcee3d87f7cfc4d5fe793f283d | 20,962 | py | Python | plaso/engine/extractors.py | jonathan-greig/plaso | b88a6e54c06a162295d09b016bddbfbfe7ca9070 | [
"Apache-2.0"
] | 1,253 | 2015-01-02T13:58:02.000Z | 2022-03-31T08:43:39.000Z | plaso/engine/extractors.py | jonathan-greig/plaso | b88a6e54c06a162295d09b016bddbfbfe7ca9070 | [
"Apache-2.0"
] | 3,388 | 2015-01-02T11:17:58.000Z | 2022-03-30T10:21:45.000Z | plaso/engine/extractors.py | jonathan-greig/plaso | b88a6e54c06a162295d09b016bddbfbfe7ca9070 | [
"Apache-2.0"
] | 376 | 2015-01-20T07:04:54.000Z | 2022-03-04T23:53:00.000Z | # -*- coding: utf-8 -*-
"""The extractor class definitions.
An extractor is a class used to extract information from "raw" data.
"""
import copy
import re
import pysigscan
from dfvfs.helpers import file_system_searcher
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.lib import errors as dfvfs_erro... | 36.519164 | 80 | 0.710094 |
import copy
import re
import pysigscan
from dfvfs.helpers import file_system_searcher
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.lib import errors as dfvfs_errors
from dfvfs.resolver import resolver as path_spec_resolver
from plaso.engine import logger
from plaso.lib import errors
from plaso... | true | true |
f74286e676eb344ed971789e33328523c4fcad9b | 1,605 | py | Python | daemon/globus_cw_daemon/config.py | sirosen/globus-cwlogger | fbe0229e9bb1bacaa81046bcc7a8da168659e806 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | daemon/globus_cw_daemon/config.py | sirosen/globus-cwlogger | fbe0229e9bb1bacaa81046bcc7a8da168659e806 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | daemon/globus_cw_daemon/config.py | sirosen/globus-cwlogger | fbe0229e9bb1bacaa81046bcc7a8da168659e806 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
Provides access to /etc/cwlogd.ini config values
"""
import configparser
CONFIG_PATH = "/etc/cwlogd.ini"
_config = None
def _get_config():
"""
Either returns an already loaded configparser
Or creates a configparser and loads ini config at /etc/cwlogd.ini
"""
global _config
if _config is N... | 28.660714 | 71 | 0.670405 | import configparser
CONFIG_PATH = "/etc/cwlogd.ini"
_config = None
def _get_config():
global _config
if _config is None:
_config = configparser.ConfigParser()
_config.read(CONFIG_PATH)
return _config
def get_string(key):
try:
return _get_config().get("general", key)
exc... | true | true |
f742874d2b694357d57492e9f34ebf0ea8c776e1 | 11,946 | py | Python | config_v1.py | eyeris/OpenRadar | 1bdb4054e7cb68b9a13be968aaf3b94108a66a10 | [
"Apache-2.0"
] | 7 | 2021-05-20T01:12:39.000Z | 2021-12-30T12:38:07.000Z | radicalsdk/radar/config_v1.py | moodoki/radical_sdk | 4438678cf73e156e5058ddb035ec8e5875fca84e | [
"Apache-2.0"
] | null | null | null | radicalsdk/radar/config_v1.py | moodoki/radical_sdk | 4438678cf73e156e5058ddb035ec8e5875fca84e | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04_radarcfg_v1.ipynb (unless otherwise specified).
__all__ = ['logger', 'read_radar_params', 'parse_commands', 'dict_to_list', 'channelStr_to_dict', 'profileStr_to_dict',
'chirp_to_dict', 'power_to_dict', 'frameStr_to_dict', 'adcStr_to_dict', 'command_handlers... | 40.222222 | 147 | 0.594676 |
__all__ = ['logger', 'read_radar_params', 'parse_commands', 'dict_to_list', 'channelStr_to_dict', 'profileStr_to_dict',
'chirp_to_dict', 'power_to_dict', 'frameStr_to_dict', 'adcStr_to_dict', 'command_handlers']
import logging
logger = logging.getLogger()
def read_radar_params(filename):
with ope... | true | true |
f742895a6d6c6a3d4529ebb0db36167c295afef5 | 296 | py | Python | src/ramstk/models/programdb/mechanism/__init__.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 26 | 2019-05-15T02:03:47.000Z | 2022-02-21T07:28:11.000Z | src/ramstk/models/programdb/mechanism/__init__.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 815 | 2019-05-10T12:31:52.000Z | 2022-03-31T12:56:26.000Z | src/ramstk/models/programdb/mechanism/__init__.py | TahaEntezari/ramstk | f82e5b31ef5c4e33cc02252263247b99a9abe129 | [
"BSD-3-Clause"
] | 9 | 2019-04-20T23:06:29.000Z | 2022-01-24T21:21:04.000Z | # pylint: disable=unused-import
# -*- coding: utf-8 -*-
#
# ramstk.models.mechanism.__init__.py is part of The RAMSTK Project
#
# All rights reserved.
# Copyright since 2007 Doyle "weibullguy" Rowland doyle.rowland <AT> reliaqual <DOT> com
"""The RAMSTK failure Mechanism model package."""
| 32.888889 | 88 | 0.719595 | true | true | |
f7428af4872c5b3f086a0a690b5dfe13c5ddd3fc | 1,399 | py | Python | migrations/versions/b7ab14de6d0f_added_macros_table.py | ukblumf/randomise-it | 0610721eba649dfa205b0d3c4b3e24d67aa1d781 | [
"MIT"
] | null | null | null | migrations/versions/b7ab14de6d0f_added_macros_table.py | ukblumf/randomise-it | 0610721eba649dfa205b0d3c4b3e24d67aa1d781 | [
"MIT"
] | null | null | null | migrations/versions/b7ab14de6d0f_added_macros_table.py | ukblumf/randomise-it | 0610721eba649dfa205b0d3c4b3e24d67aa1d781 | [
"MIT"
] | null | null | null | """Added Macros table
Revision ID: b7ab14de6d0f
Revises: 183d3f0348eb
Create Date: 2017-11-28 11:54:23.897000
"""
# revision identifiers, used by Alembic.
revision = 'b7ab14de6d0f'
down_revision = '183d3f0348eb'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto... | 34.121951 | 91 | 0.670479 |
revision = 'b7ab14de6d0f'
down_revision = '183d3f0348eb'
from alembic import op
import sqlalchemy as sa
def upgrade():
rue),
sa.Column('definition', sa.Text(), nullable=True),
sa.Column('definition_html', sa.Text(), nullable=True),
sa.Column('permissions', sa.Integer(), nullable=True),
... | true | true |
f7428b0c27edbb119da0aeb395c2eff213e2b9c2 | 399 | py | Python | api/api/wsgi.py | haavardnk/Vinmonopolet-x-Untappd | 950db7201593d7b94daf091884949aed4377d4ca | [
"MIT"
] | null | null | null | api/api/wsgi.py | haavardnk/Vinmonopolet-x-Untappd | 950db7201593d7b94daf091884949aed4377d4ca | [
"MIT"
] | null | null | null | api/api/wsgi.py | haavardnk/Vinmonopolet-x-Untappd | 950db7201593d7b94daf091884949aed4377d4ca | [
"MIT"
] | null | null | null | """
WSGI config for api project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJA... | 23.470588 | 79 | 0.749373 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'api.settings')
application = get_wsgi_application()
| true | true |
f7428b7ff1968904c5ad91436365926ac4723142 | 11,255 | py | Python | py/hookandline_hookmatrix/StateMachine.py | nwfsc-fram/pyFieldSoftware | 477ba162b66ede2263693cda8c5a51d27eaa3b89 | [
"MIT"
] | null | null | null | py/hookandline_hookmatrix/StateMachine.py | nwfsc-fram/pyFieldSoftware | 477ba162b66ede2263693cda8c5a51d27eaa3b89 | [
"MIT"
] | 176 | 2019-11-22T17:44:55.000Z | 2021-10-20T23:40:03.000Z | py/hookandline_hookmatrix/StateMachine.py | nwfsc-fram/pyFieldSoftware | 477ba162b66ede2263693cda8c5a51d27eaa3b89 | [
"MIT"
] | 1 | 2021-05-07T01:06:32.000Z | 2021-05-07T01:06:32.000Z | __author__ = 'Todd.Hay'
# -------------------------------------------------------------------------------
# Name: StateMachine.py
# Purpose:
#
# Author: Todd.Hay
# Email: Todd.Hay@noaa.gov
#
# Created: Feb 03, 2016
# License: MIT
#-------------------------------------------------------------... | 25.235426 | 99 | 0.583741 | __author__ = 'Todd.Hay'
from PyQt5.QtCore import pyqtProperty, pyqtSlot, QVariant, pyqtSignal, QObject
from PyQt5.QtQml import QJSValue
import logging
import arrow
import sys
from py.hookandline_hookmatrix.HookMatrixConfig import HOOKMATRIX_VERSION
from py.hookandline_hookmatrix.HookMatrixConfig import HO... | true | true |
f7428c89b0a49d108aaa723ccef6afcc3508e1a8 | 2,152 | py | Python | hackathon/lib/qiskitflow/cli/cli.py | IceKhan13/QiskitFlow | ec9a403a04145454c35b21bdfb26e893f52a428f | [
"Apache-2.0"
] | 7 | 2020-10-21T20:51:00.000Z | 2021-08-24T14:21:35.000Z | hackathon/lib/qiskitflow/cli/cli.py | IceKhan13/QiskitFlow | ec9a403a04145454c35b21bdfb26e893f52a428f | [
"Apache-2.0"
] | 11 | 2020-10-22T03:24:54.000Z | 2021-02-13T02:41:06.000Z | hackathon/lib/qiskitflow/cli/cli.py | IceKhan13/QiskitFlow | ec9a403a04145454c35b21bdfb26e893f52a428f | [
"Apache-2.0"
] | 5 | 2020-10-08T17:24:59.000Z | 2022-01-30T16:27:03.000Z | import click
import time
import glob
import json
import tarfile
import requests
import os
from shutil import copyfile
_FOLDER = "_experiments"
@click.group(help="""
Base QiskitFlow cli function.
""")
def qiskitflow():
click.echo(click.style("== QiskitFlow. Reproducible quantum experiments ==", fg='magenta'))
... | 28.693333 | 104 | 0.639405 | import click
import time
import glob
import json
import tarfile
import requests
import os
from shutil import copyfile
_FOLDER = "_experiments"
@click.group(help="""
Base QiskitFlow cli function.
""")
def qiskitflow():
click.echo(click.style("== QiskitFlow. Reproducible quantum experiments ==", fg='magenta'))
... | true | true |
f7428d78467189e3c7a56c8df336b8ce6bd066f8 | 22,877 | py | Python | modules/tools/create_map/create_map.py | BaiduXLab/apollo | 2764e934b6d0da1342be781447348288ac84c5e9 | [
"Apache-2.0"
] | 22 | 2018-10-10T14:46:32.000Z | 2022-02-28T12:43:43.000Z | modules/tools/create_map/create_map.py | BaiduXLab/apollo | 2764e934b6d0da1342be781447348288ac84c5e9 | [
"Apache-2.0"
] | 5 | 2020-06-13T00:36:33.000Z | 2022-02-10T17:50:43.000Z | modules/tools/create_map/create_map.py | BaiduXLab/apollo | 2764e934b6d0da1342be781447348288ac84c5e9 | [
"Apache-2.0"
] | 12 | 2018-12-24T02:17:19.000Z | 2021-12-06T01:54:09.000Z | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | 33.348397 | 177 | 0.622634 |
'center_x':
entry.center_x = new_entry
elif dim == 'center_y':
entry.center_y = new_entry
elif dim == 'width':
entry.width = new_entry
def smooth_dimension(data, dim):
extracted_data = extract_data(data, dim)
if dim == 'width':
laplacian_smooth(ex... | true | true |
f7428e1b6cc6fec86deadc41fcbfa377b7a07b12 | 565 | py | Python | examples/tokenize_wiki.py | fostroll/toxine | ad1e6b76e08d52b5041b46d542c1c5cec1052e53 | [
"BSD-3-Clause"
] | 6 | 2020-07-27T05:38:26.000Z | 2021-02-04T07:52:53.000Z | examples/tokenize_wiki.py | fostroll/toxine | ad1e6b76e08d52b5041b46d542c1c5cec1052e53 | [
"BSD-3-Clause"
] | null | null | null | examples/tokenize_wiki.py | fostroll/toxine | ad1e6b76e08d52b5041b46d542c1c5cec1052e53 | [
"BSD-3-Clause"
] | 2 | 2020-05-05T10:50:00.000Z | 2020-12-04T13:49:25.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Toxine project
#
# Copyright (C) 2019-present by Sergei Ternovykh
# License: BSD, see LICENSE for details
"""
Example: Tokenize Wikipedia and save articles as CoNLL-U.
"""
from corpuscula import Conllu
from corpuscula.wikipedia_utils import download_wikipedia
from toxine.wiki... | 28.25 | 70 | 0.762832 |
from corpuscula import Conllu
from corpuscula.wikipedia_utils import download_wikipedia
from toxine.wikipedia_utils import TokenizedWikipedia
download_wikipedia(overwrite=False)
# tokenize and save articles
Conllu.save(TokenizedWikipedia().articles(), 'wiki.conllu', fix=False,
log_file=None)
| true | true |
f7428e572f39b4ef1cd857bc6a5efc87c768094f | 13,574 | py | Python | raddoo/core.py | ConsignCloud/raddoo | 71622592644b1871e243563fa2816a7ff278b722 | [
"MIT"
] | 1 | 2022-01-20T17:32:37.000Z | 2022-01-20T17:32:37.000Z | raddoo/core.py | ConsignCloud/raddoo | 71622592644b1871e243563fa2816a7ff278b722 | [
"MIT"
] | null | null | null | raddoo/core.py | ConsignCloud/raddoo | 71622592644b1871e243563fa2816a7ff278b722 | [
"MIT"
] | null | null | null | import uuid as _uuid
import itertools as _itertools
import random as _random
import collections as _collections
import inspect as _inspect
import copy as _copy
import _collections_abc
UUID_PATTERN = "\
^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
def _curry(n, fn, carryover_args=()... | 16.39372 | 78 | 0.598644 | import uuid as _uuid
import itertools as _itertools
import random as _random
import collections as _collections
import inspect as _inspect
import copy as _copy
import _collections_abc
UUID_PATTERN = "\
^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
def _curry(n, fn, carryover_args=()... | true | true |
f7428f184f7d405c484a80da3116e3e60f11c4e5 | 11,516 | py | Python | sdk/python/pulumi_google_native/accesscontextmanager/v1/access_level.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 44 | 2021-04-18T23:00:48.000Z | 2022-02-14T17:43:15.000Z | sdk/python/pulumi_google_native/accesscontextmanager/v1/access_level.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 354 | 2021-04-16T16:48:39.000Z | 2022-03-31T17:16:39.000Z | sdk/python/pulumi_google_native/accesscontextmanager/v1/access_level.py | AaronFriel/pulumi-google-native | 75d1cda425e33d4610348972cd70bddf35f1770d | [
"Apache-2.0"
] | 8 | 2021-04-24T17:46:51.000Z | 2022-01-05T10:40:21.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 44.809339 | 304 | 0.64875 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['AccessLevelArgs', 'AccessLevel']
@pulumi.input_type
class AccessLevelArgs:
def __in... | true | true |
f7428f30924849ddcb6bbe9f34d8254915fd2522 | 964 | py | Python | fedhf/api/dpm/laplace.py | beiyuouo/fedhf | 0caa873a5db7494b0f9197848c34243fcb8c49f6 | [
"Apache-2.0"
] | 2 | 2022-03-04T02:44:14.000Z | 2022-03-24T03:59:07.000Z | fedhf/api/dpm/laplace.py | beiyuouo/FedHF | 0caa873a5db7494b0f9197848c34243fcb8c49f6 | [
"Apache-2.0"
] | null | null | null | fedhf/api/dpm/laplace.py | beiyuouo/FedHF | 0caa873a5db7494b0f9197848c34243fcb8c49f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @File : fedhf\api\dpm\laplace_noise.py
# @Time : 2022-05-02 22:39:42
# @Author : Bingjie Yan
# @Email : bj.yan.pa@qq.com
# @License : Apache License 2.0
import numpy as np
import torch
def laplace_noise(sensitivity, size, epsilon, **kwargs):
"""
... | 28.352941 | 64 | 0.655602 |
import numpy as np
import torch
def laplace_noise(sensitivity, size, epsilon, **kwargs):
noise_scale = sensitivity / epsilon
return np.random.laplace(0, noise_scale, size)
def laplace_clip(model: torch.nn.Module, clip: float):
for k, v in model.named_parameters():
v.grad /= max(1, v.grad... | true | true |
f7428f333efa60092af6caf202c8325d118622c3 | 1,484 | py | Python | src/websitecontacts/exceptions/error.py | whois-api-llc/website-contacts-py | fe1fa6140346459ea757c21852825bb4661d95e5 | [
"MIT"
] | 1 | 2022-02-07T10:10:56.000Z | 2022-02-07T10:10:56.000Z | src/websitecontacts/exceptions/error.py | whois-api-llc/website-contacts-py | fe1fa6140346459ea757c21852825bb4661d95e5 | [
"MIT"
] | null | null | null | src/websitecontacts/exceptions/error.py | whois-api-llc/website-contacts-py | fe1fa6140346459ea757c21852825bb4661d95e5 | [
"MIT"
] | null | null | null | from json import loads
from ..models.response import ErrorMessage
class WebsiteContactsApiError(Exception):
def __init__(self, message):
self.message = message
@property
def message(self):
return self._message
@message.setter
def message(self, message):
self._message = me... | 20.611111 | 58 | 0.688005 | from json import loads
from ..models.response import ErrorMessage
class WebsiteContactsApiError(Exception):
def __init__(self, message):
self.message = message
@property
def message(self):
return self._message
@message.setter
def message(self, message):
self._message = me... | true | true |
f7429026d15749af7c58f07a1d2edf47c75c251d | 2,453 | py | Python | 2020/test/d01_test.py | michal-jewczuk/advent-of-code | c4933bf0bc4b77d5032f8a7f2fdc385b6013c18d | [
"MIT"
] | null | null | null | 2020/test/d01_test.py | michal-jewczuk/advent-of-code | c4933bf0bc4b77d5032f8a7f2fdc385b6013c18d | [
"MIT"
] | null | null | null | 2020/test/d01_test.py | michal-jewczuk/advent-of-code | c4933bf0bc4b77d5032f8a7f2fdc385b6013c18d | [
"MIT"
] | null | null | null | import unittest
import sys
sys.path.append('../')
import d01_p1 as d01
class TestFindNumbers(unittest.TestCase):
def test_with_only_one_matching_pair(self):
testData = [10, 2010]
expected = (10, 2010)
result = d01.findNumbers(testData)
self.assertEqual(result, expected)
de... | 24.287129 | 64 | 0.598859 | import unittest
import sys
sys.path.append('../')
import d01_p1 as d01
class TestFindNumbers(unittest.TestCase):
def test_with_only_one_matching_pair(self):
testData = [10, 2010]
expected = (10, 2010)
result = d01.findNumbers(testData)
self.assertEqual(result, expected)
de... | true | true |
f742926227c9549f415786db3fd44d7fd9b710e3 | 232 | py | Python | sets.py | stonegrape/hello | 3d5f83371e3353863ce1d80457649fd360629bfc | [
"MIT"
] | null | null | null | sets.py | stonegrape/hello | 3d5f83371e3353863ce1d80457649fd360629bfc | [
"MIT"
] | null | null | null | sets.py | stonegrape/hello | 3d5f83371e3353863ce1d80457649fd360629bfc | [
"MIT"
] | null | null | null | # create an empty set
s = set()
# add elements to the sets
s.add(1)
s.add(2)
s.add(3)
s.add(4)
s.add(3)
print(s)
s.remove(2)
print(s)
# print out how many elements are in the set
print(f"there are {len(s)} elements in the set")
| 12.888889 | 48 | 0.659483 |
s = set()
s.add(1)
s.add(2)
s.add(3)
s.add(4)
s.add(3)
print(s)
s.remove(2)
print(s)
print(f"there are {len(s)} elements in the set")
| true | true |
f74294dc57850dfcec56e2d3428380ca57717a01 | 4,239 | py | Python | docs/source/experiments/legacy/ssl_vs_bald_vs_ssal_basic/mnist/recycle/det_SSL/pseudo_label.py | jiahfong/alr | ee561c545bd98ec17c4f9c3040ef23b0222ef71a | [
"MIT"
] | 2 | 2020-09-20T18:06:35.000Z | 2021-02-03T07:52:58.000Z | docs/source/experiments/old/legacy/ssl_vs_bald_vs_ssal_basic/mnist/recycle/det_SSL/pseudo_label.py | jiahfong/alr | ee561c545bd98ec17c4f9c3040ef23b0222ef71a | [
"MIT"
] | null | null | null | docs/source/experiments/old/legacy/ssl_vs_bald_vs_ssal_basic/mnist/recycle/det_SSL/pseudo_label.py | jiahfong/alr | ee561c545bd98ec17c4f9c3040ef23b0222ef71a | [
"MIT"
] | null | null | null | r"""
vanilla pseudo-labeling implementation
"""
from collections import defaultdict
from alr.utils import timeop, manual_seed
from alr.data.datasets import Dataset
from alr.data import UnlabelledDataset
from alr.training import VanillaPLTrainer
from alr.training.samplers import RandomFixedLengthSampler
from alr import... | 31.634328 | 119 | 0.533616 | from collections import defaultdict
from alr.utils import timeop, manual_seed
from alr.data.datasets import Dataset
from alr.data import UnlabelledDataset
from alr.training import VanillaPLTrainer
from alr.training.samplers import RandomFixedLengthSampler
from alr import MCDropout
import pickle
import numpy as np
imp... | true | true |
f742956a2e623574dcf542f0156c8bfe6e0103eb | 3,315 | py | Python | test_nnet.py | texifter/trust-defender | 08747df28adc3d2431a73087e06cb0647e8397d2 | [
"MIT"
] | 5 | 2021-06-15T12:04:28.000Z | 2021-10-08T15:56:08.000Z | test_nnet.py | texifter/trust-defender | 08747df28adc3d2431a73087e06cb0647e8397d2 | [
"MIT"
] | null | null | null | test_nnet.py | texifter/trust-defender | 08747df28adc3d2431a73087e06cb0647e8397d2 | [
"MIT"
] | null | null | null | import argparse
import numpy
import pandas as pd
import os
from keras import backend as K
from keras.models import Sequential
from keras.layers import Dense
from keras.models import model_from_json
from ngram_classifier import NGramClassifier
from sklearn.metrics import precision_recall_fscore_support
CLASS_WEIGHTS = ... | 32.821782 | 122 | 0.685671 | import argparse
import numpy
import pandas as pd
import os
from keras import backend as K
from keras.models import Sequential
from keras.layers import Dense
from keras.models import model_from_json
from ngram_classifier import NGramClassifier
from sklearn.metrics import precision_recall_fscore_support
CLASS_WEIGHTS = ... | true | true |
f74296e51a418c7b42a68c250fa42944c64784ec | 1,895 | py | Python | neurolib/models/thalamus/model.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 258 | 2020-01-26T14:38:09.000Z | 2022-03-31T14:54:04.000Z | neurolib/models/thalamus/model.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 172 | 2020-01-27T11:02:28.000Z | 2022-03-22T22:25:38.000Z | neurolib/models/thalamus/model.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 49 | 2020-02-04T08:34:44.000Z | 2022-03-28T09:29:12.000Z | from ..model import Model
from . import loadDefaultParams as dp
from . import timeIntegration as ti
class ThalamicMassModel(Model):
"""
Two population thalamic model
Reference:
Costa, M. S., Weigenand, A., Ngo, H. V. V., Marshall, L., Born, J.,
Martinetz, T., & Claussen, J. C. (2016). A thala... | 23.395062 | 80 | 0.538259 | from ..model import Model
from . import loadDefaultParams as dp
from . import timeIntegration as ti
class ThalamicMassModel(Model):
name = "thalamus"
description = "Two population thalamic mass model"
init_vars = [
"V_t_init",
"V_r_init",
"Q_t_init",
"Q_r_init",
"... | true | true |
f742970d05de192bf4795c674cd9551b60aeacb0 | 4,648 | py | Python | apps/dash-web-trader/env/Lib/site-packages/dash_html_components/Datalist.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | 1 | 2020-03-01T04:38:24.000Z | 2020-03-01T04:38:24.000Z | apps/dash-web-trader/env/Lib/site-packages/dash_html_components/Datalist.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | null | null | null | apps/dash-web-trader/env/Lib/site-packages/dash_html_components/Datalist.py | alzo425/dash-sample-apps | d3e9f521a3bc2b8d39ed2922838ad35b9b17beb0 | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Datalist(Component):
"""A Datalist component.
Keyword arguments:
- children (a list of or a singular dash component, string or number; optional): The children of this component
- id (string; optio... | 74.967742 | 586 | 0.737091 |
from dash.development.base_component import Component, _explicitize_args
class Datalist(Component):
@_explicitize_args
def __init__(self, children=None, id=Component.UNDEFINED, n_clicks=Component.UNDEFINED, n_clicks_timestamp=Component.UNDEFINED, key=Component.UNDEFINED, role=Component.UNDEFINED, accessKey=... | true | true |
f742976f167568b2f2d650209b8eb7909d8394da | 5,099 | py | Python | litex_boards/targets/de10lite.py | piotr-binkowski/litex-boards | bee71da7746c6fda0d4e1942452510e11f06c14a | [
"BSD-2-Clause"
] | 1 | 2022-02-20T00:06:32.000Z | 2022-02-20T00:06:32.000Z | litex_boards/targets/de10lite.py | piotr-binkowski/litex-boards | bee71da7746c6fda0d4e1942452510e11f06c14a | [
"BSD-2-Clause"
] | null | null | null | litex_boards/targets/de10lite.py | piotr-binkowski/litex-boards | bee71da7746c6fda0d4e1942452510e11f06c14a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2019 msloniewski <marcin.sloniewski@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause
import os
import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.build.io import DDROutput
from li... | 39.527132 | 112 | 0.539714 |
import os
import argparse
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.build.io import DDROutput
from litex_boards.platforms import de10lite
from litex.soc.cores.clock import Max10PLL
from litex.soc.integration.soc import SoCRegion
from litex.soc.integration.soc_c... | true | true |
f74299af0e78e32d3fc83a47422b53948e3f45a4 | 726 | py | Python | utils/exceptions.py | xianfang-qian/docker_ci | 0ff773d1e7d9420ef6a05a63bc56b32952b71192 | [
"Apache-2.0"
] | 35 | 2020-10-11T07:39:42.000Z | 2022-03-20T06:17:08.000Z | utils/exceptions.py | xianfang-qian/docker_ci | 0ff773d1e7d9420ef6a05a63bc56b32952b71192 | [
"Apache-2.0"
] | 32 | 2020-10-13T06:58:20.000Z | 2022-02-10T04:34:03.000Z | utils/exceptions.py | xianfang-qian/docker_ci | 0ff773d1e7d9420ef6a05a63bc56b32952b71192 | [
"Apache-2.0"
] | 39 | 2020-10-07T07:22:20.000Z | 2022-03-14T18:21:56.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2019-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Custom exceptions for this framework"""
class FailedStepError(Exception):
"""Generic non-specific exception"""
pass
class FailedBuildError(Exception):
"""Exception on failed Docker image build"""... | 20.742857 | 67 | 0.707989 |
class FailedStepError(Exception):
pass
class FailedBuildError(Exception):
pass
class FailedDeployError(Exception):
pass
class FailedTestError(Exception):
pass
class LayerNotFoundError(Exception):
pass
class InputNotValidError(Exception):
pass
| true | true |
f7429ad2198e24f0e023aab768c4500eb7130a3f | 231 | py | Python | scripts/plotFlops.py | tom-klotz/ellipsoid-solvation | 2bcaab45a9096ae078711b4f4e1495c2bead16a0 | [
"BSD-2-Clause"
] | 1 | 2016-11-05T20:15:01.000Z | 2016-11-05T20:15:01.000Z | scripts/plotFlops.py | tom-klotz/ellipsoid-solvation | 2bcaab45a9096ae078711b4f4e1495c2bead16a0 | [
"BSD-2-Clause"
] | null | null | null | scripts/plotFlops.py | tom-klotz/ellipsoid-solvation | 2bcaab45a9096ae078711b4f4e1495c2bead16a0 | [
"BSD-2-Clause"
] | null | null | null | from numpy import *
from matplotlib.pyplot import *
figure()
A = loadtxt('flopsext.txt', usecols={3})
B = loadtxt('flopsint.txt', usecols={3})
A = cumsum(A)
Awow = A / 100;
B = cumsum(B)
semilogy(A, '+', Awow, '_', B, 'o')
show()
| 19.25 | 40 | 0.627706 | from numpy import *
from matplotlib.pyplot import *
figure()
A = loadtxt('flopsext.txt', usecols={3})
B = loadtxt('flopsint.txt', usecols={3})
A = cumsum(A)
Awow = A / 100;
B = cumsum(B)
semilogy(A, '+', Awow, '_', B, 'o')
show()
| true | true |
f7429cc3bf46b07ab633bfab316a2659cbd94b06 | 7,819 | py | Python | proteus/tests/ProjScheme_with_EV/NS_convergence.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | null | null | null | proteus/tests/ProjScheme_with_EV/NS_convergence.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 13 | 2018-02-08T23:22:59.000Z | 2020-12-06T19:40:32.000Z | proteus/tests/ProjScheme_with_EV/NS_convergence.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 1 | 2020-02-17T03:25:34.000Z | 2020-02-17T03:25:34.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from past.utils import old_div
from math import *
import proteus.MeshTools
from proteus import Domain
from proteus.default_n import *
from proteus.Profiling import logEvent
from .parameters import *
manufacture... | 30.905138 | 125 | 0.649188 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from past.utils import old_div
from math import *
import proteus.MeshTools
from proteus import Domain
from proteus.default_n import *
from proteus.Profiling import logEvent
from .parameters import *
manufacture... | true | true |
f7429da2993d70de73b1401ab6d5490af2b25913 | 1,686 | py | Python | setup.py | verdel/transmission-telegram-bot | e6b48e45c8b273f98771bb17177b29ec7c27b67d | [
"MIT"
] | null | null | null | setup.py | verdel/transmission-telegram-bot | e6b48e45c8b273f98771bb17177b29ec7c27b67d | [
"MIT"
] | null | null | null | setup.py | verdel/transmission-telegram-bot | e6b48e45c8b273f98771bb17177b29ec7c27b67d | [
"MIT"
] | 3 | 2020-06-27T03:56:01.000Z | 2020-09-03T07:15:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from codecs import open
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open('transmission_telegram_bot/__init__.py') as f:
for line in f:
if line.find("__version__") >= 0:
version =... | 33.72 | 87 | 0.650059 |
from codecs import open
from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open('transmission_telegram_bot/__init__.py') as f:
for line in f:
if line.find("__version__") >= 0:
version = line.split("=")[1].strip()
vers... | true | true |
f7429e4d5b98ba3325a8628333fdc367c22c1aaf | 18,447 | py | Python | insights/parsers/modinfo.py | lhuett/insights-core | 1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8 | [
"Apache-2.0"
] | 121 | 2017-05-30T20:23:25.000Z | 2022-03-23T12:52:15.000Z | insights/parsers/modinfo.py | lhuett/insights-core | 1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8 | [
"Apache-2.0"
] | 1,977 | 2017-05-26T14:36:03.000Z | 2022-03-31T10:38:53.000Z | insights/parsers/modinfo.py | lhuett/insights-core | 1c84eeffc037f85e2bbf60c9a302c83aa1a50cf8 | [
"Apache-2.0"
] | 244 | 2017-05-30T20:22:57.000Z | 2022-03-26T10:09:39.000Z | """
ModInfo - Commands ``modinfo <module_name>``
============================================
Parsers to parse the output of ``modinfo <module_name>`` commands.
ModInfoI40e - Command ``modinfo i40e``
--------------------------------------
ModInfoVmxnet3 - Command ``modinfo vmxnet3``
----------------------------------... | 37.80123 | 203 | 0.576408 |
from insights import parser, CommandParser
from insights.parsers import SkipException
from insights.specs import Specs
class ModInfo(dict):
@classmethod
def from_content(cls, content):
if not content:
raise SkipException("No Contents")
data = {}
for line in content:
... | true | true |
f7429e7f27a5ea350d00f6c5e99f03ab2f84dee3 | 1,264 | py | Python | metadrive/examples/profile_metadrive.py | liuzuxin/metadrive | 850c207536531bc85179084acd7c30ab14a66111 | [
"Apache-2.0"
] | 125 | 2021-08-30T06:33:57.000Z | 2022-03-31T09:02:44.000Z | metadrive/examples/profile_metadrive.py | liuzuxin/metadrive | 850c207536531bc85179084acd7c30ab14a66111 | [
"Apache-2.0"
] | 72 | 2021-08-30T16:23:41.000Z | 2022-03-31T19:17:16.000Z | metadrive/examples/profile_metadrive.py | liuzuxin/metadrive | 850c207536531bc85179084acd7c30ab14a66111 | [
"Apache-2.0"
] | 20 | 2021-09-09T08:20:25.000Z | 2022-03-24T13:24:07.000Z | import time
import numpy as np
from metadrive import MetaDriveEnv
from metadrive.utils import setup_logger
if __name__ == '__main__':
print("Start to profile the efficiency of MetaDrive with 1000 maps and ~8 vehicles!")
setup_logger(debug=False)
env = MetaDriveEnv(dict(
environment_num=1000,
... | 33.263158 | 112 | 0.560127 | import time
import numpy as np
from metadrive import MetaDriveEnv
from metadrive.utils import setup_logger
if __name__ == '__main__':
print("Start to profile the efficiency of MetaDrive with 1000 maps and ~8 vehicles!")
setup_logger(debug=False)
env = MetaDriveEnv(dict(
environment_num=1000,
... | true | true |
f7429fcd096d956f247ba903d5f835404932df07 | 15,469 | py | Python | src/blueprint/azext_blueprint/vendored_sdks/blueprint/aio/operations/_published_blueprints_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/blueprint/azext_blueprint/vendored_sdks/blueprint/aio/operations/_published_blueprints_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/blueprint/azext_blueprint/vendored_sdks/blueprint/aio/operations/_published_blueprints_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.190031 | 143 | 0.669145 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pi... | true | true |
f742a0a303b4ddb2bd9f0cc47789054f0f8d7f9a | 7,148 | py | Python | assignment_4/dtd.py | archiviral/machine-learning-assignments | 198d5a713344ac33fe479eed01c534a3ab12d78c | [
"MIT"
] | null | null | null | assignment_4/dtd.py | archiviral/machine-learning-assignments | 198d5a713344ac33fe479eed01c534a3ab12d78c | [
"MIT"
] | null | null | null | assignment_4/dtd.py | archiviral/machine-learning-assignments | 198d5a713344ac33fe479eed01c534a3ab12d78c | [
"MIT"
] | 1 | 2021-09-29T17:00:14.000Z | 2021-09-29T17:00:14.000Z | import argparse
import os
import sys
import time
import datetime
from copy import deepcopy
import numpy as np
CONTINOUS_COLUMNS = [0, 2, 3, 9, 10, 11]
TTL = 30
class Node:
def __init__(self, prediction, continuous=None, unqs=None, column=None, median=None):
self.children = []
self.column = colum... | 28.365079 | 119 | 0.58394 | import argparse
import os
import sys
import time
import datetime
from copy import deepcopy
import numpy as np
CONTINOUS_COLUMNS = [0, 2, 3, 9, 10, 11]
TTL = 30
class Node:
def __init__(self, prediction, continuous=None, unqs=None, column=None, median=None):
self.children = []
self.column = colum... | true | true |
f742a124db26f049b296f2ac70cac7c8f2d49eee | 4,212 | py | Python | rv/params.py | 6aika/rest-validator | db536ed8b840a254adf76c234a39181a1802863d | [
"MIT"
] | null | null | null | rv/params.py | 6aika/rest-validator | db536ed8b840a254adf76c234a39181a1802863d | [
"MIT"
] | null | null | null | rv/params.py | 6aika/rest-validator | db536ed8b840a254adf76c234a39181a1802863d | [
"MIT"
] | null | null | null | import datetime
import random
from operator import eq
import dateutil.parser
class Param(object):
"""
Wraps a property on an object and optionally how it corresponds to a
parameter of some sort.
"""
def __init__(self, *, property, parameter=None, operator=eq, bucket=None, discrete=True):
... | 29.25 | 120 | 0.608262 | import datetime
import random
from operator import eq
import dateutil.parser
class Param(object):
def __init__(self, *, property, parameter=None, operator=eq, bucket=None, discrete=True):
assert property
self.property = property
self.parameter = (parameter or property)
self.opera... | true | true |
f742a37c18e7aa7931bd266dccc76ef8b9ef6e57 | 24,078 | py | Python | src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_host_pools_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-01-25T07:33:18.000Z | 2022-01-25T07:33:18.000Z | src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_host_pools_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 9 | 2022-03-25T19:35:49.000Z | 2022-03-31T06:09:47.000Z | src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/aio/operations/_host_pools_operations.py | haroonf/azure-cli-extensions | 61c044d34c224372f186934fa7c9313f1cd3a525 | [
"MIT"
] | 1 | 2022-03-10T22:13:02.000Z | 2022-03-10T22:13:02.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.740891 | 229 | 0.667082 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f742a4cb3a41f591c76d4933bb4c66d3954de8ab | 5,271 | py | Python | ocr2text.py | danijel1124/ocr2text | 26fec917ec72299f9255546a5c3469bd0f84dab7 | [
"MIT"
] | 72 | 2019-10-11T03:15:23.000Z | 2022-03-28T21:38:59.000Z | ocr2text.py | junmei/ocr2text | 14cc9e70506456c4e0b65a3687a63f53c0ffb5db | [
"MIT"
] | 7 | 2020-05-20T07:53:12.000Z | 2022-02-01T07:53:58.000Z | ocr2text.py | junmei/ocr2text | 14cc9e70506456c4e0b65a3687a63f53c0ffb5db | [
"MIT"
] | 19 | 2019-10-11T03:15:33.000Z | 2022-02-22T17:00:21.000Z | import os
import shutil
import errno
import subprocess
import tempfile
from tempfile import mkdtemp
try:
from PIL import Image
except ImportError:
print('Error: You need to install the "Image" package. Type the following:')
print('pip install Image')
try:
import pytesseract
except ImportError:
pri... | 32.337423 | 91 | 0.605957 | import os
import shutil
import errno
import subprocess
import tempfile
from tempfile import mkdtemp
try:
from PIL import Image
except ImportError:
print('Error: You need to install the "Image" package. Type the following:')
print('pip install Image')
try:
import pytesseract
except ImportError:
pri... | true | true |
f742a51d6eebf12b9ba603cda72561893732604c | 780 | py | Python | galleria/migrations/0008_auto_20210906_0623.py | Awadh-Awadh/AGalleria | a0313497d6b090223af93cd309bc1cd2de92dd02 | [
"MIT"
] | null | null | null | galleria/migrations/0008_auto_20210906_0623.py | Awadh-Awadh/AGalleria | a0313497d6b090223af93cd309bc1cd2de92dd02 | [
"MIT"
] | null | null | null | galleria/migrations/0008_auto_20210906_0623.py | Awadh-Awadh/AGalleria | a0313497d6b090223af93cd309bc1cd2de92dd02 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-06 06:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('galleria', '0007_rename_cats_cat'),
]
operations = [
migrations.CreateModel(
name='Location',
... | 28.888889 | 128 | 0.6 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('galleria', '0007_rename_cats_cat'),
]
operations = [
migrations.CreateModel(
name='Location',
fields=[
('id', mode... | true | true |
f742a5739d6555c65365df4f3f7466b6b45467ab | 1,164 | py | Python | bootstrap/pentagram/interpret/block_test.py | pentagram-lang/pentagram | 5c4dc2fc516ec2844dc71ddb778ddadec036ce55 | [
"MIT"
] | 2 | 2018-07-28T22:41:12.000Z | 2018-08-11T02:17:02.000Z | bootstrap/pentagram/interpret/block_test.py | tacit-lang/tacit | 5c4dc2fc516ec2844dc71ddb778ddadec036ce55 | [
"MIT"
] | 17 | 2017-12-23T02:15:03.000Z | 2019-03-31T01:15:15.000Z | bootstrap/pentagram/interpret/block_test.py | tacit-lang/tacit | 5c4dc2fc516ec2844dc71ddb778ddadec036ce55 | [
"MIT"
] | null | null | null | from __future__ import annotations
from numpy import int32
from pentagram.interpret.block import interpret_block
from pentagram.interpret.test import init_test_frame_stack
from pentagram.machine import MachineExpressionStack
from pentagram.machine import MachineFrameStack
from pentagram.machine import MachineNumber
fr... | 30.631579 | 60 | 0.752577 | from __future__ import annotations
from numpy import int32
from pentagram.interpret.block import interpret_block
from pentagram.interpret.test import init_test_frame_stack
from pentagram.machine import MachineExpressionStack
from pentagram.machine import MachineFrameStack
from pentagram.machine import MachineNumber
fr... | true | true |
f742a5b5d303e4f4824c0f008eaa8c25bf165081 | 621 | py | Python | noisify/helpers/saved_init_statement.py | dstl/Noisify | d776a74a66fa71c3f6aacd64f8c21af4f41f1714 | [
"MIT"
] | 11 | 2019-05-03T17:25:05.000Z | 2020-05-20T16:23:00.000Z | noisify/helpers/saved_init_statement.py | dstl/Noisify | d776a74a66fa71c3f6aacd64f8c21af4f41f1714 | [
"MIT"
] | null | null | null | noisify/helpers/saved_init_statement.py | dstl/Noisify | d776a74a66fa71c3f6aacd64f8c21af4f41f1714 | [
"MIT"
] | 2 | 2021-04-10T22:02:12.000Z | 2021-11-29T08:46:50.000Z | """
.. Dstl (c) Crown Copyright 2019
"""
import inspect
class SavedInitStatement:
"""Init statement saving mixin, introspects on object instantiation arguments and
saves them to the final object"""
def __init__(self, *args, **kwargs):
frame = inspect.currentframe()
_, _, _, values = inspe... | 28.227273 | 85 | 0.584541 | import inspect
class SavedInitStatement:
def __init__(self, *args, **kwargs):
frame = inspect.currentframe()
_, _, _, values = inspect.getargvalues(frame)
value_set = [str(values['args'])]
if kwargs:
if values['args']:
value_set += [str(values['kwargs']... | true | true |
f742a5c8321e25e3467e825bea40168c002d97f3 | 2,459 | py | Python | src/main/python/countries/vocabulary.py | phohenecker/country-data-gen | 16db50fe7383671c526d6c3c8101e51953b613b2 | [
"BSD-2-Clause"
] | 4 | 2018-09-03T09:48:05.000Z | 2021-09-20T16:40:35.000Z | src/main/python/countries/vocabulary.py | phohenecker/country-data-gen | 16db50fe7383671c526d6c3c8101e51953b613b2 | [
"BSD-2-Clause"
] | null | null | null | src/main/python/countries/vocabulary.py | phohenecker/country-data-gen | 16db50fe7383671c526d6c3c8101e51953b613b2 | [
"BSD-2-Clause"
] | 1 | 2020-03-21T20:12:00.000Z | 2020-03-21T20:12:00.000Z | # -*- coding: utf-8 -*-
"""This module defines various constants that describe the vocabulary of the used ontology."""
__author__ = "Patrick Hohenecker"
__copyright__ = (
"Copyright (c) 2018, Patrick Hohenecker\n"
"All rights reserved.\n"
"\n"
"Redistribution and use in source and bin... | 46.396226 | 94 | 0.704758 |
__author__ = "Patrick Hohenecker"
__copyright__ = (
"Copyright (c) 2018, Patrick Hohenecker\n"
"All rights reserved.\n"
"\n"
"Redistribution and use in source and binary forms, with or without\n"
"modification, are permitted provided that the following conditions are met:\n"
... | true | true |
f742a5c9df24d696a77918127127f5d992d640d6 | 2,890 | py | Python | examples/guarded/guarded.py | schwabe/nevow | 12fce8aed130aeab74352e232666f3c5a2223817 | [
"MIT"
] | null | null | null | examples/guarded/guarded.py | schwabe/nevow | 12fce8aed130aeab74352e232666f3c5a2223817 | [
"MIT"
] | null | null | null | examples/guarded/guarded.py | schwabe/nevow | 12fce8aed130aeab74352e232666f3c5a2223817 | [
"MIT"
] | 1 | 2019-02-28T13:46:26.000Z | 2019-02-28T13:46:26.000Z |
from zope.interface import implements
from twisted.cred import portal, checkers, credentials
from nevow import inevow, rend, tags, guard, loaders
### Renderers
class NotLoggedIn(rend.Page):
"""The resource that is returned when you are not logged in"""
addSlash = True
docFactory = loaders.stan(
tag... | 29.191919 | 105 | 0.568858 |
from zope.interface import implements
from twisted.cred import portal, checkers, credentials
from nevow import inevow, rend, tags, guard, loaders
.Page):
addSlash = True
docFactory = loaders.stan(
tags.html[
tags.head[tags.title["Not Logged In"]],
tags.body[
tags.form(action... | true | true |
f742a63ec55a16ffca53f1a4d8bf318e962cfc73 | 2,039 | py | Python | unclecrypto/crypto.py | UncleEngineer/unclecrypto | fd26b123dab32a2b259b6226d26317f76a939b6f | [
"MIT"
] | 1 | 2021-04-20T01:56:02.000Z | 2021-04-20T01:56:02.000Z | unclecrypto/crypto.py | UncleEngineer/unclecrypto | fd26b123dab32a2b259b6226d26317f76a939b6f | [
"MIT"
] | null | null | null | unclecrypto/crypto.py | UncleEngineer/unclecrypto | fd26b123dab32a2b259b6226d26317f76a939b6f | [
"MIT"
] | null | null | null | #crypto.py
from urllib.request import urlopen as req
from bs4 import BeautifulSoup as soup
def rangeprice(name='bitcoin',start='20200101',end='20200131'):
url = 'https://coinmarketcap.com/currencies/{}/historical-data/?start={}&end={}'.format(name,start,end)
webopen = req(url)
page_html = webopen.read()
webopen... | 25.17284 | 137 | 0.632663 |
from urllib.request import urlopen as req
from bs4 import BeautifulSoup as soup
def rangeprice(name='bitcoin',start='20200101',end='20200131'):
url = 'https://coinmarketcap.com/currencies/{}/historical-data/?start={}&end={}'.format(name,start,end)
webopen = req(url)
page_html = webopen.read()
webopen.close()
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.