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
import pygame, sys, os, random, math, time, copy, json from pygame import Rect, draw, QUIT, MOUSEMOTION, MOUSEBUTTONDOWN from chordConversions import * from display import resize_img class Hero: def __init__(self, screen, maxAmo, foodAddTo, powersToGet, speedFactor, moneyFactor, image, aimI...
zenev/charityGame
feedingGame/gameObjects.py
Python
gpl-2.0
29,777
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but...
cnewcome/sos
sos/plugins/zfs.py
Python
gpl-2.0
1,124
# Maitre D' # Demonstrates treating a value as a condition print("Welcome to the Chateau D' Food") print("It seems we are quite full this evening.\n") money = int(input("How many dollars do you slip the Maitre D'")) if money: print("Ah, I am reminded of a table. Right this way.") else: print("Please, sit. It may b...
rob-nn/python
first_book/maitre_d.py
Python
gpl-2.0
377
# Copyright (C) 2013 Korei Klein <korei.klein1@gmail.com> from calculus.enriched import formula, constructors, endofunctor from calculus.basic import formula as basicFormula from lib.common_symbols import leftSymbol, rightSymbol, relationSymbol, domainSymbol, inputSymbol, outputSymbol, functionPairsSymbol from lib imp...
koreiklein/fantasia
lib/common_formulas.py
Python
gpl-2.0
3,977
# -*- coding: utf-8 -*- # Generated by Django 1.11.29 on 2020-11-22 11:59 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('simon_app', '0002_probeapirequest_test_settings'), ] operations = [ migrat...
LACNIC/simon
simon-web/simon_app/migrations/0003_probeapipingresult_probeapi_id.py
Python
gpl-2.0
494
p = 16857450949524777441941817393974784044780411511252189319 A = 16857450949524777441941817393974784044780411507861094535 B = 77986137112576 P = (5732560139258194764535999929325388041568732716579308775, 14532336890195013837874850588152996214121327870156054248) Q = (2609506039090139098835068603396546214836589143940493...
Qwaz/solved-hacking-problem
SharifCTF/2016/elliptic.py
Python
gpl-2.0
1,402
''' Created on Dec 22, 2014 @author: Marcel Enguehard ''' import config,struct,logging from _socket import inet_aton logger = logging.getLogger("DHCP_server") class DHCP_option: #See RFC2132 for options explanations: https://tools.ietf.org/html/rfc2132 #For each option number, stores the corresponding value ...
marceleng/py-DHCP-server
dhcp_option.py
Python
gpl-2.0
4,387
# import numpy as np import cv2 as cv if __name__ == "__main__": faceCascade = cv.CascadeClassifier(cv.data.haarcascades + 'haarcascade_frontalface_default.xml') eyeCascade = cv.CascadeClassifier(cv.data.haarcascades + 'haarcascade_eye.xml') # img = cv.imread('sachin.jpg') video_capture = cv.VideoCapt...
iproduct/course-social-robotics
09-image-recognition-opencv-dnn/cv2_haar_cascade_demo.py
Python
gpl-2.0
1,513
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2019 RERO # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that...
rero/reroils-app
tests/api/test_permissions_patron.py
Python
gpl-2.0
2,746
import string import random import webserver.views.api.exceptions def generate_string(length): """Generates random string with a specified length.""" return ''.join([random.SystemRandom().choice( string.ascii_letters + string.digits ) for _ in range(length)]) def reformat_date(value, fmt="%b %d,...
metabrainz/acousticbrainz-server
webserver/utils.py
Python
gpl-2.0
860
# Copyright (C) 2014 Johnny Vestergaard <jkv@unixcluster.dk> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This...
soltraconpotprojectNLDA/SoltraConpot
conpot/protocols/kamstrup/usage_simulator.py
Python
gpl-2.0
4,667
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
sbesson/zeroc-ice
scripts/IceGridAdmin.py
Python
gpl-2.0
11,612
#!/usr/bin/python import time, sqlite3, sys, urllib, csv begin = time.time() url = "http://www.correlatesofwar.org/COW2%20Data/SystemMembership/2011/states2011.csv" print "Downloading from", url response = urllib.urlretrieve(url, '../Data/states2011.csv') print "Opening Database" con = sqlite3.connect('../Data/PyRB...
AABoyles/Tabular.ui
Scripts/dumpStatesToDB.py
Python
gpl-2.0
1,190
#!/usr/bin/env python class RulesContainer(object): def __init__(self): self.rules = {} def __str__(self): s = '' for key in self.rules: for value in self.rules[key]: s += str(value) + ', ' return s[:-2] def __getitem__(self, key): retu...
dasbruns/PrismaIO
RulesContainer.py
Python
gpl-2.0
667
# -*-mode: python; py-indent-offset: 4; tab-width: 8; coding: iso-8859-1 -*- # DLLM (non-linear Differentiated Lifting Line Model, open source software) # # Copyright (C) 2013-2015 Airbus Group SAS # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Pub...
matthieu-meaux/DLLM
modules/DLLM/polarManager/analyticAirfoil.py
Python
gpl-2.0
8,861
# coding=utf-8 from WindowHelper import WindowHelper from constants import * class ListDialog: def __init__(self): self.win = WindowHelper.Instance() self.win.new_color((5, 51, 90), 'dark_blue') self.win.new_color((176, 194, 238), 'light_blue') self.win.new_font('Arial', 40, 'ti...
totorigolo/WiiQuizz
ListDialog.py
Python
gpl-2.0
1,552
# -*- coding: utf-8 -*- from django.contrib.auth.models import User from django.db import models from hvad.models import TranslatableModel, TranslatedFields from hvad.manager import TranslationManager class Quiz(TranslatableModel): short_description = models.CharField(max_length=128) translations = Translated...
danieltellez/career
career/models.py
Python
gpl-2.0
2,454
# I'm pretty sure this idea is going to end up being a lot of code so its going in a separate file # # The idea is simple, don't create a new search tab but instead narrow down the library view as we type. # Each letter typed should narrow down the library view instantly and without causing any interruption to the user...
TheRealBanana/bLyrics
src/dialogs/logic/active_filtering_search.py
Python
gpl-2.0
4,055
from django.contrib import admin # Register your models here. from datatable.models import Serveur # Register your models here. class ServeurAdmin(admin.ModelAdmin): list_display = ('In_Type', 'In_Nom', 'In_IP', 'statut') list_filter = ('In_Type', 'In_Nom', 'In_IP', 'statut') search_fields = ['In_Type', 'In_Nom',...
chrislyon/dj_ds1
datatable/admin.py
Python
gpl-2.0
375
# -*- coding: utf-8 -*- import os,sys import stat,fnmatch import re from pprint import pformat def get_file_list(path, ext, subdir = True ): if os.path.exists(path): dirlist = [] for name in os.listdir(path): fullname = os.path.join(path, name) st = os.lstat(fullname) ...
Yanel85/GAEphotos
lang/ccgettext.py
Python
gpl-2.0
1,569
import os from qgis.PyQt.QtCore import pyqtSignal, QSize, Qt from qgis.PyQt.QtGui import QPixmap from qgis.PyQt.QtWidgets import QListWidgetItem, QWidget import roam.api import roam.api.utils import roam.project import roam.updater import roam.utils from roam.ui.ui_listmodules import Ui_ListModules from roam.ui.ui_pr...
DMS-Aus/Roam
src/roam/listmodulesdialog.py
Python
gpl-2.0
7,739
from .zips import unzipper, zipper from .directory import rm_file_if_exists, create_tmp_dir, find_files from .bag import create_bag from .csvs import get_csv_from_metadata, write_csv_to_file, merge_csv_metadata, read_csvs from .jsons import write_json_to_file, idx_num_to_name, idx_name_to_num, rm_empty_fields, read_jso...
nickmckay/LiPD-utilities
Python/lipd/lipd_io.py
Python
gpl-2.0
3,743
import virtualenv import textwrap output = virtualenv.create_bootstrap_script(textwrap.dedent(""" import os, subprocess def after_install(options, home_dir): subprocess.call([join(home_dir, 'bin', 'pip'), 'install', 'ipython', 'django', 'psycopg2']) """)) f = open('bootstrap.py', 'w').write(o...
Yellowen/Sharamaan
bin/bootstrap_creator.py
Python
gpl-2.0
327
import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) import sys; print('%s %s' % (sys.executable or sys.platform, sys.version)) ls list source
ivanortegaalba/DAI_2014-2015
.metadata/.plugins/org.python.pydev.shared_interactive_console/history.py
Python
gpl-2.0
165
# -*- coding=utf8 -*- import os, sys import select, threading, Queue import configparser as cf from mysocket import MySocket g_messageQueues = {} #每个scoket分配一个队列用于读写 g_messageQueues['main'] = Queue.Queue() #主队列用于接收服务器的返回消息 svrSockets = [] #MySocket 列表,对应每一个服务器 class MsgItem: def __init__(self, msgType, socket, da...
dilworm/pytest
base/client.py
Python
gpl-2.0
3,292
import uuid import re import cPickle import pprint from django.db import models from django.conf import settings from django.contrib.auth.models import AnonymousUser from django.db.models.signals import m2m_changed, pre_delete from django.dispatch import receiver class APITree(object): def __init__(self): ...
feifangit/dj-api-auth
djapiauth/models.py
Python
gpl-2.0
4,372
import sublime, sublime_plugin class SnakeCommand(sublime_plugin.TextCommand): def run(self, edit): sels = self.view.sel() for sel in sels: string = self.view.substr(sel) if string.find('_') != -1: string = self.__toCamel(string) else: ...
xxvholic/snake_camel_switch
SnakeManager.py
Python
gpl-2.0
680
# Copyright (C) 2006-2014 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library ...
FedoraScientific/salome-yacs
src/pyqt/gui/graph.py
Python
gpl-2.0
12,360
from django.db import models from django.utils.timezone import utc from django.db.models import get_model from django.contrib.auth.models import User from apps.elements.models import VersionControl, Resource from apps.towns.forms import OutskirtForm import random, itertools from datetime import datetime, timedelta f...
Sult/Buah
apps/towns/models.py
Python
gpl-2.0
18,570
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd # Copyright (C) 2008, 2009 Guillermo Gonzalez # -*- 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 ...
lenin/bzr-xmloutput
tests/test_log_xml.py
Python
gpl-2.0
29,992
## begin license ## # # "Meresco Components" are components to build searchengines, repositories # and archives, based on "Meresco Core". # # Copyright (C) 2007-2009 SURF Foundation. http://www.surf.nl # Copyright (C) 2007 SURFnet. http://www.surfnet.nl # Copyright (C) 2007-2010 Seek You Too (CQ2) http://www.cq2.nl # C...
seecr/meresco-components
meresco/components/http/pathrename.py
Python
gpl-2.0
1,768
import md5 import os import sys path = sys.argv[1] db_file = open(os.path.join(path,"pics_mysql.txt"),"w") for file_name in os.listdir(path): if not file_name.lower().endswith(".gif"): continue with open(os.path.join(path,file_name),"rb") as fp: contents = fp.read() new_file_name = m...
0x1001/funornot
utils/image_convert.py
Python
gpl-2.0
593
#!/usr/bin/python #Imports Serial into Python import serial #Function to initialize stream def initializeStream(portPath, frequency): #Makes variable stream global global stream print "Initializing stream with the port path '%s' with the frequency of %d..." %(portPath, frequency) strea...
North-Empire-Codes/Online_Robot_Project
ORP-FMS/src/SerialStream.py
Python
gpl-2.0
2,106
# -*- coding: utf-8 -*- # # pybgpstream documentation build configuration file, created by # sphinx-quickstart on Mon Jan 19 11:07:23 2015. # # 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. #...
CAIDA/bgpstream
pybgpstream/docs/conf.py
Python
gpl-2.0
8,420
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2015 CERN. # # INSPIRE 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...
jmartinm/inspire-next
inspire/modules/predicter/tasks.py
Python
gpl-2.0
4,080
from django.conf.urls import include, url from simplemooc.accounts.views import * from django.contrib.auth.views import logout, login urlpatterns = [ url(r'^$', dashboard, name='dashboard'), url(r'^entrar/$', login, {'template_name': 'accounts/login.html'}, name='login'), url(r'^sair/$', logout, {'next_pag...
WalissonRodrigo/SIMPLEMOOC
simplemooc/accounts/urls.py
Python
gpl-3.0
686
#! /usr/bin/env python # -*- coding: utf-8 -*- # Above the run-comment and file encoding comment. # TODO FIXME XXX # Keywords with break continue del exec return pass print raise global assert lambda yield for while if elif else import from as try except finally and in is not or yield from def functionname class ...
mumuxme/vim-config
test/test.py
Python
gpl-3.0
2,612
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("delft3dworker", "0050_auto_20160825_0934"), ] operations = [ migrations.AlterField( model_name="container", ...
openearth/delft3d-gt-server
delft3dworker/migrations/0051_auto_20160825_0935.py
Python
gpl-3.0
438
""" Initializer Initialize application data. Created by Lahiru Pathirage @ Mooniak<lpsandaruwan@gmail.com> on 19/12/2016 """ from session import Base from session import mysql_con_string from sqlalchemy import create_engine from utility import DBManager def initialize(): engine = create_engine( mysql...
fontman/fontman-server
utility/Initializer.py
Python
gpl-3.0
428
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/xccdf_1_2/ModelType.py
Python
gpl-3.0
6,764
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2019 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, eith...
dontnod/weblate
weblate/wladmin/models.py
Python
gpl-3.0
6,438
#!/usr/bin/env python # -*- coding: utf-8 -*- '''Method collection to obtain optical system information This module contains a method collection to obtain information, and analyze optical systems ''' __all__=["intersection", "nearest_points", "chief_ray_search", "pupil_location", "paraxial_location", "find...
ramezquitao/pyoptools
pyoptools/raytrace/calc/calc.py
Python
gpl-3.0
25,857
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/cpe_lang_2_3/CPEFactRefType.py
Python
gpl-3.0
952
# Central script to choose what to do import sys from FeeDistribution import confirmed, unconfirmed, fees, database, export def help(): print('\ncommand - description\n') for key, option in options.items(): print('------------------------') print('{} - {}'.format(key, option['description'])) print('\n') optio...
weex/bitcoin-fee-distribution
run.py
Python
gpl-3.0
2,295
#!/usr/bin/env python # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.internet.protocol import DatagramProtocol from twisted.internet import reactor # Here's a UDP version of the simplest possible protocol class EchoUDP(DatagramProtocol): def datagramReceived(self, ...
dungeonsnd/test-code
dev_examples/twisted_test/other_echo/echoserv_udp.py
Python
gpl-3.0
510
"""Initialazation "db" sqlalchemy object.""" from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy()
Wasper256/evo-departments
extentions.py
Python
gpl-3.0
103
#!/bin/python3 class SpaceShip: def __init__(self, id, health, x, y): self.id = id self.health = int(health) self.x = x self.y = y def __del__(self): print("{} was destroyed.".format(self.id)) del self def takeDMG(self, hit): self.health -= hit ...
elakamarcus/python
class-inheritance_02.py
Python
gpl-3.0
3,445
class Solution(object): def optimalDivision(self, nums): """ :type nums: List[int] :rtype: str """ if len(nums) == 0: return "" elif len(nums) == 1: return str(nums[0]) elif len(nums) == 2: return str(nums[0]) + "/" + str(nu...
sadad111/leetcodebox
Optimal Division.py
Python
gpl-3.0
509
from .models import MenuItem, ContactInformation #custom context processor to pass menu items to base.html def list_menu(request): menu_items = MenuItem.objects.all() phone = ContactInformation.objects.all()[0].phone fax = ContactInformation.objects.all()[0].fax email = ContactInformation.objects.all()...
neslihanturan/artge
app/context_processors.py
Python
gpl-3.0
556
# coding=utf-8 import unittest """166. Fraction to Recurring Decimal https://leetcode.com/problems/fraction-to-recurring-decimal/description/ Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating p...
openqt/algorithms
leetcode/python/lc166-fraction-to-recurring-decimal.py
Python
gpl-3.0
951
# ***** BEGIN GPL LICENSE BLOCK ***** # # # 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 distribute...
Microvellum/Fluid-Designer
win64-vc/2.78/Python/bin/2.78/scripts/addons/object_edit_linked.py
Python
gpl-3.0
10,814
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Simple Bot to reply to Telegram messages # This program is dedicated to the public domain under the CC0 license. import logging import telegram from telegram.error import NetworkError, Unauthorized from time import sleep def main(): # Telegram Bot Authorization T...
tsnoam/python-telegram-bot
examples/legacy/echobot.py
Python
gpl-3.0
1,437
# -*- coding: utf-8 -*- # Author: Douglas Creager <dcreager@dcreager.net> # This file is placed into the public domain. # Calculates the current version number. If possible, this is the # output of “git describe”, modified to conform to the versioning # scheme that setuptools uses. If “git describe” returns an error #...
ThomasChiroux/boksh
build_scripts/version.py
Python
gpl-3.0
2,745
from django.contrib.auth import authenticate, login from django.contrib.auth.forms import AuthenticationForm from django.contrib.auth.models import User from django.core import serializers from django.core.paginator import Paginator, EmptyPage from django.core.serializers.json import DjangoJSONEncoder from django.http....
moteloquito/final-project
final/apps/fondo/views.py
Python
gpl-3.0
5,222
# -*- coding: utf-8 -*- from __future__ import unicode_literals from statemachine import _Statemachine class Windows10StateMachine(_Statemachine): def __init__(self, params): _Statemachine.__init__(self, params) def _list_share(self): return super(Windows10StateMachine, self)._list_...
SekoiaLab/Fastir_Collector
health/windows10StateMachine.py
Python
gpl-3.0
4,814
""" Reconstruct the results """ import glob import os import tables from sapphire import ReconstructESDCoincidences RESULT_PATH = '/Users/arne/Datastore/science_park_corsika/{seed}/result.h5' PATHS = '/Users/arne/Datastore/science_park_corsika/*_*/result.h5' def reconstruct_simulations(seed): path = RESULT_PA...
HiSPARC/topaz
150624_energy_simulations/reconstruct.py
Python
gpl-3.0
1,203
""" Author: RedFantom Contributors: Daethyra (Naiii) and Sprigellania (Zarainia) License: GNU GPLv3 as in LICENSE Copyright (C) 2016-2018 RedFantom """ import socket import threading from queue import Queue from select import select from ast import literal_eval from network.connection import Connection SUPPORTED_COMM...
RedFantom/GSF-Parser
network/minimap/server.py
Python
gpl-3.0
4,942
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-21 15:22 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('pacientes', '0001_initial'), ] operations = [ migrations.RenameModel( o...
truki/logopedasur
pacientes/migrations/0002_auto_20161121_1522.py
Python
gpl-3.0
390
# module pyparsing.py # # Copyright (c) 2003-2021 Paul T. McGuire # # 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, cop...
JonnyWong16/plexpy
lib/pyparsing/__init__.py
Python
gpl-3.0
9,095
""" WSGI config for rematch-server 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.9/howto/deployment/wsgi/ """ from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
nirizr/rematch
server/rematch/wsgi.py
Python
gpl-3.0
318
from django.utils.translation import ugettext_lazy as _ from django.utils.html import mark_safe from django.core.urlresolvers import reverse from tendenci.libs.model_report.report import reports, ReportAdmin from tendenci.libs.model_report.utils import (sum_column, us_date_format, date_label, ...
alirizakeles/tendenci
tendenci/apps/invoices/reports.py
Python
gpl-3.0
2,731
#!/usr/bin/env python3 import pexpect import sys import argparse import logging from logging import StreamHandler import traceback import os import quik from quik import Template import fileinput import re import tarfile import fnmatch ROOTLOGGER = logging.getLogger("seafileinstaller") class SeafileInstaller: @stat...
aacebedo/raspbian-docker-images
seafile/files/seafile-installer.py
Python
gpl-3.0
9,507
__author__ = 'Eko Wibowo' print('Hello Python!')
pythonthusiast/Northed
main.py
Python
gpl-3.0
49
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import proteindf_bridge as bridge import proteindf_tools as pdf def find_atom_index(pdfparam, atomgroup): answer = set() for subgrp_key, subgrp in atomgroup.groups(): subgrp_atoms = find_atom_index(pdfparam, subgrp) answer = answer...
ProteinDF/ProteinDF_pytools
scripts/pdf-atom-index.py
Python
gpl-3.0
2,471
# # Tuxemon # Copyright (c) 2014-2017 William Edwards <shadowapex@gmail.com>, # Benjamin Bean <superman2k5@gmail.com> # # This file is part of Tuxemon # # 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 #...
Tuxemon/Tuxemon
tuxemon/item/effects/capture.py
Python
gpl-3.0
4,774
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-26 10:18 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blogadmin', '0001_initial'), ] operations = [ migrations.AlterField( ...
baike21/blog
blogadmin/migrations/0002_auto_20170826_1818.py
Python
gpl-3.0
822
# -*- coding: UTF-8 -*- from django.conf import settings from django.contrib.auth.models import User from django.db import models from jsonfield import JSONField PLACEHOLDER_IMAGE = "%simages/placeholder.png"%settings.STATIC_URL class UserProfile(models.Model): user = models.OneToOneField(User, related_name='_prof...
rosscdh/twimer
wastingtimer/nprofile/models.py
Python
gpl-3.0
820
from django.contrib import admin from .models import * # Register your models here. class DetalleEgresaAdmin(admin.TabularInline): model = DetalleEgreso class EgresoAdmin(admin.ModelAdmin): inlines = [ DetalleEgresaAdmin, ] list_display = ['fecha','descripcion','user'] ordering = ['user'] ...
PolarCommunity/SimpleInventoryControl
egresos/admin.py
Python
gpl-3.0
461
#main.py #Gaonkar, Vijay #vrgaonkar from __future__ import print_function from SearchEngine import SearchEngine search_engine = SearchEngine() results = [] choice = 0 while choice != 5: print("\n\t\t\t ############################### GAVELTON LIBRARY ############################### \n" "\n Welcome! Lo...
vgaonkar/GaveltonLibrary-Python
GaveltonLibrary/main.py
Python
gpl-3.0
2,980
# Configuration file example for L1L2Signature # version: '0.2.2' import l1l2py #~~ Data Input/Output ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Data assumed csv with samples and features labels # * All the path are w.r.t. config file path data_matrix = 'data/gedm.csv' labels = 'data/labels.csv' de...
slipguru/l1l2py
cuda/32bit/config.py
Python
gpl-3.0
1,967
""" Track valid dates, number of days between them, etc. """ import re import datetime, time import numpy from . import logging def today(): """Return system date in YYYYMMDD.""" return time.strftime('%Y%m%d') def decimalize(dates): """ Convert '20020930' to 2002.75. """ if numpy.isscalar(...
Fenugreek/tamarind
calendar.py
Python
gpl-3.0
11,719
from datetime import datetime import os import hashlib from django.db import models from django.db.models import Q from django.contrib.auth.models import User from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError, ObjectDoesNotExist from django.core.files.base impor...
AnnalisaS/migration_geonode
geonode/base/models.py
Python
gpl-3.0
21,558
__problem_title__ = "Eleven-free integers" __problem_url___ = "https://projecteuler.net/problem=442" __problem_description__ = "An integer is called if its decimal expansion does not contain any " \ "substring representing a power of 11 except 1. For example, 2404 and " \ ...
jrichte43/ProjectEuler
Problem-0442/solutions.py
Python
gpl-3.0
936
def print_list(message: list, indent: int = 0) -> str: # Have a newline so it's on the same line and add a [ final_message = "\n[" for count, value in enumerate(message): # Add a newline so the contents are seperate final_message += "\n" # Indent 4 spaces and multiply by the next in...
JoeyChor/python_logging
printer.py
Python
gpl-3.0
3,255
import turtle turtle.clearscreen() t = turtle.Turtle() #turtle.tracer(0, 0) t.fillcolor(0.9, 0.9, 0.6) t.begin_fill() for i in range(0, 5): t.forward(100) t.right(144) t.end_fill() t.up() t.backward(200) t.down() t.fillcolor(0.7, 0.95, 0.7) t.begin_fill() for i in range(0, 5): t.forward(100) ...
amosnier/python_for_kids
extra_code/03_loopy_turtle_01.py
Python
gpl-3.0
862
# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # b...
fracpete/python-weka-wrapper-examples
src/wekaexamples/classifiers/incremental_classifier.py
Python
gpl-3.0
1,881
# # SSSD integration test - access the ldb cache # # Copyright (c) 2016 Red Hat, Inc. # # This 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 only # # This program is distributed in the hope that it...
celestian/sssd
src/tests/intg/sssd_ldb.py
Python
gpl-3.0
2,793
__author__ = 'Joel Akeret' __version__ = '0.1.2' __credits__ = 'ETH Zurich, Institute for Astronomy'
jakeret/tf_unet
tf_unet/__init__.py
Python
gpl-3.0
101
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-04-04 22:11 from __future__ import unicode_literals import datetime from django.db import migrations, models from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('blog', '0004_auto_20160404_2211'), ...
Silvian/Blog
blog/migrations/0005_auto_20160404_2211.py
Python
gpl-3.0
599
# Copyright (C) 2010-2017 GRNET S.A. # # 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 i...
grnet/synnefo
snf-cyclades-app/synnefo/logic/management/commands/flavor-access-add.py
Python
gpl-3.0
1,983
# -*- coding: utf-8 -*- import time from collections import OrderedDict from odoo import api, fields, models, _ from odoo.osv import expression from odoo.exceptions import RedirectWarning, UserError, ValidationError from odoo.tools.misc import formatLang from odoo.tools import float_is_zero, float_compare from odoo.to...
chienlieu2017/it_management
odoo/addons/account/models/account_move.py
Python
gpl-3.0
83,795
# ##### BEGIN GPL LICENSE BLOCK ##### # # JewelCraft jewelry design toolkit for Blender. # Copyright (C) 2015-2022 Mikhail Rachinskiy # # 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, eith...
mrachinskiy/jewelcraft
op_gem_map/draw_handler.py
Python
gpl-3.0
1,672
#! /usr/bin/python # -*- coding: latin-1 -*- # $Id$ """ Classes to encapsulate a sub-process and communicate with it. Copyright (C) 2004, 2007 by Lingit AS """ __version__ = "$Rev$" import fcntl import logging import os import re import select import signal import subprocess import sys import time QUERY_TYPE_NONE ...
mtr/ttpd
lib/TTP/EncapsulateTUC.py
Python
gpl-3.0
7,681
#!/usr/bin/env python3 # 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...
oliver-sanders/cylc
cylc/flow/scripts/play.py
Python
gpl-3.0
999
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
artur-shaik/qutebrowser
tests/unit/misc/test_split.py
Python
gpl-3.0
6,878
def revertdigits( item ): return (item%10)*100 + (int(item/10)%10)*10 + int(item/100) numlist = [314, 315, 642, 246, 129, 999] numlist.sort( key=revertdigits ) print( numlist )
paulmcquad/Python
11 - Lists/sort revertdigits.py
Python
gpl-3.0
181
""" Observe the effect in the perturbations of Laplacians """ import sys import logging import numpy import scipy import itertools import copy import matplotlib.pyplot as plt from apgl.graph import * from sandbox.util.PathDefaults import PathDefaults from sandbox.misc.IterativeSpectralClustering import IterativeS...
charanpald/wallhack
wallhack/clusterexp/LaplacianExp.py
Python
gpl-3.0
2,822
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2014 Thomas Perl and the gPodder Team # # 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 Free Software Foundation; either version...
somini/gpodder
src/gpodder/query.py
Python
gpl-3.0
5,258
from SubChoosers.ISubStagesChooser import ISubStagesChooser from SubRankers.ByFullNameSubStagesRanker import ByFullNameSubStagesRanker from Utils import WriteDebug class FirstInCertainSubStagesChooser(ISubStagesChooser): """ Implementation of ISubStagesChooser. This chooser return results after ranki...
yosi-dediashvili/SubiT
src/SubChoosers/FirstInCertainSubStagesChooser.py
Python
gpl-3.0
2,895
from ..event import Event on_data_change = Event()
nextgis/nextgisweb
nextgisweb/feature_layer/event.py
Python
gpl-3.0
54
import ssl import sys from tornado import web, httpserver, ioloop, process, autoreload from DIRAC import gLogger, S_OK, S_ERROR from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader from RESTDIRAC.RESTSystem.Base.RESTHandler import RESTHandler from RESTDIRAC.ConfigurationSystem.Client.Helpers import RESTConf cl...
DIRACGrid/RESTDIRAC
RESTSystem/private/RESTApp.py
Python
gpl-3.0
2,840
# 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 t...
mozvip/Sick-Beard
sickbeard/show_queue.py
Python
gpl-3.0
18,584
import unittest import calc class CalcTestCase(unittest.TestCase): """Test calc.py""" def setUp(self): self.num1 = 10 self.num2 = 5 def tearDown(self): pass def test_add(self): self.assertTrue(calc.add(self.num1, self.num2), self.num1 + self.num2) ...
dariosena/LearningPython
general/dry/test_calc.py
Python
gpl-3.0
794
#!/usr/bin/env python from time import ctime from urllib2 import urlopen TICKs = ('yhoo', 'dell', 'cost', 'adbe', 'intc') URL = 'http://quote.yahoo.com/d/quotes.csv?s=%s&f=sl1c1p2' print '\nPrices quoted as of: %s\n' % ctime() print 'TICKER', 'PRICE', 'CHANGE', '%AGE' print '------', '-----', '------', '--...
YuxuanLing/trunk
trunk/code/study/python/core_python_appilication/ch13/stock.py
Python
gpl-3.0
485
#!/usr/bin/python import sys, getopt, warnings, os, re def mergeClosestClusters (CandidateCluster, distanceThreshold) : bReVal = True firstBestCulsterId = -1 secondBestCulsterId = -1 #print CandidateCluster for i in range(len(CandidateCluster) - 1) : averageFirst = sum(CandidateCluster[i])/float(len(Cand...
guo-xuan/Sipros-Ensemble
Scripts/HierarchicalClustering.py
Python
gpl-3.0
1,992
""" Module that runs the ls command """ import os import shutil import textwrap MAN_DOC = """ls - list files and directories Usage: ls [directory] Executing the command with no directory argument will list the files and folders in the current working directory. Executing the command with a directory argument will li...
GenericError/Project-Shell
ls.py
Python
gpl-3.0
961
# This file is part of Checkbox. # # Copyright 2012, 2013 Canonical Ltd. # Written by: # Sylvain Pineau <sylvain.pineau@canonical.com> # Zygmunt Krynicki <zygmunt.krynicki@canonical.com> # # Checkbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
zyga/debian.plainbox
plainbox/impl/secure/rfc822.py
Python
gpl-3.0
16,235
#!/usr/bin/env python3 # Convert MMGen 'v2' transaction file (amounts as BTCAmt()) # to MMGen 'v3' (amounts as strings) # v3 tx files were introduced with MMGen version 0.9.7 import sys,os repo_root = os.path.split(os.path.abspath(os.path.dirname(sys.argv[0])))[0] sys.path = [repo_root] + sys.path from mmgen.common i...
mmgen/mmgen
scripts/tx-v2-to-v3.py
Python
gpl-3.0
962
import numpy as np from sklearn.preprocessing import normalize from copy import deepcopy class PCCA(object): def __init__(self, n_states=2, psi=None, ncv=None): self.n_states = n_states if n_states < 2: raise ValueError('''Coarse-graining with PCCA+ requires at least ...
pgromano/Markov_Models
Markov_Models/coarse_grain/pcca.py
Python
gpl-3.0
1,708
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @file convert_detectors2SUMO.py @author Lukas Grohmann <Lukas.Grohmann@ait.ac.at> @date Aug 14 2015 @version $Id: convert_detectors2SUMO.py 22608 2017-01-17 06:28:54Z behrisch $ Parses induction loops and travel time measurements from a VISSIM .inpx file and wr...
702nADOS/sumo
tools/import/vissim/convert_detectors2SUMO.py
Python
gpl-3.0
13,776