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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f711b16ed81ea95da9f1a3eb15d120593368ad8a | 29,162 | py | Python | randomvars/tests/test__continuous.py | echasnovski/randomvars | 15417b0e3ecd27f185b70471102c158f60d51c28 | [
"MIT"
] | null | null | null | randomvars/tests/test__continuous.py | echasnovski/randomvars | 15417b0e3ecd27f185b70471102c158f60d51c28 | [
"MIT"
] | null | null | null | randomvars/tests/test__continuous.py | echasnovski/randomvars | 15417b0e3ecd27f185b70471102c158f60d51c28 | [
"MIT"
] | null | null | null | # pylint: disable=missing-function-docstring
"""Tests for '_continuous.py' file"""
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
import scipy.stats.distributions as distrs
from scipy.stats.kde import gaussian_kde
from scipy.integrate import quad
import pytest
from randomvar... | 33.791425 | 87 | 0.56145 | import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
import scipy.stats.distributions as distrs
from scipy.stats.kde import gaussian_kde
from scipy.integrate import quad
import pytest
from randomvars._continuous import Cont
from randomvars.tests.commontests import (
DECIMAL,
... | true | true |
f711b20c3b60383cb78e430d5bf5b6670492c5e8 | 267 | py | Python | webapp/tests/funcplugins/plugin_bad_paramtype.py | TimWhalen/graphite-web | e150af45e01d01141a8767ec0597e218105b9914 | [
"Apache-2.0"
] | 1 | 2021-01-16T20:10:45.000Z | 2021-01-16T20:10:45.000Z | webapp/tests/funcplugins/plugin_bad_paramtype.py | TimWhalen/graphite-web | e150af45e01d01141a8767ec0597e218105b9914 | [
"Apache-2.0"
] | null | null | null | webapp/tests/funcplugins/plugin_bad_paramtype.py | TimWhalen/graphite-web | e150af45e01d01141a8767ec0597e218105b9914 | [
"Apache-2.0"
] | null | null | null | from graphite.functions.params import Param, ParamTypes
def test(seriesList):
"""This is a test function"""
return seriesList
test.group = 'Test'
test.params = [
Param('seriesList', ParamTypes.bad, required=True),
]
SeriesFunctions = {
'testFunc': test,
}
| 17.8 | 55 | 0.71161 | from graphite.functions.params import Param, ParamTypes
def test(seriesList):
return seriesList
test.group = 'Test'
test.params = [
Param('seriesList', ParamTypes.bad, required=True),
]
SeriesFunctions = {
'testFunc': test,
}
| true | true |
f711b32486269d4237e64b7122aaece024245cb3 | 6,011 | py | Python | iris_validation/interface/svgwrite/validator2.py | FilomenoSanchez/iris-validation | a7bbb28dfe239527c32914229e69e007a519e0dd | [
"MIT"
] | null | null | null | iris_validation/interface/svgwrite/validator2.py | FilomenoSanchez/iris-validation | a7bbb28dfe239527c32914229e69e007a519e0dd | [
"MIT"
] | 1 | 2021-11-18T11:58:59.000Z | 2021-11-18T12:00:08.000Z | iris_validation/interface/svgwrite/validator2.py | glycojones/iris-validation | 55163a2914cf572af9b52b705188b0b4ec720be2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#coding:utf-8
# Author: mozman --<mozman@gmx.at>
# Purpose: validator2 module - new validator module
# Created: 01.10.2010
# Copyright (C) 2010, Manfred Moitzi
# License: MIT License
from .data import full11
from .data import tiny12
from .data import pattern
validator_cache = {}
def cache_key... | 35.152047 | 134 | 0.635335 |
from .data import full11
from .data import tiny12
from .data import pattern
validator_cache = {}
def cache_key(profile, debug):
return str(profile) + str(debug)
def get_validator(profile, debug=True):
try:
return validator_cache[cache_key(profile, debug)]
except KeyError:
if profile ==... | true | true |
f711b35f6d949074210d2633de5514a8461243be | 2,123 | py | Python | exatomic/interfaces/tests/test_cube.py | tjduigna/exatomic | 3e27233084588bc6a58b63fc81aaf5a6b67a968d | [
"Apache-2.0"
] | null | null | null | exatomic/interfaces/tests/test_cube.py | tjduigna/exatomic | 3e27233084588bc6a58b63fc81aaf5a6b67a968d | [
"Apache-2.0"
] | 1 | 2017-05-25T21:05:40.000Z | 2017-05-25T23:54:15.000Z | exatomic/interfaces/tests/test_cube.py | tjduigna/exatomic | 3e27233084588bc6a58b63fc81aaf5a6b67a968d | [
"Apache-2.0"
] | 1 | 2017-05-25T20:48:33.000Z | 2017-05-25T20:48:33.000Z | # -*- coding: utf-8 -*-
## Copyright (c) 2015-2018, Exa Analytics Development Team
## Distributed under the terms of the Apache License 2.0
"""
Tests for :mod:`~exatomic.interfaces.cube`
#############################################
"""
import numpy as np
from unittest import TestCase
from exatomic.base import resource... | 37.245614 | 73 | 0.629298 | import numpy as np
from unittest import TestCase
from exatomic.base import resource, staticdir
from exatomic.interfaces.cube import Cube, uni_from_cubes
class TestCube(TestCase):
def setUp(self):
self.lg = Cube(resource('mol-carbon-dz-1.cube'))
self.sm1 = Cube(resource('adf-lu-35.cube'))
... | true | true |
f711b36657fa38518e47732c9b1d3cb2046ba5c7 | 5,371 | py | Python | lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | lldb/test/API/functionalities/plugins/python_os_plugin/stepping_plugin_threads/TestOSPluginStepping.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | """
Test that stepping works even when the OS Plugin doesn't report
all threads at every stop.
"""
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class TestOSPluginStepping(TestBase... | 45.134454 | 114 | 0.65984 |
from __future__ import print_function
import os
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class TestOSPluginStepping(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
@skipIfWind... | true | true |
f711b3fdfa190d5ada52a8c9c636c1e426058e74 | 2,702 | py | Python | get_asa_full_config.py | otronomo/netmiko_based | cef803a83de475bcc95403f5caaa73937095a92f | [
"Apache-2.0"
] | null | null | null | get_asa_full_config.py | otronomo/netmiko_based | cef803a83de475bcc95403f5caaa73937095a92f | [
"Apache-2.0"
] | null | null | null | get_asa_full_config.py | otronomo/netmiko_based | cef803a83de475bcc95403f5caaa73937095a92f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# BY NOMO
from netmiko import Netmiko
from getpass import getpass
from datetime import datetime
from pprint import pprint
import re
import os
import sys
import socket
# Vars
config_dir = "/home/reponeg/logs/asa_configs"
# Function for DNS resolution
def hostnameLookup(hostname):
try:
... | 25.252336 | 89 | 0.661362 |
from netmiko import Netmiko
from getpass import getpass
from datetime import datetime
from pprint import pprint
import re
import os
import sys
import socket
config_dir = "/home/reponeg/logs/asa_configs"
def hostnameLookup(hostname):
try:
socket.gethostbyname(hostname)
return 1 ... | true | true |
f711b5328a1be3b753056e88ac6fdbce2cf20554 | 6,448 | py | Python | ros/src/twist_controller/dbw_node.py | tochalid/CarND-Capstone | 57dc493180ee34f3842ccd0dc4fb3678368f12bb | [
"MIT"
] | null | null | null | ros/src/twist_controller/dbw_node.py | tochalid/CarND-Capstone | 57dc493180ee34f3842ccd0dc4fb3678368f12bb | [
"MIT"
] | 1 | 2018-06-09T20:59:50.000Z | 2018-06-09T20:59:50.000Z | ros/src/twist_controller/dbw_node.py | tochalid/CarND-Capstone | 57dc493180ee34f3842ccd0dc4fb3678368f12bb | [
"MIT"
] | 4 | 2018-05-10T14:50:41.000Z | 2018-06-02T23:50:11.000Z | #!/usr/bin/env python
import rospy
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd
from geometry_msgs.msg import TwistStamped
from std_msgs.msg import Bool
from twist_controller import Controller
'''
You can build this node only after you have built (or partially built) the `waypoint_updater` node.
Y... | 45.090909 | 107 | 0.603133 |
import rospy
from dbw_mkz_msgs.msg import ThrottleCmd, SteeringCmd, BrakeCmd
from geometry_msgs.msg import TwistStamped
from std_msgs.msg import Bool
from twist_controller import Controller
class DBWNode(object):
def __init__(self):
rospy.init_node('dbw_node')
vehicle_mass = rospy.get_param('~v... | true | true |
f711b54c08bfea89b343bd24d2a4027f25566049 | 1,803 | py | Python | utils/model.py | alipsgh/deep-mix-nets | 3c60897687046523d58a321ca0f7cd69dbcf78a1 | [
"MIT"
] | null | null | null | utils/model.py | alipsgh/deep-mix-nets | 3c60897687046523d58a321ca0f7cd69dbcf78a1 | [
"MIT"
] | null | null | null | utils/model.py | alipsgh/deep-mix-nets | 3c60897687046523d58a321ca0f7cd69dbcf78a1 | [
"MIT"
] | null | null | null | import yaml
from models.fasttext import FastText
from models.attention_rnn import AttentionRNN
from models.rcnn import RCNN
from models.textcnn import TextCNN
from models.textrnn import TextRNN
from models.transformer import Transformer
from utils.logger import get_logger
def instantiate_model(model_name, vocab_size... | 40.066667 | 91 | 0.710483 | import yaml
from models.fasttext import FastText
from models.attention_rnn import AttentionRNN
from models.rcnn import RCNN
from models.textcnn import TextCNN
from models.textrnn import TextRNN
from models.transformer import Transformer
from utils.logger import get_logger
def instantiate_model(model_name, vocab_size... | true | true |
f711b5c6cb4a750d5b26cab33dd01b22cd4a4722 | 4,606 | py | Python | celery_progress/backend.py | darwin-homes/celery-progress | ec3c8ea0582f75b9181fab3ffc746ef982f00839 | [
"MIT"
] | null | null | null | celery_progress/backend.py | darwin-homes/celery-progress | ec3c8ea0582f75b9181fab3ffc746ef982f00839 | [
"MIT"
] | null | null | null | celery_progress/backend.py | darwin-homes/celery-progress | ec3c8ea0582f75b9181fab3ffc746ef982f00839 | [
"MIT"
] | null | null | null | import datetime
import logging
from abc import ABCMeta, abstractmethod
from decimal import Decimal
from celery.result import EagerResult, allow_join_result
from celery.backends.base import DisabledBackend
logger = logging.getLogger(__name__)
PROGRESS_STATE = 'PROGRESS'
class AbstractProgressRecorder(object):
_... | 30.104575 | 114 | 0.546244 | import datetime
import logging
from abc import ABCMeta, abstractmethod
from decimal import Decimal
from celery.result import EagerResult, allow_join_result
from celery.backends.base import DisabledBackend
logger = logging.getLogger(__name__)
PROGRESS_STATE = 'PROGRESS'
class AbstractProgressRecorder(object):
_... | true | true |
f711b676acf632290d811f521077bc40029b180d | 3,619 | py | Python | shamrock/consensus/default_constants.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | shamrock/consensus/default_constants.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | shamrock/consensus/default_constants.py | zcomputerwiz/shamrock-blockchain | 2e2d8a134f0147379812085543ac98f37ce28c2b | [
"Apache-2.0"
] | null | null | null | from shamrock.util.ints import uint64
from .constants import ConsensusConstants
testnet_kwargs = {
"SLOT_BLOCKS_TARGET": 32,
"MIN_BLOCKS_PER_CHALLENGE_BLOCK": 16, # Must be less than half of SLOT_BLOCKS_TARGET
"MAX_SUB_SLOT_BLOCKS": 128, # Must be less than half of SUB_EPOCH_BLOCKS
"NUM_SPS_SUB_SLOT... | 59.327869 | 122 | 0.741089 | from shamrock.util.ints import uint64
from .constants import ConsensusConstants
testnet_kwargs = {
"SLOT_BLOCKS_TARGET": 32,
"MIN_BLOCKS_PER_CHALLENGE_BLOCK": 16, "MAX_SUB_SLOT_BLOCKS": 128, "NUM_SPS_SUB_SLOT": 64, "SUB_SLOT_ITERS_STARTING": 2 ** 24,
"DIFFICULTY_CONSTANT_FACTOR": 2 ... | true | true |
f711b88b81563a484edd57faf54d35a5138be56c | 560 | py | Python | src/edu/edu_controller.py | feagi/feagi-core | d83c51480fcbe153fa14b2360b4d61f6ae4e2811 | [
"Apache-2.0"
] | 11 | 2020-02-18T16:03:10.000Z | 2021-12-06T19:53:06.000Z | src/edu/edu_controller.py | feagi/feagi-core | d83c51480fcbe153fa14b2360b4d61f6ae4e2811 | [
"Apache-2.0"
] | 34 | 2019-12-17T04:59:42.000Z | 2022-01-18T20:58:46.000Z | src/edu/edu_controller.py | feagi/feagi-core | d83c51480fcbe153fa14b2360b4d61f6ae4e2811 | [
"Apache-2.0"
] | 3 | 2019-12-16T06:09:56.000Z | 2020-10-18T12:01:31.000Z | """
This module will run as an independent thread and acts as a wrapper to orchestrate the training, testing, etc.
Supervised training is coordinated here
"""
from queue import Queue
from threading import Thread
from inf import runtime_data
def initialize():
return
class Controller:
def __init__(self):
... | 18.064516 | 110 | 0.689286 | from queue import Queue
from threading import Thread
from inf import runtime_data
def initialize():
return
class Controller:
def __init__(self):
return
def trainer_mnist(self):
return
def trainer_fashion_mnist(self):
return
def tester_mnist(self):
retur... | true | true |
f711b975bb4838da7a8ff361ad07935ea7c1c91a | 1,363 | py | Python | setup.py | ggbaro/covid-health-ita | 267801c3de021078a1ca5d3b93b47515315f0300 | [
"MIT"
] | 3 | 2020-03-25T22:20:07.000Z | 2020-03-29T10:01:24.000Z | setup.py | ggbaro/covid-health-ita | 267801c3de021078a1ca5d3b93b47515315f0300 | [
"MIT"
] | null | null | null | setup.py | ggbaro/covid-health-ita | 267801c3de021078a1ca5d3b93b47515315f0300 | [
"MIT"
] | null | null | null | import re
from os import path
from setuptools import find_namespace_packages, setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "src", "covid_health", "__init__.py")) as init:
__version__ = re.findall('__version__ = "([\w\.\-\_]+)"', init.read())[0]
with open(path.join(here, "README.... | 29 | 77 | 0.663243 | import re
from os import path
from setuptools import find_namespace_packages, setup
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "src", "covid_health", "__init__.py")) as init:
__version__ = re.findall('__version__ = "([\w\.\-\_]+)"', init.read())[0]
with open(path.join(here, "README.... | true | true |
f711ba8f3c0faa6064bbd30fb8baee70edbc3a0d | 13,844 | py | Python | lib-python/3/test/test_readline.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | null | null | null | lib-python/3/test/test_readline.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | 1 | 2022-02-22T00:59:49.000Z | 2022-02-22T00:59:49.000Z | lib-python/3/test/test_readline.py | hollmmax/zig | d80baa5a5fcbc82b3e2294b398edc20a98737a52 | [
"MIT"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | """
Very minimal unittests for parts of the readline module.
"""
from contextlib import ExitStack
from errno import EIO
import locale
import os
import selectors
import subprocess
import sys
import tempfile
import unittest
from test.support import import_module, unlink, temp_dir, TESTFN, verbose
from test.support.script... | 40.244186 | 87 | 0.635654 | from contextlib import ExitStack
from errno import EIO
import locale
import os
import selectors
import subprocess
import sys
import tempfile
import unittest
from test.support import import_module, unlink, temp_dir, TESTFN, verbose
from test.support.script_helper import assert_python_ok
readline = import_module('readli... | true | true |
f711bb2f78fd2588291d2748fdc4a3155a112679 | 11,194 | py | Python | unit_tests/utilities/test_zaza_utilities_openstack_upgrade.py | gnuoy/zaza-openstack-tests | 0546e01b627d7e0a785ef801e88743480e94cbed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | unit_tests/utilities/test_zaza_utilities_openstack_upgrade.py | gnuoy/zaza-openstack-tests | 0546e01b627d7e0a785ef801e88743480e94cbed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | unit_tests/utilities/test_zaza_utilities_openstack_upgrade.py | gnuoy/zaza-openstack-tests | 0546e01b627d7e0a785ef801e88743480e94cbed | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2019 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 40.854015 | 79 | 0.58317 |
import copy
import mock
import unit_tests.utils as ut_utils
import zaza.openstack.utilities.openstack_upgrade as openstack_upgrade
class TestOpenStackUpgradeUtils(ut_utils.BaseTestCase):
async def _arun_action_on_units(self, units, cmd, model_name=None,
raise_on_failure=True... | true | true |
f711bb312eb8c2c5b8dee0e29602c0929c8089ea | 592 | py | Python | Ragnvald/apps/login_reg/forms.py | DezzaPR0XY/Ragnvald | 90cdeb6cf9a73b599a05b6e37aab8e151fb221aa | [
"MIT"
] | null | null | null | Ragnvald/apps/login_reg/forms.py | DezzaPR0XY/Ragnvald | 90cdeb6cf9a73b599a05b6e37aab8e151fb221aa | [
"MIT"
] | null | null | null | Ragnvald/apps/login_reg/forms.py | DezzaPR0XY/Ragnvald | 90cdeb6cf9a73b599a05b6e37aab8e151fb221aa | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
# from .models import User
class SignUpForm(UserCreationForm):
username = forms.CharField(max_length=30, required=True)
first_name = forms.CharField(max_length=30, required=True)
las... | 39.466667 | 98 | 0.739865 | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
class SignUpForm(UserCreationForm):
username = forms.CharField(max_length=30, required=True)
first_name = forms.CharField(max_length=30, required=True)
last_name = forms.CharField(ma... | true | true |
f711bb41ebfd119a5f6b27e75ab19ba25b39268f | 1,357 | py | Python | env/lib/python3.6/site-packages/defusedxml/__init__.py | IERT-Prayagraj/iert_django_webapp | c0ad52fda672de52f2f18e543f076888d1ead1b3 | [
"MIT"
] | null | null | null | env/lib/python3.6/site-packages/defusedxml/__init__.py | IERT-Prayagraj/iert_django_webapp | c0ad52fda672de52f2f18e543f076888d1ead1b3 | [
"MIT"
] | null | null | null | env/lib/python3.6/site-packages/defusedxml/__init__.py | IERT-Prayagraj/iert_django_webapp | c0ad52fda672de52f2f18e543f076888d1ead1b3 | [
"MIT"
] | null | null | null | # defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See https://www.python.org/psf/license for licensing details.
"""Defuse XML bomb denial of service vulnerabilities
"""
from __future__ import print_function, absolute_import
from .common im... | 21.539683 | 63 | 0.677966 | from __future__ import print_function, absolute_import
from .common import (
DefusedXmlException,
DTDForbidden,
EntitiesForbidden,
ExternalReferenceForbidden,
NotSupportedError,
_apply_defusing,
)
def defuse_stdlib():
defused = {}
from . import cElementTree
from . import ElementT... | true | true |
f711bb613473ca1c7982405273c36b1db340b656 | 1,989 | py | Python | brocoli/exceptions.py | mesocentre-mcia/brocoli | 95ba415791d9fafe9cef7124562bec5e2b6f2672 | [
"BSD-3-Clause"
] | 4 | 2018-06-28T09:50:40.000Z | 2021-11-29T09:35:30.000Z | brocoli/exceptions.py | mesocentre-mcia/brocoli | 95ba415791d9fafe9cef7124562bec5e2b6f2672 | [
"BSD-3-Clause"
] | 11 | 2018-01-19T10:11:39.000Z | 2021-12-14T11:57:26.000Z | brocoli/exceptions.py | mesocentre-mcia/brocoli | 95ba415791d9fafe9cef7124562bec5e2b6f2672 | [
"BSD-3-Clause"
] | 2 | 2017-12-17T21:59:46.000Z | 2019-09-23T11:38:18.000Z | import os
import errno
import traceback
from six.moves import tkinter_messagebox as messagebox
from six import print_
class BrocoliError(Exception):
def __init__(self, exception):
self.exception = exception
def __str__(self):
return type(self.exception).__name__ + ': ' + str(self.exception)
... | 28.826087 | 79 | 0.554047 | import os
import errno
import traceback
from six.moves import tkinter_messagebox as messagebox
from six import print_
class BrocoliError(Exception):
def __init__(self, exception):
self.exception = exception
def __str__(self):
return type(self.exception).__name__ + ': ' + str(self.exception)
... | true | true |
f711bbbc339573d1744df69fd2b79a94a7b3f1b9 | 2,615 | py | Python | gateway/builders/authorization_builder.py | TarlanPayments/gw-python-client | a0dd5292c877ab06bf549693a1bfc9fb06ef9d19 | [
"MIT"
] | null | null | null | gateway/builders/authorization_builder.py | TarlanPayments/gw-python-client | a0dd5292c877ab06bf549693a1bfc9fb06ef9d19 | [
"MIT"
] | null | null | null | gateway/builders/authorization_builder.py | TarlanPayments/gw-python-client | a0dd5292c877ab06bf549693a1bfc9fb06ef9d19 | [
"MIT"
] | null | null | null | # The MIT License
#
# Copyright (c) 2017 Tarlan Payments.
#
# 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... | 41.507937 | 120 | 0.728489 |
class AuthorizationBuilder(object):
def __init__(self, __client_auth_data_set, __client_mandatory_fields):
from gateway.data_sets.request_parameters import (
RequestParameters,
RequestParametersTypes
)
self.__data_sets = RequestParameters
self.__data_types =... | true | true |
f711be4592dcc19aa285868a4d79787b82aa9f97 | 155 | py | Python | 1.py | maweefeng/baidubaikespider | 19ce975996af3a421c1e981ca83f2c269532dbb9 | [
"MIT"
] | 1 | 2019-05-29T09:59:49.000Z | 2019-05-29T09:59:49.000Z | 1.py | maweefeng/baidubaikespider | 19ce975996af3a421c1e981ca83f2c269532dbb9 | [
"MIT"
] | null | null | null | 1.py | maweefeng/baidubaikespider | 19ce975996af3a421c1e981ca83f2c269532dbb9 | [
"MIT"
] | null | null | null | from baidu_spider import spider_main
rooturl = 'https://baike.baidu.com/item/Python/407313'
obj_spider = spider_main.SpiderMain()
obj_spider.craw(rooturl)
| 31 | 54 | 0.812903 | from baidu_spider import spider_main
rooturl = 'https://baike.baidu.com/item/Python/407313'
obj_spider = spider_main.SpiderMain()
obj_spider.craw(rooturl)
| true | true |
f711be502f622c5ef3826565718977a9fa0dbc19 | 4,877 | py | Python | utest/running/test_userlibrary.py | Kompakti/robotframework | 3ac75d5212f544018ef1cc99a8b68c222715df5f | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2017-08-10T16:14:15.000Z | 2021-11-28T10:47:46.000Z | utest/running/test_userlibrary.py | Kompakti/robotframework | 3ac75d5212f544018ef1cc99a8b68c222715df5f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | utest/running/test_userlibrary.py | Kompakti/robotframework | 3ac75d5212f544018ef1cc99a8b68c222715df5f | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import unittest
import os
from robot.running import userkeyword
from robot.running.model import ResourceFile, UserKeyword
from robot.running.userkeyword import UserLibrary
from robot.errors import DataError
from robot.utils.asserts import (assert_equal, assert_none,
assert_raises_with_... | 37.806202 | 80 | 0.671109 | import unittest
import os
from robot.running import userkeyword
from robot.running.model import ResourceFile, UserKeyword
from robot.running.userkeyword import UserLibrary
from robot.errors import DataError
from robot.utils.asserts import (assert_equal, assert_none,
assert_raises_with_... | true | true |
f711c019c9da28d53aacd9a2c643deca39634632 | 1,410 | py | Python | python-socketio.py | mcity/Mcity-octane-examples | 10c59f78eeed2a93bad797ca8a990e6972a5b32a | [
"MIT"
] | 2 | 2020-09-03T20:02:59.000Z | 2021-08-24T01:18:51.000Z | python-socketio.py | mcity/Mcity-octane-examples | 10c59f78eeed2a93bad797ca8a990e6972a5b32a | [
"MIT"
] | 5 | 2020-03-03T05:53:35.000Z | 2022-01-13T03:25:09.000Z | python-socketio.py | mcity/Mcity-octane-examples | 10c59f78eeed2a93bad797ca8a990e6972a5b32a | [
"MIT"
] | 1 | 2021-10-06T03:23:27.000Z | 2021-10-06T03:23:27.000Z | """
python-socketio.py
Sample Mcity OCTANE python socketio script
"""
import os
from dotenv import load_dotenv
import socketio
#Load environment variables
load_dotenv()
api_key = os.environ.get('MCITY_OCTANE_KEY', None)
server = os.environ.get('MCITY_OCTANE_SERVER', 'http://localhost:5000')
namespace = "/octane"
#If... | 23.114754 | 71 | 0.695745 | import os
from dotenv import load_dotenv
import socketio
load_dotenv()
api_key = os.environ.get('MCITY_OCTANE_KEY', None)
server = os.environ.get('MCITY_OCTANE_SERVER', 'http://localhost:5000')
namespace = "/octane"
if not api_key:
print ("No API KEY SPECIFIED. EXITING")
exit()
sio = socketio.Client()
def ... | true | true |
f711c06dce76d53b8737288c8de318e6f90ce585 | 388 | py | Python | configs/_base_/det_datasets/icdar2015.py | hongxuenong/mmocr | e8e3a059f8f2e4fca96af37751c33563fc48e2ba | [
"Apache-2.0"
] | 2,261 | 2021-04-08T03:45:41.000Z | 2022-03-31T23:37:46.000Z | configs/_base_/det_datasets/icdar2015.py | hongxuenong/mmocr | e8e3a059f8f2e4fca96af37751c33563fc48e2ba | [
"Apache-2.0"
] | 789 | 2021-04-08T05:40:13.000Z | 2022-03-31T09:42:39.000Z | configs/_base_/det_datasets/icdar2015.py | hongxuenong/mmocr | e8e3a059f8f2e4fca96af37751c33563fc48e2ba | [
"Apache-2.0"
] | 432 | 2021-04-08T03:56:16.000Z | 2022-03-30T18:44:43.000Z | dataset_type = 'IcdarDataset'
data_root = 'data/icdar2015'
train = dict(
type=dataset_type,
ann_file=f'{data_root}/instances_training.json',
img_prefix=f'{data_root}/imgs',
pipeline=None)
test = dict(
type=dataset_type,
ann_file=f'{data_root}/instances_test.json',
img_prefix=f'{data_root}/... | 20.421053 | 52 | 0.698454 | dataset_type = 'IcdarDataset'
data_root = 'data/icdar2015'
train = dict(
type=dataset_type,
ann_file=f'{data_root}/instances_training.json',
img_prefix=f'{data_root}/imgs',
pipeline=None)
test = dict(
type=dataset_type,
ann_file=f'{data_root}/instances_test.json',
img_prefix=f'{data_root}/... | true | true |
f711c13c610a43897310b7806fbf5d47f0a3d3e0 | 4,518 | py | Python | TD3/artest.py | ChenShawn/Grad-Paper-Experiments | 00fe1142dae4077b197e99253cc5a4ab759db2ff | [
"MIT"
] | 1 | 2020-04-19T14:28:27.000Z | 2020-04-19T14:28:27.000Z | TD3/artest.py | ChenShawn/Grad-Paper-Experiments | 00fe1142dae4077b197e99253cc5a4ab759db2ff | [
"MIT"
] | null | null | null | TD3/artest.py | ChenShawn/Grad-Paper-Experiments | 00fe1142dae4077b197e99253cc5a4ab759db2ff | [
"MIT"
] | 1 | 2020-04-19T14:28:26.000Z | 2020-04-19T14:28:26.000Z | import gym
import pybullet_envs
from PIL import Image
import argparse
import numpy as np
import torch
import copy
import os
from sklearn.preprocessing import normalize as Normalize
from models import TD3, TD3_adv2
def parse_arguments():
parser = argparse.ArgumentParser("TESTING")
parser.add_argument('-p', "-... | 34.48855 | 151 | 0.64409 | import gym
import pybullet_envs
from PIL import Image
import argparse
import numpy as np
import torch
import copy
import os
from sklearn.preprocessing import normalize as Normalize
from models import TD3, TD3_adv2
def parse_arguments():
parser = argparse.ArgumentParser("TESTING")
parser.add_argument('-p', "-... | true | true |
f711c1e97d8fbef4f6cfb982410a393202354df7 | 4,422 | bzl | Python | bazel/p4c_deps.bzl | maemre/p4c | 535a49c6e0811517c5c0dbdd15f763581050cbeb | [
"Apache-2.0"
] | null | null | null | bazel/p4c_deps.bzl | maemre/p4c | 535a49c6e0811517c5c0dbdd15f763581050cbeb | [
"Apache-2.0"
] | null | null | null | bazel/p4c_deps.bzl | maemre/p4c | 535a49c6e0811517c5c0dbdd15f763581050cbeb | [
"Apache-2.0"
] | null | null | null | """Load dependencies needed to compile p4c as a 3rd-party consumer."""
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def p4c_deps():
"""Loads dependencies need to compile p4c."""
# Third party projects can define the... | 46.0625 | 117 | 0.644957 |
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def p4c_deps():
if not native.existing_rule("com_github_p4lang_p4c_extension"):
native.new_local_repository(
name = "com_github_p4lang... | true | true |
f711c29e3d1f0fb14fafb46f7dcad65b099eb3d5 | 4,558 | py | Python | _notebooks/canada_voc.py | cyanide1x/covid19-dashboard | 7da01c2477c0691caf869d7401587dc85cacef29 | [
"Apache-2.0"
] | 1,740 | 2020-03-19T17:26:24.000Z | 2022-03-30T08:04:55.000Z | _notebooks/canada_voc.py | cyanide1x/covid19-dashboard | 7da01c2477c0691caf869d7401587dc85cacef29 | [
"Apache-2.0"
] | 901 | 2020-03-19T19:16:58.000Z | 2022-03-31T00:23:58.000Z | _notebooks/canada_voc.py | cyanide1x/covid19-dashboard | 7da01c2477c0691caf869d7401587dc85cacef29 | [
"Apache-2.0"
] | 516 | 2020-03-19T16:28:36.000Z | 2022-03-28T15:22:19.000Z | import pandas as pd
import plotly.express as px
url = 'https://health-infobase.canada.ca/src/data/covidLive/covid19-epiSummary-voc.csv'
prov_dict = {
"AB" : "Alberta",
"BC" : "British Columbia",
"CA" : "Canada",
"MB" : "Manitoba",
"NB" : "New Brunswick",
"NL" : "Newfoundland and Labrador",
"NS" : "Nova Scot... | 35.889764 | 159 | 0.66301 | import pandas as pd
import plotly.express as px
url = 'https://health-infobase.canada.ca/src/data/covidLive/covid19-epiSummary-voc.csv'
prov_dict = {
"AB" : "Alberta",
"BC" : "British Columbia",
"CA" : "Canada",
"MB" : "Manitoba",
"NB" : "New Brunswick",
"NL" : "Newfoundland and Labrador",
"NS" : "Nova Scot... | true | true |
f711c384e39bc5150a7c51615c37260e97b037af | 2,091 | py | Python | August/Week4/Random Point in Non-overlapping Rectangles.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | 1 | 2020-08-02T13:41:38.000Z | 2020-08-02T13:41:38.000Z | August/Week4/Random Point in Non-overlapping Rectangles.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | August/Week4/Random Point in Non-overlapping Rectangles.py | vinaykumar7686/Leetcode-August_Challenge | fe1928d8b10a63d7aa561118a70eeaec2f3a2f36 | [
"MIT"
] | null | null | null | # Random Point in Non-overlapping Rectangles
'''
Given a list of non-overlapping axis-aligned rectangles rects, write a function pick which randomly and uniformily picks an integer point in the space covered by the rectangles.
Note:
An integer point is a point that has integer coordinates.
A point on the perimeter ... | 30.75 | 177 | 0.624582 |
import random
class Solution:
def __init__(self, rects: List[List[int]]):
self.rects = rects
self.weights = []
s = 0
for x1, y1, x2, y2 in rects:
w = (x2-x1+1)*(y2-y1+1)
self.weights.append(w)
s+=w
self.weights = [x/s f... | true | true |
f711c3edb41f016ee66e987b06daca0b3a530302 | 10,868 | py | Python | assignment1/cs231n/classifiers/neural_net.py | yufei1900/cs231n-homework | b7f5a03d5a2b650603074a7c43f203b465b74333 | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/neural_net.py | yufei1900/cs231n-homework | b7f5a03d5a2b650603074a7c43f203b465b74333 | [
"MIT"
] | null | null | null | assignment1/cs231n/classifiers/neural_net.py | yufei1900/cs231n-homework | b7f5a03d5a2b650603074a7c43f203b465b74333 | [
"MIT"
] | null | null | null | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
class TwoLayerNet(object):
"""
A two-layer fully-connected neural network. The net has an input dimension of
N, a hidden layer dimension of H, and performs classification over C classes.
We train the network with a softma... | 44.72428 | 90 | 0.502392 | from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
class TwoLayerNet(object):
def __init__(self, input_size, hidden_size, output_size, std=1e-4):
self.params = {}
self.params['W1'] = std * np.random.randn(input_size, hidden_size)
self.params['b1'] = np.zeros(hidden... | true | true |
f711c50b29718841fd8d02a9599430af17487b17 | 197 | py | Python | mainconfig/wsgi.py | rodrigofuentealbacartes/podcasts | a64190a92b346d9432143a659bb3e69bbdb62ea9 | [
"MIT"
] | null | null | null | mainconfig/wsgi.py | rodrigofuentealbacartes/podcasts | a64190a92b346d9432143a659bb3e69bbdb62ea9 | [
"MIT"
] | null | null | null | mainconfig/wsgi.py | rodrigofuentealbacartes/podcasts | a64190a92b346d9432143a659bb3e69bbdb62ea9 | [
"MIT"
] | null | null | null | # coding: utf-8
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mainconfig.settings')
application = get_wsgi_application()
| 19.7 | 71 | 0.771574 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mainconfig.settings')
application = get_wsgi_application()
| true | true |
f711c675108eb978960175f4072850d6e419edbf | 568 | py | Python | model/group.py | winsok/pythonlearning | b74e31a2c3e830d0563ca90c5ba32d59eaf4e74d | [
"Apache-2.0"
] | null | null | null | model/group.py | winsok/pythonlearning | b74e31a2c3e830d0563ca90c5ba32d59eaf4e74d | [
"Apache-2.0"
] | null | null | null | model/group.py | winsok/pythonlearning | b74e31a2c3e830d0563ca90c5ba32d59eaf4e74d | [
"Apache-2.0"
] | null | null | null | from sys import maxsize
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s:%s:%s" % (self.id, self.name, self.header,self.footer)
... | 25.818182 | 103 | 0.584507 | from sys import maxsize
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s:%s:%s" % (self.id, self.name, self.header,self.footer)
... | true | true |
f711c959f7372ed5b06b0f6103bde288b12876ab | 351 | py | Python | #001/main.py | DSAghicha/project-euler | 74de01ab4bbd8b337b2a9c79118f3e8487e7766c | [
"MIT"
] | null | null | null | #001/main.py | DSAghicha/project-euler | 74de01ab4bbd8b337b2a9c79118f3e8487e7766c | [
"MIT"
] | null | null | null | #001/main.py | DSAghicha/project-euler | 74de01ab4bbd8b337b2a9c79118f3e8487e7766c | [
"MIT"
] | null | null | null | """
@param: n -> int : Upper Limit of the range
"""
def multiples(n: int) -> int:
num: list = []
for i in range(1, n):
if (i % 3 == 0) or (i % 5 == 0):
num.append(i)
return sum(num)
if __name__ == '__main__':
t: int = int(input())
for _x in range(t):
n: int = int(input(... | 20.647059 | 43 | 0.48433 | def multiples(n: int) -> int:
num: list = []
for i in range(1, n):
if (i % 3 == 0) or (i % 5 == 0):
num.append(i)
return sum(num)
if __name__ == '__main__':
t: int = int(input())
for _x in range(t):
n: int = int(input())
print(multiples(n))
| true | true |
f711c9c48b8465a09bdde89596887d208a331294 | 347 | py | Python | 7/7_3.py | kopsh/python_cookbook | 298c092cd20404a0755e2170776c44a04e8648ad | [
"CNRI-Python"
] | null | null | null | 7/7_3.py | kopsh/python_cookbook | 298c092cd20404a0755e2170776c44a04e8648ad | [
"CNRI-Python"
] | null | null | null | 7/7_3.py | kopsh/python_cookbook | 298c092cd20404a0755e2170776c44a04e8648ad | [
"CNRI-Python"
] | null | null | null | class Solution:
r"""
函数注解
>>> def add(x: int, y: int) -> int:
... return a + b
>>> add.__annotations__
{'x': <class 'int'>, 'y': <class 'int'>, 'return': <class 'int'>}
"""
def __init__(self):
pass
def solve(self):
pass
if __name__ == '__main__':
import do... | 18.263158 | 69 | 0.498559 | class Solution:
def __init__(self):
pass
def solve(self):
pass
if __name__ == '__main__':
import doctest
doctest.testmod() | true | true |
f711ca2aa2c70076688df3fd190dd200762c7261 | 36,146 | py | Python | source/SpreadsheettoEAD/func/archdesc.py | gwiedeman/eadmachine | f6c0c0f92fc20ab6dcf4962fda827b7adb4749d4 | [
"Unlicense"
] | 5 | 2016-01-25T15:27:12.000Z | 2021-08-17T22:31:48.000Z | source/SpreadsheettoEAD/func/archdesc.py | gwiedeman/eadmachine | f6c0c0f92fc20ab6dcf4962fda827b7adb4749d4 | [
"Unlicense"
] | null | null | null | source/SpreadsheettoEAD/func/archdesc.py | gwiedeman/eadmachine | f6c0c0f92fc20ab6dcf4962fda827b7adb4749d4 | [
"Unlicense"
] | null | null | null | # module for the <archdesc/> or collection-level description
import xml.etree.cElementTree as ET
from archdescsimple import archdescsimple
from access_use_restrict import access_use_restrict
import globals
import wx
def archdesc(arch_root, CSheet, version, input_data):
from wx.lib.pubsub import pub
#update GUI p... | 44.679852 | 170 | 0.681791 | import xml.etree.cElementTree as ET
from archdescsimple import archdescsimple
from access_use_restrict import access_use_restrict
import globals
import wx
def archdesc(arch_root, CSheet, version, input_data):
from wx.lib.pubsub import pub
if "ask_gui" in globals.new_elements:
wx.CallAfter(pub.sendMessage, "up... | true | true |
f711caf5313ea4bac3e7b67357976b45c1301dc6 | 450 | py | Python | stream/migrations/0017_stream_active.py | maddevsio/yourcast-web | c3e897f28dc16f71e4f625564270c0d3b72fa53f | [
"MIT"
] | 8 | 2017-05-12T10:08:03.000Z | 2020-12-22T00:01:39.000Z | stream/migrations/0017_stream_active.py | maddevsio/yourcast-web | c3e897f28dc16f71e4f625564270c0d3b72fa53f | [
"MIT"
] | null | null | null | stream/migrations/0017_stream_active.py | maddevsio/yourcast-web | c3e897f28dc16f71e4f625564270c0d3b72fa53f | [
"MIT"
] | 6 | 2017-05-12T13:35:43.000Z | 2021-08-09T13:43:31.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-10-17 05:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stream', '0016_auto_20161012_0838'),
]
operations = [
migrations.AddField(
... | 21.428571 | 53 | 0.615556 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stream', '0016_auto_20161012_0838'),
]
operations = [
migrations.AddField(
model_name='stream',
name='active',
f... | true | true |
f711cdf5b7894bb3864580ebce3e6bec3eee4261 | 3,358 | py | Python | breakout_env/wrappers/wrappers.py | MarcoFavorito/breakout-env | b41f9ed1da693874d7d34f83e7200fd51a59c97e | [
"MIT"
] | null | null | null | breakout_env/wrappers/wrappers.py | MarcoFavorito/breakout-env | b41f9ed1da693874d7d34f83e7200fd51a59c97e | [
"MIT"
] | null | null | null | breakout_env/wrappers/wrappers.py | MarcoFavorito/breakout-env | b41f9ed1da693874d7d34f83e7200fd51a59c97e | [
"MIT"
] | null | null | null | import copy
from gym import Wrapper
from pythogic.base.Symbol import Symbol
from pythogic.base.Alphabet import Alphabet
from pythogic.base.Formula import AtomicFormula, PathExpressionEventually, PathExpressionSequence, And, Not, \
LogicalTrue, PathExpressionStar
from pythogic.base.utils import _to_pythomata_dfa
fro... | 34.979167 | 120 | 0.590232 | import copy
from gym import Wrapper
from pythogic.base.Symbol import Symbol
from pythogic.base.Alphabet import Alphabet
from pythogic.base.Formula import AtomicFormula, PathExpressionEventually, PathExpressionSequence, And, Not, \
LogicalTrue, PathExpressionStar
from pythogic.base.utils import _to_pythomata_dfa
fro... | true | true |
f711cf7097563239c0e13f07d13e566ab1a1133f | 186 | py | Python | krankit/polls/admin.py | ruankranz/blog | d83adc9035bb71f839e8e1c74a036f99be7f9d18 | [
"MIT"
] | null | null | null | krankit/polls/admin.py | ruankranz/blog | d83adc9035bb71f839e8e1c74a036f99be7f9d18 | [
"MIT"
] | 1 | 2021-05-11T12:43:52.000Z | 2021-05-11T12:43:52.000Z | krankit/polls/admin.py | ruankranz/blog | d83adc9035bb71f839e8e1c74a036f99be7f9d18 | [
"MIT"
] | null | null | null | from django.contrib import admin
from krankit.polls.models import Question, Choice, ChoiceVote
admin.site.register(Question)
admin.site.register(Choice)
admin.site.register(ChoiceVote)
| 26.571429 | 61 | 0.833333 | from django.contrib import admin
from krankit.polls.models import Question, Choice, ChoiceVote
admin.site.register(Question)
admin.site.register(Choice)
admin.site.register(ChoiceVote)
| true | true |
f711d14a97d591dacc7c04a236c7bfbe2942d778 | 6,292 | py | Python | experiments/plots_journal_CARS.py | salomonw/mixed-traffic-amod-route-rebalance | 7f1edeb195a7bfab835e596ad84deead2957943e | [
"MIT"
] | 1 | 2022-03-07T16:15:56.000Z | 2022-03-07T16:15:56.000Z | experiments/plots_journal_CARS.py | salomonw/mixed-traffic-amod-route-rebalance | 7f1edeb195a7bfab835e596ad84deead2957943e | [
"MIT"
] | null | null | null | experiments/plots_journal_CARS.py | salomonw/mixed-traffic-amod-route-rebalance | 7f1edeb195a7bfab835e596ad84deead2957943e | [
"MIT"
] | null | null | null | import src.tnet as tnet
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
import math
plt.style.use(['science','ieee', 'high-vis'])
def txt2list(fname):
return [line for line in open(fname)]
def read_result(fname):
df = pd.read_csv(fname)
results = df.T.values.tolist()
return resu... | 34.571429 | 133 | 0.672282 | import src.tnet as tnet
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
import math
plt.style.use(['science','ieee', 'high-vis'])
def txt2list(fname):
return [line for line in open(fname)]
def read_result(fname):
df = pd.read_csv(fname)
results = df.T.values.tolist()
return resu... | true | true |
f711d31b88f8761fbd168fbb814c22a17184f4a0 | 335 | py | Python | atop/options/tree.py | MouseAndKeyboard/All_Things_Options_Notebooks | 7f7bc3f5697b3ccc7aef3311f9d81ba4d5b05435 | [
"MIT"
] | 3 | 2020-01-14T03:11:14.000Z | 2020-09-09T12:51:33.000Z | atop/options/tree.py | MouseAndKeyboard/All_Things_Options_Notebooks | 7f7bc3f5697b3ccc7aef3311f9d81ba4d5b05435 | [
"MIT"
] | 8 | 2020-01-07T15:36:43.000Z | 2020-01-19T19:31:56.000Z | atop/options/tree.py | tmnewt/atop | 9c86bb6471fae73ae51c4b5af759767aea98d8fc | [
"MIT"
] | 1 | 2019-12-23T15:46:25.000Z | 2019-12-23T15:46:25.000Z | class BinTree:
def __init__(self):
'''Container for structuring and handling all nodes used in an option-like asset.
Creates a generic binomial option tree whose by planting an option.
Ha, what?
'''
class Binodes:
def __init__(self, u_node, d_node):
... | 19.705882 | 90 | 0.58806 | class BinTree:
def __init__(self):
class Binodes:
def __init__(self, u_node, d_node):
pass
| true | true |
f711d44cc69e55298f730104b6bde8fa0b31d923 | 3,236 | py | Python | profiles_project/settings.py | Nizamtechs/proflies-rest-api | 7136f41aca7fe4818b66a1485a134f5e9cac3ac1 | [
"MIT"
] | null | null | null | profiles_project/settings.py | Nizamtechs/proflies-rest-api | 7136f41aca7fe4818b66a1485a134f5e9cac3ac1 | [
"MIT"
] | 8 | 2019-12-05T00:04:14.000Z | 2022-02-10T09:44:00.000Z | profiles_project/settings.py | Nizamtechs/proflies-rest-api | 7136f41aca7fe4818b66a1485a134f5e9cac3ac1 | [
"MIT"
] | null | null | null | """
Django settings for profiles_project project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
impor... | 25.68254 | 91 | 0.700556 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'w&u3p_ohh-&rs3i-)qwcgf55d6td29($1zch4(tudt$97foaj*'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
f711d49761cde4671579c6d63e52db091e581213 | 3,376 | py | Python | utils/Paralell_Experience_Generator.py | FedePeralta/ASVs_Deep_Reinforcement_Learning_with_CNNs | 23b9b181499a4b06f2ca2951c002359c1959e727 | [
"MIT"
] | 4 | 2021-03-22T12:42:55.000Z | 2021-12-13T03:03:52.000Z | utils/Paralell_Experience_Generator.py | FedePeralta/ASVs_Deep_Reinforcement_Learning_with_CNNs | 23b9b181499a4b06f2ca2951c002359c1959e727 | [
"MIT"
] | null | null | null | utils/Paralell_Experience_Generator.py | FedePeralta/ASVs_Deep_Reinforcement_Learning_with_CNNs | 23b9b181499a4b06f2ca2951c002359c1959e727 | [
"MIT"
] | 1 | 2021-03-22T12:48:21.000Z | 2021-03-22T12:48:21.000Z | import random
import torch
import sys
from contextlib import closing
from torch.multiprocessing import Pool
from random import randint
from exploration_strategies.OUNoise import OrnsteinUhlenbeckActionNoise
class Parallel_Experience_Generator(object):
""" Plays n episode in parallel using a fixed agent. """
... | 39.717647 | 130 | 0.653732 | import random
import torch
import sys
from contextlib import closing
from torch.multiprocessing import Pool
from random import randint
from exploration_strategies.OUNoise import OrnsteinUhlenbeckActionNoise
class Parallel_Experience_Generator(object):
def __init__(self, environment, policy, seed, hyperparameters... | true | true |
f711d576cf9e1b71718444316027ae1001e6df66 | 111,408 | py | Python | zerver/tests/test_bugdown.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_bugdown.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | null | null | null | zerver/tests/test_bugdown.py | networksneaker/zulip | fae365f8c7e2d6ee041024a22b6ba5a64cbffe4e | [
"Apache-2.0"
] | null | null | null | import copy
import os
import re
from typing import Any, Dict, List, Optional, Set, Tuple
from unittest import mock
import ujson
from django.conf import settings
from django.test import TestCase, override_settings
from zerver.lib import bugdown, mdiff
from zerver.lib.actions import (
do_add_alert_words,
do_rem... | 52.011204 | 1,845 | 0.635322 | import copy
import os
import re
from typing import Any, Dict, List, Optional, Set, Tuple
from unittest import mock
import ujson
from django.conf import settings
from django.test import TestCase, override_settings
from zerver.lib import bugdown, mdiff
from zerver.lib.actions import (
do_add_alert_words,
do_rem... | true | true |
f711d5c3ee19c95b26ff713f3e6d532c9a88b33a | 109 | py | Python | python/karps/__init__.py | tjhunter/karps | 7c74c3bf5b566264d6fed6e17fb1716216467a50 | [
"Apache-2.0"
] | 5 | 2017-10-25T10:53:47.000Z | 2019-01-12T19:32:36.000Z | python/karps/__init__.py | tjhunter/karps | 7c74c3bf5b566264d6fed6e17fb1716216467a50 | [
"Apache-2.0"
] | 15 | 2017-06-22T20:53:50.000Z | 2017-10-22T00:47:00.000Z | python/karps/__init__.py | tjhunter/karps | 7c74c3bf5b566264d6fed6e17fb1716216467a50 | [
"Apache-2.0"
] | 1 | 2018-08-23T04:25:57.000Z | 2018-08-23T04:25:57.000Z | from .types import *
from .row import *
from .column import *
from .utils import scope
from .session import * | 21.8 | 24 | 0.743119 | from .types import *
from .row import *
from .column import *
from .utils import scope
from .session import * | true | true |
f711d72a06f5cf2315676d521154b060c9767ffb | 798 | py | Python | xlsxwriter/test/worksheet/test_write_sheet_format_pr.py | eddiechapman/XlsxWriter | c636117ab30e64e4b7b824c9105595c42887c2c9 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2021-03-27T11:14:47.000Z | 2021-03-27T11:14:47.000Z | xlsxwriter/test/worksheet/test_write_sheet_format_pr.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_write_sheet_format_pr.py | xiaolanmeng86/XlsxWriter | 6c3ea23a410e8216eab8f5751e5544ffb444b3da | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ...worksheet import Worksheet
class TestWriteSheetFormatPr(unittest.TestCase):
"""... | 24.181818 | 79 | 0.602757 |
import unittest
from ...compatibility import StringIO
from ...worksheet import Worksheet
class TestWriteSheetFormatPr(unittest.TestCase):
def setUp(self):
self.fh = StringIO()
self.worksheet = Worksheet()
self.worksheet._set_filehandle(self.fh)
def test_write_sheet_format_pr(self):
... | true | true |
f711d89cf242da66c3ff5569e7204d04c896b8f8 | 2,089 | py | Python | google/ads/google_ads/v1/proto/services/location_view_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/services/location_view_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/services/location_view_service_pb2_grpc.py | jwygoda/google-ads-python | 863892b533240cb45269d9c2cceec47e2c5a8b68 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v1.proto.resources import location_view_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_location__view__pb2
from google.ads.google_ads.v1.proto.services import location_view_service_pb2 as g... | 43.520833 | 169 | 0.812829 | import grpc
from google.ads.google_ads.v1.proto.resources import location_view_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_location__view__pb2
from google.ads.google_ads.v1.proto.services import location_view_service_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_location__v... | true | true |
f711d9b850675003d1af9b25eba4e09079c0755f | 201 | py | Python | mettingapp/mettingapp/doctype/test/test_test.py | hieudola/git | 732c5ce1c3104d997e51e170266669dd49adbc2c | [
"MIT"
] | null | null | null | mettingapp/mettingapp/doctype/test/test_test.py | hieudola/git | 732c5ce1c3104d997e51e170266669dd49adbc2c | [
"MIT"
] | null | null | null | mettingapp/mettingapp/doctype/test/test_test.py | hieudola/git | 732c5ce1c3104d997e51e170266669dd49adbc2c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2018, frappe and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestTest(unittest.TestCase):
pass
| 18.272727 | 45 | 0.761194 | from __future__ import unicode_literals
import frappe
import unittest
class TestTest(unittest.TestCase):
pass
| true | true |
f711d9cea94806cf0e1017d5f400a33609a5c611 | 5,488 | py | Python | doc/conf.py | timmykuo/mitpipeline | 3021bc4e4eb7b2e8dace736b743717bcd5497442 | [
"MIT"
] | 2 | 2019-06-10T01:57:48.000Z | 2019-11-18T14:50:38.000Z | doc/conf.py | timmykuo/mitpipeline | 3021bc4e4eb7b2e8dace736b743717bcd5497442 | [
"MIT"
] | 2 | 2019-07-15T09:10:35.000Z | 2019-07-15T18:10:31.000Z | doc/conf.py | timmykuo/mitpipeline | 3021bc4e4eb7b2e8dace736b743717bcd5497442 | [
"MIT"
] | 2 | 2019-06-10T21:00:48.000Z | 2019-07-15T03:57:07.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.488889 | 100 | 0.660532 |
import os
import sys
if os.environ.get('READTHEDOCS', None) == 'True':
os.system('sphinx-apidoc -o api -T ../mitopipeline --separate')
sys.path.insert(0, os.path.abspath(os.path.pardir))
project = u'mitopipeline'
copyright = u'2019, Timothy Kuo'
author = u'Timothy Kuo'
version = u''
release = u'0.1'... | true | true |
f711da7d70558fb2381e412775be6dba3b75cf0b | 852 | py | Python | models/storemodel.py | vitahoang/learn-flash | 8fad7cc66432140f8861aa2bdf23096dc6c0f23a | [
"MIT"
] | null | null | null | models/storemodel.py | vitahoang/learn-flash | 8fad7cc66432140f8861aa2bdf23096dc6c0f23a | [
"MIT"
] | null | null | null | models/storemodel.py | vitahoang/learn-flash | 8fad7cc66432140f8861aa2bdf23096dc6c0f23a | [
"MIT"
] | null | null | null | import sqlite3
from db import db
class StoreModel(db.Model):
__tablename__ = 'stores'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80))
items = db.relationship('ItemModel', lazy='dynamic')
def __init__(self, _id, name):
self.id = _id
self.name = name
... | 26.625 | 108 | 0.625587 | import sqlite3
from db import db
class StoreModel(db.Model):
__tablename__ = 'stores'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80))
items = db.relationship('ItemModel', lazy='dynamic')
def __init__(self, _id, name):
self.id = _id
self.name = name
... | true | true |
f711dadecdd59577c69f15e06fce58b3de92566e | 1,532 | py | Python | nas4candle/nasapi/evaluator/process_data.py | scrlnas2019/nas4candle | 318959424cc66819c816054a87bd1cb5d426e2e7 | [
"BSD-3-Clause"
] | 1 | 2021-01-22T04:03:00.000Z | 2021-01-22T04:03:00.000Z | nas4candle/nasapi/evaluator/process_data.py | scrlnas2019/nas4candle | 318959424cc66819c816054a87bd1cb5d426e2e7 | [
"BSD-3-Clause"
] | 1 | 2021-01-23T00:14:17.000Z | 2021-01-23T00:14:17.000Z | nas4candle/nasapi/evaluator/process_data.py | scrlnas2019/nas4candle | 318959424cc66819c816054a87bd1cb5d426e2e7 | [
"BSD-3-Clause"
] | 2 | 2019-11-27T04:42:00.000Z | 2021-01-22T04:06:59.000Z | import sys
import json
import datetime
from terminalplot import plot
from balsam.launcher.dag import BalsamJob
now = '_'.join(str(datetime.datetime.now(datetime.timezone.utc)).split(" "))
def max_list(l):
rl = [l[0]]
mx = l[0]
for i in range(1, len(l)):
mx = max(mx, l[i])
rl.append(mx)
... | 27.854545 | 96 | 0.633812 | import sys
import json
import datetime
from terminalplot import plot
from balsam.launcher.dag import BalsamJob
now = '_'.join(str(datetime.datetime.now(datetime.timezone.utc)).split(" "))
def max_list(l):
rl = [l[0]]
mx = l[0]
for i in range(1, len(l)):
mx = max(mx, l[i])
rl.append(mx)
... | true | true |
f711daec253f0a9a5300ad42651a97d52e285afa | 559 | py | Python | PythonAPI/carissma_project/lib/python3.5/site-packages/mpl_toolkits/axes_grid/__init__.py | AbdulHoffmann/carla_carissma | 8d382769ffa02a6c61a22c57160285505f5ff0a4 | [
"MIT"
] | 445 | 2019-01-26T13:50:26.000Z | 2022-03-18T05:17:38.000Z | venv/lib/python3.7/site-packages/mpl_toolkits/axes_grid/__init__.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 242 | 2019-01-29T15:48:27.000Z | 2022-03-31T22:09:21.000Z | venv/lib/python3.7/site-packages/mpl_toolkits/axes_grid/__init__.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | from . import axes_size as Size
from .axes_divider import Divider, SubplotDivider, LocatableAxes, \
make_axes_locatable
from .axes_grid import Grid, ImageGrid, AxesGrid
#from axes_divider import make_axes_locatable
from matplotlib.cbook import warn_deprecated
warn_deprecated(since='2.1',
name='mpl_... | 43 | 69 | 0.665474 | from . import axes_size as Size
from .axes_divider import Divider, SubplotDivider, LocatableAxes, \
make_axes_locatable
from .axes_grid import Grid, ImageGrid, AxesGrid
from matplotlib.cbook import warn_deprecated
warn_deprecated(since='2.1',
name='mpl_toolkits.axes_grid',
alternati... | true | true |
f711dc7f11c9c664766121e41afbc2c4dcf3ea5a | 742 | py | Python | python/day005.py | jrrickerson/adventofcode2019 | 978f70f7808539b2a8ea84336f9743c83f9bf49f | [
"MIT"
] | 1 | 2020-02-07T03:04:01.000Z | 2020-02-07T03:04:01.000Z | python/day005.py | jrrickerson/adventofcode2019 | 978f70f7808539b2a8ea84336f9743c83f9bf49f | [
"MIT"
] | null | null | null | python/day005.py | jrrickerson/adventofcode2019 | 978f70f7808539b2a8ea84336f9743c83f9bf49f | [
"MIT"
] | 1 | 2020-02-07T03:04:03.000Z | 2020-02-07T03:04:03.000Z | import intcode
INPUT_FILE = 'day005.in'
def part1(filename):
source = intcode.load_from_file(filename)
i, o = [], []
# AC Unit input value
i.append(1)
modified = intcode.run_intcode(source, i, o)
return modified[0], i, o
def part2(filename):
source = intcode.load_from_file(filename)
... | 25.586207 | 67 | 0.654987 | import intcode
INPUT_FILE = 'day005.in'
def part1(filename):
source = intcode.load_from_file(filename)
i, o = [], []
i.append(1)
modified = intcode.run_intcode(source, i, o)
return modified[0], i, o
def part2(filename):
source = intcode.load_from_file(filename)
i, o = [], []
... | true | true |
f711dca3e3f0da5ab4a025c63c872b7d0c7f2c3b | 3,282 | py | Python | armyguys/aws/subnet.py | jtpaasch/armyguys | 4f138420ba42d6d9864176a87c709af014034429 | [
"MIT"
] | null | null | null | armyguys/aws/subnet.py | jtpaasch/armyguys | 4f138420ba42d6d9864176a87c709af014034429 | [
"MIT"
] | null | null | null | armyguys/aws/subnet.py | jtpaasch/armyguys | 4f138420ba42d6d9864176a87c709af014034429 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Utilities for working with VPC subnets."""
from . import client as boto3client
def create(profile, cidr_block, vpc, availability_zone=None):
"""Create a subnet in a VPC.
Args:
profile
A profile to connect to AWS with.
cidr_block
The netwo... | 21.88 | 70 | 0.595064 |
from . import client as boto3client
def create(profile, cidr_block, vpc, availability_zone=None):
client = boto3client.get("ec2", profile)
params = {}
params["CidrBlock"] = cidr_block
params["VpcId"] = vpc
if availability_zone:
params["AvailabilityZone"] = availability_zone
return cl... | true | true |
f711dd398300cfead29056966de347f4614f3052 | 20,794 | py | Python | tools/gn.py | fossabot/sdk | 938c939554d00c87d4fd1d1647d965e20b5abe79 | [
"BSD-Source-Code"
] | 1 | 2021-05-08T18:02:11.000Z | 2021-05-08T18:02:11.000Z | tools/gn.py | fossabot/sdk | 938c939554d00c87d4fd1d1647d965e20b5abe79 | [
"BSD-Source-Code"
] | null | null | null | tools/gn.py | fossabot/sdk | 938c939554d00c87d4fd1d1647d965e20b5abe79 | [
"BSD-Source-Code"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2016 The Dart project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import subprocess
import sys
import time
import utils
HOST_OS = utils.GuessOS()
HOST_ARCH = utils.Guess... | 34.889262 | 83 | 0.58387 |
import argparse
import os
import subprocess
import sys
import time
import utils
HOST_OS = utils.GuessOS()
HOST_ARCH = utils.GuessArchitecture()
SCRIPT_DIR = os.path.dirname(sys.argv[0])
DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
AVAILABLE_ARCHS = utils.ARCH_FAMILY.keys()
GN = os.path.join(DART_ROOT,... | true | true |
f711de0041005ffd1a35ead9be432b65a80f5617 | 842 | py | Python | Lib/test/test_nis.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 5 | 2022-03-26T21:53:36.000Z | 2022-03-30T21:47:20.000Z | Lib/test/test_nis.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 6 | 2020-11-18T15:48:14.000Z | 2021-05-03T21:20:50.000Z | Lib/test/test_nis.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 2 | 2015-07-16T08:14:13.000Z | 2022-03-27T01:55:17.000Z | from test_support import verbose, TestFailed, TestSkipped
import nis
print 'nis.maps()'
try:
maps = nis.maps()
except nis.error, msg:
# NIS is probably not active, so this test isn't useful
if verbose:
raise TestFailed, msg
# only do this if running under the regression suite
raise TestSkip... | 25.515152 | 75 | 0.567696 | from test_support import verbose, TestFailed, TestSkipped
import nis
print 'nis.maps()'
try:
maps = nis.maps()
except nis.error, msg:
if verbose:
raise TestFailed, msg
# only do this if running under the regression suite
raise TestSkipped, msg
done = 0
for nismap in maps:
if verbose:
... | false | true |
f711de27c6895e9adc35199a54ad636bb55fdab2 | 1,568 | py | Python | tk_box.py | policmajsterdev/game | 24a3bcb37cc812e3e3cdf96c0fbd7190d69cae4a | [
"MIT"
] | 2 | 2020-09-11T16:56:02.000Z | 2020-09-29T08:17:14.000Z | tk_box.py | policmajsterdev/game | 24a3bcb37cc812e3e3cdf96c0fbd7190d69cae4a | [
"MIT"
] | null | null | null | tk_box.py | policmajsterdev/game | 24a3bcb37cc812e3e3cdf96c0fbd7190d69cae4a | [
"MIT"
] | null | null | null | import os
from tkinter import *
import db_save
filepath = os.path.dirname(__file__)
icon_eq = os.path.join(filepath, "data\\pics\\pleczak.ico")
tlos = os.path.join(filepath, "data\\pics\\hg.png")
tloe = os.path.join(filepath, "data\\pics\\hp.png")
def informacja(tresc, zrodlo_pliku):
eq = "☆ Otrzy... | 30.745098 | 91 | 0.63074 | import os
from tkinter import *
import db_save
filepath = os.path.dirname(__file__)
icon_eq = os.path.join(filepath, "data\\pics\\pleczak.ico")
tlos = os.path.join(filepath, "data\\pics\\hg.png")
tloe = os.path.join(filepath, "data\\pics\\hp.png")
def informacja(tresc, zrodlo_pliku):
eq = "☆ Otrzy... | true | true |
f711deb58308265e9c2f3caba88c5213cd8faeeb | 25,599 | py | Python | secondary_indexes_test.py | knifewine/cassandra-dtest | c59b97e8f587b484df945ec9e3a17e9316b2a5df | [
"Apache-2.0"
] | null | null | null | secondary_indexes_test.py | knifewine/cassandra-dtest | c59b97e8f587b484df945ec9e3a17e9316b2a5df | [
"Apache-2.0"
] | null | null | null | secondary_indexes_test.py | knifewine/cassandra-dtest | c59b97e8f587b484df945ec9e3a17e9316b2a5df | [
"Apache-2.0"
] | null | null | null | import random, re, time, uuid
from dtest import Tester, debug
from pytools import since
from pyassertions import assert_invalid
from cassandra import InvalidRequest
from cassandra.query import BatchStatement, SimpleStatement
from cassandra.protocol import ConfigurationException
class TestSecondaryIndexes(Tester):
... | 43.168634 | 183 | 0.607953 | import random, re, time, uuid
from dtest import Tester, debug
from pytools import since
from pyassertions import assert_invalid
from cassandra import InvalidRequest
from cassandra.query import BatchStatement, SimpleStatement
from cassandra.protocol import ConfigurationException
class TestSecondaryIndexes(Tester):
... | true | true |
f711def72eb84cc8aea41771bc929db02aee579c | 1,540 | py | Python | fasp/scripts/FASPScript15.py | lifebit-ai/fasp-scripts | 572b0944372f0973979a3029e5c6dbeb01073d56 | [
"Apache-2.0"
] | null | null | null | fasp/scripts/FASPScript15.py | lifebit-ai/fasp-scripts | 572b0944372f0973979a3029e5c6dbeb01073d56 | [
"Apache-2.0"
] | null | null | null | fasp/scripts/FASPScript15.py | lifebit-ai/fasp-scripts | 572b0944372f0973979a3029e5c6dbeb01073d56 | [
"Apache-2.0"
] | null | null | null | ''' Compute on ANVIL GTEX files'''
# IMPORTS
import sys
import json
from fasp.runner import FASPRunner
# The implementations we're using
from fasp.loc import Gen3DRSClient
from fasp.workflow import GCPLSsamtools
from fasp.loc import anvilDRSClient
class localSearchClient:
def __init__(self):
# edit the follo... | 27.5 | 100 | 0.746753 | import sys
import json
from fasp.runner import FASPRunner
from fasp.loc import Gen3DRSClient
from fasp.workflow import GCPLSsamtools
from fasp.loc import anvilDRSClient
class localSearchClient:
def __init__(self):
# edit the following for your local copy of the manifest file
with open('/mnt/shared/gcp-user/... | true | true |
f711df443022c3db620cefea6c80ebd73ea4c993 | 1,616 | py | Python | reporter.py | mehdishekoohi/my-smart-plants | 55e97e37b064656175c7abe1aa6e6e8d5723f394 | [
"MIT"
] | null | null | null | reporter.py | mehdishekoohi/my-smart-plants | 55e97e37b064656175c7abe1aa6e6e8d5723f394 | [
"MIT"
] | null | null | null | reporter.py | mehdishekoohi/my-smart-plants | 55e97e37b064656175c7abe1aa6e6e8d5723f394 | [
"MIT"
] | null | null | null | from apscheduler.schedulers.blocking import BlockingScheduler
from internals.sensors import get_sensors_data
from internals.constants import plants_csv, moisture_alarm, template_email, output_email, \
from_email, to_email, interval_minutes
from internals.utils import get_dry_plants, insert_text_into_mail_body, gene... | 37.581395 | 101 | 0.731436 | from apscheduler.schedulers.blocking import BlockingScheduler
from internals.sensors import get_sensors_data
from internals.constants import plants_csv, moisture_alarm, template_email, output_email, \
from_email, to_email, interval_minutes
from internals.utils import get_dry_plants, insert_text_into_mail_body, gene... | true | true |
f711e0360364b8abc0862ca55da868e7c61c1ee4 | 12,851 | py | Python | venv/lib/python3.6/site-packages/flask_login/utils.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/flask_login/utils.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | venv/lib/python3.6/site-packages/flask_login/utils.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
flask_login.utils
-----------------
General utilities.
"""
import hmac
from hashlib import sha512
from functools import wraps
from werkzeug.local import LocalProxy
from werkzeug.security import safe_str_cmp
from werkzeug.urls import url_decode, url_encode
from flask import (
... | 32.699746 | 87 | 0.668119 |
import hmac
from hashlib import sha512
from functools import wraps
from werkzeug.local import LocalProxy
from werkzeug.security import safe_str_cmp
from werkzeug.urls import url_decode, url_encode
from flask import (
_request_ctx_stack,
current_app,
request,
session,
url_for,
has_request_cont... | true | true |
f711e09f98417b900c7b6eb63431d1bc6bce250d | 435 | py | Python | examples/pybullet/examples/integrate.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 9,136 | 2015-01-02T00:41:45.000Z | 2022-03-31T15:30:02.000Z | examples/pybullet/examples/integrate.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,424 | 2015-01-05T08:55:58.000Z | 2022-03-30T19:34:55.000Z | examples/pybullet/examples/integrate.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,921 | 2015-01-02T10:19:30.000Z | 2022-03-31T02:48:42.000Z | import pybullet as p
import pybullet_data
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
cube = p.loadURDF("cube.urdf")
frequency = 240
timeStep = 1. / frequency
p.setGravity(0, 0, -9.8)
p.changeDynamics(cube, -1, linearDamping=0, angularDamping=0)
p.setPhysicsEngineParameter(fixedTimeStep=tim... | 27.1875 | 61 | 0.783908 | import pybullet as p
import pybullet_data
p.connect(p.GUI)
p.setAdditionalSearchPath(pybullet_data.getDataPath())
cube = p.loadURDF("cube.urdf")
frequency = 240
timeStep = 1. / frequency
p.setGravity(0, 0, -9.8)
p.changeDynamics(cube, -1, linearDamping=0, angularDamping=0)
p.setPhysicsEngineParameter(fixedTimeStep=tim... | true | true |
f711e12fa6f296395e89cfcd5dca7f4594f6d5eb | 399 | py | Python | shielding/routing.py | gustavosilva-gss/shielding | 476f0a30c1363730604f24428262670ebede39ad | [
"MIT"
] | null | null | null | shielding/routing.py | gustavosilva-gss/shielding | 476f0a30c1363730604f24428262670ebede39ad | [
"MIT"
] | null | null | null | shielding/routing.py | gustavosilva-gss/shielding | 476f0a30c1363730604f24428262670ebede39ad | [
"MIT"
] | null | null | null | #https://channels.readthedocs.io/en/latest/installation.html
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import website.routing
application = ProtocolTypeRouter({
# (http->django views is added by default)
'websocket': AuthMiddlewareStack(
U... | 28.5 | 60 | 0.739348 |
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
import website.routing
application = ProtocolTypeRouter({
'websocket': AuthMiddlewareStack(
URLRouter(
website.routing.websocket_urlpatterns
)
),
}) | true | true |
f711e15b750f7aca7716ed5cd772e97d6c665d99 | 19,759 | py | Python | domain_adaptation/corruptions/corruptions.py | DexiongYung/robustnav_AE | f2b1b5bb8780e4e6ae5f81c127b7589cfc949801 | [
"MIT"
] | null | null | null | domain_adaptation/corruptions/corruptions.py | DexiongYung/robustnav_AE | f2b1b5bb8780e4e6ae5f81c127b7589cfc949801 | [
"MIT"
] | null | null | null | domain_adaptation/corruptions/corruptions.py | DexiongYung/robustnav_AE | f2b1b5bb8780e4e6ae5f81c127b7589cfc949801 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from PIL import Image
# /////////////// Corruption Helpers ///////////////
import skimage as sk
from torchvision import transforms
import torchvision.transforms.functional as F
from skimage.filters import gaussian
from io import BytesIO
from wand.image import Image as WandI... | 35.990893 | 135 | 0.572144 |
import numpy as np
from PIL import Image
import skimage as sk
from torchvision import transforms
import torchvision.transforms.functional as F
from skimage.filters import gaussian
from io import BytesIO
from wand.image import Image as WandImage
from wand.api import library as wandlibrary
import wand.color as WandCol... | true | true |
f711e1ad9b6684e8626d6ab0a391f039494f773d | 726 | py | Python | gym/pendulum_test.py | simondlevy/TinyNEF | 2e42754cf22996c86f1e35780d77591ec2bbb658 | [
"MIT"
] | 2 | 2020-07-27T19:08:47.000Z | 2020-08-11T08:46:45.000Z | gym/pendulum_test.py | steroal/TinyNEF | 2e42754cf22996c86f1e35780d77591ec2bbb658 | [
"MIT"
] | null | null | null | gym/pendulum_test.py | steroal/TinyNEF | 2e42754cf22996c86f1e35780d77591ec2bbb658 | [
"MIT"
] | 1 | 2022-02-28T07:56:31.000Z | 2022-02-28T07:56:31.000Z | #!/usr/bin/env python3
'''
Use the Neural Engineering framework to solve Pendulum via an elitist GA
Copyright (C) 2020 Simon D. Levy
MIT License
'''
from lib import NefGym
from sys import argv
import pickle
import numpy as np
from sueap.algorithms.elitist import Elitist
class NefPendulum(NefGym):
def __init__... | 20.166667 | 72 | 0.657025 |
from lib import NefGym
from sys import argv
import pickle
import numpy as np
from sueap.algorithms.elitist import Elitist
class NefPendulum(NefGym):
def __init__(self, neurons=20, seed=None):
NefGym.__init__(self, 'Pendulum-v0', neurons, seed)
def activate(self, x):
return np.clip(x, -2, ... | true | true |
f711e2d3df36363fa62ae46ba94f0ec3e0ce9190 | 218 | py | Python | 06/solve.py | englhardt/adventofcode2019 | b401b39020e23482bc88e947a361274809a61f79 | [
"MIT"
] | null | null | null | 06/solve.py | englhardt/adventofcode2019 | b401b39020e23482bc88e947a361274809a61f79 | [
"MIT"
] | null | null | null | 06/solve.py | englhardt/adventofcode2019 | b401b39020e23482bc88e947a361274809a61f79 | [
"MIT"
] | null | null | null | import networkx as nx
g = nx.Graph([x.split(")") for x in open("input.txt").read().splitlines()])
print(sum([nx.shortest_path_length(g, "COM", x) for x in g.nodes]))
print(nx.shortest_path_length(g, "YOU", "SAN") - 2)
| 43.6 | 75 | 0.669725 | import networkx as nx
g = nx.Graph([x.split(")") for x in open("input.txt").read().splitlines()])
print(sum([nx.shortest_path_length(g, "COM", x) for x in g.nodes]))
print(nx.shortest_path_length(g, "YOU", "SAN") - 2)
| true | true |
f711e3c5433ef571361309d1fd37dd4b8afe5f08 | 594 | py | Python | opencv/commercial/Examples/Face/utils/__init__.py | SSG-DRD-IOT/commercial-iot-security-system | 0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9 | [
"MIT"
] | null | null | null | opencv/commercial/Examples/Face/utils/__init__.py | SSG-DRD-IOT/commercial-iot-security-system | 0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9 | [
"MIT"
] | null | null | null | opencv/commercial/Examples/Face/utils/__init__.py | SSG-DRD-IOT/commercial-iot-security-system | 0c3d89b35d0468d4d3cc5ce2653b3f0ac82652a9 | [
"MIT"
] | 3 | 2022-01-22T05:02:41.000Z | 2022-03-31T08:13:06.000Z | ###############################################################################
# Author: Daniil Budanov
# Contact: danbudanov@gmail.com
# Summer Internship - 2016
###############################################################################
# Title: __init__.py
# Project: Security System
# Description:
# package d... | 31.263158 | 79 | 0.454545 |
from trigger import *
from sys import argv
from buff import *
from dtinfo import currDate, currTime
from args import *
| true | true |
f711e3e2fd5f305700b2272fceb788f6e04b68d1 | 6,559 | py | Python | alpha_vantage/timeseries.py | LaudateCorpus1/alpha_vantage | c637657579950d72605320c68ded42a447566cdf | [
"MIT"
] | 3,865 | 2017-05-20T01:27:02.000Z | 2022-03-30T20:50:25.000Z | alpha_vantage/timeseries.py | EmmaMuhleman1/alpha_vantage | a70f110c4883ffe66f2d1f36571a61c2a90e563d | [
"MIT"
] | 286 | 2017-05-21T09:10:58.000Z | 2022-03-26T14:26:58.000Z | alpha_vantage/timeseries.py | EmmaMuhleman1/alpha_vantage | a70f110c4883ffe66f2d1f36571a61c2a90e563d | [
"MIT"
] | 743 | 2017-05-22T12:17:05.000Z | 2022-03-26T13:22:08.000Z | from .alphavantage import AlphaVantage as av
class TimeSeries(av):
"""This class implements all the api calls to times series
"""
@av._output_format
@av._call_api_on_func
def get_intraday(self, symbol, interval='15min', outputsize='compact'):
""" Return intraday time series in two json ob... | 41.251572 | 98 | 0.650099 | from .alphavantage import AlphaVantage as av
class TimeSeries(av):
@av._output_format
@av._call_api_on_func
def get_intraday(self, symbol, interval='15min', outputsize='compact'):
_FUNCTION_KEY = "TIME_SERIES_INTRADAY"
return _FUNCTION_KEY, "Time Series ({})".format(interval), 'Meta Data'... | true | true |
f711e4440525a6691974c10a06753a57f193ef38 | 5,090 | py | Python | docs/.src/programs/skyplot_proj/skyplotv1.py | astrax/astro2019 | c1f5309415c80fbd986d6760bcb8bc095898beda | [
"MIT"
] | null | null | null | docs/.src/programs/skyplot_proj/skyplotv1.py | astrax/astro2019 | c1f5309415c80fbd986d6760bcb8bc095898beda | [
"MIT"
] | null | null | null | docs/.src/programs/skyplot_proj/skyplotv1.py | astrax/astro2019 | c1f5309415c80fbd986d6760bcb8bc095898beda | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import astropy
from scipy.spatial import cKDTree
import numpy as np
import matplotlib.pyplot as plt
data=np.genfromtxt('ybs.degbv',names=True)
messier=np.genfromtxt('Messierdec.txt',names=True)
vlim=4.5
magscale=10
starsize=magscale*(vl... | 41.048387 | 154 | 0.665815 |
import astropy
from scipy.spatial import cKDTree
import numpy as np
import matplotlib.pyplot as plt
data=np.genfromtxt('ybs.degbv',names=True)
messier=np.genfromtxt('Messierdec.txt',names=True)
vlim=4.5
magscale=10
starsize=magscale*(vlim-data['v'])
import astropy
from astropy import units as u
from astropy.time ... | true | true |
f711e4d09ef2807e9e9b94a7a6071bf563e0de28 | 19,340 | py | Python | stable_baselines/a2c/a2c.py | ClementRolinat/stable-baselines | 333c59379f23e1f5c5c9e8bf93cbfa56ac52d13b | [
"MIT"
] | 1 | 2020-03-25T14:02:31.000Z | 2020-03-25T14:02:31.000Z | stable_baselines/a2c/a2c.py | ClementRolinat/stable-baselines | 333c59379f23e1f5c5c9e8bf93cbfa56ac52d13b | [
"MIT"
] | null | null | null | stable_baselines/a2c/a2c.py | ClementRolinat/stable-baselines | 333c59379f23e1f5c5c9e8bf93cbfa56ac52d13b | [
"MIT"
] | 1 | 2019-10-07T22:18:00.000Z | 2019-10-07T22:18:00.000Z | import time
from collections import deque
import gym
import numpy as np
import tensorflow as tf
from stable_baselines import logger
from stable_baselines.common import explained_variance, tf_util, ActorCriticRLModel, SetVerbosity, TensorboardWriter
from stable_baselines.common.policies import ActorCriticPolicy, Recur... | 52.12938 | 120 | 0.611996 | import time
from collections import deque
import gym
import numpy as np
import tensorflow as tf
from stable_baselines import logger
from stable_baselines.common import explained_variance, tf_util, ActorCriticRLModel, SetVerbosity, TensorboardWriter
from stable_baselines.common.policies import ActorCriticPolicy, Recur... | true | true |
f711e50db3b1e0ae05786cda0ee212109cd501ae | 8,321 | py | Python | squash/dashboard/viz/api_helper.py | lsst-sqre/qa-dashboard | 57d40a33f1d6fdc04fb8f5e6e7e4fcfaee25340c | [
"MIT"
] | 2 | 2016-12-29T18:17:55.000Z | 2017-03-01T20:20:52.000Z | squash/dashboard/viz/api_helper.py | lsst-sqre/qa-dashboard | 57d40a33f1d6fdc04fb8f5e6e7e4fcfaee25340c | [
"MIT"
] | 14 | 2016-04-08T17:11:06.000Z | 2017-06-29T23:29:03.000Z | squash/dashboard/viz/api_helper.py | lsst-sqre/qa-dashboard | 57d40a33f1d6fdc04fb8f5e6e7e4fcfaee25340c | [
"MIT"
] | 1 | 2016-05-03T22:52:02.000Z | 2016-05-03T22:52:02.000Z | import os
import pandas as pd
import requests
from datetime import datetime
from furl import furl
SQUASH_API_URL = os.environ.get('SQUASH_API_URL',
'http://localhost:8000/dashboard/api/')
def get_endpoint_urls():
"""
Lookup API endpoint URLs
"""
r = requests.get(SQUAS... | 26.415873 | 87 | 0.604855 | import os
import pandas as pd
import requests
from datetime import datetime
from furl import furl
SQUASH_API_URL = os.environ.get('SQUASH_API_URL',
'http://localhost:8000/dashboard/api/')
def get_endpoint_urls():
r = requests.get(SQUASH_API_URL)
r.raise_for_status()
retu... | true | true |
f711e542c62977ca0298efb71fdbcddc78077b81 | 186 | py | Python | Run Files/multi-sub.py | shahmari/Prevention_and_Quarantine_on_SIR | 9173fd3feaa86a79d829ee653ec2c70f678e2ac3 | [
"MIT"
] | 1 | 2021-08-25T09:56:10.000Z | 2021-08-25T09:56:10.000Z | Run Files/multi-sub.py | shahmari/Prevention_and_Quarantine_on_SIR | 9173fd3feaa86a79d829ee653ec2c70f678e2ac3 | [
"MIT"
] | null | null | null | Run Files/multi-sub.py | shahmari/Prevention_and_Quarantine_on_SIR | 9173fd3feaa86a79d829ee653ec2c70f678e2ac3 | [
"MIT"
] | null | null | null | import time
jobNumber=10
for i in range(jobNumber):
qsub_command = "qsub job.sh"
print(qsub_command)
exit_status = subprocess.call(qsub_command, shell=True)
time.sleep(6) | 26.571429 | 59 | 0.725806 | import time
jobNumber=10
for i in range(jobNumber):
qsub_command = "qsub job.sh"
print(qsub_command)
exit_status = subprocess.call(qsub_command, shell=True)
time.sleep(6) | true | true |
f711e544a0dc6217467d5a0efe20891c8d308cd5 | 2,929 | py | Python | tkinter/studenttracking_gui.py | blulady/python | 65d8e99f6411cf79be0353abc99a2677dfeebe11 | [
"bzip2-1.0.6"
] | null | null | null | tkinter/studenttracking_gui.py | blulady/python | 65d8e99f6411cf79be0353abc99a2677dfeebe11 | [
"bzip2-1.0.6"
] | null | null | null | tkinter/studenttracking_gui.py | blulady/python | 65d8e99f6411cf79be0353abc99a2677dfeebe11 | [
"bzip2-1.0.6"
] | 1 | 2020-09-11T16:05:46.000Z | 2020-09-11T16:05:46.000Z |
from tkinter import *
import tkinter as tk
import studenttracking_main
import studenttracking_fnct
def load_gui(self):
self.lbl_subform = tk.Label(self.master,text='Submission Form')
self.lbl_subform.grid(row=0,column=1,padx=(27,0),pady=(10,0),sticky=N+W)
self.lbl_fname = tk.Label(self.master... | 54.240741 | 129 | 0.699556 |
from tkinter import *
import tkinter as tk
import studenttracking_main
import studenttracking_fnct
def load_gui(self):
self.lbl_subform = tk.Label(self.master,text='Submission Form')
self.lbl_subform.grid(row=0,column=1,padx=(27,0),pady=(10,0),sticky=N+W)
self.lbl_fname = tk.Label(self.master... | true | true |
f711e63ba9ef37c10f831ed1e5a1dff0fdbe22b9 | 22,083 | py | Python | TWLight/emails/tests.py | soumyaa1804/TWLight | 25b58c9e4657919f08351f2578f5221f2e0c8e83 | [
"MIT"
] | null | null | null | TWLight/emails/tests.py | soumyaa1804/TWLight | 25b58c9e4657919f08351f2578f5221f2e0c8e83 | [
"MIT"
] | null | null | null | TWLight/emails/tests.py | soumyaa1804/TWLight | 25b58c9e4657919f08351f2578f5221f2e0c8e83 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from djmail.template_mail import MagicMailBuilder, InlineCSSTemplateMail
from unittest.mock import patch
from django_comments import get_form_target
from django_comments.models import Comment
from django_comments.signals import comment_was_posted
from django.contrib.contenttyp... | 38.074138 | 88 | 0.683059 | from datetime import datetime, timedelta
from djmail.template_mail import MagicMailBuilder, InlineCSSTemplateMail
from unittest.mock import patch
from django_comments import get_form_target
from django_comments.models import Comment
from django_comments.signals import comment_was_posted
from django.contrib.contenttyp... | true | true |
f711e6ecb38eb136dcbc93753ad3f1ee797ef1ce | 26,461 | py | Python | app/main/routes_zseries_api.py | zuiko42/picobrew_pico | 77d39fa4fe3f0361cca34bdf33eadf461fdd5ca7 | [
"MIT"
] | null | null | null | app/main/routes_zseries_api.py | zuiko42/picobrew_pico | 77d39fa4fe3f0361cca34bdf33eadf461fdd5ca7 | [
"MIT"
] | null | null | null | app/main/routes_zseries_api.py | zuiko42/picobrew_pico | 77d39fa4fe3f0361cca34bdf33eadf461fdd5ca7 | [
"MIT"
] | 1 | 2020-09-16T19:39:59.000Z | 2020-09-16T19:39:59.000Z | import json
import uuid
import os
from datetime import datetime
from flask import current_app, request, Response, abort, send_from_directory
from webargs import fields
from webargs.flaskparser import use_args, FlaskParser
from enum import Enum
from random import seed, randint
from .. import socketio
from . import main... | 38.79912 | 200 | 0.586713 | import json
import uuid
import os
from datetime import datetime
from flask import current_app, request, Response, abort, send_from_directory
from webargs import fields
from webargs.flaskparser import use_args, FlaskParser
from enum import Enum
from random import seed, randint
from .. import socketio
from . import main... | true | true |
f711e702da3a75d7ea35c783bd0cd35c00cc3b6b | 45,018 | py | Python | recipes/recipe_modules/bot_update/resources/bot_update.py | mlkt/depot_tools | e8856eea42cf284071511107e818ce9980b30636 | [
"BSD-3-Clause"
] | 1 | 2018-01-05T12:50:41.000Z | 2018-01-05T12:50:41.000Z | recipes/recipe_modules/bot_update/resources/bot_update.py | mlkt/depot_tools | e8856eea42cf284071511107e818ce9980b30636 | [
"BSD-3-Clause"
] | null | null | null | recipes/recipe_modules/bot_update/resources/bot_update.py | mlkt/depot_tools | e8856eea42cf284071511107e818ce9980b30636 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(hinoka): Use logging.
import cStringIO
import codecs
import copy
import ctypes
import json
import optparse
import os
import ppr... | 35.928172 | 102 | 0.661624 |
import cStringIO
import codecs
import copy
import ctypes
import json
import optparse
import os
import pprint
import random
import re
import subprocess
import sys
import tempfile
import threading
import time
import urllib2
import urlparse
import uuid
import os.path as path
BUF_SIZE = 256
THIS_DIR = path.dirname(pat... | false | true |
f711e74e93d140938edbc165431b7e579a1620a9 | 1,218 | py | Python | electionsproject/results/management/commands/z_not_used/delete_result_psql.py | mcclatchy/mccelections | df044c96fc1f7e310483177a0430ad9fad6de428 | [
"Apache-2.0"
] | 12 | 2017-03-04T19:46:56.000Z | 2018-10-23T23:57:44.000Z | electionsproject/results/management/commands/z_not_used/delete_result_psql.py | mcclatchy/mccelections | df044c96fc1f7e310483177a0430ad9fad6de428 | [
"Apache-2.0"
] | null | null | null | electionsproject/results/management/commands/z_not_used/delete_result_psql.py | mcclatchy/mccelections | df044c96fc1f7e310483177a0430ad9fad6de428 | [
"Apache-2.0"
] | null | null | null | from django.core.management.base import BaseCommand, CommandError
from results.models import ResultStage, ResultCheck
def count_result(model_arg):
if model_arg == "resultcheck":
result_count = ResultCheck.objects.all().count()
else:
result_count = ResultStage.objects.all().count()
return r... | 30.45 | 84 | 0.657635 | from django.core.management.base import BaseCommand, CommandError
from results.models import ResultStage, ResultCheck
def count_result(model_arg):
if model_arg == "resultcheck":
result_count = ResultCheck.objects.all().count()
else:
result_count = ResultStage.objects.all().count()
return r... | false | true |
f711e80286662591c48c44238a56a9bddebb300e | 520 | py | Python | pygeppetto/model/utils/bytesuri.py | openworm/pygeppetto | 949ab700bed7d1f5e5481898f717a15bd9d00002 | [
"MIT"
] | 10 | 2017-04-04T13:24:39.000Z | 2021-11-16T11:50:13.000Z | pygeppetto/model/utils/bytesuri.py | openworm/org.geppetto.python | 949ab700bed7d1f5e5481898f717a15bd9d00002 | [
"MIT"
] | 237 | 2021-03-17T09:40:17.000Z | 2022-03-30T11:09:44.000Z | pygeppetto/model/utils/bytesuri.py | openworm/org.geppetto.python | 949ab700bed7d1f5e5481898f717a15bd9d00002 | [
"MIT"
] | 5 | 2017-03-28T16:15:07.000Z | 2020-11-25T03:07:07.000Z |
try:
from BytesIO import BytesIO
except ImportError:
from io import BytesIO
from pyecore.resources import URI
class BytesURI(URI):
def __init__(self, uri, text=None):
super(BytesURI, self).__init__(uri)
if text is not None:
self.__stream = BytesIO(text)
def getvalue(self... | 20.8 | 43 | 0.655769 |
try:
from BytesIO import BytesIO
except ImportError:
from io import BytesIO
from pyecore.resources import URI
class BytesURI(URI):
def __init__(self, uri, text=None):
super(BytesURI, self).__init__(uri)
if text is not None:
self.__stream = BytesIO(text)
def getvalue(self... | true | true |
f711e8ed482d79490b96bdcc203e85ab45ce1a99 | 2,916 | py | Python | basic/wordcount.py | vancouverwill/google-python-exercises | 950f439d1edf57bf7e086cfa9fb53147de57372a | [
"Apache-2.0"
] | null | null | null | basic/wordcount.py | vancouverwill/google-python-exercises | 950f439d1edf57bf7e086cfa9fb53147de57372a | [
"Apache-2.0"
] | null | null | null | basic/wordcount.py | vancouverwill/google-python-exercises | 950f439d1edf57bf7e086cfa9fb53147de57372a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | 26.035714 | 79 | 0.695816 |
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and complete. It calls print_words()
and print_top() functions which you write.
1. For the --count flag, implement a print_words(filename) function that counts
how often each w... | false | true |
f711e98997d8eda653460add38d93b304d01864a | 12,564 | py | Python | src/ddog.py | srubenacker/DeepDog | ce6613e01c04a14f62a2d6f6cd1c60f97efa790a | [
"Unlicense"
] | null | null | null | src/ddog.py | srubenacker/DeepDog | ce6613e01c04a14f62a2d6f6cd1c60f97efa790a | [
"Unlicense"
] | 1 | 2018-10-02T18:33:42.000Z | 2018-10-04T01:15:29.000Z | src/ddog.py | srubenacker/DeepDog | ce6613e01c04a14f62a2d6f6cd1c60f97efa790a | [
"Unlicense"
] | null | null | null | import util
import json
import numpy as np
import random
import tensorflow as tf
class DeepDog:
"""
The DeepDog class loads the training and test set images from
disk into RAM, and provides functions to get the test set
and mini batches of the training set.
"""
def __init__(self, imageWidth, ... | 40.012739 | 109 | 0.610156 | import util
import json
import numpy as np
import random
import tensorflow as tf
class DeepDog:
def __init__(self, imageWidth, imageHeight, trainingInRAM=False, classStratify=False,
randomMirroring=False, randomCropping=None, normalizeImage=False):
self.MIRROR_PROBABILITY = 0.5
se... | true | true |
f711ebb8335bcacaf06e71865a713f96fcade64c | 193 | py | Python | profiles_api/serializers.py | guicfernandes/profiles-rest-api | 77229aa608eea654fe61479f49ba5e14aba41237 | [
"MIT"
] | null | null | null | profiles_api/serializers.py | guicfernandes/profiles-rest-api | 77229aa608eea654fe61479f49ba5e14aba41237 | [
"MIT"
] | null | null | null | profiles_api/serializers.py | guicfernandes/profiles-rest-api | 77229aa608eea654fe61479f49ba5e14aba41237 | [
"MIT"
] | null | null | null | from rest_framework import serializers
class HelloSerializer(serializers.Serializer):
"""Serializes a name field for testing our APIView"""
name = serializers.CharField(max_length=10) | 32.166667 | 57 | 0.787565 | from rest_framework import serializers
class HelloSerializer(serializers.Serializer):
name = serializers.CharField(max_length=10) | true | true |
f711ebea4ca8f3cc0b5fab941ae10170f6556214 | 5,814 | py | Python | haco/DIDrive_core/demo/cilrs/cilrs_collect_data.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | 21 | 2022-02-15T10:11:54.000Z | 2022-03-24T17:44:29.000Z | haco/DIDrive_core/demo/cilrs/cilrs_collect_data.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | null | null | null | haco/DIDrive_core/demo/cilrs/cilrs_collect_data.py | decisionforce/HACO | ebd1dc49598e6ae2704e58c053cc35f2d9e28429 | [
"Apache-2.0"
] | 3 | 2022-02-22T11:11:43.000Z | 2022-03-17T17:58:44.000Z | import os
from functools import partial
import PIL
import lmdb
import numpy as np
from ding.envs import SyncSubprocessEnvManager
from ding.utils.default_helper import deep_merge_dicts
from easydict import EasyDict
from tqdm import tqdm
from haco.DIDrive_core.data import CarlaBenchmarkCollector, BenchmarkDatasetSaver
... | 35.024096 | 132 | 0.626419 | import os
from functools import partial
import PIL
import lmdb
import numpy as np
from ding.envs import SyncSubprocessEnvManager
from ding.utils.default_helper import deep_merge_dicts
from easydict import EasyDict
from tqdm import tqdm
from haco.DIDrive_core.data import CarlaBenchmarkCollector, BenchmarkDatasetSaver
... | true | true |
f711ed3c2a7d9bd9e45ef8312a2b448a64bf6a14 | 3,741 | py | Python | game/test/test_ai.py | NejcZupec/tictactoe | 408fe11a0b9159a0f06110a98b94042e38676d86 | [
"Apache-2.0"
] | 1 | 2016-04-15T14:18:22.000Z | 2016-04-15T14:18:22.000Z | game/test/test_ai.py | NejcZupec/tictactoe | 408fe11a0b9159a0f06110a98b94042e38676d86 | [
"Apache-2.0"
] | 3 | 2016-04-14T19:21:22.000Z | 2016-04-15T12:47:29.000Z | game/test/test_ai.py | NejcZupec/tictactoe | 408fe11a0b9159a0f06110a98b94042e38676d86 | [
"Apache-2.0"
] | 1 | 2020-09-26T00:00:01.000Z | 2020-09-26T00:00:01.000Z | from django.test import TestCase
from game.ai import TicTacToeAI
class TicTacToeAITest(TestCase):
def setUp(self):
board_state = [['o', ' ', 'x'],
['x', ' ', ' '],
['x', 'o', 'o']]
self.g = TicTacToeAI(board_state)
def test_possible_moves(self)... | 28.557252 | 114 | 0.42101 | from django.test import TestCase
from game.ai import TicTacToeAI
class TicTacToeAITest(TestCase):
def setUp(self):
board_state = [['o', ' ', 'x'],
['x', ' ', ' '],
['x', 'o', 'o']]
self.g = TicTacToeAI(board_state)
def test_possible_moves(self)... | true | true |
f711edb0afff634303521d7f3bc0c72083fd877a | 656 | py | Python | core/recc/container/struct/port_binding_guest.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | 3 | 2021-06-20T02:24:10.000Z | 2022-01-26T23:55:33.000Z | core/recc/container/struct/port_binding_guest.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | core/recc/container/struct/port_binding_guest.py | bogonets/answer | 57f892a9841980bcbc35fa1e27521b34cd94bc25 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import Union
class PortBindingGuest:
__slots__ = ("port", "protocol")
port: int
protocol: str
def __init__(self, port: Union[int, str], protocol: str):
if isinstance(port, int):
self.port = port
else:
self.port = int(port)... | 21.16129 | 61 | 0.577744 |
from typing import Union
class PortBindingGuest:
__slots__ = ("port", "protocol")
port: int
protocol: str
def __init__(self, port: Union[int, str], protocol: str):
if isinstance(port, int):
self.port = port
else:
self.port = int(port)
self.protocol =... | true | true |
f711edf882ba9f6ec3210c7053a35e58218d777c | 698 | py | Python | pyzoo/zoo/xshard/pandas/__init__.py | yushan111/analytics-zoo | cf63e52e1dc2969a10fce56740a1fecb510a46d2 | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/xshard/pandas/__init__.py | yushan111/analytics-zoo | cf63e52e1dc2969a10fce56740a1fecb510a46d2 | [
"Apache-2.0"
] | 2 | 2018-10-31T01:20:05.000Z | 2018-11-02T06:06:35.000Z | pyzoo/zoo/xshard/pandas/__init__.py | yushan111/analytics-zoo | cf63e52e1dc2969a10fce56740a1fecb510a46d2 | [
"Apache-2.0"
] | 4 | 2019-02-25T03:26:56.000Z | 2019-03-06T04:41:31.000Z | #
# 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... | 36.736842 | 74 | 0.775072 |
from zoo.xshard.pandas.preprocessing import read_csv
from zoo.xshard.pandas.preprocessing import read_json
| true | true |
f711eeb2544235dce29805e572a07830e76565f5 | 17,435 | py | Python | veroviz/_queryPgRouting.py | INFORMSJoC/2020.0340 | 9536a35b9607266ad95799cbb7e59c9451aaa6ea | [
"MIT"
] | 1 | 2022-03-28T09:56:53.000Z | 2022-03-28T09:56:53.000Z | veroviz/_queryPgRouting.py | INFORMSJoC/2020.0340 | 9536a35b9607266ad95799cbb7e59c9451aaa6ea | [
"MIT"
] | null | null | null | veroviz/_queryPgRouting.py | INFORMSJoC/2020.0340 | 9536a35b9607266ad95799cbb7e59c9451aaa6ea | [
"MIT"
] | 1 | 2021-10-30T05:01:49.000Z | 2021-10-30T05:01:49.000Z | # Copyright (c) 2021 Lan Peng and Chase Murray
# Licensed under the MIT License. See LICENSING for details.
from veroviz._common import *
from veroviz._internal import locs2Dict
from veroviz._internal import loc2Dict
from veroviz._geometry import geoDistance2D
def pgrGetSnapToRoadLatLon(gid, loc, databaseName):
"""
... | 37.902174 | 165 | 0.693031 |
from veroviz._common import *
from veroviz._internal import locs2Dict
from veroviz._internal import loc2Dict
from veroviz._geometry import geoDistance2D
def pgrGetSnapToRoadLatLon(gid, loc, databaseName):
conn = psycopg2.connect("dbname='%s' user='%s' host='%s' password='%s'" % (
databaseName,
config['VRV_SETT... | true | true |
f711eeeea65596f32f53745ed391001983450cc7 | 5,830 | py | Python | imcsdk/mometa/pci/PciEquipSlot.py | ragupta-git/ImcSdk | 2e41f2ffe5282d38de85bc4739fa53dd2f0c9bb4 | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/pci/PciEquipSlot.py | ragupta-git/ImcSdk | 2e41f2ffe5282d38de85bc4739fa53dd2f0c9bb4 | [
"Apache-2.0"
] | null | null | null | imcsdk/mometa/pci/PciEquipSlot.py | ragupta-git/ImcSdk | 2e41f2ffe5282d38de85bc4739fa53dd2f0c9bb4 | [
"Apache-2.0"
] | 3 | 2018-11-14T13:02:40.000Z | 2018-11-14T13:49:38.000Z | """This module contains the general information for PciEquipSlot ManagedObject."""
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class PciEquipSlotConsts:
pass
class PciEquipSlot(ManagedObject):
"""This is PciEquipSlot class."""
... | 57.156863 | 235 | 0.612864 |
from ...imcmo import ManagedObject
from ...imccoremeta import MoPropertyMeta, MoMeta
from ...imcmeta import VersionMeta
class PciEquipSlotConsts:
pass
class PciEquipSlot(ManagedObject):
consts = PciEquipSlotConsts()
naming_props = set([u'id'])
mo_meta = {
"classic": MoMeta("PciEquipSlot",... | true | true |
f711ef4632a8ebbc51846a8b824d23dfbc6b810f | 1,030 | py | Python | old_code/pandas_order.py | yuguiyang/python_demo | 1be2406bfc920e22a0f92bf10d9a3665984067ba | [
"Apache-2.0"
] | null | null | null | old_code/pandas_order.py | yuguiyang/python_demo | 1be2406bfc920e22a0f92bf10d9a3665984067ba | [
"Apache-2.0"
] | null | null | null | old_code/pandas_order.py | yuguiyang/python_demo | 1be2406bfc920e22a0f92bf10d9a3665984067ba | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 28 13:42:30 2017
@author: hexo
"""
import numpy as np
import pandas as pd
#读取第一个sheet页
df = pd.read_excel('D:\Tableau_data\示例 - 超市.xls',sheetname=0)
print(type(df))
#每一列的数据类型
print(df.dtypes)
#每种类型的数量
print(df.get_dtype_counts())
#还不知道这个ftype到底是干嘛的,sparse|dense,稀疏|密集... | 18.727273 | 76 | 0.659223 |
import numpy as np
import pandas as pd
df = pd.read_excel('D:\Tableau_data\示例 - 超市.xls',sheetname=0)
print(type(df))
print(df.dtypes)
print(df.get_dtype_counts())
print(df.ftypes)
print(df.get_ftype_counts())
top_10_data=df.head(10)
print('----------------------------')
print(top_10_data.mean(axis=0))
print('--... | true | true |
f711ef49feb10977288d0f681356ef6504cb4062 | 488 | py | Python | blog/migrations/0002_post_subtitle.py | EmmanuelPerezP/MyBlog | 247fb638561df264701ebda91347c28136d12061 | [
"MIT"
] | null | null | null | blog/migrations/0002_post_subtitle.py | EmmanuelPerezP/MyBlog | 247fb638561df264701ebda91347c28136d12061 | [
"MIT"
] | null | null | null | blog/migrations/0002_post_subtitle.py | EmmanuelPerezP/MyBlog | 247fb638561df264701ebda91347c28136d12061 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 03:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AddField(
m... | 22.181818 | 67 | 0.604508 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='post',
name='subtitle',
field=models.C... | true | true |
f711f1b1b52a7f3dc945583c49c1999f046af643 | 747 | py | Python | user/views.py | prajilmv/recipe-app-api | f469168922e520d423d7207f69290cac172fc32e | [
"MIT"
] | null | null | null | user/views.py | prajilmv/recipe-app-api | f469168922e520d423d7207f69290cac172fc32e | [
"MIT"
] | null | null | null | user/views.py | prajilmv/recipe-app-api | f469168922e520d423d7207f69290cac172fc32e | [
"MIT"
] | null | null | null | from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerailizer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
serializer_class = UserSeraili... | 32.478261 | 66 | 0.828648 | from rest_framework import generics, authentication, permissions
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.settings import api_settings
from user.serializers import UserSerailizer, AuthTokenSerializer
class CreateUserView(generics.CreateAPIView):
serializer_class = UserSeraili... | true | true |
f711f2f36decd5351d75ec27de13bd15b0cad0af | 17,654 | py | Python | tempest/common/isolated_creds.py | Mirantis/tempest | ae7e033fef80f2a4728a13bba18123f6fe32839a | [
"Apache-2.0"
] | 3 | 2015-03-03T15:43:06.000Z | 2016-10-24T06:12:40.000Z | tempest/common/isolated_creds.py | Mirantis/tempest | ae7e033fef80f2a4728a13bba18123f6fe32839a | [
"Apache-2.0"
] | null | null | null | tempest/common/isolated_creds.py | Mirantis/tempest | ae7e033fef80f2a4728a13bba18123f6fe32839a | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 IBM Corp.
#
# 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 t... | 42.23445 | 79 | 0.582588 |
import netaddr
from tempest import auth
from tempest import clients
from tempest.common import cred_provider
from tempest.common.utils import data_utils
from tempest import config
from tempest import exceptions
from tempest.openstack.common import log as logging
CONF = config.CONF
LOG = logging.getLogger(__name__)
... | true | true |
f711f325d775ad9950782daf6d73cd89a5bd7e18 | 94,303 | py | Python | custom-components/soco/core.py | JackJPowell/sensor.sonos_upcoming_media | d796ed5e26dfe49250b23a8632a5975df754866e | [
"Apache-2.0"
] | null | null | null | custom-components/soco/core.py | JackJPowell/sensor.sonos_upcoming_media | d796ed5e26dfe49250b23a8632a5975df754866e | [
"Apache-2.0"
] | null | null | null | custom-components/soco/core.py | JackJPowell/sensor.sonos_upcoming_media | d796ed5e26dfe49250b23a8632a5975df754866e | [
"Apache-2.0"
] | null | null | null | # pylint: disable=fixme, protected-access
"""The core module contains the SoCo class that implements
the main entry to the SoCo functionality
"""
import datetime
import logging
import re
import socket
from functools import wraps
from xml.sax.saxutils import escape
from xml.parsers.expat import ExpatError
import warni... | 36.565723 | 88 | 0.586641 |
import datetime
import logging
import re
import socket
from functools import wraps
from xml.sax.saxutils import escape
from xml.parsers.expat import ExpatError
import warnings
import xmltodict
import requests
from requests.exceptions import ConnectionError as RequestsConnectionError
from requests.exceptions import C... | true | true |
f711f38baeb8f66b619dc436761fd9c561442663 | 5,633 | py | Python | venv/Lib/site-packages/setuptools/wheel.py | krolzzgk/ado_python | 44ea6e3da82afcbfd9aa1ca3c4007948e2325cc3 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/setuptools/wheel.py | krolzzgk/ado_python | 44ea6e3da82afcbfd9aa1ca3c4007948e2325cc3 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/setuptools/wheel.py | krolzzgk/ado_python | 44ea6e3da82afcbfd9aa1ca3c4007948e2325cc3 | [
"MIT"
] | null | null | null | '''Wheels support.'''
from distutils.util import get_platform
import email
import itertools
import os
import re
import zipfile
from pkg_resources import Distribution, PathMetadata, parse_version
from pkg_resources.extern.six import PY3
from setuptools import Distribution as SetuptoolsDistribution
from setuptools impo... | 44.354331 | 88 | 0.569501 |
from distutils.util import get_platform
import email
import itertools
import os
import re
import zipfile
from pkg_resources import Distribution, PathMetadata, parse_version
from pkg_resources.extern.six import PY3
from setuptools import Distribution as SetuptoolsDistribution
from setuptools import pep425tags
from set... | true | true |
f711f3b2074535a42d3b41958c1ad2e4a072b758 | 1,291 | py | Python | src/sima/riflex/blueprints/metoceanfatigueanalysis.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/riflex/blueprints/metoceanfatigueanalysis.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/riflex/blueprints/metoceanfatigueanalysis.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | #
# Generated with MetoceanFatigueAnalysisBlueprint
from dmt.blueprint import Blueprint
from dmt.dimension import Dimension
from dmt.attribute import Attribute
from dmt.enum_attribute import EnumAttribute
from dmt.blueprint_attribute import BlueprintAttribute
from sima.sima.blueprints.condition import ConditionBluepri... | 58.681818 | 121 | 0.756778 | from dmt.blueprint import Blueprint
from dmt.dimension import Dimension
from dmt.attribute import Attribute
from dmt.enum_attribute import EnumAttribute
from dmt.blueprint_attribute import BlueprintAttribute
from sima.sima.blueprints.condition import ConditionBlueprint
class MetoceanFatigueAnalysisBlueprint(ConditionB... | true | true |
f711f489ea086703ba82ac6e586eaf1c0cddf9d2 | 519 | py | Python | feedbackproj/users/admin.py | camrohlof/feedback | 664f3acbaf3bec194a5e60beb37e3a5d60ad21ed | [
"MIT"
] | null | null | null | feedbackproj/users/admin.py | camrohlof/feedback | 664f3acbaf3bec194a5e60beb37e3a5d60ad21ed | [
"MIT"
] | null | null | null | feedbackproj/users/admin.py | camrohlof/feedback | 664f3acbaf3bec194a5e60beb37e3a5d60ad21ed | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from feedbackproj.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
... | 28.833333 | 83 | 0.749518 | from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from feedbackproj.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
... | true | true |
f711f4d52d12d34e342b05aa7056e30c7be5a0e6 | 3,947 | py | Python | aws-scripts/lifecycle-hook-worker.py | tirupathiogirala/AWS-Scriptss | 8210e263c86dac257c62210c442575c11e82b9a3 | [
"MIT"
] | 4 | 2019-02-01T22:50:24.000Z | 2020-10-22T15:50:04.000Z | aws-scripts/lifecycle-hook-worker.py | tirupathiogirala/AWS-Scriptss | 8210e263c86dac257c62210c442575c11e82b9a3 | [
"MIT"
] | null | null | null | aws-scripts/lifecycle-hook-worker.py | tirupathiogirala/AWS-Scriptss | 8210e263c86dac257c62210c442575c11e82b9a3 | [
"MIT"
] | 2 | 2019-01-27T09:30:56.000Z | 2020-10-22T15:50:28.000Z | #!/usr/bin/env python
import boto3
import sys
import argparse
import ast
import urllib2
from subprocess import call
import time
from datetime import datetime
import shlex
def sqs_get_msg(qname):
sqs = boto3.resource('sqs')
queue = sqs.get_queue_by_name(QueueName=qname)
client = boto3.client('sqs')
me... | 40.27551 | 125 | 0.645807 |
import boto3
import sys
import argparse
import ast
import urllib2
from subprocess import call
import time
from datetime import datetime
import shlex
def sqs_get_msg(qname):
sqs = boto3.resource('sqs')
queue = sqs.get_queue_by_name(QueueName=qname)
client = boto3.client('sqs')
message = client.receive... | false | true |
f711f53dbfad008c2626bad9630cebfb74095511 | 1,685 | py | Python | rat-sql-gap/seq2struct/commands/preprocess.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | rat-sql-gap/seq2struct/commands/preprocess.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | rat-sql-gap/seq2struct/commands/preprocess.py | JuruoMP/gap-exp | 2d7af8a1da2f0ff8f9d3a2c6e15cc6383c716c05 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import os
import _jsonnet
import tqdm
from seq2struct import datasets
from seq2struct import models
from seq2struct.utils import registry
from seq2struct.utils import vocab
class Preprocessor:
def __init__(self, config):
self.config = config
self.model_preproc = regist... | 31.203704 | 102 | 0.633828 | import argparse
import json
import os
import _jsonnet
import tqdm
from seq2struct import datasets
from seq2struct import models
from seq2struct.utils import registry
from seq2struct.utils import vocab
class Preprocessor:
def __init__(self, config):
self.config = config
self.model_preproc = regist... | true | true |
f711f559a2332a34ec9a87a53cc60ed61996b133 | 3,017 | py | Python | torchstat/compute_flops.py | tuanho27/torchstat | 46d653795a1262f0e58a2069276a69d6bd43078c | [
"MIT"
] | 2 | 2019-06-07T01:57:37.000Z | 2019-06-07T08:05:43.000Z | torchstat/compute_flops.py | tuanho27/torchstat | 46d653795a1262f0e58a2069276a69d6bd43078c | [
"MIT"
] | null | null | null | torchstat/compute_flops.py | tuanho27/torchstat | 46d653795a1262f0e58a2069276a69d6bd43078c | [
"MIT"
] | 1 | 2019-06-07T01:57:36.000Z | 2019-06-07T01:57:36.000Z | import torch.nn as nn
import torch
import numpy as np
def compute_flops(module, inp, out):
if isinstance(module, nn.Conv2d):
return compute_Conv2d_flops(module, inp, out)
elif isinstance(module, nn.BatchNorm2d):
return compute_BatchNorm2d_flops(module, inp, out)
elif isinstance(module, (nn... | 32.095745 | 82 | 0.680809 | import torch.nn as nn
import torch
import numpy as np
def compute_flops(module, inp, out):
if isinstance(module, nn.Conv2d):
return compute_Conv2d_flops(module, inp, out)
elif isinstance(module, nn.BatchNorm2d):
return compute_BatchNorm2d_flops(module, inp, out)
elif isinstance(module, (nn... | true | true |
f711f5fee479da761adf83ead77c2a53ad4bc05d | 5,161 | py | Python | problems/pctsp/salesman/pctsp/model/solution.py | fmxFranky/attention-learn-to-route | dd0d945c93f4a924244dd71edd9c1a836793adbb | [
"MIT"
] | null | null | null | problems/pctsp/salesman/pctsp/model/solution.py | fmxFranky/attention-learn-to-route | dd0d945c93f4a924244dd71edd9c1a836793adbb | [
"MIT"
] | null | null | null | problems/pctsp/salesman/pctsp/model/solution.py | fmxFranky/attention-learn-to-route | dd0d945c93f4a924244dd71edd9c1a836793adbb | [
"MIT"
] | null | null | null | # module solution.py
#
# Copyright (c) 2018 Rafael Reis
#
"""
solution module - Implements Solution, a class that describes a solution for the problem.
"""
__version__ = "1.0"
import copy
import sys
from random import shuffle
import numpy as np
def random(pctsp, start_size):
s = Solution(pctsp)
length = le... | 30.358824 | 118 | 0.552219 | __version__ = "1.0"
import copy
import sys
from random import shuffle
import numpy as np
def random(pctsp, start_size):
s = Solution(pctsp)
length = len(pctsp.prize)
for size in range(start_size, length + 1):
if size: s.size = size
i = 0
min_solutions = 30
max_s... | true | true |
f711f602844ca37221acd3cba20608b6e5285409 | 2,054 | py | Python | build/lib/DateTimeTools/WithinTimeRange.py | pshustov/DateTimeTools | e542fd3f0e3c5290faad09b7cf8a2751132d4dd3 | [
"MIT"
] | null | null | null | build/lib/DateTimeTools/WithinTimeRange.py | pshustov/DateTimeTools | e542fd3f0e3c5290faad09b7cf8a2751132d4dd3 | [
"MIT"
] | null | null | null | build/lib/DateTimeTools/WithinTimeRange.py | pshustov/DateTimeTools | e542fd3f0e3c5290faad09b7cf8a2751132d4dd3 | [
"MIT"
] | null | null | null | import numpy as np
from ._CFunctions import _CWithinTimeRange
from ._CTConv import _CTConv
def WithinTimeRange(Timet,Time0,Time1,BoolOut=False):
'''
Performs a simple check on a test time (Timet) to see if it exists
between Time0 and time1.
Inputs
======
Timet : tuple | float
Test time - either a single flo... | 24.452381 | 67 | 0.669912 | import numpy as np
from ._CFunctions import _CWithinTimeRange
from ._CTConv import _CTConv
def WithinTimeRange(Timet,Time0,Time1,BoolOut=False):
sh = np.shape(Timet)
s0 = np.size(Time0)
s1 = np.size(Time1)
if s0 == 2:
D0 = Time0[0]
T0 = Time0[1]
else:
T0 = Time0
D0 = 20000101
if s1 == 2:
D1 = Time... | true | true |
f711f63f234292724fce1b0033a7d29c8cbe758a | 1,368 | py | Python | database/word.py | YeetmeisterII/KoreanVocabularyLearner | 729bc474f261c8bac0ca6816fc9475f99c99076a | [
"MIT"
] | null | null | null | database/word.py | YeetmeisterII/KoreanVocabularyLearner | 729bc474f261c8bac0ca6816fc9475f99c99076a | [
"MIT"
] | 1 | 2020-09-11T14:25:28.000Z | 2020-09-30T15:20:21.000Z | database/word.py | YeetmeisterII/KoreanVocabularyLearner | 729bc474f261c8bac0ca6816fc9475f99c99076a | [
"MIT"
] | null | null | null | from hangul_romanize import Transliter
from hangul_romanize.rule import academic
class Word:
"""
Object representation of a word record that can update the success_rating of that record.
"""
_romanize = Transliter(academic).translit
def __init__(self, _id: int, english: str, korean: str, score: i... | 26.307692 | 93 | 0.619152 | from hangul_romanize import Transliter
from hangul_romanize.rule import academic
class Word:
_romanize = Transliter(academic).translit
def __init__(self, _id: int, english: str, korean: str, score: int):
self._id = _id
self._english = english
self._korean = korean
self._romani... | true | true |
f711f8fb4814ebc41f7d4096bb97d4bd2ddc2da1 | 3,873 | py | Python | unitTests/testScripts/TestIntegrate.py | liute62/NumCpp | d6922b2b5e1f575021b0577aea1445e041ec7180 | [
"MIT"
] | null | null | null | unitTests/testScripts/TestIntegrate.py | liute62/NumCpp | d6922b2b5e1f575021b0577aea1445e041ec7180 | [
"MIT"
] | null | null | null | unitTests/testScripts/TestIntegrate.py | liute62/NumCpp | d6922b2b5e1f575021b0577aea1445e041ec7180 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.special as sp
from termcolor import colored
import sys
if sys.platform == 'linux':
sys.path.append(r'../lib')
else:
sys.path.append(r'../build/x64/Release')
import NumCpp
####################################################################################
NUM_DECIMALS_ROUND = 1... | 39.121212 | 91 | 0.617867 | import numpy as np
import scipy.special as sp
from termcolor import colored
import sys
if sys.platform == 'linux':
sys.path.append(r'../lib')
else:
sys.path.append(r'../build/x64/Release')
import NumCpp
NUM_DECIMALS_ROUND = 1
def doTest():
print(colored('Testing Integration Module', 'magenta'))
pri... | true | true |
f711fa4ed29569e8d699dde62c2e53254fcd265a | 446 | py | Python | proxy_ip/proxy_ip/middlewares.py | easy00000000/spider | d7cad1ed11858c68d680c9a0d83e376f0c9c6a8a | [
"MIT"
] | null | null | null | proxy_ip/proxy_ip/middlewares.py | easy00000000/spider | d7cad1ed11858c68d680c9a0d83e376f0c9c6a8a | [
"MIT"
] | null | null | null | proxy_ip/proxy_ip/middlewares.py | easy00000000/spider | d7cad1ed11858c68d680c9a0d83e376f0c9c6a8a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy.conf import settings
import os
import random
class RandomUserAgentMiddleware(object):
def process_request(self, request, spider):
... | 27.875 | 63 | 0.713004 |
from scrapy.conf import settings
import os
import random
class RandomUserAgentMiddleware(object):
def process_request(self, request, spider):
ua = random.choice(settings.get('USER_AGENT_LIST'))
if ua:
request.headers.setdefault('User-Agent', ua) | true | true |
f711fb1705f29842a5e33514511c4ca7401e1291 | 1,918 | py | Python | OpenGL/GL/AMD/framebuffer_multisample_advanced.py | t20100/pyopengl | 02d11dad9ff18e50db10e975c4756e17bf198464 | [
"BSD-2-Clause",
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | OpenGL/GL/AMD/framebuffer_multisample_advanced.py | t20100/pyopengl | 02d11dad9ff18e50db10e975c4756e17bf198464 | [
"BSD-2-Clause",
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | OpenGL/GL/AMD/framebuffer_multisample_advanced.py | t20100/pyopengl | 02d11dad9ff18e50db10e975c4756e17bf198464 | [
"BSD-2-Clause",
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension AMD.framebuffer_multisample_advanced
This module customises the behaviour of the
OpenGL.raw.GL.AMD.framebuffer_multisample_advanced to provide a more
Python-friendly API
Overview (from the spec)
This extension extends ARB_framebuffer_object by allowing compromises
between image quality and m... | 41.695652 | 78 | 0.83316 | from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GL import _types, _glgets
from OpenGL.raw.GL.AMD.framebuffer_multisample_advanced import *
from OpenGL.raw.GL.AMD.framebuffer_multisample_advanced import _EXTENSION_NAME
def glInitFramebufferMultisampleAd... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.