code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# This file is distributed under the terms of the GNU General Public license.
# Copyright (C) 1999 Aloril (See the file COPYING for details).
import time
from mind.Goal import Goal
# goals for minds
def false(_): return False
def true(_): return True
class Delayed(Goal):
"""Will delay execution of sub goal... | worldforge/cyphesis | data/rulesets/basic/scripts/mind/goals/common/common.py | Python | gpl-2.0 | 3,486 |
'''
Allmyvideos urlresolver plugin
Copyright (C) 2013 Vinnydude
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 i... | dejay313/dojostreams | script.module.urlresolver/lib/urlresolver/plugins/vidspot.py | Python | gpl-2.0 | 2,031 |
# Django settings for barista project.
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Sinan Midillili', 'sinan@rahatol.com'),
)
DEFAULT_FROM_EMAIL = 'sinan@rahatol.com',
SERVER_EMAIL = 'sinan@rahatol.com'
MANAGERS = ADMINS
# Hosts/domain names that are valid for this site; required if DEBUG is Fals... | sinanm89/barista | build/barista-site/barista/settings.py | Python | gpl-2.0 | 6,858 |
#!/usr/bin/env python3
import os
import shutil
import subprocess
import sys
if os.environ.get('DESTDIR'):
install_root = os.environ.get('DESTDIR') + os.path.abspath(sys.argv[1])
else:
install_root = sys.argv[1]
if not os.environ.get('DESTDIR'):
schemadir = os.path.join(install_root, 'glib-2.0', 'schemas')
pr... | GNOME/gnome-session | meson_post_install.py | Python | gpl-2.0 | 789 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... | mozilla/verbatim | vendor/lib/python/translate/storage/zip.py | Python | gpl-2.0 | 2,203 |
# module includes
import elliptic
import heat
import IRT
print "Loading comatmor version 0.0.1"
| fameyer/comatmor | src/comatmor/__init__.py | Python | gpl-2.0 | 96 |
# coding=utf-8
import random
import time
import threading
import unittest
from lru_cache import LruCache
class TesLruCache(unittest.TestCase):
def test_cache_normal(self):
a = []
@LruCache(maxsize=2, timeout=1)
def foo(num):
a.append(num)
return num
foo(1)... | Backflipz/plugin.video.excubed | resources/lib/cache/tests.py | Python | gpl-2.0 | 4,445 |
# -*- coding: utf-8; -*-
"""
Copyright (C) 2007-2013 Guake authors
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 progra... | mouseratti/guake | guake/main.py | Python | gpl-2.0 | 15,344 |
#!/usr/bin/env python
import sys
import json
from elasticsearch1 import Elasticsearch
def init_es(es_host, es_index):
es = Elasticsearch([ es_host ])
es.indices.delete( es_index, ignore=[400, 404] )
es.indices.create( es_index, ignore=400 )
# create mappings
with open('pcawg_summary.mapping.js... | ICGC-TCGA-PanCancer/pcawg-central-index | pcawg_metadata_parser/pcawg_summary.loader.py | Python | gpl-2.0 | 955 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | JamesLinEngineer/RKMC | addons/plugin.video.salts/scrapers/snagfilms_scraper.py | Python | gpl-2.0 | 6,712 |
"""okc_scraper includes all the functions needed to scrape profiles from
OKCupid"""
import requests
import cPickle as pickle
import time
from BeautifulSoup import BeautifulSoup
def authorize(username, password):
"""Log into OKCupid to scrape profiles"""
user_info = {"username": username, "password": passwor... | lbybee/okc_project | okc_scraper_no_q.py | Python | gpl-2.0 | 8,941 |
#
#
# Copyright (C) 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 later version.
#
# This program is distributed ... | ribag/ganeti-experiments | test/py/cmdlib/testsupport/__init__.py | Python | gpl-2.0 | 1,827 |
#!/usr/bin/python
import unittest
import apt_pkg
import apt.progress.base
class TestCache(unittest.TestCase):
"""Test invocation of apt_pkg.Cache()"""
def setUp(self):
apt_pkg.init_config()
apt_pkg.init_system()
def test_wrong_invocation(self):
"""cache_invocation: Test wrong in... | suokko/python-apt | tests/test_cache_invocation.py | Python | gpl-2.0 | 863 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | andysim/psi4 | psi4/driver/procrouting/proc_table.py | Python | gpl-2.0 | 10,293 |
#
# downloadview.py
#
# Copyright 2010 Brett Mravec <brett.mravec@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 version 2 of the License, or
#... | bmravec/DownMan | downman/gui/downloadview.py | Python | gpl-2.0 | 1,413 |
# -*- coding: utf-8 -*-
"""
Estimate the international "visibility" of countries by retrieving the
average number of articles the New York Times returns in its search query.
For each year and each country, a query is send to the NYT api and the
number of returned hits (i.e. articles) is taken as estimate for the
inter... | nberliner/delveData | lib/countryMentionNYT.py | Python | gpl-2.0 | 3,856 |
# -*- coding: utf-8 -*-
from mock import patch
import os
import pprint
import shutil
import subprocess
import unittest
from pyspatialite import dbapi2 as db
import qgis.core # Need to import this before PyQt to ensure QGIS parts work
from PyQt4.QtSql import QSqlQuery, QSqlDatabase
from Roadnet.database import conne... | thinkWhere/Roadnet | tests/integration/test_wdm.py | Python | gpl-2.0 | 8,439 |
#!/usr/bin/python2
import check
from fractions import gcd
# Algorithm taken from en.wikipedia.org/wiki/Line-line-_intersection
# All code written by Joel Williamson
## intersection: Int Int Int Int Int Int Int Int -> (union "parallel" (tuple Int Int Int Int))
##
## Purpose: Treating the input as 4 pairs of integers,... | joelwilliamson/cs234 | a1/a01q2b.py | Python | gpl-2.0 | 3,280 |
# -*- coding: utf-8 -*-
__author__ = 'Eren Turkay <turkay.eren@gmail.com>'
from scrapy import log
from scrapy.http import Request
from scrapy.exceptions import CloseSpider
from datetime import datetime
from . import GenericSozlukSpider
from ..items import Girdi
class ItusozlukBaslikSpider(GenericSozlukSpider):
... | eren/sozlukcrawler | sozlukcrawl/spiders/itusozluk.py | Python | gpl-2.0 | 2,234 |
import osclib.api
import osc.conf
import os
import os.path
import vcr
import pytest
import requests
TESTROOT = os.path.join(pytest.config.rootdir, "osclib-tests")
OSCRC = os.path.join(TESTROOT, "oscrc", "oscrc_test_api")
VCRROOT = os.path.join(TESTROOT, "fixtures", "vcr")
def test_default_api(monkeypatch):
""... | matejcik/osc | osclib-tests/test_api.py | Python | gpl-2.0 | 3,172 |
r"""A proxy enabling multiple wiring guide instances to interact with the same
SpiNNaker boards.
A very simple protocol is used between the client and server. Clients may send
the following new-line delimited commands to the server:
* ``VERSION,[versionstring]\n`` The server will disconnect any client with an
incom... | SpiNNakerManchester/SpiNNer | spinner/proxy.py | Python | gpl-2.0 | 8,272 |
# Copyright (C) 2013-2015 Red Hat, Inc.
# Copyright (C) 2015 Thomas Spura
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is di... | tomspur/dnf-plugins-buildlocal | buildlocal.py | Python | gpl-2.0 | 8,142 |
from testscenarios import TestWithScenarios
import unittest
from geocode.geocode import GeoCodeAccessAPI
class GeoCodeTests(TestWithScenarios, unittest.TestCase):
scenarios = [
(
"Scenario - 1: Get latlng from address",
{
'address': "Sydney NSW",
'l... | saleem-latif/GeoCode | tests/unittest_geocode.py | Python | gpl-2.0 | 1,541 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
package/module TEST
Descripción del test.
Autor: PABLO PIZARRO @ github.com/ppizarror
Fecha: AGOSTO 2016
Licencia: GPLv2
"""
__author__ = "ppizarror"
# Importación de librerías
# noinspection PyUnresolvedReferences
from _testpath import * # @UnusedWildI... | ppizarror/korektor | test/_template.py | Python | gpl-2.0 | 1,642 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import serial
gSerialName = '/dev/ttyS0'
gBaudrate = 9600
gTimeout = 0
gRequestByte = 1
if __name__ == "__main__":
ser = serial.Serial(
port = gSerialName,
baudrate = gBaudrate,
bytesize = serial.EIGHTBITS,
parity = ser... | yougukepp/openwrt | radio_tools/radio_tools/cli/serialServer.py | Python | gpl-2.0 | 822 |
#
# Copyright (C) 2019 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | atodorov/anaconda | tests/nosetests/pyanaconda_tests/module_disk_select_test.py | Python | gpl-2.0 | 5,967 |
## This file is part of Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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, ... | pombredanne/invenio | modules/websubmit/lib/functions/Create_Modify_Interface.py | Python | gpl-2.0 | 12,904 |
from enigma import eEPGCache, getBestPlayableServiceReference, \
eServiceReference, iRecordableService, quitMainloop
from Components.config import config
from Components.UsageConfig import defaultMoviePath
from Components.TimerSanityCheck import TimerSanityCheck
from Screens.MessageBox import MessageBox
import Scree... | openpli-arm/enigma2-arm | RecordTimer.py | Python | gpl-2.0 | 26,731 |
import unittest
import mock
import blivet
from pykickstart.constants import CLEARPART_TYPE_ALL, CLEARPART_TYPE_LINUX, CLEARPART_TYPE_NONE
from parted import PARTITION_NORMAL
from blivet.flags import flags
DEVICE_CLASSES = [
blivet.devices.DiskDevice,
blivet.devices.PartitionDevice
]
@unittest.skipUnless(not... | atodorov/blivet | tests/clearpart_test.py | Python | gpl-2.0 | 9,228 |
# SPDX-License-Identifier: GPL-2.0+
# Copyright (c) 2016 Google, Inc
# Written by Simon Glass <sjg@chromium.org>
#
# Entry-type module for 'u-boot-nodtb.bin'
#
from entry import Entry
from blob import Entry_blob
class Entry_u_boot_spl_nodtb(Entry_blob):
def __init__(self, image, etype, node):
Entry_blob._... | ev3dev/u-boot | tools/binman/etype/u_boot_spl_nodtb.py | Python | gpl-2.0 | 431 |
# Working Unit Test Benches for Network Simulator
# Last Revised: 14 November 2015 by Sushant Sundaresh & Sith Domrongkitchaiporn
'''
IMPORTANT: Please turn off logging (MEASUREMENT_ENABLE = False) in constants.py
before running these testbenches.
'''
# Unit Testing Framework
import unittest
# Test Modules
import r... | sssundar/NetworkSimulator | Code/Python/unit_test_benches.py | Python | gpl-2.0 | 12,927 |
#!/usr/bin/env python
from setuptools import setup, find_packages
from os import path
# www.pythonhosted.org/setuptools/setuptools.html
setup(
name="lines",
version="1.4.0",
description="Program for plotting powder diffraction patterns and background subtraction",
author="Stef Smeets",
author_em... | stefsmeets/lines | setup.py | Python | gpl-2.0 | 911 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
[tests/stdlib/test_help.py]
Test the help command.
"""
import unittest
#import os
#from ergonomica import ergo, ENV
class TestHelp(unittest.TestCase):
"""Tests the 'help' command."""
def test_list_commands(self):
"""
Tests listing all comma... | ergonomica/ergonomica | tests/stdlib/test_help.py | Python | gpl-2.0 | 375 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Source : Les recettes Python de Tyrtamos
http://python.jpvweb.com/mesrecettespython/doku.php?id=date_de_paques
"""
class jourferie:
def datepaques(self,an):
"""Calcule la date de Pâques d'une année donnée an (=nombre entier)"""
a=an//100
b=a... | guiguiabloc/api-domogeek | Holiday.py | Python | gpl-2.0 | 6,861 |
# 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.
"""Make osversion.osmajor_id non-NULLable
Revision ID: 5ab66e956c6b
Re... | beaker-project/beaker | Server/bkr/server/alembic/versions/5ab66e956c6b_osversion_osmajor_id_non_nullable.py | Python | gpl-2.0 | 743 |
"""
Functions performing URL trimming and cleaning
"""
## This file is available from https://github.com/adbar/courlan
## under GNU GPL v3 license
import logging
import re
from collections import OrderedDict
from urllib.parse import parse_qs, urlencode, urlparse, ParseResult
from .filters import validate_url
from .... | adbar/url-tools | courlan/clean.py | Python | gpl-2.0 | 5,520 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ts=4:sw=4:expandtab:
# Copyright 2008 Mark Mitchell
# License: see __license__ below.
__doc__ = """
Reads a GraphicsMagick source file and parses the specially formatted
comment blocks which precede each function and writes the information
obtained from the commen... | kazuyaujihara/osra_vs | GraphicsMagick/scripts/format_c_api_doc.py | Python | gpl-2.0 | 21,967 |
import sys
def bye():
sys.exit(40) # Crucial error: abort now!
try:
bye()
except Exception:
print('got it') # Oops--we ignored the exit
print('continuing...')
| simontakite/sysadmin | pythonscripts/learningPython/exiter2.py | Python | gpl-2.0 | 208 |
#!/usr/bin/env python
################################################################################
#
# Project Euler - Problem 6
#
# The sum of the squares of the first ten natural numbers is,
#
# 1^2 + 2^2 + ... + 10^2 = 385
# The square of the sum of the first ten natural numbers is,
#
# (1 + 2 + ... + 10)^2 = 5... | carrdelling/project_euler | problem6.py | Python | gpl-2.0 | 996 |
#!/usr/bin/python
# Ubuntu Tweak - PyGTK based desktop configure tool
#
# Copyright (C) 2007-2008 TualatriX <tualatrix@gmail.com>
#
# Ubuntu Tweak 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 versio... | tualatrix/ubuntu-tweak-old | src/common/config.py | Python | gpl-2.0 | 6,864 |
# Copyright (C) 2013-2021 Roland Lutz
#
# 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 ... | rlutz/xorn | tests/cpython/storage/ob_equality.py | Python | gpl-2.0 | 1,119 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'c:/steganography/main.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _... | nklose/Steganography | gui_main.py | Python | gpl-2.0 | 15,883 |
__author__ = 'george'
from baseclass import Plugin
import time
from apscheduler.scheduler import Scheduler
class AreWeDone(Plugin):
def __init__(self, skype):
super(AreWeDone, self).__init__(skype)
self.command = "arewedoneyet"
self.sched = Scheduler()
self.sched.start()
sel... | jvlomax/Beaker-bot | plugins/arewedone.py | Python | gpl-2.0 | 1,837 |
ucodes = {
"U0001" : "High Speed CAN Communication Bus" ,
"U0002" : "High Speed CAN Communication Bus (Performance)" ,
"U0003" : "High Speed CAN Communication Bus (Open)" ,
"U0004" : "High Speed CAN Communication Bus (Low)" ,
"U0005" : "High Speed CAN Communication Bus (High)" ,
"U0006" : "High Speed ... | lkarsten/pyobd | network_codes.py | Python | gpl-2.0 | 18,096 |
# Portions Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# Copyright Mercurial Contributors
#
# This software may be used and distributed according to the terms of the
# GNU General Public License v... | facebookexperimental/eden | eden/scm/edenscm/mercurial/annotate.py | Python | gpl-2.0 | 4,963 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | tkaitchuck/nupic | py/nupic/analysis/inspectors/network/__init__.py | Python | gpl-3.0 | 1,690 |
## Copyright 2009 Laurent Bovet <laurent.bovet@windmaster.ch>
## Jordi Puigsegur <jordi.puigsegur@gmail.com>
##
## This file is part of wfrog
##
## wfrog 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 Softwar... | wfrog/wfrog | wfcommon/config.py | Python | gpl-3.0 | 7,089 |
"""Multidict implementation.
HTTP Headers and URL query string require specific data structure:
multidict. It behaves mostly like a dict but it can have
several values for the same key.
"""
import os
__all__ = ('MultiDictProxy', 'CIMultiDictProxy',
'MultiDict', 'CIMultiDict', 'upstr', 'istr')
__version__... | DivineHime/seishirou | lib/multidict/__init__.py | Python | gpl-3.0 | 1,162 |
""" DIRAC FileCatalog mix-in class to manage directory metadata
"""
# pylint: disable=protected-access
import six
import os
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Utilities.Time import queryTime
class DirectoryMetadata(object):
def __init__(self, database=None):
self.db = database
def setDa... | DIRACGrid/DIRAC | src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/DirectoryMetadata/DirectoryMetadata.py | Python | gpl-3.0 | 37,350 |
# 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,
# bu... | santazhang/BitTorrent-4.0.0-GPL | BitTorrent/btformats.py | Python | gpl-3.0 | 5,378 |
from __future__ import absolute_import
from .MockPrinter import MockPrinter
import mock
from random import random
class M201_Tests(MockPrinter):
def setUp(self):
self.printer.path_planner.native_planner.setAcceleration = mock.Mock()
self.printer.axis_config = self.printer.AXIS_CONFIG_XY
self.printer.sp... | intelligent-agent/redeem | tests/gcode/test_M201.py | Python | gpl-3.0 | 3,414 |
###################################################################################################
#
# PySpice - A Spice Package for Python
# Copyright (C) 2014 Fabrice Salvaire
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... | thomaslima/PySpice | PySpice/Spice/Simulation.py | Python | gpl-3.0 | 14,801 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | Pakoach/Sick-Beard-Animes | sickbeard/tvcache.py | Python | gpl-3.0 | 10,306 |
from DIRAC import S_ERROR, S_OK, gLogger
from DIRAC.DataManagementSystem.private.FTSAbstractPlacement import FTSAbstractPlacement, FTSRoute
from DIRAC.ConfigurationSystem.Client.Helpers.Resources import getFTS3Servers
from DIRAC.ResourceStatusSystem.Client.ResourceStatus import ResourceStatus
import random
class FTS... | vmendez/DIRAC | DataManagementSystem/private/FTS3/FTS3Placement.py | Python | gpl-3.0 | 5,870 |
# Copyright (c) 2019 2021 by Rocky Bernstein
#
# 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... | rocky/python-uncompyle6 | uncompyle6/semantics/customize26_27.py | Python | gpl-3.0 | 2,225 |
# -*- coding: utf-8 -*-
#################### 本文件用于进行基本的 json urlencode 操作
import sys,re
import json
from jsonpath_rw import jsonpath, parse # pip2/pip3 install jsonpath_rw
from lxml import etree
import platform
sysstr = platform.system() ### 判断操作系统类型 Windows Linux . 本脚本函数入口, 统一以 LINUX 为准, 其后在函数内... | sheerfish999/torpedo | modules/dodata.py | Python | gpl-3.0 | 9,121 |
import json
import pytest
from plugins.fishbans import fishbans, bancount
from cloudbot import http
test_user = "notch"
test_api = """
{"success":true,"stats":{"username":"notch","uuid":"069a79f444e94726a5befca90e38aaf5","totalbans":11,"service":{"mcbans":0,"mcbouncer":11,"mcblockit":0,"minebans":0,"glizer":0}}}
"""... | Zarthus/CloudBotRefresh | plugins/test/test_fishbans.py | Python | gpl-3.0 | 3,502 |
#!/usr/bin/env python
import random
from copy import copy
from cnfgen.formula.cnf import CNF
def Shuffle(F,
polarity_flips='shuffle',
variables_permutation='shuffle',
clauses_permutation='shuffle'):
"""Reshuffle the given formula F
Returns a formula logically equivalent ... | MassimoLauria/cnfgen | cnfgen/transformations/shuffle.py | Python | gpl-3.0 | 4,446 |
#!/usr/bin/python
#
# bravialib - Will Cooke - Whizzy Labs - @8none1
# http://www.whizzy.org
# Copyright Will Cooke 2016. Released under the GPL.
#
#
# My attempt to talk to the Sony Bravia web API.
#
# This is designed to be used by a long running process
# So there is a potentially slow start-up time but then it ... | 8none1/bravialib | bravialib.py | Python | gpl-3.0 | 24,487 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2018 Max Weller
## Copyright (C) 2019 DreamSourceLab <support@dreamsourcelab.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 Sof... | DreamSourceLab/DSView | libsigrokdecode4DSL/decoders/sda2506/pd.py | Python | gpl-3.0 | 5,750 |
#!/usr/bin/env python
from setuptools import setup
setup(name='edith',
version='0.1.0a1',
description='Edit-distance implementation with edit-path retrieval',
author='david weil (tenuki)',
author_email='tenuki@gmail.com',
url='https://github.com/tenuki/edith',
py_modules=['edith'],
... | tenuki/edith | setup.py | Python | gpl-3.0 | 554 |
from setuptools import setup, find_packages
from fccsmap import __version__
test_requirements = []
with open('requirements-test.txt') as f:
test_requirements = [r for r in f.read().splitlines()]
setup(
name='fccsmap',
version=__version__,
author='Joel Dubowy',
license='GPLv3+',
author_email='... | pnwairfire/fccsmap | setup.py | Python | gpl-3.0 | 1,292 |
from __future__ import with_statement
import os
import sys
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# We need to go back a dir to get the config.
_this_dir = os.path.dirname((os.path.abspath(__file__)))
_parent_dir = os.path.join(_this_dir, '../'... | tristanfisher/yams | multidb/env.py | Python | gpl-3.0 | 2,875 |
#!/usr/bin/env python
#
# !!!!!!!!! WARNING !!!!!!!!!!!!!!!
# This Script was bastardized To Read Password From /home/bspaans/.googlecode
#
#
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is int... | anthonyt/mingus-counterpoint | googlecode_upload.py | Python | gpl-3.0 | 9,994 |
# Utilities ------------------------------------------------------------------ #
import math
def clamp(val, min, max):
if val <= min:
return min
elif val >= max:
return max
return val
def fixAngle(angle):
while angle > 180.0:
angle -= 360.0
while angle < -180.0:
a... | CertainlyUncertain/Kinetic-Gunner-Gunner-of-Angst | utils.py | Python | gpl-3.0 | 502 |
import re, shlex
import hangups
from hangupsbot.utils import text_to_segments
from hangupsbot.handlers import handler, StopEventHandling
from hangupsbot.commands import command
default_bot_alias = '/bot'
def find_bot_alias(aliases_list, text):
"""Return True if text starts with bot alias"""
command = text... | ildelusion/JSBot | hangupsbot/handlers/commands.py | Python | gpl-3.0 | 2,643 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from statemachine import _Statemachine
class Windows8_1StateMachine(_Statemachine):
def __init__(self, params):
_Statemachine.__init__(self, params)
def _list_share(self):
return super(Windows8_1StateMachine, self)._list_share()
... | SeungGiJeong/SK_FastIR | health/windows8_1StateMachine.py | Python | gpl-3.0 | 2,827 |
#!/usr/bin/env python
# Copyright (C) 2012 nwmaltego Developer.
# This file is part of nwmaltego - https://github.com/bostonlink/nwmaltego
# See the file 'LICENSE' for copying permission.
# Netwitness Threat to Filename Maltego transform
# Author: David Bressler (@bostonlink)
import sys
import urllib2, urllib, json
f... | bostonlink/nwmaltego | nw_threat_2_file_attachment.py | Python | gpl-3.0 | 2,405 |
import pytest
from learn.models import Task, ProblemSet, Domain
from learn.models import Student, TaskSession, Skill
from learn.mastery import has_mastered, get_level
from learn.mastery import get_first_unsolved_mission
from learn.mastery import get_first_unsolved_phase
from learn.mastery import get_current_mission_ph... | adaptive-learning/robomission | backend/learn/tests/test_mastery.py | Python | gpl-3.0 | 5,319 |
#!/usr/bin/env python
import os
import json
from flask import Flask, abort, jsonify, request, g, url_for
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.httpauth import HTTPBasicAuth
from passlib.apps import custom_app_context as pwd_context
from itsdangerous import (TimedJSONWebSignatureSerializer
... | emilio-simoes/qt-rest-client | tools/test-service/server.py | Python | gpl-3.0 | 4,688 |
#!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# A sword KJV indexed search module.
# Copyright (C) 2012-2013 Josiah Gordon <josiahg@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 publ... | zepto/biblesearch.web | sword_search.old/sword_verses.py | Python | gpl-3.0 | 32,753 |
# Copyright (C) 2013-2018 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# 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... | mkuron/espresso | maintainer/check_features.py | Python | gpl-3.0 | 1,020 |
from pycddb.dataset import Dataset
from lingpy import Wordlist, csv2list
from lingpy.compare.partial import _get_slices
def prepare(ds):
errs = 0
wl = Wordlist(ds.raw('bds.tsv'))
W = {}
for k in wl:
value = wl[k, 'value']
tokens = wl[k, 'tokens']
doc = wl[k, 'doculect']
... | digling/cddb | datasets/Allen2007/__init__.py | Python | gpl-3.0 | 1,690 |
import re
def analyzeLine(txtlines):
outline = []
lcnt = -1
for line in txtlines:
lcnt += 1
typ = None
itmText = None
spc = (len(line) -len(line.lstrip()))*' '
tls = line.lstrip()
if tls.lower().startswith('<body'):
itmText... | lucidlylogicole/scope | plugins/outline/lang/html.py | Python | gpl-3.0 | 1,217 |
# test driver to verify that new version of code works
import opiniongame.config as og_cfg
import opiniongame.IO as og_io
import opiniongame.coupling as og_coupling
import opiniongame.state as og_state
import opiniongame.opinions as og_opinions
import opiniongame.adjacency as og_adj
import opiniongame.selection as og_s... | mjsottile/PyOpinionGame | driver_alpha_tau_study.py | Python | gpl-3.0 | 2,715 |
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os... | xapple/pyrotrfid | doc/conf.py | Python | gpl-3.0 | 7,241 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim: set et sw=4 fenc=utf-8:
#
# Copyright 2016 INVITE Communications Co., Ltd. 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 Founda... | invitecomm/asterisk-ivr | pigeonhole/junk.py | Python | gpl-3.0 | 1,356 |
# -*- encoding: utf-8 -*-
'''Dependencies:
The ``scoretools`` package should not import ``instrumenttools``
at top level.
'''
from abjad.tools import systemtools
systemtools.ImportManager.import_structured_package(
__path__[0],
globals(),
)
_documentation_section = 'core' | andrewyoung1991/abjad | abjad/tools/scoretools/__init__.py | Python | gpl-3.0 | 278 |
#!/usr/bin/python
# =======================================================================
# This file is part of MCLRE.
#
# MCLRE 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 Lice... | augustoqm/MCLRE | src/recommender_execution/run_rec_mrbpr.py | Python | gpl-3.0 | 5,871 |
#!/usr/bin/python3
"""
Written by: True Demon
The non-racist Kali repository grabber for all operating systems.
Git Kali uses Offensive Security's package repositories and their generous catalog
of extremely handy penetration testing tools. This project is possible because
of Offensive Security actually sticking to go... | True-Demon/gitkali | gitkali.py | Python | gpl-3.0 | 5,391 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""
"""
__version__ = "$Id$"
#end_pymotw_header
import trace
from trace_example.recurse import recurse
tracer = trace.Trace(count=True, trace=False, outfile='trace_report.dat')
tracer.runfunc(recurse, 2)
report_trace... | qilicun/python | python2/PyMOTW-1.132/PyMOTW/trace/trace_report.py | Python | gpl-3.0 | 469 |
# Django settings for freudiancommits project.
import os
DEBUG = True if os.environ.get('DJANGO_DEBUG', None) == '1' else False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
import dj_database_url
DATABASES = {'default': dj_database_url.config()}
# Local time ... | michaelmior/freudiancommits | freudiancommits/settings.py | Python | gpl-3.0 | 6,595 |
#!/usr/bin/env python3
import argparse
import pathlib
import numpy as np
def waterfall(input_filename, output_filename):
fs = 200
nfft = 8192
w = np.blackman(nfft)
x = np.fromfile(input_filename, 'int16')
x = (x[::2] + 1j*x[1::2])/2**15
freq_span = 5
nbins = round(freq_span / fs * nfft)
... | daniestevez/jupyter_notebooks | december2021_eclipse/make_waterfalls.py | Python | gpl-3.0 | 1,664 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('contests', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='SuspendedProblem',
fields... | sio2project/oioioi | oioioi/suspendjudge/migrations/0001_initial.py | Python | gpl-3.0 | 760 |
#!/usr/bin/env python3
#########################################################################
# File Name: mthreading.py
# Author: ly
# Created Time: Wed 05 Jul 2017 08:46:57 PM CST
# Description:
#########################################################################
# -*- coding: utf-8 -*-
im... | LingyuGitHub/codingofly | python/threading/mthreading.py | Python | gpl-3.0 | 699 |
# flake8: noqa
# -*- coding: utf-8 -*-
###############################################
# Geosite local settings
###############################################
import os
# Outside URL
SITEURL = 'http://$DOMAIN'
OGC_SERVER['default']['LOCATION'] = os.path.join(GEOSERVER_URL, 'geoserver/')
OGC_SERVER['default']['PUBLI... | simonemurzilli/geonode | geonode/contrib/geosites/site_template/local_settings_template.py | Python | gpl-3.0 | 597 |
"""
WSGI config for model_advanced project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJAN... | mjiang-27/django_learn | model_advanced/model_advanced/wsgi.py | Python | gpl-3.0 | 406 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, subprocess, hashlib, shutil, glob, stat, sys, time
from subprocess import check_call
from tempfile import NamedT... | Eksmo/calibre | setup/upload.py | Python | gpl-3.0 | 10,267 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# TODO: PORASQUI: BUG: Cerrar la ventana no detiene el GMapCatcher y se queda
# como un proceso de fondo en espera bloqueante... Ni atiende al Ctrl+C
# siquiera.
import sys, os.path
dirfichero = os.path.realpath(os.path.dirname(__file__))
if os.path.realpath(os.path.cur... | pacoqueen/cican | utils/mapa.py | Python | gpl-3.0 | 6,423 |
#significant input and copied functions from T. Morton's VESPA code (all mistakes are my own)
#coords -- RA and DEC of target in degrees. Needed for GAIA querying.
# Degrees, 0-360 and -90 to +90. List format [RA,DEC].
import numpy as np
import pandas as pd
from scipy.integrate import quad
from scipy import... | DJArmstrong/autovet | FPPcalc/priorutils.py | Python | gpl-3.0 | 16,928 |
"""
/*
* Custom handlers for the BBB
*
*/
"""
import Adafruit_BBIO.GPIO as GPIO
GPIO.setup("P9_12", GPIO.OUT)
def alexaHandler(client, userdata, message):
print "Received payload: " + str(message.payload.decode())
# Assume only 1 and 0 are send here.
if message.payload == "1":
GPIO.output("P9_1... | Metonimie/Beaglebone | alexa-amazon/basicServer/gpio_handlers.py | Python | gpl-3.0 | 525 |
#!/usr/bin/python
# Copyright (C) 2013 rapidhere
#
# Author: rapidhere <rapidhere@gmail.com>
# Maintainer: rapidhere <rapidhere@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, ... | rapidhere/snake_game | snake_game.py | Python | gpl-3.0 | 1,496 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import re
try:
import regex
_regex_available = True
except ImportError:
_regex_available = False
import phonenumbers
from six.moves import zip
from language_utilities.constant import ENGLISH_LANG
from ner_v2.detectors.base_detector import B... | hellohaptik/chatbot_ner | ner_v2/detectors/pattern/phone_number/phone_number_detection.py | Python | gpl-3.0 | 6,667 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Yann GUIBET <yannguibet@gmail.com>
# See LICENSE for details.
import sys, os
from gevent import select, monkey, spawn, Greenlet, GreenletExit, sleep, socket
from base64 import b64encode
from hashlib import md5
from struct import pack, unpack
from zl... | yann2192/vpyn | Client.py | Python | gpl-3.0 | 2,459 |
import shesha.config as conf
simul_name = "bench_scao_sh_16x16_8pix"
layout = "layoutDeFab_SH"
# loop
p_loop = conf.Param_loop()
p_loop.set_niter(1000)
p_loop.set_ittime(0.002) # =1/500
# geom
p_geom = conf.Param_geom()
p_geom.set_zenithangle(0.)
# tel
p_tel = conf.Param_tel()
p_tel.set_diam(4.0)
p_tel.set_cobs... | ANR-COMPASS/shesha | data/par/par4tests/test_custom_dm_diam_dm_proj.py | Python | gpl-3.0 | 2,303 |
# import libraries
import math
import random
import pygame
from pygame.locals import *
pygame.init()
pygame.mixer.init()
width, height = 800, 600
screen = pygame.display.set_mode((width, height))
keys = [False, False, False, False]
player = [100, 520]
invaders = []
bullets = []
bombs = []
rockets = []
rocketpieces =... | vlna/another-py-invaders | another-py-invaders.py | Python | gpl-3.0 | 3,451 |
""" Configuration and utilities for all the X509 unit tests """
import os
import sys
from datetime import datetime
from pytest import fixture
# We use certificates stored in the same folder as this test file
CERTDIR = os.path.join(os.path.dirname(__file__), "certs")
HOSTCERT = os.path.join(CERTDIR, "host/hostcert.pem... | DIRACGrid/DIRAC | src/DIRAC/Core/Security/test/x509TestUtilities.py | Python | gpl-3.0 | 17,182 |
# -*- coding: utf-8 -*-
# * Copyright (C) 2012-2014 Croissance Commune
# * Authors:
# * Arezki Feth <f.a@majerti.fr>;
# * Miotte Julien <j.m@majerti.fr>;
# * TJEBBES Gaston <g.t@majerti.fr>
#
# This file is part of Autonomie : Progiciel de gestion de CAE.
#
# Autonomie is free software: you can red... | CroissanceCommune/autonomie | autonomie/models/options.py | Python | gpl-3.0 | 5,322 |
import json
from mflow_nodes.processors.base import BaseProcessor
from mflow_nodes.stream_node import get_processor_function, get_receiver_function
from mflow_nodes.node_manager import NodeManager
def setup_file_writing_receiver(connect_address, output_filename):
"""
Setup a node that writis the message head... | datastreaming/mflow_nodes | tests/helpers.py | Python | gpl-3.0 | 1,389 |
#!/usr/bin/env python3
# Copyright 2016, 2017 Andrew Conrad
#
# 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 ... | her001/tmdrv | tmdrv.py | Python | gpl-3.0 | 3,992 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.