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
# Author: Alexander Bokovoy <abokovoy@redhat.com> # # Copyright (C) 2011 Red Hat # see file 'COPYING' for use and warranty information # # 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 ...
hatchetation/freeipa
ipapython/platform/fedora16.py
Python
gpl-3.0
9,991
from factory.django import DjangoModelFactory from booking.models import Building, Place, Booking, BookTime from faker import Factory as FakerFactory from factory import * import factory from factory.fuzzy import FuzzyChoice, FuzzyDate, FuzzyInteger from user.factories import UserFactory, UserProfileFactory from dateti...
fga-gpp-mds/2016.2-SAS_FGA
sas/booking/factories.py
Python
gpl-3.0
2,595
# coding=utf-8 """ Cadasta **Cadasta Project Update Dialog.** .. note:: 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 v...
Cadasta/cadasta-qgis-plugin
cadasta/gui/tools/wizard/project_update_wizard.py
Python
gpl-3.0
3,103
def solution(x): """ :param int: :return: print step """ if x == 0: print 0 return step = 1 length = 0 while length < x: length += step if length == x: print step return step += 1 step -= 1 length = length - step ...
zymtech/leetcode
interview/leshi/2.py
Python
gpl-3.0
617
# # Copyright (c) 2013 Markus Eliasson, http://www.quarterapp.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) any later version...
OlofFredriksson/quarterapp
quarterapp/handlers/base.py
Python
gpl-3.0
4,657
""" Copyright 2008, 2009, 2015 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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...
glennlive/gnuradio-wg-grc
grc/core/Element.py
Python
gpl-3.0
3,410
""" mediatum - a multimedia content repository Copyright (C) 2007 Arne Seifert <seiferta@in.tum.de> Copyright (C) 2007 Matthias Kramm <kramm@in.tum.de> 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 Foun...
mediatum/mediatum
web/common/acl_editor_web.py
Python
gpl-3.0
2,490
#! /usr/bin/env python from pySecDec.loop_integral import loop_package import pySecDec as psd # Example used to demonstrate symmetry finder in Stephen Jones ACAT Proceedings 2017 li = psd.loop_integral.LoopIntegralFromGraph( internal_lines = [ [0,[1,4]], [0,[1,5]], [0,[2,3]], [0,[2,7]], [0,[3,8]], [0,[4,6]], [0,[5,6]...
mppmu/secdec
nodist_examples/box3L/box3L.py
Python
gpl-3.0
1,060
from meowth.core.data_manager import schema def setup(bot): team_table = bot.dbi.table('teams') # color_table = bot.dbi.table('colors') team_table.new_columns = [ schema.IDColumn('team_id', primary_key=True), schema.IDColumn('color_id', unique=True, # foreign_key=colors['color_i...
FoglyOgly/Meowth
meowth/exts/users/tables.py
Python
gpl-3.0
4,133
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # """ coco.config ~~~~~~~~~~~~ the configuration related objects. copy from flask :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import types import errno import json import socket i...
jumpserver/coco
coco/conf.py
Python
gpl-3.0
14,583
# -*- coding: utf-8 -*- """ HipparchiaServer: an interface to a database of Greek and Latin texts Copyright: E Gunderson 2016-21 License: GNU GENERAL PUBLIC LICENSE 3 (see LICENSE in the top level directory of the distribution) """ import re from flask import session from server.hipparchiaobjects.searchobjects ...
e-gun/HipparchiaServer
server/listsandsession/searchlistmanagement.py
Python
gpl-3.0
12,836
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- ### BEGIN LICENSE # Copyright (C) 2014 Brian Douglass bhdouglass@gmail.com # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Softwa...
bhdouglass/agui
agui/aextras/sound.py
Python
gpl-3.0
1,065
# -*- coding: utf-8 -*- value = input().split(" ") cod, qtd = value cod = int(cod) qtd = int(qtd) if cod == 1: print('Total: R$ %.2f' %(qtd*4.00)) elif cod == 2: print('Total: R$ %.2f' %(qtd*4.50)) elif cod == 3: print('Total: R$ %.2f' %(qtd*5.00)) elif cod == 4: print('Total: R$ %.2f' %(qtd*2.00)) elif...
lidymonteirowm/URI
Python3/URI1038.py
Python
gpl-3.0
371
#!/usr/bin/python3 # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is d...
squidsoup/snapcraft
snapcraft/_schema.py
Python
gpl-3.0
3,387
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2020 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
snapcore/snapcraft
snapcraft/internal/project_loader/_extensions/ros2_foxy.py
Python
gpl-3.0
3,074
import os import sys import math import random import pygame from pygame.locals import * SCREEN_SIZE = [720, 480] FPS = 60 #print(FPS) # Initialize screen pygame.init() screen = pygame.display.set_mode(SCREEN_SIZE) pygame.display.set_caption("Juego en PyGame to guapo") clock = pygame.time.Clock() class Background(p...
ElGoreLoco/Pygame-Testing
ship_asteroids.py
Python
gpl-3.0
5,612
from __future__ import absolute_import from __future__ import division from __future__ import print_function from DIRAC import S_OK from DIRAC.AccountingSystem.Client.Types.DataOperation import DataOperation from DIRAC.AccountingSystem.private.Plotters.BaseReporter import BaseReporter class DataOperationPlotter(Base...
yujikato/DIRAC
src/DIRAC/AccountingSystem/private/Plotters/DataOperationPlotter.py
Python
gpl-3.0
10,965
# coding:utf-8 ''' Author : qbeenslee Created : 2015/1/20 ''' import os import re import time import datetime from config.configuration import THUMB_SIZE_NORMAL, THUMB_SIZE_ORIGIN, THUMB_SIZE_LARGE from config.setting import UPLOAD_PATH from data.db import Share, Comment, Favorite, User RE_MATCH_DEPWD =...
qbeenslee/Nepenthes-Server
utils/stringutil.py
Python
gpl-3.0
6,041
#!/usr/bin/python # -*- coding: utf-8 -*- import tempfile from datetime import datetime import time from PIL import Image as ImagePIL from django.conf import settings from django.contrib import messages from django.http import Http404, HttpResponseRedirect from django.views.decorators.http import require_POST from d...
DevHugo/zds-site
zds/gallery/views.py
Python
gpl-3.0
16,394
from django.db import models from django.contrib import admin from django.utils.translation import ugettext_lazy as _ class ScheduleAdmin(admin.ModelAdmin): list_display = ('group', 'location', 'week_day', 'start_time', 'end_time') fieldsets = ((None, {'fields': ('group', 'location', 'week_day', 'start_time',...
htmfilho/boust
club/models/schedule.py
Python
gpl-3.0
996
# This file is part of Indico. # Copyright (C) 2002 - 2014 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...
nop33/indico-plugin-livesync
indico_livesync/zodbimport.py
Python
gpl-3.0
3,329
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Node Class The Node is based on the Basic class It is the base class of all items in a namespace. Device and Value are based on the Node Class it """ from pybush.constants import __dbug__ from pybush.functions import spacelessify from pybush.basic import Basic from py...
PixelStereo/pybush
pybush/node.py
Python
gpl-3.0
6,766
#! /usr/bin/env python """ File: main.py Author: Revolt -------------------------- Desc: This file initializes the wx application and starts the main application loop. -------------------------- Copyright (C) 2010 Revolt This program is free software: you can redistribute it and/or modify it under th...
AlexJF/MHDD-Organizer
main.py
Python
gpl-3.0
3,567
# -*- coding: utf-8 -*- """ APT Motor Controller for Thorlabs. Qudi 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. Qudi is distributed in ...
drogenlied/qudi
hardware/motor/aptmotor.py
Python
gpl-3.0
72,081
__author__ = 'civa' import re class DictQuery(dict): def get(self, path, where = '', single=False, default = None): keys = path.split("/") val = None for key in keys: if val: if isinstance(val, list): if where: if '*...
Civa/Zenith
src/Backend/Distributed/shared/utils.py
Python
gpl-3.0
2,328
# ##### 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 distrib...
kilon/sverchok
nodes/number/range_map.py
Python
gpl-3.0
3,434
#!/usr/bin/env python vector_a = [1,1,1,1,1] vector_b = [1,1,1,1,1] vector_c = [0,0,0,0,0] for i in range(0,len(vector_a)): vector_c[i] = vector_a[i] + vector_b[i] print vector_c
robertdfrench/tiny-vector-addition
Step1/vector-add-serial.py
Python
gpl-3.0
182
"""initialize invoice number format Revision ID: 1e1a970ad004 Revises: 44f964dc36a2 Create Date: 2018-06-06 12:29:45.046659 """ # revision identifiers, used by Alembic. revision = '1e1a970ad004' down_revision = '44f964dc36a2' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql def...
CroissanceCommune/autonomie
autonomie/alembic/versions/4_2_0_initialize_invoice_number_format_1e1a970ad004.py
Python
gpl-3.0
1,033
#!/usr/bin/python # -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*- """ Role ==== The ``PluginFileLocator`` locates plugins when they are accessible via the filesystem. It's default behaviour is to look for text files with the '.yapsy-plugin' extensions and to read the plugin's decription...
meyt/mehrcal
mehrcal/yapsy/PluginFileLocator.py
Python
gpl-3.0
19,587
# Copyright Daniel Dunn 2013-2015 # This file is part of Kaithem Automation. # Kaithem Automation 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 3. # Kaithem Automation is distributed in the hope th...
EternityForest/KaithemAutomation
kaithem/src/kaithemobj.py
Python
gpl-3.0
19,149
import unittest import os.path import sys import numpy as np from opm.io.parser import Parser from opm.io.parser import ParseContext from opm.io.deck import DeckKeyword try: from tests.utils import test_path except ImportError: from utils import test_path unit_foot = 0.3048 #meters class TestParser(unittes...
OPM/opm-cmake
python/tests/test_parser.py
Python
gpl-3.0
5,804
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This file is part of DaBroker, a distributed data access manager. ## ## DaBroker is Copyright © 2014 by Matthias Urlichs <matthias@urlichs.de>, ## it is licensed under the GPLv3. See the file `README.rst` fo...
smurfix/DaBroker
dabroker/server/transport/local.py
Python
gpl-3.0
1,877
def horner(a, x): y = 0.0 i = a.length - 1 while i >= 0: y = a[i] + x * y i = i - 1 return y
wojtask/CormenPy
src/chapter02/textbook_problem2_3.py
Python
gpl-3.0
125
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) | Plural subsystem is created by Vladyslav Kozlovskyy (Ukraine) <dbdevelop@gmail.com> Translation sys...
urrego093/proyecto_mv
gluon/languages.py
Python
gpl-3.0
36,357
# 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...
Zelgadis87/Sick-Beard
sickbeard/helpers.py
Python
gpl-3.0
21,438
# Django settings for FLAP project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Wacharabuhm', 'n.kimmy@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'F...
javadevil/FLAP
FLAP/FLAP/settings.py
Python
gpl-3.0
5,444
# coding: utf-8 # # Copyright (C) 2015 Google Inc. # 2017 ycmd contributors # # This file is part of ycmd. # # ycmd 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...
Qusic/ycmd
ycmd/tests/go/go_completer_test.py
Python
gpl-3.0
7,262
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2020 Bitergia # # 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 ...
grimoirelab/perceval
perceval/backends/core/meetup.py
Python
gpl-3.0
16,239
#!/usr/bin/python #-*- coding: utf-8 -*- """ (c) 2012 - 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_meeting.py
Python
gpl-3.0
33,466
# -*- coding: utf-8 -*- """ Exception classes """ class DontwiNotImplementedError(NotImplementedError): """Raised when not implemented method was called. """ pass class DontwiConfigError(AttributeError): """Raised when reading or parsing error occurred. Attributes: message -- explanation...
vocalodon/dontwi
dontwi/exception.py
Python
gpl-3.0
706
# coding: utf-8 # # Copyright 2014 NAMD-EMAP-FGV # # This file is part of PyPLN. You can get more information at: http://pypln.org/. # # PyPLN 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...
fccoelho/pypln.backend
tests/test_worker_wordcloud.py
Python
gpl-3.0
1,468
# sample code for the Sieve of Eratosthenes def sieve(limit): composites = [] primes = [] for i in range(2,limit+1): # Iterate from 2 up to the limit if i not in composites: # check if number is not already marked primes.append(i) # add the unmarked number to the prime list! for j in range(i*i,lim...
willybh11/python
Euler/primesSieve.py
Python
gpl-3.0
637
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # streamondemand.- XBMC Plugin # Canal para piratestreaming # http://blog.tvalacarta.info/plugin-xbmc/streamondemand. # ------------------------------------------------------------ import re import sys import urlparse from core impo...
orione7/Italorione
channels/italiaserie.py
Python
gpl-3.0
6,895
# 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, unittest import frappe.defaults from frappe.utils import flt, nowdate, nowtime from erpnext.stock.doctype.serial_no.serial_no import * fr...
KanchanChauhan/erpnext
erpnext/stock/doctype/stock_entry/test_stock_entry.py
Python
gpl-3.0
23,016
# -*- coding: utf-8 -*- """ Qt4 TS file parser for Python """ from __future__ import absolute_import import re, collections import time import xml.dom.minidom import xml.parsers.expat from xml.sax.saxutils import escape as xml_escape from django.db import transaction from django.db.models import get_model from django....
tymofij/adofex
transifex/resources/formats/qt.py
Python
gpl-3.0
19,864
# Authors: Rich Megginson <richm@redhat.com> # Rob Crittenden <rcritten@redhat.com> # John Dennis <jdennis@redhat.com> # # Copyright (C) 2007 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms of ...
hatchetation/freeipa
ipaserver/ipaldap.py
Python
gpl-3.0
29,998
import sys sys.path.append('flsk_app/malayalam_lesk/classes/') sys.path.append('classes/') import mysqldaccess as _m_acc class mysqldbwordnet: def __init__(self,HOST=None,USER=None,PASSWORD=None,DB=None): self._ml_access_obj = _m_acc.DbAccess() def getIdFromSense(self,sense): qr = "SELECT w...
omrehman/padam
flsk_app/malayalam_lesk/MalayalamWordnet.py
Python
gpl-3.0
692
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: https://sickrage.github.io # Git: https://github.com/SickRage/SickRage.git # # This file is part of SickRage. # # SickRage 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...
jackkiej/SickRage
sickbeard/logger.py
Python
gpl-3.0
16,593
# https://www.codewars.com/kata/tribonacci-sequence/train/python def tribonacci(signature, n): # Print arguments print('signature = {}'.format(signature)) print('n = {}'.format(n)) # The final tribonacci sequence. Start with the provided signature. # If n is less than 3, then [:n] will shorten it tribonacci = ...
pcampese/codewars
tribonacci.py
Python
gpl-3.0
591
from flask import render_template, Response import json from valar import app from valar.utils import get_summaries, get_devices @app.route('/') def index(): return render_template("index.html", title = 'Valar', ) @app.route('/miner') def get_miners(): results = [] sums = get_summaries() ...
BoulderBTC/valar
valar/views.py
Python
gpl-3.0
723
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
40223137/2015cd_midterm
wsgi.py
Python
gpl-3.0
25,645
# -*- coding: utf-8 -*- # Copyright (C) 2008 Osmo Salomaa # # 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 pr...
otsaloma/nfoview
nfoview/test/test_about.py
Python
gpl-3.0
929
# -*- coding: utf-8 -*- ''' Created on 18 Νοε 2012 @author: tedlaz ''' from PyQt4 import QtGui,Qt from utils import dbutils, widgets isValSQL = ''' SELECT m12_par.id FROM m12_par INNER JOIN m12_xrisi ON m12_xrisi.id=m12_par.xrisi_id INNER JOIN m12_period ON m12_period.id=m12_par.period_id WHERE m12_xrisi...
tedlaz/pyted
misthodosia/m13/f_calcpar.py
Python
gpl-3.0
3,290
# Copyright (C) MetaCarta, Incorporated. # # 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. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; ...
hohum/imap_autosort_nilsimsa
nilsimsa/__init__.py
Python
gpl-3.0
9,317
#! /usr/bin/env python import sys, getopt sys.path.append('/usr/local/nagios/share') from pygraylog.monitoring import StreamCheck hostname = "" login = "" password = "" port = 0 options = "" ############# try: options, remainder = getopt.gnu_getopt(sys.argv[1:], 'h:p:u:P:', ['host=', 'port=', 'user=', 'password=...
mblakele/pygraylog
examples/check_streams.py
Python
gpl-3.0
1,258
import logging import sys # Logging logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG) # Gracefully load numpy try: import numpy as np except (ImportError): logging.critical("Cannot import numpy. Skipping Test (%s)", __name__) # Gracefully load BaseTest try: sys.path.append('.....
rgatkinson/oxdna
TEST/UserTest/Test_MeanPE.py
Python
gpl-3.0
1,880
from pypers.core.step import CmdLineStep class CreateIntervalList(CmdLineStep): spec = { "version": "0.1.19", "descr": [ "Creates an interval list file suitable for use by picard tools, e.g., CalculateHsMetrics.", "A SAM style header must be present in the file which lists t...
frankosan/pypers
pypers/steps/qc/createintervallist.py
Python
gpl-3.0
1,745
#!/bin/env python # # AutoPyfactory batch plugin for Condor # from CondorBaseBatchSubmitPlugin import CondorBaseBatchSubmitPlugin from autopyfactory import jsd class CondorGridBatchSubmitPlugin(CondorBaseBatchSubmitPlugin): def __init__(self, apfqueue, config=None): if not config: qcl =...
edquist/autopyfactory
autopyfactory/plugins/batchsubmit/CondorGridBatchSubmitPlugin.py
Python
gpl-3.0
1,010
# encoding=utf-8 # @modified 2021/10/24 16:36:19 import web import time import hashlib import xutils import xauth import xtemplate from xutils import dateutil, cacheutil, dbutil from xutils import Storage from xutils import webutil RETRY_LIMIT = 3 dbutil.register_table("record", "记录表") dbutil.register_table("user_op_...
xupingmao/xnote
handlers/user/login.py
Python
gpl-3.0
2,520
#!/usr/bin/env python '''Download multipage PCS ranking data''' import os import csv import json import argparse import pathlib from bs4 import BeautifulSoup from tidylib import tidy_document import requests BASE_URL = 'https://www.procyclingstats.com/race/{race}/{year}/stage-{stage}' def get_soup_for(filename): ...
lauromoura/cyclinggctracker
src/pcs/downloader.py
Python
gpl-3.0
4,542
# good question class Solution(object): def removeDuplicateLetters(self, s): """ :type s: str :rtype: str """ n = len(s) last_index = {} for i, elem in enumerate(s): last_index[elem] = i seq = sorted(((idx, k) for k, idx in last_index.i...
wufangjie/leetcode
316. Remove Duplicate Letters.py
Python
gpl-3.0
3,854
# -*- coding: utf-8 -*- """ Created on Wed Mar 16 21:51:00 2016 @author: Rrich """ # Tic- Tac- Toe import random # print the board on screen def showBoard(Board): '''The function prints the board on screen. Board is a list of 10 strings representing the board. ''' print ' | | ' print str(...
rrichajalota/The-Python-Project
Tic Tac Toe/tictactoe.py
Python
gpl-3.0
7,281
#!/home/dante/Projects/free-art/venv/bin/python3 from django.core import management if __name__ == "__main__": management.execute_from_command_line()
DanteOnline/free-art
venv/bin/django-admin.py
Python
gpl-3.0
155
class Solution: def productExceptSelf(self, nums): """ :type nums: List[int] :rtype: List[int] """ left, right = 1, 1 num = len(nums) ans = [1 for i in range(num)] for i in range(num): ans[i] *= left; ans[num-1-i] *= right; ...
YiqunPeng/Leetcode-pyq
solutions/238ProductOfArrayExceptSelf.py
Python
gpl-3.0
400
from __future__ import print_function, absolute_import import time, math, numpy def turn(lbot, angle=0): if lbot.getGyroscope("Z_AXIS") is not None: lbot.resetGyroscope("Z_AXIS") curAngle = lbot.getGyroscope("Z_AXIS") while curAngle>2: curAngle = lbot.getGyroscope("Z_AXIS") ...
robocomp/learnbot
learnbot_dsl/functions/motor/base/turn.py
Python
gpl-3.0
1,875
#!/usr/bin/python ''' Copyright (C) 2015 Luxembourg Institute of Science and Technology 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 any later version. Thi...
ERIN-LIST/iguess
transaction_insert_register.py
Python
gpl-3.0
2,052
# coding=utf-8 # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 ...
Maximilian-Reuter/SickRage-1
sickbeard/search_queue.py
Python
gpl-3.0
11,131
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2021 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...
forkbong/qutebrowser
tests/unit/commands/test_runners.py
Python
gpl-3.0
3,986
import expyriment from pydoc import getdoc x = None y = None def _get_doc_and_function(obj): rtn = [] for var in dir(obj): if not var.startswith("_"): rtn.append(var) return getdoc(obj), rtn def _read_module(mod, doc_dict): doc_dict[mod.__name__], classes = _get_doc_and_function(...
expyriment/expyriment
documentation/api/expyriment_doc_search.py
Python
gpl-3.0
1,367
# -*- coding: utf-8 -*- import numpy as np from pandas import Series, DataFrame print("## Series index and default ordinal number index") obj = Series(np.arange(4.0), index = ['a', 'b', 'c', 'd']) print(obj) print(obj['b']) print(obj[3]) print(obj[[1, 3]]) print(obj[obj < 2]) print() print("## Series slice:") print(...
lamontu/data-analysis
pandas/indexing_selection_and_filtering.py
Python
gpl-3.0
1,034
#!/usr/bin/env python3 import os, sys, signal euid = os.geteuid() if euid != 0: print("Script not started as root. Running sudo..") args = ['sudo', sys.executable] + sys.argv + [os.environ] os.execlpe('sudo', *args) print('Running. Your euid is', euid) sys.path.insert(0, './Network') from NetworkMgr import ...
GadgeurX/NetworkLiberator
Daemon/main.py
Python
gpl-3.0
1,012
#!/usr/bin/env python3 import gi gi.require_version('Gtk','3.0') from gi.repository import Gtk from gi.repository import GLib import logging import os import configparser import signal class Co2MonitorGui(): def __init__(self): # initially set the standard logger self.set_logger(logging.getLogger(...
nobodyinperson/co2monitor
usr/lib/co2monitor/python/co2monitor/gui.py
Python
gpl-3.0
2,936
"""Define PVs, constants and properties of LIEmitMeas IOC.""" from .. import csdev as _csdev # --- Enumeration Types --- class ETypes(_csdev.ETypes): """Local enumerate types.""" MEASURESTATE = ('Stopped', 'Measuring') PLANE = ('Y', 'X') _et = ETypes # syntactic sugar # --- Const class --- class Co...
lnls-sirius/dev-packages
siriuspy/siriuspy/meas/liemit/csdev.py
Python
gpl-3.0
1,455
#!/usr/bin/env python # Fetch and build keywords from the "subject" field of federal register data from datetime import date, timedelta from glob import glob import itertools import logging import re import os import string import requests from requests_cache.core import CachedSession import yaml FR_BASE = "https:...
sunlightlabs/foia-data
new/new-more/foia-master/contacts/keywords_from_fr.py
Python
gpl-3.0
7,540
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Wed Jan 4 11:23:34 2017 @author: shiweisun """ from .datafile import NC class OUT(NC): def __init__(self,fpath): super(OUT,self).__init__(fpath) pass def getvar(self,vrbl,ztype=None,zlevels=None): ''' Get the va...
weinihou/pyWRFPost
getvar/main.py
Python
gpl-3.0
744
#!/usr/bin/env python '''Pixbufs A GdkPixbuf represents an image, normally in RGB or RGBA format. Pixbufs are normally used to load files from disk and perform image scaling. This demo is not all that educational, but looks cool. It was written by Extreme Pixbuf Hacker Federico Mena Quintero. It also shows off how to ...
chriskmanx/qmole
QMOLEDEV/pygtk-2.16.0/examples/pygtk-demo/demos/pixbufs.py
Python
gpl-3.0
6,410
# -*- coding: utf-8 -*- """ Code relating to controlling 200^2, BiStim^2, and Rapid^2 Magstim TMS units @author: Nicolas McNair """ from __future__ import division import serial from sys import version_info, platform from os.path import realpath, join, dirname from os import getcwd from math import floor from time imp...
nicolasmcnair/magpy
magpy/magstim.py
Python
gpl-3.0
69,520
#Multiples of 3 and 5 #Problem 1 # #If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. #Find the sum of all the multiples of 3 or 5 below 1000. sum = 0 for i in range(1,1000): if i%3 == 0 or i%5 == 0: sum += i print sum ...
paulmcquad/projecteuler
0-100/problem1.py
Python
gpl-3.0
321
# -*- coding: utf-8 -*- """ @file route.py @author Michael Behrisch @author Lena Kalleske @date 2008-10-09 @version $Id: route.py 13811 2013-05-01 20:31:43Z behrisch $ Python implementation of the TraCI interface. SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ Copyright (C) 2008-2013 DLR...
rudhir-upretee/Sumo17_With_Netsim
tools/traci/route.py
Python
gpl-3.0
2,735
# -*- coding: utf-8 -*- from docpool.config.utils import CHILDREN from docpool.config.utils import createPloneObjects from docpool.config.utils import ID from docpool.config.utils import TITLE from docpool.config.utils import TYPE from plone.app.dexterity.behaviors.exclfromnav import IExcludeFromNavigation from Produc...
OpenBfS/dokpool-plone
Plone/src/docpool.config/docpool/config/general/base.py
Python
gpl-3.0
6,876
# the following line needed for unicode character in convert_anglestring # -*- coding: latin-1 -*- import ast import constants as c import copy import datetime import dateutil import logging import math import meteorologicalfunctions as mf import netCDF4 import numpy import os import platform import pytz import sys imp...
OzFlux/OzFluxQC
scripts/qcutils.py
Python
gpl-3.0
82,118
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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...
priyaganti/rockstor-core
src/rockstor/storageadmin/views/pool_scrub.py
Python
gpl-3.0
3,837
from django.contrib.syndication.views import Feed from django.shortcuts import get_object_or_404 from orb.models import Resource, Tag class LatestTagEntries(Feed): description_template = 'feeds/resource.html' link = "/" def get_object(self, request, tag_slug): return get_object_or_404(Tag, slug=t...
mPowering/django-orb
orb/feeds.py
Python
gpl-3.0
1,207
#!/usr/bin/env python # By Robin Lennox - twitter.com/robberbear from lib.Layout import colour from pexpect import pxssh from scapy.all import IP, TCP, sr1 import subprocess import time import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Import Colour Scheme G, Y, B, R, W = colour() def ope...
robinlennox/breakout
lib/SetupTunnel.py
Python
gpl-3.0
3,373
import Globals class Food: def __init__(self, game_globals: Globals.PYG_snake_Globals): self.game_globals = game_globals self.fruits = [self.game_globals.random_point() for _ in range(self.game_globals.fruit_number)] def add_fruit(self, occupied): pos = False occupied += self.fr...
wrec/CursedSnake
pygame/Food.py
Python
gpl-3.0
724
import textwrap import re # from textwrap _whitespace_only_re = re.compile('^[ \t*#/]+$', re.MULTILINE) _leading_whitespace_re = re.compile('(^[ \t*#/]*)(?:[^ \t\n])', re.MULTILINE) def common_indent(text): # This is mostly taken from textwrap.dedent # Look for the longest leading string of spaces and tab...
sam-roth/Keypad
keypad/util/wrap.py
Python
gpl-3.0
3,066
############################################################################## ## ## ## This file is part of ModelBlocks. Copyright 2009, ModelBlocks developers. ## ## ## #...
modelblocks/modelblocks-release
resource-gcg/scripts/discgraphs2discexprs.py
Python
gpl-3.0
27,849
from interspike_interval import * from numpy import * from matplotlib.pyplot import * from numpy.random import randint from matplotlib import rcParams from scipy.io import savemat, loadmat from switch import * import UnrecognizedFormatError class ISIpy(object): #Constructor begins ---------------------------------...
mac389/brainpy
lib/analysis/ISI/ISIpy.py
Python
gpl-3.0
5,276
from invoke import task, call from .docker import setup, manage @task( pre=[setup], post=[call(manage, command='create_example_data')] ) def quickstart(ctx): print('RadioCo should be running') print('Generating some data...') @task def commit_changes(ctx): # Add files ctx.run('git add .') ...
txenoo/django-radio
tasks/radioco.py
Python
gpl-3.0
701
""" Simple Tests for Support Generation """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals __author__ = "Han Altae-Tran and Bharath Ramsundar" __copyright__ = "Copyright 2016, Stanford University" __license__ = "GPL" import numpy as np import unittest im...
bowenliu16/deepchem
deepchem/data/tests/test_support_generator.py
Python
gpl-3.0
12,947
from django import forms from django.contrib.auth.forms import AuthenticationForm class RegistrationForm(forms.Form): username = forms.CharField() password = forms.CharField(widget=forms.PasswordInput()) confirm_password = forms.CharField(widget=forms.PasswordInput()) class LoginForm(AuthenticationForm): username...
imranariffin/taskmanager
accounts/forms.py
Python
gpl-3.0
398
''' Created on 2015-5-1 @author: cheneave ''' import json from subprocess import PIPE, Popen import sys class ShellMiddleware(object): ''' classdocs ''' def __init__(self, app, password, url_path="webshell"): ''' Constructor app indicates the application that should be call...
cheneave/wsgishell
wsgishell/shell_middleware.py
Python
gpl-3.0
2,112
from sqlalchemy import Column, Integer, String, DateTime, Sequence from sqlalchemy.ext.declarative import declarative_base from datetime import datetime from locale import setlocale, LC_TIME from sqlalchemy.sql import func Base = declarative_base() class LatestTopic(Base): __tablename__ = 'scr_latesttopics' ...
stackingfunctions/scrapeforum
python/src/latesttopic.py
Python
gpl-3.0
2,452
import os import subprocess import threading import timeit from collections import deque from logging import critical, info, debug, exception from math import ceil from queue import Queue from time import time from .service import Service, ServiceConfig from .queuemanager import QueueManager, TimedQueueManager, Billi...
Rosiak/librenms
LibreNMS/__init__.py
Python
gpl-3.0
12,436
from fGame import Game from fV2 import V2 import pygame class Game1(Game): angle = 0 pos = V2.One() * 150 def load_content(self): self.car = pygame.image.load('images\schnitzelimage.png').convert_alpha() def update(self, events): #self.pos+=4 self.angle+=1 ro...
gitlitz/pygame-with-interpreter
3/fGame1.py
Python
gpl-3.0
610
# This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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, ...
rembo10/headphones
lib/beets/util/__init__.py
Python
gpl-3.0
36,926
# # viscosity.py # This file is part of ISOFT. # # Copyright 2018 Chris MacMackin <cmacmackin@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 Licen...
cmacmackin/isoft
plotting/viscosity.py
Python
gpl-3.0
2,204
""" GCode M907 Set stepper current in A Author: quillford License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from __future__ import absolute_import from .GCodeCommand import GCodeCommand class M907(GCodeCommand): def execute(self, g): self.printer.path_planner.wait_until_done() for i i...
intelligent-agent/redeem
redeem/gcodes/M907.py
Python
gpl-3.0
596
# # Copyright 2015-2016 Free Software Foundation, Inc. # # This file is part of PyBOMBS # # PyBOMBS 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, or (at your option) # any later version. # ...
gnuradio/pybombs
pybombs/packagers/extern.py
Python
gpl-3.0
8,711
from __future__ import unicode_literals from .exceptions import MultipleObjectsReturned, YouTubeError from .models import Video from .utils import safe_filename from urllib import urlencode from urllib2 import urlopen from urlparse import urlparse, parse_qs, unquote import re YT_BASE_URL = 'http://www.youtube.com/ge...
dandygithub/kodi
addons/plugin.video.online-life.cc/lib/pytube/api.py
Python
gpl-3.0
9,210