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 |
|---|---|---|---|---|---|
# Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk>
#
# 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 ... | markes1977/conpot-master | conpot/core/loggers/stix_transform.py | Python | gpl-2.0 | 6,622 |
#!/usr/bin/env python
import sys, os
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master'))
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf'))
print os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf')
from... | wukong-m2m/NanoKong | tools/python/scripts/installer.py | Python | gpl-2.0 | 2,839 |
import os
import sys
print help(sys)
print help(os) | pybursa/homeworks | e_tverdokhleboff/hw3/3.4.py | Python | gpl-2.0 | 52 |
#!/usr/bin/env python
try:
from io import StringIO
except ImportError:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import bs4 as BeautifulSoup
import logging
from thug.DOM.W3C.Element import Element
from thug.DOM.W3C.Style.CSS.ElementCSSInlineStyl... | tweemeterjop/thug | thug/DOM/W3C/HTML/HTMLElement.py | Python | gpl-2.0 | 2,479 |
import sys
import pygame
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((600, 500))
pygame.display.set_caption("Drawing Lines")
screen.fill((0, 80, 0))
# draw the line
color = 100, 255, 200
width = 8
pygame.draw.line(screen, color, (100, 100), (500, 400), width)
pygame.dis... | PoisonBOx/PyGames | 2.Pie/drawLine.py | Python | gpl-2.0 | 453 |
"""
Function-like objects that creates cubic clusters.
"""
import numpy as np
from ase.data import reference_states as _refstate
from ase.cluster.factory import ClusterFactory
class SimpleCubicFactory(ClusterFactory):
spacegroup = 221
xtal_name = 'sc'
def get_lattice_constant(self):
"Get the la... | JConwayAWT/PGSS14CC | lib/python/multimetallics/ase/cluster/cubic.py | Python | gpl-2.0 | 1,732 |
#!/usr/bin/python3
import math
import random
def finding_prime(number):
num=abs(number)
if num<4: return True
for x in range(2,num):
if num%x == 0:
return False
return True
def finding_prime_sqrt(number):
num=abs(number)
if num<4: return True
for x in range(2,int(math.sqrt(num))+1):
if number%x == 0:
... | Urinx/SomeCodes | Python/others/practice/finding_if_prime.py | Python | gpl-2.0 | 995 |
# encoding: utf-8
# module _dbus_bindings
# from /usr/lib/python2.7/dist-packages/_dbus_bindings.so
# by generator 1.135
"""
Low-level Python bindings for libdbus. Don't use this module directly -
the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`
and `dbus.mainloop.glib` modules, with a lower-le... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/_dbus_bindings/UInt64.py | Python | gpl-2.0 | 1,618 |
bl_info = {
"name" : "text objects to-from xml",
"author" : "chebhou",
"version" : (1, 0),
"blender" : (2, 7, 3),
"location" : "file->export->text to-from xml",
"discription" : "copys an text objectx from-to xml file",
"wiki_url" : " https://github.com/chebhou",
"tracker_url" : "https://... | chebhou/Text-from-to-.XML | text_io_xml.py | Python | gpl-2.0 | 3,503 |
from __future__ import print_function, division, absolute_import
import difflib
import locale
import os
import pprint
import six
import sys
import tempfile
try:
import unittest2 as unittest
except ImportError:
import unittest
# just log py.warnings (and pygtk warnings in particular)
import logging
try:
... | Lorquas/subscription-manager | test/fixture.py | Python | gpl-2.0 | 18,129 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 26 11:09:05 2013
@author: jotterbach
"""
from numpy import *
from ED_HalfFilling import EigSys_HalfFilling
from DotProduct import scalar_prod
from multiprocessing import *
from multiprocessing import Pool
import matplotlib.pyplot as plt
from ParallelizationTools import... | jotterbach/ExactDiagonalization_PolarizedFermionicDipolesOnZigZagChain | DiagonalizationMethods.py | Python | gpl-2.0 | 10,568 |
#!/usr/bin/python
"""Do not call std::string::find_first_of or std::string::find with a string of
characters to locate that has the size 1.
Use the version of std::string::find that takes a single character to
locate instead. Same for find_last_of/rfind.
"""
error_msg = "Do not use find(\"a\"), use find('a')."
reg... | widelands/widelands | cmake/codecheck/rules/contrived_std_string_find.py | Python | gpl-2.0 | 1,480 |
global mods
mods = []
| TheCherry/ark-server-manager | src/config.py | Python | gpl-2.0 | 22 |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 CERN.
##
## Invenio 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; eithe... | jrbl/invenio | modules/websearch/lib/search_engine.py | Python | gpl-2.0 | 270,395 |
import hashlib
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.colors as colors
import matplotlib.cm as cm
from matplotlib.patches import Rectangle
import os
import shutil
import tempfile
fro... | mbaldessari/sarstats | sar_grapher.py | Python | gpl-2.0 | 10,858 |
#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... | MOA-2011/enigma2-plugin-extensions-openwebif | plugin/controllers/views/web/gettags.py | Python | gpl-2.0 | 5,093 |
"""
.. module:: editor_subscribe_label_deleted
The **Editor Subscribe Label Deleted** Model.
PostgreSQL Definition
---------------------
The :code:`editor_subscribe_label_deleted` table is defined in the MusicBrainz Server as:
.. code-block:: sql
CREATE TABLE editor_subscribe_label_deleted
(
editor... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/models/editor_subscribe_label_deleted.py | Python | gpl-2.0 | 1,251 |
#!/usr/bin/env python
####################################################################################################
####################################################################################################
## ... | PiStuffing/Quadcopter | Quadcopter.py | Python | gpl-2.0 | 267,801 |
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
class MassMailController(http.Controller):
@http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none')
def track_mail_open(self, mail_id, **post):
""" Email tracking. """
mail_mail_stats... | 3dfxsoftware/cbss-addons | mass_mailing/controllers/main.py | Python | gpl-2.0 | 2,342 |
# -*- coding: utf-8 -*-
default_app_config = 'escolar.apps.EscolarConfig' | kaajavi/ninformes | escolar/__init__.py | Python | gpl-2.0 | 73 |
#
# Copyright 2006-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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 ... | miurahr/translate | translate/storage/poxliff.py | Python | gpl-2.0 | 14,579 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017-2022 Mike Fährmann
#
# 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.
import os
import sys
import unittest
from unittes... | mikf/gallery-dl | test/test_cookies.py | Python | gpl-2.0 | 7,492 |
from os import path
try:
from lib.settings_build import Configure
except ImportError:
import sys
from os.path import expanduser, join
sys.path.append(join(expanduser("~"), 'workspace/automation/launchy'))
from lib.settings_build import Configure
class Default(Configure):
def __init__(self):... | amites/nedcompost_wordpress | fabsettings.py | Python | gpl-2.0 | 1,613 |
from numpy import *
from matplotlib.pyplot import *
import scipy.constants as sc
import copy
import scipy.integrate as integ
# test sun/earth with hw5(1.989e30,5.972e24,149.6e6,0.0167,1000)
def hw5(m1, m2, a, e, tmax, tstep=0.001, tplot=0.025, method='leapfrog'):
if method != 'leapfrog' and method != 'odeint':
... | smorad/ast119 | hw5.py | Python | gpl-2.0 | 2,857 |
from django import forms
from getresults_aliquot.models import Aliquot
from .models import Order
class OrderForm(forms.ModelForm):
def clean_aliquot_identifier(self):
aliquot_identifier = self.cleaned_data.get('aliquot_identifier')
try:
Aliquot.objects.get(aliquot_identifier=aliquot... | botswana-harvard/getresults-order | getresults_order/forms.py | Python | gpl-2.0 | 514 |
#
# Copyright 2012 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 th... | edwardbadboy/vdsm-ubuntu | tests/fileUtilTests.py | Python | gpl-2.0 | 8,296 |
try:
from django.conf.urls import url, patterns
except ImportError:
from django.conf.urls.defaults import url, patterns
from actstream import feeds
from actstream import views
from django.contrib.auth.decorators import login_required
urlpatterns = patterns('actstream.views',
# Syndication Feeds
url(r... | meletakis/collato | esn/actstream/urls.py | Python | gpl-2.0 | 2,399 |
class Song(object):
def __init__(self, lyrics):
self.lyrics = lyrics
def sing_me_a_song(self):
for line in self.lyrics:
print line
happy_bday = Song(["Happy birthday to you",
"I don't want to get sued",
"So I'll stop right here"])
bulls_on_pa... | mshcruz/LearnPythonTheHardWay | ex40.py | Python | gpl-2.0 | 484 |
from __future__ import absolute_import
import os
import sys
import shutil
import unittest
import xml.dom.minidom
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
from pcs_test_functions import pcs,ac
import rule
empty_cib = "empty.xml"
temp_cib = "temp.xml"
class D... | tradej/pcs | pcs/test/test_rule.py | Python | gpl-2.0 | 67,998 |
"""
.. module:: poes
:synopsis: A module for reading, writing, and storing poes Data
.. moduleauthor:: AJ, 20130129
*********************
**Module**: gme.sat.poes
*********************
**Classes**:
* :class:`poesRec`
**Functions**:
* :func:`readPoes`
* :func:`readPoesFtp`
* :func:`mapPoesMongo`
* :func:`... | Shirling-VT/davitpy_sam | davitpy/gme/sat/poes.py | Python | gpl-3.0 | 33,273 |
#!/usr/bin/env python
# encoding: UTF-8
"""
This file is part of Commix Project (http://commixproject.com).
Copyright (c) 2014-2017 Anastasios Stasinopoulos (@ancst).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Soft... | hackersql/sq1map | comm1x/src/utils/session_handler.py | Python | gpl-3.0 | 17,851 |
# This file is part of Korman.
#
# Korman 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.
#
# Korman is distributed i... | dpogue/korman | korman/properties/modifiers/logic.py | Python | gpl-3.0 | 5,501 |
import os.path
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from django.contrib.auth import get_user_model
from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER
from avatar.util import get_primary_avatar
from avatar.models import... | bhermansyah/DRR-datacenter | avatar/tests.py | Python | gpl-3.0 | 5,578 |
#!/usr/bin/env python3
"""Output a CSV file that can be imported to Petra"""
import os
import sys
import calendar
import csv
from csv_dict import CSVDict, CSVKeyMissing
def split_csv(table_file='Tabell.csv'):
"""Split account, cost center and project into three tables"""
account = []
cost_center = []
... | jswetzen/sie-parse | petra_output.py | Python | gpl-3.0 | 6,907 |
# -*- coding: utf-8 -*-
"""
José Vicente Pérez
Granada University (Spain)
March, 2017
Testing suite for profiler.py
Last modified: 19 June 2017
"""
import time
import profiler as p
import praster as pr
import numpy as np
import matplotlib.pyplot as plt
print("Tests for TProfiler methods")
def test01():
"""... | geolovic/TProfiler | test/06_TProfiler_test.py | Python | gpl-3.0 | 12,892 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, eithe... | quinox/weblate | weblate/accounts/models.py | Python | gpl-3.0 | 26,496 |
#coding: utf-8
from __future__ import unicode_literals, absolute_import
import logging
import json
from django.utils.dateparse import parse_datetime
from django.utils import timezone
from wechatpy.exceptions import WeChatClientException
from common import wechat_client
from .local_parser import LocalParser
from remind... | polyrabbit/WeCron | WeCron/wxhook/todo_parser/__init__.py | Python | gpl-3.0 | 2,854 |
from settings import CONTENT_SERVER
"""
context processor applied to all requests
"""
def settings_cp(request):
return {'content_server': CONTENT_SERVER}
| elifeasley/metacademy-application | app_server/context_processors/global_cp.py | Python | gpl-3.0 | 160 |
# This file is part of JST.
#
# JST 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.
#
# JST is distributed in the hope that it will b... | s-gogna/JST | mips/configurations.py | Python | gpl-3.0 | 904 |
# -*- coding: utf-8 -*-
"""Caliopen mail message privacy features extraction methods."""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import pgpy
from caliopen_main.pi.parameters import PIParameter
from .helpers.spam import SpamScorer
from .helpers.ingress_path import get_i... | CaliOpen/CaliOpen | src/backend/components/py.pi/caliopen_pi/features/mail.py | Python | gpl-3.0 | 8,082 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2019-11-21 04:58
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posgradmin', '0039_auto_20191120_2249'),
]
operations = [
migrations.AlterModelOpt... | sostenibilidad-unam/posgrado | posgradmin/posgradmin/migrations/0040_auto_20191120_2258.py | Python | gpl-3.0 | 484 |
""" Interacts with sqlite3 db
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
import sqlite3
import os
import hashlib
import random
import time
import DIRAC
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.FrameworkSystem.private.monitorin... | ic-hep/DIRAC | src/DIRAC/FrameworkSystem/private/monitoring/MonitoringCatalog.py | Python | gpl-3.0 | 19,766 |
# -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundatio... | adw0rd/lettuce-py3 | tests/functional/test_terrain.py | Python | gpl-3.0 | 2,378 |
"""
Test notifiers
"""
import unittest
from sickchill.oldbeard import db
from sickchill.oldbeard.notifiers.emailnotify import Notifier as EmailNotifier
from sickchill.oldbeard.notifiers.prowl import Notifier as ProwlNotifier
from sickchill.tv import TVEpisode, TVShow
from sickchill.views.home import Home
from tests ... | Vagab0nd/SiCKRAGE | tests/notifier_tests.py | Python | gpl-3.0 | 9,061 |
import os, random
rfilename=random.choice(os.listdir("/storage/pictures"))
rextension=os.path.splitext(rfilename)[1]
picturespath='/storage/pictures/'
#TODO Probably dont need a forloop can possibly do random*
#TODO What if the directory is empty?
for filename in os.listdir(picturespath):
if filename.startswith("ran... | shoaibali/kodi.background.rotator | randombackground.py | Python | gpl-3.0 | 713 |
# -*- encoding: utf-8 -*-
import os
from abjad.tools import documentationtools
from abjad.tools import systemtools
from abjad.tools.developerscripttools.DeveloperScript import DeveloperScript
from abjad.tools.developerscripttools.ReplaceInFilesScript \
import ReplaceInFilesScript
class RenameModulesScript(Develop... | mscuthbert/abjad | abjad/tools/developerscripttools/RenameModulesScript.py | Python | gpl-3.0 | 13,078 |
"""
Module defining the Event class which is used to manage collissions and check their validity
"""
from itertools import combinations
from copy import copy
from particle import Particle
class EventParticle(object):
def __init__(self, particle1, particle2):
self.particle1 = particle1
self.pa... | hniemeyer/HardSphereSim | EventManager.py | Python | gpl-3.0 | 4,177 |
# -*- coding: utf-8 -*-
""" Projy template for PythonPackage. """
# system
from datetime import date
from os import mkdir, rmdir
from shutil import move
from subprocess import call
# parent class
from projy.templates.ProjyTemplate import ProjyTemplate
# collectors
from projy.collectors.AuthorCollector import AuthorCol... | stephanepechard/projy | projy/templates/DjangoProjectTemplate.py | Python | gpl-3.0 | 4,869 |
#!/usr/bin/python
# The file is part of the WRL Project.
#
# The WRL Project 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.
#
# ... | smutt/WRL | topThick.py | Python | gpl-3.0 | 2,656 |
#-----------------------------------------------------------------------------
# Copyright (c) 2013-2016, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this s... | ijat/Hotspot-PUTRA-Auto-login | PyInstaller-3.2/PyInstaller/hooks/hook-wx.lib.activex.py | Python | gpl-3.0 | 571 |
# rasPyCNCController
# Copyright 2016 Francesco Santini <francesco.santini@gmail.com>
#
# This file is part of rasPyCNCController.
#
# rasPyCNCController 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 ... | fsantini/rasPyCNCController | gcode/GCodeLoader.py | Python | gpl-3.0 | 2,216 |
# Authors: Karl MacMillan <kmacmill@redhat.com>
#
# Copyright (C) 2007 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 ver... | encukou/freeipa | ipapython/config.py | Python | gpl-3.0 | 9,257 |
"""Define and instantiate the configuration class for Robottelo."""
import logging
import os
import sys
from logging import config
from nailgun import entities, entity_mixins
from nailgun.config import ServerConfig
from robottelo.config import casts
from six.moves.urllib.parse import urlunsplit, urljoin
from six.moves... | Ichimonji10/robottelo | robottelo/config/base.py | Python | gpl-3.0 | 35,889 |
# This file is part of PlexPy.
#
# PlexPy 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.
#
# PlexPy is distributed in the hope t... | gnowxilef/plexpy | plexpy/webserve.py | Python | gpl-3.0 | 52,488 |
"""treetools: Tools for transforming treebank trees.
transformations: constants and utilities
Author: Wolfgang Maier <maierw@hhu.de>
"""
from . import trees
# Head rules for PTB (WSJ) from Collins (1999, p. 240)
HEAD_RULES_PTB = {
'adjp' : [('left-to-right', 'nns qp nn $ advp jj vbn vbg adjp jjr np jjs dt fw rbr... | wmaier/treetools | trees/transformconst.py | Python | gpl-3.0 | 4,747 |
#!/usr/bin/env python
#
# Author: Pablo Iranzo Gomez (Pablo.Iranzo@redhat.com)
#
# Description: Script for setting the keyring password for RHEV scripts
#
# Requires: python keyring
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | DragonRoman/rhevm-utils | rhev-keyring.py | Python | gpl-3.0 | 2,000 |
#!/usr/bin/python
import os,sys,re
#Check the OS Version
RELEASE_FILE = "/etc/redhat-release"
RWM_FILE = "/etc/httpd/conf.modules.d/00-base.conf"
if os.path.isfile(RELEASE_FILE):
f=open(RELEASE_FILE,"r")
rel_list = f.read().split()
if rel_list[2] == "release" and tuple(rel_list[3].split(".")) < ('8','5'):
pri... | sujith7c/py-system-tools | en_mod_rw.py | Python | gpl-3.0 | 636 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-15 14:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalogue', '0014_auto_20170414_0845'),
]
operations = [
migrations.AlterFi... | Gatomlo/shareandplay | catalogue/migrations/0015_auto_20170415_1628.py | Python | gpl-3.0 | 495 |
#!/usr/bin/env python
import os
import random
__author__ = 'duceppemo'
class SnpTableMaker(object):
"""
Everything is ran inside the class because data structures have to be
shared across parent and child process during multi threading
"""
def __init__(self, args):
import os
imp... | OLF-Bioinformatics/snp_analysis | binaries/snpTableMaker.py | Python | gpl-3.0 | 15,587 |
# -*- coding: utf-8 -*-
# File: enemy.py
# Author: Casey Jones
#
# Created on July 20, 2009, 4:48 PM
#
# This file is part of Alpha Beta Gamma (abg).
#
# ABG 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, ... | jcnix/abg | enemies.py | Python | gpl-3.0 | 2,843 |
# -*-coding: utf-8-*-
import logging
from pyramid.view import view_config, view_defaults
from pyramid.httpexceptions import HTTPFound
from . import BaseView
from ..models import DBSession
from ..models.account_item import AccountItem
from ..lib.bl.subscriptions import subscribe_resource
from ..lib.utils.common_utils... | mazvv/travelcrm | travelcrm/views/accounts_items.py | Python | gpl-3.0 | 6,534 |
# -*- coding: utf-8 -*-
import classes.level_controller as lc
import classes.game_driver as gd
import classes.extras as ex
import classes.board
import random
import pygame
class Board(gd.BoardGame):
def __init__(self, mainloop, speaker, config, screen_w, screen_h):
self.level = lc.Level(self,mainloop,5,... | OriHoch/pysiogame | game_boards/game070.py | Python | gpl-3.0 | 12,968 |
#!/usr/bin/env python3
# - coding: utf-8 -
# Copyright (C) 2010 Matías Ribecky <matias at mribecky.com.ar>
# Copyright (C) 2010-2012 Toms Bauģis <toms.baugis@gmail.com>
# Copyright (C) 2012 Ted Smith <tedks at cs.umd.edu>
# This file is part of Project Hamster.
# Project Hamster is free software: you can redistribut... | projecthamster/hamster | src/hamster-cli.py | Python | gpl-3.0 | 18,772 |
# encoding=utf-8
from gi.repository import Gtk
from .i18n import _
class AboutDialog(Gtk.AboutDialog):
def __init__(self, parent):
super(AboutDialog, self).__init__(title=_('About'), parent=parent)
self.set_modal(True)
self.set_program_name('Ydict')
self.set_authors(['Wiky L<wiii... | wiiiky/ydict | pydict/about.py | Python | gpl-3.0 | 743 |
from ._costs import *
| csxeba/ReSkiv | brainforge/costs/__init__.py | Python | gpl-3.0 | 22 |
# -*- coding: utf8 -*-
import argparse
import logging
import pytest
import SMSShell
import SMSShell.commands
def test_abstract_init():
"""Test abstract init methods
"""
abs = SMSShell.commands.AbstractCommand(logging.getLogger(),
object(),
... | Turgon37/SMSShell | tests/test_smsshell_commands.py | Python | gpl-3.0 | 2,388 |
# pylint: disable = too-many-lines, invalid-name, line-too-long, too-many-instance-attributes,
# pylint: disable = too-many-branches,too-many-locals, too-many-nested-blocks
from __future__ import (absolute_import, division, print_function)
try:
from mantidplot import *
except ImportError:
canMantidPlot = False... | dymkowsk/mantid | scripts/Interface/ui/reflectometer/refl_gui.py | Python | gpl-3.0 | 64,194 |
from discord.ext import commands
import discord.utils
def is_owner_check(ctx):
author = str(ctx.message.author)
owner = ctx.bot.config['master']
return author == owner
def is_owner():
return commands.check(is_owner_check)
def check_permissions(ctx, perms):
#if is_owner_check(ctx):
# return... | Jonqora/whiskers | checks.py | Python | gpl-3.0 | 5,290 |
# -*- coding: utf-8 -*-
"""
nwdiag.sphinx_ext
~~~~~~~~~~~~~~~~~~~~
Allow nwdiag-formatted diagrams to be included in Sphinx-generated
documents inline.
:copyright: Copyright 2010 by Takeshi Komiya.
:license: BSDL.
"""
from __future__ import absolute_import
import os
import re
import tracebac... | bboalimoe/ndn-cache-policy | docs/sphinx-contrib/nwdiag/sphinxcontrib/nwdiag.py | Python | gpl-3.0 | 10,218 |
#!/usr/bin/python
import sys
def fib(n):
if(n<=2):
return (n-1)
else:
return fib(n-1)+fib(n-2)
if ( len(sys.argv) == 2 ):
print fib(int(sys.argv[1]))
else:
print "Usage : "+sys.argv[0]+" <term required>"
| simula67/Coding | python/AAD PoC/naive_fibinocci.py | Python | gpl-3.0 | 241 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Tiger Soldier
#
# This file is part of OSD Lyrics.
#
# OSD Lyrics 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... | ihacklog/osdlyrics | python/pattern.py | Python | gpl-3.0 | 5,769 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# encryption-generator.py
#
# Copyright 2016 Netuser <zorgonteam@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either v... | P1d0f/encryptGen | encryption-generator.py | Python | gpl-3.0 | 8,291 |
#!/bin/env python2.7
# -*- coding: utf-8 -*-
# This file is part of AT-Platform.
#
# EPlatform 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 ... | bjura/EPlatform | spellerPuzzle.py | Python | gpl-3.0 | 24,523 |
import json
import argparse
import numpy
import sys
import copy
from astropy.coordinates import SkyCoord
from astropy import units
import operator
class Program(object):
def __init__(self, runid="16BP06", pi_login="gladman"):
self.config = {"runid": runid,
"pi_login": pi_login,
... | CFIS-Octarine/octarine | planning/ph2.py | Python | gpl-3.0 | 5,099 |
#-*- coding: utf-8 -*-
from django.conf.urls import url
from . import views
app_name = "perso"
urlpatterns = [
url(r'^$', views.main, name='main'),
url(r'^(?P<pageId>[0-9]+)/?$', views.main, name='main'),
url(r'^ab... | LeMinaw/minaw.net | perso/urls.py | Python | gpl-3.0 | 901 |
#!/usr/bin/env python
########################################################################
# $HeadURL$
########################################################################
"""
Get the list of all the user files.
"""
__RCSID__ = "$Id$"
from DIRAC.Core.Base import Script
days = 0
months = 0
years = 0
wildcard = ... | vmendez/DIRAC | DataManagementSystem/scripts/dirac-dms-user-lfns.py | Python | gpl-3.0 | 5,259 |
#!/usr/bin/env python
"""
@file costFunctionChecker.py
@author Michael Behrisch
@author Daniel Krajzewicz
@author Jakob Erdmann
@date 2009-08-31
@version $Id: costFunctionChecker.py 13811 2013-05-01 20:31:43Z behrisch $
Run duarouter repeatedly and simulate weight changes via a cost function.
SUMO, Simulatio... | rudhir-upretee/Sumo17_With_Netsim | tools/assign/costFunctionChecker.py | Python | gpl-3.0 | 8,986 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | jacobtomlinson/datapoint-python | datapoint/_version.py | Python | gpl-3.0 | 18,444 |
# -*- coding: utf-8 -*-
"""
Common structures and functions used by other scripts.
"""
from xml.etree import cElementTree as ET
str_to_entailment = {'none': 0,
'entailment': 1,
'paraphrase': 2}
entailment_to_str = {v: k for k, v in str_to_entailment.items()}
class Pair(obj... | nathanshartmann/portuguese_word_embeddings | sentence_similarity/utils/commons.py | Python | gpl-3.0 | 2,224 |
from edges import EdgeExtractor
from extractor import Extractor
from parambfs import ParamExtractor | daajoe/trellis | trellis/extractor/__init__.py | Python | gpl-3.0 | 99 |
"""
.. module: FSRStools.rraman
:platform: Windows
.. moduleauthor:: Daniel Dietze <daniel.dietze@berkeley.edu>
Resonance Raman excitation profile calculation based on the time-domain picture of resonance Raman. See Myers and Mathies in *Biological Applications of Raman Spectroscopy*, Vol. 2, pp. 1-58 (John Wi... | ddietze/FSRStools | rraman/__init__.py | Python | gpl-3.0 | 36,173 |
# Copyright (c) 2008 testtools developers. See LICENSE for details.
"""Test results and related things."""
__metaclass__ = type
__all__ = [
'ExtendedToOriginalDecorator',
'MultiTestResult',
'TestResult',
'ThreadsafeForwardingResult',
]
import datetime
import sys
import unittest
from testtools.co... | lauria/Samba4 | lib/testtools/testtools/testresult/real.py | Python | gpl-3.0 | 23,481 |
import abc
import subprocess
import logging
from observables import BLOperator, MCObservable
from data import BLDataChannel, GIDataChannel
import util
class Channel(metaclass=abc.ABCMeta):
ISOSPIN_MAP = {
'singlet': "0",
'doublet': "1h",
'triplet': "1",
'quartet': "3h",
'quintet': "2"... | andrewhanlon/QCD_scripts | sigmond/channel.py | Python | gpl-3.0 | 7,175 |
# -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe.utils.data import flt, nowdate, getdate, cint
class MoneyTransfere... | ahmadRagheb/goldenHR | erpnext/accounts/doctype/money_transfere/money_transfere.py | Python | gpl-3.0 | 4,294 |
import numpy as np
def min_max_model(power, use, battery_capacity):
"""
Minimal maximum battery model, obsoleted
:param power: Pandas TimeSeries, total power from renewable system
:param use: float, unit W fixed load of the power system
:param battery_capacity: float, unit Wh battery capacity
... | tsaoyu/D3HRE | D3HRE/core/battery_models.py | Python | gpl-3.0 | 18,409 |
import re
class HeadingsParser():
"""
The HeadingParser parses the document for headings.
NOT YET: converts headings to raw latex headings in the correct way, so that they can be referrenced to later
see https://www.sharelatex.com/learn/Sections_and_chapters for info about the levels"""
def __ini... | ZelphirKaltstahl/rst-internal-links-to-raw-latex | RSTInternalLinks/HeadingsParser.py | Python | gpl-3.0 | 13,092 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
## ##
## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ##
## ... | rowinggolfer/openmolar2 | src/lib_openmolar/admin/db_orm/admin_practitioners.py | Python | gpl-3.0 | 3,483 |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free software... | jimsize/PySolFC | pysollib/winsystems/common.py | Python | gpl-3.0 | 3,751 |
#! /usr/bin/env python
import sys
g = {}
n = {}
for line in sys.stdin:
(n1, n2, p, q, t, tg, x) = line.strip().split(' ')
t = int(t)
x = float(x)
key = ' '.join((n1,n2,p,q))
if not key in n:
n[key] = 0
g[key] = 0
n[key] += t
g[key] += x*t
for key in n:
print key, n... | vbeffara/Simulations | tools/massage-box.py | Python | gpl-3.0 | 341 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.shortcuts import redirect
from django.contrib.auth.views import logout as original_logout
from loginas import settings as la_settings
from loginas.utils impor... | CroceRossaItaliana/jorvik | autenticazione/viste.py | Python | gpl-3.0 | 986 |
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# b... | fracpete/python-weka-wrapper-examples | src/wekaexamples/flow/list_file.py | Python | gpl-3.0 | 1,948 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | FireBladeNooT/Medusa_1_6 | lib/tvdbapiv2/models/series_actors.py | Python | gpl-3.0 | 3,002 |
#!/usr/bin/python3
import os
import sys
import subprocess
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from lutris.util.wineregistry import WineRegistry
PREFIXES_PATH = os.path.expanduser("~/Games/wine/prefixes")
def get_registries():
registries = []
directories = os.listdir... | RobLoach/lutris | tests/check_prefixes.py | Python | gpl-3.0 | 1,465 |
# -*- coding: utf-8 -*-
import re
from channels import renumbertools
from channelselector import get_thumb
from core import httptools
from core import scrapertools
from core import servertools
from core import tmdb
from core.item import Item
from platformcode import config, logger
from channels import autoplay
IDIO... | pitunti/alfaPitunti | plugin.video.alfa/channels/anitoonstv.py | Python | gpl-3.0 | 6,699 |
#!/usr/bin/env python3
import argparse
import logging
import string
# Quiet scapy
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy import volatile # noqa: E402
from scapy import sendrecv # noqa: E402
from scapy import config # noqa: E402
from scapy.layers import l2 # noqa: E402
from scapy.la... | mschwager/dhcpwn | dhcpwn.py | Python | gpl-3.0 | 2,829 |
# -*- coding: utf-8 -*-
import os
import pickle
import random
import time
import urllib
try:
import xbmc, xbmcgui
except:
pass
from platformcode import config, logger
LIBTORRENT_PATH = config.get_setting("libtorrent_path", server="torrent", default='')
from servers import torrent as torr
lt... | alfa-jor/addon | plugin.video.alfa/lib/btserver/client.py | Python | gpl-3.0 | 26,890 |
# Copyright (C) 2012 Aaron Krebs akrebs@ualberta.ca
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is... | a-krebs/finances | finances/django_registration/urls.py | Python | gpl-3.0 | 3,598 |
############################################
# [config.py]
# CONFIGURATION SETTINGS FOR A PARTICULAR METER
#
#
# Set the long-form name of this meter
name = "*PEAK only"
#
# [Do not remove or uncomment the following line]
Cs={}
############################################
############################################
#... | quadrismegistus/prosodic | meters/strength_and_resolution.py | Python | gpl-3.0 | 10,457 |
#!/usr/bin/env python
from gnuradio import gr, gr_unittest
from gnuradio import blocks
import grdab
class qa_measure_processing_rate(gr_unittest.TestCase):
"""
@brief QA for measure processing rate sink.
This class implements a test bench to verify the corresponding C++ class.
"""
def setUp(self):
self.tb = ... | andrmuel/gr-dab | python/qa/qa_measure_processing_rate.py | Python | gpl-3.0 | 1,233 |
# Copyright (C) 2010-2018 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | hmenke/espresso | testsuite/python/drude.py | Python | gpl-3.0 | 10,864 |