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 |
|---|---|---|---|---|---|
from urllib.request import urlopen
for line in urlopen('https://secure.ecs.soton.ac.uk/status/'):
line = line.decode('utf-8') # Decoding the binary data to text.
if 'Core Priority Devices' in line: #look for 'Core Priority Devices' To find the line of text with the list of issues
linesIWant = line.spl... | SThomasP/ECSSystemsBot | TestProcedures/GetWebPage.py | Python | gpl-3.0 | 1,077 |
'''
ThunderGate - an open source toolkit for PCI bus exploration
Copyright (C) 2015-2016 Saul St. John
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 Lice... | sstjohn/thundergate | py/cdpserver.py | Python | gpl-3.0 | 22,448 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/oval_5/defs/independent/FileHashStateElement.py | Python | gpl-3.0 | 1,656 |
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_O_IBK_WSYH_ECCIF').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.s... | cysuncn/python | spark/crm/PROC_O_IBK_WSYH_ECCIF.py | Python | gpl-3.0 | 7,652 |
# Copyright (C) 2014 Adam Schubert <adam.schubert@sg1-game.net>
#
# 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.
#
# Th... | Salamek/DwaPython | tests/UserTest.py | Python | gpl-3.0 | 4,776 |
# -*- coding: utf-8 -*-
__author__ = "Matheus Marotzke"
__copyright__ = "Copyright 2017, Matheus Marotzke"
__license__ = "GPLv3.0"
import numpy as np
class Truss:
"""Class that represents the Truss and it's values"""
def __init__(self, nodes, elements):
self.nodes = nodes # List... | MatheusDMD/InGodWeTruss | truss.py | Python | gpl-3.0 | 6,558 |
"""
This file is part of xcos-gen.
xcos-gen 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.
xcos-gen is distribute... | ilia-novikov/xcos-gen | hdl_block.py | Python | gpl-3.0 | 1,461 |
# Copyright (c) 2014 Yubico AB
# All rights reserved.
#
# 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... | Yubico/yubioath-desktop-dpkg | yubioath/gui/controller.py | Python | gpl-3.0 | 14,732 |
import unittest
import test_dot
import test_math
import test_trans
import test_lapack
# linear algebra group suite
suite = unittest.TestSuite([test_dot.suite(),
test_math.suite(),
test_trans.suite(),
test_lapack.suite
... | biolauncher/pycudalibs | test/test_linalg.py | Python | gpl-3.0 | 415 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# nala - file/directory watcher
# Copyright (C) 2013 Eugenio "g7" Paolantonio <me@medesimo.eu>
#
# 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, ... | g7/python-nala | setup.py | Python | gpl-3.0 | 1,120 |
class Solution(object):
def __init__(self):
self.l=[]
def helper(self,root,level):
if not root:
return None
else:
if level<len(self.l):
self.l[level].append(root.val)
else:
self.l.append([root.val])
self.help... | sadad111/leetcodebox | Binary Tree Level Order Traversal.py | Python | gpl-3.0 | 603 |
from .submaker import Submaker
import zipfile
import os
import shutil
import logging
logger = logging.getLogger(__name__ )
class SuperSuSubmaker(Submaker):
def make(self, workDir):
supersuZipProp = self.getTargetConfigProperty("root.methods.supersu.path")
assert supersuZipProp.getValue(), "Must s... | tgalal/inception | inception/argparsers/makers/submakers/submaker_supersu.py | Python | gpl-3.0 | 4,484 |
class CharacterSubstitutions(object):
character_substitutions = dict()
def standard_text_from_block(block, offset, max_length):
str = ''
for i in range(offset, offset + max_length):
c = block[i]
if c == 0:
return str
else:
str += chr(c - 0x30)
return str... | john-soklaski/CoilSnake | coilsnake/util/eb/text.py | Python | gpl-3.0 | 2,207 |
import librosa
import numpy as np
import help_functions
def extract_mfccdd(fpath, n_mfcc=13, winsize=0.25, sampling_rate=16000):
'''
Compute MFCCs, first and second derivatives
:param fpath: the file path
:param n_mfcc: the number of MFCC coefficients. Default = 13 coefficients
:param winsize: the ... | gkaramanolakis/adsm | adsm/feature_extraction.py | Python | gpl-3.0 | 3,139 |
#%% Libraries: Built-In
import numpy as np
#% Libraries: Custom
#%%
class Combiner(object):
def forward(self, input_array, weights, const):
## Define in child
pass
def backprop(self, error_array, backprop_array, learn_weight = 1e-0):
## Define in child
pass
#%%
class Linear... | Calvinxc1/neural_nets | Processors/Combiners.py | Python | gpl-3.0 | 2,965 |
# -*- coding: utf-8 -*-
# Copyright 2007-2022 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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 y... | hyperspy/hyperspy | hyperspy/tests/misc/test_utils.py | Python | gpl-3.0 | 4,362 |
#!/usr/bin/python
# selects stream from tuning dial position
# monitors battery condition
from __future__ import division
import spidev
import time
import os
import gc
import sys
import math
global tune1, tune2, tunerout, volts2, volume1, volume2, volumeout, IStream
tune1 = False
tune2 = False
tunerout = False
volts2... | cjohnson98/transistor-pi | radio3.py | Python | gpl-3.0 | 2,243 |
# -*- coding: utf-8 -*-
from pyload.plugin.internal.SimpleCrypter import SimpleCrypter
class FiletramCom(SimpleCrypter):
__name = "FiletramCom"
__type = "crypter"
__version = "0.03"
__pattern = r'http://(?:www\.)?filetram\.com/[^/]+/.+'
__config = [("use_premium" , "bool", "Use prem... | ardi69/pyload-0.4.10 | pyload/plugin/crypter/FiletramCom.py | Python | gpl-3.0 | 843 |
"""
Copyright 2016 Jacob C. Wimberley.
This file is part of Weathredds.
Weathredds 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... | JakeWimberley/Weathredds | tracker/urls.py | Python | gpl-3.0 | 2,582 |
# $Id: statemachine.py 6314 2010-04-26 10:04:17Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
A finite state machine specialized for regular-expression-based text filters,
this module defines the following classes:
- `StateMachine`, a state ma... | mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/docutils-0.7-py2.7.egg/docutils/statemachine.py | Python | gpl-3.0 | 56,989 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('events', '0021_auto_20171023_1358'),
]
operations = [
migrations.AlterField(
model_name='inductioninterest',
name='age',
field=... | Spoken-tutorial/spoken-website | events/migrations/0022_auto_20171023_1505.py | Python | gpl-3.0 | 2,412 |
"""
This file: csm_notation.py
Last modified: November 8, 2010
Package: CurlySMILES Version 1.0.1
Author: Axel Drefahl
E-mail: axeleratio@yahoo.com
Internet: http://www.axeleratio.com/csm/proj/main.htm
Python module csm_notation implements a class for managing
a Cur... | axeleratio/CurlySMILESpy | csm_notation.py | Python | gpl-3.0 | 36,184 |
import collections
import functools
import re
import wrappers
class History(object):
"""
Tracking of operations provenance.
>>> h = History("some_op")
>>> print str(h)
some_op()
>>> h.add_args(["w1", "w2"])
>>> print str(h)
some_op(
w1,
w2,
)
>>> h.add_kws({"a... | dnowatsc/Varial | varial/history.py | Python | gpl-3.0 | 3,742 |
# This file is part of the Perspectives Notary Server
#
# Copyright (C) 2011 Dan Wendlandt
#
# 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, version 3 of the License.
#
# This progra... | danwent/Perspectives-Server | notary_util/threaded_scanner.py | Python | gpl-3.0 | 10,401 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 3 as published by the Free
# Software Foundation.
#
# This program is... | hmpf/nav | python/nav/web/seeddb/page/patch/__init__.py | Python | gpl-3.0 | 5,363 |
from chapter02.exercise2_3_5 import recursive_binary_search
from chapter02.textbook2_3 import merge_sort
from util import between
def sum_search(S, x):
n = S.length
merge_sort(S, 1, n)
for i in between(1, n - 1):
if recursive_binary_search(S, x - S[i], i + 1, n) is not None:
return Tru... | wojtask/CormenPy | src/chapter02/exercise2_3_7.py | Python | gpl-3.0 | 339 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.12 on 2017-05-25 20:11
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('anagrafica', '0046_delega_stato'),
]
operations = [
migrations.AlterIndexTogether(
... | CroceRossaItaliana/jorvik | anagrafica/migrations/0047_auto_20170525_2011.py | Python | gpl-3.0 | 865 |
import re
from simpleparse.parser import Parser
from simpleparse.dispatchprocessor import *
grammar = """
root := transformation
transformation := ( name, index, assign, expr )
assign := '='
expr := ( trinary )
/ ( term )
trinary := ( term, '?', term, ':', term )
term := ( factor, binaryop, term )
... | Pikecillo/digi-dark | digidark/parser.py | Python | gpl-3.0 | 3,699 |
from snmp_helper import snmp_get_oid,snmp_extract
COMMUNITY_STRING = 'galileo'
SNMP_PORT = 161
IP = '184.105.247.70'
a_device = (IP, COMMUNITY_STRING, SNMP_PORT)
OID = '1.3.6.1.2.1.1.1.0'
snmp_data = snmp_get_oid(a_device, oid=OID)
output = snmp_extract(snmp_data)
print output
| the-packet-thrower/pynet | Week02/snmp-test.py | Python | gpl-3.0 | 281 |
import numpy
import math
import pylab
from scipy.optimize import curve_fit
import math
import scipy.stats
import lab
def fit_function(x, a, b):
return b*(numpy.exp(x/a)-1)
FileName='/home/federico/Documenti/Laboratorio2/Diodo/dati_arduino/dati.txt'
N1, N2 = pylab.loadtxt(FileName, unpack="True")
errN2 = numpy.arra... | fedebell/Laboratorio3 | Laboratorio2/Diodo/analisi.py | Python | gpl-3.0 | 3,409 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'milletluo'
configs = {
'db': {
'host': '127.0.0.1'
}
}
| milletluo/awesome-python3-webapp | www/config_override.py | Python | gpl-3.0 | 134 |
from datetime import date, datetime
from textwrap import dedent
from unittest.mock import patch
from freezegun import freeze_time
from mitoc_const import affiliations
import ws.utils.dates as date_utils
from ws import enums, models, settings
from ws.lottery import run
from ws.tests import TestCase, factories
class ... | DavidCain/mitoc-trips | ws/tests/lottery/test_run.py | Python | gpl-3.0 | 8,051 |
# Copyright (C) 2013-2016 2ndQuadrant Italia Srl
#
# This file is part of Barman.
#
# Barman 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 ver... | hareevs/pgbarman | tests/test_infofile.py | Python | gpl-3.0 | 19,981 |
#trun based rpg
import random
import time
class role:
name=""
lv=1
exp=0
nextLv=1000
hp=100
mp=30
stra=5
inte=5
spd=5
defe=5
rest=5
void=5
dropItems=[None]
dropPrecent=[100]
command=['attack','void','def','fireball']
def __init__(self,name,lv):
sel... | alucardlockon/LearnCode | 01PythonTest/05_trunBasedRpg.py | Python | gpl-3.0 | 5,415 |
from syncloud_platform.snap.models import App, AppVersions
from syncloud_platform.snap.snap import join_apps
def test_join_apps():
installed_app1 = App()
installed_app1.id = 'id1'
installed_app_version1 = AppVersions()
installed_app_version1.installed_version = 'v1'
installed_app_version1.current... | syncloud/platform | src/test/snap/test_snap.py | Python | gpl-3.0 | 1,740 |
# -*- coding: utf-8 -*-
"""Shutdown Timer - Small Windows shutdown timer.
Created 2013, 2015 Triangle717
<http://Triangle717.WordPress.com>
Shutdown Timer 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 ... | le717/Shutdown-Timer | constants.py | Python | gpl-3.0 | 937 |
#!/usr/bin/python3
#-*- coding: utf-8 -*-
def absMat(matrice):
'''Renvoie la matrice avec la valeur absolue de tous ses coefficients. Renvoie False si échec.
- matrice
- complexe
'''
if type(matrice) is not list:
raise Exception("absMat : Pas une matrice.")
#~ return False
if no... | random-toto/funcMatrix | fMatrices.py | Python | gpl-3.0 | 11,526 |
#!/usr/bin/env python3
import sys
import re
def isSectionStart(line, interface=""):
sectionpattern = "^[0-9]+:\\s+%s"
return re.match(sectionpattern%interface, line) != None
def printSection(interface, lines):
in_section = False
for line in lines:
if in_section:
if isSectionStart... | taikedz/bash-builder | examples/myip/bin/find_section.py | Python | gpl-3.0 | 667 |
# -*- coding:utf-8; mode:python -*-
"""
Implements a queue efficiently using only two stacks.
"""
from helpers import SingleNode
from stack import Stack
class QueueOf2Stacks:
def __init__(self):
self.stack_1 = Stack()
self.stack_2 = Stack()
def enqueue(self, value):
self.stack_1.pus... | wkmanire/StructuresAndAlgorithms | pythonpractice/queueoftwostacks.py | Python | gpl-3.0 | 1,054 |
# -*- coding: utf-8 -*-
# Licence: GPL v.3 http://www.gnu.org/licenses/gpl.html
# This is an XBMC addon for demonstrating the capabilities
# and usage of PyXBMCt framework.
import os
import xbmc
import xbmcaddon
import pyxbmct
from lib import utils
import plugintools
from itertools import tee, islice, chain, izip
_a... | bigoldboy/repository.bigoldboy | plugin.video.VADER/categorySelectDialog.py | Python | gpl-3.0 | 3,306 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'options_dialog_base.ui'
#
# Created: Mon Feb 17 11:50:09 2014
# by: PyQt4 UI code generator 4.10.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
e... | assefay/inasafe | safe_qgis/ui/options_dialog_base.py | Python | gpl-3.0 | 23,148 |
'''
Given a sorted integer array where the range of elements are in the inclusive range [lower, upper], return its missing ranges.
Have you met this question in a real interview?
Example
Example 1
Input:
nums = [0, 1, 3, 50, 75], lower = 0 and upper = 99
Output:
["2", "4->49", "51->74", "76->99"]
Explanation:
in ra... | boxu0001/practice | py3/S163_L641_MissingRange.py | Python | gpl-3.0 | 1,104 |
"""Simulation of controlled dumbbell around Itokawa with
simulated imagery using Blender
This will generate the imagery of Itokawa from a spacecraft following
a vertical descent onto the surface.
4 August 2017 - Shankar Kulumani
"""
from __future__ import absolute_import, division, print_function, unicode_literals
... | skulumani/asteroid_dumbbell | blender_sim.py | Python | gpl-3.0 | 26,548 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2015 Bastian Kleineidam
#
# 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.
#... | wummel/patool | tests/__init__.py | Python | gpl-3.0 | 3,628 |
# -*- coding: utf-8 -*-
from module.common.json_layer import json_loads
from module.network.RequestFactory import getURL
from module.plugins.internal.MultiHoster import MultiHoster
class MyfastfileCom(MultiHoster):
__name__ = "MyfastfileCom"
__type__ = "hook"
__version__ = "0.02"
__config__ = ... | sebdelsol/pyload | module/plugins/hooks/MyfastfileCom.py | Python | gpl-3.0 | 1,045 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
from fnmatch import fnmatch
from django.db.... | r-o-b-b-i-e/pootle | pootle/apps/pootle_fs/resources.py | Python | gpl-3.0 | 5,525 |
###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... | ivmech/iviny-scope | lib/xlsxwriter/test/comparison/test_set_start_page01.py | Python | gpl-3.0 | 1,929 |
#!/usr/bin/python2
from conf import *
import socket
import os
from threading import Thread
import time
def get_cookie(request_lines):
#print("cookie data is: " + request_lines[-3])
data = request_lines[-3].split(":")[-1]
return (data.split("=")[-1])
def error_404(addr,request_words):
print("File not ... | aadarshkarumathil/Webserver | webserver.py | Python | gpl-3.0 | 10,173 |
"""
Some utilities for bools manipulation.
Copyright 2013 Deepak Subburam
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.
"""
... | Fenugreek/tamarind | bools.py | Python | gpl-3.0 | 1,641 |
import math
import inspect
import numpy as np
import numpy.linalg as linalg
import scipy as sp
import scipy.optimize
import scipy.io
from itertools import product
import trep
import _trep
from _trep import _System
from frame import Frame
from finput import Input
from config import Config
from force import Force
from c... | hilario/trep | src/system.py | Python | gpl-3.0 | 46,931 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | amenonsen/ansible | lib/ansible/modules/network/fortios/fortios_wanopt_profile.py | Python | gpl-3.0 | 32,337 |
#!/usr/bin/python
# Python DB APIs:
#for more: http://www.mikusa.com/python-mysql-docs/index.html
#and more: http://zetcode.com/db/mysqlpython/
#and else: http://mysql-python.sourceforge.net/MySQLdb.html
import MySQLdb as mdb
import itertools
from pprint import pprint
import ConfigParser
def db_connect(properties_fil... | ssamot/vgdl_competition | src/server/db_utils.py | Python | gpl-3.0 | 3,033 |
#!/usr/bin/python
## globals
primes_set = set()
primes_list = []
def is_prime(n):
limit = int(round(sqrt(n)))
i = 2
while True:
if i > limit:
return True
if n % i == 0:
return False
def find_prime_permutations(n):
"find the prime permutations including n"
... | AaronM04/coding-practice | pe_49/main.py | Python | gpl-3.0 | 1,693 |
# MajorMajor - Collaborative Document Editing Library
# Copyright (C) 2013 Ritchie Wilson
#
# 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)... | ritchiewilson/majormajor | tests/document/test_document_missing_changesets.py | Python | gpl-3.0 | 3,226 |
# -*- coding: utf-8 -*-
import copy
import re
import sqlite3
import time, urllib
from core import filetools
from core import httptools
from core import jsontools
from core import scrapertools
from core.item import InfoLabels
from platformcode import config
from platformcode import logger
# -----------... | alfa-jor/addon | plugin.video.alfa/core/tmdb.py | Python | gpl-3.0 | 77,962 |
from indivo.lib import iso8601
from indivo.models import EquipmentScheduleItem
XML = 'xml'
DOM = 'dom'
class IDP_EquipmentScheduleItem:
def post_data(self, name=None,
name_type=None,
name_value=None,
name_abbrev=None,
scheduled... | newmediamedicine/indivo_server_1_0 | indivo/document_processing/idp_objs/equipmentscheduleitem.py | Python | gpl-3.0 | 3,298 |
# (c) Copyright 2014, University of Manchester
#
# This file is part of PyNSim.
#
# PyNSim 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 optio... | UMWRG/pynsim | examples/trivial_demo/components/node.py | Python | gpl-3.0 | 2,510 |
from django.http import HttpResponse, Http404
from django.template.loader import get_template
from django.template import RequestContext
from django.core.paginator import Paginator, EmptyPage
from django.utils.translation import ugettext as _
from tagging.models import Tag
from messages.models import Message
from sett... | rtts/qqq | qqq/views.py | Python | gpl-3.0 | 3,044 |
#!/usr/bin/env python
#
# Copyright 2004,2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | trnewman/VT-USRP-daughterboard-drivers_python | gr-atsc/src/python/fpll.py | Python | gpl-3.0 | 2,429 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ==============================================================================
# author :Ghislain Vieilledent
# email :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com
# web :https://ecology.ghislainv.fr
# python_version :>=2.7
# license... | ghislainv/deforestprob | test/test_get_started.py | Python | gpl-3.0 | 9,570 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2012 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
import logging
from datetime import datetime
from hashlib import sha256
... | alirizakeles/zato | code/zato-server/src/zato/server/connection/http_soap/url_data.py | Python | gpl-3.0 | 63,529 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | PhilLidar-DAD/geonode | geonode/layers/admin.py | Python | gpl-3.0 | 3,475 |
#!/Users/pjjokine/anaconda/bin/python3
import curses
import os
import signal
from time import sleep
stdscr = curses.initscr()
curses.noecho()
begin_x = 20; begin_y = 7
height = 5; width = 40
win = curses.newwin(height, width, begin_y, begin_x)
count = 5
for x in range(0,20):
for y in range (0,5):
win.addstr(... | PaavoJokinen/molli | ncurses.py | Python | gpl-3.0 | 460 |
word = raw_input().lower()
v = 'aeiouy'
n = ''
for c in word:
if not c in v:
n += '.' + c
print n | yamstudio/Codeforces | 100/118A - String Task.py | Python | gpl-3.0 | 109 |
from vsg.rule_group import length
from vsg import violation
class number_of_lines_between_tokens(length.Rule):
'''
Checks the number of lines between tokens do not exceed a specified number
Parameters
----------
name : string
The group the rule belongs to.
identifier : string
... | jeremiah-c-leary/vhdl-style-guide | vsg/rules/number_of_lines_between_tokens.py | Python | gpl-3.0 | 1,091 |
#! /usr/bin/env python
#
# Copyright (C) 2014 Intel Corporation
#
# 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, ... | ArcticaProject/vcxsrv | mesalib/src/glsl/nir/nir_opt_algebraic.py | Python | gpl-3.0 | 10,772 |
#! /usr/bin/env python
# ==========================================================================
# This script performs the ctools science verification. It creates and
# analyses the pull distributions for a variety of spectral and spatial
# models. Test are generally done in unbinned mode, but also a stacked
# anal... | ctools/ctools | test/science_verification.py | Python | gpl-3.0 | 24,640 |
"This module provides a set of common utility functions."
__author__ = "Anders Logg"
__copyright__ = "Copyright (C) 2009 Simula Research Laboratory and %s" % __author__
__license__ = "GNU GPL Version 3 or any later version"
from math import ceil
from numpy import linspace
from dolfin import PeriodicBC, warning
def ... | Juanlu001/CBC.Solve | cbc/common/utils.py | Python | gpl-3.0 | 1,493 |
# Copyright 2017 Kevin Howell
#
# This file is part of sixoclock.
#
# sixoclock 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.
#
# six... | kahowell/sixoclock | sixoclock/cli.py | Python | gpl-3.0 | 6,455 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-11-08 20:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('persons', '0002_person_is_staff'),
]
operations = ... | grodrigo/django_general | persons/migrations/0003_auto_20161108_1710.py | Python | gpl-3.0 | 550 |
# Add 'RESPOND' and 'M118' commands for sending messages to the host
#
# Copyright (C) 2018 Alec Plumb <alec@etherwalker.com>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
respond_types = {
'echo': 'echo:',
'command': '//',
'error' : '!!',
}
class HostResponder:
def __ini... | KevinOConnor/klipper | klippy/extras/respond.py | Python | gpl-3.0 | 2,082 |
# (void)walker CPU architecture support
# Copyright (C) 2013 David Holm <dholmster@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 License, or
# (at your opti... | dholm/voidwalker | voidwalker/application/cpus/generic.py | Python | gpl-3.0 | 1,397 |
"""
Make a "Bias Curve" or perform a "Rate-scan",
i.e. measure the trigger rate as a function of threshold.
Usage:
digicam-rate-scan [options] [--] <INPUT>...
Options:
--display Display the plots
--compute Computes the trigger rate vs threshold
-o OUTPUT --output=OUTPUT. F... | calispac/digicampipe | digicampipe/scripts/rate_scan.py | Python | gpl-3.0 | 4,980 |
import sys
import glob
import numpy
try:
from setuptools import setup
from setuptools import Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
#
# Force `setup_requires` stuff like Cython to be installed before proceeding
#
from setuptools.dist imp... | petebachant/openpiv-python | setup.py | Python | gpl-3.0 | 3,204 |
from django.contrib import messages
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models import F, Q
from django.db.models.aggregates import Max
from django.db.models.deletion import PROTECT
from dj... | interlegis/sapl | sapl/compilacao/models.py | Python | gpl-3.0 | 66,332 |
# -*- coding: utf-8 -*-
"""
debug.py - Functions to aid in debugging
Copyright 2010 Luke Campagnola
Distributed under MIT/X11 license. See license.txt for more information.
"""
from __future__ import print_function
import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading
from . import p... | ArteliaTelemac/PostTelemac | PostTelemac/meshlayerlibs/pyqtgraph/debug.py | Python | gpl-3.0 | 41,232 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-04-26 12:53
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('admin', '0007_vm_user'),
]
operations = [
migrations.AddField(
m... | 827992983/yue | admin/migrations/0008_vm_system.py | Python | gpl-3.0 | 443 |
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='Harmony',
version='0.1',
author='H. Gökhan Sarı',
author_email='th0th@returnfalse.net',
packages=['harmony'],
scripts=['bin/harmony'],
url='https://github.com/th0th/harmony/',
license='LICENSE.txt',
description='... | th0th/harmony | setup.py | Python | gpl-3.0 | 403 |
from django.contrib import admin
from .models import Lesson, Course, CourseLead, QA
# from django.utils.translation import ugettext_lazy as _
from ordered_model.admin import OrderedModelAdmin
from core.models import User
# from adminfilters.models import Species, Breed
class UserAdminInline(admin.TabularInline):
... | pashinin-com/pashinin.com | src/pashinin/admin.py | Python | gpl-3.0 | 1,211 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created: Sat May 11 12:28:54 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = b"\
\x00\x00\x04\x58\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\... | haskelladdict/sconcho | sconcho/gui/icons_rc.py | Python | gpl-3.0 | 575,342 |
# -*- coding: utf-8 -*-
import re
import urlparse
from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo
class FiledropperCom(SimpleHoster):
__name__ = "FiledropperCom"
__type__ = "hoster"
__version__ = "0.01"
__pattern__ = r'https?://(?:www\.)?filedropper\.com/\w+'
... | Zerknechterer/pyload | module/plugins/hoster/FiledropperCom.py | Python | gpl-3.0 | 1,311 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright 2011 Yaşar Arabacı
This file is part of packagequiz.
packagequiz 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 y... | yasar11732/arch-package-quiz | packagequiz/questionGenerator.py | Python | gpl-3.0 | 4,801 |
# -*- coding: utf-8 -*-
"""Assorted base data structures.
Assorted base data structures provide a generic communicator with V-REP
simulator.
"""
from vrepsim.simulator import get_default_simulator
class Communicator(object):
"""Generic communicator with V-REP simulator."""
def __init__(self, vrep_sim):
... | macknowak/vrepsim | vrepsim/base.py | Python | gpl-3.0 | 699 |
#!/usr/bin/env python2.7
import hashlib
import httplib
import os
import socket
import sys
import time
import urllib
import mechanize
import xbmcgui
from resources.lib import common
from resources.lib import logger, cookie_helper
from resources.lib.cBFScrape import cBFScrape
from resources.lib.cCFScrape import cCFScra... | xStream-Kodi/plugin.video.xstream | resources/lib/handler/requestHandler.py | Python | gpl-3.0 | 11,867 |
import logging
from urllib.request import urlopen
from shutil import copyfileobj
class MapDownloader(object):
def __init__(self):
self.__log = logging.getLogger(__name__)
def to_file(self, top, left, bottom, right, file_path = 'map.osm'):
self.__log.info('Downloading map data for [%f,%f,%f,... | bradleyhd/netsim | mapserver/graph/downloader.py | Python | gpl-3.0 | 659 |
#!/usr/bin/env python
'''
Files and renames your films according to genre
using IMDb API
supert-is-taken 2015
'''
from imdb import IMDb
import sys
import re
import os
import errno
import codecs
db=IMDb()
def main(argv):
for filename in sys.argv[1:]:
print filename
movie_list=db.search_movie( c... | supert-is-taken/film-sorter | film_sorter.py | Python | gpl-3.0 | 3,764 |
# Copyright (C) 2010 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 agreed to in writ... | palladius/gcloud | packages/gcutil-1.7.1/lib/google_api_python_client/apiclient/discovery.py | Python | gpl-3.0 | 26,209 |
""" Class defining a production step """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__RCSID__ = "$Id$"
import json
from DIRAC import S_OK, S_ERROR
class ProductionStep(object):
"""Define the Production Step object"""
def __init__(self, **k... | ic-hep/DIRAC | src/DIRAC/ProductionSystem/Client/ProductionStep.py | Python | gpl-3.0 | 2,408 |
import numpy as np
from displays.letters import ALPHABET
class Writer:
"""Produce scrolling text for the LED display, frame by frame"""
def __init__(self):
self.font = ALPHABET
self.spacer = np.zeros([8, 1], dtype=int)
self.phrase = None
def make_phrase(self, phrase):
""... | PaulBrownMagic/LED_Arcade | displays/writer.py | Python | gpl-3.0 | 1,026 |
# coding=utf-8
import typing
from collections import MutableMapping
from emft.core.logging import make_logger
from emft.core.path import Path
from emft.core.singleton import Singleton
LOGGER = make_logger(__name__)
# noinspection PyAbstractClass
class OutputFolder(Path):
pass
class OutputFolders(MutableMappin... | 132nd-etcher/EMFT | emft/plugins/reorder/value/output_folder.py | Python | gpl-3.0 | 1,091 |
class Manipulator(object):
KINDS=()
SEPERATOR="$"
def __call__(self, txt, **kwargs):
data = {}
splitted = txt.split("$")
for kind, part in zip(self.KINDS, splitted):
data[kind]=part
for info, new_value in kwargs.items():
kind, position = info.r... | jedie/django-secure-js-login | tests/test_utils/manipulators.py | Python | gpl-3.0 | 1,102 |
""" Pymulator simulation objects """
import json
import datetime
from .serialize import PandasNumpyEncoderMixIn, hook
def importmodel(s):
"""
Import model from string s specifying a callable. The string has the
following structure:
package[.package]*.model[:function]
For example:
... | glciampaglia/pymulator | pymulator/sim.py | Python | gpl-3.0 | 3,607 |
#!/usr/bin/env python
from distutils.core import setup
setup(
name='py-viitenumero',
version='1.0',
description='Python module for generating Finnish national payment reference number',
author='Mohanjith Sudirikku Hannadige',
author_email='moha@codemaster.fi',
url='http... | codemasteroy/py-viitenumero | setup.py | Python | gpl-3.0 | 547 |
#!/usr/bin/python
import sys, time, scipy.optimize, scipy.ndimage.interpolation
import scipy.ndimage.filters as filt
import src.lib.utils as fn
import src.lib.wsutils as ws
import src.lib.Algorithms as alg
import scipy.signal.signaltools as sig
from src.lib.PSF import *
from src.lib.AImage import *
from src.lib.wavel... | COSMOGRAIL/COSMOULINE | pipe/modules/src/deconv_simult.py | Python | gpl-3.0 | 6,598 |
# coding=utf-8
from django.test import TestCase, override_settings
from merepresenta.models import Candidate, NON_WHITE_KEY, NON_MALE_KEY
from merepresenta.tests.volunteers import VolunteersTestCaseBase
from backend_candidate.models import CandidacyContact
from elections.models import PersonalData, Election, Area
from ... | ciudadanointeligente/votainteligente-portal-electoral | merepresenta/tests/volunteers/filter_tests.py | Python | gpl-3.0 | 2,975 |
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt,... | ijat/Hotspot-PUTRA-Auto-login | PyInstaller-3.2/tests/functional/test_import.py | Python | gpl-3.0 | 16,563 |
from robot import Robot
class TheRobot(Robot):
def initialize(self):
# Try to get in to a corner
self.forseconds(5, self.force, 50)
self.forseconds(0.9, self.force, -10)
self.forseconds(0.7, self.torque, 100)
self.forseconds(6, self.force, 50)
# Then look around and... | CodingRobots/CodingRobots | robots/examples/Ninja.py | Python | gpl-3.0 | 2,216 |
# /**
# * Definition for a binary tree node.
# * public class TreeNode {
# * int val;
# * TreeNode left;
# * TreeNode right;
# * TreeNode(int x) { val = x; }
# * }
# */
# public class Solution {
# public List<Integer> inorderTraversal(TreeNode root) {
# List<Integer> list = new Array... | sadad111/leetcodebox | Binary Tree Inorder Traversal.py | Python | gpl-3.0 | 1,336 |
#!/usr/bin/env python
########################################
#Globale Karte fuer tests
# from Rabea Amther
########################################
# http://gfesuite.noaa.gov/developer/netCDFPythonInterface.html
import math
import numpy as np
import pylab as pl
import Scientific.IO.NetCDF as IO
import matplotlib as... | CopyChat/Plotting | Downscaling/climatechange.rsds.py | Python | gpl-3.0 | 8,239 |
from django import forms
from faculty.event_types.base import BaseEntryForm
from faculty.event_types.base import CareerEventHandlerBase
from faculty.event_types.choices import Choices
from faculty.event_types.base import TeachingAdjust
from faculty.event_types.fields import TeachingCreditField
from faculty.event_types... | sfu-fas/coursys | faculty/event_types/position.py | Python | gpl-3.0 | 2,366 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.