hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c39ba30cf076499676c885c32fc3bc7af869d8a | 2,261 | py | Python | scripts/hunter/tracer.py | Duroktar/Wolf | c192d5c27eb2098e440f7726eb1bff40ed004db5 | [
"Apache-2.0"
] | 105 | 2018-02-07T22:07:47.000Z | 2022-03-31T18:16:47.000Z | scripts/hunter/tracer.py | Duroktar/Wolf | c192d5c27eb2098e440f7726eb1bff40ed004db5 | [
"Apache-2.0"
] | 57 | 2018-02-07T23:07:41.000Z | 2021-11-21T17:14:06.000Z | scripts/hunter/tracer.py | MalcomnM/Fox | f41e59305c1fb4c008f5e0d712e291525c2b39f2 | [
"Apache-2.0"
] | 10 | 2018-02-24T23:44:51.000Z | 2022-03-02T07:52:27.000Z | from __future__ import absolute_import
import sys
import threading
from .event import Event
class Tracer(object):
"""
Trace object.
"""
def __init__(self, threading_support=False):
self._handler = None
self._previous = None
self._threading_previous = None
self.threa... | 27.573171 | 115 | 0.57939 | from __future__ import absolute_import
import sys
import threading
from .event import Event
class Tracer(object):
def __init__(self, threading_support=False):
self._handler = None
self._previous = None
self._threading_previous = None
self.threading_support = threading_support
... | true | true |
1c39ba66fa608550e4cccc018cb87aabc2527ad6 | 1,705 | py | Python | tests/test_utils.py | suganthsundar/melano | 8e9dd57d3ce9945b18e64da6b0df30811018fbf0 | [
"MIT"
] | null | null | null | tests/test_utils.py | suganthsundar/melano | 8e9dd57d3ce9945b18e64da6b0df30811018fbf0 | [
"MIT"
] | null | null | null | tests/test_utils.py | suganthsundar/melano | 8e9dd57d3ce9945b18e64da6b0df30811018fbf0 | [
"MIT"
] | null | null | null | import nose
from melano.utils import (sort, group_by, count)
def test_utils_sort_single_key():
items = [dict(x=1), dict(x=4), dict(x=2)]
sorted_items = sort(items, 'x')
nose.tools.assert_list_equal(sorted_items, [dict(x=1), dict(x=2), dict(x=4)])
def test_utils_sort_multiple_keys():
items = [dict(x=... | 34.1 | 112 | 0.524927 | import nose
from melano.utils import (sort, group_by, count)
def test_utils_sort_single_key():
items = [dict(x=1), dict(x=4), dict(x=2)]
sorted_items = sort(items, 'x')
nose.tools.assert_list_equal(sorted_items, [dict(x=1), dict(x=2), dict(x=4)])
def test_utils_sort_multiple_keys():
items = [dict(x=... | true | true |
1c39bb0fc92c8274504c4a01918fd5834b1290c6 | 1,576 | py | Python | bindings/python/examples/feature_example.py | beckgom/wav2letter | 69ea72b2ea553d2792fa8a702ebe84fdb6b6f372 | [
"BSD-3-Clause"
] | 1 | 2019-06-25T03:29:55.000Z | 2019-06-25T03:29:55.000Z | bindings/python/examples/feature_example.py | beckgom/wav2letter | 69ea72b2ea553d2792fa8a702ebe84fdb6b6f372 | [
"BSD-3-Clause"
] | null | null | null | bindings/python/examples/feature_example.py | beckgom/wav2letter | 69ea72b2ea553d2792fa8a702ebe84fdb6b6f372 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# adapted from wav2letter/src/feature/test/MfccTest.cpp
import itertools as it
import os
import sys
from wav2letter.feature import FeatureParams, Mfcc
if len(sys.argv) != 2:
print(f"usage: {sys.argv[0]} feature_test_data_path", file=sys.stderr)
print(" (usually: <wav2letter_root>/sr... | 25.836066 | 85 | 0.687183 |
import itertools as it
import os
import sys
from wav2letter.feature import FeatureParams, Mfcc
if len(sys.argv) != 2:
print(f"usage: {sys.argv[0]} feature_test_data_path", file=sys.stderr)
print(" (usually: <wav2letter_root>/src/feature/test/data)", file=sys.stderr)
sys.exit(1)
data_path = sys.argv[1... | true | true |
1c39bb129b8916d3543e06f71819bd1661e4a778 | 592 | py | Python | gumroad_clone/products/migrations/0003_auto_20211223_1608.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | 1 | 2022-01-22T13:43:30.000Z | 2022-01-22T13:43:30.000Z | gumroad_clone/products/migrations/0003_auto_20211223_1608.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | gumroad_clone/products/migrations/0003_auto_20211223_1608.py | AlexanderTCHK/gumroad-clone | 39654243e581b918569772e410196557f71f6591 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.14 on 2021-12-23 10:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0002_product_user'),
]
operations = [
migrations.AddField(
model_name='product',
name='active',
... | 24.666667 | 108 | 0.592905 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('products', '0002_product_user'),
]
operations = [
migrations.AddField(
model_name='product',
name='active',
field=models.BooleanField(default=False),
... | true | true |
1c39bbc1bd2d09912707a6984ef94b6d42f347b5 | 1,397 | py | Python | src/litedesk/lib/airwatch/device.py | litedesk/litedesk-lib-airwatch | 19c47a50d606f966497a6e24fd892bca1bf11354 | [
"Apache-2.0"
] | 1 | 2016-12-22T07:10:45.000Z | 2016-12-22T07:10:45.000Z | src/litedesk/lib/airwatch/device.py | litedesk/litedesk-lib-airwatch | 19c47a50d606f966497a6e24fd892bca1bf11354 | [
"Apache-2.0"
] | null | null | null | src/litedesk/lib/airwatch/device.py | litedesk/litedesk-lib-airwatch | 19c47a50d606f966497a6e24fd892bca1bf11354 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014, Deutsche Telekom AG - Laboratories (T-Labs)
#
# 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... | 32.488372 | 74 | 0.652112 |
from base import BaseObject
from app import App
class Device(BaseObject):
@classmethod
def search(cls, client, **kwargs):
endpoint = 'mdm/devices/search'
response = client.call_api('GET', endpoint, params=kwargs)
response.raise_for_status()
try:
return [
... | true | true |
1c39bc31e2a7c8c1b35471d80affab37545856b8 | 2,134 | py | Python | phonenumbers/data/region_BH.py | ayushgoel/FixGoogleContacts | e49e58db6718bef8f95b6f767241605441c7fe41 | [
"MIT"
] | 2 | 2019-02-22T05:27:22.000Z | 2020-12-30T19:33:18.000Z | phonenumbers/data/region_BH.py | ayushgoel/FixGoogleContacts | e49e58db6718bef8f95b6f767241605441c7fe41 | [
"MIT"
] | null | null | null | phonenumbers/data/region_BH.py | ayushgoel/FixGoogleContacts | e49e58db6718bef8f95b6f767241605441c7fe41 | [
"MIT"
] | null | null | null | """Auto-generated file, do not edit by hand. BH metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BH = PhoneMetadata(id='BH', country_code=973, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[136-9]\\d{7}', possible_number_pattern=... | 101.619048 | 246 | 0.741799 | from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_BH = PhoneMetadata(id='BH', country_code=973, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='[136-9]\\d{7}', possible_number_pattern='\\d{8}'),
fixed_line=PhoneNumberDesc(national_number_pa... | true | true |
1c39bc742127d4a9e7c8c6db4eb2ca4162e43bb9 | 5,727 | py | Python | pontoon/sync/tests/__init__.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | null | null | null | pontoon/sync/tests/__init__.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | null | null | null | pontoon/sync/tests/__init__.py | nanopony/pontoon | ebd342922d04df2dfbbce23ac5a15ee1e71d50fe | [
"BSD-3-Clause"
] | null | null | null | import os.path
import factory
from mock import patch, PropertyMock
from pontoon.base.models import Project
from pontoon.base.tests import (
EntityFactory,
LocaleFactory,
ProjectFactory,
RepositoryFactory,
ResourceFactory,
TestCase,
TranslationFactory,
)
from pontoon.base.utils import aware... | 31.994413 | 93 | 0.654618 | import os.path
import factory
from mock import patch, PropertyMock
from pontoon.base.models import Project
from pontoon.base.tests import (
EntityFactory,
LocaleFactory,
ProjectFactory,
RepositoryFactory,
ResourceFactory,
TestCase,
TranslationFactory,
)
from pontoon.base.utils import aware... | true | true |
1c39bd85b12944df9e3e4d4650fe72b4a9c113d5 | 211 | py | Python | Trivia.py | Plumbob/PythonDemos | fb008651ad72e5f07ded5da44a04ab996571fb4d | [
"Unlicense"
] | null | null | null | Trivia.py | Plumbob/PythonDemos | fb008651ad72e5f07ded5da44a04ab996571fb4d | [
"Unlicense"
] | null | null | null | Trivia.py | Plumbob/PythonDemos | fb008651ad72e5f07ded5da44a04ab996571fb4d | [
"Unlicense"
] | null | null | null |
def even_evens(some_list):
"""
Give a list 'some_list', return a list of only the even numbers from the
even indices of 'some_list'.
"""
return [x for x in some_list[::2] if x % 2 == 0]
| 17.583333 | 76 | 0.606635 |
def even_evens(some_list):
return [x for x in some_list[::2] if x % 2 == 0]
| true | true |
1c39bdaabf85888bdde2272e24f9b639e4b3bc26 | 4,042 | py | Python | digits/download_data/cifar10.py | dcmartin/digits | 4a16aef47226413eba232e268049678816281c7d | [
"BSD-3-Clause"
] | 1 | 2021-01-25T01:06:25.000Z | 2021-01-25T01:06:25.000Z | digits/download_data/cifar10.py | dcmartin/digits | 4a16aef47226413eba232e268049678816281c7d | [
"BSD-3-Clause"
] | null | null | null | digits/download_data/cifar10.py | dcmartin/digits | 4a16aef47226413eba232e268049678816281c7d | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
import pickle
import os
import tarfile
import PIL.Image
from .downloader import DataDownloader
class Cifar10Downloader(DataDownloader):
"""
See details about the CIFAR10 dataset here:
http://www.cs.toronto.edu/~kriz/cifar.html
"""... | 38.495238 | 113 | 0.567293 |
import pickle
import os
import tarfile
import PIL.Image
from .downloader import DataDownloader
class Cifar10Downloader(DataDownloader):
def urlList(self):
return [
'http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz',
]
def uncompressData(self):
filename = 'cifar-1... | true | true |
1c39bf2d260753f05acf235e773635b503489f9b | 328 | py | Python | core/urls.py | adankro/Mood-sensing-app | 9fe77a04c506d6bfb5f77cbd5c68d02a69758570 | [
"MIT"
] | null | null | null | core/urls.py | adankro/Mood-sensing-app | 9fe77a04c506d6bfb5f77cbd5c68d02a69758570 | [
"MIT"
] | 14 | 2020-02-11T23:12:48.000Z | 2022-03-11T23:29:00.000Z | core/urls.py | adankro/Mood-sensing-app | 9fe77a04c506d6bfb5f77cbd5c68d02a69758570 | [
"MIT"
] | 1 | 2020-07-06T03:29:57.000Z | 2020-07-06T03:29:57.000Z | from django.urls import path
from . import views
urlpatterns = [
path('Mood/', views.MoodView.as_view(), name='Mood-all'),
path('<int:user_id>', views.HappyPlacesView, name='HappyPlacesView'),
path('user/<int:userID>', views.stats, name='stats'),
#path('stats/<int:user_id>', stats, name="sta... | 29.818182 | 74 | 0.643293 | from django.urls import path
from . import views
urlpatterns = [
path('Mood/', views.MoodView.as_view(), name='Mood-all'),
path('<int:user_id>', views.HappyPlacesView, name='HappyPlacesView'),
path('user/<int:userID>', views.stats, name='stats'),
] | true | true |
1c39bfb5d105d684c875003b253f1ba0480ad5bc | 3,733 | py | Python | Tools/concat.py | ka10ryu1/keytouch_cam | a99fbb16d0c5054cf462602fb73c025924d77a8a | [
"MIT"
] | 7 | 2018-02-25T22:47:01.000Z | 2020-09-14T05:39:33.000Z | Tools/concat.py | ka10ryu1/human_delete | 042b0caacb5af31cfa9c71ae012d58e798777c8d | [
"MIT"
] | null | null | null | Tools/concat.py | ka10ryu1/human_delete | 042b0caacb5af31cfa9c71ae012d58e798777c8d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*-coding: utf-8 -*-
#
help = '複数の画像を任意の行列で結合する'
#
import os
import sys
import cv2
import argparse
import numpy as np
[sys.path.append(d) for d in ['./Tools/', '../Tools/'] if os.path.isdir(d)]
import func as F
import imgfunc as IMG
def command():
parser = argparse.ArgumentParser(descri... | 27.651852 | 82 | 0.584784 | help = '複数の画像を任意の行列で結合する'
import os
import sys
import cv2
import argparse
import numpy as np
[sys.path.append(d) for d in ['./Tools/', '../Tools/'] if os.path.isdir(d)]
import func as F
import imgfunc as IMG
def command():
parser = argparse.ArgumentParser(description=help)
parser.add_argument('jpeg', nargs=... | true | true |
1c39bfde332307ca3cad3187669e4c969cf0f51d | 320 | py | Python | clipSync/__init__.py | AravindVasudev/clip-sync | 8cf8c09687cbf1aa5db1fc95fd2e9a283b57e5ee | [
"MIT"
] | null | null | null | clipSync/__init__.py | AravindVasudev/clip-sync | 8cf8c09687cbf1aa5db1fc95fd2e9a283b57e5ee | [
"MIT"
] | null | null | null | clipSync/__init__.py | AravindVasudev/clip-sync | 8cf8c09687cbf1aa5db1fc95fd2e9a283b57e5ee | [
"MIT"
] | null | null | null | from flask import Flask
from flask_socketio import SocketIO
from tkinter import Tk
# App Instance
app = Flask(__name__)
app.config['SECRET_KEY'] = 'shamballa'
# SocketIO Init
socketio = SocketIO(app)
# tkinter window for reading clipboard
win = Tk()
win.withdraw()
from . import views
from . import clipboard_thread
| 17.777778 | 38 | 0.76875 | from flask import Flask
from flask_socketio import SocketIO
from tkinter import Tk
app = Flask(__name__)
app.config['SECRET_KEY'] = 'shamballa'
socketio = SocketIO(app)
win = Tk()
win.withdraw()
from . import views
from . import clipboard_thread
| true | true |
1c39c0426bd8361e249700059f1c06b48f11d7e8 | 41,711 | py | Python | nova/tests/unit/virt/libvirt/test_imagecache.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_imagecache.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | 5 | 2016-07-11T20:59:47.000Z | 2020-07-28T09:56:35.000Z | nova/tests/unit/virt/libvirt/test_imagecache.py | nicholaskuechler/nova | ff412c3888b234eb123161cc4e6d0d0d69c0004e | [
"Apache-2.0"
] | 3 | 2018-01-29T00:44:44.000Z | 2020-07-24T01:19:20.000Z | # Copyright 2012 Michael Still and Canonical 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
#
# ... | 41.711 | 79 | 0.598068 |
import contextlib
import hashlib
import os
import time
import mock
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import formatters
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import importutils
from six.moves import cStringIO
fro... | true | true |
1c39c1888e907fdbe3085235d0ac84a0ebe35965 | 497 | py | Python | basicdevice/migrations/0002_status.py | dave-promulgare/Affinidi-Device | 5eb9ff08eed652066e102dd49aa9cb3c2d70fdbe | [
"Apache-2.0"
] | 1 | 2021-02-10T23:50:41.000Z | 2021-02-10T23:50:41.000Z | basicdevice/migrations/0002_status.py | dave-promulgare/Affinidi-Device | 5eb9ff08eed652066e102dd49aa9cb3c2d70fdbe | [
"Apache-2.0"
] | null | null | null | basicdevice/migrations/0002_status.py | dave-promulgare/Affinidi-Device | 5eb9ff08eed652066e102dd49aa9cb3c2d70fdbe | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.10 on 2021-02-02 21:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('basicdevice', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Status',
fields=[
('i... | 23.666667 | 114 | 0.567404 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('basicdevice', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Status',
fields=[
('id', models.AutoField(auto_created=True, primary_k... | true | true |
1c39c36a39a1532ef2f99ac92d06f1d1552bc659 | 742 | py | Python | alipay/aop/api/response/AlipayMerchantItemFileUploadResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2022-03-07T06:11:10.000Z | 2022-03-07T06:11:10.000Z | alipay/aop/api/response/AlipayMerchantItemFileUploadResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayMerchantItemFileUploadResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 1 | 2021-10-05T03:01:09.000Z | 2021-10-05T03:01:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMerchantItemFileUploadResponse(AlipayResponse):
def __init__(self):
super(AlipayMerchantItemFileUploadResponse, self).__init__()
self._material_id = None
@... | 28.538462 | 109 | 0.725067 | import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayMerchantItemFileUploadResponse(AlipayResponse):
def __init__(self):
super(AlipayMerchantItemFileUploadResponse, self).__init__()
self._material_id = None
@property
def material_id(self):
re... | true | true |
1c39c3b659c75e1d8cfc2b2b467ce2ec26bdd183 | 1,671 | py | Python | UpdateOpencv2.0/AllDetection2.0.py | sujitmandal/python | 9fbb1e5f58f9ff173874941dd2adb868088bf67a | [
"MIT"
] | 1 | 2019-04-10T15:43:16.000Z | 2019-04-10T15:43:16.000Z | UpdateOpencv2.0/AllDetection2.0.py | sujitmandal/python | 9fbb1e5f58f9ff173874941dd2adb868088bf67a | [
"MIT"
] | null | null | null | UpdateOpencv2.0/AllDetection2.0.py | sujitmandal/python | 9fbb1e5f58f9ff173874941dd2adb868088bf67a | [
"MIT"
] | null | null | null | import cv2
#Github: https://github.com/sujitmandal
#This programe is create by Sujit Mandal
"""
Github: https://github.com/sujitmandal
This programe is create by Sujit Mandal
LinkedIn : https://www.linkedin.com/in/sujit-mandal-91215013a/
Facebook : https://www.facebook.com/sujit.mandal.33671748
Twitter : https://twi... | 27.85 | 94 | 0.64991 | import cv2
face = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
eye = cv2.CascadeClassifier('haarcascade_eye.xml')
video = cv2.VideoCapture(0)
first_frame = None
while True:
check, frame = video.read()
print(frame)
faces = face.detectMultiScale(frame)
eyes = eye.detectMultiScale(fr... | true | true |
1c39c3dc873b6363195497dd6c13bdd0aecff7cd | 1,248 | py | Python | src/versioningit/hook.py | jenshnielsen/versioningit | b575e300ae2ea78e283254537cffd30135ae7fe6 | [
"MIT"
] | 17 | 2021-07-05T23:41:36.000Z | 2022-03-10T14:55:24.000Z | src/versioningit/hook.py | jenshnielsen/versioningit | b575e300ae2ea78e283254537cffd30135ae7fe6 | [
"MIT"
] | 20 | 2021-07-05T23:56:09.000Z | 2022-03-14T13:04:09.000Z | src/versioningit/hook.py | jenshnielsen/versioningit | b575e300ae2ea78e283254537cffd30135ae7fe6 | [
"MIT"
] | 4 | 2021-09-04T13:24:49.000Z | 2022-03-25T19:44:19.000Z | from pathlib import Path
from typing import Any
from .core import get_version
from .errors import NoTagError, NotSdistError, NotVersioningitError
from .logging import init_logging, log
def setuptools_finalizer(dist: Any) -> None:
"""
The entry point called by setuptools to retrieve the version for a project
... | 39 | 79 | 0.672276 | from pathlib import Path
from typing import Any
from .core import get_version
from .errors import NoTagError, NotSdistError, NotVersioningitError
from .logging import init_logging, log
def setuptools_finalizer(dist: Any) -> None:
init_logging()
# root of the source tree".
PROJECT_ROOT = Path().resolve... | true | true |
1c39c3e0a5de09df35a959cf57d62098a5fe12c1 | 1,971 | py | Python | backend/project/migrations/0001_initial.py | Tim6FTN/UKS | 3cf19f014cdc7845bf0b808b97c4e05dc49b062e | [
"MIT"
] | 1 | 2021-01-10T12:34:59.000Z | 2021-01-10T12:34:59.000Z | backend/project/migrations/0001_initial.py | Tim6FTN/UKS | 3cf19f014cdc7845bf0b808b97c4e05dc49b062e | [
"MIT"
] | 37 | 2021-01-07T22:31:25.000Z | 2021-02-20T10:59:46.000Z | backend/project/migrations/0001_initial.py | Tim6FTN/UKS | 3cf19f014cdc7845bf0b808b97c4e05dc49b062e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-20 09:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('repo... | 44.795455 | 141 | 0.621005 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('repository', '0001_initial'),
]
operations ... | true | true |
1c39c4ad5cb383418629f41da5cebcb5e997f379 | 2,987 | py | Python | iqs_client/models/undefined_object.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | iqs_client/models/undefined_object.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | iqs_client/models/undefined_object.py | thomas-bc/mms-autocref | 1db6697f929a1c782c902923209389e337ec6961 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
IncQuery Server
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.12.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Undefi... | 26.433628 | 124 | 0.559759 |
import pprint
import re
import six
class UndefinedObject(object):
openapi_types = {
'unknown': 'str'
}
attribute_map = {
'unknown': 'unknown'
}
def __init__(self, unknown=None):
self._unknown = None
self.discriminator = None
if unknown is not None... | true | true |
1c39c6279e33098e6f563ad838b96d7935544f4f | 15,416 | py | Python | tests/helpers/test_dict.py | Centaurioun/PyFunceble | 59b809f3322118f7824195752c6015220738d4a0 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_dict.py | Centaurioun/PyFunceble | 59b809f3322118f7824195752c6015220738d4a0 | [
"Apache-2.0"
] | null | null | null | tests/helpers/test_dict.py | Centaurioun/PyFunceble | 59b809f3322118f7824195752c6015220738d4a0 | [
"Apache-2.0"
] | null | null | null | """
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █... | 27.528571 | 88 | 0.526207 |
import copy
import os
import tempfile
import unittest
from PyFunceble.helpers.dict import DictHelper
class TestDictHelper(unittest.TestCase):
def setUp(self) -> None:
self.test_subject = {
"Hello": "world",
"World": {"world": "hello"},
"funilrys": ["Fun", "Ilrys"],
... | true | true |
1c39c62bbe46fc73ad45448972754bd2cc90b8f4 | 2,976 | py | Python | scripts/test_retrieval_algorithms.py | liam-clink/pypret | c84e954efc12137c6b5ade4fae920d60a15d4875 | [
"MIT"
] | 36 | 2019-03-16T18:38:10.000Z | 2022-02-15T14:25:30.000Z | scripts/test_retrieval_algorithms.py | liam-clink/pypret | c84e954efc12137c6b5ade4fae920d60a15d4875 | [
"MIT"
] | 1 | 2019-06-24T21:32:14.000Z | 2019-07-03T12:46:28.000Z | scripts/test_retrieval_algorithms.py | liam-clink/pypret | c84e954efc12137c6b5ade4fae920d60a15d4875 | [
"MIT"
] | 12 | 2019-07-23T22:03:55.000Z | 2022-01-06T08:50:52.000Z | """ This script tests COPRA against a lot of different PNPS schemes
and compares it against PCGPA and ptychographic retrieval for SHG-FROG.
It reproduces the data of Fig. 4, 5 and 7 from [Geib2019]_.
Notes
-----
As we are using multiprocessing to speed up the parameter scan you may not be
able to run this script insi... | 38.153846 | 81 | 0.572581 | import path_helper
import pypret
from benchmarking import benchmark_retrieval, RetrievalResultPlot
from pathlib import Path
from concurrent import futures
configs = [
("shg-frog", "copra"),
("shg-frog", "pcgpa"),
("shg-frog", "pie"),
("pg-frog", "copra"),
("shg-tdp", "copra"),
("shg-dscan", "co... | true | true |
1c39c703ae95df60fc23f1e8f91243e265fca628 | 4,272 | py | Python | autopandas_v2/tests/engines.py | chyanju/autopandas | 16080ad12f0e8e7b0a614671aea1ed57b3fed7fe | [
"BSD-3-Clause"
] | 16 | 2019-08-13T02:49:44.000Z | 2022-02-08T03:14:34.000Z | autopandas_v2/tests/engines.py | chyanju/autopandas | 16080ad12f0e8e7b0a614671aea1ed57b3fed7fe | [
"BSD-3-Clause"
] | 2 | 2020-09-25T22:40:40.000Z | 2022-02-09T23:42:53.000Z | autopandas_v2/tests/engines.py | chyanju/autopandas | 16080ad12f0e8e7b0a614671aea1ed57b3fed7fe | [
"BSD-3-Clause"
] | 3 | 2021-07-06T10:30:36.000Z | 2022-01-11T23:21:31.000Z | import glob
import logging
import os
import unittest
from typing import List, Any
import pandas as pd
from autopandas_v2.generators.ml.networks.mocking.models import MockSelectModel, MockChainModel, MockSubsetsModel
from autopandas_v2.iospecs import IOSpec
from autopandas_v2.synthesis.search.engines.functions import ... | 33.637795 | 113 | 0.558755 | import glob
import logging
import os
import unittest
from typing import List, Any
import pandas as pd
from autopandas_v2.generators.ml.networks.mocking.models import MockSelectModel, MockChainModel, MockSubsetsModel
from autopandas_v2.iospecs import IOSpec
from autopandas_v2.synthesis.search.engines.functions import ... | true | true |
1c39c7226c0d97bf8a0631733cf56849f214b531 | 5,896 | py | Python | ask-sdk-model/ask_sdk_model/interfaces/alexa/presentation/apl/user_event.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | 2 | 2021-10-30T06:52:48.000Z | 2021-11-16T12:34:16.000Z | ask-sdk-model/ask_sdk_model/interfaces/alexa/presentation/apl/user_event.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | ask-sdk-model/ask_sdk_model/interfaces/alexa/presentation/apl/user_event.py | Signal-Kinetics/alexa-apis-for-python | abb8d3dce18a5510c48b215406ed36c024f01495 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 39.046358 | 182 | 0.627714 |
import pprint
import re import six
import typing
from enum import Enum
from ask_sdk_model.request import Request
if typing.TYPE_CHECKING:
from typing import Dict, List, Optional, Union
from datetime import datetime
class UserEvent(Request):
deserialized_types = {
'object_type': 'str',
... | true | true |
1c39c75e116fe30ffafbf9832e70de19b45788e8 | 11,505 | py | Python | discovery-provider/integration_tests/queries/test_search.py | Tenderize/audius-protocol | aa15844e3f12812fe8aaa81e2cb6e5c5fa89ff51 | [
"Apache-2.0"
] | null | null | null | discovery-provider/integration_tests/queries/test_search.py | Tenderize/audius-protocol | aa15844e3f12812fe8aaa81e2cb6e5c5fa89ff51 | [
"Apache-2.0"
] | null | null | null | discovery-provider/integration_tests/queries/test_search.py | Tenderize/audius-protocol | aa15844e3f12812fe8aaa81e2cb6e5c5fa89ff51 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from src.models import Block, Follow, Playlist, Save, SaveType, Track, User, UserBalance
from src.queries.search_queries import (
playlist_search_query,
track_search_query,
user_search_query,
)
from src.tasks.index_aggregate_user import UPDATE_AGGREGATE_USER_QUERY
from src.uti... | 28.907035 | 88 | 0.54585 | from datetime import datetime
from src.models import Block, Follow, Playlist, Save, SaveType, Track, User, UserBalance
from src.queries.search_queries import (
playlist_search_query,
track_search_query,
user_search_query,
)
from src.tasks.index_aggregate_user import UPDATE_AGGREGATE_USER_QUERY
from src.uti... | true | true |
1c39c776ae095bb77e2c8b1c26d33151d9e9f281 | 138 | py | Python | Codewars/6kyu/write-number-in-expanded-form/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codewars/6kyu/write-number-in-expanded-form/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codewars/6kyu/write-number-in-expanded-form/Python/solution1.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python - 3.6.0
expanded_form = lambda num: ' + '.join([s + '0' * (len(str(num)) - i - 1) for i, s in enumerate(str(num)) if s != '0'])
| 34.5 | 119 | 0.536232 |
expanded_form = lambda num: ' + '.join([s + '0' * (len(str(num)) - i - 1) for i, s in enumerate(str(num)) if s != '0'])
| true | true |
1c39ca5f5b2ce225491816f042cfead88503b22d | 4,299 | py | Python | lib/googlecloudsdk/command_lib/compute/tpus/util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/compute/tpus/util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/googlecloudsdk/command_lib/compute/tpus/util.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... | 36.12605 | 80 | 0.746453 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from apitools.base.py import exceptions as apitools_exceptions
from googlecloudsdk.api_lib.services import exceptions
from googlecloudsdk.api_lib.services import peering
from googlecloudsdk.api_lib.util imp... | true | true |
1c39cb12905b1cd1f69475bf120720cda699220e | 1,315 | py | Python | p1-stock-code/stock-code.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | null | null | null | p1-stock-code/stock-code.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | null | null | null | p1-stock-code/stock-code.py | cclai999/pyxl-stock | 3c0bb2f3e17f88770d16e9cb7171d56757a451b4 | [
"MIT"
] | 1 | 2020-12-27T01:55:19.000Z | 2020-12-27T01:55:19.000Z | import pandas as pd
from openpyxl import load_workbook
from tools import get_html_to_file
url1 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=1&issuetype=1&industry_code=&Page=1&chklike=Y"
url2 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=2... | 29.222222 | 136 | 0.710266 | import pandas as pd
from openpyxl import load_workbook
from tools import get_html_to_file
url1 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=1&issuetype=1&industry_code=&Page=1&chklike=Y"
url2 = "https://isin.twse.com.tw/isin/class_main.jsp?owncode=&stockname=&isincode=&market=2... | true | true |
1c39cbb5e1345dbab2efda224099029126a685d6 | 1,959 | py | Python | spectrl/envs/finite_mdp.py | keyshor/high-nash | 3ac6e09c554ec94a227f3e76756983295860d665 | [
"MIT"
] | null | null | null | spectrl/envs/finite_mdp.py | keyshor/high-nash | 3ac6e09c554ec94a227f3e76756983295860d665 | [
"MIT"
] | null | null | null | spectrl/envs/finite_mdp.py | keyshor/high-nash | 3ac6e09c554ec94a227f3e76756983295860d665 | [
"MIT"
] | null | null | null | import gym
import numpy as np
class FiniteMDP(gym.Env):
'''
Finite Multi-agent MDPs
'''
def __init__(self, transitions, start_state, num_actions, max_steps=100, rewards={}):
'''
'transitions' is a dictionary mapping joint actions to transition matrices.
Eg:- transitions[(0... | 33.20339 | 90 | 0.60388 | import gym
import numpy as np
class FiniteMDP(gym.Env):
def __init__(self, transitions, start_state, num_actions, max_steps=100, rewards={}):
self.P = transitions
self.start_state = start_state
self.rewards = rewards
self.max_steps = max_steps
self.n = len(num_actions)
... | true | true |
1c39cc563fc605a827f88d7b504a38495a6f1f3d | 3,325 | py | Python | setup.py | nardi/iocursor | 11e88cec3efb8b94d4bde4a483572a5f135175a7 | [
"MIT"
] | 3 | 2021-06-01T16:53:15.000Z | 2022-02-14T07:02:53.000Z | setup.py | nardi/iocursor | 11e88cec3efb8b94d4bde4a483572a5f135175a7 | [
"MIT"
] | null | null | null | setup.py | nardi/iocursor | 11e88cec3efb8b94d4bde4a483572a5f135175a7 | [
"MIT"
] | 1 | 2021-07-01T16:35:14.000Z | 2021-07-01T16:35:14.000Z | #!/usr/bin/env python
# coding: utf-8
import configparser
import glob
import os
import sys
import setuptools
from distutils.command.clean import clean as _clean
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.sdist import sdist as _sdist
# --- `setup.py` commands ----------... | 28.913043 | 80 | 0.583459 |
import configparser
import glob
import os
import sys
import setuptools
from distutils.command.clean import clean as _clean
from setuptools.command.build_ext import build_ext as _build_ext
from setuptools.command.sdist import sdist as _sdist
class sdist(_sdist):
def run(self):
c = configparser... | true | true |
1c39cc6db1874258fd396af5c835ea5525aa73a3 | 4,354 | py | Python | doc/source/conf.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | 4383/tobiko | f8e6916db890021fa17ddbfc5e6007a25093c8cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 32.014706 | 79 | 0.692696 |
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
TOBIKO_DIR = os.path.abspath(os.path.join(BASE_DIR, "..", ".."))
sys.path.insert(0, TOBIKO_DIR)
project = 'Tobiko'
copyright = "2019, Red Hat"
author = "Tobiko's Team"
# The version info for the project you're documenting, acts as replace... | true | true |
1c39cc78f7fc6d9dd231de1c9b2d6eebed2bd7ab | 3,627 | py | Python | official/cv/resnet/infer/ResNet152/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | official/cv/resnet/infer/ResNet152/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | official/cv/resnet/infer/ResNet152/sdk/main.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # coding=utf-8
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 34.542857 | 94 | 0.61759 |
import datetime
import json
import os
import sys
from StreamManagerApi import StreamManagerApi
from StreamManagerApi import MxDataInput
def run():
stream_manager_api = StreamManagerApi()
ret = stream_manager_api.InitManager()
if ret != 0:
print("Failed to init Stream manager, ret=%s" % str(r... | true | true |
1c39ccaa8632efa29bf1d6b281d47bd52b4b78c9 | 3,846 | py | Python | python/tvm/topi/cuda/searchsorted.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | python/tvm/topi/cuda/searchsorted.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | python/tvm/topi/cuda/searchsorted.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.339806 | 93 | 0.658346 | import tvm
from tvm import te
from .. import utils
from ..searchsorted import binary_search
def searchsorted(sorted_sequence, values, right, out_dtype="int64"):
def ir(sorted_sequence, values, indices):
ib = tvm.tir.ir_builder.create()
sorted_sequence_shape = sorted_sequence.shape
values_... | true | true |
1c39cd8c4cf42ebac589fbb1076b1761f7dbaeff | 2,060 | py | Python | cardea/fhir/Reference.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | cardea/fhir/Reference.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | cardea/fhir/Reference.py | Hector-hedb12/Cardea | 75c75f343796555f08c4511d6427efd04261a105 | [
"MIT"
] | null | null | null | from .fhirbase import fhirbase
class Reference(fhirbase):
"""
A reference from one resource to another.
Attributes:
reference: A reference to a location at which the other resource is
found. The reference may be a relative reference, in which case it is
relative to the ser... | 39.615385 | 82 | 0.647087 | from .fhirbase import fhirbase
class Reference(fhirbase):
__name__ = 'Reference'
def __init__(self, dict_values=None):
self.reference = None
self.display = None
self.identifier = None
if dict_values:
self.set_attributes(dict_values)
... | true | true |
1c39d0ba68c5aa0475565e3a4ceea547d580d482 | 895 | py | Python | netqasm/examples/apps/three_nodes/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | null | null | null | netqasm/examples/apps/three_nodes/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | null | null | null | netqasm/examples/apps/three_nodes/app_charlie.py | Doomsk/netqasm | 5d6c6ad00c4e0f9ab0ec05518cfa827675f357e7 | [
"MIT"
] | null | null | null | from netqasm.logging.glob import get_netqasm_logger
from netqasm.sdk import EPRSocket
from netqasm.sdk.external import NetQASMConnection
logger = get_netqasm_logger()
def main(app_config):
epr_socket_alice = EPRSocket(
remote_app_name="alice", epr_socket_id=0, remote_epr_socket_id=1
)
epr_socket_... | 27.96875 | 72 | 0.69162 | from netqasm.logging.glob import get_netqasm_logger
from netqasm.sdk import EPRSocket
from netqasm.sdk.external import NetQASMConnection
logger = get_netqasm_logger()
def main(app_config):
epr_socket_alice = EPRSocket(
remote_app_name="alice", epr_socket_id=0, remote_epr_socket_id=1
)
epr_socket_... | true | true |
1c39d0c50c3baca0aa302babde060b258f61c9aa | 9,066 | py | Python | multimedia/south_migrations/0022_move_media.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 19 | 2015-01-28T08:40:20.000Z | 2021-12-18T11:55:58.000Z | multimedia/south_migrations/0022_move_media.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 2 | 2015-02-09T17:03:24.000Z | 2015-04-22T17:57:45.000Z | multimedia/south_migrations/0022_move_media.py | jbittel/django-multimedia | 4ddd5e6d9f4f680e2f4f68cc3616ced8f0fc2a43 | [
"BSD-3-Clause"
] | 4 | 2015-02-02T14:05:08.000Z | 2016-09-14T00:44:55.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for audio in orm.Audio.objects.all():
old_profiles = audio.profiles.all()
... | 63.398601 | 195 | 0.539709 | from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for audio in orm.Audio.objects.all():
old_profiles = audio.profiles.all()
media = orm.... | true | true |
1c39d2ce35fa1d037a4d280d7d6f300feb05c36a | 23,359 | py | Python | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 35.179217 | 115 | 0.593176 |
import gc
import logging
import tabulate
from typing import Optional
from armi import context
from armi import interfaces
from armi import mpiActions
from armi import runLog
from armi.reactor.composites import ArmiObject
try:
import psutil
_havePsutil = True
except ImportError:
runLog.warning(
... | true | true |
1c39d3c48cb80c4e4808e18b8ba1a690569e1369 | 2,070 | py | Python | gammapy/spectrum/tests/test_results.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | gammapy/spectrum/tests/test_results.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | gammapy/spectrum/tests/test_results.py | gabemery/gammapy | 99e5c5d38e4920dddd7bca41fb1539ccda8bea2d | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import astropy.units as u
from ...utils.testing import assert_quantity_allclose
from ...utils.testing import requires_dependency, requires_data
from ..mod... | 39.807692 | 83 | 0.647343 | from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import astropy.units as u
from ...utils.testing import assert_quantity_allclose
from ...utils.testing import requires_dependency, requires_data
from ..models import PowerLaw
from .. import SpectrumObservation, Spectrum... | true | true |
1c39d3f944c9c5d2cf7faae8bf17a3e63cac88c4 | 3,703 | py | Python | models/layers/split_att_conv2d.py | HotaekHan/classification-pytorch | 41185301709280c78ce1e51e3c9bc5c4d23d6443 | [
"MIT"
] | 5 | 2020-11-19T02:03:55.000Z | 2021-07-13T12:26:05.000Z | models/layers/split_att_conv2d.py | HotaekHan/classification-pytorch | 41185301709280c78ce1e51e3c9bc5c4d23d6443 | [
"MIT"
] | 1 | 2020-11-23T13:21:20.000Z | 2020-12-01T11:45:09.000Z | models/layers/split_att_conv2d.py | HotaekHan/classification-pytorch | 41185301709280c78ce1e51e3c9bc5c4d23d6443 | [
"MIT"
] | 1 | 2021-07-13T13:04:16.000Z | 2021-07-13T13:04:16.000Z | """Split-Attention"""
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Conv2d, Module, Linear, BatchNorm2d, ReLU
from torch.nn.modules.utils import _pair
__all__ = ['SplAtConv2d']
class SplAtConv2d(Module):
"""Split-Attention Conv2d
"""
def __init__(self, in_channels... | 36.303922 | 103 | 0.572239 |
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn import Conv2d, Module, Linear, BatchNorm2d, ReLU
from torch.nn.modules.utils import _pair
__all__ = ['SplAtConv2d']
class SplAtConv2d(Module):
def __init__(self, in_channels, channels, kernel_size, stride=(1, 1), padding=(0, 0),
... | true | true |
1c39d450e97701185e55969fad7b43f942a77878 | 76 | py | Python | ABC038/ABC038f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC038/ABC038f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC038/ABC038f.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | #ABC038f
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| 15.2 | 28 | 0.789474 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| true | true |
1c39d47124c3ced2c1f626a08e83d57f514ab838 | 623 | py | Python | app/core/migrations/0004_auto_20190113_2046.py | jazziesf/scout-travel-api | 09cb599d869e0a67b94bc58803822774fa658c65 | [
"MIT"
] | null | null | null | app/core/migrations/0004_auto_20190113_2046.py | jazziesf/scout-travel-api | 09cb599d869e0a67b94bc58803822774fa658c65 | [
"MIT"
] | null | null | null | app/core/migrations/0004_auto_20190113_2046.py | jazziesf/scout-travel-api | 09cb599d869e0a67b94bc58803822774fa658c65 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.5 on 2019-01-13 20:46
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0003_pin_likes'),
]
operations = [
migrations.AddField(
model_name='pin',
name=... | 23.961538 | 86 | 0.585875 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('core', '0003_pin_likes'),
]
operations = [
migrations.AddField(
model_name='pin',
name='dish',
field=models.CharField(defau... | true | true |
1c39d5bf3f5bb26180c473498b62eef86a13aa48 | 3,077 | py | Python | src/conversor.py | xandao6/url-to-desktop | 750dc0db9717e0e50e3af3f2c1ac8fb7047cb375 | [
"MIT"
] | 1 | 2020-02-23T13:47:19.000Z | 2020-02-23T13:47:19.000Z | src/conversor.py | xandao6/url-to-desktop | 750dc0db9717e0e50e3af3f2c1ac8fb7047cb375 | [
"MIT"
] | null | null | null | src/conversor.py | xandao6/url-to-desktop | 750dc0db9717e0e50e3af3f2c1ac8fb7047cb375 | [
"MIT"
] | 1 | 2020-01-20T05:11:14.000Z | 2020-01-20T05:11:14.000Z | import os, shutil, fire
from typing import List, Optional
from pyfiglet import Figlet
def main(path: Optional[str] = None) -> None:
__print_logo('url - desktop')
fire.Fire(__convert)
def __convert(path: Optional[str] = None) -> None:
if path is None:
path = os.getcwd()
try:
url_list... | 29.028302 | 86 | 0.653884 | import os, shutil, fire
from typing import List, Optional
from pyfiglet import Figlet
def main(path: Optional[str] = None) -> None:
__print_logo('url - desktop')
fire.Fire(__convert)
def __convert(path: Optional[str] = None) -> None:
if path is None:
path = os.getcwd()
try:
url_list... | true | true |
1c39d5cea93358a6f1f58385273c38feaecd9d64 | 2,746 | py | Python | cogs/counting.py | rssnyder/discord-bot | 0430515abf49e94529c064574f23bf9d48fcf6e1 | [
"MIT"
] | 1 | 2022-03-31T20:30:55.000Z | 2022-03-31T20:30:55.000Z | cogs/counting.py | rssnyder/discord-bot | 0430515abf49e94529c064574f23bf9d48fcf6e1 | [
"MIT"
] | null | null | null | cogs/counting.py | rssnyder/discord-bot | 0430515abf49e94529c064574f23bf9d48fcf6e1 | [
"MIT"
] | null | null | null | from discord.ext import commands
class Counting(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('Counting cog ready')
@commands.Cog.listener()
async def on_message(self, message):
# Don't do this in... | 34.759494 | 125 | 0.557174 | from discord.ext import commands
class Counting(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_ready(self):
print('Counting cog ready')
@commands.Cog.listener()
async def on_message(self, message):
if not mes... | true | true |
1c39d6ee5aa7792bea311f30b618e62f61c84356 | 1,476 | py | Python | python-examples/classical-mds-image.py | amazing89/mathtoolbox | 8904bb06ced2ac501594f9574ef1ba3454b8e38e | [
"MIT"
] | 1 | 2020-02-01T03:39:24.000Z | 2020-02-01T03:39:24.000Z | python-examples/classical-mds-image.py | amazing89/mathtoolbox | 8904bb06ced2ac501594f9574ef1ba3454b8e38e | [
"MIT"
] | null | null | null | python-examples/classical-mds-image.py | amazing89/mathtoolbox | 8904bb06ced2ac501594f9574ef1ba3454b8e38e | [
"MIT"
] | null | null | null | import pymathtoolbox
import numpy as np
import matplotlib.pyplot as plt
import os
import seaborn as sns
from PIL import Image
from scipy.spatial.distance import pdist, squareform
# Load an image
asset_dir_path = os.path.dirname(os.path.abspath(__file__)) + "/assets"
image = Image.open(asset_dir_path + "/autumn-leaves.... | 25.894737 | 72 | 0.732385 | import pymathtoolbox
import numpy as np
import matplotlib.pyplot as plt
import os
import seaborn as sns
from PIL import Image
from scipy.spatial.distance import pdist, squareform
asset_dir_path = os.path.dirname(os.path.abspath(__file__)) + "/assets"
image = Image.open(asset_dir_path + "/autumn-leaves.jpg")
resized_im... | true | true |
1c39d8b39e4b2b44f37d76664f9ffbf7dbb1a736 | 540 | py | Python | Python/Para Checker.py | bhupendpatil/Practice | 9663b3f41e359787cbbd04aedb3db3c605c6ec8e | [
"MIT"
] | 1 | 2020-12-23T06:22:29.000Z | 2020-12-23T06:22:29.000Z | Python/Para Checker.py | bhupendpatil/Practice | 9663b3f41e359787cbbd04aedb3db3c605c6ec8e | [
"MIT"
] | 8 | 2020-06-18T19:32:39.000Z | 2022-03-11T11:37:07.000Z | Python/Para Checker.py | bhupendpatil/Practice | 9663b3f41e359787cbbd04aedb3db3c605c6ec8e | [
"MIT"
] | 1 | 2021-01-19T00:16:34.000Z | 2021-01-19T00:16:34.000Z | from Properties import Stack
def par_checker(symbol_string):
s = Stack()
balanced = True
index = 0
while index < len(symbol_string) and balanced:
symbol = symbol_string[index]
if symbol=='(':
s.push(symbol)
else:
if s.is_empty():
balanced ... | 21.6 | 50 | 0.522222 | from Properties import Stack
def par_checker(symbol_string):
s = Stack()
balanced = True
index = 0
while index < len(symbol_string) and balanced:
symbol = symbol_string[index]
if symbol=='(':
s.push(symbol)
else:
if s.is_empty():
balanced ... | true | true |
1c39d8bec0f0297cd94594c0cd15fb0cea38d8c7 | 2,032 | py | Python | Code/venv/src/Account/admin.py | WebMetadataRetrieval/15-Web_Metadata_Retrieval | 96a9c8869ccc5429c4de9e97d37705bbb9e19c5b | [
"Apache-2.0"
] | null | null | null | Code/venv/src/Account/admin.py | WebMetadataRetrieval/15-Web_Metadata_Retrieval | 96a9c8869ccc5429c4de9e97d37705bbb9e19c5b | [
"Apache-2.0"
] | 38 | 2021-04-01T18:09:31.000Z | 2021-05-08T17:27:03.000Z | Code/venv/src/Account/admin.py | WebMetadataRetrieval/15-Web_Metadata_Retrieval | 96a9c8869ccc5429c4de9e97d37705bbb9e19c5b | [
"Apache-2.0"
] | 3 | 2021-04-16T07:25:11.000Z | 2022-01-29T10:24:33.000Z | from django.contrib import admin
from django import forms
from .models import UserAccount
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.models import Group
class UserCreationForm(forms.ModelForm):
password1 = forms.CharFie... | 29.449275 | 127 | 0.662402 | from django.contrib import admin
from django import forms
from .models import UserAccount
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.contrib.auth.models import Group
class UserCreationForm(forms.ModelForm):
password1 = forms.CharFie... | true | true |
1c39d90848805f177260a317dc93179e49b0e348 | 846 | py | Python | test/test_cart_coupon.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | test/test_cart_coupon.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | test/test_cart_coupon.py | gstingy/uc_python_api | 9a0bd3f6e63f616586681518e44fe37c6bae2bba | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
UltraCart Rest API V2
UltraCart REST API Version 2
OpenAPI spec version: 2.0.0
Contact: support@ultracart.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import ultracart
f... | 18.8 | 79 | 0.680851 |
from __future__ import absolute_import
import os
import sys
import unittest
import ultracart
from ultracart.rest import ApiException
from ultracart.models.cart_coupon import CartCoupon
class TestCartCoupon(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testC... | true | true |
1c39d9f362d75c3f11fa331666751886a38a5eeb | 1,930 | py | Python | Source/GridWorldDrivingDQNMain.py | claytonkanderson/SimplyRL | 3e808f519f174d081c80c04a8adba88cf93c9c9d | [
"MIT"
] | null | null | null | Source/GridWorldDrivingDQNMain.py | claytonkanderson/SimplyRL | 3e808f519f174d081c80c04a8adba88cf93c9c9d | [
"MIT"
] | null | null | null | Source/GridWorldDrivingDQNMain.py | claytonkanderson/SimplyRL | 3e808f519f174d081c80c04a8adba88cf93c9c9d | [
"MIT"
] | null | null | null | import numpy as np
import gym
from time import time
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
from keras.callbacks import TensorBoard
from rl.agents.dqn import DQNAgent
from rl.policy import BoltzmannQPolicy
from rl.memory import Sequenti... | 33.275862 | 109 | 0.774093 | import numpy as np
import gym
from time import time
from keras.models import Sequential
from keras.layers import Dense, Activation, Flatten
from keras.optimizers import Adam
from keras.callbacks import TensorBoard
from rl.agents.dqn import DQNAgent
from rl.policy import BoltzmannQPolicy
from rl.memory import Sequenti... | true | true |
1c39da935d7fec5f8dd0559596ea48273ebc07a6 | 3,864 | py | Python | src/SurvivalCalculator/calculator/views.py | computer-geek64/covid19-survival-calculator | c52879ca562220bdfd5634f3d83ed09df18ea771 | [
"MIT"
] | 3 | 2020-03-31T17:01:46.000Z | 2020-06-25T02:57:10.000Z | src/SurvivalCalculator/calculator/views.py | varunlakshmanan/covid19-survival-calculator | 33b447f8dc99ed5060a117b68b362403ec0b6e38 | [
"MIT"
] | null | null | null | src/SurvivalCalculator/calculator/views.py | varunlakshmanan/covid19-survival-calculator | 33b447f8dc99ed5060a117b68b362403ec0b6e38 | [
"MIT"
] | 2 | 2020-03-30T17:05:26.000Z | 2020-03-30T17:49:02.000Z | from django.shortcuts import render
from django.http import HttpResponse
import os
import sys
import json
import math
import numpy as np
import requests
import pandas as pd
from subprocess import Popen, PIPE
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
from data import dataset
from model... | 40.25 | 184 | 0.709886 | from django.shortcuts import render
from django.http import HttpResponse
import os
import sys
import json
import math
import numpy as np
import requests
import pandas as pd
from subprocess import Popen, PIPE
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
from data import dataset
from model... | true | true |
1c39db80e816be69da88de2b0f5d099c1655af9d | 75 | py | Python | tests/test_water.py | fladi/qraz | 7e2fb4b9dc1decb3f5aa390990c02091d4326ef8 | [
"BSD-2-Clause"
] | null | null | null | tests/test_water.py | fladi/qraz | 7e2fb4b9dc1decb3f5aa390990c02091d4326ef8 | [
"BSD-2-Clause"
] | null | null | null | tests/test_water.py | fladi/qraz | 7e2fb4b9dc1decb3f5aa390990c02091d4326ef8 | [
"BSD-2-Clause"
] | null | null | null |
import water
def test_main():
assert water # use your library here
| 10.714286 | 41 | 0.693333 |
import water
def test_main():
assert water | true | true |
1c39dc85d475051c67b7ea6d510ba498bd7b66ba | 30,533 | py | Python | dual_annealing.py | website-fingerprinting/minipatch | 682d86c0eca5331a8c001e83003cf79b5d4b1a78 | [
"MIT"
] | null | null | null | dual_annealing.py | website-fingerprinting/minipatch | 682d86c0eca5331a8c001e83003cf79b5d4b1a78 | [
"MIT"
] | null | null | null | dual_annealing.py | website-fingerprinting/minipatch | 682d86c0eca5331a8c001e83003cf79b5d4b1a78 | [
"MIT"
] | null | null | null | # Dual Annealing implementation.
# Copyright (c) 2018 Sylvain Gubian <sylvain.gubian@pmi.com>,
# Yang Xiang <yang.xiang@pmi.com>
# Author: Sylvain Gubian, Yang Xiang, PMP S.A.
"""
A slight modification to Scipy's implementation of simulated annealing.
Fix bug in implementation of formula in p. 398 of reference [2] (li... | 43.125706 | 91 | 0.616219 |
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.optimize import OptimizeResult
from scipy.optimize import minimize
from scipy.special import gammaln
from scipy._lib._util import check_random_state
__all__ = ['dual_annealing']
class VisitingDistribution(object):
... | true | true |
1c39dccda5ab4c3452bd526b158464ab5404df36 | 3,169 | py | Python | splay_tree_trace.py | andribas404/splay_benchmark | 1ba2fe4d715b25db806c0b241c6adadd8d442a77 | [
"MIT"
] | null | null | null | splay_tree_trace.py | andribas404/splay_benchmark | 1ba2fe4d715b25db806c0b241c6adadd8d442a77 | [
"MIT"
] | null | null | null | splay_tree_trace.py | andribas404/splay_benchmark | 1ba2fe4d715b25db806c0b241c6adadd8d442a77 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Trace splay tree."""
import inspect
import logging
import os
import pygraphviz as pgv
from splay_tree_orig import SplayTree
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
os.makedirs("graph", exist_ok=True)
def for_all_methods(decora... | 25.556452 | 144 | 0.577469 |
import inspect
import logging
import os
import pygraphviz as pgv
from splay_tree_orig import SplayTree
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
os.makedirs("graph", exist_ok=True)
def for_all_methods(decorator):
def decorate(cls):
members = inspect.getmembers(cls,... | true | true |
1c39dd072a1ea1d4d97dd6b71d7de7375b7976e5 | 50,281 | py | Python | hdl21/tests/test_hdl21.py | dan-fritchman/Hdl21 | adb7787b137f2bea720e576a3027314a1dcd0947 | [
"BSD-3-Clause"
] | 1 | 2022-02-19T18:48:45.000Z | 2022-02-19T18:48:45.000Z | hdl21/tests/test_hdl21.py | dan-fritchman/Hdl21 | adb7787b137f2bea720e576a3027314a1dcd0947 | [
"BSD-3-Clause"
] | 13 | 2021-07-21T17:48:49.000Z | 2022-01-31T23:12:08.000Z | hdl21/tests/test_hdl21.py | dan-fritchman/Hdl21 | adb7787b137f2bea720e576a3027314a1dcd0947 | [
"BSD-3-Clause"
] | null | null | null | """
# hdl21 Unit Tests
"""
import sys, copy, pytest
from io import StringIO
from types import SimpleNamespace
from enum import Enum, EnumMeta, auto
from textwrap import dedent
# Import the PUT (package under test)
import hdl21 as h
def test_version():
assert h.__version__ == "0.2.0"
def test_module1():
... | 27.902886 | 99 | 0.622879 |
import sys, copy, pytest
from io import StringIO
from types import SimpleNamespace
from enum import Enum, EnumMeta, auto
from textwrap import dedent
import hdl21 as h
def test_version():
assert h.__version__ == "0.2.0"
def test_module1():
@h.module
class M1:
a = h.Input()
b = h.Output... | true | true |
1c39dd1ce758aca3ce61780686afa04337bd16b5 | 3,328 | py | Python | SCRM/cloud_plugin/urls.py | prakashar11/secure-cloud-native-fabric | 8a6c51d8744c33afb8edc1455caaccb011f7e1de | [
"Apache-2.0"
] | 2 | 2019-07-30T05:53:36.000Z | 2019-10-26T20:11:52.000Z | SCRM/cloud_plugin/urls.py | prakashar11/secure-cloud-native-fabric | 8a6c51d8744c33afb8edc1455caaccb011f7e1de | [
"Apache-2.0"
] | 6 | 2019-06-17T05:22:32.000Z | 2021-06-10T21:36:22.000Z | SCRM/cloud_plugin/urls.py | prakashar11/secure-cloud-native-fabric | 8a6c51d8744c33afb8edc1455caaccb011f7e1de | [
"Apache-2.0"
] | 3 | 2019-10-26T21:20:02.000Z | 2020-06-01T14:25:17.000Z | #
# Copyright 2019 Altran. 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 ... | 36.977778 | 151 | 0.684495 | from django.conf.urls import url
from .views import MonitoredObject, Policies,VpcList, CrispPostureGraph, CrispPostureMap, Auditor, RunAuditor, PolicyTemplate, PolicyInstances, Clouds
from rest_framework.urlpatterns import format_suffix_patterns
from . import views
urlpatterns = [
url(r'^index/$', views.index, na... | true | true |
1c39dd2dd92e8e1ee3914fc886a249531e1665e8 | 11,894 | py | Python | skimage/feature/tests/test_corner.py | atemysemicolon/scikit-image | a48cf5822f9539c6602b9327c18253aed14fa692 | [
"BSD-3-Clause"
] | 1 | 2016-01-26T06:14:58.000Z | 2016-01-26T06:14:58.000Z | skimage/feature/tests/test_corner.py | atemysemicolon/scikit-image | a48cf5822f9539c6602b9327c18253aed14fa692 | [
"BSD-3-Clause"
] | null | null | null | skimage/feature/tests/test_corner.py | atemysemicolon/scikit-image | a48cf5822f9539c6602b9327c18253aed14fa692 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from numpy.testing import (assert_array_equal, assert_raises,
assert_almost_equal)
from skimage import data
from skimage import img_as_float
from skimage.color import rgb2gray
from skimage.morphology import octagon
from skimage.feature import (corner_moravec, corner_harri... | 35.610778 | 78 | 0.523962 | import numpy as np
from numpy.testing import (assert_array_equal, assert_raises,
assert_almost_equal)
from skimage import data
from skimage import img_as_float
from skimage.color import rgb2gray
from skimage.morphology import octagon
from skimage.feature import (corner_moravec, corner_harri... | true | true |
1c39ddc0de426696ab88abf4bdf8f1734b66de8b | 3,769 | py | Python | setup.py | NickleDave/williams | bfc362e82dfa5785116e11142e90e7f6908255b0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | NickleDave/williams | bfc362e82dfa5785116e11142e90e7f6908255b0 | [
"BSD-3-Clause"
] | null | null | null | setup.py | NickleDave/williams | bfc362e82dfa5785116e11142e90e7f6908255b0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# adopted from Kenneth Reitz
# https://github.com/kennethreitz/setup.py
# released under MIT license
# (https://github.com/kennethreitz/setup.py/blob/master/LICENSE)
# Note: To use the 'upload' functionality of this file, you must:
# $ pip install twine
import io
impor... | 27.311594 | 81 | 0.647652 |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
NAME = 'williams'
DESCRIPTION = 'experiments with stochastic semilinear units and REINFORCE'
URL = 'https://github.com/NickleDave/williams'
EMAIL = 'dnicho4@emory.edu'
AUTHOR = 'David Nicholson'
REQUIRES_P... | true | true |
1c39de8304e631a1f28c5979e046c66e978f553d | 841 | py | Python | triplinker/accounts/migrations/0010_auto_20201009_1212.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | triplinker/accounts/migrations/0010_auto_20201009_1212.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | triplinker/accounts/migrations/0010_auto_20201009_1212.py | GonnaFlyMethod/triplinker | f4189e499ad48fd9102dd2211a8884078136eae9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.8 on 2020-10-09 12:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0009_userphotogallery'),
]
operations = [
migrations.CreateModel(
name='PersonalQualities',
fields=[
... | 28.033333 | 114 | 0.557669 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0009_userphotogallery'),
]
operations = [
migrations.CreateModel(
name='PersonalQualities',
fields=[
('id', models.AutoField(auto_create... | true | true |
1c39dea512b95a1df786c32d360d7cdf2afe45c9 | 7,698 | py | Python | lib/googlecloudsdk/command_lib/concepts/dependency_managers.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/concepts/dependency_managers.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/command_lib/concepts/dependency_managers.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2018 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 requir... | 34.675676 | 78 | 0.681865 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import functools
from googlecloudsdk.calliope.concepts import deps as deps_lib
from googlecloudsdk.command_lib.concepts import base
from googlecloudsdk.command_lib.concepts import exceptions
from googleclo... | true | true |
1c39defa19c7d3ded9d65cfde924d0d825e870ad | 10,956 | py | Python | utils/performance.py | mmaguero/NCRFpp | 65486d0160f24349751eafc307fa72be9f586b6e | [
"Apache-2.0"
] | null | null | null | utils/performance.py | mmaguero/NCRFpp | 65486d0160f24349751eafc307fa72be9f586b6e | [
"Apache-2.0"
] | null | null | null | utils/performance.py | mmaguero/NCRFpp | 65486d0160f24349751eafc307fa72be9f586b6e | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
"""
Development Version: Python 3.5.1
Author: Benjamin Cordier
Description: Module For Performance
Assessment of Classification Task
License: BSD 3 Clause
--
Copyright 2018 Benjamin Cordier
Redistribution and use in source and binary forms, with or without
modification, are permitted provi... | 45.841004 | 172 | 0.580869 |
import math
from collections import OrderedDict
class Performance(object):
__metrics = {
"statistics" : {
"accuracy" : lambda tp, tn, fp, fn: (tp + tn) / (tp + tn + fp + fn) if (tp + tn) > 0 else 0.0,
"f1score" : lambda tp, tn, fp, fn: (2 * tp) /... | true | true |
1c39e00af8e8ccde2480fb3d4ba00de71126bf44 | 18,212 | py | Python | reordering.py | dawn-ico/grid-experiments | 882d73d2dc2f3dadeeb71dde6731c21397f37092 | [
"MIT"
] | null | null | null | reordering.py | dawn-ico/grid-experiments | 882d73d2dc2f3dadeeb71dde6731c21397f37092 | [
"MIT"
] | null | null | null | reordering.py | dawn-ico/grid-experiments | 882d73d2dc2f3dadeeb71dde6731c21397f37092 | [
"MIT"
] | null | null | null | from grid_types import Grid, DEVICE_MISSING_VALUE, GridSet
from location_type import LocationType
from schemas import *
import numpy as np
import netCDF4
from functools import cmp_to_key
NaN = float("nan")
def apply_permutation(
ncf, perm: np.ndarray, schema: GridScheme, location_type: LocationType
) -> None:
... | 35.992095 | 119 | 0.527729 | from grid_types import Grid, DEVICE_MISSING_VALUE, GridSet
from location_type import LocationType
from schemas import *
import numpy as np
import netCDF4
from functools import cmp_to_key
NaN = float("nan")
def apply_permutation(
ncf, perm: np.ndarray, schema: GridScheme, location_type: LocationType
) -> None:
... | true | true |
1c39e059a56049c710059e652ade0e3185fb9417 | 1,253 | py | Python | examples/fastapi_app.py | euri10/starsessions | 6bd258a0f94d30b6ec4a8da41910f97c5dabbe54 | [
"MIT"
] | 31 | 2021-07-15T13:00:06.000Z | 2022-03-17T08:25:52.000Z | examples/fastapi_app.py | euri10/starsessions | 6bd258a0f94d30b6ec4a8da41910f97c5dabbe54 | [
"MIT"
] | 6 | 2021-09-01T15:25:20.000Z | 2022-03-13T07:29:19.000Z | examples/fastapi_app.py | euri10/starsessions | 6bd258a0f94d30b6ec4a8da41910f97c5dabbe54 | [
"MIT"
] | 5 | 2021-08-19T04:46:35.000Z | 2022-03-09T15:27:22.000Z | """This examples demonstrates integration with FastAPI
This example requires `fastapi` to be installed:
> pip install fastapi
Usage:
> uvicorn examples.fastapi_app:app
Access localhost:8000/set to set test session data, and
access localhost:8000/clean to clear session data
"""
import datetime
import typing as t
from... | 25.571429 | 73 | 0.727853 | import datetime
import typing as t
from fastapi import FastAPI
from fastapi.requests import Request
from fastapi.responses import JSONResponse, RedirectResponse
from starsessions import SessionMiddleware
app = FastAPI()
app.add_middleware(SessionMiddleware, secret_key='secret', autoload=True)
@app.get('/', respons... | true | true |
1c39e0a1a6217c4f10bf7fdf63a9f7ab4623c775 | 658 | py | Python | blender/arm/logicnode/math/LN_vector_clamp_to_size.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/math/LN_vector_clamp_to_size.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/math/LN_vector_clamp_to_size.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | from arm.logicnode.arm_nodes import *
class VectorClampToSizeNode(ArmLogicTreeNode):
"""Use to keep the vector value inside the defined range."""
bl_idname = 'LNVectorClampToSizeNode'
bl_label = 'Vector Clamp To Size'
arm_version = 1
def init(self, context):
super(VectorClampToSizeNode, se... | 38.705882 | 86 | 0.709726 | from arm.logicnode.arm_nodes import *
class VectorClampToSizeNode(ArmLogicTreeNode):
bl_idname = 'LNVectorClampToSizeNode'
bl_label = 'Vector Clamp To Size'
arm_version = 1
def init(self, context):
super(VectorClampToSizeNode, self).init(context)
self.add_input('NodeSocketVector', 'Vec... | true | true |
1c39e11671ad141a09092bdd7164187b5921998b | 7,217 | py | Python | influxdb_client/domain/slack_notification_rule_base.py | MASIFAYUB/influxdb-client-python | a067fa5670a6fbc600db2ac4e54e29e1b7124998 | [
"MIT"
] | null | null | null | influxdb_client/domain/slack_notification_rule_base.py | MASIFAYUB/influxdb-client-python | a067fa5670a6fbc600db2ac4e54e29e1b7124998 | [
"MIT"
] | null | null | null | influxdb_client/domain/slack_notification_rule_base.py | MASIFAYUB/influxdb-client-python | a067fa5670a6fbc600db2ac4e54e29e1b7124998 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
InfluxDB OSS API Service.
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa:... | 34.864734 | 539 | 0.608979 |
import pprint
import re
import six
from influxdb_client.domain.notification_rule_discriminator import NotificationRuleDiscriminator
class SlackNotificationRuleBase(NotificationRuleDiscriminator):
openapi_types = {
'type': 'str',
'channel': 'str',
'message_template': 'str',
'l... | true | true |
1c39e1f46642f562a9a58cee4cfedac1f0c43963 | 762 | py | Python | useGoogleTranslate.py | babebeebaboo/WordCookiesLIST | 5909bdd6667ed3d18f6e008c2562d3483e609c7f | [
"MIT"
] | 1 | 2021-07-07T21:07:56.000Z | 2021-07-07T21:07:56.000Z | useGoogleTranslate.py | babebeebaboo/WordCookiesLIST | 5909bdd6667ed3d18f6e008c2562d3483e609c7f | [
"MIT"
] | null | null | null | useGoogleTranslate.py | babebeebaboo/WordCookiesLIST | 5909bdd6667ed3d18f6e008c2562d3483e609c7f | [
"MIT"
] | null | null | null | from googletrans import Translator
import random
import operator as op
import math
import sys
import itertools
def run():
length = int(input("Length(-1 to quit): "))
if length == -1 : sys.exit()
translator = Translator()
translateShuffleWord = []
shuffleWord = []
ans = []
for i in itertools... | 25.4 | 60 | 0.60105 | from googletrans import Translator
import random
import operator as op
import math
import sys
import itertools
def run():
length = int(input("Length(-1 to quit): "))
if length == -1 : sys.exit()
translator = Translator()
translateShuffleWord = []
shuffleWord = []
ans = []
for i in itertools... | true | true |
1c39e2c26a297f9fffddc0d096b983f1e7b2c225 | 9,455 | py | Python | bindings/python/capstone/sparc_const.py | arizvisa/capstone | e1998a28c4cacbf70f3d4ca148aa0eac23213475 | [
"BSD-3-Clause"
] | null | null | null | bindings/python/capstone/sparc_const.py | arizvisa/capstone | e1998a28c4cacbf70f3d4ca148aa0eac23213475 | [
"BSD-3-Clause"
] | null | null | null | bindings/python/capstone/sparc_const.py | arizvisa/capstone | e1998a28c4cacbf70f3d4ca148aa0eac23213475 | [
"BSD-3-Clause"
] | null | null | null | # For Capstone Engine. AUTO-GENERATED FILE, DO NOT EDIT [sparc_const.py]
# Enums corresponding to Sparc condition codes, both icc's and fcc's.
SPARC_CC_INVALID = 0
# Integer condition codes
SPARC_CC_ICC_A = 8+256
SPARC_CC_ICC_N = 0+256
SPARC_CC_ICC_NE = 9+256
SPARC_CC_ICC_E = 1+256
SPARC_CC_ICC_G = 10+256
SPARC_CC_I... | 21.247191 | 72 | 0.807403 |
SPARC_CC_INVALID = 0
SPARC_CC_ICC_A = 8+256
SPARC_CC_ICC_N = 0+256
SPARC_CC_ICC_NE = 9+256
SPARC_CC_ICC_E = 1+256
SPARC_CC_ICC_G = 10+256
SPARC_CC_ICC_LE = 2+256
SPARC_CC_ICC_GE = 11+256
SPARC_CC_ICC_L = 3+256
SPARC_CC_ICC_GU = 12+256
SPARC_CC_ICC_LEU = 4+256
SPARC_CC_ICC_CC = 13+256
SPARC_CC_ICC_CS = 5+256
SPARC_CC... | true | true |
1c39e2fab3f7eb9a227fdeba5b0d6ed471103be8 | 473 | py | Python | content/posts/faking-python-imports/code/main.py | NathanVaughn/blog.nathanv.me-hugo | 381955333a497914b1e1d1e26db37ccbda86923e | [
"MIT"
] | 1 | 2020-01-30T16:02:38.000Z | 2020-01-30T16:02:38.000Z | content/posts/faking-python-imports/code/main.py | NathanVaughn/blog.nathanv.me-hugo | 381955333a497914b1e1d1e26db37ccbda86923e | [
"MIT"
] | 14 | 2019-09-16T05:51:28.000Z | 2021-10-15T00:16:56.000Z | content/posts/faking-python-imports/code/main.py | NathanVaughn/blog.nathanv.me-hugo | 381955333a497914b1e1d1e26db37ccbda86923e | [
"MIT"
] | null | null | null | import sys
import c
VAL = 20
print("The real value of c.func is: {}".format(c.func(VAL)))
# ideally, you would have never imported this module
sys.modules.pop("c")
# create reference to real import so we don't lose it
a_real_import = __import__("a")
a_fake_import = __import__("b")
# fake the import
sys.modules["a"... | 22.52381 | 60 | 0.712474 | import sys
import c
VAL = 20
print("The real value of c.func is: {}".format(c.func(VAL)))
sys.modules.pop("c")
a_real_import = __import__("a")
a_fake_import = __import__("b")
# fake the import
sys.modules["a"] = a_fake_import
import c
# set it back to the real value
sys.modules["a"] = a_real_import
print("The fak... | true | true |
1c39e4542a0969dd1be70c3e2bcf2c5197b76976 | 7,474 | py | Python | bot/cogs/help.py | Kobu/MasarykBOT | 9a6b6a026b4f39afaca5ab509c90f6da09e169a0 | [
"MIT"
] | 13 | 2019-09-14T16:51:35.000Z | 2021-03-03T22:20:44.000Z | bot/cogs/help.py | Kobu/MasarykBOT | 9a6b6a026b4f39afaca5ab509c90f6da09e169a0 | [
"MIT"
] | 15 | 2019-09-29T19:25:31.000Z | 2022-02-13T16:40:45.000Z | bot/cogs/help.py | Kobu/MasarykBOT | 9a6b6a026b4f39afaca5ab509c90f6da09e169a0 | [
"MIT"
] | 15 | 2019-09-18T10:50:59.000Z | 2022-02-11T20:55:19.000Z | import asyncio
import itertools
import discord
from discord.ext import commands
from .utils.paginator import Pages
class HelpPaginator(Pages):
def __init__(self, help_command, ctx, entries, *, per_page=4):
super().__init__(ctx, entries=entries, per_page=per_page)
self.reaction_emojis.append(
... | 35.932692 | 92 | 0.61734 | import asyncio
import itertools
import discord
from discord.ext import commands
from .utils.paginator import Pages
class HelpPaginator(Pages):
def __init__(self, help_command, ctx, entries, *, per_page=4):
super().__init__(ctx, entries=entries, per_page=per_page)
self.reaction_emojis.append(
... | true | true |
1c39e4d37682c58f6b0bd26a132a4bb2379313a9 | 1,069 | py | Python | mmpose/apis/__init__.py | jiangtaoo2333/mmpose | 00e12ddc224b492e9c903df96d09aa04c3f2a5f3 | [
"Apache-2.0"
] | null | null | null | mmpose/apis/__init__.py | jiangtaoo2333/mmpose | 00e12ddc224b492e9c903df96d09aa04c3f2a5f3 | [
"Apache-2.0"
] | null | null | null | mmpose/apis/__init__.py | jiangtaoo2333/mmpose | 00e12ddc224b492e9c903df96d09aa04c3f2a5f3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .inference import (inference_bottom_up_pose_model,RMinference_top_down_pose_model,
inference_top_down_pose_model, init_pose_model,
process_mmdet_results, vis_pose_result)
from .inference_3d import (extract_pose_sequence... | 53.45 | 87 | 0.755847 | from .inference import (inference_bottom_up_pose_model,RMinference_top_down_pose_model,
inference_top_down_pose_model, init_pose_model,
process_mmdet_results, vis_pose_result)
from .inference_3d import (extract_pose_sequence, inference_interhand_3d_model,
... | true | true |
1c39e519c33b9ae45a9b9f1373ec1c644ae313eb | 12,152 | py | Python | jenkinsapi_tests/unittests/test_plugins.py | ward-peng/jenkinsapi | f77259d36f3cb45fd82e79d9bf8fca9dda9f6966 | [
"MIT"
] | null | null | null | jenkinsapi_tests/unittests/test_plugins.py | ward-peng/jenkinsapi | f77259d36f3cb45fd82e79d9bf8fca9dda9f6966 | [
"MIT"
] | 1 | 2019-07-03T11:16:39.000Z | 2019-07-03T11:16:39.000Z | jenkinsapi_tests/unittests/test_plugins.py | TwistoPayments/jenkinsapi | aa3e23289b666feb02e1bde89aa2f75ca14cbd56 | [
"MIT"
] | null | null | null | """
jenkinsapi_tests.test_plugins
"""
import mock
# To run unittests on python 2.6 please use unittest2 library
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
from StringIO import StringIO # python2
except ImportError:
from io import BytesIO as StringIO # python3
import zi... | 38.334385 | 79 | 0.563611 | import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
from StringIO import StringIO except ImportError:
from io import BytesIO as StringIO import zipfile
from jenkinsapi.jenkins import Requester
from jenkinsapi.jenkins import Jenkins
from jenkinsapi.plugins import Pl... | true | true |
1c39e6b7bfa4026293ba7f48cff72b75babd8ec7 | 15,846 | py | Python | elasticsearch/_sync/client/nodes.py | stevepentland/elasticsearch-py | 5a512a8f822ce2eff93fbc75f3629973427519bd | [
"Apache-2.0"
] | null | null | null | elasticsearch/_sync/client/nodes.py | stevepentland/elasticsearch-py | 5a512a8f822ce2eff93fbc75f3629973427519bd | [
"Apache-2.0"
] | null | null | null | elasticsearch/_sync/client/nodes.py | stevepentland/elasticsearch-py | 5a512a8f822ce2eff93fbc75f3629973427519bd | [
"Apache-2.0"
] | null | null | null | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | 44.139276 | 123 | 0.629181 |
from typing import Any, Dict, List, Optional, Union
from elastic_transport import ObjectApiResponse, TextApiResponse
from ._base import NamespacedClient
from .utils import SKIP_IN_PATH, _quote, _rewrite_parameters
class NodesClient(NamespacedClient):
@_rewrite_parameters()
def hot_threads(
self,
... | true | true |
1c39e6bae743ac99b3e22d020d76719ff4de7e4c | 569 | py | Python | src/conf.py | mix2zeta/social-d | 923cc2b224470e940ae6ac9cc712adb685c1b216 | [
"MIT"
] | null | null | null | src/conf.py | mix2zeta/social-d | 923cc2b224470e940ae6ac9cc712adb685c1b216 | [
"MIT"
] | null | null | null | src/conf.py | mix2zeta/social-d | 923cc2b224470e940ae6ac9cc712adb685c1b216 | [
"MIT"
] | 1 | 2021-03-11T09:07:11.000Z | 2021-03-11T09:07:11.000Z | from dataclasses import dataclass
import os
@dataclass
class settings:
@dataclass
class DATABASE:
PGHOST: str = os.environ["PGHOST"]
PGPORT: str = os.environ["PGPORT"]
PGDBNAME: str = os.environ["PGDBNAME"]
PGUSER: str = os.environ["PGUSER"]
PGPASSWORD: str = os.environ... | 27.095238 | 50 | 0.650264 | from dataclasses import dataclass
import os
@dataclass
class settings:
@dataclass
class DATABASE:
PGHOST: str = os.environ["PGHOST"]
PGPORT: str = os.environ["PGPORT"]
PGDBNAME: str = os.environ["PGDBNAME"]
PGUSER: str = os.environ["PGUSER"]
PGPASSWORD: str = os.environ... | true | true |
1c39e826c505c7f544a6b4004a45c4c5d6122363 | 1,567 | py | Python | mime/envs/table_envs/tower_env.py | nikwl/mime-release | 2f3d09d1d04bee2505bbb416f960c90f73f4346c | [
"MIT"
] | 13 | 2020-06-24T10:52:28.000Z | 2021-07-23T03:05:27.000Z | mime/envs/table_envs/tower_env.py | nikwl/mime-release | 2f3d09d1d04bee2505bbb416f960c90f73f4346c | [
"MIT"
] | 1 | 2020-08-18T12:45:15.000Z | 2020-08-18T12:45:15.000Z | mime/envs/table_envs/tower_env.py | nikwl/mime-release | 2f3d09d1d04bee2505bbb416f960c90f73f4346c | [
"MIT"
] | 3 | 2020-09-09T18:17:46.000Z | 2021-09-06T09:43:45.000Z | from .tower_scene import TowerScene
from .table_env import TableEnv
from .table_cam_env import TableCamEnv
import numpy as np
class TowerEnv(TableEnv):
""" Tower environment, trajectory observation, linear tool control """
def __init__(self, **kwargs):
scene = TowerScene(**kwargs)
super(Tower... | 32.645833 | 104 | 0.644544 | from .tower_scene import TowerScene
from .table_env import TableEnv
from .table_cam_env import TableCamEnv
import numpy as np
class TowerEnv(TableEnv):
def __init__(self, **kwargs):
scene = TowerScene(**kwargs)
super(TowerEnv, self).__init__(scene)
self.observation_space = self._make_dic... | true | true |
1c39e9326c83dea15da67c3d3d62970f9952f41d | 10,185 | py | Python | tests/test_packet_builder.py | hansroh/aioquic | 491869f9faab05d8bcbcbabb2a4f9244e0cd06f9 | [
"BSD-3-Clause"
] | null | null | null | tests/test_packet_builder.py | hansroh/aioquic | 491869f9faab05d8bcbcbabb2a4f9244e0cd06f9 | [
"BSD-3-Clause"
] | null | null | null | tests/test_packet_builder.py | hansroh/aioquic | 491869f9faab05d8bcbcbabb2a4f9244e0cd06f9 | [
"BSD-3-Clause"
] | 2 | 2019-11-05T22:55:03.000Z | 2020-06-12T12:57:36.000Z | from unittest import TestCase
from aioquic.quic.crypto import CryptoPair
from aioquic.quic.packet import (
PACKET_TYPE_HANDSHAKE,
PACKET_TYPE_INITIAL,
PACKET_TYPE_ONE_RTT,
QuicFrameType,
QuicProtocolVersion,
)
from aioquic.quic.packet_builder import (
QuicPacketBuilder,
QuicPacketBuilderSto... | 33.725166 | 88 | 0.606578 | from unittest import TestCase
from aioquic.quic.crypto import CryptoPair
from aioquic.quic.packet import (
PACKET_TYPE_HANDSHAKE,
PACKET_TYPE_INITIAL,
PACKET_TYPE_ONE_RTT,
QuicFrameType,
QuicProtocolVersion,
)
from aioquic.quic.packet_builder import (
QuicPacketBuilder,
QuicPacketBuilderSto... | true | true |
1c39e94973e2435380a45b7fbc88ce61e57de438 | 747 | py | Python | post/migrations/0001_initial.py | zmojtaba/Django-code-post | 1aa8ea60080239258ae5f1ca3f7facd6d548b2d9 | [
"MIT"
] | null | null | null | post/migrations/0001_initial.py | zmojtaba/Django-code-post | 1aa8ea60080239258ae5f1ca3f7facd6d548b2d9 | [
"MIT"
] | null | null | null | post/migrations/0001_initial.py | zmojtaba/Django-code-post | 1aa8ea60080239258ae5f1ca3f7facd6d548b2d9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-11-13 15:21
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', mode... | 28.730769 | 114 | 0.572959 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True... | true | true |
1c39e9fb9b8cf85d0e162ed57e110e82d4a13824 | 28,196 | py | Python | csv2bufr/__init__.py | tomkralidis/CSV2BUFR | ba7ce4ed2bb41e42fcb9d03f10049ffc6a2073f8 | [
"Apache-2.0"
] | null | null | null | csv2bufr/__init__.py | tomkralidis/CSV2BUFR | ba7ce4ed2bb41e42fcb9d03f10049ffc6a2073f8 | [
"Apache-2.0"
] | null | null | null | csv2bufr/__init__.py | tomkralidis/CSV2BUFR | ba7ce4ed2bb41e42fcb9d03f10049ffc6a2073f8 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this fi... | 39.161111 | 123 | 0.533586 |
__version__ = "0.1.0"
import csv
from datetime import timezone, datetime
import hashlib
from io import StringIO, BytesIO
import json
import logging
import os.path
from typing import Any, Iterator, Union
from eccodes import (codes_bufr_new_from_samples,
codes_set_array, codes_set, codes_get_nativ... | true | true |
1c39ea212f29f4b670366b9a6e4ef3ba23026a48 | 2,112 | py | Python | tests/models/symbol/alarm_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 5 | 2016-08-23T17:52:22.000Z | 2019-05-16T08:45:30.000Z | tests/models/symbol/alarm_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 2 | 2016-11-10T05:30:21.000Z | 2019-04-05T15:03:37.000Z | tests/models/symbol/alarm_test.py | NetApp/santricity-webapi-pythonsdk | 1d3df4a00561192f4cdcdd1890f4d27547ed2de2 | [
"BSD-3-Clause-Clear"
] | 7 | 2016-08-25T16:11:44.000Z | 2021-02-22T05:31:25.000Z | #!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions... | 55.578947 | 845 | 0.766098 |
import unittest
from netapp.santricity.models.symbol.alarm import Alarm
class AlarmTest(unittest.TestCase):
def test_alarm(self):
alarm_obj = Alarm()
self.assertNotEqual(alarm_obj, None)
| true | true |
1c39eb03b62b8f90c8a9a5f1726780d591b4195b | 3,416 | py | Python | tests/test_optimizers.py | Javicadserres/dnetworks | ff648a24dbc6d882c0986feb9c23549d30a9c1e8 | [
"MIT"
] | 1 | 2021-02-07T22:47:11.000Z | 2021-02-07T22:47:11.000Z | tests/test_optimizers.py | Javicadserres/dnetworks | ff648a24dbc6d882c0986feb9c23549d30a9c1e8 | [
"MIT"
] | 1 | 2021-01-30T23:37:24.000Z | 2021-02-07T21:06:30.000Z | tests/test_optimizers.py | Javicadserres/DNet | 173f9dfa35ae1cff8dbeec3c1d24cb00990b41a6 | [
"MIT"
] | null | null | null | import numpy as np
import dnetworks
from dnetworks import SGD, RMSprop, Adam
from .test_utils import test_parameters_optimizers
def test_sgd():
"""
Tests Stochastic gradient descent optimization class.
"""
weights, bias, dW, db = test_parameters_optimizers()
expected_weights = np.array(
... | 32.533333 | 75 | 0.661007 | import numpy as np
import dnetworks
from dnetworks import SGD, RMSprop, Adam
from .test_utils import test_parameters_optimizers
def test_sgd():
weights, bias, dW, db = test_parameters_optimizers()
expected_weights = np.array(
[[-0.17310385, -0.87734562, 0.04230592],
[ 0.58351704, -1.... | true | true |
1c39eb79a723b7c27a77ce7f7e120981453c52eb | 4,175 | py | Python | venv/lib/python3.8/site-packages/tests/test.py | julio9246/hg-poker-api | 56805601bc26bf8bb80e05235ae22a59a174af09 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/tests/test.py | julio9246/hg-poker-api | 56805601bc26bf8bb80e05235ae22a59a174af09 | [
"Apache-2.0"
] | null | null | null | venv/lib/python3.8/site-packages/tests/test.py | julio9246/hg-poker-api | 56805601bc26bf8bb80e05235ae22a59a174af09 | [
"Apache-2.0"
] | null | null | null | from py_postgresql_wrapper.configuration import Configuration
from py_postgresql_wrapper.database import Database, Page
Configuration.instance(configuration_file='configuration.json')
def test_create_table():
with Database() as database:
database.execute('''
drop table if exists test
... | 31.870229 | 124 | 0.621078 | from py_postgresql_wrapper.configuration import Configuration
from py_postgresql_wrapper.database import Database, Page
Configuration.instance(configuration_file='configuration.json')
def test_create_table():
with Database() as database:
database.execute('''
drop table if exists test
... | true | true |
1c39ebdbdc6d584b05bc200ab2e7204acc597dc9 | 14,241 | py | Python | discovery-infra/start_discovery.py | nmagnezi/assisted-test-infra | a31dc4350d77681038a16c05d9a1e09fa992578a | [
"Apache-2.0"
] | null | null | null | discovery-infra/start_discovery.py | nmagnezi/assisted-test-infra | a31dc4350d77681038a16c05d9a1e09fa992578a | [
"Apache-2.0"
] | null | null | null | discovery-infra/start_discovery.py | nmagnezi/assisted-test-infra | a31dc4350d77681038a16c05d9a1e09fa992578a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import argparse
import dns.resolver
import ipaddress
import json
import os
import pprint
import time
import uuid
from distutils.dir_util import copy_tree
from pathlib import Path
import bm_inventory_api
import consts
import install_cluster
import utils
import waiting
from lo... | 33.508235 | 118 | 0.649884 |
import argparse
import dns.resolver
import ipaddress
import json
import os
import pprint
import time
import uuid
from distutils.dir_util import copy_tree
from pathlib import Path
import bm_inventory_api
import consts
import install_cluster
import utils
import waiting
from logger import log
def _create_ip_address_li... | true | true |
1c39ed4d45a3b5b0ec6dda5a6a04cced4f458431 | 4,998 | py | Python | functions/get_Proposals.py | GuillaumeBalezo/SOD-python | c54566d25e01b252815fbc613a8d0af1c77818b6 | [
"MIT"
] | null | null | null | functions/get_Proposals.py | GuillaumeBalezo/SOD-python | c54566d25e01b252815fbc613a8d0af1c77818b6 | [
"MIT"
] | null | null | null | functions/get_Proposals.py | GuillaumeBalezo/SOD-python | c54566d25e01b252815fbc613a8d0af1c77818b6 | [
"MIT"
] | null | null | null | # Functions for generating the proposal set for optimization
#
# Jianming Zhang, Stan Sclaroff, Zhe Lin, Xiaohui Shen,
# Brian Price and Radomír Mech. "Unconstrained Salient
# Object Detection via Proposal Subset Optimization."
# CVPR, 2016.
# Code written by Guillaume Balezo, 2020
import numpy as np
from scipy import... | 35.956835 | 143 | 0.622449 | # Object Detection via Proposal Subset Optimization."
import numpy as np
from scipy import cluster
import cv2
from tensorflow.keras.applications.vgg16 import preprocess_input
from tensorflow.keras.preprocessing.image import load_img
from functions.utils import get_iou_float, get_roi_bbox
def get_proposals(I_batch, ne... | true | true |
1c39ee0d09d309601976177d3ee3b77136688f28 | 598 | gyp | Python | Dependencies/gyp-master/test/link-objects/link-objects.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/link-objects/link-objects.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/link-objects/link-objects.gyp | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | # Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'link-objects',
'type': 'executable',
'actions': [
{
'action_name': 'build ext... | 23.92 | 73 | 0.4699 |
{
'targets': [
{
'target_name': 'link-objects',
'type': 'executable',
'actions': [
{
'action_name': 'build extra object',
'inputs': ['extra.c'],
'outputs': ['extra.o'],
'action': ['gcc', '-o', 'extra.o', '-c', 'extra.c'],
'pr... | true | true |
1c39ee4c86ec9922e58fdf773cb6aa7bd3757d51 | 26 | py | Python | btd6_memory_info/generated/UnityEngine/PlayerLoop/Initialization/initialization.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/PlayerLoop/Initialization/initialization.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/PlayerLoop/Initialization/initialization.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Initialization: pass | 26 | 26 | 0.884615 | class Initialization: pass | true | true |
1c39eff48d75c5db6921826a3a317ebc0b7bbe05 | 8,176 | py | Python | test/functional/feature_part_smsgpaidfee.py | empower-network/empower | 3b63fbfe394574855d176262d604060f49ad77c1 | [
"MIT"
] | 2 | 2019-06-26T23:49:53.000Z | 2019-08-13T06:49:56.000Z | test/functional/feature_part_smsgpaidfee.py | empower-network/empower | 3b63fbfe394574855d176262d604060f49ad77c1 | [
"MIT"
] | null | null | null | test/functional/feature_part_smsgpaidfee.py | empower-network/empower | 3b63fbfe394574855d176262d604060f49ad77c1 | [
"MIT"
] | 4 | 2019-08-07T04:36:40.000Z | 2021-07-07T03:21:31.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Particl Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import struct
import copy
from test_framework.test_empower import EmpowerTestFramework
from test_framewo... | 38.566038 | 201 | 0.603229 |
import struct
import copy
from test_framework.test_empower import EmpowerTestFramework
from test_framework.util import connect_nodes, assert_raises_rpc_error
def getvarint(bb, ofs=0):
i = bb[ofs] & 0x7F
nb = 1
ofs += 1
while (bb[ofs-1] & 0x80):
i += (bb[ofs] & 0x7F) << (7 * nb)
ofs +... | true | true |
1c39f11b3ba73675d5f201c56b4c1885141547f8 | 1,668 | py | Python | googlevoice/tests.py | nathanhere/pygooglevoice | d5662f6d9fb2e023e75553044bc5bfae0be61815 | [
"BSD-3-Clause"
] | 156 | 2015-01-07T00:34:33.000Z | 2022-03-13T01:14:53.000Z | googlevoice/tests.py | nathanhere/pygooglevoice | d5662f6d9fb2e023e75553044bc5bfae0be61815 | [
"BSD-3-Clause"
] | 51 | 2015-02-06T14:58:39.000Z | 2021-10-01T23:00:13.000Z | googlevoice/tests.py | nathanhere/pygooglevoice | d5662f6d9fb2e023e75553044bc5bfae0be61815 | [
"BSD-3-Clause"
] | 94 | 2015-02-06T18:44:48.000Z | 2022-02-10T01:29:34.000Z | import os
from unittest import TestCase, main
from six.moves import input
from googlevoice import Voice
from googlevoice import conf
class VoiceTest(TestCase):
voice = Voice()
voice.login()
outgoing = input('Outgoing number (blank to ignore call tests): ')
forwarding = None
if outgoing:
... | 26.0625 | 70 | 0.63789 | import os
from unittest import TestCase, main
from six.moves import input
from googlevoice import Voice
from googlevoice import conf
class VoiceTest(TestCase):
voice = Voice()
voice.login()
outgoing = input('Outgoing number (blank to ignore call tests): ')
forwarding = None
if outgoing:
... | true | true |
1c39f121bfc197bc668023b153d241ed81092a0a | 1,090 | py | Python | Wardies/urls.py | HabeshaQueen/Awards | 956fad404d9910660266eb8e1819418b78a788b6 | [
"Unlicense"
] | null | null | null | Wardies/urls.py | HabeshaQueen/Awards | 956fad404d9910660266eb8e1819418b78a788b6 | [
"Unlicense"
] | 2 | 2021-03-19T00:53:00.000Z | 2021-06-08T19:56:23.000Z | Wardies/urls.py | HabeshaQueen/Awards | 956fad404d9910660266eb8e1819418b78a788b6 | [
"Unlicense"
] | null | null | null | """Wardies URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | 35.16129 | 79 | 0.700917 | from django.conf.urls import url,include
from django.contrib import admin
from django.contrib.auth import views
from rest_framework.authtoken.views import obtain_auth_token
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('Wards.urls')),
url(r'^accounts/', include('registration.backends.s... | true | true |
1c39f1537f68410a285118d7a096bbcbbb42619e | 1,357 | py | Python | CONFidence CTF 2014/Main event/Crypto Machine/solution/exploit.py | IMULMUL/ctf-tasks | 9c1549c71aa5fc876f3a46751de226320dc879af | [
"Apache-2.0"
] | 581 | 2019-02-20T08:53:36.000Z | 2022-03-20T13:29:29.000Z | CONFidence CTF 2014/Main event/Crypto Machine/solution/exploit.py | Ma3k4H3d/ctf-tasks | 67b3564307a20a9175bcf695ce9643fb80d4652f | [
"Apache-2.0"
] | null | null | null | CONFidence CTF 2014/Main event/Crypto Machine/solution/exploit.py | Ma3k4H3d/ctf-tasks | 67b3564307a20a9175bcf695ce9643fb80d4652f | [
"Apache-2.0"
] | 61 | 2019-02-20T10:57:42.000Z | 2021-07-02T06:53:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Filename: exploit.py
# Author: Mateusz Jurczyk
# Task: Crypto Machine
# Competition: CONFidence CTF 2014
# Category: Software exploitation
# Scoring: 200 pts (medium difficulty)
# Number of solves: 0 out of 11... | 24.232143 | 73 | 0.619749 |
import struct
import socket
import telnetlib
import time
def dw(x):
return struct.pack("<H", x)
def dd(x):
return struct.pack("<I", x)
def dq(x):
return struct.pack("<Q", x)
def main():
s = socket.socket()
s.connect(("127.0.0.1", 1337))
data = "Hello world"
s.send(dq(0x800000... | true | true |
1c39f1f3573625b65fb6b63b7c9c5f1b016fc439 | 1,838 | py | Python | package/spack-r-affycontam/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-r-affycontam/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-r-affycontam/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 44.829268 | 128 | 0.673014 | from spack import *
class RAffycontam(RPackage):
homepage = "https://www.bioconductor.org/packages/affyContam/"
url = "https://git.bioconductor.org/packages/affyContam"
version('1.34.0', git='https://git.bioconductor.org/packages/affyContam', commit='03529f26d059c19e069cdda358dbf7789b6d4c40')
... | true | true |
1c39f2d3d02b95bc196458142e48edfd8407d931 | 7,545 | py | Python | policy/td3.py | dkkim93/gumbel-rl-gridworld | 902352ed3e10b551472f5c28933864ca17f82e12 | [
"MIT"
] | 4 | 2019-07-20T02:46:54.000Z | 2021-03-09T13:07:27.000Z | policy/td3.py | Nedaned/gumbel-marl-gridworld | 2ec86bc6cf7c16d5ef0368c9dc4a83062d3d86e3 | [
"MIT"
] | null | null | null | policy/td3.py | Nedaned/gumbel-marl-gridworld | 2ec86bc6cf7c16d5ef0368c9dc4a83062d3d86e3 | [
"MIT"
] | 2 | 2020-09-28T16:05:32.000Z | 2021-03-15T13:15:14.000Z | """Modified Twin Delayed Deep Deterministic Policy Gradients (TD3)
TD3 Ref: https://github.com/sfujim/TD3
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from misc.utils import onehot_from_logits, gumbel_softmax
device = torch.device("cuda" if torch.cuda.is_available() else "c... | 39.502618 | 106 | 0.60729 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from misc.utils import onehot_from_logits, gumbel_softmax
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class Actor(nn.Module):
def __init__(self, actor_input_dim, actor_output_dim, n_hidden, n_action, n... | true | true |
1c39f33f152b69d3caa02ce9ce7545ca11e23004 | 1,814 | py | Python | setup.py | OpenPeerPower/supervisor | 39a3226041caa34b2dabb54f76d8e88c06d50155 | [
"Apache-2.0"
] | 1 | 2021-11-19T12:03:03.000Z | 2021-11-19T12:03:03.000Z | setup.py | OpenPeerPower/supervisor | 39a3226041caa34b2dabb54f76d8e88c06d50155 | [
"Apache-2.0"
] | null | null | null | setup.py | OpenPeerPower/supervisor | 39a3226041caa34b2dabb54f76d8e88c06d50155 | [
"Apache-2.0"
] | null | null | null | """Open Peer Power Supervisor setup."""
from setuptools import setup
from supervisor.const import SUPERVISOR_VERSION
setup(
name="Supervisor",
version=SUPERVISOR_VERSION,
license="BSD License",
author="The Open Peer Power Authors",
author_email="hello@openpeerpower.io",
url="https://openpeerpo... | 32.981818 | 87 | 0.627343 | from setuptools import setup
from supervisor.const import SUPERVISOR_VERSION
setup(
name="Supervisor",
version=SUPERVISOR_VERSION,
license="BSD License",
author="The Open Peer Power Authors",
author_email="hello@openpeerpower.io",
url="https://openpeerpower.io/",
description=("Open-source ... | true | true |
1c39f57ebadec3283331504a168a0ad14f3c8d8c | 2,055 | py | Python | src/source_wkpd/wiki_source_obj.py | Aluriak/24hducode2016 | 629a3225c5a426d3deb472d67f0e0091904d1547 | [
"Unlicense"
] | null | null | null | src/source_wkpd/wiki_source_obj.py | Aluriak/24hducode2016 | 629a3225c5a426d3deb472d67f0e0091904d1547 | [
"Unlicense"
] | null | null | null | src/source_wkpd/wiki_source_obj.py | Aluriak/24hducode2016 | 629a3225c5a426d3deb472d67f0e0091904d1547 | [
"Unlicense"
] | null | null | null | """
Definition of a source than adds Wikipédia data.
"""
from src.default import *
from src.source import Source
#import src.wkpd.wikipedia_parse as wkp
from src.source_wkpd import wikipedia_parse as wkp
class WikiSource(Source):
"""docstring de class"""
def __init__(self):
self.funny_keys = set(... | 31.136364 | 77 | 0.569343 |
from src.default import *
from src.source import Source
from src.source_wkpd import wikipedia_parse as wkp
class WikiSource(Source):
def __init__(self):
self.funny_keys = set()
def enrichment(self, data_dict):
if FIELD_NAME in data_dict:... | true | true |
1c39f727dd39651a1793e6825b30540d3352e9a7 | 26,609 | py | Python | koku/masu/database/aws_report_db_accessor.py | bsquizz/koku | 386dd6ca4a4fd1b50790a929acc81d2dc245a91c | [
"Apache-2.0"
] | null | null | null | koku/masu/database/aws_report_db_accessor.py | bsquizz/koku | 386dd6ca4a4fd1b50790a929acc81d2dc245a91c | [
"Apache-2.0"
] | null | null | null | koku/masu/database/aws_report_db_accessor.py | bsquizz/koku | 386dd6ca4a4fd1b50790a929acc81d2dc245a91c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Database accessor for report data."""
import json
import logging
import pkgutil
import uuid
from dateutil.parser import parse
from django.conf import settings
from django.db import connection
from django.db.models import F
from jinjasql import ... | 44.127695 | 120 | 0.655605 | import json
import logging
import pkgutil
import uuid
from dateutil.parser import parse
from django.conf import settings
from django.db import connection
from django.db.models import F
from jinjasql import JinjaSql
from tenant_schemas.utils import schema_context
from trino.exceptions import TrinoExternalError
from ap... | true | true |
1c39f85d98024e1f191b3e92b15dd3b3e349b5e1 | 8,767 | py | Python | tests/providers_test.py | Asjidkalam/studio | 5a4f2bbd6a2e3508d740404b0177f21c0c412f6e | [
"Apache-2.0"
] | null | null | null | tests/providers_test.py | Asjidkalam/studio | 5a4f2bbd6a2e3508d740404b0177f21c0c412f6e | [
"Apache-2.0"
] | 1 | 2021-02-08T15:42:00.000Z | 2021-02-08T15:42:00.000Z | tests/providers_test.py | Asjidkalam/studio | 5a4f2bbd6a2e3508d740404b0177f21c0c412f6e | [
"Apache-2.0"
] | 1 | 2021-02-08T15:38:56.000Z | 2021-02-08T15:38:56.000Z | import unittest
import inspect
import yaml
import uuid
import os
import time
import six
import shutil
from studio import model
from studio.firebase_provider import FirebaseProvider
from studio.postgres_provider import PostgresProvider
from studio.s3_provider import S3Provider
from studio.auth import remove_all_keys
fr... | 34.789683 | 77 | 0.639557 | import unittest
import inspect
import yaml
import uuid
import os
import time
import six
import shutil
from studio import model
from studio.firebase_provider import FirebaseProvider
from studio.postgres_provider import PostgresProvider
from studio.s3_provider import S3Provider
from studio.auth import remove_all_keys
fr... | true | true |
1c39fa63b000568faf65b90c206d0fb5ea691a09 | 784 | py | Python | services/backend/app/api/auth.py | miguelalb/resume-portal-fastapi | 286f732510925c5ad3760ca2af82098ed78e0dd9 | [
"BSD-3-Clause"
] | 1 | 2022-02-28T02:29:02.000Z | 2022-02-28T02:29:02.000Z | services/backend/app/api/auth.py | miguelalb/resume-portal-fastapi | 286f732510925c5ad3760ca2af82098ed78e0dd9 | [
"BSD-3-Clause"
] | null | null | null | services/backend/app/api/auth.py | miguelalb/resume-portal-fastapi | 286f732510925c5ad3760ca2af82098ed78e0dd9 | [
"BSD-3-Clause"
] | null | null | null | from app import crud, schemas
from app.dependencies import get_db
from app.security import authenticate_user, create_access_token
from fastapi import APIRouter, Depends, status
from sqlalchemy.orm import Session
router = APIRouter()
@router.post("/login")
async def login(user_in: schemas.UserLogin, db: Session = Dep... | 34.086957 | 81 | 0.769133 | from app import crud, schemas
from app.dependencies import get_db
from app.security import authenticate_user, create_access_token
from fastapi import APIRouter, Depends, status
from sqlalchemy.orm import Session
router = APIRouter()
@router.post("/login")
async def login(user_in: schemas.UserLogin, db: Session = Dep... | true | true |
1c39fa755029bf8e012024a8e85eda8529fb046e | 8,984 | py | Python | dataset/clip_generator.py | yuananf/Voice-Cloning-App | 5996f971232fd8056cd2514b196df44bffef0d34 | [
"BSD-3-Clause"
] | null | null | null | dataset/clip_generator.py | yuananf/Voice-Cloning-App | 5996f971232fd8056cd2514b196df44bffef0d34 | [
"BSD-3-Clause"
] | null | null | null | dataset/clip_generator.py | yuananf/Voice-Cloning-App | 5996f971232fd8056cd2514b196df44bffef0d34 | [
"BSD-3-Clause"
] | 1 | 2021-07-22T08:29:12.000Z | 2021-07-22T08:29:12.000Z | import argparse
import os
import logging
import json
import uuid
import shutil
from pathlib import Path
from pydub import AudioSegment
import dataset.forced_alignment.align as align
from dataset.forced_alignment.search import FuzzySearch
from dataset.forced_alignment.audio import DEFAULT_RATE
from dataset.audio_proces... | 33.901887 | 114 | 0.675534 | import argparse
import os
import logging
import json
import uuid
import shutil
from pathlib import Path
from pydub import AudioSegment
import dataset.forced_alignment.align as align
from dataset.forced_alignment.search import FuzzySearch
from dataset.forced_alignment.audio import DEFAULT_RATE
from dataset.audio_proces... | true | true |
1c39fba6acb33be18e0143c0ffd889f24a117da6 | 4,404 | py | Python | src/pymortests/sylvester.py | weslowrie/pymor | badb5078b2394162d04a1ebfefe9034b889dac64 | [
"Unlicense"
] | 1 | 2020-12-31T18:45:48.000Z | 2020-12-31T18:45:48.000Z | src/pymortests/sylvester.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | 4 | 2022-03-17T10:07:38.000Z | 2022-03-30T12:41:06.000Z | src/pymortests/sylvester.py | TreeerT/pymor | e8b18d2d4c4b5998f0bd84f6728e365e0693b753 | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import numpy as np
import scipy.linalg as spla
import scipy.sparse as sps
from pymor.algorithms.s... | 26.214286 | 77 | 0.585831 |
import numpy as np
import scipy.linalg as spla
import scipy.sparse as sps
from pymor.algorithms.sylvester import solve_sylv_schur
from pymor.operators.numpy import NumpyMatrixOperator
import pytest
n_list = [100, 1000]
r_list = [1, 10, 20]
m_list = [1, 2]
p_list = [1, 2]
def fro_norm(A):
if not sps.issparse(... | true | true |
1c39fe76c1f399b2f771ca5be27723a225538a27 | 8,347 | py | Python | docs/source/conf.py | GabrielFritz/DTCR-Retail | e961cb5230c940318eb022a7fee2f0058780e284 | [
"MIT"
] | null | null | null | docs/source/conf.py | GabrielFritz/DTCR-Retail | e961cb5230c940318eb022a7fee2f0058780e284 | [
"MIT"
] | null | null | null | docs/source/conf.py | GabrielFritz/DTCR-Retail | e961cb5230c940318eb022a7fee2f0058780e284 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018-2019 QuantumBlack Visual Analytics Limited
#
# 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/... | 32.352713 | 81 | 0.677848 |
import re
from kedro.cli.utils import find_stylesheets
from recommonmark.transform import AutoStructify
from ts_clustering import __version__ as release
project = "ts_clustering"
copyright = "2018-2019, QuantumBlack Visual Analytics Limited"
author = "QuantumBlack"
version = re.match(r"^([0-9]+\.[0-9]+).*", rel... | true | true |
1c39feaeae94c0bc499563a7804647f96374a2a2 | 1,905 | py | Python | pyeto/_check.py | gcamargo1/PyETo | 2dbbdecad04fdd25976beefe3953062cb3f04064 | [
"BSD-3-Clause"
] | 1 | 2018-12-17T10:57:05.000Z | 2018-12-17T10:57:05.000Z | pyeto/_check.py | mwheels/PyETo | fa4f78ada2b1de9f7e8c10648f0a58baa6d79bd3 | [
"BSD-3-Clause"
] | null | null | null | pyeto/_check.py | mwheels/PyETo | fa4f78ada2b1de9f7e8c10648f0a58baa6d79bd3 | [
"BSD-3-Clause"
] | null | null | null | """
Internal validation functions.
:copyright: (c) 2015 by Mark Richards.
:license: BSD 3-Clause, see LICENSE.txt for more details.
"""
from pyeto.convert import deg2rad
# Internal constants
# Latitude
_MINLAT_RADIANS = deg2rad(-90.0)
_MAXLAT_RADIANS = deg2rad(90.0)
# Solar declination
_MINSOLDEC_RADIANS = deg2rad(-... | 27.214286 | 78 | 0.649344 | from pyeto.convert import deg2rad
_MINLAT_RADIANS = deg2rad(-90.0)
_MAXLAT_RADIANS = deg2rad(90.0)
_MINSOLDEC_RADIANS = deg2rad(-23.5)
_MAXSOLDEC_RADIANS = deg2rad(23.5)
_MINSHA_RADIANS = 0.0
_MAXSHA_RADIANS = deg2rad(180)
def check_day_hours(hours, arg_name):
if not 0 <= hours <= 24:
raise ValueError(... | true | true |
1c39ffe2f7f5a6174766372a64e6a4f384c8b2d1 | 6,931 | py | Python | salted/input_handler.py | RuedigerVoigt/salted | 97886014b7a582d943758d65307db2bc03197f6e | [
"Apache-2.0"
] | 4 | 2020-11-24T09:18:36.000Z | 2022-01-13T20:32:21.000Z | salted/input_handler.py | RuedigerVoigt/salted | 97886014b7a582d943758d65307db2bc03197f6e | [
"Apache-2.0"
] | 11 | 2020-11-30T23:11:48.000Z | 2022-02-25T23:47:44.000Z | salted/input_handler.py | RuedigerVoigt/salted | 97886014b7a582d943758d65307db2bc03197f6e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Input Handler for salted
~~~~~~~~~~~~~~~~~~~~~
Source: https://github.com/RuedigerVoigt/salted
(c) 2020-2021: Rüdiger Voigt
Released under the Apache License 2.0
"""
from collections import Counter
import logging
import pathlib
from typing import List, Optional
import ur... | 37.874317 | 80 | 0.553023 |
from collections import Counter
import logging
import pathlib
from typing import List, Optional
import urllib.parse
import userprovided
from tqdm.asyncio import tqdm
from salted import database_io
from salted import parser
class InputHandler:
def __init__(self,
db: database_io.DatabaseIO):
... | true | true |
1c3a012eff61b3f8dc43f89b7561938c442c0588 | 2,196 | py | Python | lib/node_modules/@stdlib/math/base/special/sincos/benchmark/python/benchmark.py | ghalimi/stdlib | 88f50b88aa945875ef053e2f89d26f9150a18c12 | [
"BSL-1.0"
] | 3,428 | 2016-07-14T13:48:46.000Z | 2022-03-31T22:32:13.000Z | lib/node_modules/@stdlib/math/base/special/sincos/benchmark/python/benchmark.py | ghalimi/stdlib | 88f50b88aa945875ef053e2f89d26f9150a18c12 | [
"BSL-1.0"
] | 435 | 2016-04-07T18:12:45.000Z | 2022-03-22T15:43:17.000Z | lib/node_modules/@stdlib/math/base/special/sincos/benchmark/python/benchmark.py | sthagen/stdlib | 042b6215818db0e2a784e72c7e054167dcefcd2a | [
"BSL-1.0"
] | 188 | 2016-11-29T22:58:11.000Z | 2022-03-17T06:46:43.000Z | #!/usr/bin/env python
#
# @license Apache-2.0
#
# Copyright (c) 2018 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 22.408163 | 74 | 0.631603 |
from __future__ import print_function
import timeit
NAME = "sincos"
REPEATS = 3
ITERATIONS = 1000000
def print_version():
print("TAP version 13")
def print_summary(total, passing):
print("#")
print("1.." + str(total)) print("# total " + str(total))
print("# pass " + str(passing))
print(... | true | true |
1c3a01509c43b5982a2e565f209bb2f980cd1989 | 932 | py | Python | py/desisim/test/test_top_level.py | HiramHerrera/desisim | 3ae76e4c921f72b71ff7522462740e904136f428 | [
"BSD-3-Clause"
] | 15 | 2015-12-16T22:01:53.000Z | 2022-01-14T07:31:55.000Z | py/desisim/test/test_top_level.py | HiramHerrera/desisim | 3ae76e4c921f72b71ff7522462740e904136f428 | [
"BSD-3-Clause"
] | 455 | 2015-04-06T03:11:27.000Z | 2022-02-28T18:11:16.000Z | py/desisim/test/test_top_level.py | HiramHerrera/desisim | 3ae76e4c921f72b71ff7522462740e904136f428 | [
"BSD-3-Clause"
] | 21 | 2015-01-26T17:45:04.000Z | 2022-02-22T19:46:20.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
test top-level desisim functions
"""
#
from __future__ import absolute_import, division, print_function
#
import unittest
import re
from .. import __version__ as theVersion
#
class TestTopLevel(unittest.TestCase):
@classmet... | 28.242424 | 98 | 0.660944 | from __future__ import absolute_import, division, print_function
import unittest
import re
from .. import __version__ as theVersion
class TestTopLevel(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.versionre = re.compile(r'([0-9]+!)?([0-9]+)(\.[0-9]+)*((a|b|rc|\.post|\.dev)[0-9]+)?')
@c... | true | true |
1c3a035bbccea8366fcfa766c69145e4ec0d73ca | 64,359 | py | Python | python/paddle/nn/functional/pooling.py | joey12300/Paddle | 59102c6dcd2def3091f5c37816354ac69d669809 | [
"Apache-2.0"
] | 1 | 2021-03-11T13:16:50.000Z | 2021-03-11T13:16:50.000Z | python/paddle/nn/functional/pooling.py | AFLee/Paddle | 311b3b44fc7d51d4d66d90ab8a3fc0d42231afda | [
"Apache-2.0"
] | null | null | null | python/paddle/nn/functional/pooling.py | AFLee/Paddle | 311b3b44fc7d51d4d66d90ab8a3fc0d42231afda | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle 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 app... | 45.515559 | 248 | 0.582234 |
from ...fluid import core
from ...fluid.framework import in_dygraph_mode
from ...fluid.layers import utils, LayerHelper, unsqueeze, squeeze
from ...fluid.data_feeder import check_type, check_variable_and_dtype
__all__ = [
'avg_pool1d',
'avg_pool2d',
'avg_pool3d',
'max_pool1d',
'max_pool2d',
'm... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.