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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7156ae46165bfa283ef31892e3fde5d02b6eeab | 166 | py | Python | StarAcmSpider/StarAcmSpider/items.py | MeiK-h/StarACM | 54654bdc19c8eff02c67ba77784d08368570d4e7 | [
"MIT"
] | null | null | null | StarAcmSpider/StarAcmSpider/items.py | MeiK-h/StarACM | 54654bdc19c8eff02c67ba77784d08368570d4e7 | [
"MIT"
] | null | null | null | StarAcmSpider/StarAcmSpider/items.py | MeiK-h/StarACM | 54654bdc19c8eff02c67ba77784d08368570d4e7 | [
"MIT"
] | null | null | null | import scrapy
class StarAcmSpiderItem(scrapy.Item):
username = scrapy.Field()
source = scrapy.Field()
run_id = scrapy.Field()
data = scrapy.Field()
| 18.444444 | 37 | 0.674699 | import scrapy
class StarAcmSpiderItem(scrapy.Item):
username = scrapy.Field()
source = scrapy.Field()
run_id = scrapy.Field()
data = scrapy.Field()
| true | true |
f7156b5c602c9fa2552e9ba98cbbe35c20310e78 | 15,637 | py | Python | MomentumProject/mtInitialize_004.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | MomentumProject/mtInitialize_004.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | MomentumProject/mtInitialize_004.py | hpgit/HumanFoot | f9a1a341b7c43747bddcd5584b8c98a0d1ac2973 | [
"Apache-2.0"
] | null | null | null | import copy
import sys
#if '../PyCommon/modules' not in sys.path:
# sys.path.append('../PyCommon/modules')
if './modules' not in sys.path:
sys.path.append('./modules')
import Resource.ysMotionLoader as yf
import Simulator.ysPhysConfig as ypc
import Math.mmMath as mm
import Motion.ysHierarchyEdit as ... | 34.904018 | 387 | 0.592249 | import copy
import sys
if './modules' not in sys.path:
sys.path.append('./modules')
import Resource.ysMotionLoader as yf
import Simulator.ysPhysConfig as ypc
import Math.mmMath as mm
import Motion.ysHierarchyEdit as yme
import Motion.ysMotion as ym
HIP = 'Hips'
RIGHT_UP_LEG = 'RightUpLeg'
RIGHT_LEG... | true | true |
f7156beba4fa44c0a6d9b574e93c8eddef795b71 | 10,381 | py | Python | python/ccxt/async/bitstamp1.py | destenson/ccxt--ccxt | 3928a058cb1ecf00d11309c7812a0fcdb502080a | [
"MIT"
] | null | null | null | python/ccxt/async/bitstamp1.py | destenson/ccxt--ccxt | 3928a058cb1ecf00d11309c7812a0fcdb502080a | [
"MIT"
] | null | null | null | python/ccxt/async/bitstamp1.py | destenson/ccxt--ccxt | 3928a058cb1ecf00d11309c7812a0fcdb502080a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NotSupported
class bitstamp1 (Exchange):
def describe(self):
return self.deep_extend(super(bitstamp1, self).describe(), {
'id': 'bitstamp1',
... | 44.174468 | 137 | 0.50814 |
from ccxt.async.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import NotSupported
class bitstamp1 (Exchange):
def describe(self):
return self.deep_extend(super(bitstamp1, self).describe(), {
'id': 'bitstamp1',
'name': 'Bitstamp v1'... | false | true |
f7156c17c1c2dac9f185a10f4aef638483c87e61 | 976 | py | Python | core/forms.py | donnellan0007/blog | 02c8850688422e3b685ffac10c32bf3e7a7c2e7a | [
"MIT"
] | null | null | null | core/forms.py | donnellan0007/blog | 02c8850688422e3b685ffac10c32bf3e7a7c2e7a | [
"MIT"
] | null | null | null | core/forms.py | donnellan0007/blog | 02c8850688422e3b685ffac10c32bf3e7a7c2e7a | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class ProfileForm(UserCreationForm):
email = forms.EmailField(widget=forms.TextInput(
attrs = {
'type' : 'email',
'placeholder' : ('Email')
}
))
... | 36.148148 | 79 | 0.609631 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class ProfileForm(UserCreationForm):
email = forms.EmailField(widget=forms.TextInput(
attrs = {
'type' : 'email',
'placeholder' : ('Email')
}
))
... | true | true |
f7156c4bf5fa7bbe5bdf31d0caf7e0a157cf1469 | 4,015 | py | Python | tests/parser/functions/test_concat.py | Solexplorer/vyper | 135edd6a91d47c72de105066d6e6c1bdfe9ea66e | [
"MIT"
] | 1 | 2021-04-23T21:48:20.000Z | 2021-04-23T21:48:20.000Z | tests/parser/functions/test_concat.py | Solexplorer/vyper | 135edd6a91d47c72de105066d6e6c1bdfe9ea66e | [
"MIT"
] | null | null | null | tests/parser/functions/test_concat.py | Solexplorer/vyper | 135edd6a91d47c72de105066d6e6c1bdfe9ea66e | [
"MIT"
] | 1 | 2020-01-27T05:21:46.000Z | 2020-01-27T05:21:46.000Z | from vyper.exceptions import (
TypeMismatchException,
)
def test_concat(get_contract_with_gas_estimation):
test_concat = """
@public
def foo2(input1: bytes[50], input2: bytes[50]) -> bytes[1000]:
return concat(input1, input2)
@public
def foo3(input1: bytes[50], input2: bytes[50], input3: bytes[50]) -> by... | 30.18797 | 131 | 0.62142 | from vyper.exceptions import (
TypeMismatchException,
)
def test_concat(get_contract_with_gas_estimation):
test_concat = """
@public
def foo2(input1: bytes[50], input2: bytes[50]) -> bytes[1000]:
return concat(input1, input2)
@public
def foo3(input1: bytes[50], input2: bytes[50], input3: bytes[50]) -> by... | true | true |
f7156ce7fd453c52f14385b72fc6a38950f75874 | 5,307 | py | Python | nicos_mlz/biodiff/setups/motor.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/biodiff/setups/motor.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_mlz/biodiff/setups/motor.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | # -*- coding: utf-8 -*-
description = 'Axes setup'
group = 'lowlevel'
tango_base = 'tango://phys.biodiff.frm2:10000/biodiff/'
devices = dict(
omega_samplestepper = device('nicos.devices.tango.Motor',
description = 'Sample stepper omega variant',
tangodevice = tango_base + 'fzjs7/omega_samplestepp... | 36.349315 | 85 | 0.606181 |
description = 'Axes setup'
group = 'lowlevel'
tango_base = 'tango://phys.biodiff.frm2:10000/biodiff/'
devices = dict(
omega_samplestepper = device('nicos.devices.tango.Motor',
description = 'Sample stepper omega variant',
tangodevice = tango_base + 'fzjs7/omega_samplestepper',
unit = 'deg... | true | true |
f7156d0af1e9a61d01bcad558cbe5b0d3ec055db | 15,159 | py | Python | src/config/api-server/tests/test_logical_router.py | amitkg29/contrail-controller | be71b50f185a68338ea54d6f8088623ab88c2bf6 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/tests/test_logical_router.py | amitkg29/contrail-controller | be71b50f185a68338ea54d6f8088623ab88c2bf6 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/tests/test_logical_router.py | amitkg29/contrail-controller | be71b50f185a68338ea54d6f8088623ab88c2bf6 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2013,2014 Juniper Networks, Inc. All rights reserved.
#
import gevent
import os
import sys
import socket
import errno
import uuid
import logging
import coverage
import cgitb
cgitb.enable(format='text')
import testtools
from testtools.matchers import Equals, MismatchError, Not, Contains
from testtool... | 42.343575 | 88 | 0.647734 | import gevent
import os
import sys
import socket
import errno
import uuid
import logging
import coverage
import cgitb
cgitb.enable(format='text')
import testtools
from testtools.matchers import Equals, MismatchError, Not, Contains
from testtools import content, content_type, ExpectedException
import unittest
import r... | false | true |
f7156e71c027a040fc6f4c1727ecee29015afce9 | 303 | py | Python | listing_8-5.py | PrinceChou/Play-Python-with-Alisa | 808ab2744a99c548de4633b5707af27112bcdccf | [
"Apache-2.0"
] | null | null | null | listing_8-5.py | PrinceChou/Play-Python-with-Alisa | 808ab2744a99c548de4633b5707af27112bcdccf | [
"Apache-2.0"
] | null | null | null | listing_8-5.py | PrinceChou/Play-Python-with-Alisa | 808ab2744a99c548de4633b5707af27112bcdccf | [
"Apache-2.0"
] | null | null | null | # Listing_8-5.py
# Copyright Warren & Carter Sande, 2013
# Released under MIT license http://www.opensource.org/licenses/mit-license.php
# Version $version ----------------------------
# Printing the 8 times table using range()
for looper in range(1, 11):
print looper, "times 8 =", looper * 8
| 30.3 | 81 | 0.643564 |
for looper in range(1, 11):
print looper, "times 8 =", looper * 8
| false | true |
f7156edb72ba4944c07e754e6e68e17a3a4c0c87 | 648 | py | Python | trade_remedies_api/organisations/migrations/0011_organisation_merged_from.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 1 | 2020-08-13T10:37:15.000Z | 2020-08-13T10:37:15.000Z | trade_remedies_api/organisations/migrations/0011_organisation_merged_from.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | 4 | 2020-09-10T13:41:52.000Z | 2020-12-16T09:00:21.000Z | trade_remedies_api/organisations/migrations/0011_organisation_merged_from.py | uktrade/trade-remedies-api | fbe2d142ef099c7244788a0f72dd1003eaa7edce | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-11-06 15:10
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("organisations", "0010_auto_20191024_1353"),
]
operations = [
migrations.AddField(
model_name="o... | 24.923077 | 60 | 0.574074 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("organisations", "0010_auto_20191024_1353"),
]
operations = [
migrations.AddField(
model_name="organisation",
name="merged_from",
... | true | true |
f7156f2a19e53f51807d2c9be830a384fe50f7d0 | 4,368 | py | Python | tests/unit/test_clearmot.py | traffic-ai/EvalDeT | 3b52698e1b03fb9066e3203c2f36aebfa0030aba | [
"Apache-2.0"
] | 2 | 2021-12-19T21:55:12.000Z | 2021-12-19T21:55:19.000Z | tests/unit/test_clearmot.py | sasp-ai/EvalDeT | 3b52698e1b03fb9066e3203c2f36aebfa0030aba | [
"Apache-2.0"
] | 10 | 2021-08-07T09:51:27.000Z | 2021-08-29T07:26:07.000Z | tests/unit/test_clearmot.py | traffic-ai/EvalDeT | 3b52698e1b03fb9066e3203c2f36aebfa0030aba | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pytest
from evaldet import Tracks
from evaldet.mot_metrics.clearmot import calculate_clearmot_metrics
def test_missing_frame_hyp():
gt = Tracks()
gt.add_frame(0, [0], np.array([[0, 0, 1, 1]]))
gt.add_frame(1, [0], np.array([[0, 0, 1, 1]]))
hyp = Tracks()
hyp.add_frame(0... | 30.545455 | 83 | 0.565476 | import numpy as np
import pytest
from evaldet import Tracks
from evaldet.mot_metrics.clearmot import calculate_clearmot_metrics
def test_missing_frame_hyp():
gt = Tracks()
gt.add_frame(0, [0], np.array([[0, 0, 1, 1]]))
gt.add_frame(1, [0], np.array([[0, 0, 1, 1]]))
hyp = Tracks()
hyp.add_frame(0... | true | true |
f7157086f3990ba862350c2dc2e8610185bd0247 | 1,377 | py | Python | transcript/transcript/urls.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | 1 | 2019-02-25T23:17:18.000Z | 2019-02-25T23:17:18.000Z | transcript/transcript/urls.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | null | null | null | transcript/transcript/urls.py | Harrymissi/transcript-system | c7c3a8e505e4e8e5ca6ab5f934338bb8ff314260 | [
"Apache-2.0"
] | null | null | null | """transcript URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | 43.03125 | 121 | 0.718228 | from django.contrib import admin
from django.urls import path
import xadmin
from django.views.generic import TemplateView
from trans_sys.views import user_login, user_info, user_course, user_GPA, user_transcript, changeProfile, change_password
urlpatterns = [
path('xadmin/', xadmin.site.urls),
path('index/',Te... | true | true |
f7157154f136fad7994d2221db333cf67ad7e9d1 | 6,774 | py | Python | samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py | jonnii/openapi-generator | b828860614df0b5207761c2a34c6a002fb56419b | [
"Apache-2.0"
] | 1 | 2021-01-26T15:23:10.000Z | 2021-01-26T15:23:10.000Z | samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py | jonnii/openapi-generator | b828860614df0b5207761c2a34c6a002fb56419b | [
"Apache-2.0"
] | 5 | 2021-03-10T19:39:24.000Z | 2022-02-27T05:24:35.000Z | samples/client/petstore/python-experimental/petstore_api/models/grandparent_animal.py | jonnii/openapi-generator | b828860614df0b5207761c2a34c6a002fb56419b | [
"Apache-2.0"
] | 2 | 2020-08-06T08:52:02.000Z | 2021-05-06T09:22:11.000Z | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 36.815217 | 174 | 0.602303 |
from __future__ import absolute_import
import re import sys
import six import nulltype
from petstore_api.model_utils import ( ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
i... | true | true |
f715723718b976ccc5b5a3dc7091ae07ddbd3d22 | 3,657 | py | Python | plex/utils/datasource/thetvdb.py | spuriousdata/plex-cli | f2561d1a68917edbc9bbcce39a9548da86d2d7ef | [
"MIT"
] | 1 | 2018-03-26T20:06:57.000Z | 2018-03-26T20:06:57.000Z | plex/utils/datasource/thetvdb.py | spuriousdata/plex-cli | f2561d1a68917edbc9bbcce39a9548da86d2d7ef | [
"MIT"
] | null | null | null | plex/utils/datasource/thetvdb.py | spuriousdata/plex-cli | f2561d1a68917edbc9bbcce39a9548da86d2d7ef | [
"MIT"
] | null | null | null | import json
import requests
class TVDBHttpException(Exception):
pass
class TVDB(object):
base = 'https://api.thetvdb.com'
def __init__(self, apikey=None, username=None, userkey=None):
self.username = username
self.userkey = userkey
self.apikey = apikey
self.authenticate(... | 38.904255 | 106 | 0.508067 | import json
import requests
class TVDBHttpException(Exception):
pass
class TVDB(object):
base = 'https://api.thetvdb.com'
def __init__(self, apikey=None, username=None, userkey=None):
self.username = username
self.userkey = userkey
self.apikey = apikey
self.authenticate(... | true | true |
f71572afcd687fc4a51638572448889091aac7fe | 615 | py | Python | wework/migrations/0001_initial.py | edsion1107/pytest_backend | 59caf69226b821497ee19673630226df24d34391 | [
"BSD-3-Clause"
] | null | null | null | wework/migrations/0001_initial.py | edsion1107/pytest_backend | 59caf69226b821497ee19673630226df24d34391 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T23:52:19.000Z | 2021-06-10T21:19:50.000Z | wework/migrations/0001_initial.py | edsion1107/pytest_backend | 59caf69226b821497ee19673630226df24d34391 | [
"BSD-3-Clause"
] | 1 | 2020-11-28T15:25:03.000Z | 2020-11-28T15:25:03.000Z | # Generated by Django 2.1.7 on 2019-02-26 03:56
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AccessToken',
fields=[
('id', models.AutoFi... | 25.625 | 114 | 0.573984 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='AccessToken',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, seriali... | true | true |
f71573d18019e66119ed0720c4b4edddc4c1a5eb | 987 | py | Python | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nu... | 24.073171 | 109 | 0.733536 |
from __future__ import absolute_import
import unittest
import nucleus_api
from nucleus_api.models.order_reconcile_return_object import OrderReconcileReturnObject from nucleus_api.rest import ApiException
class TestOrderReconcileReturnObject(unittest.TestCase):
def setUp(self):
pass
def tearDow... | true | true |
f71573ed4848e9b29e823af2889eea2f2d9b5fc1 | 822 | py | Python | inventory/home/view.py | Rohitkuru/Smart-Linux-Box | 0cc1b0c4ebc9edb35b2ba64b51f451d36af87304 | [
"MIT"
] | null | null | null | inventory/home/view.py | Rohitkuru/Smart-Linux-Box | 0cc1b0c4ebc9edb35b2ba64b51f451d36af87304 | [
"MIT"
] | 1 | 2021-03-07T07:59:47.000Z | 2021-03-07T07:59:47.000Z | inventory/home/view.py | Rohitkuru/dynamic-linux-inventory | 0cc1b0c4ebc9edb35b2ba64b51f451d36af87304 | [
"MIT"
] | null | null | null | from flask import Blueprint,render_template,request,flash
from inventory.backend.scripts import scan
from inventory.Crud.operation import add_record
from inventory.models import *
home = Blueprint("home_view",__name__)
@home.route("/",methods = ['GET','POST'])
def home_view():
if request.method == "POST":
... | 37.363636 | 87 | 0.70073 | from flask import Blueprint,render_template,request,flash
from inventory.backend.scripts import scan
from inventory.Crud.operation import add_record
from inventory.models import *
home = Blueprint("home_view",__name__)
@home.route("/",methods = ['GET','POST'])
def home_view():
if request.method == "POST":
... | true | true |
f7157414e7e3ec2bdef8398e48beb4165dba07b9 | 16,669 | py | Python | MAML-ADML/meta.py | robustmetalearning/robust-meta-learning | 08fc3e9302c9fbd1fcfc3e001e0b080a3c783c81 | [
"MIT"
] | null | null | null | MAML-ADML/meta.py | robustmetalearning/robust-meta-learning | 08fc3e9302c9fbd1fcfc3e001e0b080a3c783c81 | [
"MIT"
] | null | null | null | MAML-ADML/meta.py | robustmetalearning/robust-meta-learning | 08fc3e9302c9fbd1fcfc3e001e0b080a3c783c81 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
from torch.utils.data import TensorDataset, DataLoader
from torch import optim
import numpy as np
from learner import Learner
from copy import deepcopy
def zero_nontrainable_grads(grads, trainable_lay... | 43.183938 | 141 | 0.599736 | import torch
from torch import nn
from torch import optim
from torch.nn import functional as F
from torch.utils.data import TensorDataset, DataLoader
from torch import optim
import numpy as np
from learner import Learner
from copy import deepcopy
def zero_nontrainable_grads(grads, trainable_lay... | true | true |
f715745078d64aff302f2395177ab959a49111ab | 3,310 | py | Python | steps/nnet3/train.py | ondrejklejch/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 18 | 2019-10-24T04:42:16.000Z | 2021-11-24T03:07:59.000Z | steps/nnet3/train.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | null | null | null | steps/nnet3/train.py | choko/learning_to_adapt | 6de0b98370769596da16a1688582925ea2e1fa29 | [
"Apache-2.0"
] | 4 | 2018-08-31T01:08:50.000Z | 2019-05-10T12:12:57.000Z | import sys
import numpy as np
from keras.callbacks import ModelCheckpoint, CSVLogger, LearningRateScheduler
from keras.models import Model
from keras.layers import Input, Activation, Conv1D, BatchNormalization
from keras.optimizers import Adam
from learning_to_adapt.model import LHUC, Renorm
from learning_to_adapt.ut... | 37.613636 | 161 | 0.710876 | import sys
import numpy as np
from keras.callbacks import ModelCheckpoint, CSVLogger, LearningRateScheduler
from keras.models import Model
from keras.layers import Input, Activation, Conv1D, BatchNormalization
from keras.optimizers import Adam
from learning_to_adapt.model import LHUC, Renorm
from learning_to_adapt.ut... | true | true |
f71574ae5ca34081f8ffb4a0fb83b14cf338b46f | 2,364 | py | Python | tests/test_euromil.py | rse01/pyeuromil | 17f7c800f6f10289d3211bd9d783d1f516594f6c | [
"MIT"
] | null | null | null | tests/test_euromil.py | rse01/pyeuromil | 17f7c800f6f10289d3211bd9d783d1f516594f6c | [
"MIT"
] | null | null | null | tests/test_euromil.py | rse01/pyeuromil | 17f7c800f6f10289d3211bd9d783d1f516594f6c | [
"MIT"
] | null | null | null | """ Unit tests for euromil.py """
from datetime import date
import pytest
from pyeuromil import euro_results, euro_draw_dates, euro_stats
def test_euromil_results_year_not_exist():
""" results of year test (year does not exists) """
with pytest.raises(ValueError):
results = euro_results("abcd")
... | 29.924051 | 88 | 0.661168 | from datetime import date
import pytest
from pyeuromil import euro_results, euro_draw_dates, euro_stats
def test_euromil_results_year_not_exist():
with pytest.raises(ValueError):
results = euro_results("abcd")
assert results is None
results = euro_results(1920)
assert results is No... | true | true |
f71575f5748372d7306937a1f31ad94c872397b7 | 16,014 | py | Python | nemo/collections/nlp/data/data_utils/data_preprocessing.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 4,145 | 2019-09-13T08:29:43.000Z | 2022-03-31T18:31:44.000Z | nemo/collections/nlp/data/data_utils/data_preprocessing.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 2,031 | 2019-09-17T16:51:39.000Z | 2022-03-31T23:52:41.000Z | nemo/collections/nlp/data/data_utils/data_preprocessing.py | madhukarkm/NeMo | 648c97f076147684bee6aaada209f2f20adcaf5d | [
"Apache-2.0"
] | 1,041 | 2019-09-13T10:08:21.000Z | 2022-03-30T06:37:38.000Z | # 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... | 29.710575 | 132 | 0.604783 |
import csv
import json
import os
import pickle
import random
import re
import string
from collections import Counter
import numpy as np
import torch
from tqdm.auto import tqdm
from nemo.utils import logging
from nemo.utils.env_var_parsing import get_envint
__all__ = [
'DataProcessor',
'get_label_stats',
... | true | true |
f7157672a7aaadbb0f7dae37f20ea58ef3e5d0da | 12,933 | py | Python | lib/model/config.py | Kenneth-Wong/tf-faster-rcnn | a6bd798df1b9075ebdfeb7744fffc13226c3a65e | [
"MIT"
] | null | null | null | lib/model/config.py | Kenneth-Wong/tf-faster-rcnn | a6bd798df1b9075ebdfeb7744fffc13226c3a65e | [
"MIT"
] | null | null | null | lib/model/config.py | Kenneth-Wong/tf-faster-rcnn | a6bd798df1b9075ebdfeb7744fffc13226c3a65e | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import numpy as np
# `pip install easydict` if you don't have it
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config im... | 27 | 91 | 0.710044 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
__C = edict()
# Consumers can get config by:
# from fast_rcnn_config import cfg
cfg = __C
#
# Memory options
#
__C.M... | true | true |
f715773b79dedecb2423d1c8a82ee28a03b25ac1 | 2,009 | py | Python | tools.py | VieVie31/face_detection | fea010faedcad038f908bdab559eeb0f18ee5063 | [
"MIT"
] | 4 | 2017-10-19T07:41:25.000Z | 2018-11-03T16:10:16.000Z | tools.py | VieVie31/face_detection | fea010faedcad038f908bdab559eeb0f18ee5063 | [
"MIT"
] | null | null | null | tools.py | VieVie31/face_detection | fea010faedcad038f908bdab559eeb0f18ee5063 | [
"MIT"
] | null | null | null | import os
import re
import cv2
import random
import numpy as np
import matplotlib.pyplot as plt
def read_pgm(filename, byteorder='>'):
"""Return image data from a raw PGM file as numpy array.
Format specification: http://netpbm.sourceforge.net/doc/pgm.html
"""
with open(filename, 'rb') as f:
... | 28.295775 | 77 | 0.558487 | import os
import re
import cv2
import random
import numpy as np
import matplotlib.pyplot as plt
def read_pgm(filename, byteorder='>'):
with open(filename, 'rb') as f:
buffer = f.read()
try:
header, width, height, maxval = re.search(
b"(^P5\s(?:\s*#.*[\r\n])*"
b"(\d+)\s(?... | true | true |
f71578c338458c847d71d9fa063b9ac9dfebe6cd | 5,541 | py | Python | Sporter/test_leeftijdsklassen.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-12-22T13:11:12.000Z | 2021-12-22T13:11:12.000Z | Sporter/test_leeftijdsklassen.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | 9 | 2020-10-28T07:07:05.000Z | 2021-06-28T20:05:37.000Z | Sporter/test_leeftijdsklassen.py | RamonvdW/nhb-apps | 5a9f840bfe066cd964174515c06b806a7b170c69 | [
"BSD-3-Clause-Clear"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019-2021 Ramon van der Winkel.
# All rights reserved.
# Licensed under BSD-3-Clause-Clear. See LICENSE file for details.
from django.test import TestCase
from django.utils import timezone
from NhbStructuur.models import NhbRegio, NhbVereniging
from .leeftijdsklassen import ... | 41.044444 | 151 | 0.562714 |
from django.test import TestCase
from django.utils import timezone
from NhbStructuur.models import NhbRegio, NhbVereniging
from .leeftijdsklassen import bereken_leeftijdsklassen
from .models import Sporter
from TestHelpers.e2ehelpers import E2EHelpers
import datetime
class TestSporterLeeftijdsklassen(E2EHelpers, Te... | true | true |
f71579a7221e41b1b3740a7e825aa1b7bae7267b | 6,193 | py | Python | test/test_addressspace.py | dendisuhubdy/coriander | 7df182981e5c4a8e043fea25d272d025a953f06d | [
"Apache-2.0"
] | 644 | 2017-05-21T05:25:20.000Z | 2022-03-25T04:18:14.000Z | test/test_addressspace.py | hughperkins/cuda-ir-to-opencl | 7c6b65bc08a25a6bce21efe7b86be8fa985597af | [
"Apache-2.0"
] | 82 | 2017-05-21T15:19:24.000Z | 2022-01-30T01:41:44.000Z | test/test_addressspace.py | hughperkins/cuda-ir-to-opencl | 7c6b65bc08a25a6bce21efe7b86be8fa985597af | [
"Apache-2.0"
] | 88 | 2017-05-21T01:31:16.000Z | 2022-01-31T09:28:17.000Z | # Copyright Hugh Perkins 2016
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... | 32.088083 | 103 | 0.676893 | import numpy as np
import pyopencl as cl
import os
import subprocess
from test import test_common
from test.test_common import offset_type
def test_getelementptr_struct_local(context, q, float_data, float_data_gpu):
cu_source = """
struct MyStruct {
float* f0;
float* f1;
};
__global__ void foo(float ... | true | true |
f7157a1710b2e208b523118567fc8e95d752447c | 16,786 | py | Python | RL_TD3/src/pe_model.py | Crazy-Jack/RL4GRN | e683e17758eb468bd42e0ea0020e2246051c258c | [
"MIT"
] | null | null | null | RL_TD3/src/pe_model.py | Crazy-Jack/RL4GRN | e683e17758eb468bd42e0ea0020e2246051c258c | [
"MIT"
] | null | null | null | RL_TD3/src/pe_model.py | Crazy-Jack/RL4GRN | e683e17758eb468bd42e0ea0020e2246051c258c | [
"MIT"
] | 1 | 2020-12-14T09:32:36.000Z | 2020-12-14T09:32:36.000Z | '''
The probabilistic ensemble dynamics model
'''
# pylint: disable=C0103, R0902, R0913, W0201, E0401, E1120
import time
import itertools
import numpy as np
import tensorflow as tf
from tensorflow import keras
from collections import defaultdict
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
class PEModel(ke... | 43.041026 | 143 | 0.614083 | import time
import itertools
import numpy as np
import tensorflow as tf
from tensorflow import keras
from collections import defaultdict
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
class PEModel(keras.Model):
def __init__(self, state_dim, action_dim):
super().__init__()
self.l1 = keras.la... | true | true |
f7157a7507148ed0eab64630453d5382f6fcb0e0 | 264 | py | Python | project/api/migrations/0052_merge_0051_catalog_content_0051_video_resource_group.py | hlystovea/BBBS | 7164ef67615e45d750e965bf958af229b56d49e3 | [
"BSD-3-Clause"
] | null | null | null | project/api/migrations/0052_merge_0051_catalog_content_0051_video_resource_group.py | hlystovea/BBBS | 7164ef67615e45d750e965bf958af229b56d49e3 | [
"BSD-3-Clause"
] | 2 | 2021-06-07T14:06:05.000Z | 2021-06-18T16:27:29.000Z | project/api/migrations/0052_merge_0051_catalog_content_0051_video_resource_group.py | hlystovea/BBBS | 7164ef67615e45d750e965bf958af229b56d49e3 | [
"BSD-3-Clause"
] | 2 | 2021-07-27T20:40:18.000Z | 2021-09-12T16:48:19.000Z | # Generated by Django 3.2.3 on 2021-07-13 14:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0051_catalog_content'),
('api', '0051_video_resource_group'),
]
operations = [
]
| 17.6 | 47 | 0.636364 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('api', '0051_catalog_content'),
('api', '0051_video_resource_group'),
]
operations = [
]
| true | true |
f7157aa07d402c4517f82d9775f1feb82ec86069 | 1,855 | py | Python | repos/system_upgrade/el7toel8/actors/checkbootavailspace/tests/unit_test.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/checkbootavailspace/tests/unit_test.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/checkbootavailspace/tests/unit_test.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | from __future__ import division
from leapp.libraries.actor.library import (MIN_AVAIL_BYTES_FOR_BOOT,
check_avail_space_on_boot,
inhibit_upgrade)
from leapp import reporting
from leapp.libraries.common.testutils import create_report_m... | 35.673077 | 108 | 0.750404 | from __future__ import division
from leapp.libraries.actor.library import (MIN_AVAIL_BYTES_FOR_BOOT,
check_avail_space_on_boot,
inhibit_upgrade)
from leapp import reporting
from leapp.libraries.common.testutils import create_report_m... | true | true |
f7157bf8af638e897f07970e2094a05bd644cb21 | 162 | py | Python | boa3_test/test_sc/native_test/contractmanagement/DestroyContractTooManyArguments.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/native_test/contractmanagement/DestroyContractTooManyArguments.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/native_test/contractmanagement/DestroyContractTooManyArguments.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from typing import Any
from boa3.builtin.nativecontract.contractmanagement import ContractManagement
def Main(arg0: Any):
ContractManagement.destroy(arg0)
| 20.25 | 77 | 0.820988 | from typing import Any
from boa3.builtin.nativecontract.contractmanagement import ContractManagement
def Main(arg0: Any):
ContractManagement.destroy(arg0)
| true | true |
f7157c2e2f6a53fa18f4f1a00dcbb3a3da29ecfd | 15,984 | py | Python | conta/main/views.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | null | null | null | conta/main/views.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | 23 | 2021-12-29T21:41:37.000Z | 2022-03-31T10:01:54.000Z | conta/main/views.py | osso73/contabilidad | babdedfdb47b2b4fd01a09e2db9db5d21bbc88f0 | [
"MIT"
] | 1 | 2022-02-18T19:58:52.000Z | 2022-02-18T19:58:52.000Z | import datetime
from django.shortcuts import render
from django.views import View
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.db.models.deletion import ProtectedError
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequi... | 34.081023 | 126 | 0.611424 | import datetime
from django.shortcuts import render
from django.views import View
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.db.models.deletion import ProtectedError
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequi... | true | true |
f7157cc2826df7834aa60b3fb11396d26a4e5f5b | 2,465 | py | Python | day_15/second.py | Mizux/adventofcode | 8bca6b5db1b9f2e64b4038d32680d07766d14e2d | [
"Apache-2.0"
] | 1 | 2021-12-11T19:41:25.000Z | 2021-12-11T19:41:25.000Z | day_15/second.py | Mizux/adventofcode | 8bca6b5db1b9f2e64b4038d32680d07766d14e2d | [
"Apache-2.0"
] | null | null | null | day_15/second.py | Mizux/adventofcode | 8bca6b5db1b9f2e64b4038d32680d07766d14e2d | [
"Apache-2.0"
] | 1 | 2021-12-06T12:09:44.000Z | 2021-12-06T12:09:44.000Z | #!/usr/bin/env python3
from collections import deque
FILE='test.txt' # sol: 40
FILE='input.txt' # sol: 824
def print_board(board):
for row in board:
print(''.join([str(i) for i in row]))
def parse_input(file, repeat):
board = []
for i in range(repeat):
with open(file, 'r') as f:
... | 31.602564 | 135 | 0.55213 | from collections import deque
FILE='test.txt' FILE='input.txt'
def print_board(board):
for row in board:
print(''.join([str(i) for i in row]))
def parse_input(file, repeat):
board = []
for i in range(repeat):
with open(file, 'r') as f:
for line in f:
board.append([i... | true | true |
f7157d354d86263b22ff896993d75bae3d71e43b | 21,644 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/_subnets_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.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.747748 | 220 | 0.660968 | from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpR... | true | true |
f7157de80611bef9e79b6363562de1eb0d53d409 | 14,816 | py | Python | assignment-01/assignment-01.py | ehumss/itu-blu537e-data-analysis-and-visualisation | a401b0d8580d2021a9f634607339d074327276cd | [
"MIT"
] | 1 | 2020-01-28T12:48:53.000Z | 2020-01-28T12:48:53.000Z | assignment-01/assignment-01.py | ehumss/itu-blu537e-data-analysis-and-visualisation | a401b0d8580d2021a9f634607339d074327276cd | [
"MIT"
] | null | null | null | assignment-01/assignment-01.py | ehumss/itu-blu537e-data-analysis-and-visualisation | a401b0d8580d2021a9f634607339d074327276cd | [
"MIT"
] | null | null | null | ####################################################################################################
#
# ISTANBUL TECHNICAL UNIVERSITY
# BLU 537E - Data Analysis & Visualization
# Assignment 01
#
####################################################################################################
#
# ... | 43.83432 | 189 | 0.532667 |
NUMBER_OF_ITEMS_TYPE_1 = 10;
NUMBER_OF_ITEMS_TYPE_2 = 100;
CHARGE_TYPE_1 = 12;
CHARGE_TYPE_2 = 10;
CHARGE_TYPE_3 = 7;
def problem1(number_of_items):
cost = 0;
if (number_of_items < NUMBER_OF_ITEMS_TYPE_1):
cost = number_of_items * CHARGE_TYPE_1;
elif (number_of_items >= NUMBER_OF_... | true | true |
f7157fcc233e7ad5174d2ffad33f0e7b24b80a15 | 1,120 | py | Python | sagemaker_studio/containers/dashboard/src/app.py | NihalHarish/sagemaker-explaining-credit-decisions | e5965902d8901819a60f8c56517a82ddd17c1f95 | [
"Apache-2.0"
] | 80 | 2020-04-15T09:35:11.000Z | 2022-03-23T01:56:12.000Z | sagemaker_studio/containers/dashboard/src/app.py | IronOnet/sagemaker-explaining-credit-decisions | dbb8ea1a685412033c774c2a79cc1e5794438cf9 | [
"Apache-2.0"
] | 8 | 2020-04-16T16:53:09.000Z | 2022-02-06T17:07:02.000Z | sagemaker_studio/containers/dashboard/src/app.py | IronOnet/sagemaker-explaining-credit-decisions | dbb8ea1a685412033c774c2a79cc1e5794438cf9 | [
"Apache-2.0"
] | 28 | 2020-05-25T09:26:41.000Z | 2022-01-25T22:23:54.000Z | from pathlib import Path
import streamlit as st
from package import utils
from pages import local_page, global_page
from shared import list_explanation_groups
def explanation_group_selectbox():
paths = list_explanation_groups()
path = st.sidebar.selectbox(
label='Select explanation group:',
... | 28.717949 | 75 | 0.707143 | from pathlib import Path
import streamlit as st
from package import utils
from pages import local_page, global_page
from shared import list_explanation_groups
def explanation_group_selectbox():
paths = list_explanation_groups()
path = st.sidebar.selectbox(
label='Select explanation group:',
... | true | true |
f715800c50b2c0c85b8363141732d1ea4e6cedf4 | 11,896 | py | Python | opflexagent/rpc.py | shyam81295/python-opflex-agent | 3b564c93d62734354eea059afec7dce713225872 | [
"Apache-2.0"
] | null | null | null | opflexagent/rpc.py | shyam81295/python-opflex-agent | 3b564c93d62734354eea059afec7dce713225872 | [
"Apache-2.0"
] | null | null | null | opflexagent/rpc.py | shyam81295/python-opflex-agent | 3b564c93d62734354eea059afec7dce713225872 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 40.879725 | 79 | 0.634247 |
from neutron.common import rpc as n_rpc
from neutron.common import topics
from oslo_log import helpers as log
from oslo_log import log as logging
import oslo_messaging
LOG = logging.getLogger(__name__)
TOPIC_OPFLEX = 'opflex'
ENDPOINT = 'endpoint'
VRF = 'vrf'
NOTIFY_VRF = 'notify-vrf'
class AgentNotifierApi(object... | true | true |
f715802eeda042cbb9bf7a01b8eb94abfede69c2 | 2,706 | py | Python | modules/cmderr.py | patataofcourse/styleventer-archive | dc4b82f2903f91990fa9236cb67a9dd92e3e1a2f | [
"MIT"
] | 1 | 2021-01-28T16:22:32.000Z | 2021-01-28T16:22:32.000Z | modules/cmderr.py | alexdevteam/styleventer-archive | 303f280049d480b21c6e804e236c90fe3475a074 | [
"MIT"
] | 1 | 2021-01-16T22:14:36.000Z | 2021-01-16T22:14:36.000Z | modules/cmderr.py | patataofcourse/styleventer-archive | dc4b82f2903f91990fa9236cb67a9dd92e3e1a2f | [
"MIT"
] | 1 | 2021-01-16T22:01:59.000Z | 2021-01-16T22:01:59.000Z | from discord.ext import commands
import discord, sys, os
import traceback
import datetime
from libs import settings
async def oncmderror(ctx: discord.ext.commands.Context, error):
if type(error) == commands.CommandOnCooldown:
if int(error.retry_after) == 0:
await ctx.send("Wait a few seconds be... | 52.038462 | 126 | 0.65558 | from discord.ext import commands
import discord, sys, os
import traceback
import datetime
from libs import settings
async def oncmderror(ctx: discord.ext.commands.Context, error):
if type(error) == commands.CommandOnCooldown:
if int(error.retry_after) == 0:
await ctx.send("Wait a few seconds be... | true | true |
f71581382f809688e495e7651dfc11918e82e216 | 884 | py | Python | awwardsApp/urls.py | umunadine/Awwards | 1a862ef64c195e6ab9b38c8e1faf35f224354dbb | [
"MIT"
] | null | null | null | awwardsApp/urls.py | umunadine/Awwards | 1a862ef64c195e6ab9b38c8e1faf35f224354dbb | [
"MIT"
] | null | null | null | awwardsApp/urls.py | umunadine/Awwards | 1a862ef64c195e6ab9b38c8e1faf35f224354dbb | [
"MIT"
] | null | null | null | from django.conf.urls import url,include
from django.conf import settings
from . import views
from django.conf.urls.static import static
urlpatterns = [
url(r'^$',views.index,name='index'),
url(r'^accounts/profile/', views.my_profile, name='my_profile'),
url(r'register/',views.register, name='register'),
... | 38.434783 | 81 | 0.707014 | from django.conf.urls import url,include
from django.conf import settings
from . import views
from django.conf.urls.static import static
urlpatterns = [
url(r'^$',views.index,name='index'),
url(r'^accounts/profile/', views.my_profile, name='my_profile'),
url(r'register/',views.register, name='register'),
... | true | true |
f71581754c1df790c4b96c28981d61f8e5506370 | 89 | py | Python | samples/helloworld.py | neumond/minpiler | 2e37a9e0854383d3974af38e1cb2da0ecb8e2108 | [
"MIT"
] | 23 | 2020-12-20T03:39:30.000Z | 2022-03-23T15:47:10.000Z | samples/helloworld.py | neumond/minpiler | 2e37a9e0854383d3974af38e1cb2da0ecb8e2108 | [
"MIT"
] | 15 | 2020-12-21T01:12:22.000Z | 2021-04-19T10:40:11.000Z | samples/helloworld.py | neumond/minpiler | 2e37a9e0854383d3974af38e1cb2da0ecb8e2108 | [
"MIT"
] | 2 | 2022-02-12T19:19:50.000Z | 2022-02-12T21:33:35.000Z | from minpiler.typeshed import M, message1
M.print('Hello world!')
message1.printFlush()
| 17.8 | 41 | 0.775281 | from minpiler.typeshed import M, message1
M.print('Hello world!')
message1.printFlush()
| true | true |
f715818477d40bfbaf00925d174a3b2a99345b43 | 853 | py | Python | reviewboard/reviews/evolutions/file_attachments.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 921 | 2015-01-01T15:26:28.000Z | 2022-03-29T11:30:38.000Z | reviewboard/reviews/evolutions/file_attachments.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 5 | 2015-03-17T18:57:47.000Z | 2020-10-02T13:24:31.000Z | reviewboard/reviews/evolutions/file_attachments.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 285 | 2015-01-12T06:24:36.000Z | 2022-03-29T11:03:50.000Z | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ReviewRequest', 'file_attachments', models.ManyToManyField,
related_model='attachments.FileAttachment'),
AddField('ReviewRequest', 'inactive_file_attachmen... | 40.619048 | 78 | 0.731536 | from __future__ import unicode_literals
from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('ReviewRequest', 'file_attachments', models.ManyToManyField,
related_model='attachments.FileAttachment'),
AddField('ReviewRequest', 'inactive_file_attachmen... | true | true |
f71581f934458fc27232e1abba28dfc2d9fb50c7 | 2,639 | py | Python | trustpayments/models/transaction_comment_create.py | TrustPayments/python-sdk | 6fde6eb8cfce270c3612a2903a845c13018c3bb9 | [
"Apache-2.0"
] | 2 | 2020-01-16T13:24:06.000Z | 2020-11-21T17:40:17.000Z | postfinancecheckout/models/transaction_comment_create.py | pfpayments/python-sdk | b8ef159ea3c843a8d0361d1e0b122a9958adbcb4 | [
"Apache-2.0"
] | 4 | 2019-10-14T17:33:23.000Z | 2021-10-01T14:49:11.000Z | postfinancecheckout/models/transaction_comment_create.py | pfpayments/python-sdk | b8ef159ea3c843a8d0361d1e0b122a9958adbcb4 | [
"Apache-2.0"
] | 2 | 2019-10-15T14:17:10.000Z | 2021-09-17T13:07:09.000Z | # coding: utf-8
import pprint
import six
from enum import Enum
from . import AbstractTransactionCommentActive
class TransactionCommentCreate(AbstractTransactionCommentActive):
swagger_types = {
'transaction': 'int',
}
attribute_map = {
'transaction': 'transaction',
}
_... | 26.39 | 83 | 0.56726 | import pprint
import six
from enum import Enum
from . import AbstractTransactionCommentActive
class TransactionCommentCreate(AbstractTransactionCommentActive):
swagger_types = {
'transaction': 'int',
}
attribute_map = {
'transaction': 'transaction',
}
_transaction = No... | true | true |
f715842fcaf7266d175e63d68638aed9f2e32e69 | 7,994 | py | Python | tagger_ui/ui_model/annotated_images_manager.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | tagger_ui/ui_model/annotated_images_manager.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | tagger_ui/ui_model/annotated_images_manager.py | RobertMcCarter/animal-finder | 5ac839a65df62ab312e440ce43416727492e84d8 | [
"MIT"
] | null | null | null | """
The business model core of the application.
"""
from typing import List, Union
from PIL import Image
from .annotated_image import AnnotatedImage
from .scaled_region2d import ScaledRegion2d
from .timer import Timer
from src.model import Size2d, Region2d
def clearImagesOutsideRange(
annotatedImages: List[Ann... | 37.35514 | 102 | 0.621091 | from typing import List, Union
from PIL import Image
from .annotated_image import AnnotatedImage
from .scaled_region2d import ScaledRegion2d
from .timer import Timer
from src.model import Size2d, Region2d
def clearImagesOutsideRange(
annotatedImages: List[AnnotatedImage],
currentIndex: int,
keepPreviou... | true | true |
f715861adc117fbbd75adf3f5e6a1228542c06dc | 97,810 | py | Python | src/sos/step_executor.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | null | null | null | src/sos/step_executor.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | null | null | null | src/sos/step_executor.py | pgcudahy/sos | ee902841003c7630db501101038f370650955ef9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import ast
import copy
import os
import subprocess
import sys
import time
from collections import defaultdict
from collections.abc import Mapping, Sequence
f... | 42.433839 | 193 | 0.486893 |
import ast
import copy
import os
import subprocess
import sys
import time
from collections import defaultdict
from collections.abc import Mapping, Sequence
from typing import List
import zmq
from .controller import close_socket, create_socket, send_message_to_controller
from .messages import encode_msg, decode_msg
f... | true | true |
f715866e13eb002c14554c06f9cadbe3ff57a70a | 322 | py | Python | generator/framework/util/fs.py | sinsay/ds_generator | 9365e22e8730418caf29b8ed6ada1f30f936a297 | [
"Apache-2.0"
] | null | null | null | generator/framework/util/fs.py | sinsay/ds_generator | 9365e22e8730418caf29b8ed6ada1f30f936a297 | [
"Apache-2.0"
] | null | null | null | generator/framework/util/fs.py | sinsay/ds_generator | 9365e22e8730418caf29b8ed6ada1f30f936a297 | [
"Apache-2.0"
] | null | null | null | import os
def mkdir_without_exception(target):
try:
# subprocess.call([
# "mkdir",
# "-p",
# target
# ])
os.makedirs(target, exist_ok=True)
except FileExistsError:
print("the directory %s already exists. continue the next gen phase." % target... | 23 | 87 | 0.552795 | import os
def mkdir_without_exception(target):
try:
os.makedirs(target, exist_ok=True)
except FileExistsError:
print("the directory %s already exists. continue the next gen phase." % target)
| true | true |
f71586bd484ad9828fd3d9ba20d058a77b29f8ff | 91 | py | Python | app/handlers/__init__.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | null | null | null | app/handlers/__init__.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | 5 | 2020-12-22T17:53:05.000Z | 2021-04-07T20:00:47.000Z | app/handlers/__init__.py | Katel212/MyPersonalKitchenBot | 03de0beeaf2665e8b3ddd1709da3d4edcd422b80 | [
"MIT"
] | null | null | null | from .errors import *
from .private import *
from .callback import *
from .states import *
| 18.2 | 23 | 0.736264 | from .errors import *
from .private import *
from .callback import *
from .states import *
| true | true |
f71586c2e3611f2c07d319406a22e6a386a06e89 | 695 | py | Python | app/core/management/commands/wait_for_db.py | martinramirezboggio/recipe-app-api | 8f576ae036ba9a55e75a76465e97e0340378572e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | martinramirezboggio/recipe-app-api | 8f576ae036ba9a55e75a76465e97e0340378572e | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | martinramirezboggio/recipe-app-api | 8f576ae036ba9a55e75a76465e97e0340378572e | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""django command to pause execution until db is ready"""
def handle(self, *args, **options):
"""handle the command"""
se... | 30.217391 | 78 | 0.638849 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write('Waiting for database...')
db_conn = None
while not db_conn:
... | true | true |
f71587d10ef1d1aed4af3fd809bfa4096755e581 | 7,494 | py | Python | e2e/tests/selenium/page_objects.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 10 | 2016-05-03T20:41:25.000Z | 2021-09-17T18:42:01.000Z | e2e/tests/selenium/page_objects.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 655 | 2016-05-04T19:00:35.000Z | 2022-03-28T13:09:20.000Z | e2e/tests/selenium/page_objects.py | p2pu/learning-circles | ccd94208ec18082f8fda6d7f21eacdd71bad6023 | [
"MIT"
] | 8 | 2016-05-06T10:24:27.000Z | 2020-10-21T00:56:59.000Z | from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from e2e.tests.selenium.locators import LearningCircleCreationPageLocators
from e2e.tests.selenium.locators import RegistrationModalLocators
import datetime
import tim... | 49.96 | 154 | 0.777022 | from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from e2e.tests.selenium.locators import LearningCircleCreationPageLocators
from e2e.tests.selenium.locators import RegistrationModalLocators
import datetime
import tim... | true | true |
f71589db678f6272d81bf39a0e17b2bd21472491 | 8,808 | py | Python | postman/forms.py | StriveForBest/django-postman | 25f5fcf5a6d54dbb22b393432701652c21e49552 | [
"BSD-3-Clause"
] | null | null | null | postman/forms.py | StriveForBest/django-postman | 25f5fcf5a6d54dbb22b393432701652c21e49552 | [
"BSD-3-Clause"
] | null | null | null | postman/forms.py | StriveForBest/django-postman | 25f5fcf5a6d54dbb22b393432701652c21e49552 | [
"BSD-3-Clause"
] | 2 | 2015-04-30T13:46:16.000Z | 2019-09-16T06:55:14.000Z | """
You may define your own custom forms, based or inspired by the following ones.
Examples of customization:
recipients = CommaSeparatedUserField(label=("Recipients", "Recipient"),
min=2,
max=5,
user_filter=my_user_filter,
channel='my_channel',
)
can_overwrite_limits = Fals... | 40.036364 | 129 | 0.63431 | from __future__ import unicode_literals
from django import forms
from django.conf import settings
try:
from django.contrib.auth import get_user_model except ImportError:
from postman.future_1_5 import get_user_model
from django.db import transaction
from django.utils.translation import ugettext, ugettext_lazy... | true | true |
f7158ab6ed278e6df18c8b2e6bfd09087bd18ae7 | 426 | py | Python | Util/EnvUtil.py | xrkk/proxy_pool | 7e4f732041f51fa6aa9a2e906ad9e7cab880f2b6 | [
"MIT"
] | null | null | null | Util/EnvUtil.py | xrkk/proxy_pool | 7e4f732041f51fa6aa9a2e906ad9e7cab880f2b6 | [
"MIT"
] | null | null | null | Util/EnvUtil.py | xrkk/proxy_pool | 7e4f732041f51fa6aa9a2e906ad9e7cab880f2b6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: EnvUtil
Description : 环境相关
Author : J_hao
date: 2017/9/18
-------------------------------------------------
Change Activity:
2017/9/18: 区分Python版本
------------------... | 25.058824 | 50 | 0.319249 | __author__ = 'J_hao'
import sys
PY3 = sys.version_info >= (3,) | true | true |
f7158afa9cbb6416fad2e41340029a8fbbd333f2 | 12,471 | py | Python | tfx/orchestration/kubeflow/kubeflow_dag_runner_test.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/kubeflow_dag_runner_test.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/kubeflow_dag_runner_test.py | rtg0795/tfx | 63c31b719896eef645df3850d0e6b946e44cd059 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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 or agreed to in writing, ... | 37.790909 | 106 | 0.667228 |
import json
import os
import tarfile
from typing import List
from kfp import onprem
import tensorflow as tf
from tfx.components.statistics_gen import component as statistics_gen_component
from tfx.dsl.component.experimental import executor_specs
from tfx.dsl.component.experimental.annotations import Parameter
from tf... | true | true |
f7158c0d4644817021a89da48a6f1e663928ae91 | 2,766 | py | Python | catalyst/dl/utils/trace.py | 162/catalyst | b4ba36be52c51160e0fabecdcb084a8d5cd96cb7 | [
"MIT"
] | null | null | null | catalyst/dl/utils/trace.py | 162/catalyst | b4ba36be52c51160e0fabecdcb084a8d5cd96cb7 | [
"MIT"
] | null | null | null | catalyst/dl/utils/trace.py | 162/catalyst | b4ba36be52c51160e0fabecdcb084a8d5cd96cb7 | [
"MIT"
] | null | null | null | from typing import Type
import torch
from torch import nn
from torch.jit import ScriptModule
from catalyst.dl.core import Experiment, Runner
class _ForwardOverrideModel(nn.Module):
"""
Model that calls specified method instead of forward
(Workaround, single method tracing is not supported)
"""
... | 25.850467 | 73 | 0.656905 | from typing import Type
import torch
from torch import nn
from torch.jit import ScriptModule
from catalyst.dl.core import Experiment, Runner
class _ForwardOverrideModel(nn.Module):
def __init__(self, model, method_name):
super().__init__()
self.model = model
self.method = method_name
... | true | true |
f7158d1fdb4e339a2eeef76b607b2b96c5f92797 | 11,206 | py | Python | tensorflow/python/distribute/multi_process_runner_test.py | Diva-Pant/tensorflow | f926d8c10efb07176ae559d0e098cdfdb4d03219 | [
"Apache-2.0"
] | 78 | 2020-08-04T12:36:25.000Z | 2022-03-25T04:23:40.000Z | tensorflow/python/distribute/multi_process_runner_test.py | Diva-Pant/tensorflow | f926d8c10efb07176ae559d0e098cdfdb4d03219 | [
"Apache-2.0"
] | 1 | 2020-08-12T09:47:19.000Z | 2020-08-12T09:47:19.000Z | tensorflow/python/distribute/multi_process_runner_test.py | Diva-Pant/tensorflow | f926d8c10efb07176ae559d0e098cdfdb4d03219 | [
"Apache-2.0"
] | 25 | 2020-08-31T12:21:19.000Z | 2022-03-20T05:16:32.000Z | # Copyright 2019 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... | 34.374233 | 80 | 0.663127 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import threading
import time
from absl import logging
from tensorflow.python.distribute import multi_process_runner
from tensorflow.python.distribute import multi_worker_test_base
from t... | true | true |
f7158d5e6cf2a8dfdb996beebce53453c96ec708 | 281 | py | Python | lambda/index.py | sano307/lambda-container-demo | 6c27c56819c9a3defb63bf26b4fd53bf6cdb71d3 | [
"MIT"
] | null | null | null | lambda/index.py | sano307/lambda-container-demo | 6c27c56819c9a3defb63bf26b4fd53bf6cdb71d3 | [
"MIT"
] | null | null | null | lambda/index.py | sano307/lambda-container-demo | 6c27c56819c9a3defb63bf26b4fd53bf6cdb71d3 | [
"MIT"
] | 1 | 2021-07-18T03:52:40.000Z | 2021-07-18T03:52:40.000Z | import json
import pandas as pd
def handler(event, context):
df = pd.DataFrame({"id": [1, 2], "value": ["foo", "boo"]})
print(df)
return {
"statusCode": 200,
"body": json.dumps({
"message": "This is a container lambda."
})
}
| 17.5625 | 62 | 0.512456 | import json
import pandas as pd
def handler(event, context):
df = pd.DataFrame({"id": [1, 2], "value": ["foo", "boo"]})
print(df)
return {
"statusCode": 200,
"body": json.dumps({
"message": "This is a container lambda."
})
}
| true | true |
f7158d9cf34dc0b5ca5dc19e15a61f7fd3e08c77 | 12,588 | py | Python | test.py | trs123s/ModernFarming | 28f99c090ed041486c3c3bbae1054cc9279261bd | [
"MIT"
] | null | null | null | test.py | trs123s/ModernFarming | 28f99c090ed041486c3c3bbae1054cc9279261bd | [
"MIT"
] | null | null | null | test.py | trs123s/ModernFarming | 28f99c090ed041486c3c3bbae1054cc9279261bd | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter.ttk import *
import sqlite3
from tkinter import *
'''
import speech_recognition as sr # for speech recognition to play songs
import pyttsx3 as tts # python module for speech
engine = tts.init()
volume = engine.getProperty('volume')
engine.setProperty('volume',0.75)
voices = engine.g... | 33.03937 | 398 | 0.640133 | import tkinter as tk
from tkinter.ttk import *
import sqlite3
from tkinter import *
root = tk.Tk()
root.title("DataBase Manager by Mohit Gupta")
root.geometry("800x640")
songs = Entry(root, width=50)
songs.grid(row=8,column=1,pady=5)
age0_2 = Entry(root, width=50)
age0_2.grid(row=9, column=1,pady=5)
age4_6 = Ent... | true | true |
f7158e044b9155a5343668120d5af436908eaa72 | 8,428 | py | Python | synchronization/SyncNetInstance.py | PlatterDataset/feature | 2ebdc1b28498b709a0c91e60c19bfc731006bc50 | [
"MIT"
] | null | null | null | synchronization/SyncNetInstance.py | PlatterDataset/feature | 2ebdc1b28498b709a0c91e60c19bfc731006bc50 | [
"MIT"
] | null | null | null | synchronization/SyncNetInstance.py | PlatterDataset/feature | 2ebdc1b28498b709a0c91e60c19bfc731006bc50 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#-*- coding: utf-8 -*-
# Video 25 FPS, Audio 16000HZ
import torch
import numpy
import time, pdb, argparse, subprocess, os, math, glob
import cv2
import python_speech_features
from scipy import signal
from scipy.io import wavfile
from SyncNetModel import *
from shutil import rmtree
# ==============... | 32.666667 | 154 | 0.51495 |
import torch
import numpy
import time, pdb, argparse, subprocess, os, math, glob
import cv2
import python_speech_features
from scipy import signal
from scipy.io import wavfile
from SyncNetModel import *
from shutil import rmtree
def get_median(data1):
data = sorted(data1)
size = len(data)
if size % 2 == 0:... | true | true |
f7158e76c232bf5249188b7a0fe3dc8f0b03f00c | 405 | py | Python | turtlebot3_automatic_parking_vision/setup.py | herb-kuta-lge/turtlebot3_applications | b41f06fda13bcab43800e311c8df63aa0f075445 | [
"Apache-2.0"
] | 70 | 2017-06-14T16:48:51.000Z | 2022-03-15T02:44:14.000Z | turtlebot3_automatic_parking_vision/setup.py | herb-kuta-lge/turtlebot3_applications | b41f06fda13bcab43800e311c8df63aa0f075445 | [
"Apache-2.0"
] | 20 | 2018-06-04T12:06:30.000Z | 2021-09-10T14:01:25.000Z | turtlebot3_automatic_parking_vision/setup.py | herb-kuta-lge/turtlebot3_applications | b41f06fda13bcab43800e311c8df63aa0f075445 | [
"Apache-2.0"
] | 47 | 2017-10-31T23:51:19.000Z | 2022-03-23T12:38:48.000Z | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['turtl... | 28.928571 | 70 | 0.780247 |
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
setup_args = generate_distutils_setup(
packages=['turtlebot3_automatic_parking_vision'],
package_dir={'': 'src'}
)
setup(**setup_args)
| true | true |
f7158e77cbc37e40ac0788e476409ce0f922c325 | 5,748 | py | Python | src/deepspeech_training/util/config.py | googleinterns/deepspeech-reconstruction | 72f28d1e9064d221b3421c302a8725a8c71859ee | [
"Apache-2.0"
] | 3 | 2021-08-20T16:40:09.000Z | 2022-02-08T23:17:52.000Z | src/deepspeech_training/util/config.py | googleinterns/deepspeech-reconstruction | 72f28d1e9064d221b3421c302a8725a8c71859ee | [
"Apache-2.0"
] | 1 | 2022-03-22T04:16:15.000Z | 2022-03-22T04:26:03.000Z | src/deepspeech_training/util/config.py | googleinterns/deepspeech-reconstruction | 72f28d1e9064d221b3421c302a8725a8c71859ee | [
"Apache-2.0"
] | 1 | 2021-04-28T21:51:12.000Z | 2021-04-28T21:51:12.000Z | from __future__ import absolute_import, division, print_function
import os
import sys
import tensorflow.compat.v1 as tfv1
from attrdict import AttrDict
from xdg import BaseDirectory as xdg
from src.flags import FLAGS
from .gpu import get_available_gpus
from .logging import log_error
from .text import Alphabet, UTF8A... | 38.066225 | 108 | 0.677279 | from __future__ import absolute_import, division, print_function
import os
import sys
import tensorflow.compat.v1 as tfv1
from attrdict import AttrDict
from xdg import BaseDirectory as xdg
from src.flags import FLAGS
from .gpu import get_available_gpus
from .logging import log_error
from .text import Alphabet, UTF8A... | true | true |
f715901de4244e706505bcbc2ad3c07df8e07766 | 5,685 | py | Python | lib/itertools.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | lib/itertools.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | lib/itertools.py | ralic/grumpy3 | a471f7ba64167d5812c0f6701380f9f71fa937c3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 23.491736 | 74 | 0.65277 |
import _collections
import sys
class chain(object):
def from_iterable(cls, iterables):
for it in iterables:
for element in it:
yield element
from_iterable = classmethod(from_iterable)
def __init__(self, *iterables):
if not iterables:
self.iterables = iter([[]])
else:
se... | true | true |
f7159091f18210b97ef9f6170f617a8643d4d010 | 1,414 | py | Python | hbi/server/tornado_server.py | Glutexo/host-inventory | 558b77eff633e5ec7cdb45393e767e4a05bca470 | [
"Apache-2.0"
] | 1 | 2018-09-17T13:57:55.000Z | 2018-09-17T13:57:55.000Z | hbi/server/tornado_server.py | Glutexo/host-inventory | 558b77eff633e5ec7cdb45393e767e4a05bca470 | [
"Apache-2.0"
] | 3 | 2018-10-02T10:05:12.000Z | 2018-10-10T09:33:47.000Z | hbi/server/tornado_server.py | Glutexo/host-inventory | 558b77eff633e5ec7cdb45393e767e4a05bca470 | [
"Apache-2.0"
] | 3 | 2018-08-15T16:50:51.000Z | 2018-09-26T08:52:44.000Z | import json, os
from threading import Thread
from tornado.ioloop import IOLoop
import tornado.web
from hbi.model import Host, Filter
from hbi.server import Service
class RootHandler(tornado.web.RequestHandler):
def get(self):
self.write("boop")
class EntitiesPoster(tornado.web.RequestHandler):
d... | 25.709091 | 87 | 0.66761 | import json, os
from threading import Thread
from tornado.ioloop import IOLoop
import tornado.web
from hbi.model import Host, Filter
from hbi.server import Service
class RootHandler(tornado.web.RequestHandler):
def get(self):
self.write("boop")
class EntitiesPoster(tornado.web.RequestHandler):
d... | true | true |
f71590e5707ba2a3e6cb07b4a5957c674ad9a1d3 | 4,112 | py | Python | members/management/commands/sent-invite.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-03-12T21:38:32.000Z | 2021-11-06T15:26:56.000Z | members/management/commands/sent-invite.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 33 | 2019-01-21T15:54:50.000Z | 2021-05-18T17:54:52.000Z | members/management/commands/sent-invite.py | leonrenkema/makerspaceleiden-crm | 36ea20f5b9e263e8f30b1831ae4a2b1d5b926d3c | [
"Apache-2.0"
] | 5 | 2019-01-21T15:47:26.000Z | 2021-09-22T07:14:34.000Z | from django.core.management.base import BaseCommand, CommandError
from simple_history.models import HistoricalRecords
from members.models import User
from members.models import User
from django.contrib.auth.forms import PasswordResetForm
from django.conf import settings
from django.core.mail import EmailMessage
impor... | 33.16129 | 156 | 0.56785 | from django.core.management.base import BaseCommand, CommandError
from simple_history.models import HistoricalRecords
from members.models import User
from members.models import User
from django.contrib.auth.forms import PasswordResetForm
from django.conf import settings
from django.core.mail import EmailMessage
impor... | true | true |
f7159115d342958270b72c812e03dd46e1a80fe8 | 23,723 | py | Python | src/experiment_collection_core/service_pb2.py | AsciiShell/experiment_collection | 86397cae1427c49f30e8af2d6dfb7a15c3f3494d | [
"MIT"
] | 2 | 2020-09-30T21:42:35.000Z | 2020-11-21T17:58:40.000Z | src/experiment_collection_core/service_pb2.py | AsciiShell/experiment_collection | 86397cae1427c49f30e8af2d6dfb7a15c3f3494d | [
"MIT"
] | null | null | null | src/experiment_collection_core/service_pb2.py | AsciiShell/experiment_collection | 86397cae1427c49f30e8af2d6dfb7a15c3f3494d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: experiment_collection_core/service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _ref... | 39.21157 | 2,040 | 0.75842 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
from google.protobuf import timestamp_pb2 as google_dot_prot... | true | true |
f715925d591bd9957fdc6799ded885a4c997bb33 | 6,877 | py | Python | p7/MIPSMicroSystem/my_files/test/auto_test.py | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | 2 | 2022-03-06T06:05:24.000Z | 2022-03-10T09:08:08.000Z | p7/MIPSMicroSystem/my_files/test/auto_test.py | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | null | null | null | p7/MIPSMicroSystem/my_files/test/auto_test.py | t0ush1/ComputerOrganization | 8093949bbd3e48678cea832133e9bf8990bbdf27 | [
"MIT"
] | null | null | null | #############################################################
# win10 64bit
# python 3.9.6
#
# author: toush1 (20373944 he tianran)
#############################################################
import os
import re
# software path
xilinxPath = "G:\\ISE\\ise\\14.7\\ISE_DS\\ISE\\"
marsPath = "G:\\mars\\Mars... | 40.452941 | 138 | 0.54137 |
import os
import re
xilinxPath = "G:\\ISE\\ise\\14.7\\ISE_DS\\ISE\\"
marsPath = "G:\\mars\\Mars_test.jar"
myPrjPath = "D:\\study\\CO\\p7\\MIPSMicroSystem\\"
otherPrjPath = "D:\\study\\CO\\p7\\szxCPU\\"
start = 0
tot = 1
interrupt = 0x301c
def runMars(asm, codeFilePath, out):
path = os.path.dirname(... | true | true |
f715928065109e697649bf15722ccc0e6c0edfa4 | 7,114 | py | Python | test/functional/tests/fault_injection/test_cache_insert_error.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | null | null | null | test/functional/tests/fault_injection/test_cache_insert_error.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | 1 | 2022-03-21T22:05:26.000Z | 2022-03-21T22:05:26.000Z | test/functional/tests/fault_injection/test_cache_insert_error.py | andreatomassetti/open-cas-linux | 6a6a0267d76dca86de8695a959991ecefdc0ddf8 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright(c) 2019-2021 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
import pytest
from api.cas import casadm
from api.cas.cache_config import (
CacheMode,
CacheLineSize,
SeqCutOffPolicy,
CleaningPolicy,
CacheStatus,
)
from core.test_run import TestRun
from storage_devices.disk i... | 38.247312 | 100 | 0.66826 |
import pytest
from api.cas import casadm
from api.cas.cache_config import (
CacheMode,
CacheLineSize,
SeqCutOffPolicy,
CleaningPolicy,
CacheStatus,
)
from core.test_run import TestRun
from storage_devices.disk import DiskTypeSet, DiskType, DiskTypeLowerThan
from test_tools.device_mapper import Err... | true | true |
f71592ac0589f8a0a4e9faf12a0a0f6c0ac061b2 | 2,240 | py | Python | importo/fields/html.py | torchbox/django-importo | 57c96951af624d2f6c9128c5689d55f1cc1f7019 | [
"BSD-3-Clause"
] | 1 | 2021-12-09T15:10:50.000Z | 2021-12-09T15:10:50.000Z | importo/fields/html.py | torchbox/django-importo | 57c96951af624d2f6c9128c5689d55f1cc1f7019 | [
"BSD-3-Clause"
] | null | null | null | importo/fields/html.py | torchbox/django-importo | 57c96951af624d2f6c9128c5689d55f1cc1f7019 | [
"BSD-3-Clause"
] | null | null | null | from typing import Any, Mapping, Sequence
from urllib.parse import unquote_plus
import bleach
from importo.fields.base import Field
from importo.utils.html import tidy_html
class HTMLField(Field):
allowed_tags = [
"a",
"abbr",
"acronym",
"b",
"bdi",
"blockquote",
... | 27.317073 | 84 | 0.537054 | from typing import Any, Mapping, Sequence
from urllib.parse import unquote_plus
import bleach
from importo.fields.base import Field
from importo.utils.html import tidy_html
class HTMLField(Field):
allowed_tags = [
"a",
"abbr",
"acronym",
"b",
"bdi",
"blockquote",
... | true | true |
f71595154e1ed423c34fbdbea424fd5fd9cd6d53 | 1,245 | py | Python | myroot/global_config.py | pinoylearnpython/dev | 3fd904c594a8c5cab7fd1fe2ad775fd519410a8a | [
"MIT"
] | 2 | 2019-10-29T07:41:38.000Z | 2020-01-31T16:46:15.000Z | myroot/global_config.py | pinoylearnpython/dev | 3fd904c594a8c5cab7fd1fe2ad775fd519410a8a | [
"MIT"
] | null | null | null | myroot/global_config.py | pinoylearnpython/dev | 3fd904c594a8c5cab7fd1fe2ad775fd519410a8a | [
"MIT"
] | 2 | 2019-04-23T04:40:07.000Z | 2020-02-17T09:11:48.000Z | from django.conf import settings
def global_settings(request):
""" Return custom constant global variables to be
used widely for all of our apps. """
# Current user logged in info
cur_user_id = 0
cur_user_name = ''
cur_user_full_name = ''
if request.user.is_authenticated:
... | 35.571429 | 84 | 0.665863 | from django.conf import settings
def global_settings(request):
cur_user_id = 0
cur_user_name = ''
cur_user_full_name = ''
if request.user.is_authenticated:
cur_user_id = request.user.id
cur_user_name = request.user.username
cur_user_full_name = request... | true | true |
f7159641e3e977f8f51e5cc647c57a31d0966efe | 1,025 | py | Python | server/src/models.py | Jobegiar99/Garden-Palooza | 694acaf42a56f3ecfb2fa3912e3777ad44e3126e | [
"MIT"
] | 1 | 2021-08-02T23:33:50.000Z | 2021-08-02T23:33:50.000Z | server/src/models.py | Jobegiar99/Garden-Palooza | 694acaf42a56f3ecfb2fa3912e3777ad44e3126e | [
"MIT"
] | 61 | 2021-08-03T00:13:24.000Z | 2021-08-20T17:38:36.000Z | server/src/models.py | Jobegiar99/Garden-Palooza | 694acaf42a56f3ecfb2fa3912e3777ad44e3126e | [
"MIT"
] | 1 | 2021-08-22T03:32:42.000Z | 2021-08-22T03:32:42.000Z | # flake8: noqa
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.dialects import postgresql
db = SQLAlchemy()
class UserModel(db.Model):
__tablename__ = "user"
username = db.Column(db.String(36), primary_key=True)
password = db.Column(db.String(30))
def __init__(self, username, password):
... | 27.702703 | 72 | 0.693659 | from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.dialects import postgresql
db = SQLAlchemy()
class UserModel(db.Model):
__tablename__ = "user"
username = db.Column(db.String(36), primary_key=True)
password = db.Column(db.String(30))
def __init__(self, username, password):
self.usern... | true | true |
f715967f3c28b129f56ec6481c8bda553b44d472 | 963 | py | Python | lpot/ux/components/model/tensorflow/frozen_pb.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | null | null | null | lpot/ux/components/model/tensorflow/frozen_pb.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | null | null | null | lpot/ux/components/model/tensorflow/frozen_pb.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021 Intel 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... | 34.392857 | 74 | 0.73001 |
from ..model_type_getter import get_model_type
from .model import TensorflowModel as TFModel
class FrozenPbModel(TFModel):
@staticmethod
def supports_path(path: str) -> bool:
return "frozen_pb" == get_model_type(path)
| true | true |
f715970fd90159b33cf104a6f896c9d635be8d7d | 981 | py | Python | kafka_to_elastic/kafka_historique_montants_to_elastic.py | Neemys/BigCoin | 13d76eaccf66fd8a50820bb835fe8b69c39a28af | [
"Apache-2.0"
] | null | null | null | kafka_to_elastic/kafka_historique_montants_to_elastic.py | Neemys/BigCoin | 13d76eaccf66fd8a50820bb835fe8b69c39a28af | [
"Apache-2.0"
] | 10 | 2018-03-22T09:21:11.000Z | 2018-04-11T08:50:58.000Z | kafka_to_elastic/kafka_historique_montants_to_elastic.py | Neemys/BigCoin | 13d76eaccf66fd8a50820bb835fe8b69c39a28af | [
"Apache-2.0"
] | 2 | 2018-03-30T09:52:48.000Z | 2018-04-11T13:13:36.000Z | from bigcoin import bc_kafka,bc_elasticsearch
import json
import datetime
import signal
def generate_elastic_insert_from_messages(messages):
for message in messages:
json_message = json.loads(message)
#value are in satoshi
yield {
'_index' : 'transaction_idx',
'_type': 'transaction',
'_id': json_messag... | 26.513514 | 100 | 0.746177 | from bigcoin import bc_kafka,bc_elasticsearch
import json
import datetime
import signal
def generate_elastic_insert_from_messages(messages):
for message in messages:
json_message = json.loads(message)
yield {
'_index' : 'transaction_idx',
'_type': 'transaction',
'_id': json_message['index'],
'_sourc... | true | true |
f715986ba969fafbf1bb6c8a7b6a6295ca3828db | 1,546 | py | Python | mltemplate/ci/stages.py | vmarkovtsev/ml-repo-template | bf3596e2a1c319166092c1fd263ec28ceacc1dd1 | [
"MIT"
] | null | null | null | mltemplate/ci/stages.py | vmarkovtsev/ml-repo-template | bf3596e2a1c319166092c1fd263ec28ceacc1dd1 | [
"MIT"
] | null | null | null | mltemplate/ci/stages.py | vmarkovtsev/ml-repo-template | bf3596e2a1c319166092c1fd263ec28ceacc1dd1 | [
"MIT"
] | null | null | null | from mltemplate.ci.core import Stage
from mltemplate.ci.jobs import BumpVersionJob, PypiDeployJob, RunTestsJob, StyleCheckJob
class BumpVersionStage(Stage):
def __init__(self, name="bump-version", **kwargs):
super(BumpVersionStage, self).__init__(
name=name, jobs=[BumpVersionJob(stage=name, **... | 35.136364 | 94 | 0.650065 | from mltemplate.ci.core import Stage
from mltemplate.ci.jobs import BumpVersionJob, PypiDeployJob, RunTestsJob, StyleCheckJob
class BumpVersionStage(Stage):
def __init__(self, name="bump-version", **kwargs):
super(BumpVersionStage, self).__init__(
name=name, jobs=[BumpVersionJob(stage=name, **... | true | true |
f7159a946ae2267a79e3a78a56dd34aec97345e1 | 1,130 | py | Python | simulator/event.py | djpetti/molecube | b7267803f080ed62e158fc5c1cfcff6beb709de7 | [
"MIT"
] | 2 | 2018-09-11T21:09:22.000Z | 2018-10-05T08:35:58.000Z | simulator/event.py | djpetti/molecube | b7267803f080ed62e158fc5c1cfcff6beb709de7 | [
"MIT"
] | 24 | 2018-09-09T22:51:26.000Z | 2018-11-29T22:49:57.000Z | simulator/event.py | djpetti/molecube | b7267803f080ed62e158fc5c1cfcff6beb709de7 | [
"MIT"
] | 1 | 2018-10-16T20:01:20.000Z | 2018-10-16T20:01:20.000Z | class Event(object):
""" Represents a GUI event. """
def __init__(self, tk_event):
"""
Args:
tk_event: The underlying Tkinter event to wrap. """
self._tk_event = tk_event
@classmethod
def get_identifier(cls):
"""
Returns:
The Tkinter identifier for this event. """
raise Not... | 24.042553 | 80 | 0.676106 | class Event(object):
def __init__(self, tk_event):
self._tk_event = tk_event
@classmethod
def get_identifier(cls):
raise NotImplementedError("Must be implemented by subclass.")
class MouseEvent(Event):
def get_pos(self):
return (self._tk_event.x, self._tk_event.y)
class MouseDragEvent(MouseEven... | true | true |
f7159b75d0cdb78ddc25a9f3959376ef6d82d188 | 16,663 | py | Python | connexion/operations/abstract.py | eyalkaspi/connexion | 9e07c9d5ba554119c38e17d3afc120eec0c1e390 | [
"Apache-2.0"
] | null | null | null | connexion/operations/abstract.py | eyalkaspi/connexion | 9e07c9d5ba554119c38e17d3afc120eec0c1e390 | [
"Apache-2.0"
] | null | null | null | connexion/operations/abstract.py | eyalkaspi/connexion | 9e07c9d5ba554119c38e17d3afc120eec0c1e390 | [
"Apache-2.0"
] | null | null | null | import abc
import logging
from connexion.operations.secure import SecureOperation
from ..decorators.metrics import UWSGIMetricsCollector
from ..decorators.parameter import parameter_to_arg
from ..decorators.produces import BaseSerializer, Produces
from ..decorators.response import ResponseValidator
from ..decorators.... | 34.932914 | 120 | 0.63434 | import abc
import logging
from connexion.operations.secure import SecureOperation
from ..decorators.metrics import UWSGIMetricsCollector
from ..decorators.parameter import parameter_to_arg
from ..decorators.produces import BaseSerializer, Produces
from ..decorators.response import ResponseValidator
from ..decorators.... | true | true |
f7159bc7a6e447bf791158449870039af24b7945 | 2,451 | py | Python | examples/python/lis2ds12.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 619 | 2015-01-14T23:50:18.000Z | 2019-11-08T14:04:33.000Z | examples/python/lis2ds12.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 576 | 2015-01-02T09:55:14.000Z | 2019-11-12T15:31:10.000Z | examples/python/lis2ds12.py | moredu/upm | d6f76ff8c231417666594214679c49399513112e | [
"MIT"
] | 494 | 2015-01-14T18:33:56.000Z | 2019-11-07T10:08:15.000Z | #!/usr/bin/env python
# Author: Jon Trulson <jtrulson@ics.com>
# Copyright (c) 2016-2017 Intel Corporation.
#
# 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
# ... | 35.521739 | 83 | 0.696042 |
from __future__ import print_function
import time, sys, signal, atexit
from upm import pyupm_lis2ds12 as sensorObj
def main():
sensor = sensorObj.LIS2DS12()
def SIGINTHandler(signum, frame):
raise SystemExit
def exitHandler():
print("Exiting")
sys.exi... | true | true |
f7159c0f90f16cb4e374669e5d3e907a7304876f | 8,515 | py | Python | pcdet/datasets/augmentor/data_augmentor.py | Jasonkks/mlcnet | 8f89c860c709733c8baa663607004fc48d76291d | [
"Apache-2.0"
] | 18 | 2021-11-30T15:19:53.000Z | 2022-03-30T15:15:57.000Z | pcdet/datasets/augmentor/data_augmentor.py | Jasonkks/mlcnet | 8f89c860c709733c8baa663607004fc48d76291d | [
"Apache-2.0"
] | 2 | 2021-12-10T06:38:18.000Z | 2022-03-27T21:45:53.000Z | pcdet/datasets/augmentor/data_augmentor.py | Jasonkks/mlcnet | 8f89c860c709733c8baa663607004fc48d76291d | [
"Apache-2.0"
] | 3 | 2021-12-01T06:25:52.000Z | 2022-01-21T14:13:51.000Z | from functools import partial
import torch
import random
import numpy as np
from ...ops.roiaware_pool3d import roiaware_pool3d_utils
from ...utils import common_utils, box_utils
from . import augmentor_utils, database_sampler
class DataAugmentor(object):
def __init__(self, root_path, augmentor_configs, class_name... | 40.165094 | 121 | 0.622548 | from functools import partial
import torch
import random
import numpy as np
from ...ops.roiaware_pool3d import roiaware_pool3d_utils
from ...utils import common_utils, box_utils
from . import augmentor_utils, database_sampler
class DataAugmentor(object):
def __init__(self, root_path, augmentor_configs, class_name... | true | true |
f7159c350fdf2aa74b7565b424ed07b5ef99b118 | 733 | py | Python | services/migrations/0010_auto_20170729_0711.py | iesteban/bitcoin_bazaar_backend | 2aa7c61d8727dae3a9be4b19c4b2aa49ec7ecaa0 | [
"MIT"
] | 18 | 2017-03-08T06:30:55.000Z | 2020-05-08T17:30:20.000Z | services/migrations/0010_auto_20170729_0711.py | iesteban/bitcoin_bazaar_backend | 2aa7c61d8727dae3a9be4b19c4b2aa49ec7ecaa0 | [
"MIT"
] | 871 | 2017-03-06T21:03:59.000Z | 2022-03-28T19:46:44.000Z | services/migrations/0010_auto_20170729_0711.py | iesteban/bitcoin_bazaar_backend | 2aa7c61d8727dae3a9be4b19c4b2aa49ec7ecaa0 | [
"MIT"
] | 5 | 2017-07-07T12:10:47.000Z | 2020-05-13T15:57:56.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-07-29 07:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0009_auto_20170617_1557'),
]
operations = [
migrations.AddField... | 28.192308 | 113 | 0.618008 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('services', '0009_auto_20170617_1557'),
]
operations = [
migrations.AddField(
model_name='category',
name='name_en',
... | true | true |
f7159d3af512db4cfc343827849b64501a5eca32 | 2,770 | py | Python | apps/project/subviews/bug.py | gvizquel/pyerp | c859f7293cabd1003f79112463cee93ac89fccba | [
"MIT"
] | null | null | null | apps/project/subviews/bug.py | gvizquel/pyerp | c859f7293cabd1003f79112463cee93ac89fccba | [
"MIT"
] | 11 | 2020-06-05T22:50:37.000Z | 2022-02-10T09:05:56.000Z | apps/project/subviews/bug.py | gvizquel/pyerp | c859f7293cabd1003f79112463cee93ac89fccba | [
"MIT"
] | null | null | null | # Librerias Django
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView
... | 33.780488 | 88 | 0.648014 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.shortcuts import redirect
from django.urls import reverse
from django.views.generic import DetailView, ListView
from django.views.generic.edit import CreateView, UpdateView
from ..submodels.b... | true | true |
f7159d5a2d920dc9cc5bb8cc18005b68413166a5 | 2,828 | py | Python | Efficient-3DCNNs/thop/count_hooks.py | reetikaag/human-activity-recognition | 1e6760a88ca52fe9a8a8ca60d000cd3426851156 | [
"MIT"
] | null | null | null | Efficient-3DCNNs/thop/count_hooks.py | reetikaag/human-activity-recognition | 1e6760a88ca52fe9a8a8ca60d000cd3426851156 | [
"MIT"
] | null | null | null | Efficient-3DCNNs/thop/count_hooks.py | reetikaag/human-activity-recognition | 1e6760a88ca52fe9a8a8ca60d000cd3426851156 | [
"MIT"
] | null | null | null | import argparse
import torch
import torch.nn as nn
multiply_adds = 1
def count_conv2d(m, x, y):
# TODO: add support for pad and dilation
x = x[0]
cin = m.in_channels
cout = m.out_channels
kh, kw = m.kernel_size
batch_size = x.size()[0]
out_w = y.size(2)
out_h = y.size(3)
# ops per output element
# kern... | 22.624 | 61 | 0.684936 | import argparse
import torch
import torch.nn as nn
multiply_adds = 1
def count_conv2d(m, x, y):
x = x[0]
cin = m.in_channels
cout = m.out_channels
kh, kw = m.kernel_size
batch_size = x.size()[0]
out_w = y.size(2)
out_h = y.size(3)
kernel_ops = multiply_adds * kh * kw * cin // m.groups
bias_ops = 1 i... | true | true |
f7159d9791448f06c36331ba8b9839a880d17d19 | 4,281 | py | Python | ambari-agent/src/test/python/ambari_agent/TestClusterConfigurationCache.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/test/python/ambari_agent/TestClusterConfigurationCache.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | ambari-agent/src/test/python/ambari_agent/TestClusterConfigurationCache.py | tqrg-bot/ambari | 05cd35982b30f424cec0b5b9d93bc4709880a3bc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
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")... | 38.918182 | 122 | 0.723896 |
import os
import sys
from ambari_agent.ClusterConfigurationCache import ClusterConfigurationCache
from mock.mock import MagicMock, patch, mock_open, ANY
from unittest import TestCase
class TestClusterConfigurationCache(TestCase):
o_flags = os.O_WRONLY | os.O_CREAT
perms = 0o600
def setUp(self):
sel... | true | true |
f7159dc06a6352dac967128fe0aa532b3e17b5a1 | 355 | py | Python | nsd1802/python/day04/seqop.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1802/python/day04/seqop.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | nsd1802/python/day04/seqop.py | MrWangwf/nsd1806 | 069e993b0bb64cb21adc2a25aa56f6da674453bc | [
"Apache-2.0"
] | null | null | null | from random import randint
alist = list() # []
list('hello') # ['h', 'e', 'l', 'l', 'o']
list((10, 20, 30)) # [10, 20, 30] 元组转列表
astr = str() # ''
str(10) # '10'
str(['h', 'e', 'l', 'l', 'o']) # 将列表转成字符串
atuple = tuple() # ()
tuple('hello') # ('h', 'e', 'l', 'l', 'o')
num_list = [randint(1, 100) for i in rang... | 25.357143 | 47 | 0.498592 | from random import randint
alist = list() list('hello') list((10, 20, 30)) astr = str() str(10) str(['h', 'e', 'l', 'l', 'o']) atuple = tuple() tuple('hello') num_list = [randint(1, 100) for i in range(10)]
max(num_list)
min(num_list)
| true | true |
f7159dfd3e5220cdf838857e63b85ecb77e79ba3 | 11,938 | py | Python | venv/Lib/site-packages/praw/endpoints.py | Dartok-SD/Dartok-SD-s-reddit-bot | dc7a3215c062ed95b9f44bc207383e776c1692ea | [
"MIT"
] | null | null | null | venv/Lib/site-packages/praw/endpoints.py | Dartok-SD/Dartok-SD-s-reddit-bot | dc7a3215c062ed95b9f44bc207383e776c1692ea | [
"MIT"
] | 1 | 2020-11-26T18:38:13.000Z | 2020-11-27T15:25:49.000Z | praw/endpoints.py | leviroth/praw | 8f05dd2a9188cbaf1fba067e429ad6552d952059 | [
"BSD-2-Clause"
] | null | null | null | """List of API endpoints PRAW knows about."""
# flake8: noqa
# fmt: off
API_PATH = {
"about_edited": "r/{subreddit}/about/edited/",
"about_log": "r/{subreddit}/about/log/",
"about_modqueue": "r/{subreddit}/about/modqueue/",
"about_reports": "r/{subreddit}/abo... | 58.234146 | 82 | 0.554951 |
API_PATH = {
"about_edited": "r/{subreddit}/about/edited/",
"about_log": "r/{subreddit}/about/log/",
"about_modqueue": "r/{subreddit}/about/modqueue/",
"about_reports": "r/{subreddit}/about/reports/",
"about_spam": "r/{subreddit}/about/spam/"... | true | true |
f7159f9ba44b38e5dac9b34e58d1d994a96098c0 | 5,561 | py | Python | autotorrent/clients/tests/test_transmission.py | jyggen/autotorrent | 5a8f2b40ccc8c66c73dc520f98b886d21e163afa | [
"MIT"
] | 278 | 2015-02-12T19:19:53.000Z | 2022-03-22T21:17:28.000Z | autotorrent/clients/tests/test_transmission.py | jyggen/autotorrent | 5a8f2b40ccc8c66c73dc520f98b886d21e163afa | [
"MIT"
] | 56 | 2015-03-27T00:38:37.000Z | 2022-03-26T17:52:58.000Z | autotorrent/clients/tests/test_transmission.py | jyggen/autotorrent | 5a8f2b40ccc8c66c73dc520f98b886d21e163afa | [
"MIT"
] | 48 | 2015-03-10T16:50:19.000Z | 2022-03-20T12:11:50.000Z | import json
import os
import shutil
import tempfile
from unittest import TestCase
from ...bencode import bdecode
from ..transmission import TransmissionClient as RealTransmissionClient
current_path = os.path.dirname(__file__)
class TransmissionClient(RealTransmissionClient):
def __init__(self, *args, **kwargs... | 36.827815 | 182 | 0.58209 | import json
import os
import shutil
import tempfile
from unittest import TestCase
from ...bencode import bdecode
from ..transmission import TransmissionClient as RealTransmissionClient
current_path = os.path.dirname(__file__)
class TransmissionClient(RealTransmissionClient):
def __init__(self, *args, **kwargs... | true | true |
f7159fe0ba18267bd61a13e1aaa108634eb930fb | 18,619 | py | Python | src/test/ClusterClassifier.py | fermi-lat/CalRecon | 69e123b523770baa1fc9e8f3b78e211b1064b0c0 | [
"BSD-3-Clause"
] | null | null | null | src/test/ClusterClassifier.py | fermi-lat/CalRecon | 69e123b523770baa1fc9e8f3b78e211b1064b0c0 | [
"BSD-3-Clause"
] | null | null | null | src/test/ClusterClassifier.py | fermi-lat/CalRecon | 69e123b523770baa1fc9e8f3b78e211b1064b0c0 | [
"BSD-3-Clause"
] | null | null | null | import ROOT
import time
import os
from array import array
from math import sqrt
from pXmlWriter import *
from ClusterConfig import *
class ClusterClassifier:
def __init__(self, varBins=True):
print 'Opening files...'
self.RootTreeDict = {}
for (topology, filePat... | 40.56427 | 213 | 0.555239 | import ROOT
import time
import os
from array import array
from math import sqrt
from pXmlWriter import *
from ClusterConfig import *
class ClusterClassifier:
def __init__(self, varBins=True):
print 'Opening files...'
self.RootTreeDict = {}
for (topology, filePat... | false | true |
f715a037d80404b6931c2c3dd6c455b1ba329594 | 4,755 | py | Python | tools/stats_mcdc_data.py | Yc174/tf-faster-rcnn-mcdc | 02d6008f2d689e6f928d2de24fc660073044d1b8 | [
"MIT"
] | null | null | null | tools/stats_mcdc_data.py | Yc174/tf-faster-rcnn-mcdc | 02d6008f2d689e6f928d2de24fc660073044d1b8 | [
"MIT"
] | null | null | null | tools/stats_mcdc_data.py | Yc174/tf-faster-rcnn-mcdc | 02d6008f2d689e6f928d2de24fc660073044d1b8 | [
"MIT"
] | null | null | null | #coding=utf-8
from __future__ import print_function
import time
import argparse
from glob import glob
import os, cv2
import json
def show(image_path, bbox):
print(image_path, bbox)
im = cv2.imread(image_path)
x, y, w, h = bbox
# left = int(x - w / 2)
# right = int(x + w / 2)
# top = int(y - h... | 30.677419 | 146 | 0.512303 | from __future__ import print_function
import time
import argparse
from glob import glob
import os, cv2
import json
def show(image_path, bbox):
print(image_path, bbox)
im = cv2.imread(image_path)
x, y, w, h = bbox
left = int(x)
top = int(y)
right = int(x + w)
bottom = int(... | true | true |
f715a131ad3bfd03cd6d8810488e273d1fd54f64 | 6,015 | py | Python | docker/api/daemon.py | jbn/docker-py | 1e38d31c9fc74d07cb8dd3b7b100723bfacd23f7 | [
"Apache-2.0"
] | 72 | 2018-07-02T07:47:15.000Z | 2022-03-29T10:02:14.000Z | docker/api/daemon.py | jbn/docker-py | 1e38d31c9fc74d07cb8dd3b7b100723bfacd23f7 | [
"Apache-2.0"
] | 51 | 2019-10-08T01:53:02.000Z | 2021-06-04T22:02:21.000Z | docker/api/daemon.py | jbn/docker-py | 1e38d31c9fc74d07cb8dd3b7b100723bfacd23f7 | [
"Apache-2.0"
] | 29 | 2018-09-17T06:10:32.000Z | 2022-03-19T13:15:30.000Z | import os
from datetime import datetime
from .. import auth, types, utils
class DaemonApiMixin(object):
@utils.minimum_version('1.25')
def df(self):
"""
Get data usage information.
Returns:
(dict): A dictionary representing different resource categories
and th... | 33.049451 | 79 | 0.571904 | import os
from datetime import datetime
from .. import auth, types, utils
class DaemonApiMixin(object):
@utils.minimum_version('1.25')
def df(self):
url = self._url('/system/df')
return self._result(self._get(url), True)
def events(self, since=None, until=None, filters=None, decode=None)... | true | true |
f715a15885e13fd0957f648c1414a90e72a239ca | 10,690 | py | Python | stable_baselines3/dqn/dqn.py | haorang/285 | 3b7369b8eb4433952c9cdf27d4feaa015a6c40e4 | [
"MIT"
] | 26 | 2021-11-05T08:46:06.000Z | 2022-03-22T05:53:57.000Z | stable_baselines3/dqn/dqn.py | haorang/285 | 3b7369b8eb4433952c9cdf27d4feaa015a6c40e4 | [
"MIT"
] | 1 | 2021-11-19T11:13:37.000Z | 2021-11-30T09:08:04.000Z | stable_baselines3/dqn/dqn.py | haorang/285 | 3b7369b8eb4433952c9cdf27d4feaa015a6c40e4 | [
"MIT"
] | 5 | 2021-11-05T08:46:12.000Z | 2022-03-25T21:56:58.000Z | from typing import Any, Dict, List, Optional, Tuple, Type, Union
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3.common import logger
from stable_baselines3.common.off_policy_algorithm import OffPolicyAlgorithm
from stable_baselines3.common.type_aliases import GymEnv,... | 43.279352 | 110 | 0.659682 | from typing import Any, Dict, List, Optional, Tuple, Type, Union
import numpy as np
import torch as th
from torch.nn import functional as F
from stable_baselines3.common import logger
from stable_baselines3.common.off_policy_algorithm import OffPolicyAlgorithm
from stable_baselines3.common.type_aliases import GymEnv,... | true | true |
f715a21938d09961aef70bbfb712b4ac4b78ccb3 | 2,266 | py | Python | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/scp/impl/scp_sdram_alloc_request.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | 2 | 2020-11-01T13:22:11.000Z | 2020-11-01T13:22:20.000Z | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/scp/impl/scp_sdram_alloc_request.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinnman/messages/scp/impl/scp_sdram_alloc_request.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | from spinnman.messages.scp.abstract_messages.abstract_scp_request\
import AbstractSCPRequest
from spinnman.messages.scp.impl.scp_sdram_alloc_response import \
SCPSDRAMAllocResponse
from spinnman.messages.sdp.sdp_header import SDPHeader
from spinnman.messages.sdp.sdp_flag import SDPFlag
from spinnman.messages.sc... | 39.068966 | 79 | 0.644307 | from spinnman.messages.scp.abstract_messages.abstract_scp_request\
import AbstractSCPRequest
from spinnman.messages.scp.impl.scp_sdram_alloc_response import \
SCPSDRAMAllocResponse
from spinnman.messages.sdp.sdp_header import SDPHeader
from spinnman.messages.sdp.sdp_flag import SDPFlag
from spinnman.messages.sc... | true | true |
f715a27d0c9909bea75ea1edd3eb15e6bba3b9a4 | 5,102 | py | Python | gluon/packages/dal/pydal/adapters/mssql.py | kyomei/python-locadora | c461252387f77bd01465fd851d0b5bfa9ce53493 | [
"BSD-3-Clause"
] | null | null | null | gluon/packages/dal/pydal/adapters/mssql.py | kyomei/python-locadora | c461252387f77bd01465fd851d0b5bfa9ce53493 | [
"BSD-3-Clause"
] | null | null | null | gluon/packages/dal/pydal/adapters/mssql.py | kyomei/python-locadora | c461252387f77bd01465fd851d0b5bfa9ce53493 | [
"BSD-3-Clause"
] | null | null | null | import re
from .._compat import PY2, iteritems, integer_types, to_unicode, long
from .._globals import IDENTITY
from .base import SQLAdapter
from . import adapters, with_connection_or_raise
class Slicer(object):
def rowslice(self, rows, minimum=0, maximum=None):
if maximum is None:
return rows[... | 32.705128 | 75 | 0.561348 | import re
from .._compat import PY2, iteritems, integer_types, to_unicode, long
from .._globals import IDENTITY
from .base import SQLAdapter
from . import adapters, with_connection_or_raise
class Slicer(object):
def rowslice(self, rows, minimum=0, maximum=None):
if maximum is None:
return rows[... | true | true |
f715a381967b6c4678430e111919f89608f9e232 | 1,922 | py | Python | astropy/stats/lombscargle/implementations/tests/test_mle.py | b1quint/astropy | a170a74739e4356c169429a42e554f9777b53f4d | [
"BSD-3-Clause"
] | 8 | 2019-04-27T01:19:45.000Z | 2020-09-21T03:31:01.000Z | astropy/stats/lombscargle/implementations/tests/test_mle.py | b1quint/astropy | a170a74739e4356c169429a42e554f9777b53f4d | [
"BSD-3-Clause"
] | null | null | null | astropy/stats/lombscargle/implementations/tests/test_mle.py | b1quint/astropy | a170a74739e4356c169429a42e554f9777b53f4d | [
"BSD-3-Clause"
] | 5 | 2019-04-27T01:19:47.000Z | 2020-09-20T15:15:19.000Z | import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.stats.lombscargle.implementations.mle import design_matrix, periodic_fit
@pytest.fixture
def t():
rand = np.random.RandomState(42)
return 10 * rand.rand(10)
@pytest.mark.parametrize('freq', [1.0, 2])
@pytest.mark.parame... | 34.945455 | 85 | 0.605619 | import pytest
import numpy as np
from numpy.testing import assert_allclose
from astropy.stats.lombscargle.implementations.mle import design_matrix, periodic_fit
@pytest.fixture
def t():
rand = np.random.RandomState(42)
return 10 * rand.rand(10)
@pytest.mark.parametrize('freq', [1.0, 2])
@pytest.mark.parame... | true | true |
f715a4a05c0ac41089e088d453bb1aff5563f056 | 29,345 | py | Python | braintree/webhook_testing_gateway.py | maneeshd/braintree_python | 4aa3f4b8a376ea81bf16a053d840efe55ae13675 | [
"MIT"
] | 1 | 2019-05-23T10:08:54.000Z | 2019-05-23T10:08:54.000Z | braintree/webhook_testing_gateway.py | maneeshd/braintree_python | 4aa3f4b8a376ea81bf16a053d840efe55ae13675 | [
"MIT"
] | null | null | null | braintree/webhook_testing_gateway.py | maneeshd/braintree_python | 4aa3f4b8a376ea81bf16a053d840efe55ae13675 | [
"MIT"
] | 2 | 2019-05-06T01:10:41.000Z | 2019-05-06T01:10:42.000Z | from braintree.util.crypto import Crypto
from braintree.webhook_notification import WebhookNotification
import sys
if sys.version_info[0] == 2:
from base64 import encodestring as encodebytes
else:
from base64 import encodebytes
from datetime import datetime
class WebhookTestingGateway(object):
def __init__... | 43.474074 | 129 | 0.566434 | from braintree.util.crypto import Crypto
from braintree.webhook_notification import WebhookNotification
import sys
if sys.version_info[0] == 2:
from base64 import encodestring as encodebytes
else:
from base64 import encodebytes
from datetime import datetime
class WebhookTestingGateway(object):
def __init__... | true | true |
f715a55d3a4d0e4ed9e635af1fb7092bd4dc3fdc | 2,188 | py | Python | project-1-command-line/main.py | jadry92/Course-data-ing-with-python | 57d4eb1564a2379497546ff28e02377fb07ba0b9 | [
"MIT"
] | null | null | null | project-1-command-line/main.py | jadry92/Course-data-ing-with-python | 57d4eb1564a2379497546ff28e02377fb07ba0b9 | [
"MIT"
] | null | null | null | project-1-command-line/main.py | jadry92/Course-data-ing-with-python | 57d4eb1564a2379497546ff28e02377fb07ba0b9 | [
"MIT"
] | null | null | null | import argparse
import logging
import datetime
import csv
from requests.exceptions import HTTPError
from urllib3.exceptions import MaxRetryError
# local imports
from common import config
import news_page_objects as news
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def _news_scraper(n... | 29.567568 | 95 | 0.673675 | import argparse
import logging
import datetime
import csv
from requests.exceptions import HTTPError
from urllib3.exceptions import MaxRetryError
from common import config
import news_page_objects as news
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def _news_scraper(news_sites_uid):
... | true | true |
f715a596a287133251f9a3c65e63acf439e485b9 | 18,541 | py | Python | powerbot/models/order_entry.py | rogerarmstrong/python-samples | df73b5dab70090f820fc47096b0ae5490c7779b6 | [
"Apache-2.0"
] | null | null | null | powerbot/models/order_entry.py | rogerarmstrong/python-samples | df73b5dab70090f820fc47096b0ae5490c7779b6 | [
"Apache-2.0"
] | null | null | null | powerbot/models/order_entry.py | rogerarmstrong/python-samples | df73b5dab70090f820fc47096b0ae5490c7779b6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Powerbot Server
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import... | 28.656878 | 372 | 0.584596 |
import pprint
import re
import six
class OrderEntry(object):
swagger_types = {
'side': 'str',
'prod': 'str',
'quantity': 'float',
'price': 'float',
'display_qty': 'int',
'contract_id': 'int',
'contract_name': 'str',
'cl_ordr_id': 'str',
... | true | true |
f715a6870b84172a6bce55c32434e579a2ef0c2a | 6,133 | py | Python | output/models/ms_data/element/elem_z018_xsd/elem_z018.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/element/elem_z018_xsd/elem_z018.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/element/elem_z018_xsd/elem_z018.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from typing import Dict, List, Optional
@dataclass
class Signatures:
class Meta:
name = "signatures"
w3_org_2000_09_xmldsig_element: List[object] = field(
default_factory=list,
metadata={
"type": "Wildcard",
"namespace":... | 15.806701 | 65 | 0.459971 | from dataclasses import dataclass, field
from typing import Dict, List, Optional
@dataclass
class Signatures:
class Meta:
name = "signatures"
w3_org_2000_09_xmldsig_element: List[object] = field(
default_factory=list,
metadata={
"type": "Wildcard",
"namespace":... | true | true |
f715a6b708707b2792f67edc44f6ef7fd6f14e2c | 58,348 | py | Python | torch/nn/parallel/distributed.py | chaekit/pytorch | 132f5c1f36698361149ea99ca3504bd2acfdc19f | [
"Intel"
] | null | null | null | torch/nn/parallel/distributed.py | chaekit/pytorch | 132f5c1f36698361149ea99ca3504bd2acfdc19f | [
"Intel"
] | null | null | null | torch/nn/parallel/distributed.py | chaekit/pytorch | 132f5c1f36698361149ea99ca3504bd2acfdc19f | [
"Intel"
] | null | null | null | import copy
import inspect
import itertools
import logging
import os
import warnings
from contextlib import contextmanager
from typing import NamedTuple
import torch
import torch.distributed as dist
RPC_AVAILABLE = False
if dist.is_available():
from torch.distributed.distributed_c10d import ReduceOp
from torc... | 46.015773 | 116 | 0.622935 | import copy
import inspect
import itertools
import logging
import os
import warnings
from contextlib import contextmanager
from typing import NamedTuple
import torch
import torch.distributed as dist
RPC_AVAILABLE = False
if dist.is_available():
from torch.distributed.distributed_c10d import ReduceOp
from torc... | true | true |
f715a88fabf1954be8dfa7b40347f927f0d59c06 | 362 | py | Python | test.py | fahmirevo/sign-language-recognition | ff5e3f4ffb7ecba15667be8870db62717f1fab66 | [
"MIT"
] | null | null | null | test.py | fahmirevo/sign-language-recognition | ff5e3f4ffb7ecba15667be8870db62717f1fab66 | [
"MIT"
] | null | null | null | test.py | fahmirevo/sign-language-recognition | ff5e3f4ffb7ecba15667be8870db62717f1fab66 | [
"MIT"
] | null | null | null | from keras.models import load_model
import numpy as np
X = np.load("dataset/X_test.npy")
Y = np.load("dataset/Y_test.npy")
model = load_model("model")
score = model.evaluate(X, Y)
print(score[0], score[1])
# print(np.argmax(model.predict(X[:200]), axis=1))
# print(np.argmax(model.predict(X), axis=1) == np.argmax(Y... | 22.625 | 68 | 0.685083 | from keras.models import load_model
import numpy as np
X = np.load("dataset/X_test.npy")
Y = np.load("dataset/Y_test.npy")
model = load_model("model")
score = model.evaluate(X, Y)
print(score[0], score[1])
| true | true |
f715aa3a3e29c2e7729e963647247ab81b1771d1 | 7,083 | py | Python | deepchem/molnet/load_function/factors_datasets.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 3,782 | 2016-02-21T03:53:11.000Z | 2022-03-31T16:10:26.000Z | deepchem/molnet/load_function/factors_datasets.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 2,666 | 2016-02-11T01:54:54.000Z | 2022-03-31T11:14:33.000Z | deepchem/molnet/load_function/factors_datasets.py | deloragaskins/deepchem | 234ab699cdb997e5963966a8b6926cb2cda7c064 | [
"MIT"
] | 1,597 | 2016-02-21T03:10:08.000Z | 2022-03-30T13:21:28.000Z | """
FACTOR dataset loader
"""
import os
import logging
import time
import numpy as np
import deepchem
from deepchem.molnet.load_function.kaggle_features import merck_descriptors
logger = logging.getLogger(__name__)
TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/FACTORS_training_disguised_combi... | 34.217391 | 149 | 0.743188 | import os
import logging
import time
import numpy as np
import deepchem
from deepchem.molnet.load_function.kaggle_features import merck_descriptors
logger = logging.getLogger(__name__)
TRAIN_URL = "https://deepchemdata.s3-us-west-1.amazonaws.com/datasets/FACTORS_training_disguised_combined_full.csv.gz"
VALID_URL = "... | true | true |
f715aa40f422bc6e058fe8e7a1b2311652df84ae | 2,299 | py | Python | tests/threadpool/test_concurrency.py | iiSeymour/aiofiles | cba6910a491f585f2dc4a87e215f5f52ebde6f48 | [
"Apache-2.0"
] | null | null | null | tests/threadpool/test_concurrency.py | iiSeymour/aiofiles | cba6910a491f585f2dc4a87e215f5f52ebde6f48 | [
"Apache-2.0"
] | null | null | null | tests/threadpool/test_concurrency.py | iiSeymour/aiofiles | cba6910a491f585f2dc4a87e215f5f52ebde6f48 | [
"Apache-2.0"
] | 1 | 2018-09-19T15:45:51.000Z | 2018-09-19T15:45:51.000Z | """Test concurrency properties of the implementation."""
from os.path import dirname
from os.path import join
import time
import asyncio
import pytest
import aiofiles.threadpool
@pytest.mark.asyncio
def test_slow_file(monkeypatch, unused_tcp_port):
"""Monkey patch open and file.read(), and assert the loop still w... | 28.382716 | 79 | 0.599391 | """Test concurrency properties of the implementation."""
from os.path import dirname
from os.path import join
import time
import asyncio
import pytest
import aiofiles.threadpool
@pytest.mark.asyncio
def test_slow_file(monkeypatch, unused_tcp_port):
"""Monkey patch open and file.read(), and assert the loop still w... | false | true |
f715aab0451804e3126d9a43d6e5f34e22e7a392 | 15,596 | py | Python | ch16-deployment/.venv/lib/python3.10/site-packages/psycopg/sql.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | 5 | 2021-12-14T03:33:39.000Z | 2022-01-11T14:13:21.000Z | ch16-deployment/.venv/lib/python3.10/site-packages/psycopg/sql.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | null | null | null | ch16-deployment/.venv/lib/python3.10/site-packages/psycopg/sql.py | wsvincent/djangoforbeginners_32 | aba7c99aa6050cfe8fb9d588af58c9f67411ae8a | [
"MIT"
] | null | null | null | """
SQL composition utility module
"""
# Copyright (C) 2020-2021 The Psycopg Team
import codecs
import string
from abc import ABC, abstractmethod
from typing import Any, Iterator, List, Optional, Sequence, Union
from .pq import Escaping
from .abc import AdaptContext
from .adapt import Transformer, PyFormat
from ._en... | 33.757576 | 85 | 0.591883 |
import codecs
import string
from abc import ABC, abstractmethod
from typing import Any, Iterator, List, Optional, Sequence, Union
from .pq import Escaping
from .abc import AdaptContext
from .adapt import Transformer, PyFormat
from ._encodings import pgconn_encoding
def quote(obj: Any, context: Optional[AdaptContex... | true | true |
f715ab79d63a14aca43b177b0113ad356a236fd3 | 1,008 | py | Python | stubs.min/System/Windows/Forms/__init___parts/ToolStripItemAlignment.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/System/Windows/Forms/__init___parts/ToolStripItemAlignment.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/System/Windows/Forms/__init___parts/ToolStripItemAlignment.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class ToolStripItemAlignment(Enum,IComparable,IFormattable,IConvertible):
"""
Determines the alignment of a System.Windows.Forms.ToolStripItem in a System.Windows.Forms.ToolStrip.
enum ToolStripItemAlignment,values: Left (0),Right (1)
"""
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <=... | 29.647059 | 215 | 0.675595 | class ToolStripItemAlignment(Enum,IComparable,IFormattable,IConvertible):
pass
""" __format__(formattable: IFormattable,format: str) -> str """
pass
pass
def __gt__(self,*args):
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) i... | true | true |
f715ab87bac08f07d5539e7b64cc21481970b063 | 8,682 | py | Python | gitinfo/utils.py | Secozzi/gitinfo | 4d218c724f5533f4bfc3f1e6ceb30cd78392eae6 | [
"MIT"
] | null | null | null | gitinfo/utils.py | Secozzi/gitinfo | 4d218c724f5533f4bfc3f1e6ceb30cd78392eae6 | [
"MIT"
] | null | null | null | gitinfo/utils.py | Secozzi/gitinfo | 4d218c724f5533f4bfc3f1e6ceb30cd78392eae6 | [
"MIT"
] | null | null | null | from __future__ import annotations
from anytree import NodeMixin
from datetime import datetime, timezone
from dotenv import load_dotenv
from os import environ
from os.path import join, dirname
from typing import Tuple, List, Any, Dict, Optional
import re
import requests
from rich.box import Box
__all__ = [
"get_d... | 27.738019 | 109 | 0.584543 | from __future__ import annotations
from anytree import NodeMixin
from datetime import datetime, timezone
from dotenv import load_dotenv
from os import environ
from os.path import join, dirname
from typing import Tuple, List, Any, Dict, Optional
import re
import requests
from rich.box import Box
__all__ = [
"get_d... | true | true |
f715ac6786b1c8d153bae843595f1b3b37a7b901 | 6,518 | py | Python | casinotools/fileformat/casino3/IntensityImage.py | drix00/pycasinotools | 2e33b42fb7c7629b35f007be5a404fdd1c45c771 | [
"Apache-2.0"
] | 2 | 2019-07-14T23:16:09.000Z | 2019-10-26T10:54:38.000Z | casinotools/fileformat/casino3/IntensityImage.py | drix00/pycasinotools | 2e33b42fb7c7629b35f007be5a404fdd1c45c771 | [
"Apache-2.0"
] | 5 | 2017-02-06T16:50:48.000Z | 2020-08-21T03:50:06.000Z | casinotools/fileformat/casino3/IntensityImage.py | drix00/pycasinotools | 2e33b42fb7c7629b35f007be5a404fdd1c45c771 | [
"Apache-2.0"
] | 5 | 2016-05-03T16:41:14.000Z | 2022-01-14T22:22:58.000Z | #!/usr/bin/env python
""" """
# Script information for the file.
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2009 Hendrix Demers"
__license__ = ""
# Standard library modules.
import logging
import os.path
# Third party modu... | 35.617486 | 109 | 0.596502 |
__author__ = "Hendrix Demers (hendrix.demers@mail.mcgill.ca)"
__version__ = ""
__date__ = ""
__copyright__ = "Copyright (c) 2009 Hendrix Demers"
__license__ = ""
import logging
import os.path
from PIL import Image
import casinotools.fileformat.casino3.File as File
import casinotools.fileformat.casino3.... | true | true |
f715af0a24dd23852f403a9a2f9f37a1c461984d | 66 | py | Python | programaker_twitter_service/__init__.py | plaza-project/twitter-bridge | 0b1807fef5817b2535eecc3b795e58685ff08ff5 | [
"Apache-2.0"
] | 1 | 2020-12-19T05:04:19.000Z | 2020-12-19T05:04:19.000Z | programaker_twitter_service/__init__.py | plaza-project/twitter-bridge | 0b1807fef5817b2535eecc3b795e58685ff08ff5 | [
"Apache-2.0"
] | null | null | null | programaker_twitter_service/__init__.py | plaza-project/twitter-bridge | 0b1807fef5817b2535eecc3b795e58685ff08ff5 | [
"Apache-2.0"
] | null | null | null | from . import config, storage
from .listener import TweetListener
| 22 | 35 | 0.818182 | from . import config, storage
from .listener import TweetListener
| true | true |
f715af426554e6845a9d59b633445b811a99ff66 | 1,074 | py | Python | core/api/base.py | care2donate/care2donate | 5f99e7169653a96b6e6db44f90afee17758a4480 | [
"MIT"
] | 1 | 2021-05-14T15:21:42.000Z | 2021-05-14T15:21:42.000Z | core/api/base.py | care2donate/care2donate | 5f99e7169653a96b6e6db44f90afee17758a4480 | [
"MIT"
] | 2 | 2021-05-13T10:26:36.000Z | 2021-05-13T19:30:25.000Z | core/api/base.py | care2donate/care2donate | 5f99e7169653a96b6e6db44f90afee17758a4480 | [
"MIT"
] | null | null | null | from django.db import transaction
from rest_framework import generics, mixins
class BaseAPIView(generics.GenericAPIView,
mixins.CreateModelMixin,
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.... | 31.588235 | 60 | 0.620112 | from django.db import transaction
from rest_framework import generics, mixins
class BaseAPIView(generics.GenericAPIView,
mixins.CreateModelMixin,
mixins.ListModelMixin,
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.... | true | true |
f715b0166e705758a0701b19f80e34986238aa34 | 4,522 | py | Python | tests/contrib/sensors/test_wasb_sensor.py | abhishek-ch/incubator-airflow | 3358551c8e73d9019900f7a85f18ebfd88591450 | [
"Apache-2.0"
] | 4 | 2015-11-12T10:58:54.000Z | 2017-08-05T06:41:36.000Z | tests/contrib/sensors/test_wasb_sensor.py | abhishek-ch/incubator-airflow | 3358551c8e73d9019900f7a85f18ebfd88591450 | [
"Apache-2.0"
] | 13 | 2018-07-11T10:45:30.000Z | 2018-08-18T00:43:30.000Z | tests/contrib/sensors/test_wasb_sensor.py | abhishek-ch/incubator-airflow | 3358551c8e73d9019900f7a85f18ebfd88591450 | [
"Apache-2.0"
] | 5 | 2020-05-12T13:38:14.000Z | 2022-03-17T17:17:50.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 31.402778 | 79 | 0.627377 |
import unittest
import datetime
from airflow import DAG, configuration
from airflow.contrib.sensors.wasb_sensor import WasbBlobSensor
from airflow.contrib.sensors.wasb_sensor import WasbPrefixSensor
try:
from unittest import mock
except ImportError:
try:
import mock
except ImportError:
m... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.