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 |
|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011, De Verkeersonderneming <rits@verkeersonderneming.nl>
#
# This file is part of PyRITS - A tool for processing and analyzing transport
# management system data.
#
# PyRITS is free software: you can redistribute it and/or modify
# it under the terms of... | figure002/pyrits | pyrits.py | Python | gpl-3.0 | 17,967 |
# -*- coding: utf-8 -*-
'''
Sphinx setting.
'''
import os.path
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
extensions = [
'mamchecker.inl',
'sphinx.ext.mathjax',
'sphinxcontrib.tikz',
'sphinxcontrib.texfigure']
# i.e. same as conf.py and with page.html containing only {... | mamchecker/mamchecker | mamchecker/conf.py | Python | gpl-3.0 | 1,452 |
"""This file sets up a command line manager.
Use "python manage.py" for a list of available commands.
Use "python manage.py runserver" to start the development web server on localhost:5000.
Use "python manage.py runserver --help" for additional runserver options.
"""
from flask_migrate import MigrateCommand
from flas... | jennywoites/MUSSA | MUSSA_Flask/manage.py | Python | gpl-3.0 | 879 |
#!/usr/bin/env python
import os
import sys
## A name of directory containing 'path:...' file
## You can download them using 'make-wget_pathway.sh' script
dir_name = sys.argv[1]
f_summary = open('%s.summary'%dir_name,'w')
f_genes = open('%s.genes'%dir_name,'w')
f_compounds = open('%s.compounds'%dir_name,'w')
gene_to... | taejoonlab/taejoonlab-toolbox | KEGG/make-pathway2list.py | Python | gpl-3.0 | 2,013 |
from PyQt4.QtCore import Qt
from PyQt4.QtGui import QHBoxLayout
from PyQt4.QtGui import QLabel
from PyQt4.QtGui import QLineEdit
from PyQt4.QtGui import QMessageBox
from PyQt4.QtGui import QPixmap
from PyQt4.QtGui import QPushButton
from PyQt4.QtGui import QVBoxLayout
from PyQt4.QtGui import QWidget
import qtUtils
fr... | kostyll/Cryptully | cryptully/qt/qNickInputWidget.py | Python | gpl-3.0 | 2,500 |
"""Run the interactive pulse program.
Keys:
- Escape - Exit the program
- Space - Update program image
- C - Calibrate the image again
"""
import time
import cv2
from pulse_programming import PulseField
from camera_calibration import Calibration
window = "Camera Pulse Programming"
cv2.namedWindow("Threshold", ... | niccokunzmann/pulse-programming | camera_pulse.py | Python | gpl-3.0 | 1,372 |
#
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2015, Mostapha Sadeghipour Roudsari <Sadeghipour@gmail.com>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU Ge... | samuto/Honeybee | src/Honeybee_Radiance Mirror Material By Color.py | Python | gpl-3.0 | 4,158 |
from fnmatch import fnmatch
import os
from sys import exit
import html2text
import re
import urllib
import shutil
import logging
import sqlite3
from sys import stdout
logging.basicConfig(filename='error_log.log', filemode='a')
class BackupEvernote(object):
def __init__(self, evernote_dir, db_dir='', output_dir... | shawndaniel/evernote-exporter | evernote_exporter.py | Python | gpl-3.0 | 10,506 |
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
CURRENT_DIR = os.path.dirname(__file__)
setup(name='datapot',
description='Library for automatic feature extraction from JSON-datasets',
long_description=open(os.path.join(CURRENT_DIR, 'README.rst')).read(),
version='0.1.3'... | bashalex/datapot | setup.py | Python | gpl-3.0 | 1,582 |
# -*- coding: utf-8 -*-
###############################################################################
# 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... | estaban/pyload | module/plugins/hoster/XFileSharingPro.py | Python | gpl-3.0 | 13,352 |
#!/usr/bin/python
# vim: ai:ts=4:sw=4:sts=4:et:fileencoding=utf-8
#
# Thermal monitor
#
# Copyright 2013 Michal Belica <devel@beli.sk>
#
# 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... | beli-sk/thermal_monitor | thermal_monitor.py | Python | gpl-3.0 | 5,081 |
""" aulario.py """
BACK_BUTTON_TEXT = "Indietro ❌"
DAY_SELECTION = "Seleziona la data della lezione che ti interessa."
AULARIO_WARNING = "⚠️ Aulario non ancora pronto, riprova fra qualche minuto ⚠️"
LESSON_SELECTION = "Quale lezione devi seguire?"
NO_LESSON_WARNING = "Nessuna lezione programmata per questo giorno"
"... | UNICT-DMI/Telegram-DMI-Bot | module/data/vars.py | Python | gpl-3.0 | 2,524 |
#!/usr/bin/env python
################################################################################
# Copyright 2015 Brecht Baeten
# This file is part of mpcpy.
#
# mpcpy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... | BrechtBa/mpcpy | examples/simple_space_heating_mpc.py | Python | gpl-3.0 | 11,279 |
from dolfin import error, info
class Heart:
def __init__(self, cell_model):
self._cell_model = cell_model
# Mandatory stuff
def mesh(self):
error("Need to prescribe domain")
def conductivities(self):
error("Need to prescribe conducitivites")
# Optional stuff
def a... | Juanlu001/CBC.Solve | cbc/beat/heart.py | Python | gpl-3.0 | 897 |
# * *************************************************************
# *
# * Soft Active Mater on Surfaces (SAMoS)
# *
# * Author: Rastko Sknepnek
# *
# * Division of Physics
# * School of Engineering, Physics and Mathematics
# * University of Dundee
# *
# * (c) 2013, 2014
# *
# * School of Scienc... | sknepneklab/SAMoS | configurations/MakeConfigurations/regular_rods.py | Python | gpl-3.0 | 4,354 |
#!/usr/bin/python
# Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].
class Solution(object):
# @param {integer[]} nums
# @return {integer[]}
def productExceptSelf(self, nums):
p = 1
... | ravyg/algorithms | python/238_productArrayExceptSelf.py | Python | gpl-3.0 | 721 |
from django.contrib.auth.models import AbstractUser
from django.db import models
STATUT = ['docteur', 'secrétaire', 'interne', 'remplaçant']
class UnoUser(AbstractUser):
"""
Base User class for unolog
define statu
"""
MEDECIN = "medecin"
SECRETAIRE = "secretaire"
INTERNE = "interne"
R... | jgirardet/unolog | unolog/unousers/models.py | Python | gpl-3.0 | 686 |
import numpy as np
import matplotlib.pyplot as plt
b = map(int,open('data/dist_distances_enfermos_same_chr').readlines())
a = map(int,open('data/dist_distances_sanos_same_chr').readlines())
plt.hist(b, bins=100, normed=0, alpha=0.5, label='enfermos')
plt.hist(a, bins=100, normed=0, alpha=0.5, label='sanos')
plt.legen... | CSB-IG/circos_rnaseq_tcga_brca | RNAseq_TCGA_BRCA/plot.py | Python | gpl-3.0 | 353 |
'''
9.5 First, you have to resolve assignment9_3. This is slightly different.
This program records the domain name (instead of the address) where the message
was sent from instead of who the mail came from (i.e., the whole email address).
At the end of the program, print out the contents of your dictionary.
Sample:
py... | hosseinoliabak/learningpy | 09_5_dictionary.py | Python | gpl-3.0 | 877 |
from threading import Thread
import time
from scapy.all import *
class AttackProcess(Thread):
def __init__(self, main):
Thread.__init__(self)
self.main = main
self.selected_hosts = []
self.is_attacking = False
def run(self):
while True:
while self.is_attac... | GadgeurX/NetworkLiberator | Daemon/AttackProcess.py | Python | gpl-3.0 | 586 |
'''
primepalCodeEval.py - Solution to Problem Prime Palindrome (Category - Easy)
Copyright (C) 2013, Shubham Verma
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 th... | shubhamVerma/code-eval | Category - Easy/primePalindromeCodeEval.py | Python | gpl-3.0 | 1,290 |
import lxml.html
from .bills import NHBillScraper
from .legislators import NHLegislatorScraper
from .committees import NHCommitteeScraper
metadata = {
'abbreviation': 'nh',
'name': 'New Hampshire',
'capitol_timezone': 'America/New_York',
'legislature_name': 'New Hampshire General Court',
'legislatu... | cliftonmcintosh/openstates | openstates/nh/__init__.py | Python | gpl-3.0 | 3,210 |
from http import HTTPStatus
from json import loads
from unittest.mock import Mock, patch
from uuid import uuid4
from tornado.testing import gen_test
from pokerserver.database import PlayerState, UUIDsRelation
from pokerserver.models import InvalidTurnError, NotYourTurnError, Player, PositionOccupiedError
from tests.u... | MartinAltmayer/pokerserver | tests/integration/controllers/test_table.py | Python | gpl-3.0 | 14,923 |
#Macros commonly used
_be = "(be|is|am|are|were|was|been|being)"
_intensadj1 = "( absolutely| absurdly| resoundingly | amazingly | awfully | extremely | completely | highly | incredibly | perfectly | quite | really | strikingly | surprisingly | terribly | totally | unbelievably | hugely | unnaturally | unusually | utte... | raphaottoni/arglex | arglex/macros.py | Python | gpl-3.0 | 1,719 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008, TUBITAK/UEKAE
#
# 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.
#
# Plea... | hknyldz/pisitools | pisilinux/pisilinux/db/historydb.py | Python | gpl-3.0 | 4,426 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import RPi.GPIO as GPIO
import time
BUTTON_PIN = 11
LED_PIN = 7
def stisknuto_callback(channel):
global sviti
sviti = int(not sviti)
GPIO.output(LED_PIN,sviti)
if sviti == 1:
print "LED dioda ZAPNUTA"
else:
print "LED dioda VYPNUTA"
try:
GPIO.setwarn... | HellTech/NAG_IoE_2016 | 30_HellTech_1512_1/04_tlacitko_zhasnuti/04_zap_vyp_event_detect.py | Python | gpl-3.0 | 867 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | mganeva/mantid | scripts/AbinsModules/CalculateS.py | Python | gpl-3.0 | 2,205 |
# Flexlay - A Generic 2D Game Editor
# Copyright (C) 2014 Ingo Ruhnke <grumbel@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 3 of the License, or
# (at your option)... | SuperTux/flexlay | flexlay/wip/sprite_stroke_drawer.py | Python | gpl-3.0 | 5,541 |
from __future__ import absolute_import
import os.path
import requests
import wtforms
from wtforms import validators
from ..forms import TextDatasetForm
from origae import utils
from origae.utils.forms import validate_required_iff, validate_greater_than
class TextClassificationDatasetForm(TextDatasetForm):
"""
... | winnerineast/Origae-6 | origae/dataset/text/classification/forms.py | Python | gpl-3.0 | 14,708 |
from spectral_cube import SpectralCube
import glob
from astropy.convolution import Box1DKernel
import astropy.units as u
from corner import corner
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as ss
empdir = '/mnt/space/erosolow/surveys/empire/'
degasdir = '/mnt/space/erosolow/surveys/DEGAS/'
m... | low-sky/degas | degas/examples/compare_cube.py | Python | gpl-3.0 | 6,219 |
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException... | kobotoolbox/kobo_selenium_tests | kobo_selenium_tests/selenium_ide_exported/create_form_test_template.py | Python | gpl-3.0 | 7,253 |
# PPFem: An educational finite element code
# Copyright (C) 2015 Matthias Rambausek
#
# 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 ... | mrambausek/PPFem | ppfem/elements/lagrange_elements.py | Python | gpl-3.0 | 3,551 |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.utils import getdate
from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice
from erpnext.a... | brownharryb/erpnext | erpnext/regional/doctype/gstr_3b_report/test_gstr_3b_report.py | Python | gpl-3.0 | 10,519 |
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2017 Andrew Ziem
# https://www.bleachbit.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 3 of the License, or
# ... | brahmastra2016/bleachbit | bleachbit/Cleaner.py | Python | gpl-3.0 | 41,217 |
import os
import ConfigParser
class SettingsIO(object):
""" ConfigParser abstraction """
def __init__(self, config_file):
self.config_file = config_file
self.config = ConfigParser.ConfigParser()
if os.path.exists(self.config_file):
self.config.read([self.config_file])
... | GoeGaming/lutris | lutris/util/settings.py | Python | gpl-3.0 | 894 |
import os
from ase.structure import molecule
from ase.io import read, write
from ase.parallel import rank
from gpaw import GPAW, restart
import warnings
# cmr calls all available methods in ase.atoms detected by the module inspect.
# Therefore also deprecated methods are called - and we choose to silence those warni... | robwarm/gpaw-symm | gpaw/test/cmrtest/Li2_atomize.py | Python | gpl-3.0 | 10,201 |
#!/usr/bin/env python
"""
This example explores how logging behaves if no special
configuration is performed.
conclusions:
- we get an error printout which DOES NOT stop the program
that we do not have handlers.
"No handlers could be found for logger "root""
This is printed once and then no more.
this... | veltzer/demos-python | src/examples/short/logging/basic_no_conf.py | Python | gpl-3.0 | 687 |
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
import os
from collections import namedtuple
from calibre.customize import Plugin
from calibre.constants import iswindows
class DevicePlugin(Plugin):
"""
Defines the interface that should be implemented by backends that
... | yeyanchao/calibre | src/calibre/devices/interface.py | Python | gpl-3.0 | 29,487 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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... | oliver-sanders/cylc | tests/unit/parsec/test_validate.py | Python | gpl-3.0 | 21,599 |
__author__ = 'michogarcia'
from setuptools import setup, find_packages
version = '0.1'
setup(name='FullDiskAlert',
version=version,
author="Micho Garcia",
author_email="micho.garcia@geomati.co",
license="LICENSE.txt",
description="Sends mail when disk is above threshold",
packages... | michogar/FullDiskAlert | setup.py | Python | gpl-3.0 | 399 |
#!/usr/bin/env python
"""
A simple python example for multiprocess.
Created by yetship at 2017/4/18 08:57
"""
from random import randint
import multiprocessing
def worker(lower, upper):
"""thread worker function"""
print("get a random int: {}".format(randint(lower, upper)))
if __name__ == '__main__... | yetship/blog_codes | multiprocess_demo/example02.py | Python | gpl-3.0 | 432 |
import re
from setuptools import setup, find_packages
# Auto detect the library version from the __init__.py file
with open('xbee/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError... | MichaelCoughlinAN/Odds-N-Ends | Python/Python Modules/XBee-2.3.1/setup.py | Python | gpl-3.0 | 1,137 |
# Author: Denis A. Engemann <denis.engemann@gmail.com>
# License: BSD (3-clause)
import mkl
import sys
import os.path as op
import numpy as np
import mne
from mne.io import Raw
from mne.preprocessing import read_ica
from mne.viz import plot_drop_log
from meeg_preprocessing.utils import setup_provenance, set_eog_ecg_c... | kingjr/meg_expectation_p3 | scripts/run_extract_epochs.py | Python | gpl-3.0 | 6,371 |
"""return a jumbled version of a string. eg, the lazy hamster is jumping becomes the lzay hmasetr si jmunipg
shuffles insides of words.
"""
import random
import string
#okay, so this will be the jmuble algorythim
#variables, passed
#string_to_jumble = "" #yeah
#jumble_mode = true # do u switch words of t... | Moth-Tolias/LetterBoy | backend/jumbles nontrobo/jumbles nontrobo.py | Python | gpl-3.0 | 4,226 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import cv2
import numpy as np
import pymeanshift as pms
from blobs.BlobResult import CBlobResult
from blobs.Blob import CBlob # Note: This must be imported in order to destroy blobs and use other methods
################################################################... | xmnlab/minilab | ia/ocr/alpr.py | Python | gpl-3.0 | 10,141 |
# gcp xml backend
# Copyright (C) 2012 Jesse van den Kieboom <jessevdk@gnome.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
# (at your option) any la... | jonocodes/gedit-code-assistance | backends/xml/gcpbackendxml/backend.py | Python | gpl-3.0 | 1,683 |
from __future__ import unicode_literals
from memory.mem import _Memory
class Windows2003ServerMemory(_Memory):
def __init__(self, params):
super(Windows2003ServerMemory, self).__init__(params)
def csv_all_modules_dll(self):
super(Windows2003ServerMemory, self)._csv_all_modules_dll()
def ... | SeungGiJeong/SK_FastIR | memory/windows2003ServerMemory.py | Python | gpl-3.0 | 432 |
#!/usr/bin/env python
# encoding: utf-8
#
# AuthorDetector
# Copyright (C) 2013 Larroque Stephen
#
# 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 ... | lrq3000/author-detector | authordetector/configparser.py | Python | gpl-3.0 | 7,707 |
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
engine = create_engine('postgresql://igsql:igsql@127.0.0.1/igsql')
db_session = scoped_session(sessionmaker(autocommit=False,
aut... | karlward/igsql | igsql/database.py | Python | gpl-3.0 | 537 |
# coding: utf8
# topicview.py
# 1/2/2015 jichi
if __name__ == '__main__':
import sys
sys.path.append('..')
import debug
debug.initenv()
import json
from functools import partial
from PySide.QtCore import Qt, QObject
from Qt5 import QtWidgets
from sakurakit import skevents, skqss
from sakurakit.skclass import ... | Dangetsu/vnr | Frameworks/Sakura/py/apps/reader/views/topicview.py | Python | gpl-3.0 | 12,896 |
import unittest
import numpy as np
from ..emissions import GaussianEmissions, MultinomialEmissions
from ..hsmm import GaussianHSMM, MultinomialHSMM
class TestHSMMWrappers(unittest.TestCase):
def setUp(self):
# Exact values don't matter
self.tmat = np.eye(3)
self.durations = np.eye(3)
... | jvkersch/hsmmlearn | hsmmlearn/tests/test_hsmm_wrappers.py | Python | gpl-3.0 | 1,757 |
import base64
import imghdr
import six
import uuid
from django.core.files.base import ContentFile
from rest_framework import serializers
from .models import Scholar, Record
class ScholarSerializer(serializers.ModelSerializer):
class Meta:
model = Scholar
fields = (
'pk',
... | mxmaslin/Test-tasks | django_test_tasks/old_django_test_tasks/apps/playschool/serializers.py | Python | gpl-3.0 | 721 |
#!/usr/bin/python2.6
# -*- coding: utf-8 -*-
# This file is a part of Metagam project.
#
# Metagam 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
# any later version.
#
#... | JoyTeam/metagam | mg/test/testorm-2.py | Python | gpl-3.0 | 1,140 |
from marshmallow import (
Schema,
fields,
validates_schema,
ValidationError,
validates_schema,
EXCLUDE,
)
from marshmallow.validate import Regexp
MAP_1 = {
"name": "OpenStreetMap",
"layer": "//{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png",
"attribution": "© OpenStreetMap",
}
M... | PnEcrins/GeoNature-atlas | atlas/configuration/config_schema.py | Python | gpl-3.0 | 7,525 |
"""
This file is part of py-sonic.
py-sonic 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.
py-sonic is distributed in the hope that it wil... | ties/py-sonic | libsonic/connection.py | Python | gpl-3.0 | 100,484 |
msg_list["Echo Request"] = { "type" : "1" }
msg_list["Echo Response"] = { "type" : "2" }
msg_list["Version Not Supported Indication"] = { "type" : "3" }
msg_list["Create Session Request"] = { "type" : "32" }
msg_list["Create Session Response"] = { "type" : "33" }
msg_list["Delete Session Request"] = { "type" : "36" }
m... | acetcom/cellwire | lib/gtp/support/cache/tlv-msg-list.py | Python | gpl-3.0 | 3,258 |
import unittest
from chat.commands.commandlist import CommandList
from chat.command import Command
from tests.structs.dummychat import DummyChat
class TestCommands(unittest.TestCase):
def setUp(self):
self.chat = DummyChat()
def test_get(self):
command = CommandList.get('help', self.chat, 'me... | jk977/twitch-plays | bot/tests/commands.py | Python | gpl-3.0 | 1,035 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the central widget showing the web pages.
"""
from __future__ import unicode_literals
import os
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt, QUrl
from PyQt5.QtGui import QIcon
from PyQt5.... | paulmadore/Eric-IDE | 6-6.0.9/eric/Helpviewer/HelpTabWidget.py | Python | gpl-3.0 | 37,071 |
"""
Track channel ops for permissions checks
Requires:
server_info.py
"""
import gc
import json
import logging
import weakref
from collections import Mapping, Iterable, namedtuple
from contextlib import suppress
from numbers import Number
from operator import attrgetter
from irclib.parser import Prefix
import cloudb... | tiredtyrant/CloudBot | plugins/chan_track.py | Python | gpl-3.0 | 23,414 |
import random
T = 10
for tt in range(T):
n = 10 ** 6
print(n)
for i in range(n):
print(random.randint(0, 1000), end = ' ')
print()
for i in range(n):
print(random.randint(1, 1000), end = ' ')
print()
| kzoacn/Grimoire | Training/9.10(ShenyangOnline)/L_gen.py | Python | gpl-3.0 | 214 |
from app.db import db
from task import Task
class User(db.Document):
name = db.StringField(required=True)
password = db.StringField(required=True)
email = db.StringField(required=True)
tasks = db.ListField(db.ReferenceField(Task))
def serialize(self):
return {
'id': str(self.i... | janol77/rest-api | app/api/models/user.py | Python | gpl-3.0 | 494 |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetAllGroups
# Retrieve data for all groups in an account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use ... | MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/Google/Contacts/GetAllGroups.py | Python | gpl-3.0 | 4,869 |
#from setuptools import setup
from distutils.core import setup
setup(
name='pilfer',
version='2.0',
description='pilfer command line tool to record audio and video from Kodi',
url='https://github.com/NapoleonWils0n/pilfer',
author='NapoleonWils0n',
maintainer='NapoleonWils0n',
license='GPL'... | NapoleonWils0n/pilfer | setup.py | Python | gpl-3.0 | 605 |
from .waresponseparser import ResponseParser
from yowsup.env import YowsupEnv
import sys
import logging
from axolotl.ecc.curve import Curve
from axolotl.ecc.ec import ECPublicKey
from yowsup.common.tools import WATools
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from yowsup.config.v1.config import C... | tgalal/yowsup | yowsup/common/http/warequest.py | Python | gpl-3.0 | 10,328 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This is the module where the main solver object for the
nonlinear solver of bolt is defined. This solver object
stores the details of the system defined under physical_system,
and is evolved using the methods of this module.
The solver has the option of using 2 dif... | ShyamSS-95/Bolt | bolt/lib/nonlinear/nonlinear_solver.py | Python | gpl-3.0 | 29,921 |
#!/usr/bin/env python3
import copy
import matplotlib.pyplot as plt
import numpy as np
import pytest
from pysisyphus.plotters.AnimPlot import AnimPlot
from pysisyphus.calculators.MullerBrownPot import MullerBrownPot
#from pysisyphus.calculators.MullerBrownSympyPot import MullerBrownPot
from pysisyphus.cos.NEB import ... | eljost/pysisyphus | tests_staging/test_mullerbrownpot.py | Python | gpl-3.0 | 6,681 |
from Timeline.Server.Constants import TIMELINE_LOGGER
from twisted.internet.defer import Deferred, inlineCallbacks, returnValue
from twistar.dbobject import DBObject
from twistar.registry import Registry
from collections import deque
import logging, time, json
class Penguin(DBObject):
HASONE = ['avatar', 'curren... | Times-0/Timeline | Timeline/Database/DB.py | Python | gpl-3.0 | 8,784 |
# -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2014 Thomas Perl and the gPodder Team
# Copyright (c) 2011 Neal H. Walfield
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | somini/gpodder | src/gpodder/util.py | Python | gpl-3.0 | 54,845 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... | belokop/indico_bare | indico/MaKaC/review.py | Python | gpl-3.0 | 118,820 |
# vim: fileencoding=UTF-8:expandtab:autoindent:ts=4:sw=4:sts=4
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# To import from calibre, some things need to be added to `sys` first. Do not import
# anything from calibr... | NiLuJe/calibre-kobo-driver | tests/test_common.py | Python | gpl-3.0 | 4,914 |
import re
simple_cmd_match = re.compile(r'\\([^\\]+?)\{(.*?)\}')
graphics_cmd_match = re.compile(r'\\includegraphics\[.*?\]?\{(.*?)\}')
begin_cmd_match = re.compile(r'\\begin{([^}]+?)}(?:(?:\[([^\]]+?)\])|.*)')
newcmd_match = re.compile(r'\\.+?\{(.*?)\}\{(.*)\}')
# newcmd_match_with_var = re.compile(r'\\[^\\]+?\{(.*?)... | floriangeigl/arxiv_converter | tex_utils.py | Python | gpl-3.0 | 969 |
# -*- coding: utf-8 -*-
"""Common message dialogs"""
import os
from gi.repository import GLib, Gtk, Gdk, GObject
from lutris import api, pga, runtime, settings
from lutris.gui.widgets import DownloadProgressBox
from lutris.util import datapath
class GtkBuilderDialog(GObject.Object):
def __init__(self, parent=No... | RobLoach/lutris | lutris/gui/dialogs.py | Python | gpl-3.0 | 11,016 |
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
class MyuniversityscraperPipeline(object):
def process_item(self, item, spider):
return item
| systemovich/scrapy-myuniversity | myuniversityscraper/pipelines.py | Python | gpl-3.0 | 273 |
# Copyright (c) 2015 Aaron Kehrer
# Licensed under the terms of the MIT License
# (see fiddle/__init__.py for details)
import os
import unicodedata
from io import StringIO
from PyQt4 import QtCore, QtGui
from fiddle.config import EDITOR_FONT, EDITOR_FONT_SIZE
class PyConsoleTextBrowser(QtGui.QTextBrowser):
def ... | akehrer/fiddle | fiddle/controllers/PyConsole.py | Python | gpl-3.0 | 5,579 |
# TODO : Faire l'agent destructeur
| vportascarta/UQAC-8INF844-SPHERO | agents/Destructor.py | Python | gpl-3.0 | 35 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 Thomas Jost and the Contributors
#
# This file is part of git-annex-remote-hubic.
#
# git-annex-remote-hubic 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... | Schnouki/git-annex-remote-hubic | setup.py | Python | gpl-3.0 | 1,813 |
###############################
# This file is part of PyLaDa.
#
# Copyright (C) 2013 National Renewable Energy Lab
#
# PyLaDa is a high throughput computational platform for Physics. It aims to
# make it easier to submit large numbers of jobs on supercomputers. It
# provides a python interface to physical input, ... | pylada/pylada-light | tests/ipython/conftest.py | Python | gpl-3.0 | 2,390 |
#!/usr/bin/python2
import collections
import os
from loranode import RN2483Controller
# from ../_examplify.py import Examplify
import os
os.sys.path.append(os.path.dirname(os.path.abspath('.')))
from _examplify import Examplify
import lora, pmt, osmosdr
from gnuradio import gr, blocks
class ReceiveWhitening:
de... | Wosser1sProductions/gr-lora | examples/lora-whitening/createWhiteningValues.py | Python | gpl-3.0 | 3,178 |
from vadvisor.store.event import InMemoryStore
import pytest
from freezegun import freeze_time
from datetime import datetime, timedelta
@pytest.fixture
@freeze_time("2012-01-14 03:00:00")
def expired_store():
store = InMemoryStore(60)
# Insert old data
store.put('old')
store.put('old')
store.put('... | kubevirt/vAdvisor | tests/store/test_event.py | Python | gpl-3.0 | 1,720 |
"""
__TMWQuestDragonEggActions_MDL.py_____________________________________________________
Automatically generated AToM3 Model File (Do not modify directly)
Author: bogdan
Modified: Wed May 2 00:27:03 2018
______________________________________________________________________________________
"""
from stickylink impor... | Balannen/LSMASOMM | atom3/Models/TMWQuestDragonEggActions_MDL.py | Python | gpl-3.0 | 56,827 |
# -*- coding: utf-8 -*-
'''
Subtitles.gr Addon
Author Twilight0
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
'''
import re, unicodedata
from shutil import copy
from os.path import splitext, exists, split as os_split
from resources.lib import subtitlesgr, xsubs... | Twilight0/service.subtitles.subtitles.gr | resources/lib/addon.py | Python | gpl-3.0 | 12,802 |
#!/usr/bin/env python
import numpy as np
import mirheo as mir
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--axes', type=float, nargs=3)
parser.add_argument('--coords', type=str)
parser.add_argument('--vis', action='store_true', default=False)
parser.add_argument('--drag', type=float... | dimaleks/uDeviceX | tests/bindings/obj_rod.py | Python | gpl-3.0 | 3,627 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: Enrique Henestroza Anguiano
#
"""
Classifier for liblinear, svmlin. Agnostic about features or labels. Uses
'ranking', or dynamic classes.
"""
import sys
import os
import codecs
import svmlight
from libsvm import svmutil, svm
# Optional LIBLinear
try:
from... | enhean/fredist | src/fredist/classifier.py | Python | gpl-3.0 | 8,580 |
#!/usr/bin/python3
""" message_gds.py:
"""
# Import Required Libraries (Standard, Third Party, Local) ********************
import datetime
import logging
if __name__ == "__main__":
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from rpihom... | csm0042/rpihome_v3 | rpihome_v3/messages/get_device_state.py | Python | gpl-3.0 | 11,430 |
"""
Test functions in iwords.py. To run with pytest.
"""
import os
from tempfile import NamedTemporaryFile
import iwords
def test_get_freqs():
with NamedTemporaryFile() as fp:
fp.write(b'Hello world!')
fp.flush()
assert iwords.get_freqs([fp.name]) == {'hello': 0.5, 'world': 0.5}
def te... | jordibc/destaca_palabras | test_iwords.py | Python | gpl-3.0 | 823 |
import ujson as json
import pytz
from datetime import datetime
import requests
from django.http import HttpResponse, Http404
from django.shortcuts import render
def index(request):
return render(request, 'timetable/index.html', {})
def query(request, term):
ret = []
if len(term) > 1:
r = reques... | drbeni/fahrplan | timetable/views.py | Python | gpl-3.0 | 3,943 |
# 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... | stephanehenry27/Sickbeard-anime | sickbeard/scheduler.py | Python | gpl-3.0 | 2,593 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=W0403,R0902,R0903,R0904,W021... | mganeva/mantid | scripts/HFIR_4Circle_Reduction/detector2dview.py | Python | gpl-3.0 | 14,054 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | 2ndQuadrant/ansible | lib/ansible/executor/play_iterator.py | Python | gpl-3.0 | 27,052 |
import unittest
from vsvbp.container import Item, Bin, Instance
from vsvbp.generator import generator
class ItemBinTestCase(unittest.TestCase):
def setUp(self):
self.i1 = Item([1,2,9]); self.i2 = Item([4,5,3])
self.i3 = Item([0,1,0]); self.i4 = Item([9,8,7])
self.i1.size = 1; self.i2.size ... | FreshetDMS/FDCapacityPlanner | tests/test_generator.py | Python | gpl-3.0 | 941 |
# -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
# 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 ... | kartoza/geonode | geonode/tasks/tests.py | Python | gpl-3.0 | 1,025 |
# -*- coding: utf-8 -*-
from Components.Language import language
from Tools.Directories import resolveFilename, SCOPE_PLUGINS
import gettext
PluginLanguageDomain = "OpenWebif"
PluginLanguagePath = "Extensions/OpenWebif/locale"
def localeInit():
gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLU... | pr2git/e2openplugin-OpenWebif | plugin/__init__.py | Python | gpl-3.0 | 509 |
import math
from scipy import integrate, optimize
import numpy as np
import matplotlib.pyplot as plt
import numpy. polynomial.chebyshev as cheb
from matplotlib import rc
iphi = lambda x: np.sqrt(9.8 / 8.) * (1. - np.cos(x)) / \
np.sqrt((x - np.sin(x)) * np.sin(x / 2.))
def getChebNodes(N):
return -np.cos(np... | liebannam/pipes | interpolation_tests/intphisucks.py | Python | gpl-3.0 | 3,989 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-27 16:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('reddit', '0009_auto_20170527_1814'),
]
operations ... | hcosta/escueladevideojuegos.net-backend-django | edv/reddit/migrations/0010_question_best_response.py | Python | gpl-3.0 | 628 |
"""Some eastereggs just for fun"""
from utils import Filehandler
class EasterEggFunctions(object):
"""Easter Egg functions"""
def __init__(self):
self.fhandler = Filehandler()
def darkwing(self, channel, callback, msg=None, nck=None, hq=None, keys=None, pb=None):
"""Post a random line"""... | fast90/christian | commands/eggfunctions.py | Python | gpl-3.0 | 964 |
import helpers
from config import render, db
class Keyword(object):
def GET(self):
keyword_count = db.query('SELECT KEYWORD,\
COUNT(DISTINCT IPKEY) AS PACKAGES,\
COUNT(DISTINCT UUID) AS HOSTS\
FROM GLOBAL_KEYWORDS NATURAL JOIN KEYWORDS\
NATUR... | vikraman/gentoostats | server/kwd.py | Python | gpl-3.0 | 1,062 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import sys
import random
import itertools
from gensim.models.phrase... | janrygl/gensim | gensim/test/test_count_minimal_sketch_counter.py | Python | gpl-3.0 | 3,092 |
from __future__ import absolute_import
#from urllib.parse import urlparse, urlunparse
from builtins import str
from builtins import range
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib.auth import (
REDIRECT_FIELD_NAME, get_user_model, login as auth_lo... | zibawa/zibawa | front/views.py | Python | gpl-3.0 | 12,712 |
# Copyright 2016-2017 Alan F Rubin, Daniel C Esposito
#
# This file is part of Enrich2.
#
# Enrich2 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) ... | daniaki/Enrich2 | enrich2/sequence/aligner.py | Python | gpl-3.0 | 21,237 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.test_runner import make_test_objects
from erpnext.controllers.item_variant import (create_variant, ItemVarian... | tfroehlich82/erpnext | erpnext/stock/doctype/item/test_item.py | Python | gpl-3.0 | 10,134 |