code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import platform
import glob
from .io import DxlIO, Dxl320IO, DxlError
from .error import BaseErrorHandler
from .controller import BaseDxlController
from .motor import DxlMXMotor, DxlAXRXMotor, DxlXL320Motor
from ..robot import Robot
def _get_available_ports():
""" Tries to find the available usb2serial port on ... | manon-cortial/pypot | pypot/dynamixel/__init__.py | Python | gpl-3.0 | 2,888 |
from numpy import sqrt
from pacal.standard_distr import NormalDistr, ChiSquareDistr
from pacal.distr import Distr, SumDistr, DivDistr, InvDistr
from pacal.distr import sqrt as distr_sqrt
class NoncentralTDistr(DivDistr):
def __init__(self, df = 2, mu = 0):
d1 = NormalDistr(mu, 1)
d2 = distr_sqrt(C... | ianmtaylor1/pacal | pacal/stats/noncentral_distr.py | Python | gpl-3.0 | 2,437 |
from ert.cwrap import CWrapper, BaseCClass
from ert.enkf import ENKF_LIB
from ert.util import StringList
class SummaryKeyMatcher(BaseCClass):
def __init__(self):
c_ptr = SummaryKeyMatcher.cNamespace().alloc()
super(SummaryKeyMatcher, self).__init__(c_ptr)
def addSummaryKey(self, key):
... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/enkf/summary_key_matcher.py | Python | gpl-3.0 | 1,882 |
#!/usr/bin/python
# coding: utf8
import os
import subprocess
from '{% if cookiecutter.namespace %}{{ cookiecutter.namespace }}.{{ cookiecutter.project_slug }}{% else %}{{ cookiecutter.project_slug }}{% endif %}'.commands.base import BaseCommand
from '{% if cookiecutter.namespace %}{{ cookiecutter.namespace }}.{{ cooki... | antoinedube/numeric-cookiecutter | {{cookiecutter.namespace+'.'+cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/commands/configure.py | Python | gpl-3.0 | 571 |
#!/usr/bin/env python
"""The setup and build script for the python-telegram-bot library."""
import codecs
import os
from setuptools import setup, find_packages
def requirements():
"""Build the requirements list for this project"""
requirements_list = []
with open('requirements.txt') as requirements:
... | txemagon/1984 | modules/Telegram-bot-python/setup.py | Python | gpl-3.0 | 2,168 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0003_remove_userprofile_is_check'),
]
operations = [
migrations.RemoveField(
model_name='userprofile'... | yangxianbo/jym | account/migrations/0004_auto_20160525_1032.py | Python | gpl-3.0 | 591 |
import io
import openpyxl
from django.test import (
Client, TestCase
)
from django.urls import reverse
from core.models import (
User, Batch, Section, Election, Candidate, CandidateParty,
CandidatePosition, Vote, VoterProfile, Setting, UserType
)
class ResultsExporter(TestCase):
"""
Tests the r... | seanballais/botos | tests/test_results_exporter_view.py | Python | gpl-3.0 | 18,942 |
from mercurial import cmdutil
_hgignore_content = """\
syntax: glob
*~
*.pyc
*.pyo
*.bak
cache/*
databases/*
sessions/*
errors/*
"""
def commit():
app = request.args[0]
path = apath(app, r=request)
uio = ui.ui()
uio.quiet = True
if not os.environ.get('HGUSER') and not uio.config("ui", "usernam... | henkelis/sonospy | web2py/applications/admin/controllers/mercurial.py | Python | gpl-3.0 | 1,107 |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Flood Raster Impact on
Population.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 Fou... | wonder-sk/inasafe | safe/impact_functions/inundation/flood_raster_population/metadata_definitions.py | Python | gpl-3.0 | 5,408 |
# -*- coding: utf-8 -*-
from django.shortcuts import render
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
def centres(request):
#Python练习项目管理中心Center
return render(request, 'cen... | xBoye/xHome | centres/views.py | Python | gpl-3.0 | 1,162 |
import cv2
import numpy as np
np.set_printoptions(threshold=np.nan)
import util as util
import edge_detect
import lineseg
import drawedgelist
# img = cv2.imread("img/Slide2.jpg", 0)
img = cv2.imread("unsorted/Unit Tests/lambda.png", 0)
im_size = img.shape
returnedCanny = cv2.Canny(img, 50, 150, apertureSize = 3)
cv2.... | Jordan-Zhu/RoboVision | scratch/testingColorImg.py | Python | gpl-3.0 | 2,023 |
#!/usr/bin/env python
# setup of the grid parameters
# default queue used for training
training_queue = { 'queue':'q1dm', 'memfree':'16G', 'pe_opt':'pe_mth 2', 'hvmem':'8G', 'io_big':True }
# the queue that is used solely for the final ISV training step
isv_training_queue = { 'queue':'q1wm', 'memfree':'32G', 'pe_opt... | guker/spear | config/grid/para_training_local.py | Python | gpl-3.0 | 1,092 |
#!/usr/bin/python2
# -*- coding: utf-8 -*-
# coding=utf-8
import unittest
from datetime import datetime
from lib.escala import Escala
import dirs
dirs.DEFAULT_DIR = dirs.TestDir()
class FrameTest(unittest.TestCase):
def setUp(self):
self.escala = Escala('fixtures/escala.xml')
self.dir = dirs.T... | camponez/importescala | test/test_escala.py | Python | gpl-3.0 | 3,876 |
from test_support import *
# this test calls a prover which is correctly configured but whose execution
# gives an error (here: the prover executable doesn't exist). The intent is to
# test the output of gnatprove in this specific case
prove_all(prover=["plop"], opt=["--why3-conf=test.conf"])
| ptroja/spark2014 | testsuite/gnatprove/tests/N804-036__bad_prover/test.py | Python | gpl-3.0 | 296 |
from itertools import combinations
def is_good(n):
return 1 + ((int(n) - 1) % 9) == 9
def generate_subsequences(n):
subsequences = []
combinations_list = []
index = 4
#Generate all combinations
while index > 0:
combinations_list.append(list(combinations(str(n), index)))
index... | Dawny33/Code | HackerEarth/BeCoder 2/nine.py | Python | gpl-3.0 | 882 |
#coding=utf-8
import unittest
import HTMLTestRunner
import time
from config import globalparam
from public.common import sendmail
def run():
test_dir = './testcase'
suite = unittest.defaultTestLoader.discover(start_dir=test_dir,pattern='test*.py')
now = time.strftime('%Y-%m-%d_%H_%M_%S')
reportname =... | lsp84ch83/PyText | UItestframework/run.py | Python | gpl-3.0 | 730 |
# -*- coding: utf-8 -*-
from pyload.plugin.internal.DeadCrypter import DeadCrypter
class FiredriveCom(DeadCrypter):
__name = "FiredriveCom"
__type = "crypter"
__version = "0.03"
__pattern = r'https?://(?:www\.)?(firedrive|putlocker)\.com/share/.+'
__config = [] #@TODO: Remove in 0.4.10
... | ardi69/pyload-0.4.10 | pyload/plugin/crypter/FiredriveCom.py | Python | gpl-3.0 | 474 |
import queue
import logging
import platform
import threading
import datetime as dt
import serial
import serial.threaded
import serial_device
from .or_event import OrEvent
logger = logging.getLogger(__name__)
# Flag to indicate whether queues should be polled.
# XXX Note that polling performance may vary by platfor... | wheeler-microfluidics/serial_device | serial_device/threaded.py | Python | gpl-3.0 | 9,719 |
__author__ = "Harish Narayanan"
__copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__
__license__ = "GNU GPL Version 3 or any later version"
from cbc.twist import *
from sys import argv
""" DEMO - Twisting of a hyperelastic cube """
class Twist(StaticHyperelasticity):
""" Definition... | hnarayanan/twist | demo/static/twist.py | Python | gpl-3.0 | 2,606 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# dépendances
import requests
import xml.dom.minidom
import sys
import signal
import os
import getopt
from queue import Queue
from threading import Thread
import time
class SetQueue(Queue):
def _init(self, maxsize):
Queue._init(self, maxsize)
self.a... | adalmieres/scriptsIBMConnections | IBMConnectionsSocialGraph.py | Python | gpl-3.0 | 8,111 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# pkpgcounter : a generic Page Description Language parser
#
# (c) 2003-2009 Jerome Alet <alet@librelogiciel.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 Soft... | lynxis/pkpgcounter | setup.py | Python | gpl-3.0 | 2,361 |
#!/usr/bin/env python
"""This utility script was adopted from StackExchange:
http://stackoverflow.com/questions/12090503/listing-available-com-ports-with-python
Adopted for use with arduino_GC connection project
"""
import sys
import glob
import serial
def serial_ports():
""" Lists serial port names
:ra... | Mobleyta/GasChromino | PythonCode/serial_ports.py | Python | gpl-3.0 | 1,189 |
def _setup_pkgresources():
import pkg_resources
import os
import plistlib
pl = plistlib.readPlist(os.path.join(
os.path.dirname(os.getenv('RESOURCEPATH')), "Info.plist"))
appname = pl.get('CFBundleIdentifier')
if appname is None:
appname = pl['CFBundleDisplayName']
path = os... | nCoda/macOS | .eggs/py2app-0.14-py2.7.egg/py2app/bootstrap/setup_pkgresource.py | Python | gpl-3.0 | 453 |
#!/usr/bin/env python
# sample module
from jira.client import JIRA
def main():
jira = JIRA()
JIRA(options={'server': 'http://localhost:8100'})
projects = jira.projects()
print projects
for project in projects:
print project.key
# Standard boilerplate to call the main() function.
if __nam... | selvait90/jira-automation | sample.py | Python | gpl-3.0 | 349 |
""" Class that contains client access to the transformation DB handler. """
__RCSID__ = "$Id$"
import types
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.Base.Client import Client
from DIRAC.Core.Utilities.List ... | avedaee/DIRAC | TransformationSystem/Client/TransformationClient.py | Python | gpl-3.0 | 22,189 |
from django.db import models
from django.contrib.auth.models import User
import MySQLdb
# Create your models here.
class Comentario(models.Model):
"""Comentario"""
contenido = models.TextField(help_text='Escribe un comentario')
fecha_coment = models.DateField(auto_now=True)
def __unicode__(self):
return self.c... | darciga/cf | blog/models.py | Python | gpl-3.0 | 1,127 |
import unittest
from itertools import izip
import numpy as np
from numpy import cos, sin, pi
from pele.angleaxis import RBTopology, RigidFragment, RBPotentialWrapper
from pele.potentials import LJ
from pele.angleaxis._otp_cluster import OTPCluster
from pele.thermodynamics import get_thermodynamic_information
from pel... | cjforman/pele | pele/angleaxis/tests/test_otp.py | Python | gpl-3.0 | 11,705 |
# -*- coding: utf8 -*-
SQL = """select SQL_CALC_FOUND_ROWS * FROM doc_view order by `name` asc limit %(offset)d,%(limit)d ;"""
FOUND_ROWS = True
ROOT = "doc_view_list"
ROOT_PREFIX = "<doc_view_edit />"
ROOT_POSTFIX= None
XSL_TEMPLATE = "data/af-web.xsl"
EVENT = None
WHERE = ()
PARAM = None
TITLE="Список видов документо... | ffsdmad/af-web | cgi-bin/plugins2/doc_view_list.py | Python | gpl-3.0 | 444 |
# -*- encoding: utf-8 -*-
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.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
# ... | Xprima-ERP/odoo_addons | xpr_xis_connector/res_users.py | Python | gpl-3.0 | 1,160 |
"""
Contains format specification class and methods to parse it from JSON.
.. codeauthor:: Tomas Krizek <tomas.krizek1@tul.cz>
"""
import json
import re
def get_root_input_type_from_json(data):
"""Return the root input type from JSON formatted string."""
return parse_format(json.loads(data))
def parse_form... | GeoMop/GeoMop | src/gm_base/model_data/format.py | Python | gpl-3.0 | 4,784 |
"""
Page view class
"""
import os
from Server.Importer import ImportFromModule
class PageView(ImportFromModule("Server.PageViewBase", "PageViewBase")):
"""
Page view class.
"""
_PAGE_TITLE = "Python Web Framework"
def __init__(self, htmlToLoad):
"""
Constructor.
- ht... | allembedded/python_web_framework | WebApplication/Views/PageView.py | Python | gpl-3.0 | 781 |
import discord
import asyncio
import datetime
import time
import aiohttp
import threading
import glob
import re
import json
import os
import urllib.request
from discord.ext import commands
from random import randint
from random import choice as randchoice
from random import choice as rndchoice
from random import shuffl... | IODisrupt/OmegaBot | cogs/runescapecompare.py | Python | gpl-3.0 | 2,978 |
import string
import ast
from state_machine import PSM, Source
class SpecialPattern:
individual_chars = ('t', 'n', 'v', 'f', 'r', '0')
range_chars = ('d', 'D', 'w', 'W', 's', 'S')
special_chars = ('^', '$', '[', ']', '(', ')', '{', '}', '\\', '.', '*',
'?', '+', '|', '.')
rest... | VaysseB/id_generator | src/parser.py | Python | gpl-3.0 | 15,217 |
'''WARCAT: Web ARChive (WARC) Archiving Tool
Tool and library for handling Web ARChive (WARC) files.
'''
from .version import *
| chfoo/warcat | warcat/__init__.py | Python | gpl-3.0 | 130 |
import math
from PyQt5.QtCore import Qt, pyqtSlot
from PyQt5.QtGui import QCloseEvent
from PyQt5.QtWidgets import QDialog, QInputDialog
from urh import settings
from urh.models.FuzzingTableModel import FuzzingTableModel
from urh.signalprocessing.ProtocoLabel import ProtocolLabel
from urh.signalprocessing.ProtocolAnal... | jopohl/urh | src/urh/controller/dialogs/FuzzingDialog.py | Python | gpl-3.0 | 15,833 |
import os
import unittest
from vsg.rules import iteration_scheme
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_300_test_input.vhd'))
dIndentMap = utils.read_indent_file()
lExpected = []
lExpected.ap... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/iteration_scheme/test_rule_300.py | Python | gpl-3.0 | 1,279 |
#
# LMirror is Copyright (C) 2010 Robert Collins <robertc@robertcollins.net>
#
# LMirror 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
# versio... | rbtcollins/lmirror | l_mirror/tests/test_logging_support.py | Python | gpl-3.0 | 2,180 |
# -*- coding: utf8 -*-
###########################################################################
# This is the package latexparser
#
# 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, ei... | LaurentClaessens/LaTeXparser | Occurrence.py | Python | gpl-3.0 | 7,331 |
#!/usr/bin/env python
#
# MCP320x
#
# Author: Maurik Holtrop
#
# This module interfaces with the MCP300x or MCP320x family of chips. These
# are 10-bit and 12-bit ADCs respectively. The x number indicates the number
# of multiplexed analog inputs: 2 (MCP3202), 4 (MCP3204) or 8 (MCP3208)
# Communications with this chi... | mholtrop/Phys605 | Python/DevLib/MCP320x.py | Python | gpl-3.0 | 11,971 |
# __init__.py
# Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
__version__ = '0.3.4'
| codendev/rapidwsgi | src/mako/__init__.py | Python | gpl-3.0 | 256 |
#!/usr/bin/python
import sys
print "divsum_analysis.py DivsumFile NumberOfNucleotides"
try:
file = sys.argv[1]
except:
file = raw_input("Introduce RepeatMasker's Divsum file: ")
try:
nucs = sys.argv[2]
except:
nucs = raw_input("Introduce number of analysed nucleotides: ")
nucs = int(nucs)
data = o... | fjruizruano/ngs-protocols | divsum_analysis.py | Python | gpl-3.0 | 974 |
"""
Copyright 2014 Jason Heeris, jason.heeris@gmail.com
This file is part of the dungeon excavator web interface ("webcavate").
Webcavate 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 L... | detly/webcavate | webcavate/app.py | Python | gpl-3.0 | 3,132 |
import subprocess
import time
import sys
import re
class checkIfUp:
__shellPings = []
__shell2Nbst = []
__ipsToCheck = []
checkedIps = 0
onlineIps = 0
unreachable = 0
timedOut = 0
upIpsAddress = []
computerName = []
completeMacAddress = []
executionTime = 0
... | mixedup4x4/Speedy | Contents/LanScan.py | Python | gpl-3.0 | 7,956 |
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import re
from PyQt5.QtCore import Qt, pyqtSlot
from PyQt5.QtWidgets import (
QPushButton,
QLineEdit... | arsenetar/dupeguru | qt/exclude_list_dialog.py | Python | gpl-3.0 | 7,359 |
from bottle import route, template, error, request, static_file, get, post
from index import get_index
from bmarks import get_bmarks
from tags import get_tags
from add import add_tags
from bmarklet import get_bmarklet
from account import get_account
from edit_tags import get_edit_tags
from importbm import get_import_bm... | netllama/tastipy | tastiapp.py | Python | gpl-3.0 | 2,172 |
#!/usr/bin/env python
class Message(object):
"""
Base type of a message sent through the pipeline.
Define some attributes and methods to form your message.
I suggest you don't alter this class. You're are free to do so, of course. It's your own decision.
Though, I suggest you creat... | lumannnn/pypifi | pypifi/message.py | Python | gpl-3.0 | 397 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import itertools
import json
import erpnext
import frappe
import copy
from erpnext.controllers.item_variant import (ItemVariantExistsError,
copy_attr... | shubhamgupta123/erpnext | erpnext/stock/doctype/item/item.py | Python | gpl-3.0 | 36,632 |
import unittest
import os
from ui import main
print os.getcwd()
class TestMain(unittest.TestCase):
def setUp(self):
self.m = main.MainWindow()
def test_mainWindow(self):
assert(self.m)
def test_dataframe(self):
import numpy
#Random 25x4 Numpy Matrix
self.m... | sdiehl/rpygtk | rpygtk/runtests.py | Python | gpl-3.0 | 818 |
from datetime import datetime
import factory
from zds.forum.factories import PostFactory, TopicFactory
from zds.gallery.factories import GalleryFactory, UserGalleryFactory
from zds.utils.factories import LicenceFactory, SubCategoryFactory
from zds.utils.models import Licence
from zds.tutorialv2.models.database import... | ChantyTaguan/zds-site | zds/tutorialv2/factories.py | Python | gpl-3.0 | 8,840 |
#
# -*- coding: utf-8 -*-
# Dia Group Resize Plugin
# Copyright (c) 2015, Alexandre Machado <axmachado@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 version 3 of the Licen... | axmachado/dia-group-resize | group_resize.py | Python | gpl-3.0 | 6,960 |
from ..models import Album
from ..resource import SingleResource, ListResource
from ..schemas import AlbumSchema
class SingleAlbum(SingleResource):
schema = AlbumSchema()
routes = ('/album/<int:id>/',)
model = Album
class ListAlbums(ListResource):
schema = AlbumSchema(many=True)
routes = ('/albu... | justanr/owa | owa/api/album.py | Python | gpl-3.0 | 358 |
"""
System plugin
Copyright (C) 2016 Walid Benghabrit
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 version 3 of the License, or
(at your option) any later version.
This program is distribu... | hkff/AccMon | accmon/plugins/system.py | Python | gpl-3.0 | 920 |
#!/usr/bin/env python
import turtle
import random
def bloom(radius):
turtle.colormode(255)
for rad in range(40, 10, -5):
for looper in range(360//rad):
turtle.up()
turtle.circle(radius+rad, rad)
turtle.begin_fill()
turtle.fillcolor((200+random.randint(0,... | mpclemens/python-explore | turtle/bloom.py | Python | gpl-3.0 | 728 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('characters', '0011_auto_20160212_1144'),
]
operations = [
migrations.CreateModel(
name='CharacterSpells',
... | svamp/rp_management | characters/migrations/0012_auto_20160212_1210.py | Python | gpl-3.0 | 1,712 |
#!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | mountainpenguin/BySH | server/lib/tornado/netutil.py | Python | gpl-3.0 | 15,081 |
import re
import traceback
from urllib.parse import quote
from requests.utils import dict_from_cookiejar
from sickchill import logger
from sickchill.helper.common import convert_size, try_int
from sickchill.oldbeard import tvcache
from sickchill.oldbeard.bs4_parser import BS4Parser
from sickchill.providers.torrent.To... | h3llrais3r/SickRage | sickchill/oldbeard/providers/pretome.py | Python | gpl-3.0 | 5,958 |
# -*- encoding: UTF-8 -*-
import re
import sys
import os
import traceback
from ..ibdawg import IBDAWG
from ..echo import echo
from . import gc_options
__all__ = [ "lang", "locales", "pkg", "name", "version", "author", \
"load", "parse", "getDictionary", \
"setOptions", "getOptions", "getOpti... | SamuelLongchamps/grammalecte | gc_core/py/gc_engine.py | Python | gpl-3.0 | 17,150 |
# Copyright 2019 Virgil Dupras
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-3.0.html
import datetime
from collections import defaultdict
from core.util import ... | hsoft/moneyguru | core/gui/import_window.py | Python | gpl-3.0 | 15,326 |
#!/usr/bin/env python
# coding=utf-8
"""30. Digit fifth powers
https://projecteuler.net/problem=30
Surprisingly there are only three numbers that can be written as the sum of
fourth powers of their digits:
> 1634 = 14 \+ 64 \+ 34 \+ 44
> 8208 = 84 \+ 24 \+ 04 \+ 84
> 9474 = 94 \+ 44 \+ 74 \+ 44
As 1 = 14 is n... | openqt/algorithms | projecteuler/pe030-digit-fifth-powers.py | Python | gpl-3.0 | 507 |
import sys, math
from test import goertzel
import wave
import pyaudio
import Queue
import numpy as np
if len(sys.argv) < 2:
print "Usage: %s <filename> " % sys.argv[0]
sys.exit(1)
filename = sys.argv[1]
w = wave.open(filename)
fs = w.getframerate()
width = w.getsampwidth()
chunkDuration = .2 #.2 second chunks... | jloloew/AirBridge | parse.py | Python | gpl-3.0 | 3,509 |
from controllers.job_ctrl import JobController
from models.job_model import JobModel
from views.job_view import JobView
class MainController(object):
def __init__(self, main_model):
self.main_view = None
self.main_model = main_model
self.main_model.begin_job_fetch.connect(self.on_begin_jo... | redline-forensics/auto-dm | controllers/main_ctrl.py | Python | gpl-3.0 | 2,757 |
#!/usr/bin/python
#
# Problem: Making Chess Boards
# Language: Python
# Author: KirarinSnow
# Usage: python thisfile.py <input.in >output.out
from heapq import *
def process(r1, r2, c1, c2):
for i in range(r1, r2):
for j in range(c1, c2):
if 0 <= i < m and 0 <= j < n:
if g[i]... | KirarinSnow/Google-Code-Jam | Round 1C 2010/C.py | Python | gpl-3.0 | 1,627 |
from .gaussian_process import RandomFeatureGaussianProcess, mean_field_logits
from .spectral_normalization import SpectralNormalization
| gagnonlg/explore-ml | sngp/tf_import/__init__.py | Python | gpl-3.0 | 136 |
import unittest
from test import support
import os
import io
import socket
import urllib.request
from urllib.request import Request, OpenerDirector
# XXX
# Request
# CacheFTPHandler (hard to write)
# parse_keqv_list, parse_http_list, HTTPDigestAuthHandler
class TrivialTests(unittest.TestCase):
def test_trivial(... | mancoast/CPythonPyc_test | fail/313_test_urllib2.py | Python | gpl-3.0 | 51,087 |
#!/usr/bin/env python
# File written by pyctools-editor. Do not edit.
import argparse
import logging
from pyctools.core.compound import Compound
import pyctools.components.arithmetic
import pyctools.components.qt.qtdisplay
import pyctools.components.zone.zoneplategenerator
class Network(object):
components = \
{ ... | jim-easterbrook/pyctools-demo | src/scripts/temporal_alias/stage_2.py | Python | gpl-3.0 | 2,808 |
# -*- coding: utf-8 -*-
import itertools
"""
Languages | ShortCode | Wordnet
Albanian | sq | als
Arabic | ar | arb
Bulgarian | bg | bul
Catalan | ca | cat
Chinese | zh | cmn
Chinese (... | domenicosolazzo/jroc | jroc/nlp/wordnet/WordnetManager.py | Python | gpl-3.0 | 8,043 |
#############################################################################
# $HeadURL$
#############################################################################
""" ..mod: FTSRequest
=================
Helper class to perform FTS job submission and monitoring.
"""
# # imports
import sys
import re
import... | miloszz/DIRAC | DataManagementSystem/Client/FTSRequest.py | Python | gpl-3.0 | 37,261 |
import sys, os, urllib, time, socket, mt, ssl
from dlmanager.NZB import NZBParser
from dlmanager.NZB.nntplib2 import NNTP_SSL,NNTPError,NNTP, NNTPReplyError
from dlmanager.NZB.Decoder import ArticleDecoder
class StatusReport(object):
def __init__(self):
self.message = "Downloading.."
self.total_byt... | andr3wmac/metaTower | packages/dlmanager/NZB/NZBClient.py | Python | gpl-3.0 | 10,499 |
"""Tests for `fix.with_fixture`."""
from __future__ import with_statement
import os
import shutil
import tempfile
from types import FunctionType
from fix import with_fixture
def test_exists():
"""`fix.with_fixture` function exists"""
assert isinstance(with_fixture, FunctionType)
def test_setup_only():
... | schesis/fix | tests/decorators/test_with_fixture.py | Python | gpl-3.0 | 3,536 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of the G... | espressopp/espressopp | src/integrator/CapForce.py | Python | gpl-3.0 | 2,764 |
# -*- coding: utf-8 -*-
"""proyectoP4 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.h... | jesmorc/Workinout | proyectoP4/urls.py | Python | gpl-3.0 | 1,273 |
#!/usr/bin/python
# This programs is intended to manage patches and apply them automatically
# through email in an automated fashion.
#
# Copyright (C) 2008 Imran M Yousuf (imran@smartitengineering.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Pu... | imyousuf/smart-patcher | src/smart-patcher.py | Python | gpl-3.0 | 5,526 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-02-20 22:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('erudit', '0065_auto_20170202_1152'),
]
operations = [
migrations.AddField(
... | erudit/zenon | eruditorg/erudit/migrations/0066_issue_force_free_access.py | Python | gpl-3.0 | 505 |
# Example implementing 5 layer encoder
# Original code taken from
# https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/3_NeuralNetworks/autoencoder.py
# The model trained here is restored in load.py
from __future__ import division, print_function, absolute_import
# Import MNIST data
# from tens... | LindaLS/Sausage_Biscuits | architecture/tests/2_test/train.py | Python | gpl-3.0 | 4,265 |
"""
Tests for closeness centrality.
"""
import pytest
import networkx as nx
from networkx.testing import almost_equal
class TestClosenessCentrality:
@classmethod
def setup_class(cls):
cls.K = nx.krackhardt_kite_graph()
cls.P3 = nx.path_graph(3)
cls.P4 = nx.path_graph(4)
cls.K5 ... | SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/algorithms/centrality/tests/test_closeness_centrality.py | Python | gpl-3.0 | 10,220 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'Vendeur', fields ['code_permanent']
db.create_unique(u'encefal_vendeur', ['co... | nilovna/EnceFAL | project/encefal/migrations/0003_auto__add_unique_vendeur_code_permanent.py | Python | gpl-3.0 | 8,651 |
# $Id$
# Copyright 2013 Matthew Wall
# See the file LICENSE.txt for your full rights.
#
# Thanks to Eddie De Pieri for the first Python implementation for WS-28xx.
# Eddie did the difficult work of decompiling HeavyWeather then converting
# and reverse engineering into a functional Python implementation. Eddie's
# wor... | sai9/weewx-gitsvn | bin/weewx/drivers/ws28xx.py | Python | gpl-3.0 | 174,398 |
#
# logutil.py
# A module containing means of interacting with log files.
#
import logging
import logging.handlers
import os
import time
from data_structures import enum
from config import get_config_value
LoggingSection = enum(
'CLIENT',
'CRAWLER',
'DATA',
'FRONTIER',
'TEST',
'UTILITIES',
)... | mizhgun/HTResearch | HTResearch/Utilities/logutil.py | Python | gpl-3.0 | 1,640 |
#!/usr/bin/env python
'''
Purpose:
This script, using default values, determines and plots the CpG islands in
relation to a given feature "type" (e.g. "gene" or "mRNA") from a GFF file
which corresponds to the user-provided fasta file.
Note:
CpG Islands are determined by ObEx = (Observed CpG) / (Expected CpG) ,
def... | juswilliams/bioscripts | CpG_by_feature/cpg_gene.py | Python | gpl-3.0 | 3,970 |
import numpy as np
from scipy import sparse
from scipy.interpolate import interp1d
class calibration(object):
'''
some useful tools for manual calibration
'''
def normalize_zdata(self,z_data,cal_z_data):
return z_data/cal_z_data
def normalize_amplitude(self,z_data,cal_ampdata):
return z_data/cal_ampdata
... | vdrhtc/Measurement-automation | resonator_tools/resonator_tools/calibration.py | Python | gpl-3.0 | 4,324 |
## mostly copied from: http://norvig.com/spell-correct.html
import sys, random
import re, collections, time
TXT_FILE='';
BUF_DIR='';
NWORDS=None;
def words(text): return re.findall('[a-z]+', text)
def train(features):
model = collections.defaultdict(lambda: 1)
for f in features:
model[f] += 1
r... | xulesc/spellchecker | impl1.py | Python | gpl-3.0 | 1,898 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gnagel/backtrader | backtrader/broker.py | Python | gpl-3.0 | 13,299 |
#! /usr/bin/env python
import logging, logtool
from .page import Page
from .xlate_frame import XlateFrame
LOG = logging.getLogger (__name__)
class Contents:
@logtool.log_call
def __init__ (self, canvas, objects):
self.canvas = canvas
self.objects = objects
@logtool.log_call
def render (self):
w... | clearclaw/xxpaper | xxpaper/contents.py | Python | gpl-3.0 | 590 |
# -*- coding: utf-8 -*-
import logging
from pprint import pformat
from time import clock, sleep
try:
import unittest2 as unittest
except ImportError:
import unittest
import config
from event_stack import TimeOutReached
from database_reception import Database_Reception
from static_ag... | AdaHeads/Coverage_Tests | disabled_tests/incoming_calls.py | Python | gpl-3.0 | 9,794 |
# Topydo - A todo.txt client written in Python.
# Copyright (C) 2014 - 2015 Bram Schoenmakers <bram@topydo.org>
#
# 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 version 3 of the License,... | bram85/topydo | topydo/lib/Todo.py | Python | gpl-3.0 | 3,165 |
from pupa.scrape import Jurisdiction, Organization
from .bills import MNBillScraper
from .committees import MNCommitteeScraper
from .people import MNPersonScraper
from .vote_events import MNVoteScraper
from .events import MNEventScraper
from .common import url_xpath
"""
Minnesota legislative data can be found at the O... | cliftonmcintosh/openstates | openstates/mn/__init__.py | Python | gpl-3.0 | 5,612 |
'''
Copyright 2015
This file is part of Orbach.
Orbach 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 version.
Orbach is distributed in the hope t... | awood/orbach | orbach/core/urls.py | Python | gpl-3.0 | 1,005 |
import kivy
kivy.require('1.9.1')
from kivy.uix.popup import Popup
from kivy.uix.label import Label
from kivy.uix.gridlayout import GridLayout
from kivy.metrics import dp
from kivy.app import Builder
from kivy.properties import StringProperty, ObjectProperty
from kivy.clock import Clock
from kivy.metrics import sp
from... | ddimensia/RaceCapture_App | autosportlabs/racecapture/views/util/alertview.py | Python | gpl-3.0 | 3,843 |
class CheckBase(object):
"""
Base class for checks.
"""
hooks = []
# pylint: disable=W0105
"""Git hooks to which this class applies. A list of strings."""
def execute(self, hook):
"""
Executes the check.
:param hook: The name of the hook being run.
:type ... | lddubeau/glerbl | glerbl/check/__init__.py | Python | gpl-3.0 | 461 |
#!/usr/bin/python3
### rev: 5.0
### author: <zhq>
### features:
### errors included
### up to 63 bases (2 to 64)
### caps recognition and same output format (deprecated)
### for the function parameters, `cur` represents the current (input) base, `res` represents the result (output) base, and `num` represen... | Irides-Chromium/cipher | scale_strict.py | Python | gpl-3.0 | 1,750 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'events.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from collections import *
from functools import *
import os, glob
import pandas a... | vince8290/dana | ui_files/samples.py | Python | gpl-3.0 | 11,728 |
from cProfile import Profile
from optparse import make_option
from django.conf import settings
from django.core.management.base import (BaseCommand,
CommandError)
from treeherder.etl.buildapi import (Builds4hJobsProcess,
PendingJobsProcess,... | adusca/treeherder | treeherder/etl/management/commands/ingest_push.py | Python | mpl-2.0 | 3,195 |
#
# This is the configuration file for the RPi environd
#
### Presentation - General
# All datetime stamps use typical strftime codes: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior
# The date/time stamp of the last (most current) reading.
present_lastread_stamp = "%I:%M %p on %A, %b %d"
... | modalexii/RPi-Environd | config.py | Python | mpl-2.0 | 2,371 |
# coding=utf-8
''' tagsPlorer package entry point (C) 2021-2021 Arne Bachmann https://github.com/ArneBachmann/tagsplorer '''
from tagsplorer import tp
tp.Main().parse_and_run() | ArneBachmann/tagsplorer | tagsplorer/__main__.py | Python | mpl-2.0 | 183 |
# 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 socorro.lib import datetimeutil
from socorro.unittest.external.es.base import (
ElasticsearchTestCase,
Supe... | Tayamarn/socorro | socorro/unittest/external/es/test_analyzers.py | Python | mpl-2.0 | 1,852 |
"""Django module for the OS2datascanner project."""
| os2webscanner/os2webscanner | django-os2webscanner/os2webscanner/__init__.py | Python | mpl-2.0 | 53 |
# -*- coding: utf-8 -*-
# © 2009 Pexego/Comunitea
# © 2011-2012 Iker Coranti (www.avanzosc.es)
# © 2014 Juanjo Algaz (gutierrezweb.es)
# © 2014-2016 Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0).
{
"name": "Account balance reporting engine",
"version": "8.0.1.2.0",
"auth... | Endika/l10n-spain | account_balance_reporting/__openerp__.py | Python | agpl-3.0 | 1,278 |
# -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program 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, eit... | nishad-jobsglobal/odoo-marriot | openerp/addons/tapplicant_webcam/__openerp__.py | Python | agpl-3.0 | 1,685 |
# ActivitySim
# Copyright (C) 2014-2015 Synthicity, LLC
# See full license in LICENSE.txt.
import os.path
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pytest
from ..activitysim import eval_variables
from .. import mnl
# this is lifted straight from urbansim's test_mnl.py
@pytest.... | bhargavasana/activitysim | activitysim/tests/test_mnl.py | Python | agpl-3.0 | 3,724 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-2014 OpenERP (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | Antiun/odoo | openerp/fields.py | Python | agpl-3.0 | 75,603 |