repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
tkchafin/scripts
findBreaksVCF.py
#!/usr/bin/python import re import sys import os import getopt import vcf def main(): params = parseArgs() vfh = vcf.Reader(open(params.vcf, 'r')) #grab contig sizes contigs = dict() for c,s in vfh.contigs.items(): contigs[s.id] = s.length regions = list() this_chrom = None start = int() stop = int() ...
spencerkclark/aospy-obj-lib
aospy_user/runs/cases.py
from aospy import Run am2_control = Run( name='am2_control', description=( 'Preindustrial control simulation.' ), data_in_direc=('/archive/Yi.Ming/sm2.1_fixed/' 'SM2.1U_Control-1860_lm2_aie_rerun6.YIM/pp'), data_in_dur=5, data_in_start_date='0001-01-01', data_in_e...
djo938/dumpFormat
dumpformat/test/test.py
#!/usr/bin/python # -*- coding: utf-8 -*- #Copyright (C) 2013 Jonathan Delvaux <dumpformat@djoproject.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 #an...
chrmoritz/zoxel
src/plugins/tool_extrude.py
# tool_extrude.py # Extrusion tool. # Copyright (c) 2015, Lennart Riecken # # 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 versi...
asoliveira/NumShip
scripts/entrada/padrao/plot-1cg.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import matplotlib.pyplot as plt import scipy as sp #Nome do arquivo em que está os dados da posição arq = 'CurvaGiro/pos.dat' #Limites dos eixos v = [-10,1000, 0, 1000] #Título eixo x xl = r'y metros' #Título do eixo y yl = r'x metros' x = sp.genfromtxt('CurvaGiro/pos.dat...
Abjad/abjad
abjad/__init__.py
from quicktions import Fraction from . import ( _update, deprecated, enumerate, format, get, illustrators, io, iterate, iterpitches, lyconst, lyenv, makers, mutate, persist, string, wf, ) from ._version import __version__, __version_info__ from .bind impo...
oser-cs/oser-website
tests/test_core/test_address.py
"""Address model tests.""" from core.models import Address from core.factory import AddressFactory from tests.utils import ModelTestCase class AddressTest(ModelTestCase): """Test the Address model.""" model = Address field_tests = { 'line1': { 'verbose_name': 'ligne 1', '...
twm/yarrharr
yarrharr/application.py
# Copyright © 2013, 2015, 2016, 2017, 2018, 2020, 2022 Tom Most <twm@freecog.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 # (at your option) any lat...
wdecoster/nanoget
nanoget/extraction_functions.py
import logging from functools import reduce import nanoget.utils as ut import pandas as pd import sys import pysam import re from Bio import SeqIO import concurrent.futures as cfutures from itertools import repeat def process_summary(summaryfile, **kwargs): """Extracting information from an albacore summary file....
qpiel/python_estimation_source
Example/ExReadFermiCatalog.py
# author David Sanchez david.sanchez@lapp.in2p3.fr # ------ Imports --------------- # import numpy from Plot.PlotLibrary import * from Catalog.ReadFermiCatalog import * from environ import FERMI_CATALOG_DIR # ------------------------------ # #look for this 2FGL source source = "2FGL J1015.1+4925" #source = "1FHL J2158...
squilter/ardupilot
libraries/AP_MSP/Tools/pymsp.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ author: Alex Apostoli based on https://github.com/hkm95/python-multiwii which is under GPLv3 """ import struct import time import sys import re class MSPItem: def __init__(self, name, fmt, fields): self.name = name self.format ...
hackersql/sq1map
comm1x/src/core/injections/controller/shell_options.py
#!/usr/bin/env python # encoding: UTF-8 """ This file is part of Commix Project (http://commixproject.com). Copyright (c) 2014-2017 Anastasios Stasinopoulos (@ancst). 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 Soft...
kickino/aws-scripts
glacier/glacier_push.py
#!/usr/bin/python2.7 from boto.glacier.layer1 import Layer1 from boto.glacier.concurrent import ConcurrentUploader import sys import os.path from time import gmtime, strftime access_key_id = "xxx" secret_key = "xxx" target_vault_name = "xxx" inventory = "xxx" # the file to be uploaded into the vault as an archive ...
Theyrealone/ExcelMapper
run.py
from shutil import copyfile from datetime import datetime from ExcelMapper.mapper import * import xlrd import xlsxwriter row_rules_sheet1_t1 = { 'found "risk"': lambda data: 'risk' in data['type'], 'found "Risk"': lambda data: 'Risk' in data['type'], 'found "reward"(ignore letter casing)': lambda data: 'rew...
davidam/python-examples
scikit/latentsemantic.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2019 David Arroyo Menéndez # Author: David Arroyo Menéndez <davidam@gnu.org> # Maintainer: David Arroyo Menéndez <davidam@gnu.org> # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
kugel-/peasy
plugins/peasypytest.py
from __future__ import print_function import gettext import gi gi.require_version('Peas', '1.0') from gi.repository import GObject from gi.repository import Peas from gi.repository import Peasy from gi.repository import Geany gettext.bindtextdomain("peasy", "/home/kugel/dev/geany.git/build-linux/dest/share/locale") ...
autosportlabs/RaceCapture_App
spacer.py
# # Race Capture App # # Copyright (C) 2014-2017 Autosport Labs # # This file is part of the Race Capture App # # This is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at ...
frankosan/pypers
pypers/steps/picard/reordersam.py
import os from pypers.core.step import CmdLineStep class ReorderSam(CmdLineStep): spec = { "version": "0.0.1", "descr": [ "Runs ReorderSam to reorder chromosomes into GATK order" ], "args": { "inputs": [ { "name" ...
thica/ORCA-Remote
src/scripts/tools/tool_repositorymanager/RepManager.py
# -*- coding: utf-8 -*- """ ORCA Open Remote Control Application Copyright (C) 2013-2020 Carsten Thielepape Please contact me by : http://www.orca-remote.org/ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publ...
etrombly/snort-rule-tool
snort-rule-tool.py
#!/usr/bin/env python2 import sys import math from PyQt5 import QtWidgets from PyQt5 import QtGui from PyQt5 import QtCore from mainwindow import Ui_MainWindow from scapy.all import * """ dump any string, ascii or encoded, to formatted hex output """ def dumpString(src, length=16): FILTER = ''.join([(len(repr(chr...
elainenaomi/sciwonc-dataflow-examples
sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/python2.7/dist-packages/Pegasus/tools/kickstart_parser.py
#!/usr/bin/env python """ Pegasus utility functions for pasing a kickstart output file and return wanted information """ ## # Copyright 2007-2010 University Of Southern California # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
flexi-framework/hopr
tools/blockgridgenerator/main.py
#!/usr/bin/python # -*- coding: utf-8 -*- import sys,os from PyQt5 import QtCore, QtGui, QtWidgets, uic from model import MainModel from view import MainView class App(QtWidgets.QApplication): def __init__(self, scriptpath, sys_argv): super(App, self).__init__(sys_argv) self.model = MainModel() ...
bkaganyildiz/StreamBasedNotification
StreamBasedNotifs/capture/consumer.py
from channels.auth import channel_session_user_from_http from .models import Stream, Notification import redis import ast from .task import sendNotifications, send_notifications from channels import Group import json redis_con = redis.Redis('demo.scorebeyond.com', 8007) subs = redis_con.pubsub() subs.subscribe('test')...
alvcarmona/efficiencycalculatorweb
effcalculator/effcalculator/urls.py
"""effcalculator URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
joaormatos/anaconda
Anaconda/pyglet/canvas/win32.py
#!/usr/bin/python # $Id:$ from base import Display, Screen, ScreenMode, Canvas from pyglet.libs.win32 import _kernel32, _user32, types, constants from pyglet.libs.win32.constants import * from pyglet.libs.win32.types import * class Win32Display(Display): def get_screens(self): screens = [] def en...
isislovecruft/switzerland
switzerland/lib/shrunk_scapy/data.py
## This file is part of Scapy ## See http://www.secdev.org/projects/scapy for more informations ## Copyright (C) Philippe Biondi <phil@secdev.org> ## This program is published under a GPLv2 license import re from dadict import DADict from error import log_loading ############ ## Consts ## ############ ETHER_ANY = "\...
jjgomera/pychemqt
lib/EoS/Cubic/RKTwu.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- r"""Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwa...
gaeun/open-event-orga-server
app/views/users/export.py
from flask import Blueprint from flask import flash from flask import make_response, render_template from flask_login import current_user from markupsafe import Markup from app.helpers.data_getter import DataGetter from app.helpers.auth import AuthManager from app.helpers.exporters.ical import ICalExporter from app.he...
mm10ws/ImPy
ImAdd.py
__author__ = 'Mayur M' import ImgIO def add(image1, image2): # add two images together if image1.width == image2.width and image1.height == image2.height: return_red = [] return_green = [] return_blue = [] for i in range(0, len(image1.red)): tmp_r = image1.red[i] + ima...
junzis/pyModeS
pyModeS/decoder/allcall.py
""" Decode all-call reply messages, with downlink format 11 """ from pyModeS import common def _checkdf(func): """Ensure downlink format is 11.""" def wrapper(msg): df = common.df(msg) if df != 11: raise RuntimeError( "Incorrect downlink format, expect 11, got {}"...
aouyar/pybackup
pybackup/plugins/mysql.py
"""pybackup - Backup Plugin for MySQL Database """ import os from pybackup import errors from pybackup import utils from pybackup.logmgr import logger from pybackup.plugins import BackupPluginBase from pysysinfo.mysql import MySQLinfo __author__ = "Ali Onur Uyar" __copyright__ = "Copyright 2011, Ali Onur Uyar" __cr...
ReservoirWebs/GrowChinook
Test_test.py
#!/usr/bin/python import os import glob import cgi import PrintPages_test as pt address = cgi.escape(os.environ["REMOTE_ADDR"]) script = "Main Model Form" pt.write_log_entry(script, address) pt.print_header('GrowChinook', 'Std') pt.print_full_form(None, None, 'in', 'RunModel.py') extension = 'csv' os.chdir('uploads')...
ShengRang/c4f
leetcode/combination-sum-ii.py
# coding: utf-8 class Solution(object): @staticmethod def dfs(candidates, target, vis, res, cur_idx, sum): if sum > target: return if sum == target: ans = [candidates[i] for i in cur_idx if i >= 0] res.append(ans) return if sum < target: ...
RYLF/pythontip
33.py
# coding=utf-8 # Title:大幂次运算 # 给你两个正整数a(0 < a < 100000)和n(0 <= n <=100000000000),计算(a^n) % 20132013并输出结果 import math # Test a,n =10000,10000000 # Answer ret = 1 #余数 def PowerMod(a, n, ret): if n == 0: return ret if n % 2: # n为奇数 ret = ret * a % 20132013 return PowerM...
vasili-v/ctauto
test/test_parser.py
import unittest from ctauto.exceptions import CTAutoMissingEndOfMetablockError, \ CTAutoBrokenEndOfMetablockError, \ CTAutoInvalidMetablockError, \ CTAutoInvalidIdError, \ CTAutoMissingEndOfStringErr...
mattsch/Sickbeard
cherrypy/test/test_logging.py
"""Basic tests for the CherryPy core: request handling.""" from cherrypy.test import test test.prefer_parent_path() import os localDir = os.path.dirname(__file__) import cherrypy access_log = os.path.join(localDir, "access.log") error_log = os.path.join(localDir, "error.log") # Some unicode strings. ...
jeremiah-c-leary/vhdl-style-guide
vsg/rules/generic/rule_002.py
from vsg.rules import token_indent from vsg import token lTokens = [] lTokens.append(token.generic_clause.generic_keyword) class rule_002(token_indent): ''' This rule checks the indent of the **generic** keyword. **Violation** .. code-block:: vhdl entity fifo is generic ( ...
sramkrishna/eidisi
scripts/meson_post_install.py
#!/usr/bin/env python3 import os import pathlib import sysconfig import compileall import subprocess prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local')) datadir = prefix / 'share' destdir = os.environ.get('DESTDIR', '') if not destdir: print('Compiling gsettings schemas...') subproces...
testmana2/test
Plugins/VcsPlugins/vcsMercurial/HgCopyDialog.py
# -*- coding: utf-8 -*- # Copyright (c) 2010 - 2015 Detlev Offenbach <detlev@die-offenbachs.de> # """ Module implementing a dialog to enter the data for a copy or rename operation. """ from __future__ import unicode_literals import os.path from PyQt5.QtCore import pyqtSlot from PyQt5.QtWidgets import QDialog, QDia...
trungnt13/BAY2-uef17
utils.py
# =========================================================================== # This file contain some utilities for the course # =========================================================================== from __future__ import print_function, division, absolute_import import os import sys import time import shutil f...
microwaveabletoaster/dunces-and-dungeons
dunces-and-dungeons.py
from dungeon.dungeon import Dungeon, Hub from entity.player.players import Player, Party import entity.item.items as items import sys, os import base import web.server try: import dill except: dill = None PARTY = Party() class Manager: def __init__(self): self.checked = False def get_current_release(self): ...
satriaphd/bgc-learn
bgc-learn.py
import os import sys import shutil import straight.plugin import numpy as np import pkg_resources from os import path from core import utils from core import argparser from core import log from core import parser def main(): ## Parse arguments ap = argparser.init_arg_parser() options = ap.parse_args() ...
ebigelow/LOTlib
LOTlib/Hypotheses/Lexicon/RecursiveLexicon.py
from SimpleLexicon import SimpleLexicon from LOTlib.Evaluation.EvaluationException import RecursionDepthException class RecursiveLexicon(SimpleLexicon): """ A lexicon where word meanings can call each other. Analogous to a RecursiveLOTHypothesis from a LOTHypothesis. To achieve this, we require the LOThy...
kanishkarj/Rave
Qt_Designer_files/main_design.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'main.ui' # # Created by: PyQt4 UI code generator 4.12.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): ...
SergeySatskiy/codimension
codimension/utils/config.py
# -*- coding: utf-8 -*- # # codimension - graphics python two-way code editor and analyzer # Copyright (C) 2010-2017 Sergey Satskiy <sergey.satskiy@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 Softw...
MLOrsini/ProjetWEB
INSport/tableaubord/migrations/0042_auto_20170507_2352.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2017-05-07 23:52 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tableaubord', '0041_auto_20170507_2344'), ] operations = [ mi...
CopyChat/Plotting
Python/download_era-interim.py
#!/usr/bin/python import os from ecmwfapi import ECMWFDataServer server = ECMWFDataServer() time=["06"] year=["2013"] param=["129.128","130.128","131.128","132.128","157.128","151.128"] nam=["hgt","air","uwnd","vwnd","rhum","psl"] #month=["01","02","03","04","05","06","07","08","09","10","11","12"] for y in year: ...
antonszilasi/honeybeex
honeybeex/honeybee/radiance/command/gensky.py
# coding=utf-8 from _commandbase import RadianceCommand from ..datatype import RadiancePath, RadianceTuple from ..parameters.gensky import GenskyParameters import os class Gensky(RadianceCommand): u""" gensky - Generate an annual Perez sky matrix from a weather tape. The attributes for this class and th...
bradrowesf/AnkiDeckMaker
tests/notetranslator_tests.py
from nose.tools import * from DeckMaker.notetranslator import NoteTranslator def setup(): print "SETUP!" def teardown(): print "TEAR DOWN!" def test_basic(): t = NoteTranslator() assert_equal(t.GetMidiCodeForHumans("E5"),64) assert_equal(t.GetMidiCodeForHumans("C1"),12) assert_equal(t.GetM...
CaesarTjalbo/musictagger
mp3names/model_classes.py
# -*- coding: utf-8 -*- import sys import os import logging import random import PyQt4 from PyQt4.QtCore import * #from PyQt4.QtCore import QAbstractTableModel import constants class Model(QAbstractTableModel): keys = list() modelType = None def __init__(self, parent = None): ''' ''' ...
byDimasik/Magic_Ping
client.py
import socket import argparse import sys import magic_ping import os import settings import signal import logging import struct logging.basicConfig(format=u'%(levelname)-8s [%(asctime)s] %(message)s', level=logging.DEBUG, filename=u'client.log') # Обработка CTRL+C def signal_handler(signal, frame): print("\nSTOP...
cloudnull/tribble-api
tribble/api/views/zones_rest.py
# ============================================================================= # Copyright [2013] [Kevin Carter] # License Information : # This software has no warranty, it is provided 'as is'. It is your # responsibility to validate the behavior of the routines and its accuracy # using the code provided. Consult the ...
PlushBeaver/FanFicFare
fanficfare/adapters/adapter_literotica.py
# -*- coding: utf-8 -*- # Copyright 2013 Fanficdownloader team, 2015 FanFicFare team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
parpg/parpg
parpg/components/container.py
# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be...
Madpilot0/EVE-Farm
app.py
#!/usr/bin/env python from flask import Flask, render_template, request, jsonify, session, redirect, escape, url_for import MySQLdb import bcrypt from esipy import App from esipy import EsiClient from esipy import EsiSecurity from esipy.exceptions import APIException import time import json import requests import datet...
stuckj/dupeguru
qt/base/details_dialog.py
# Created By: Virgil Dupras # Created On: 2010-02-05 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/g...
mmartinortiz/pyePuck
examples/line_follower.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # line_follower.py # # Copyright 2011 Manuel Martín Ortiz <mmartinortiz@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 # ...
UCNA/main
Scripts/plotters/LarmorClipping.py
#!/sw/bin/python2.7 import sys sys.path.append("..") from ucnacore.PyxUtils import * from math import * from ucnacore.LinFitter import * #from UCNAUtils import * from bisect import bisect from calib.FieldMapGen import * def clip_function(y,rho,h,R): sqd = sqrt(rho**2-y**2) if sqd==0: sqd = 1e-10 return h*rho**2...
VPAC/pbs_python
src/PBSQuery.py
# # Authors: Roy Dragseth (roy.dragseth@cc.uit.no) # Bas van der Vlies (basv@sara.nl) # # SVN INFO: # $Id$ # """ Usage: from PBSQuery import PBSQuery This class gets the info from the pbs_server via the pbs.py module for the several batch objects. All get..() functions return an dictionary with id as key a...
yeyanchao/calibre
src/calibre/gui2/preferences/look_feel_ui.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/yc/code/calibre/calibre/src/calibre/gui2/preferences/look_feel.ui' # # Created: Thu Oct 25 16:54:55 2012 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui...
qbeenslee/Nepenthes-Server
config/configuration.py
# coding:utf-8 """ Author : qbeenslee Created : 2014/12/12 """ import re # 客户端ID号 CLIENT_ID = "TR5kVmYeMEh9M" ''' 传输令牌格式 加密方式$迭代次数$盐$结果串 举个栗子: ====start==== md5$23$YUXQ_-2GfwhzVpt5IQWp$3ebb6e78bf7d0c1938578855982e2b1c ====end==== ''' MATCH_PWD = r"md5\$(\d\d)\$([a-zA-Z0-9_\-]{20})\$([a-f0-9]{32}...
UnbDroid/robomagellan
Codigos/Raspberry/desenvolvimentoRos/devel/lib/python2.7/dist-packages/tf2_ros/__init__.py
# -*- coding: utf-8 -*- # generated from catkin/cmake/template/__init__.py.in # keep symbol table as clean as possible by deleting all unnecessary symbols from os import path as os_path from sys import path as sys_path from pkgutil import extend_path __extended_path = "/home/pi/Documents/desenvolvimentoRos/src/tf2_r...
timbotron/ICLS
framework.py
# This file is part of ICLS. # # ICLS 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. # # ICLS is distributed in the hope that it will ...
iLoop2/ResInsight
ThirdParty/Ert/devel/python/python/ert/enkf/enkf_main.py
# Copyright (C) 2012 Statoil ASA, Norway. # # The file 'ecl_kw.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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...
Uruwolf/pyshop
products/admin.py
''' This file is part of pyShop pyShop 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. pyShop is distributed in the hope that it will be us...
Alberto-Beralix/Beralix
i386-squashfs-root/usr/share/pyshared/oneconf/packagesethandler.py
# Copyright (C) 2010 Canonical # # Authors: # Didier Roche <didrocks@ubuntu.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; version 3. # # This program is distributed in the hope that it...
the-new-sky/BlogInPy
markdown/extensions/smartLegend.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import markdown from markdown.treeprocessors import Treeprocessor from markdown.blockprocessors import BlockProcessor import re from markdown import util import xml.etree.ElementTree as ET import copy from markdown.inlinepatterns im...
mgautierfr/devparrot
devparrot/core/ui/statusBar.py
# This file is part of DevParrot. # # Author: Matthieu Gautier <matthieu.gautier@devparrot.org> # # DevParrot 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 ...
michellab/SireUnitTests
unittests/SireIO/test_mol2.py
from Sire.Base import * from Sire.IO import * from Sire.Mol import * from glob import glob from nose.tools import assert_equal, assert_almost_equal # Check that we have Mol2 support in this version of Sire. has_mol2 = True try: p = Mol2() except: # No Mol2 support. has_mol2 = False # General test of abi...
valesi/electrum
gui/kivy/uix/dialogs/create_restore.py
''' Dialogs and widgets Responsible for creation, restoration of accounts are defined here. Namely: CreateAccountDialog, CreateRestoreDialog, RestoreSeedDialog ''' from functools import partial from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectPrope...
fr500/mgba
src/platform/python/mgba/core.py
# Copyright (c) 2013-2016 Jeffrey Pfau # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from ._pylib import ffi, lib from . import tile from cached_property import cach...
arkharin/OpenCool
scr/logic/components/expansion_valve/theoretical.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Define the Expansion Valve component. """ from scr.logic.components.component import Component as Cmp from scr.logi...
KWierso/treeherder
tests/etl/conftest.py
import datetime import pytest from tests.test_utils import create_generic_job from treeherder.model.models import Push @pytest.fixture def perf_push(test_repository): return Push.objects.create( repository=test_repository, revision='1234abcd', author='foo@bar.com', time=datetime....
jgmize/kuma
kuma/wiki/models.py
import hashlib import json import sys import traceback from datetime import datetime, timedelta from functools import wraps from uuid import uuid4 import newrelic.agent import waffle from constance import config from django.apps import apps from django.conf import settings from django.core.exceptions import Validation...
Metronus/metronus
Metronus-Project/metronus_app/model/goalEvolution.py
from django.db import models from metronus_app.model.actor import Actor from metronus_app.model.task import Task class GoalEvolution(models.Model): """ Each time the goal or the price per unit/hour from a task is changed, a new entry is created in the log Maybe should have been named TaskLog, but... "...
hipsterware/scoreline
toys/corpscore.py
#!/usr/bin/env python import csv import json import sys import click def score(company, sexbiases): """ Given a company record with board of directors and executive names, return our guess of the % of governance that is male. Since names are not always unambiguous determinants of sex, we also r...
ViaFerrata/DL_pipeline_TauAppearance
scraps/multi_gpu/multi_gpu.py
# -*- coding: utf-8 -*- """ Multi-gpu code for Keras/TF. From https://github.com/avolkov1/keras_experiments """ # MODIFIED. Inspiration taken from the ref link below. # ref: https://raw.githubusercontent.com/kuza55/keras-extras/master/utils/multi_gpu.py @IgnorePep8 # The inspirational one carried license: # Apache ...
co-ment/comt
src/cm/migrations/0003_update_keys_to_textversion.py
from south.db import db from django.db import models from cm.models import * class Migration: def forwards(self, orm): "Write your forwards migration here" for tv in orm.TextVersion.objects.all(): tv.key = orm.TextVersion.objects._gen_key() tv.adminkey = orm.T...
odoousers2014/LibrERP
l10n_it_sale/wizard/confirmation.py
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) 2013-2014 Didotech SRL (info at didotech.com) # All Rights Reserved. # # WARNING: This program as such is intended to be used by professional # programmers who take the who...
fidelcoria/AYFM-Scheduling
ScheduleParsing/scripts/schedule/convert_docx.py
#https://python-docx.readthedocs.io/en/latest/user/install.html #python-docx may be installed with pip if you have it available: # pip install python-docx #python-docx can also be installed using easy_install, although this is #discouraged: # easy_install python-docx #If neither pip nor easy_install is available, it...
emilydolson/forestcat
pyrobot/system/serial/serialwin32.py
#! python #Python Serial Port Extension for Win32, Linux, BSD, Jython #serial driver for win32 #see __init__.py # #(C) 2001-2003 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt import win32file # The base COM port and file IO functions. import win32event # We use ...
bameda/monarch
back/settings/common.py
import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/ ADMINS = ( ("David Barra...
ztp-at/RKSV
librksv/depparser.py
########################################################################### # Copyright 2017 ZT Prentner IT GmbH (www.ztp.at) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either ver...
goyal-sidd/BLT
website/migrations/0037_auto_20170813_0319.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-08-13 03:19 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('website', '0036_auto_20170813_0049'), ] operations = [ migrations.AlterField...
madprof/alpha-hub
prototype/pool.py
# |ALPHA| Hub - an authorization server for alpha-ioq3 # See files README and COPYING for copyright and licensing details. """ A throwaway thread pool with thread-local storage. Throwaway Tasks =============== A throwaway task is one you'd *like* to get done, but it's not a big deal if it doesn't actually get done. ...
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/scripts/process-one-mail.py
#!/usr/bin/python -S # # Copyright 2011 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Process one email message, read from stdin.""" import _pythonpath import sys from lp.services.config import config from lp.services.mail.helpers import...
shyba/cryptosync
cryptosync/tests/test_webserver.py
from twisted.trial.unittest import TestCase from mock import Mock from twisted.web.test.test_web import DummyRequest from twisted.web.http import OK, NOT_FOUND from cryptosync.resources import make_site def make_request(uri='', method='GET', args={}): site = make_site(authenticator=Mock()) request = DummyReq...
joshbohde/megaminer-framework
server/networking/Filter.py
""" Copyright (C) 2008 by Steven Wallace snwallace@gmail.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later vers...
hip-odoo/odoo
addons/delivery/models/delivery_carrier.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError from odoo.tools.safe_eval import safe_eval _logger = logging.getLogger(__name__) class DeliveryCarrier(mod...
suutari/shoop
shuup_tests/core/test_payments_api.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals import json from rest_fra...
moschlar/SAUCE
sauce/controllers/crc/selectors.py
''' @since: 2015-01-07 @author: moschlar ''' import sqlalchemy.types as sqlat import tw2.core as twc import tw2.bootstrap.forms as twb import tw2.jqplugins.chosen.widgets as twjc import sprox.widgets.tw2widgets.widgets as sw from sprox.sa.widgetselector import SAWidgetSelector from sprox.sa.validatorselector import ...
naresh21/synergetics-edx-platform
cms/djangoapps/contentstore/courseware_index.py
""" Code to allow module store to interface with courseware index """ from __future__ import absolute_import from abc import ABCMeta, abstractmethod from datetime import timedelta import logging import re from six import add_metaclass from django.conf import settings from django.utils.translation import ugettext_lazy,...
avanzosc/avanzosc6.1
avanzosc_net_weight_in_lots/__init__.py
# -*- encoding: utf-8 -*- ############################################################################## # # Avanzosc - Avanced Open Source Consulting # Copyright (C) 2011 - 2013 Avanzosc <http://www.avanzosc.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
ROB-Seismology/oq-hazardlib
openquake/hazardlib/gsim/atkinson_wald_2007.py
# coding: utf-8 # The Hazard Library # Copyright (C) 2012 GEM Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later...
tpltnt/ircensus
ircensus_channel_bot.py
#!/usr/bin/env python3 """ A simple bot to gather some census data in IRC channels. It is intended to sit in a channel and collect the data for statistics. :author: tpltnt :license: AGPLv3 """ import irc.bot import irc.strings from irc.client import ip_numstr_to_quad, ip_quad_to_numstr class CensusBot(irc.bot.Singl...
pculture/unisubs
utils/one_time_data.py
# Amara, universalsubtitles.org # # Copyright (C) 2017 Participatory Culture Foundation # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your op...
hasgeek/funnel
migrations/versions/3a6b2ab00e3e_session_proposal_one.py
"""Make session:proposal 1:1. Revision ID: 3a6b2ab00e3e Revises: 4dbf686f4380 Create Date: 2013-11-09 13:51:58.343243 """ # revision identifiers, used by Alembic. revision = '3a6b2ab00e3e' down_revision = '4dbf686f4380' from alembic import op def upgrade(): op.create_unique_constraint('session_proposal_id_key...
franek/weboob
weboob/tools/capabilities/gallery/genericcomicreader.py
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Noé Rubinstein # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at you...
dsanders11/django-newsletter
test_project/test_project/settings.py
import os test_dir = os.path.dirname(__file__) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(test_dir, 'db.sqlite3'), } } INSTALLED_APPS = [ 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.auth', 'django.contr...
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/services/webapp/tests/test_navigation.py
# Copyright 2010 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). __metaclass__ = type from zope.component import ( ComponentLookupError, getMultiAdapter, ) from zope.configuration import xmlconfig from zope.interface import ( im...