repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
nijel/weblate | weblate/accounts/management/commands/dumpuserdata.py | #
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://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, either version 3 of the Licens... |
fzimmermann89/pyload | module/plugins/hoster/AlldebridCom.py | # -*- coding: utf-8 -*-
import re
import urllib
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
from module.plugins.internal.utils import json, parse_size
class AlldebridCom(MultiHoster):
__name__ = "AlldebridCom"
__type__ = "hoster"
__version__ = "0.49"
__status__ ... |
timbalam/GroopM | groopm/map.py | #!/usr/bin/env python
###############################################################################
# #
# map.py #
# ... |
simonvh/pyDNase | pyDNase/scripts/dnase_to_javatreeview.py | #!/usr/bin/env python
# Copyright (C) 2013 Jason Piper - j.piper@warwick.ac.uk
#
# 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... |
bdoin/GCompris-qt | src/activities/lang/resource/datasetToPo.py | #!/usr/bin/python3
#
# GCompris - datasetToPo.py
#
# Copyright (C) 2015 Bruno Coudoin <bruno.coudoin@gcompris.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the... |
eellak/gsoc17-donationbox | Donation-Box/DjangoApp/donationProjects/donationProjects/settings.py | """
Django settings for donationProjects project.
Generated by 'django-admin startproject' using Django 1.11.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
... |
alexcigun/KPK2016teachers | A-gun/A gun initial steps 17_06_2016 02 15.py | from tkinter import *
from random import choice, randint as rnd
import time
from math import sin, cos, pi
class Gun:
def __init__(self,canvas,v0,tetta,width=30):
global x_vyl,y_vyl
# сразу задаёмся радианами
rad=180/pi
tetta_r=tetta/rad # вместо градусов получили количество ... |
nab911/rubber-debugy | python/chatbot.py | from routes.chat import chat_route
from routes.feedback import feedback_route
from flask import Flask
# App Setup
app = Flask(__name__)
app.secret_key = 'whats the good word'
# Route Registration
app.register_blueprint(chat_route)
app.register_blueprint(feedback_route)
## Error Handling
@app.errorhandler(400)
def ... |
gcallah/Indra | indraV1/indra/vs_agent.py | """
vs_agent.py
An agent that use vector space Prehensions to understand its environment.
"""
import indra.grid_agent as ga
import indra.vector_space as vs
import indra.prehension_agent as pa
class VSAgent(pa.PrehensionAgent):
"""
An agent that use Prehensions to understand its environment.
"""
def __i... |
spektral/havencore | client/blockentity.py | # -*- coding: utf-8 -*-
import pygame
from defines import *
from entities import Entity
"""
Generic class for all projectiles in the game.
"""
class BlockEntity(Entity):
#def __init__(self, (x,y), vel, rot, filename, size, parent):
def __init__(self, (x,y), vel, rot, (r,g,b), size, parent):
Entity.__... |
joakim-hove/ert | tests/libres_tests/res/enkf/test_ert_context.py | import pkg_resources
import pytest
from libres_utils import ResTest
from res.test import ErtTestContext
class ErtTestContextTest(ResTest):
def setUp(self):
self.config = self.createTestPath("local/snake_oil/snake_oil.ert")
def test_raises(self):
with self.assertRaises(IOError):
t... |
shahzebsiddiqui/BuildTest | buildtest/utils/tools.py | from functools import reduce
def deep_get(dictionary, *keys):
return reduce(
lambda d, key: d.get(key, None) if isinstance(d, dict) else None,
keys,
dictionary,
)
class Hasher(dict):
def __missing__(self, key):
value = self[key] = type(self)()
return value
de... |
payet-s/pyrser | tests/grammar_directive.py | import unittest
from pyrser import grammar
from pyrser import meta
from pyrser import parsing
from pyrser import error
from pyrser.directives import *
class IgnoreNull(grammar.Grammar):
grammar = """
root =[ @ignore("null") [ item : i #add_to(_, i) ]+ eof ]
item = [ ' ' | 'a'..'z' | 'A'..'Z' | '\... |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/tests/test_index.py | # pylint: disable=E1101,E1103,W0232
from datetime import datetime, timedelta
from pandas.compat import range, lrange, lzip, u, zip
import operator
import pickle
import re
import nose
import warnings
import os
import numpy as np
from numpy.testing import assert_array_equal
from pandas.core.index import (Index, Float6... |
luuquanghung1982/python | datascience/bookhist.py | # [bookhist.py]
# ------------------------------------------------------------------------
# (c) Luu Quang Hung [luuquanghung@gmail.com]
# ...
# calculate histogram of words from a book, adapted from Learn Python, p149
# my extension is to handle book in unicode (UTF-8) format,
# and allow to search the frequency of a... |
EthanPlail/GJN | Programs/Walker2.py | import re, sys, os, json
cwd = os.getcwd()
path = os.path.join(cwd,'WD')
content = {}
for dir, subdirs, files in os.walk(path):
for theFile in files:
evenOdd = int(theFile[:-4]) % 2
wd = str(theFile[:-4])
if evenOdd != 0:
inPath = os.path.join(path,theFile)
f = ... |
ssokolow/snakebyte | test/test_queue.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test Suite for Queue code for SnakeByte FServe"""
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__license__ = "GNU GPL 3.0 or later"
__docformat__ = "restructuredtext en"
import heapq, logging, string, sys
log = logging.getLogger(__name__)
if sys.version_info[0... |
skasamatsu/py_mc | examples/HAp-bulk/Elist_to_expect.py | import numpy as np
import random as rand
import sys, os
import copy
import pickle
if __name__ == "__main__":
energy_lst = pickle.load(open("energy_reps.pickle", "rb"))
reps = pickle.load(open("latgas_reps.pickle", "rb"))
energy_lst = energy_lst - np.sum(energy_lst)/len(energy_lst) #energy_lst[0]
kb = ... |
RedhawkSDR/integration-gnuhawk | components/cvsd_encode_sb/tests/test_cvsd_encode_sb.py | #!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by ... |
grwl/sslcaudit | sslcaudit/ui/ClientServerTestResultTreeTableModel.py | # ----------------------------------------------------------------------
# SSLCAUDIT - a tool for automating security audit of SSL clients
# Released under terms of GPLv3, see COPYING.TXT
# Copyright (C) 2012 Alexandre Bezroutchko abb@gremwell.com
# ----------------------------------------------------------------------... |
gerddie/mia | doc/miaxml2sgml.py | #!/usr/bin/env python3
#
# Copyright (c) Leipzig, Madrid 1999-2015 Gert Wollny
#
# 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... |
bincker/research | tools/feature/parse_apicall.py | #!/usr/bin/python
#
# Copyright (C) 2014 Che-Hsun Liu <chehsunliu@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... |
bitcraze/crazyflie-firmware | bindings/setup.py | """Compiles the cffirmware C extension."""
import distutils.command.build
from distutils.core import setup, Extension
import os
fw_dir = "."
include = [
os.path.join(fw_dir, "src/modules/interface"),
os.path.join(fw_dir, "src/hal/interface"),
os.path.join(fw_dir, "src/utils/interface/lighthouse"),
]
modu... |
karimbahgat/Pure-Python-Greiner-Hormann-Polygon-Clipping | GreinerHorman_Algo/Forster-Overfelt/puremidpoints_v4(maybedone).py | # -*- coding: UTF-8 -*-
# Efficient Clipping of Arbitrary Polygons
#
# Copyright (c) 2011, 2012 Helder Correia <helder.mc@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 vers... |
AnnalisaS/migration_geonode | geonode/documents/forms.py | import taggit
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from geonode.people.models import Profile
from geonode.documents.models import Document
from geonode.maps.models import Map
from geonode.layers.models imp... |
IceflowRE/MR-eBook-Downloader | unidown/main.py | """
Entry into the program.
"""
import argparse
import logging
import sys
from argparse import ArgumentParser
from pathlib import Path
from unidown import static_data, tools
from unidown.core import manager
from unidown.core.settings import Settings
from unidown.plugin.a_plugin import APlugin
class PluginListAction(... |
rmarkello/peakdet | peakdet/cli/run.py | # -*- coding: utf-8 -*-
import glob
import os
import sys
import warnings
import matplotlib
matplotlib.use('WXAgg')
from gooey import Gooey, GooeyParser
import peakdet
TARGET = 'pythonw' if sys.platform == 'darwin' else 'python'
TARGET += ' -u ' + os.path.abspath(__file__)
LOADERS = dict(
rtpeaks=peakdet.load_rtpe... |
skulumani/asteroid_dumbbell | tests/test_dumbell.py | from __future__ import absolute_import, division, print_function, unicode_literals
import dynamics.dumbbell as dumbbell
import dynamics.asteroid as asteroid
import kinematics.attitude as attitude
import pdb
import numpy as np
angle = (2*np.pi- 0) * np.random.rand(1) + 0
# generate a random initial state that is outsi... |
dennyb87/pycity | week5/matrix.py | #!/usr/bin/env python3
'''
Write a function that displays an nbyn matrix
using the following header:
defprintMatrix(n):
Each element is 0 or 1, which is generated randomly.
Write a test program that prompts the user
to enter n and displays an nbyn matrix.
Here is a sample run:
Entern:3
010
000
111
'''
from random... |
hknyldz/pisitools | pisilinux/pisilinux/configfile.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2010, TUBITAK/UEKAE
#
# 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.
#
#... |
jkotan/nexdatas.sardanascanrecorders | setup.py | #!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2018 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... |
theblindr/blindr-backend | blindr/api/interests.py | from flask.ext import restful
from flask import request
from blindr.common.authenticate import authenticate
import facebook
from blindr.models.event import Event
from blindr.models.user import User
from blindr import db
class Interests(restful.Resource):
method_decorators=[authenticate]
def post(self):
... |
metaMMA/metaMMA | mover.py | #!/usr/bin/env python
################################################################################
#
# Copyright (C) 2017 Robert Erickson (metaMMAproject@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 F... |
tyndare/osmose-backend | analysers/analyser_merge_recycling_FR_bm.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2014-2016 ##
## ... |
wavicles/pycode-browser | pycode-browser.py | #!/usr/bin/python
# 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 ... |
partizand/gnucashreport | src/test/test_cli.py | import unittest
from gnucashreport.gcreportcli import build_cli_report, parse_args
from test.testinfo import TestInfo
class CliProg_Test(unittest.TestCase):
def test_parse_args(self):
gnucash_file = 'my.gnucash'
xlsx_file = 'my.xlsx'
args = [gnucash_file, xlsx_file]
p_args = pars... |
NikosAlexandris/landsat8_metadata | landsat8_metadata.py | #!/usr/bin/python\<nl>\
# -*- coding: utf-8 -*-
"""
@author nik |
"""
import sys
from collections import namedtuple
# globals
MTLFILE = ''
DUMMY_MAPCALC_STRING_RADIANCE = 'Radiance'
DUMMY_MAPCALC_STRING_DN = 'DigitalNumber'
# helper functions
def set_mtlfile():
"""
Set user defined MTL file, if any
""... |
sfelton/todo | todo.py | #!/usr/bin/env python3
#--------[ Imports ]-----------------------------------------------------------
import sys
import os
import configparser
import getpass
import libtodo as lib
import utilities as util
import colors as c
from libtodo import Task, Project
#--------[ GLOBALS ]--------------------------------------... |
kiniou/blender-smooth-slides | tools/lpod/xmlpart.py | # -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: David Versmisse <david.versmisse@itaapy.com>
# Hervé Cauwelier <herve@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or modify it unde... |
chaosim/dao | samples/sexpression.py | from dao.rule import Rule
from dao import term
from dao.term import nil, Cons, conslist as L, cons2tuple
from dao.command import Command
from dao.term import vars, DummyVar, CommandCall
from dao.solve import make_solver, set_run_mode, noninteractive
from dao import builtin
from dao.special import *
from dao... |
iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/config/__init__.py | # Copyright (C) 2013 Statoil ASA, Norway.
#
# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Licens... |
Gimpneek/exclusive-raid-gym-tracker | app/migrations/0007_auto_20170903_1811.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-03 18:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0006_auto_20170903_1730'),
]
operations = [
migrations.AlterField(
... |
allthroughthenight/aces | python/functions/WGFET.py | import math
# Determine "representative" fetch and wave direction
# INPUT
# ang1: angle of first radial fetch
# dang: angle increment between radials
# wdir: wind direction approach
# x: radial fetch length at given angles
# OUTPUT
# F: representative fetch length
# phi: angle between wind and wave d... |
LeonNie52/dk-plus | collision_avoidance.py | """
Handler for the collision avoidance part of the module.
A specific drone_network.Networking object needs to be running
Custom algorithms can be specified
Spawns a thread by instantiation
Author: Leonidas Antoniou
mail: leonidas.antoniou@gmail.com
"""
from multiprocessing import Process
import threading, time, ite... |
Squishymedia/feedingdb | src/feeddb/feed/migrations/0005_name2title_drop_name.py |
from south.db import db
from django.db import models
from feeddb.feed.models import *
class Migration:
def forwards(self, orm):
# Deleting field 'Trial.name'
db.delete_column('feed_trial', 'name')
# Deleting field 'Experiment.name'
db.delete_column('feed_expe... |
pedro2d10/SickRage-FR | sickbeard/rssfeeds.py | # coding=utf-8
import re
import urlparse
from feedparser.api import parse
from sickbeard import logger
from sickrage.helper.exceptions import ex
def getFeed(url, request_headers=None, handlers=None):
parsed = list(urlparse.urlparse(url))
parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / wit... |
lincheney/import_anything | import_anything/finder.py | import importlib.machinery
import importlib.util
import sys
class Finder(importlib.machinery.PathFinder):
"""
Finder
Responsible for locating source files
and loading them with the appropriate loader
"""
_loaders = []
_suffixes = []
@classmethod
def find_module(cls, fullname, pat... |
sravan953/pulseq-gpi | mr_gpi/opts.py | import mr_gpi.convert
class Opts():
"""This class contains the gradient limits of the MR system."""
def __init__(self, kwargs=dict()):
valid_grad_units = ['Hz/m', 'mT/m', 'rad/ms/mm']
valid_slew_units = ['Hz/m/s', 'mT/m/ms', 'T/m/s', 'rad/ms/mm/ms']
self.max_grad = kwargs.get("max_gra... |
eepgwde/pyeg0 | minfo/minfo/MInfo1.py | # @file MInfo.py
# @brief Media Info fetching.
# @author weaves
#
# @details
# This class uses the MediaInfo library for Python.
#
# @note
#
# The library has a limitation that it cannot handle UTF-8 names very
# well. To side-step that, I make a temporary symlink using the 'os'
# module and then use MediaInfo on that.... |
SUNY-Oswego-IEEE-Myo-Car/myo-car-driver | myocardriver/car.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,... |
ctjacobs/pyqso | pyqso/dx_cluster.py | #!/usr/bin/env python3
# Copyright (C) 2013-2017 Christian Thomas Jacobs.
# This file is part of PyQSO.
# PyQSO 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... |
dgovil/AdvancedPythonForMaya | Nodes/pushDeformer.py | # Unfortunately, OpenMaya 2 doesn't support creating deformers
# Therefore we must use the old OpenMaya instead
from maya import OpenMaya as om
from maya import OpenMayaMPx as ompx
import maya.cmds as cmds
# Unfortunately the API has changed somewhat between Maya 2015 and 2016 so we need to get the right attributes i... |
shrinidhi666/wtfBox | bin/toolsDevice/country_add.py | #!/usr/bin/python
import os
import sys
import argparse
dirSelf = os.path.dirname(os.path.realpath(__file__))
libDir = dirSelf.rstrip(os.sep).rstrip("toolsDevice").rstrip(os.sep).rstrip("bin").rstrip(os.sep) + os.sep + "lib"
sys.path.append(libDir)
# print("lib : "+ libDir)
import dbOuiDevices
parser ... |
modmypi/PiModules | code/python/package/pimodules/alerts.py |
import smtplib
import subprocess
import datetime
import jinja2
import base64
from email.mime.text import MIMEText
def get_host_name():
try:
command = "uname -n"
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
output = process.communicate()[0]
return output
except:
return None
def ge... |
drptbl/Just-Metadata | modules/intelgathering/feed_urls.py | '''
This module grabs various threat/intel feeds on the internet and will store
if the IP is in any of the feeds.
List of feeds came from the isthisipbad project - go check it out!
https://github.com/jgamblin/isthisipbad
'''
import urllib2
class IntelGather:
def __init__(self):
self.cli_name = "FeedLis... |
barjuegocreador93/pycab | resources/oauth2/settings.py | from resources.routes import Route
import bottle
import oauth2
def simple_oauth(consumer_secret=None):
"""
Verify 2-legged oauth (per request).
base on http://philipsoutham.com/post/2172924723/two-legged-oauth-in-python
Parameters accepted as values in "Authorization" header, or as a GET request
o... |
dciabrin/blog-dump | plugins/print_media/__init__.py | # -*- coding: utf-8 -*-
"""
print_media
===========
A Pelican plugin that transforms generated HTML to be more suitable
for printing. Based on pelican-cite.
"""
import logging
import os
import re
import sys
from typing import Dict, List, Match, Union
from jinja2 import Environment, FileSystemLoader
from pelican impor... |
SideChannelMarvels/Deadpool | wbs_aes_nsc2013/RE/ssa_algorithm_step1.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
code = open('0vercl0k_writeup/wbaes128_solve.cpp', 'r').read().split('\n')
#print code
rounds=[]
inblock=False
blockcount=-1 # no bug here
block=[]
for line in code:
begin_round_pattern = '^ for'
match = re.search(begin_round_pattern, line)
if ma... |
excid3/keryx | keryx/unwrapt/__init__.py | # Unwrapt - cross-platform package system emulator
# Copyright (C) 2010 Chris Oliver <chris@excid3.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 L... |
virtadpt/exocortex-halo | exocortex_xmpp_bridge/message_queue.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set expandtab tabstop=4 shiftwidth=4 :
# message_queue.py - A module of the Exocortex XMPP Bridge that implements the
# message queue as a global so the other classes can all see it.
#
# This is part of the Exocortex Halo project
# (https://github.com/virtadp... |
hzlf/openbroadcast | website/apps/alibrary/migrations/0112_auto__chg_field_relation_service.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Relation.service'
db.alter_column('alibrary_relation', 'service', self.gf('django.db.mode... |
nens/threedi-qgis-plugin | datasource/result_constants.py | from collections import namedtuple
#: namedtuple for NetCDF variable information
NcVar = namedtuple("NcVar", ["name", "verbose_name", "unit"])
WATERLEVEL = NcVar("s1", "waterlevel", "m MSL")
DISCHARGE = NcVar("q", "discharge", "m3/s")
VELOCITY = NcVar("u1", "velocity", "m/s")
VOLUME = NcVar("vol", "volume", "m3")
DI... |
MrAwesome/pnb | pnb/bak/ui_movement.py | # NOTE: these are all Main mode selection movements - there are similar paradigms, so you may want to make these more extensible. just start here.
class UIMovement:
@classmethod
def left(ui):
node = ui.selected
if node.parent != ui.root:
ui.selected = node.parent
# TODO: move cursor position
... |
richlanc/KaraKara | website/karakara/tests/integration/test_tracks.py | ## -*- coding: utf-8 -*-
import pytest
from . import admin_rights
@pytest.mark.parametrize(('track_id', 'expected_response', 'text_list',), [
('t1', 200, ['Test Track 1' , 'series X', 'anime', 'ここ', 'test/image1.jpg' ]),
('t2', 200, ['Test Track 2' , 'series X', 'anime', 'äöü', 'test/preview2.flv']),
... |
markgw/jazzparser | lib/nltk/classify/tadm.py | # Natural Language Toolkit: Interface to TADM Classifier
#
# Copyright (C) 2001-2010 NLTK Project
# Author: Joseph Frazee <jfrazee@mail.utexas.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import sys
import subprocess
from nltk.internals import find_binary
try:
import numpy
except... |
machawk1/pywb | pywb/cdx/query.py | from urllib import urlencode
from cdxobject import CDXException
#=================================================================
class CDXQuery(object):
def __init__(self, **kwargs):
self.params = kwargs
if not self.params.get('matchType'):
url = self.params.get('url', '')
... |
nickthecoder/adoddler | adoddler/action/deleteAction.py | import os
from adoddler import configuration
from adoddler.action import HTMLTemplateAction
class DeleteAction( HTMLTemplateAction ) :
def do_POST( self, handler ) :
if 'file' in handler.parameters :
file = handler.parameters['file'][0]
if file.find("..") >= 0 :
... |
amahabal/PySeqsee | farg/apps/seqsee/workspace.py | # Copyright (C) 2011, 2012 Abhijit Mahabal
#
# 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 distribu... |
narfman0/helga-amazon-metadata | helga_amazon_meta/plugin.py | """ Plugin entry point for helga """
import re
import requests
from amazon.api import AmazonAPI
from bs4 import BeautifulSoup
from helga import settings
from helga.plugins import match
PRODUCT_REGEX = r'amazon\.com/(?:[\w|-]+/)?dp/(\w+)'
PRUDUCT_URL = 'https://www.amazon.com/dp/'
RESPONSE_TEMPLATE = 'Title: {} Pric... |
kimiscircle/fdfs_client-py | fdfs_client/connection.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: connection.py
import socket
import os
import sys
import time
import random
from itertools import chain
from fdfs_client.exceptions import (
FDFSError,
ConnectionError,
ResponseError,
InvaildResponse,
DataError
)
# start class Connection
cla... |
votervoice/openstates | openstates/oh/bills.py | import os
import datetime
from pupa.scrape import Scraper, Bill, VoteEvent
from pupa.scrape.base import ScrapeError
import xlrd
import scrapelib
import lxml.html
import pytz
class OHBillScraper(Scraper):
_tz = pytz.timezone('US/Eastern')
def scrape(self, session=None, chambers=None):
# Bills endpoi... |
gizela/gizela | gizela/data/CoordSystemLocal.py | # gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id$
from gizela.util.Ellipsoid import Ellipsoid
from gizela.data.PointGeodetic import PointGeodetic
from gizela.data.PointCart import PointCart
from gizela.data.A... |
bayesimpact/bob-emploi | data_analysis/importer/fhs_job_frequency.py | """This script computes the frequency of professions in the FHS.
The script considers only the jobseekers that are unemployed to date (well to
the date of the FHS) and get the # of jobseekers in each job.
It outputs a simple JSON file with a mapping from the OGR codes to the # of
jobseekers in the corresponding job.
... |
blancha/abcngspipelines | rnaseq/cufflinks.py | #!/usr/bin/env python3
# Version 1.1
# Author Alexis Blanchet-Cohen
# Date: 09/06/2014
import argparse
from collections import OrderedDict
import glob
import os
import subprocess
import util
# Read the command line arguments.
parser = argparse.ArgumentParser(description="Generates Cufflinks scripts, in the old forma... |
hadronproject/HadronWeb | apps/frontend/migrations/0003_auto__add_developer__add_frontendimage__add_field_page_published__add_.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Developer'
db.create_table('frontend_developer', (
('id', self.gf('django.db.mod... |
zepto/musio | examples/musio_proc_test.py | from multiprocessing import Process, Pipe
import select
import time
from musio import open_file, open_device
class Player(Process):
""" Music player process.
"""
def __init__(self, loops: int = -1):
""" Start the player.
"""
super(Player, self).__init__()
in_pipe, out_... |
yunit-io/yunit | tests/autopilot/unity8/greeter/tests/test_args.py | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Unity Autopilot Test Suite
# Copyright (C) 2015 Canonical
#
# 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 ... |
CosmicFish/CosmicFish | python/apps/debug_plotter.py | #----------------------------------------------------------------------------------------
#
# This file is part of CosmicFish.
#
# Copyright (C) 2015-2017 by the CosmicFish authors
#
# The CosmicFish code is free software;
# You can use it, redistribute it, and/or modify it under the terms
# of the GNU General Public L... |
roxana-lafuente/CursoAA | clase6_chatbox.py | from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
bot = ChatBot(
"Math & Time Bot",
logic_adapters=[
'chatterbot.logic.BestMatch',
"chatterbot.logic.MathematicalEvaluation",
"chatterbot.logic.TimeLogicAdapter",
'chatterbot.logic.LowConfidenceAdapter'
... |
tcstewar/nengo_pacman | pacman.py | import nengo
import pm
import numpy as np
model = nengo.Network()
with model:
pacman = pm.pacman_world.PacmanWorld(
pm.maze.generateMaze(num_rows=5, num_cols=5,
num_ghosts=1, seed=1))
move = nengo.Ensemble(n_neurons=100, dimensions=2, r... |
arximboldi/jagsat | src/states/attack.py | #
# Copyright (C) 2009, 2010 JAGSAT Development Team (see below)
#
# This file is part of JAGSAT.
#
# JAGSAT 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 ... |
cbrunker/quip | lib/Constants.py | #
# Constants used throughout the library
#
######################
# P2P Server Commands
######################
REQ_FRIEND = 12012201
REQ_FILE = 99119840
RECV_FILE = 99119841
RECV_MSG = 78986713
RECV_AVATAR = 57383752
INVITE_CHAT = 86878161
#########################
# Quip Server Commands
#########################
LO... |
assefay/inasafe | safe/common/test_utilities.py | # coding=utf-8
"""InaSAFE Disaster risk assessment tool developed by AusAid -
**Utilities Tests implementation.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 ... |
tobykurien/MakerDroid | assetsrc/public.mp3/skeinforge/skeinforge_tools/craft_plugins/chop.py | """
This page is in the table of contents.
Chop is a script to chop a shape into svg slice layers.
==Settings==
===Add Extra Top Layer if Necessary===
Default is on.
When selected, chop will add an extra layer at the very top of the object if the top of the object is more than half the layer thickness above the first... |
RedFantom/GSF-Parser | toplevels/strategy/add_phase.py | """
Author: RedFantom
Contributors: Daethyra (Naiii) and Sprigellania (Zarainia)
License: GNU GPLv3 as in LICENSE
Copyright (C) 2016-2018 RedFantom
"""
# UI Libraries
import tkinter as tk
from tkinter import ttk, messagebox
class AddPhase(tk.Toplevel):
"""
Toplevel to show widgets for entering the data requir... |
swim-fish/SQA_WEB | baseuser/tests/tests_admin.py | from django.test import TestCase
from django.test import RequestFactory
from django.test import Client
from django.contrib.admin.sites import AdminSite
from django.contrib.admin.options import (ModelAdmin, TabularInline,
HORIZONTAL, VERTICAL)
from baseuser.admin import (BaseUserAdmin, UserChangeForm,
UserCrea... |
wgurecky/GammaSpy | gammaspy/gammaData/peak.py | """!
@brief Module peak
Contains peak model def
"""
from __future__ import division
import numpy as np
import numdifftools as nd
from scipy.special import erf
class GaussModel(object):
"""!
@brief Gaussian model of the form:
\f[
y(x) = a\ e^{\frac{-(x - b)^2}{2c^2}}
\f]
Where $a$ is the scalin... |
stephenrkell/dwarfpython | contrib/flex/ast/autogen.py | import os, sys, re
import dircache
"""
Generates a parser and header therefore from the .cc files in a given directory.
It is assumed that: 1 class -> 1 rule of the grammer.
These files must be beautiful - i.e. each function declaration on its own line
without the opening {
Any private members ar... |
smyrman/kikrit | django_kikrit/jquery_widgets/widgets.py | # -*- coding: utf-8 -*-
# Based on code from Jannis Leidel's blog 2008 (http://jannisleidel.com/)
# Copyright (C) 2010: Sindre Røkenes Myren,
from django import VERSION, forms
from django.conf import settings
from django.utils.safestring import mark_safe
from django.utils.text import truncate_words
from django.templa... |
YuxuanLing/trunk | trunk/code/study/python/thread/mythreading0.py | #-!/usr/bin/python
#coding:utf-8
import threading
from time import sleep, time
loops=[4,2]
def loop(nloop,nsec):
print('start loop %s at: %s'%(nloop, time()))
sleep(nsec)
print('loop %s done at: %s'%(nloop,time()))
def main():
print('starting at:', time())
threads = []
nloops... |
chriscallan/Euler | Probs_1_to_50/044_PentagonNumbers.py | # Problem 44
# Pentagonal numbers are generated by the formula, Pn=n(3n−1)/2. The first ten pentagonal numbers are:
#
# 1, 5, 12, 22, 35, 51, 70, 92, 117, 145, ...
#
# It can be seen that P4 + P7 = 22 + 70 = 92 = P8. However, their difference, 70 − 22 = 48, is not pentagonal.
#
# Find the pair of pentagonal numbers, Pj... |
AlvaroRQ/prototipo | ownLibraries/cloudFiles/createPlate.py | import scipy.misc
import cv2
class WritePlate():
def __init__(self):
pass
def __call__(self, path_to_image = '', region = None, plate = ''):
if plate != 'NOPLATE':
path_to_new_image = path_to_image[:path_to_image.rfind('.')]
px0 = region[0]['x']
py0 = regio... |
thegaragelab/quickui | tools/mkimage.py | #!/usr/bin/env python
#----------------------------------------------------------------------------
# 01-Jun-2013 ShaneG
#
# This tool is used to generate image resources and corresponding palettes
# from image files.
#----------------------------------------------------------------------------
from sys import argv
fro... |
ReproducibleBuilds/diffoscope | tests/comparators/test_containers.py | # -*- coding: utf-8 -*-
#
# diffoscope: in-depth comparison of files, archives, and directories
#
# Copyright © 2017 Juliana Oliveira R <juliana.orod@gmail.org>
#
# diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... |
kennym/itools | scripts/ipkg-quality.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2007 David Versmisse <david.versmisse@itaapy.com>
# Copyright (C) 2007-2008 Juan David Ibáñez Palomar <jdavid@itaapy.com>
# Copyright (C) 2008 Henry Obein <henry@itaapy.com>
# Copyright (C) 2008 Sylvain Taverne <sylvain@itaapy.com>
#
# This program is free s... |
lokipl/folavirt | lib/folavirt/disks/iscsi/ImportIscsiPool.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
import libvirt
from xml.etree import ElementTree
from ConfigParser import ConfigParser
from folavirt.virt.Pool import Pool
from folavirt.virt.Host import Host
class ImportIscsiPool():
"""
Zarządzanie pulami dyskowymi iscsi
"""
def __init__(self, iscsilis... |
dMaggot/FeedToJoomla | src/feedtojoomla/feedtojoomla.py | # -*- 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope th... |
vadmium/webvi | src/libwebvi/webvi/asyncurl.py | # asyncurl.py - Wrapper class for using pycurl objects in asyncore
#
# Copyright (c) 2009-2011 Antti Ajanki <antti.ajanki@iki.fi>
#
# 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... |
adventurerscodex/uat | components/core/dm/npc.py | """NPC component."""
from component_objects import Component, Element
class NPCAddModal(Component):
"""Definition of NPC Add component."""
name_xpath = '//*[@id="addNPC"]/div/div/div[2]/form/div[1]/div/input'
race_xpath = '//*[@id="addNPC"]/div/div/div[2]/form/div[2]/div/input'
description_xpath = '... |
smyrman/kikrit | dev_tools/post_install.py | #!/usr/bin/env python2
import os
import sys
def main():
"""For virtual environments, symlink sip.so and PyQt4 into the
site-packeges directory. Note that python-pyqt4 and python-sip must be
installed to your system for this to work.
"""
pyenv = sys.argv[1]
# commands will be issued from the root of your python... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.