code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
#!/usr/bin/env python
# coding: utf-8
# Sublist3r v1.0
# By Ahmed Aboul-Ela - twitter.com/aboul3la
# modules in standard library
import re
import sys
import os
import argparse
import time
import hashlib
import random
import multiprocessing
import threading
import socket
import json
from collections import Counter
# e... | Yukinoshita47/Yuki-Chan-The-Auto-Pentest | Module/sublist3r/sublist3r.py | Python | mit | 35,832 |
import re
from waliki.signals import page_saved
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from waliki.models import Page
from django.utils.translation import ugettext_lazy as _
from django.utils.text import get_text_list
try:
from waliki.attachments.models im... | RobertoMaurizzi/waliki | waliki/management/commands/moin_migration_cleanup.py | Python | bsd-3-clause | 6,418 |
import hypertrack
hypertrack.secret_key = 'c237rtyfeo9893u2t4ghoevslsd'
customer = hypertrack.Customer.create(
name='John Doe',
email='john@customer.com',
phone='+15555555555',
)
print(customer)
| hypertrack/hypertrack-python | example.py | Python | mit | 211 |
#!/usr/bin/env python
#########################################################################
# Reinforcement Learning with PGPE on the Acrobot Environment
#
# The Acrobot Environment is a 1 DoF system.
# The goal is to swing up the pole and balance it.
# The motor is underpowered so that the pole can not go directl... | affordablewindurbines/jarvisproject | pybrain/examples/rl/environments/ode/acrobot_pgpe.py | Python | gpl-3.0 | 2,788 |
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2016 Jonathan Labéjof <jonathan.labejof@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation fi... | b3j0f/requester | b3j0f/requester/request/crud/read.py | Python | mit | 8,583 |
import logging
from datetime import datetime
from email.message import EmailMessage
from smtplib import SMTP_SSL, SMTPException
__author__ = 'Miel Donkers <miel.donkers@gmail.com>'
log = logging.getLogger(__name__)
class Mailer:
def __init__(self, mail_backoff_timeout_in_sec, smtp_address, smtp_user, smtp_pass... | mdonkers/AlarmListener | alarmlistener/mailer.py | Python | mit | 1,928 |
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = "Tsartsaris Sotiris"
__copyright__ = "Copyright 2014, The TSP Project"
__credits__ = ["Tsartsaris Sotiris"]
__license__ = "APACHE 2.0"
__version__ = "1.0.1"
__maintainer__ = "Tsartsaris Sotiris"
__email__ = "info@tsartsaris.gr"
__status__ = "Development"
""... | tsartsaris/TSP | tsp_ga.py | Python | apache-2.0 | 17,995 |
#!/usr/bin/env python
# encoding: utf8
from setuptools import setup
setup(
name="SmallScrewdriver",
version="1.0.2",
packages=['SmallScrewdriver', 'ScreamingMercury'],
scripts=['ScreamingMercury.py', 'SundaysIron.py'],
install_requires=['PySide>=1.2.1',
'SillyCrossbow>=1.0.8']... | Ingener74/Small-Screwdriver | setup.py | Python | lgpl-3.0 | 1,340 |
'''
Created on Jun 14, 2011
@author: lebleu1
'''
import unittest
from sccp.messagefactory import MessageFactory
from sccp.sccpregisterack import SCCPRegisterAck
from sccp.sccpcapabilitiesreq import SCCPCapabilitiesReq
from sccp.sccpkeepaliveack import SCCPKeepAliveAck
from sccp.sccpdefinetimedate import SCCPDefineTime... | mwicat/sccp | sccp/tests/test_messsagefactory.py | Python | gpl-3.0 | 2,059 |
#!/usr/bin/env python
# coding=utf-8
"""
Created on April 15 2017
@author: yytang
"""
from scrapy import Selector
from libs.misc import get_spider_name_from_domain
from libs.polish import *
from novelsCrawler.spiders.novelSpider import NovelSpider
class YushuwuNetMobileSpider(NovelSpider):
"""
classdocs
... | yytang2012/novels-crawler | novelsCrawler/spiders/m-yushuwu-net.py | Python | mit | 7,055 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-19 20:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('suite', '0002_auto_20170219_0729'),
]
operations = [
migrations.AlterField(... | fsxfreak/club-suite | clubsuite/suite/migrations/0003_auto_20170219_2009.py | Python | mit | 452 |
#!/usr/bin/python
import logging as log
import tornado.ioloop
import tornado.web
from WebService import WebService
log.basicConfig(filename='mms2.log',level=log.DEBUG)
handler_urls = WebService.loadHandlers('.')
application = tornado.web.Application(handler_urls)
if __name__ == "__main__":
application.listen(8... | OpenFilter/MediaManagerService | MMS.py | Python | gpl-2.0 | 370 |
"""
Base class for ensemble-based estimators.
"""
# Authors: Gilles Louppe
# License: BSD 3 clause
import numpy as np
from ..base import clone
from ..base import BaseEstimator
from ..base import MetaEstimatorMixin
from ..externals.joblib import cpu_count
class BaseEnsemble(BaseEstimator, MetaEstimatorMixin):
"... | Tong-Chen/scikit-learn | sklearn/ensemble/base.py | Python | bsd-3-clause | 3,513 |
# -*- encoding: utf-8 -*-
# Module iasobel
def iasobel(f):
import numpy as np
from ia636 import iaimginfo, iapconv
wx = np.array([[1.,2.,1.],
[0.,0.,0.],
[-1.,-2.,-1.]])
wy = np.array([[1.,0.,-1.],
[2.,0.,-2.],
[1.,0.,-1.]])
... | robertoalotufo/ia636 | ia636/iasobel.py | Python | bsd-3-clause | 448 |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetParticipant
# Retrieves details for an individual participant of a conference.
#
# Python version 2.6
#
###############################################################################
from temboo.core.choreo... | egetzel/wecrow | truehand2014/temboo/Library/Twilio/Conferences/GetParticipant.py | Python | apache-2.0 | 3,809 |
import os
import re
import nltk
from nltk.tag import tnt
from modules import cleaner
class Location:
def __init__(self):
train_data = []
with open(os.path.join(os.path.dirname(__file__), 'tagged_locations.txt'), 'r') as f:
for line in f:
train_data.append([nltk.tag.st... | dwiajik/twit-macet-mining-v2 | modules/location.py | Python | mit | 1,393 |
# -*- encoding: utf-8 -*-
"""
django-thumbs by Antonio Melé
http://django.es
"""
from django.db.models import ImageField
from django.db.models.fields.files import ImageFieldFile
from PIL import Image
from django.core.files.base import ContentFile
import cStringIO
def generate_thumb(img, thumb_size, format):
"""
... | CARocha/asocam | thumbs_logo.py | Python | gpl-2.0 | 6,072 |
# authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip('\n') for x in keys]
# Connect
api = twitter.Api(consumer_key = keys[0],
... | dankolbman/MarketCents | twitter_feed.py | Python | mit | 920 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import sys
from spack import *
class Vtk(CMakePackage):
"""The Visualization Toolkit (VTK) is an open-sou... | rspavel/spack | var/spack/repos/builtin/packages/vtk/package.py | Python | lgpl-2.1 | 12,385 |
class Base(object):
def __init__(self, client, host):
super(Base, self).__init__()
self._client = client
self._host = host
| xuru/pyvisdk | pyvisdk/esxcli/base/__init__.py | Python | mit | 151 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './flowchart/FlowchartTemplate.ui'
#
# Created: Sun Feb 24 19:47:30 2013
# by: pyside-uic 0.2.13 running on PySide 1.1.1
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_Form(object):
... | ibressler/pyqtgraph | pyqtgraph/flowchart/FlowchartTemplate_pyside.py | Python | mit | 2,393 |
#!/usr/bin/python
#
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | xarses/fuel-library | files/fuel-ha-utils/tools/rabbitmq-dump-clean.py | Python | apache-2.0 | 1,705 |
#!/usr/bin/env python3
import cgi
form = cgi.FieldStorage()
print('Content-type: text/html\n')
print('<title>Reply Page</title>')
if not 'user' in form:
print('<h1>Who are you?</h1>')
else:
print('<h1>Hello <i>%s</i>!</h1>' % cgi.escape(form['user'].value))
| lichengshuang/createvhost | python/others/Preview/cgi-bin/cgi101.py | Python | apache-2.0 | 266 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | nathanielvarona/airflow | airflow/migrations/versions/64a7d6477aae_fix_description_field_in_connection_to_.py | Python | apache-2.0 | 2,586 |
"""Treadmill identity trace CLI."""
import logging
import sys
import os
import glob
import tempfile
import click
from treadmill import cli
from treadmill import context
from treadmill.websocket import client as ws_client
_LOGGER = logging.getLogger(__name__)
def init():
"""Return top level command handler.""... | keithhendry/treadmill | treadmill/sproc/host_ring.py | Python | apache-2.0 | 3,490 |
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import os
from hashlib import md5
from fractions import Fraction
mpl.rcParams["text.usetex"] = True
mpl.rcParams["text.latex.preamble"] = "\usepackage{bm}"
def read_hash(path):
if not os.path.isfile(path):
return ""
with open(... | kingfisher1337/tns | qpotts_groundstate_1d/plot.py | Python | gpl-3.0 | 12,349 |
# -----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
# -----------------------------------------------------------------... | ericmjl/bokeh | release/__main__.py | Python | bsd-3-clause | 398 |
from __future__ import absolute_import
from django.db.models import Q
from rest_framework import serializers, status
from rest_framework.response import Response
from sentry import roles
from sentry.api.bases.organization import OrganizationEndpoint, OrganizationPermission
from sentry.api.exceptions import ResourceDo... | beeftornado/sentry | src/sentry/api/endpoints/organization_member_team_details.py | Python | bsd-3-clause | 6,954 |
from scoring_engine.celery_app import celery_app
from celery.exceptions import SoftTimeLimitExceeded
import subprocess
from scoring_engine.logger import logger
@celery_app.task(name='execute_command', acks_late=True, reject_on_worker_lost=True, soft_time_limit=30)
def execute_command(job):
output = ""
# Disa... | pwnbus/scoring_engine | scoring_engine/engine/execute_command.py | Python | mit | 836 |
# -*- coding: utf-8 -*-
{
'name': 'test-field-converter',
'version': '0.1',
'category': 'Tests',
'description': """Tests of field conversions""",
'author': 'OpenERP SA',
'maintainer': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': ['ir.model.access.cs... | diogocs1/comps | web/openerp/addons/test_converter/__openerp__.py | Python | apache-2.0 | 445 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | jvrsantacruz/XlsxWriter | xlsxwriter/test/comparison/test_chart_pie04.py | Python | bsd-2-clause | 1,427 |
# -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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; eith... | Ictp/indico | indico/MaKaC/plugins/RoomBooking/CERN/dalManagerCERN.py | Python | gpl-3.0 | 960 |
# this is like your scripts with argv
def print_two(*args):
arg1, arg2 = args
print "arg1: %r, arg2: %r" % (arg1, arg2)
# ok that *args is actually pointerless, we can just do this
def print_two_again(arg1, arg2):
print "arg1: %r, arg2: %r" % (arg1, arg2)
# this just takes one argument
def print_one(arg1)... | jgavinray/LPTHW | ex18.py | Python | mit | 515 |
##########################################################################
#
# Copyright (c) 2007, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistribu... | appleseedhq/cortex | test/IECore/Struct.py | Python | bsd-3-clause | 2,048 |
# Copyright (C) 2011-2012 Canonical Services Ltd
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... | wikimedia/operations-debs-txstatsd | txstatsd/stats/ewma.py | Python | mit | 3,210 |
# Copyright 2016 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... | hfp/tensorflow-xsmm | tensorflow/contrib/lookup/lookup_ops_test.py | Python | apache-2.0 | 106,863 |
# -*- coding: utf-8 -*-
"""djangoflash.models test cases.
"""
from unittest import TestCase
from djangoflash.models import FlashScope, _SESSION_KEY, _USED_KEY
class FlashScopeTestCase(TestCase):
"""Tests the FlashScope object.
"""
def setUp(self):
"""Create a FlashScope object to be used by the... | danielfm/django-flash | src/djangoflash/tests/models.py | Python | bsd-3-clause | 15,008 |
from django.http import HttpResponse
from django.urls import reverse
from django.utils.decorators import decorator_from_middleware
from django.test import (
TestCase,
RequestFactory,
modify_settings,
override_settings,
)
from headers.middleware import (
MultipleProxyMiddleware,
ViaHeaderMiddlewa... | alphageek-xyz/site | tests/test_middleware.py | Python | bsd-3-clause | 1,350 |
# module pyparsing.py
#
# Copyright (c) 2003-2013 Paul T. McGuire
#
# 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, cop... | Sir-Fancy/AlgArt | libalgart/libpyparsing/pyparsing.py | Python | artistic-2.0 | 153,727 |
def func_good(
a = 3,
b = 2):
pass
def func_bad(
a = 3,
b = 2
):
pass
| zedlander/flake8-commas | test/data/multiline_bad_function_def.py | Python | mit | 116 |
# -*- 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... | jmesteve/saas3 | openerp/addons/mrp/wizard/mrp_product_produce.py | Python | agpl-3.0 | 3,258 |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | goddardl/gaffer | python/GafferImageUI/ChannelMaskPlugValueWidget.py | Python | bsd-3-clause | 6,424 |
"""
functionality for finding inverse foreign key relations in model classes
"""
try:
from django.contrib.contenttypes.fields import ReverseGenericRelatedObjectsDescriptor
except ImportError:
from django.contrib.contenttypes.generic import ReverseGenericRelatedObjectsDescriptor
from django.db.models.base impor... | raagin/django-easymode | easymode/tree/introspection.py | Python | gpl-3.0 | 2,442 |
# -*- coding: utf-8 -*-
import json
import unittest
from preprocessings.ja.cleaning import clean_html_tags, clean_html_and_js_tags, clean_code, clean_url
class TestCleaning(unittest.TestCase):
def setUp(self):
self.html_text = open('data/test.html').read()
def test_clean_html_tag(self):
cle... | Hironsan/natural-language-preprocessings | tests/ja/cleaning.py | Python | mit | 1,204 |
# -*- coding: utf-8 -*-
#
# Rackspace Developer Documentation documentation build configuration file,
# created by sphinx-quickstart on Thu Mar 6 14:14:55 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
#... | RobinJoe/Docs | doc/conf.py | Python | gpl-3.0 | 8,757 |
import logging
from collections import Counter
from copy import copy
from pathlib import Path
from typing import Iterable, NamedTuple, Union
from fs import path as fspath
from fs.base import FS
from fs.errors import NoSysPath
from fs.walk import Walker
from rich.console import Console
from . import config, console
fr... | tfeldmann/organize | organize/core.py | Python | mit | 9,998 |
from pycp2k.inputsection import InputSection
class _spawned_hills_invdt1(InputSection):
def __init__(self):
InputSection.__init__(self)
self.Default_keyword = []
self._name = "SPAWNED_HILLS_INVDT"
self._repeated_default_keywords = {'Default_keyword': 'DEFAULT_KEYWORD'}
self... | SINGROUP/pycp2k | pycp2k/classes/_spawned_hills_invdt1.py | Python | lgpl-3.0 | 356 |
# -*- coding: utf-8 -*-
from django.conf.urls import url, patterns
urlpatterns = patterns(
'tcms.testplans.views',
url(r'^$', 'all'),
url(r'^new/$', 'new'),
url(r'^ajax/$', 'ajax_search'),
url(r'^treeview/$', 'tree_view'),
url(r'^clone/$', 'clone'),
url(r'^printable/$', 'printable'),
u... | MrSenko/Nitrate | tcms/testplans/urls/plans_urls.py | Python | gpl-2.0 | 389 |
#!/usr/bin/env python
#
# Copyright 2011 Authors of PyTask.
#
# This file is part of PyTask.
#
# PyTask is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your opt... | madhusudancs/pytask | pytask/settings.py | Python | agpl-3.0 | 4,774 |
from marathon.models.app import MarathonApp
import unittest
class MarathonAppTest(unittest.TestCase):
def test_env_defaults_to_empty_dict(self):
"""
é testé
"""
app = MarathonApp()
self.assertEquals(app.env, {})
def test_add_env_empty_dict(self):
app = Maratho... | thefactory/marathon-python | tests/test_model_app.py | Python | mit | 698 |
from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from Components.SystemInfo import SystemInfo
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry, config, ConfigBoolean
from Components.ActionMap import ActionMap
from Components.Button import B... | SIFTeam/enigma2 | lib/python/SIFTeam/Preferences.py | Python | gpl-2.0 | 1,786 |
# Copyright 2020 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... | freedomtan/tensorflow | tensorflow/python/keras/layers/preprocessing/discretization_test.py | Python | apache-2.0 | 9,949 |
"""Machine limits for Float32 and Float64 and (long double) if available...
"""
__all__ = ['finfo', 'iinfo']
import warnings
from .machar import MachAr
from .overrides import set_module
from . import numeric
from . import numerictypes as ntypes
from .numeric import array, inf
from .umath import log10, exp2
from . im... | WarrenWeckesser/numpy | numpy/core/getlimits.py | Python | bsd-3-clause | 19,076 |
import pdb,sys
from threading import Thread
from django.contrib import messages
from django.shortcuts import render
#from django.template import RequestContext
from django.utils.translation import ugettext as _
from django.views.generic import TemplateView
from django.views.generic.base import View
# Create your view... | nirvaris/nirvaris-contactform | contactform/views.py | Python | mit | 2,389 |
u={"1":"1","2":"2"}
u=u.get("1")
g=u["1"]
print(g)
print(u) | xiaoyongaa/ALL | 网络编程第四周/11.py | Python | apache-2.0 | 60 |
'''Python 3 串列資料(List)的應用
1. 了解何謂串列資料 (List)
[1, 2, 3] 以中括號圈起, 逗點隔開的群組資料, 就是串列資料
[1, 2, 3, "資料"] 也是串列資料
若 變數 = [1, 2, 3] 則 變數[0] = 1, 變數[1] = 2,
表示串列的序號由 0 開始
串列資料的次序可以重新排列, 也可以排序.
>>> sorted([3, 1, 2])
[1, 2, 3]
也可以反向排序
>>> sorted([3, 1, 2], reverse=True)
[3, 2, 1]
有關串列 (List) 的用法, 請參照 python3教材_2.pdf,
第 4 頁~第 ... | 2014c2g5/2014cadp | wsgi/local_data/brython_programs/sorted1.py | Python | gpl-3.0 | 2,520 |
from django.utils.encoding import smart_str
try:
from django.utils.encoding import force_text as force_unicode
except ImportError:
from django.utils.encoding import force_unicode
try:
from django.utils.encoding import smart_text as smart_unicode
except ImportError:
try:
from django.utils.encodin... | asm-products/movie-database-service | mongoadmin/util.py | Python | agpl-3.0 | 3,673 |
__author__ = 'Luke'
| lukeroge/multithreaded_uuid_converter | util/__init__.py | Python | cc0-1.0 | 20 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-09-27 21:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('forum', '0013_board_locked'),
]
operations = [
# Removed to prevent crashing... | WarwickAnimeSoc/aniMango | forum/migrations/0014_auto_20180927_2204.py | Python | mit | 670 |
# Copyright (c) 2011 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 ... | JioCloud/cinder | cinder/tests/unit/api/contrib/test_hosts.py | Python | apache-2.0 | 8,038 |
DATASET_DIR = './voxceleb'
AUDIO_DIR = './voxceleb/voxceleb1_wav'
NUM_PREVIOUS_FRAME = 9
#NUM_PREVIOUS_FRAME = 13
NUM_NEXT_FRAME = 23
NUM_FRAMES = NUM_PREVIOUS_FRAME + NUM_NEXT_FRAME
USE_LOGSCALE = True
USE_DELTA = False
USE_SCALE = False
SAMPLE_RATE = 16000
TRUNCATE_SOUND_FIRST_SECONDS = 0.5
FILTER_BANK = 64
| qqueing/DeepSpeaker-pytorch | constants.py | Python | mit | 316 |
#!/usr/bin/python
# Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script runs the LLVM regression tests and the LLVM testsuite.
These tests are tightly coupled to the LLVM build, and re... | cvsuser-chromium/native_client | pnacl/scripts/llvm-test.py | Python | bsd-3-clause | 17,712 |
"""Support for Xiaomi curtain."""
import logging
from homeassistant.components.cover import ATTR_POSITION, CoverDevice
from . import PY_XIAOMI_GATEWAY, XiaomiDevice
_LOGGER = logging.getLogger(__name__)
ATTR_CURTAIN_LEVEL = "curtain_level"
DATA_KEY_PROTO_V1 = "status"
DATA_KEY_PROTO_V2 = "curtain_status"
def set... | fbradyirl/home-assistant | homeassistant/components/xiaomi_aqara/cover.py | Python | apache-2.0 | 2,535 |
#!/usr/bin/env python
from setuptools import setup
entry_points = {'console_scripts': [
'vst-pawplot = surveytools.quicklook:vst_pawplot_main',
'vphas-quicklook = surveytools.quicklook:vphas_quicklook_main',
'vphas-filenames = surveytools.footprint:vphas_filenames_main',
'vphas-offset-catalogue = surve... | barentsen/surveytools | setup.py | Python | mit | 1,016 |
# noinspection PyPackageRequirements
import wx
import gui.globalEvents as GE
import gui.mainFrame
from gui.contextMenu import ContextMenuUnconditional
from service.settings import GraphSettings
_t = wx.GetTranslation
class GraphDmgIgnoreResistsMenu(ContextMenuUnconditional):
def __init__(self):
self.m... | pyfa-org/Pyfa | gui/builtinContextMenus/graphDmgIgnoreResists.py | Python | gpl-3.0 | 972 |
import os
import sys
import unittest
from test.support import run_unittest, import_module
# Skip tests if we don't have threading.
import_module('threading')
# Skip tests if we don't have concurrent.futures.
import_module('concurrent.futures')
def suite():
tests = unittest.TestSuite()
loader = unittest.TestL... | PennartLoettring/Poettrix | rootfs/usr/lib/python3.4/test/test_asyncio/__init__.py | Python | gpl-2.0 | 793 |
# Copyright (c) 2019 Red Hat, Inc.
#
# This file is part of ARA Records Ansible.
#
# ARA 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 your option) any later v... | dmsimard/ara | ara/setup/env.py | Python | gpl-3.0 | 1,891 |
# -*- coding: utf-8 -*-
#
# Codimension - Python 3 experimental IDE
# Copyright (C) 2010-2017 Sergey Satskiy <sergey.satskiy@gmail.com>
#
# 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 v... | SergeySatskiy/codimension | setup.py | Python | gpl-3.0 | 7,612 |
# Copyright (C) 2010 Wil Mahan <wmahan+fatics@gmail.com>
#
# This file is part of FatICS.
#
# FatICS is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | ecolitan/fatics | test/test_channel.py | Python | agpl-3.0 | 14,009 |
#!/usr/bin/python2
import os
import sys
import codecs
import pyauparser
def main():
# tokenize an input string by lexer with grammar loaded
# you can know how to use lexer manually
g = pyauparser.Grammar.load_file("data/operator.egt")
lexer = pyauparser.Lexer(g)
lexer.load_file("... | veblush/PyAuParser | sample/sample-lexer.py | Python | mit | 857 |
#__docformat__ = "restructuredtext en"
# ******NOTICE***************
# optimize.py module by Travis E. Oliphant
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
# A collection of optimization algorithms. Version ... | teoliphant/scipy | scipy/optimize/optimize.py | Python | bsd-3-clause | 101,264 |
from django.core.exceptions import ValidationError
from django.core.validators import MinValueValidator, MaxValueValidator
from django.db import models
from django.utils.translation import ugettext_lazy as _
from konfera.models.abstract import FromToModel
from konfera.models.ticket import Ticket
class DiscountCode(F... | Matusf/django-konfera | konfera/models/discount_code.py | Python | mit | 1,834 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | browseinfo/odoo_saas3_nicolas | addons/crm/crm_phonecall.py | Python | agpl-3.0 | 14,811 |
#!/usr/bin/python
import os
container_name = "goji"
host_port = "8003"
cmd = "docker ps -a | grep %s"%container_name
container_exists = len(os.popen(cmd).read().split('\n')) > 1
print cmd
print "exists:", container_exists
if container_exists:
cmd = "go build && docker restart %s"%container_name
print cmd
... | mikerjacobi/goji-skeleton | go.py | Python | apache-2.0 | 547 |
# A handler to render the index.html template for the MOL AngularJS SPA
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app
import logging
import os
import random
import webapp2
if 'SERVER_SOFTWARE' in os.environ:
PROD = not os.environ['SERVER_SOFTWARE'].sta... | MapofLife/location-module | server/handlers/base.py | Python | bsd-3-clause | 1,047 |
# -*- coding: utf-8 -*-
import KBEngine
from KBEDebug import *
import d_spaces
import SpaceContext
class GameObject(KBEngine.Entity):
def __init__(self):
KBEngine.Entity.__init__(self)
def getCurrSpaceBase(self):
"""
获得当前space的entity baseMailbox
"""
spaceBase = KBEngine.globalData["space_%i... | theheros/kbengine | demo/res/scripts/cell/GameObject.py | Python | lgpl-3.0 | 1,290 |
from src.config import Config
manager_config = Config()
| wrycu/DiscordGameManager | src/run.py | Python | mit | 57 |
from sqlalchemy import Column, ForeignKey, Integer
from sqlalchemy.orm import relationship
from estimators.database import Base, DataBase, PrimaryMixin
from estimators.datasets import DataSet
from estimators.estimators import Estimator
class EvaluationMixin:
"""A list of common methods and attributes for evalua... | fridiculous/estimators | estimators/evaluations.py | Python | mit | 4,396 |
# -*- coding: utf-8 -*-
"""
lists
~~~~~
Collections based on list interface.
"""
import collections
from .base import RedisCollection
class List(RedisCollection, collections.MutableSequence):
"""Mutable **sequence** collection aiming to have the same API as the
standard sequence type, :class:`list`. See `... | burakbostancioglu/redis-collections | redis_collections/lists.py | Python | isc | 12,464 |
"""
* Experimental *
Like the map function, but can use a pool of threads.
Really easy to use threads. eg. tmap(f, alist)
If you know how to use the map function, you can use threads.
"""
__author__ = "Rene Dudfield"
__version__ = "0.3.0"
__license__ = 'Python license'
import traceback, sys
from pygame.compat i... | mark-me/Pi-Jukebox | venv/Lib/site-packages/pygame/threads/__init__.py | Python | agpl-3.0 | 8,709 |
import sys
sys.path.append('../..')
import codestudio
z = codestudio.load('s1level83')
def draw_square():
for count in range(4):
z.move_forward(100)
z.turn_right(90)
def draw_triangle():
for count in range(3):
z.move(100)
z.right(120)
draw_triangle()
z.check()
| skilstak/code-dot-org-python | solutions/stage15-artist4/s1level83.py | Python | unlicense | 305 |
import pytest
def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
r = nginxproxy.get("http://unknown.nginx-proxy.tld/port")
assert r.status_code == 503
def test_webA_is_forwarded(docker_compose, nginxproxy):
r = nginxproxy.get("http://webA.nginx-proxy.tld/port")
assert r.status_code == ... | jwilder/nginx-proxy | test/test_multiple-hosts.py | Python | mit | 562 |
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from shoop.utils import update_module_attributes
from ._context import TaxingContext
from ._line_ta... | akx/shoop | shoop/core/taxing/__init__.py | Python | agpl-3.0 | 712 |
"""
problem59.py
https://projecteuler.net/problem=59
Each character on a computer is assigned a unique code and the preferred
standard is ASCII (American Standard Code for Information Interchange). For
example, uppercase A = 65, asterisk (*) = 42, and lowercase k = 107.
A modern encryption method is to take a text f... | mjwestcott/projecteuler | python/problem59.py | Python | mit | 2,167 |
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | kailIII/geraldo | site/newsite/site-geraldo/appengine_django/models.py | Python | lgpl-3.0 | 5,908 |
__author__ = 'mpetyx'
from rdflib import Graph, ConjunctiveGraph
# import rdflib.plugin
# from django.conf import settings
import datetime
import os
# register('SQLite', Store, 'rdflib.store.SQLite', 'SQLite')
def random_file_generating():
basename = "deepGraphFile"
suffix = datetime.datetime.now().strftime(... | LinDA-tools/LindaWorkbench | linda/graphdb/dgraphdbstore.py | Python | mit | 1,595 |
#!/usr/bin/env python3
class Prepend(object):
# Add the methods of the class here
def __init__(self, some_string):
self.text = some_string
def write(self, new_string):
print(self.text + new_string)
def main():
p = Prepend("+++ ")
p.write("Hello");
if __name__ == "__main__":
main()
| mohanprasath/Course-Work | data_analysis/uh_data_analysis_with_python/hy-data-analysis-with-python-spring-2020/part02-e08_prepend/src/prepend.py | Python | gpl-3.0 | 302 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-23 11:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ja_social', '0013_auto_20161023_1015'),
]
operations = [
migrations.RenameF... | Bryconc/JA-Social | ja_social/migrations/0014_auto_20161023_1102.py | Python | mit | 633 |
#!/usr/bin/env python
# Copyright (c) 2002-2008 ActiveState Software
# Author: Trent Mick (trentm@gmail.com)
"""Quick directory changing (super-cd)
'go' is a simple command line script to simplify jumping between
directories in the shell. You can create shortcut names for commonly
used directories and invoke 'go <sho... | trentm/go-tool | setup.py | Python | mit | 1,571 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# A simple and fast sub domains brute tool for pentesters
# my[at]lijiejie.com (http://www.lijiejie.com)
import Queue
import sys
import dns.resolver
import threading
import time
import optparse
import os
from lib.consle_width import getTerminalSize
class DNSBrute(objec... | RicterZ/moescan | tools/subDomainsBrute/subDomainsBrute.py | Python | mit | 7,122 |
#!/usr/bin/env python
##############################################################################
# Addon Releng Script
#
# Prepares an addon for release.
# Depends on version numbers being in the x.y.z
##############################################################################
import time
import argparse
import... | alex-dow/xbmc | addon_release.py | Python | mit | 2,568 |
# -*- coding: utf-8 -*-
#
# Python Fedora Module documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 9 08:12:44 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that a... | fedora-infra/packagedb | docs/conf.py | Python | gpl-2.0 | 5,223 |
"""Support for Minut Point binary sensors."""
import logging
from homeassistant.components.binary_sensor import DOMAIN, BinarySensorDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import MinutPointEntity
from .const import DOMAIN as POINT_DOM... | fbradyirl/home-assistant | homeassistant/components/point/binary_sensor.py | Python | apache-2.0 | 4,219 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from github3.models import BaseComment
from github3.users import User
class IssueComment(BaseComment):
"""The :class:`IssueComment <IssueComment>` object. This structures and
handles the comments on issues specifically.
Two comment instance... | liresearchgroup/submtr | submtr/lib/github3/issues/comment.py | Python | mit | 968 |
"""rippl URL Configuration"""
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
from .registration.forms import RecaptchaRegView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^accounts/register/$', RecaptchaRegView.as_view()),
... | gnmerritt/dailyrippl | rippl/rippl/urls.py | Python | mit | 911 |
from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E07000011'
addresses_name = 'parl.2017-06-08/Version 1/Huntingdonshire Democracy_Club__08June2017.tsv'
stations_name = 'parl.2017-06-08/Version 1/Huntingdonshi... | chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/management/commands/import_huntingdonshire.py | Python | bsd-3-clause | 416 |
"""
Example: parse URLs.
"""
from peglet import *
# N.B. The grammar at
# http://www.udacity.com/view#Course/cs212/CourseRev/apr2012/Unit/207010/Nugget/152008
# uses . for '.' and this accepts any character there, right? Looks like a bug.
# Another: ftpaddress's (; ftptype) should be optional.
# Another: port: digits... | JaDogg/__py_playground | reference/peglet/examples/url.py | Python | mit | 3,221 |
from __future__ import print_function, division
import os
os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=cpu,floatX=float32"
import theano
from theano import tensor
import numpy as np
import scipy as sp
import dnntoolkit
import unittest
import h5py
import lasagne
# ===============================================... | trungnt13/dnntoolkit | tests/mnist_crosstraining.py | Python | apache-2.0 | 4,825 |
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.contrib.auth.models import Group
from .forms import (
AdminUserCreationForm,
AdminUserChangeForm
)
User = get_user_model()
def ban_users(modeladmin, ne... | kasper190/SPAforum | accounts/admin.py | Python | mit | 1,194 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sistema', '0010_deuda_sociodeuda'),
]
operations = [
migrations.AddField(
model_name='lote',
name='s... | gabrielf10/webAmpunc | sistema/migrations/0011_lote_socio.py | Python | bsd-3-clause | 448 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.