repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
MichaelSEA/python_koans
python3/koans/about_lists.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutArrays in the Ruby Koans # from runner.koan import * class AboutLists(Koan): def test_creating_lists(self): empty_list = list() self.assertEqual(list, type(empty_list)) self.assertEqual(0, len(empty_list)) def test_list_...
sneharavi12/DeepLearningFinals
game.py
import random import math import numpy as np import pygame from pygame.color import THECOLORS import pymunk from pymunk.vec2d import Vec2d from pymunk.pygame_util import draw # PyGame init width = 1000 height = 700 pygame.init() screen = pygame.display.set_mode((width, height)) clock = pygame.time.Clock() # Turn of...
enixdark/10gen-Courses
Mongo-Developer-M101P-Pyramid/Week 6/better_failover.py
__author__ = 'aje' import pymongo import sys import time connection = pymongo.MongoReplicaSetClient("localhost:27017,localhost:27018,localhost:27019", replicaSet="abc") db = connection.m101 test = db.test test.remove() # clear collection def writesome(): # let's do...
ritviksahajpal/LUH2
doc/conf.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # LUH2 documentation build configuration file, created by # sphinx-quickstart on Tue Apr 14 10:29:06 2015. # # 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 # autog...
marrow/util
marrow/util/url.py
# encoding: utf-8 from __future__ import unicode_literals from __future__ import print_function try: from urlparse import urlparse from urllib import quote_plus, unquote_plus except ImportError: from urllib.parse import urlparse, quote_plus, unquote_plus from marrow.util.compat import basestring, native...
realmarcin/data_api
lib/doekbase/data_api/tests/examples/test_genome_annotation_api.py
""" Verify that all examples in ``taxon_api`` are runnable. When you add a new example, add a call to it, here. """ __author__ = 'Dan Gunter <dkgunter@lbl.gov>' __date__ = '10/14/15' from doekbase.data_api.tests.examples.genome_annotation_api import * from doekbase.data_api.tests import shared # Some known reference...
magicalhobo/Hatchling
appengine/project/db.py
from google.appengine.ext.ndb import BooleanProperty, DateProperty, DateTimeProperty, IntegerProperty, StringProperty, TextProperty from google.appengine.ext.ndb.polymodel import PolyModel class Intent(PolyModel): expires = DateTimeProperty() nonce = StringProperty() class Login(PolyModel): created = DateTimeP...
sidnarayanan/PandaCore
Statistics/python/SimpleStats.py
#!/usr/bin/env python ''' Module containing simple statistical calculations Author: Sid Narayanan < sidn AT mit DOT edu > ''' import ROOT as root #import root_numpy as rnp import numpy as np from PandaCore.Tools.Misc import * from RooFitUtils import * from numpyUtils import * class SimpleVar(object): ''' ...
campaignmonitor/createsend-python
test/test_subscriber.py
from six.moves.urllib.parse import quote import unittest from createsend.createsend import BadRequest from createsend.subscriber import Subscriber class SubscriberTestCase(object): def test_get(self): email = "subscriber@example.com" self.subscriber.stub_request("subscribers/%s.json?email=%s&inc...
thedeerchild/meYOw
meYOw.py
import serial import sys sys.path.append('./src') import yo import tumblr SERIAL_ADDRESS = '/dev/tty.usbmodemfd121' BAUD_RATE = 9600 MEASUREMENT_RATE = 0.1 # Number of seconds between readings sent by the Arduino TRIGGER_THRESHOLD = 2 # Number of seconds target must be in range before triggering TRIGGER_TIMEOUT = 10 ...
andrew-d/Specter.py
specter/tests/test_selectors.py
from .util import StaticSpecterTestCase class TestSelectors(StaticSpecterTestCase): STATIC_FILE = 'selectors.html' def test_exists_id(self): self.open('/') self.assert_true(self.s.exists('#the_id')) def test_exists_class(self): self.open('/') self.assert_true(self.s.exist...
mmaldacker/Vortex2D
Scripts/GenerateSPIRV.py
import argparse import subprocess import ntpath import tempfile import shutil parser = argparse.ArgumentParser(description='Compile to SPIRV and generate header/implementation') parser.add_argument('files', metavar='files', nargs='+', help='list of glsl files') parser.add_argument('--output', action='store', dest='out...
SubhankarGhosh/NetworkX
checkenv.py
# Check that the packages are installed. from pkgutil import iter_modules import sys def check_import(packagename): if packagename in (name for _, name, _ in iter_modules()): return True else: return False packages = ['networkx', 'numpy', 'matplotlib', 'circos', 'hiveplot', 'pandas', ...
butala/pyrsss
pyrsss/l1/hdf4to5.py
import os import sys import logging from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter from collections import defaultdict from datetime import datetime, timedelta import pandas as PD from pyhdf.HDF import HDF, HDF4Error from pyhdf import VS def key_from_fname(fname): """ Return the ACE data...
ErikBjare/rescuetime-exporter
rescuetime_exporter/main.py
#!/usr/bin/python3 import os import requests # Settings ## Can be "month", "week", "day", "hour" or "minute" ## "minute" returns the data in 5 minute chunks, this is the highest allowed by RescueTime resolution = "minute" ## You should probably not change this unless you really want to script_location = os.path.dirn...
nithyanandan/PRISim
scripts/FEKO_beam_to_healpix.py
#!python import ast import numpy as NP import healpy as HP import yaml, h5py from astropy.io import fits import argparse from scipy import interpolate import progressbar as PGB from astroutils import mathops as OPS import ipdb as PDB def read_FEKO(infile): freqs = [] theta_list = [] phi_list = [] gain...
zecruel/sand_box
webdriver/cria_ficha.py
# -*- coding: utf-8 -*- import os from tkinterdnd2 import * from tkinter import * from tkinter import ttk import re from tkinter import filedialog from tkinter import messagebox from openpyxl import load_workbook import time from selenium import webdriver from selenium.webdriver.support import expected_conditions a...
ppyordanov/HCI_4_Future_Cities
Server/src/virtualenv/Lib/encodings/cp869.py
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py. """ # " import codecs # ## Codec APIs class Codec(codecs.Codec): def encode(self, input, errors='strict'): return codecs.charmap_encode(input, errors, encoding_map) def decode(self, input, errors='str...
popara/jonny-api
matching/forms.py
from django import forms from googleplaces import types class GPSearchForm(forms.Form): TARGETS = ( ('ReCa', 'ReCa'), ('Accomodation', 'Accomodation'), ('Activity', 'Activity'), ) TYPES_LIST = list((getattr(types, t)) for t in dir(types) if t.startswith("TYPE")) TYPES = map(lambda t: (t, t), TYPES...
xuender/ubuntu
bin/sleep.py
#! /usr/bin/env python # -*- coding: utf-8 -*- import time import sys import urlparse from SocketServer import ThreadingMixIn from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer, test sleep = 3 class ThreadedHTTPServer(ThreadingMixIn, HTTPServer): pass class SleepHandler(BaseHTTPRequestHandler): ...
nathants/s
tests/test_data.py
import util.func import util.data import pytest import tornado.concurrent from unittest import mock def test_future(): f = tornado.concurrent.Future() f2 = util.data.freeze(f) val = [1, 2] f.set_result(val) val.append(3) assert f2.result() == [1, 2] def test_unicode_synonymous_with_str(): ...
admk/soap
soap/semantics/label.py
from collections import namedtuple from soap.common import Comparable, Flyweight from soap.datatype import type_of from soap.expression import expression_factory, is_expression _label_map = {} _label_context_maps = {} _label_size = 0 def fresh_int(hashable, _lmap=_label_map): """ Generates a fresh int for ...
petrvanblokland/Xierpa3
xierpa3/contributions/filibuster/content/medical.py
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # ---------------------------------------------------------------...
phzfi/RIC
report_generator/csv_to_html.py
#!/usr/bin/env python3 """ Created on 18 Dec 2015 @author: Lauri @modified-by: Kristian """ import csv import codecs import datetime import logging import os import sys import traceback """ Different formatted csvs made with the csv_formatter are used to make html tables. The different formatted csv paths are given ...
sdispater/tomlkit
tomlkit/exceptions.py
from typing import Collection from typing import Optional class TOMLKitError(Exception): pass class ParseError(ValueError, TOMLKitError): """ This error occurs when the parser encounters a syntax error in the TOML being parsed. The error references the line and location within the line where th...
sachinio/redalert
tasks/vso.py
__author__ = 'sachinpatney' import json import base64 from urllib.request import urlopen from urllib.request import Request from common import ITask from common import BuildNotifier from common import sync_read_status_file from common import Timeline from common import safe_read_dictionary from common import Icons fr...
jptomo/rpython-lang-scheme
rpython/memory/gc/test/test_direct.py
""" The tests below don't use translation at all. They run the GCs by instantiating them and asking them to allocate memory by calling their methods directly. The tests need to maintain by hand what the GC should see as the list of roots (stack and prebuilt objects). """ # XXX VERY INCOMPLETE, low coverage import p...
tofixx/epic-battle-db
SAP-Hana-Scripts/createInsertData.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from random import randint, seed, uniform import random seed(0) # Create Schemata: def create_data (amount): print('create data...') insertData = [] for x in range(0, amount): entryDict = dict() data = createChangedData(x) entryDict['B...
wilhadams/Honors-Module
Broyden.py
import math import csv class Matrix(object): def __init__(self, mat, augmented=False): self.mat = mat self.rows = len(mat) if isinstance(mat[0], list): self.cols = len(mat[0]) else: self.cols = 1 self.augmented = augmented self.t...
adityadharne/TestObento
obi/ui/migrations/0003_auto__add_journal.py
# -*- 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 model 'Journal' db.create_table(u'ui_journal', ( (u'id', self.gf('django.db.models.fiel...
tebanep/odoo_training_addons
openacademy/model/openacademy_course.py
# -*- coding: utf-8 -*- from openerp import models, fields, api class Course(models.Model): ''' This class creates a model for courses ''' _name = 'openacademy.course' name = fields.Char(string='Title', required=True) description = fields.Text(string='Description') responsible_id = fields...
lord63/wangyi_music_top100
manage.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import import os from flask_script import Manager from wangyi_music.app import create_app from wangyi_music.configs import DevelopConfig, ProductionConfig if os.environ.get('Flask_APP') == 'production': app = create_app(ProductionCo...
Vaayne/vaayne.com
app/views/feed/__init__.py
# -*- coding:utf-8 -*- # Created by Vaayne at 2016/07/29 14:26 from flask import Blueprint, Response from pymongo import DESCENDING from ... import db, init_log import PyRSS2Gen import datetime import xml.etree.cElementTree as ET from arrow import Arrow from io import StringIO import sys feed = Blueprint('feed', __n...
diegojromerolopez/djanban
src/djanban/apps/requirements/migrations/0004_auto_20160823_1727.py
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-08-23 15:27 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('requirements', '0003_requirement_estimated_number_of_hours'), ] operations = [ ...
geographika/mappyfile
tests/test_expressions.py
# -*- coding: utf-8 -*- import logging import json import inspect import pytest from mappyfile.parser import Parser from mappyfile.pprint import PrettyPrinter from mappyfile.transformer import MapfileToDict def output(s): """ Parse, transform, and pretty print the result """ p = Parser() m = M...
lukleh/TwistedBot
twistedbot/plugins/core/chat_help.py
from twistedbot.plugins.base import PluginChatBase class Help(PluginChatBase): @property def command_verb(self): return "help" @property def help(self): return "without argument shows aviable commands or help for specfic command" def command(self, sender, command, args): ...
franklingu/leetcode-solutions
questions/spiral-matrix-iii/Solution.py
""" On a 2 dimensional grid with R rows and C columns, we start at (r0, c0) facing east. Here, the north-west corner of the grid is at the first row and column, and the south-east corner of the grid is at the last row and column. Now, we walk in a clockwise spiral shape to visit every position in this grid. Whenever...
jggatc/pyjsdl
pyjsdl/font.py
#Pyjsdl - Copyright (C) 2013 James Garnon <https://gatc.ca/> #Released under the MIT License <https://opensource.org/licenses/MIT> from math import ceil as _ceil from pyjsdl.surface import Surface from pyjsdl.color import Color from pyjsdl.pyjsobj import HTML5Canvas __docformat__ = 'restructuredtext' _initialized =...
franklingu/leetcode-solutions
questions/longest-word-in-dictionary-through-deleting/Solution.py
""" Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. If there are more than one possible results, return the longest word with the smallest lexicographical order. If there is no possible result, return the empty stri...
Team-JETT/Grouvie
Back-end/DBManager.py
from sys import stdout import pprint import psycopg2 # Make a new Grouvie table to store all the plans CREATE_GROUVIE = """ CREATE TABLE GROUVIE( PHONE_NUMBER CHAR(11) NOT NULL, LEADER CHAR(11) NOT NULL, CREATION_DATETIME CHAR(19) NOT NULL, DATE ...
echen/restricted-boltzmann-machines
rbm.py
from __future__ import print_function import numpy as np class RBM: def __init__(self, num_visible, num_hidden): self.num_hidden = num_hidden self.num_visible = num_visible self.debug_print = True # Initialize a weight matrix, of dimensions (num_visible x num_hidden), using # a uniform distri...
TeachCraft/TeachCraft-Examples
mcpi/minecraft.py
from .connection import Connection from .vec3 import Vec3 from .event import BlockEvent, ChatEvent from .block import Block import math from .util import flatten """ Minecraft PI low level api v0.1_1 Note: many methods have the parameter *arg. This solution makes it simple to allow different types, and variab...
domob1812/huntercore
test/functional/mempool_packages.py
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test descendant package tracking code.""" from test_framework.test_framework import BitcoinTestFramewo...
karinemiras/evoman_framework
evoman/enemy6.py
################################ # EvoMan FrameWork - V1.0 2016 # # Author: Karine Miras # # karine.smiras@gmail.com # ################################ import sys import numpy import random import Base from Base.SpriteConstants import * from Base.SpriteDefinition import * from sensors import Sensors til...
OrganDonor/Organelle
pytest/gpiotest.py
#!/usr/bin/env python """Master program for the Organ Donor "Organelle" This program is mainly responsible for monitoring the physical rotary switch that allows users to select a major mode of operation for the Organelle. When it detects that the switch has been moved, it asks the current program to clean up and exit ...
lituan/tools
lt.py
import datetime import itertools import operator import os import random import re import sys import time from functools import wraps from collections import OrderedDict from colorama import init,deinit,Fore,Back,Style import cPickle as pickle def zen_of_python(): ZEN = ['Beautiful is better than ugly', ...
jtvaughan/calligraphy
svgitalicslantsheet.py
#!/usr/bin/env python3 # Generate Slant Guide Lines for Italic Calligraphy Guide Sheets # Written in 2014 by Jordan Vaughan # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public domain # worldwide. This software is distribut...
nholtz/structural-analysis
matrix-methods/frame2d/Frame2D/__init__.py
from salib import extend, NBImporter ## Because of the idiotic Python 3 import rules, we have to add ## this directory to the path, otherwise we cannot use notebook ## pages both as modules and as scripts. import sys try: __path = __file__.split('/')[:-1] __thisdir = '/'.join(__path) if __thisdir not in s...
FuelCellUAV/FC_datalogger
quick2wire/quick2wire/i2c.py
import sys from ctypes import create_string_buffer, sizeof, string_at import posix from fcntl import ioctl from quick2wire.i2c_ctypes import * from quick2wire.board_revision import revision assert sys.version_info.major >= 3, __name__ + " is only supported on Python 3" default_bus = 1 if revision() > 1 else 0 cla...
johnnypass/nypr_archives_py
XML_search_export.py
#!/usr/bin/env python """ This downloads archives records for use by import_archives.py. To run this automatically you'll need to set the archives site (cavafy) password in the settings file. For increased security, put it in local_settings on the relevant machines, like we do with our db password, so if the repo is ...
races1986/SafeLanguage
CEM/_s/preGrep.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # conda execute # env: # - python >=3 #Preparar un respaldo para usar grep import sys, getopt import re regTitle = re.compile('^.*<title>(.*)</title>.*$') regSpace = re.compile('^.*<ns>(.*)</ns>.*$') tabla = { '&lt;':'<', '&gt;':'>', '&quot;':'"', '&amp;':'&',...
steve-bate/openhab2-jython
Community/NOAA Weather Alerts/automation/jsr223/python/personal/nws_alerts/nws_alerts.py
""" Purpose ------- This script creates a rule that sends a notification when an NWS RSS feed updates with a weather alert. Requires -------- * `openHAB Cloud Connector <https://www.openhab.org/addons/bindings/amazonechocontrol/>`_ * myopenhab.org setup with at least one mobile device * Find the URL for the area th...
wikimedia/operations-debs-contenttranslation-lttoolbox
tests/lt_trim/__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals # If you have HFST installed, you can diff lttoolbox binaries like this: # $ lt-print full.bin | sed 's/ /@_SPACE_@/g' | hfst-txt2fst -e ε | hfst-fst2strings -c1 > full.strings # $ lt-print trim.bin | sed 's/ /@_SPACE_@/g' | hfst-txt2fst -e ε | hfst-fst2s...
jeremycline/pulp_puppet
pulp_puppet_extensions_admin/pulp_puppet/extensions/admin/repo/remove.py
# -*- coding: utf-8 -*- # # Copyright © 2012 Red Hat, Inc. # # This software is licensed to you under the GNU General Public # License as published by the Free Software Foundation; either version # 2 of the License (GPLv2) or (at your option) any later version. # There is NO WARRANTY for this software, express or impli...
Debian/ud
src/common/management/commands/echelon.py
# 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 2 of the License, or (at your option) any later # version. # # This program is distributed in the hope that it will be useful, but ...
ricleal/x3DAC
src/absorption/correction.py
''' Created on Oct 21, 2014 @author: rhf ''' import logging logger = logging.getLogger(__name__) class Correction(object): ''' classdocs ''' def __init__(self, params): ''' Constructor ''' pass
eli261/jumpserver
apps/terminal/views/session.py
# -*- coding: utf-8 -*- # from django.views.generic import ListView, TemplateView from django.views.generic.edit import SingleObjectMixin from django.utils.translation import ugettext as _ from django.utils import timezone from django.conf import settings from common.permissions import PermissionsMixin, IsOrgAdmin, I...
gzamboni/sdnResilience
loxi/of14/port_stats_prop.py
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University # Copyright (c) 2011, 2012 Open Networking Foundation # Copyright (c) 2012, 2013 Big Switch Networks, Inc. # See the file LICENSE.pyloxi which should have been included in the source distribution # Automatically generated by LOXI from ...
bluciam/ruby_versus_python
white_book/Kap_9/9_1.py
def count_steps(n): if n < 0: return 0 elif n == 0: return 1 else: return count_steps(n-1) + count_steps(n-2) + count_steps(n-3) def count_steps_DP(n, my): if n < 0: return 0 elif n == 0: return 1 else: my[n] = count_steps_DP(n-1, my) + count_step...
toladata/TolaTables
silo/migrations/0037_auto_20171110_0101.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-11-10 09:01 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('silo', '0036_auto_20171025_1225'), ] operations = ...
hexdump42/spreadrrd
spreadrrd.py
#! /usr/bin/env python __doc__ = """Consumer to store data sent via Spread messaging system into RRDtool databases. Based on Chris Miles elvinrrd listener. """ __version__ = """0.1""" __copyright__ = """Copyright (C) 2001-2009 Chris Miles, 2015 Mark Rees""" __license__ = """ This program is free software; you ...
andrenam/webtagpy
api.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import sys, os, os.path import ConfigParser import logging from flask import Flask, send_file, Response, request, json, jsonify from reverseproxy import ReverseProxied import mutagen import base64 import StringIO, magic import hashlib import requests import Levenshtein im...
ezzze/tcloud-pyclient
twindow/clientDaemon.py
#!coding:utf-8 #!/usr/bin/env python# """ @author:Jay.Han @TODO 异常处理 """ import dbus import socket from twindow.api.apr_proxy import api as api_proxy from twindow.common import utils import logging import thread import time from twindow.common.exception import NetworkException VERSION = '3.0.0' LOG = logging...
mysql/mysql-utilities
mysql-test/t/mylogin_errors_port_socket.py
# # Copyright (c) 2014 Oracle and/or its affiliates. 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; version 2 of the License. # # This program is distributed in the hope ...
RsrchBoy/rpmdevtools
rpmdev-rmdevelrpms.py
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # rpmdev-rmdevelrpms -- Find (and optionally remove) "development" RPMs # # Copyright (c) 2004-2009 Ville Skyttä <ville.skytta@iki.fi> # Credits: Seth Vidal (yum), Thomas Vander Stichele (mach) # # This program is free software; you can redistribute it and/or modify # it u...
Jajcus/cjc
plugins/jogger_pl.py
# Console Jabber Client # Copyright (C) 2004-2010 Jacek Konieczny # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as published # by the Free Software Foundation # # This program is distributed in the hope that it will be useful, #...
willingc/portal
systers_portal/community/tests/test_permissions.py
from django.test import TestCase from community.constants import (CONTENT_CONTRIBUTOR, CONTENT_MANAGER, USER_CONTENT_MANAGER, COMMUNITY_ADMIN) from community.permissions import (content_contributor_permissions, content_manager_permissions, ...
Tinkerforge/brickv
src/brickv/bindings/bricklet_evse.py
# -*- coding: utf-8 -*- ############################################################# # This file was automatically generated on 2022-01-18. # # # # Python Bindings Version 2.1.29 # # ...
ssjssh/algorithm
src/ssj/leecode/two_sum.py
#!/usr/bin/env python # -*- coding:UTF-8 """ Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2.Please note that your returned answers (bot...
shlomif/gringotts
python3-src/grg_py.py
# -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Written by Shlomi Fish <shlomif@cpan.org> at 2019 # based on libgringotts by Germano Rizzo. # # Distributed under the terms of the GPL - version # 2 or at your option any later version. import os import platform import unittest from cffi import FFI class Gringotts(object...
maheshcn/memory-usage-from-ldfile
openpyxl/charts/__init__.py
from __future__ import absolute_import # Copyright (c) 2010-2015 openpyxl # # 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 u...
bmazin/SDR
Projects/Filters/matched_fir.py
import numpy from scipy import * from scipy import optimize import matplotlib.pyplot as mpl #import pylab import random, math import sim_utilities ############################################################################################ # some constants ###########################################################...
PaulWay/spacewalk
client/solaris/smartpm/smart/channels/rpm_sys.py
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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...
muromec/qtopia-ezx
src/3rdparty/libraries/helix/src/build/lib/pyar_exe.py
#!/usr/bin/env python # # ***** BEGIN LICENSE BLOCK ***** # # Source last modified: $Id: pyar_exe.py,v 1.2 2006/07/06 19:28:05 jfinnecy Exp $ # # Copyright Notices: # # Portions Copyright (c) 1995-2006 RealNetworks, Inc. All Rights Reserved. # # Patent Notices: This file may contain technology pr...
tongpa/PollSurveyWeb
pollandsurvey/service/invitationservice.py
#-*-coding: utf-8 -*- from pollandsurvey import model from surveyobject import JsontoObject from tgext.pyutilservice import Utility, extraLog from tg import expose, flash, require, url, lurl, request, redirect, tmpl_context,validate,response import logging; log = logging.getLogger(__name__); __all__ = ['InvitationSe...
felipeparpinelli/coderep
worker.py
__author__ = 'Felipe Parpinelli' import sched import time import coderep import history from providers import github_resources from providers import stackoverflow_resouces s = sched.scheduler(time.time, time.sleep) def update_values(sc): print "worker..." github_resources.update_stars() stackoverflow_re...
arunkgupta/gramps
gramps/gen/filters/rules/event/_hasdata.py
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2008 Gary Burton # # 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 2 of the License, or # (at your option) any...
azraq27/neural
neural/qc.py
'''quality control functions''' import neural as nl import tempfile,os,sys,shutil,re def find_atlas(atlas=None): if atlas: return atlas if atlas==None: atlas = nl.find('TT_N27+tlrc.HEAD') if atlas==None: atlas = nl.find('TT_N27.nii.gz') if atlas==None: nl.error('Error: N...
open-austin/influence-texas
tabula/tabulaFolderWalk.py
import os import sys import subprocess ####Requires Tabula 1.03 jar, not the linux or windows 'version' - https://github.com/tabulapdf/tabula-java/releases/tag/v1.0.3 tabula_path = os.getcwd() + "/" + sys.argv[1] tablua_path = tabula_path.replace(" ", "\\ ") walk_dir = sys.argv[2] if not tabula_path: prin...
skyoo/jumpserver
apps/terminal/models/session.py
from __future__ import unicode_literals import os import uuid from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils import timezone from django.conf import settings from django.core.files.storage import default_storage from django.core.cache import cache from assets.m...
felipenaselva/repo.felipe
plugin.video.salts/scrapers/dizilab_scraper.py
""" SALTS XBMC Addon Copyright (C) 2014 tknorris 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. T...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/gtk/gdk/__init__/PixbufSimpleAnimIter.py
# encoding: utf-8 # module gtk.gdk # from /usr/lib/python2.7/dist-packages/gtk-2.0/pynotify/_pynotify.so # by generator 1.135 # no doc # imports from exceptions import Warning import gio as __gio import gobject as __gobject import gobject._gobject as __gobject__gobject import pango as __pango import pangocairo as __p...
3dfxsoftware/cbss-addons
sale_line_import/sale.py
# -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # # Copyright (c) 2012 Vauxoo - http://www.vauxoo.com # All Rights Reserved. # info@vauxoo.com ###################################################...
Ovce/py1
polls/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Choice', fields=[ ('id', models.AutoField(verbo...
eduardomartins/ProjectEuler
Python/problem4.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # problem4.py # # Copyright 2017 Eduardo Sant'Anna Martins <eduardo@eduardomartins.site> # # 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...
loop0/kktua
kktua/kktua/urls.py
from django.conf import settings from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.staticfiles.urls import staticfiles_urlpatterns from brewery.views import Statusboard admin.autodiscover() urlpatterns = patterns('', url(r'^brewery/$', Statusboard.as_view(),...
tatsuhirosatou/JMdictDB
python/tests/test_objects.py
# -*- coding: utf-8 -*- import sys, re, unittest, pdb if '../lib' not in sys.path: sys.path.append ('../lib') import jdb from objects import * def globalSetup (): pass class Test_DbRow (unittest.TestCase): def test000010(_): _.assertIs (type (DbRow()), DbRow) def test000020(_): _.assertEqual (len (DbRow([],...
CopperBadger/lemonhead-ticker
ticker.py
from html.parser import HTMLParser import email.utils from urllib.request import urlopen,HTTPError import time,sys,os,re from datetime import datetime from subprocess import call from queue import PriorityQueue now = time.time() urlpat=re.compile("^url=") class TickerManager(): """docstring for TickerManager""" def...
tvierling/GDriveFS
tests/gdtool/Conf.py
from unittest import TestCase, main from gdrivefs.gdtool import Conf class ConfTestCase(TestCase): """Test the Conf class.""" def setUp(self): pass def tearDown(self): pass def test_config(self): """Test for the existence of all configuration keys.""" keys = [ 'auth...
windskyer/nova
nova/db/api.py
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file...
SCSSoftware/BlenderTools
addon/io_scs_tools/internals/shaders/eut2/water/__init__.py
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 2 # of the License, or (at your option) any later version. # # This program is distributed ...
dbkaynor/PyCopyMoveTk
auxfiles/ToolTip.py
#!/usr/bin/python import tkinter from tkinter import * #------------------------------ class ToolTip: def __init__(self, master, text='Your text here', delay=250, **opts): self.master = master self._opts = {'anchor': 'center', 'bd': 1, 'bg': 'orange', 'delay': delay, 'fg': 'black', ...
alisonken1/pyProjector
projector/test/server-net.py
#!/usr/bin/env python """server-net.py Network server to handle network connections and pass commands to projector emulators """ __version__ = '0.0.2' _v = __version__.split(".") __version_hex__ = int(_v[0]) << 24 | \ int(_v[1]) << 16 | \ int(_v[2]) << 8 import thread import threa...
vgdev-beauchef/Wilson
engine/UI.py
from gfx import * import debug import sys import traceback import world import Player import Log import Inventory import Item import Info #import musicPlayer import optionsUI _inveWindowWidth = 10 _inveWindowHeight = 10 _inveWindowXPos = 33 _inveWindowYPos = 10 class UI: def __init__(self, _world, _log, _info, ...
rex-xxx/mt6572_x201
frameworks/av/libvideoeditor/ve.py
#!/usr/bin/env python # # Written by demon.deng@mediatek.com # Any problems, please ocs/email me, thanks import sys import os import platform import time import xml.dom.minidom import hashlib import subprocess version = sys.version_info[0] VERSION2 = version == 2 VIDEO_EDITOR_LEAK_DIRECTORY = "/sdcard/videoeditor/lea...
Spardz/Projects
xbmc/script.screensaver.wallbase/wallbaseMech.py
import mechanize import sys from advLogger import log from constants import _loginUrl, _user, _pass from constants import _wallpageSearchString, _wallSearchString from constants import _testingMainUrl class WallbaseWeb: def __init__(self): self.connect() def login(self): respon...
ceholden/TSTools
tstools/src/controls/attach_md.py
""" QDialog for "attaching" additional metadata from CSV file """ import logging import os from PyQt4 import QtCore, QtGui import numpy as np from ..ui_attach_md import Ui_AttachMd from ..logger import qgis_log from ..ts_driver.ts_manager import tsm logger = logging.getLogger('tstools') class AttachMetadata(QtGu...
ClusterLabs/crmsh
doc/website-v1/postprocess.py
#!/usr/bin/env python # create a table of contents for pages that need it import sys import re import argparse TOC_PAGES = ['man/index.html', 'man-4.3/index.html', 'man-3/index.html', 'man-2.0/index.html', 'man-1.2/index.html'] V2_PAGES = ['index.html'] INSERT_AFTER...
scbzyhx/sdn_access_network
NIB.py
#! /usr/bin/python import logging from ryu.base import app_manager from switch import OVSSwitch from ryu.lib.ovs.vsctl import VSCtlQueue from ryu.controller.handler import set_ev_cls from ryu.controller.handler import MAIN_DISPATCHER,DEAD_DISPATCHER from ryu.controller import ofp_event from ryu.controller.dpset import...
ncss-tech/geo-pit
alena_tools/desktop__V_tools/Generate_Regional_Transactional_MLRA_FGDB_old.py
# Create_Regional_Transactional_FGDB # # 1/16/2014 # # Adolfo Diaz, Region 10 GIS Specialist # USDA - Natural Resources Conservation Service # Madison, WI 53719 # adolfo.diaz@wi.usda.gov # 608.662.4422 ext. 216 # #Modified for use in Region 11 to create individual RTSD file geodatabase for MLRA offices # # ...