code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/bin/env python
#
# This file is part Protein Engineering Analysis Tool (PEAT)
# (C) Copyright Jens Erik Nielsen, University College Dublin 2003-
# All rights reserved
#
# Damien Farrell April 2010
from Tkinter import *
import Pmw
class YasaraControl(Frame):
"""A yasara controller for comparison use... | dmnfarrell/peat | PEATDB/Yasara.py | Python | mit | 1,231 |
import numpy as np
from model import GAN, discriminator_pixel, discriminator_image, discriminator_patch1, discriminator_patch2, generator, discriminator_dummy
import utils
import os
from PIL import Image
import argparse
from keras import backend as K
# arrange arguments
parser=argparse.ArgumentParser()
parser.add_arg... | jaeminSon/V-GAN | codes/train.py | Python | mit | 6,553 |
from __future__ import unicode_literals
class User(object):
def __init__(self, app, id, name, adapter):
self.app = app
self.id = id
self.name = name
self.chat = adapter.create_chat_with(self.id)
self.storage = app.get_storage('communication:{}:users:{}'.format(
... | KiraLT/KiraBot | src/kirabot/kirabot/communication/user.py | Python | mit | 425 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.auth.models
import django.utils.timezone
from django.conf import settings
import django.core.validators
import forum.models
class Migration(migrations.Migration):
dependencies = [
... | michaelyou/One-piece-forum | forum/migrations/0001_initial.py | Python | mit | 12,680 |
import os
import sys
import scandir
import pymmh3 as mmh3
import misc
def log_paths_dict(d, record_key = 'input', nest_depth = 1, sep = ':',
cl_args_list = sys.argv):
'''
Records contents of dictionary d at record_key on nest_depth.
Assumes unnested elements of d follow human-name: file... | gslab-econ/gslab_python | gslab_scons/log_paths_dict.py | Python | mit | 5,515 |
# -*- coding: utf-8 -*-
from unittest import TestCase
from nose.tools import eq_
from mock import Mock
from datetime import datetime
from tests.constants import STRING, NUMBER, DATE
from tests.asserters import eq_obj
from danmaku.cores.danmaku_process import generate_danmaku
from danmaku.cores.danmaku_process import ... | OctavianLee/Barrage | tests/cores/test_danmaku_process.py | Python | mit | 4,281 |
from ..abstractdriver import AbstractDriver
import numpy as np
import os
class FreeCADDriver(AbstractDriver):
def __init__(self, debug=False):
super(FreeCADDriver, self).__init__()
self._debug = debug
self._program_name = "FreeCAD"
def get_program_name(self):
return self._pro... | DanielWinklehner/py_particle_processor | py_particle_processor_qt/drivers/FreeCADDriver/FreeCADDriver.py | Python | mit | 2,334 |
#!/usr/bin/python
# TODO: issues with new oauth2 stuff. Keep using older version of Python for now.
# #!/usr/bin/env python
import subprocess
import praw
import datetime
import pyperclip
from hashlib import sha1
from flask import Flask
from flask import Response
from flask import request
from cStringIO import StringI... | foobarbazblarg/stayclean | stayclean-2017-may/serve-challenge-with-flask.py | Python | mit | 10,823 |
"""
By Simon Harms.
Copyright 2015 Simon Harms, MIT LICENSE
Name: Stack2
Summary: Stack Version 2
"""
class Stack:
"""
Python Stack V2 with view and change.
"""
def __init__(self):
"""
Initialize the Stack.
"""
self.__storage = []
def is_empty(self):
"""
... | XiKuuKy/Stack2 | Stack2.py | Python | mit | 1,481 |
from ritoapi.endpoints.match_v3 import MatchV3
import threading
def _load_matches(match_v3, sample_region, sample_match_id, count):
for i in range(count):
data = match_v3.matches(sample_region, sample_match_id)
assert(data['gameId'] == sample_match_id)
def test_matches_stress(sample_api_key, sam... | FancyRice/RitoAPI | ritoapi/tests/test_stress.py | Python | mit | 655 |
import os
from conans.tools import unzip
import shutil
from conans.util.files import rmdir, mkdir
from conans.client.remote_registry import RemoteRegistry
from conans import tools
from conans.errors import ConanException
def _handle_remotes(registry_path, remote_file, output):
registry = RemoteRegistry(registry_p... | lasote/conan | conans/client/conf/config_installer.py | Python | mit | 4,484 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import mechanize
from links import links
class LinksTest(unittest.TestCase):
"""Test para 'links.py'"""
def test_obtener_parametros_de_la_url(self):
url_unlam = 'http://www.unlam.edu.ar/index.php'
url_unlam_con_parametros = '... | leapalazzolo/XSS | test/test_links.py | Python | mit | 5,360 |
from .attribute import html_attribute
from .element import VoidElement
class Image(VoidElement):
"""An HTML image (<img>) element.
Images must have an alternate text description that describes the
contents of the image, if the image can not be displayed. In some
cases the alternate text can be empty.... | srittau/python-htmlgen | htmlgen/image.py | Python | mit | 952 |
from django.db import models
from botManager.models import Bot
class Activist(models.Model):
identifier = models.CharField(max_length=200)
name = models.CharField(max_length=200)
username = models.CharField(max_length=200)
reg_date = models.DateTimeField('Date registered', auto_now_add=True)
bot ... | stefan2904/activismBot | activistManager/models.py | Python | mit | 477 |
import os
from pynsett.discourse import Discourse
from pynsett.drt import Drs
from pynsett.extractor import Extractor
from pynsett.knowledge import Knowledge
_path = os.path.dirname(__file__)
text = "John Smith is not blond"
drs = Drs.create_from_natural_language(text)
drs.plot()
print(drs) | fractalego/pynsett | pynsett/examples/negation.py | Python | mit | 294 |
#!/usr/bin/python
from participantCollection import ParticipantCollection
import string
import re
import datetime
import pyperclip
# Edit Me!
# Remember, this is during signup, so current month is not June, it's May.
currentMonthTotalDays = 31
currentMonthURL = "https://www.reddit.com/r/pornfree/comments/5lefq1/stay_c... | foobarbazblarg/stayclean | stayclean-2017-february/display-during-signup.py | Python | mit | 6,610 |
import curses
import sys
import time
import os.path
import random
import pickle
from curses import wrapper
gamedims = [5,22]
currPos = [10,10]
currPosList = [1,3]
def main(stdscr):#{
curses.start_color()
curses.init_pair(1, curses.COLOR_WHITE, curses.COLOR_BLACK)
curses.init_pair(2, curses.COLOR_BLACK, curses.COL... | OliGon/pycurse | Version-0.1/Curses-GoL-0.9.py | Python | mit | 28,137 |
# -*- coding: utf-8 -*-
__author__ = 'Sergey Efimov'
| serefimov/billboards | billboards/boards/parsing/__init__.py | Python | mit | 57 |
from django.conf.urls import url, include
from django.conf import settings
from paying_for_college.views import LandingView
from django.contrib import admin
# from django.conf.urls.static import static
urlpatterns = [
# url(r'^admin/', include(admin.site.urls)),
url(r'^$',
LandingView.as_view(), name='... | ascott1/college-costs | paying_for_college/config/urls.py | Python | cc0-1.0 | 801 |
"""
Crawls a terrain raster from a starting
point and "floods" everything at the same
or lower elevation by producing a mask
image of 1,0 values.
"""
import numpy as np
from linecache import getline
def floodFill(c,r,mask):
"""
Crawls a mask array containing
only 1 and 0 values from the
starting... | nchaparr/Geospatial-Analysis-with-Python | 1138_08_03-flood-fill.py | Python | cc0-1.0 | 2,243 |
"""Builder for Current and Pending Reports."""
import datetime as dt
import sys
import time
from argparse import RawTextHelpFormatter
import nameparser
from regolith.helpers.basehelper import SoutHelperBase, DbHelperBase
from regolith.dates import month_to_int, month_to_str_int
from regolith.fsclient import _id_key
f... | scopatz/regolith | regolith/helpers/a_proprevhelper.py | Python | cc0-1.0 | 4,818 |
import math
class Neptune:
"""
NEPTUNE - VSOP87 Series Version C
HELIOCENTRIC DYNAMICAL ECLIPTIC AND EQUINOX OF THE DATE
Rectangular (X,Y,Z) Coordinates in AU (Astronomical Units)
Series Validity Span: 4000 BC < Date < 8000 AD
Theoretical accuracy over span: +-1 arc sec
... | zdomjus60/astrometry | vsop87c/neptune.py | Python | cc0-1.0 | 232,946 |
from xml.etree.ElementTree import ElementTree
from xml.etree.ElementTree import Element
import xml.etree.ElementTree as etree
from xml.dom import minidom
import io
"""
using xml.etree.ElementTree
"""
def prettify(elem):
"""Return a pretty-printed XML string for the Element.
"""
rough_string = etree.tostr... | hoaibang07/Webscrap | sources/xmldemo/xmlcreate.py | Python | gpl-2.0 | 731 |
from distutils.core import setup
setup(
name = 'voxgenerator',
packages = ['voxgenerator',
'voxgenerator.core',
'voxgenerator.plugin',
'voxgenerator.pipeline',
'voxgenerator.generator',
'voxgenerator.service',
'voxge... | benoitfragit/VOXGenerator | setup.py | Python | gpl-2.0 | 1,170 |
#/usr/bin/env python
# -#- coding: utf-8 -#-
#
# equity_master/tests/__init__.py - equity masger unit test package
#
# Standard copyright message
#
#
#
# Initial version: 2012-04-02
# Author: Amnon Janiv
"""
.. module:: equity_master/tests
:synopsis: equity_master module unit test package
This package is... | ajaniv/equitymaster | tests/__init__.py | Python | gpl-2.0 | 1,668 |
import logging
class BaseDebugInterface(object):
def __init__(self, debuger):
self.robotDebuger = debuger
self.debugCtx = debuger.debugCtx
self.logger = logging.getLogger("rbt.int")
self.bp_id = 0
def start(self, settings):
"""start debug interface."""
... | deonwu/robotframework-debuger | src/rdb/interface/base.py | Python | gpl-2.0 | 3,484 |
# Copyright (C) 2013 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 in ... | bwildenhain/virt-manager | tests/test_urls.py | Python | gpl-2.0 | 11,455 |
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1+
# Generate autosuspend rules for devices that have been tested to work properly
# with autosuspend by the Chromium OS team. Based on
# https://chromium.googlesource.com/chromiumos/platform2/+/master/power_manager/udev/gen_autosuspend_rules.py
import chromium... | filbranden/systemd | tools/make-autosuspend-rules.py | Python | gpl-2.0 | 938 |
import os
import hashlib
import datetime
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.db import connection
from django.db.models.signals import post_save
def set_user_password(user, password):
if user and password:
password = passwor... | Bozhidariv/statisticum | statisticum/profiles/models.py | Python | gpl-2.0 | 1,019 |
# -*- Mode:Python; -*-
# /*
# * Copyright (c) 2010 INRIA
# *
# * 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 b... | nsnam/ns-3-dev-git | src/core/examples/sample-simulator.py | Python | gpl-2.0 | 2,886 |
#
# Copyright (c) 2010, 2015, 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 th... | mysql/mysql-utilities | mysql-test/t/import_errors.py | Python | gpl-2.0 | 15,732 |
'''
ps = psi4.Solver
with psi4.quite_run():
ps.prepare_chkpt(mo_coeff, fock_on_mo, nelec, e_scf, nuclear_repulsion)
ecc = ps.energy('CCSD', c.shape[1], hcore_on_mo, eri_on_mo)
rdm1, rdm2 = ps.density(mo_coeff.shape[1])
eccsdt = ps.energy('CCSD(T)', c.shape[1], hcore_on_mo, eri_on_mo)
rdm1, rdm2 = p... | sunqm/psi4-cc | psi4/__init__.py | Python | gpl-2.0 | 434 |
#!/usr/bin/python
from pisi.actionsapi import shelltools, get, autotools, pisitools
def setup():
autotools.configure ("--prefix=/usr\
--disable-static")
def build():
autotools.make ()
def install():
autotools.rawInstall ("DESTDIR=%s" % get.installDIR())
pisitools.dodoc ... | richard-fisher/repository | system/base/libffi/actions.py | Python | gpl-2.0 | 355 |
# -*- coding: utf-8 -*-
import time
class Timer(object):
'''
Simple timer control
'''
def __init__(self, delay):
self.current_time = 0
self.set_delay(delay)
def pause(self, pause):
if pause >= self.delay:
self.current_time = time.clock()
... | pantuza/art-gallery | src/timer.py | Python | gpl-2.0 | 1,202 |
import networkx as nx
import networkx.algorithms as alg
import numpy as np
import matplotlib.pyplot as plt
# create graph object
twitter = nx.Graph()
# add users
twitter.add_node('Tom', {'age': 34})
twitter.add_node('Rachel', {'age': 33})
twitter.add_node('Skye', {'age': 29})
twitter.add_node('Bob', {'age': 45})
twit... | drabastomek/practicalDataAnalysisCookbook | Codes/Chapter08/graph_handling.py | Python | gpl-2.0 | 7,099 |
# -*- coding: utf-8 -*-
"""Test suite for the TG app's models"""
from __future__ import unicode_literals
from nose.tools import eq_
from wiki20 import model
from wiki20.tests.models import ModelTest
class TestGroup(ModelTest):
"""Unit test case for the ``Group`` model."""
klass = model.Group
attrs = dict(... | txdywy/wiki20 | wiki20/tests/models/test_auth.py | Python | gpl-2.0 | 1,523 |
from django.core.serializers import json
from django.http import HttpResponseNotFound, HttpResponse
from django.views.generic import View
from rest_test_data.models import Simple
from rest_test_data.views import BaseTestDataRestView
from nose.tools import assert_equal, assert_is_instance
from mock import Mock, patch
... | hogarthww/django-rest-test-data | rest_test_data/tests/test_base.py | Python | gpl-2.0 | 4,061 |
__author__ = 'mark'
# StarinetPython3Logger a data logger for the Beaglebone Black.
# Copyright (C) 2015 Mark Horn
#
# This file is part of StarinetPython3Logger.
#
# StarinetPython3Logger is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the... | mhorn71/StarinetPythonLogger | utilities/staribuscrc.py | Python | gpl-2.0 | 2,214 |
# This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | seankelly/buildbot | master/buildbot/reporters/http.py | Python | gpl-2.0 | 4,489 |
from time import time
import unittest
from unittest.mock import patch, Mock
from urllib.error import URLError
from suds import WebFault
from ..exceptions import (
ConnectError, ServiceError, ApiLimitError, AccountFault, TableFault, ListFault)
from .. import client
class InteractClientTests(unittest.TestCase):
... | jslang/responsys | responsys/tests/test_client.py | Python | gpl-2.0 | 7,054 |
# -*- coding: latin-1 -*-
##
## Copyright (c) 2000, 2001, 2002, 2003 Thomas Heller
##
## 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 limitatio... | skeenp/Roam | libs/py2exe-0.6.9/py2exe/resources/VersionInfo.py | Python | gpl-2.0 | 9,595 |
#!/usr/bin/env python
#coding:utf-8
# Author: Beining --<cnbeining#gmail.com>
# Purpose: A Chrome DCP handler.
# Created: 07/15/2015
#Original copyright info:
#Author: Xiaoxia
#Contact: xiaoxia@xiaoxia.org
#Website: xiaoxia.org
import sys
import argparse
from threading import Thread, Lock
from struct import unpac... | power12317/Chrome-Data-Compression-Proxy-Standalone-Python | google.py | Python | gpl-2.0 | 6,470 |
# -*- coding: utf-8 -*-
'''
Created on Jul 04, 2016
Modified on Aug 05, 2016
Version 0.01.b
@author: rainier.madruga@gmail.com
A simple Python Program to scrape the ESPN FC website for content.
### =========================================================================================== ###
### Change & Revision Log ... | rainier-m/python-soccer | parseBBC-Leagues.py | Python | gpl-2.0 | 6,099 |
#csv module.
import csv
from geopy import geocoders
from collections import defaultdict
import json
def checkgeocode(geocode):
#return len(geocode)
if len(geocode) < 9:
return "0"+str(geocode)
else:
return geocode
with open('casualty.csv', 'rb') as f:
reader = csv.reader(f)
codelist = dict()
f... | rukku/casualty-geocoder | alpha.py | Python | gpl-2.0 | 1,956 |
# -*- coding: utf-8 -*-
__author__ = 'lxr0827'
import pymysql,requests,json
import datetime
#定时运行该脚本获取accesstoken,记录到accesstoken module里
#test
APPID = "wx243dd553e7ab9da7"
SECRET = "57f109fd1cce0913a76a1700f94c4e2d"
AccessTokenURL = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' + APPID... | lxr0827/weChatOrder | weChatOrder/WeInterc/get_access_token.py | Python | gpl-2.0 | 1,465 |
from collections import defaultdict
class Solution:
def longestDecomposition(self, text: str) -> int:
num = 0
L = len(text)
l, r = 0, L - 1
mp1 = defaultdict(int)
mp2 = defaultdict(int)
while l < r:
mp1[text[l]] += 1
mp2[text[r]] += 1
... | lmmsoft/LeetCode | LeetCode-Algorithm/1147. Longest Chunked Palindrome Decomposition/1147.py | Python | gpl-2.0 | 896 |
#encoding=utf-8
#------------------------------------------------------------------
# File Name: crawler_wikipedia_v0.py
# Author: yy
# Mail: RNHisnothuman@gmail.com
# Date: 2014年02月12日 星期三 15时15分24秒
#-------------------------------------------------------------------
import time
import sys
import string
import ur... | ReiMaster/WordsCrawler | crawler_wikipedia.py | Python | gpl-2.0 | 4,044 |
def get_timestamp():
import time
return int(time.time())
def load_name_map(map_file_path):
from os.path import isfile
import ConfigParser
config = ConfigParser.RawConfigParser()
config.read(map_file_path)
if not config.has_section("effort"):
raise Exception("Missing effort in {0}... | kd0kfo/timeclock | timeclock/__init__.py | Python | gpl-2.0 | 464 |
import os
import sys
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.utils import process
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')
basedir = os.path.abspath(basedir)
class StandaloneTests(unittest.TestCase):
def ... | Hao-Liu/avocado | selftests/functional/test_standalone.py | Python | gpl-2.0 | 2,525 |
# -*- coding: utf-8 -*-
"""Module for running microtests on how well the extraction works -
this module is STANDALONE safe"""
import ConfigParser
import glob
import traceback
import codecs
import bibclassify_config as bconfig
import bibclassify_engine as engine
log = bconfig.get_logger("bibclassify.microtest")
de... | pombredanne/invenio-old | modules/bibclassify/lib/bibclassify_microtests.py | Python | gpl-2.0 | 7,289 |
from PyQt4 import QtGui, QtCore
class Walls(QtGui.QGraphicsPixmapItem):
def __init__(self, name):
super(Walls, self).__init__()
self.setPixmap(QtGui.QPixmap(name))
def create_walls():
obstacles = []
wall1 = Walls("./resources/images/obstacle1.png")
wall1.setPos(175, 102)
wall2 ... | VickyTerzieva/Pacman | code/walls.py | Python | gpl-2.0 | 6,373 |
import os
BASEDIR = os.path.abspath(os.path.dirname(__file__))
DEBUG = False
##
# Database settings
##
DB_HOST = 'localhost'
DB_NAME = 'scoremodel'
DB_USER = 'scoremodel'
DB_PASS = 'scoremodel'
##
# MySQL SSL connections
##
use_ssl = False
SSL_CA = '/etc/mysql/certs/ca-cert.pem'
SSL_KEY = '/etc/mysql/keys/client-key... | PACKED-vzw/scoremodel | example_config.py | Python | gpl-2.0 | 1,348 |
from chronotope.model.base import PublicationWorkflowBehavior
from chronotope.model.base import SQLBase
from chronotope.model.category import CategoryRecord
from chronotope.model.location import LocationRecord
from chronotope.utils import ensure_uuid
from chronotope.utils import html_index_transform
from cone.app.model... | rnixx/chronotope | src/chronotope/model/facility.py | Python | gpl-2.0 | 4,882 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.7.1)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x05\x96\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
\x00\x00\x18\x0... | phborba/dsgtoolsop | numericalVertexEdit/resources.py | Python | gpl-2.0 | 7,700 |
"""
MUSE -- A Multi-algorithm-collaborative Universal Structure-prediction Environment
Copyright (C) 2010-2017 by Zhong-Li Liu
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 t... | zhongliliu/muse | muse/Similarity/Calc_Angle.py | Python | gpl-2.0 | 1,889 |
# peppy Copyright (c) 2006-2010 Rob McMullen
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""Simple macros created by recording actions
This plugin provides macro recording
"""
import os
import wx
from wx.lib.pubsub import Publisher
from peppy.yapsy.plugins import *
from peppy.actions im... | robmcmullen/peppy | peppy/plugins/macro.py | Python | gpl-2.0 | 47,677 |
#!/usr/bin/python
from pisi.actionsapi import shelltools, get, autotools, pisitools
def setup():
autotools.configure ("--prefix=/usr\
--disable-static\
--disable-docs\
--docdir=/usr/share/doc/fontconfig-2.10.2")
def build():
aut... | richard-fisher/repository | system/base/fontconfig/actions.py | Python | gpl-2.0 | 410 |
"""
.. module:: instrument_alias_type
The **Instrument Alias Type** Model. Here's a complete table of values, from the
MusicBrainz database dump of 2017-07-22:
+----+-----------------+--------+-------------+-------------+--------------------------------------+
| id | name | parent | child_order | descripti... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/models/instrument_alias_type.py | Python | gpl-2.0 | 2,427 |
#!/usr/bin/env python
# game.py
#
# Copyright (C) 2013, 2014 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
#
import stage
import gameloop
import math
import random
import config
import gamestate as gs
direction = (0, 0)
lastPos = (0, 0)
snake = []
speed = 1
ap... | alexaverill/make-snake | snake/game.py | Python | gpl-2.0 | 3,912 |
from __future__ import print_function, division, absolute_import
#
# Copyright (c) 2010 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 FITN... | Lorquas/subscription-manager | src/subscription_manager/gui/messageWindow.py | Python | gpl-2.0 | 3,262 |
"""A very simple logger that tries to be concurrency-safe."""
import os, sys
import time
import traceback
import subprocess
import select
LOG_FILE = '/var/log/nodemanager.func'
# basically define 3 levels
LOG_NONE=0
LOG_NODE=1
LOG_VERBOSE=2
# default is to log a reasonable amount of stuff for when running on oper... | caglar10ur/func | func/minion/modules/nm/logger.py | Python | gpl-2.0 | 3,426 |
import unittest
import string
from pprint import pprint
import XGram, XGram.Parser, XGram.Exceptions
from XGram.Generator.Prebuilt import Codons
from XGram.Model import Annotation
import Bio.Data.CodonTable
class GeneratorCodonsTest(unittest.TestCase):
"""
A test class for testing a grammar
"""
def s... | ihh/dart | python/XGram/Tests/GeneratorCodonsTest.py | Python | gpl-2.0 | 6,123 |
import codecs
import logging
logger = logging.getLogger(__name__)
class TextAnalyzer:
def __init__(self):
logger.debug('-- Initializing TextAnalyzer --')
"""
Deze functie leest een stopwoorden file (stoplist_tno.tab) in en retourneert deze woorden in
een dictionary
""... | beeldengeluid/linkedtv-editortool | src/linkedtv/text/TextAnalyzer.py | Python | gpl-2.0 | 1,003 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Poodle implementation with a client <--> proxy <--> server
'''
import argparse
import random
import re
import select
import socket
import SocketServer
import ssl
import string
import sys
import struct
import threading
import time
from utils.color import draw
from ... | rtbn/TER_Project | poodle-PoC/poodle.py | Python | gpl-2.0 | 12,158 |
from asgiref.sync import async_to_sync
from channels.generic.websocket import JsonWebsocketConsumer
from django.conf import settings
from django.utils import timezone
from .models import Route
class BusConsumer(JsonWebsocketConsumer):
groups = ["bus"]
def connect(self):
self.user = self.scope["user... | tjcsl/ion | intranet/apps/bus/consumers.py | Python | gpl-2.0 | 3,019 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2002-2018 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 ... | unioslo/cerebrum | Cerebrum/modules/bofhd/config.py | Python | gpl-2.0 | 2,808 |
# -*- coding: utf-8 -*-
# Pluma External Tools plugin
# Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.net>
# Copyright (C) 2012-2021 MATE Developers
#
# 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
# ... | mate-desktop/pluma | plugins/externaltools/tools/functions.py | Python | gpl-2.0 | 10,724 |
'''
run with ex: mpiexec -n 10 python article_simulated_estimate_mpi.py
Created on Jul 11, 2014
@author: jonaswallin
'''
from __future__ import division
import time
import scipy.spatial as ss
import article_simulatedata
from mpi4py import MPI
import numpy as np
import BayesFlow as bm
import matplotlib
import matplotl... | JonasWallin/BayesFlow | examples/article1/article_simulated_estimate_mpi.py | Python | gpl-2.0 | 8,046 |
from __future__ import with_statement
from fabric.api import local, abort, run, cd, env
from fabric.context_managers import prefix
env.directory = '/home/pestileaks/pestileaks'
env.activate = 'source /home/pestileaks/env/bin/activate'
env.user = 'pestileaks'
env.hosts = ['pestileaks.nl']
env.restart = 'killall -HUP gu... | ivorbosloper/pestileaks | fabfile.py | Python | gpl-2.0 | 973 |
import urllib2
import os
import re
import time
print '---------------------------------------------------------------'
print 'Name: Luoo.net-Mp3 crawler '
print 'version: v1.0'
print 'author: ChenYao'
print 'data: 2013/9/4'
print 'Introductions: the music will Downloaded to path D:\\Luoo.net\\'
print '------------... | flyaos/Luoo.net | luoo_Download.py | Python | gpl-2.0 | 5,357 |
from zope.interface import Interface
class IUWOshThemeLayer(Interface):
"""
Marker interface that defines a browser layer
""" | uwosh/uwosh.themebase | uwosh/themebase/browser/interfaces.py | Python | gpl-2.0 | 138 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from generator import Generator
import logging
class Phobia(Generator):
""" Define a phobia to be used in your game """
def __init__(self, redis, features={}):
Generator.__init__(self, redis, features)
self.logger = logging.getLogger(__name__)
... | CityGenerator/Megacosm-Generator | megacosm/generators/phobia.py | Python | gpl-2.0 | 661 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Author: S.H.
Version: 0.1
Date: 2015-01-17
Description:
Scan ip:
74.125.131.0/24
74.125.131.99-125
74.125.131.201
Only three format above.
Read ip form a ip.txt, and scan all port(or a list port).
"""
import os
import io
import socket
file... | KyoHS/Python | SingleThreadPortScan.py | Python | gpl-2.0 | 1,536 |
#!/usr/bin/env python
# -*- coding: iso8859-1 -*-
#
# connections.py - network connections statistics
#
# Copyright (c) 2005-2007, Carlos Rodrigues <cefrodrigues@mail.telepac.pt>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License (version 2) ... | carlosefr/quicklook | components/connections.py | Python | gpl-2.0 | 6,270 |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import re
from datetime import datetime, date
from decimal import Decimal
from translations import _t, _a
from model import Model
from lib.query_builder import Query
from lib.money import Money
import payment
import membership
import package
import settings
class Instal... | arielj/danceinstitute | models/installment.py | Python | gpl-2.0 | 8,146 |
# -*-coding:Utf-8 -*
import Adafruit_BBIO.GPIO as GPIO
import Adafruit_BBIO.ADC as ADC
import Adafruit_BBIO.PWM as PWM
import time
from math import *
class Motor :
"""Classe définissant un moteur, caractérisé par :
- le rapport de cycle de son PWM
- la pin de son PWM
- son sens de rotation
- la pin de ... | 7Robot/BeagleBone-Black | PROJETS/2013/FiveAxesArm/asserv/Motor.py | Python | gpl-2.0 | 3,370 |
""" Helper functions related to the creation, listing, filtering and destruction of providers
The list_providers function in this module depend on a (by default global) dict of filters.
If you are writing tests or fixtures, you want to depend on this function as a de facto gateway.
The rest of the functions, such as ... | dajohnso/cfme_tests | utils/providers.py | Python | gpl-2.0 | 16,707 |
"""sparql_select_result.py
Data structure for storing the results of SPARQL SELECT queries"""
__all__ = ["SPARQLSelectResult"]
from xml.etree import ElementTree as et
class SPARQLSelectResult(object):
def __init__(self):
self.variables = []
self.results = []
def parse(self, s):
tree = et.fromstring(s)
head = ... | iand/pynappl | old/sparql_select_result.py | Python | gpl-2.0 | 1,296 |
# DATA class v1.0 written by HR,JB@KIT 2011, 2016
'''
DATA exchange class, also holds global variables for thread management.
Generalized version based on TIP.
'''
# 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... | qkitgroup/qkit | qkit/services/qsurveilkit/data_class.py | Python | gpl-2.0 | 8,469 |
import sys
import os
from com.googlecode.fascinator.common import FascinatorHome
sys.path.append(os.path.join(FascinatorHome.getPath(),"harvest", "workflows"))
from baserules import BaseIndexData
class IndexData(BaseIndexData):
def __activate__(self, context):
BaseIndexData.__activate__(self... | redbox-mint/redbox | config/src/main/config/home/harvest/workflows/simpleworkflow-rules.py | Python | gpl-2.0 | 356 |
# Copyright (c) 2015-2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Derek Gustafson <degustaf@gmail.com>
# Copyright (c) 2018 Lucas Cimon <lucas.cimon@gmail.com>
# Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
# Copyright (c) 2019-2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
# Copyrig... | PyCQA/pylint | tests/checkers/unittest_strings.py | Python | gpl-2.0 | 1,133 |
# -*- coding: utf8 -*-
u"""
Тесты на ДЗ#5.
"""
__author__ = "wowkalucky"
__email__ = "wowkalucky@gmail.com"
__date__ = "2014-11-17"
import datetime
from hw5_solution1 import Person
def tests_for_hw5_solution1():
u"""Тесты задачи 1"""
petroff = Person("Petrov", "Petro", "1952-01-02")
ivanoff = Person(... | pybursa/homeworks | o_shestakoff/hw5/hw5_tests.py | Python | gpl-2.0 | 953 |
# -*- coding: utf-8 -*-
#=======================================================================
#
# Python Lexical Analyser
#
# Converting NFA to DFA
#
#=======================================================================
import Machines
from Machines import LOWEST_PRIORITY
from Transitions import TransitionMa... | unioslo/cerebrum | Cerebrum/extlib/Plex/DFA.py | Python | gpl-2.0 | 5,539 |
# coding: utf-8
"""
pyextend.core.math
~~~~~~~~~~~~~~~~~~
pyextend core math tools.
:copyright: (c) 2016 by Vito.
:license: GNU, see LICENSE for more details.
"""
def isprime(n):
"""Check the number is prime value. if prime value returns True, not False."""
n = abs(int(n))
if n < 2:
... | Vito2015/pyextend | pyextend/core/math.py | Python | gpl-2.0 | 643 |
## Package for various utility functions to execute build and shell commands
#
# @copyright (c) 2007 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# atnf-enquiries@csiro.au
#
# This file is part of the ... | ATNF/askapsdp | Tools/Dev/rbuild/askapdev/rbuild/utils/create_init_file.py | Python | gpl-2.0 | 2,053 |
''' direct
.. moduleauthor:: Edwin Tye <Edwin.Tye@gmail.com>
'''
from __future__ import division, print_function, absolute_import
from .sqp import *
from .ip import *
from .ipBar import *
from .ipPD import *
from .ipPDC import *
from .ipPDandPDC import *
from .approxH import *
from .trust import *
__all__ = [s for ... | edwintye/pygotools | pygotools/convex/__init__.py | Python | gpl-2.0 | 412 |
from Tkinter import *
root = Tk()
root.title('first test window')
#root.geometry('300x200')
frm = Frame(root)
frm_l = Frame(frm)
Label(frm_l, text='left_top').pack(side=TOP)
Label(frm_l, text='left_bottom').pack(side=BOTTOM)
frm_l.pack(side=LEFT)
frm_r = Frame(frm)
Label(frm_r, text='right_top').pack(side=TOP)
Label... | NUPT-Pig/python_test | tkinter_gui.py | Python | gpl-2.0 | 1,385 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-05 15:01
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('loginapp', '0001_initial'),
]
operations = [
migrations.RenameField(
mo... | sailuh/perceive | Websites/Experiments/loginapp/migrations/0002_auto_20170205_1501.py | Python | gpl-2.0 | 427 |
__author__ = 'Alexandre Menai amenai@amenai.net'
'''
The weather module intends to grab pilot weather from the aviation weather services in the USA
'''
#TODO put the following global parameters into a configuration file later on
WEAHTER_HOSTNAME="aviationweather.gov"
METAR_PATH="/adds/dataserver_current/httpparam?dataS... | amenai1979/pylot | bin/weather.py | Python | gpl-2.0 | 1,775 |
#-*- coding: utf-8 -*-
from mock import patch
from django.conf import settings
from django.test import TestCase
from django_any.models import any_model
from django.utils import unittest
from django.contrib.auth.models import User
from django.test.client import Client
from django.test.client import RequestFactory
from ... | andresriancho/w3af-webui | src/w3af_webui/tests/test_view.py | Python | gpl-2.0 | 6,559 |
#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Pygame.UI.
#
# Pygame.UI is free software; you can redistribute it and/or modify
# it under the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 2.1 of the Lice... | mozts2005/OuterSpace | client-pygame/lib/pygameui/Fonts.py | Python | gpl-2.0 | 2,420 |
import os
class generic(object):
def __init__(self,myspec):
self.settings=myspec
self.settings.setdefault('CHROOT', 'chroot')
def setarch(self, arch):
"""Set the chroot wrapper to run through `setarch |arch|`
Useful for building x86-on-amd64 and such.
"""
if os.uname()[0] == 'Linux':
self.settings['... | benkohler/catalyst | catalyst/builder.py | Python | gpl-2.0 | 702 |
# encoding: utf-8
# module samba.credentials
# from /usr/lib/python2.7/dist-packages/samba/credentials.so
# by generator 1.135
""" Credentials management. """
# imports
import talloc as __talloc
# Variables with simple values
AUTO_KRB_FORWARDABLE = 0
AUTO_USE_KERBEROS = 0
DONT_USE_KERBEROS = 1
FORCE_KRB_FORWARDA... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/credentials.py | Python | gpl-2.0 | 4,756 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SpatialJoin.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Joshua Arnott
Email : josh at snorfalorpagus dot net
*******************... | myarjunar/QGIS | python/plugins/processing/algs/qgis/SpatialJoin.py | Python | gpl-2.0 | 10,601 |
#!/usr/bin/python
# encoding=utf8
"""
Copyright (C) 2018 MuadDib
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
@tantrumdev wrote this file. As long as you retain this notice you can do
whatever you want with this stuff. Just A... | repotvsupertuga/tvsupertuga.repository | plugin.video.TVsupertuga/resources/lib/plugins/cobp.py | Python | gpl-2.0 | 9,604 |
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
from downloadCommon import DownloadCommon, getSeqName
from DdlCommonInterface import DdlCommonInterface
import re
class FbDownloader(DownloadCommon):
def __init__(self):
self.strDbms = 'firebird'
def connect(self, info):
try:
... | BackupTheBerlios/xml2ddl-svn | xml2ddl/FirebirdInterface.py | Python | gpl-2.0 | 15,609 |
#!/usr/bin/env python
import os.path
import time
import transmission as send
import shelving as db
def first_check():
if os.path.isfile('check.db') == False:
db.prime()
else:
if send.passthru(['mode','?']) == 'play':
db.update_shelf()
else:
perform_start_tasks()
def perform_start_tasks():
last_known_c... | NovaXeros/OpelSqueeze | lib/smartshuffle.py | Python | gpl-2.0 | 859 |
from pathlib import PosixPath
import pytest
from rpmlint.cli import process_lint_args
from rpmlint.config import Config
from rpmlint.lint import Lint
@pytest.mark.parametrize('test_arguments', [['-c', 'rpmlint/configs/thisdoesntexist.toml']])
def test_parsing_non_existing_config_file(test_arguments):
with pytest... | matwey/rpmlint | test/test_cli.py | Python | gpl-2.0 | 1,865 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 17/2/2015
@author: Antonio Hermosilla Rodrigo.
@contact: anherro285@gmail.com
@organization: Antonio Hermosilla Rodrigo.
@copyright: (C) 2015 by Antonio Hermosilla Rodrigo
@version: 1.0.0
'''
import sys
from PyQt4 import QtCore
from PyQt4 import QtGui
from ... | tonihr/pyGeo | Controladores/UTM2Geo.py | Python | gpl-2.0 | 7,615 |
# for localized messages
from boxbranding import getBoxType, getImageType, getImageDistro, getImageVersion, getImageBuild, getImageFolder, getImageFileSystem, getBrandOEM, getMachineBrand, getMachineName, getMachineBuild, getMachineMake, getMachineMtdRoot, getMachineRootFile, getMachineMtdKernel, getMachineKernelFile, ... | mrnamingo/vix4-core | src/ImageManager.py | Python | gpl-2.0 | 37,839 |