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
class save_and_reraise_exception(object): def __init__(self): self.reraise = True def __enter__(self): self.type_, self.value, self.tb, = sys.exc_info() return self def __exit__(self, exc_type, exc_val, exc_tb): if exc_type is not None: logging.error(_('Origin...
windskyer/mvpn
mvpn/openstack/common/excutils.py
Python
gpl-2.0
655
# functions to help building list of files needed by the various tools def get_file_list(l, context, target): """ Return a file list depending of the target, and update pathes depending of context parameter @param l: the definition for all the files/directory used by the project @type l: list of...
rbarzic/arty-cm0-designstart
common/file_list.py
Python
gpl-2.0
1,916
from django import forms class ContactForm(forms.Form): name = forms.CharField(max_length=100) email = forms.EmailField() message = forms.CharField(widget=forms.Textarea)
UTAlan/ginniBeam.net
gin/contact/models.py
Python
gpl-2.0
189
# Mustafa Hussain # Digital Image Processing with Dr. Anas Salah Eddin # FL Poly, Spring 2015 # # Homework 3: Spatial Filtering # # USAGE NOTES: # # Written in Python 2.7 # # Please ensure that the script is running as the same directory as the images # directory! import cv2 import copy #import matplotlib.pyplot as p...
hmustafamail/digitalimageprocessing
HW 3 - Spatial Filtering/spatialFiltering.py
Python
gpl-2.0
8,567
from sqlalchemy import * from migrate import * from migrate.changeset import schema pre_meta = MetaData() post_meta = MetaData() project = Table('project', post_meta, Column('id', Integer, primary_key=True, nullable=False), Column('name', String(length=255)), ) project_association = Table('project_associatio...
itJunky/web-tasker.py
db_repository/versions/026_migration.py
Python
gpl-2.0
1,017
import os from social.backends.base import BaseAuth from social.exceptions import AuthException from .sso import DiscourseSSO class DiscourseAssociation(object): """ Use Association model to save the nonce by force. """ def __init__(self, handle, secret='', issued=0, lifetime=0, assoc_type=''): self...
FMF-studenti/backend
fmf/discourse/auth/discourse.py
Python
gpl-2.0
2,814
# Copyright (c) 2019 Charles University, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2019 Tomas Machalek <tomas.machalek@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 publis...
czcorpus/kontext
lib/plugins/default_auth/scripts/usercorp.py
Python
gpl-2.0
4,023
# This file initializes the py.test environment import os import pwd import pytest import _pytest.monkeypatch import sys import glob import testlib import tempfile import shutil import errno from collections import OrderedDict # # Each test is of one of the following types. # # The tests are marked using the marker py...
huiyiqun/check_mk
tests/conftest.py
Python
gpl-2.0
7,643
import Gears as gears from .. import * from .SingleShape import * class FullfieldGradient(SingleShape) : def boot(self, *, duration : 'Stimulus time in frames (unless superseded by duration_s).' = 1, duration_s : 'Stimulus time in se...
szecsi/Gears
GearsPy/Project/Components/Stimulus/FullfieldGradient.py
Python
gpl-2.0
898
''' Non-original introduction script, added solely for the sake of familiarizing myself with Tensorflow. I, Evan Kirsch, do not claim credit whatsoever for this code. It is taken directly from https://www.tensorflow.org/ ''' import tensorflow as tf import numpy as np # Create 100 phony x, y data points in NumPy, y = ...
etkirsch/Tensorflow-Learn
introduction.py
Python
gpl-2.0
1,175
# Pluma snippets plugin # Copyright (C) 2006-2007 Jesse van den Kieboom <jesse@icecrew.nl> # Copyright (C) 2012-2021 MATE Developers # # 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...
mate-desktop/pluma
plugins/snippets/snippets/SubstitutionParser.py
Python
gpl-2.0
5,925
import wx import wx.grid import wx.lib.scrolledpanel import wx.stc import os import os.path import time import platform import multiprocessing import datetime import Bio.PDB import webbrowser from threading import Thread from tools import * class AntibodyPanel(wx.lib.scrolledpanel.ScrolledPanel): def __init__(self...
schenc3/InteractiveROSETTA
InteractiveROSETTA/scripts/antibody.py
Python
gpl-2.0
14,153
#!/usr/bin/python # -*- coding: utf-8 -*- from bottle import route, get, post, view, run, app, default_app, static_file from palpite import palpite @get('/') @view('index.html') def index_get(): return dict() @post('/') @view('index.html') def index_post(): gera_palpite = palpite() return dict(jogo=gera_...
marciocg/palpite-megasena
palpite-megasena.py
Python
gpl-2.0
708
"""contentbox_add.py Supports adding to the contentbox""" import httplib2 from errors import * class ContentboxAddCommand(object): h = httplib2.Http() def __init__(self, store_uri=None, data=None, type="application/x-unknown"): self.store_uri = (store_uri is not None and store_uri.endswith("/")) and store_uri[:-1] ...
iand/pynappl
old/contentbox_add.py
Python
gpl-2.0
936
import calfunctions from tkinter import * #Main-File #verwendet: schaltjahr(jahr), monatslaenge(jahr,monat), wochentag(jahr,monat,tag) def kalender(jahr): #Listen für schnellen Zugriff auf Monatsname und Wochentag monatsname = ['Januar','Februar','März','April','Mai','Juni','Juli','August','September','Oktober','No...
Tanoshinderuyo/Python
Calendar/A2Jahreskalender/calendar.py
Python
gpl-2.0
9,023
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011, 2012 CERN. ## ## Invenio 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 opt...
jrbl/invenio
modules/bibauthorid/lib/bibauthorid_wedge.py
Python
gpl-2.0
11,722
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from datetime import datetime from django.contrib.contenttypes.models import * from .exceptions import IncorrectCellLabel from utils.util import * from django.db.models import Sum, Max from django.contrib import messages from d...
rootAir/rootAir
finance/type_launch.py
Python
gpl-2.0
1,196
""" WSGI config for circuit 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.8/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTI...
7Pros/circuit
circuit/wsgi.py
Python
gpl-2.0
391
# # __init__.py # # Deluge is free software. # # You may redistribute it and/or modify it under the terms of the # GNU General Public License, as published by the Free Software # Foundation; either version 3 of the License, or (at your option) # any later version. # # deluge is distributed in the hope that it will be u...
zoff/torrentz-deluge-plugin
torrentztrackersautoload/__init__.py
Python
gpl-2.0
1,603
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Screens.Console import Console from Screens.Standby import TryQuitMainloop from Components.ActionMap import ActionMap, NumberActionMap from Components.Pixmap import Pixmap from Tools.LoadPixmap import LoadPixmap from Components.Label impor...
formiano/enigma2
lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
Python
gpl-2.0
27,174
"""The main job wrapper This is the core infrastructure. Copyright Andy Whitcroft, Martin J. Bligh 2006 """ import copy, os, re, shutil, sys, time, traceback, types, glob import logging, getpass, weakref from autotest.client import client_logging_config from autotest.client import utils, parallel, kernel, xen from a...
ldoktor/autotest
client/job.py
Python
gpl-2.0
50,100
# Note: Modified by Neui (Note: sphinx.util.compat.Directive is deprecated) # # Copyright (C) 2011 by Matteo Franchin # # This file 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...
vhelin/wla-dx
doc/sphinx/globalindex.py
Python
gpl-2.0
2,896
#!/usr/bin/python import sys import copy # Create fruitlist fruitlist = [u"Apples", u"Pears", u"Oranges", u"Peaches"] # Display all fruit - helper method def displayAllFruit(fruitlist): sys.stdout.write("\nHere is the current list of fruit:\n") sys.stdout.write(", ".join(fruitlist)) sys.stdout.write(...
AmandaMoen/AmandaMoen
students/KarlGentner/list_lab.py
Python
gpl-2.0
4,184
# importing libraries: import maya.cmds as cmds import maya.mel as mel # global variables to this module: CLASS_NAME = "Arm" TITLE = "m028_arm" DESCRIPTION = "m029_armDesc" ICON = "/Icons/dp_arm.png" def Arm(dpAutoRigInst): """ This function will create all guides needed to compose an arm. """ # chec...
SqueezeStudioAnimation/dpAutoRigSystem
dpAutoRigSystem/Scripts/dpArm.py
Python
gpl-2.0
3,972
#-*- coding: utf-8 -*- # collections.py # Define various kind of collections # # Copyright (C) 2016 Jakub Kadlcik # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) ...
sean797/tracer
tracer/resources/collections.py
Python
gpl-2.0
3,632
import sys, math # **************** Main program ********************************************* def main(): # File IO ############################################### txt = open("in9.txt", 'r') N = int (txt.readline()) n = 2 * N a = [[0 for x in range(1)] for y in range(n)] ...
dannyp11/gossip_network
main_v2.py
Python
gpl-2.0
4,267
from test_oop import * from beliefs.referent import * import sys TaxonomyCell.initialize(sys.modules[__name__]) m = MusicalThing() print m t = TaxonomyCell() t.to_dot()
EventTeam/beliefs
test_oop/__init__.py
Python
gpl-2.0
171
# -*- coding: utf-8 -*- ''' Copyright 2011 NTT Software Corporation. All Rights Reserved. @author NTT Software Corporation. @version 1.0.0 $Date: 2010-08-31 09:54:14 +0900 (火, 31 8 2010) $ $Revision: 435 $ $Author: NTT Software Corporation. $ ''' import os import sys from optparse import OptionParser f...
kuenishi/vHut
src/admin_server/vhut/agent/vhut/vhutac.py
Python
gpl-2.0
12,562
#!/usr/bin/env python # Blink an LED using the RPi.GPIO library. import RPi.GPIO as GPIO from time import sleep # Use GPIO numbering: GPIO.setmode(GPIO.BCM) # Set pin GPIO 14 to be output: GPIO.setup(14, GPIO.OUT) try: while True: GPIO.output(14, GPIO.HIGH) sleep(.5) GPIO.output(14, GPI...
akkana/pi-zero-w-book
ch2/blink-rpigpio.py
Python
gpl-2.0
468
# -*- 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 'UserProfile.email_every' db.add_column('djeuscan_userprofile', 'email_every', ...
iksaif/euscan
euscanwww/djeuscan/migrations/0020_auto__add_field_userprofile_email_every.py
Python
gpl-2.0
15,896
from django.contrib.auth import get_user_model from django.urls import reverse from django.utils import timezone from intranet.apps.groups.models import Group from ...models import EighthActivity, EighthBlock, EighthRoom, EighthScheduledActivity, EighthSponsor from ..eighth_test import EighthAbstractTest class Eigh...
tjcsl/ion
intranet/apps/eighth/tests/admin/test_admin_activities.py
Python
gpl-2.0
13,432
import numpy as np import pylab as pl from scipy.integrate import odeint from scipy.interpolate import interp1d phi = [0.0, 4.0, 8.0, 12.0, 16.0, 20.0, 24.0, 28.0, 32.0, 36.0, 40.0, 44.0, 48.0, 52.0, 56.0, 60.0, 64.0, 68.0, 72.0, 76.0, 80.0, 84.0, 88.0, 92.0, 96.0, 100.0, 104.0, 108.0, 112.0, 116.0, 120.0, 124.0, 128....
karban/agros2d
data/scripts/dc_motor_dynamic.py
Python
gpl-2.0
3,460
############################################################################### # This file is part of openWNS (open Wireless Network Simulator) # _____________________________________________________________________________ # # Copyright (C) 2004-2007 # Chair of Communication Networks (ComNets) # Kopernikusstr. 16, D-...
creasyw/IMTAphy
framework/scenarios/PyConfig/scenarios/interfaces.py
Python
gpl-2.0
4,832
import pytest import unittest from os import path from django.test import SimpleTestCase from django.conf import settings from rest_framework.renderers import BaseRenderer import sunburnt from openapi.search_builder import ( SearchBuilder, SearchWrapper, InvalidFieldError, InvalidQueryError, Unkno...
oriel-hub/api
django/idsapi/openapi/tests/search_wrapper.py
Python
gpl-2.0
14,005
# Copyright (C) 2006, Red Hat, Inc. # Copyright (C) 2007, One Laptop Per Child # Copyright (C) 2009, Tomeu Vizoso # # 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 Licens...
georgejhunt/HaitiDictionary.activity
progresslistener.py
Python
gpl-2.0
3,788
# # Copyright 2012 Red Hat, Inc. # # 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 th...
edwardbadboy/vdsm-ubuntu
tests/netinfoTests.py
Python
gpl-2.0
7,176
""" pure Python wrapper around libreader.so using ctypes """ import ctypes lib = ctypes.cdll.LoadLibrary('libreader.so') from message_wrap import Message, as_array class MessageReader: """ Straightforward mapping of C API to Python class. """ def __init__(self, r=None): self.r = r or lib.mes...
desdemonda/cbmroot
fles/spadic/message/test/reader_wrap.py
Python
gpl-2.0
993
import pytest import sys from inspect import isgeneratorfunction from logging import getLogger from subprocess import Popen, PIPE from re import search from input_generation import user_input_generator DELIMITER = "; " def get_input_generator_from_list(lst): def _generator(): for line in lst: ...
asnorkin/shad_testing_script
conftest.py
Python
gpl-3.0
8,688
#! /usr/bin/env python from pySecDec.loop_integral import loop_package import pySecDec as psd li = psd.loop_integral.LoopIntegralFromPropagators( propagators = ['k1^2', '(k1-k2)^2', '(k1-k2+p1)^2-mZ^2', '(k2)^2', '(k2+p2)^2', '(k1+p1+p2)^2', '(k2+p1)^2'], loop_momenta = ['k1'], external_momenta = ['p1','p2','p3','p4...
mppmu/secdec
nodist_examples/Zbb_vertex_correction_finite/F1diminc2_37_bubble.py
Python
gpl-3.0
1,812
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-10-18 14:49 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('queue', '0003_auto_20161014_1531'), ] operations = [ migrations.DeleteModel( ...
josejapch/proyectoIV1617
queue/migrations/0004_delete_usuario.py
Python
gpl-3.0
359
# Licensed under the MIT license # http://opensource.org/licenses/mit-license.php # Copyright 2007-2008 Brisa Team <brisa-develop@garage.maemo.org> """ Provides a UPnP control point API. """ from brisa.upnp.control_point.control_point import ControlPoint from brisa.upnp.control_point.control_point_av import ControlPo...
henkelis/sonospy
sonospy/brisa/upnp/control_point/__init__.py
Python
gpl-3.0
561
import logging import os import shutil import subprocess from collections import namedtuple from datetime import timedelta, datetime from os import path import tarfile from urllib.error import HTTPError, URLError from urllib.request import urlopen from urllib.parse import urlparse import json import re from errbot.p...
ESSS/err
errbot/repo_manager.py
Python
gpl-3.0
9,791
# def inject_app_defaults(application): # """Inject an application's default settings""" # try: # __import__('%s.settings' % application) # import sys # # Import our defaults, project defaults, and project settings # _app_settings = sys.modules['%s.settings' % application] # ...
gtfierro/BAS
web/smapgeo/__init__.py
Python
gpl-3.0
1,039
import uuid import sqlite3 from datetime import date, timedelta import logging import dblog class datamgr( object ): """ Handles database creation/setup, queries, and importation """ _dbConn = { } _dbCurs = { } _db = None # default name/location of the merged history database DEF_DB_L...
m-kal/DirtyBoots
src/datamgr.py
Python
gpl-3.0
10,361
import wx import os from framegrid import FrameGrid from framebuilddict import FrameBuildDictionary import dictionary import Global class FrameDictionary(wx.Frame): WILDCARD = "Memorize Word File (*.mwd)|*.mwd" def __init__(self, parent): BUTTON_SIZE=(200,-1) FRAME_SIZE_WIDTH = 800...
afsungur/MemWord
framedict.py
Python
gpl-3.0
2,001
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Copyright (C) 2015 Luiz Fernando Oliveira, Carlos Oliveira, Matheus Fernandes This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of th...
SpaceWars/spacewars
src/layers/base_layers.py
Python
gpl-3.0
1,054
import time import sys import RPi.GPIO as GPIO '''Stringhe binarie ON e OFF per le prese 1,2,3,4 mappate come a,b,c,d''' a_on = '' a_off = '' b_on = '' b_off = '' c_on = '' c_off = '' d_on = '0011100011000111011010001' d_off = '0011100011000111011010011' '''intervalli brevi/lunghi nel segnale e tra le r...
geekonerd/smartplugs
data/transmit.py
Python
gpl-3.0
2,037
#!/usr/bin/env python ''' Copyright (c) 2015, Mark Silliman All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of condit...
nvelaborja/CptS-483_Robotics
Lab 4/draw_a_square.py
Python
gpl-3.0
3,425
#!/usr/bin/python import json class Tests(object): def __init__(self, tests, name): self.tests = tests self.name = name self.export_tests() def export_tests(self): with open(self.name + ".ptdf", "w+") as ptdf_file: ptdf_file.write("Application " + self.name + '\n')...
kfrye/SMM-MPI
utilities/results/ptdf_export.py
Python
gpl-3.0
2,213
""" Tests for slice decoding """ import pytest from mmap_backed_array.slice_decoding import ( _decode_index, _decode_old_slice, _decode_slice, ) def test_decode_slice_bad_parameter(): """Test that bad parameters to decode_slice raise""" with pytest.raises(TypeError): _decode_slice("this is...
JaggedVerge/mmap_backed_array
mmap_backed_array/tests/test_slice_decoding.py
Python
gpl-3.0
5,134
import billiard billiard.forking_enable(0) ######## # Define a class that spawns a new process ######## class childClass: def __init__(self,childFile): self.childFile = childFile self.initDict = {} self.qTo = billiard.Queue() self.qFrom = billiard.Queue() self.started = False def f(self,childFile,qTo,qFrom...
mike-lawrence/fileForker
fileForker/__init__.py
Python
gpl-3.0
916
#************************************************************************ # Codelet Tuning Infrastructure # Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ # # 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 # th...
franck-talbart/codelet_tuning_infrastructure
ctr-common/plugins/34f27d92-f558-4121-b862-85216c54e18f/main.py
Python
gpl-3.0
2,154
#Special Numbers import math for i in range(1000, 10000): a = str(i) b, c = int(a[:2]), int(a[2:]) if(math.sqrt(i) == b+c): print (i)
LTKills/languages
python/15.py
Python
gpl-3.0
156
from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants import time ################################################# ################################################# class GeneralInstructions(Page): timeout_seconds = 120 form_model = 'player' ...
anthropo-lab/XP
privacy_project/privacy_value/pages.py
Python
gpl-3.0
3,067
#!/usr/bin/env python # # Author: # Mateusz Kruszynski <mateusz.kruszynski@gmail.com> """ Use to debug real-life streaming modules like: - amplifier - streamer - filter See signal_streamer_no_filter.py for sample use. """ import time class Debug(object): def __init__(self, p_sampling, logger, per=1): ...
BrainTech/openbci
obci/utils/streaming_debug.py
Python
gpl-3.0
2,136
# -*- coding: utf-8 -*- # django-djcopyright # tests/templatetags/test_djcopyright_tags.py from typing import List from django.test import TestCase from django.utils import timezone from djcopyright.templatetags.djcopyright_tags import djcopyright_years __all__: List[str] = ["DjcopyrightYearsTemplatetagTest"] ...
vint21h/django-djcopyright
tests/templatetags/test_djcopyright_tags.py
Python
gpl-3.0
707
import os import subprocess import logging import re from checks import utils import sys class RunSamtoolsCommands: @classmethod def _run_subprocess(cls, args_list): proc = subprocess.run(args_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) utils.log_error(args_l...
wtsi-hgi/bam2cram-check
checks/stats_checks.py
Python
gpl-3.0
11,324
"""Core AdjSim Module. This module contains the core features of the ABM engine, specifically, the Simulation and Agent objects and the facilities to allow them to interact with one another. Designed and developed by Sever Topan. """ # Standard. import sys import time import random # Third party. from PyQt5 import ...
SeverTopan/AdjSim
adjsim/visual.py
Python
gpl-3.0
6,894
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Jakub Beranek # # This file is part of Devi. # # Devi 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 of the License, or # (at yo...
Kobzol/debug-visualizer
debugger/lldbc/lldb_io_manager.py
Python
gpl-3.0
3,121
############################################################################## # # Copyright (c) 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
Donkyhotay/MoonPy
zope/app/cache/interfaces/ram.py
Python
gpl-3.0
1,471
""" This module provides loaders for local file system and over http local and remote access """ import os import hmac import urllib #import urllib2 import requests import urlparse import time import pkg_resources from io import open, BytesIO try: from boto import connect_s3 s3_avail = True except ImportError...
jcushman/pywb
pywb/utils/loaders.py
Python
gpl-3.0
9,733
#! /usr/bin/env python # -*- coding: utf-8 -*- # This simple example on how to do animations using graph-tool. Here we do a # simple simulation of an S->I->R->S epidemic model, where each vertex can be in # one of the following states: Susceptible (S), infected (I), recovered (R). A # vertex in the S state becomes inf...
jim-pansn/graph-tool
doc/demos/animation_zombies.py
Python
gpl-3.0
5,436
# -*- coding: utf-8 -*- import time import pycurl from module.plugins.captcha.ReCaptcha import ReCaptcha from module.plugins.internal.misc import json from module.plugins.internal.SimpleHoster import SimpleHoster class RapiduNet(SimpleHoster): __name__ = "RapiduNet" __type__ = "hoster" __version__ = "0....
rlindner81/pyload
module/plugins/hoster/RapiduNet.py
Python
gpl-3.0
3,047
# -*- coding: utf-8 -*- from minheap import minheap class maxheap(minheap): """ Heap class - made of keys and items methods: build_heap, heappush, heappop """ MAX_HEAP = True def __str__(self): return "Max-heap with %s items" % (len(self.heap)) def heapify(self, i): l =...
NicovincX2/Python-3.5
Algorithmique/Algorithme/Algorithme de tri/Tri par tas (Heapsort)/maxheap.py
Python
gpl-3.0
1,134
import sys from hexdump import hexdump # name.id0 - contains contents of B-tree style database # name.id1 - contains flags that describe each program byte # name.nam - contains index information related to named program locations # name.til - contains information about local type definitions BTREE_PAGE_SIZE = 8192 #...
KernelAnalysisPlatform/KlareDbg
extra/parseida/parseidb.py
Python
gpl-3.0
553
default_app_config = 'wiki.plugins.links.apps.LinksConfig'
floemker/django-wiki
src/wiki/plugins/links/__init__.py
Python
gpl-3.0
59
from comm485 import Conn485 from device485 import Device import time conn = Conn485() time.sleep(0.1) # led1 = Device("led1","pwm") # led1.init_as_hardware(60, [0,0], conn) enc1 = Device("enc1", "encoder", 1) enc1.init_as_hardware(50, [0,0], conn) # dummy = input(">") try: while True: # time.sleep(0.1) # pri...
eta4ever/dimmer485
host/test2.py
Python
gpl-3.0
523
# Copyright (c) 2014-2017 Cedric Bellegarde <cedric.bellegarde@adishatz.org> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later vers...
gnumdk/lollypop
lollypop/controllers.py
Python
gpl-3.0
13,447
class Corpus: """Interface for corpus """ def __init__(self): pass
rain1024/underthesea
underthesea/corpus/corpus.py
Python
gpl-3.0
87
from loguru import logger import asyncio from typing import Optional, List, Dict, ClassVar from pydispatch import Dispatcher, Property from pydispatch.properties import ListProperty, DictProperty from vidhubcontrol.common import ConnectionState, ConnectionManager class BackendBase(Dispatcher): """Base class for ...
nocarryr/vidhub-control
vidhubcontrol/backends/base.py
Python
gpl-3.0
27,623
''' Network related functionality like bridge and netfilter setup ''' import itertools import logging import re import time import iptc import locker import netaddr import pyroute2 from locker.util import regex_ip class BridgeUnavailable(Exception): ''' Bridge device does not exist Raised if the project sp...
run2fail/locker
locker/network.py
Python
gpl-3.0
16,640
#!/usr/bin/env python # from __future__ import print_function # from future import standard_library # standard_library.install_aliases() # from __future__ import absolute_import, division, print_function from builtins import str # For dbus import dbus import dbus.service import dbus.mainloop.glib import threading ...
liloman/pomodoroTasks2
pomodorotasks/systray.py
Python
gpl-3.0
17,195
import sys import os import time try: import mflow except: sys.path.append(os.environ["PWD"] + "/../") import mflow import logging import numpy as np logger = logging.getLogger("mflow.mflow") logger.setLevel(logging.ERROR) address = "tcp://127.0.0.1:40000" stream = mflow.connect(address, conn_type=mflo...
datastreaming/mflow
examples/sender.py
Python
gpl-3.0
825
with open('/tmp2/MicrosoftAcademicGraph/Papers.txt', 'r') as f, open('/tmp2/MicrosoftAcademicGraph_refine/papers_1_column.txt','w') as b: for line in f: a = line.split('\t') #a = a[1].split('\r') #b.write(a[0]+a[1]) b.write(a[2]+'\n') #break
chanhou/refine-client-py
parse_paper.py
Python
gpl-3.0
289
from geolocation.main import GoogleMaps google_maps = GoogleMaps(api_key='AIzaSyBCksh0B58c_C6k_Epm2k1ZQb-YF6kA6SE') lat = -2.500044 lng = -44.288093 location = google_maps.search(lat=lat, lng=lng) my_location = location.first() if my_location.city: print(my_location.city.decode('utf-8')) if my_locatio...
wsricardo/mcestudos
treinamento-webScraping/raspa/geo03.py
Python
gpl-3.0
602
# peepdf is a tool to analyse and modify PDF files # http://peepdf.eternal-todo.com # By Jose Miguel Esparza <jesparza AT eternal-todo.com> # # Copyright (C) 2016 Jose Miguel Esparza # # This file is part of peepdf. # # peepdf is free software: you can redistribute it and/or modify # it und...
buffer/peepdf
tests/test_pee.py
Python
gpl-3.0
1,359
from django.conf.urls import patterns, url urlpatterns = patterns('fpuf.utils.views', url(r'^about/$', 'about', name ="varis_about_about" ) , url(r'^missatges/$', 'about', name ="varis_missatges_veure" ) , url(r'^condicions/$', 'condicions', name ="va...
ctrl-alt-d/fpuf
fpuf/utils/urls.py
Python
gpl-3.0
381
# This Python file uses the following encoding: utf-8 """autogenerated by genpy from diagnostic_msgs/DiagnosticArray.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import diagnostic_msgs.msg import std_msgs.msg class DiagnosticArray(genpy.Message): ...
UnbDroid/robomagellan
Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/diagnostic_msgs/msg/_DiagnosticArray.py
Python
gpl-3.0
14,346
# # This file is part of environmentd # # environmentd 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. # # environmentd is distributed ...
warwick-one-metre/environmentd
warwick/observatory/environment/constants.py
Python
gpl-3.0
1,389
#!/usr/bin/python # -*- coding: utf-8 -*- """ This file is part of XBMC Mega Pack Addon. Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Softwar...
xbmcmegapack/plugin.video.megapack.dev
resources/lib/menus/home_countries_virgin_islands_us.py
Python
gpl-3.0
1,134
# Copyright (c) 2014-2018 Matteo Degiacomi and Valentina Erastova # # Assemble 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. # Assemb...
degiacom/assemble
ForceField.py
Python
gpl-3.0
4,345
''' Tools for Monte Carlo bootstrap error analysis ''' import logging import math import numpy as np import westpa from westpa.oldtools.aframe import AnalysisMixin log = logging.getLogger(__name__) class MCBSMixin(AnalysisMixin): def __init__(self): super().__init__() self.mcbs_alpha = None ...
ASinanSaglam/westpa
src/westpa/oldtools/aframe/mcbs.py
Python
gpl-3.0
5,928
import re def clean_text(text): return re.sub('[^\w\d_,\. -]', '', text, flags=re.UNICODE)
aluminiumgeek/cc-telegram
modules/utils/text.py
Python
gpl-3.0
97
#!/usr/bin/env python3 import os, sys reg_nums = [] instructions = [] errors = 0 alias = [ "move", "negu", "not" ] # -------------------------- fold here ----------------------------- print("Disassembler: PIC32") for i in range(0, 32): reg_nums.append("$" + str(i)) fp = open("../comparison/pic32.txt", "r") out...
mikeakohn/naken_asm
tests/disasm/pic32.py
Python
gpl-3.0
2,606
#****************************************************************************** # This file is part of RAW. # # RAW 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 ...
lqhuang/SAXS-tools
RAW/SASbuild_Clibs.py
Python
gpl-3.0
21,915
import shutil import os import base64 from PySide.QtCore import * from PySide.QtGui import * from maya.app.general.mayaMixin import MayaQWidgetBaseMixin, MayaQWidgetDockableMixin from maya import cmds from luka import Luka from luka.gui.qt import TakeSnapshotWidget, SnapshotListWidget __all__ = ['LukaTakeSnapshotUI...
zakuro9715/luka
luka_maya.py
Python
gpl-3.0
2,318
#AddDisk2VM.py from VMWConfigFile import * from pyVim import connect from pyVim.connect import SmartConnect, Disconnect from pyVmomi import vim, vmodl import atexit import os import sys import ssl import requests import argparse import time import getpass # Disabling urllib3 ssl warnings requests.packages.urllib3.dis...
FibercorpLabs/FibercorpDevops
vmware/vcenter/AddDisk2VM.py
Python
gpl-3.0
4,831
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """A simple (improved + 1) ACBT scraper to download course files (by /u/chehanr).""" import getpass import os import urllib from argparse import ArgumentParser import requests from bs4 import BeautifulSoup, SoupStrainer CWD = os.getcwd() class Download: """Downlo...
chehanr/moodlescrapr
moodlescrapr3.py
Python
gpl-3.0
9,047
from django.conf import settings import santaclara_editor.languages from santaclara_editor.santaclara_lang import tags from santaclara_editor.santaclara_lang import factories from santaclara_pages.models import Page,Image,File import re class IUrlTag(tags.Tag): def __init__(self,lang,padre): tags.Tag._...
chiara-paci/santaclara-pages
santaclara_pages/santaclara_languages.py
Python
gpl-3.0
5,795
# -*- coding: UTF-8 -*- from jsonvalidate import Validate import json import os class Database(): """ program database interface""" def __init__(self, dbfile): """ @param dbfile: full path of database file """ self.dbfile = dbfile self.iscached = False self.va...
pade/sprinkler
src/database.py
Python
gpl-3.0
1,254
from random import random import pyxel SCENE_TITLE = 0 SCENE_PLAY = 1 SCENE_GAMEOVER = 2 STAR_COUNT = 100 STAR_COLOR_HIGH = 12 STAR_COLOR_LOW = 5 PLAYER_WIDTH = 8 PLAYER_HEIGHT = 8 PLAYER_SPEED = 2 BULLET_WIDTH = 2 BULLET_HEIGHT = 8 BULLET_COLOR = 11 BULLET_SPEED = 4 ENEMY_WIDTH = 8 ENEMY_HEIGHT = 8 ENEMY_SPEED =...
ferriman/SSandSP
pyxel-test/venv/lib/python3.8/site-packages/pyxel/examples/09_shooter.py
Python
gpl-3.0
8,375
from __future__ import unicode_literals import os from guardian.compat import unittest from guardian.utils import abspath from django.conf import settings from django.conf import UserSettingsHolder from django.utils.functional import wraps THIS = abspath(os.path.dirname(__file__)) TEST_TEMPLATES_DIR = abspath(THIS, '...
Alexander-M-Waldman/local_currency_site
lib/python2.7/site-packages/guardian/testapp/tests/conf.py
Python
gpl-3.0
2,998
import random import datetime from async_notifications.models import EmailTemplate from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from report_builder import models PROJECT_NAMES = [ 'Project Manhattan', 'Sysadmin association project', 'Operation Know-...
solvo/derb
report_builder/create_data.py
Python
gpl-3.0
9,928
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './Plugins/VcsPlugins/vcsMercurial/HgBundleDialog.ui' # # Created: Tue Nov 18 17:53:57 2014 # by: PyQt5 UI code generator 5.3.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class U...
davy39/eric
Plugins/VcsPlugins/vcsMercurial/Ui_HgBundleDialog.py
Python
gpl-3.0
9,093
import os import unittest from vsg.rules import architecture from vsg import vhdlFile from vsg.tests import utils sTestDir = os.path.dirname(__file__) lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_016_test_input.vhd')) lExpected_require_blank = [] lExpected_require_blank.append('') utils....
jeremiah-c-leary/vhdl-style-guide
vsg/tests/architecture/test_rule_016.py
Python
gpl-3.0
2,048
#!/usr/bin/env python # encoding: utf-8 # Copyright 2013 Steven Maude # 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. ...
StevenMaude/sale_GOGgles
GOGgles.py
Python
gpl-3.0
2,999
#! /usr/bin/python3 import pygame from colors import Colors class Heart(pygame.sprite.Sprite): def __init__(self, pos): pygame.sprite.Sprite.__init__(self) self.image, self.rect = self.load_image("heart.png") self.rect.x = pos[0] self.rect.y = pos[1] def load_image(self...
joalcava/space_invaders
heart.py
Python
gpl-3.0
626
#!/usr/bin/env python import os import sys sys.path.insert(0, os.path.abspath('lib')) from ansible import __version__, __author__ try: from setuptools import setup, find_packages except ImportError: print("Ansible now needs setuptools in order to build. Install it using" " your package manager (us...
20uf/ansible
setup.py
Python
gpl-3.0
1,159
from django.test import TestCase from django.shortcuts import resolve_url from MMTest.projects.models import Project from MMTest.mathmodels.models import MathModel from MMTest.mmtests.models import MMTest from MMTest.core.tests.view_testing_utils import FormSuccessTestMixin class DeleteTest(FormSuccessTestMixin, Tes...
ftovar/TCC
Codigo/MMTest/mmtests/tests/test_view_delete.py
Python
gpl-3.0
1,031
# -*- coding: utf-8 -*- """ The main GUI model of project. """ import sys import webbrowser from PyQt5 import QtWidgets, QtCore, QtGui from PyQt5.QtWidgets import QErrorMessage # import qdarkstyle from src.gui.main_ui import Ui_PDFdir from src.pdfdirectory import add_directory from src.isupdated import is_updated...
chroming/pdfdir
src/gui/main.py
Python
gpl-3.0
8,507