code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Create a blockchain cache.
Creating a cache of the blockchain speeds up test execution when running
mu... | NeblioTeam/neblio | test/functional/create_cache.py | Python | mit | 826 |
# Copyright 2013 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.
"""Generates test runner factory and tests for instrumentation tests."""
import logging
import os
import test_package
import test_runner
def Setup(test_o... | hugegreenbug/libgestures | include/build/android/pylib/instrumentation/setup.py | Python | bsd-3-clause | 1,209 |
#!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at you... | amchoukir/ycmd | ycmd/tests/misc_handlers_test.py | Python | gpl-3.0 | 1,507 |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_filesize,
parse_iso8601,
)
class UMGDeIE(InfoExtractor):
IE_NAME = 'umg:de'
IE_DESC = 'Universal Music Deutschland'
_VALID_URL = r'https?://(?:www\.)?universal-mu... | vinegret/youtube-dl | youtube_dl/extractor/umg.py | Python | unlicense | 3,414 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either... | biswajitsahu/kuma | vendor/packages/translate/storage/placeables/interfaces.py | Python | mpl-2.0 | 1,302 |
"""Base and mixin classes for nearest neighbors"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Jol... | jaidevd/scikit-learn | sklearn/neighbors/base.py | Python | bsd-3-clause | 30,649 |
"""
HTMLParser-based link extractor
"""
from HTMLParser import HTMLParser
from urlparse import urljoin
from w3lib.url import safe_url_string
from scrapy.link import Link
from scrapy.utils.python import unique as unique_list
class HtmlParserLinkExtractor(HTMLParser):
def __init__(self, tag="a", attr="href", pro... | mzdaniel/oh-mainline | vendor/packages/scrapy/scrapy/contrib/linkextractors/htmlparser.py | Python | agpl-3.0 | 2,447 |
#!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import (
assertGreaterEqual,
expect_warnings,
get_params,
gettestcases,
expe... | apllicationCOM/youtube-dl-api-server | youtube_dl_server/test/test_download.py | Python | unlicense | 8,537 |
"""Models for SQLAlchemy.
This file contains the original models definitions before schema tracking was
implemented. It is used to test the schema migration logic.
"""
import json
from datetime import datetime
import logging
from sqlalchemy import (Boolean, Column, DateTime, ForeignKey, Index, Integer,
... | kyvinh/home-assistant | tests/components/recorder/models_original.py | Python | apache-2.0 | 5,545 |
"""
Django's standard crypto functions and utilities.
"""
from __future__ import unicode_literals
import hmac
import struct
import hashlib
import binascii
import time
# Use the system PRNG if possible
import random
try:
random = random.SystemRandom()
using_sysrandom = True
except NotImplementedError:
impo... | simbha/mAngE-Gin | lib/django/utils/crypto.py | Python | mit | 6,880 |
#! /usr/bin/env python
# Print digits of pi forever.
#
# The algorithm, using Python's 'long' integers ("bignums"), works
# with continued fractions, and was conceived by Lambert Meertens.
#
# See also the ABC Programmer's Handbook, by Geurts, Meertens & Pemberton,
# published by Prentice-Hall (UK) Ltd., 1990.
import... | MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Demo/scripts/pi.py | Python | gpl-2.0 | 928 |
#!/usr/bin/env python
'''Test that audio playback works.
You should hear white noise (static) for 0.5 seconds. The test will exit
immediately after.
You may want to turn down the volume of your speakers.
'''
import unittest
from pyglet import media
from pyglet.media import procedural
class TEST_... | jpaalasm/pyglet | tests/media/PLAYER_STATIC_STATIC.py | Python | bsd-3-clause | 716 |
# Copyright 2013 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.
from telemetry.core import exceptions
class InspectorRuntime(object):
def __init__(self, inspector_backend):
self._inspector_backend = inspector_backe... | 7kbird/chrome | tools/telemetry/telemetry/core/backends/chrome/inspector_runtime.py | Python | bsd-3-clause | 2,006 |
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_age_limit,
)
class BreakIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?break\.com/video/(?:[^/]+/)*.+-(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.break... | apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/breakcom.py | Python | unlicense | 1,866 |
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publis... | Eficent/sale-workflow | product_customer_code_sale/__init__.py | Python | agpl-3.0 | 880 |
# coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import re
from .common import InfoExtractor, SearchInfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urlparse,
)
from ..utils import (
clean_html,
unescapeHTML,
ExtractorError,
int_or_none,
... | Buggaarde/youtube-dl | youtube_dl/extractor/yahoo.py | Python | unlicense | 13,867 |
import os
from pelican import signals
def add_gallery_post(generator):
contentpath = generator.settings.get('PATH')
gallerycontentpath = os.path.join(contentpath,'images/gallery')
for article in generator.articles:
if 'gallery' in article.metadata.keys():
album = article.metadata.get... | ioos/system-test | pelican-plugins/gallery/gallery.py | Python | unlicense | 2,531 |
import urllib2
from HTMLParser import HTMLParser
from traceback import print_exc
from sys import stderr
class _DeHTMLParser(HTMLParser):
'''
利用HTMLParse来解析网页元素
'''
def __init__(self):
HTMLParser.__init__(self)
self.img_links = []
def handle_starttag(self, tag, attrs):
if tag == 'img':
# print(attrs)
... | luoxufeiyan/python | burness/0013/get_photos.py | Python | mit | 1,039 |
#!/usr/bin/env python
"""Basic example
Demonstrates how to create symbols and print some algebra operations.
"""
from sympy import Symbol, pprint
def main():
a = Symbol('a')
b = Symbol('b')
c = Symbol('c')
e = ( a*b*b + 2*b*a*b )**c
print('')
pprint(e)
print('')
if __name__ == "__main... | sampadsaha5/sympy | examples/beginner/basic.py | Python | bsd-3-clause | 336 |
# Copyright 2014-2015 Canonical Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | coreycb/charm-keystone | tests/charmhelpers/core/__init__.py | Python | apache-2.0 | 584 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadat... | alxgu/ansible | lib/ansible/modules/cloud/vmware/vmware_host_acceptance.py | Python | gpl-3.0 | 6,958 |
# Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | miyakz1192/neutron | neutron/tests/api/test_extra_dhcp_options.py | Python | apache-2.0 | 4,030 |
#!/usr/bin/python2.4
#
# Copyright 2011 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | boxed/CMi | web_frontend/gdata/apps/organization/client.py | Python | mit | 20,094 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | npuichigo/ttsflow | third_party/tensorflow/tensorflow/contrib/learn/python/learn/estimators/debug.py | Python | apache-2.0 | 10,942 |
class Spam(Eggs):
def spam_methods(self):
pass
class Eggs(Spam):
def spam_methods(self):
super(Eggs, self).spam_methods()
def my_methods(self):
pass
| asedunov/intellij-community | python/testData/override/circle_after.py | Python | apache-2.0 | 171 |
#!/usr/bin/python
# coding=utf-8
import datetime
import mock
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
from test import run_only
from mock import Mock
from diamond.collector import Collector
from elb import ElbCollector
def run_only_if... | venkey-ariv/fullerite | src/diamond/collectors/elb/test/testelb.py | Python | apache-2.0 | 8,323 |
#!/usr/bin/env python
from gnuradio import gr
from gnuradio import blocks
import argparse
from volk_test_funcs import *
try:
from gnuradio import blocks
except ImportError:
sys.stderr.write("This example requires gr-blocks.\n")
def multiply_const_cc(N):
k = 3.3
op = blocks.multiply_const_cc(k)
tb... | courtarro/gnuradio-wg-grc | gnuradio-runtime/examples/volk_benchmark/volk_math.py | Python | gpl-3.0 | 5,334 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
import json
import os
import sys
import environment as env
import products
imp... | shinglyu/servo | tests/wpt/harness/wptrunner/wptrunner.py | Python | mpl-2.0 | 9,731 |
import socket
try:
from select import poll, POLLIN
except ImportError: # `poll` doesn't exist on OSX and other platforms
poll = False
try:
from select import select
except ImportError: # `select` doesn't exist on AppEngine.
select = False
def is_connection_dropped(conn): # Platform-... | ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/requests/packages/urllib3/util/connection.py | Python | apache-2.0 | 3,341 |
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests import MockedResponse
from allauth.socialaccount.providers import registry
from .provider import GitHubProvider
class GitHubTests(create_oauth2_tests(registry.by_id(GitHubProvider.id))):
def get_mocked_response(self):
return Mo... | tejesh95/Zubio.in | zubio/allauth/socialaccount/providers/github/tests.py | Python | mit | 1,978 |
"""
PHP date() style date formatting
See http://www.php.net/date for format strings
Usage:
>>> import datetime
>>> d = datetime.datetime.now()
>>> df = DateFormat(d)
>>> print df.format('jS F Y H:i')
7th October 2003 11:39
>>>
"""
import re
import time
import calendar
from django.utils.dates import MONTHS, MONTHS_3, ... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.2/django/utils/dateformat.py | Python | bsd-3-clause | 8,796 |
# -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i:s'
# DA... | 912/M-new | virtualenvironment/experimental/lib/python2.7/site-packages/django/conf/locale/bg/formats.py | Python | gpl-2.0 | 772 |
#!/usr/bin/env python3
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... | hughperkins/kgsgo-dataset-preprocessor | thirdparty/future/src/future/backports/test/pystone.py | Python | mpl-2.0 | 7,427 |
"""
Unit tests for TNC optimization routine from tnc.py
"""
from numpy.testing import (assert_allclose, assert_equal, TestCase,
run_module_suite)
from scipy import optimize
import numpy as np
from math import pow
class TestTnc(TestCase):
"""TNC non-linear optimization.
These test... | valexandersaulys/airbnb_kaggle_contest | venv/lib/python3.4/site-packages/scipy/optimize/tests/test_tnc.py | Python | gpl-2.0 | 11,264 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | diogocs1/comps | web/addons/account/wizard/account_validate_account_move.py | Python | apache-2.0 | 3,203 |
"""
===============================================================
Model selection with Probabilistic PCA and Factor Analysis (FA)
===============================================================
Probabilistic PCA and Factor Analysis are probabilistic models.
The consequence is that the likelihood of new data can be u... | AnasGhrab/scikit-learn | examples/decomposition/plot_pca_vs_fa_model_selection.py | Python | bsd-3-clause | 4,467 |
from django.test import TestCase
from django.core import signing
from django.core.exceptions import SuspiciousOperation
from django.http import HttpResponse
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.formtools.wizard.storage.cookie import CookieStorage
from django.contrib.formtool... | edisonlz/fruit | web_project/base/site-packages/django/contrib/formtools/tests/wizard/test_cookiestorage.py | Python | apache-2.0 | 1,813 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | diogocs1/comps | web/openerp/report/common.py | Python | apache-2.0 | 3,337 |
from .Kernel import Kernel
from .RayKernel import RayKernel
from .FresnelKernel import FresnelKernel
__all__ = [s for s in dir() if not s.startswith('_')]
| JKrehl/Electrons | Electrons/Tomography/Kernels/__init__.py | Python | isc | 157 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Datacratic Inc. All rights reserved.
# @Author: Alexis Tremblay
# @Email: atremblay@datacratic.com
# @Date: 2015-03-06 14:53:37
# @Last Modified by: Alexis Tremblay
# @Last Modified time: 2015-04-09 16:54:58
# @File Name: qu... | datacratic/pymldb | pymldb/query.py | Python | isc | 6,753 |
# -*- coding: utf-8 -*-
import os
import tarfile
import logging
import subprocess
from pyspark import SparkFiles
"""
Name of the Conda environment to be used for the installation
"""
CONDA_ENV_NAME = None
"""
Location of the Conda environment on the driver node to be used for the installation
"""
CONDA_ENV_LOCATION ... | moutai/sparkonda | sparkonda/sparkonda_utils.py | Python | isc | 5,695 |
"""App related signal handlers."""
import redis
from django.conf import settings
from django.db.models import signals
from django.dispatch import receiver
from modoboa.admin import models as admin_models
from . import constants
def set_message_limit(instance, key):
"""Store message limit in Redis."""
old_... | modoboa/modoboa | modoboa/policyd/handlers.py | Python | isc | 1,435 |
from level import FakeChunk
import logging
from materials import pocketMaterials
from mclevelbase import ChunkNotPresent, notclosing
from nbt import TAG_List
from numpy import array, fromstring, zeros
import os
import struct
# values are usually little-endian, unlike Minecraft PC
logger = logging.getLogger(__name__)
... | Khroki/MCEdit-Unified | pymclevel/pocket.py | Python | isc | 15,372 |
#!/usr/bin/env python
from distutils.util import convert_path
from django_email_multibackend import __version__, __maintainer__, __email__
from fnmatch import fnmatchcase
import os
import sys
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
s... | tbarbugli/django_email_multibackend | setup.py | Python | isc | 4,819 |
import os
import sys
if os.environ.get("DJANGO_PRODUCTION_MODE"):
from settings.cloud import *
else:
# When not using production mode try to load local.py
try:
from settings.local import *
except ImportError:
sys.stderr.write(
"Couldn't import settings.local, have you creat... | thorgate/django-project-template | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/settings/__init__.py | Python | isc | 392 |
#!/usr/bin/env python3
# Copyright (c) 2018-2019, Ulf Magnusson
# SPDX-License-Identifier: ISC
"""
Lists all user-modifiable symbols that are not given a value in the
configuration file. Usually, these are new symbols that have been added to the
Kconfig files.
The default configuration filename is '.config'. A diffe... | ulfalizer/Kconfiglib | listnewconfig.py | Python | isc | 2,619 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Tests for chat.py
"""
def test_logged_in_successful():
"""
Test TwitchChatStream._logged_in_successful
"""
from twitchstream.chat import TwitchChatStream
res = TwitchChatStream._logged_in_successful(
":tmi.twitch.tv NOTICE * :Error logging in")... | 317070/python-twitch-stream | twitchstream/tests/test_chat.py | Python | mit | 1,392 |
# HAppy
import sys
import logging
from optparse import OptionParser
logger = logging.getLogger(__name__)
SUB_COMMANDS = [
'daemon',
'takeover',
'release',
'status',
]
def parse_args(argv):
if len(argv) > 0 and argv[0] in SUB_COMMANDS:
subcommand = argv.pop(0)
... | adregner/HAppy | happy/shell.py | Python | mit | 1,151 |
# -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class CabukcgcrawlerPipeline(object):
def process_item(self, item, spider):
return item
| codeforkaohsiung/CabuKcgCrawler | CabuKcgCrawler/pipelines.py | Python | mit | 294 |
import os
import sys
import math
import logging
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
import numpy as NP
import pandas as PD
from pyglow.pyglow import Point
from geomagio.StreamConverter import get_obs_from_geo, get_geo_from_obs
from obspy.core.stream import Stream
from obspy.core.utcdatet... | butala/pyrsss | pyrsss/mag/iaga2hdf.py | Python | mit | 10,261 |
from web.backend.utils import loadPresetsList, transition2isolver, getAddressesToRead
from graph.graph_utils import vanillaTransitions, vanillaBossesTransitions, vanillaEscapeTransitions, GraphUtils
from logic.logic import Logic
from utils.version import displayedVersion
from gluon.html import OPTGROUP
class Plando(o... | theonlydude/RandomMetroidSolver | web/backend/plando.py | Python | mit | 2,305 |
__author__ = 'akilharris'
import httplib
from bs4 import BeautifulSoup
import os
#Load http://www.nyc.gov/html/nypd/html/traffic_reports/traffic_summons_reports.shtml
#grab all pdfs and save to a folder
path = "raw_data/pdf/"
def scrape(url):
conn = httplib.HTTPConnection("www.nyc.gov")
conn.request("GET", ... | akilism/moving_violation_scraper | scraper.py | Python | mit | 1,500 |
from FWCore.ParameterSet.VarParsing import VarParsing
options =VarParsing('analysis')
options.register('config', default = '', mult = VarParsing.multiplicity.singleton, mytype = VarParsing.varType.string, info = 'Single-switch config. Values: 03Feb2017, 23Sep2016, Spring16, Summer16')
options.register('globaltag', def... | cpausmit/Kraken | pandaf/003/mc.py | Python | mit | 20,611 |
import json
import os
import time
config = {
'spool_root': None,
}
def spool_file_path(service_name, port):
if port is None:
base_name = service_name
else:
base_name = "%s:%s" % (service_name, port)
return os.path.join(config['spool_root'], base_name)
def parse_spool_file_path(path... | EvanKrall/hacheck | hacheck/spool.py | Python | mit | 5,093 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import shutil
import urllib2
from contextlib import closing
from os.path import basename
import gzip
import tarfile
# argparse for information
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--directory", help="input dire... | Twinstar2/Python_Master_scripts | data_mining/extract_all_targz_in_dir.py | Python | mit | 2,292 |
from megaera import local, json
from oauth import signed_url
from google.appengine.api import urlfetch
__TWITTER_API__ = "http://api.twitter.com/1"
def tweet(status, **credentials):
if not credentials:
# shortcut for no-credentials case
credentials = local.config_get('twitter')
if not credentials:
... | tantalor/emend | app/emend/twitter.py | Python | mit | 1,161 |
import json
import urllib2
# open the url and the screen name
# (The screen name is the screen name of the user for whom to return results for)
def get_data():
url = "http://api.twitter.com/1/statuses/user_timeline.json?screen_name=python"
# this takes a python object and dumps it to a string which is a JSON
# r... | anthonyndunguwanja/Anthony-Ndungu-bootcamp-17 | Day 3/http_client.py | Python | mit | 439 |
# import the basic python packages we need
import os
import sys
import tempfile
import pprint
import traceback
# disable python from generating a .pyc file
sys.dont_write_bytecode = True
# change me to the path of pytan if this script is not running from EXAMPLES/PYTAN_API
pytan_loc = "~/gh/pytan"
pytan_static_path =... | tanium/pytan | BUILD/doc/source/examples/export_resultset_csv_sensor_false_code.py | Python | mit | 3,040 |
#! /usr/bin/env python
# coding:utf-8
# レコードファイルがあるディレクトリ
# デフォルトではこのスクリプトファイルが存在する
# ディレクトリにある zones/ 以下に配置する
zone_dir = "testzones"
# 生成した HTML をおくディレクトリ
html_dir = "build"
# レコードに関する情報をおいているディレクトリ
record_info_dir = "testzones"
# A レコードのゾーンファイル名
a_record_filenames = [
"example.jp.zone",
]
# PTR レコードのゾーンファイル名そ... | kusm/dnschecker | config.py | Python | mit | 750 |
import ImageGrab
import os
import time
import win32api, win32con
import quickGrab
import ImageOps
from numpy import *
"""
All coordinates assume a screen resolution of 1920x1080
And window size of 1280x720
"""
## Globals
#Top left corner of game window
pad_x = 320
pad_y = 171
#Size of window
window_x = 1280
window... | doofmars/systems_nominal_bot | code.py | Python | mit | 6,584 |
VERSION_PARTS = (2, 0, 2)
__version__ = '.'.join(map(str, VERSION_PARTS))
try:
from geokey.extensions.base import register
register(
'geokey_sapelli',
'Sapelli',
display_admin=True,
superuser=False,
version=__version__
)
except BaseException:
print 'Please insta... | ExCiteS/geokey-sapelli | geokey_sapelli/__init__.py | Python | mit | 337 |
#!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... | InsuraCoinDev/insuracoin | contrib/testgen/gen_base58_test_vectors.py | Python | mit | 4,344 |
from pagarme import card
from pagarme import plan
from tests.resources import pagarme_test
from tests.resources.dictionaries import card_dictionary
from tests.resources.dictionaries import customer_dictionary
from tests.resources.dictionaries import plan_dictionary
from tests.resources.dictionaries import transaction_d... | pagarme/pagarme-python | tests/resources/dictionaries/subscription_dictionary.py | Python | mit | 1,513 |
"""Tests for the widgets of the ``django_libs`` app."""
from django.test import TestCase
from ..widgets import ColorPickerWidget
class ColorPickerWidgetTestCase(TestCase):
"""Tests for the ``ColorPickerWidget`` widget."""
longMessage = True
def setUp(self):
self.widget = ColorPickerWidget()
... | bitmazk/django-libs | django_libs/tests/widget_tests.py | Python | mit | 488 |
"""
Module where admin tools dashboard modules classes are defined.
"""
from django.utils.text import capfirst
from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django.utils.itercompat import is_iterable
... | liberation/django-admin-tools | admin_tools/dashboard/modules.py | Python | mit | 24,954 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/compute/azure-mgmt-vmwarecloudsimple/azure/mgmt/vmwarecloudsimple/aio/_vmware_cloud_simple.py | Python | mit | 7,393 |
##
# Name: David Landsman
# File name: main.py
# Description: Startup script used to setup database
##
import Login
from SQLWrapper import *
sqlWrapper = SQLWrapper()
# Create a table for students
sqlWrapper.createStudentsTable()
# Create a table for courses and fill it up with a list of courses
sqlWrapper.createCo... | S-Kantor/Time-table-creator | src/main.py | Python | mit | 395 |
from example_util import get_filename
from glc import Gif
from glc.color import Color, hsva
with Gif(get_filename(__file__)) as a:
a.set_bg_color(Color("black")).set_duration(2).set_size(300, 300)
l = a.render_list
res = 250
c = [hsva((i / res) * 360, 1, 1) for i in range(res)]
l.gradient_pie(x=a.... | leovoel/glc.py | examples/gradient.py | Python | mit | 412 |
# -*- coding: utf-8 -*-
"""
Retrieve information on system memory (RAM).
"""
import psutil
import orchard.extensions
def free() -> int:
"""
Get the amount of memory available for usage.
:return: The memory in Bytes that can be used.
"""
memory = psutil.virtual_memory()
return m... | BMeu/Orchard | orchard/system_status/system/memory.py | Python | mit | 1,413 |
# -*- coding: utf-8 -*-
r"""
Base class for single-objective Particle Swarm Optimization
implementations.
All methods here are abstract and raise a :code:`NotImplementedError`
when not used. When defining your own swarm implementation,
create another class,
>>> class MySwarm(SwarmBase):
>>> def __init__(... | ljvmiranda921/pyswarms | pyswarms/base/base_single.py | Python | mit | 7,186 |
import networkx
from yaiep.graph.Node import Node
##
# Classe che rappresenta l'intero spazio di ricerca che viene
# generato via via che il metodo di ricerca ispeziona nuovi nodi
#
class SearchGraph(networkx.DiGraph):
##
# Crea il grafo di ricerca come un grafo direzionato
# il quale ha come nodo inizial... | aleSuglia/YAIEP | yaiep/graph/SearchGraph.py | Python | mit | 1,169 |
"""Tests for the diagnostics data provided by the TP-Link integration."""
import json
from aiohttp import ClientSession
from kasa import SmartDevice
import pytest
from homeassistant.core import HomeAssistant
from . import _mocked_bulb, _mocked_plug, initialize_config_entry_for_device
from tests.common import load_f... | rohitranjan1991/home-assistant | tests/components/tplink/test_diagnostics.py | Python | mit | 1,931 |
#!/usr/bin/env python
'''
thermo_calc.py:
Calculate thermodynamic stability (minimum free energy (mfe) structures)
<Energy>
(1)miRNA seed region vs TargetRNA seed region
-------- miRNA(8nt_seed)
||||||||
-------- TargetRNA(8nt_seed)
(2)mature miRNA vs candidate target site (the same length)
-----------... | Naoto-Imamachi/MIRAGE | scripts/module/analysis/thermo_calc.py | Python | mit | 8,126 |
import sys
import traceback
import logging
from time import gmtime, strftime
from django.core.management.base import BaseCommand
from django.db import transaction
from syntacticframes.models import VerbNetClass, VerbTranslation, VerbNetMember
class Command(BaseCommand):
def handle(self, *args, **options):
... | aymara/verbenet-editor | syntacticframes_project/syntacticframes/management/commands/restriction_space.py | Python | mit | 1,671 |
import unittest
from tree import horizontal_sorter
from tree import person_node
class TestHorizontalSorter(unittest.TestCase):
def setUp(self):
self.edges = {}
@staticmethod
def only_even_numbers_in_dict(dict_to_check):
for key in dict_to_check:
if dict_to_check[key] % 2 != 0:... | sandordargo/family-tree | tests/test_horizontal_sorter.py | Python | mit | 14,566 |
#!/bin/sh /cvmfs/icecube.opensciencegrid.org/py2-v1/icetray-start
#METAPROJECT /data/user/jbourbeau/metaprojects/icerec/V05-00-00/build
import numpy as np
import time
import glob
import argparse
import os
from icecube import dataio, toprec, dataclasses, icetray, phys_services
from icecube.frame_object_diff.segments i... | jrbourbeau/composition | save_sim/save_sim.py | Python | mit | 4,424 |
#!/usr/bin/env python
import pyzfm20x
VERSION = '0.1'
| garyservin/python-zfm20x | pyzfm20x/__init__.py | Python | mit | 56 |
import _ast
import collections
from cStringIO import StringIO
import re
import sys
import os
from icbd.util import ast_utils, cfa
from icbd.type_analyzer import builtins, type_checker, type_system
from . import closure_analyzer, usage_checker, phi_analyzer
from .type_conversion import InferredTypeOutput
from .code_em... | kmod/icbd | icbd/compiler/codegen.py | Python | mit | 63,826 |
#!/usr/bin/env python
#
# Protein Engineering Analysis Tool DataBase (PEATDB)
# Copyright (C) 2010 Damien Farrell & Jens Erik Nielsen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ver... | dmnfarrell/peat | PEATDB/GUI_helper.py | Python | mit | 9,795 |
#!/usr/bin/python
# Google Spreadsheet BMP Sensor Data-logging Example
# Depends on the 'gspread' package being installed. If you have pip installed
# execute:
# sudo pip install gspread
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Permission is hereby granted, free of charge, to any person o... | dpcrook/timetemp | install/Archive/logging_sparkfun.py | Python | mit | 5,870 |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name = "nxtools",
version = "0.8.4",
author = "Martin Wacker",
author_email = "martas@imm.cz",
description = "Set of common utilities and little helpers.",
lice... | martastain/nxtools | setup.py | Python | mit | 989 |
"""
the handlers that respond to requests from browsers or clients.
Each view function is mapped to one or more request URLs.
"""
from flask import render_template, flash, redirect, session, url_for, reqeust, g
from flask.ext.login import login_user, logout_user, current_user, login_required
from app import app, db, l... | r2k0/flask-apps | mega-tut/app/views.py | Python | mit | 2,555 |
# # # # #
# wrap downscaler for running on slurm
# # # # #
def run_model( fn, base_dir, variable, mean_variable, model, scenario, units, metric, level=None, level_name=None ):
import os, subprocess
head = '#!/bin/sh\n' + \
'#SBATCH --ntasks=32\n' + \
'#SBATCH --nodes=1\n' + \
'#SBATCH --ntasks-per-node=32\... | ua-snap/downscale | snap_scripts/downscaling_v2/wrap_downscaler_cmip5_slurm_minmax.py | Python | mit | 2,344 |
def save_model_as(X, columns, model, save_model, flatten):
'''Model Saver
WHAT: Saves a trained model so it can be loaded later
for predictions by predictor().
'''
model_json = model.to_json()
with open(save_model+".json", "w") as json_file:
json_file.write(model_json)
model.save... | botlabio/autonomio | autonomio/save_model_as.py | Python | mit | 1,376 |
# NIx GeoIP Tool
# nv 1.2
# Modulo Identifier Protocol
import json
import urllib2
class Struct:
def __init__(self):
values = ''
s = Struct()
s.values = []
def geoIP(ip):
response = urllib2.urlopen('http://ip-api.com/json/'+ip)
dt = response.read()
dt_all = json.loads(dt)
#SET GEO IP-------------------------... | lamecksf/nix | mIP.py | Python | mit | 2,035 |
# coding=utf-8
"""Descending gauged inserter.
.. moduleauthor:: Stéphane Vialette <vialette@gmail.com>
"""
from .gaugedinserter import GaugedInserter
class DescendingGaugedInserter(GaugedInserter):
def __init__(self, storage_system):
"""Initialize this descending gauged inserter with a stroage syste... | vialette/ultrastorage | ultrastorage/inserter/descendinggaugedinserter.py | Python | mit | 413 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
import os
def getRandomTime(sleepTime):
def wrapper():
return sleepTime * random.random()
return wrapper
class MisUtils(object):
"""
管理配置的类
"""
refreshSleep = getRandomTime(10) # 刷新的间隔时间
wechatPushSleep = getRandomTime(1... | cycoe/class_robber | modules/MisUtils.py | Python | mit | 3,375 |
import pytest
from mitmproxy.test import taddons
from mitmproxy.test import tflow
from mitmproxy import io
from mitmproxy import exceptions
from mitmproxy import options
from mitmproxy.addons import streamfile
def test_configure(tmpdir):
sa = streamfile.StreamFile()
with taddons.context(options=options.Opti... | xaxa89/mitmproxy | test/mitmproxy/addons/test_streamfile.py | Python | mit | 1,682 |
class Power:
def __init__(self, base, exponent):
self.base = base
self.exponent = exponent
def addexponent(self):
self.exponent += 1
def getTotal(self):
return self.base**self.exponent
def getBase(self):
return self.base
def getexponent(self):
return s... | chrisjluc/ProjectEuler | Power.py | Python | mit | 409 |
# coding: utf-8
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = (
'tests.myapp',
'test_without_migrations',
'django_nose'
)
SITE_ID=1,
SECRET_KEY='secret'
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddl... | henriquebastos/django-test-without-migrations | tests/nose_settings.py | Python | mit | 509 |
from flask import (flash,
redirect,
render_template,
request,
url_for)
from flask.ext.login import (current_user,
fresh_login_required)
from breezeminder.app import app
from breezeminder.forms.reminder import Remin... | shaunduncan/breezeminder | breezeminder/views/reminder.py | Python | mit | 5,296 |
""" Helpers to allow vncdotool to be intergrated into other applications.
This feature is under developemental, you're help testing and
debugging is appreciated.
"""
import threading
try:
import queue
except ImportError:
import Queue as queue
import logging
from twisted.internet import reactor
from twisted.i... | jamtwister/vncdotool | vncdotool/api.py | Python | mit | 3,674 |
"""Mock module for Sphinx autodoc."""
class FFI(object):
NULL = NotImplemented
I_AM_FAKE = True # This is used for the documentation of "default"
def cdef(self, _):
pass
def dlopen(self, _):
return FakeLibrary()
class FakeLibrary(object):
# from portaudio.h:
paFloat32 =... | dholl/python-sounddevice | doc/fake_cffi.py | Python | mit | 636 |
__all__ = ['dbload', 'parsers', 'exporters']
| sirrice/dbtruck | dbtruck/__init__.py | Python | mit | 46 |
from typing import Type, TypeVar, MutableMapping, Any, Iterable
from datapipelines import DataSource, DataSink, PipelineContext, Query, validate_query
from cassiopeia.data import Platform, Region
from cassiopeia.dto.status import ShardStatusDto
from cassiopeia.datastores.uniquekeys import convert_region_to_platform
f... | meraki-analytics/cassiopeia-datastores | cassiopeia-diskstore/cassiopeia_diskstore/status.py | Python | mit | 1,801 |
# (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2019
import os
import sys
import time
import threading
if 'GEVENT_TEST' not in os.environ and 'CASSANDRA_TEST' not in os.environ and sys.version_info >= (3, 5, 3):
# Background RPC application
#
# Spawn the background RPC app that the tests will ... | instana/python-sensor | tests/apps/grpc_server/__init__.py | Python | mit | 709 |
"""
Development specific settings for troupon project.
"""
from .base import *
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'troupon',
'USER': os.getenv('DB_USER'),
... | andela/troupon | troupon/troupon/settings/development.py | Python | mit | 420 |
import django.dispatch
task_generate_pre_save = django.dispatch.Signal(providing_args=["task"])
| fab13n/caracole | floreal/signals/__init__.py | Python | mit | 97 |
import logging
import time
import hashlib
import binascii
import aiohttp
import ecdsa
from torba.client.hash import sha256
from lbry.wallet.transaction import Output
log = logging.getLogger(__name__)
def get_encoded_signature(signature):
signature = signature.encode() if type(signature) is str else signature
... | lbryio/lbry | lbry/lbry/extras/daemon/comment_client.py | Python | mit | 1,961 |
cancelItem = {}
| softlayer/softlayer-cinder-driver | slos/test/fixtures/Billing_Item.py | Python | mit | 16 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.