hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76ec925aa83d20aec64d677f2561623ffa86175 | 1,746 | py | Python | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/virtual_network_gateway_sku.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/virtual_network_gateway_sku.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2019_02_01/models/virtual_network_gateway_sku.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 38.8 | 76 | 0.607675 |
from msrest.serialization import Model
class VirtualNetworkGatewaySku(Model):
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'tier': {'key': 'tier', 'type': 'str'},
'capacity': {'key': 'capacity', 'type': 'int'},
}
def __init__(self, **kwargs):
super(VirtualN... | true | true |
f76ecc306bab0aa6499c41c303282ce1cd3916d7 | 981 | py | Python | src/sw/allotmentclub/alembic/versions/add_signature_for_st_38a1521607b5.py | sweh/sw.allotmentclub.backend | 77344045e29c2b173d635e9e20a0ca556161888e | [
"ZPL-2.1"
] | 1 | 2019-11-12T08:13:18.000Z | 2019-11-12T08:13:18.000Z | src/sw/allotmentclub/alembic/versions/add_signature_for_st_38a1521607b5.py | sweh/sw.allotmentclub.backend | 77344045e29c2b173d635e9e20a0ca556161888e | [
"ZPL-2.1"
] | 26 | 2020-05-16T12:08:25.000Z | 2022-03-12T00:53:57.000Z | src/sw/allotmentclub/alembic/versions/add_signature_for_st_38a1521607b5.py | sweh/sw.allotmentclub.backend | 77344045e29c2b173d635e9e20a0ca556161888e | [
"ZPL-2.1"
] | null | null | null | """Add signature for st
Revision ID: 38a1521607b5
Revises: 2fd64f1e524c
Create Date: 2015-01-04 15:40:04.177104
"""
from alembic import op
import sqlalchemy as sa
import base64
import pkg_resources
# revision identifiers, used by Alembic.
revision = '38a1521607b5'
down_revision = '2fd64f1e524c'
def upgrade():
... | 26.513514 | 79 | 0.666667 | from alembic import op
import sqlalchemy as sa
import base64
import pkg_resources
revision = '38a1521607b5'
down_revision = '2fd64f1e524c'
def upgrade():
op.drop_column('user', 'signature')
op.add_column(
'user',
sa.Column('signature', sa.String(), nullable=True))
signature = pkg_resource... | true | true |
f76ecd58962604e73df424450e99a96805b9dd28 | 13,699 | py | Python | models/components/pixelcnn.py | kkleidal/GatedPixelCNNPyTorch | 286298a0cd81ed2f6cb918fd39ce4da2c0e92802 | [
"MIT"
] | 63 | 2017-12-29T16:17:09.000Z | 2022-01-09T10:59:59.000Z | models/components/pixelcnn.py | MegaYEye/GatedPixelCNNPyTorch | 286298a0cd81ed2f6cb918fd39ce4da2c0e92802 | [
"MIT"
] | null | null | null | models/components/pixelcnn.py | MegaYEye/GatedPixelCNNPyTorch | 286298a0cd81ed2f6cb918fd39ce4da2c0e92802 | [
"MIT"
] | 18 | 2017-12-20T21:51:11.000Z | 2021-09-28T11:07:31.000Z | # Loosely derived from https://github.com/jzbontar/pixelcnn-pytorch/blob/master/main.py
# and moreso derived from https://github.com/rampage644/wavenet/blob/master/wavenet/models.py
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import tqdm
#... | 44.477273 | 112 | 0.596029 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import tqdm
def same_padding(kernel_size):
if isinstance(kernel_size, int):
return kernel_size // 2
else:
return (kernel_size[0] // 2, kernel_size[1] // 2)
class Maske... | true | true |
f76ece47e74b6966dce9edf7579d12bfedf7b982 | 15,962 | py | Python | tardis/tardis_portal/tests/test_models.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | tardis/tardis_portal/tests/test_models.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | tardis/tardis_portal/tests/test_models.py | keithschulze/mytardis | 8ed3562574ce990d42bfe96133185a82c31c27d4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2010, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are per... | 41.67624 | 162 | 0.566596 | from StringIO import StringIO
from django.conf import settings
from django.test import TestCase
from tastypie.utils import trailing_slash
class ModelTestCase(TestCase):
def setUp(self):
from django.contrib.auth.models import User
user = 'tardis_user1'
pwd = 'secret'
email = ''
... | true | true |
f76ecf6c4ecde422241c3990cb517ad3b265344b | 3,374 | py | Python | port/config/settings.py | jaywoong/learn_django | d791694c17db3b5bf1e75ae162b7e74d3157ecd3 | [
"Apache-2.0"
] | null | null | null | port/config/settings.py | jaywoong/learn_django | d791694c17db3b5bf1e75ae162b7e74d3157ecd3 | [
"Apache-2.0"
] | null | null | null | port/config/settings.py | jaywoong/learn_django | d791694c17db3b5bf1e75ae162b7e74d3157ecd3 | [
"Apache-2.0"
] | null | null | null | """
Django settings for config project.
Generated by 'django-admin startproject' using Django 3.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
from... | 25.953846 | 91 | 0.696799 | import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-_tgow!)!u&d^(!c@6f)0%+8iy)gxxp5dqxi=k^p%+eus82ylst'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.c... | true | true |
f76ecfe68bc4809ae2638b5dc2863f949dc2d84a | 1,803 | py | Python | test/functional/feature_filelock.py | minblock/cheesecoin | 3a7f891516234a8bda5ff62cc40e56630261300e | [
"MIT"
] | null | null | null | test/functional/feature_filelock.py | minblock/cheesecoin | 3a7f891516234a8bda5ff62cc40e56630261300e | [
"MIT"
] | null | null | null | test/functional/feature_filelock.py | minblock/cheesecoin | 3a7f891516234a8bda5ff62cc40e56630261300e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Check that it's not possible to start a second cheesecoind instance using the same datadir or wallet."""
imp... | 48.72973 | 177 | 0.72213 | import os
from test_framework.test_framework import BitcoinTestFramework
from test_framework.test_node import ErrorMatch
class FilelockTest(BitcoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
def setup_network(self):
self.add_nodes(self.n... | true | true |
f76ed065673126c9a36bc1c04ec7cc2ca5bcf729 | 821 | py | Python | faucetsite/urls.py | izcoser/faucet | 39e3e818824dff6ae96f22253d1d2f516c237d68 | [
"MIT"
] | null | null | null | faucetsite/urls.py | izcoser/faucet | 39e3e818824dff6ae96f22253d1d2f516c237d68 | [
"MIT"
] | null | null | null | faucetsite/urls.py | izcoser/faucet | 39e3e818824dff6ae96f22253d1d2f516c237d68 | [
"MIT"
] | null | null | null | """faucetsite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
... | 35.695652 | 78 | 0.684531 | from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('', include('faucet.urls')),
path('admin/', admin.site.urls),
]
| true | true |
f76ed06a79b21d27cdff53f99b1bce5adce47793 | 965 | py | Python | setup.py | weijarz/python-testpkg | 3d6132b80d85e80bdc818dce077ea377dc65aa48 | [
"MIT"
] | null | null | null | setup.py | weijarz/python-testpkg | 3d6132b80d85e80bdc818dce077ea377dc65aa48 | [
"MIT"
] | null | null | null | setup.py | weijarz/python-testpkg | 3d6132b80d85e80bdc818dce077ea377dc65aa48 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import testpkg
setup(
name='python-testpkg',
version='0.3',
description='Run test package.',
url='https://github.com/weijarz/python-testpkg',
author='weijarz',
author_email='weijarz@gmail.com',
license='MIT',
# See https://pypi.python.org/py... | 26.805556 | 65 | 0.602073 | from setuptools import setup, find_packages
import testpkg
setup(
name='python-testpkg',
version='0.3',
description='Run test package.',
url='https://github.com/weijarz/python-testpkg',
author='weijarz',
author_email='weijarz@gmail.com',
license='MIT',
classifiers=[
'Devel... | true | true |
f76ed0a7b8a24d06be8e20c147f8e4940f8d49b1 | 941 | py | Python | setup.py | Malcolmnixon/VhdlTest | f17b981e21345444571418d067a61d23325162d3 | [
"MIT"
] | null | null | null | setup.py | Malcolmnixon/VhdlTest | f17b981e21345444571418d067a61d23325162d3 | [
"MIT"
] | 15 | 2020-08-03T15:15:11.000Z | 2020-08-27T02:41:17.000Z | setup.py | Malcolmnixon/VhdlTest | f17b981e21345444571418d067a61d23325162d3 | [
"MIT"
] | null | null | null | """Module for python packaging setup."""
import setuptools
# Read README.md for the long description
with open('README.md', 'r') as fh:
long_description = fh.read()
# Setup information
setuptools.setup(
name='VHDLTest',
version='0.2.0',
author='Malcolm Nixon',
description='VHDL Testbench Runner',... | 24.763158 | 51 | 0.618491 |
import setuptools
with open('README.md', 'r') as fh:
long_description = fh.read()
setuptools.setup(
name='VHDLTest',
version='0.2.0',
author='Malcolm Nixon',
description='VHDL Testbench Runner',
long_description=long_description,
long_description_content_type='text/markdown',
url='htt... | true | true |
f76ed14325da13bb66d3ca9f7ececb6904365799 | 717 | py | Python | wordGame.py | terpyPy/PracticePython | b37060e9f61f6c1ea7f7edbaf20c50f5af156ed7 | [
"MIT"
] | null | null | null | wordGame.py | terpyPy/PracticePython | b37060e9f61f6c1ea7f7edbaf20c50f5af156ed7 | [
"MIT"
] | null | null | null | wordGame.py | terpyPy/PracticePython | b37060e9f61f6c1ea7f7edbaf20c50f5af156ed7 | [
"MIT"
] | null | null | null | import random, temp
name = input('whats is your name? ')
print('good luck ' + name)
words = [temp.read()]
word = random.choice(words)
print('guess the characters')
guesses = ''
turns = 12
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
... | 23.129032 | 51 | 0.520223 | import random, temp
name = input('whats is your name? ')
print('good luck ' + name)
words = [temp.read()]
word = random.choice(words)
print('guess the characters')
guesses = ''
turns = 12
while turns > 0:
failed = 0
for char in word:
if char in guesses:
print(char)
else:
... | true | true |
f76ed1772a7c15e1b77d50f41291730924493302 | 2,146 | py | Python | app.py | Flask-Examples/Tutorial-simple-flask-api | 8d900d6a9a177550139931920825e5fd7ee2919a | [
"MIT"
] | null | null | null | app.py | Flask-Examples/Tutorial-simple-flask-api | 8d900d6a9a177550139931920825e5fd7ee2919a | [
"MIT"
] | null | null | null | app.py | Flask-Examples/Tutorial-simple-flask-api | 8d900d6a9a177550139931920825e5fd7ee2919a | [
"MIT"
] | null | null | null | """
Flask API REST
Tutorial Python e Flask - Como Criar Uma API REST Em Minutos
Homepage and documentation:
https://www.youtube.com/watch?v=N6cZ6aHvLYs&list=PLTzsdf89Lw9wISVTaoCBwk4pRCCgddRZO
Copyright (c) 2018, Marcus Mariano.
License: MIT (see LICENSE for details)
"""
from flask import Flask, jsonify, request
a... | 21.897959 | 83 | 0.566636 |
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/', methods=['GET'])
def home():
return 'Hello world', 200
devs = [
{
'id': 1,
'name': 'Rafael Marques',
'lang': 'python'
},
{
'id': 2,
'name': 'Robert T',
'lang': 'pytho... | true | true |
f76ed20ba08847aff73e3446ff1ad0c0414ab46c | 367 | py | Python | wiki/forms.py | Rediet8abere/makewiki_v2 | 2d3b42055a08f7c2297cddec0717ec47ca65a8a5 | [
"MIT"
] | null | null | null | wiki/forms.py | Rediet8abere/makewiki_v2 | 2d3b42055a08f7c2297cddec0717ec47ca65a8a5 | [
"MIT"
] | 7 | 2020-06-06T00:32:55.000Z | 2022-02-10T11:06:27.000Z | wiki/forms.py | Rediet8abere/makewiki_v2 | 2d3b42055a08f7c2297cddec0717ec47ca65a8a5 | [
"MIT"
] | null | null | null | from django import forms
from wiki.models import Page
class PageForm(forms.ModelForm):
""" Render and process a form based on the Page model. """
class Meta:
model = Page
fields = ['title', 'author', 'content']
class FriendlyForm(forms.Form):
first_name = forms.CharField(max_length=100)
... | 26.214286 | 62 | 0.689373 | from django import forms
from wiki.models import Page
class PageForm(forms.ModelForm):
class Meta:
model = Page
fields = ['title', 'author', 'content']
class FriendlyForm(forms.Form):
first_name = forms.CharField(max_length=100)
last_name = forms.CharField(max_length=100)
| true | true |
f76ed3d60983af1df16e5e1e83b72501d6fb0e19 | 4,208 | py | Python | google/ads/google_ads/v2/proto/enums/product_channel_exclusivity_pb2.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v2/proto/enums/product_channel_exclusivity_pb2.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v2/proto/enums/product_channel_exclusivity_pb2.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2020-09-30T17:04:06.000Z | 2020-09-30T17:04:06.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v2/proto/enums/product_channel_exclusivity.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.prot... | 41.254902 | 687 | 0.800143 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _s... | true | true |
f76ed4233c319cc4eed7d60f095a15a8b8fe4aaf | 6,189 | py | Python | train/tasks/semantic/visualize_uncertainty.py | inkyusa/SalsaNext | c72cfb643add90cf51ab87e2b4eaef53bb457729 | [
"MIT"
] | null | null | null | train/tasks/semantic/visualize_uncertainty.py | inkyusa/SalsaNext | c72cfb643add90cf51ab87e2b4eaef53bb457729 | [
"MIT"
] | null | null | null | train/tasks/semantic/visualize_uncertainty.py | inkyusa/SalsaNext | c72cfb643add90cf51ab87e2b4eaef53bb457729 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This file is covered by the LICENSE file in the root of this project.
import argparse
import os
import yaml
import __init__ as booger
from common.laserscan import LaserScan, SemLaserScan
from common.laserscanvis_uncert import LaserScanVisUncert
import glob
if __name__ == '__main__':
pa... | 34.383333 | 154 | 0.606237 |
import argparse
import os
import yaml
import __init__ as booger
from common.laserscan import LaserScan, SemLaserScan
from common.laserscanvis_uncert import LaserScanVisUncert
import glob
if __name__ == '__main__':
parser = argparse.ArgumentParser("./visualize.py")
parser.add_argument(
'--dataset', ... | true | true |
f76ed43e4efcaae5a2db613d1fc07d070b88fad6 | 755 | py | Python | web3/_utils/toolz/__init__.py | nicolashardy/web3.py | 26d849987756f3b0dc328fdde14ea691188729be | [
"MIT"
] | 5 | 2018-12-19T02:37:18.000Z | 2022-01-26T02:52:50.000Z | web3/_utils/toolz/__init__.py | vaporyproject/web3.py | 2a67ea9f0ab40bb80af2b803dce742d6cad5943e | [
"MIT"
] | 2 | 2019-02-06T14:22:48.000Z | 2021-06-23T21:28:19.000Z | web3/_utils/toolz/__init__.py | vaporyproject/web3.py | 2a67ea9f0ab40bb80af2b803dce742d6cad5943e | [
"MIT"
] | 5 | 2019-03-24T15:46:16.000Z | 2020-08-28T02:42:51.000Z | try:
from cytoolz import (
assoc,
complement,
compose,
concat,
cons,
curry,
dicttoolz,
dissoc,
excepts,
functoolz,
groupby,
identity,
itertoolz,
merge,
partial,
pipe,
sliding_windo... | 16.777778 | 37 | 0.442384 | try:
from cytoolz import (
assoc,
complement,
compose,
concat,
cons,
curry,
dicttoolz,
dissoc,
excepts,
functoolz,
groupby,
identity,
itertoolz,
merge,
partial,
pipe,
sliding_windo... | true | true |
f76ed51639308a86da13eac0d302ab7991881524 | 12,607 | py | Python | drf-tutorial/snippets/migrations/0001_initial.py | marcus-crane/junkcode | 290128f97d22d30cc8f5f3c16b6560f9656842d9 | [
"MIT"
] | null | null | null | drf-tutorial/snippets/migrations/0001_initial.py | marcus-crane/junkcode | 290128f97d22d30cc8f5f3c16b6560f9656842d9 | [
"MIT"
] | 5 | 2020-05-07T09:32:48.000Z | 2020-05-07T09:32:49.000Z | drf-tutorial/snippets/migrations/0001_initial.py | marcus-crane/junkcode | 290128f97d22d30cc8f5f3c16b6560f9656842d9 | [
"MIT"
] | null | null | null | # Generated by Django 2.0b1 on 2017-11-13 02:56
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),
]
ope... | 360.2 | 10,760 | 0.56897 |
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),
]
operations = [
migrations.CreateModel(
... | true | true |
f76ed52bcb44a67a01b3f51fef41b1b556420240 | 5,804 | py | Python | airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py | ncolomer/airflow | cb7c67dea9cd9b9c5de10e355b63039446003149 | [
"Apache-2.0"
] | 1 | 2021-03-03T14:13:28.000Z | 2021-03-03T14:13:28.000Z | airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py | ncolomer/airflow | cb7c67dea9cd9b9c5de10e355b63039446003149 | [
"Apache-2.0"
] | null | null | null | airflow/providers/google/cloud/transfers/facebook_ads_to_gcs.py | ncolomer/airflow | cb7c67dea9cd9b9c5de10e355b63039446003149 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.457143 | 99 | 0.680048 | import csv
import tempfile
from typing import Any, Dict, List, Optional, Sequence, Union
from airflow.models import BaseOperator
from airflow.providers.facebook.ads.hooks.ads import FacebookAdsReportingHook
from airflow.providers.google.cloud.hooks.gcs import GCSHook
from airflow.utils.decorators import apply_defaults... | true | true |
f76ed53d9edc72fc5ea2a7c67f4329187696b58b | 5,204 | py | Python | src/EHRNN/trainingUtils.py | chus-chus/PredictingWithSketches | e30e94760a4c1cb00387982528066ed274bd2a6d | [
"MIT"
] | 1 | 2021-09-15T13:22:18.000Z | 2021-09-15T13:22:18.000Z | src/EHRNN/trainingUtils.py | chus-chus/PredictingWithSketches | e30e94760a4c1cb00387982528066ed274bd2a6d | [
"MIT"
] | null | null | null | src/EHRNN/trainingUtils.py | chus-chus/PredictingWithSketches | e30e94760a4c1cb00387982528066ed274bd2a6d | [
"MIT"
] | null | null | null | import time
from src.EHs.binaryCounterEH import VarEH
def EH_train_epoch(train_loader, network, optimizer, loss_fn, hparams, epoch, taskType='classification'):
# custom training with resetting of EHs in each epoch.
# Activate the train=True flag inside the model
network.train()
# reset EHs
netwo... | 35.162162 | 117 | 0.644696 | import time
from src.EHs.binaryCounterEH import VarEH
def EH_train_epoch(train_loader, network, optimizer, loss_fn, hparams, epoch, taskType='classification'):
network.train()
network.EHs = [[VarEH(len, eps=network.EHeps, maxValue=1) for len in network.EHlengths] for _ in
rang... | true | true |
f76ed56ce2f297c1ba36da01a99ca26dcd92e2a8 | 619 | py | Python | pkg_radish_ext/radish_ext/radish/base_test_data.py | bbielicki/radish-bdd-extensions | 7f1317461af23a70f2a551b66299b54e296af32f | [
"BSD-3-Clause"
] | 4 | 2019-09-19T21:25:26.000Z | 2019-11-10T06:09:06.000Z | pkg_radish_ext/radish_ext/radish/base_test_data.py | bbielicki/radish-bdd-extensions | 7f1317461af23a70f2a551b66299b54e296af32f | [
"BSD-3-Clause"
] | null | null | null | pkg_radish_ext/radish_ext/radish/base_test_data.py | bbielicki/radish-bdd-extensions | 7f1317461af23a70f2a551b66299b54e296af32f | [
"BSD-3-Clause"
] | 2 | 2019-09-17T11:26:59.000Z | 2020-01-23T20:20:43.000Z | # © 2019 Nokia
# Licensed under the BSD 3 Clause license
# SPDX-License-Identifier: BSD-3-Clause
from radish_ext.radish.template_with_nested_data_replacer import TemplateForNestedDict
from radish_ext.sdk.l import Logging
class TestDataBase(object):
def __init__(self, cfg) -> None:
super().__init__()
... | 30.95 | 86 | 0.662359 |
from radish_ext.radish.template_with_nested_data_replacer import TemplateForNestedDict
from radish_ext.sdk.l import Logging
class TestDataBase(object):
def __init__(self, cfg) -> None:
super().__init__()
self.data = {'cfg': cfg,
'generate': {}
}
... | true | true |
f76ed5eb65085bb539ed1a324ae41d109a3a34e1 | 1,176 | py | Python | tc_gan/loaders/tests/test_gen_moments_records.py | ahmadianlab/tc-gan | 06c549e8ae74bc6af62fddeed698565ea1f548c5 | [
"MIT"
] | 4 | 2019-06-04T08:15:43.000Z | 2020-10-03T13:59:15.000Z | tc_gan/loaders/tests/test_gen_moments_records.py | ahmadianlab/tc-gan | 06c549e8ae74bc6af62fddeed698565ea1f548c5 | [
"MIT"
] | null | null | null | tc_gan/loaders/tests/test_gen_moments_records.py | ahmadianlab/tc-gan | 06c549e8ae74bc6af62fddeed698565ea1f548c5 | [
"MIT"
] | null | null | null | from types import SimpleNamespace
import numpy as np
import pandas
import pytest
from ...execution import DataStore
from ...recorders import GenMomentsRecorder
from ..datastore_loader import DataStoreLoader1
@pytest.mark.parametrize('num_mom_conds', [1, 2, 12])
def test_record_load(num_mom_conds, tmpdir):
datas... | 32.666667 | 71 | 0.676871 | from types import SimpleNamespace
import numpy as np
import pandas
import pytest
from ...execution import DataStore
from ...recorders import GenMomentsRecorder
from ..datastore_loader import DataStoreLoader1
@pytest.mark.parametrize('num_mom_conds', [1, 2, 12])
def test_record_load(num_mom_conds, tmpdir):
datas... | true | true |
f76ed684898594b4904f801eaa5ecc1ad69dcc77 | 6,904 | py | Python | clap/trunks/create_trunk.py | cfoster0/CLAP | 6414377dc5a461a35a5c75320a4c5effa83df6ae | [
"BSD-3-Clause"
] | 74 | 2021-04-16T07:58:00.000Z | 2022-03-24T11:25:15.000Z | clap/trunks/create_trunk.py | cfoster0/CLAP | 6414377dc5a461a35a5c75320a4c5effa83df6ae | [
"BSD-3-Clause"
] | 26 | 2021-04-16T07:26:13.000Z | 2021-08-12T07:50:19.000Z | clap/trunks/create_trunk.py | cfoster0/CLAP | 6414377dc5a461a35a5c75320a4c5effa83df6ae | [
"BSD-3-Clause"
] | 2 | 2021-04-16T18:47:42.000Z | 2021-08-09T06:32:21.000Z | from jax import numpy as jnp
from . import Transformer, ViT, TNT, CaiT, MLPMixer
def create_trunk(
model_name: str, output_dim: int = 1000, dtype: jnp.dtype = jnp.float32
):
if model_name == "txt_b":
return Transformer(
output_dim=output_dim,
num_layers=12,
num_he... | 29.504274 | 86 | 0.521147 | from jax import numpy as jnp
from . import Transformer, ViT, TNT, CaiT, MLPMixer
def create_trunk(
model_name: str, output_dim: int = 1000, dtype: jnp.dtype = jnp.float32
):
if model_name == "txt_b":
return Transformer(
output_dim=output_dim,
num_layers=12,
num_he... | true | true |
f76ed6bc344042b5fb320278e77a4ad440a405a2 | 759 | py | Python | common/doc/examples/python/cryptobox.py | ane-community/botan-crypto-ane | 71056f5f0d5fd706e6d42e2f7ec0f7f55d86fb74 | [
"MIT"
] | 1 | 2018-03-09T20:21:47.000Z | 2018-03-09T20:21:47.000Z | common/doc/examples/python/cryptobox.py | ane-community/botan-crypto-ane | 71056f5f0d5fd706e6d42e2f7ec0f7f55d86fb74 | [
"MIT"
] | null | null | null | common/doc/examples/python/cryptobox.py | ane-community/botan-crypto-ane | 71056f5f0d5fd706e6d42e2f7ec0f7f55d86fb74 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import botan
def main(args = None):
if args is None:
args = sys.argv
if len(args) != 3:
raise Exception("Usage: <password> <input>");
password = args[1]
input = ''.join(open(args[2]).readlines())
rng = botan.RandomNumberGenerator()
ciphertext = ... | 20.513514 | 74 | 0.636364 |
import sys
import botan
def main(args = None):
if args is None:
args = sys.argv
if len(args) != 3:
raise Exception("Usage: <password> <input>");
password = args[1]
input = ''.join(open(args[2]).readlines())
rng = botan.RandomNumberGenerator()
ciphertext = botan.cryptobox_en... | false | true |
f76ed7089e6cdda42ee9db02a1a23cd807d8fff4 | 1,197 | py | Python | docs/components_page/components/input/radio_check_inline.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 776 | 2019-02-07T19:36:59.000Z | 2022-03-31T05:53:04.000Z | docs/components_page/components/input/radio_check_inline.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 350 | 2019-02-05T10:42:19.000Z | 2022-03-31T19:23:35.000Z | docs/components_page/components/input/radio_check_inline.py | glsdown/dash-bootstrap-components | 0ebea4f7de43975f6e3a2958359c4480ae1d4927 | [
"Apache-2.0"
] | 219 | 2019-02-10T13:46:25.000Z | 2022-03-23T17:03:39.000Z | import dash_bootstrap_components as dbc
from dash import html
inline_radioitems = html.Div(
[
dbc.Label("Choose one"),
dbc.RadioItems(
options=[
{"label": "Option 1", "value": 1},
{"label": "Option 2", "value": 2},
],
value=1,
... | 22.584906 | 58 | 0.447786 | import dash_bootstrap_components as dbc
from dash import html
inline_radioitems = html.Div(
[
dbc.Label("Choose one"),
dbc.RadioItems(
options=[
{"label": "Option 1", "value": 1},
{"label": "Option 2", "value": 2},
],
value=1,
... | true | true |
f76ed7bff8d6d08c7543e5ff478361dda4a8f84b | 2,091 | py | Python | rocon_client_sdk_py/apis/api_worker.py | boklae/rocon_client_sdk_py | 47ffd3a466fbbcb43f77338eddd9a9fa32b3a763 | [
"MIT"
] | null | null | null | rocon_client_sdk_py/apis/api_worker.py | boklae/rocon_client_sdk_py | 47ffd3a466fbbcb43f77338eddd9a9fa32b3a763 | [
"MIT"
] | 1 | 2021-06-08T21:01:30.000Z | 2021-06-08T21:01:30.000Z | rocon_client_sdk_py/apis/api_worker.py | boklae/rocon_client_sdk_py | 47ffd3a466fbbcb43f77338eddd9a9fa32b3a763 | [
"MIT"
] | null | null | null | import aiohttp
import pydash
import json
class ApiWorker():
def __init__(self, httpclient):
self._httpclient = httpclient
async def find_one_by_uuid(self, uuid):
request = self._httpclient.request()
url = self._httpclient.scheduler_url('/workers?uuid=' + uuid)
async with reque... | 29.871429 | 108 | 0.55428 | import aiohttp
import pydash
import json
class ApiWorker():
def __init__(self, httpclient):
self._httpclient = httpclient
async def find_one_by_uuid(self, uuid):
request = self._httpclient.request()
url = self._httpclient.scheduler_url('/workers?uuid=' + uuid)
async with reque... | true | true |
f76ed7c0ba8ccb588b12ef632ac74dd84558e380 | 995 | py | Python | python_BJ/1107_brute_force.py | DongUk-Park/im_coma | b5c1acdea3957dead6d884f5d4b257df3ae931aa | [
"MIT"
] | null | null | null | python_BJ/1107_brute_force.py | DongUk-Park/im_coma | b5c1acdea3957dead6d884f5d4b257df3ae931aa | [
"MIT"
] | 1 | 2022-03-22T02:30:53.000Z | 2022-03-22T02:31:43.000Z | python_BJ/1107_brute_force.py | DongUk-Park/im_coma | b5c1acdea3957dead6d884f5d4b257df3ae931aa | [
"MIT"
] | null | null | null | # 수빈이는 TV를 보고 있다. 수빈이는 채널을 돌리려고 했지만, 버튼을 너무 세게 누르는 바람에, 일부 숫자 버튼이 고장났다.
# 리모컨에는 버튼이 0부터 9까지 숫자, +와 -가 있다. +를 누르면 현재 보고있는 채널에서 +1된 채널로 이동하고, -를 누르면 -1된 채널로 이동한다. 채널 0에서 -를 누른 경우에는 채널이 변하지 않고, 채널은 무한대 만큼 있다.
# 수빈이가 지금 이동하려고 하는 채널은 N이다. 어떤 버튼이 고장났는지 주어졌을 때, 채널 N으로 이동하기 위해서 버튼을 최소 몇 번 눌러야하는지 구하는 프로그램을 작성하시오.
# 수빈이가 지금 보... | 33.166667 | 134 | 0.609045 |
target = int(input())
result = abs(100 - target)
count_broken_button = int(input())
if count_broken_button: broken_buttons = set(input().split()) else:
broken_buttons = set()
for num in range(1000001): num = str(num)
for i in range(len(num)):
if num[i] in broken_buttons:
... | true | true |
f76ed82436b2fce364c7f4c2c418797b4e7af97a | 4,575 | py | Python | tools/convert_datasets/trans_txt2json.py | zhengye1995/datafountain_siweituxin_autodriver_det | 2c2df76fb9942ddc334730cc5bc447be66440e22 | [
"Apache-2.0"
] | 17 | 2019-11-05T06:36:49.000Z | 2021-04-06T07:38:01.000Z | tools/convert_datasets/trans_txt2json.py | zhengye1995/datafountain_siweituxin_autodriver_det | 2c2df76fb9942ddc334730cc5bc447be66440e22 | [
"Apache-2.0"
] | 2 | 2019-11-05T15:24:18.000Z | 2020-01-20T06:42:47.000Z | tools/convert_datasets/trans_txt2json.py | zhengye1995/datafountain_siweituxin_autodriver_det | 2c2df76fb9942ddc334730cc5bc447be66440e22 | [
"Apache-2.0"
] | 5 | 2019-11-07T16:18:56.000Z | 2020-08-24T02:08:06.000Z | # *utf-8*
import os
import json
import numpy as np
from tqdm import tqdm
import cv2
defect_name2label = {
'red': 1, 'green': 2, 'yellow': 3, 'red_left': 4, 'red_right': 5, 'yellow_left': 6, 'yellow_right': 7,
'green_left': 8, 'green_right': 9, 'red_forward': 10, 'green_forward': 11, 'yellow_forward': 12,
'... | 34.141791 | 115 | 0.531803 | import os
import json
import numpy as np
from tqdm import tqdm
import cv2
defect_name2label = {
'red': 1, 'green': 2, 'yellow': 3, 'red_left': 4, 'red_right': 5, 'yellow_left': 6, 'yellow_right': 7,
'green_left': 8, 'green_right': 9, 'red_forward': 10, 'green_forward': 11, 'yellow_forward': 12,
'horizon_re... | true | true |
f76ed86a7c92cbcb62b74658bb68fcced6a63271 | 612 | py | Python | script.py | xeddmc/frick | 5a60bc8fe8ddcac146853ad22b64e3bac7930269 | [
"MIT"
] | 269 | 2018-06-17T14:30:41.000Z | 2022-03-15T09:08:03.000Z | script.py | xeddmc/frick | 5a60bc8fe8ddcac146853ad22b64e3bac7930269 | [
"MIT"
] | 3 | 2018-08-06T10:33:31.000Z | 2020-01-08T08:32:05.000Z | script.py | xeddmc/frick | 5a60bc8fe8ddcac146853ad22b64e3bac7930269 | [
"MIT"
] | 37 | 2018-06-18T00:52:28.000Z | 2022-03-29T09:54:47.000Z | def get_script(pid, module, offsets, dtinitOffsets):
js = 'var pid = ' + str(pid) + ';'
js += 'var module = "' + module + '";'
js += 'var pTargets = {};'
js += 'var dtInitTargets = {};'
for k, v in offsets.items():
js += 'pTargets[' + str(k) + '] = ' + str(k) + ';'
for k, v in dtinitOffs... | 36 | 63 | 0.457516 | def get_script(pid, module, offsets, dtinitOffsets):
js = 'var pid = ' + str(pid) + ';'
js += 'var module = "' + module + '";'
js += 'var pTargets = {};'
js += 'var dtInitTargets = {};'
for k, v in offsets.items():
js += 'pTargets[' + str(k) + '] = ' + str(k) + ';'
for k, v in dtinitOffs... | true | true |
f76ed95ff881ba66780ff8d9c1efc9ad9aac9580 | 2,393 | py | Python | support/hdsjsonschemacommon.py | victordomingos/haikudepotserver | e0c8c1314bc0bcdf65c7cd02a4e1b8b007b8ca78 | [
"MIT"
] | null | null | null | support/hdsjsonschemacommon.py | victordomingos/haikudepotserver | e0c8c1314bc0bcdf65c7cd02a4e1b8b007b8ca78 | [
"MIT"
] | null | null | null | support/hdsjsonschemacommon.py | victordomingos/haikudepotserver | e0c8c1314bc0bcdf65c7cd02a4e1b8b007b8ca78 | [
"MIT"
] | null | null | null |
# =====================================
# Copyright 2017, Andrew Lindesay
# Distributed under the terms of the MIT License.
# =====================================
# common material related to generation of schema-generated artifacts.
import datetime
# The possible JSON types
JSON_TYPE_STRING = "string"
JSON_TYPE_... | 26.588889 | 93 | 0.651066 |
import datetime
JSON_TYPE_STRING = "string"
JSON_TYPE_OBJECT = "object"
JSON_TYPE_ARRAY = "array"
JSON_TYPE_BOOLEAN = "boolean"
JSON_TYPE_INTEGER = "integer"
JSON_TYPE_NUMBER = "number"
CPP_TYPE_STRING = "BString"
CPP_TYPE_ARRAY = "List"
CPP_TYPE_BOOLEAN = "bool"
CPP_TYPE_INTEGER = "int64"
CPP_TYPE_NUMBER = "dou... | true | true |
f76eda4b2a0ac99671819fa181913b406208b2d9 | 5,433 | py | Python | iotbx/pdb/tst_extract_rfactors_resolutions_sigma.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | iotbx/pdb/tst_extract_rfactors_resolutions_sigma.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | iotbx/pdb/tst_extract_rfactors_resolutions_sigma.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from iotbx.pdb import extract_rfactors_resolutions_sigma
from libtbx.test_utils import approx_equal
example_cns = """
REMARK 2
REMARK 2 RESOLUTION. 2.20 ANGSTROMS.
REMARK 3
REMARK 3 REFINEMENT.
REMARK 3 PROGRAM : CNS 0.9
REMARK 3 AUTH... | 41.792308 | 75 | 0.648261 | from __future__ import absolute_import, division, print_function
from iotbx.pdb import extract_rfactors_resolutions_sigma
from libtbx.test_utils import approx_equal
example_cns = """
REMARK 2
REMARK 2 RESOLUTION. 2.20 ANGSTROMS.
REMARK 3
REMARK 3 REFINEMENT.
REMARK 3 PROGRAM : CNS 0.9
REMARK 3 AUTH... | true | true |
f76edc4c13c41f67367c21367814b9f5c96bc54b | 1,906 | py | Python | test/pytest.py | Elainehxx/python.js | c3ea7d238da49bb97a3f5e384451998169e0f49a | [
"BSD-3-Clause"
] | 214 | 2015-03-20T09:51:35.000Z | 2022-01-13T15:03:08.000Z | test/pytest.py | Elainehxx/python.js | c3ea7d238da49bb97a3f5e384451998169e0f49a | [
"BSD-3-Clause"
] | 8 | 2015-07-31T23:52:40.000Z | 2017-04-25T15:39:24.000Z | test/pytest.py | Elainehxx/python.js | c3ea7d238da49bb97a3f5e384451998169e0f49a | [
"BSD-3-Clause"
] | 40 | 2015-03-25T11:54:28.000Z | 2019-11-28T11:37:27.000Z |
def test_01(value):
print value
return value * 2
def test_02(value):
print value
return value * 1.5
def test_03(value):
print value
return value + ', hello python'
def test_04(value):
print value
return not value
def test_05(value):
print value
if value is None:
return None
else:
raise Exception()
... | 18.686275 | 58 | 0.660021 |
def test_01(value):
print value
return value * 2
def test_02(value):
print value
return value * 1.5
def test_03(value):
print value
return value + ', hello python'
def test_04(value):
print value
return not value
def test_05(value):
print value
if value is None:
return None
else:
raise Exception()
... | false | true |
f76edc5439681e5e573e6bdaa6c0f810a1157200 | 10,064 | py | Python | src/model.py | Mrpatekful/supervised-translation | d03db6a0fc25900fd42b8057a12adad0b8d025f8 | [
"MIT"
] | 1 | 2020-09-22T12:01:29.000Z | 2020-09-22T12:01:29.000Z | src/model.py | Mrpatekful/nmt | d03db6a0fc25900fd42b8057a12adad0b8d025f8 | [
"MIT"
] | 1 | 2021-06-01T23:40:35.000Z | 2021-06-01T23:40:35.000Z | src/model.py | Mrpatekful/nmt | d03db6a0fc25900fd42b8057a12adad0b8d025f8 | [
"MIT"
] | 1 | 2020-03-11T15:45:47.000Z | 2020-03-11T15:45:47.000Z | """
@author: Patrik Purgai
@copyright: Copyright 2019, supervised-translation
@license: MIT
@email: purgai.patrik@gmail.com
@date: 2019.04.04.
"""
# pylint: disable=no-member
# pylint: disable=not-callable
import torch
import random
from torch.nn.modules import (
Module, ModuleList)
from torch.nn.... | 29.426901 | 67 | 0.605624 |
import torch
import random
from torch.nn.modules import (
Module, ModuleList)
from torch.nn.functional import (
log_softmax, softmax, linear,
embedding)
from torch.nn import (
Linear, Softmax, Parameter,
GRU, Dropout, Embedding)
def setup_model_args(parser):
parser.add_argument(
... | true | true |
f76eddac566f07c128c6eee62aae4cdec57f7727 | 3,423 | py | Python | examples/tf/smac/recurrent/decentralised/run_madqn_scale_trainers.py | 1998x-stack/Mava | 2c8f7f59f235340886e92045b6730cf5a542a496 | [
"Apache-2.0"
] | 1 | 2022-03-19T12:51:16.000Z | 2022-03-19T12:51:16.000Z | examples/tf/smac/recurrent/decentralised/run_madqn_scale_trainers.py | 1998x-stack/Mava | 2c8f7f59f235340886e92045b6730cf5a542a496 | [
"Apache-2.0"
] | null | null | null | examples/tf/smac/recurrent/decentralised/run_madqn_scale_trainers.py | 1998x-stack/Mava | 2c8f7f59f235340886e92045b6730cf5a542a496 | [
"Apache-2.0"
] | null | null | null | # python3
# Copyright 2021 InstaDeep Ltd. 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 applic... | 30.292035 | 85 | 0.716915 |
import functools
from datetime import datetime
from typing import Any
import launchpad as lp
from absl import app, flags
from mava.components.tf.modules.exploration import LinearExplorationTimestepScheduler
from mava.systems.tf import madqn
from mava.utils import enums, lp_utils
from mava.utils.enums import Architec... | true | true |
f76edddd628194674b77a4619bad6532e4f93650 | 942 | py | Python | ArtificialNeuralNetwork/model.py | jiruifu-jerry0219/UpperLimbEstimator | d62deef93419934dcb33e43707dd0634a235fb9a | [
"Apache-2.0"
] | null | null | null | ArtificialNeuralNetwork/model.py | jiruifu-jerry0219/UpperLimbEstimator | d62deef93419934dcb33e43707dd0634a235fb9a | [
"Apache-2.0"
] | null | null | null | ArtificialNeuralNetwork/model.py | jiruifu-jerry0219/UpperLimbEstimator | d62deef93419934dcb33e43707dd0634a235fb9a | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as Data
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, WeightedRandomSampler
class MultipleRegression(nn.Module):
def __init__(self, num_features):
s... | 27.705882 | 71 | 0.626327 | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as Data
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader, WeightedRandomSampler
class MultipleRegression(nn.Module):
def __init__(self, num_features):
s... | true | true |
f76edf4467f713c024a9444e55ce8b1063567958 | 5,255 | py | Python | google/ads/googleads/v6/resources/types/campaign_experiment.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/resources/types/campaign_experiment.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v6/resources/types/campaign_experiment.py | wxxlouisa/google-ads-python | f24137966f6bfcb765a9b1fae79f2d23041825fe | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 41.706349 | 139 | 0.67764 |
import proto
from google.ads.googleads.v6.enums.types import campaign_experiment_status
from google.ads.googleads.v6.enums.types import (
campaign_experiment_traffic_split_type,
)
__protobuf__ = proto.module(
package="google.ads.googleads.v6.resources",
marshal="google.ads.googleads.v6",
manifest... | true | true |
f76edfa3b668f35efdacaef09612528572bf670e | 29,232 | py | Python | tests/common/fixtures/advanced_reboot.py | amulyan7/sonic-mgmt | b673fe4d830f064ae6f937c514215a7a7d0c7f33 | [
"Apache-2.0"
] | null | null | null | tests/common/fixtures/advanced_reboot.py | amulyan7/sonic-mgmt | b673fe4d830f064ae6f937c514215a7a7d0c7f33 | [
"Apache-2.0"
] | null | null | null | tests/common/fixtures/advanced_reboot.py | amulyan7/sonic-mgmt | b673fe4d830f064ae6f937c514215a7a7d0c7f33 | [
"Apache-2.0"
] | null | null | null | import copy
import ipaddress
import itertools
import json
import logging
import pytest
import time
import os
from tests.common.mellanox_data import is_mellanox_device as isMellanoxDevice
from tests.common.platform.ssh_utils import prepare_testbed_ssh_keys as prepareTestbedSshKeys
from tests.common.reboot import reboot... | 45.391304 | 139 | 0.635365 | import copy
import ipaddress
import itertools
import json
import logging
import pytest
import time
import os
from tests.common.mellanox_data import is_mellanox_device as isMellanoxDevice
from tests.common.platform.ssh_utils import prepare_testbed_ssh_keys as prepareTestbedSshKeys
from tests.common.reboot import reboot... | true | true |
f76ee06f23d36cbdf4ecd44376f5a2474cd49f25 | 257 | py | Python | PythonApp/lib/tracer/test/constants.py | IMULMUL/tracer | 221ae67558fa08a8a45ddd82c237417c0085b5a5 | [
"MIT"
] | 51 | 2017-12-18T20:49:36.000Z | 2022-02-19T13:28:51.000Z | PythonApp/lib/tracer/test/constants.py | IMULMUL/tracer | 221ae67558fa08a8a45ddd82c237417c0085b5a5 | [
"MIT"
] | 1 | 2018-05-15T19:46:47.000Z | 2018-05-15T19:59:25.000Z | PythonApp/lib/tracer/test/constants.py | IMULMUL/tracer | 221ae67558fa08a8a45ddd82c237417c0085b5a5 | [
"MIT"
] | 8 | 2018-05-07T13:59:53.000Z | 2022-01-20T02:06:00.000Z | #===============================================================================
# Constants
#===============================================================================
# vim:set ts=8 sw=4 sts=4 tw=80 et :
| 36.714286 | 80 | 0.120623 | true | true | |
f76ee0dbf591cea2f5366db8d7a69a2b67ebf8d4 | 680 | py | Python | load_styles.py | wouter-veeken/docs | 5cf0e424a35ee736951aa83b9b24efbb2a2ab296 | [
"MIT"
] | 1 | 2019-03-18T15:49:48.000Z | 2019-03-18T15:49:48.000Z | load_styles.py | evandandrea/docs | 8acd25262d57b2d660ad49b2d35273f2a960aedd | [
"MIT"
] | null | null | null | load_styles.py | evandandrea/docs | 8acd25262d57b2d660ad49b2d35273f2a960aedd | [
"MIT"
] | 1 | 2021-09-23T15:27:09.000Z | 2021-09-23T15:27:09.000Z | #!/usr/bin/env python
import os
import jinja2
import yaml
PATH = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_ENVIRONMENT = jinja2.Environment(
autoescape=False,
loader=jinja2.FileSystemLoader(os.path.join(PATH, 'data')),
trim_blocks=False)
def render_template(template_filename, context):
ret... | 25.185185 | 79 | 0.701471 | import os
import jinja2
import yaml
PATH = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_ENVIRONMENT = jinja2.Environment(
autoescape=False,
loader=jinja2.FileSystemLoader(os.path.join(PATH, 'data')),
trim_blocks=False)
def render_template(template_filename, context):
return TEMPLATE_ENVIRONME... | true | true |
f76ee1d8c4c2e0700a3e1a53dd17a8a4cc7f5b64 | 1,622 | py | Python | collect_latency.py | anonymousGithub2023/ECCV | 6b8e3c70911b53ca842925d403461be57b710bea | [
"MIT"
] | 1 | 2022-03-31T06:00:25.000Z | 2022-03-31T06:00:25.000Z | collect_latency.py | SeekingDream/NICGSlowDown | 7c4b862c898aa6a591bc7f32f95c5900e0492490 | [
"MIT"
] | null | null | null | collect_latency.py | SeekingDream/NICGSlowDown | 7c4b862c898aa6a591bc7f32f95c5900e0492490 | [
"MIT"
] | null | null | null | import torch
import os
import numpy as np
from utils import *
l2_res = np.zeros([6, 7])
linf_res = np.zeros([6, 7])
resDir = 'res'
if not os.path.isdir(resDir):
os.mkdir(resDir)
for model_file in MODEL_FILE_LIST:
task_name = model_file.split('.')[0]
for attack_name in ['L2', 'Linf']:
avg_res = np... | 39.560976 | 119 | 0.580764 | import torch
import os
import numpy as np
from utils import *
l2_res = np.zeros([6, 7])
linf_res = np.zeros([6, 7])
resDir = 'res'
if not os.path.isdir(resDir):
os.mkdir(resDir)
for model_file in MODEL_FILE_LIST:
task_name = model_file.split('.')[0]
for attack_name in ['L2', 'Linf']:
avg_res = np... | true | true |
f76ee283ac648caf8dbc1302f163de80b48db4c2 | 820 | py | Python | google/ads/google_ads/v5/services/keyword_plan_idea_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | 1 | 2021-04-09T04:28:47.000Z | 2021-04-09T04:28:47.000Z | google/ads/google_ads/v5/services/keyword_plan_idea_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v5/services/keyword_plan_idea_service_client_config.py | arammaliachi/google-ads-python | a4fe89567bd43eb784410523a6306b5d1dd9ee67 | [
"Apache-2.0"
] | null | null | null | config = {
"interfaces": {
"google.ads.googleads.v5.services.KeywordPlanIdeaService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_delay... | 25.625 | 64 | 0.535366 | config = {
"interfaces": {
"google.ads.googleads.v5.services.KeywordPlanIdeaService": {
"retry_codes": {
"idempotent": [
"DEADLINE_EXCEEDED",
"UNAVAILABLE"
],
"non_idempotent": []
},
"retry_params": {
"default": {
"initial_retry_delay... | true | true |
f76ee2c3f05952654db97b8202f17a4d442c234b | 1,465 | py | Python | app/main/model/image.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 11 | 2018-02-07T00:16:54.000Z | 2021-05-13T22:47:07.000Z | app/main/model/image.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 47 | 2018-11-26T23:17:37.000Z | 2022-03-25T16:12:05.000Z | app/main/model/image.py | meedan/alegre | ad28736f53b8905882e196e90cac66d39db341a3 | [
"MIT"
] | 9 | 2019-05-23T22:06:03.000Z | 2020-10-27T20:45:04.000Z | import io
import urllib.request
from PIL import Image, ImageFile
from sqlalchemy.dialects.postgresql import JSONB
from app.main import db
from app.main.lib.image_hash import compute_phash_int, sha256_stream
class ImageModel(db.Model):
""" Model for storing image related details """
__tablename__ = 'images'
id... | 38.552632 | 97 | 0.730375 | import io
import urllib.request
from PIL import Image, ImageFile
from sqlalchemy.dialects.postgresql import JSONB
from app.main import db
from app.main.lib.image_hash import compute_phash_int, sha256_stream
class ImageModel(db.Model):
__tablename__ = 'images'
id = db.Column(db.Integer, primary_key=True)
sha25... | true | true |
f76ee439ef57264cc54c0845e196812f131a1afc | 11,625 | py | Python | mistral/mistral/tests/unit/engine/test_reverse_workflow_rerun.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | mistral/mistral/tests/unit/engine/test_reverse_workflow_rerun.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | mistral/mistral/tests/unit/engine/test_reverse_workflow_rerun.py | Toure/openstack_mistral_wip | 1c3d028cb7c918de74a3cb018c84d6c5ee42e3f1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 31.334232 | 79 | 0.622022 |
import mock
from oslo_config import cfg
from mistral.actions import std_actions
from mistral.db.v2 import api as db_api
from mistral import exceptions as exc
from mistral.services import workbooks as wb_service
from mistral.tests.unit.engine import base
from mistral.workflow import states
cfg.CONF.set_default('aut... | true | true |
f76ee6243f611919979a54cc0896e448d6d04dca | 217 | py | Python | data/settings.py | OddExtension5/repo4U | bfd82ed1ec7489745c198b90d5763119b6f82db6 | [
"MIT"
] | 3 | 2020-06-11T09:43:39.000Z | 2021-06-13T08:03:36.000Z | data/settings.py | OddExtension5/repo-recommender | bfd82ed1ec7489745c198b90d5763119b6f82db6 | [
"MIT"
] | 1 | 2020-12-04T12:59:13.000Z | 2020-12-04T12:59:13.000Z | data/settings.py | OddExtension5/repo-recommender | bfd82ed1ec7489745c198b90d5763119b6f82db6 | [
"MIT"
] | 2 | 2020-06-26T11:36:07.000Z | 2020-12-04T12:17:22.000Z | from dotenv import load_dotenv
from pathlib import Path
import os
env_path = Path('.') / 'data/.env'
load_dotenv(dotenv_path=env_path)
TOKEN = os.getenv("GITHUB_ACCESS_TOKEN")
USERNAME = os.getenv("GITHUB_USERNAME") | 24.111111 | 40 | 0.774194 | from dotenv import load_dotenv
from pathlib import Path
import os
env_path = Path('.') / 'data/.env'
load_dotenv(dotenv_path=env_path)
TOKEN = os.getenv("GITHUB_ACCESS_TOKEN")
USERNAME = os.getenv("GITHUB_USERNAME") | true | true |
f76ee928623c61ab6d0b9cc4577bd0610a914676 | 1,972 | py | Python | tests/test_iterator_wrappers.py | smheidrich/progress-passthrough | e01bc8e0599463412eb9d91d72fd1cf568b392a5 | [
"MIT"
] | null | null | null | tests/test_iterator_wrappers.py | smheidrich/progress-passthrough | e01bc8e0599463412eb9d91d72fd1cf568b392a5 | [
"MIT"
] | null | null | null | tests/test_iterator_wrappers.py | smheidrich/progress-passthrough | e01bc8e0599463412eb9d91d72fd1cf568b392a5 | [
"MIT"
] | null | null | null | from progress_passthrough.iterator_wrappers import (
IteratorWrapper,
AttachedLengthIterator,
CallbackIterator,
wrap_source,
wrap_source_len,
)
from unittest.mock import Mock
def test_iterator_wrapper_on_iterable():
it = range(10)
w = IteratorWrapper(it)
assert len(w) == len(range(10))... | 26.293333 | 74 | 0.642495 | from progress_passthrough.iterator_wrappers import (
IteratorWrapper,
AttachedLengthIterator,
CallbackIterator,
wrap_source,
wrap_source_len,
)
from unittest.mock import Mock
def test_iterator_wrapper_on_iterable():
it = range(10)
w = IteratorWrapper(it)
assert len(w) == len(range(10))... | true | true |
f76ee9486e96dfb91efeb5769a65599057685f00 | 705 | py | Python | smac_platform.py | initio-smac/smac_kivy | deb37e34fdc9df8e6629f418b662b5a001ffe1b4 | [
"Apache-2.0"
] | null | null | null | smac_platform.py | initio-smac/smac_kivy | deb37e34fdc9df8e6629f418b662b5a001ffe1b4 | [
"Apache-2.0"
] | null | null | null | smac_platform.py | initio-smac/smac_kivy | deb37e34fdc9df8e6629f418b662b5a001ffe1b4 | [
"Apache-2.0"
] | null | null | null | from kivy import platform
import json
import random
TEST_DEVICE = False
SMAC_PLATFORM = None
# platform options
# android, ESP, RPI, win, linux
if TEST_DEVICE:
TEST_PLATFORMS = ["android", "win", "linux", "ESP"]
try:
with open('config.json', 'r') as f:
fd = json.load(f)
if fd.get("PLATFORM", None) != None:... | 21.363636 | 52 | 0.670922 | from kivy import platform
import json
import random
TEST_DEVICE = False
SMAC_PLATFORM = None
if TEST_DEVICE:
TEST_PLATFORMS = ["android", "win", "linux", "ESP"]
try:
with open('config.json', 'r') as f:
fd = json.load(f)
if fd.get("PLATFORM", None) != None:
SMAC_PLATFORM = fd.get("PLATFORM")
else:
... | true | true |
f76ee9756fb291216acce6a855805ed104ac0183 | 13,648 | py | Python | openselfsup/models/backbones/resnet.py | youqingxiaozhua/OpenSelfSup | 7e94af11d8bec67cace70fb881e45228224fe14d | [
"Apache-2.0"
] | 1,624 | 2020-06-16T04:03:15.000Z | 2021-12-16T03:42:24.000Z | openselfsup/models/backbones/resnet.py | changlin31/OpenSelfSup | ab8fc27c6b43679317eaf312b85461ba490606af | [
"Apache-2.0"
] | 91 | 2020-06-16T13:57:20.000Z | 2021-12-06T09:24:03.000Z | openselfsup/models/backbones/resnet.py | changlin31/OpenSelfSup | ab8fc27c6b43679317eaf312b85461ba490606af | [
"Apache-2.0"
] | 235 | 2020-06-16T05:45:52.000Z | 2021-12-15T02:43:21.000Z | import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from openselfsup.utils import get_root_logger
from ..registry import BACKBONES
from ..utils import build_conv_layer, build... | 31.739535 | 79 | 0.540958 | import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from openselfsup.utils import get_root_logger
from ..registry import BACKBONES
from ..utils import build_conv_layer, build... | true | true |
f76ee9b0aad76d36a64883ad4fd24117730eaf8a | 5,518 | py | Python | conans/client/graph/build_requires.py | aharrison24/conan | d5197368d1bcf99241cad08c858f6a1471613471 | [
"MIT"
] | null | null | null | conans/client/graph/build_requires.py | aharrison24/conan | d5197368d1bcf99241cad08c858f6a1471613471 | [
"MIT"
] | null | null | null | conans/client/graph/build_requires.py | aharrison24/conan | d5197368d1bcf99241cad08c858f6a1471613471 | [
"MIT"
] | null | null | null | import copy
import fnmatch
from collections import OrderedDict
from conans.errors import conanfile_exception_formatter
from conans.model.ref import ConanFileReference
from conans.model.conan_file import get_env_context_manager
from conans.client.graph.printer import print_graph
def _apply_build_requires(deps_graph, ... | 45.603306 | 118 | 0.695542 | import copy
import fnmatch
from collections import OrderedDict
from conans.errors import conanfile_exception_formatter
from conans.model.ref import ConanFileReference
from conans.model.conan_file import get_env_context_manager
from conans.client.graph.printer import print_graph
def _apply_build_requires(deps_graph, ... | true | true |
f76ee9f1a3702473cc3634cecb572c73034942b5 | 5,566 | py | Python | src/cms/forms/events/recurrence_rule_form.py | mckinly/cms-django | c9995a3bfab6ee2d02f2406a7f83cf91b7ccfcca | [
"Apache-2.0"
] | null | null | null | src/cms/forms/events/recurrence_rule_form.py | mckinly/cms-django | c9995a3bfab6ee2d02f2406a7f83cf91b7ccfcca | [
"Apache-2.0"
] | 5 | 2021-02-10T02:41:20.000Z | 2022-03-12T00:56:56.000Z | src/cms/forms/events/recurrence_rule_form.py | mckinly/cms-django | c9995a3bfab6ee2d02f2406a7f83cf91b7ccfcca | [
"Apache-2.0"
] | null | null | null | import logging
from django import forms
from django.utils.translation import ugettext as _
from ...constants import weekdays, frequency
from ...models import RecurrenceRule
from ..custom_model_form import CustomModelForm
logger = logging.getLogger(__name__)
class RecurrenceRuleForm(CustomModelForm):
"""
Fo... | 35.909677 | 116 | 0.556594 | import logging
from django import forms
from django.utils.translation import ugettext as _
from ...constants import weekdays, frequency
from ...models import RecurrenceRule
from ..custom_model_form import CustomModelForm
logger = logging.getLogger(__name__)
class RecurrenceRuleForm(CustomModelForm):
has_recur... | true | true |
f76eea35cbc3cbae7381d9fa78606d78fae64e69 | 3,607 | py | Python | test/functional/wallet_zapwallettxes.py | BITRUBCOIN-Project/BITRUBCOIN | 0a0f9f21bfb15c3c9ed91f7f88e3b955a2d842d1 | [
"MIT"
] | null | null | null | test/functional/wallet_zapwallettxes.py | BITRUBCOIN-Project/BITRUBCOIN | 0a0f9f21bfb15c3c9ed91f7f88e3b955a2d842d1 | [
"MIT"
] | null | null | null | test/functional/wallet_zapwallettxes.py | BITRUBCOIN-Project/BITRUBCOIN | 0a0f9f21bfb15c3c9ed91f7f88e3b955a2d842d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the zapwallettxes functionality.
- start two bitrubcoind nodes
- create two transactions on node ... | 42.435294 | 116 | 0.690324 |
from test_framework.test_framework import BitRubCoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
class ZapWalletTXesTest (BitRubCoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.e... | true | true |
f76eea516847add8d006b502e3f7aaafc5c42461 | 8,324 | py | Python | bot/exts/utils/utils.py | VirdanTheBurden/bot-1 | 73c08646d29e587959ff794678eed4cdf5976ddb | [
"MIT",
"BSD-3-Clause"
] | 1,003 | 2018-11-17T21:10:01.000Z | 2022-03-31T22:50:39.000Z | bot/exts/utils/utils.py | VirdanTheBurden/bot-1 | 73c08646d29e587959ff794678eed4cdf5976ddb | [
"MIT",
"BSD-3-Clause"
] | 1,474 | 2018-11-17T10:18:14.000Z | 2022-03-31T18:01:39.000Z | bot/exts/utils/utils.py | VirdanTheBurden/bot-1 | 73c08646d29e587959ff794678eed4cdf5976ddb | [
"MIT",
"BSD-3-Clause"
] | 771 | 2018-11-21T08:36:07.000Z | 2022-03-31T14:56:39.000Z | import difflib
import re
import unicodedata
from typing import Tuple, Union
from discord import Colour, Embed, utils
from discord.ext.commands import BadArgument, Cog, Context, clean_content, command, has_any_role
from discord.utils import snowflake_time
from bot.bot import Bot
from bot.constants import Channels, MOD... | 39.079812 | 112 | 0.630586 | import difflib
import re
import unicodedata
from typing import Tuple, Union
from discord import Colour, Embed, utils
from discord.ext.commands import BadArgument, Cog, Context, clean_content, command, has_any_role
from discord.utils import snowflake_time
from bot.bot import Bot
from bot.constants import Channels, MOD... | true | true |
f76eec4e419649a2cbfcaf80d9248149fe1baa56 | 539 | py | Python | tests/__init__.py | linw1995/data_extractor | ba20fbb8c6dc87f0fb141bd5d64e5d14f71465eb | [
"MIT"
] | 28 | 2019-04-19T11:03:04.000Z | 2022-01-02T10:31:15.000Z | tests/__init__.py | linw1995/data_extractor | ba20fbb8c6dc87f0fb141bd5d64e5d14f71465eb | [
"MIT"
] | 82 | 2019-04-19T14:16:50.000Z | 2021-12-24T14:16:17.000Z | tests/__init__.py | linw1995/data_extractor | ba20fbb8c6dc87f0fb141bd5d64e5d14f71465eb | [
"MIT"
] | 4 | 2019-07-05T04:15:17.000Z | 2022-02-08T05:18:00.000Z | # Standard Library
import platform
import sys
from pathlib import Path
current_python_version = "%s.%s" % platform.python_version_tuple()[:2]
# when executing pytest cli, the sys.path will be changed.
# jsonpath-extractor package's module `jsonpath` same as
# the file `jsonpath.py` in f'{sys.prefix}/bin'.
# So need ... | 25.666667 | 70 | 0.710575 | import platform
import sys
from pathlib import Path
current_python_version = "%s.%s" % platform.python_version_tuple()[:2]
# the file `jsonpath.py` in f'{sys.prefix}/bin'.
# So need to remove it to avoid import the wrong module.
for p in [
Path(f"{sys.prefix}/bin/jsonpath.py"),
Path(f"__pypackages__/{current... | true | true |
f76eecaf20fa26199ef8733ec65e949708fb6277 | 6,320 | py | Python | patches/tileset.py | unhold/game-and-watch-patch | dc33f2228d7c791a746502aef27a5331c0076503 | [
"BSD-3-Clause"
] | 48 | 2021-08-19T19:34:51.000Z | 2022-03-29T02:02:35.000Z | patches/tileset.py | unhold/game-and-watch-patch | dc33f2228d7c791a746502aef27a5331c0076503 | [
"BSD-3-Clause"
] | 5 | 2021-09-04T12:15:46.000Z | 2022-01-21T07:47:06.000Z | patches/tileset.py | unhold/game-and-watch-patch | dc33f2228d7c791a746502aef27a5331c0076503 | [
"BSD-3-Clause"
] | 11 | 2021-10-15T23:36:08.000Z | 2022-03-05T12:38:23.000Z | from io import BytesIO
from math import ceil
import numpy as np
from PIL import Image
from .exception import ParsingError
_BLOCK_SIZE = 16
_BLOCK_PIXEL = _BLOCK_SIZE * _BLOCK_SIZE
PALETTE_OFFSETS = [
0xB_EC68,
0xB_EDA8,
0xB_EEE8,
0xB_F028,
0xB_F168,
]
def bytes_to_tilemap(data, palette=None, b... | 25.28 | 81 | 0.560443 | from io import BytesIO
from math import ceil
import numpy as np
from PIL import Image
from .exception import ParsingError
_BLOCK_SIZE = 16
_BLOCK_PIXEL = _BLOCK_SIZE * _BLOCK_SIZE
PALETTE_OFFSETS = [
0xB_EC68,
0xB_EDA8,
0xB_EEE8,
0xB_F028,
0xB_F168,
]
def bytes_to_tilemap(data, palette=None, b... | true | true |
f76eee6bb269d99061c1cca5343b65071085a37d | 3,008 | py | Python | home/management/commands/redirectpage.py | reidmporter/IATI-Standard-Website | f10d48caed9fab7a76c3556e8e4f1451ceec0f0c | [
"MIT"
] | null | null | null | home/management/commands/redirectpage.py | reidmporter/IATI-Standard-Website | f10d48caed9fab7a76c3556e8e4f1451ceec0f0c | [
"MIT"
] | null | null | null | home/management/commands/redirectpage.py | reidmporter/IATI-Standard-Website | f10d48caed9fab7a76c3556e8e4f1451ceec0f0c | [
"MIT"
] | null | null | null | """Management command that replaces soft-links in content editors and creates redirects."""
import json
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from wagtail.core.models import Page
from wagtail.contrib.redirects.models import Redirect
from wagtail_modeltran... | 45.575758 | 126 | 0.634973 |
import json
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from wagtail.core.models import Page
from wagtail.contrib.redirects.models import Redirect
from wagtail_modeltranslation.contextlib import use_language
from home.models import HomePage
class Command(Bas... | true | true |
f76eeea98aa6f57ae9d1e79ca1588b8af0a64767 | 395 | py | Python | backend/routers/news.py | nachiketbhuta/smart-platform | a84d718fb9a3e5e9739f68bc2d2a2e19305bd513 | [
"Apache-2.0"
] | 6 | 2021-03-21T05:12:45.000Z | 2021-07-12T12:36:44.000Z | backend/routers/news.py | nachiketbhuta/smart-platform | a84d718fb9a3e5e9739f68bc2d2a2e19305bd513 | [
"Apache-2.0"
] | 3 | 2021-03-20T07:53:46.000Z | 2021-03-20T17:20:30.000Z | backend/routers/news.py | nachiketbhuta/smart-platform | a84d718fb9a3e5e9739f68bc2d2a2e19305bd513 | [
"Apache-2.0"
] | 1 | 2021-03-21T07:21:19.000Z | 2021-03-21T07:21:19.000Z | from fastapi import APIRouter
import finviz
import requests
from urllib.error import HTTPError
news_router = APIRouter()
@news_router.get("/{stock}/news")
async def get_stock_news(stock: str):
try:
news = finviz.get_news(stock)
return {"success": True, "news": news[0:5]}
except requests.except... | 26.333333 | 58 | 0.693671 | from fastapi import APIRouter
import finviz
import requests
from urllib.error import HTTPError
news_router = APIRouter()
@news_router.get("/{stock}/news")
async def get_stock_news(stock: str):
try:
news = finviz.get_news(stock)
return {"success": True, "news": news[0:5]}
except requests.except... | true | true |
f76eef2d87b806e324d705947eb0f03d3c835075 | 6,827 | py | Python | PSICT_extras/PSICT_MultiPulse/PSICT_MultiPulse.py | JeanOlivier/Labber-PSICT | f6d831823ec7c8373fd562b6d1247f7e438f1ee5 | [
"MIT"
] | 2 | 2019-09-09T05:19:11.000Z | 2021-07-20T05:44:17.000Z | PSICT_extras/PSICT_MultiPulse/PSICT_MultiPulse.py | JeanOlivier/Labber-PSICT | f6d831823ec7c8373fd562b6d1247f7e438f1ee5 | [
"MIT"
] | 4 | 2019-09-11T07:27:30.000Z | 2021-02-26T04:26:33.000Z | PSICT_extras/PSICT_MultiPulse/PSICT_MultiPulse.py | JeanOlivier/Labber-PSICT | f6d831823ec7c8373fd562b6d1247f7e438f1ee5 | [
"MIT"
] | 2 | 2021-02-25T15:51:34.000Z | 2021-02-25T16:15:05.000Z | #!/usr/bin/env python
import InstrumentDriver
import numpy as np
import os
import logging
from datetime import datetime
from PSICT_MultiPulse_tools import delistifyPulseDefs
from waveforms_handling import generatePulse, calculateWaveform, gen_pulse_sequence
class Driver(InstrumentDriver.InstrumentWorker):
""" ... | 44.331169 | 106 | 0.600996 |
import InstrumentDriver
import numpy as np
import os
import logging
from datetime import datetime
from PSICT_MultiPulse_tools import delistifyPulseDefs
from waveforms_handling import generatePulse, calculateWaveform, gen_pulse_sequence
class Driver(InstrumentDriver.InstrumentWorker):
def performOpen(self, opt... | true | true |
f76eef3b5707d756f75898714ff3b346dec1da24 | 3,521 | py | Python | rasa_core_sdk/events.py | MalwareC500/rasa_core_sdk | 01c81b401c26ff000bd4fcad86b3cdb17861ea2c | [
"Apache-2.0"
] | null | null | null | rasa_core_sdk/events.py | MalwareC500/rasa_core_sdk | 01c81b401c26ff000bd4fcad86b3cdb17861ea2c | [
"Apache-2.0"
] | null | null | null | rasa_core_sdk/events.py | MalwareC500/rasa_core_sdk | 01c81b401c26ff000bd4fcad86b3cdb17861ea2c | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from typing import Dict, Text, Any
logger = logging.getLogger(__name__)
EventType = Dict[Text, Any]
# noinspection PyPep8Naming
def UserUttered(text, p... | 26.276119 | 88 | 0.696109 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
from typing import Dict, Text, Any
logger = logging.getLogger(__name__)
EventType = Dict[Text, Any]
def UserUttered(text, parse_data=None, timestamp=No... | true | true |
f76eef86126e60a703908eb34dc97565cb8c2805 | 1,844 | py | Python | app.py | keklarup/POET_AiPoetry | ff197564ab13d0e2001093bc2b803d538dd52f59 | [
"Apache-2.0"
] | null | null | null | app.py | keklarup/POET_AiPoetry | ff197564ab13d0e2001093bc2b803d538dd52f59 | [
"Apache-2.0"
] | null | null | null | app.py | keklarup/POET_AiPoetry | ff197564ab13d0e2001093bc2b803d538dd52f59 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# app.py
from flask import Flask, request, render_template
import pickle
import gzip
import numpy as np
import AiPoems
#start up cell -- import necessary metadata for model
with open('tokenizer.pickle', 'rb') as handle:
tokenizer = pickle.load(handle)
with gzip.GzipFile('predictors.npy.gz'... | 29.741935 | 113 | 0.707158 |
from flask import Flask, request, render_template
import pickle
import gzip
import numpy as np
import AiPoems
with open('tokenizer.pickle', 'rb') as handle:
tokenizer = pickle.load(handle)
with gzip.GzipFile('predictors.npy.gz', "r") as f:
predictors=np.load(f)
with gzip.GzipFile('label.npy.gz', "r") as f:
... | true | true |
f76ef0602029c1e576deb3877b461b02d78850d5 | 1,485 | py | Python | setup.py | mikiec84/wagtail_app_pages | 110994be401f23ae2e5d4566fab73047ce8c5247 | [
"MIT"
] | null | null | null | setup.py | mikiec84/wagtail_app_pages | 110994be401f23ae2e5d4566fab73047ce8c5247 | [
"MIT"
] | 2 | 2021-04-20T14:16:22.000Z | 2021-06-10T23:08:37.000Z | setup.py | mikiec84/wagtail_app_pages | 110994be401f23ae2e5d4566fab73047ce8c5247 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'wagtail>=1.11.1,<2.5',
]
setup_... | 28.557692 | 58 | 0.654545 |
from setuptools import setup, find_packages
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
'wagtail>=1.11.1,<2.5',
]
setup_requirements = []
test_requirements = []
setup(
author="Marco We... | true | true |
f76ef091034cd432eb8e3509b1766b6743ae73cd | 6,667 | py | Python | generated/intermediate/ansible-module-rest/azure_rm_recoveryservicesvaultextendedinfo_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/intermediate/ansible-module-rest/azure_rm_recoveryservicesvaultextendedinfo_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | generated/intermediate/ansible-module-rest/azure_rm_recoveryservicesvaultextendedinfo_info.py | audevbot/autorest.devops.debug | a507fb6e2dd7826212537f27d583f203aac1c28f | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2019 Zim Kalinowski, (@zikalino)
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 29.241228 | 113 | 0.557522 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: azure_rm_recoveryservicesvaultextendedinfo_inf... | true | true |
f76ef0aabf701d7550baf9e8539077abd3b676ee | 12,775 | py | Python | docs/developer/release/release_vars.py | rodrofr/checker-framework | 82ab85f3ac86ffd0765a4e6184e6d8f65cdd3fd5 | [
"MIT"
] | 1 | 2020-12-03T15:27:33.000Z | 2020-12-03T15:27:33.000Z | docs/developer/release/release_vars.py | rodrofr/checker-framework | 82ab85f3ac86ffd0765a4e6184e6d8f65cdd3fd5 | [
"MIT"
] | null | null | null | docs/developer/release/release_vars.py | rodrofr/checker-framework | 82ab85f3ac86ffd0765a4e6184e6d8f65cdd3fd5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
"""
release_vars.py
Created by Jonathan Burke on 2013-02-05.
Copyright (c) 2014 University of Washington. All rights reserved.
"""
# See release_development.html for an explanation of how the release process works
# it will be invaluable when trying to understand the scripts ... | 47.846442 | 295 | 0.763209 | """
release_vars.py
Created by Jonathan Burke on 2013-02-05.
Copyright (c) 2014 University of Washington. All rights reserved.
"""
import os
import datetime
import pwd
import subprocess
import shlex
def getAndAppend(name, append):
"""Retrieves the given environment variable and appends the given string to
... | false | true |
f76ef1331db8c311452737f6b64bc409412d2919 | 4,023 | py | Python | game/model/entity/character/hero.py | AntonYermilov/progue | 7f382208c9efc904cff9d8df4750606039801d45 | [
"MIT"
] | null | null | null | game/model/entity/character/hero.py | AntonYermilov/progue | 7f382208c9efc904cff9d8df4750606039801d45 | [
"MIT"
] | 6 | 2019-03-25T21:11:28.000Z | 2019-06-21T16:21:47.000Z | game/model/entity/character/hero.py | AntonYermilov/progue | 7f382208c9efc904cff9d8df4750606039801d45 | [
"MIT"
] | 1 | 2021-12-22T22:03:47.000Z | 2021-12-22T22:03:47.000Z | from dataclasses import dataclass
from typing import Dict
import numpy as np
from game import Position
from game.model.entity.damage import Damageable, Damage, DamageType
from game.model.entity.inventory.inventory_keeper import InventoryKeeper
from game.model.entity.item.item import Item
from .character import Charac... | 42.347368 | 125 | 0.65921 | from dataclasses import dataclass
from typing import Dict
import numpy as np
from game import Position
from game.model.entity.damage import Damageable, Damage, DamageType
from game.model.entity.inventory.inventory_keeper import InventoryKeeper
from game.model.entity.item.item import Item
from .character import Charac... | true | true |
f76ef28dc1788a4149221ffaaf4df5319a59957a | 20,320 | py | Python | salt/utils/templates.py | timgates42/salt | 8c2cde3c2160b8d14744ecc9e591650f00af2d1e | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/utils/templates.py | timgates42/salt | 8c2cde3c2160b8d14744ecc9e591650f00af2d1e | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/utils/templates.py | timgates42/salt | 8c2cde3c2160b8d14744ecc9e591650f00af2d1e | [
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Template render systems
'''
from __future__ import absolute_import, print_function, unicode_literals
# Import Python libs
import codecs
import os
import logging
import tempfile
import traceback
import sys
# Import 3rd-party libs
import jinja2
import jinja2.ext
from salt.ext import six
if... | 34.09396 | 147 | 0.606299 |
from __future__ import absolute_import, print_function, unicode_literals
import codecs
import os
import logging
import tempfile
import traceback
import sys
import jinja2
import jinja2.ext
from salt.ext import six
if sys.version_info[:2] >= (3, 5):
import importlib.machinery import importlib.util USE_I... | true | true |
f76ef38b7f14c7d09577658d04d935256f7061f4 | 2,382 | py | Python | Gds/src/fprime_gds/flask/channels.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 1 | 2021-05-08T10:56:01.000Z | 2021-05-08T10:56:01.000Z | Gds/src/fprime_gds/flask/channels.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | 1 | 2021-04-11T06:34:02.000Z | 2021-05-04T17:15:32.000Z | Gds/src/fprime_gds/flask/channels.py | SSteve/fprime | 12c478bd79c2c4ba2d9f9e634e47f8b6557c54a8 | [
"Apache-2.0"
] | null | null | null | ####
# channels.py:
#
# This file captures the HTML endpoint for the events list. This file contains one endpoint which allows for listing
# events after a certain time-stamp.
#
# GET /events: list events
# Input Data: {
# "start-time": "YYYY-MM-DDTHH:MM:SS.sss" #Start time for event listing
... | 30.151899 | 116 | 0.601595 | import types
import flask_restful
import flask_restful.reqparse
class ChannelDictionary(flask_restful.Resource):
def __init__(self, dictionary):
self.dictionary = dictionary
def get(self):
return self.dictionary
class ChannelHistory(flask_restful.Resource):
def __init__(self, history... | true | true |
f76ef42df7b20fcb56afe9a827caea9ec579681c | 3,533 | py | Python | udp_receiver.py | jinwen/dms_image_sample | 3bab6b7f4cfdee07dc887e9a11034dec067fa57e | [
"Apache-2.0"
] | null | null | null | udp_receiver.py | jinwen/dms_image_sample | 3bab6b7f4cfdee07dc887e9a11034dec067fa57e | [
"Apache-2.0"
] | null | null | null | udp_receiver.py | jinwen/dms_image_sample | 3bab6b7f4cfdee07dc887e9a11034dec067fa57e | [
"Apache-2.0"
] | null | null | null | import socket
import select
import logging
from crccheck.crc import Crc8, Crc16
def parseData(data):
byte_data = bytearray(data)
header = byte_data[:26]
sop = header[0]
camera_id = header[1]
image_type = header[2]
width = (header[... | 37.585106 | 114 | 0.497028 | import socket
import select
import logging
from crccheck.crc import Crc8, Crc16
def parseData(data):
byte_data = bytearray(data)
header = byte_data[:26]
sop = header[0]
camera_id = header[1]
image_type = header[2]
width = (header[... | true | true |
f76ef435e8466660ada8ae183eb6de4b8595f1f0 | 1,477 | py | Python | test/CrossImport/Inputs/rewrite-module-triples.py | ApolloZhu/swift | ec1892a8f0178bc7bf7b3b9cbedd14c6802af6f4 | [
"Apache-2.0"
] | 15 | 2019-09-05T14:56:40.000Z | 2021-06-06T14:09:23.000Z | test/CrossImport/Inputs/rewrite-module-triples.py | SunSatan/swift | aa6e600d6adeea630eb304f7572ef4ef71c262dd | [
"Apache-2.0"
] | 8 | 2020-08-29T22:47:59.000Z | 2020-09-20T03:24:15.000Z | test/CrossImport/Inputs/rewrite-module-triples.py | SunSatan/swift | aa6e600d6adeea630eb304f7572ef4ef71c262dd | [
"Apache-2.0"
] | 2 | 2017-04-06T22:10:07.000Z | 2020-10-31T00:26:28.000Z | #!/usr/bin/env python
"""
Renames files or directories with "module-triple-here" in their names to use
the indicated module triples instead.
"""
from __future__ import print_function
import os
import platform
import shutil
import sys
if len(sys.argv) < 3:
print('Too few args to ' + sys.argv[0])
print('Usage:... | 26.854545 | 77 | 0.609343 |
from __future__ import print_function
import os
import platform
import shutil
import sys
if len(sys.argv) < 3:
print('Too few args to ' + sys.argv[0])
print('Usage: rewrite-module-triples.py <root-dir> <module-triple>...')
sys.exit(1)
root_dir = sys.argv[1]
triples = sys.argv[2:]
def rewritten_names(n... | true | true |
f76ef65d571b8543a5b9c7085fd88db616ec6b20 | 1,017 | py | Python | src/ralph/dc_view/views/ui.py | DoNnMyTh/ralph | 97b91639fa68965ad3fd9d0d2652a6545a2a5b72 | [
"Apache-2.0"
] | 1,668 | 2015-01-01T12:51:20.000Z | 2022-03-29T09:05:35.000Z | src/ralph/dc_view/views/ui.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 2,314 | 2015-01-02T13:26:26.000Z | 2022-03-29T04:06:03.000Z | src/ralph/dc_view/views/ui.py | hq-git/ralph | e2448caf02d6e5abfd81da2cff92aefe0a534883 | [
"Apache-2.0"
] | 534 | 2015-01-05T12:40:28.000Z | 2022-03-29T21:10:12.000Z | import json
from django.conf import settings
from django.db.models import Count
from ralph.admin.mixins import RalphTemplateView
from ralph.data_center.models.physical import DataCenter
class ServerRoomView(RalphTemplateView):
template_name = 'dc_view/server_room_view.html'
def get_context_data(self, **kwa... | 31.78125 | 106 | 0.718781 | import json
from django.conf import settings
from django.db.models import Count
from ralph.admin.mixins import RalphTemplateView
from ralph.data_center.models.physical import DataCenter
class ServerRoomView(RalphTemplateView):
template_name = 'dc_view/server_room_view.html'
def get_context_data(self, **kwa... | true | true |
f76ef687bd9d4f2e712dc92a6122f627e6fe8111 | 1,419 | py | Python | lhzoss.py | LiHongzhuo/wxBot | 98c7acee5a076332c8de2bac091e04d7f661edb6 | [
"Apache-2.0"
] | null | null | null | lhzoss.py | LiHongzhuo/wxBot | 98c7acee5a076332c8de2bac091e04d7f661edb6 | [
"Apache-2.0"
] | null | null | null | lhzoss.py | LiHongzhuo/wxBot | 98c7acee5a076332c8de2bac091e04d7f661edb6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import ConfigParser
import oss2
import sys
from itertools import islice
reload(sys)
sys.setdefaultencoding('utf-8')
# 获取配置
config = ConfigParser.ConfigParser()
path = os.path.split(os.path.realpath(__file__))[0] + '/config.conf'
config.read(path)
ossAccessKeyId = config.g... | 36.384615 | 82 | 0.699084 | import os
import ConfigParser
import oss2
import sys
from itertools import islice
reload(sys)
sys.setdefaultencoding('utf-8')
config = ConfigParser.ConfigParser()
path = os.path.split(os.path.realpath(__file__))[0] + '/config.conf'
config.read(path)
ossAccessKeyId = config.get('makelove', 'ossAccessKeyId')
... | true | true |
f76ef71a6193c1035991fc0f909e125148fbc847 | 2,061 | py | Python | capstone/capdb/migrations/0118_auto_20210816_1521.py | ChefAndy/capstone | bac7c44518312c5b64462ea92ecbabdcb5d29bb6 | [
"MIT"
] | 134 | 2017-07-12T17:03:06.000Z | 2022-03-27T06:38:29.000Z | capstone/capdb/migrations/0118_auto_20210816_1521.py | fakegit/capstone | 57647481de99bbe4af52b6dd5ade1954fba41a2d | [
"MIT"
] | 1,362 | 2017-06-22T17:42:49.000Z | 2022-03-31T15:28:00.000Z | capstone/capdb/migrations/0118_auto_20210816_1521.py | ChefAndy/capstone | bac7c44518312c5b64462ea92ecbabdcb5d29bb6 | [
"MIT"
] | 38 | 2017-06-22T14:46:23.000Z | 2022-03-16T05:32:54.000Z | # Generated by Django 3.2.6 on 2021-08-16 15:21
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('capdb', '0117_extractedcitation_opinion_id'),
]
operations = [
migrations.AddField(
model_name=... | 40.411765 | 172 | 0.600679 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('capdb', '0117_extractedcitation_opinion_id'),
]
operations = [
migrations.AddField(
model_name='casemetadata',
name='batch',
... | true | true |
f76ef77044cd74e8e5bd57f05f828b7dc178b0df | 279 | py | Python | dataclasses_json/__init__.py | nr23/dataclasses-json | 22a25d03f307134ae748c6f842bcafd6357c8b25 | [
"MIT"
] | 1 | 2021-08-20T05:43:20.000Z | 2021-08-20T05:43:20.000Z | dataclasses_json/__init__.py | nr23/dataclasses-json | 22a25d03f307134ae748c6f842bcafd6357c8b25 | [
"MIT"
] | null | null | null | dataclasses_json/__init__.py | nr23/dataclasses-json | 22a25d03f307134ae748c6f842bcafd6357c8b25 | [
"MIT"
] | 1 | 2020-10-11T06:05:00.000Z | 2020-10-11T06:05:00.000Z | # flake8: noqa
from dataclasses_json.api import (DataClassJsonMixin,
LetterCase,
dataclass_json)
from dataclasses_json.cfg import config, global_config
from dataclasses_json.undefined import CatchAll, Undefined
| 39.857143 | 58 | 0.648746 | from dataclasses_json.api import (DataClassJsonMixin,
LetterCase,
dataclass_json)
from dataclasses_json.cfg import config, global_config
from dataclasses_json.undefined import CatchAll, Undefined
| true | true |
f76ef867476812a610a679c38a98e197581d2757 | 4,541 | py | Python | main.py | MatMasIt/sqlGram | c620f10a21eec99a0f12816f510fe333ab75c7f4 | [
"MIT"
] | null | null | null | main.py | MatMasIt/sqlGram | c620f10a21eec99a0f12816f510fe333ab75c7f4 | [
"MIT"
] | null | null | null | main.py | MatMasIt/sqlGram | c620f10a21eec99a0f12816f510fe333ab75c7f4 | [
"MIT"
] | null | null | null | import configparser
import json
import colorama
import pymysql.cursors
import telebot
from tabulate import tabulate
import init
colorama.init()
config = configparser.ConfigParser()
config.read("conf.ini")
bot = telebot.TeleBot(config["DATA"]["token"].strip())
connection = pymysql.connect(host=config["DB"]["host"... | 36.918699 | 112 | 0.524334 | import configparser
import json
import colorama
import pymysql.cursors
import telebot
from tabulate import tabulate
import init
colorama.init()
config = configparser.ConfigParser()
config.read("conf.ini")
bot = telebot.TeleBot(config["DATA"]["token"].strip())
connection = pymysql.connect(host=config["DB"]["host"... | true | true |
f76ef8a20fd32c3638ab6cbf1cd7499dd7a2b636 | 8,504 | py | Python | tests/test_controls.py | qureshinomaan/habitat-sim | df2540b658d0444e84bbc7a0c3fb995f8d523b52 | [
"MIT"
] | 1 | 2020-10-08T04:35:52.000Z | 2020-10-08T04:35:52.000Z | tests/test_controls.py | qureshinomaan/habitat-sim | df2540b658d0444e84bbc7a0c3fb995f8d523b52 | [
"MIT"
] | null | null | null | tests/test_controls.py | qureshinomaan/habitat-sim | df2540b658d0444e84bbc7a0c3fb995f8d523b52 | [
"MIT"
] | 1 | 2021-03-18T05:54:08.000Z | 2021-03-18T05:54:08.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import attr
import hypothesis
import magnum as mn
import numpy as np
import pytest
import quaternion # noqa: F401
from ... | 32.833977 | 87 | 0.680738 |
import attr
import hypothesis
import magnum as mn
import numpy as np
import pytest
import quaternion from hypothesis import strategies as st
import habitat_sim
import habitat_sim.errors
from habitat_sim.utils.common import angle_between_quats, quat_from_angle_axis
def test_no_action():
scene_graph = habitat_s... | true | true |
f76ef93bf8a26a8e18ea6b39336ba9aa6b0c1759 | 5,435 | py | Python | src/tabmat/dense_matrix.py | readthedocs-assistant/tabmat | c2d82db1901afb0ea79806f26ee66068d553b3e6 | [
"BSD-3-Clause"
] | null | null | null | src/tabmat/dense_matrix.py | readthedocs-assistant/tabmat | c2d82db1901afb0ea79806f26ee66068d553b3e6 | [
"BSD-3-Clause"
] | null | null | null | src/tabmat/dense_matrix.py | readthedocs-assistant/tabmat | c2d82db1901afb0ea79806f26ee66068d553b3e6 | [
"BSD-3-Clause"
] | null | null | null | from typing import List, Optional, Union
import numpy as np
from .ext.dense import (
dense_matvec,
dense_rmatvec,
dense_sandwich,
transpose_square_dot_weights,
)
from .matrix_base import MatrixBase
from .util import (
check_matvec_out_shape,
check_transpose_matvec_out_shape,
setup_restrict... | 34.398734 | 87 | 0.600368 | from typing import List, Optional, Union
import numpy as np
from .ext.dense import (
dense_matvec,
dense_rmatvec,
dense_sandwich,
transpose_square_dot_weights,
)
from .matrix_base import MatrixBase
from .util import (
check_matvec_out_shape,
check_transpose_matvec_out_shape,
setup_restrict... | true | true |
f76efa281b82f6f3b4bc17e22944f7b20d54d8a3 | 2,008 | py | Python | tests/test_errors.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | 214 | 2019-01-19T03:56:10.000Z | 2022-03-31T01:37:33.000Z | tests/test_errors.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | 120 | 2019-03-19T23:01:52.000Z | 2022-03-14T08:41:27.000Z | tests/test_errors.py | Fogapod/edgedb-python | 377805660e3455bef536412bd5467b435753b3a5 | [
"Apache-2.0"
] | 24 | 2019-04-29T22:41:10.000Z | 2021-11-15T00:28:01.000Z | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2016-present MagicStack Inc. and the EdgeDB 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... | 32.387097 | 74 | 0.697709 |
import unittest
from edgedb import errors
from edgedb.errors import _base as base_errors
class TestErrors(unittest.TestCase):
def test_errors_1(self):
new = base_errors.EdgeDBError._from_code
e = new(0x_04_00_00_00, 'aa')
self.assertIs(type(e), errors.QueryError)
self.assertE... | true | true |
f76efb07220bb96137c47f2b2dba1435b76ce321 | 674 | py | Python | data/Twitter_NER/generate.py | bzcheeseman/Dali | a77c7ce60b20ce150a5927747e128688657907eb | [
"MIT"
] | null | null | null | data/Twitter_NER/generate.py | bzcheeseman/Dali | a77c7ce60b20ce150a5927747e128688657907eb | [
"MIT"
] | null | null | null | data/Twitter_NER/generate.py | bzcheeseman/Dali | a77c7ce60b20ce150a5927747e128688657907eb | [
"MIT"
] | null | null | null | import random
import sys
from os import listdir
from os.path import isdir, isfile, join, dirname, realpath
# add data to path
DATA_DIR = dirname(dirname(realpath(__file__)))
sys.path.append(DATA_DIR)
from utils import print_progress, execute_bash
THIS_DATA_DIR = dirname(realpath(__file__))
# important
TEXT_URL = '... | 25.923077 | 96 | 0.744807 | import random
import sys
from os import listdir
from os.path import isdir, isfile, join, dirname, realpath
DATA_DIR = dirname(dirname(realpath(__file__)))
sys.path.append(DATA_DIR)
from utils import print_progress, execute_bash
THIS_DATA_DIR = dirname(realpath(__file__))
TEXT_URL = 'https://raw.githubusercontent.c... | true | true |
f76efb0f5db0037ddd8b45914354ed66aa0b3bd0 | 1,281 | py | Python | mAccessViolation/fbUpdateReportForNULLPointer.py | SkyLined/mBugId | 781bfe9a120e55630a91ce1e86b39ad0dee031ec | [
"CC-BY-4.0"
] | 22 | 2016-08-11T14:50:55.000Z | 2021-06-06T09:39:26.000Z | mAccessViolation/fbUpdateReportForNULLPointer.py | SkyLined/mBugId | 781bfe9a120e55630a91ce1e86b39ad0dee031ec | [
"CC-BY-4.0"
] | 19 | 2016-09-07T05:54:40.000Z | 2020-07-02T07:46:38.000Z | mAccessViolation/fbUpdateReportForNULLPointer.py | SkyLined/mBugId | 781bfe9a120e55630a91ce1e86b39ad0dee031ec | [
"CC-BY-4.0"
] | 11 | 2016-09-03T22:42:50.000Z | 2018-10-01T18:28:59.000Z | from ..fsGetNumberDescription import fsGetNumberDescription;
from mWindowsAPI import oSystemInfo;
def fbUpdateReportForNULLPointer(
oCdbWrapper, oBugReport, oProcess, oThread, sViolationTypeId, uAccessViolationAddress, sViolationVerb, oVirtualAllocation
):
if uAccessViolationAddress == 0:
sOffset = "";
elif ... | 55.695652 | 144 | 0.774395 | from ..fsGetNumberDescription import fsGetNumberDescription;
from mWindowsAPI import oSystemInfo;
def fbUpdateReportForNULLPointer(
oCdbWrapper, oBugReport, oProcess, oThread, sViolationTypeId, uAccessViolationAddress, sViolationVerb, oVirtualAllocation
):
if uAccessViolationAddress == 0:
sOffset = "";
elif ... | true | true |
f76efb2bc8ee296d8fcbf3ad1ecf685088368929 | 7,895 | py | Python | homeassistant/components/onvif/event.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 1 | 2021-10-01T10:38:31.000Z | 2021-10-01T10:38:31.000Z | homeassistant/components/onvif/event.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/onvif/event.py | DoctorU/core | 5b218d7e1c4164e32d41473977459cbaf23adf42 | [
"Apache-2.0"
] | 2 | 2021-01-26T07:41:33.000Z | 2021-01-26T07:45:11.000Z | """ONVIF event abstraction."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
from contextlib import suppress
import datetime as dt
from httpx import RemoteProtocolError, TransportError
from onvif import ONVIFCamera, ONVIFService
from zeep.exceptions import Fault
from homeassi... | 33.312236 | 89 | 0.593414 | from __future__ import annotations
import asyncio
from collections.abc import Callable
from contextlib import suppress
import datetime as dt
from httpx import RemoteProtocolError, TransportError
from onvif import ONVIFCamera, ONVIFService
from zeep.exceptions import Fault
from homeassistant.core import CALLBACK_TYPE... | true | true |
f76efb8bc13731da5e2eb118319ce44f052d3999 | 294 | py | Python | api/models.py | ptyadana/django-WEB-video-rental | 19918a212ba6f06069ad0b14926c2f77a51da308 | [
"MIT"
] | null | null | null | api/models.py | ptyadana/django-WEB-video-rental | 19918a212ba6f06069ad0b14926c2f77a51da308 | [
"MIT"
] | 9 | 2021-03-30T13:02:01.000Z | 2022-03-12T00:23:09.000Z | api/models.py | ptyadana/django-WEB-video-rental | 19918a212ba6f06069ad0b14926c2f77a51da308 | [
"MIT"
] | null | null | null | from django.db import models
from tastypie.resources import ModelResource
from movies.models import Movie
# Create your models here.
class MovieResource(ModelResource):
class Meta:
queryset = Movie.objects.all()
resource_name = 'movies'
excludes = ['date_created']
| 26.727273 | 44 | 0.72449 | from django.db import models
from tastypie.resources import ModelResource
from movies.models import Movie
class MovieResource(ModelResource):
class Meta:
queryset = Movie.objects.all()
resource_name = 'movies'
excludes = ['date_created']
| true | true |
f76efc59c667be7709879a7118e3ae876db5c859 | 4,498 | py | Python | devel/lib/python2.7/dist-packages/kinova_msgs/msg/_CartesianForce.py | madalynlmillen/MadalynMillenCapstone | a1585ba419d4ab4854908b4ba88e4c8ca330b5cd | [
"MIT",
"Unlicense"
] | null | null | null | devel/lib/python2.7/dist-packages/kinova_msgs/msg/_CartesianForce.py | madalynlmillen/MadalynMillenCapstone | a1585ba419d4ab4854908b4ba88e4c8ca330b5cd | [
"MIT",
"Unlicense"
] | null | null | null | devel/lib/python2.7/dist-packages/kinova_msgs/msg/_CartesianForce.py | madalynlmillen/MadalynMillenCapstone | a1585ba419d4ab4854908b4ba88e4c8ca330b5cd | [
"MIT",
"Unlicense"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from kinova_msgs/CartesianForce.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class CartesianForce(genpy.Message):
_md5sum = "b01974557c40b776cdb7003057779989"
_typ... | 34.335878 | 145 | 0.664295 | import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class CartesianForce(genpy.Message):
_md5sum = "b01974557c40b776cdb7003057779989"
_type = "kinova_msgs/CartesianForce"
_has_header = False _full_text = """float32 force_x
float32 force_y
float32 force_z
float32 torq... | true | true |
f76efc8744e6a34780dc4f0756a95e50d3640058 | 201 | py | Python | asgi.py | magiskboy/library-backend | 80487d08bb3b13f048ab8721ef3d26ce217d3f36 | [
"MIT"
] | null | null | null | asgi.py | magiskboy/library-backend | 80487d08bb3b13f048ab8721ef3d26ce217d3f36 | [
"MIT"
] | null | null | null | asgi.py | magiskboy/library-backend | 80487d08bb3b13f048ab8721ef3d26ce217d3f36 | [
"MIT"
] | null | null | null | import logging
from library import create_app
# disable uvicorn access log
logging.getLogger("uvicorn.access").handlers = []
logging.getLogger("uvicorn.access").propagate = False
app = create_app()
| 20.1 | 53 | 0.776119 | import logging
from library import create_app
logging.getLogger("uvicorn.access").handlers = []
logging.getLogger("uvicorn.access").propagate = False
app = create_app()
| true | true |
f76efd1913386da3036186c950bdfb88e56e2bc7 | 13,805 | py | Python | python/helpers/sphinxcontrib/napoleon/__init__.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/helpers/sphinxcontrib/napoleon/__init__.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/helpers/sphinxcontrib/napoleon/__init__.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Rob Ruana
# Licensed under the BSD License, see LICENSE file for details.
"""Sphinx napoleon extension -- support for NumPy and Google style docstrings.
"""
import sys
from six import iteritems
from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring
from ... | 35.579897 | 79 | 0.605071 |
import sys
from six import iteritems
from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring
from sphinxcontrib.napoleon._version import __version__
assert __version__
class Config(object):
_config_values = {
'napoleon_google_docstring': (True, 'env'),
'napoleon_numpy_docs... | true | true |
f76efd7481c123d2c5611d9161fffa278e6b7e5f | 20,779 | py | Python | src/core/flask_server.py | jeeve/gpsanapy | dc9ae35f6e6209119bfbbdf87af94ca2d6a24921 | [
"Apache-2.0"
] | 4 | 2021-01-04T18:18:45.000Z | 2021-02-26T08:53:30.000Z | src/core/flask_server.py | jeeve/gpsanapy | dc9ae35f6e6209119bfbbdf87af94ca2d6a24921 | [
"Apache-2.0"
] | 5 | 2021-01-04T20:32:33.000Z | 2021-07-23T15:58:24.000Z | src/core/flask_server.py | jeeve/gpsanapy | dc9ae35f6e6209119bfbbdf87af94ca2d6a24921 | [
"Apache-2.0"
] | 2 | 2021-03-04T12:27:01.000Z | 2021-03-24T20:30:06.000Z | from flask import Flask, request, g, render_template, redirect, flash, url_for, session, abort
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import joinedload
#from flask import reqparse, fields, Resource, Api,
from werkzeug.datastructures import FileStorage
from werkzeug.security import check_password_ha... | 35.099662 | 149 | 0.656961 | from flask import Flask, request, g, render_template, redirect, flash, url_for, session, abort
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.orm import joinedload
from werkzeug.datastructures import FileStorage
from werkzeug.security import check_password_hash, generate_password_hash
from werkzeug.utils impor... | true | true |
f76efdc61173fc6e8fe0a0e439a6b182d1da4ba0 | 244 | py | Python | api/user_by_id.py | DiegoPrestesGit/flask-crud | 2f5d1581ac215e2cc2f0cbd6ec173bed1f78ab1a | [
"MIT"
] | null | null | null | api/user_by_id.py | DiegoPrestesGit/flask-crud | 2f5d1581ac215e2cc2f0cbd6ec173bed1f78ab1a | [
"MIT"
] | null | null | null | api/user_by_id.py | DiegoPrestesGit/flask-crud | 2f5d1581ac215e2cc2f0cbd6ec173bed1f78ab1a | [
"MIT"
] | null | null | null | from flask_restful import Resource
import logging as logger
from .database import get_user_by_id
class UserById(Resource):
def get(self, user_id):
selected_user = get_user_by_id(user_id)
return selected_user, 200
| 24.4 | 48 | 0.729508 | from flask_restful import Resource
import logging as logger
from .database import get_user_by_id
class UserById(Resource):
def get(self, user_id):
selected_user = get_user_by_id(user_id)
return selected_user, 200
| true | true |
f76efdd95189187acd489657d847a3284aae0da9 | 2,462 | py | Python | epoal_src/ToDimacs.py | ai-se/parGALE | 2922e7e5f382c795b1f58d9e45be54b88d2ed1eb | [
"Unlicense"
] | null | null | null | epoal_src/ToDimacs.py | ai-se/parGALE | 2922e7e5f382c795b1f58d9e45be54b88d2ed1eb | [
"Unlicense"
] | 3 | 2016-01-19T17:24:23.000Z | 2016-01-27T17:14:27.000Z | epoal_src/ToDimacs.py | ai-se/parGALE | 2922e7e5f382c795b1f58d9e45be54b88d2ed1eb | [
"Unlicense"
] | null | null | null | '''
Created on Jan 17, 2014
@author: ezulkosk
'''
from z3 import Tactic, IntNumRef, BoolRef, is_not, BoolSortRef, Not, simplify
import Z3ModelERSNoObjectives as ERS
import Z3ModelEShopNoObjectives as SHP
import Z3ModelWPTNoObjectives as WPT
import sys
import z3
class DimacsConverter():
def __init__(self):
... | 28.964706 | 77 | 0.492283 | from z3 import Tactic, IntNumRef, BoolRef, is_not, BoolSortRef, Not, simplify
import Z3ModelERSNoObjectives as ERS
import Z3ModelEShopNoObjectives as SHP
import Z3ModelWPTNoObjectives as WPT
import sys
import z3
class DimacsConverter():
def __init__(self):
self.vars = {}
self.varcount = 1
... | true | true |
f76efddcfa4178b5c10a0085073d16dd79a631c1 | 2,436 | py | Python | tests/test_util.py | bittlingmayer/pyconll | b32aac1914bc37f0d952ec78ed549b338ddac059 | [
"MIT"
] | 1 | 2020-07-19T13:16:29.000Z | 2020-07-19T13:16:29.000Z | tests/test_util.py | bittlingmayer/pyconll | b32aac1914bc37f0d952ec78ed549b338ddac059 | [
"MIT"
] | null | null | null | tests/test_util.py | bittlingmayer/pyconll | b32aac1914bc37f0d952ec78ed549b338ddac059 | [
"MIT"
] | null | null | null | import operator
import pytest
from pyconll.util import find_ngrams
from pyconll import load_from_file
from tests.util import fixture_location
def test_ngram_standard():
"""
Test if the find_ngram method works for standard situations.
"""
c = load_from_file(fixture_location('basic.conll'))
s, i ... | 26.769231 | 80 | 0.675698 | import operator
import pytest
from pyconll.util import find_ngrams
from pyconll import load_from_file
from tests.util import fixture_location
def test_ngram_standard():
c = load_from_file(fixture_location('basic.conll'))
s, i = next(find_ngrams(c, 'un film sur la'.split()))
assert s.id == 'fr-ud-dev_00... | true | true |
f76efdeea17e36c827a3bc65f3c91e995ee816ca | 808 | py | Python | notifications/match_score.py | samuelcouch/the-blue-alliance | 8c7977071dbe9d9745ffdfbb03e37bd016792511 | [
"MIT"
] | null | null | null | notifications/match_score.py | samuelcouch/the-blue-alliance | 8c7977071dbe9d9745ffdfbb03e37bd016792511 | [
"MIT"
] | null | null | null | notifications/match_score.py | samuelcouch/the-blue-alliance | 8c7977071dbe9d9745ffdfbb03e37bd016792511 | [
"MIT"
] | null | null | null | from consts.notification_type import NotificationType
from helpers.model_to_dict import ModelToDict
from notifications.base_notification import BaseNotification
class MatchScoreNotification(BaseNotification):
def __init__(self, match):
self.match = match
self.event = match.event.get()
sel... | 32.32 | 78 | 0.704208 | from consts.notification_type import NotificationType
from helpers.model_to_dict import ModelToDict
from notifications.base_notification import BaseNotification
class MatchScoreNotification(BaseNotification):
def __init__(self, match):
self.match = match
self.event = match.event.get()
sel... | true | true |
f76efe3169bf2ddcce81e56753c31f2dd58a7880 | 9,039 | py | Python | mr/syncema.py | alekseyrybalkin/monorepo | dcbfdf930cc56ddbf8434cb06b9c67661de9597a | [
"WTFPL"
] | null | null | null | mr/syncema.py | alekseyrybalkin/monorepo | dcbfdf930cc56ddbf8434cb06b9c67661de9597a | [
"WTFPL"
] | null | null | null | mr/syncema.py | alekseyrybalkin/monorepo | dcbfdf930cc56ddbf8434cb06b9c67661de9597a | [
"WTFPL"
] | null | null | null | import argparse
import imaplib
import logging
import mailbox
import os
import re
import signal
import sys
import time
import mr.config
import mr.db
class IMAPTool:
def __init__(self, imap):
self.imap = imap
def _check_error(self, status, response):
if status != 'OK':
raise Runtim... | 36.011952 | 117 | 0.580263 | import argparse
import imaplib
import logging
import mailbox
import os
import re
import signal
import sys
import time
import mr.config
import mr.db
class IMAPTool:
def __init__(self, imap):
self.imap = imap
def _check_error(self, status, response):
if status != 'OK':
raise Runtim... | true | true |
f76efe5e1dfc1f9781edb91b25b10382d331d71d | 27,161 | py | Python | slowapi/extension.py | thomasleveil/slowapi | 4c4141a7dbecf03cd03e0a4529bcf9ba42de687b | [
"MIT"
] | null | null | null | slowapi/extension.py | thomasleveil/slowapi | 4c4141a7dbecf03cd03e0a4529bcf9ba42de687b | [
"MIT"
] | null | null | null | slowapi/extension.py | thomasleveil/slowapi | 4c4141a7dbecf03cd03e0a4529bcf9ba42de687b | [
"MIT"
] | null | null | null | """
The starlette extension to rate-limit requests
"""
import asyncio
import datetime
import functools
import inspect
import itertools
import json
import logging
import sys
import time
import warnings
from email.utils import formatdate, parsedate_to_datetime
from functools import wraps
from typing import (Any, Awaitabl... | 41.028701 | 111 | 0.589117 | import asyncio
import datetime
import functools
import inspect
import itertools
import json
import logging
import sys
import time
import warnings
from email.utils import formatdate, parsedate_to_datetime
from functools import wraps
from typing import (Any, Awaitable, Callable, Dict, List, Optional, Set, Tuple,
... | true | true |
f76eff29527bd228642e051e41a02acb2bb69352 | 2,389 | py | Python | encoder_train.py | lsh950919/sv2tts | a6ff637ac478b8b3ce4dcc5a776442cab9cbdd67 | [
"MIT"
] | 3 | 2021-04-26T00:17:14.000Z | 2021-07-04T15:30:09.000Z | backend/microservices/TTS/VC/encoder_train.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | null | null | null | backend/microservices/TTS/VC/encoder_train.py | MuhamedAbdalla/Automatic-Audio-Book-Based-On-Emotion-Detection | 72130ad037b900461af5be6d80b27ab29c81de5e | [
"MIT"
] | null | null | null | from utils.argutils import print_args
from encoder.train import train
from pathlib import Path
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Trains the speaker encoder. You must have run encoder_preprocess.py first.",
formatter_class=argparse.Ar... | 50.829787 | 98 | 0.666806 | from utils.argutils import print_args
from encoder.train import train
from pathlib import Path
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Trains the speaker encoder. You must have run encoder_preprocess.py first.",
formatter_class=argparse.Ar... | true | true |
f76f01321348d1bfa710929c17891ececd8e036e | 12,707 | py | Python | rlscore/test/test_learner/test_query_rankrls.py | vishalbelsare/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 61 | 2015-03-06T08:48:01.000Z | 2021-04-26T16:13:07.000Z | rlscore/test/test_learner/test_query_rankrls.py | andrecamara/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 5 | 2016-09-08T15:47:00.000Z | 2019-02-25T17:44:55.000Z | rlscore/test/test_learner/test_query_rankrls.py | vishalbelsare/RLScore | 713f0a402f7a09e41a609f2ddcaf849b2021a0a7 | [
"MIT"
] | 31 | 2015-01-28T15:05:33.000Z | 2021-04-16T19:39:48.000Z | import numpy as np
import numpy.linalg as la
from numpy.testing import assert_allclose
import unittest
from rlscore.learner import QueryRankRLS
from rlscore.kernel import GaussianKernel, PolynomialKernel
def mapQids(qids):
"""Maps qids to running numbering starting from zero, and partitions
the training data... | 40.597444 | 162 | 0.511686 | import numpy as np
import numpy.linalg as la
from numpy.testing import assert_allclose
import unittest
from rlscore.learner import QueryRankRLS
from rlscore.kernel import GaussianKernel, PolynomialKernel
def mapQids(qids):
qid_dict = {}
folds = {}
counter = 0
for index, qid in enumerate(qids):
... | true | true |
f76f03b606dda0accadd9e33077c826ce5334b53 | 279 | py | Python | simplemes/mesuser/urls.py | saulshao/simplemes | fb317570666f776231c1ffd48c6114b9697e47f1 | [
"MIT"
] | null | null | null | simplemes/mesuser/urls.py | saulshao/simplemes | fb317570666f776231c1ffd48c6114b9697e47f1 | [
"MIT"
] | null | null | null | simplemes/mesuser/urls.py | saulshao/simplemes | fb317570666f776231c1ffd48c6114b9697e47f1 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
]
| 23.25 | 46 | 0.759857 | from django.conf.urls import url, include
from rest_framework import routers
from . import views
router = routers.DefaultRouter()
router.register(r'users', views.UserViewSet)
router.register(r'groups', views.GroupViewSet)
urlpatterns = [
url(r'^', include(router.urls)),
]
| true | true |
f76f0488d85900921c0cf1e8cfbdd01bd82c2ef6 | 1,532 | py | Python | extras/gen-states.py | kayatmin/blynk-library | 649a38516228e67175397838e31896f10d9adf3c | [
"MIT"
] | 3,682 | 2015-03-24T22:37:49.000Z | 2022-03-31T10:33:28.000Z | extras/gen-states.py | kayatmin/blynk-library | 649a38516228e67175397838e31896f10d9adf3c | [
"MIT"
] | 515 | 2015-05-22T10:36:39.000Z | 2022-02-14T18:18:57.000Z | extras/gen-states.py | kayatmin/blynk-library | 649a38516228e67175397838e31896f10d9adf3c | [
"MIT"
] | 1,300 | 2015-03-27T07:00:51.000Z | 2022-03-31T04:13:10.000Z | # coding: utf-8
import numpy as np
from PIL import Image, ImageDraw
from math import sin,cos
from numpngw import write_apng
W,H = 1024,1024
COLOR_BLACK = (0x00, 0x00, 0x00, 0x00)
COLOR_WHITE = (0xF0, 0xF0, 0xE0)
COLOR_BLUE = (0x0D, 0x36, 0xFF)
COLOR_BLYNK = (0x2E, 0xFF, 0xB9)
COLOR_RED = (0xFF, 0x10, 0x... | 37.365854 | 111 | 0.665144 | import numpy as np
from PIL import Image, ImageDraw
from math import sin,cos
from numpngw import write_apng
W,H = 1024,1024
COLOR_BLACK = (0x00, 0x00, 0x00, 0x00)
COLOR_WHITE = (0xF0, 0xF0, 0xE0)
COLOR_BLUE = (0x0D, 0x36, 0xFF)
COLOR_BLYNK = (0x2E, 0xFF, 0xB9)
COLOR_RED = (0xFF, 0x10, 0x08)
COLOR_MAGENT... | true | true |
f76f04faa4c8e34c11468ed41f4f4c1f4dcff352 | 2,287 | py | Python | qtensor/tests/test_simulators.py | marwahaha/QTensor | 936d078825a6418f9d32d2c176332422d8a4c137 | [
"BSD-3-Clause"
] | null | null | null | qtensor/tests/test_simulators.py | marwahaha/QTensor | 936d078825a6418f9d32d2c176332422d8a4c137 | [
"BSD-3-Clause"
] | null | null | null | qtensor/tests/test_simulators.py | marwahaha/QTensor | 936d078825a6418f9d32d2c176332422d8a4c137 | [
"BSD-3-Clause"
] | null | null | null | import qtensor
from qtensor import CirqQAOAComposer, QtreeQAOAComposer
from qtensor import QAOAQtreeSimulator
from qtensor.Simulate import CirqSimulator, QtreeSimulator
from qtensor.FeynmanSimulator import FeynmanSimulator
import numpy as np
import networkx as nx
np.random.seed(42)
def get_test_problem(n=14, p=2, d=... | 24.591398 | 77 | 0.668561 | import qtensor
from qtensor import CirqQAOAComposer, QtreeQAOAComposer
from qtensor import QAOAQtreeSimulator
from qtensor.Simulate import CirqSimulator, QtreeSimulator
from qtensor.FeynmanSimulator import FeynmanSimulator
import numpy as np
import networkx as nx
np.random.seed(42)
def get_test_problem(n=14, p=2, d=... | true | true |
f76f06c5a37e01c8d9ad4c08ff90f2d9c4412f6a | 3,074 | py | Python | BUILD/doc/source/examples/ask_manual_question_simple_single_sensor_no_results_code.py | netsec/pytan | 29a3484d21cb90d8896275febd1c535e4f3cdc7e | [
"MIT"
] | 1 | 2019-01-29T21:22:06.000Z | 2019-01-29T21:22:06.000Z | BUILD/doc/source/examples/ask_manual_question_simple_single_sensor_no_results_code.py | c1rdan/pytan | 5e537a6dcf4136e3b9c3905a39f073396e7f044f | [
"MIT"
] | null | null | null | BUILD/doc/source/examples/ask_manual_question_simple_single_sensor_no_results_code.py | c1rdan/pytan | 5e537a6dcf4136e3b9c3905a39f073396e7f044f | [
"MIT"
] | null | null | null | # import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pytan"
pytan_static_path =... | 33.413043 | 90 | 0.735198 | import os
import sys
import tempfile
import pprint
import traceback
sys.dont_write_bytecode = True
pytan_loc = "~/gh/pytan"
pytan_static_path = os.path.join(os.path.expanduser(pytan_loc), 'lib')
my_file = os.path.abspath(sys.argv[0])
my_dir = os.path.dirname(my_file)
parent_dir = os.path.dirname(my_dir)
pytan_root_... | false | true |
f76f0733d11644eb76d6789ed22fe8c5f80a04c6 | 5,980 | py | Python | ops/dataset_config.py | ryansanford4/temporal-shift-module | 344dc9525da08543068fbda3669dee314147090f | [
"Apache-2.0"
] | null | null | null | ops/dataset_config.py | ryansanford4/temporal-shift-module | 344dc9525da08543068fbda3669dee314147090f | [
"Apache-2.0"
] | null | null | null | ops/dataset_config.py | ryansanford4/temporal-shift-module | 344dc9525da08543068fbda3669dee314147090f | [
"Apache-2.0"
] | null | null | null | # Code for "TSM: Temporal Shift Module for Efficient Video Understanding"
# arXiv:1811.08383
# Ji Lin*, Chuang Gan, Song Han
# {jilin, songhan}@mit.edu, ganchuang@csail.mit.edu
import os
ROOT_DATASET = '/media/nas-570-002-nfssamba/rsanford/activity_recognition/' # '/data/jilin/'
def return_ucf101(modality):
fi... | 44.626866 | 113 | 0.70903 |
import os
ROOT_DATASET = '/media/nas-570-002-nfssamba/rsanford/activity_recognition/'
def return_ucf101(modality):
filename_categories = 'UCF101/labels/classInd.txt'
if modality == 'RGB':
root_data = ROOT_DATASET + 'UCF101/jpg'
filename_imglist_train = 'UCF101/file_list/ucf101_rgb_train_spl... | true | true |
f76f0735ae360c49d1b01cbe8e340e70224bdfd9 | 71,023 | py | Python | main.py | GaneshPrasannan/alfred-discord-bot | d86d45c3dd4c29ca8cc0f0102a4a685ee10a955d | [
"MIT"
] | null | null | null | main.py | GaneshPrasannan/alfred-discord-bot | d86d45c3dd4c29ca8cc0f0102a4a685ee10a955d | [
"MIT"
] | null | null | null | main.py | GaneshPrasannan/alfred-discord-bot | d86d45c3dd4c29ca8cc0f0102a4a685ee10a955d | [
"MIT"
] | null | null | null | """
Set your env like the example below:
token=
mysql=
default=
dev=
"""
def temporary_fix():
from shutil import copyfile
copyfile("./utils/post.py","/opt/virtualenvs/python3/lib/python3.8/site-packages/instascrape/scrapers/post.py")
import os
import sys
import subprocess
sys.path.insert(1,f"{os.getcwd()}... | 36.609794 | 281 | 0.542528 |
def temporary_fix():
from shutil import copyfile
copyfile("./utils/post.py","/opt/virtualenvs/python3/lib/python3.8/site-packages/instascrape/scrapers/post.py")
import os
import sys
import subprocess
sys.path.insert(1,f"{os.getcwd()}/utils/")
sys.path.insert(1,f"{os.getcwd()}/src")
sys.path.insert(1,f"{os... | true | true |
f76f0810e4bd5cd1555681e367fb4a7dbc18f24c | 1,253 | py | Python | notcv_bridge.py | Prakadeeswaran05/Simple-Tf-ObjectDetection-SemanticSegmentation-ROS | f119f0f8394c324c8453d540f4dfa495e34ee001 | [
"MIT"
] | 9 | 2021-04-29T14:30:16.000Z | 2022-01-26T16:39:34.000Z | notcv_bridge.py | Prakadeeswaran05/Tf-ObjectDetection-SemanticSegmentation-ROS | f119f0f8394c324c8453d540f4dfa495e34ee001 | [
"MIT"
] | null | null | null | notcv_bridge.py | Prakadeeswaran05/Tf-ObjectDetection-SemanticSegmentation-ROS | f119f0f8394c324c8453d540f4dfa495e34ee001 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
import sys
import numpy as np
from sensor_msgs.msg import Image
def imgmsg_to_cv2(img_msg):
if img_msg.encoding != "bgr8":
rospy.logerr("This Coral detect node has been hardcoded to the 'bgr8' encoding. Come change the code if you're actually trying to implement a new camera")
d... | 46.407407 | 178 | 0.706305 | import sys
import numpy as np
from sensor_msgs.msg import Image
def imgmsg_to_cv2(img_msg):
if img_msg.encoding != "bgr8":
rospy.logerr("This Coral detect node has been hardcoded to the 'bgr8' encoding. Come change the code if you're actually trying to implement a new camera")
dtype = np.dtype("uint8"... | true | true |
f76f082d6467cbf1f8c5a80d252df73fc9385978 | 882 | py | Python | _src/om2py5w/5wex0/imm/mysqldb.py | wwshen/OMOOC2py | d156889b1414956ad67f27bdff9d04b459190810 | [
"MIT"
] | null | null | null | _src/om2py5w/5wex0/imm/mysqldb.py | wwshen/OMOOC2py | d156889b1414956ad67f27bdff9d04b459190810 | [
"MIT"
] | 1 | 2015-10-23T17:52:41.000Z | 2015-10-23T17:52:41.000Z | _src/om2py5w/5wex0/imm/mysqldb.py | wwshen/OMOOC2py | d156889b1414956ad67f27bdff9d04b459190810 | [
"MIT"
] | 1 | 2018-10-15T06:42:12.000Z | 2018-10-15T06:42:12.000Z | #-*- coding:utf-8 -*-
import sae
import sae.const
import MySQLdb
import time
db = MySQLdb.connect(host ="localhost", port =3306, user ="root", passwd ="Sww6416!", db="storychain")
cursor =db.cursor()
cursor.execute('USE app_storychain')
cursor.execute('''CREATE TABLE IF NOT EXISTS users
(
id INTEGER PRIMARY KEY AUT... | 23.210526 | 102 | 0.718821 | import sae
import sae.const
import MySQLdb
import time
db = MySQLdb.connect(host ="localhost", port =3306, user ="root", passwd ="Sww6416!", db="storychain")
cursor =db.cursor()
cursor.execute('USE app_storychain')
cursor.execute('''CREATE TABLE IF NOT EXISTS users
(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
name VAR... | true | true |
f76f088ecf77e4f5aae9939484cc2d3998ac2b80 | 265 | py | Python | server/src/weaverbird/pipeline/steps/utils/validation.py | JeremyJacquemont/weaverbird | e04ab6f9c8381986ab71078e5199ece7a875e743 | [
"BSD-3-Clause"
] | 54 | 2019-11-20T15:07:39.000Z | 2022-03-24T22:13:51.000Z | server/src/weaverbird/pipeline/steps/utils/validation.py | JeremyJacquemont/weaverbird | e04ab6f9c8381986ab71078e5199ece7a875e743 | [
"BSD-3-Clause"
] | 786 | 2019-10-20T11:48:37.000Z | 2022-03-23T08:58:18.000Z | server/src/weaverbird/pipeline/steps/utils/validation.py | JeremyJacquemont/weaverbird | e04ab6f9c8381986ab71078e5199ece7a875e743 | [
"BSD-3-Clause"
] | 10 | 2019-11-21T10:16:16.000Z | 2022-03-21T10:34:06.000Z | from typing import Sequence
from weaverbird.exceptions import DuplicateColumnError
def validate_unique_columns(columns: Sequence[str]) -> Sequence[str]:
if len(set(columns)) < len(columns):
raise DuplicateColumnError
else:
return columns
| 24.090909 | 69 | 0.739623 | from typing import Sequence
from weaverbird.exceptions import DuplicateColumnError
def validate_unique_columns(columns: Sequence[str]) -> Sequence[str]:
if len(set(columns)) < len(columns):
raise DuplicateColumnError
else:
return columns
| true | true |
f76f09806245c3e713a5dc3d80f49a1cda5fc483 | 5,306 | py | Python | test/unit/test_serving.py | ipanepen/sagemaker-scikit-learn-container | 3214b0d36955fed0b6338b997b26bcc883f7b883 | [
"Apache-2.0"
] | 105 | 2018-11-28T21:48:12.000Z | 2022-03-27T18:51:29.000Z | test/unit/test_serving.py | ipanepen/sagemaker-scikit-learn-container | 3214b0d36955fed0b6338b997b26bcc883f7b883 | [
"Apache-2.0"
] | 55 | 2019-01-01T18:52:12.000Z | 2022-03-29T09:06:38.000Z | test/unit/test_serving.py | ipanepen/sagemaker-scikit-learn-container | 3214b0d36955fed0b6338b997b26bcc883f7b883 | [
"Apache-2.0"
] | 94 | 2019-01-21T06:46:07.000Z | 2022-03-31T18:25:13.000Z | # Copyright 2018 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 "license" file acc... | 33.796178 | 87 | 0.745006 | from __future__ import absolute_import
from mock import patch, MagicMock
import numpy as np
import pytest
import os
from sklearn.base import BaseEstimator
from sagemaker_containers.beta.framework import (content_types, encoders, errors)
from sagemaker_sklearn_container import serving
from sagemaker_sklearn_container... | true | true |
f76f0abe5c9f7df784871e6f371a300c0fe57210 | 35 | py | Python | 000_playground/0016_pandasgui_faster.py | fkubota/rkkubotay-gmail.com | 03abffd520b6ba241d102184bba28507c8aa4d61 | [
"MIT"
] | null | null | null | 000_playground/0016_pandasgui_faster.py | fkubota/rkkubotay-gmail.com | 03abffd520b6ba241d102184bba28507c8aa4d61 | [
"MIT"
] | 49 | 2021-01-12T07:25:17.000Z | 2022-03-12T00:53:24.000Z | 000_playground/0016_pandasgui_faster.py | fkubota/sand-pit | 03abffd520b6ba241d102184bba28507c8aa4d61 | [
"MIT"
] | null | null | null | from pandasgui import show
show()
| 8.75 | 26 | 0.771429 | from pandasgui import show
show()
| true | true |
f76f0beb64cd4926dfcc0e7d79a47fc272c6d03b | 5,103 | py | Python | src/trex/writers.py | cnk113/TREX | add83d8108f3602c5bbe7b37f60ff19f89b2236d | [
"MIT"
] | null | null | null | src/trex/writers.py | cnk113/TREX | add83d8108f3602c5bbe7b37f60ff19f89b2236d | [
"MIT"
] | 1 | 2022-03-18T01:56:53.000Z | 2022-03-24T19:35:58.000Z | src/trex/writers.py | cnk113/TREX | add83d8108f3602c5bbe7b37f60ff19f89b2236d | [
"MIT"
] | 1 | 2022-03-23T03:07:42.000Z | 2022-03-23T03:07:42.000Z | from pathlib import Path
from typing import List
from .cell import Cell
import operator
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "Conversion of the second argument of issubdtype")
import loompy
import numpy as np
def write_count_matrix(path: Path, cells: List[Cell]):
... | 37.248175 | 98 | 0.569665 | from pathlib import Path
from typing import List
from .cell import Cell
import operator
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", "Conversion of the second argument of issubdtype")
import loompy
import numpy as np
def write_count_matrix(path: Path, cells: List[Cell]):
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.