hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c199cfcd8fedad8450e57530dec9a9335a9d042 | 270 | py | Python | webapp/post/urls.py | n3k0fi5t/ClonePttWeb | f2a5abb523c244389113b653ed20252fbcec5251 | [
"MIT"
] | null | null | null | webapp/post/urls.py | n3k0fi5t/ClonePttWeb | f2a5abb523c244389113b653ed20252fbcec5251 | [
"MIT"
] | null | null | null | webapp/post/urls.py | n3k0fi5t/ClonePttWeb | f2a5abb523c244389113b653ed20252fbcec5251 | [
"MIT"
] | null | null | null | from django.urls import re_path
from .views import BoardView, PostView
app_name = 'post'
urlpatterns = [
re_path('^(?P<board_name>\w+)/$', BoardView.as_view(), name='board'),
re_path('^(?P<board_name>\w+)/(?P<endpoint>.+)/', PostView.as_view(), name='post'),
] | 30 | 87 | 0.655556 |
1c199e0916ba81d9dd81a3b28296676a2ebfa58f | 1,924 | py | Python | weboob/py/connector.py | frankrousseau/kresus | 617967e111ac4b9a13ee4524f2db2428c2dbc954 | [
"MIT"
] | null | null | null | weboob/py/connector.py | frankrousseau/kresus | 617967e111ac4b9a13ee4524f2db2428c2dbc954 | [
"MIT"
] | null | null | null | weboob/py/connector.py | frankrousseau/kresus | 617967e111ac4b9a13ee4524f2db2428c2dbc954 | [
"MIT"
] | null | null | null | from weboob.core import WebNip
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
class Connector(object):
'''
Connector is a tool that connects to common websites like bank website,
phone operator website... and that grabs personal data from there.
Credentials are required to make this operation.
Technicall... | 33.754386 | 76 | 0.56341 |
1c19dfb33a6ebc155670f0c08eb58365c4b97604 | 19,252 | py | Python | homeassistant/components/template/light.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 1 | 2020-04-07T15:44:54.000Z | 2020-04-07T15:44:54.000Z | homeassistant/components/template/light.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:31:36.000Z | 2022-03-12T01:00:03.000Z | homeassistant/components/template/light.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 1 | 2020-06-01T12:43:03.000Z | 2020-06-01T12:43:03.000Z | """Support for Template lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_HS_COLOR,
ATTR_WHITE_VALUE,
ENTITY_ID_FORMAT,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPORT_COLOR_TEMP,
SUPPORT_WHITE_VALUE,
... | 34.876812 | 105 | 0.59999 |
1c19ec1018b31ee6c457a34ec81e8afc7514bedb | 2,307 | py | Python | tests_smoke/smoke/test_api_one_off.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | tests_smoke/smoke/test_api_one_off.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | tests_smoke/smoke/test_api_one_off.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | from typing import Any, Dict
import requests
from .common import (
Attachment_type,
Config,
Notification_type,
pretty_print,
single_succeeded,
)
def test_api_one_off(notification_type: Notification_type, attachment_type: Attachment_type = Attachment_type.NONE):
if attachment_type is Attachme... | 31.175676 | 117 | 0.598179 |
1c19f41f055f0e57505c6e37b8b3b8904534a85a | 11,742 | py | Python | primehub/admin_volumes.py | InfuseAI/primehub-python-sdk | edbdbcb3e41f0c99e4542245de1345a64f509fb4 | [
"Apache-2.0"
] | 10 | 2021-09-13T23:14:22.000Z | 2022-02-06T06:07:40.000Z | primehub/admin_volumes.py | KellenJohn/primehub-python-sdk | edbdbcb3e41f0c99e4542245de1345a64f509fb4 | [
"Apache-2.0"
] | 4 | 2021-08-10T03:10:27.000Z | 2021-12-16T02:11:50.000Z | primehub/admin_volumes.py | KellenJohn/primehub-python-sdk | edbdbcb3e41f0c99e4542245de1345a64f509fb4 | [
"Apache-2.0"
] | 1 | 2021-12-21T11:59:51.000Z | 2021-12-21T11:59:51.000Z | import json
from typing import Optional
from primehub import Helpful, Module, cmd, primehub_load_config
from primehub.utils import PrimeHubException
from primehub.utils.optionals import file_flag
from primehub.utils.validator import validate_name, validate_pv_groups
def waring_if_needed(data: dict, stderr):
if d... | 30.419689 | 119 | 0.552461 |
1c1a12a83c9dfa23ae1c931c3bb59a89387bb0cc | 4,373 | py | Python | pytorch/torch/random.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/random.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/random.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | import contextlib
import warnings
from torch._C import default_generator
import torch
def set_rng_state(new_state) -> None:
r"""Sets the random number generator state.
Args:
new_state (torch.ByteTensor): The desired state
"""
default_generator.set_state(new_state)
def get_rng_state() -> to... | 35.552846 | 103 | 0.664304 |
1c1a2360d3305f52fdb8a790a62c062c976bfe53 | 10,475 | py | Python | bookworm/bookshelf/local_bookshelf/dialogs.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 18 | 2019-07-19T22:12:15.000Z | 2020-08-26T17:45:19.000Z | bookworm/bookshelf/local_bookshelf/dialogs.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 44 | 2019-07-15T10:17:00.000Z | 2020-07-26T11:22:53.000Z | bookworm/bookshelf/local_bookshelf/dialogs.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 9 | 2019-09-03T13:13:31.000Z | 2020-08-25T13:55:27.000Z | # coding: utf-8
from __future__ import annotations
import os
import operator
import wx
import wx.lib.sized_controls as sc
import wx.lib.filebrowsebutton as filebrowse
from bookworm import speech
from bookworm.reader import EBookReader
from bookworm.resources import sounds
from bookworm.gui.components import (
Simp... | 42.581301 | 148 | 0.640477 |
1c1aba16f1d0df13312e6c54da2dd71c2cdb386d | 6,525 | py | Python | userbot/modules/filter.py | JoanLindo/BaianoBot-backup-sexo | b3d0b0f83b6460c3279a243ab753745df1562852 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-11-23T16:43:44.000Z | 2021-11-23T16:43:44.000Z | userbot/modules/filter.py | JoanLindo/purpled | fd95c674de3e4c0bc9eb909dddb4a65c7623fa02 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/filter.py | JoanLindo/purpled | fd95c674de3e4c0bc9eb909dddb4a65c7623fa02 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for filter commands """
from asyncio import sleep
from re import IGNORECASE, escape, search
from u... | 39.545455 | 120 | 0.622989 |
1c1acbfdf41e8470d804a47acbbf729720f32fd4 | 366 | py | Python | high/thread1.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | high/thread1.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | high/thread1.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import time,thread
def print_time(threadName,delay):
count = 0
while count<5:
time.sleep(delay)
count+=1
print "%s:%s" %(threadName,time.ctime(time.time()))
try:
thread.start_new_thread(print_time,("thread-1",2,))
thread.start_new_thread(print_time,("thread-2",4,))... | 18.3 | 53 | 0.688525 |
1c1b07d3f5b1a8c4bc835d871b18f2519e9ad590 | 15,817 | py | Python | autotest/ogr/ogr_rfc35_sqlite.py | chambbj/gdal | 3d56aecb5b8e9890dae8f560acd099992e707d12 | [
"MIT"
] | 1 | 2015-02-16T16:51:38.000Z | 2015-02-16T16:51:38.000Z | autotest/ogr/ogr_rfc35_sqlite.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | autotest/ogr/ogr_rfc35_sqlite.py | theduckylittle/gdal | 61be261cae524582ba28bceebb027cc1e967e0ab | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test RFC35 for SQLite driver
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
##############################################################... | 29.022018 | 112 | 0.617437 |
1c1b0ca57812126361db5974f6ebc5de4309cfe9 | 15,457 | py | Python | Notebooks/Tutorials/GAN_Digit_tutorial.py | sa-artea/VVG-MLModel-Trainer | 42bcaec9910ab58886dd9ebe739dbdb49426c40f | [
"MIT"
] | null | null | null | Notebooks/Tutorials/GAN_Digit_tutorial.py | sa-artea/VVG-MLModel-Trainer | 42bcaec9910ab58886dd9ebe739dbdb49426c40f | [
"MIT"
] | null | null | null | Notebooks/Tutorials/GAN_Digit_tutorial.py | sa-artea/VVG-MLModel-Trainer | 42bcaec9910ab58886dd9ebe739dbdb49426c40f | [
"MIT"
] | null | null | null | """
https://machinelearningmastery.com/how-to-develop-a-generative-adversarial-network-for-an-mnist-handwritten-digits-from-scratch-in-keras/
"""
# example of training a gan on mnist
from numpy import expand_dims
from numpy import zeros
from numpy import ones
from numpy import vstack
from numpy.random import randn
fr... | 35.780093 | 137 | 0.698971 |
1c1b33fdf9e76530964c6bca2fc1b6361437f0d3 | 3,116 | py | Python | arithmetic_analysis/in_static_equilibrium.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | arithmetic_analysis/in_static_equilibrium.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | arithmetic_analysis/in_static_equilibrium.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | 1 | 2020-06-26T09:46:17.000Z | 2020-06-26T09:46:17.000Z | '''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT... | 29.961538 | 77 | 0.621309 |
1c1b4a60ec4ec4c894cc1c63e5473ddddaf77353 | 1,365 | py | Python | tests/tools/test_surelog.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | 1 | 2022-03-10T03:56:49.000Z | 2022-03-10T03:56:49.000Z | tests/tools/test_surelog.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | tests/tools/test_surelog.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | import os
import siliconcompiler
import pytest
@pytest.mark.eda
@pytest.mark.quick
def test_surelog(scroot):
gcd_src = os.path.join(scroot, 'examples', 'gcd', 'gcd.v')
design = "gcd"
step = "import"
chip = siliconcompiler.Chip(loglevel="INFO")
chip.load_target('freepdk45_demo')
chip.add('sour... | 24.375 | 62 | 0.660806 |
1c1b543da2708ac1608070980034dae0395cb122 | 1,319 | py | Python | linked_list/69_rotate_list.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | linked_list/69_rotate_list.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | linked_list/69_rotate_list.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def rotateRight(self, head, k):
"""
:type head: ListNode
:type k: int
:rtype: ListNode
"""
if not head:
... | 21.983333 | 90 | 0.482183 |
1c1b91f577fb734b743aa6f00aaebe8d0727dab9 | 52,281 | py | Python | keystone/tests/unit/test_v2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_v2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | keystone/tests/unit/test_v2.py | yanheven/keystone | 417b8941095f40674575ed951b4a03ebcdc91fef | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# 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... | 34.784431 | 79 | 0.561217 |
1c1b97adeb7e85d95eec0832aeadb651751cbe27 | 2,541 | py | Python | app/proxy/ippool/db.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | app/proxy/ippool/db.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | app/proxy/ippool/db.py | imokyou/admin_backend | d2415fb57277cde1dab34a317fc77f6d7405088f | [
"MIT"
] | null | null | null | # coding=utf8
import traceback
import json
import redis
from django.conf import settings
REDIS = settings.REDIS['proxy']
class RedisClient(object):
def __init__(self):
try:
if REDIS['password']:
redis_pool = redis.ConnectionPool(host=REDIS['host'], port=REDIS['port'], password... | 27.031915 | 133 | 0.590712 |
1c1be89ee658a45f0acbbb3ddb9f0c158f5327a2 | 3,151 | py | Python | tests/tls13/test_tls13_TLS_AES_128_GCM_SHA256.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | tests/tls13/test_tls13_TLS_AES_128_GCM_SHA256.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | tests/tls13/test_tls13_TLS_AES_128_GCM_SHA256.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implements a class to be used for unit testing.
"""
import pathlib
import logging
from tests.cipher_suite_tester import CipherSuiteTester
from tlsmate import tls
from tlsmate import msg
from tlsmate.tlssuite import TlsLibrary
class TestCase(CipherSuiteTester):
"""Class used for tests wi... | 36.639535 | 83 | 0.657886 |
1c1bf3ab7792a933c46b8c277e7b506d88bc9ffb | 5,412 | py | Python | src/snowflake/connector/file_util.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | null | null | null | src/snowflake/connector/file_util.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | null | null | null | src/snowflake/connector/file_util.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | 2 | 2021-03-16T12:41:29.000Z | 2021-03-16T14:50:08.000Z | #
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
from __future__ import division
import base64
import gzip
import os
import shutil
import struct
from io import BytesIO, open
from logging import getLogger
from typing import IO, Tuple
from Cryptodome.Hash import SHA256
from cryptography.hazma... | 32.407186 | 98 | 0.575942 |
1c1c1c0c2c8f21c2c1e2f73db12c546529cb7cf6 | 1,544 | py | Python | pyls/plugins/signature.py | cbosdo/python-language-server | a20b9dfa15e8eff4384caa911873587271efb674 | [
"MIT"
] | 1 | 2020-10-01T18:40:14.000Z | 2020-10-01T18:40:14.000Z | pyls/plugins/signature.py | cbosdo/python-language-server | a20b9dfa15e8eff4384caa911873587271efb674 | [
"MIT"
] | 2 | 2022-02-19T06:28:08.000Z | 2022-02-27T10:15:43.000Z | pyls/plugins/signature.py | cbosdo/python-language-server | a20b9dfa15e8eff4384caa911873587271efb674 | [
"MIT"
] | 1 | 2019-10-08T21:46:10.000Z | 2019-10-08T21:46:10.000Z | # Copyright 2017 Palantir Technologies, Inc.
import logging
import re
from pyls import hookimpl, _utils
log = logging.getLogger(__name__)
SPHINX = re.compile(r"\s*:param\s+(?P<param>\w+):\s*(?P<doc>[^\n]+)")
EPYDOC = re.compile(r"\s*@param\s+(?P<param>\w+):\s*(?P<doc>[^\n]+)")
GOOGLE = re.compile(r"\s*(?P<param>\w+).... | 28.592593 | 80 | 0.60557 |
1c1c1ec7bc10537a29db93b50aac0501e43ba2fd | 271 | py | Python | terrascript/gridscale/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/gridscale/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/gridscale/__init__.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/gridscale/__init__.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class gridscale(terrascript.Provider):
pass
| 18.066667 | 79 | 0.774908 |
1c1c35e00fa65f26d922f1e5e44234b2cd9e5c9c | 15,513 | py | Python | Part1/record_violation.py | ParashRahman/Database-Project | 3a934d82289b58dcf83497b658970b2d336c1fba | [
"Apache-2.0"
] | null | null | null | Part1/record_violation.py | ParashRahman/Database-Project | 3a934d82289b58dcf83497b658970b2d336c1fba | [
"Apache-2.0"
] | null | null | null | Part1/record_violation.py | ParashRahman/Database-Project | 3a934d82289b58dcf83497b658970b2d336c1fba | [
"Apache-2.0"
] | null | null | null | from application import Application
from error_checker import ErrorChecker
from errors import InvalidDateException
import add_person
class RecordViolation(Application):
def start_application(self, c):
self.cursor = c
self.list_of_inputs = [ None for i in range(8) ]
self.get_violation_no(0... | 38.115479 | 116 | 0.475988 |
1c1c7ac5c89fc6f8682efcb86527ccfcda1bc443 | 2,894 | py | Python | alipay/aop/api/domain/PaidOuterCardPurchaseInfoDTO.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/PaidOuterCardPurchaseInfoDTO.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/PaidOuterCardPurchaseInfoDTO.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class PaidOuterCardPurchaseInfoDTO(object):
def __init__(self):
self._action_date = None
self._alipay_trade_no = None
self._out_trade_no = None
self._price = None
... | 28.653465 | 81 | 0.587422 |
1c1c9cdbf40eb3a68e1c5c75f5f0c3268f5ab882 | 838 | py | Python | django_messages/urls.py | michaelmior/django-messages | fd48dbfd203459b270007953e6e8f010f985abf1 | [
"BSD-3-Clause"
] | null | null | null | django_messages/urls.py | michaelmior/django-messages | fd48dbfd203459b270007953e6e8f010f985abf1 | [
"BSD-3-Clause"
] | null | null | null | django_messages/urls.py | michaelmior/django-messages | fd48dbfd203459b270007953e6e8f010f985abf1 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls.defaults import *
from django.views.generic import RedirectView
from django_messages.views import *
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='inbox/'), name='messages_redirect'),
url(r'^inbox/$', inbox, name='messages_inbox'),
url(r'^outbox/$', outbox, name='mes... | 46.555556 | 82 | 0.655131 |
1c1cb31f5561763793ff5b3fa91c804793dea091 | 7,411 | py | Python | swtloc/bubble_bbox.py | ag-ds-bubble/swtloc | ca4a3bf323a0d7a2928634df99d193ca5c2a16d2 | [
"BSD-3-Clause"
] | 30 | 2020-12-09T12:24:40.000Z | 2022-03-16T22:29:34.000Z | swtloc/bubble_bbox.py | carpediemzt/swtloc | af11cfa4369116ed708b9db930b294ed9a430f59 | [
"BSD-3-Clause"
] | 10 | 2020-12-09T13:00:47.000Z | 2022-03-16T11:19:36.000Z | swtloc/bubble_bbox.py | carpediemzt/swtloc | af11cfa4369116ed708b9db930b294ed9a430f59 | [
"BSD-3-Clause"
] | 4 | 2021-01-26T09:37:16.000Z | 2022-01-11T16:49:37.000Z | # Author : Achintya Gupta
import numpy as np
from cv2 import cv2
class BubbleBBOX:
def __init__(self, labelmask, comp_props, lookup_radii_multiplier=0.8,
sw_ratio = 2, cl_deviat = [13,13,13], ht_ratio = 2, ar_ratio = 3, ang_deviat = 30,
bubble_width = 1):
self.l... | 41.634831 | 137 | 0.616921 |
1c1ce2dd0b23b73087c24e13c3ccdfdc47d4c372 | 4,890 | py | Python | smolDM/client.py | andreheringer/smolDM | 6486048293a0f1dda71ce3d88f361cb9c3a524d5 | [
"MIT"
] | 4 | 2020-04-01T01:11:49.000Z | 2021-04-14T11:42:01.000Z | smolDM/client.py | andreheringer/smolDM | 6486048293a0f1dda71ce3d88f361cb9c3a524d5 | [
"MIT"
] | 6 | 2020-04-22T20:56:25.000Z | 2020-04-22T20:56:27.000Z | smolDM/client.py | andreheringer/crael | 6486048293a0f1dda71ce3d88f361cb9c3a524d5 | [
"MIT"
] | null | null | null | """
This module defines the Discord Clint interface.
:copywrite: Andre Heringer 2018-2019
:license: MIT, see license for details
"""
import asyncio
import discord
from pathlib import Path
from typing import Optional
from loguru import logger
import smolDM.commands as cmd
import smolDM.compass as compass
import smolD... | 30 | 85 | 0.624949 |
1c1cf9da105efe4e6ec378073c48ecdc2a36487d | 14,128 | py | Python | configs/mvxnet/parallel/hybrid/dv_parallel_mvx_pgd_adamw_kitti-3d-3class_loss2_pre_choi_aux4_ifatv2_iou.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/parallel/hybrid/dv_parallel_mvx_pgd_adamw_kitti-3d-3class_loss2_pre_choi_aux4_ifatv2_iou.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/parallel/hybrid/dv_parallel_mvx_pgd_adamw_kitti-3d-3class_loss2_pre_choi_aux4_ifatv2_iou.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../../_base_/schedules/cosine.py', '../../../_base_/default_runtime.py'
]
# model settings
voxel_size = [0.05, 0.05, 0.1]
point_cloud_range = [0, -40, -3, 70.4, 40, 1]
model = dict(
type='ParallelMVXMono3D',
loss_pts_w = 1.,
loss_img_w = 0.125,
use_li_fusion_layer=True,
pos_li_f... | 33.009346 | 79 | 0.56703 |
1c1d28c8e9633f5c149dc14e8b9eaa1dff800d37 | 5,789 | py | Python | hytra/dvid/upload_dataset.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/dvid/upload_dataset.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | hytra/dvid/upload_dataset.py | m-novikov/hytra | 0dc28deaa2571fa8bea63ca178f0e53cc1cd7508 | [
"MIT"
] | null | null | null | import logging
from libdvid import DVIDNodeService, DVIDServerService
import numpy as np
import json_tricks.np as json
from pluginsystem.plugin_manager import TrackingPluginManager
def dataToBlock(data, dtype=np.uint8, block_size=32):
if len(data.shape) == 2:
data = np.expand_dims(data, axis=2)
elif l... | 34.254438 | 318 | 0.643807 |
1c1d3467fe832215492835f105fafc1c252e7912 | 17,368 | py | Python | tests/mypy_test.py | Harry-Lees/typeshed | 5fa31e675980226416272271b86def0d88915f9b | [
"Apache-2.0"
] | 2 | 2022-01-02T05:45:47.000Z | 2022-01-19T04:00:42.000Z | tests/mypy_test.py | Harry-Lees/typeshed | 5fa31e675980226416272271b86def0d88915f9b | [
"Apache-2.0"
] | 12 | 2022-01-02T13:23:13.000Z | 2022-01-30T06:02:03.000Z | tests/mypy_test.py | Harry-Lees/typeshed | 5fa31e675980226416272271b86def0d88915f9b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Test runner for typeshed.
Depends on mypy being installed.
Approach:
1. Parse sys.argv
2. Compute appropriate arguments for mypy
3. Pass those arguments to mypy.api.run()
"""
from __future__ import annotations
import argparse
import os
import re
import shutil
import subprocess
import sys
i... | 35.663244 | 123 | 0.641179 |
1c1d5c1bb82a809a09739b7673fec47e3c23b6c0 | 538 | py | Python | basic/forDemo.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | basic/forDemo.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | basic/forDemo.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
print '今天我们学习:%s' % '循环语句'
#第一种循环
print '-------------------for------------------'
classmates = ['Tom','Jack','John','merry']
for classmate in classmates:
print classmate
sum = 0
for x in xrange(1,10):
sum +=x
print '累计和为 sum =',sum
print '生成序列range(10)'
num = range(10)
pr... | 17.354839 | 48 | 0.520446 |
1c1d6a08343534515329fd926ac598d96c818aef | 1,804 | py | Python | fugue_spark/ibis_engine.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | fugue_spark/ibis_engine.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | fugue_spark/ibis_engine.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Callable, Optional
import ibis
import ibis.expr.types as ir
from fugue import DataFrame, DataFrames, ExecutionEngine
from fugue_ibis._utils import to_schema
from fugue_ibis.execution.ibis_engine import IbisEngine, register_ibis_engine
from pyspark.sql import DataFrame as PySparkDataFrame
from t... | 35.372549 | 87 | 0.710089 |
1c1d802227e5e9c91a1eb1b1556169ad6a892c6f | 2,760 | py | Python | test/lib/test_argformats.py | baderj/refinery | 801c900a7184dfd47f5455124fbcfb4cf68814ed | [
"BSD-3-Clause"
] | 1 | 2022-02-13T20:57:15.000Z | 2022-02-13T20:57:15.000Z | test/lib/test_argformats.py | baderj/refinery | 801c900a7184dfd47f5455124fbcfb4cf68814ed | [
"BSD-3-Clause"
] | null | null | null | test/lib/test_argformats.py | baderj/refinery | 801c900a7184dfd47f5455124fbcfb4cf68814ed | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from refinery.lib import argformats
from refinery.lib import loader
from .. import TestBase
class TestArgumentFormats(TestBase):
def test_hex_number_arg(self):
self.assertEqual(argformats.number('045FAD'), 0x45FAD)
self.assertEqual(argformats.number... | 40.588235 | 110 | 0.653986 |
1c1d9befeb767fa538bcd6d87c9b2d11ffc8882a | 2,060 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/secure_value_type_temporary_registration.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/secure_value_type_temporary_registration.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/secure_value_type_temporary_registration.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 32.1875 | 103 | 0.645146 |
1c1da3cebd5f1cd78625f2bad1104ea62879f7b7 | 24,918 | py | Python | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 1 | 2020-08-08T21:56:11.000Z | 2020-08-08T21:56:11.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 2 | 2021-03-31T19:54:17.000Z | 2021-06-02T02:33:56.000Z | NBA Project/venv/Lib/site-packages/plotly/graph_objs/choropleth/colorbar/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# font
# ----
@property
def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now depr... | 34.512465 | 82 | 0.565254 |
1c1da7330cdec13e2548f665f4de51eafe1f091a | 3,988 | py | Python | smiler/instrumenting/utils.py | samadpaydar/acvtool | 84d6977cf9e7db247216735cd8828ae90111cf85 | [
"Apache-2.0"
] | 53 | 2018-10-02T18:54:20.000Z | 2022-01-11T03:56:36.000Z | smiler/instrumenting/utils.py | samadpaydar/acvtool | 84d6977cf9e7db247216735cd8828ae90111cf85 | [
"Apache-2.0"
] | 23 | 2019-01-07T08:31:39.000Z | 2021-12-13T19:50:02.000Z | smiler/instrumenting/utils.py | samadpaydar/acvtool | 84d6977cf9e7db247216735cd8828ae90111cf85 | [
"Apache-2.0"
] | 22 | 2018-11-17T03:42:28.000Z | 2022-02-12T05:29:52.000Z | import os
import shutil
from time import time
from datetime import datetime
class Utils(object):
''' Static Helpers.'''
@staticmethod
def rm_tree(path):
'''Removes all the files.'''
if os.path.isdir(path):
if os.name == 'nt':
#Hack for Windows. Shutil can't remo... | 34.678261 | 106 | 0.555667 |
1c1dae59664721b41c4cf828f4ef8a2a4b55144f | 3,138 | py | Python | py/cidoc_crm_types/entities/e77_persistent_item.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/entities/e77_persistent_item.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/entities/e77_persistent_item.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | from .e1_crm_entity import E1CRMEntity
from dataclasses import dataclass
@dataclass
class E77PersistentItem(E1CRMEntity):
"""
Scope note:
This class comprises items that have persistent characteristics of structural nature substantially related to their identity and their integrity, sometimes known as “endu... | 104.6 | 978 | 0.809751 |
1c1ddb9011f9d50a162ca14296f8867a6d953361 | 8,857 | py | Python | Tools/scons/scons-local/SCons/Tool/javac.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/javac.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/javac.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """SCons.Tool.javac
Tool-specific initialization for javac.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2017 The SCons Foundation
#
# Permission is hereby granted, f... | 37.850427 | 159 | 0.594897 |
1c1ddf17adf72e62a78136fd3ec4ae73ab6abd83 | 6,256 | py | Python | tempest/cli/simple_read_only/test_nova.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/cli/simple_read_only/test_nova.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/cli/simple_read_only/test_nova.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# 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 requ... | 30.517073 | 78 | 0.650575 |
1c1de1cdda5c343498bd6e96937a415a98c2120a | 7,552 | py | Python | guild/vcs_util.py | guildai/guild-python2 | 8f83e8234fc4b268b6f29ca7d0f1b93148e4d2a6 | [
"Apache-2.0"
] | null | null | null | guild/vcs_util.py | guildai/guild-python2 | 8f83e8234fc4b268b6f29ca7d0f1b93148e4d2a6 | [
"Apache-2.0"
] | null | null | null | guild/vcs_util.py | guildai/guild-python2 | 8f83e8234fc4b268b6f29ca7d0f1b93148e4d2a6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2022 RStudio, PBC
#
# 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... | 29.046154 | 82 | 0.615996 |
1c1e01e225d71208746b80f40b71459e3772911f | 4,824 | py | Python | gameanalysis/script/learning.py | calebho/gameanalysis | 280726a8aa125850b827a1e10b1203e91f515461 | [
"Apache-2.0"
] | null | null | null | gameanalysis/script/learning.py | calebho/gameanalysis | 280726a8aa125850b827a1e10b1203e91f515461 | [
"Apache-2.0"
] | null | null | null | gameanalysis/script/learning.py | calebho/gameanalysis | 280726a8aa125850b827a1e10b1203e91f515461 | [
"Apache-2.0"
] | null | null | null | """Analyze a game using gp learn"""
import argparse
import json
import sys
import warnings
from gameanalysis import learning
from gameanalysis import gamereader
from gameanalysis import nash
from gameanalysis import regret
def add_parser(subparsers):
"""Parser for learning script"""
parser = subparsers.add_p... | 41.586207 | 79 | 0.620854 |
1c1e5b36934035c3cc1ec24e09ab649d58715061 | 4,412 | py | Python | tester.py | zigaLuksic/glitch-doctor | 85ae7bfec15e0a0c564f31669c3d9f04a76aa159 | [
"MIT"
] | null | null | null | tester.py | zigaLuksic/glitch-doctor | 85ae7bfec15e0a0c564f31669c3d9f04a76aa159 | [
"MIT"
] | null | null | null | tester.py | zigaLuksic/glitch-doctor | 85ae7bfec15e0a0c564f31669c3d9f04a76aa159 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import time
from scipy.optimize import rosen, differential_evolution
from metamodel import Metamodel
from sklearn import ensemble, tree
from test_models.repressilator import repressilator, repressilator_bounds
# --------------------------------------------------------... | 33.172932 | 88 | 0.640979 |
1c1e7e4dfa4fdc350536afdc58a924b3f81240cd | 3,020 | py | Python | veros/diagnostics/cfl_monitor.py | AkasDutta/veros | 9f530596a0148a398829050017de3e01a71261a0 | [
"MIT"
] | 115 | 2019-11-23T02:31:30.000Z | 2022-03-29T12:58:30.000Z | veros/diagnostics/cfl_monitor.py | AkasDutta/veros | 9f530596a0148a398829050017de3e01a71261a0 | [
"MIT"
] | 207 | 2019-11-21T13:21:22.000Z | 2022-03-31T23:36:09.000Z | veros/diagnostics/cfl_monitor.py | AkasDutta/veros | 9f530596a0148a398829050017de3e01a71261a0 | [
"MIT"
] | 21 | 2020-01-28T13:13:39.000Z | 2022-02-02T13:46:33.000Z | from veros import logger
from veros.core.operators import numpy as npx
from veros.diagnostics.base import VerosDiagnostic
from veros.distributed import global_max
class CFLMonitor(VerosDiagnostic):
"""Diagnostic monitoring the maximum CFL number of the solution to detect
instabilities.
Writes output to s... | 34.318182 | 108 | 0.455629 |
1c1ee8ac1bbf369aec857b13ed467b7b6c6932f9 | 6,159 | py | Python | traffic/data/basic/airways.py | MichelKhalaf/traffic | 84e315d84a4ab9d8711414e7c275733e27a089ed | [
"MIT"
] | null | null | null | traffic/data/basic/airways.py | MichelKhalaf/traffic | 84e315d84a4ab9d8711414e7c275733e27a089ed | [
"MIT"
] | null | null | null | traffic/data/basic/airways.py | MichelKhalaf/traffic | 84e315d84a4ab9d8711414e7c275733e27a089ed | [
"MIT"
] | null | null | null | from __future__ import annotations
import logging
from io import BytesIO
from pathlib import Path
from typing import Tuple, Union
import pandas as pd
from shapely.geometry.base import BaseGeometry
from ...core.mixins import GeoDBMixin
from ...core.structure import Navaid, Route
__github_url = "https://raw.githubuse... | 32.935829 | 80 | 0.547816 |
1c1eea891c14a208222de9c41ad26f2fbf010557 | 6,515 | py | Python | matrix_content_scanner/servlets/__init__.py | babolivier/matrix-content-scanner-python | 3a9fe707467a551d06fedb94921d057f9177728f | [
"Apache-2.0"
] | 1 | 2021-12-10T18:59:02.000Z | 2021-12-10T18:59:02.000Z | matrix_content_scanner/servlets/__init__.py | babolivier/matrix-content-scanner-python | 3a9fe707467a551d06fedb94921d057f9177728f | [
"Apache-2.0"
] | null | null | null | matrix_content_scanner/servlets/__init__.py | babolivier/matrix-content-scanner-python | 3a9fe707467a551d06fedb94921d057f9177728f | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The Matrix.org Foundation C.I.C.
#
# 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 la... | 32.575 | 86 | 0.66109 |
1c1f17a2292e7517854a0a016451026e2b03690c | 3,385 | py | Python | tql/algo_ml/opt_params/XGBOptimizer.py | Jie-Yuan/1_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 14 | 2019-06-25T13:46:32.000Z | 2020-10-27T02:04:59.000Z | tql/algo_ml/opt_params/XGBOptimizer.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | null | null | null | tql/algo_ml/opt_params/XGBOptimizer.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 7 | 2019-06-25T13:26:16.000Z | 2020-10-27T02:05:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : tql-Python.
# @File : XGBOptimizer
# @Time : 2019-09-16 11:58
# @Author : yuanjie
# @Email : yuanjie@xiaomi.com
# @Software : PyCharm
# @Description :
import json
import yaml
import numpy as np
import xgboost as xgb
from... | 30.772727 | 96 | 0.524668 |
1c1f2b3b3d3820c98008b34c1be6cc866b211fa7 | 7,713 | py | Python | psg_utils/io/hypnogram/dhedreader.py | perslev/sleep-utils | 9f9edf67f4cac6d8361243b4153bfe6351314844 | [
"MIT"
] | 1 | 2022-03-17T10:37:17.000Z | 2022-03-17T10:37:17.000Z | psg_utils/io/hypnogram/dhedreader.py | perslev/sleep-utils | 9f9edf67f4cac6d8361243b4153bfe6351314844 | [
"MIT"
] | null | null | null | psg_utils/io/hypnogram/dhedreader.py | perslev/sleep-utils | 9f9edf67f4cac6d8361243b4153bfe6351314844 | [
"MIT"
] | null | null | null | """
MODIFIED FROM DeepSleepNet IMPLEMENTATION
https://github.com/akaraspt/deepsleepnet
https://github.com/akaraspt/deepsleepnet/blob/master/dhedfreader.py
Reader for EDF+ files.
"""
import logging
import re
import datetime
import numpy as np
from collections import namedtuple
logger = logging.getLogger(__name__)
EVE... | 33.38961 | 89 | 0.580578 |
1c1f603fbee2af83a396d863ed563894dab299e0 | 701 | py | Python | maquinaria/alquileres/models/alquileres.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/alquileres/models/alquileres.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | maquinaria/alquileres/models/alquileres.py | CFredy9/Maquinaria | 7b55d2e882702b62cdbb11f9684ab54d9b485199 | [
"MIT"
] | null | null | null | """Modelo de Alquileres"""
#Django
from django.db import models
from django.utils import timezone
#Utilities
from maquinaria.utils.models import CRideModel
from maquinaria.maquinas.models import Maquina
from datetime import datetime
from datetime import timedelta
class Alquiler(CRideModel):
cliente = models.F... | 22.612903 | 74 | 0.796006 |
1c1f676a3388bf7db3e947dc3c85949ac2486f08 | 10,682 | py | Python | processors/engine_comments_contract_processor.py | hive-engine/distribution-engine-smt | 9ed4fddbae17342700a4ba0f24c667c8b853c793 | [
"MIT"
] | null | null | null | processors/engine_comments_contract_processor.py | hive-engine/distribution-engine-smt | 9ed4fddbae17342700a4ba0f24c667c8b853c793 | [
"MIT"
] | null | null | null | processors/engine_comments_contract_processor.py | hive-engine/distribution-engine-smt | 9ed4fddbae17342700a4ba0f24c667c8b853c793 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from beem.constants import STEEM_100_PERCENT
from beem.utils import resolve_authorperm, construct_authorperm
from dat... | 71.691275 | 1,310 | 0.611122 |
1c1f88caa6b165584c22326e753fbd8294cb0088 | 12,766 | py | Python | tests/unit/fake_data_root/openstack/var/lib/juju/agents/unit-neutron-openvswitch-1/charm/unit_tests/test_neutron_ovs_hooks.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 6 | 2021-10-01T19:46:14.000Z | 2022-03-31T17:05:08.000Z | tests/unit/fake_data_root/openstack/var/lib/juju/agents/unit-neutron-openvswitch-1/charm/unit_tests/test_neutron_ovs_hooks.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 111 | 2021-10-01T18:18:17.000Z | 2022-03-29T12:23:20.000Z | tests/unit/fake_data_root/openstack/var/lib/juju/agents/unit-neutron-openvswitch-1/charm/unit_tests/test_neutron_ovs_hooks.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 10 | 2021-09-29T14:47:54.000Z | 2022-03-18T14:52:16.000Z | # Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 40.398734 | 79 | 0.653454 |
1c1fa4fcb623d3d8b15bca398f5b7e35d89f13ea | 9,936 | py | Python | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/multiapi/Expected/AcceptanceTests/MultiapiDataPlane/multiapidataplane/_operations_mixin.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.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 ... | 51.216495 | 122 | 0.687701 |
1c1fa8a1f2ed8cf454a4998769d95d7c6e36b87b | 1,253 | py | Python | savu/plugins/segmentation/evolving_contours/region_grow3D_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/plugins/segmentation/evolving_contours/region_grow3D_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/plugins/segmentation/evolving_contours/region_grow3D_tools.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | from savu.plugins.plugin_tools import PluginTools
class RegionGrow3dTools(PluginTools):
"""Fast 3D segmentation by evolving the user-given mask, the initialised
mask should be set in the central part of the object to be segmented.
"""
def define_parameters(self):
"""
threshold:
... | 28.477273 | 76 | 0.563448 |
1c1fc4df7e34836edae257ff58f1a0153688ef14 | 22 | py | Python | btd6_memory_info/generated/UnityEngine/Experimental/TerrainAPI/terrain_api.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/Experimental/TerrainAPI/terrain_api.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/Experimental/TerrainAPI/terrain_api.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class TerrainAPI: pass | 22 | 22 | 0.863636 |
1c1fcc0ab819d3845cea4baa7465a3e0977c85b8 | 17,238 | py | Python | src/pynwb/image.py | tjd2002/pynwb | 426109b85c2e683d96f2126286fb3369013abb8b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/pynwb/image.py | tjd2002/pynwb | 426109b85c2e683d96f2126286fb3369013abb8b | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/pynwb/image.py | tjd2002/pynwb | 426109b85c2e683d96f2126286fb3369013abb8b | [
"BSD-3-Clause-LBNL"
] | null | null | null | import numpy as np
from collections import Iterable
from .form.utils import docval, popargs, call_docval_func
from . import register_class, CORE_NAMESPACE
from .base import TimeSeries, _default_resolution, _default_conversion
@register_class('ImageSeries', CORE_NAMESPACE)
class ImageSeries(TimeSeries):
'''
... | 63.608856 | 114 | 0.600592 |
1c1fef8d8244a2a7dbfd44c09a67212134a73bd1 | 7,040 | py | Python | tests/manage/pv_services/pvc_snapshot/test_rbd_block_pvc_snapshot.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/pv_services/pvc_snapshot/test_rbd_block_pvc_snapshot.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | tests/manage/pv_services/pvc_snapshot/test_rbd_block_pvc_snapshot.py | nbalacha/ocs-ci | 9c5a5474d62777e868b80894d6b0f3567a7b605d | [
"MIT"
] | null | null | null | import logging
import pytest
from ocs_ci.ocs import constants
from ocs_ci.framework.testlib import (
skipif_ocs_version,
ManageTest,
tier1,
skipif_ocp_version,
)
from ocs_ci.ocs.resources.pod import cal_md5sum, verify_data_integrity
from ocs_ci.helpers.helpers import wait_for_resource_state, create_pod... | 34.009662 | 87 | 0.591903 |
1c1ff5dafa633101ac1353f79119479b70299c34 | 25,083 | py | Python | ryu/lib/ofctl_v1_2.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/ryu/lib/ofctl_v1_2.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/ryu/lib/ofctl_v1_2.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 Nippon Telegraph and Telephone 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 applicab... | 33.759085 | 75 | 0.566559 |
1c2013bf2028d7cbb724ad158588fa5ef3a19f2f | 9,824 | py | Python | experiments/ashvin/icra2021/widowx/sawyer_physical_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icra2021/widowx/sawyer_physical_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icra2021/widowx/sawyer_physical_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import rlkit.misc.hyperparameter as hyp
from rlkit.demos.source.dict_to_mdp_path_loader import EncoderDictToMDPPathLoader
from rlkit.launchers.experiments.ashvin.awac_rig import awac_rig_experiment
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.arglauncher import run_variants
from rlkit.t... | 36.117647 | 126 | 0.610037 |
1c201fb28871e0739e9374c85a66f7fab5dc669c | 1,659 | py | Python | sendim/tests/event.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | 1 | 2017-12-13T20:28:32.000Z | 2017-12-13T20:28:32.000Z | sendim/tests/event.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | sendim/tests/event.py | ZuluPro/snafu | dbd79da4617db315ba7e76a0af6805cc3b1cbae2 | [
"BSD-3-Clause"
] | null | null | null | """
"""
from django.utils import unittest
from django.core import management
from sendim.models import Alert, Event
from sendim.tests.defs import create_event, create_alert
class Event_TestCase(unittest.TestCase):
"""
"""
def setUp(self):
management.call_command('loaddata', 'test_supervisor.json', database='def... | 33.18 | 131 | 0.742013 |
1c203fd8a27aef68b219fd3cc2bc05c69e04fd55 | 152 | py | Python | venv/bin/django-admin.py | EmadElmogy/youtubeCrawler | 3bd3bafc3deb3aaa44ba7685dd490725f585bb22 | [
"MIT"
] | null | null | null | venv/bin/django-admin.py | EmadElmogy/youtubeCrawler | 3bd3bafc3deb3aaa44ba7685dd490725f585bb22 | [
"MIT"
] | null | null | null | venv/bin/django-admin.py | EmadElmogy/youtubeCrawler | 3bd3bafc3deb3aaa44ba7685dd490725f585bb22 | [
"MIT"
] | null | null | null | #!/home/emad/Documents/ytc/venv/bin/python2.7
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 25.333333 | 45 | 0.776316 |
1c204dc1ff7d894c755866aca5da6c7e86b4c881 | 24,716 | py | Python | trac/wiki/tests/macros.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | 1 | 2017-08-03T07:04:28.000Z | 2017-08-03T07:04:28.000Z | trac/wiki/tests/macros.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | null | null | null | trac/wiki/tests/macros.py | arielnetworks/trac | 1a96a3c39961a8952358cb8c64ccf9e94079c26b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2013 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consi... | 46.371482 | 991 | 0.55454 |
1c2076a0e82cadd18b0d14d345adf961d063a2a0 | 11,471 | py | Python | easy_efficientdet/factory.py | waldemarmeier/easy-efficientdet | 1329f497fdfd0542ee0db074020c4db351b1aa57 | [
"Apache-2.0"
] | null | null | null | easy_efficientdet/factory.py | waldemarmeier/easy-efficientdet | 1329f497fdfd0542ee0db074020c4db351b1aa57 | [
"Apache-2.0"
] | null | null | null | easy_efficientdet/factory.py | waldemarmeier/easy-efficientdet | 1329f497fdfd0542ee0db074020c4db351b1aa57 | [
"Apache-2.0"
] | null | null | null | import json
import traceback
from inspect import isgeneratorfunction
from typing import Optional, Sequence, Tuple, Union
import tensorflow as tf
from easy_efficientdet._third_party.training import CosineLrSchedule
from easy_efficientdet.anchors import generate_anchor_boxes
from easy_efficientdet.config import ObjectD... | 41.561594 | 88 | 0.609014 |
1c20c6f91c170f591f1c93ab77dcc5386a57fdff | 27,517 | py | Python | aesara/gpuarray/neighbours.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | aesara/gpuarray/neighbours.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | aesara/gpuarray/neighbours.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | import aesara.tensor as at
from aesara.graph.basic import Apply
from aesara.graph.op import _NoPythonOp
from aesara.graph.params_type import ParamsType
from aesara.tensor.nnet.neighbours import Images2Neibs
from aesara.tensor.type import integer_dtypes
try:
from pygpu import gpuarray
except ImportError:
pass
... | 43.608558 | 125 | 0.422611 |
1c20cb52412f70f975496fabf83b70ee4448b7f8 | 739 | py | Python | architecture/timer.py | ChrisKonishi/multi-stream-crowd-counting-extended | 4b1590499bd93ac09e62c4c7760b88ae92e6b301 | [
"MIT"
] | 3 | 2020-10-14T12:52:04.000Z | 2022-03-02T11:38:23.000Z | architecture/timer.py | ChrisKonishi/multi-stream-crowd-counting-extended | 4b1590499bd93ac09e62c4c7760b88ae92e6b301 | [
"MIT"
] | null | null | null | architecture/timer.py | ChrisKonishi/multi-stream-crowd-counting-extended | 4b1590499bd93ac09e62c4c7760b88ae92e6b301 | [
"MIT"
] | 1 | 2020-11-16T22:33:53.000Z | 2020-11-16T22:33:53.000Z | from __future__ import absolute_import
from __future__ import division
import time
class Timer(object):
def __init__(self):
self.tot_time = 0.
self.calls = 0
self.start_time = 0.
self.diff = 0.
self.average_time = 0.
def tic(self):
# using time.time instead of ... | 26.392857 | 71 | 0.610284 |
1c20d489257a0c803379a69fab88590993a96b1a | 610 | py | Python | Common/StockMarketIndex/Yahoo/TnxIndex.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 2 | 2020-03-04T11:18:38.000Z | 2020-05-10T15:36:42.000Z | Common/StockMarketIndex/Yahoo/TnxIndex.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 6 | 2020-03-30T16:42:47.000Z | 2021-12-13T20:37:21.000Z | Common/StockMarketIndex/Yahoo/TnxIndex.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 1 | 2020-04-14T11:26:16.000Z | 2020-04-14T11:26:16.000Z | from Common.Measures.Time.TimeSpan import TimeSpan
from Common.StockMarketIndex.AbstractStockMarketIndex import AbstractStockMarketIndex
from pyarrow.lib import null
class TnxIndex(AbstractStockMarketIndex):
def __init__(self, source: str = 'yahoo', ticker: str = "^TNX", tm_spn: TimeSpan = null):
a_ticke... | 43.571429 | 93 | 0.704918 |
1c20d88fe4bcbe2c1f1e3413502dbf276f2d21b3 | 92,661 | py | Python | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 26 | 2017-04-12T16:25:44.000Z | 2018-10-30T10:10:15.000Z | # Copyright 2015 The TensorFlow 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 required by applica... | 37.89816 | 85 | 0.657558 |
1c217396a3f7c2a5e1749c5344246c889240466e | 1,822 | py | Python | e3sm_to_cmip/cmor_handlers/cesm_drybc.py | JGCRI/e3sm_to_cmip | 3d3bc7dd7e3a46a97dba4f13a888758e01ef4797 | [
"MIT"
] | null | null | null | e3sm_to_cmip/cmor_handlers/cesm_drybc.py | JGCRI/e3sm_to_cmip | 3d3bc7dd7e3a46a97dba4f13a888758e01ef4797 | [
"MIT"
] | null | null | null | e3sm_to_cmip/cmor_handlers/cesm_drybc.py | JGCRI/e3sm_to_cmip | 3d3bc7dd7e3a46a97dba4f13a888758e01ef4797 | [
"MIT"
] | null | null | null | """
bc_a1DDF, bc_a4DDF, bc_c1DDF, bc_c4DDF to drybc converter
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import cmor
from e3sm_to_cmip.lib import handle_variables
# list of raw variable names needed
RAW_VARIABLES = [str('bc_a1DDF'), str('bc_a4DDF'), str('bc_c1DDF'), str('bc... | 31.413793 | 87 | 0.590011 |
1c218d9a1249a8c2c20ffb879fbdd0532e2816a4 | 1,992 | py | Python | src/tespy/components/deprecated.py | govind-menon110/tespy | 69f00d6e8fa3d9ecc329e71ac9c53f1276fd06ae | [
"MIT"
] | null | null | null | src/tespy/components/deprecated.py | govind-menon110/tespy | 69f00d6e8fa3d9ecc329e71ac9c53f1276fd06ae | [
"MIT"
] | null | null | null | src/tespy/components/deprecated.py | govind-menon110/tespy | 69f00d6e8fa3d9ecc329e71ac9c53f1276fd06ae | [
"MIT"
] | null | null | null | # -*- coding: utf-8
import logging
from tespy.tools.helpers import TESPyComponentError
# %%
class PlaceHolderForError:
r"""Throw errors for deprecated classes."""
def __init__(self, *args, **kwargs):
msg = (
'Version 0.4.x introduced PEP 8 conform class names for all '
'clas... | 15.323077 | 76 | 0.722892 |
1c219e0eed56fbd8a5948a4838cf1d6d612356d9 | 125 | py | Python | setup.py | i4Ds/Karabo-Pipeline | c9a7f120b08b56af93bb953e284b33c107fd865c | [
"MIT"
] | null | null | null | setup.py | i4Ds/Karabo-Pipeline | c9a7f120b08b56af93bb953e284b33c107fd865c | [
"MIT"
] | 42 | 2022-01-27T14:12:46.000Z | 2022-03-31T14:21:26.000Z | setup.py | i4Ds/Karabo-Pipeline | c9a7f120b08b56af93bb953e284b33c107fd865c | [
"MIT"
] | null | null | null | from distutils.core import setup
# implicitly takes config from setup.cfg (used by conda build load_setup_py_data())
setup()
| 31.25 | 83 | 0.8 |
1c21b217e2c71095b6a3e196c7aabb797fa57dae | 8,020 | py | Python | IPython/core/logger.py | damianavila/ipython | 4481c323e0d261685ad350fc6f437494b889ab12 | [
"BSD-3-Clause-Clear"
] | 2 | 2020-11-30T14:04:30.000Z | 2021-11-08T11:29:05.000Z | IPython/core/logger.py | RuSHi2381/ipython | 4481c323e0d261685ad350fc6f437494b889ab12 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/core/logger.py | RuSHi2381/ipython | 4481c323e0d261685ad350fc6f437494b889ab12 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-11-19T05:18:41.000Z | 2020-11-19T05:18:41.000Z | """Logger class for IPython's logging facilities.
"""
#*****************************************************************************
# Copyright (C) 2001 Janko Hauser <jhauser@zscout.de> and
# Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. ... | 36.289593 | 83 | 0.558603 |
1c2208ea8a7d0e1e91c9876e6104c8d70c2a4ff0 | 3,253 | py | Python | benchmarking/cormorant/train_mutation.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | benchmarking/cormorant/train_mutation.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | benchmarking/cormorant/train_mutation.py | bfabiandev/atom3d | b2499ff743be2e851c286cabf64696682abffa44 | [
"MIT"
] | null | null | null | #
# Cormorant training script for the residue deletion dataset
#
import logging
import torch
from cormorant.data.collate import collate_siamese
from cormorant.data.utils import initialize_datasets
from cormorant.engine import Engine
from cormorant.engine import init_argparse, init_file_paths, init_logger, init_cuda
f... | 39.192771 | 154 | 0.65478 |
1c220a7987b1443ff9c37d0376a69fae069c916b | 940 | py | Python | sdks/python/test/test_ApiTokenResponsev2.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/test/test_ApiTokenResponsev2.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/test/test_ApiTokenResponsev2.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
from __future__ import absolute_import
import unittest
import appcente... | 23.5 | 95 | 0.723404 |
1c2220a8b1407258a71854845ea88eec8c7759c7 | 491 | py | Python | hw3/wordcount/othermapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2022-01-05T14:27:20.000Z | 2022-01-05T14:27:20.000Z | hw3/wordcount/othermapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | hw3/wordcount/othermapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
from csv import reader
import sys
for row in reader(iter(sys.stdin.readline, '')):
product = row[1].lower()
issue = row[3].lower()
if product == 'mortgage' or product == 'debt collection':
continue
else:
bagofwords = issue.split(' ')
for word in bagofwor... | 28.882353 | 90 | 0.578411 |
1c2222f7beecd8ed09574405810b07f4187ca212 | 1,656 | py | Python | design_pattern/memento/run.py | AustinHellerRepo/DesignPatternDemo | 2409315eb7494ff738e64e1ca51206fb46083040 | [
"MIT"
] | null | null | null | design_pattern/memento/run.py | AustinHellerRepo/DesignPatternDemo | 2409315eb7494ff738e64e1ca51206fb46083040 | [
"MIT"
] | null | null | null | design_pattern/memento/run.py | AustinHellerRepo/DesignPatternDemo | 2409315eb7494ff738e64e1ca51206fb46083040 | [
"MIT"
] | null | null | null | from design_pattern.memento.implementation import Implementor
import os
class ConsoleDisplay(Implementor):
"""
This class implements the interface for the
"""
def __init__(self):
super().__init__()
pass
def show(self):
# gather all of the lines to be printed out
_lines = [] # type: List[str]
_line... | 21.789474 | 65 | 0.661232 |
1c2229f0e31fce394692cf0aa3d0ee1175e42ca9 | 9,685 | py | Python | tests/unit/gapic/v2/test_session_entity_types_client_v2.py | gertventer1970/dialogflow-python-client-v2 | e78b0e6765f94fb9ecbbc72c9fc30ce7245703e2 | [
"Apache-2.0"
] | 1 | 2020-10-14T07:43:19.000Z | 2020-10-14T07:43:19.000Z | tests/unit/gapic/v2/test_session_entity_types_client_v2.py | everydaycodings/dialogflow-python-client-v2 | c1c925d94726f49e549870e087ad79ee491056e2 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/v2/test_session_entity_types_client_v2.py | everydaycodings/dialogflow-python-client-v2 | c1c925d94726f49e549870e087ad79ee491056e2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 35.346715 | 87 | 0.682499 |
1c224a22cd09a2d7839ee6e2f33716f9e7a32d46 | 207 | py | Python | iris_sdk/models/maps/reservation.py | NumberAI/python-bandwidth-iris | 0e05f79d68b244812afb97e00fd65b3f46d00aa3 | [
"MIT"
] | 2 | 2020-04-13T13:47:59.000Z | 2022-02-23T20:32:41.000Z | iris_sdk/models/maps/reservation.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2020-09-18T20:59:24.000Z | 2021-08-25T16:51:42.000Z | iris_sdk/models/maps/reservation.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2018-12-12T14:39:50.000Z | 2020-11-17T21:42:29.000Z | #!/usr/bin/env python
from iris_sdk.models.maps.base_map import BaseMap
class ReservationMap(BaseMap):
account_id = None
reservation_id = None
reservation_expires = None
reserved_tn = None | 20.7 | 49 | 0.743961 |
1c224a66a87898ab314c95757863bbafd1f66a66 | 1,732 | py | Python | cryptography/rail_fence_cipher/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | cryptography/rail_fence_cipher/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | cryptography/rail_fence_cipher/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | from itertools import cycle, chain
def fence_pattern(rail, size):
"""
Creates a fence pattern for th encoding of messages
This is done by creating a zig zag pattern using cycle and chain
chain will 'chain' the rail and the decreasing rail range to create 1 long iterable
cycle will produce this cha... | 37.652174 | 101 | 0.700346 |
1c22548b536cb544986eebdf7be092af6265fb62 | 13,640 | py | Python | mg_toolkit/bulk_download.py | EBI-Metagenomics/emg-full-metadata-download | 45e3bd3398468b12ff30ed7c227262a667126285 | [
"Apache-2.0"
] | 14 | 2018-05-12T14:11:46.000Z | 2021-09-04T12:30:12.000Z | mg_toolkit/bulk_download.py | EBI-Metagenomics/emg-full-metadata-download | 45e3bd3398468b12ff30ed7c227262a667126285 | [
"Apache-2.0"
] | 18 | 2018-08-08T15:30:32.000Z | 2022-03-15T11:57:11.000Z | mg_toolkit/bulk_download.py | EBI-Metagenomics/emg-full-metadata-download | 45e3bd3398468b12ff30ed7c227262a667126285 | [
"Apache-2.0"
] | 7 | 2018-05-12T14:11:32.000Z | 2021-07-31T10:09:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2021 EMBL - European Bioinformatics Institute
#
# 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/LICEN... | 35.154639 | 86 | 0.591129 |
1c22677c50792430b3c195cd863af7672f230a43 | 21,849 | py | Python | snip/network.py | Danderson123/snip-public | e464ffed8b76a102ae485ab12b44f0f3b5314ce4 | [
"MIT"
] | 85 | 2019-03-15T03:52:56.000Z | 2022-03-14T10:30:27.000Z | snip/network.py | Danderson123/snip-public | e464ffed8b76a102ae485ab12b44f0f3b5314ce4 | [
"MIT"
] | 1 | 2019-04-23T07:35:15.000Z | 2019-04-23T07:35:15.000Z | snip/network.py | Danderson123/snip-public | e464ffed8b76a102ae485ab12b44f0f3b5314ce4 | [
"MIT"
] | 18 | 2019-08-21T06:45:06.000Z | 2022-01-10T13:02:42.000Z | import tensorflow as tf
from functools import reduce
from helpers import static_size
def load_network(
datasource, arch, num_classes,
initializer_w_bp, initializer_b_bp, initializer_w_ap, initializer_b_ap,
):
networks = {
'lenet300': lambda: LeNet300(
initializer_w_bp,... | 50.343318 | 100 | 0.567806 |
1c228e2d64bdca77ef2e25d2d20151461ee11584 | 4,990 | py | Python | tests/common/output/test_get_exit_code.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | tests/common/output/test_get_exit_code.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | 3 | 2020-02-07T19:51:40.000Z | 2022-03-21T05:06:29.000Z | tests/common/output/test_get_exit_code.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | import unittest
from checkov.common.models.enums import CheckResult
from checkov.common.output.report import Report
from checkov.common.output.record import Record
class TestGetExitCode(unittest.TestCase):
def test_get_exit_code(self):
record1 = Record(check_id='CKV_AWS_157',
b... | 50.918367 | 117 | 0.561323 |
1c229bba4c5bae6cfdd2f1da1d86be022a5d6a06 | 10,294 | py | Python | keras/esim_init.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | 1 | 2020-05-22T02:03:34.000Z | 2020-05-22T02:03:34.000Z | keras/esim_init.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | null | null | null | keras/esim_init.py | ksboy/adversarial_attack | cb1e02b8ff31056cdd0eb1f747c1b08ed12527bc | [
"Apache-2.0"
] | 1 | 2019-12-04T14:29:23.000Z | 2019-12-04T14:29:23.000Z | import os
os.environ["CUDA_VISIBLE_DEVICES"] = "3"
import pandas as pd
import numpy as np
from tqdm import tqdm
import time
import logging
from sklearn.model_selection import StratifiedKFold
from keras_bert import load_trained_model_from_checkpoint, Tokenizer
from keras.optimizers import Adam
import pandas as... | 37.028777 | 108 | 0.615407 |
1c22a12469b487a47ba2149e1d89c0586cd20af1 | 539 | py | Python | notebooks/import_test_notebooks.py | vvandriichuk/etl_spark_airflow_emr | 0c793ca67389a789c8eb1f487fe3a384e714ff3b | [
"MIT"
] | 3 | 2021-01-02T01:18:39.000Z | 2021-06-09T19:52:38.000Z | notebooks/import_test_notebooks.py | philippschmalen/etl_spark_airflow_emr | 0c793ca67389a789c8eb1f487fe3a384e714ff3b | [
"MIT"
] | null | null | null | notebooks/import_test_notebooks.py | philippschmalen/etl_spark_airflow_emr | 0c793ca67389a789c8eb1f487fe3a384e714ff3b | [
"MIT"
] | 3 | 2021-06-12T04:06:33.000Z | 2021-12-01T17:48:38.000Z | import pandas as pd
import numpy as np
from sys import version
print(f"Python version: {version}")
query_return_length = 261
keywords = [i for i in range(20)]
# # create empty df with 0s
df_zeros = pd.DataFrame(np.zeros((query_return_length*len(keywords), 3)), columns=['date','keyword', 'search_interest'])
# repl... | 26.95 | 120 | 0.745826 |
1c22a95c230cc0e1d78e38a0c432fc4b5a2993fd | 3,489 | py | Python | bin/vertretung.py | SteffenDE/monitornjus-classic | 62ae69169621036bea19d39cb44e6966a3fa7356 | [
"MIT"
] | null | null | null | bin/vertretung.py | SteffenDE/monitornjus-classic | 62ae69169621036bea19d39cb44e6966a3fa7356 | [
"MIT"
] | null | null | null | bin/vertretung.py | SteffenDE/monitornjus-classic | 62ae69169621036bea19d39cb44e6966a3fa7356 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2015 Steffen Deusch
# Licensed under the MIT license
# Beilage zu MonitorNjus, 14.09.2015 (Version 0.9.3)
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
######### Settings #########
path = "sync/heute_und_morgen/"
name_heute = "subst_001.htm"
na... | 34.205882 | 171 | 0.63084 |
1c22bf8cd912ba6d1bfa0e8efc21a9e34069984c | 2,864 | py | Python | Analytics/resources/login.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 4 | 2018-11-21T14:42:18.000Z | 2020-05-11T10:52:59.000Z | Analytics/resources/login.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 60 | 2018-11-21T15:11:59.000Z | 2019-12-02T10:46:44.000Z | Analytics/resources/login.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 7 | 2018-11-21T14:42:44.000Z | 2019-11-28T16:24:14.000Z | from datetime import timedelta
from flask_restful import Resource, reqparse, inputs
from flask_jwt_extended import (create_access_token, create_refresh_token, jwt_required, get_jwt_identity,get_jwt_claims)
from db import db
from models.users import Users
class Login(Resource):
"""
API that grants users access to ... | 30.795699 | 121 | 0.728352 |
1c22d22dd8f02feb3353f8c76ad4d4594d162168 | 3,345 | py | Python | experiments/ashvin/icml2020/hand/pen/phases/sac_bc2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/phases/sac_bc2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/phases/sac_bc2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
if __name__ == "__main__":
variant = dict(... | 28.589744 | 74 | 0.571001 |
1c22ec4a77ca0e0de021be4a8b69679bb31f8a18 | 27,168 | py | Python | pods/mocap.py | lawrennd/ods | 16b5b577cfa6bbae52afac29f14083eadc963687 | [
"BSD-3-Clause"
] | 28 | 2015-07-15T06:44:55.000Z | 2022-03-01T19:08:56.000Z | pods/mocap.py | lawrennd/ods | 16b5b577cfa6bbae52afac29f14083eadc963687 | [
"BSD-3-Clause"
] | 13 | 2015-03-25T11:53:36.000Z | 2021-06-17T23:41:22.000Z | pods/mocap.py | lawrennd/ods | 16b5b577cfa6bbae52afac29f14083eadc963687 | [
"BSD-3-Clause"
] | 17 | 2015-01-06T01:49:02.000Z | 2021-12-20T19:25:32.000Z | # Copyright 2014 Open Data Science Initiative and other authors. See AUTHORS.txt
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import os
import sys
import numpy as np
import math
class vertex:
def __init__(self, name, id, parents=[], children=[], meta={}):
self.name = name
self.id =... | 35.467363 | 155 | 0.495804 |
1c233c0a1086c66a55f244dcf9faf92d78d048d1 | 3,314 | py | Python | api_env/app/app/settings.py | AnuragTimilsina/recipe-app-api | 77ed8c0aa490727dd4c54fcfb698426510c8a48d | [
"MIT"
] | null | null | null | api_env/app/app/settings.py | AnuragTimilsina/recipe-app-api | 77ed8c0aa490727dd4c54fcfb698426510c8a48d | [
"MIT"
] | null | null | null | api_env/app/app/settings.py | AnuragTimilsina/recipe-app-api | 77ed8c0aa490727dd4c54fcfb698426510c8a48d | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.0.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Bui... | 25.106061 | 91 | 0.691008 |
1c2349e20f1d31c8b7111c38d4b1026f9df73bc9 | 4,624 | py | Python | salt/modules/data.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/modules/data.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/modules/data.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage a local persistent data structure that can hold any arbitrary data
specific to the minion
'''
from __future__ import absolute_import
# Import python libs
import os
import ast
import logging
# Import salt libs
import salt.utils
import salt.payload
# Import 3rd-party lib
import salt.... | 17.716475 | 73 | 0.581964 |
1c236efa17c85dbb571cd6a759f8569556327186 | 199 | py | Python | homeassistant/external/__init__.py | Cribstone/home-assistant | 328b9a84c0169c8067f2aa8d07392519de8a5e35 | [
"MIT"
] | 1 | 2022-01-09T18:02:24.000Z | 2022-01-09T18:02:24.000Z | homeassistant/packages/__init__.py | jwveldhuis/home-assistant | f07622e0d77ceac236d631245a2486f249812666 | [
"MIT"
] | null | null | null | homeassistant/packages/__init__.py | jwveldhuis/home-assistant | f07622e0d77ceac236d631245a2486f249812666 | [
"MIT"
] | null | null | null | """
Not all external Git repositories that we depend on are
available as a package for pip. That is why we include
them here.
PyChromecast
------------
https://github.com/balloob/pychromecast
"""
| 16.583333 | 55 | 0.713568 |
1c23739d2d308e070b8630b274d954a65e7cc931 | 3,159 | py | Python | pre_commit/commands/install_uninstall.py | bukzor/pre-commit | 7d546c1f815a41f17af276e2f8d0636efdd87a6d | [
"MIT"
] | null | null | null | pre_commit/commands/install_uninstall.py | bukzor/pre-commit | 7d546c1f815a41f17af276e2f8d0636efdd87a6d | [
"MIT"
] | null | null | null | pre_commit/commands/install_uninstall.py | bukzor/pre-commit | 7d546c1f815a41f17af276e2f8d0636efdd87a6d | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import unicode_literals
import io
import logging
import os
import os.path
import stat
import sys
from pre_commit.logging_handler import LoggingHandler
from pre_commit.util import resource_filename
logger = logging.getLogger('pre_commit')
# This is used to iden... | 29.523364 | 78 | 0.707186 |
1c2390c7bce3bcdfcfc7e32900319e8c07211e06 | 3,161 | py | Python | assignment2/cs231n/layer_utils.py | lalithnag/cs231n | ed540c4ed06a6ee01966314e4106b8c44f58546b | [
"MIT"
] | 22 | 2019-07-15T08:26:31.000Z | 2022-01-17T06:29:17.000Z | assignment2/cs231n/layer_utils.py | lalithnag/cs231n | ed540c4ed06a6ee01966314e4106b8c44f58546b | [
"MIT"
] | 26 | 2020-03-24T17:18:21.000Z | 2022-03-11T23:54:37.000Z | assignment2/cs231n/layer_utils.py | lalithnag/cs231n | ed540c4ed06a6ee01966314e4106b8c44f58546b | [
"MIT"
] | 8 | 2019-07-17T09:13:11.000Z | 2021-04-16T11:20:51.000Z | pass
from cs231n.layers import *
from cs231n.fast_layers import *
def affine_relu_forward(x, w, b):
"""
Convenience layer that performs an affine transform followed by a ReLU
Inputs:
- x: Input to the affine layer
- w, b: Weights for the affine layer
Returns a tuple of:
- out: Output fro... | 29.542056 | 74 | 0.686808 |
1c23a7c756b53b807d9488b7a3be916e28a8de1b | 476 | py | Python | src/components/image/models.py | svenvandescheur/svenv.nl-new | c448714853d96ad31d26c825d8b35c4890be40a1 | [
"MIT"
] | null | null | null | src/components/image/models.py | svenvandescheur/svenv.nl-new | c448714853d96ad31d26c825d8b35c4890be40a1 | [
"MIT"
] | null | null | null | src/components/image/models.py | svenvandescheur/svenv.nl-new | c448714853d96ad31d26c825d8b35c4890be40a1 | [
"MIT"
] | null | null | null | from cms.models import CMSPlugin
from django.db import models
from django.utils.translation import ugettext as _
from filer.fields.image import FilerImageField
class ImagePlugin(CMSPlugin):
"""
A simple image plugin allowing custom CSS classes.
"""
alt_text = models.CharField(_('Alternative text'), ma... | 34 | 88 | 0.75 |
1c23e6da51bd129c7b83aa84a643bd9df97623df | 23,127 | py | Python | py_blackboard/client.py | PaoloRollo/py-blackboard | c8d7f49ff7b21f4eba6914d88cb89521befbd226 | [
"MIT"
] | null | null | null | py_blackboard/client.py | PaoloRollo/py-blackboard | c8d7f49ff7b21f4eba6914d88cb89521befbd226 | [
"MIT"
] | null | null | null | py_blackboard/client.py | PaoloRollo/py-blackboard | c8d7f49ff7b21f4eba6914d88cb89521befbd226 | [
"MIT"
] | null | null | null | import jwt
import requests
from datetime import datetime, timedelta
APPLICATION_JSON = "application/json"
APPLICATION_FORM_URLENCODED = "application/x-www-form-urlencoded"
class BlackboardClient:
"""
BlackboardClient class that handles all the blackboard requests.
"""
url = None
key = None
sec... | 41.005319 | 165 | 0.594586 |
1c23ed065e2159e63bd66eac34f96910384ff7a5 | 1,116 | py | Python | src/BribeNet/gui/classes/tooltip.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | src/BribeNet/gui/classes/tooltip.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | src/BribeNet/gui/classes/tooltip.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | import tkinter as tk
# noinspection PyUnusedLocal
class ToolTip(object):
"""
Show a tooltip
from https://stackoverflow.com/a/56749167/5539184
"""
def __init__(self, widget, text):
self.widget = widget
self.tip_window = None
self.id = None
self.x = self.y = 0
... | 31 | 78 | 0.564516 |
1c23f5ea5f1138f36c38382c18a4cb1f75f178f8 | 7,826 | py | Python | ament_package/package.py | Acidburn0zzz/ament_package | 8746846857872e74e1174f610ea3aacb1198ce6e | [
"Apache-2.0"
] | 1 | 2018-01-17T19:18:10.000Z | 2018-01-17T19:18:10.000Z | ament_package/package.py | Acidburn0zzz/ament_package | 8746846857872e74e1174f610ea3aacb1198ce6e | [
"Apache-2.0"
] | null | null | null | ament_package/package.py | Acidburn0zzz/ament_package | 8746846857872e74e1174f610ea3aacb1198ce6e | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Open Source Robotics Foundation, 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... | 35.899083 | 94 | 0.568873 |
1c2435ffb62dbaae800d3511da8ea16ceb870857 | 2,579 | py | Python | api/test/api/responders_test/test_data/links.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/test/api/responders_test/test_data/links.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/test/api/responders_test/test_data/links.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #
# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #
# #
... | 28.340659 | 79 | 0.562621 |
1c245a26b1ebfcd8b7a3b880617ecb0ee8c6377d | 2,793 | py | Python | src/tests/sensor_test.py | mattskone/robot_maze | 448394b90325518c987ce81222230cd7fef64000 | [
"MIT"
] | 3 | 2016-12-22T09:16:59.000Z | 2018-07-09T23:01:48.000Z | src/tests/sensor_test.py | mattskone/robot_maze | 448394b90325518c987ce81222230cd7fef64000 | [
"MIT"
] | 4 | 2015-10-04T05:05:53.000Z | 2015-12-18T17:16:48.000Z | src/tests/sensor_test.py | mattskone/robot_maze | 448394b90325518c987ce81222230cd7fef64000 | [
"MIT"
] | 2 | 2015-09-29T02:46:23.000Z | 2019-11-21T19:18:56.000Z | """Unit tests for the sensor module."""
import unittest
from mock import call, MagicMock, patch
import sensor
SENSOR_PIN = 0
class BaseSensorTest(unittest.TestCase):
"""Unit tests for the BaseSensor class."""
def setUp(self):
self.driver = MagicMock()
self.mount = MagicMock()
self.s = sensor.BaseSensor(d... | 29.09375 | 71 | 0.746151 |
1c246a550777f13a0693ded5b4e269a637158255 | 801 | py | Python | tests/test_layers_basic.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | null | null | null | tests/test_layers_basic.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | null | null | null | tests/test_layers_basic.py | lllcho/tensorlayer | 87591b4945a6a67dfb4ea797a575efae997fd9d2 | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import tensorlayer as tl
x = tf.placeholder(tf.float32, [None, 100])
n = tl.layers.InputLayer(x, name='in')
n = tl.layers.DenseLayer(n, 80, name='d1')
n = tl.layers.DenseLayer(n, 80, name='d2')
print(n)
n.print_layers()
n.print_params(False)
print(n.count_params())
if n.count_params() != 14560... | 20.538462 | 43 | 0.670412 |
1c248d87285c57e90bc39c231e930f95b666eb0b | 1,360 | py | Python | pyqt5_fundamentals/window13_QGridLayout.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | 1 | 2021-09-19T07:51:23.000Z | 2021-09-19T07:51:23.000Z | pyqt5_fundamentals/window13_QGridLayout.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | pyqt5_fundamentals/window13_QGridLayout.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from PyQt5 import QtWidgets
import sys
"""
QGridLayout: Allows easy grid-shape layout management.
Buttons and other similar elements in the GUI are dynamically re-sized w.r.t. window dimensions.
"""
def create_window():
# Define window:
obj = QtWidgets.QApplication(s... | 30.909091 | 110 | 0.685294 |
1c2495692d54ce7b308fa83b45b60fa3fb95d2c7 | 4,965 | py | Python | readthedocs/restapi/views/footer_views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/restapi/views/footer_views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | readthedocs/restapi/views/footer_views.py | gamearming/readthedocs | 53d0094f657f549326a86b8bd0ccf924c2126941 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from django.template import RequestContext, loader as template_loader
from django.conf import settings
from rest_framework import decorators, permissions
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
from rest_framework_js... | 40.365854 | 93 | 0.69003 |
1c24b5cd1919d95bf2b14654d5ab0de01eeaad15 | 13,240 | py | Python | tempest/scenario/test_load_balancer_basic.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/scenario/test_load_balancer_basic.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | tempest/scenario/test_load_balancer_basic.py | vmahuli/tempest | f70319f5eda72b8c8a913ae1002ec531324e4116 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Mirantis.inc
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 40.121212 | 78 | 0.579305 |
1c24b81a4a17cbdab0e7032899dd7b81df816cbe | 1,650 | py | Python | app/api/routers/items.py | flych3r/spotify-tracker | 306d549da6a57866ea480c85286d870e7653a1eb | [
"MIT"
] | 2 | 2021-06-25T00:24:13.000Z | 2021-07-10T13:00:39.000Z | app/api/routers/items.py | flych3r/spotify-tracker | 306d549da6a57866ea480c85286d870e7653a1eb | [
"MIT"
] | null | null | null | app/api/routers/items.py | flych3r/spotify-tracker | 306d549da6a57866ea480c85286d870e7653a1eb | [
"MIT"
] | 2 | 2021-05-16T01:40:39.000Z | 2021-07-10T12:59:07.000Z | from typing import Dict, List, Union
from fastapi import APIRouter, Query, Security
from app.api.crud.played_tracks import (
get_artists,
get_audio_features,
get_genres,
get_tracks,
)
from app.api.dependencies.config import AUDIO_FEATURES
from app.api.dependencies.security import get_current_user
from... | 29.464286 | 87 | 0.712727 |
1c24cedcb3bd852e3971e8c8795c43c4f39a5b8d | 927 | py | Python | bookworm/signals.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 18 | 2019-07-19T22:12:15.000Z | 2020-08-26T17:45:19.000Z | bookworm/signals.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 44 | 2019-07-15T10:17:00.000Z | 2020-07-26T11:22:53.000Z | bookworm/signals.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 9 | 2019-09-03T13:13:31.000Z | 2020-08-25T13:55:27.000Z | # coding: utf-8
"""
Implements the core signals of bookworm.
"""
from blinker import Namespace
# The namespace of bookworm signals
_signals = Namespace()
# Core app signals
app_booting = _signals.signal("app/booting")
app_starting = _signals.signal("app/starting")
app_started = _signals.signal("app/started")
app_w... | 26.485714 | 66 | 0.795038 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.