repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
zachcalvert/basketball | basketball/leagues/migrations/0002_auto_20160624_1747.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-24 17:47
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('leagues', '0001_initial'),
]
operations = [
migrations.RenameField(
mode... |
sambyers/o365_fmc | .venv/lib/python3.6/site-packages/logutils/queue.py | #
# Copyright (C) 2010-2017 Vinay Sajip. See LICENSE.txt for details.
#
"""
This module contains classes which help you work with queues. A typical
application is when you want to log from performance-critical threads, but
where the handlers you want to use are slow (for example,
:class:`~logging.handlers.SMTPHandler`)... |
gprMax/gprMax | tools/convert_png2h5.py | # Copyright (C) 2015-2022: The University of Edinburgh
# Authors: Craig Warren and Antonis Giannopoulos
#
# This file is part of gprMax.
#
# gprMax 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... |
easmetz/inasafe | safe/impact_functions/inundation/tsunami_raster_landcover/impact_function.py | # coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Tsunami Raster Impact on
Road
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 Software Foundati... |
dladd/pyFormex | pyformex/gui/draw.py | ## $Id$
##
## This file is part of pyFormex 0.8.9 (Fri Nov 9 10:49:51 CET 2012)
## pyFormex is a tool for generating, manipulating and transforming 3D
## geometrical models by sequences of mathematical operations.
## Home page: http://pyformex.org
## Project page: http://savannah.nongnu.org/projects/pyformex/
#... |
mice-software/maus | src/common_py/MausReducedData/SciFiReducedData.py | #!/usr/bin/env python
""" MAUS Reduced Data objects for easy plotting with PyROOT """
import array
import ROOT
# pylint: disable = C0103
# pylint: disable = E1101
# pylint: disable = R0902
# pylint: disable = R0903
# pylint: disable = R0912
# pylint: disable = R0913
# pylint: disable = R0914
# pylint: disable = R091... |
ElecProg/MPL | mpl/m.py | # -*- coding: utf-8 -*-
# IMPORTANT CONFIGURE YOUR TEXT EDITOR/IDE TO utf-8 !!!
# @author: "Evert Provoost"
# @nickname: "ElecProg"
# @pack: "Math Processing Layer (MPL)"
# @part: "Meta translation (MPL.M)"
# @version: "v5.0.0"
# @license: "GNU General Public License v3"
import re
# Translates to the MPL... |
HexHive/datashield | compiler/llvm/tools/clang/tools/scan-build-py/tests/functional/cases/test_create_cdb.py | # -*- coding: utf-8 -*-
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
from ...unit import fixtures
from . import make_args, silent_check_call, silent_call, create_empty_file
import unittest
impor... |
Anstow/TeamAwesome | game/planet.py | from math import cos, sin
from random import randrange
from conf import conf
from gm import Graphic
from util import ir, Vect
from physics import GravitySource, GravitySink
def mk_graphic (obj):
graphic = Graphic(obj.img_ident + '.png',
layer = conf.GRAPHICS_LAYERS[obj.ident])
w = graphic.w
offset = conf.I... |
tkolhar/robottelo | tests/foreman/ui/test_operatingsystem.py | # -*- encoding: utf-8 -*-
"""Test class for Operating System UI"""
from fauxfactory import gen_string
from nailgun import entities
from robottelo.constants import (
INSTALL_MEDIUM_URL, PARTITION_SCRIPT_DATA_FILE)
from robottelo.datafactory import invalid_values_list, valid_data_list
from robottelo.decorators impor... |
littleghosty/forum | mysite/usercenter/migrations/0006_userprofile_avatar.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-22 15:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('usercenter', '0005_auto_20161016_1501'),
]
operations = [
migrations.AddFie... |
beiko-lab/gengis | plugins/IRIDA/IRIDA.py | #=======================================================================
# Author: Alexander Keddy
#
# Copyright 2014 Alexander Keddy
#
# This file is part of GenGIS.
#
# GenGIS is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... |
cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/scripts/modules/bpy/utils.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... |
srmagura/potential | scripts/resonance.py | """
WARNING: This script might not give the correct values. (Unsure)
Print values of k for which a resonance will occur.
Accepts the side length of the square auxiliary domain as a
command-line argument. This argument can be a Python expression and
may include the variable pi. The default is 2*pi.
"""
import numpy as... |
georgebv/PyEVA | AppCore/LoadingDialog.py | from PyQt4 import QtGui, QtCore
import sys
from win32api import GetSystemMetrics
class LoadingDialog(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent, QtCore.Qt.WindowStaysOnTopHint)
self.movie = QtGui.QMovie('loading.gif', QtCore.QByteArray(), self)
sel... |
lifemapper/core | LmWebServer/formatters/json_formatter.py | """Module functions for converting object to JSON
Todo:
Use constants
"""
from hashlib import md5
import json
from LmCommon.common.lmconstants import LMFormat
from LmServer.base.atom import Atom
from LmServer.base.layer import Raster, Vector
from LmServer.base.utilities import format_time_human
from LmServer.comm... |
VapourApps/va_master | va_master/cli/cli.py | from datetime import datetime
import tornado.ioloop
import yaml, json, glob
import os
import sys
import time
import argparse
import subprocess
import distutils
import traceback
import functools
import imp
from va_master.handlers.datastore_handler import DatastoreHandler
from va_master.api import login
from va_master.va... |
GrayAreaorg/InnovateSF-Map | repsf/urls.py | from django.conf.urls import patterns, include, url
from emailusernames.forms import EmailAuthenticationForm
from repsf.accounts.forms import ISFAuthForm
from accounts import views
import settings
from moderation.helpers import auto_discover
# Uncomment the next two lines to enable the admin:
from django.contrib impor... |
shiyemin/shuttleNet | preprocessing/preprocessing_factory.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# 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 applicable ... |
ziQ/observables | observable_importer.py | import string
import logging
import logging.handlers
class SyslogSender:
"""Sends Syslog messages."""
def __init__(self, **kwargs):
"""Initiate Syslog server settings."""
kwargs.setdefault("syslog_server","udp://127.0.0.1:514")
# to-do: extract fields from kwargs["syslog_server"]
... |
sagiss/txrm2nexus | txm2nexuslib/workflows/ctbiopartial.py | #!/usr/bin/python
"""
(C) Copyright 2018 ALBA-CELLS
Author(s): Marc Rosanes Siscart, Carlos Falcon Torres,
Zbigniew Reszela, Carlos Pascual
The program is distributed under the terms of the
GNU General Public License (or the Lesser GPL).
This program is free software: you can redistribute it and/or modify
it under th... |
anweshadas/gitcen | gitcen.py | """This module does a census/survey of a git repo"""
import os
import datetime
import click
from pygit2 import Repository
from pygit2 import GIT_SORT_TOPOLOGICAL
def date(path):
"""Function to find the commits done on each day"""
data = {}
repo = Repository(path)
for commit in repo.walk(repo.head.targ... |
godlike64/indexor | indexor/__init__.py | # This file is part of Indexor.
#
# Indexor 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.
#
# Indexor is distributed... |
DougFirErickson/qgisSpaceSyntaxToolkit | esstoolkit/__init__.py | # -*- coding: utf-8 -*-
"""
/***************************************************************************
essToolkit
Space Syntax Toolkit
Set of tools for essential space syntax network analysis and results exploration
-------------------
begin ... |
ruchikd/Algorithms | Python/MinimumSizeSubarraySum/MinimumSizeSubarraySum.py | import sys
def findMinimumSizeSubarraySum(a, s):
i, j, sumN, minN = 0, 0, 0, sys.maxsize
while j < len(a):
sumN = sumN + a[j]
j = j + 1
while (sumN >= s):
minN = min(minN, j - i)
sumN = sumN - a[i]
i = i + 1
return minN
def main():
arr = [ 2, 1, 3, 4, 0, -9, -7, 8]
val = 7
print findMinimumSi... |
tatigo/XBMC-BestRussianTVPlugin | ArcSearch.py | # coding=utf-8
#
# <BestRussianTV plugin for XBMC>
# Copyright (C) <2011> <BestRussianTV>
#
# 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
# ... |
nert-gu/Xposition | src/wiki/plugins/metadata/migrations/0009_auto_20170820_1837.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-20 22:37
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('metadata', '0008_metadatarevision_article_revision'),
]... |
jmdejong/Asciifarm | asciifarm/server/world.py | from . import room
from . import player
# The World class is like the model in the MVC pattern (though the rest is not that clear)
class World:
def __init__(self, worldLoader, roomLoader, playerLoader):
self.rooms = {}
self.players = {}
self.worldLoader = w... |
Acais/Tracker | models.py | from peewee import *
db = SqliteDatabase("tracker.db")
class Coach(Model):
username = CharField()
password = CharField()
f_name = CharField()
class Meta:
database = db # This means this model uses the "coach.db" database
class Athlete(Model):
grade = IntegerField()
f_name = Ch... |
pablorecio/Cobaya | src/cobaya/hamster_task.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 ... |
mosquito/TelePY | settings.py | # Django settings for telepy project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
('Mosquito','me@mosquito.su')
)
MANAGERS = ADMINS
DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_N... |
deifius/crazymachine | crazymachineredux/s-abstractions/utils/net_triangle.py | #!BPY
"""
Name: 'Raw Triangle Across The Net Via UDP...'
Blender: 232
Group: 'Export'
Tooltip: 'Export selected mesh via UDP packets in Raw Triangle Format'
"""
__author__ = "Chris McCormick"
__url__ = ("blender", "mccormick",
"Author's homepage, http://mccormick.cx/")
__version__ = "0.1"
__bpydoc__ = """\
This scri... |
toway/towaymeetups | mba/alembic/env.py | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
cbschaff/NBP | src/models/beacon4.py | """
Copyright (C) 2017 Charles Schaff, David Yunis, Ayan Chakrabarti,
Matthew R. Walter. See LICENSE.txt for details.
"""
# Beacon model 4: fixed beacons of a single channel on each wall
import tensorflow as tf
import numpy as np
# Use with 4 channels
def beacon(self):
NCHAN=self.NCHAN
v = np.zeros((25,25... |
sebp/scikit-survival | sksurv/linear_model/aft.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,
# bu... |
jeremiah-c-leary/vhdl-style-guide | vsg/rules/case/rule_021.py |
from vsg.rules import align_consecutive_lines_starting_with_a_comment_above_line_starting_with_token
from vsg.token import case_statement_alternative as token
class rule_021(align_consecutive_lines_starting_with_a_comment_above_line_starting_with_token):
'''
This rule aligns consecutive comment only lines a... |
xStream-Kodi/plugin.video.xstream | xstream.py | # -*- coding: utf-8 -*-
from resources.lib.handler.pluginHandler import cPluginHandler
from resources.lib.handler.ParameterHandler import ParameterHandler
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.config import cConfig
from resources.lib import logge... |
s0lst1c3/eaphammer | local/hostapd-eaphammer/tests/hwsim/test_rfkill.py | # rfkill tests
# Copyright (c) 2014, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import time
import hostapd
from hostapd import HostapdGlobal
import hwsim_utils
from wpasupplicant import Wpa... |
aexposito6/Steam | Steam/Steam/settings.py | """
Django settings for Steam project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import os
... |
Donkyhotay/MoonPy | zope/testing/testrunner.py | ##############################################################################
#
# Copyright (c) 2004-2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... |
eminorhan/inevitable-probability | recurrent_ei/binary_categorization_expt.py | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 28 16:52:18 2016 by emin
"""
import os
import sys
import theano
import theano.tensor as T
import numpy as np
from lasagne.layers import InputLayer, ReshapeLayer
from CellTypeSpecificLayers import DenseEILayer
from generators import BinaryCategorizationTask
import lasagne.l... |
lkluft/python-toolbox | scripts/if_abfrage.py | # -*- coding: utf-8 -*-
"""Steuerung des Programmablaufes mittels if-Abfragen.
Ein elementares Werkzeug der Prozesssteuerung in der Programmierung sind
bedingte Abfagen. In Python lassen sich diese in Form von
if-Konstrukten realisieren. Eine if-Abfrage steuert mit Hilfe einer
Bedingung den Ablauf des Skriptes.
"""... |
FedeMPouzols/Savu | savu/test/test_utils.py | # -*- coding: utf-8 -*-
# Copyright 2014 Diamond Light Source Ltd.
#
# 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 ap... |
gborri/SickRage | sickrage/subtitles/__init__.py | # Author: echel0n <echel0n@sickrage.ca>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your... |
LaurentClaessens/mazhe | src_yanntricks/new_picture.py | #! /usr/bin/python3
import sys
import os
import random
import string
from pathlib import Path
import dirmanage # working directory is mazhe's main dir.
def via_random(alphabet, n):
"""Return a string of `n` random letters."""
a = ""
for k in range(0, n):
a = a + random.choice(alphabet)
re... |
GovReady/govready-q | tools/simple_sar_server/sar.py | #!/usr/bin/env python3
########################################################
#
# A simple Python webserver to generate random
# assessment results
#
# Usage:
# python sar.py
#
# Accessing:
# curl localhost:8888
#
#######################################################
# Parse command-line arguments
import clic... |
nemanja-d/odoo_project_extensions | template_module/__openerp__.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Template module',
'version': '1.0',
'summary': 'Template module',
'author': 'nemanja-d@hotmail.com',
'website': 'https://www.linkedin.com/in/nemanjadragovic',
'category': 'Projects',
... |
wylok/opsweb | views/Assets.py | #-*- coding: utf-8 -*-
from flask import Flask,Blueprint,render_template,g,request,flash,redirect,send_file
from sqlalchemy import func
import redis
from module import user_auth,db_idc,db_op,loging,MyForm,tools
from sqlalchemy import distinct,and_
from collections import defaultdict
import time,datetime
import pyexcel
... |
imchipwood/iSOBOT_ESP8266 | iSOBOT_Control/isobot.py | __author__ = "chawood@pdx.edu"
import requests
import ping
import socket
import time
import re
# Code originally pulled from here
# http://web.cecs.pdx.edu/~mperkows/CLASS_479/Projects-2012/Mathias_Sunardi-iSobot_controller_report.pdf
# And subsequently changed entirely for use with ESP8266s over wifi
commands = {
'... |
Ichimonji10/robottelo | tests/foreman/api/test_activationkey.py | """Unit tests for the ``activation_keys`` paths.
@Requirement: Activationkey
@CaseAutomation: Automated
@CaseLevel: Acceptance
@CaseComponent: API
@TestType: Functional
@CaseImportance: High
@Upstream: No
"""
from fauxfactory import gen_integer, gen_string
from nailgun import client, entities
from requests.excep... |
marvin-jens/find_circ | find_circ.py | #!/usr/bin/env python
import pysam
import numpy
import os,sys,re
from logging import error, warning, debug
import logging
#logging.basicConfig(level=logging.DEBUG)
import mmap
import optparse
import traceback
COMPLEMENT = {
'a' : 't',
't' : 'a',
'c' : 'g',
'g' : 'c',
'k' : 'm',
'm' : 'k',
'... |
phdowling/holist-hkgazette | backend/util/communication/Listener.py | import requests
from backend.util.util import *
ln = getModuleLogger(__name__)
class Listener(object):
def __init__(self, ip, port):
self.ip = ip
self.port = port
def notify(self, data=""):
try:
requests.post("http://"+self.ip+":"+str(self.port) + "/notify", data=data)
... |
rahenry/nonHexact | test8.py | import numpy, scipy, math, cmath, random, scipy.sparse, scipy.sparse.linalg, scipy.special, sys, struct, os, operator
import matplotlib.pyplot as plt
import solver, data_processing, writer, measure
N = 3
L = 3
Q = N**L
columns = []
for total_charge in range(N):
columns.append([])
for i in range(Q):
for tota... |
veltzer/templar | templar/dput.py | """
Module that knows how to run dput(1)
dput(1) uploads your package to debian/ubuntu.
The weird thing about dput(1) is that you just point it to the '.changes'
file of your generated package and it takes care of the rest.
"""
import templar.subprocess
import os.path
do_dput = True
def run(d):
if do_dput:
... |
PythonCharmers/orange3 | Orange/canvas/application/addons.py | import sys
import sysconfig
import os
import errno
import shlex
import subprocess
import itertools
import concurrent.futures
from collections import namedtuple, deque
from xml.sax.saxutils import escape
from distutils import version
import pkg_resources
try:
import docutils.core
except ImportError:
docutils ... |
jumpserver/jumpserver | apps/tickets/models/flow.py | # -*- coding: utf-8 -*-
#
from django.db import models
from django.utils.translation import ugettext_lazy as _
from users.models import User
from common.mixins.models import CommonModelMixin
from orgs.mixins.models import OrgModelMixin
from orgs.models import Organization
from orgs.utils import tmp_to_org, get_current... |
xray7224/MegBot | megbot/core/privmsg.py | ##
# This file is part of MegBot.
#
# MegBot 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.
#
# MegBot is distributed in t... |
rlindner81/pyload | module/plugins/hooks/Captcha9Kw.py | # -*- coding: utf-8 -*-
from __future__ import with_statement
import base64
import re
import time
from module.network.HTTPRequest import BadHeader
from module.plugins.internal.Addon import Addon
from module.plugins.internal.misc import threaded
class Captcha9Kw(Addon):
__name__ = "Captcha9Kw"
__type__ = "h... |
d2emon/generator-pack | src/game_menu/galaxy_menu.py | from menu import Menu
# from generator._unknown.space.galaxy import GalaxyGenerator
# from generator._unknown.space.planet import PlanetGenerator
from .menu_handler import MenuHandler
galaxies = []
class GalaxyHandler(MenuHandler):
def __init__(self, galaxy):
self.galaxy = galaxy
@property
de... |
enormandeau/Scripts | fasta_split.py | #!/usr/bin/env python2
"""Split a fasta file in n files of approximately the same number of sequences
WARNING: This will create 'n' files in your present directory
USAGE:
python fasta_split.py input_file num_files
input_file: fasta file
num_files: number of files to split into
"""
# Importing modules
import gzi... |
esben/brother-scan | brscan/listen.py | import socket
import subprocess
from .scanto import scanto
def launch(args, config):
addr = (args.bind_addr, args.bind_port)
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(addr)
print("Listening on %s:%d"%(addr))
while(1):
data, addr = server_socket.re... |
tjma12/pycbc | pycbc/events/coinc.py | # Copyright (C) 2015 Alex Nitz
#
# 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 ... |
zaneveld/picrust | tests/test_count.py | #!/usr/bin/env python
# File created on 27 Feb 2012
from __future__ import division
__author__ = "Morgan Langille"
__copyright__ = "Copyright 2011-2013, The PICRUSt Project"
__credits__ = ["Morgan Langille"]
__license__ = "GPL"
__version__ = "1.1.0"
__maintainer__ = "Morgan Langille"
__email__ = "morgan.g.i.langille@g... |
SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/algorithms/communicability_alg.py | """
Communicability.
"""
import networkx as nx
from networkx.utils import not_implemented_for
__all__ = [
"communicability",
"communicability_exp",
]
@not_implemented_for("directed")
@not_implemented_for("multigraph")
def communicability(G):
r"""Returns communicability between all pairs of nodes in G.
... |
evilkost/cdic | src/try_dockerhub.py | # coding: utf-8
import sys
import time
import logging
log = logging.getLogger(__name__)
from cdic.app import app
from cdic.util import setup_logging
from cdic.app.util.dockerhub import create_dockerhub
logging.basicConfig(
# filename="/tmp/try_dockerhub.log",
stream=sys.stdout,
# format='[%(asctime)s]... |
dtakken/edxml-sdk | setup.py | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
#with open(path.join(here, 'DESCRIPTION.rst'), encoding='utf-8')... |
tomlyscan/Ordenacao | sort.py | import argparse
import pandas as pd
import bib
parser = argparse.ArgumentParser()
parser.add_argument('-f', action='store', dest='list_integers', help='Arquivo com os números a serem ordenados')
parser.add_argument('-s', action='store_const', dest='sort_method', const='selection', help='Algoritmo selection sort sel... |
DavideCanton/Python3 | ds/haar_wavelet.py | __author__ = 'davide'
import numpy as np
class HaarWavelet:
def __init__(self, signal):
signal_length = len(signal)
if signal_length and signal_length & (signal_length - 1):
# if len(signal) is not a power of 2
raise ValueError()
array = signal
result = np.... |
KonradBreitsprecher/espresso | src/featuredefs.py | # Copyright (C) 2013,2014,2015,2016 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# 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 L... |
MartinHvidberg/jobman | misc_and_fun/kbd.py | import msvcrt # built-in module
def kbfunc():
return ord(msvcrt.getch()) if msvcrt.kbhit() else 0
if __name__ == '__main__':
go = True
while go:
for n in range(10000000):
pass
print '.',
k = kbfunc()
print '\n', str(type(k)), k # <-- Why the h... is this ne... |
Vierkantor/RSwail | test/test_full.py | #!/usr/bin/env python2
import pytest
from target import entry_point, target
def test_empty_file():
"""The interpreter should accept an empty file."""
exit_code = entry_point(["swail", "example/triv.swa"])
assert exit_code == 0
def test_hello_file(capsys):
"""The hello world program should output exactly this st... |
gkarthik/mygene.hub | src/dataload/data_dump/dl_ensembl_mart.py | # Copyright [2010-2013] [Chunlei Wu]
#
# 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 applicable law or agreed to in wr... |
suizokukan/anceps | dchars/languages/ang/__init__.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
################################################################################
# DChars Copyright (C) 2012 Suizokukan
# Contact: suizokukan _A.T._ orange dot fr
#
# This file is part of DChars.
# DChars is free software: you can redistribute it and/or modify
# ... |
spiderbit/skelpy | skelpy/arg_parser.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from skelpy import SkelPy
import sys
class ArgParser(object):
def __init__(self, args=sys.argv):
self.args = args
self.params = []
self.skel = SkelPy()
def parse(self):
if self.args[1] == 'init':
self.valid = True
self.cmd = "init"
self.params += self.ar... |
edwardsmith999/pyDataView | postproclib/channelflowrawdata.py | #! /usr/bin/env python
import numpy as np
import subprocess as sp
import os
import sys
try:
import h5py
except:
print("h5py package not avilable -- using ascii conversion")
from .rawdata import RawData
from .pplexceptions import DataNotAvailable
class Channelflow_RawData(RawData):
def __init__(self,f... |
long-exposure/watchdog | python/watchdog/__main__.py | # Watchdog - Building supervision with Raspberry Pi
# (C)2017 - Norbert Huffschmid
# Main program
import dbus
import dbus.mainloop.glib
import dbus.service
import gobject
import logging
import signal
from watchdog.motion_proxy import MotionProxy
from watchdog.plugin_proxy import PluginProxy
logger = logging.getLogg... |
neelravi/vasp | walker-pdf-reduction.py | import glob, os
def scanfolder():
for path, dirs, files in os.walk('/media/ravindra/SAMSUNG/Rinkle'):
#print path
#print dirs
#print files
for _dir in dirs:
os.chdir(path+"/"+_dir)
if os.path.isfile('vasprun.xml'):
#os.system('cp /media/ravindra/SAMSUNG/R... |
dwu4/fhe-si | scripts/generateRandomData.py | #!/usr/bin/python
import random, sys, math
nFiles = 1
if len(sys.argv) < 4:
print 'usage: python generateRandomData.py filename d N [nFiles]'
sys.exit(1)
else:
filename = sys.argv[1]
d = int(sys.argv[2])
N = int(sys.argv[3])
if len(sys.argv) > 4:
nFiles = int(sys.argv[4])
MIN = -100
MAX... |
zzzzrrr/openmelee | players/cpu.py | #
# Copyright (c) 2009 Mason Green & Tom Novelli
#
# This file is part of OpenMelee.
#
# OpenMelee 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
# any later version.
#
# O... |
melonproject/oyente | oyente/ast_walker.py | class AstWalker:
def walk(self, node, attributes, nodes):
if isinstance(attributes, dict):
self._walk_with_attrs(node, attributes, nodes)
else:
self._walk_with_list_of_attrs(node, attributes, nodes)
def _walk_with_attrs(self, node, attributes, nodes):
if self._ch... |
ThatBenderGuy/pyN3S | cpu.py | from collections import defaultdict
from instructions import StaAbsInstruction, LdaImmInstruction, SEIInstruction, CLDInstruction
from memory import RAM
from ppu import PPU
from rom import ROM
from status import Status
RAM_START_INCLUSIVE = int.from_bytes(bytes.fromhex('0000'), byteorder='big')
RAM_END_INCLUSIVE = in... |
pkesist/buildpal | Python/buildpal/server/compiler_repository.py | import os
import tempfile
import hashlib
import pickle
from collections import defaultdict
class CompilerRepository:
def __init__(self):
self.__dir = os.path.join(tempfile.gettempdir(), 'BuildPal', 'Compilers')
self.__compilers = set()
self.__partial_compilers = set()
s... |
vecnet/om | website/apps/email/admin.py | # -*- coding: utf-8 -*-
#
# This file is part of the VecNet OpenMalaria Portal.
# For copyright and licensing information about this package, see the
# NOTICE.txt and LICENSE.txt files in its top-level directory; they are
# available at https://github.com/vecnet/om
#
# This Source Code Form is subject to the terms of t... |
mozilla-mobile/firefox-ios | taskcluster/scripts/write-dummy-secret.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import errno
import os
def write_secret_to_file(path, secret):
path = os.p... |
jhu-asco/aerial_autonomy | scripts/analysis/test_exponential_filter.py | #!/usr/bin/env python2
import matplotlib.pyplot as plt
import argparse
import os
import pandas as pd
import numpy as np
# %%
parser = argparse.ArgumentParser(
prog='plot_quad_data')
parser.add_argument('file', type=str, help='Data file')
args = parser.parse_args()
data = pd.read_csv(os.path.join(
args.file)... |
Comunitea/CMNT_004_15 | project-addons/disable_action_buttons/__manifest__.py | {
"name": "Disable Action buttons",
"description": "Disable archive and unarchive fields on a list view in partners and disable action button for group 'group_comercial_ext' ",
"version": "0.1",
"category": "Extra Tools",
'author': 'Visiotech',
'website': 'www.visiotechsecurity.com',
"data":... |
maxive/erp | addons/maintenance/models/maintenance.py | # -*- coding: utf-8 -*-
from datetime import date, datetime, timedelta
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.exceptions import UserError
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
class MaintenanceStage(models.Model):
""" Model for case stages. Th... |
jmesteve/saas3 | openerp/addons_extra/mail_extra/mail_mail.py | from openerp.osv import fields, osv
from urlparse import urljoin
from urllib import urlencode
class mail_mail(osv.osv):
_inherit = 'mail.mail'
#------------------------------------------------------
# mail_mail formatting, tools and send mechanism
#--------------------------------------------... |
taedori81/shoop | shoop/admin/modules/products/__init__.py | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from collections import Counter
fr... |
Micronaet/micronaet-purchase | purchase_price_precision/purchase_precision.py | # -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License a... |
kuiwei/kuiwei | common/lib/xmodule/xmodule/modulestore/search.py | from .exceptions import (ItemNotFoundError, NoPathToItem)
def path_to_location(modulestore, usage_key):
'''
Try to find a course_id/chapter/section[/position] path to location in
modulestore. The courseware insists that the first level in the course is
chapter, but any kind of module can be a "sectio... |
mbareta/edx-platform-ft | lms/djangoapps/student_profile/views.py | """ Views for a student's profile information. """
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.http import Http404
from django.views.decorators.http import requi... |
kevin8909/xjerp | openerp/addons/sale/report/sale_order.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
SysTheron/adhocracy | src/adhocracy/lib/pager.py | import copy
from inspect import isclass
import math
import logging
from ordereddict import OrderedDict
import time
import urllib
from formencode import validators
from paste.deploy.converters import asbool
from pylons.i18n import _, lazy_ugettext, lazy_ugettext as L_
from pylons import config, request, tmpl_context as... |
OSSystems/lava-server | dashboard_app/tests/utils.py | """
Django-specific test utilities
"""
import xmlrpclib
from django.conf import settings
from django.contrib.auth import login
from django.core.urlresolvers import reverse
from django.http import HttpRequest
from django.test.client import Client
from django.utils.importlib import import_module
from django_testscenari... |
gem/oq-engine | openquake/calculators/tests/ucerf_test.py | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2016-2022 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... |
DemocracyClub/yournextrepresentative | ynr/apps/elections/uk/management/commands/uk_update_parties_from_ec_data.py | import re
from datetime import datetime
from os.path import join
from urllib.parse import urlencode
import dateutil.parser
import magic
import requests
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import transaction
from candidates.models import PartySet
from pop... |
michal-ruzicka/archivematica | src/dashboard/src/components/rights/ingest_urls.py | # This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
avanzosc/avanzosc6.1 | project_department/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2011 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Joel Grand-guillaume (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programm... |
iw3hxn/LibrERP | l10n_it_ade/models/italy_ade_tax_nature.py | # -*- coding: utf-8 -*-
#
# Copyright 2018 - Associazione Odoo Italia <https://www.odoo-italia.org>
# Copyright 2018-19 - SHS-AV s.r.l. <https://www.zeroincombenze.it>
# Copyright 2020 - Didotech s.r.l. <https://www.didotech.com>
#
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
#
from openerp.osv im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.