repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
SchrodingersGat/InvenTree
InvenTree/build/models.py
""" Build database model definitions """ # -*- coding: utf-8 -*- from __future__ import unicode_literals import decimal import os from datetime import datetime from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator from djan...
nlaurens/budgetRapportage
controller/controller.py
import web import urllib from web import form from config import config import model.regels import model.ordergroup from model.functions import check_connection from model.users import protected class Controller(object): def __init__(self): self.mainRender = web.template.render('webpages/') self...
wikimedia/pywikibot-core
tests/edit_failure_tests.py
#!/usr/bin/python3 """ Tests for edit failures. These tests should never write to the wiki, unless something has broken badly. These tests use special code 'write = -1' for edit failures. """ # # (C) Pywikibot team, 2014-2022 # # Distributed under the terms of the MIT license. # import unittest from contextlib import...
stggh/PyAbel
abel/transform.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import numpy as np import time import warnings from . import basex from . import dasch from . import direct from . import h...
Connor-R/NSBL
failure_scripts/lineup_builder.py
from py_db import db import argparse from decimal import Decimal import NSBL_helpers as helper import itertools from time import time # OUTDATED (no longer needed) # script that determines the value for most reasonable lineups for all teams. # it uses some heuristics to limit the player list and then brute force fin...
wuttem/simple-hdlc
test_hdlc.py
#!/usr/bin/python # coding: utf8 import unittest import time import logging import serial from simple_hdlc import * class HDLCTests(unittest.TestCase): def setUp(self): pass def tearDown(self): pass @classmethod def tearDownClass(cls): pass @classmethod def setUpC...
wonkoderverstaendige/PyFL593FL
setup.py
#!/usr/bin/env python # coding=utf-8 from setuptools import setup, find_packages setup(name='PyFL593FL', version='0.0.1', author='Ronny Eichler', author_email='ronny.eichler@gmail.com', url='https://github.com/wonkoderverstaendige/PyFL593FL', download_url='https://github.com/wonkoderver...
jojanper/draalcore
draalcore/test_apps/test_models/tests/test_upload.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """File upload tests""" # System imports import logging # Project imports from draalcore.test_utils.rest_api import FileUploadAPI from draalcore.test_utils.basetest import BaseTestUser from draalcore.test_utils.upload import upload_file logger = logging.getLogger(__name...
skeryl/pygov
pygov/usda/enums.py
__author__ = 'scarroll' from enum import Enum class UsdaApis(Enum): ndb = "ndb" class UsdaUriActions(Enum): list = "list" report = "reports" class UsdaNdbListType(Enum): all_nutrients = "n" specialty_nutrients = "ns" standard_release_nutrients = "nr" food = "f" food_group = "g" ...
abhikpal/organic-robot-web-app
orgrobo/views.py
from flask import render_template from orgrobo import app from orgrobo import socketio @app.route('/') def index(): return render_template('index.html', async_mode=socketio.async_mode) @app.route('/control/') def controller(): return render_template('controller.html', title="Organ...
hulkwork/hvalidators
templates/templates_gen.py
from utils import schema_validators def get_input_form(fields): tmp = '<input name="{name}">{name}</input>' if "type" in fields: tmp = '<input name="{name}" type="{type}">{name}</input>' if "required" in fields and fields["required"]: tmp = '<input name="{name}" type="{type} required">' ...
dchaplinsky/pep.org.ua
pepdb/tasks/migrations/0030_auto_20180220_1405.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2018-02-20 12:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tasks', '0029_edrmonitoring_person_id'), ] operations = [ migrations.AlterF...
sashgorokhov/argparse-autogen
tests/test_autospec.py
import argparse_autogen def test_parser_description(parser): def foo(): """ Hello, world! :return: """ pass argparse_autogen.autospec(parser, foo) assert parser.description == 'Hello, world!' def test_cls_method(parser): class Foo: def bar(self): ...
billychasen/billots
billots/src/controller/server.py
# Copyright (c) 2017-present, Billy Chasen. # See LICENSE for details. # Created by Billy Chasen on 8/17/17. import json import logging import os from random import random from twisted.internet import protocol, reactor from billots.src.model.billot import Billot from billots.src.model.billots import Billots from bill...
algolia/algoliasearch-client-python
algoliasearch/search_index.py
import copy import math import random import string import time from typing import Any, Optional, Dict, List, Union, Iterator, Callable from algoliasearch.configs import SearchConfig from algoliasearch.exceptions import ( MissingObjectIdException, ObjectNotFoundException, RequestException, ) from algolias...
L3K0V/lifebelt
server/api/announcements/migrations/0002_announcementcomment_courseannouncement.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('announcements', '0001_initial'), ] operations = [ migrations.CreateModel( name='AnnouncementComment', ...
ksamuel/nmea_converter_proxy
setup.py
import re import setuptools def get_version(path="src/nmea_converter_proxy/__init__.py"): """ Return the version of by with regex intead of importing it""" init_content = open(path, "rt").read() pattern = r"^__version__ = ['\"]([^'\"]*)['\"]" return re.search(pattern, init_content, re.M).group(1) d...
tatumdmortimer/formatConverters
BratStandardtoTabular.py
#!/usr/bin/env python import sys #This script takes a BratNextGen standard output file and converts it to the #tabular form # check for correct arguments if len(sys.argv) != 3: print("Usage: BratStandardtoTabular.py <inputfile> <outputfile>") sys.exit(0) input_name = sys.argv[1] output_name = sys.argv[2] i...
tmolina27/prototipo
inapi.py
import re import string import urlparse import selenium from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By from bs4 import Beaut...
projectweekend/Article-Collector
rabbit/publisher.py
import sys import pika import json class Publisher(object): def __init__(self, rabbit_url, publish_interval, article_urls): self._connection = None self._channel = None self._deliveries = [] self._message_number = 0 self._stopping = False self._publish_interval = p...
icarrera/twitter-tunes
twitter_tunes/tests/test_redis.py
# coding=utf-8 import pytest from twitter_tunes.scripts import redis_data from mock import patch REDIS_PARSE = [ (b"{'trend3': 'url3', 'trend2': 'url2', 'trend1': 'url1'}", {'trend1': 'url1', 'trend2': 'url2', 'trend3': 'url3'}), (b"{}", {}), (b"{'hello':'its me'}", {'hello': 'its me'}), (b"{'...
michael-lazar/rtv
rtv/__main__.py
# -*- coding: utf-8 -*- # pylint: disable=wrong-import-position from __future__ import unicode_literals from __future__ import print_function import os import sys import locale import logging import warnings import six import requests # Need to check for curses compatibility before performing the rtv imports try: ...
Bertrand256/dash-masternode-tool
src/hw_wipe_device_wdg.py
import logging import re from enum import Enum from typing import Optional, Dict, Tuple from PyQt5 import QtCore from PyQt5.QtWidgets import QWidget, QMessageBox import app_utils import hw_intf from app_defs import get_note_url from common import CancelException from hw_common import HWDevice, HWType, HWModel, HWFirm...
leon-lei/learning-materials
data_science/pandas_tutorials/pandas_practice1_data_frames.py
import pandas as pd import datetime import matplotlib.pyplot as plt from pandas_datareader import data as web from matplotlib import style # plots data frame of yahoo data using matplotlib style.use('ggplot') start = datetime.datetime(2010, 1, 1) end = datetime.datetime(2015, 1, 1) df = web.DataReader("XOM", "yahoo"...
goodmami/xmt
xmt/select.py
import os from itertools import groupby from nltk.translate import bleu_score from nltk.tokenize.moses import MosesTokenizer from delphin import itsdb _tokenize = MosesTokenizer().tokenize _smoother = bleu_score.SmoothingFunction().method3 bleu = bleu_score.sentence_bleu def do(args): join_table = 'g-result' ...
jianaosiding/crawl1
ganji/page_spider.py
import requests from bs4 import BeautifulSoup import pymongo import re import random import time from lxml import etree # 连接mongodb client = pymongo.MongoClient('localhost', 27017, connect=False) ganji = client['ganji'] item_info = ganji['item_info'] url_list = ganji['url_list2'] # 设置头部 header = { 'User-Agent': '...
ryanraaum/oldowan.mitotype
oldowan/mitotype/network.py
import networkx as nx from networkx import single_source_shortest_path from oldowan.polymorphism import Polymorphism from oldowan.polymorphism import InfiniteRange from oldowan.mtdna import rCRSlist def transition(position): ts_dict = {'A':'G', 'G':'A', 'C':'T', 'T':'C'} return ts_dict[rCRSlist[position]] ...
ic-labs/django-icekit
icekit/plugins/text/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import fluent_contents.extensions class Migration(migrations.Migration): dependencies = [ ('fluent_contents', '0001_initial'), ] operations = [ migrations.CreateModel( na...
Frederick-S/quiz
app/models/question.py
from app.db import db class Question(db.Model): __tablename__ = 'question' id = db.Column(db.Integer, primary_key=True) type = db.Column(db.String(64)) question = db.Column(db.Text, index=True) explanation = db.Column(db.Text) complement = db.Column(db.Text) section_id = db.Column(db.Inte...
shtalinberg/django-el-pagination
el_pagination/settings.py
# """Django Endless Pagination settings file.""" from __future__ import unicode_literals from django.conf import settings # How many objects are normally displayed in a page # (overwriteable by templatetag). PER_PAGE = getattr(settings, 'EL_PAGINATION_PER_PAGE', 10) # The querystring key of the page number. PAGE_LAB...
ecsalina/gtrends
_login.py
import six import re import logging try: import urllib.request as urllib2 except ImportError: import urllib2 try: import urllib.parse as urllib except ImportError: import urllib try: from http.cookiejar import CookieJar except ImportError: from cookielib import CookieJar class Downloader(objec...
devxoul/fabric-verbose
setup.py
from distutils.core import setup import os module_path = os.path.join(os.path.dirname(__file__), 'fabric_verbose.py') version_line = [line for line in open(module_path) if line.startswith('__version_info__')][0] __version__ = '.'.join(eval(version_line.split('__version_info__ = ')[-1])) setup( na...
thp44/delphin_6_automation
pytest/test_material_parser.py
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules # RiBuild Modules from delphin_6_automation.file_parsing import material_parser import shutil import os import pytest #...
methoxid/micropystat
stmhal/build-MSTAT01/pins_af.py
PINS_AF = ( ('A1', (1, 'TIM2_CH2'), (2, 'TIM5_CH2'), (7, 'USART2_RTS'), (8, 'UART4_RX'), ), ('CS_DAC', (1, 'TIM2_CH3'), (2, 'TIM5_CH3'), (3, 'TIM9_CH1'), (7, 'USART2_TX'), ), ('MX30', (1, 'TIM2_CH4'), (2, 'TIM5_CH4'), (3, 'TIM9_CH2'), (7, 'USART2_RX'), ), ('A4', (5, 'SPI1_NSS'), (6, 'SPI3_NSS'), (7, 'USART2_CK'...
MadsJensen/malthe_alpha_project
filter_ICA.py
# -*- coding: utf-8 -*- """ Created on Wed Oct 8 14:45:02 2014. @author: mje """ import mne import socket import numpy as np import os import glob from mne.io import Raw from mne.preprocessing import ICA, create_ecg_epochs, create_eog_epochs import matplotlib matplotlib.use('Agg') # Setup paths and prepare raw da...
isayev/ANI1_dataset
readers/example_data_sampler.py
import pyanitools as pya # Set the HDF5 file containing the data hdf5file = '../ani_gdb_s01.h5' # Construct the data loader class adl = pya.anidataloader(hdf5file) # Print the species of the data set one by one for data in adl: # Extract the data P = data['path'] X = data['coordinates'] E = data['en...
manyoso/tools
gdb_helpers/qt4.py
# -*- coding: iso-8859-1 -*- # Pretty-printers for Qt4. # Copyright (C) 2009 Niko Sams <niko.sams@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 2 of the License, or...
gyepisam/kedpm
kedpm/frontends/cli.py
# Copyright (C) 2003-2005 Andrey Lebedev <andrey@micro.lt> # # 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 p...
markfasheh/ocfs2-tools
ocfs2console/ocfs2interface/mount.py
# OCFS2Console - GUI frontend for OCFS2 management and debugging # Copyright (C) 2002, 2005 Oracle. All rights reserved. # # 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 th...
Xwoe/pedalumi
test_anim.py
#import aubioOperations #! /usr/bin/python import threading import signal import sys # import pdlmThreads from pdlmThreads import pdlmAnimation import pdlmLCD from time import sleep from pdlmEnums import Animations from pprint import pprint from pdlmSettings import pdlmSettings import pyaudio, struct fr...
rob-nn/python
first_book/blackjack.py
# Blackjack import cards, games class BJ_Card(cards.Card): """A Blackjack Card.""" ACE_VALUE = 1 @property def value(self): if self.is_face_up: v = BJ_Card.RANKS.index(self.rank) +1 if v > 10: v = 10 else: v = None return v class BJ_Deck(cards.Deck): """A Blackjack Deck.""" def populate(...
dsoprea/PyHdHomeRun
pyhdhomerun/constants.py
MAX_DEVICES = 16 HDHOMERUN_DEVICE_TYPE_TUNER = 0x00000001 HDHOMERUN_DEVICE_ID_WILDCARD = 0xFFFFFFFF HDHOMERUN_CHANNELSCAN_MAX_PROGRAM_COUNT = 64 VIDEO_DATA_BUFFER_SIZE_1S = (20000000 / 8) MAP_AU_BCAST = 'au-bcast' MAP_AU_BCAST = 'au-cable' MAP_EU_BCAST = 'eu-bcast' MAP_EU_CABLE = 'eu-cable' MA...
szecsi/Gears
GearsPy/Project/Components/Pif/MouseRect.py
import Gears as gears from .. import * import math from .Base import * class MouseRect(Base) : def applyWithArgs( self, spass, functionName, *, size_um : 'Dimensions of the rectangle shape, as a (width, height) pair [um,um], or Interactiv...
eternnoir/pyTelegramBotAPI
examples/middleware/i18n.py
#!/usr/bin/python # This example shows how to implement i18n (internationalization) l10n (localization) to create # multi-language bots with middleware handler. # # Note: For the sake of simplicity of this example no extra library is used. However, it is recommended to use # better i18n systems (gettext and etc) for h...
sbidoul/buildbot
master/buildbot/test/unit/test_www_hooks_gitorious.py
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
joselamego/patchwork
patchwork/tests/test_series.py
# Patchwork - automated patch tracking system # Copyright (C) 2014 Intel Corporation # # This file is part of the Patchwork package. # # Patchwork 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...
barbosm/gatepy
examples/monitor_system_config_backup.py
#!/usr/bin/env python3 ''' Backup system config Method https://<DEVICE_IP>/api/v2/monitor/system/config/backup?scope=global CLI FG # show full-configuration #config-version=FG81EP-6.0.2-FW-build0163-180725:opmode=1:vdom=0:user=admin #conf_file_ver=380263519573911 #buildno=0163 #global_vdom=1...
botherder/volatility
volatility/plugins/objtypescan.py
# Volatility # # This file is part of Volatility. # # Volatility 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. # # Volatility is dist...
repotvsupertuga/repo
plugin.video.zen/resources/lib/sources/gogoanime_tv.py
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any l...
dan-cristian/haiot
apps/dashcam/recorder/usb_tool.py
import subprocess import os #from collections import namedtuple from recordtype import recordtype import sudo_usb try: from main.logger_helper import L except Exception: class L: class l: @staticmethod def info(msg): print msg @staticmethod def warning(msg...
ULHPC/easybuild-easyblocks
easybuild/easyblocks/generic/waf.py
## # Copyright 2015-2017 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
fredriklindberg/chromesthesia
chromesthesia_app/output/__init__.py
# Copyright (C) 2015 Fredrik Lindberg <fli@shapeshifter.se> # # 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. # # This program is distributed in the hope that it...
bchoward/homehub
frontends/flask-video-streaming/camera_pi.py
import time import io import threading import picamera class Camera(object): thread = None # background thread that reads frames from camera frame = None # current frame is stored here by background thread last_access = 0 # time of last client access to the camera def initialize(self): if ...
dwagon/pymoo
moo/tech/migrations/0005_chemistry_techs.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations def initial_data(apps, schema_editor): TC = apps.get_model('tech', 'TechCategory') T = apps.get_model('tech', 'Tech') tc = TC(name='Chemistry', cost=50, category='CH') tc.save() T(name='Nuclear Missi...
zebMcCorkle/ZeroNet
update.py
import urllib import zipfile import os import ssl import httplib import socket import re import cStringIO as StringIO from gevent import monkey monkey.patch_all() def update(): from src.util import helper print "Downloading.", req = helper.httpRequest("https://github.com/HelloZeroNet/ZeroNet/archive/mas...
marcomilanesio/qoe-server
DBConn.py
#!/usr/bin/python # # mPlane QoE Server # # (c) 2013-2014 mPlane Consortium (http://www.ict-mplane.eu) # Author: Marco Milanesio <milanesio.marco@gmail.com> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published b...
DevCouch/coderbyte_python
easy/additive_persitence.py
def AdditivePersistence(num): persistence = 0 finished = False new_num = 0 if num < 10: return persistence while not finished: for ch in str(num): new_num += int(ch) num = new_num new_num = 0 persistence += 1 if num < 10: finis...
germanovm/vdsm
tests/storagefakelib.py
# Copyright 2015 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 the ...
aglitke/vdsm
tests/functional/storageTests.py
# # 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...
maruina/python-scripts
sendGmail.py
#! /usr/bin/env python # # Send a mail via Gmail # # Import usefull stuff import smtplib # Import the email modules we need from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText # Import sys for exit codes import sys # Import for parsing command line arguments import argparse # Import for c...
slb6968/Encyclopedia-Brown
travelhangman.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Encyclopedia Brown, the hangman game""" import random wrtr = "\n Escape the tree!" wr1 = "\n O" wr2 = "\n |" wr3 = "\n \|" wr4 = "\n \|/" wr5 = "\n _/" wr6 = "\n _/ \_" wrgr = "\n Land on your feet" HMIMAGES = [wrtr+wrgr, wrtr+wr1+wrgr, wrtr+wr1+wr2+wrgr, wrt...
myarjunar/QGIS
python/plugins/processing/algs/qgis/ExtractByExpression.py
# -*- coding: utf-8 -*- """ *************************************************************************** ExtractByExpression.py --------------------- Date : October 2016 Copyright : (C) 2016 by Nyall Dawson **********************************************************************...
MicroPyramid/MicroSite
micro_blog/tests.py
from django.test import TestCase from django.test import Client from micro_blog.forms import (BlogpostForm, BlogCategoryForm, CustomBlogSlugInlineFormSet) from micro_blog.models import Category, Post, Tags, Post_Slugs from micro_admin.models import User from django.forms.models import inli...
jalavik/harvesting-kit
harvestingkit/inspire_cds_package/base.py
# -*- coding: utf-8 -*- # # This file is part of Harvesting Kit. # Copyright (C) 2015 CERN. # # Harvesting Kit 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...
madprogrammer/sniper
web.py
import threading import operator, os, sys import cherrypy import template from config import Config from model import Item from updater import ItemUpdater from form import ItemForm from formencode import Invalid from genshi.input import HTML from genshi.filters import HTMLFormFiller, HTMLSanitizer from ebay import Item...
liebermeister/flux-enzyme-cost-minimization
scripts/venn.py
# -*- coding: utf-8 -*- """ Created on Thu Aug 25 19:17:11 2016 @author: noore """ import pandas as pd import os import definitions as D from prepare_data import get_concatenated_raw_data def count_efms(): rates1_df, _, _ = get_concatenated_raw_data('standard') rates2_df, _, _ = get_concatenated_raw_data('an...
UdK-VPT/Open_eQuarter
mole/extensions/eval_present_heritage/oeq_UPH_Window.py
# -*- coding: utf-8 -*- import os,math from qgis.core import NULL from mole import oeq_global from mole.project import config from mole.extensions import OeQExtension from mole.stat_corr import rb_present_window_uvalue_AVG_by_building_age_lookup, nrb_present_window_uvalue_by_building_age_lookup, rb_contemporary_window...
unioslo/cerebrum
contrib/no/uio/quarantine_opptak_students.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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...
sathnaga/avocado-vt
avocado_vt/plugins/vt_joblock.py
import errno import logging import os import re import random import string import sys from avocado.core import exit_codes from avocado.utils.process import pid_exists from avocado.utils.stacktrace import log_exc_info from avocado.core.plugin_interfaces import JobPreTests as Pre from avocado.core.plugin_interfaces im...
syncboard/syncboard
src/network.py
""" Cross-platform clipboard syncing tool Copyright (C) 2013 Syncboard 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) an...
supiiik/OpenAVRc
util/add-issue-links.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import sys import re if len(sys.argv) > 1: inputFile = sys.argv[1] inp = open(inputFile, "r") else: inp = sys.stdin pattern = re.compile("#\d+") while True: skip = False line = inp.readline() if len(line) ==...
bradallred/gemrb
gemrb/GUIScripts/bg2/LUHLASelection.py
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003-2004 The GemRB Project # # 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 opt...
kenjoe41/screeny
screeny.py
################################################################################################ # Name: Screeny. # # Description: A tool to take screen shots and upload them to imgur from within the Terminal. # # Author: Phage (phage@evilzo...
melizalab/neurobank
nbank/core.py
# -*- coding: utf-8 -*- # -*- mode: python -*- """functions for managing a data archive Copyright (C) 2013 Dan Meliza <dan@meliza.org> Created Mon Nov 25 08:52:28 2013 """ from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literal...
a-slide/IsFinder
src/ShortReadAligner_test.py
""" @package AlignerSpliter @brief ... @copyright [GNU General Public License v2](http://www.gnu.org/licenses/gpl-2.0.html) @author Adrien Leger - 2014 * <adrien.leger@gmail.com> * <adrien.leger@inserm.fr> * <adrien.leger@univ-nantes.fr> * [Github](https://github.com/a-slide) * [Atlantic Gene Therapies - INSERM 1089] (...
jeffmahoney/crash-python
crash/arch/x86_64.py
# -*- coding: utf-8 -*- # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: import gdb import re from typing import Optional from crash.arch import CrashArchitecture, KernelFrameFilter, register_arch from crash.arch import FetchRegistersCallback from crash.util.symbols import Types, MinimalSymvals from cras...
roorco/CliChing
cliching.py
#!/usr/bin/env/python2 # -*- coding: utf-8 -*- # CliChing by roberto dell'orco 2014 # I-Ching on command line # import pydoc import random from time import sleep from iching64 import * iching_A = 0 iching_B = 0 mutatis = False # Variable that activates the mutation process class Line(object): ...
benoit-pierre/mcomix
mcomix/bookmark_menu_item.py
"""bookmark_menu_item.py - A signle bookmark item.""" import gtk class _Bookmark(gtk.ImageMenuItem): """_Bookmark represents one bookmark. It extends the gtk.ImageMenuItem and is thus put directly in the bookmarks menu. """ def __init__(self, window, file_handler, name, path, page, numpages, archive...
tgcmteam/tgcmlinux
src/tgcm/contrib/mobile-manager2/src/mobilemanager/devices/option/ModemGsmNetwork.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Authors : Roberto Majadas <roberto.majadas@openshine.com> # # Copyright (c) 2010, Telefonica Móviles España S.A.U. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by th...
pacoqueen/ginn
ginn/framework/pclases/superfacturaventa.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright (C) 2005-2015 Francisco José Rodríguez Bogado # # <frbogado@geotexan.com> # # ...
wezs/uktils
uktils/utils.py
# -*- coding: utf-8 -*- # uktils - ukrainian-specific string utils # Copyright (C) 2011 Taras Marchuk # # Based on pytils project # http://pyobject.ru/projects/pytils/ # # 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 F...
pthagnar/SFOS
sfos.py
#!/usr/bin/python3 from random import uniform, choice, sample, gauss import os, sys from time import strftime def weighted_choice(choices): total = sum(w for c, w in choices) r = uniform(0, total) upto = 0 for c, w in choices: if upto + w > r: return c upto += w assert False, "Shouldn't get here" #groupe...
pescobar/easybuild-framework
easybuild/toolchains/iompic.py
## # Copyright 2013-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
prrvchr/USBTerminal
USB/App/PySerialState.py
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2015 Pierre Vacher <prrvchr@gmail.com> * #* ...
openlmi/openlmi-doc
doc/python/lmi/providers/__init__.py
# Software Management Providers # # Copyright (C) 2012-2014 Red Hat, Inc. All rights reserved. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (...
VioletRed/script.module.urlresolver
lib/urlresolver/plugins/hugefiles.py
''' Hugefiles urlresolver plugin Copyright (C) 2013 Vinnydude This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is ...
Csega/PythonCAD3
Interface/CmdIntf/cmdlinedock.py
# This is only needed for Python v2 but is harmless for Python v3. import sip sip.setapi('QString', 2) from PyQt5 import QtCore, QtGui, QtWidgets from Interface.CmdIntf.functionhandler import FunctionHandler from Kernel.pycadevent import PyCadEvent class CmdLineDock(QtWidgets.QDockWidget): ''' A dockable...
camptocamp/QGIS
python/plugins/processing/lidar/fusion/CanopyModel.py
# -*- coding: utf-8 -*- """ *************************************************************************** CanopyModel.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***************************...
fabio-otsuka/invesalius3
invesalius/data/converters.py
#-------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU ...
thisissc/stunnelproxy
other_proxy/proxy_gevent.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import signal import urlparse import gevent import time from gevent.server import StreamServer from gevent.socket import create_connection, gethostbyname class ProxyServer(StreamServer): def __init__(self, listener, **kwargs): super(ProxyServer, se...
interlegis/sigi
sigi/apps/parlamentares/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('casas', '__first__'), ] operations = [ migrations.CreateModel( name='Cargo', fields=[ ...
acasadoquijada/cifrado-de-bazeries
Bazeries/bazeries.py
import itertools import string from num2words import num2words import re class Bazeries: alfabeto='abcdefghiklmnopqrstuvwxyz' llave='' texto='' cifrado='' digitos=[] descifrado='' matrix=[[0 for x in range(5)] for x in range(5)] matrix2=[[0 for x in range(5)] for x in range(5)] ind...
ruuk/script.module.youtube.dl
service.py
# -*- coding: utf-8 -*- import sys import json import binascii import xbmc from lib.yd_private_libs import util, servicecontrol, jsonqueue sys.path.insert(0, util.MODULE_PATH) import YDStreamExtractor # noqa E402 import threading # noqa E402 import AddonSignals class Service(): def __init__(self): self....
gunny26/webstorage
devel/wstar_since_2017-12-19.py
#!/usr/bin/python3 # pylint: disable=line-too-long # disable=locally-disabled, multiple-statements, fixme, line-too-long """ command line program to create/restore/test WebStorageArchives """ import os import hashlib import datetime import time import sys import socket import argparse import stat import re import loggi...
PaulBeaudet/plover
plover/gui/main.py
# Copyright (c) 2010-2011 Joshua Harlan Lifton. # See LICENSE.txt for details. """The main graphical user interface. Plover's graphical user interface is a simple task bar icon that pauses and resumes stenotype translation and allows for application configuration. """ import sys import os import wx import wx.animat...
garbear/EventGhost
plugins/VLC/__init__.py
# This file is a plugin for EventGhost. # Copyright (C) 2006 MonsterMagnet # # EventGhost 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 ...
collinss/Cinnamon
files/usr/share/cinnamon/cinnamon-looking-glass/cinnamon-looking-glass.py
#!/usr/bin/python3 # Todo: # - TextTag.invisible does not work nicely with scrollheight, find out why # - (Sometimes scrollbars think there is more or less to scroll than there actually is after showing/hiding entries in page_log.py) # - Add insert button to "simple types" inspect dialog ? is there actual use for th...
sgnes/MemoryAnalysis
MemoryAnalysis.py
__author__ = 'DZMP8F' import re import os import sys import time # .text_vle 0012ac04 00000030 D:/Code/62.1G/10028809_MT62.1G_for_coding/Products/objs_MT62P1G_NA_CNG/dd_knock_ctc.o class memory_analysis(object): def __init__(self, argv): self.argv = argv self.__str_wind_river_keyword = "Wi...
invicnaper/MWF
Utils/t/toscgi.py
#!/usr/bin/env python # coding=UTF-8 # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 def toscgi(text): def to_headers(): res = [] hdr = text[:text.find('\n\n')] for element in hdr.split('\n'): [key,value]=element.split(':') res.append((key.upper().replace('-','...
mphemanth/dense-coding
main.py
from struct import pack import sys def shift_base(ar,b): # creates the variable length code for each rank out,arg=[],int(ar) while arg >0: out.append(arg%b) # rip off digits arg=arg/b out[-1]=out[-1]+128 # set last byte's flag for variable operation return out[::-1] def to_binary(l): ...