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 |
|---|---|---|---|---|---|
# -*- coding: utf-8
'''
adapted from old code: morphology.py (July 2012)
we used x,y rather than i, j then.
USE:
reload(mor)
from armor.morphology import morphology as mor
from armor import pattern
a=pattern.a
mor.erode(a)
'''
"""
* morphology.py
* module for mathematical morphologies
* reference: e.g. http:/... | yaukwankiu/armor | geometry/morphology.py | Python | cc0-1.0 | 7,056 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
import sys
import os
import time
import datetime
import platform
from subprocess import call, check_output, STDOUT
fr... | yeleman/ORTM-VC | convert-video.py | Python | cc0-1.0 | 13,034 |
from streamajoker import plugin
from streamajoker.scrapers import scraper
from streamajoker.ga import tracked
from streamajoker.caching import cached_route
from streamajoker.utils import ensure_fanart
from streamajoker.library import library_context
BASE_URL = plugin.get_setting("base_btdigg")
HEADERS = {
"Refere... | Mafarricos/Mafarricos-modded-xbmc-addons | plugin.video.streamajoker/resources/site-packages/streamajoker/scrapers/btdigg.py | Python | gpl-2.0 | 2,022 |
# TODO: Docstrings
import processes.base
class MACChangerProcess(processes.base.BaseProcess):
# TODO: Docstrings
def set_specific_mac(self, interface, new_mac):
# TODO: Docstrings
'''
:param interface:
:param new_mac:
:return:
'''
# TODO: Convert to Py... | pbromwelljr/crack_py | processes/macchanger.py | Python | gpl-2.0 | 3,226 |
import time
from mutagen.flac import FLAC
from mutagen.easyid3 import EasyID3
from mutagen.id3 import ID3NoHeaderError
from mutagen.mp3 import MP3
from schema import *
def scan_tag(player, pause = None):
session = Session()
prescanned = session.query(Scan.song_id).filter(Scan.scan == 'tag').subquery()
t... | tobes/jukebox | scan.py | Python | gpl-2.0 | 2,236 |
from django import forms
from django.db import models
from django.contrib.auth.models import User
from datetime import *
from django.utils import timezone
"""
Modelo de area
"""
class Area(models.Model):
# Atributos
is_active = models.BooleanField(default=True)
nombre = models.CharField(max_length=30)
... | nico4021/RegistroTEA | ProyectoTEA/AppTEA/models.py | Python | gpl-2.0 | 3,917 |
# -*- coding: utf-8 -*-
'''The app module, containing the app factory function.'''
from flask import Flask, render_template
from blogaggregator.settings import ProdConfig
from blogaggregator.assets import assets
from blogaggregator.extensions import (
bcrypt,
cache,
db,
login_manager,
migrate,
... | andre-geldenhuis/bloggregator | blogaggregator/blogaggregator/app.py | Python | gpl-2.0 | 1,580 |
'''
Created on Nov 1, 2011
@author: hampt
'''
import sys
from commons import bpRoot, mfRoot, parseGOAnnotations, GOPrediction
from f1Measure import maxf1Measure
'''
Created on Sep 25, 2011
@author: hampt
'''
from multiprocessing.pool import Pool
from operator import itemgetter
def calcThreshMeasure(goPrediction):
#... | Rostlab/MetaStudent | EVAL/threshMeasure.py | Python | gpl-2.0 | 3,372 |
# -*- coding: utf-8 -*-
from django import forms
import re
class QuestionarioRespondidoForm(forms.Form):
pass
def __init__(self, *args, **kwargs):
perguntas = kwargs.pop('perguntas')
respostas = kwargs.pop('respostas')
super(QuestionarioRespondidoForm, self).__init__(*args, **kwargs)
if not respostas:
f... | agendaTCC/AgendaTCC | tccweb/apps/questionarios/forms.py | Python | gpl-2.0 | 2,396 |
# -*- coding: utf-8 -*-
{
'!langcode!': 'es',
'!langname!': 'Español',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN',
'%s %... | davidblaisonneau/fabm | server/languages/es.py | Python | gpl-2.0 | 19,174 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api
class Solicitantes(models.Model):
_name = 'propuestas.solicitantes'
_inherit = 'contactos.personas'
familiares_ids = fields.One2many('propuestas.familiares', 'solicitantes_id',string="Familiares")
conyuges_ids = fields.One2many('propues... | sani-coop/tinjaca | addons/propuestas/models/solicitantes.py | Python | gpl-2.0 | 604 |
"""
This creates and generated tokens for users stored in the database
"""
from django.conf import settings
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
# This code is triggered whenever a new user has been created and saved to
... | andela-ooshodi/django-bucketlist-application | djangobucketlist/apiv1/models.py | Python | gpl-2.0 | 521 |
# -*- coding: utf-8 -*-
from django import forms
from web.models import Contact, Venue, Image, Description
class AdvancedSearchForm(forms.Form):
q = forms.CharField(label="Sökord", max_length=128, required=False)
audience = forms.IntegerField(min_value=1, required=False, label="Publikmängd")
class VenueForm(forms... | eriklavander/klaviaturregistret | web/forms.py | Python | gpl-2.0 | 1,157 |
#!/usr/bin/python
import subprocess
import re
import argparse
def stripper(fasta):
result = {}
with open(fasta) as f:
for name, seq in fastq_fasta_parser.read_fasta(f):
bases = list(seq)
end1 = bases[-3:]
end1 = ''.join(end1)
if end1 == "CCA":
tmpseq = bases[:-3]
seq = ''.join(tmpseq)
end2... | pdl30/pynoncode | pynoncode/run_bowtie.py | Python | gpl-2.0 | 8,057 |
#!/usr/bin/python
#
# Copyright (C) 2006, 2007, 2008, 2010, 2012, 2013 Google 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 l... | narurien/ganeti-ceph | test/py/ganeti.objects_unittest.py | Python | gpl-2.0 | 24,989 |
import base64
import binascii
import json
from Crypto.Cipher import AES
from lib.pyaes import Encrypter, AESModeOfOperationCBC
partner_id = 918
domain_id = 515601
_mw_adb = False
video_token = 'add4fb87365dc508'
e = '617adae21a8aedc4e13938619b62f4ecdd3b947cd64620569df257d333e4f11d'
def pad(s):
block_size = 16... | seppius-xbmc-repo/ru | plugin.video.baskino.com/test.py | Python | gpl-2.0 | 1,321 |
# homogeneous equilibrium of a gas.
from Cantera import *
# create an object representing the gas phase
gas = importPhase("h2o2.cti")
# set the initial state
gas.set(T = 2000.0, P = 0.1*OneAtm, X = "H2:1.0, O2:0.6")
# equilibrate the gas holding T and P fixed
gas.equilibrate("TP")
# print a summary of the results
... | HyperloopTeam/FullOpenMDAO | cantera-2.0.2/samples/python/equilibrium/simple_test/simple.py | Python | gpl-2.0 | 589 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 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; either version 2 of the
# License, or (at your option) any later... | inspirehep/invenio-grobid | tests/conftest.py | Python | gpl-2.0 | 1,137 |
#
# Copyright (C) 2006-2019 Nexedi SA
#
# 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... | Nexedi/neoppod | neo/lib/util.py | Python | gpl-2.0 | 6,503 |
# -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | AMOboxTV/AMOBox.LegoBuild | plugin.video.exodus/resources/lib/modules/debrid.py | Python | gpl-2.0 | 9,950 |
#@file sql_tokenizer.py - Parsing commands
from pyparsing import *
import re
class sql_tokenizer:
def AK_parse_grant(self, string):
'''
@author Boris Kisic, edited by Zvonimir Kapes
@brief sql parsing of GRANT command
@param string sql command as string
@return if command is success... | mschatten/akdb | akdb/src/srv/sql_tokenizer.py | Python | gpl-2.0 | 56,862 |
import threading
class ClientStack(threading.local):
"""Thread local stack of StatsdClients.
Applications and tests can either set the global statsd client using
perfmetrics.set_statsd_client() or set a statsd client for each thread
using statsd_client_stack.push()/.pop()/.clear().
This is like... | Labgoo/appengine-logstash-rabbitmq-log-handler | code/clientstack.py | Python | gpl-2.0 | 789 |
__all__ = ["build_extra",
"build_i18n",
"build_icons",
"build_help",
"clean_i18n"]
| ceibal-tatu/sugar-update-control | dist_extra/__init__.py | Python | gpl-2.0 | 127 |
from datetime import datetime
from inflection import underscore
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declared_attr, declarative_base
from sqlalchemy.orm import relationship, backref
from sqlalchemy.orm.session import sessionmaker
from sqlalchemy.sql.sc... | behos/backup-to-s3 | packages/backup_to_s3/database/models.py | Python | gpl-2.0 | 1,972 |
# PyTransit: fast and easy exoplanet transit modelling in Python.
# Copyright (C) 2010-2019 Hannu Parviainen
#
# 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 Licen... | hpparvi/PyTransit | notebooks/contamination/src/blendlpf.py | Python | gpl-2.0 | 3,425 |
from tkinter import *
import icon
class TabMaker:
def __init__(self, main):
# S'occupe de l'installation du tab sur le tab area
self.main = main
self.frame = main.frame
self.cache = main.cache
self.tab_title = self.cache["CurrentTab"][0]
self.tab_bg_color = self.cache["CurrentTab"][1][0]
se... | EnceladOnline/interfaX | tab.py | Python | gpl-2.0 | 1,558 |
#!/usr/bin/env python
#
# Author : Vikas Chouhan
# email : presentisgood@gmail.com
#
# This is an automated script for mining down the list of all scrips available on
# https://in.finance.yahoo.com
# NOTE : This script uses selenium python module to function properly.
from selenium import webdriver
from selenium.... | vikaschouhan/stock_analysis | mine_scrips_from_yahoo.py | Python | gpl-2.0 | 4,934 |
from . import num_reader
import sys
import math
class Parser(num_reader.NumReader):
def __init__(self, writer):
num_reader.NumReader.__init__(self, writer)
self.i = 0
self.j = 0
self.x = 0
self.y = 0
self.down_z = 0
self.up_z = 20
self.up = True
... | vilemnovak/blendercam | scripts/addons/cam/nc/hpgl2d_read.py | Python | gpl-2.0 | 3,087 |
"""Contains forms related to INIS submissions."""
import copy
import os
# from datetime import date
from datetime import datetime
from flask import current_app, request
from inis.modules.deposit.field_widgets import SelectInput
from inis.modules.deposit.fields.inis_fields import CreatorForm, date_factory, location... | SDSG-Invenio/inis | inis/modules/deposit/forms.py | Python | gpl-2.0 | 15,561 |
#!/usr/bin/env python
# thecloud.py - Micro-sized Twitter client.
# Copyright (C) 2012 Amanda Folson <amanda@incredibl.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; either version 2
# o... | afolson/thecloud | thecloud.py | Python | gpl-2.0 | 1,545 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
# ex: /winecat/5/
url(r'^(?P<wine_id>[0-9]+)/$', views.detail, name='detail'),
url(r'^(?P<wine_id>[0-9]+)/vineyard/$', views.vineyard, name='vineyard'),
# ex: /polls/5/vote/
url(r'^(?P<w... | tday55/wineapp | winecat/urls.py | Python | gpl-2.0 | 383 |
# ~*~ coding: utf-8 ~*~
from __future__ import unicode_literals
import os
from collections import namedtuple, defaultdict
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.vars import VariableManager
from ansible.parsing.dataloader import DataLoader
from ansible.executor.playbook_executor ... | choldrim/jumpserver | apps/ops/ansible/runner.py | Python | gpl-2.0 | 9,951 |
import logging
import os
import sys
import ConfigParser
import string
import urllib2
class Config:
def __init__(self):
config = ConfigParser.ConfigParser()
with open(os.path.join(self._get_dir_path(),'config.cfg'), 'r') as cfg_file:
config.readfp(cfg_file)
self.service_host ... | JasonJDong/CompressBinary | IncrementalUpdate/IncrementalUpdate/config.py | Python | gpl-2.0 | 2,379 |
# BurnMan - a lower mantle toolkit
# Copyright (C) 2012, 2013, Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
# Released under GPL v2 or later.
import numpy as np
import warnings
from burnman import Material
from burnman import Mineral
def check_pairs(fractions, minerals):
if len(fractions) < 1:
... | QuLogic/burnman | burnman/composite.py | Python | gpl-2.0 | 3,925 |
#!/usr/bin/env python
"""Program to compare 2 images
Process these images to show the differences more clearly
and show with 3 tabs: Master image, Slave image, Diff image.
Author: Henk Speksnijder october 2013.
20130927 Version 0.73 using PYTHON-PILLOW
"""
import sys
#import os
import io
from PIL import Image, ImageC... | henkidefix/CompareDir | compareimage.py | Python | gpl-2.0 | 8,354 |
#!/usr/bin/python
#
# Copyright (C) 2015 Cisco Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | tecdct2941/scripts | guestshell/getIntfDataRaw.py | Python | gpl-2.0 | 2,192 |
import csv
# Steps
# 1. print each line
# 2. print each item in each line
# 3. add all names to a set
# 4. create a friend dictionary of sets of friends
people = set()
with open('harry_potter.csv') as file:
reader = csv.reader(file)
for row in reader:
if(len(row) == 2):
people.add(row[0])
people.add(row[1])
... | emhill/117-S15 | src/morea/10.project2/in_class/csv_reader.py | Python | gpl-2.0 | 406 |
# Copyright (C) 2014-2014 Project
# License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
import argparse
import logging
_logger = logging.getLogger('pwebs.main')
#logging.basicConfig(level=0)
exitcodes = {'OK': 0,
'Warning': 1,
'Critical': 2,
'Unknown': 3}
de... | lakrahn-de/pwebs | pwebs/main.py | Python | gpl-2.0 | 9,421 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | stuart-knock/tvb-framework | tvb/core/entities/file/hdf5_storage_manager.py | Python | gpl-2.0 | 29,494 |
#--->
#-from enigma import eTimer, eTPM, eEnv
#---<
#+++>
from enigma import eTimer, eEnv
#+++<
from Screens.Screen import Screen
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Pixmap import Pixmap,MultiPixmap
from Components.Label import Label
from Components.Sources.StaticText import Stat... | popazerty/enigma2cuberevo | lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py | Python | gpl-2.0 | 19,320 |
# Nothing alliance specific in here.
# qebab, 24/6/08.
import re
import math
from munin import loadable
class rprod(loadable.loadable):
"""Find out how much you can spend with n factories
in m ticks."""
def __init__(self, cursor):
super().__init__(cursor, 1)
self.paramre = re.compile(r"^... | munin/munin | deprecated/rprod.py | Python | gpl-2.0 | 3,450 |
from unittest import TestCase
from duckduckgo.duckduckgo import query, Redirect, Result, Results, Abstract, Image, Answer
__author__ = 'robbie'
class TestDDG(TestCase):
def setUp(self):
pass
def test_ddg(self):
result = query('meat')
string = ""
related = result.related
... | robbielynch/RoblySearch | tests/test_duckduckgo.py | Python | gpl-2.0 | 567 |
from builder.btools import RegisterCustomTest
from builder.btools import AddConfigKey
from builder.bconfig import getAutoconfPrefix
from builder.bconfig import getArchInfo, ARCH_X86_64
from builder.bconfig import Version
import os.path
def CheckOptix(ctx, write_config_h=False, add_to_compiler_env=False,
... | paeschli/scons-builder | modules/optix_check.py | Python | gpl-2.0 | 4,137 |
import tkinter.ttk as ttk
class SearchClient(ttk.Frame):
def __init__(self, master, model, ctrl):
ttk.Frame.__init__(self, master)
self.model = model
self.ctrl = ctrl
self.create_widgets()
def create_widgets(self):
ttk.Label(self, text="Email:").grid(row=0, sticky="E")... | rssalessio/MMSE15Project-RussoJohansson | mmse15project/views/subviews/SearchClient.py | Python | gpl-2.0 | 3,195 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 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; either version 2 of the
# License, or (at your option) any... | ddaze/cds | cds/modules/personal_collection/bundles.py | Python | gpl-2.0 | 1,113 |
# This file contains the WSGI configuration required to serve up your
# web application.
# It works by setting the variable 'application' to a WSGI handler of some
# description.
#
# The below has been auto-generated for your Bottle project
import bottle
import os
import sys
here = os.path.dirname(__file__)
# add your ... | labase/eica | wsgi.py | Python | gpl-2.0 | 872 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
## rank_display.py
#############################################################################
# Copyright (C) Labomedia November 2012
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# a... | sergeLabo/mpff | game/scripts/rank_display.py | Python | gpl-2.0 | 2,839 |
from django.test import TestCase
from ..models import series_alias
class test_series_alias(TestCase):
def setUp(self):
self.subject = series_alias(name='Name')
def test__series_alias__instance(self):
self.assertIsInstance(self.subject, series_alias)
def test__series_alias__str(self):
... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/tests/test_series_alias.py | Python | gpl-2.0 | 380 |
# -*- coding: utf-8 -*-
"""
@brief GUI panel for export functionality
This program is free software under the GNU General Public License
(>=v2). Read the file COPYING that comes with GRASS for details.
@author: Anna Petrasova (akratoc@ncsu.edu)
"""
import os
import wx
import wx.lib.filebrowsebutton as filebrowse
from... | ncsu-osgeorel/grass-tangible-landscape | export.py | Python | gpl-2.0 | 6,303 |
import pygame
pygame.init()
screen = pygame.display.set_mode((640, 480))
clock = pygame.time.Clock()
done = False
font = pygame.font.SysFont("comicsansms", 72)
text = font.render("Hello, World", True, (0, 128, 0))
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
... | scottjames/LightArcade | raspi/quick.py | Python | gpl-2.0 | 611 |
# Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either v... | tjcsl/cslbot | cslbot/commands/cve.py | Python | gpl-2.0 | 2,149 |
# -*- coding: utf-8 -*-
#
# Copyright © 2008-2015 Red Hat, Inc. All rights reserved.
# Copyright © 2008-2015 Luke Macken <lmacken@redhat.com>
# Copyright © 2008 Kushal Das <kushal@fedoraproject.org>
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject t... | gastrodia/liveusb-creator | liveusb/gui.py | Python | gpl-2.0 | 25,975 |
"""
Parser Exceptions shared by all Parsers
"""
from marshmallow import ValidationError
class ParserException(Exception):
pass
class NoParserException(Exception):
pass
class FormatException(ParserException):
"""
Use for badly formatted files
"""
pass
class UndefinedRecordType(FormatExce... | DeskGen/dgparse | dgparse/exc.py | Python | gpl-2.0 | 832 |
from threading import Thread
import time
class trackMain(object):
def __init__(self, app):
self.loggedIn = {}
self.socket = app
self.checkTime = 3
self.timeoutThreshhold = 2
@app.on('heartbeat')
def heartbeat(name):
self.loggedIn[name] = True
... | sona1111/flaskchat | app/trackUsers.py | Python | gpl-2.0 | 1,192 |
from django.urls import path
from .views import MailchimpSubscribeView
app_name = 'newsletter'
urlpatterns = [
path('subscribe/', MailchimpSubscribeView.as_view(), name='subscribe')
]
| OpenTechFund/WebApp | opentech/public/mailchimp/urls.py | Python | gpl-2.0 | 193 |
from controller.registrar import Registrar
import json
class TestRegistrar:
def __init__(self, conf, auth_info):
self.registrar = Registrar(conf, auth_info)
def test_client(self):
assert self.registrar.client != None
assert self.registrar.client != None
print self.registrar.cl... | balajiiyer-ufl-projects/OpenStackVaccine | test/registrar_test.py | Python | gpl-2.0 | 1,074 |
import gdb
import gdb_lookup
gdb_lookup.register_printers(gdb)
| eranif/codelite | Runtime/gdb_printers/rustlib/etc/gdb_load_rust_pretty_printers.py | Python | gpl-2.0 | 63 |
# -----------------------------------------------------------------------------
# Sharamaan Web client - Web client of Sharamaan GIS suite
# Copyright (C) 2012-2013 Yellowen Development Team <checkout AUTHORS>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of t... | Yellowen/Sharamaan | auth/views.py | Python | gpl-2.0 | 2,633 |
"""
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 source directory tree.
"""
"""
#############################################################################################
# Name: AlarmFTP.py
#
# Authors:
# ... | khosrow/metpx | sundew/lib/AlarmFTP.py | Python | gpl-2.0 | 1,016 |
"""
A SCons tool that tries to run python-config to collect the build environment
variables.
Sets env['HAVE_PYTHON_CONFIG'] to True on success, False otherwise.
$Id: ImportPythonConfig.py 806 2013-12-26 21:50:22Z weegreenblobbie $
"""
"""
Nsound is a C++ library and Python module for audio synthesis featuring
dynam... | weegreenblobbie/nsound | site_scons/site_tools/ImportPythonConfig.py | Python | gpl-2.0 | 7,292 |
# Copyright 2011 Jaap Karssenberg <jaap.karssenberg@gmail.com>
# This module contains a number of meta test to check coding style
# and packaging
import tests
import os
import sys
import copy
import re
import subprocess
import inspect
def zim_modules():
'''Get the all module in the zim source'''
for file in tes... | jaap-karssenberg/zim-desktop-wiki | tests/package.py | Python | gpl-2.0 | 9,944 |
#!/usr/bin/python
"""
execute.py
Execute a command in the default shell.
Copyright (C) 2013 William Kettler <william.p.kettler@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 ve... | wkettler/pyzfs | execute.py | Python | gpl-2.0 | 2,315 |
# -*- coding: utf-8 -*-
################################################################################
# Copyright (C) 2012 Travis Shirk <travis@pobox.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 So... | daltonsena/eyed3 | fabfile.py | Python | gpl-2.0 | 1,595 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015-2016 James Clark <james.clark@ligo.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; either version 2 of the License, or
#... | astroclark/bhextractor | bin/bhex_makePCs.py | Python | gpl-2.0 | 3,267 |
# A part of pdfrw (https://github.com/pmaupin/pdfrw)
# Copyright (C) 2015 Patrick Maupin, Austin, Texas
# MIT license -- See LICENSE.txt for details
''' This module contains a function to find all the XObjects
in a document, and another function that will wrap them
in page objects.
'''
from .objects import Pd... | Wintermute0110/plugin.program.advanced.MAME.launcher | pdfrw/pdfrw/findobjs.py | Python | gpl-2.0 | 4,640 |
/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/genericpath.py | HyperloopTeam/FullOpenMDAO | lib/python2.7/genericpath.py | Python | gpl-2.0 | 101 |
#!/usr/bin/env python
'''
Project Euler Problem 024 - Lexicographic permutations
----------------
Description:
What is the millionth lexicographic permutation of
the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
Solution:
2783915460
----------------
Haoliang Wang 02/03/2015
'''
from math import flo... | haoliangx/Project-Euler | src/P-024.py | Python | gpl-2.0 | 549 |
VERSION = (0, "1.0", None)
| pat1/autoradio | autoradio/player/__init__.py | Python | gpl-2.0 | 27 |
import re
import string
from types import StringType
import nsiqcppstyle_util
import os
import urllib
try:
import hashlib
md5_constructor = hashlib.md5
except ImportError:
import md5
md5_constructor = md5.new
url = "http://nsiqcppstyle.appspot.com"
def Update(currentVersion):
import httplib
i... | kunaltyagi/nsiqcppstyle | updateagent/agent.py | Python | gpl-2.0 | 5,305 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
LrsPlugin
A QGIS plugin
Linear reference system builder and editor
-------------------
begin : 2013-10-02
copyright ... | blazek/lrs | lrs/lrs/error/lrserrorlayer.py | Python | gpl-2.0 | 2,001 |
#!/usr/bin/evn python
import OledTestCaseWrapper
import unittest
import time
class OledMessageDisplayTestCase(OledTestCaseWrapper.OledInitializationWrapper):
def test_display_short_message_should_not_scroll(self):
success, msg = self._oled.Cmd('%c%s' % (0x06, 'no scrolling\0'))
self.asser... | simbits/Ad-Hoc-Dark-Roast-Network-Travel-Mug- | Code/Mug/oled_4GDL/tests/OledTextTestSuite.py | Python | gpl-2.0 | 3,580 |
def cheese_and_crackers(cheese_count, boxes_of_crackers):
print "You have %d cheeses!" % cheese_count
print "You have %d boxes of crackers!" % boxes_of_crackers
print "Man that's enough for the party!"
print "Get a blanket.\n"
print "We can just give the function numbers directly:"
cheese_and_crackers(20,3... | anantk17/lpthw | ex19.py | Python | gpl-2.0 | 668 |
# 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... | buildbot/buildbot | master/buildbot/test/unit/steps/test_python.py | Python | gpl-2.0 | 25,470 |
# Copyright (C) 2001-2006 Quantum ESPRESSO group
# This file is distributed under the terms of the
# GNU General Public License. See the file `License'
# in the root directory of the present distribution,
# or http://www.gnu.org/copyleft/gpl.txt .
#
# Author: Filippo Spiga (spiga.filippo@gmail.com)
# Date: September 29... | fspiga/phiGEMM | scripts/addPhigemmSymbs.py | Python | gpl-2.0 | 1,821 |
# -*- coding: utf-8 -*-
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter
@stringfilter
def ka_translit(value,arg):
""" Returns the passed Georgian string as transliterated into the language
given in arg."""
if arg[0:2] in la... | tigeorgia/CorpSearch | apps/django_transliterate/templatetags/transliterate.py | Python | gpl-2.0 | 1,139 |
from functools import reduce
def toposort(data):
"""Dependencies are expressed as a dictionary whose keys are items
and whose values are a set of dependent items. Output is a list of
sets in topological order. The first set consists of items with no
dependences, each subsequent set consists of items that depend ... | velezj/pods.velezj-pods-utils | src/produce-to-build.py | Python | gpl-2.0 | 1,388 |
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# 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... | palli/python-virtinst | virtinst/User.py | Python | gpl-2.0 | 2,726 |
from socket import *
from argparse import ArgumentParser
from bowman.utils import Connection
from math import sqrt
import sys, os
UNIT_TYPES_SYMBOLS = ["r", "k", "h", "w", "s", "a", "dm", "lm", "dr"]
class bot():
def __init__(self, remote_ip, remote_port):
self.remote_ip = remote_ip
self.remote_po... | carzil/bowman | bot.py | Python | gpl-2.0 | 13,595 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
import pymongo
from pymongo import ASCENDING, DESCENDING
if "Darwin" in os.po... | erikdejonge/newsrivr | daemons/clear_newsrivr.py | Python | gpl-2.0 | 1,356 |
# 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
from DrawingArea import DrawingArea
class Curve(DrawingArea):
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/Curve.py | Python | gpl-2.0 | 7,072 |
# Copyright (C) 2004-2008 Paul Cochrane
#
# 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 distribut... | paultcochrane/pyvisi | pyvisi/tests/test_renderer.py | Python | gpl-2.0 | 6,801 |
# fsm.py - Finite State Machine classes
# Azzurra IRC Services TLD DFA generator
# Copyright (C) 2011 Matteo Panella <morpheus@azzurra.org>
#
# This program is free but copyrighted software; please check COPYING
# for more details.
__all__ = ['DFA', 'Trie', 'State']
class Token(object):
def __init__(self, sym, i... | rfc1459/tldgen | fsm.py | Python | gpl-2.0 | 7,214 |
import wpilib
class MyRobot(wpilib.IterativeRobot):
def robotInit(self):
'''
Initializes robot components
'''
#initialize motor
self.motor = wpilib.Jaguar(0)
def autonomousInit(self):
pass
def autonomousPeriodic(self):
p... | frc2423/2015 | mike_practice/robot.py | Python | gpl-2.0 | 425 |
basis_set = \
{
"H": [
[
"S",
[
[
19.2406,
0.032828
],
[
2.8992,
0.231208
],
[
0.6534,
... | LT12/LTPsi | basis/DZ.py | Python | gpl-2.0 | 25,619 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2016-08-01
git sha ... | lcoandrade/DsgTools | gui/CustomWidgets/CustomDbManagementWidgets/newAttributeWidget.py | Python | gpl-2.0 | 7,466 |
from __future__ import unicode_literals
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from django.utils.translation import ugettext_lazy as _
from alliance_auth.hooks import get_hooks
from authentication.decorators import members_and_... | iAddz/allianceauth | services/views.py | Python | gpl-2.0 | 3,056 |
from amoco.config import conf
from amoco.system.core import DefineLoader
from amoco.system import elf
@DefineLoader("elf", elf.EM_X86_64)
def loader_x64(p):
from amoco.system.linux64.x64 import OS
return OS.loader(p, conf.System)
@DefineLoader("elf", elf.EM_AARCH64)
def loader_aarch64(p):
from amoco.sy... | LRGH/amoco | amoco/system/linux64/__init__.py | Python | gpl-2.0 | 389 |
#!/usr/bin/python3
# This test needs Raspberry Pi hardware
# need export PYTHONPATH=/path/to/Vcourse/lib
import RPi.GPIO as GPIO
import time
# GPIO.cleanup()
# quit()
RED = 12
GREEN = 16
BLUE = 18 # not currently used
SLOW = 0.5
MEDIUM = 1.0 # can miss this with quick look
FAST = 2.0
VERYFAST ... | pdgilbert/Vcourse | tests/segfault2.py | Python | gpl-2.0 | 1,924 |
# -*- coding: utf-8 -*-
import logging
import webbrowser
import wx
import widgetUtils
import output
from wxUI.tabs import video
from wxUI import commonMessages, menus
from controller import selector
from .wall import wallBuffer
log = logging.getLogger("controller.buffers.video")
class videoBuffer(wallBuffer):
"""... | manuelcortez/socializer | src/controller/buffers/video.py | Python | gpl-2.0 | 4,961 |
from flask import Response
from flask.views import View
from bson import json_util
from ugca import mongo
class SurveyeeDistribution(View):
def dispatch_request(self, group):
'''Get the answers types of corruption as they are preceived, witnessed, and participated in.
:param group: surveyee prope... | opendatakosovo/undp-gsc-api | ugca/views/surveyeedistribution.py | Python | gpl-2.0 | 1,322 |
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from ui_frmVisual import Ui_Dialog
import ftools_utils
import math
class VisualDialog( QDialog, Ui_Dialog ):
def __init__( self, iface, function ):
QDialog.__init__( self )
self.iface = iface
self.setupUi... | sourcepole/qgis | qgis/python/plugins/fTools/tools/doVisual.py | Python | gpl-2.0 | 21,682 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# EEG.py
#
# Copyright 2015 220 <220@WKH>
#
# 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... | 2-2-0/EDFview | EEG.py | Python | gpl-2.0 | 5,672 |
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic.base import RedirectView
admin.autodiscover()
urlpatterns = patterns('',
url(r'^polls/', include('polls.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^(.*)$', RedirectView.as_view(ur... | gstiebler/offline_mobile_poll | django/mysite/urls.py | Python | gpl-2.0 | 347 |
from ProfileManager import ProfileManager
GLOBAL_SESSION = None
def _setSession(session):
global GLOBAL_SESSION
GLOBAL_SESSION = session
def _getSession():
global GLOBAL_SESSION
return GLOBAL_SESSION
class SessionManager(object):
@staticmethod
def doLogin(name):
profileManager... | Neeneko/OKMiner | SessionManager.py | Python | gpl-2.0 | 463 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# 2009 Benny Malengier
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; ei... | Forage/Gramps | gramps/gui/editors/displaytabs/nameembedlist.py | Python | gpl-2.0 | 7,691 |
"""Test invalid __all__ format.
Tuples with one element MUST contain a comma! Otherwise it's a string.
"""
__all__ = ("CONST") # [invalid-all-format]
CONST = 42
| PyCQA/pylint | tests/functional/i/invalid/invalid_all_format.py | Python | gpl-2.0 | 164 |
# -*- coding: utf-8 -*-
"""
------
Views
------
Arquivo de configuração das views da aplicação blog
Autores:
* Alisson Barbosa Ferreira <alissonbf@hotmail.com>
Data:
============== ==================
Criação Atualização
============== ==================
29/11/2014 25/03/2015
============== ===... | alissonbf/blog-teste | blog/views.py | Python | gpl-2.0 | 7,479 |
# Copyright (c) 2016 The GNOME Music Developers
#
# GNOME Music 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.
#
# GNOME Music is dist... | albfan/gnome-music | gnomemusic/widgets/playlistdialog.py | Python | gpl-2.0 | 7,810 |
#!usr/bin/python
# -*- coding: utf-8 -*-
#
from random import choice, uniform
import smtplib
import requests
from email.mime.text import MIMEText
from datetime import date, timedelta
import getpass
import settings as s
class TheWonderCouple:
def __init__(self, gifter_email, gifted_email, joke):
self.gift... | rphenriques/couple_mixer | couple_mixer_v2019.py | Python | gpl-2.0 | 5,612 |
# -*- coding: utf-8 -*-
#
# This file is part of Zenodo.
# Copyright (C) 2020 CERN.
#
# Zenodo 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 v... | zenodo/zenodo | zenodo/modules/spam/ext.py | Python | gpl-2.0 | 2,369 |