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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c0ace37b0e5757a8e5cea7ab6cc7302ffc2e29a | 1,514 | py | Python | marvin/core/models.py | marvinbraga/corona_thread | 7e1d64779457a8dca9f0de5673b3d48c15633953 | [
"MIT"
] | 4 | 2020-03-23T03:16:48.000Z | 2020-03-25T19:54:38.000Z | marvin/core/models.py | marvinbraga/corona_thread | 7e1d64779457a8dca9f0de5673b3d48c15633953 | [
"MIT"
] | null | null | null | marvin/core/models.py | marvinbraga/corona_thread | 7e1d64779457a8dca9f0de5673b3d48c15633953 | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020 Marcus Vinicius D. B. Braga - mvbraga@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the r... | 34.409091 | 80 | 0.73646 |
class Model:
__description = 'base model'
__obj = None
def __init__(self, description, obj):
self.__description = description
self.__obj = obj
def __str__(self):
return self.__description
@property
def description(self):
return self.__description
@prope... | true | true |
1c0ace38162236849a3a852f9d520fc234a7abbf | 3,095 | py | Python | app/app/settings.py | rajrpatel62499/recipie-app-api | 5d92a4bb30b0b6752a98ecbf11e3b46bff0dc81b | [
"MIT"
] | null | null | null | app/app/settings.py | rajrpatel62499/recipie-app-api | 5d92a4bb30b0b6752a98ecbf11e3b46bff0dc81b | [
"MIT"
] | null | null | null | app/app/settings.py | rajrpatel62499/recipie-app-api | 5d92a4bb30b0b6752a98ecbf11e3b46bff0dc81b | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 3.1.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib imp... | 24.959677 | 91 | 0.692407 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'e&==&#(%b))$l@%h6%n2a!ec25!1js2323p1dp&mb-8d%*ei62'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
... | true | true |
1c0acf8355a0cf7d406913b5458b2c55776aca11 | 5,217 | py | Python | test/functional/test_framework/wallet_util.py | robbelouwet/Elixir | 609412402c5dd4fb9d77ae6d87505d8efd608132 | [
"MIT"
] | null | null | null | test/functional/test_framework/wallet_util.py | robbelouwet/Elixir | 609412402c5dd4fb9d77ae6d87505d8efd608132 | [
"MIT"
] | null | null | null | test/functional/test_framework/wallet_util.py | robbelouwet/Elixir | 609412402c5dd4fb9d77ae6d87505d8efd608132 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Elixir Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Useful util functions for testing the wallet"""
from collections import namedtuple
from test_framework.... | 39.522727 | 118 | 0.602837 | from collections import namedtuple
from test_framework.address import (
byte_to_base58,
key_to_p2pkh,
key_to_p2sh_p2wpkh,
key_to_p2wpkh,
script_to_p2sh,
script_to_p2sh_p2wsh,
script_to_p2wsh,
)
from test_framework.key import ECKey
from test_framework.script import (
CScript,
OP_0,
... | true | true |
1c0acfc40ba025cad02a1c9142da000cc2e065af | 520 | py | Python | tests/unit/test_inception_tools/data/test_standard_archetype/inception-tools-archetype-lib-1.0/some_package_name/__init__.py | avanherick/pyincept | c3af88d980dc9e85be7b63feb47990f472311c62 | [
"Apache-2.0"
] | 1 | 2022-03-16T14:26:54.000Z | 2022-03-16T14:26:54.000Z | tests/unit/test_inception_tools/data/test_standard_archetype/inception-tools-archetype-lib-1.0/some_package_name/__init__.py | avanherick/pyincept | c3af88d980dc9e85be7b63feb47990f472311c62 | [
"Apache-2.0"
] | 24 | 2020-06-26T06:40:41.000Z | 2020-07-16T09:05:43.000Z | tests/unit/test_inception_tools/data/test_standard_archetype/inception-tools-archetype-lib-1.0/some_package_name/__init__.py | avanherick/pyincept | c3af88d980dc9e85be7b63feb47990f472311c62 | [
"Apache-2.0"
] | null | null | null | """
some_package_name
~~~~~~~~~~~~~~~~~
The :py:mod:`some_package_name` package contains the root-level distributable
source code for the `some_package_name` project.
"""
__author__ = 'some_author'
__copyright__ = 'Unpublished Copyright (c) 2000 some_author. All Rights Reserved.'
__license__ = 'Apache Software Licens... | 27.368421 | 82 | 0.769231 |
__author__ = 'some_author'
__copyright__ = 'Unpublished Copyright (c) 2000 some_author. All Rights Reserved.'
__license__ = 'Apache Software License 2.0'
from pkg_resources import DistributionNotFound, get_distribution
try:
__version__ = get_distribution('some_package_name').version
except DistributionNotFound:
... | true | true |
1c0ad0760e550e95a651b5729eb7707a9163fe80 | 68 | py | Python | pantsuBooru/__init__.py | nitros12/pantsuBooru | 1566470eed0bd5ec9317e0c59849b30903f80545 | [
"MIT"
] | null | null | null | pantsuBooru/__init__.py | nitros12/pantsuBooru | 1566470eed0bd5ec9317e0c59849b30903f80545 | [
"MIT"
] | 1 | 2017-08-09T01:30:52.000Z | 2017-08-09T01:30:52.000Z | pantsuBooru/__init__.py | nitros12/pantsuBooru | 1566470eed0bd5ec9317e0c59849b30903f80545 | [
"MIT"
] | null | null | null | from .models import *
from .backend import *
__version__ = "0.0.1"
| 13.6 | 22 | 0.691176 | from .models import *
from .backend import *
__version__ = "0.0.1"
| true | true |
1c0ad2ba27e54be7ca906e10ae8c9ac774d1d751 | 3,876 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/experimenter.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/experimenter.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/openflow/experimenter.py | ralfjon/IxNetwork | c0c834fbc465af69c12fd6b7cee4628baba7fff1 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | 29.142857 | 128 | 0.744066 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class Experimenter(Base):
_SDM_NAME = 'experimenter'
def __init__(self, parent):
super(Experimenter, self).__init__(parent)
@property
def ExperimenterData(self):
return self._get_attribute('experimenterData... | true | true |
1c0ad3118cb95682ccfaacd66f3d94c7407da545 | 624 | py | Python | Programs/orfogram.py | AlanAloha/Learning_MCB185 | 5f88bd05a816da9a7c2430fbcb777ad49c314aee | [
"MIT"
] | 3 | 2021-06-22T17:56:14.000Z | 2021-11-02T15:10:47.000Z | Programs/orfogram.py | AlanAloha/Learning_MCB185 | 5f88bd05a816da9a7c2430fbcb777ad49c314aee | [
"MIT"
] | null | null | null | Programs/orfogram.py | AlanAloha/Learning_MCB185 | 5f88bd05a816da9a7c2430fbcb777ad49c314aee | [
"MIT"
] | 5 | 2021-04-01T16:22:28.000Z | 2022-01-01T00:34:12.000Z | #!/usr/bin/env python3
import argparse
# In prokaryotic genomes, genes are often predicted based on length
# Long ORFs are not expected to occur by chance
# Write a program that creates a histogram of ORF lengths in random DNA
# Your library should contain new functions for the following
# 1. generating random seq... | 34.666667 | 71 | 0.751603 |
import argparse
| true | true |
1c0ad3ee92c194ce8e0f8d4e46a256b7633afffe | 538 | py | Python | app/services/category_services/update.py | brunocamposal/fast-food-simulator | 6dc7f33cdebd222998fc88df9264853c741c64ca | [
"MIT"
] | 2 | 2021-01-11T23:47:17.000Z | 2021-01-13T13:16:50.000Z | app/services/category_services/update.py | brunocamposal/kitchin-kanri | 6dc7f33cdebd222998fc88df9264853c741c64ca | [
"MIT"
] | 7 | 2021-01-13T13:16:46.000Z | 2021-01-21T16:07:28.000Z | app/services/category_services/update.py | brunocamposal/kitchin-kanri | 6dc7f33cdebd222998fc88df9264853c741c64ca | [
"MIT"
] | null | null | null | from app.serializer.category_schema import category_schema
from app.services.http import build_api_response
from app.models import Category
from flask import current_app
from http import HTTPStatus
from typing import Dict
def update_category(category_id: int , data: Dict):
category = Category.query.get_or_404(ca... | 26.9 | 59 | 0.775093 | from app.serializer.category_schema import category_schema
from app.services.http import build_api_response
from app.models import Category
from flask import current_app
from http import HTTPStatus
from typing import Dict
def update_category(category_id: int , data: Dict):
category = Category.query.get_or_404(ca... | true | true |
1c0ad43972ac305d7d097d80430762259defafa8 | 242 | py | Python | tests/tuple/tuple_cmp.py | Slater-Victoroff/pyjaco | 89c4e3c46399c5023b0e160005d855a01241c58a | [
"MIT"
] | 38 | 2015-01-01T18:08:59.000Z | 2022-02-18T08:57:27.000Z | tests/tuple/tuple_cmp.py | dusty-phillips/pyjaco | 066895ae38d1828498e529c1875cb88df6cbc54d | [
"MIT"
] | 1 | 2020-07-15T13:30:32.000Z | 2020-07-15T13:30:32.000Z | tests/tuple/tuple_cmp.py | Slater-Victoroff/pyjaco | 89c4e3c46399c5023b0e160005d855a01241c58a | [
"MIT"
] | 12 | 2016-03-07T09:30:49.000Z | 2021-09-05T20:38:47.000Z | tups = [(1, 1), (1, 2), (1, 3), (1, 2, 1), (1, 2, 2), (1, 2, 10)]
for x in tups:
for y in tups:
print "%s cmp %s = %s" % (x, y, cmp(x, y))
print "%s > %s = %s" % (x, y, x > y)
print "%s < %s = %s" % (x, y, x < y)
| 30.25 | 65 | 0.338843 | tups = [(1, 1), (1, 2), (1, 3), (1, 2, 1), (1, 2, 2), (1, 2, 10)]
for x in tups:
for y in tups:
print "%s cmp %s = %s" % (x, y, cmp(x, y))
print "%s > %s = %s" % (x, y, x > y)
print "%s < %s = %s" % (x, y, x < y)
| false | true |
1c0ad4527a48f9befb7a0fa88fe1f50489fea03a | 8,232 | py | Python | dtcli/signing.py | TDyszewski/dt-cli | 13585d0d9726fb3d3cb0e430fa748d6d54382e4e | [
"Apache-2.0"
] | null | null | null | dtcli/signing.py | TDyszewski/dt-cli | 13585d0d9726fb3d3cb0e430fa748d6d54382e4e | [
"Apache-2.0"
] | null | null | null | dtcli/signing.py | TDyszewski/dt-cli | 13585d0d9726fb3d3cb0e430fa748d6d54382e4e | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Dynatrace LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in wr... | 37.081081 | 101 | 0.665209 |
import datetime
from asn1crypto import cms, util, x509, core, pem
from cryptography import x509 as crypto_x509
from cryptography.x509.oid import NameOID
from cryptography.hazmat.primitives import serialization, hashes
from cryptography.hazmat.primitives.asymmetric import padding, rsa, utils
from cryptog... | true | true |
1c0ad545e88699e6cf4ba2b8a8e98b8d80463913 | 43,546 | py | Python | tests/unit/plugins/openstack/test_osclients.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/test_osclients.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/test_osclients.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | # Copyright 2013: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 45.983105 | 79 | 0.620838 |
import ddt
import mock
from rally.common import cfg
from rally import consts
from rally import exceptions
from rally import osclients as deprecated_osclients from rally.plugins.openstack import credential as oscredential
from rally.plugins.openstack import osclients
from tests.unit import fakes
from tests.unit impor... | true | true |
1c0ad63ebd343e95f424026ad73fd1e4fed81d2d | 548 | py | Python | examples/modelling/fast_ssc/4096.py | MingxuZhang/python-polar-coding | bfab8e1cdcffaefea8e6d0209b13465fbd7fa936 | [
"MIT"
] | 2 | 2021-12-07T09:52:15.000Z | 2022-01-06T14:35:37.000Z | examples/modelling/fast_ssc/4096.py | manhduc1811/python-polar-coding | bfab8e1cdcffaefea8e6d0209b13465fbd7fa936 | [
"MIT"
] | null | null | null | examples/modelling/fast_ssc/4096.py | manhduc1811/python-polar-coding | bfab8e1cdcffaefea8e6d0209b13465fbd7fa936 | [
"MIT"
] | 4 | 2020-07-03T14:20:04.000Z | 2021-07-04T13:20:40.000Z | from examples.modelling.fast_ssc.base import fast_ssc_executor
# (4096, 3072) code built with Bhattacharya parameters method
CODE_RATES = [0.75, ]
# From 2 to 5 with step 0.25 dB
SNR_RANGE = [i/4 for i in range(8, 21)]
MESSAGES_PER_EXPERIMENT = 100
REPETITIONS = 1000
CODE_LENGTH = 4096
MAX_WORKERS = 4
if __name__ ==... | 26.095238 | 62 | 0.726277 | from examples.modelling.fast_ssc.base import fast_ssc_executor
CODE_RATES = [0.75, ]
SNR_RANGE = [i/4 for i in range(8, 21)]
MESSAGES_PER_EXPERIMENT = 100
REPETITIONS = 1000
CODE_LENGTH = 4096
MAX_WORKERS = 4
if __name__ == '__main__':
fast_ssc_executor(
codeword_length=CODE_LENGTH,
code_rates=CO... | true | true |
1c0ad799248316684521a25762ad2a16670cc9cd | 810 | py | Python | setup.py | pozole-rojo/advent-of-code-2018 | 105530d86afdd1ae1d297b4eb8f95b3bb99a63f4 | [
"MIT"
] | null | null | null | setup.py | pozole-rojo/advent-of-code-2018 | 105530d86afdd1ae1d297b4eb8f95b3bb99a63f4 | [
"MIT"
] | null | null | null | setup.py | pozole-rojo/advent-of-code-2018 | 105530d86afdd1ae1d297b4eb8f95b3bb99a63f4 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='advent_of_code_2018',
version='0.0.0',
packages=('advent_of_code_2018',),
url='https://github.com/pozole-rojo/advent-of-code-2018',
license='MIT',
author='Pozole Rojo',
author_email='jperez.4096@gmail.com',
install_requires=(),
tests_require... | 35.217391 | 70 | 0.62716 | from setuptools import setup
setup(
name='advent_of_code_2018',
version='0.0.0',
packages=('advent_of_code_2018',),
url='https://github.com/pozole-rojo/advent-of-code-2018',
license='MIT',
author='Pozole Rojo',
author_email='jperez.4096@gmail.com',
install_requires=(),
tests_require... | true | true |
1c0ad990d03449ff620284387f733d37c1fd81fc | 388 | py | Python | backend/config/settings/test.py | heidal/apollo | 576743e12048985ae8ef127224e1cb8ac49acd28 | [
"MIT"
] | 2 | 2020-02-28T16:24:55.000Z | 2020-03-27T17:12:50.000Z | backend/config/settings/test.py | heidal/apollo | 576743e12048985ae8ef127224e1cb8ac49acd28 | [
"MIT"
] | 51 | 2020-02-12T20:52:08.000Z | 2022-02-27T00:23:20.000Z | backend/config/settings/test.py | heidal/apollo | 576743e12048985ae8ef127224e1cb8ac49acd28 | [
"MIT"
] | null | null | null | from .base import *
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
}
# without DEBUG tests run faster
DEBUG = False
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOC... | 17.636364 | 67 | 0.600515 | from .base import *
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
}
DEBUG = False
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "",
}
}
TEST_RUNNER ... | true | true |
1c0ad9fa65e84e87558ca8cc77074cb1df1a954a | 1,057 | py | Python | solutions/blockedbillboard.py | 24TangC/USACO-Bronze | 80f0986cb04998b039ba23c7349d25431b4e876b | [
"MIT"
] | null | null | null | solutions/blockedbillboard.py | 24TangC/USACO-Bronze | 80f0986cb04998b039ba23c7349d25431b4e876b | [
"MIT"
] | null | null | null | solutions/blockedbillboard.py | 24TangC/USACO-Bronze | 80f0986cb04998b039ba23c7349d25431b4e876b | [
"MIT"
] | null | null | null | bill_board = list(map(int, input().split()))
tarp = list(map(int, input().split()))
xOverlap = max(min(bill_board[2], tarp[2]) - max(bill_board[0], tarp[0]), 0)
yOverlap = max(min(bill_board[3], tarp[3]) - max(bill_board[1], tarp[1]), 0)
if xOverlap == 0 or yOverlap == 0:
print((bill_board[2] - bill_boar... | 48.045455 | 93 | 0.653737 | bill_board = list(map(int, input().split()))
tarp = list(map(int, input().split()))
xOverlap = max(min(bill_board[2], tarp[2]) - max(bill_board[0], tarp[0]), 0)
yOverlap = max(min(bill_board[3], tarp[3]) - max(bill_board[1], tarp[1]), 0)
if xOverlap == 0 or yOverlap == 0:
print((bill_board[2] - bill_boar... | true | true |
1c0adb04c38ed1b9e8b33dd950d259d0d261ab05 | 15,440 | py | Python | lib/datasets/vg.py | j40903272/bottom-up-attention-py3 | cceb719133023895a4b63569c5ba9a25fcd2c86b | [
"MIT"
] | null | null | null | lib/datasets/vg.py | j40903272/bottom-up-attention-py3 | cceb719133023895a4b63569c5ba9a25fcd2c86b | [
"MIT"
] | null | null | null | lib/datasets/vg.py | j40903272/bottom-up-attention-py3 | cceb719133023895a4b63569c5ba9a25fcd2c86b | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------... | 41.505376 | 101 | 0.536528 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import zip
from builtins import str
from builtins import range
from past.utils import old_div
import os
from datasets.imdb im... | true | true |
1c0adbd0cdf7fe1e847fbcacc15350d7171f7b61 | 1,036 | py | Python | tests/integration/model_loading_test.py | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 61 | 2020-07-06T17:11:46.000Z | 2022-03-12T14:42:51.000Z | tests/integration/model_loading_test.py | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 1 | 2021-02-25T01:30:29.000Z | 2021-11-09T11:13:14.000Z | tests/integration/model_loading_test.py | gglin001/popart | 3225214343f6d98550b6620e809a3544e8bcbfc6 | [
"MIT"
] | 6 | 2020-07-15T12:33:13.000Z | 2021-11-07T06:55:00.000Z | # Copyright (c) 2021 Graphcore Ltd. All rights reserved.
import numpy as np
import popart
import pytest
def test_bad_model_proto():
builder = popart.Builder()
i = builder.addInputTensor("FLOAT", [4, 4])
c = builder.aiOnnx.constant(np.random.rand(4, 4).astype(np.float32))
m = builder.aiOnnx.matmul([i,... | 28 | 72 | 0.645753 | import numpy as np
import popart
import pytest
def test_bad_model_proto():
builder = popart.Builder()
i = builder.addInputTensor("FLOAT", [4, 4])
c = builder.aiOnnx.constant(np.random.rand(4, 4).astype(np.float32))
m = builder.aiOnnx.matmul([i, c])
m = builder.aiOnnx.matmul([m, c])
builder.a... | true | true |
1c0add55ba7da561be71e90388b132507fabe835 | 1,565 | py | Python | python/web/courseDB.py | raindroid/Course-Timetable | 36ed03d94f62b8475190e5d925ecee1c4b0dbb2d | [
"MIT"
] | 4 | 2020-06-23T04:09:50.000Z | 2021-08-25T02:48:40.000Z | python/web/courseDB.py | raindroid/Course-Timetable | 36ed03d94f62b8475190e5d925ecee1c4b0dbb2d | [
"MIT"
] | null | null | null | python/web/courseDB.py | raindroid/Course-Timetable | 36ed03d94f62b8475190e5d925ecee1c4b0dbb2d | [
"MIT"
] | null | null | null | import pymongo
from typing import List
class CourseDB():
def __init__(self, db_name: str, db_client='mongodb://localhost:27017/'):
self.__db_name = db_name
self.__db_client = pymongo.MongoClient(db_client)
self.__mydb = self.__db_client[self.__db_name]
def show_dbs(self) -> List[str]... | 32.604167 | 82 | 0.652396 | import pymongo
from typing import List
class CourseDB():
def __init__(self, db_name: str, db_client='mongodb://localhost:27017/'):
self.__db_name = db_name
self.__db_client = pymongo.MongoClient(db_client)
self.__mydb = self.__db_client[self.__db_name]
def show_dbs(self) -> List[str]... | true | true |
1c0add77fffbedd332c8dd9290f65b7a944a4197 | 758 | py | Python | authentik/flows/migrations/0021_flowstagebinding_invalid_response_action.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 15 | 2020-01-05T09:09:57.000Z | 2020-11-28T05:27:39.000Z | authentik/flows/migrations/0021_flowstagebinding_invalid_response_action.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 302 | 2020-01-21T08:03:59.000Z | 2020-12-04T05:04:57.000Z | authentik/flows/migrations/0021_flowstagebinding_invalid_response_action.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 3 | 2020-03-04T08:21:59.000Z | 2020-08-01T20:37:18.000Z | # Generated by Django 3.2.4 on 2021-06-27 16:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("authentik_flows", "0020_flow_compatibility_mode"),
]
operations = [
migrations.AddField(
model_name="flowstagebinding",
... | 32.956522 | 228 | 0.629288 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("authentik_flows", "0020_flow_compatibility_mode"),
]
operations = [
migrations.AddField(
model_name="flowstagebinding",
name="invalid_response_action",
... | true | true |
1c0add9bc49bb5865077660ce85b451f48509f03 | 8,727 | py | Python | obsolete/tophat_segment_juncs.py | 861934367/cgat | 77fdc2f819320110ed56b5b61968468f73dfc5cb | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 87 | 2015-01-01T03:48:19.000Z | 2021-11-23T16:23:24.000Z | obsolete/tophat_segment_juncs.py | 861934367/cgat | 77fdc2f819320110ed56b5b61968468f73dfc5cb | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 189 | 2015-01-06T15:53:11.000Z | 2019-05-31T13:19:45.000Z | obsolete/tophat_segment_juncs.py | CGATOxford/cgat | 326aad4694bdfae8ddc194171bb5d73911243947 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | 56 | 2015-01-13T02:18:50.000Z | 2022-01-05T10:00:59.000Z | #! /bin/env python
################################################################################
#
# MRC FGU Computational Genomics Group
#
# $Id: cgat_script_template.py 2871 2010-03-03 10:20:44Z andreas $
#
# Copyright (C) 2009 Andreas Heger
#
# This program is free software; you can redistribute it and/or... | 31.734545 | 103 | 0.58955 | '''
tophat_segment_juncs - speeding up tophat's segment_juncs
=====================================================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
A bottle neck in the tophat pipeline is :file:`segment_juncs`. This script
serves as a drop-in. It spl... | false | true |
1c0ade5d123a95dc5016da01267481e18f08c1c7 | 1,487 | py | Python | samples/generated_samples/aiplatform_v1_generated_model_service_get_model_evaluation_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | samples/generated_samples/aiplatform_v1_generated_model_service_get_model_evaluation_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/aiplatform_v1_generated_model_service_get_model_evaluation_sync.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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 or... | 32.326087 | 85 | 0.765299 |
from google.cloud import aiplatform_v1
def sample_get_model_evaluation():
client = aiplatform_v1.ModelServiceClient()
request = aiplatform_v1.GetModelEvaluationRequest(
name="name_value",
)
response = client.get_model_evaluation(request=request)
print(response)
| true | true |
1c0ade9fcf7a047921a1e5ee9761d057e56fa0b3 | 7,065 | py | Python | pyzoo/test/zoo/pipeline/utils/test_utils.py | Herald-of-Aurora/analytics-zoo | 1fc3bd738f4a1b2c1dbc2dffa2e20ee33dee737b | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/pipeline/utils/test_utils.py | Herald-of-Aurora/analytics-zoo | 1fc3bd738f4a1b2c1dbc2dffa2e20ee33dee737b | [
"Apache-2.0"
] | null | null | null | pyzoo/test/zoo/pipeline/utils/test_utils.py | Herald-of-Aurora/analytics-zoo | 1fc3bd738f4a1b2c1dbc2dffa2e20ee33dee737b | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.83815 | 100 | 0.642038 |
from __future__ import print_function
import logging
import shutil
from unittest import TestCase
import keras.backend as K
from zoo.common.nncontext import *
np.random.seed(1337)
class ZooTestCase(TestCase):
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('py4j').setLevel(logging.INFO)
d... | true | true |
1c0aded3b37ea9d23d58b63daad18df54441430d | 71 | py | Python | nikdev_iot/serializers/__init__.py | Niklasson-Developmet/nikdev_iot_python | 162c2c21902a99f8f903cbea96e47191f38b866f | [
"MIT"
] | 1 | 2020-10-29T22:14:53.000Z | 2020-10-29T22:14:53.000Z | nikdev_iot/serializers/__init__.py | Niklasson-Developmet/nikdev_iot_python | 162c2c21902a99f8f903cbea96e47191f38b866f | [
"MIT"
] | 11 | 2018-08-16T20:57:49.000Z | 2018-08-17T00:17:40.000Z | nikdev_iot/serializers/__init__.py | Niklasson-Developmet/nikdev_iot_python | 162c2c21902a99f8f903cbea96e47191f38b866f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .value_serializer import ValueSerializer
| 17.75 | 45 | 0.71831 |
from .value_serializer import ValueSerializer
| true | true |
1c0adf2b82d9cbfe6db20d368afa9827c211f577 | 8,114 | py | Python | aldryn_newsblog/tests/test_reversion.py | GabrielDumbrava/aldryn-newsblog | f3be5ff78e88fde532ce4c45e5eeb88d98fa6d93 | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/tests/test_reversion.py | GabrielDumbrava/aldryn-newsblog | f3be5ff78e88fde532ce4c45e5eeb88d98fa6d93 | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/tests/test_reversion.py | GabrielDumbrava/aldryn-newsblog | f3be5ff78e88fde532ce4c45e5eeb88d98fa6d93 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipIf
try:
from django.core.urlresolvers import reverse
except ModuleNotFoundError:
from django.urls import reverse
from django.db import transaction
from aldryn_reversion.core import create_revision as aldryn_create_revisio... | 37.391705 | 78 | 0.646537 | from __future__ import unicode_literals
from unittest import skipIf
try:
from django.core.urlresolvers import reverse
except ModuleNotFoundError:
from django.urls import reverse
from django.db import transaction
from aldryn_reversion.core import create_revision as aldryn_create_revision
from parler.utils.cont... | true | true |
1c0adff49bd3e57b8e0c116cf02722924ab8d396 | 50,552 | py | Python | mesonbuild/compilers/compilers.py | rossburton/meson | 58db8d5e1134e3917b2fb20403624ac090f1f604 | [
"Apache-2.0"
] | null | null | null | mesonbuild/compilers/compilers.py | rossburton/meson | 58db8d5e1134e3917b2fb20403624ac090f1f604 | [
"Apache-2.0"
] | null | null | null | mesonbuild/compilers/compilers.py | rossburton/meson | 58db8d5e1134e3917b2fb20403624ac090f1f604 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012-2019 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | 40.120635 | 164 | 0.591272 |
import contextlib, os.path, re, tempfile
import collections.abc
import typing as T
from functools import lru_cache
from ..linkers import StaticLinker, GnuLikeDynamicLinkerMixin, SolarisDynamicLinker
from .. import coredata
from .. import mlog
from .. import mesonlib
from ..mesonlib import (
EnvironmentExceptio... | true | true |
1c0ae050f362a1f950a6140676bff9de295da9f8 | 16,312 | py | Python | server/api/socket/location.py | chrispoupart/PlanarAlly | 4015621468072fee90a796e7baa0212d9a62c7e5 | [
"MIT"
] | 300 | 2018-03-22T12:09:15.000Z | 2022-03-30T05:33:39.000Z | server/api/socket/location.py | chrispoupart/PlanarAlly | 4015621468072fee90a796e7baa0212d9a62c7e5 | [
"MIT"
] | 482 | 2018-03-08T23:44:56.000Z | 2022-03-30T18:06:04.000Z | server/api/socket/location.py | chrispoupart/PlanarAlly | 4015621468072fee90a796e7baa0212d9a62c7e5 | [
"MIT"
] | 79 | 2018-05-12T18:42:59.000Z | 2022-03-29T17:12:22.000Z | import json
from typing import List, Union
from playhouse.shortcuts import update_model_from_dict
from typing_extensions import TypedDict
import auth
from api.socket.constants import GAME_NS
from app import app, sio
from models import (
Floor,
Initiative,
Layer,
Location,
LocationOptions,
Loca... | 30.376164 | 129 | 0.607835 | import json
from typing import List, Union
from playhouse.shortcuts import update_model_from_dict
from typing_extensions import TypedDict
import auth
from api.socket.constants import GAME_NS
from app import app, sio
from models import (
Floor,
Initiative,
Layer,
Location,
LocationOptions,
Loca... | true | true |
1c0ae0c6765757de1cdc795dd16394e0719c3b6b | 27,289 | py | Python | tensor2tensor/models/research/moe.py | jinliangwei/tensor2tensor-1.11 | bfca92e0c48956ad5be987b25b4309a59ff61bb5 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/models/research/moe.py | jinliangwei/tensor2tensor-1.11 | bfca92e0c48956ad5be987b25b4309a59ff61bb5 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/models/research/moe.py | jinliangwei/tensor2tensor-1.11 | bfca92e0c48956ad5be987b25b4309a59ff61bb5 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 40.130882 | 80 | 0.728389 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mesh_tensorflow as mtf
import tensorflow as tf
def transformer_moe_layer_v1(inputs, output_dim, hparams, train,
master_dtype=tf.bfloat16,
sli... | true | true |
1c0ae28b90d3ca3dfeaf4d7ed4bc9410c99b4e44 | 1,816 | py | Python | mce_filebrowser/migrations/0002_auto__add_field_filebrowserfile_user_id.py | FullFact/Django-tinymce-filebrowser | 4f43f84c2758f599556993aa4e09c03befe44974 | [
"MIT"
] | null | null | null | mce_filebrowser/migrations/0002_auto__add_field_filebrowserfile_user_id.py | FullFact/Django-tinymce-filebrowser | 4f43f84c2758f599556993aa4e09c03befe44974 | [
"MIT"
] | null | null | null | mce_filebrowser/migrations/0002_auto__add_field_filebrowserfile_user_id.py | FullFact/Django-tinymce-filebrowser | 4f43f84c2758f599556993aa4e09c03befe44974 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import datetime
# from south.db import db
# from south.v2 import SchemaMigration
from django.db import models, migrations
from taggit.managers import TaggableManager
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('mce_filebrowser', '0001_... | 37.833333 | 118 | 0.600771 | import datetime
from django.db import models, migrations
from taggit.managers import TaggableManager
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('mce_filebrowser', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
... | true | true |
1c0ae2e2d38eb776d925bd91481af85cd42b69f5 | 22,148 | py | Python | subversion/tests/cmdline/svntest/verify.py | ruchirarya/svn | 81502a213251c2af21361a942bd9a8cd7d3adb9f | [
"Apache-2.0"
] | 7 | 2018-01-18T06:13:21.000Z | 2020-07-09T03:46:16.000Z | depe/subversion/subversion/tests/cmdline/svntest/verify.py | louis-tru/TouchCode2 | 91c182aeaa37fba16e381ea749d32906dab1aeea | [
"BSD-3-Clause-Clear"
] | 4 | 2015-01-12T22:23:41.000Z | 2015-01-12T22:33:52.000Z | src/subversion/subversion/tests/cmdline/svntest/verify.py | schwern/alien-svn | 7423b08f9bc4fdf0ac0d7ea53495269b21b3e8f9 | [
"Apache-2.0"
] | 1 | 2020-11-04T07:25:22.000Z | 2020-11-04T07:25:22.000Z | #
# verify.py: routines that handle comparison and display of expected
# vs. actual output
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Licensed to the Apache Softwar... | 34.28483 | 81 | 0.675411 |
import re, sys
from difflib import unified_diff, ndiff
import pprint
import logging
import svntest
logger = logging.getLogger()
class SVNUnexpectedOutput(svntest.Failure):
pass
class SVNUnexpectedStdout(SVNUnexpectedOutput):
pass
class SVNUnexpectedStderr(SVNUnexpectedOutput):
pass
class SVNExpectedStdou... | true | true |
1c0ae404a6c027db79983257b3fcc9b548491c88 | 2,561 | py | Python | gesture_control.py | naseemap47/GestureVolumeControl-ComputerVision-python | 17f7b1aa6528d5a0701e49ce294708ccd5d574b0 | [
"MIT"
] | 1 | 2022-03-01T16:48:35.000Z | 2022-03-01T16:48:35.000Z | gesture_control.py | naseemap47/GestureVolumeControl-ComputerVision-python | 17f7b1aa6528d5a0701e49ce294708ccd5d574b0 | [
"MIT"
] | null | null | null | gesture_control.py | naseemap47/GestureVolumeControl-ComputerVision-python | 17f7b1aa6528d5a0701e49ce294708ccd5d574b0 | [
"MIT"
] | null | null | null | import cv2
import mediapipe as mp
import time
import math
import numpy as np
from change_vol import set_master_volume
cap = cv2.VideoCapture(0)
p_time = 0
mp_hand = mp.solutions.hands
hand = mp_hand.Hands(max_num_hands=1)
mp_draw = mp.solutions.drawing_utils
vol = 0
vol_bar = 400
while True:
success, img = cap.... | 33.25974 | 78 | 0.500976 | import cv2
import mediapipe as mp
import time
import math
import numpy as np
from change_vol import set_master_volume
cap = cv2.VideoCapture(0)
p_time = 0
mp_hand = mp.solutions.hands
hand = mp_hand.Hands(max_num_hands=1)
mp_draw = mp.solutions.drawing_utils
vol = 0
vol_bar = 400
while True:
success, img = cap.... | true | true |
1c0ae46aa55005586cb5027168f068093f57ae59 | 16,094 | py | Python | pandas/tests/generic/test_duplicate_labels.py | nickleus27/pandas | e892d46598d303530519dde7e00b69e549a3d7ea | [
"BSD-3-Clause"
] | 3 | 2018-04-24T13:31:51.000Z | 2019-07-09T07:31:43.000Z | pandas/tests/generic/test_duplicate_labels.py | nickleus27/pandas | e892d46598d303530519dde7e00b69e549a3d7ea | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/generic/test_duplicate_labels.py | nickleus27/pandas | e892d46598d303530519dde7e00b69e549a3d7ea | [
"BSD-3-Clause"
] | 5 | 2018-04-24T13:31:56.000Z | 2021-10-21T05:06:23.000Z | """Tests dealing with the NDFrame.allows_duplicates."""
import operator
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
not_implemented = pytest.mark.xfail(reason="Not implemented.")
# ----------------------------------------------------------------------------
# Preservation
cla... | 35.371429 | 88 | 0.516963 | import operator
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
not_implemented = pytest.mark.xfail(reason="Not implemented.")
class TestPreserves:
@pytest.mark.parametrize(
"cls, data",
[
(pd.Series, np.array([])),
(pd.Series, [1, 2]),... | true | true |
1c0ae48b9f51327c20e0f601768bdf52440cc838 | 6,604 | py | Python | src/estimation/evaluation.py | LadaOndris/IBT | 5f8f9207f8cce3124cf92c60874691ebb8d0fe42 | [
"MIT"
] | null | null | null | src/estimation/evaluation.py | LadaOndris/IBT | 5f8f9207f8cce3124cf92c60874691ebb8d0fe42 | [
"MIT"
] | 4 | 2021-11-10T20:11:43.000Z | 2022-03-12T00:57:01.000Z | src/estimation/evaluation.py | LadaOndris/IBT | 5f8f9207f8cce3124cf92c60874691ebb8d0fe42 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import src.estimation.configuration as configs
from src.datasets.bighand.dataset import BighandDataset
from src.datasets.msra.dataset import MSRADataset
from src.estimation.preprocessing import DatasetPreprocessor
from src.estimation.architecture.jgrp2o import JGR_J2O... | 50.030303 | 116 | 0.757874 | import matplotlib.pyplot as plt
import numpy as np
import src.estimation.configuration as configs
from src.datasets.bighand.dataset import BighandDataset
from src.datasets.msra.dataset import MSRADataset
from src.estimation.preprocessing import DatasetPreprocessor
from src.estimation.architecture.jgrp2o import JGR_J2O... | true | true |
1c0ae504b04c48a65559668f541ea7d568c41596 | 352 | py | Python | src/driver.py | anishLearnsToCode/stop-words-removal | 6f6698b1456f399ae04e032b1cab039dccd41060 | [
"MIT"
] | null | null | null | src/driver.py | anishLearnsToCode/stop-words-removal | 6f6698b1456f399ae04e032b1cab039dccd41060 | [
"MIT"
] | null | null | null | src/driver.py | anishLearnsToCode/stop-words-removal | 6f6698b1456f399ae04e032b1cab039dccd41060 | [
"MIT"
] | null | null | null | import nltk
import pickle
from utils import tokenize_document
resume_file = open('../assets/resume.txt', 'r')
resume = resume_file.read()
resume_file.close()
tokenizer = nltk.RegexpTokenizer(r'\w+')
resume_tokenized = tokenize_document(resume, tokenizer)
print(resume_tokenized)
pickle.dump(resume_tokenized, open('../... | 27.076923 | 70 | 0.775568 | import nltk
import pickle
from utils import tokenize_document
resume_file = open('../assets/resume.txt', 'r')
resume = resume_file.read()
resume_file.close()
tokenizer = nltk.RegexpTokenizer(r'\w+')
resume_tokenized = tokenize_document(resume, tokenizer)
print(resume_tokenized)
pickle.dump(resume_tokenized, open('../... | true | true |
1c0ae5684e49a48de9f7e54ab57a8f7b88aa68c2 | 15,075 | py | Python | mmd_scripting/scratch_stuff/reweight_blender_fragments.py | Nuthouse01/PMX-VMD-Scripting-Tools | 21a397db92c5f8034494dfcc41c7814096d3dd50 | [
"MIT"
] | 54 | 2020-07-15T02:51:47.000Z | 2022-03-22T01:33:54.000Z | mmd_scripting/scratch_stuff/reweight_blender_fragments.py | Nuthouse01/VMD-to-text-Conversion-Tool | 0d9334bd5735accdd8bb6e1b69889fbe054a7481 | [
"MIT"
] | 5 | 2020-09-05T23:22:40.000Z | 2021-11-26T22:32:09.000Z | mmd_scripting/scratch_stuff/reweight_blender_fragments.py | Nuthouse01/VMD-to-text-Conversion-Tool | 0d9334bd5735accdd8bb6e1b69889fbe054a7481 | [
"MIT"
] | 13 | 2020-09-05T19:06:27.000Z | 2022-02-14T16:01:09.000Z | import mmd_scripting.core.nuthouse01_core as core
import mmd_scripting.core.nuthouse01_pmx_parser as pmxlib
import mmd_scripting.core.nuthouse01_pmx_struct as pmxstruct
_SCRIPT_VERSION = "Script version: Nuthouse01 - v0.6.01 - 7/12/2021"
# This code is free to use and re-distribute, but I cannot be held responsible f... | 47.109375 | 287 | 0.733665 | import mmd_scripting.core.nuthouse01_core as core
import mmd_scripting.core.nuthouse01_pmx_parser as pmxlib
import mmd_scripting.core.nuthouse01_pmx_struct as pmxstruct
_SCRIPT_VERSION = "Script version: Nuthouse01 - v0.6.01 - 7/12/2021"
helptext = '''=================================================
asdfasdf
'''
... | true | true |
1c0ae58c075ec080530a245ed4a6ccbf2740dd2f | 1,309 | py | Python | tests/test_critical.py | peterpramb/pynagioscheck | 63220f30fb62335a57cbf029946e6a801c81e6f1 | [
"BSD-2-Clause"
] | null | null | null | tests/test_critical.py | peterpramb/pynagioscheck | 63220f30fb62335a57cbf029946e6a801c81e6f1 | [
"BSD-2-Clause"
] | null | null | null | tests/test_critical.py | peterpramb/pynagioscheck | 63220f30fb62335a57cbf029946e6a801c81e6f1 | [
"BSD-2-Clause"
] | 1 | 2022-02-14T08:28:10.000Z | 2022-02-14T08:28:10.000Z | #!/usr/bin/env python
#
# pylint: disable=E0401,E1101,W0201
from nose.tools import raises
from nagioscheck import NagiosCheck, Status
from tests import NagiosCheckTest, WouldHaveExitNonZero
class SimplePessimisticCheck(NagiosCheck):
version = '1.2.3'
msg = "YOU DUN MADE ME MAD"
def __init__(self, *args... | 26.18 | 62 | 0.669977 |
from nose.tools import raises
from nagioscheck import NagiosCheck, Status
from tests import NagiosCheckTest, WouldHaveExitNonZero
class SimplePessimisticCheck(NagiosCheck):
version = '1.2.3'
msg = "YOU DUN MADE ME MAD"
def __init__(self, *args, **kwargs):
NagiosCheck.__init__(self, *args, **kwa... | true | true |
1c0ae69728e675454aa3505a9ef36ba0f23df7f7 | 116 | py | Python | Curso_de_Python_ Curso_em_Video/PythonTeste/estruturaDeRepeticaoFor001.py | DanilooSilva/Cursos_de_Python | 8f167a4c6e16f01601e23b6f107578aa1454472d | [
"MIT"
] | null | null | null | Curso_de_Python_ Curso_em_Video/PythonTeste/estruturaDeRepeticaoFor001.py | DanilooSilva/Cursos_de_Python | 8f167a4c6e16f01601e23b6f107578aa1454472d | [
"MIT"
] | null | null | null | Curso_de_Python_ Curso_em_Video/PythonTeste/estruturaDeRepeticaoFor001.py | DanilooSilva/Cursos_de_Python | 8f167a4c6e16f01601e23b6f107578aa1454472d | [
"MIT"
] | null | null | null | i = int(input('Ínicio: '))
f = int(input('Fim: '))
p = int(input('Passo: '))
for c in range(i, f, p):
print(c)
| 19.333333 | 26 | 0.525862 | i = int(input('Ínicio: '))
f = int(input('Fim: '))
p = int(input('Passo: '))
for c in range(i, f, p):
print(c)
| true | true |
1c0ae72b873aa96ac0c0c65d3087997670a56428 | 1,402 | py | Python | experiments/text2speech_org/minimalbot.py | float-cat/text2speech_bot | b819c764c2b823a7121dd8c45f27ebf773b52ead | [
"MIT"
] | null | null | null | experiments/text2speech_org/minimalbot.py | float-cat/text2speech_bot | b819c764c2b823a7121dd8c45f27ebf773b52ead | [
"MIT"
] | 10 | 2021-02-01T07:48:18.000Z | 2021-02-06T21:33:23.000Z | experiments/text2speech_org/minimalbot.py | vtrokhymenko/text2speech_bot | b819c764c2b823a7121dd8c45f27ebf773b52ead | [
"MIT"
] | 1 | 2021-03-23T01:55:45.000Z | 2021-03-23T01:55:45.000Z | # minimalbot для проверки функций получения и отправки аудио
import os
import sk_adapter
import telebot
bot_config = {}
bot_config["TG_SEX"] = "male"
bot_config["TG_TOKEN"] = os.environ.get("TG_TOKEN")
bot_config["GLOBAL_IAM_TOKEN"] = os.environ.get("IAM_TOKEN")
bot_config["GLOBAL_ID_FOLDER"] = os.environ.get("ID_FOL... | 31.155556 | 117 | 0.720399 | import os
import sk_adapter
import telebot
bot_config = {}
bot_config["TG_SEX"] = "male"
bot_config["TG_TOKEN"] = os.environ.get("TG_TOKEN")
bot_config["GLOBAL_IAM_TOKEN"] = os.environ.get("IAM_TOKEN")
bot_config["GLOBAL_ID_FOLDER"] = os.environ.get("ID_FOLDER")
bot = telebot.TeleBot(bot_config["TG_TOKEN"])
@bot.m... | true | true |
1c0aea53e3ed4bdcf1ed2d12aaf3ef790fbbca91 | 1,634 | py | Python | pytcnz/squashnz/registrations_reader.py | madduck/pytcnz | 95be82e0bd513f7f86ae44bf1d2c4d993887eb54 | [
"MIT"
] | null | null | null | pytcnz/squashnz/registrations_reader.py | madduck/pytcnz | 95be82e0bd513f7f86ae44bf1d2c4d993887eb54 | [
"MIT"
] | null | null | null | pytcnz/squashnz/registrations_reader.py | madduck/pytcnz | 95be82e0bd513f7f86ae44bf1d2c4d993887eb54 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © 2021–2022 martin f. krafft <tctools@pobox.madduck.net>
# Released under the MIT Licence
#
import pyexcel
from ..datasource import DataSource
from .player import Player
class RegistrationsReader(DataSource):
def __init__(self, filename, *, Player_class=None, **kwargs):
... | 28.172414 | 71 | 0.625459 |
import pyexcel
from ..datasource import DataSource
from .player import Player
class RegistrationsReader(DataSource):
def __init__(self, filename, *, Player_class=None, **kwargs):
self.__open_book(filename)
super().__init__(Player_class=Player_class or Player, **kwargs)
def __open_book(self, ... | true | true |
1c0aeb9ff15a0c1f1b4b025c2a79c72dfb77f9aa | 26 | py | Python | spr/core/__init__.py | aksr-aashish/spr | d63068f04fae262d351403103c8155af3f846cc9 | [
"MIT"
] | 35 | 2021-07-16T01:27:25.000Z | 2022-03-31T03:44:56.000Z | spr/core/__init__.py | aksr-aashish/spr | d63068f04fae262d351403103c8155af3f846cc9 | [
"MIT"
] | 3 | 2021-09-02T11:18:07.000Z | 2022-03-31T12:51:38.000Z | spr/core/__init__.py | aksr-aashish/spr | d63068f04fae262d351403103c8155af3f846cc9 | [
"MIT"
] | 88 | 2021-07-16T02:21:53.000Z | 2022-03-30T06:08:42.000Z | from .keyboard import ikb
| 13 | 25 | 0.807692 | from .keyboard import ikb
| true | true |
1c0aec6f49f4a61026df88a08407ecb386994222 | 1,269 | py | Python | test/test_install_devices.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_install_devices.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_install_devices.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
ESPER API REFERENCE
OpenAPI spec version: 1.0.0
Contact: developer@esper.io
---------------------------------------------------------
Copyright 2019 Shoonya Enterprises Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... | 23.943396 | 72 | 0.716312 |
from __future__ import absolute_import
import unittest
import esperclient
from esperclient.models.install_devices import InstallDevices
from esperclient.rest import ApiException
class TestInstallDevices(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testIns... | true | true |
1c0aec81ba04717d00bf07fa1c680747e27cf451 | 1,624 | py | Python | live_stream/renderers.py | amyxzhang/pano-server | b3949af178a41b6327b5a74dae96fc466b12f91a | [
"MIT"
] | 22 | 2015-03-10T12:53:36.000Z | 2022-03-01T15:15:39.000Z | live_stream/renderers.py | amyxzhang/pano-server | b3949af178a41b6327b5a74dae96fc466b12f91a | [
"MIT"
] | 135 | 2015-01-13T03:36:43.000Z | 2018-10-06T20:09:45.000Z | live_stream/renderers.py | haystack/eyebrowse-server | 582570a9af031efba77f4c50286fdc24dcec1e55 | [
"MIT"
] | 11 | 2015-03-12T21:07:32.000Z | 2018-07-26T16:58:53.000Z | from django.template.loader import render_to_string
from common.constants import EMPTY_SEARCH_MSG
import urllib
def history_renderer(user, history,
hist_type, return_type,
empty_search_msg,
template, get_params=None,
following=None)... | 31.230769 | 77 | 0.535099 | from django.template.loader import render_to_string
from common.constants import EMPTY_SEARCH_MSG
import urllib
def history_renderer(user, history,
hist_type, return_type,
empty_search_msg,
template, get_params=None,
following=None)... | true | true |
1c0aed4eba1a4d2e5704be971c04cc9807e72faa | 49 | py | Python | presto_types_parser/src/row_parsing_exception.py | ofekby/presto-types-parser | b1f2d8b686c1a0b2eeec71b8545e1693a92965e7 | [
"Apache-2.0"
] | null | null | null | presto_types_parser/src/row_parsing_exception.py | ofekby/presto-types-parser | b1f2d8b686c1a0b2eeec71b8545e1693a92965e7 | [
"Apache-2.0"
] | null | null | null | presto_types_parser/src/row_parsing_exception.py | ofekby/presto-types-parser | b1f2d8b686c1a0b2eeec71b8545e1693a92965e7 | [
"Apache-2.0"
] | null | null | null | class RowParsingException(Exception):
pass
| 16.333333 | 38 | 0.755102 | class RowParsingException(Exception):
pass
| true | true |
1c0aedb68ccbbbfe2dd4ca81949b34f560eba29b | 1,299 | py | Python | openstates/metadata/data/wi.py | washabstract/openstates-core | ea69564f1f56fe4a80181b0aa715731bbc47e3f5 | [
"MIT"
] | 9 | 2020-04-04T00:19:07.000Z | 2022-02-27T02:24:12.000Z | openstates/metadata/data/wi.py | washabstract/openstates-core | ea69564f1f56fe4a80181b0aa715731bbc47e3f5 | [
"MIT"
] | 17 | 2020-03-31T18:19:59.000Z | 2022-01-03T15:18:48.000Z | openstates/metadata/data/wi.py | washabstract/openstates-core | ea69564f1f56fe4a80181b0aa715731bbc47e3f5 | [
"MIT"
] | 19 | 2020-04-10T21:32:21.000Z | 2022-03-02T20:23:21.000Z | from ..models import State, Chamber, simple_numbered_districts
WI = State(
name="Wisconsin",
abbr="WI",
capital="Madison",
capital_tz="America/Chicago",
fips="55",
unicameral=False,
legislature_name="Wisconsin State Legislature",
legislature_organization_id="ocd-organization/1cba9936-eb... | 34.184211 | 88 | 0.668976 | from ..models import State, Chamber, simple_numbered_districts
WI = State(
name="Wisconsin",
abbr="WI",
capital="Madison",
capital_tz="America/Chicago",
fips="55",
unicameral=False,
legislature_name="Wisconsin State Legislature",
legislature_organization_id="ocd-organization/1cba9936-eb... | true | true |
1c0aee1282811471dcf1281573e2a3b21e6d9f75 | 5,816 | py | Python | torchvision/prototype/datasets/utils/_dataset.py | kohtala/vision | 107dec64bd3b1c9bc7a1d74de5173fa4c56e40d3 | [
"BSD-3-Clause"
] | 1 | 2021-10-30T17:22:08.000Z | 2021-10-30T17:22:08.000Z | torchvision/prototype/datasets/utils/_dataset.py | davidmn19/vision | 48ebc0bbdb12089eca557d52a8db7b0674b23486 | [
"BSD-3-Clause"
] | null | null | null | torchvision/prototype/datasets/utils/_dataset.py | davidmn19/vision | 48ebc0bbdb12089eca557d52a8db7b0674b23486 | [
"BSD-3-Clause"
] | null | null | null | import abc
import csv
import enum
import io
import os
import pathlib
from typing import Any, Callable, Dict, List, Optional, Sequence, Union, Tuple
import torch
from torch.utils.data import IterDataPipe
from torchvision.prototype.datasets.utils._internal import (
add_suggestion,
sequence_to_str,
)
from .._hom... | 32.858757 | 105 | 0.608494 | import abc
import csv
import enum
import io
import os
import pathlib
from typing import Any, Callable, Dict, List, Optional, Sequence, Union, Tuple
import torch
from torch.utils.data import IterDataPipe
from torchvision.prototype.datasets.utils._internal import (
add_suggestion,
sequence_to_str,
)
from .._hom... | true | true |
1c0aeeed96110e8a7b7606c0a630cbb6fd238084 | 24,243 | py | Python | train_blending.py | wordsand/fsgan | dabfc28afda0463100f37c48fd6dfed308e6e2b0 | [
"CC0-1.0"
] | null | null | null | train_blending.py | wordsand/fsgan | dabfc28afda0463100f37c48fd6dfed308e6e2b0 | [
"CC0-1.0"
] | null | null | null | train_blending.py | wordsand/fsgan | dabfc28afda0463100f37c48fd6dfed308e6e2b0 | [
"CC0-1.0"
] | null | null | null | import os
import itertools
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils as tutils
import torch.nn.functional as F
import numpy as np
import cv2
from tqdm import tqdm
from fsgan.utils.obj_factory import obj_factory
from fsgan.utils.tensorboard_logger import TensorBoardLogger
from fsgan.... | 48.680723 | 118 | 0.630863 | import os
import itertools
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.utils as tutils
import torch.nn.functional as F
import numpy as np
import cv2
from tqdm import tqdm
from fsgan.utils.obj_factory import obj_factory
from fsgan.utils.tensorboard_logger import TensorBoardLogger
from fsgan.... | true | true |
1c0aef6470728675fc8ddead6b2ef0627fcba1a5 | 20,272 | py | Python | nova/tests/virt/vmwareapi/test_ds_util.py | bopopescu/nova-26 | 3154f2cb0eb0d8c447c6d18ee0bab5e7dbeba60b | [
"Apache-2.0"
] | null | null | null | nova/tests/virt/vmwareapi/test_ds_util.py | bopopescu/nova-26 | 3154f2cb0eb0d8c447c6d18ee0bab5e7dbeba60b | [
"Apache-2.0"
] | null | null | null | nova/tests/virt/vmwareapi/test_ds_util.py | bopopescu/nova-26 | 3154f2cb0eb0d8c447c6d18ee0bab5e7dbeba60b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2014 VMware, 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 a... | 41.371429 | 78 | 0.579371 |
import contextlib
import re
import mock
from nova import exception
from nova.i18n import _
from nova.openstack.common import units
from nova import test
from nova.tests.virt.vmwareapi import fake
from nova.virt.vmwareapi import ds_util
from nova.virt.vmwareapi import error_util
class DsUtilTestCase(test.NoDBTestCa... | true | true |
1c0aef7012b4543d8e1c1629616502c388c52098 | 576 | py | Python | 2015/day1/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2015/day1/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | 2015/day1/puzzle2.py | tcmitchell/AdventOfCode | caaac1aa37c999d4804f9f4154bf7033a06e98af | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
def load_data(filename):
with open(filename, 'rb') as f:
return f.read()
def main(argv=None):
if not argv:
argv = sys.argv
instructions = load_data(argv[1])
print len(instructions), 'instructions'
floor = 0
pos = 1
for i in instructions:
... | 19.862069 | 53 | 0.519097 |
import sys
def load_data(filename):
with open(filename, 'rb') as f:
return f.read()
def main(argv=None):
if not argv:
argv = sys.argv
instructions = load_data(argv[1])
print len(instructions), 'instructions'
floor = 0
pos = 1
for i in instructions:
if i == '(':
... | false | true |
1c0af0339d8069bc0536eda014b6b8c2142bead5 | 7,459 | py | Python | client/openapi_client/models/client_predicate.py | NCATS-Tangerine/kba-reasoner | 19ea293fa02693b2df5ecfe1d91856b34e73a3e1 | [
"MIT"
] | null | null | null | client/openapi_client/models/client_predicate.py | NCATS-Tangerine/kba-reasoner | 19ea293fa02693b2df5ecfe1d91856b34e73a3e1 | [
"MIT"
] | null | null | null | client/openapi_client/models/client_predicate.py | NCATS-Tangerine/kba-reasoner | 19ea293fa02693b2df5ecfe1d91856b34e73a3e1 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Translator Knowledge Beacon Aggregator API
This is the Translator Knowledge Beacon Aggregator web service application programming interface (API) that provides integrated access to a pool of knowledge sources publishing concepts and relations through the Translator Knowledge Beacon API. Th... | 32.714912 | 570 | 0.612817 |
import pprint
import re
import six
class ClientPredicate(object):
openapi_types = {
'description': 'str',
'id': 'str',
'uri': 'str',
'edge_label': 'str',
'beacons': 'list[ClientPredicatesByBeacon]'
}
attribute_map = {
'description': 'description',
... | true | true |
1c0af0bd7ab5ef139ffda685a06aae02eeb13d70 | 1,203 | py | Python | setup.py | filips123/ZeroFramePy | 0fab804ec7bbfaf2743bc1358aa1a07e2189d4e0 | [
"MIT"
] | 3 | 2019-09-05T15:09:47.000Z | 2020-04-11T09:05:00.000Z | setup.py | filips123/ZeroFramePy | 0fab804ec7bbfaf2743bc1358aa1a07e2189d4e0 | [
"MIT"
] | 3 | 2019-09-14T10:06:35.000Z | 2020-04-20T17:51:34.000Z | setup.py | filips123/ZeroFramePy | 0fab804ec7bbfaf2743bc1358aa1a07e2189d4e0 | [
"MIT"
] | 1 | 2020-07-19T11:59:32.000Z | 2020-07-19T11:59:32.000Z | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(
name = 'zeroframe-ws-client',
description = 'ZeroFrame WebSocket API for Python',
long_description = readme(),
long_description_content_type='text/markdown',
license = 'MIT',
version... | 25.595745 | 76 | 0.600998 | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(
name = 'zeroframe-ws-client',
description = 'ZeroFrame WebSocket API for Python',
long_description = readme(),
long_description_content_type='text/markdown',
license = 'MIT',
version... | true | true |
1c0af15c198f33b6d5165ffac3d6a78eb7c46044 | 1,198 | py | Python | expmgmt/utils/regex.py | wbrandenburger/ExpMgmt | bc2383bb360d8d7e876d503c1570c2d9188f8e39 | [
"MIT"
] | null | null | null | expmgmt/utils/regex.py | wbrandenburger/ExpMgmt | bc2383bb360d8d7e876d503c1570c2d9188f8e39 | [
"MIT"
] | null | null | null | expmgmt/utils/regex.py | wbrandenburger/ExpMgmt | bc2383bb360d8d7e876d503c1570c2d9188f8e39 | [
"MIT"
] | null | null | null | # ===========================================================================
# regex.py ----------------------------------------------------------------
# ===========================================================================
# import ------------------------------------------------------------------
# -----... | 42.785714 | 80 | 0.191152 |
import re
class ReSearch():
def __init__(self, regex, group):
self._regex = re.compile(regex)
self._group = int(group)
def __call__(self, pattern):
try:
result = self._regex.search(pattern).group(self._group)
except AttributeError:
resu... | true | true |
1c0af2afe90360a5ace2863e7eaef35c9dd727be | 460 | py | Python | 11/test11.1.py | BillZong/CorePythonProgrammingDemos | c97b6f2c1533a3eeaf35d2de39902b95e969a411 | [
"MIT"
] | null | null | null | 11/test11.1.py | BillZong/CorePythonProgrammingDemos | c97b6f2c1533a3eeaf35d2de39902b95e969a411 | [
"MIT"
] | null | null | null | 11/test11.1.py | BillZong/CorePythonProgrammingDemos | c97b6f2c1533a3eeaf35d2de39902b95e969a411 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Demo 11.1 for chapter 11."""
def new_foo(arg1, arg2, *nkw, **kw):
"""Display regular args and all variable args."""
print 'arg1 is:', arg1
print 'arg2 is:', arg2
for each_nkw in nkw:
print 'additional non-keyword arg:', each_nkw
for each_kw in kw.keys():
p... | 27.058824 | 58 | 0.6 |
"""Demo 11.1 for chapter 11."""
def new_foo(arg1, arg2, *nkw, **kw):
"""Display regular args and all variable args."""
print 'arg1 is:', arg1
print 'arg2 is:', arg2
for each_nkw in nkw:
print 'additional non-keyword arg:', each_nkw
for each_kw in kw.keys():
print "additional keywo... | false | true |
1c0af2ca95bcab4c75908ed5bda5cdd56ba64458 | 124 | py | Python | fabfile/__init__.py | maherpk/django-boilerplate | 9b1001d3dd1ea435288c9a2fc5fc52a2a209164e | [
"MIT"
] | null | null | null | fabfile/__init__.py | maherpk/django-boilerplate | 9b1001d3dd1ea435288c9a2fc5fc52a2a209164e | [
"MIT"
] | 1 | 2016-04-05T22:02:40.000Z | 2016-04-05T22:03:20.000Z | fabfile/__init__.py | maherpk/django-boilerplate | 9b1001d3dd1ea435288c9a2fc5fc52a2a209164e | [
"MIT"
] | null | null | null | import setup
import os
CONF_DIR = os.path.dirname(os.path.dirname(__file__))
BASE_DIR = os.path.join(CONF_DIR, os.pardir)
| 17.714286 | 53 | 0.766129 | import setup
import os
CONF_DIR = os.path.dirname(os.path.dirname(__file__))
BASE_DIR = os.path.join(CONF_DIR, os.pardir)
| true | true |
1c0af334f5bcd9334c4d60936816e725c0afd9db | 142,836 | py | Python | cs-20151215/python/alibabacloud_cs20151215/models.py | atptro/alibabacloud-sdk | 65d4a000e4f4059b58ca1bc3d032853aedef4f3f | [
"Apache-2.0"
] | null | null | null | cs-20151215/python/alibabacloud_cs20151215/models.py | atptro/alibabacloud-sdk | 65d4a000e4f4059b58ca1bc3d032853aedef4f3f | [
"Apache-2.0"
] | null | null | null | cs-20151215/python/alibabacloud_cs20151215/models.py | atptro/alibabacloud-sdk | 65d4a000e4f4059b58ca1bc3d032853aedef4f3f | [
"Apache-2.0"
] | null | null | null | # This file is auto-generated, don't edit it. Thanks.
from Tea.model import TeaModel
class ResumeComponentUpgradeRequest(TeaModel):
def __init__(self, headers=None):
self.headers = {}
def validate(self):
pass
def to_map(self):
result = {}
result['headers'] = self.headers
... | 31.496362 | 1,106 | 0.609902 | from Tea.model import TeaModel
class ResumeComponentUpgradeRequest(TeaModel):
def __init__(self, headers=None):
self.headers = {}
def validate(self):
pass
def to_map(self):
result = {}
result['headers'] = self.headers
return result
def from_map(self, map={}):... | true | true |
1c0af4a8d7fa006aa325fa6ee57fafb4d14efbcc | 363 | py | Python | user.py | JKimani77/Password-locker | a4bf94b85466e535360074d98228185d34f476aa | [
"MIT"
] | 1 | 2020-01-08T12:28:46.000Z | 2020-01-08T12:28:46.000Z | user.py | ramza007/Password-Locker | 63ee0eada73d1ef361bd96f378a8051364110a71 | [
"MIT"
] | null | null | null | user.py | ramza007/Password-Locker | 63ee0eada73d1ef361bd96f378a8051364110a71 | [
"MIT"
] | 1 | 2020-01-28T08:33:27.000Z | 2020-01-28T08:33:27.000Z | class User:
'''
class that generates new instance of user
'''
user_list = []
def __init__(self, user_name, password):
self.user_name = user_name
self.password = password
def save_user(self):
'''
save_user method saves a new user objects to the user_list
... | 19.105263 | 66 | 0.592287 | class User:
user_list = []
def __init__(self, user_name, password):
self.user_name = user_name
self.password = password
def save_user(self):
User.user_list.append(self)
| true | true |
1c0af526f94db45d07d499832b557419693ac000 | 2,630 | py | Python | blog/views.py | Vardancer/django_blog | d5dae0e4f05bd306d39dd63d289ca7ed48b516d1 | [
"BSD-2-Clause"
] | null | null | null | blog/views.py | Vardancer/django_blog | d5dae0e4f05bd306d39dd63d289ca7ed48b516d1 | [
"BSD-2-Clause"
] | 7 | 2019-12-04T22:27:15.000Z | 2022-02-10T07:57:32.000Z | blog/views.py | Vardancer/django_blog | d5dae0e4f05bd306d39dd63d289ca7ed48b516d1 | [
"BSD-2-Clause"
] | null | null | null | from django.contrib.auth.views import LoginView, LogoutView
from django.http import HttpResponseForbidden
from django.urls import reverse, reverse_lazy
from django.views.generic import ListView, DetailView, CreateView, FormView
from django.views.generic.edit import FormMixin, ModelFormMixin
from blog.models import Arti... | 30.581395 | 89 | 0.687833 | from django.contrib.auth.views import LoginView, LogoutView
from django.http import HttpResponseForbidden
from django.urls import reverse, reverse_lazy
from django.views.generic import ListView, DetailView, CreateView, FormView
from django.views.generic.edit import FormMixin, ModelFormMixin
from blog.models import Arti... | true | true |
1c0af5706b11c7e1b837d2895f43d63ac02b2e83 | 24,703 | py | Python | harry_potter_quiz.py | stoporinjail/harry_potter_games | 7fae841bfa5cb7af2c78e14246deb387fff9fbcd | [
"BSL-1.0"
] | 4 | 2020-09-15T13:05:28.000Z | 2021-02-06T17:39:24.000Z | harry_potter_quiz.py | stoporinjail/harry_potter_games.py | 7fae841bfa5cb7af2c78e14246deb387fff9fbcd | [
"BSL-1.0"
] | 2 | 2020-09-14T17:44:48.000Z | 2021-02-16T14:45:43.000Z | harry_potter_quiz.py | stoporinjail/harry_potter_games.py | 7fae841bfa5cb7af2c78e14246deb387fff9fbcd | [
"BSL-1.0"
] | null | null | null | from sys import exit as e
name = input('What is your name? ')
def dictionary():
def Cedric_Diggory():
while True:
cedric_diggory = {"name":"Cedric Diggory",
"species":"human",
"gender":"male",
"house":"Hufflepuff",
"bloodStatus":"Unknown (not Muggle-born)",
"eyeColor":"gray",
... | 35.905523 | 184 | 0.605473 | from sys import exit as e
name = input('What is your name? ')
def dictionary():
def Cedric_Diggory():
while True:
cedric_diggory = {"name":"Cedric Diggory",
"species":"human",
"gender":"male",
"house":"Hufflepuff",
"bloodStatus":"Unknown (not Muggle-born)",
"eyeColor":"gray",
... | true | true |
1c0af597402fb736d0872cd35d8258a439b75bb1 | 15,953 | py | Python | src/pymor/algorithms/ei.py | fameyer/pymorWin | b449a38754fddb719d554f1aacf9280a585f1168 | [
"Unlicense"
] | null | null | null | src/pymor/algorithms/ei.py | fameyer/pymorWin | b449a38754fddb719d554f1aacf9280a585f1168 | [
"Unlicense"
] | null | null | null | src/pymor/algorithms/ei.py | fameyer/pymorWin | b449a38754fddb719d554f1aacf9280a585f1168 | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
"""This module contains algorithms for the empirical interpolation of operators.
The main work for generating the... | 42.541333 | 116 | 0.674544 |
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.linalg import solve_triangular, cho_factor, cho_solve
from pymor.core.logger import getLogger
from pymor.core.cache import CacheableInterface, cached
from pymor.la.interfaces import VectorArrayInterface
from pymor.la.pod ... | true | true |
1c0af5c92af0d47018dd47a383985b52a1b0c115 | 1,421 | py | Python | chapters/chap03.py | DatHydroGuy/RayTracer | f870d3eb0408e52b92ee528bb6615187b762bede | [
"MIT"
] | null | null | null | chapters/chap03.py | DatHydroGuy/RayTracer | f870d3eb0408e52b92ee528bb6615187b762bede | [
"MIT"
] | null | null | null | chapters/chap03.py | DatHydroGuy/RayTracer | f870d3eb0408e52b92ee528bb6615187b762bede | [
"MIT"
] | null | null | null | from matrices import Matrix
from tuples import Tuple
def run():
# Inverse of the identity = the identity
matrix = Matrix.identity(4).inverse()
for row in matrix.matrix:
print(row)
print()
# Matrix * it's inverse = the identity
matrix = Matrix([[3, -9, 7, 3], [3, -8, 2, -9], [-4, 4, 4... | 23.295082 | 83 | 0.518649 | from matrices import Matrix
from tuples import Tuple
def run():
matrix = Matrix.identity(4).inverse()
for row in matrix.matrix:
print(row)
print()
matrix = Matrix([[3, -9, 7, 3], [3, -8, 2, -9], [-4, 4, 4, 1], [-6, 5, -1, 1]])
inv = matrix.inverse()
mult = matrix * inv
fo... | true | true |
1c0af5febedcc553e4c6a842e6832b43ac76dea2 | 741 | py | Python | reportportal_client/__init__.py | Scanters/client-Python | ece2a12ac390d8d66d507c5d61104b695851ff5d | [
"Apache-2.0"
] | null | null | null | reportportal_client/__init__.py | Scanters/client-Python | ece2a12ac390d8d66d507c5d61104b695851ff5d | [
"Apache-2.0"
] | null | null | null | reportportal_client/__init__.py | Scanters/client-Python | ece2a12ac390d8d66d507c5d61104b695851ff5d | [
"Apache-2.0"
] | 1 | 2020-04-10T07:23:15.000Z | 2020-04-10T07:23:15.000Z | # Copyright (c) 2018 http://reportportal.io
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.681818 | 75 | 0.759784 |
from reportportal_client.core.rp_service import ReportPortalService
__all__ = (
ReportPortalService,
)
POST_LOGBATCH_RETRY_COUNT = 10
| true | true |
1c0af69c33762248257bdf2450637bc669390c2a | 1,030 | py | Python | src/python/test.py | lupino3/libcircllhist | b86ff46c7bc25301f539e258fd07be99b67b5709 | [
"Apache-2.0"
] | 82 | 2016-08-26T06:25:48.000Z | 2021-03-08T21:41:13.000Z | src/python/test.py | lupino3/libcircllhist | b86ff46c7bc25301f539e258fd07be99b67b5709 | [
"Apache-2.0"
] | 32 | 2016-07-01T19:39:06.000Z | 2020-07-29T16:27:00.000Z | src/python/test.py | lupino3/libcircllhist | b86ff46c7bc25301f539e258fd07be99b67b5709 | [
"Apache-2.0"
] | 15 | 2016-09-27T01:13:55.000Z | 2021-03-05T03:15:20.000Z | "Test for circllhist"
import unittest
from circllhist import Circllhist, Circllbin
class TestHistogram(unittest.TestCase):
def test_hist(self):
h = Circllhist()
h.insert(123,3)
h.insert_intscale(1,1)
self.assertEqual(h.count(), 4)
self.assertEqual(h.bin_count(), 2)
... | 29.428571 | 57 | 0.616505 |
import unittest
from circllhist import Circllhist, Circllbin
class TestHistogram(unittest.TestCase):
def test_hist(self):
h = Circllhist()
h.insert(123,3)
h.insert_intscale(1,1)
self.assertEqual(h.count(), 4)
self.assertEqual(h.bin_count(), 2)
self.assertAlmostEqua... | true | true |
1c0af6b5e70fff37956619708b518974686dd959 | 337 | py | Python | ExerciciosPythonMundo1/22. Tabuada.py | juniorppb/arquivos-python | 25690e9ba65352fc332a0517ef65f1042e44edff | [
"MIT"
] | null | null | null | ExerciciosPythonMundo1/22. Tabuada.py | juniorppb/arquivos-python | 25690e9ba65352fc332a0517ef65f1042e44edff | [
"MIT"
] | null | null | null | ExerciciosPythonMundo1/22. Tabuada.py | juniorppb/arquivos-python | 25690e9ba65352fc332a0517ef65f1042e44edff | [
"MIT"
] | null | null | null | tab = int(input('Olá, você quer a tabuada de qual número? '))
n1 = tab * 1
n2 = tab * 2
n3 = tab * 3
n4 = tab * 4
n5 = tab * 5
n6 = tab * 6
n7 = tab * 7
n8 = tab * 8
n9 = tab * 9
n10 = tab * 10
print('Em sequência, os resultados são: \n {}\n {}\n {}\n {}\n {}\n {}\n {}\n {}\n {}\n {}'.format(n1, n2, n3, n4, n5, n6, n7,... | 22.466667 | 140 | 0.510386 | tab = int(input('Olá, você quer a tabuada de qual número? '))
n1 = tab * 1
n2 = tab * 2
n3 = tab * 3
n4 = tab * 4
n5 = tab * 5
n6 = tab * 6
n7 = tab * 7
n8 = tab * 8
n9 = tab * 9
n10 = tab * 10
print('Em sequência, os resultados são: \n {}\n {}\n {}\n {}\n {}\n {}\n {}\n {}\n {}\n {}'.format(n1, n2, n3, n4, n5, n6, n7,... | true | true |
1c0af700e8daa836879a2b0f4146df8c68c93320 | 424 | py | Python | api/accounts/views.py | yetiblue/testtemplate | 1fdc8a987710be89f53551934bf0539a8899b12a | [
"MIT"
] | null | null | null | api/accounts/views.py | yetiblue/testtemplate | 1fdc8a987710be89f53551934bf0539a8899b12a | [
"MIT"
] | null | null | null | api/accounts/views.py | yetiblue/testtemplate | 1fdc8a987710be89f53551934bf0539a8899b12a | [
"MIT"
] | null | null | null | from rest_framework.viewsets import ModelViewSet
from accounts.serializers import UserSerializer
from accounts.models import User
class CurrentUserViewSet(ModelViewSet):
model = User
queryset = User.objects.all()
serializer_class = UserSerializer
def get_object(self):
return self.request.use... | 24.941176 | 54 | 0.735849 | from rest_framework.viewsets import ModelViewSet
from accounts.serializers import UserSerializer
from accounts.models import User
class CurrentUserViewSet(ModelViewSet):
model = User
queryset = User.objects.all()
serializer_class = UserSerializer
def get_object(self):
return self.request.use... | true | true |
1c0af7521ca093b62d1b9d9db71efe8c5f8d0840 | 2,123 | py | Python | uwsgi/app.py | abid-mujtaba/BitcoinTracker-server | 1d986319c62da0d7368b8edf410358917def36b7 | [
"Apache-2.0"
] | null | null | null | uwsgi/app.py | abid-mujtaba/BitcoinTracker-server | 1d986319c62da0d7368b8edf410358917def36b7 | [
"Apache-2.0"
] | null | null | null | uwsgi/app.py | abid-mujtaba/BitcoinTracker-server | 1d986319c62da0d7368b8edf410358917def36b7 | [
"Apache-2.0"
] | null | null | null | import os
import re
import routes
import logging
import sys
import wsgiref.util
# We start by appending the current folder to the system path to allow importing custom modules:
path = os.path.abspath(os.path.dirname(__file__)) # Append the absolute path of the current folder to the python path
if not path ... | 32.661538 | 148 | 0.7122 | import os
import re
import routes
import logging
import sys
import wsgiref.util
path = os.path.abspath(os.path.dirname(__file__))
if not path in sys.path:
sys.path.insert(1, path)
del path
logger = logging.getLogger('bitcoin.logger')
logger.setLevel(logging.DEBUG)
import api
import current
import e... | true | true |
1c0af888487d961026564a71556ac8f47363bf8a | 31,636 | py | Python | devito/ir/iet/visitors.py | reguly/devito | 543b7be41ddbf1faa90224cca3824767756c9390 | [
"MIT"
] | 1 | 2022-01-25T02:20:52.000Z | 2022-01-25T02:20:52.000Z | devito/ir/iet/visitors.py | reguly/devito | 543b7be41ddbf1faa90224cca3824767756c9390 | [
"MIT"
] | null | null | null | devito/ir/iet/visitors.py | reguly/devito | 543b7be41ddbf1faa90224cca3824767756c9390 | [
"MIT"
] | null | null | null | """
Visitor hierarchy to inspect and/or create IETs.
The main Visitor class is adapted from https://github.com/coneoproject/COFFEE.
"""
from collections import OrderedDict
from collections.abc import Iterable
from itertools import chain, groupby
import cgen as c
from sympy import IndexedBase
from devito.exceptions ... | 34.499455 | 90 | 0.559995 |
from collections import OrderedDict
from collections.abc import Iterable
from itertools import chain, groupby
import cgen as c
from sympy import IndexedBase
from devito.exceptions import VisitorException
from devito.ir.iet.nodes import (Node, Iteration, Expression, ExpressionBundle,
... | true | true |
1c0af89869a43b0cfa3acc78219f9c217ac9d2f4 | 1,930 | py | Python | tools/scoring/score/dimensions/raw_field_selection.py | samkenxstream/digitalbuildings | 59ca7adeccf762810349927b44bc8f2bbeafa65b | [
"Apache-2.0"
] | null | null | null | tools/scoring/score/dimensions/raw_field_selection.py | samkenxstream/digitalbuildings | 59ca7adeccf762810349927b44bc8f2bbeafa65b | [
"Apache-2.0"
] | 1 | 2021-10-22T02:32:33.000Z | 2021-10-22T02:32:33.000Z | tools/scoring/score/dimensions/raw_field_selection.py | josephedwardchang/digitalbuildings | cf412172fa8577392cf0447511589fbbb6792809 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | 35.090909 | 77 | 0.769948 |
from score.dimensions.dimension import Dimension
from score.constants import FileTypes, DimensionCategories
PROPOSED, SOLUTION = FileTypes
class RawFieldSelection(Dimension):
category = DimensionCategories.SIMPLE
def _fetch_raw_field_names(self, translations):
return set([
translation.raw_fiel... | true | true |
1c0af8bb4061811c5f1116ef1e06e1caf10b7393 | 57 | py | Python | debugTest.py | kamilawasilewska/mgr | cc4365d268dcff72670e73c86c9c5d38c850fa74 | [
"MIT"
] | null | null | null | debugTest.py | kamilawasilewska/mgr | cc4365d268dcff72670e73c86c9c5d38c850fa74 | [
"MIT"
] | null | null | null | debugTest.py | kamilawasilewska/mgr | cc4365d268dcff72670e73c86c9c5d38c850fa74 | [
"MIT"
] | null | null | null | from XTTreeLabeled import XTTreeLabeled
XTTreeLabeled(0) | 19 | 39 | 0.877193 | from XTTreeLabeled import XTTreeLabeled
XTTreeLabeled(0) | true | true |
1c0af8c2be75cc911e92fed708531830c589e5f7 | 16,347 | py | Python | tools/pagination.py | combe15/Raphael-Bot | 1bf34b48e92c4bef1740ec507e3e5c08a3b284a3 | [
"MIT"
] | 5 | 2021-05-22T02:49:08.000Z | 2021-06-26T05:41:43.000Z | tools/pagination.py | combe15/Raphael-Bot | 1bf34b48e92c4bef1740ec507e3e5c08a3b284a3 | [
"MIT"
] | null | null | null | tools/pagination.py | combe15/Raphael-Bot | 1bf34b48e92c4bef1740ec507e3e5c08a3b284a3 | [
"MIT"
] | 2 | 2021-05-24T19:47:39.000Z | 2021-05-28T20:31:48.000Z | import asyncio
import logging
import typing
import discord
from discord.abc import User
from discord.ext.commands import Context, Paginator
import constants
FIRST_EMOJI = constants.Emojis.first
LEFT_EMOJI = constants.Emojis.previous
RIGHT_EMOJI = constants.Emojis.next
LAST_EMOJI = constants.Emojis.last
DELETE_EMOJI ... | 38.104895 | 118 | 0.559613 | import asyncio
import logging
import typing
import discord
from discord.abc import User
from discord.ext.commands import Context, Paginator
import constants
FIRST_EMOJI = constants.Emojis.first
LEFT_EMOJI = constants.Emojis.previous
RIGHT_EMOJI = constants.Emojis.next
LAST_EMOJI = constants.Emojis.last
DELETE_EMOJI ... | true | true |
1c0afa94212ce83eaf0d970000cbb3b3067008fa | 400 | py | Python | friction_ramp_analysis/__main__.py | JSotres/AFM-Friction-Ramp-Analysis | d663134f148575f09e2991186c991ed00598ab5e | [
"MIT"
] | null | null | null | friction_ramp_analysis/__main__.py | JSotres/AFM-Friction-Ramp-Analysis | d663134f148575f09e2991186c991ed00598ab5e | [
"MIT"
] | null | null | null | friction_ramp_analysis/__main__.py | JSotres/AFM-Friction-Ramp-Analysis | d663134f148575f09e2991186c991ed00598ab5e | [
"MIT"
] | null | null | null | '''
Main function for the Friction Ramp Analysis Software
'''
import sys
from PyQt5.QtWidgets import QApplication
from .classes.callFrictionRampGUI import (
frictionRampGUI)
if __name__ == "__main__":
app = QApplication(sys.argv)
# Creates an instance of the main GUI
# defined in defined in call... | 23.529412 | 53 | 0.7075 |
import sys
from PyQt5.QtWidgets import QApplication
from .classes.callFrictionRampGUI import (
frictionRampGUI)
if __name__ == "__main__":
app = QApplication(sys.argv)
w = frictionRampGUI()
w.show()
sys.exit(app.exec_()) | true | true |
1c0afaa947f7346f912251e8123ff8d515610865 | 9,202 | py | Python | parser/team29/Analizador/Expresiones.py | susanliss/tytus | a613a2352cf4a1d0e90ce27bb346ab60ed8039cc | [
"MIT"
] | null | null | null | parser/team29/Analizador/Expresiones.py | susanliss/tytus | a613a2352cf4a1d0e90ce27bb346ab60ed8039cc | [
"MIT"
] | null | null | null | parser/team29/Analizador/Expresiones.py | susanliss/tytus | a613a2352cf4a1d0e90ce27bb346ab60ed8039cc | [
"MIT"
] | null | null | null | from abc import abstractmethod
from enum import Enum
from typing import Type
class TYPE(Enum):
NUMBER = 1
STRING = 2
BOOLEAN = 3
class Expresion:
'''
Esta clase representa una expresión
'''
@abstractmethod
def execute(self):
pass
class ExpresionUnaria(Expresion):
'''
... | 34.208178 | 141 | 0.5589 | from abc import abstractmethod
from enum import Enum
from typing import Type
class TYPE(Enum):
NUMBER = 1
STRING = 2
BOOLEAN = 3
class Expresion:
@abstractmethod
def execute(self):
pass
class ExpresionUnaria(Expresion):
def __init__(self, exp, operador):
self.exp = exp
... | true | true |
1c0afc3fb5faa0db5c5ee8d78bd09ca56bde791f | 10,344 | py | Python | research/object_detection/core/standard_fields.py | taegoobot/models | 2c54560546b17d3766a12f248e5a57f5e65995a8 | [
"Apache-2.0"
] | null | null | null | research/object_detection/core/standard_fields.py | taegoobot/models | 2c54560546b17d3766a12f248e5a57f5e65995a8 | [
"Apache-2.0"
] | null | null | null | research/object_detection/core/standard_fields.py | taegoobot/models | 2c54560546b17d3766a12f248e5a57f5e65995a8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 44.017021 | 80 | 0.765275 |
class InputDataFields(object):
image = 'image'
image_additional_channels = 'image_additional_channels'
original_image = 'original_image'
original_image_spatial_shape = 'original_image_spatial_shape'
key = 'key'
source_id = 'source_id'
filename = 'filename'
groundtruth_gsd = 'groundtruth_gsd'
ground... | true | true |
1c0afdd4f3c304a0d0fd1c40e981cda86f56418f | 1,155 | py | Python | joki.py | fulcrum101/klases_avize | b7e605bdc721705eda8752614d33d81d73bfbe1d | [
"MIT"
] | null | null | null | joki.py | fulcrum101/klases_avize | b7e605bdc721705eda8752614d33d81d73bfbe1d | [
"MIT"
] | null | null | null | joki.py | fulcrum101/klases_avize | b7e605bdc721705eda8752614d33d81d73bfbe1d | [
"MIT"
] | null | null | null | import streamlit as st
def Joki_lapa():
st.header('Joki')
###
st.write('Skolotāja: Bērni, kā jūs domājat, cik skola ir augsta?')
st.write('Jānītis: 1m 50cm')
st.write('Kapēc tu tā domā?')
st.write('Jo skola man ir līdz kaklam!')
st.write('----------')
###
st.write('Sakiet, skolotāj,... | 31.216216 | 86 | 0.57316 | import streamlit as st
def Joki_lapa():
st.header('Joki')
st.write('Skolotāja: Bērni, kā jūs domājat, cik skola ir augsta?')
st.write('Jānītis: 1m 50cm')
st.write('Kapēc tu tā domā?')
st.write('Jo skola man ir līdz kaklam!')
st.write('----------')
st.write('Sakiet, skolotāj, vai cil... | true | true |
1c0afe35e0b316700ce2f943b9a0e776888dcc18 | 12,441 | py | Python | src/pretix/presale/views/__init__.py | gvarela1981/pretix | 5cc0bd5d367a8cf46c9635d2e2e474c81210cb80 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-25T00:11:00.000Z | 2020-04-25T00:11:00.000Z | src/pretix/presale/views/__init__.py | gvarela1981/pretix | 5cc0bd5d367a8cf46c9635d2e2e474c81210cb80 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/presale/views/__init__.py | gvarela1981/pretix | 5cc0bd5d367a8cf46c9635d2e2e474c81210cb80 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | from collections import defaultdict
from datetime import datetime, timedelta
from decimal import Decimal
from functools import wraps
from itertools import groupby
from django.conf import settings
from django.db.models import Prefetch, Sum
from django.utils.functional import cached_property
from django.utils.timezone i... | 38.162577 | 116 | 0.620207 | from collections import defaultdict
from datetime import datetime, timedelta
from decimal import Decimal
from functools import wraps
from itertools import groupby
from django.conf import settings
from django.db.models import Prefetch, Sum
from django.utils.functional import cached_property
from django.utils.timezone i... | true | true |
1c0affdf9084da842b1538f67ac264dea9fd678d | 12,439 | py | Python | src/losses/vggloss.py | krishna-aditi/Big-Data-Systems-Assignment-2 | a7e02b4588e9609c6a9ff12e04169ca042300950 | [
"MIT"
] | 38 | 2020-12-08T18:13:54.000Z | 2022-03-10T09:44:02.000Z | src/losses/vggloss.py | krishna-aditi/Big-Data-Systems-Assignment-2 | a7e02b4588e9609c6a9ff12e04169ca042300950 | [
"MIT"
] | 1 | 2021-11-14T03:11:09.000Z | 2022-02-11T23:39:26.000Z | src/losses/vggloss.py | krishna-aditi/Big-Data-Systems-Assignment-2 | a7e02b4588e9609c6a9ff12e04169ca042300950 | [
"MIT"
] | 18 | 2020-10-27T08:22:17.000Z | 2022-02-24T06:51:53.000Z | """
Various loss functions for training
"""
import os
import tensorflow as tf
# Global vars for VGG19 loss
global vggfull
global vggfeats
global vggfeats_l
global vggfeats_seq
global vggfeats_seq_l
global vgginput_shape
global vgginit
# Download this file using keras first.
_default_vgg_weights = f'{os.environ["HOM... | 43.645614 | 138 | 0.618458 | import os
import tensorflow as tf
global vggfull
global vggfeats
global vggfeats_l
global vggfeats_seq
global vggfeats_seq_l
global vgginput_shape
global vgginit
_default_vgg_weights = f'{os.environ["HOME"]}/.keras/models/vgg19_weights_tf_dim_ordering_tf_kernels_notop.h5'
class VGGLoss():
def __init__(self,
... | true | true |
1c0b009058b525551eec7ee0b5232228a4756307 | 1,559 | py | Python | twitoffDS9/TWITOFF/twitter.py | Zebfred/twitter_3 | 8eb74768fc783d5d02214870067ce012044f373b | [
"MIT"
] | null | null | null | twitoffDS9/TWITOFF/twitter.py | Zebfred/twitter_3 | 8eb74768fc783d5d02214870067ce012044f373b | [
"MIT"
] | 3 | 2020-03-24T18:11:35.000Z | 2021-02-02T22:37:57.000Z | twitoffDS9/TWITOFF/twitter.py | Zebfred/twitter_3 | 8eb74768fc783d5d02214870067ce012044f373b | [
"MIT"
] | null | null | null | """Retrieve tweets, embedding, save into database"""
import basilica
import tweepy
from .models import DB, Tweet, User
from decouple import config
TWITTER_AUTH = tweepy.OAuthHandler(config('TWITTER_CONSUMER_KEY'),
config('TWITTER_CONSUMER_SECRET'))
TWITTER_AUTH.set_access_token(co... | 34.644444 | 81 | 0.660038 |
import basilica
import tweepy
from .models import DB, Tweet, User
from decouple import config
TWITTER_AUTH = tweepy.OAuthHandler(config('TWITTER_CONSUMER_KEY'),
config('TWITTER_CONSUMER_SECRET'))
TWITTER_AUTH.set_access_token(config('TWITTER_ACCESS_TOKEN'),
... | true | true |
1c0b009c35a18c252cc5f4ec2c83588148e8832c | 763 | py | Python | appengine_config.py | tomasfse/netblocks | 42eea55ded695dca5954b5fbefaa864a1cd1cd21 | [
"Apache-2.0"
] | 8 | 2018-02-28T15:46:14.000Z | 2020-03-06T10:20:07.000Z | appengine_config.py | tomasfse/netblocks | 42eea55ded695dca5954b5fbefaa864a1cd1cd21 | [
"Apache-2.0"
] | 2 | 2017-10-06T17:49:44.000Z | 2018-06-02T16:50:47.000Z | appengine_config.py | tomasfse/netblocks | 42eea55ded695dca5954b5fbefaa864a1cd1cd21 | [
"Apache-2.0"
] | 2 | 2017-10-04T16:32:50.000Z | 2020-04-05T17:46:07.000Z | #
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 31.791667 | 74 | 0.753604 |
from google.appengine.ext import vendor
vendor.add('lib')
| true | true |
1c0b012a40b78bc8d6ed20a13c5666bcacd9cdbf | 136 | py | Python | Python Script Tools/38.0 Area Of A Circle.py | juan1305/0.11-incremento_descremento | 954ddb32180c3197e5b01cf95d20f5325ada8a29 | [
"MIT"
] | 1 | 2020-04-13T00:16:16.000Z | 2020-04-13T00:16:16.000Z | Python Script Tools/38.0 Area Of A Circle.py | juan1305/0.11-incremento_descremento | 954ddb32180c3197e5b01cf95d20f5325ada8a29 | [
"MIT"
] | null | null | null | Python Script Tools/38.0 Area Of A Circle.py | juan1305/0.11-incremento_descremento | 954ddb32180c3197e5b01cf95d20f5325ada8a29 | [
"MIT"
] | null | null | null | from math import pi
r = float(input('Escriba el radio del circulo: '))
area = pi*r**2
print("El area del circulo es {}". format(area)) | 27.2 | 50 | 0.676471 | from math import pi
r = float(input('Escriba el radio del circulo: '))
area = pi*r**2
print("El area del circulo es {}". format(area)) | true | true |
1c0b0206ecb822cd581d9e481c64160208b552a2 | 10,289 | py | Python | build/lib/biolearns/coexpression/lmQCM.py | huangzhii/biolearns | 95d58d55690e550fff94730f34ed7c0fb96f12af | [
"MIT"
] | 7 | 2020-02-26T17:30:20.000Z | 2022-02-22T06:06:47.000Z | build/lib/biolearns/coexpression/lmQCM.py | huangzhii/biolearns | 95d58d55690e550fff94730f34ed7c0fb96f12af | [
"MIT"
] | 1 | 2021-06-29T16:17:56.000Z | 2021-06-29T16:19:20.000Z | build/lib/biolearns/coexpression/lmQCM.py | huangzhii/biolearns | 95d58d55690e550fff94730f34ed7c0fb96f12af | [
"MIT"
] | null | null | null | # Copyright 2020 Zhi Huang. All rights reserved
# Created on Mon Feb 10 17:57:08 2020
# Author: Zhi Huang, Purdue University
# ___ ___ ___ ___ ___
# /\__\ /\__\ /\ \ /\ \ /\__\
# /:/ / /::| | /::\ \ /::\ \ /... | 47.855814 | 242 | 0.563417 |
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy.stats import spearmanr
class lmQCM():
def __init__(self, data_in = None, gamma = 0.55, t = 1, lambdaa = 1, beta = 0.4,
minClusterSize = 10, CCmethod = "pearson", normalization = False):
self.data_in = ... | true | true |
1c0b0215310248d1433c189c1b4bc31df13bb3b2 | 550 | py | Python | image.py | Iphytech/image-download | d1cc25880dc00331781f785daecb4723f17a494b | [
"MIT"
] | null | null | null | image.py | Iphytech/image-download | d1cc25880dc00331781f785daecb4723f17a494b | [
"MIT"
] | null | null | null | image.py | Iphytech/image-download | d1cc25880dc00331781f785daecb4723f17a494b | [
"MIT"
] | null | null | null | import random
# module that will aid us download image from the web
import urllib.request
# function that will collect the image url to be downloaded
def download_image(url):
name = random.randrange(1, 1000)
full_name = str(name) + ".png"
# function to save the image passed
urllib.request.urlretriev... | 28.947368 | 96 | 0.749091 | import random
import urllib.request
def download_image(url):
name = random.randrange(1, 1000)
full_name = str(name) + ".png"
urllib.request.urlretrieve(url, full_name)
download_image("https://cdn.pixabay.com/photo/2017/01/06/19/15/soap-bubble-1958650_960_720.jpg")
| true | true |
1c0b02c94a00ebb19c4398084ab10354a9da2056 | 1,848 | py | Python | aoc-2021-python/day11.py | mihaicostin/advent-of-code | f6c1121e831fb55a7620369970b31654ee5e50e3 | [
"MIT"
] | 1 | 2018-12-07T13:48:24.000Z | 2018-12-07T13:48:24.000Z | aoc-2021-python/day11.py | mihaicostin/adventofcode-2018 | f6c1121e831fb55a7620369970b31654ee5e50e3 | [
"MIT"
] | null | null | null | aoc-2021-python/day11.py | mihaicostin/adventofcode-2018 | f6c1121e831fb55a7620369970b31654ee5e50e3 | [
"MIT"
] | null | null | null | def parse_input(file_name):
result = []
with open(file_name) as f:
file_lines = f.readlines()
for line in file_lines:
line_nr = list(map(lambda x: int(x), line.strip()))
result.append(line_nr)
return result
octopuses = parse_input("day11.txt")
def increment_energy... | 26.4 | 132 | 0.544372 | def parse_input(file_name):
result = []
with open(file_name) as f:
file_lines = f.readlines()
for line in file_lines:
line_nr = list(map(lambda x: int(x), line.strip()))
result.append(line_nr)
return result
octopuses = parse_input("day11.txt")
def increment_energy... | true | true |
1c0b02d3c66c1f2920832ad0eb0dbec942004988 | 697 | py | Python | src/onnx_ddd.py | mayanks888/CenterNet | e331bd17f158847564f5fb131185b21ece82b559 | [
"MIT"
] | null | null | null | src/onnx_ddd.py | mayanks888/CenterNet | e331bd17f158847564f5fb131185b21ece82b559 | [
"MIT"
] | null | null | null | src/onnx_ddd.py | mayanks888/CenterNet | e331bd17f158847564f5fb131185b21ece82b559 | [
"MIT"
] | null | null | null | import torch
import torchvision
import torch.onnx
# from models.model import create_model, load_model
from lib.models.model import create_model, load_model
input = torch.randn(1, 3, 512, 512)
## mobilenetv2_10
# model = create_model('mobilenetv2_10', heads={'hm': 1, 'wh': 2, 'reg': 2}, head_conv=24)
## resnet18
model ... | 43.5625 | 126 | 0.705882 | import torch
import torchvision
import torch.onnx
from lib.models.model import create_model, load_model
input = torch.randn(1, 3, 512, 512)
model = create_model('res_18', heads={'hm': 3, 'dep': 1, 'rot': 8, 'dim': 3, 'wh': 2, 'reg': 2}, head_conv=256)
onnx_model_name="../onnx/model.onnx"
torch.onnx.export(model, inpu... | true | true |
1c0b033dcd4f07f92b1ed34ba308df9b55b06ab7 | 1,888 | py | Python | tests/short/discount_test.py | jackharmer/agency | 5a78dd23e14c44c4076e49ea44b83ab1697e51c8 | [
"MIT"
] | 2 | 2022-03-30T19:51:42.000Z | 2022-03-30T20:05:39.000Z | tests/short/discount_test.py | jackharmer/agency | 5a78dd23e14c44c4076e49ea44b83ab1697e51c8 | [
"MIT"
] | null | null | null | tests/short/discount_test.py | jackharmer/agency | 5a78dd23e14c44c4076e49ea44b83ab1697e51c8 | [
"MIT"
] | null | null | null | import torch
from agency.tools.gamma_matrix import make_gamma_matrix, discount
from pytest import approx
def simple_discount(rewards, gamma, value, masks):
discounts = []
V = value
for cc in reversed(range(len(rewards))):
V = rewards[cc] + gamma * masks[cc] * V
discounts.append(V)
retu... | 26.222222 | 65 | 0.597458 | import torch
from agency.tools.gamma_matrix import make_gamma_matrix, discount
from pytest import approx
def simple_discount(rewards, gamma, value, masks):
discounts = []
V = value
for cc in reversed(range(len(rewards))):
V = rewards[cc] + gamma * masks[cc] * V
discounts.append(V)
retu... | true | true |
1c0b03bff8a3792c2fda3ca566690889daa1b4be | 53,030 | py | Python | contrib/tools/python3/src/Lib/imaplib.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 8 | 2018-12-06T05:18:14.000Z | 2021-01-21T21:28:26.000Z | contrib/tools/python3/src/Lib/imaplib.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | null | null | null | contrib/tools/python3/src/Lib/imaplib.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 4 | 2018-08-07T23:05:19.000Z | 2021-01-12T03:20:02.000Z | """IMAP4 client.
Based on RFC 2060.
Public class: IMAP4
Public variable: Debug
Public functions: Internaldate2tuple
Int2AP
ParseFlags
Time2Internaldate
"""
# Author: Piers Lauder <piers@cs.su.oz.au> December 1997.
#
# Auth... | 32.937888 | 119 | 0.563643 |
__version__ = "2.58"
import binascii, errno, random, re, socket, subprocess, sys, time, calendar
from datetime import datetime, timezone, timedelta
from io import DEFAULT_BUFFER_SIZE
try:
import ssl
HAVE_SSL = True
except ImportError:
HAVE_SSL = False
__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2t... | true | true |
1c0b03c74c87b255799bee617d218007492291d6 | 2,310 | py | Python | source/conf.py | allixender/30MapChallenge2020 | 70c5aa1fc39ac4620464f3f64bbfdf91ae1bca86 | [
"MIT"
] | 11 | 2020-11-04T04:55:40.000Z | 2021-11-12T10:43:20.000Z | source/conf.py | allixender/30MapChallenge2020 | 70c5aa1fc39ac4620464f3f64bbfdf91ae1bca86 | [
"MIT"
] | null | null | null | source/conf.py | allixender/30MapChallenge2020 | 70c5aa1fc39ac4620464f3f64bbfdf91ae1bca86 | [
"MIT"
] | 2 | 2020-11-06T10:31:34.000Z | 2021-11-12T10:43:23.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.478261 | 79 | 0.661039 |
project = "30-day Map Challenge 2020"
copyright = "2020, Alexander Kmoch"
author = "Alexander Kmoch"
release = "2021.04"
extensions = []
templates_path = ["_templates"]
exclude_patterns = []
html_theme = "pydata_sphinx_theme"
html_logo = "_static/logo.png"
html_static_path = ["_static"]
html_theme_opti... | true | true |
1c0b043d9dd3506c66a7dc83bd900647675c3712 | 2,412 | py | Python | apps/file/views.py | nowindxdw/flask_base | 44963513a3945ebf6cd7c4dcd7fbd67d6d8c5641 | [
"MIT"
] | null | null | null | apps/file/views.py | nowindxdw/flask_base | 44963513a3945ebf6cd7c4dcd7fbd67d6d8c5641 | [
"MIT"
] | 2 | 2020-04-22T11:26:13.000Z | 2020-04-22T11:26:20.000Z | apps/file/views.py | nowindxdw/flask_base | 44963513a3945ebf6cd7c4dcd7fbd67d6d8c5641 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import json
import os
from flask import render_template,request
from apps import app
from apps.file import file
from apps.file import utils as file_utils
# 这段代码是为了解决Python中中文输出出错而写,在Python2中适用,在Python3中已无效
#import sys
#reload(sys)
#sys.setdefaultencoding('utf8')
# how ... | 30.531646 | 90 | 0.59743 |
import json
import os
from flask import render_template,request
from apps import app
from apps.file import file
from apps.file import utils as file_utils
@file.route("/file/file_list", methods=['GET', 'POST'])
def file_list():
data = []
for i in os.listdir(os.path.join(app.config.get('BASEDIR'),'test')):
... | true | true |
1c0b048b7f15ca045be4afb4e5a01c467cf4a487 | 3,287 | py | Python | Classes/SlotMag.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Classes/SlotMag.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | Classes/SlotMag.py | Superomeg4/pyleecan | 2b695b5f39e77475a07aa0ea89489fb0a9659337 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Warning : this file has been generated, you shouldn't edit it"""
from os import linesep
from pyleecan.Classes.check import check_init_dict, check_var, raise_
from pyleecan.Functions.save import save
from pyleecan.Classes.Slot import Slot
from pyleecan.Classes.check import InitUnKnowClassErr... | 33.20202 | 88 | 0.61728 |
from os import linesep
from pyleecan.Classes.check import check_init_dict, check_var, raise_
from pyleecan.Functions.save import save
from pyleecan.Classes.Slot import Slot
from pyleecan.Classes.check import InitUnKnowClassError
class SlotMag(Slot):
VERSION = 1
save = save
def __init__(self, W3=0... | true | true |
1c0b07286bcca10f1155f2fef4981a35e9aeb6b9 | 327 | py | Python | config.py | deabreu/flask-cadastro-alunos | f0a518b05578f6ade015306cfc83c117afa33de6 | [
"Apache-2.0"
] | null | null | null | config.py | deabreu/flask-cadastro-alunos | f0a518b05578f6ade015306cfc83c117afa33de6 | [
"Apache-2.0"
] | null | null | null | config.py | deabreu/flask-cadastro-alunos | f0a518b05578f6ade015306cfc83c117afa33de6 | [
"Apache-2.0"
] | null | null | null | """Configurações de bootstrap"""
class Config(object):
"""Flask configuration object"""
FLASK_ENV = "development"
DEBUG=True
SECRET_KEY = "Segredo"
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://seu_usuario:password@127.0.0.1:3306/Escola"
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS =... | 29.727273 | 90 | 0.721713 |
class Config(object):
FLASK_ENV = "development"
DEBUG=True
SECRET_KEY = "Segredo"
SQLALCHEMY_DATABASE_URI = "mysql+pymysql://seu_usuario:password@127.0.0.1:3306/Escola"
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
| true | true |
1c0b0755e7d94c39e167d6f40ba5155e22276a4d | 1,788 | py | Python | crabageprediction/venv/Lib/site-packages/pandas/tests/frame/methods/test_copy.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 28,899 | 2016-10-13T03:32:12.000Z | 2022-03-31T21:39:05.000Z | crabageprediction/venv/Lib/site-packages/pandas/tests/frame/methods/test_copy.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 31,004 | 2016-10-12T23:22:27.000Z | 2022-03-31T23:17:38.000Z | crabageprediction/venv/Lib/site-packages/pandas/tests/frame/methods/test_copy.py | 13rianlucero/CrabAgePrediction | 92bc7fbe1040f49e820473e33cc3902a5a7177c7 | [
"MIT"
] | 15,149 | 2016-10-13T03:21:31.000Z | 2022-03-31T18:46:47.000Z | import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame
import pandas._testing as tm
class TestCopy:
@pytest.mark.parametrize("attr", ["index", "columns"])
def test_copy_index_name_checking(self, float_frame, attr):
# don't want to be able to modify th... | 27.9375 | 87 | 0.569351 | import numpy as np
import pytest
import pandas.util._test_decorators as td
from pandas import DataFrame
import pandas._testing as tm
class TestCopy:
@pytest.mark.parametrize("attr", ["index", "columns"])
def test_copy_index_name_checking(self, float_frame, attr):
# making a copy
ind ... | true | true |
1c0b088da47a876fe059210031393d9e59aedbb9 | 3,643 | py | Python | bindings/python/ensmallen/datasets/string/pseudomonasbrassicacearumsubspbrassicacearumnfm421.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/pseudomonasbrassicacearumsubspbrassicacearumnfm421.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/pseudomonasbrassicacearumsubspbrassicacearumnfm421.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Pseudomonas brassicacearum subsp. brassicacearum NFM421.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
ti... | 34.695238 | 223 | 0.689542 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def PseudomonasBrassicacearumSubspBrassicacearumNfm421(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
c... | true | true |
1c0b09aece1105bea5e536c14d896a0dfc4bf1f2 | 1,819 | py | Python | src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/table_get_properties_resource.py | limingu/azure-cli-extensions | 1bc29f089f4da42ab8905e440f2f46d6b5b0aa97 | [
"MIT"
] | 2 | 2021-06-05T17:51:26.000Z | 2021-11-17T11:17:56.000Z | src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/table_get_properties_resource.py | limingu/azure-cli-extensions | 1bc29f089f4da42ab8905e440f2f46d6b5b0aa97 | [
"MIT"
] | 1 | 2020-06-12T01:39:40.000Z | 2020-06-12T01:39:40.000Z | src/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/models/table_get_properties_resource.py | anpaz-msft/azure-cli-extensions | 847fd487fe61e83f2a4163a9393edc9555267bc2 | [
"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 ... | 33.072727 | 76 | 0.588785 |
from msrest.serialization import Model
class TableGetPropertiesResource(Model):
_validation = {
'id': {'required': True},
'_rid': {'readonly': True},
'_ts': {'readonly': True},
'_etag': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
... | true | true |
1c0b0a71aef319e6427925a7586a88c8f76de166 | 633 | py | Python | scripts/compute_covariance_descriptor.py | SheffieldChemoinformatics/molsg | 13c2edfce84539266e344119316b29a070816afc | [
"BSD-3-Clause"
] | 4 | 2020-06-22T02:53:48.000Z | 2022-03-11T00:50:17.000Z | scripts/compute_covariance_descriptor.py | SheffieldChemoinformatics/molsg | 13c2edfce84539266e344119316b29a070816afc | [
"BSD-3-Clause"
] | 1 | 2018-12-08T21:08:26.000Z | 2019-02-18T11:34:45.000Z | scripts/compute_covariance_descriptor.py | SheffieldChemoinformatics/molsg | 13c2edfce84539266e344119316b29a070816afc | [
"BSD-3-Clause"
] | 6 | 2019-07-04T08:24:01.000Z | 2022-03-08T06:11:56.000Z | """Compute example WKS compute_WKS_descriptor."""
from __future__ import print_function, absolute_import
import numpy as np
from molsg.laplacemesh import compute_lb_fem
from molsg.localgeometry import WKS_descriptor
from molsg.covariance import covariance_descriptor
evals = 100
mol = np.load('data/ampc/npy/actives18.... | 33.315789 | 59 | 0.78357 | from __future__ import print_function, absolute_import
import numpy as np
from molsg.laplacemesh import compute_lb_fem
from molsg.localgeometry import WKS_descriptor
from molsg.covariance import covariance_descriptor
evals = 100
mol = np.load('data/ampc/npy/actives18.pqr0.50.41.2.npy')
eigs = compute_lb_fem(vertices=... | true | true |
1c0b0a9ee61e315960b7039fad8346be46556b9f | 9,452 | py | Python | lib/MyModule/MyModuleImpl.py | deleonkb/MyModule | c33948465415ffe2f44ab4751ee5cc036f6168b2 | [
"MIT"
] | null | null | null | lib/MyModule/MyModuleImpl.py | deleonkb/MyModule | c33948465415ffe2f44ab4751ee5cc036f6168b2 | [
"MIT"
] | null | null | null | lib/MyModule/MyModuleImpl.py | deleonkb/MyModule | c33948465415ffe2f44ab4751ee5cc036f6168b2 | [
"MIT"
] | null | null | null | #BEGIN_HEADER
# The header block is where all import statments should live
import sys
import traceback
import uuid
from pprint import pprint, pformat
from biokbase.workspace.client import Workspace as workspaceService
#END_HEADER
class MyModule:
'''
Module Name:
MyModule
Module Description:
A KBa... | 44.168224 | 114 | 0.578396 | import sys
import traceback
import uuid
from pprint import pprint, pformat
from biokbase.workspace.client import Workspace as workspaceService
class MyModule:
workspaceURL = None
# be found
def __init__(self, config):
#BEGIN_CONSTRUCTOR
self.worksp... | true | true |
1c0b0ad779bc41330f1ad865bebb9598ab0b119f | 156 | py | Python | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_PolyTrend_BestCycle_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_PolyTrend_BestCycle_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_PolyTrend_BestCycle_MLP.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['PolyTrend'] , ['BestCycle'] , ['MLP'] ); | 39 | 78 | 0.74359 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['PolyTrend'] , ['BestCycle'] , ['MLP'] ); | true | true |
1c0b0baf1fdacd668a72c840f68ef607ce852208 | 23,627 | py | Python | test/ibmq/test_ibmq_job.py | chlorophyll-zz/qiskit-ibmq-provider | ee2b326b0a07dba132cca4f85fe700f030b5880f | [
"Apache-2.0"
] | 1 | 2020-07-14T20:09:40.000Z | 2020-07-14T20:09:40.000Z | test/ibmq/test_ibmq_job.py | chlorophyll-zz/qiskit-ibmq-provider | ee2b326b0a07dba132cca4f85fe700f030b5880f | [
"Apache-2.0"
] | null | null | null | test/ibmq/test_ibmq_job.py | chlorophyll-zz/qiskit-ibmq-provider | ee2b326b0a07dba132cca4f85fe700f030b5880f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 43.998138 | 100 | 0.621365 |
import time
import copy
from concurrent import futures
from datetime import datetime, timedelta
from unittest import SkipTest
import numpy
from scipy.stats import chi2_contingency
from qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister
from qiskit.providers import JobStatus
from qiskit.providers.ibmq... | true | true |
1c0b0bca159ba79347ba8d6ea88c65fefcf1b68e | 1,027 | py | Python | baseconfig/migrations/0004_auto_20170815_1531.py | establishment/django-establishment | ad1d04fe9efc748e2fba5b4bc67446d2a4cf12f6 | [
"CC0-1.0"
] | 1 | 2017-04-27T19:35:42.000Z | 2017-04-27T19:35:42.000Z | baseconfig/migrations/0004_auto_20170815_1531.py | establishment/django-establishment | ad1d04fe9efc748e2fba5b4bc67446d2a4cf12f6 | [
"CC0-1.0"
] | null | null | null | baseconfig/migrations/0004_auto_20170815_1531.py | establishment/django-establishment | ad1d04fe9efc748e2fba5b4bc67446d2a4cf12f6 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-15 15:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('baseconfig', '0003_auto_20170614_1349'),
]
operations = [
migrations.AddFie... | 28.527778 | 74 | 0.600779 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('baseconfig', '0003_auto_20170614_1349'),
]
operations = [
migrations.AddField(
model_name='privateglobalsettings',
name='exp... | true | true |
1c0b0d397c7d1901f441f70b02d7e044ac2b3a27 | 12,558 | py | Python | src/oci/oda/models/work_request_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/oda/models/work_request_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/oda/models/work_request_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 39.993631 | 376 | 0.695095 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class WorkRequestSummary(object):
REQUEST_ACTION_CREATE_ODA_INSTANCE = "CREATE_ODA_INSTANCE"
REQUEST_ACTION_UP... | true | true |
1c0b0d6fe62e657ffbc2fb0397abde729149e9f9 | 4,956 | py | Python | examples/ensembling/parallel_train.py | mathandy/functorch | 8d82eb3bb963e6d83d62df2f17b91ab6381dc1f0 | [
"BSD-3-Clause"
] | 423 | 2021-10-20T07:31:53.000Z | 2022-03-30T16:57:57.000Z | examples/ensembling/parallel_train.py | mathandy/functorch | 8d82eb3bb963e6d83d62df2f17b91ab6381dc1f0 | [
"BSD-3-Clause"
] | 266 | 2021-10-21T16:25:59.000Z | 2022-03-31T20:53:02.000Z | examples/ensembling/parallel_train.py | mathandy/functorch | 8d82eb3bb963e6d83d62df2f17b91ab6381dc1f0 | [
"BSD-3-Clause"
] | 29 | 2021-12-06T18:45:26.000Z | 2022-03-29T12:58:36.000Z | import argparse
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from functorch import make_functional, grad_and_value, vmap, combine_state_for_ensemble
# Adapted from http://willwhitney.com/parallel-training-jax.html , which is a
# tutorial on Model Ensembling with JAX by Will Whitney.
#... | 33.714286 | 91 | 0.696933 | import argparse
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from functorch import make_functional, grad_and_value, vmap, combine_state_for_ensemble
parser = argparse.ArgumentParser(description="Functorch Ensembled Models")
parser.add_argument(
"--device",
type=str,
defa... | true | true |
1c0b0d951ff23a1a6c4c352267dbdbbac8b8fb6c | 7,866 | py | Python | SpoTwillio/lib/python3.6/site-packages/tests/integration/api/v2010/account/call/test_notification.py | Natfan/funlittlethings | 80d5378b45b5c0ead725942ee50403bd057514a6 | [
"MIT"
] | 3 | 2019-11-12T07:55:51.000Z | 2020-04-01T11:19:18.000Z | SpoTwillio/lib/python3.6/site-packages/tests/integration/api/v2010/account/call/test_notification.py | Natfan/funlittlethings | 80d5378b45b5c0ead725942ee50403bd057514a6 | [
"MIT"
] | 7 | 2020-06-06T01:06:19.000Z | 2022-02-10T11:15:14.000Z | SpoTwillio/lib/python3.6/site-packages/tests/integration/api/v2010/account/call/test_notification.py | Natfan/funlittlethings | 80d5378b45b5c0ead725942ee50403bd057514a6 | [
"MIT"
] | 2 | 2019-10-20T14:54:47.000Z | 2020-06-11T07:29:37.000Z | # coding=utf-8
"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class NotificationTestCase(Integ... | 46.270588 | 187 | 0.575896 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class NotificationTestCase(IntegrationTestCase):
def test_fetch_request(self):
self.holodeck.mock(Response(500, ''))
with self.as... | true | true |
1c0b0e750a960a7275d8873a7b301f0296114d84 | 2,360 | py | Python | ss_baselines/common/tensorboard_utils.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 171 | 2020-08-21T06:45:19.000Z | 2022-03-30T03:52:15.000Z | ss_baselines/common/tensorboard_utils.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 69 | 2020-09-19T02:44:10.000Z | 2022-03-17T03:57:55.000Z | ss_baselines/common/tensorboard_utils.py | tynguyen/sound-spaces | b196f3a36b4076752400cbf186e9cf2e160cc3c2 | [
"CC-BY-4.0"
] | 41 | 2020-08-25T06:58:24.000Z | 2022-03-23T05:04:47.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from typing import Any
import numpy as np
import torch
from torch.utils.tensorboard import SummaryW... | 33.239437 | 79 | 0.626695 |
from typing import Any
import numpy as np
import torch
from torch.utils.tensorboard import SummaryWriter
class TensorboardWriter:
def __init__(self, log_dir: str, *args: Any, **kwargs: Any):
self.writer = None
if log_dir is not None and len(log_dir) > 0:
self.writer = SummaryWriter... | true | true |
1c0b0ef8ca511fd89a1e5c52e38d5a0df5f6d6e6 | 1,336 | py | Python | run.py | wzx140/wxRebot | 78d2143624934ed246f7dd25d9981f2090795d49 | [
"MIT"
] | 15 | 2020-02-03T07:05:14.000Z | 2022-02-24T03:27:18.000Z | run.py | wzx140/wx_robo | 78d2143624934ed246f7dd25d9981f2090795d49 | [
"MIT"
] | 8 | 2020-10-13T16:06:04.000Z | 2022-03-11T23:35:13.000Z | run.py | wzx140/wx_robo | 78d2143624934ed246f7dd25d9981f2090795d49 | [
"MIT"
] | 2 | 2020-11-26T07:58:45.000Z | 2021-01-29T09:39:06.000Z | # coding=utf-8
from argparse import ArgumentParser
from log import setup_logging
from wx import Wx
import robot
if __name__ == '__main__':
# 解析参数
parser = ArgumentParser(description='wx聊天机器人')
parser.add_argument('--sync_frequency', type=int, default=2, help='心跳频率, 越大机器人回复的越慢')
parser.add_argument('--... | 38.171429 | 119 | 0.669162 |
from argparse import ArgumentParser
from log import setup_logging
from wx import Wx
import robot
if __name__ == '__main__':
parser = ArgumentParser(description='wx聊天机器人')
parser.add_argument('--sync_frequency', type=int, default=2, help='心跳频率, 越大机器人回复的越慢')
parser.add_argument('--target_name', type=str... | true | true |
1c0b0f2efd32382181d7bf1e7aa26efbe73fe5c7 | 351 | py | Python | src/config.py | stefanilie/PyPlagDetect | df65ad2eb76c955db9e1d7045aed564970a60452 | [
"MIT"
] | null | null | null | src/config.py | stefanilie/PyPlagDetect | df65ad2eb76c955db9e1d7045aed564970a60452 | [
"MIT"
] | 1 | 2021-01-06T13:30:48.000Z | 2021-01-06T13:30:48.000Z | src/config.py | stefanilie/PyPlagDetect | df65ad2eb76c955db9e1d7045aed564970a60452 | [
"MIT"
] | null | null | null | import os
BASE_PATH=os.getcwd()
SUSPICIOUS=BASE_PATH+"/suspicious"
SUSPICIOUS_DOCUMENTS=BASE_PATH+"/suspicious-documents"
TRAINING=BASE_PATH+"/training"
DUMPS=BASE_PATH+"/dumps"
OANC=BASE_PATH+'/OANC'
PLOTS=BASE_PATH+'/PLOTS'
WIKI_DUMP='wiki.pickle'
SMALL_DUMP='tokenized.pickle'
TAGGER_DUMP='unigram_tagger.pickle'
WIK... | 25.071429 | 54 | 0.809117 | import os
BASE_PATH=os.getcwd()
SUSPICIOUS=BASE_PATH+"/suspicious"
SUSPICIOUS_DOCUMENTS=BASE_PATH+"/suspicious-documents"
TRAINING=BASE_PATH+"/training"
DUMPS=BASE_PATH+"/dumps"
OANC=BASE_PATH+'/OANC'
PLOTS=BASE_PATH+'/PLOTS'
WIKI_DUMP='wiki.pickle'
SMALL_DUMP='tokenized.pickle'
TAGGER_DUMP='unigram_tagger.pickle'
WIK... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.