code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
# Sort of an experiment in thread programming. This script locates all # ASCEND files in the ASCENDLIBRARY path, then for any that contain 'self_test' # methods, it loads them and solves them and runs the self test. It's not # very good at checking the results just yet: probably there needs to be a # 'TestReporter' hoo...
georgyberdyshev/ascend
pygtk/selftest.py
Python
gpl-2.0
7,384
#! /usr/bin/env python from PyFoam.Applications.ChangePython import changePython changePython("pvpython","PVSnapshot")
Unofficial-Extend-Project-Mirror/openfoam-extend-Breeder-other-scripting-PyFoam
bin/pyFoamPVSnapshot.py
Python
gpl-2.0
121
from django.contrib.gis.db import models class SatYear(models.Model): year = models.IntegerField(primary_key=True) def __unicode__(self): return str(self.year) class Meta: verbose_name = 'Year' db_table = u'sat_year' class Satellite(models.Model): # id = model...
qliu/globe_nocturne
globenocturne/globenocturneapp/models.py
Python
gpl-2.0
10,974
from rest_framework.permissions import BasePermission, SAFE_METHODS ADMIN_METHODS = ('PUT', 'DELETE') class AuthenticatedAddAdminEditOrReadOnly(BasePermission): """ Users can add, admins can edit, or is a read-only request. """ def has_permission(self, request, view): if request.method in ADMIN_...
FMF-studenti/backend
fmf/common/permissions.py
Python
gpl-2.0
543
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Plugins.Plugin import PluginDescriptor from Components.Label import Label from Components.ActionMap import ActionMap from Components.NimManager import nimmanager from Components.MenuList import MenuList from Components.config import config...
kajgan/stbgui
lib/python/Plugins/SystemPlugins/CableScan/plugin.py
Python
gpl-2.0
11,601
from datetime import datetime from hashlib import sha1 from xml.sax.saxutils import escape as xml_escape from .common import CHARSET def xml_template(template, data): """ return template % data but with proper escaping """ escaped_data = {} for key, value in data.items(): escaped_data[key] ...
hoffie/gnucash-ofx-export
gce/ofx.py
Python
gpl-2.0
3,118
from lib.font import * import sys import fcntl import termios import struct class progress_bar(object): def __init__(self, tot=100, lenght=10): self.cp='/-\|' self.bar_lenght = lenght self.tot = tot def startprogress(self, title): """Creates a progress bar 40 chars long on the console and moves cursor ba...
luca-heltai/ePICURE
applications/lib/progress_bar.py
Python
gpl-2.0
1,682
# # Allows GTK 3 python applications to exit when CTRL-C is raised # From https://bugzilla.gnome.org/show_bug.cgi?id=622084 # # Author: Simon Feltman # License: Presume same as pygobject # import sys import signal from typing import ClassVar, List from gi.repository import GLib class InterruptibleLoopContext: ...
exaile/exaile
xl/externals/sigint.py
Python
gpl-2.0
2,472
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'AuthoredData.yielded' db.add_column(u'dingos_authoring_authoreddata', 'yielded', ...
siemens/django-dingos-authoring
dingos_authoring/south_migrations/0007_auto__add_field_authoreddata_yielded.py
Python
gpl-2.0
17,052
#! /usr/bin/env python ''' vcq12.py: 12TET quantizer for V/oct control voltages Copyright (c) 2020 Bill Gribble <grib@billgribble.com> ''' from ..processor import Processor from ..mfp_app import MFPApp from ..bang import Uninit from mfp import log class VCQ12(Processor): doc_tooltip_obj = "Quantize to 12TET se...
bgribble/mfp
mfp/builtins/vcq12.py
Python
gpl-2.0
1,819
#nazwa komendy sluzacej do ponownego polaczenia aero #reconnect = "reconnects\\android-flightmode\\adb shell < reconnects\\android-flightmode\\reconnect.adb" reconnect = "reconnects\\windows-rasdial\\rasdial.bat" #czas co jaki ma byc sprawdzane czy jest juz captcha (sekundy) sleeptime = 3 #odleglosc okna captchy od dol...
JuniorJPDJ/aerogui
aerogui_config.py
Python
gpl-2.0
416
# -*- coding: utf-8 -*- # # talk_time.py # # Copyright 2017 Cimbali <me@cimba.li> # # 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,...
Cimbali/pympress
pympress/talk_time.py
Python
gpl-2.0
10,340
#Script to use if you are not launching the tweet from another script import sys import send_tweet if len(sys.argv) == 8: send_tweet.send_tweet(sys.argv[3])
cmaxwe/SabnzbdSendTweet
send_standalone_tweet.py
Python
gpl-2.0
160
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0001_squashed_0016_change_page_url_path_to_text_field'), ('lessonplan', '0002_auto_2...
warmersun/lessonplan2
warmersun_lessonplans_site/lessonplan/migrations/0003_homepage.py
Python
gpl-2.0
816
from lipd.lipd_io import lipd_read, lipd_write from lipd.timeseries import extract, collapse, mode_ts, translate_expression, get_matches from lipd.doi_main import doi_main from lipd.csvs import get_csv_from_metadata from lipd.excel import excel_main from lipd.noaa import noaa_prompt, noaa_to_lpd, lpd_to_noaa, noaa_prom...
nickmckay/LiPD-utilities
Python/lipd/__init__.py
Python
gpl-2.0
38,558
# -*- coding: utf-8 -*- from urlparse import urlparse import pytest from fixtures.pytest_store import store from cfme.utils.appliance import IPAppliance, DummyAppliance def test_ipappliance_from_address(): address = '1.2.3.4' ip_a = IPAppliance(address) assert ip_a.address == address assert ip_a.url ...
okolisny/integration_tests
cfme/utils/tests/test_ipappliance.py
Python
gpl-2.0
1,553
import gtk, pygtk import os import sys pygtk.require('2.0') #------------------------------------------------------------------------------- class Clipboard(object): def __init__(self): object.__init__(self) self.clipboard = gtk.clipboard_get() #-----------------------------------------------...
kralf/morsel
python/lib/morsel/console/clipboard.py
Python
gpl-2.0
559
def scoring(a, b, n, m, x): i, j, sumNum = 0, 0, 0 while i < n and (sumNum+a[i]) <= x: sumNum += a[i] i += 1 ans = i while j < m and i >= 0: sumNum += b[j] j += 1 while sumNum > x and i > 0: i -= 1 sumNum -= a[i] if sumNum <= x and ...
nickedes/Ni-Algos
Practice/Hr/Data Structures/Stack/Game of two stacks.py
Python
gpl-2.0
567
#!/usr/bin/python2.5 import sys import time import os import nuke def launchSubmit(): print("nukeStub(): launch submitter dialog") submitCmd = "/drd/software/int/bin/launcher.sh -p %s -d %s --launchBlocking farm -o EPA_CMDLINE python2.5 --arg '$ABSUBMIT/nukesubmit/nuke2AB.py'" % (os.environ['DRD_JOB'], os.environ[...
kurikaesu/arsenalsuite
cpp/apps/absubmit/nukesubmit/nukeStub.py
Python
gpl-2.0
877
from django.template.loader import render_to_string from oioioi.base.permissions import make_request_condition from oioioi.programs.controllers import ProgrammingContestController def render_head(requirements): """For a given list of paths for required files produces a HTML which includes the paths. The ou...
papedaniel/oioioi
oioioi/statistics/utils.py
Python
gpl-3.0
1,402
import re def to_integer(s): if re.match(r'\A[+-]?((0b[01]+)|(0o[0-7]+)|(0x[\da-fA-F]+)|\d+)\Z', s): sign = 1 if s[0] in '-+': sign = int(s[0] + '1') s = s[1:] base = {'0b': 2, '0o': 8, '0x': 16}.get(s[:2], 10) return sign * int(s, base) return None
VladKha/CodeWars
6 kyu/Regexp basics - parsing integers/solve.py
Python
gpl-3.0
316
from plugin import Projections import pca class Pca(Projections): name = "Pca" def Main(self,model): self.model = model pca_data = pca.pca(self.model.GetCurrentData()[:]) fields = ['Comp%02d' % c for c in range(1, pca_data.shape[1]+1)] self.model.updateHDF('PCA', pca_data, field...
cliburn/flow
src/plugins/projections/Princomp/Main.py
Python
gpl-3.0
631
from .owlpropertyrange import OWLPropertyRange from .swrlpredicate import SWRLPredicate class OWLClassExpression(OWLPropertyRange, SWRLPredicate): """TODO: implement"""
patrickwestphal/owlapy
owlapy/model/owlclassexpression.py
Python
gpl-3.0
174
# -*- coding: utf-8 -*- import urllib import logger from resources.lib.gui.gui import cGui from resources.lib.gui.guiElement import cGuiElement from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.parser import cParser from resources.lib.util import cUtil from resources.lib.config import ...
dbiesecke/plugin.video.xstream
sites/kinox_to.py
Python
gpl-3.0
34,288
from flask import Flask, request, make_response import requests import logging logger = logging.getLogger(__name__) app = Flask(__name__) app.debug = True jenkins_url = 'http://localhost:8000' def prepare_response(response): _headers = {} for h in ['content-type', 'x-jenkins-session', 'x-jenkins', 'server...
kampfschlaefer/jenkins_api_simulator
jenkins_api_simulator/passthrough.py
Python
gpl-3.0
3,301
# YouTube Video: https://www.youtube.com/watch?v=wlnx-7cm4Gg from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import twitter_credentials # # # # TWITTER STREAMER # # # # class TwitterStreamer(): """ Class for streaming and processing live tweets. """ ...
vprusso/youtube_tutorials
twitter_python/part_1_streaming_tweets/tweepy_streamer.py
Python
gpl-3.0
1,932
# # Copyright (C) 2013 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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 hope...
hmpf/nav
python/nav/web/crispyforms.py
Python
gpl-3.0
1,764
#! /usr/bin/python3 import os import gi gi.require_version('Budgie', '1.0') gi.require_version('Wnck', '3.0') gi.require_version('Gtk', '3.0') from gi.repository import Budgie, GObject, Gtk, Wnck, Gio, GLib import time import ast """ Budgie Workspace Timer Author: Jacob Vlijm Copyright © 2017-2022 Ubuntu Budgie Devel...
UbuntuBudgie/budgie-extras
budgie-workspace-stopwatch/budgie-workspacestopwatch.py
Python
gpl-3.0
9,172
""" Lateral distribution functions that can be used for simulating particle densities and for fitting to data. Example usage:: >>> import tables >>> from sapphire import NkgLdfSimulation, ScienceParkCluster >>> data = tables.open_file('/tmp/test_ldf_simulation.h5', 'w') >>> cluster = ScienceParkClus...
HiSPARC/sapphire
sapphire/simulations/ldf.py
Python
gpl-3.0
16,510
""" Define command names and prove command/code mappings """ from collections import ChainMap __all__ = [ 'nibble_commands', 'byte_commands', 'sysex_commands', 'command_lookup', 'command_names', ] INPUT, OUTPUT, ANALOG, \ PWM, SERVO, I2C, ONEWIRE, \ STEPPER, ENCODER = range(0, 9) # do not combine...
bitcraft/firmata_aio
firmata_aio/protocol/commands.py
Python
gpl-3.0
1,998
# -*- coding: utf-8 -*- import re from module.plugins.Crypter import Crypter class LixIn(Crypter): __name__ = "LixIn" __type__ = "crypter" __version__ = "0.22" __pattern__ = r'http://(?:www\.)?lix\.in/(?P<ID>.+)' __config__ = [("use_subfolder", "bool", "Save package to subfolder", True),...
sebdelsol/pyload
module/plugins/crypter/LixIn.py
Python
gpl-3.0
2,104
# vim: ts=4:sw=4:expandtab # BleachBit # Copyright (C) 2014 Andrew Ziem # http://bleachbit.sourceforge.net # # 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 ...
maximilianofaccone/puppy-siberian
usr/share/bleachbit/CleanerML.py
Python
gpl-3.0
8,532
class MyException(Exception): def __init__(self, msg): self.message = msg def __str__(self): return self.message try: raise MyException("Janice自定义的异常") except MyException as e: print(e)
jcchoiling/learningPython
s13/Day08/practice/s16.py
Python
gpl-3.0
237
tf.reset_default_graph() # input x_len = 6 x = tf.constant([7, 0, 42, 1, 13, 4]) def cond(i, acc, y): return i < x_len def body(i, acc, y): acc += x[i] y = tf.concat([y, tf.expand_dims(acc, axis=0)], axis=0) # y.shape = (?,) i += 1 return i, acc, y # initial value for y y_init = tf.zeros(sha...
KristianHolsheimer/tensorflow_training
sol/ex_while_loop_cumsum.py
Python
gpl-3.0
755
#!./bin/python """ Shows interesting activity from followed users of Github """ from __future__ import print_function from github import Github from datetime import datetime, timedelta from argparse import ArgumentParser from config import GITHUB_USERNAME, GITHUB_PASS def repo_title(repo): return "{} ({}/{})".fo...
tiberiuichim/minitools
get_git_social_log.py
Python
gpl-3.0
1,890
#!/usr/bin/env python3 # # extract and fix frames from buggy apng animation # # https://github.com/eight04/pyAPNG import apng from struct import pack, unpack # patch the buggy picture sizes def fix(w, h, i): if w == 1280: w, h = 180, 75 if w > 200: w //= 10 if h > 100: h //= 10 ...
tothi/ctfs
asis-finals-ctf-2016/p1ng/xtract_frames.py
Python
gpl-3.0
707
"""Integration tests for client-server interaction.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from multiprocessing import Process import os import shutil import tempfile import time import unittest from filetracker.client import Client, Filetracke...
sio2project/filetracker
filetracker/tests/interaction_test.py
Python
gpl-3.0
7,181
# Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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 ...
pburdet/hyperspy
hyperspy/tests/signal/test_kramers_kronig_transform.py
Python
gpl-3.0
6,051
import unittest import os from crawler import Crawler domain = "http://www.legittorrents.info/" URL = "http://www.legittorrents.info/index.php?page=torrents&search=&category=1&active=1" line = '<td align="center" width="20" class="lista" style="text-align: center;"><a href="download.php?id=0819ccee9ebe25d7a02fe14496d5...
gabrielgmendonca/torrentcrawler
test.py
Python
gpl-3.0
1,757
lines = int(input("How many lines of text? ")) lineText = input("What is the line of text? ") for i in range(lines): print(lineText)
ZachOhara/OCSTA-Programming-Contest-2015
python/TestPrintLines.py
Python
gpl-3.0
134
from cavicapture import CaviCapture from process import CaviProcess import sys, os, getopt import time, datetime import numpy as np import matplotlib.pyplot as plt def main(): config_path = './config.ini' # default try: opts, args = getopt.getopt(sys.argv[1:], "c", ["config="]) except getopt.GetoptError: ...
OpenSourceOV/cavicapture
calibrate.py
Python
gpl-3.0
3,982
""" Document class definition """ class Document(object): """Represents a document""" def __init__(self, id, name, type, path): if '\n' in name: raise ValueError('The document name cannot contain newline character!') if '\n' in type: raise ValueError('The document type...
piller-imre/grimoire-tk
grimoire/document.py
Python
gpl-3.0
806
# shtub - shell command stub # Copyright (C) 2012-2013 Immobilien Scout GmbH # # 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) ...
yadt/shtub
src/main/python/shtub/stubconfiguration.py
Python
gpl-3.0
5,492
# -*- coding: utf-8 -*- """Database connection class.""" import psycopg2 class db(object): """A database connection class """ def __init__(self, dbname, host, port, user, password): self.dbname = dbname self.host = host self.port = port self.user = user self.password...
balazsdukai/batch3dfier
batch3dfier/db.py
Python
gpl-3.0
2,117
from threading import Lock from gobject import GObject, SIGNAL_RUN_FIRST, TYPE_NONE from Log import log try: import pygst pygst.require('0.10') import gst except ImportError, e: log.error("Unable to import gstreamer. All sound will be mute.\n%s" % e) class Player (GObject): __gsignals__ = ...
btrent/knave
pychess/System/gstreamer.py
Python
gpl-3.0
1,803
import numpy as np import logging from logging.handlers import RotatingFileHandler from time import strftime, gmtime import json import sys import os import traceback __version__ = '2.7.5' # Setup Logger logging.basicConfig(level=logging.DEBUG) logging.getLogger('PyQt5').setLevel(logging.WARNING) root_logger = loggi...
OceanOptics/Inlinino
inlinino/__init__.py
Python
gpl-3.0
3,760
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'QuestionReport' db.create_table(u'survey_questionreport', ( (u'question_ptr', se...
point97/hapifis
server/apps/survey/migrations/0036_auto__add_questionreport__del_field_question_filterBy__del_field_quest.py
Python
gpl-3.0
7,859
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): depends_on = ( ("django_facebook", "0001_initial"), ) def forwards(self, orm): # Adding ...
AriMeidan/Fantasy-Knesset
votes/migrations/0001_initial.py
Python
gpl-3.0
10,925
# COPYRIGHT (c) 2016-2018 Nova Labs SRL # # All rights reserved. All use of this software and documentation is # subject to the License Agreement located in the file LICENSE. from .Core import * from .ModuleTarget import * from .ParametersTarget import * from abc import abstractmethod class CoreWorkspaceBase: de...
novalabs/core-tools
novalabs/core/CoreWorkspace.py
Python
gpl-3.0
16,247
from multiprocessing import RLock from sys import path from mako.lookup import TemplateLookup from scullery import iceflow,workers import os import time import threading import logging import weakref import traceback import shutil import re import io import random logger = logging.Logger("plugins.nvr") templateGetter...
EternityForest/KaithemAutomation
kaithem/src/thirdparty/iot_devices/devices/NVRPlugin/__init__.py
Python
gpl-3.0
46,929
# coding: utf-8 # # Copyright © 2012-2015 Ejwa Software. All rights reserved. # # This file is part of gitinspector. # # gitinspector 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 Lic...
eklochkov/gitinspector
gitinspector/extensions.py
Python
gpl-3.0
1,635
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-02-16 13:08 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tmv_app', '0080_auto_20180214_1234'), ] operations = [ migrations.AddField(...
mcallaghan/tmv
BasicBrowser/tmv_app/migrations/0081_auto_20180216_1308.py
Python
gpl-3.0
767
""" Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k. Example: Given matrix = [ [1, 0, 1], [0, -2, 3] ] k = 2 The answer is 2. Because the sum of rectangle [[0, 1], [-2, 3]] is 2 and 2 is the max number no larger than k (k = 2...
dichen001/Go4Jobs
JackChen/queue/363. Max Sum of Rectangle No Larger Than K.py
Python
gpl-3.0
1,362
# (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callback: debug type: stdout short_description: formated stdout/stderr display...
manuBocquet/ansible-report
callbackplugin/ansible-report.py
Python
gpl-3.0
5,751
# Copyright (C) 2017,2019, Yu Sheng Lin, johnjohnlys@media.ee.ntu.edu.tw # This file is part of Nicotb. # Nicotb 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...
johnjohnlin/nicotb
lib/event.py
Python
gpl-3.0
1,550
#!/usr/bin/env python # -*- coding: utf8 -*- #~####################################################################### #~ Copyright (c) 2008 Burdakov Daniel <kreved@kreved.org> # #~ # #~ This file is part of FreQ-bot. ...
TLemur/freq-bot
src/plugins/help/help_handler.py
Python
gpl-3.0
2,586
import StkPortInterfaces.StkDATControlIf import PortInterface.ProvidedPort import re import StkParser.StkPortCriteria import Components.IComponent import Parser.IPortCriteria class StkCHeaderProvDATControlCriteria(StkParser.StkPortCriteria.StkPortCriteria): """STK C Header file provided DATControl criteria""" ...
dmanev/ArchExtractor
ArchExtractor/umlgen/Specific/STK/StkParser/StkCFileCriteria/StkCHeaderProvDATControlCriteria.py
Python
gpl-3.0
1,064
''' Copyright (C) 2015 Andreas Esau andreasesau@gmail.com Created by Andreas Esau 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)...
ndee85/coa_tools
Blender/coa_tools/operators/edit_shapekey.py
Python
gpl-3.0
11,020
from PyQt5 import QtWidgets from projManagement.Validation import Validation from configuration.Appconfig import Appconfig import os # This class is called when user creates new Project class convertSub(QtWidgets.QWidget): """ Contains functions that checks project present for conversion and also function...
FOSSEE/eSim
src/subcircuit/convertSub.py
Python
gpl-3.0
2,427
from decimal import Decimal from collections import deque import gc from uuid import uuid4 from operator import itemgetter import json from twisted.internet import reactor from twisted.internet.task import deferLater from twisted.python import log from txplaya.library import Library from txplaya.lastfm import getScro...
petrushev/txplaya
txplaya/player.py
Python
gpl-3.0
13,214
#!/usr/bin/env python # # An example on how to read the YAML output from etisnoop # Pipe etisnoop to this script # # License: public domain import sys import yaml for frame in yaml.load_all(sys.stdin): print("FIGs in frame {}".format(frame['Frame'])) for fib in frame['LIDATA']['FIC']: if fib['FIGs']: ...
Opendigitalradio/etisnoop
yamlexample.py
Python
gpl-3.0
401
import logging from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _, ungettext from mss.lib.xmlrpc import XmlRpc xmlrpc = XmlRpc() logger = logging.getLogger(__name__) class Steps: PREINST = "preinst" DOWNLOAD = "download" MEDIAS_AUTH = "medias_auth" MEDIA...
pulse-project/mss
mss/www/wizard/transaction.py
Python
gpl-3.0
7,120
from django.contrib import admin from .models import Article # Register your models here. class ArticleModelAdmin(admin.ModelAdmin): class Meta: model = Article list_display = ['name', 'timestamp', 'updated_time','category'] list_display_links = ['name'] search_fields = ['name', 'article'] ...
oluwex/Akede
Articles/admin.py
Python
gpl-3.0
424
#! /usr/bin/env python # This file is part of IVRE. # Copyright 2011 - 2021 Pierre LALET <pierre@droids-corp.org> # # IVRE 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 #...
cea-sec/ivre
ivre/tools/db2view.py
Python
gpl-3.0
3,806
'''Tutorial to demonstrate theia.''' import numpy as np from theia.running import simulation as sim from theia.optics import beam as gbeam from theia.optics import mirror as mir from theia.helpers import settings from theia.helpers.units import * # initialize globals (necessary to use theia in library form) dic = {'i...
bandang0/theia
tutos/telescope.py
Python
gpl-3.0
1,642
# Generated by Django 2.1.3 on 2018-11-09 18:28 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('proposals', '0016_auto_20180405_2116'), ] operations = [ migrations.AlterField( model_name='timeallocation', name='i...
LCOGT/valhalla
valhalla/proposals/migrations/0017_auto_20181109_1828.py
Python
gpl-3.0
1,094
# coding: utf8 # lingoesparse.py # 1/15/2013 jichi # # LD2 and LDX # http://code.google.com/p/lingoes-extractor/source/browse/trunk/src/cn/kk/extractor/lingoes/LingoesLd2Extractor.java # https://code.google.com/p/dict4cn/source/browse/trunk/importer/src/LingoesLd2Reader.java # http://devchina.wordpress.com/2012/03/01/l...
Dangetsu/vnr
Frameworks/Sakura/py/libs/lingoes/lingoesparse.py
Python
gpl-3.0
6,775
import traceback from flask import ( Blueprint, current_app, jsonify, render_template, ) bp = Blueprint('patilloid', __name__) @bp.route('/', methods=('GET',)) def index(): try: current_app.logger.info("Let's show them Patilloid!") return render_template('patilloid.html') exc...
patillacode/patilloid
app/patilloid.py
Python
gpl-3.0
565
# Copyright: (c) 2019, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.module_utils.six import string_types from ansible.playbook.attribute import FieldAttr...
tonk/ansible
lib/ansible/playbook/collectionsearch.py
Python
gpl-3.0
2,597
import argparse import os import sys import gym import config import copy import time import numpy as np import subprocess import config parser = argparse.ArgumentParser(description="Run commands") def new_tmux_cmd(session, name, cmd): if isinstance(cmd, (list, tuple)): cmd = " ".join(str(v) for v in cmd)...
YuhangSong2017/test_4
train.py
Python
gpl-3.0
6,963
# codegen.py # Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """provides functionality for rendering a parsetree constructing into module source code."""...
codendev/rapidwsgi
src/mako/codegen.py
Python
gpl-3.0
39,495
import src import random class Bomb(src.items.Item): """ ingame item to kill things and destroy stuff """ type = "Bomb" name = "bomb" description = "designed to explode" usageInfo = """ The explosion will damage/destroy everything on the current tile or the container. Activate it to trig...
MarxMustermann/OfMiceAndMechs
src/itemFolder/military/bomb.py
Python
gpl-3.0
1,990
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-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
qutebrowser/utils/usertypes.py
Python
gpl-3.0
16,178
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script to convert an ICCD TRC file to CSV format. The input file is assumed to be UTF-8 with UNIX line ending. """ # # (C) Federico Leva, 2016 # # Distributed under the terms of the MIT license. # __version__ = '0.1.0' import codecs import unicodecsv as csv from collectio...
nemobis/bots
iccd-trc2csv.py
Python
gpl-3.0
4,621
from DIRAC.WorkloadManagementSystem.Client.SandboxStoreClient import SandboxStoreClient from WebAppDIRAC.Lib.WebHandler import WebHandler, WErr, WOK, asyncGen from DIRAC.Core.DISET.RPCClient import RPCClient from DIRAC import gConfig, S_OK, S_ERROR, gLogger from DIRAC.Core.Utilities import Time from WebAppDIRAC.WebApp...
atsareg/WebAppDIRAC
WebApp/handler/JobMonitorHandler.py
Python
gpl-3.0
22,096
import numpy as np import matplotlib.pyplot as plt x = np.arange(4) y = x t = [1.0,0.9,0.95,1.05] s = np.array([1.0,0.9,0.95,1.05])*100 plt.scatter(x, y, c=t, s=s, alpha = 0.5) plt.colorbar() plt.show()
jmmauricio/pypstools
dev/colormaps.py
Python
gpl-3.0
214
""" Stack - Reverse Substrings Between Each Pair of Parentheses (medium) You are given a string `s` that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting from the innermost one. Your result should not contain any brackets. Example 3: Input: s ...
dreamibor/Algorithms-and-Data-Structures-Using-Python
practice/implementation/stack_and_queue/reverse_substrings_between_each_pair_of_parentheses.py
Python
gpl-3.0
1,483
#!/usr/bin/python # -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: x6hr.py # Purpose: log reader of SUUNTO H6HR # Author: tomoya kamata (iware pref. japan) # Created: 15 Mar 2010 # Copyright: GPL. please read COPYING file # ma...
lycopersin/x6hr-python
x6hr.py
Python
gpl-3.0
17,896
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # exceptions.py """PyPhi exceptions.""" class StateUnreachableError(ValueError): """The current state cannot be reached from any previous state.""" def __init__(self, state): self.state = state msg = "The state {} cannot be reached in the given ...
wmayner/pyphi
pyphi/exceptions.py
Python
gpl-3.0
653
import numpy as np ### Digitised data for HL-1 i_Kr channel. # I-V curves. def IV_Toyoda(): """Data points in IV curve for i_Kr. Data from Figure 1E from Toyoda 2010. Reported as mean \pm SEM from 10 cells. """ x = [-80, -70, -60, -50, -40, -30, -20, -10, 0, 10, 20, 30, 40] y = np.asarray([0...
c22n/ion-channel-ABC
docs/examples/hl1/data/ikr/data_ikr.py
Python
gpl-3.0
6,863
#!/usr/bin/env python import os, signal, unittest from fn_helper import strarray_setup, compare_output, get_lineno class TestSigHandler(unittest.TestCase): def test_handle(self): # FIXME! self.assertTrue(True) return # See that we handle a USR1 signal with a 'stop' action ...
rocky/python2-trepan
test/functional/test-sig.py
Python
gpl-3.0
2,976
# -*- coding: utf-8 -*- # leapbackend.py # Copyright (C) 2013 LEAP # # 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. # #...
meskio/bitmask_client
src/leap/bitmask/backend/leapbackend.py
Python
gpl-3.0
20,848
import os import sys import glob try: import numpy except ImportError: print "You need to have numpy installed on your system to run setup.py. Sorry!" sys.exit() try: from Cython.Distutils import build_ext except ImportError: print "You need to have Cython installed on your system to run setup.py....
caglar10ur/anvio
setup.py
Python
gpl-3.0
2,549
# Copyright (C) 2012-2015 ASTRON (Netherlands Institute for Radio Astronomy) # P.O. Box 2, 7990 AA Dwingeloo, The Netherlands # # This file is part of the LOFAR software suite. # The LOFAR software suite is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as p...
kernsuite-debian/lofar
SAS/ResourceAssignment/ResourceAssignmentEditor/config/default.py
Python
gpl-3.0
967
import os import re from urlparse import urlparse import sys main_dir = sys.argv[1] output_dir = os.path.join(sys.argv[1],'OpenWPM/analysis_redirect/output/') urls_file = open(os.path.join(output_dir, 'urls')) queries_file = open(os.path.join(output_dir, 'queries'),'a') no_redirects_file = open(os.path.join(output_di...
natasasdj/OpenWPM
analysis_redirect/02_queries.py
Python
gpl-3.0
1,378
import multiprocessing from setuptools import setup, find_packages from ber_kit import __version__ setup(name='ber-kit', version= __version__, description='Toolkit to manage rolling upgrades on a Marathon cluster', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Deve...
chuckwired/ber-kit
setup.py
Python
gpl-3.0
1,036
# # Copyright (C) 2013 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV 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 hope...
hmpf/nav
python/nav/web/messages/urls.py
Python
gpl-3.0
1,573
#!/usr/bin/kivy # Critical Injury Module # By Sean Wallitsch, 2013/08/20 # Built in Modules from random import randint from time import strftime # For timestamping history log # Kivy Modules from kivy.app import App # Base App Class from kivy.adapters.listadapter import ListAdapter # For History list from kivy.uix....
shidarin/AT-DiceRoller
modules/criticalInjuries.py
Python
gpl-3.0
29,380
#!/usr/bin/env python # Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import sys import numpy import random import numpy from gnuradio import gr, gr_unittest, blocks, analog, digital import pmt def shift_tuple(vec, N): ...
trabucayre/gnuradio
gr-digital/python/digital/qa_ofdm_chanest_vcvc.py
Python
gpl-3.0
13,180
# # Copyright 2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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. # #...
trnewman/VT-USRP-daughterboard-drivers_python
gnuradio-core/src/python/gnuradio/blks2impl/stream_to_vector_decimator.py
Python
gpl-3.0
2,500
from numpy import * svg_header = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="...
commonsense/divisi
csc/divisi/graphics.py
Python
gpl-3.0
4,195
""" base IPOL demo web app includes interaction and rendering """ # TODO add steps (cf amazon cart) import shutil from mako.lookup import TemplateLookup import traceback import cherrypy import os.path import math import copy import threading import time from mako.exceptions import RichTraceback from . import http fr...
kerautret/ipolDevel
ipol_demo/lib/base_app.py
Python
gpl-3.0
27,462
from django.contrib import admin from . import models # Register your models here. #admin.site.register(models.MyUser) @admin.register(models.MyUser) class MyUserAdmin(admin.ModelAdmin): list_display = ['user']
pacocampo/Backend
traveleando/project/usuario/admin.py
Python
gpl-3.0
213
""" Two pointers - Sort Colours / Dutch National Flag Problem (medium) Description: Given an array containing 0s, 1s and 2s, sort the array in-place. You should treat numbers of the array as objects, hence, we can’t count 0s, 1s, and 2s to recreate the array. The flag of the Netherlands consists of three colors: red...
dreamibor/Algorithms-and-Data-Structures-Using-Python
practice/implementation/two_pointers/sort_colors.py
Python
gpl-3.0
2,266
# from exchange import * from threaded import *
tessonec/PySPG
spg/runner/__init__.py
Python
gpl-3.0
49
# -*- coding: utf-8 -*- # # Copyright 2018 Ibai Roman # # This file is part of GPlib. # # GPlib 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 ...
ibaidev/gplib
gplib/parameters.py
Python
gpl-3.0
15,692
# ubuntuone.syncdaemon.logger - logging utilities # # Author: Guillermo Gonzalez <guillermo.gonzalez@canonical.com> # # Copyright 2010 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 Soft...
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/ubuntuone-client/ubuntuone/logger.py
Python
gpl-3.0
9,937
pet = ['dog', 'cat', 'parrot', 'squirrel', 'goldfish'] for animal in pet: print(animal, len(animal))
zamonia500/PythonTeacherMythenmetz
300문제/96.py
Python
gpl-3.0
106
# -*- coding: utf-8 -*- """Version information.""" """ Kontalk XMPP server Copyright (C) 2014 Kontalk Devteam <devteam@kontalk.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either versi...
daniele-athome/kontalk-legacy-xmppserver
kontalk/xmppserver/version.py
Python
gpl-3.0
967
from django.conf.urls import patterns, url from . import views urlpatterns = patterns('', # The password reset form view: url(r'^password_reset/$', views.PasswordResetView.as_view(), name='password_reset' ), # The password reset confirmation view: url(r'^reset/(?P<uidb64>[0-9A-Za-z...
hebronlin/churchlife
authentication/urls.py
Python
gpl-3.0
993