repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
davidam/python-examples
bokeh/openstreetmap.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2018 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...
project-owner/Peppy
ui/slider/equalizerslider.py
# Copyright 2016-2021 Peppy Player peppy.player@gmail.com # # This file is part of Peppy Player. # # Peppy Player 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 you...
Ebag333/Pyfa
eos/db/saveddata/user.py
# =============================================================================== # Copyright (C) 2010 Diego Duclos # # This file is part of eos. # # eos 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, ...
tvenkat/askbot-devel
askbot/search/postgresql/__init__.py
"""Procedures to initialize the full text search in PostgresQL""" from django.db import connection def setup_full_text_search(script_path): """using postgresql database connection, installs the plsql language, if necessary and runs the stript, whose path is given as an argument """ fts_init_query =...
cycloidio/cyclosible
cyclosible/playbook/migrations/0004_playbookrunhistory_log_url.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('playbook', '0003_auto_20151028_1735'), ] operations = [ migrations.AddField( model_name='playbookrunhistory', ...
wez3/domoboard
modules/api.py
#!/usr/bin/python # Provides all the API functionality callable through "/api" from flask import request from flaskext.auth import login_required import json, os, sys import security, charts, plugins, webconfig, domoticz apiDict = {} modules = {} def init(): global modules modules = plugins.loadPlugins() ...
ZachOhara/Project-Euler
python/p061_p070/problem062.py
import itertools def main(): #print(permutations(41063625)) #print([isCube(i) for i in [41063625, 56623104, 66430125]]) #print(hasCubicPermutations(41063625, 3)) i = 1 while not hasCubicPermutations(i ** 3, 5): i += 1 print(i) print(i, i ** 3) def hasCubicPermutations(n, p): cubesCount = 0 for i in set(p...
jbu/personis
personis/examples/aelog/httplib2/__init__.py
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
tycho/yubioath-desktop
yubioath/gui/messages.py
# Copyright (c) 2014 Yubico AB # 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 3 of the License, or # (at your option) any later version. # # This program...
giuva90/TreeBot
bot.py
#!/usr/bin/python # -*- coding: iso-8859-1 -*- import configparser from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, RegexHandler, ConversationHandler from telegram import (ReplyKeyboardMarkup, ReplyKeyboardRemove) from copy import deepcopy import logging import logging.handlers from decisionT...
DavidAlt/ITG
python/test-gui-template-as-text.py
# -*- coding: utf-8 -*- """ Created on Tue Nov 27 11:19:54 2018 @author: david """ from PyQt5 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(800, 600) self.centralwidget = QtWidgets.QWidge...
tommyjasmin/polar2grid
py/polar2grid_core/polar2grid/core/constants.py
#!/usr/bin/env python # encoding: utf-8 """Module to store all constants. Any constant needed in more than one component, or potentially more than one part, of polar2grid should be defined here. Rules/Preferences: - All values lowercase - strings - user-legible (assume that they may be printed in log mess...
bmaia/rext
core/updater.py
#This file is part of REXT #updater.py - script that handles updating of REXT and it's components #Author: Ján Trenčanský #License: GNU GPL v3 import subprocess import time import re import os import interface.utils import core.globals from interface.messages import print_blue #Pull REXT from git repo def update_re...
7fever/script.pseudotv.live
utilities.py
# Copyright (C) 2015 Kevin S. Graer # # # This file is part of PseudoTV Live. # # PseudoTV 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 ver...
sergeyfarin/pyqt-fit
setup.py
#!/usr/bin/env python from setuptools import setup #from path import path #with (path(__file__).dirname() / 'pyqt_fit' / 'version.txt').open() as f: #__version__ = f.read().strip() import os.path version_filename = os.path.join(os.path.dirname(__file__), 'pyqt_fit', 'version.txt') with open(version_filename, "...
Rosebotics/cwc-projects
lego-ev3/examples/analog_sensors/ir_sensor/print_beacon_seeking.py
#!/usr/bin/env python3 """ The goal of this example is to show you the syntax for IR seeking readings. When using IR-SEEK with a remote control you get both heading and distance data. The code below shows the syntax for beacon seeking. Additionally it's good to play with a demo so that you can see how well or not we...
bengosney/rhgd3
gardens/migrations/0024_auto_20180215_2316.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2018-02-15 23:16 from __future__ import unicode_literals from django.db import migrations import image_cropping.fields class Migration(migrations.Migration): dependencies = [ ('gardens', '0023_auto_20180215_2314'), ] operations = [ ...
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Lib/macpath.py
"""Pathname and path-related operations for the Macintosh.""" import os from stat import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile", "walk","exp...
Null01/detect-polygons-from-image
src/generate-polygons/vectorize-img-03.py
''' This program illustrates the use of findContours and drawContours. The original image is put up along with the image of drawn contours. Usage: contours.py A trackbar is put up which controls the contour level from -3 to 3 ''' import numpy as np import cv2 name_file_tile = "0.45-nd.png" file_tile = "../../wp-...
mdlawson/autojump
install.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os import platform import shutil import sys sys.path.append('bin') from autojump_argparse import ArgumentParser SUPPORTED_SHELLS = ('bash', 'zsh', 'fish') def cp(src, dest, dryrun=False): print("copying file: %s -> %s" ...
gburd/dbsql
src/py/pydbsql/dbapi2.py
#-*- coding: ISO-8859-1 -*- # # DBSQL - A SQL database engine. # # Copyright (C) 2007-2008 The DBSQL Group, Inc. - All rights reserved. # # This library 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 ...
duyuan11/ford
setup.py
from setuptools import setup, find_packages from codecs import open # To use a consistent encoding from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup(...
intelligent-agent/redeem
redeem/Stepper.py
#!/usr/bin/env python """ A Stepper Motor Driver class for Replicape. Author: Elias Bakken email: elias(dot)bakken(at)gmail(dot)com Website: http://www.thing-printer.com License: GNU GPL v3: http://www.gnu.org/copyleft/gpl.html Redeem is free software: you can redistribute it and/or modify it under the terms of the...
jedie/DrQueueIPython
DrQueue/__init__.py
# -*- coding: utf-8 -*- """ DrQueue main module Copyright (C) 2011-2013 Andreas Schroeder This file is part of DrQueue. Licensed under GNU General Public License version 3. See LICENSE for details. """ import platform import os import sys import smtplib import json from email.mime.text import MIMEText from .client...
zapier/transformer
transformer/transforms/string/phone_number_extract.py
# -*- coding: utf-8 -*- import re from transformer.registry import register from transformer.transforms.base import BaseTransform # updated to include seperate regexes - testing is much easier here: # orig and default (UNI1): https://regex101.com/r/FCS4px/1 # uni2: https://regex101.com/r/sk6MVY/1 # na: https://regex1...
JonasWallin/logisticnormal
logisticnormal/PurePython/priors.py
''' Created on Jul 5, 2014 updated: May 28, 2015: added AMCMC @author: jonaswallin ''' import numpy as np import numpy.random as npr from ..utils.gammad import ln_gamma_d def f_prior_nu(x, nu=0.01): """ deafult prior for nu which is gamma returns : log of prior """ return -nu*x class n...
gljohn/meterd
meterd/parser/currentcost.py
''' Module ''' import re import logging class CurrentCost: ''' Class ''' ''' def __init__(self, data=None, logger=None): ''' Method ''' self._data = data self.logger = logger or logging.getLogger(__name__) self.time = None self.uid = None self.value = None '''...
Turgon37/SMSShell
SMSShell/commands/help.py
# -*- coding: utf8 -*- # This file is a part of SMSShell # # Copyright (c) 2016-2018 Pierre GINDRAUD # # SMSShell 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...
lypnol/adventofcode-2016
day-5/part-2/jules.py
from submission import Submission class JulesSubmission(Submission): def author(self): return 'Jules' def run(self, s): import hashlib salt = s.strip() password = [0]*8 indexChanged = [] index = 0 while(len(indexChanged) < 8): md5 = hashlib...
dholm/voidwalker
voidwalker/backends/test/target.py
# (void)walker unit test backend # Copyright (C) 2012 David Holm <dholmster@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...
CQT-Alex/GSN-heatmap
gomsurveyplot.py
''' gomsurveyplot.py: This program creates the sky heatmap plot from the GomSpace survey data. input: A CSV file containing the sky survey data generated by the survey program provided by GomSpace. output: A heatmap plot of the input data. ...
ESSolutions/ESSArch_Core
ESSArch_Core/essxml/ProfileMaker/migrations/0007_auto_20160908_1428.py
""" ESSArch is an open source archiving and digital preservation system ESSArch Copyright (C) 2005-2019 ES Solutions AB 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...
hforge/ikaaro
scripts/icms-stop.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (C) 2005-2007 Juan David Ibáñez Palomar <jdavid@itaapy.com> # Copyright (C) 2007 Sylvain Taverne <sylvain@itaapy.com> # Copyright (C) 2008 David Versmisse <david.versmisse@itaapy.com> # # This program is free software: you can redistribute it and/or modify # it ...
launchar/abeja
abeja/abeja/server/core.py
''' Author: Hoa V. Do Copyright (c) 2014 Hoa V. Do <vit@launchar.com> Project: abeja Module: server.core Core library of Abeja server This file is part of Abeja. Abeja 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...
shuqin/pystudy
pystudy/basic/to100.py
import random import sys sys.setrecursionlimit(10000) UPLIMIT = 10000 NUMBERS = 500 NUMBER_RANGE = (1,UPLIMIT/4) def randNums(n): return [randGen(NUMBER_RANGE[0], NUMBER_RANGE[1]) for i in range(n)] def randGen(start, end): return random.randint(start, end) def solve(numlist): if UPLIMIT >= 1000 and...
cjaymes/pyscap
src/scap/model/oval_5/DeprecatedInfoElement.py
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
swegener/sigrok-meter
multiplotwidget.py
## ## This file is part of the sigrok-meter project. ## ## Copyright (C) 2015 Jens Steinhauser <jens.steinhauser@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...
TheLazyHase/dragon_dice_simulator
business/dice/face/missile_with_special/bullseye.py
# -*- coding: utf-8 *-* # Copyright (c) 2013 Tisserant Pierre # # This file is part of Dragon dice simulator. # # Dragon dice simulator 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 ve...
timwee/emacs-starter-kit-mr-flip-forked
vendor/rope/ropetest/builtinstest.py
import unittest from rope.base import pyobjects, builtins from ropetest import testutils class BuiltinTypesTest(unittest.TestCase): def setUp(self): super(BuiltinTypesTest, self).setUp() self.project = testutils.sample_project() self.pycore = self.project.pycore self.mod = testut...
Erotemic/local
depricated/speech/Examples/notepad_example.py
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly 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 3 of the...
tarzenda/gasp
tests/mockbackends.py
# -*- coding: utf-8 -*- # # This program is part of GASP, a toolkit for newbie Python Programmers. # Copyright (C) 2009, the GASP Development Team # # 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 Foundatio...
lcpt/xc
python_modules/import_export/sciaXML/scia_loads/LoadCaseContainer.py
# -*- coding: utf-8 -*- #Based on sXML-master projet on gitHub __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2015 LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2015 LCPT" __license__= "GPL" __versio...
bostonlink/nwmaltego
nw_phrase_2_threat.py
#!/usr/bin/env python # Copyright (C) 2012 nwmaltego Developer. # This file is part of nwmaltego - https://github.com/bostonlink/nwmaltego # See the file 'LICENSE' for copying permission. # Maltego Phrase to NW Threat # Author: David Bressler (@bostonlink) import sys import urllib2, urllib, json from datetime import ...
ampron/nflstat
simulator_NFL.py
#!/usr/bin/python # -*- encoding: UTF-8 -*- '''NFL Simulator List of classes: -none- List of functions: main ''' # built-in modules import random import math from pprint import pprint # third-party modules import numpy as np from scipy.stats import skew, kurtosis from scipy.special import erf, er...
aslab/rct
higgs/branches/ros-groovy/higgs_gazebo_simulation/rqt_robot_plugins/rqt_robot_monitor/src/rqt_robot_monitor/robot_monitor.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
OsirisSPS/osiris-sps
client/data/extensions/148B613D055759C619D5F4EFD9FDB978387E97CB/scripts/oml/rotator.py
import os import osiris import globalvars class OmlRotator(osiris.OMLHtmlWrapper): def __init__(self, tag): osiris.OMLHtmlWrapper.__init__(self, tag, "div", False, "", "", "") def processHtml(self, item, context): extensionID = globalvars.extension.getID().getString() context.page.addJavascript("/...
akamensky/sssd
src/config/SSSDConfigTest.py
#!/usr/bin/env python ''' Created on Sep 18, 2009 @author: sgallagh ''' import unittest import os import shutil import tempfile from stat import * import sys srcdir = os.getenv('srcdir') if srcdir: sys.path.insert(0, "./src/config") srcdir = srcdir + "/src/config" else: srcdir = "." import SSSDConfig d...
flass/agrogenom
pipeline/scripts_agrogenom/3_Ananalysis_of_genome_histories/phyloprofile_to_db.py
#!/usr/bin/python """to build genome.phylogenetic_profile table in agrogenomdb""" import sys, os, tree2 nfphyloprofile = sys.argv[1] nfout = sys.argv[2] fphyloprofile = open(nfphyloprofile, 'r') fout = open(nfout, 'w') dboolstr = {True:'T', False:'F', '1':'T', '0':'F'} header = fphyloprofile.readline().rstrip('\n')...
LondoMundo/githubFrontendPy
gitGUI.py
import wx import os class bucky(wx.Frame): def __init__(self, parent, id): wx.Frame.__init__(self, parent, id, 'Git GUI', size =(500,500)) panel = wx.Panel(self) gitAddB = wx.Button(panel, label = "add", pos = (0,0), size =(60,60)) gitCommitB = wx.Button(panel, label="commit", pos ...
munhyunsu/WorkLogger
src/basescanner/base_scanner.py
#!/usr/bin/python3 import configparser # ConfigParser import socket # socket import os # path.exists import sys # exit import struct # unstruct import logging # log class BaseScanner(object): """MAC 주소를 스캔하는 클래스 """ # 스니핑 소켓 생성 # @arg: socket - interface 가 있는 config def _create_socket(self): ...
bradhowes/pyslimp3
server/ClientPersistence.py
# # Copyright (C) 2009 Brad Howes. # # This file is part of Pyslimp3. # # Pyslimp3 is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 3, or (at your option) any later version. # # Pyslimp3 is distr...
d-kiss/candyland
trees/binary_tree.py
from immutable import Immutable class BinaryTree(Immutable): """Immutable Binary Tree. Left child always smaller than the parent. Right child always bigger than the parent. Each element exists only once in a binary tree. Attributes: left (BinaryTree): left node. right (BinaryTree...
mkuron/espresso
testsuite/python/random_pairs.py
# Copyright (C) 2010-2018 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 v...
openearth/delft3d-gt-server
delft3dworker/migrations/0008_delft3dworker_info.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-02-04 10:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("delft3dworker", "0007_delft3dworker_workerid"), ] operations = [ migrations....
beerbauf/Arduino-SC-Interface
src/SerialComunication.py
''' Project: Arduino SC Interface - A GUI for Arduino serial comunication @author: Andrea Cirillo <sabageek.blogspot.com> @copyright: 2012 Andrea Cirillo @license: GPL-3 This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as p...
nhsb1/PatternTargetFinder
ptf.py
from argparse import ArgumentParser from yahoo_finance import Share import pyperclip import urllib2 from bs4 import BeautifulSoup currentrelease = 'Pattern Target Finder 1.2' #v1.2 - Added get earnings date function #v1.1 - Get's current delayed price from Yahoo_Finance # Allowed you to override price -p 123 # Copi...
andrewcbennett/iris
lib/iris/tests/test_cdm.py
# (C) British Crown Copyright 2010 - 2015, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
krischer/LASIF
conftest.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file has a two purpose: 1. Force the use of the "Agg" matplotlib backend for the tests. Otherwise lots of windows pop up. 2. Force OpenBLAS to use single threading. Otherwise it will deadlock in some cases. It will be run by pytest, as specified in the pytest...
petervaro/tup
src/tup.py
## INFO ## ## INFO ## # TODO: %o is not available in output, nor input strings, only in command # TODO: !-macro and ^-flags should only be available # at the beginning of a command #-- CHEATSHEET ----------------------------------------------------------------# # HOWTO: http://sublimetext.info/docs/en/referenc...
1337/yesterday-i-learned
leetcode/318m.py
# Hashing a string into a binary representation helps compare them in linear time, and storing the max length for each # binary representation in a hashmap is just icing on the cake class Solution: def maxProduct(self, words: List[str]) -> int: def string_to_bool(string): mask = 0b0 ...
distributed-system-analysis/pbench
lib/pbench/server/api/resources/query_apis/datasets_detail.py
from http import HTTPStatus from flask import jsonify from flask_restful import abort from logging import Logger from pbench.server import PbenchServerConfig, JSON from pbench.server.api.resources import Schema, Parameter, ParamType from pbench.server.api.resources.query_apis import ( CONTEXT, ElasticBase, ...
xmnlab/minilab
labtrans/daq/MultiChannelAnalogInput.py
# -*- coding: utf-8 -*- """ Created on Tue Oct 8 16:11:48 2013 @author: ivan """ import numpy import time from PyDAQmx.DAQmxFunctions import * from PyDAQmx.DAQmxConstants import * terminals = {} terminals['Dev1'] = ['Dev1/ai%s' % line for line in range(0, 2)] terminals['Dev2'] = ['Dev2/ai%s' % line for line in ra...
Seek/ValueTracker
hs.py
import tkinter as tk from tkinter import ttk from collections import namedtuple import sqlite3 from enum import Enum import re import datetime import logging import os import time # Regular expression we rely upon win_loss_pattern = r'PowerTaskList\.DebugPrintPower\(\) - TAG_CHANGE Entity=(.+) tag=PLAYSTATE value=...
pferreir/indico-backup
indico/MaKaC/plugins/Collaboration/Vidyo/pages.py
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; eith...
jrichte43/ProjectEuler
Problem-0081/solutions.py
__problem_title__ = "Path sum: two ways" __problem_url___ = "https://projecteuler.net/problem=81" __problem_description__ = "In the 5 by 5 matrix below, the minimal path sum from the top left to " \ "the bottom right, by , is indicated in bold red and is equal to 2427. " \ ...
clusterfudge/boomer
boomer/skills/wolfram_alpha/__init__.py
# Copyright 2016 Boomer AI, Inc. # # This file is part of Boomer Core. # # Boomer Core 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. ...
slightstone/SickRage
sickbeard/postProcessor.py
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
sim642/weechat
doc/docgen.py
#!/usr/bin/env python3 # # Copyright (C) 2008-2020 Sébastien Helleu <flashcode@flashtux.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 opti...
insomnia-lab/calibre
src/calibre/ebooks/docx/fields.py
#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import re from calibre.ebooks.docx.names import XPath, get class Field(obje...
pism/pism
examples/python/bed_deformation.py
#!/usr/bin/env python3 import PISM from PISM.util import convert from math import cos, pi # Simple testing program for Lingle & Clark bed deformation model. # Runs go for 150,000 years on 63.5km grid with 100a time steps and Z=2 in L&C model. # SCENARIOS: run 'python bed_deformation.py -scenario N' where N=1,2,3,4 a...
mckerrj/ansible
lib/ansible/executor/play_iterator.py
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
RaisingTheDerp/raisingthebar
root/devtools/WildcardSearch.py
from __future__ import generators import os import re import stat # # Useful function to return a list of files in a directory based on a dos-style wildcard like "*.txt" # # for name in WildcardSearch( "d:/hl2/src4/dt*.cpp", 1 ): # print name # def WildcardSearch( wildcard, bRecurse=0 ): # First find the base direc...
TokTok/toxcore
other/fun/bootstrap_node_info.py
#!/usr/bin/env python3 """ Copyright (c) 2014 by nurupo <nurupo.contributions@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the right...
mmgen/mmgen
mmgen/wallet/brain.py
#!/usr/bin/env python3 # # mmgen = Multi-Mode GENerator, a command-line cryptocurrency wallet # Copyright (C)2013-2022 The MMGen Project <mmgen@tuta.io> # Licensed under the GNU General Public License, Version 3: # https://www.gnu.org/licenses # Public project repositories: # https://github.com/mmgen/mmgen # http...
fabsx00/joern-tools
joerntools/mlutils/pythonEmbedder/PythonEmbedder.py
import os from FeatureArray import FeatureArray from FeatureArrayToMatrix import FeatureArrayToMatrix class Embedder: def embed(self, directory, tfidf = True): """ For a given directory containing a TOC and a data/ directory as, for example, created by joern-demux, create an e...
peter-reinholdt/propertyfit
gen_topology.py
#!/usr/bin/env python import re import json import argparse import numpy as np def parse_range(index_list): indices = [] string = "".join(index_list) terms = string.split(",") for term in terms: if "-" in term: start, end = [int(x) for x in term.split("-")] indices += l...
crisely09/horton
horton/espfit/test/test_mask.py
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2016 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
francocurotto/GraphSLAM
src/python-helpers/commons/g2o2lab.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 useful, but WITHOUT...
zomux/nlpy
nlpy/util/feature_container.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 NLPY.ORG # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html import numpy as np from line_iterator import LineIterator class FeatureContainer(object): def __init__(self, path=None, dtype="libsvm", feature_n=-1): s...
majerteam/sqla_inspect
sqla_inspect/py3o.py
# -*- coding: utf-8 -*- # * Authors: # * Arezki Feth <f.a@majerti.fr>; # * Miotte Julien <j.m@majerti.fr>; # * TJEBBES Gaston <g.t@majerti.fr> """ Py3o exporters >>> model = Company.query().first() >>> template = Template.query().first() >>> odt_file_datas = compile_template(model, template.data_obj...
cgogolin/ncpol2sdpa
ncpol2sdpa/__init__.py
"""Ncpol2SDPA ===== Provides 1. A converter from a polynomial optimization problems of commuting and noncommuting variables to a semidefinite programming relaxation. 2. Helper functions to define physics problems. """ __version__ = "1.11.1" from .faacets_relaxation import FaacetsRelaxation from .sdp_relaxation ...
ForgeGreensboro/forge-tool-control-api
access/serializers/MachineSerializer.py
""" Machine model serializer """ from __future__ import unicode_literals from rest_framework import serializers from access.models import Machine class MachineSerializer(serializers.ModelSerializer): """ Machine model (de)Serializer """ department = serializers.HyperlinkedRelatedField(many=False, ...
tvenkat/askbot-devel
askbot/management/commands/send_accept_answer_reminders.py
import datetime from django.core.management.base import NoArgsCommand from django.conf import settings as django_settings from askbot import models from askbot import const from askbot.conf import settings as askbot_settings from django.utils.translation import ugettext as _ from django.utils.translation import ungette...
zeldin/libsigrokdecode
decoders/spiflash/lists.py
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2015 Uwe Hermann <uwe@hermann-uwe.de> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the Li...
hemebond/kapua
forms.py
# coding=UTF-8 # Copyright 2011 James O'Neill # # This file is part of Kapua. # # Kapua 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....
noplay/gns3-gui
scripts/ssh_to_server.py
""" This script can be used to ssh to a cloud server started by GNS3. It copies the ssh keys for a server to a temp file on disk and starts ssh using the keys. Right now it only connects to the first cloud server listed in the config file. """ import getopt import os import sys from PyQt4 import QtCore, QtGui SCR...
t-wissmann/qutebrowser
tests/unit/misc/test_keyhints.py
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2020 Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software...
akhilaananthram/nupic.research
sound_encoder/live_sound_encoding_demo.py
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
elianerpereira/gtg
GTG/core/__init__.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # t...
cosven/FeelUOwn
feeluown/gui/tray.py
import logging import sys from PyQt5.QtCore import Qt, QEvent from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QSystemTrayIcon, QAction, QMenu, QApplication from feeluown.player import State from feeluown.gui.helpers import elided_text TOGGLE_APP_TEXT = ('激活主窗口', '隐藏主窗口') TOGGLE_PLAYER_TEXT = ('播放', '暂停') ...
tuxfux-hlp-notes/python-batches
archieves/batch-66/05.2-market.py
#!/usr/bin/python # pass: block filler - it does nothing. # logical operators - and/or print "welcome to the market" food_type = raw_input("please enter the item- meat/fish/chicken/veg: ") if food_type == 'meat': pass elif food_type == 'fish': print "welcome to the fish market." fish_type = raw_input("pl...
Vagab0nd/SiCKRAGE
tests/browser_tests.py
import logging import os import sys import unittest from sickchill.oldbeard import browser class BrowserTestAll(unittest.TestCase): """ Test methods in oldbeard.browser """ def setUp(self): self.here = os.path.normpath(os.path.dirname(__file__)) @unittest.skipUnless(os.name == 'nt', 'Tes...
danwchan/trail_of_cthulhu
mythos_website_upgrade/characterbirther/forms.py
from django.forms import ModelForm, inlineformset_factory, HiddenInput, ModelChoiceField from .models import BirthForm, SanityPillars, InnateAbility, StabilitySources class CharBirthForm(ModelForm): class Meta: model = BirthForm fields = ['name', 'pronoun', 'age', 'birthplace', 'drive', 'occupation...
feranick/SpectralMachine
Utilities/PlotRruffSpectraRound.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' ********************************************* * * PlotRruffSpectraRound * Plot Rruff spectra * Files must be in RRuFF * version: 20171208c * * By: Nicola Ferralis <feranick@hotmail.com> * *********************************************** ''' print(__doc__) import numpy ...
trombastic/PyScada
pyscada/modbus/migrations/0004_auto_20160115_0920.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('pyscada', '0010_auto_20160115_0918'), ('modbus', '0003_auto_20160115_0918'), ] operations = [ migrations.RenameField...
MaxTyutyunnikov/lino
obsolete/src/lino/apps/contacts/tables.py
## Copyright 2005-2006 Luc Saffre ## This file is part of the Lino project. ## Lino 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 versio...
pnwairfire/bluesky
bluesky/filtermerge/__init__.py
"""bluesky.filtermerge""" __author__ = "Joel Dubowy" import abc import logging from bluesky.config import Config class FiresActionBase(object, metaclass=abc.ABCMeta): """Base class for merging or filtering fires """ def __init__(self, fires_manager, fire_class): """Constructor args: ...
MaxTyutyunnikov/lino
obsolete/tests/8.py
# coding: latin1 ## Copyright 2003-2007 Luc Saffre ## This file is part of the Lino project. ## Lino 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) ...
qilicun/python
python2/PyMOTW-1.132/PyMOTW/datetime/datetime_datetime_math.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """Calculations with datetime values. """ __version__ = "$Id$" #end_pymotw_header import datetime today = datetime.datetime.today() print 'Today :', today yesterday = today - datetime.timedelta(days=1) print 'Yest...
zetaops/pyoko
tests/test_model_to_solr_schema.py
# -*- coding: utf-8 -*- """ """ # Copyright (C) 2015 ZetaOps Inc. # # This file is licensed under the GNU General Public License v3 # (GPLv3). See LICENSE.txt for details. from pyoko.conf import settings from pyoko.db.schema_update import SchemaUpdater from tests.data.solr_schema import test_data_solr_fields_debug_z...