repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
AthenaYe/UFLDL_Tutorial
Chap1_Supervised_Learning_and_Optimization/logistic_regression.py
#!/usr/bin/env python2.7 # -*- coding:utf-8 -*- import sklearn.datasets as skds import numpy as np import random import theano.tensor as T import theano import matplotlib.pyplot as plt import math #I don't know what the jesus 'housing.data' means so I used self-generated dataset x = np.arange(-50., 50., 1) y = np.arr...
PXke/invenio
invenio/modules/redirector/redirect_methods/goto_plugin_cern_hr_documents.py
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) a...
mineo/picard
picard/util/icontheme.py
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2006 Lukáš Lalinský # # 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...
ekohl/ganeti
lib/opcodes.py
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google 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. # ...
uml-robotics/player-2.1.3
libplayercore/bindings/java/parse.py
#!/usr/bin/env python import re import string import sys import os USAGE = 'USAGE: parse.y <player.h> <playercore_casts.i> <playercore_arraysofclasses.i> <Jplayercore> <playercore> <player.java>' if __name__ == '__main__': if len(sys.argv) != 7: print USAGE sys.exit(-1) infilename = sys.argv[1] outfi...
colloquium/spacewalk
backend/server/handlers/xmlrpc/errata.py
# # Copyright (c) 2008--2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
Titulacion-Sistemas/PracticasDjango
usuarios_logueados/usuarios/models.py
from django import forms from django.contrib.auth.models import User from django.forms import ModelForm from django.db import models # Create your models here. #EDICION DE MODELO USER User.add_to_class('usuario_sico', models.CharField(max_length=10, null=False, blank=False)) User.add_to_class('contrasenia_sico', mode...
ioanaantoche/muhaha
ioana/RecordAudio.py
import sys import time from naoqi import ALProxy IP = "nao.local" PORT = 9559 if (len(sys.argv) < 2): print "Usage: 'python RecordAudio.py nume'" sys.exit(1) fileName = "/home/nao/" + sys.argv[1] + ".wav" aur = ALProxy("ALAudioRecorder", IP, PORT) channels = [0,0,1,0] aur.startMicrophonesRecording(fileName...
paradiseOffice/Bash_and_Cplus-plus
CPP/full_examples/pyqt/chap07/findandreplacedlg.py
#!/usr/bin/env python3 # Copyright (c) 2008-9 Qtrac Ltd. All rights reserved. # This program or module 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 # version 3 of the Lic...
markes1977/conpot-master
conpot/core/loggers/stix_transform.py
# Copyright (C) 2013 Johnny Vestergaard <jkv@unixcluster.dk> # # 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 ...
wukong-m2m/NanoKong
tools/python/scripts/installer.py
#!/usr/bin/env python import sys, os sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master')) sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf')) print os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../../master/wkpf') from...
tweemeterjop/thug
thug/DOM/W3C/HTML/HTMLElement.py
#!/usr/bin/env python try: from io import StringIO except ImportError: try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import bs4 as BeautifulSoup import logging from thug.DOM.W3C.Element import Element from thug.DOM.W3C.Style.CSS.ElementCSSInlineStyl...
PoisonBOx/PyGames
2.Pie/drawLine.py
import sys import pygame from pygame.locals import * pygame.init() screen = pygame.display.set_mode((600, 500)) pygame.display.set_caption("Drawing Lines") screen.fill((0, 80, 0)) # draw the line color = 100, 255, 200 width = 8 pygame.draw.line(screen, color, (100, 100), (500, 400), width) pygame.dis...
JConwayAWT/PGSS14CC
lib/python/multimetallics/ase/cluster/cubic.py
""" Function-like objects that creates cubic clusters. """ import numpy as np from ase.data import reference_states as _refstate from ase.cluster.factory import ClusterFactory class SimpleCubicFactory(ClusterFactory): spacegroup = 221 xtal_name = 'sc' def get_lattice_constant(self): "Get the la...
Urinx/SomeCodes
Python/others/practice/finding_if_prime.py
#!/usr/bin/python3 import math import random def finding_prime(number): num=abs(number) if num<4: return True for x in range(2,num): if num%x == 0: return False return True def finding_prime_sqrt(number): num=abs(number) if num<4: return True for x in range(2,int(math.sqrt(num))+1): if number%x == 0: ...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/_dbus_bindings/UInt64.py
# encoding: utf-8 # module _dbus_bindings # from /usr/lib/python2.7/dist-packages/_dbus_bindings.so # by generator 1.135 """ Low-level Python bindings for libdbus. Don't use this module directly - the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop` and `dbus.mainloop.glib` modules, with a lower-le...
chebhou/Text-from-to-.XML
text_io_xml.py
bl_info = { "name" : "text objects to-from xml", "author" : "chebhou", "version" : (1, 0), "blender" : (2, 7, 3), "location" : "file->export->text to-from xml", "discription" : "copys an text objectx from-to xml file", "wiki_url" : " https://github.com/chebhou", "tracker_url" : "https://...
Lorquas/subscription-manager
test/fixture.py
from __future__ import print_function, division, absolute_import import difflib import locale import os import pprint import six import sys import tempfile try: import unittest2 as unittest except ImportError: import unittest # just log py.warnings (and pygtk warnings in particular) import logging try: ...
jotterbach/ExactDiagonalization_PolarizedFermionicDipolesOnZigZagChain
DiagonalizationMethods.py
# -*- coding: utf-8 -*- """ Created on Wed Jun 26 11:09:05 2013 @author: jotterbach """ from numpy import * from ED_HalfFilling import EigSys_HalfFilling from DotProduct import scalar_prod from multiprocessing import * from multiprocessing import Pool import matplotlib.pyplot as plt from ParallelizationTools import...
widelands/widelands
cmake/codecheck/rules/contrived_std_string_find.py
#!/usr/bin/python """Do not call std::string::find_first_of or std::string::find with a string of characters to locate that has the size 1. Use the version of std::string::find that takes a single character to locate instead. Same for find_last_of/rfind. """ error_msg = "Do not use find(\"a\"), use find('a')." reg...
mbaldessari/sarstats
sar_grapher.py
import hashlib import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.colors as colors import matplotlib.cm as cm from matplotlib.patches import Rectangle import os import shutil import tempfile fro...
MOA-2011/enigma2-plugin-extensions-openwebif
plugin/controllers/views/web/gettags.py
#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path try: import builtins as builtin except ImportError: import __builtin__ as builtin from os.path import getmtime, exists import time import types from Cheetah.Version import MinCompatib...
marios-zindilis/musicbrainz-django-models
musicbrainz_django_models/models/editor_subscribe_label_deleted.py
""" .. module:: editor_subscribe_label_deleted The **Editor Subscribe Label Deleted** Model. PostgreSQL Definition --------------------- The :code:`editor_subscribe_label_deleted` table is defined in the MusicBrainz Server as: .. code-block:: sql CREATE TABLE editor_subscribe_label_deleted ( editor...
3dfxsoftware/cbss-addons
mass_mailing/controllers/main.py
import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request class MassMailController(http.Controller): @http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none') def track_mail_open(self, mail_id, **post): """ Email tracking. """ mail_mail_stats...
miurahr/translate
translate/storage/poxliff.py
# # Copyright 2006-2009 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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 ...
mikf/gallery-dl
test/test_cookies.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2017-2022 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. import os import sys import unittest from unittes...
amites/nedcompost_wordpress
fabsettings.py
from os import path try: from lib.settings_build import Configure except ImportError: import sys from os.path import expanduser, join sys.path.append(join(expanduser("~"), 'workspace/automation/launchy')) from lib.settings_build import Configure class Default(Configure): def __init__(self):...
smorad/ast119
hw5.py
from numpy import * from matplotlib.pyplot import * import scipy.constants as sc import copy import scipy.integrate as integ # test sun/earth with hw5(1.989e30,5.972e24,149.6e6,0.0167,1000) def hw5(m1, m2, a, e, tmax, tstep=0.001, tplot=0.025, method='leapfrog'): if method != 'leapfrog' and method != 'odeint': ...
edwardbadboy/vdsm-ubuntu
tests/fileUtilTests.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...
meletakis/collato
esn/actstream/urls.py
try: from django.conf.urls import url, patterns except ImportError: from django.conf.urls.defaults import url, patterns from actstream import feeds from actstream import views from django.contrib.auth.decorators import login_required urlpatterns = patterns('actstream.views', # Syndication Feeds url(r...
mshcruz/LearnPythonTheHardWay
ex40.py
class Song(object): def __init__(self, lyrics): self.lyrics = lyrics def sing_me_a_song(self): for line in self.lyrics: print line happy_bday = Song(["Happy birthday to you", "I don't want to get sued", "So I'll stop right here"]) bulls_on_pa...
tradej/pcs
pcs/test/test_rule.py
from __future__ import absolute_import import os import sys import shutil import unittest import xml.dom.minidom parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, parentdir) from pcs_test_functions import pcs,ac import rule empty_cib = "empty.xml" temp_cib = "temp.xml" class D...
Shirling-VT/davitpy_sam
davitpy/gme/sat/poes.py
""" .. module:: poes :synopsis: A module for reading, writing, and storing poes Data .. moduleauthor:: AJ, 20130129 ********************* **Module**: gme.sat.poes ********************* **Classes**: * :class:`poesRec` **Functions**: * :func:`readPoes` * :func:`readPoesFtp` * :func:`mapPoesMongo` * :func:`...
hackersql/sq1map
comm1x/src/utils/session_handler.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...
dpogue/korman
korman/properties/modifiers/logic.py
# This file is part of Korman. # # Korman 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. # # Korman is distributed i...
bhermansyah/DRR-datacenter
avatar/tests.py
import os.path from django.test import TestCase from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.auth import get_user_model from avatar.settings import AVATAR_DEFAULT_URL, AVATAR_MAX_AVATARS_PER_USER from avatar.util import get_primary_avatar from avatar.models import...
jswetzen/sie-parse
petra_output.py
#!/usr/bin/env python3 """Output a CSV file that can be imported to Petra""" import os import sys import calendar import csv from csv_dict import CSVDict, CSVKeyMissing def split_csv(table_file='Tabell.csv'): """Split account, cost center and project into three tables""" account = [] cost_center = [] ...
geolovic/TProfiler
test/06_TProfiler_test.py
# -*- coding: utf-8 -*- """ José Vicente Pérez Granada University (Spain) March, 2017 Testing suite for profiler.py Last modified: 19 June 2017 """ import time import profiler as p import praster as pr import numpy as np import matplotlib.pyplot as plt print("Tests for TProfiler methods") def test01(): """...
quinox/weblate
weblate/accounts/models.py
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.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, eithe...
polyrabbit/WeCron
WeCron/wxhook/todo_parser/__init__.py
#coding: utf-8 from __future__ import unicode_literals, absolute_import import logging import json from django.utils.dateparse import parse_datetime from django.utils import timezone from wechatpy.exceptions import WeChatClientException from common import wechat_client from .local_parser import LocalParser from remind...
s-gogna/JST
mips/configurations.py
# This file is part of JST. # # JST 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. # # JST is distributed in the hope that it will b...
CaliOpen/CaliOpen
src/backend/components/py.pi/caliopen_pi/features/mail.py
# -*- coding: utf-8 -*- """Caliopen mail message privacy features extraction methods.""" from __future__ import absolute_import, print_function, unicode_literals import logging import pgpy from caliopen_main.pi.parameters import PIParameter from .helpers.spam import SpamScorer from .helpers.ingress_path import get_i...
sostenibilidad-unam/posgrado
posgradmin/posgradmin/migrations/0040_auto_20191120_2258.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2019-11-21 04:58 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('posgradmin', '0039_auto_20191120_2249'), ] operations = [ migrations.AlterModelOpt...
ic-hep/DIRAC
src/DIRAC/FrameworkSystem/private/monitoring/MonitoringCatalog.py
""" Interacts with sqlite3 db """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import six import sqlite3 import os import hashlib import random import time import DIRAC from DIRAC import gLogger, S_OK, S_ERROR from DIRAC.FrameworkSystem.private.monitorin...
adw0rd/lettuce-py3
tests/functional/test_terrain.py
# -*- coding: utf-8 -*- # <Lettuce - Behaviour Driven Development for python> # Copyright (C) <2010-2012> Gabriel Falcão <gabriel@nacaolivre.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 Foundatio...
Vagab0nd/SiCKRAGE
tests/notifier_tests.py
""" Test notifiers """ import unittest from sickchill.oldbeard import db from sickchill.oldbeard.notifiers.emailnotify import Notifier as EmailNotifier from sickchill.oldbeard.notifiers.prowl import Notifier as ProwlNotifier from sickchill.tv import TVEpisode, TVShow from sickchill.views.home import Home from tests ...
shoaibali/kodi.background.rotator
randombackground.py
import os, random rfilename=random.choice(os.listdir("/storage/pictures")) rextension=os.path.splitext(rfilename)[1] picturespath='/storage/pictures/' #TODO Probably dont need a forloop can possibly do random* #TODO What if the directory is empty? for filename in os.listdir(picturespath): if filename.startswith("ran...
mscuthbert/abjad
abjad/tools/developerscripttools/RenameModulesScript.py
# -*- encoding: utf-8 -*- import os from abjad.tools import documentationtools from abjad.tools import systemtools from abjad.tools.developerscripttools.DeveloperScript import DeveloperScript from abjad.tools.developerscripttools.ReplaceInFilesScript \ import ReplaceInFilesScript class RenameModulesScript(Develop...
hniemeyer/HardSphereSim
EventManager.py
""" Module defining the Event class which is used to manage collissions and check their validity """ from itertools import combinations from copy import copy from particle import Particle class EventParticle(object): def __init__(self, particle1, particle2): self.particle1 = particle1 self.pa...
stephanepechard/projy
projy/templates/DjangoProjectTemplate.py
# -*- coding: utf-8 -*- """ Projy template for PythonPackage. """ # system from datetime import date from os import mkdir, rmdir from shutil import move from subprocess import call # parent class from projy.templates.ProjyTemplate import ProjyTemplate # collectors from projy.collectors.AuthorCollector import AuthorCol...
smutt/WRL
topThick.py
#!/usr/bin/python # The file is part of the WRL Project. # # The WRL Project 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. # # ...
fsantini/rasPyCNCController
gcode/GCodeLoader.py
# rasPyCNCController # Copyright 2016 Francesco Santini <francesco.santini@gmail.com> # # This file is part of rasPyCNCController. # # rasPyCNCController 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 ...
encukou/freeipa
ipapython/config.py
# Authors: Karl MacMillan <kmacmill@redhat.com> # # Copyright (C) 2007 Red Hat # see file 'COPYING' for use and warranty information # # 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 ver...
Ichimonji10/robottelo
robottelo/config/base.py
"""Define and instantiate the configuration class for Robottelo.""" import logging import os import sys from logging import config from nailgun import entities, entity_mixins from nailgun.config import ServerConfig from robottelo.config import casts from six.moves.urllib.parse import urlunsplit, urljoin from six.moves...
gnowxilef/plexpy
plexpy/webserve.py
# This file is part of PlexPy. # # PlexPy 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. # # PlexPy is distributed in the hope t...
wmaier/treetools
trees/transformconst.py
"""treetools: Tools for transforming treebank trees. transformations: constants and utilities Author: Wolfgang Maier <maierw@hhu.de> """ from . import trees # Head rules for PTB (WSJ) from Collins (1999, p. 240) HEAD_RULES_PTB = { 'adjp' : [('left-to-right', 'nns qp nn $ advp jj vbn vbg adjp jjr np jjs dt fw rbr...
DragonRoman/rhevm-utils
rhev-keyring.py
#!/usr/bin/env python # # Author: Pablo Iranzo Gomez (Pablo.Iranzo@redhat.com) # # Description: Script for setting the keyring password for RHEV scripts # # Requires: python keyring # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
sujith7c/py-system-tools
en_mod_rw.py
#!/usr/bin/python import os,sys,re #Check the OS Version RELEASE_FILE = "/etc/redhat-release" RWM_FILE = "/etc/httpd/conf.modules.d/00-base.conf" if os.path.isfile(RELEASE_FILE): f=open(RELEASE_FILE,"r") rel_list = f.read().split() if rel_list[2] == "release" and tuple(rel_list[3].split(".")) < ('8','5'): pri...
Gatomlo/shareandplay
catalogue/migrations/0015_auto_20170415_1628.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-15 14:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalogue', '0014_auto_20170414_0845'), ] operations = [ migrations.AlterFi...
OLF-Bioinformatics/snp_analysis
binaries/snpTableMaker.py
#!/usr/bin/env python import os import random __author__ = 'duceppemo' class SnpTableMaker(object): """ Everything is ran inside the class because data structures have to be shared across parent and child process during multi threading """ def __init__(self, args): import os imp...
jcnix/abg
enemies.py
# -*- coding: utf-8 -*- # File: enemy.py # Author: Casey Jones # # Created on July 20, 2009, 4:48 PM # # This file is part of Alpha Beta Gamma (abg). # # ABG 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, ...
mazvv/travelcrm
travelcrm/views/accounts_items.py
# -*-coding: utf-8-*- import logging from pyramid.view import view_config, view_defaults from pyramid.httpexceptions import HTTPFound from . import BaseView from ..models import DBSession from ..models.account_item import AccountItem from ..lib.bl.subscriptions import subscribe_resource from ..lib.utils.common_utils...
OriHoch/pysiogame
game_boards/game070.py
# -*- coding: utf-8 -*- import classes.level_controller as lc import classes.game_driver as gd import classes.extras as ex import classes.board import random import pygame class Board(gd.BoardGame): def __init__(self, mainloop, speaker, config, screen_w, screen_h): self.level = lc.Level(self,mainloop,5,...
projecthamster/hamster
src/hamster-cli.py
#!/usr/bin/env python3 # - coding: utf-8 - # Copyright (C) 2010 Matías Ribecky <matias at mribecky.com.ar> # Copyright (C) 2010-2012 Toms Bauģis <toms.baugis@gmail.com> # Copyright (C) 2012 Ted Smith <tedks at cs.umd.edu> # This file is part of Project Hamster. # Project Hamster is free software: you can redistribut...
wiiiky/ydict
pydict/about.py
# encoding=utf-8 from gi.repository import Gtk from .i18n import _ class AboutDialog(Gtk.AboutDialog): def __init__(self, parent): super(AboutDialog, self).__init__(title=_('About'), parent=parent) self.set_modal(True) self.set_program_name('Ydict') self.set_authors(['Wiky L<wiii...
Turgon37/SMSShell
tests/test_smsshell_commands.py
# -*- coding: utf8 -*- import argparse import logging import pytest import SMSShell import SMSShell.commands def test_abstract_init(): """Test abstract init methods """ abs = SMSShell.commands.AbstractCommand(logging.getLogger(), object(), ...
dymkowsk/mantid
scripts/Interface/ui/reflectometer/refl_gui.py
# pylint: disable = too-many-lines, invalid-name, line-too-long, too-many-instance-attributes, # pylint: disable = too-many-branches,too-many-locals, too-many-nested-blocks from __future__ import (absolute_import, division, print_function) try: from mantidplot import * except ImportError: canMantidPlot = False...
Jonqora/whiskers
checks.py
from discord.ext import commands import discord.utils def is_owner_check(ctx): author = str(ctx.message.author) owner = ctx.bot.config['master'] return author == owner def is_owner(): return commands.check(is_owner_check) def check_permissions(ctx, perms): #if is_owner_check(ctx): # return...
bboalimoe/ndn-cache-policy
docs/sphinx-contrib/nwdiag/sphinxcontrib/nwdiag.py
# -*- coding: utf-8 -*- """ nwdiag.sphinx_ext ~~~~~~~~~~~~~~~~~~~~ Allow nwdiag-formatted diagrams to be included in Sphinx-generated documents inline. :copyright: Copyright 2010 by Takeshi Komiya. :license: BSDL. """ from __future__ import absolute_import import os import re import tracebac...
ihacklog/osdlyrics
python/pattern.py
# -*- coding: utf-8 -*- # # Copyright (C) 2011 Tiger Soldier # # This file is part of OSD Lyrics. # # OSD Lyrics 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...
P1d0f/encryptGen
encryption-generator.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # encryption-generator.py # # Copyright 2016 Netuser <zorgonteam@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 v...
bjura/EPlatform
spellerPuzzle.py
#!/bin/env python2.7 # -*- coding: utf-8 -*- # This file is part of AT-Platform. # # EPlatform 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 ...
CFIS-Octarine/octarine
planning/ph2.py
import json import argparse import numpy import sys import copy from astropy.coordinates import SkyCoord from astropy import units import operator class Program(object): def __init__(self, runid="16BP06", pi_login="gladman"): self.config = {"runid": runid, "pi_login": pi_login, ...
vmendez/DIRAC
DataManagementSystem/scripts/dirac-dms-user-lfns.py
#!/usr/bin/env python ######################################################################## # $HeadURL$ ######################################################################## """ Get the list of all the user files. """ __RCSID__ = "$Id$" from DIRAC.Core.Base import Script days = 0 months = 0 years = 0 wildcard = ...
rudhir-upretee/Sumo17_With_Netsim
tools/assign/costFunctionChecker.py
#!/usr/bin/env python """ @file costFunctionChecker.py @author Michael Behrisch @author Daniel Krajzewicz @author Jakob Erdmann @date 2009-08-31 @version $Id: costFunctionChecker.py 13811 2013-05-01 20:31:43Z behrisch $ Run duarouter repeatedly and simulate weight changes via a cost function. SUMO, Simulatio...
jacobtomlinson/datapoint-python
datapoint/_version.py
# This file helps to compute a version number in source trees obtained from # git-archive tarball (such as those provided by githubs download-from-tag # feature). Distribution tarballs (built by setup.py sdist) and build # directories (produced by setup.py build) will contain a much shorter file # that just contains t...
nathanshartmann/portuguese_word_embeddings
sentence_similarity/utils/commons.py
# -*- coding: utf-8 -*- """ Common structures and functions used by other scripts. """ from xml.etree import cElementTree as ET str_to_entailment = {'none': 0, 'entailment': 1, 'paraphrase': 2} entailment_to_str = {v: k for k, v in str_to_entailment.items()} class Pair(obj...
ddietze/FSRStools
rraman/__init__.py
""" .. module: FSRStools.rraman :platform: Windows .. moduleauthor:: Daniel Dietze <daniel.dietze@berkeley.edu> Resonance Raman excitation profile calculation based on the time-domain picture of resonance Raman. See Myers and Mathies in *Biological Applications of Raman Spectroscopy*, Vol. 2, pp. 1-58 (John Wi...
lauria/Samba4
lib/testtools/testtools/testresult/real.py
# Copyright (c) 2008 testtools developers. See LICENSE for details. """Test results and related things.""" __metaclass__ = type __all__ = [ 'ExtendedToOriginalDecorator', 'MultiTestResult', 'TestResult', 'ThreadsafeForwardingResult', ] import datetime import sys import unittest from testtools.co...
andrewhanlon/QCD_scripts
sigmond/channel.py
import abc import subprocess import logging from observables import BLOperator, MCObservable from data import BLDataChannel, GIDataChannel import util class Channel(metaclass=abc.ABCMeta): ISOSPIN_MAP = { 'singlet': "0", 'doublet': "1h", 'triplet': "1", 'quartet': "3h", 'quintet': "2"...
ahmadRagheb/goldenHR
erpnext/accounts/doctype/money_transfere/money_transfere.py
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe.utils.data import flt, nowdate, getdate, cint class MoneyTransfere...
tsaoyu/D3HRE
D3HRE/core/battery_models.py
import numpy as np def min_max_model(power, use, battery_capacity): """ Minimal maximum battery model, obsoleted :param power: Pandas TimeSeries, total power from renewable system :param use: float, unit W fixed load of the power system :param battery_capacity: float, unit Wh battery capacity ...
ZelphirKaltstahl/rst-internal-links-to-raw-latex
RSTInternalLinks/HeadingsParser.py
import re class HeadingsParser(): """ The HeadingParser parses the document for headings. NOT YET: converts headings to raw latex headings in the correct way, so that they can be referrenced to later see https://www.sharelatex.com/learn/Sections_and_chapters for info about the levels""" def __ini...
rowinggolfer/openmolar2
src/lib_openmolar/admin/db_orm/admin_practitioners.py
#! /usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### ## ## ## Copyright 2010-2012, Neil Wallace <neil@openmolar.com> ## ## ...
jimsize/PySolFC
pysollib/winsystems/common.py
#!/usr/bin/env python # -*- mode: python; coding: utf-8; -*- # --------------------------------------------------------------------------- # # Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer # Copyright (C) 2003 Mt. Hood Playing Card Co. # Copyright (C) 2005-2009 Skomoroh # # This program is free software...
vbeffara/Simulations
tools/massage-box.py
#! /usr/bin/env python import sys g = {} n = {} for line in sys.stdin: (n1, n2, p, q, t, tg, x) = line.strip().split(' ') t = int(t) x = float(x) key = ' '.join((n1,n2,p,q)) if not key in n: n[key] = 0 g[key] = 0 n[key] += t g[key] += x*t for key in n: print key, n...
CroceRossaItaliana/jorvik
autenticazione/viste.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals from django.contrib.auth import REDIRECT_FIELD_NAME from django.shortcuts import redirect from django.contrib.auth.views import logout as original_logout from loginas import settings as la_settings from loginas.utils impor...
fracpete/python-weka-wrapper-examples
src/wekaexamples/flow/list_file.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, # b...
FireBladeNooT/Medusa_1_6
lib/tvdbapiv2/models/series_actors.py
# coding: utf-8 """ Copyright 2015 SmartBear Software 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 Unless required by applica...
RobLoach/lutris
tests/check_prefixes.py
#!/usr/bin/python3 import os import sys import subprocess sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from lutris.util.wineregistry import WineRegistry PREFIXES_PATH = os.path.expanduser("~/Games/wine/prefixes") def get_registries(): registries = [] directories = os.listdir...
pitunti/alfaPitunti
plugin.video.alfa/channels/anitoonstv.py
# -*- coding: utf-8 -*- import re from channels import renumbertools from channelselector import get_thumb from core import httptools from core import scrapertools from core import servertools from core import tmdb from core.item import Item from platformcode import config, logger from channels import autoplay IDIO...
mschwager/dhcpwn
dhcpwn.py
#!/usr/bin/env python3 import argparse import logging import string # Quiet scapy logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy import volatile # noqa: E402 from scapy import sendrecv # noqa: E402 from scapy import config # noqa: E402 from scapy.layers import l2 # noqa: E402 from scapy.la...
alfa-jor/addon
plugin.video.alfa/lib/btserver/client.py
# -*- coding: utf-8 -*- import os import pickle import random import time import urllib try: import xbmc, xbmcgui except: pass from platformcode import config, logger LIBTORRENT_PATH = config.get_setting("libtorrent_path", server="torrent", default='') from servers import torrent as torr lt...
a-krebs/finances
finances/django_registration/urls.py
# Copyright (C) 2012 Aaron Krebs akrebs@ualberta.ca # 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...
quadrismegistus/prosodic
meters/strength_and_resolution.py
############################################ # [config.py] # CONFIGURATION SETTINGS FOR A PARTICULAR METER # # # Set the long-form name of this meter name = "*PEAK only" # # [Do not remove or uncomment the following line] Cs={} ############################################ ############################################ #...
andrmuel/gr-dab
python/qa/qa_measure_processing_rate.py
#!/usr/bin/env python from gnuradio import gr, gr_unittest from gnuradio import blocks import grdab class qa_measure_processing_rate(gr_unittest.TestCase): """ @brief QA for measure processing rate sink. This class implements a test bench to verify the corresponding C++ class. """ def setUp(self): self.tb = ...
hmenke/espresso
testsuite/python/drude.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...
mipt-cs-on-python3/arithmetic_dragons
tournament.py
# coding: utf-8 # license: GPLv3 from enemies import * from hero import * def annoying_input_int(message =''): answer = None while answer == None: try: answer = int(input(message)) except ValueError: print('Вы ввели недопустимые символы') return answer def game_tou...
spikeekips/source-over-ssh
src/tests/__init__.py
# -*- coding: utf-8 -*- __all__ = [ "test_config_db", "test_grid", "test_shell", "test_svn", ] if __name__ == "__main__" : import doctest for i in __all__ : print ("%%-%ds: %%s" % (max(map(len, __all__)) + 1)) % ( i, doctest.testmod(__import__(i, None, None, [i...
cecilulysess/MinerLite
main.py
#!/usr/bin/python # MinerLite - A client side miner controller. # This will launch cgminer with a few delay seconds and # retrieve the local data and post it into somewhere! # # Author: Yanxiang Wu # Release Under GPL 3 # Used code from cgminer python API example import socket import json import sys import subproc...