repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
markuz/scripts | copyemail.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- encoding: utf-8 -*-
#
# This file is part of my scripts project
#
# Copyright (c) 2013 Marco Antonio Islas Cruz
#
# This script 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 So... |
GreenJoey/My-Simple-Programs | python/500L Async Scraper/simple-url-getter.py | import socket
from selectors import DefaultSelector, EVENT_WRITE, EVENT_READ
sock = socket.socket()
sock.setblocking(False)
selector = DefaultSelector()
urls_todo = set(['/'])
seen_urls = set(['/'])
class Fetcher:
def __init__(self, url):
self.response = b''
self.url = url
self.sock = ... |
ATNF/askapsdp | Tools/Dev/rbuild/askapdev/rbuild/dependencies/dependency.py | ## @file
# Module to gather dependency information for ASKAP packages
#
# @copyright (c) 2006 CSIRO
# Australia Telescope National Facility (ATNF)
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# PO Box 76, Epping NSW 1710, Australia
# atnf-enquiries@csiro.au
#
# This file is part of the ASKAP ... |
inwotep/lava-dispatcher | lava_dispatcher/tests/test_device_version.py | # Copyright (C) 2012 Linaro Limited
#
# Author: Antonio Terceiro <antonio.terceiro@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher 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... |
KryoEM/relion2 | python/myutils/image.py | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 17 17:44:17 2014
@author: worker
"""
import numpy as np
from numpy.fft import fftshift,ifftshift,fft,ifft
from numpy.fft import fft2 as fast_fft2
from numpy.fft import ifft2 as fast_ifft2
from numpy.fft import fftn as fast_fftn
from numpy.fft import ifftn as fast_ifftn
... |
tcstewar/testing_notebooks | show_remote_spikes/sink.py | import nengo
import numpy as np
import redis
import struct
r = redis.StrictRedis('127.0.0.1')
model = nengo.Network()
with model:
def receive_spikes(t):
msg = r.get('spikes')
v = np.zeros(10)
if len(msg) > 0:
ii = struct.unpack('%dI' % (len(msg)/4), msg)
v[[ii]] =... |
j08lue/poppy | scripts/save_regavg_timeseries.py | #!/usr/bin/env python
from __future__ import print_function
import numpy as np
import argparse
import glob
import netCDF4
import poppy.metrics
import poppy.grid
import meta
def _get_grid_cell_area(fname, grid, lonlim, latlim):
with netCDF4.Dataset(fname) as ds:
mask = poppy.grid.get_mask_lonlat(ds, lon... |
RenZ0/php-show-controller | engine/delta.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# 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 distr... |
Ghost-script/dyno-chat | kickchat/apps/pulsar/utils/exceptions.py | '''
A list of all Exception specific to pulsar library.
'''
class PulsarException(Exception):
'''Base class of all Pulsar exceptions.'''
class MonitorStarted(PulsarException):
pass
class ImproperlyConfigured(PulsarException):
'''A :class:`PulsarException` raised when an inconsistent configuration
has ... |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/TextWindowType.py | # encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class TextWindowType(__gobject.GEnum):
# no doc
def __init_... |
agendaTCC/AgendaTCC | tccweb/apps/website/views.py | # -*- coding: utf-8 -*-
from django.shortcuts import render_to_response, redirect, render
from django.contrib import messages
from django.template import RequestContext
from django.contrib.auth import forms, authenticate, views, login
from django.contrib.auth.decorators import login_required
from django import http
fro... |
yehnan/python_book_yehnan | ch10/package_example/formats/foo.py |
import sys
sys.path.append('/cygdrive/d/yehnan/wr_python_drmaster/python_book_yehnan/ch10')
# import package_example.formats.bar
# square = package_example.formats.bar.square
# from bar import square
from . import bar
square = bar.square
# from .bar import square
def sos(a, b):
return squar... |
viswimmer1/PythonGenerator | data/python_files/30585323/ravebot.py | import os, sys
up_path = os.path.abspath('..')
sys.path.append(up_path)
from numpy import *
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
from matplotlib import rc
from objects import SimObject
from utils import scalar
from covar import draw_ellipsoid, vec2cov, cov2vec,\
pr... |
drtuxwang/system-config | bin/dockerreg.py | #!/usr/bin/env python3
"""
List images in Docker registry
curl http://localhost:5000/v1/_ping
curl http://localhost:5000/v1/search
curl http://localhost:5000/v1/repositories/<repository>/tags
curl -X DELETE http://localhost:5000/v1/repositories/<repository>/tags/<tag>
curl http://localhost:5000/v2/
curl http://localh... |
f3at/feat | src/feat/test/test_database_migration.py | from feat.test import common
from feat.database import migration, document
from feat.database.interface import NotMigratable
from feat.interface.serialization import IVersionAdapter
TYPE_NAME = 'nonexisting-type'
class A(document.VersionedDocument):
type_name = TYPE_NAME
version = 6
document.field('f... |
metabrainz/listenbrainz-server | listenbrainz/mbid_mapping/mapping/typesense_index.py | import sys
import re
import time
import datetime
import typesense
import typesense.exceptions
from unidecode import unidecode
import psycopg2
import config
from mapping.utils import log
BATCH_SIZE = 5000
COLLECTION_NAME_PREFIX = 'mbid_mapping_'
def prepare_string(text):
return unidecode(re.sub(" +", " ", re.s... |
botswana-harvard/bcpp-export | bcpp_export/old_export/urls.py | from django.conf.urls import patterns, include
from django.contrib import admin
from django.views.generic import RedirectView
from edc.lab.lab_profile.classes import site_lab_profiles
from edc.map.classes import site_mappers
from bhp066.apps.bcpp_household.mappers.central_server_mapper import CentralServerMapper
from ... |
Llamatech/sis-fibo | model/vos/operacion.py | #-*- coding:iso-8859-1 -*-
"""
Clase que modela la información de una cuenta en el sistema
"""
# NUMERO.valor.punto_atencion,cajero,cuenta,fecha
class Operacion(object):
def __init__(self, numero, tipo_operacion, cliente, valor, punto_atencion, cajero, cuenta, fecha):
self.numero = numero
sel... |
wxgeo/geophar | wxgeometrie/geolib/tests/test_cercles.py | # -*- coding: utf-8 -*-
from math import sqrt, sin, cos
from random import random
from pytest import XFAIL
from tools.testlib import assertAlmostEqual, assertEqual
from wxgeometrie.geolib import (Cercle_points, Cercle_diametre, Cercle_rayon, Demicercle,
Arc_oriente, Arc_points, Label_... |
olivierdalang/stdm | third_party/sqlalchemy/engine/url.py | # engine/url.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the :class:`~sqlalchemy.engine.url.URL` class which encapsulates
i... |
lehmannro/translate | storage/test_ts2.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-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; e... |
DrPaulBrewer/rtlsdr-automated-wxsat-capture | pypredict.py | import subprocess
import sys
import time
class missingSatellitePredictionError(Exception):
def __init__(self):
self.description = "predict did not return data for the satellite"
def __str__(self):
return self.description
def aoslos(satname):
lines = subprocess.check_output(['... |
pierreberthet/local-scripts | reduce_dopa.py | import nest
import nest.raster_plot
import numpy as np
import pylab as pl
nest.ResetKernel()
nest.SetKernelStatus({"overwrite_files": True})
sim_time = 0.
weight = []
if (not 'bcpnn_dopamine_synapse' in nest.Models()):
#nest.Install('ml_module')
nest.Install('/media/backup/temp_milner/save/17.10.14/modu... |
TobiHartmann/hotspot | benchmarks/run_tests.py | import os
import shlex
import datetime
import time
import shutil
from subprocess import Popen, PIPE
home = "/home/tobias/"
vm_config = " -XX:+PrintCodeCache "
# Benchmark configurations
dacapo_names = ("avrora", "batik", "fop", "h2", "jython", "luindex", "lusearch" ,"pmd", "sunflow", "tomcat", "tradebeans", "xalan")
... |
yudingding6197/fin_script | batchHis.py | #!/usr/bin/env python
# -*- coding:gbk -*-
import sys
import re
import os
import datetime
import urllib
import urllib2
from openpyxl import Workbook
from openpyxl.reader.excel import load_workbook
from internal.common import *
from internal.ts_common import *
#Èç¹ûÐèÒª¼Ç¼µ½csvÎļþÖУ¬ÐÞ¸Äaddcsv=1
addcsv = 0
prepath =... |
erral/eitbapi | eitbapi/cors.py | from pyramid.security import NO_PERMISSION_REQUIRED
def includeme(config):
config.add_directive("add_cors_preflight_handler", add_cors_preflight_handler)
config.add_route_predicate("cors_preflight", CorsPreflightPredicate)
config.add_subscriber(add_cors_to_response, "pyramid.events.NewResponse")
class ... |
tomato42/tlsfuzzer | scripts/test-sslv2-force-export-cipher.py | # Author: Hubert Kario, (c) 2015
# Released under Gnu GPL v2.0, see LICENSE file for details
"""Test forcing of export ciphers in SSLv2"""
from __future__ import print_function
import traceback
import sys
import re
from random import sample
import getopt
from tlsfuzzer.runner import Runner
from tlsfuzzer.messages impo... |
matzika/article-tagger-system | words_similarity_detector.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 12 11:57:45 2016
@author: katerinailiakopoulou
"""
import gensim
import logging
import sys
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
"""
The Finder finds which words are similar to the one given
based on the word2vec wo... |
VioletRed/script.module.urlresolver | lib/urlresolver/plugins/purevid.py | #-*- coding: utf-8 -*-
"""
Purevid urlresolver XBMC Addon
Copyright (C) 2011 t0mm0, belese, JUL1EN094
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 Licen... |
RidgeRun/gstd-1.x | tests/libgstc/python/test_libgstc_python_list_elements.py | #!/usr/bin/env python3
# GStreamer Daemon - gst-launch on steroids
# Python client library abstracting gstd interprocess communication
# Copyright (c) 2015-2020 RidgeRun, LLC (http://www.ridgerun.com)
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... |
kinap/scapy | setup.py | #! /usr/bin/env python
"""
Distutils setup file for Scapy.
"""
from distutils import archive_util
from distutils import sysconfig
from distutils.core import setup
from distutils.command.sdist import sdist
import os
EZIP_HEADER = """#! /bin/sh
PYTHONPATH=$0/%s exec python -m scapy.__init__
"""
def make_ezipfile(b... |
cobbler/cobbler | tests/module_loader_test.py | import pytest
from cobbler.cexceptions import CX
from cobbler import module_loader
from tests.conftest import does_not_raise
@pytest.fixture(scope="function")
def reset_modules():
module_loader.MODULE_CACHE = {}
module_loader.MODULES_BY_CATEGORY = {}
@pytest.fixture(scope="function")
def load_modules():
... |
BobbyKim/plotting-scripts | plotcontour538.py | '''
Generates contour plot from 3 columns of data.
'''
import sys
import argparse
import yaml
import numpy as np
from numpy.random import uniform
import matplotlib as mpl
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
parser = argparse.ArgumentParser(description='Plots pmf data.')
parser.add... |
50thomatoes50/blender.io_mqo | io_scene_mqo/export_mqo.py | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... |
elbeardmorez/quodlibet | quodlibet/gdist/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2007 Joe Wreschnig
# 2012-2016 Christoph Reiter
#
# 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 limita... |
elbeardmorez/quodlibet | quodlibet/quodlibet/util/dbusutils.py | # -*- coding: utf-8 -*-
# Copyright 2012, 2013 Christoph Reiter
#
# 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.
impor... |
PingPesto/BitList | bitlist/player.py | #!/usr/bin/env python
# Transactional wrapping class to interact with an MPD Daemon. Leverages the
# smarts of MPDClient2 python library. Stubbing out a lot of the common client
from contextlib import contextmanager
import logging
from mpd import MPDClient, ConnectionError
from os import environ
log = logging.getLog... |
LCOGT/valhalla | valhalla/sciapplications/migrations/0017_timerequest_semester.py | # Generated by Django 2.0.2 on 2018-03-13 23:48
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('proposals', '0012_proposal_non_science'),
('sciapplications', '0016_remove_scienceapplication_moon'),
]
ope... |
psy0rz/zfs_autobackup | tests/test_zfsnode.py | from basetest import *
from zfs_autobackup.LogStub import LogStub
from zfs_autobackup.ExecuteNode import ExecuteError
class TestZfsNode(unittest2.TestCase):
def setUp(self):
prepare_zpools()
# return super().setUp()
def test_consistent_snapshot(self):
logger = LogStub()
descr... |
gobstones/PyGobstones-Lang | tests/utils.py | import importlib
import os
import subprocess
import math
import itertools
import random
def eqValue(gbsv, pyv):
return gbsv == str(pyv)
def delete_files_in_dir(dir, exceptions=[]):
for f in os.listdir(dir):
if not f in exceptions:
os.remove(os.path.join(dir, f))
def group(lst, n):
... |
NaN-tic/nereid | nereid/sessions.py | #This file is part of Tryton & Nereid. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
from datetime import datetime # noqa
from flask.sessions import SessionInterface, SessionMixin
from werkzeug.contrib.sessions import Session as SessionBase, SessionStor... |
alf3r/GidroGraf-Sirius | src/main_gui.py | import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
class Handler:
def button_start_clicked_cb(self, button):
print('Start')
def button_open_project_clicked_cb(self, button):
print('Project')
def window_main_delete_event_cb(self, *args):
Gtk.main... |
pygeek/PyInterstate | PyInterstate.py | #PyInterstate by @pygeek
import urllib2
import json
class InterstateError(Exception):
"""Base class for Interstate App Exceptions."""
pass
class AuthError(InterstateError):
"""Exception raised upon authentication errors."""
pass
class IdError(InterstateError):
"""Raised when an operatio... |
shucommon/little-routine | python/python-crash-course/matplot/surface3d.py | # This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
fig = plt.figure()
ax = fig.gca(projecti... |
m4ll0k/Spaghetti | lib/handler/attacks.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt
import os
import sys
from lib.utils.dirs import *
from lib.utils.printer import *
from importlib import impor... |
ETShax/Coffeebot | pybot/botcommands.py | # -*- coding: UTF-8 -*-
"""
muutama esimerkki komennoista
"""
import random, time, os
from subprocess import call
# tähän sanastoon lisätään komennot ja niitä vastaavat oliot
command_dict = {}
class Test:
def main(self, irc, line):
irc.send('PRIVMSG %s :Hell World!' % line[2])
command_dict[':!... |
jeremiah-c-leary/vhdl-style-guide | vsg/rules/if_statement/rule_031.py |
from vsg.rules import previous_line
from vsg import token
lTokens = []
lTokens.append(token.if_statement.if_keyword)
class rule_031(previous_line):
'''
This rule checks for blank lines or comments above the **if** keyword.
In the case of nested **if** statements, the rule will be enfoced on the first *... |
fcalo/bbqtv | bbqtv/services/db.py | from pymongo import MongoClient
from datetime import datetime
class DB(object):
def __init__(self):
pass
def init_app(self, app):
self.db = MongoClient(host = app.config['DB_HOST'],
port = app.config['DB_PORT'])[app.config['DB_NAME']]
def get_channels(self, limi... |
ndncomm/mini-ndn | ndn/experiments/integration_tests.py | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (C) 2015 The University of Memphis,
# Arizona Board of Regents,
# Regents of the University of California.
#
# This file is part of Mini-NDN.
# See AUTHORS.md for a complete list of Mini-NDN authors an... |
Pistachitos/Sick-Beard | sickbeard/notifiers/growl.py | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... |
Ale-/grrr.tools | apps/views/glossary.py | from django.utils.translation import ugettext_lazy as _
def get():
""" Site glossary. """
return {
'construction' : [
{
'term' : _('Bienes'),
'text' : _('Objetos o cosas susceptibles de apropiación (art. 333 CC). Los bienes son de domino público o de propied... |
doirisks/dori | models/10.1001:archinte.167.10.1068/config_gener_a.py | # -*- coding: utf-8 -*-
# a template for making config.json files for functions
#import pprint
#pp = pprint.PrettyPrinter(indent=4)
config = {}
# human and machine readable names for the model
config['id'] = {}
config['id']['DOI'] = '10.1001/archinte.167.10.1068' # DOI tag '99.99... |
MesserLab/SLiM | treerec/tests/test_specific_recipes.py | """
Tests that look at the result of specific recipes in test_recipes
These may depend on the exact random seed used to run the SLiM simulation.
Individual recipes can be specified by decorating with
@pytest.mark.parametrize('recipe', ['test_____my_specific_recipe.slim'], indirect=True)
"""
import msprime
import numpy ... |
normpad/iotatipbot | test/bot_api.py | import re
from iota import *
import praw
import sqlite3
import random
import string
from iota.adapter.wrappers import RoutingWrapper
import config
import urllib.request
from urllib.error import HTTPError
import json
import math
node_address = config.node_address
class api:
def __init__(self,seed,prod=True):
... |
pedropva/AIprojects | sources/Data.py | from Node import Node
from Utils import Utils
class Data:
"""description of class"""
def __init__(self):
pass
@staticmethod
def cities():
neighbors = {'Arad':('Sibiu','Timisoara','Zerind'),'Zerind':('Arad','Oradea'),'Oradea':('Sibiu','Zerind'),'Timisoara':('Arad','Lugoj'),'Lugoj':('Mehadia','... |
WindowsPhoneForensics/find_my_texts_wp8 | find_my_texts_wp8/wp8_sms_integrated.py | #! /usr/bin/env python
# Python script to parse SMStext messages from a Windows 8.0 phone's store.vol file
# Author: cheeky4n6monkey@gmail.com (Adrian Leong)
#
# Special Thanks to Detective Cindy Murphy (@cindymurph) and the Madison, WI Police Department (MPD)
# for the test data and encouragement.
# Thanks also to Jo... |
adamjchristiansen/CS470 | bzagents/other_pigeons/wild_pigeon.py | #!/usr/bin/python -tt
# An incredibly simple agent. All we do is find the closest enemy tank, drive
# towards it, and shoot. Note that if friendly fire is allowed, you will very
# often kill your own tanks with this code.
#################################################################
# NOTE TO STUDENTS
# This is... |
spanner888/madparts | setup.py | #!/usr/bin/env python
#
# (c) 2013 Joost Yervante Damad <joost@damad.be>
# License: GPL
VERSION='1.2.1'
import glob, sys, platform
from setuptools import setup
with open('README.md') as file:
long_description = file.read()
arch = platform.uname()[4]
extra_data_files = []
if sys.platform == 'darwin':
OPTION... |
manassolanki/erpnext | erpnext/setup/doctype/email_digest/email_digest.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import fmt_money, formatdate, format_time, now_datetime, \
get_url_to_form, get_url_to_list, flt
f... |
OzFlux/PyFluxPro | scripts/constants.py | beta = 5 # "beta" value in adiabatic correction to wind profile
Cd = 840.0 # heat capacity of mineral component of soil, J/kg/K
Co = 1920.0 # heat capacity of organic component of soil, J/kg/K
Cp = 1004.67 # specific heat of dry air at constant pressure, J/kg-K
Cpd = 1004.67 # specific heat of dry air a... |
bmaia/rext | modules/misc/arris/tm602a_password_day.py | # Name:Arris password of the day generator
# File:tm602a_password_day_py
#Author:Ján Trenčanský
#License: GNU GPL v3
#Created: 29.3.2015
#Last modified: 29.3.2015
#Shodan Dork:
#Description: The Accton company builds switches, which are rebranded and sold by several manufacturers.
# Based on work of Raul Pe... |
lavalamp-/ws-backend-community | wselasticsearch/query/all.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .base import BaseElasticsearchQuery
class AllElasticsearchQuery(BaseElasticsearchQuery):
"""
This is an Elasticsearch query class that is meant to query all of the document types in
a given index.
"""
# Class Members
# Inst... |
wayneww/Scrabble | game_run.py | # wayne warren 2015
import scrabble # for my shuffling etc. PRESSING ENTER WILL SCORE WORD.
import pygame
import pygame.locals
import time
import random
from pygame import mixer
from os import getcwd
top_dir = getcwd()
print top_dir
mixer.init()
# for bleep when window pops up
bad_word_alert=mixer.Sound(top_dir+'/soun... |
GeoMop/GeoMop | src/LayerEditor/ui/gitems/diagram_view.py | import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
from LayerEditor.leconfig import cfg
class DiagramView(QtWidgets.QGraphicsItem):
"""
Represents some diagram view in edited diagram background
"""
ZVALUE = -9
def __init__(self, diagram_uid,... |
emesene/emesene | emesene/gui/base/MainWindowBase.py | '''base implementation of a main window'''
# -*- coding: utf-8 -*-
# This file is part of emesene.
#
# emesene 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
#... |
charanpald/wallhack | wallhack/clusterexp/BoundExp2.py | from cvxopt import matrix, solvers
from apgl.data.Standardiser import Standardiser
import numpy
"""
Let's test the massively complicated bound on the clustering error
"""
numpy.set_printoptions(suppress=True, linewidth=150)
numC1Examples = 50
numC2Examples = 50
d = 3
numpy.random.seed(21)
center1 = numpy.array([-1... |
bundlewrap/bundlewrap | bundlewrap/cmdline/groups.py | from ..group import GROUP_ATTR_DEFAULTS
from ..utils.text import bold, mark_for_translation as _
from ..utils.ui import io
from .nodes import _attribute_table
GROUP_ATTRS = sorted(list(GROUP_ATTR_DEFAULTS) + ['nodes'])
GROUP_ATTRS_LISTS = ('nodes',)
def bw_groups(repo, args):
if not args['groups']:
for ... |
jrichte43/ProjectEuler | Problem-0283/solutions.py |
__problem_title__ = "Integer sided triangles for which the area/perimeter ratio is integral"
__problem_url___ = "https://projecteuler.net/problem=283"
__problem_description__ = "Consider the triangle with sides 6, 8 and 10. It can be seen that the " \
"perimeter and the area are both equal t... |
RudolfCardinal/crate | crate_anon/nlp_webserver/views.py | #!/usr/bin/env python
r"""
crate_anon/nlp_webserver/views.py
===============================================================================
Copyright (C) 2015-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of CRATE.
CRATE is free software: you can redistribute it and/or modify
it under... |
DanteOnline/free-art | venv/bin/painter.py | #!/home/dante/Projects/free-art/venv/bin/python3
#
# The Python Imaging Library
# $Id$
#
# this demo script illustrates pasting into an already displayed
# photoimage. note that the current version of Tk updates the whole
# image every time we paste, so to get decent performance, we split
# the image into a set of til... |
AA33/dsa_exp | bst_misc/interval_tree.py | __author__ = 'aanurag'
import sys
from binary_tree import BinaryTree
class IntervalTree(BinaryTree):
def __init__(self):
BinaryTree.__init__(self)
self.max = None
def insert(self, key, parent=None):
try:
if (self.key == None):
self.key = key
... |
ssamot/causality | kaggle_scores.py | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 16 14:54:23 2013
@author: ssamot
"""
#title :compMonitor.py
#description :Sends an email alert if people pass a threshold on the Kaggle public leaderboards
#author :William Cukierski
#date :2013-05-06
#python_version :2.7
#============... |
bnsgeyer/Copter3_4 | Tools/autotest/sim_vehicle.py | #!/usr/bin/env python
"""
Framework to start a simulated vehicle and connect it to MAVProxy.
Peter Barker, April 2016
based on sim_vehicle.sh by Andrew Tridgell, October 2011
"""
from __future__ import print_function
import atexit
import getpass
import optparse
import os
import os.path
import re
import signal
import... |
dongweiming/web_develop | chapter9/section4/kombu_consumer.py | # coding=utf-8
from kombu import Connection, Exchange, Queue, Consumer
from kombu.async import Hub
web_exchange = Exchange('web_develop', 'direct', durable=True)
standard_queue = Queue('standard', exchange=web_exchange,
routing_key='web.develop')
URI = 'librabbitmq://dongwm:123456@localhost:567... |
sanacl/GrimoireELK | grimoire/elk/gmane.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
#
# Copyright (C) 2015 Bitergia
#
# 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 ve... |
mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/GeneTrack-2.0.0_beta_1_dev_48da9e998f0caf01c5be731e926f4b0481f658f0-py2.7.egg/genetrack/fitlib.py | """
Data fitting and peak prediction routines
"""
import genetrack
from genetrack import logger, conf
from itertools import *
import numpy, operator
from math import log, exp
def normal_function( w, sigma ):
"""
Defaulf fitting function, it returns values
from a normal distribution over a certain width.
... |
harlequin/sickbeard | sickbeard/providers/__init__.py | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
goldeneye-source/ges-python | stubs/GEAiSched.py | ################ Copyright 2005-2016 Team GoldenEye: Source #################
#
# This file is part of GoldenEye: Source's Python Library.
#
# GoldenEye: Source's Python 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 So... |
infoxchange/barman | barman/xlog.py | # Copyright (C) 2011-2017 2ndQuadrant Limited
#
# This file is part of Barman.
#
# Barman 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 versio... |
killabytenow/chirribackup | chirribackup/storage/Local.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
###############################################################################
# chirribackup/storage/Local.py
#
# Local backup storage -- backup is organized in a local folder
#
# -----------------------------------------------------------------------------
# Chirri Bac... |
sadad111/leetcodebox | Minimum Time Difference.py | class Solution(object):
def findMinDifference(self, timePoints):
"""
:type timePoints: List[str]
:rtype: int
"""
def convert(time):
return int(time[:2]) * 60 + int(time[3:])
minutes = map(convert, timePoints)
minutes.sort()
return min( (y ... |
elopio/snapcraft | snapcraft/plugins/go.py | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
darfire/screp | setup.py | #!/usr/bin/env python
# Bootstrap installation of Distribute
import distribute_setup
distribute_setup.use_setuptools()
import os
from setuptools import setup
PROJECT = u'screp'
VERSION = '0.3.2'
URL = 'https://github.com/darfire/screp'
AUTHOR = u'Doru Arfire'
AUTHOR_EMAIL = u'doruarfire@gmail.com'
DESC = u'Command... |
vxgmichel/aioconsole | example/cli.py | """Command line interface for echo server."""
import fnmatch
import asyncio
import argparse
from aioconsole import AsynchronousCli, start_interactive_server
from aioconsole.server import parse_server, print_server
from . import echo
async def get_history(reader, writer, pattern=None):
history = asyncio.get_eve... |
appleorange1/praw | praw/objects.py | # This file is part of PRAW.
#
# PRAW 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.
#
# PRAW is distributed in the hope that it will ... |
KANGKANGABC/ArmRobot | xmos_motor.py | #!/usr/bin/env python
import vrep
import time
import sys
import serial
import serial.tools.list_ports
import struct
import pyHook
import pythoncom
import threading
global data1 #Global Variable:where used where declare
global data2 #Global Variable:where used where declare
data1 = [0,0]
data2 = 1
event_close = threa... |
SMMAR11/smmarbsence | app/forms/admin.py | # coding: utf-8
# Imports
from app.models import *
from django import forms
from django.contrib.admin.widgets import FilteredSelectMultiple
class FGroupeUtilisateur(forms.ModelForm) :
# Champ
util = forms.ModelMultipleChoiceField(
label = 'Utilisateurs composant le groupe',
queryset = TUtilis... |
hzlf/openbroadcast.ch | app/onair/migrations/0005_scheduleditem_uuid.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-12-21 13:17
from __future__ import unicode_literals
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
('onair', '0004_auto_20180827_1759'),
]
operations = [
migration... |
hzlf/openbroadcast | website/tools/dgs2/discogs_client/models.py | from dgs2.discogs_client.exceptions import HTTPError
from dgs2.discogs_client.utils import parse_timestamp, update_qs, omit_none
class SimpleFieldDescriptor(object):
"""
An attribute that determines its value using the object's fetch() method.
If transform is a callable, the value will be passed through ... |
RalfJung/dudel | dudel/__init__.py | from raven.contrib.flask import Sentry
from flask import Flask
from flask.ext.babel import Babel
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.markdown import Markdown
from flask.ext.login import LoginManager
from flask.ext.gravatar import Gravatar
from flask.ext.migrate import Migrate, MigrateCommand
from... |
open-machine-learning/mldata | repository/views/publication.py | from django.core import serializers
from django.core.urlresolvers import reverse
from django.db import transaction
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from repository.forms import *
from repository.models import *
@transaction.commit_on_success
def edit(request):
"""E... |
zenn1989/scoria-interlude | L2Jscoria-Game/data/scripts/quests/614_SlayTheEnemyCommander_Varka/__init__.py | #Made by Emperorc
import sys
from com.l2scoria import Config
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2scoria.gameserver.util import Util
qn = "614_SlayTheEnemy... |
gjr80/weewx | bin/weewx/__init__.py | #
# Copyright (c) 2009-2021 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Package weewx, containing modules specific to the weewx runtime engine."""
from __future__ import absolute_import
import time
__version__="4.5.1"
# Holds the program launch time in unix epoch secon... |
InfectedSoap/TDP002 | Lab 02/uppgift2a.py |
def frame(s):
print("*"*(len(s)+4))
print("*",s,"*")
print("*"*(len(s)+4))
def triangle(rows):
for i in range(rows):
print("*"*(2*i+1))
def flag(n):
for i in range(n*4):
print(("*"*n*10) + (2*n*(" ")) + ("*"*n*10))
for i in range(n):
print("")
for i in range(n*4):
print(("*"*n*10) + (2*n*(" ")) + ("*... |
snegovick/bcam | bcam/events.py | from __future__ import absolute_import, division, print_function
import pygtk
pygtk.require('2.0')
import gtk, gobject, cairo
import time
import sys
import imp
import os
from bcam.loader_dxf import DXFLoader
from bcam.loader_excellon import ExcellonLoader
from bcam.tool_operation import TOResult
from bcam.tool_op_dri... |
hozn/keepassdb | keepassdb/export/xml.py | """
Support for exporting database to KeePassX XML format.
"""
from __future__ import absolute_import
from datetime import datetime
from xml.etree import ElementTree as ET
from xml.dom import minidom
from keepassdb import const
class XmlExporter(object):
"""
Class for exporting database to KeePassX XML format... |
joakim-hove/ert | ert_gui/ert_splash.py | import sys
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QSplashScreen, QApplication
from qtpy.QtGui import QColor, QPen, QFont
from ert_gui.ertwidgets import resourceImage
class ErtSplash(QSplashScreen):
def __init__(self, version_string="Version string"):
QSplashScreen.__init__(self)
... |
libretees/libreshop | libreshop/products/tests/models/.~c9_invoke_taooUl.py | import logging
from django.test import TestCase
from ...models import Attribute
# Initialize logger.
logger = logging.getLogger(__name__)
# Create your tests here.
class AttributeValueModelTest(TestCase):
def test_model_has_inventory_field(self):
'''
Test that Attribute_Value.inventory is present... |
JonSeijo/filelines-measurer | filelines.py | import subprocess
import re
import matplotlib.pyplot as plt
import argparse
import os
outfile_git_name = "tmp_git.txt"
outfile_format_name = "tmp_formatted.txt"
git_log_constant = "1 file changed, " # Used for grep, do not modify
diff_list = []
total_list = []
# Parse arguments passed by command line
parser = argp... |
davinellulinvega/COM1005 | Lab8/wipe.py | names = list()
times = list()
keys = list()
names.append("HeadPitch")
times.append([0.96, 1.68, 3.28, 3.96, 4.52, 5.08])
keys.append([-0.0261199, 0.427944, 0.308291, 0.11194, -0.013848, 0.061318])
names.append("HeadYaw")
times.append([0.96, 1.68, 3.28, 3.96, 4.52, 5.08])
keys.append([-0.234743, -0.622845, -0.113558, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.