code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/usr/bin/env python
# Hua Shao <hua.shao@mediatek.com>
import sys
import re
import random
l1conf = []
def parseconfig(conf):
global l1conf
l1conf.extend([[],[],[]])
with open(conf, "r") as fp:
for line in fp:
if line.startswith("CONFIG_first_card_"):
kv = line.split("=")
l1conf[0].append((kv[0][l... | jchuang1977/openwrt | package/lean/mt/drivers/wifi-l1profile/make-l1profile.py | Python | gpl-2.0 | 3,812 |
#!/usr/bin/env python
from distutils.core import setup, Extension
poppler_install_path = '/usr'
import multivio
setup(
name='multivio',
version=multivio.__version__,
description='Multivio server.',
long_description='''Multivio is a project...''',
license=multivio.__license__,
url='http://www.m... | jma/multivio_server | setup.py | Python | gpl-2.0 | 1,080 |
import glob, imp
import events
class EventManager:
def __init__(self):
self.Chat_Message_Event = events.ChatMessageEventHandler()
self.Player_Join_Event = events.PlayerJoinEventHandler()
self.Player_Leave_Event = events.PlayerLeaveEventHandler()
self.Player_Move_Event = events.Playe... | benbaptist/pymine2 | plugin.py | Python | gpl-2.0 | 849 |
#!/usr/env python
# Change this stuff:
name='Light Blue Fun Timexxxx'
author='Travis Wells'
shortname='litebluebg' # out file will be shortname with a 'vxp' extension
color=(155,204,224) # Set to the Red,Green,Blue of the color you want.
uniqueid=0 # Set to 0 if you don't have one.
#Don't change this stuff:
#RGB2VXP... | foone/7gen | bin/rgb2vxp.py | Python | gpl-2.0 | 6,990 |
#
# livecd.py: An anaconda backend to do an install from a live CD image
#
# The basic idea is that with a live CD, we already have an install
# and should be able to just copy those bits over to the disk. So we dd
# the image, move things to the "right" filesystem as needed, and then
# resize the rootfs to the size o... | icomfort/anaconda | livecd.py | Python | gpl-2.0 | 17,872 |
#----------------------------------------------------------------------
# This file was generated by D:\personal\src\airs\gui\images\make_images.py
#
from wx import ImageFromStream, BitmapFromImage, EmptyIcon
import cStringIO, zlib
def getData():
return zlib.decompress(
'x\xda\x01}\x08\x82\xf7\x89PNG\r\n... | jorgb/airs | gui/images/icon_about.py | Python | gpl-2.0 | 7,076 |
# -*- coding: utf-8 -*-
"""
-------------------------------------
N A C S P Y T H O N S C R I P T
-------------------------------------
NACS version: 2.0.2745 - pre3
NACS architecture: CENTOS 5.11 (X86_64)
File generated at Tue Jan 20 16:55:05 2015
On host 'lse86' by 'cae42'
"""
from __future__ import division ... | cosailer/caeproject | simulation_result/3/project3.py | Python | gpl-2.0 | 2,019 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Smile (<http://www.smile.fr>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | 3dfxsoftware/cbss-addons | smile_base/__init__.py | Python | gpl-2.0 | 1,012 |
#!/usr/bin/python
import unittest, tempfile, os, glob, logging
try:
import autotest.common as common
except ImportError:
import common
from autotest.client.shared import xml_utils, ElementTree
class xml_test_data(unittest.TestCase):
def get_tmp_files(self, prefix, sufix):
path_string = os.path... | ColinIanKing/autotest | client/shared/xml_utils_unittest.py | Python | gpl-2.0 | 12,510 |
## Copyright (C) 2007 Sadique Puthen <sputhenp@redhat.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 2 of the License, or
## (at your option) any later version.
## Thi... | portante/sosreport | sos/plugins/ipsec.py | Python | gpl-2.0 | 1,514 |
from mock import patch
import networkx as nx
from nav.models.manage import SwPortVlan, Vlan
from nav.netmap import topology
from nav.topology import vlan
from .topology_testcase import TopologyTestCase
class TopologyLayer2TestCase(TopologyTestCase):
def setUp(self):
super(TopologyLayer2TestCase, self).se... | UNINETT/nav | tests/unittests/netmap/topology_layer2_testcase.py | Python | gpl-2.0 | 3,029 |
from __future__ import unicode_literals
"""
AllSkyMap is a subclass of Basemap, specialized for handling common plotting
tasks for celestial data.
It is essentially equivalent to using Basemap with full-sphere projections
(e.g., 'hammer' or 'moll') and the `celestial` keyword set to `True`, but
it adds a few new metho... | bosscha/alma-calibrator | notebooks/selecting_source/allskymap.py | Python | gpl-2.0 | 16,580 |
"""
##############################################################################
##
##
## @name : StatsDateLib.py
##
## @license : MetPX Copyright (C) 2004-2006 Environment Canada
## MetPX comes with ABSOLUTELY NO WARRANTY; For details type see the file
## named COPYING in the root of the s... | khosrow/metpx | pxStats/lib/StatsDateLib.py | Python | gpl-2.0 | 32,661 |
import logging
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import useragents
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
from streamlink.utils import parse_json
log = logging.getLogger(__name__)
class Mitele(Plugin):
_url_re = re.compile(r"ht... | repotvsupertuga/tvsupertuga.repository | script.module.streamlink.base/resources/lib/streamlink/plugins/mitele.py | Python | gpl-2.0 | 2,844 |
#
# Copyright (C) 2008, 2013 Red Hat, Inc.
# Copyright (C) 2008 Cole Robinson <crobinso@redhat.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 2 of the License, or
# (at yo... | aurex-linux/virt-manager | virtManager/createpool.py | Python | gpl-2.0 | 18,923 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('jumpserver.views',
# Examples:
url(r'^$', 'index', name='index'),
# url(r'^api/user/$', 'api_user'),
url(r'^skin_config/$', 'skin_config', name='skin_config'),
url(r'^login/$', 'Login', name='login'),
url(r'^logout/$',... | xskh2007/zjump | jumpserver/urls.py | Python | gpl-2.0 | 955 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# test_crafting.py
import os
import sys
import unittest
root_folder = os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + os.sep + ".." )
pth = root_folder #+ os.sep + 'worldbuild'
sys.path.append(pth)
from worldbuild.crafting import craft as mod_craft
class Test... | acutesoftware/worldbuild | tests/test_crafting.py | Python | gpl-2.0 | 1,300 |
from modules.Utils import runCommand
import re
import sys
def parseOptions(command):
so, se, rc = runCommand("gofed %s --help" % command)
if rc != 0:
return []
options = []
option_f = False
for line in so.split("\n"):
if line == "Options:":
option_f = True
continue
if option_f == True:
if line ==... | fridex/gofed | parseOptions.py | Python | gpl-2.0 | 955 |
'''
Created on 24 Feb 2015
@author: oche
'''
from __future__ import unicode_literals
from __future__ import division
import argparse
import os
import sys
import time
import re
import logging
import json
import numpy
from plotter import makeSubPlot
from os.path import expanduser
from util import validURLMatch, validYo... | oche-jay/vEQ-benchmark | vEQ_benchmark.py | Python | gpl-2.0 | 13,919 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007-2009,2011 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 vers... | claudep/translate | translate/lang/el.py | Python | gpl-2.0 | 2,156 |
# -*- coding: utf-8 -*-
# Copyright 2012 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import re
from lxml.cssselect import CSSSelector
from zope.testbrowser.browser import Browser
from splinter.element_list import Element... | devenbansod/SWD-Query | splinter/driver/zopetestbrowser.py | Python | gpl-2.0 | 12,097 |
from __future__ import print_function, division, absolute_import
# Copyright (c) 2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNES... | Lorquas/subscription-manager | src/rhsmlib/dbus/util.py | Python | gpl-2.0 | 2,488 |
from unittest import TestCase
class TestLoadUser(TestCase):
def test_find_user(self):
from backend import load_user
user = load_user('Neill', 'password')
self.assertIsNotNone(user)
self.assertEqual(user.password, "Password")
user = load_user("Tony")
self.assertIsN... | neillc/memberdb-ng | backend/tests/test_load_user.py | Python | gpl-2.0 | 330 |
# -*- coding: utf-8 -*-
# Copyright (c) 2008 - 2009 Lukas Hetzenecker <LuHe@gmx.at>
from PyQt4.QtCore import *
from PyQt4.QtGui import *
# Matplotlib
try:
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4 import NavigationToolbar2QT as Navig... | ypid/series60-remote | pc/widget/ContactCanvas.py | Python | gpl-2.0 | 1,696 |
from routersploit.modules.creds.cameras.arecont.ssh_default_creds import Exploit
def test_check_success(target):
""" Test scenario - testing against SSH server """
exploit = Exploit()
assert exploit.target == ""
assert exploit.port == 22
assert exploit.threads == 1
assert exploit.defaults == ... | dasseclab/dasseclab | clones/routersploit/tests/creds/cameras/arecont/test_ssh_default_creds.py | Python | gpl-2.0 | 594 |
from random import shuffle
import pytest
from utils import testgen
from utils.version import current_version
from cfme.web_ui import paginator, summary_title
from cfme.containers.pod import Pod, paged_tbl as pod_paged_tbl
from cfme.containers.provider import ContainersProvider, paged_tbl as provider_paged_tbl,\
... | rananda/cfme_tests | cfme/tests/containers/test_relationships.py | Python | gpl-2.0 | 4,007 |
import json
import re
from trac.admin import IAdminCommandProvider
from trac.attachment import Attachment, IAttachmentChangeListener
from trac.core import Component, implements
from trac.versioncontrol import (
RepositoryManager, NoSuchChangeset, IRepositoryChangeListener)
from trac.web.api import HTTPNotFound, IR... | SpamExperts/trac-code-comments-plugin | code_comments/subscription.py | Python | gpl-2.0 | 17,278 |
from pyramid.httpexceptions import (
HTTPException,
HTTPFound,
HTTPNotFound,
HTTPBadRequest,
HTTPConflict,
)
from pyramid.security import Authenticated
from pyramid.view import view_config
from perpetualfailure.db import session
from perpetualfailure.knowledgebase.models import (
KB_Article,
... | ChatNode/PerpetualFailure | perpetualfailure/knowledgebase/views.py | Python | gpl-2.0 | 5,808 |
# DFF -- An Open Source Digital Forensics Framework
# Copyright (C) 2009-2010 ArxSys
# This program is free software, distributed under the terms of
# the GNU General Public License Version 2. See the LICENSE file
# at the top of the source tree.
#
# See http://www.digital-forensic.org for more information about this... | elthariel/dff | modules/viewer/hexedit/scrollbar.py | Python | gpl-2.0 | 5,795 |
import omf.cosim
glw = omf.cosim.GridLabWorld('6267', 'localhost', 'GC-solarAdd.glm', '2000-01-01 0:00:00')
glw.start()
print (glw.readClock())
# Changing solar gen status.
print (glw.read('test_solar', 'generator_status'))
glw.write('test_solar','generator_status', 'OFFLINE')
print ('Switched off solar')
print (glw.r... | dpinney/omf | omf/scratch/MPUPV/solarSwitch.py | Python | gpl-2.0 | 709 |
# Mustafa Hussain
# Digital Image Processing with Dr. Anas Salah Eddin
# FL Poly, Spring 2015
#
# Homework 3: Spatial Filtering
#
# USAGE NOTES:
#
# Written in Python 2.7
#
# Please ensure that the script is running as the same directory as the images
# directory!
import cv2
import copy
#import matplotlib.pyplot as p... | hmustafamail/digitalimageprocessing | HW 5 - Frequency Filtering/Spatial Filtering/spatialFiltering.py | Python | gpl-2.0 | 2,087 |
# yum-rhn-plugin - RHN support for yum
#
# Copyright (C) 2006 Red Hat, 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 2 of the License, or
# (at your option) a... | colloquium/spacewalk | client/rhel/yum-rhn-plugin/test/settestpath.py | Python | gpl-2.0 | 992 |
#
# Script to build RPM's using latest LIS code, it will build the RPM's and copy it to LISISO folder
# currently we have two source tree one for RHEL 5 and one for RHEL6
#
#
import os
import sys
import shutil
import subprocess
homedir = os.getcwd()
directory = "lis-next"
if os.path.exists(directory):
shutil.rmtree... | alexngmsft/lis-next | rpmbuild/createrpms.py | Python | gpl-2.0 | 5,034 |
#!/bin/env python
from CoaSim import *
cm = CustomMarker(0.1)
assert cm.position == 0.1
class MyMarker(CustomMarker):
def __init__(self,pos):
CustomMarker.__init__(self,pos)
def defaultValue(self):
return 1
def mutate(self, parentAllele, edgeLength):
return parentAllele+1
mm = My... | mailund/CoaSim | Python/customMarkerTest.py | Python | gpl-2.0 | 2,572 |
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Don't use the unicode-wrapped os and shutil modules here since
# the whole _selinux module itself will be wrapped.
import os
import shutil
import portage
from portage import _encodings
from portage import _uni... | fastinetserver/portage-idfetch | pym/portage/_selinux.py | Python | gpl-2.0 | 3,723 |
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, m... | MSEMJEJME/Get-Dumped | renpy/display/imagelike.py | Python | gpl-2.0 | 10,715 |
from main import KeyboardHandler
import threading
import thread
import pyatspi
def parse(s):
"""parse a string like control+f into (modifier, key).
Unknown modifiers will return ValueError."""
m = 0
lst = s.split('+')
if not len(lst):
return (0, s)
# Are these right?
d = {
"shif... | Oliver2213/Queriet | queriet/keyboard_handler/linux.py | Python | gpl-2.0 | 2,059 |
#!/usr/bin/env python
#
# Plugins.py
#
# 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,
# but WITHOUT ANY WARRANTY; w... | max0d41/ThugBrowser | src/DOM/Plugins.py | Python | gpl-2.0 | 1,544 |
import xml.etree.cElementTree
from os import environ, unlink, symlink, path
from Tools.Directories import SCOPE_SKIN, resolveFilename
import time
from Tools.StbHardware import setRTCoffset
class Timezones:
def __init__(self):
self.timezones = []
self.readTimezonesFromFile()
def readTimezonesFromFile(self):
t... | OpenSPA/dvbapp | lib/python/Components/Timezones.py | Python | gpl-2.0 | 1,411 |
#!/usr/bin/env python3
import math
import random
import mapp
import geom
class Robot:
def __init__(self, mapp, num_particles):
"""
Initialize the robot with a map.
Inputs:
mapp: a Map object on which the robot will move.
"""
self.d_sigma = 0.05 # ... | Lebuin/project-robotica | robot.py | Python | gpl-2.0 | 21,805 |
#!/usr/bin/python
#
# This file is part of the Lampadas Documentation System.
#
# Copyright (c) 2000, 2001, 2002 David Merrill <david@lupercalia.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 Fou... | tLDP/lampadas | pylib/data/search.py | Python | gpl-2.0 | 4,556 |
#!/usr/bin/env python3
"""
Sandbox for "swell-foop" command
"""
import glob
import os
import signal
import sys
import network_mod
import subtask_mod
class Main:
"""
Main class
"""
def __init__(self) -> None:
try:
self.config()
sys.exit(self.run())
except (EOF... | drtuxwang/system-config | bin/swell_foop_.py | Python | gpl-2.0 | 1,717 |
import logging
from autotest.client.shared import error
from virttest import aexpect, utils_misc
@error.context_aware
def run_autotest_regression(test, params, env):
"""
Autotest regression test:
Use Virtual Machines to test autotest.
1) Clone the given guest OS (only Linux) image twice.
2) Boot... | sathnaga/virt-test | tests/autotest_regression.py | Python | gpl-2.0 | 11,381 |
from Screens.Screen import Screen
from Components.GUIComponent import GUIComponent
from Components.VariableText import VariableText
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Button import Button
from Components.FileList import FileList
from Components.ScrollLabel imp... | popazerty/enigma2 | lib/python/Screens/LogManager.py | Python | gpl-2.0 | 19,571 |
# This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Philippe Biondi <phil@secdev.org>
# This program is published under a GPLv2 license
"""
SuperSocket.
"""
from __future__ import absolute_import
from select import select, error as select_error
import errno
imp... | mtury/scapy | scapy/supersocket.py | Python | gpl-2.0 | 11,654 |
import py, sys, platform
import pytest
from testing import backend_tests, test_function, test_ownlib
from cffi import FFI
import _cffi_backend
class TestFFI(backend_tests.BackendTests,
test_function.TestFunction,
test_ownlib.TestOwnLib):
TypeRepr = "<ctype '%s'>"
@staticmethod
... | mhnatiuk/phd_sociology_of_religion | scrapper/build/cffi/testing/test_ffi_backend.py | Python | gpl-2.0 | 9,406 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Copyright (C) 2009-2010 Fluendo, S.L. (www.fluendo.com).
# Copyright (C) 2009-2010 Marc-Andre Lureau <marcandre.lureau@gmail.com>
# Copyright (C) 2014 Juan Font Alonso <juanfontalonso@gmail.com>
# This file may be distributed and/or modified under the terms of
# th... | juanfont/hls-proxy | m3u8.py | Python | gpl-2.0 | 7,177 |
from django.apps import AppConfig
class FinancesConfig(AppConfig):
name = "finances"
| open-austin/influence-texas | src/influencetx/finances/apps.py | Python | gpl-2.0 | 91 |
# 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,
# bu... | thomas-schmid-ubnt/avocado | avocado/core/dispatcher.py | Python | gpl-2.0 | 8,715 |
"""
Classes and functions to handle storage devices.
This exports:
- two functions for get image/blkdebug filename
- class for image operates and basic parameters
"""
from __future__ import division
import errno
import logging
import os
import shutil
import re
import functools
import collections
from avocado.core... | balamuruhans/avocado-vt | virttest/storage.py | Python | gpl-2.0 | 36,710 |
import numpy as np
#x must be a np array
def lnbin(x, BinNum):
"""
Logarithmically bins a numpy array, returns (midpoints, Freq)
This function take the input of a data vector x, which is to be binned;
it also takes in the amount bins one would like the data binned into. The
output is two vectors,... | bkerster/utilities | lnbin.py | Python | gpl-2.0 | 1,964 |
#
# Copyright 2010-2011 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | kvaps/vdsm | vdsm/storage/lvm.py | Python | gpl-2.0 | 44,652 |
# -*- coding:utf-8 -*-
def decode(data):
try:
value, idx = __decode(data, 0)
retval = (True, value)
except Exception as e:
retval = (False, e.message)
finally:
return retval
def encode(data):
try:
value = __encode(data)
retval = (True, value)
excep... | fupenglin/PyDHT | dht_bencode.py | Python | gpl-2.0 | 2,915 |
#This file is distributed under the terms of the GNU General Public license.
#Copyright (C) 2011 Jekin Trivedi <jekintrivedi@gmail.com> (See the file COPYING for details).
from atlas import *
from physics import *
from physics import Quaternion
from physics import Vector3D
import server
class Repairing(server.Task):... | alriddoch/cyphesis | rulesets/mason/world/tasks/Repairing.py | Python | gpl-2.0 | 3,147 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yan Yan'
'''
Deployment toolkit.
'''
import os, re
from datetime import datetime
from fabric.api import *
env.user = 'michael'
env.sudo_user = 'root'
env.hosts = ['192.168.0.3']
db_user = 'www-data'
db_password = 'www-data'
_TAR_FILE = 'dist-awesome.tar... | Byronic94/py-blog | fabfile.py | Python | gpl-2.0 | 5,473 |
import sys
import string
f = sys.stdin
g = sys.stdout
echo = 0
while 1:
l = f.readline()
if not l: break
ll=string.strip(l)
if ll=='BEGIN-LOG':
echo = 1
elif ll=='END-LOG':
echo = 0
elif echo:
l=string.replace(l,"-0.000"," 0.000") # squish annoying negative zeros
g.write(l)
| gratefulfrog/lib | python/pymol/pymol_path/test/trim.py | Python | gpl-2.0 | 319 |
# encoding=utf-8
import codecs
import sys
from src.view.FileProcessingOutput import FileProcessingOutput
class FileProcessing():
def __init__(self):
self.fileProcessingOutput = FileProcessingOutput()
def read_input_file(self, file_path, file_type):
'''
Lectura de archivo y procesamie... | r4wd3r/VAGO | src/controller/FileProcessing.py | Python | gpl-2.0 | 2,276 |
import serial
class SerialConnection:
"""RS-232 connection to the Agilent power supply"""
def __init__(self, port='/dev/usb/ttyUSB0', baudrate=9600, parity=serial.PARITY_NONE, bytesize=serial.EIGHTBITS):
"""Initialize the connection"""
self.serial = serial.Serial(port=port, baudrate=baudrate, parity=parity... | delaere/aaptos | SerialConnection.py | Python | gpl-2.0 | 1,127 |
# encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class PrintStatus(__gobject.GEnum):
# no doc
def __init__(s... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/PrintStatus.py | Python | gpl-2.0 | 792 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 by Kai Blin
#
# Plunger 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 hop... | kblin/plunger | plunger/plugins/md3.py | Python | gpl-2.0 | 7,657 |
# -*- coding: utf-8 -*-
# __author__: Yixuan LI
# __email__: yl2363@cornell.edu
import os
import json
import re
from optparse import OptionParser
import tweepy
import time
class UserTimeline:
def __init__(self,inputDir,outputDir):
self.inputDir = inputDir
self.outputDir = outputDir
os.system("mkdir -p %s"%(o... | YixuanLi/geo-tweet | twitter-timeline/get_non_locator_timeline.py | Python | gpl-2.0 | 5,282 |
import math
import random
import GameData
from Util.TileTypes import *
from Util import Line, StarCallback
def initializeRandom( x, y ):
dist = math.sqrt( x ** 2 + y ** 2 )
angle = math.atan2( x, y ) / math.pi * 5
rand = ( random.random() * 7 ) - 3.5
val = ( ( dist + angle + rand ) % 10 )
if val ... | KevinVDVelden/7DRL_2015 | Game/MapGen.py | Python | gpl-2.0 | 4,996 |
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | sgallagher/anaconda | pyanaconda/modules/storage/partitioning/specification.py | Python | gpl-2.0 | 6,228 |
import bpy
from .utils import MultiCamContext
class MultiCamFadeError(Exception):
def __init__(self, msg):
self.msg = msg
def __str__(self):
return repr(self.msg)
class BlendObj(object):
def __init__(self, **kwargs):
self.children = set()
p = self.parent = kwargs.g... | nocarryr/blender-scripts | multicam_tools/multicam.py | Python | gpl-2.0 | 11,734 |
import time
import traceback
from .optionparser import args
debug_level=args.debug or 0
debug_file=args.debug_file
timestamp=args.time
if debug_file:
import re
debug_file = re.compile(debug_file)
if debug_level > 0: print('DEBUG_LEVEL=',debug_level)
if debug_file: print('DEBUG_FILE=',debug_file)
def debug... | kirienko/gourmet | src/gourmet/gdebug.py | Python | gpl-2.0 | 2,063 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012 Anne Archibald <peridot.faceted@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... | jwvhewitt/dmeternal | old_game/container.py | Python | gpl-2.0 | 8,515 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | mjuric/duplicity | duplicity/backends/hsibackend.py | Python | gpl-2.0 | 2,314 |
# -*- coding: utf-8 -*-
from canaimagnulinux.wizard.interfaces import IChat
from canaimagnulinux.wizard.interfaces import ISocialNetwork
from canaimagnulinux.wizard.utils import CanaimaGnuLinuxWizardMF as _
from collective.beaker.interfaces import ISession
from collective.z3cform.wizard import wizard
from plone impor... | CanaimaGNULinux/canaimagnulinux.wizard | canaimagnulinux/wizard/browser/socialnetwork.py | Python | gpl-2.0 | 3,378 |
# -*- coding: utf-8 -*-
import application
import platform
import exceptions
from ctypes import c_char_p
from libloader import load_library
import paths
if platform.architecture()[0][:2] == "32":
lib = load_library("api_keys32", x86_path=paths.app_path("keys/lib"))
else:
lib = load_library("api_keys64", x64_path=path... | codeofdusk/ProjectMagenta | src/keys/__init__.py | Python | gpl-2.0 | 847 |
import itertools
from django.conf import settings
from django.contrib.syndication.views import Feed, FeedDoesNotExist
from django.utils import timezone
from schedule.feeds.ical import ICalendarFeed
from schedule.models import Calendar
class UpcomingEventsFeed(Feed):
feed_id = "upcoming"
def feed_title(self... | tommybobbins/PiThermostat | django/hotf/schedule/feeds/__init__.py | Python | gpl-2.0 | 1,787 |
import logging
from django.db import models
class BaseModel(models.Model):
class Meta:
# Makes django recognize model in split modules
app_label = 'sdn'
# Turns this into an abstract model (does not create table for it)
abstract = True
# Default exception for models in manager... | ComputerNetworks-UFRGS/AuroraSDN | sdn/models/base_model.py | Python | gpl-2.0 | 601 |
# -*- coding:UTF-8 -*-
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.layers import Embedding
from keras.layers import LSTM,Flatten
import numpy as np
import loadpkl
(X_train, y_train),(X_test, y_test) = loadpkl.load_data()
#print "hello"
X_train = np.array(X_train)... | lefteye/superroutingchioce | model.py | Python | gpl-2.0 | 2,888 |
"""
Module with universal etree module
"""
__all__ = ('etree', )
try:
from lxml import etree
except ImportError:
try:
import xml.etree.cElementTree as etree
except (ImportError, SystemError):
import xml.etree.ElementTree as etree
| bacher09/gpackages-metadata | packages_metadata/generic_metadata/my_etree.py | Python | gpl-2.0 | 262 |
# Copyright 2007, Red Hat, Inc
# James Bowes <jbowes@redhat.com>
# Alex Wood <awood@redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free So... | kadamski/func | func/minion/modules/yumcmd.py | Python | gpl-2.0 | 2,371 |
#!/usr/bin/env python
# coding=utf8
#
"""
Python SDK for Weibo
Simple wrapper for weibo oauth2
author: seraphwlq@gmail.com
"""
import time
from utils.http import request
from utils.http import SDataDict
from utils.http import encode_params
from utils.const import WEIBO_DOMAIN
from utils.const import WEIBO_VERSION... | seraphln/chat2all | chat2all/sso/weibo/api.py | Python | gpl-2.0 | 3,381 |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetCategories
# Returns the latest category hierarchy for the eBay site.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# yo... | willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/eBay/Trading/GetCategories.py | Python | gpl-2.0 | 5,654 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import cv2
from Tkinter import *
from PIL import Image, ImageTk
import tkFileDialog
appname = "example"
class App(object):
def __init__(self, root=None):
if not root:
root = Tk()
self.root = root
self.initUI()
def initUI(self):
... | zrafa/ev | python+tk+opencv/ejemplo-funciona.py | Python | gpl-2.0 | 2,626 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Description: File system resilience testing application
# Author: Hubert Kario <hubert@kario.pl>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright (c) 2015 Hubert Kario. All rights reserved.
#
# This ... | tomato42/fsresck | tests/nbd/test_request.py | Python | gpl-2.0 | 6,139 |
'''
Created on Jan 19, 2013
@author: dsnowdon
'''
import os
import tempfile
import datetime
import json
import logging
from naoutil.jsonobj import to_json_string, from_json_string
from naoutil.general import find_class
import robotstate
from event import *
from action import *
from naoutil.naoenv import make_enviro... | davesnowdon/nao-wanderer | wanderer/src/main/python/wanderer/wanderer.py | Python | gpl-2.0 | 14,410 |
#! /usr/bin/python3
import re
err = "La contraseña no es segura"
msg = "Escriba una contraseña al menos 8 caracteres alfanumericos"
def ismayor8(a):
"""
Compara si es mayor a 8 caracteres
"""
if (len(a) < 8):
return False
return True
def minus(a):
"""
compara si existe alguna le... | IntelBUAP/Python3 | Evaluaciones/tuxes/eva2/validapass.py | Python | gpl-2.0 | 1,660 |
from typing import List
class Solution:
def transformArray2(self, arr: List[int]) -> List[int]:
while True:
arr2 = [a for a in arr]
changed = 0
for id in range(1, len(arr) - 1):
l = arr[id - 1]
r = arr[id + 1]
m = arr[id]
... | lmmsoft/LeetCode | LeetCode-Algorithm/1243. Array Transformation/1243.py | Python | gpl-2.0 | 992 |
#!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
import sqlite3
def main():
print('connect')
db = sqlite3.connect('db-api.db')
cur = db.cursor()
print('create')
cur.execute("DROP TABLE IF EXISTS test")
cur.execute("""
CREATE TABLE test (
id INTEG... | ketan-analytics/learnpython | IntermediatePython/Lynda_Bill_PYEssential/SQL.py | Python | gpl-2.0 | 1,160 |
# coding: utf8
# OeQ autogenerated lookup function for 'Window/Wall Ratio East in correlation to year of construction, based on the source data of the survey for the "German Building Typology developed by the "Institut für Wohnen und Umwelt", Darmstadt/Germany, 2011-2013'
import math
import numpy as np
import oeqLooku... | UdK-VPT/Open_eQuarter | mole/stat_corr/window_wall_ratio_east_SDH_by_building_age_lookup.py | Python | gpl-2.0 | 1,995 |
# -*- coding: utf-8 -*-
from shutil import rmtree
from tempfile import mkdtemp
from omdbapi import OMDbAPI
from scrusubtitles import ScruSubtitles
from scrusubtitles import ScruSubtitlesListener
from scrusubtitles import ScruSubtitlesLogger
class TestService(ScruSubtitlesListener, ScruSubtitlesLogger):
def __in... | systemcrash/service.subtitles.subs_com_ru | resources/lib/scrutest.py | Python | gpl-2.0 | 2,013 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-03 10:44
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('domains', '0003_auto_20161103_1031'),
]
operations... | adithyabhatkajake/kompile | domains/migrations/0004_auto_20161103_1044.py | Python | gpl-2.0 | 678 |
'''
adaboost.py script can be used to train and test adaboost with a SGDclassifier
for mnist data. Look up commandline options for more information.
'''
import argparse
import cPickle as pickle
import numpy as np
import pylab as pl
import time
from sklearn.ensemble import AdaBoostClassifier
from sklearn.linear_mod... | vmr2117/nnet | src/adaboost/adaboostSAMME.py | Python | gpl-2.0 | 5,974 |
from collections import namedtuple
import fcntl
import os
import shutil
from pcs.common.tools import format_os_error
# TODO add logging (logger / debug reports ?) to the RawFile class; be aware
# the class is used both in pcs.cli and pcs.lib packages
FileMetadata = namedtuple(
"FileMetadata",
[
"file... | feist/pcs | pcs/common/file.py | Python | gpl-2.0 | 6,496 |
import gobject
import gtk
class Downloader(gtk.Dialog):
def __init__(self, path):
self.__is_cancelled = False
gtk.Dialog.__init__(self, title = "", buttons = (gtk.STOCK_CANCEL,
gtk.RESPONSE_CANCEL))
self.set_default_size(300, 100)... | RaumZeit/gdesklets-core | shell/plugins/PackageInstaller/Downloader.py | Python | gpl-2.0 | 3,008 |
# PyJVM (pyjvm.org) Java Virtual Machine implemented in pure Python
# Copyright (C) 2014 Andrew Romanenco (andrew@romanenco.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 ... | andrewromanenco/pyjvm | pyjvm/class_path.py | Python | gpl-3.0 | 3,299 |
"""
3D.py is the interface for plotting Skeleton Wireframes in a 3D
perspective using matplotlib
"""
# 3D Plotting tool
from matplotlib import pyplot as plt
from matplotlib import animation
from mpl_toolkits.mplot3d import Axes3D
# PyKinect XEF modules
import Colour
#: 3D View Obj
class View:
def __ini... | Qirky/PyKinectTk | PyKinectTk/utils/3D.py | Python | gpl-3.0 | 2,821 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | nop33/indico-plugins | piwik/indico_piwik/queries/utils.py | Python | gpl-3.0 | 1,914 |
"""Test MQTT connections."""
import unittest
from infopanel import mqtt
from infopanel.tests import load_test_config
class TestMqtt(unittest.TestCase):
"""Test connectivity with MQTT."""
@classmethod
def setUpClass(cls):
cls.conf = load_test_config()
def setUp(self):
"""Set up each... | partofthething/infopanel | infopanel/tests/test_mqtt.py | Python | gpl-3.0 | 818 |
# Author: Paul Wollaston
# Contributions: Luke Mullan
#
# This client script allows connection to Deluge Daemon directly, completely
# circumventing the requirement to use the WebUI.
import json
from base64 import b64encode
import sickbeard
from sickbeard import logger
from .generic import GenericClient
from synchron... | eXistenZNL/SickRage | sickbeard/clients/deluged_client.py | Python | gpl-3.0 | 6,499 |
from core.engine import hplayer
# PLAYER
player = hplayer.addplayer('mpv', 'gadagne')
# Interfaces
player.addInterface('osc', 4000, 4001)
player.addInterface('http', 8080)
# player.addInterface('gpio', [16,19,20,21,26])
# GADAGNE logic
defaultFile = 'media0.mp4'
push1File = 'media1.mp4'
push2File = 'media2.mp4'
push... | Hemisphere-Project/HPlayer2 | profiles/_legacy/gadagne.py | Python | gpl-3.0 | 696 |
#!/usr/bin/env python3
"""
Loader
import modules from zip files that are stored in ./libs/ directory
author: Steve Göring
contact: stg7@gmx.de
2014
"""
import os
import sys
for m in filter(lambda x: ".zip" in x, os.listdir(os.path.dirname(os.path.realpath(__file__)) + "/libs")):
sys.path.ins... | stg7/papyrus | loader.py | Python | gpl-3.0 | 464 |
# Name: mapper_opendap_sentinel1.py
# Purpose: Nansat mapping for ESA Sentinel-1 data from the Norwegian ground segment
# Author: Morten W. Hansen
# Licence: This file is part of NANSAT. You can redistribute it or modify
# under the terms of GNU General Public License, v.3
# ... | nansencenter/nansat | nansat/mappers/mapper_opendap_sentinel1.py | Python | gpl-3.0 | 4,824 |
import sys
import os
import io
from pkg_resources import parse_version
import wx
if parse_version(wx.__version__) < parse_version('2.9'):
tmpApp = wx.PySimpleApp()
else:
tmpApp = wx.App(False)
from psychopy import experiment
from psychopy.experiment.components import getAllComponents
# usage: generate or com... | psychopy/psychopy | psychopy/tests/test_experiment/needs_wx/genComponsTemplate.py | Python | gpl-3.0 | 4,702 |
# This file is part of PARPG.
# PARPG 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.
# PARPG is distributed in the hope ... | parpg/parpg | parpg/gui/slot.py | Python | gpl-3.0 | 889 |
#!/usr/bin/python
# This file is part of PARPG.
# PARPG 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.
# PARPG is distr... | orlandov/parpg-game | scripts/objects/containers.py | Python | gpl-3.0 | 1,128 |
#
# FLOGGER
#
# This program reads records from the OGN network processing only
# those received from a specified site and registration marks, eg aircraft belonging to
# a specific club.
# It writes each record to a database and at the end of each day process
# them to determine the flight times of each flight for eac... | tobiz/OGN-Flight-Logger_V3 | flogger3.py | Python | gpl-3.0 | 77,519 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.