repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
TU-NHM/plutof-taxonomy-module | apps/taxonomy/tests/base.py | from django.test import TestCase
from apps.taxonomy.tests import factories
from django.contrib.auth.models import User
from rest_framework import status
class BaseTestMixin(object):
"""
Base class for testing
"""
read_list_status = None
read_options_status = None
read_head_status = None
... |
bootphon/tde | bin/make_goldset.py | """This script extracts the gold fragments from a corpus.
"""
import sys
import cPickle as pickle
import argparse
if __name__ == '__main__':
def parse_args():
parser = argparse.ArgumentParser(
prog='goldset.py',
formatter_class=argparse.RawDescriptionHelpFormatter,
de... |
LuoZijun/uOffice | lib/WMF/__init__.py | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#__doc__ = "Document"
#__version__ = "0.0000001"
import os,sys,time
from struct import pack,unpack
from termcolor import colored
import wmf.Records.control
class Wmf:
metafile = None
header = None
records = None
objects = None
def __init__(sel... |
gilestrolab/ethoscope | src/ethoscope/trackers/adaptive_bg_tracker.py |
__author__ = 'quentin'
from collections import deque
from math import log10, sqrt, pi
import cv2
try:
CV_VERSION = int(cv2.__version__.split(".")[0])
except:
CV_VERSION = 2
import numpy as np
from scipy import ndimage
from ethoscope.core.variables import XPosVariable, YPosVariable, XYDistance, WidthVariabl... |
tony-hong/roleo | wsvt/view2D/matrixFactory.py | '''
matrixFactory.py
'''
import os
import sys
# Configuration of environment
sys.path.append('Rollenverteilung/src/lib')
os.system('export LD_LIBRARY_PATH=hdf5/1.8.16/lib')
from rv.structure.Tensor import Matricisation
# Base directory of the project
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__f... |
sumihai-tekindo/account_sicepat | customer_churn_report/models/res_config.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2016 Pambudi Satria (<https://github.com/pambudisatria>).
# @author Pambudi Satria <pambudi.satria@yahoo.com>
#
# This program is free software: you can redistribute it and/or modify
... |
artur-shaik/qutebrowser | qutebrowser/browser/hints.py | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... |
alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/computation/ops.py | """Operator classes for eval.
"""
import re
import operator as op
from functools import partial
from itertools import product, islice, chain
from datetime import datetime
import numpy as np
import pandas as pd
from pandas.compat import PY3, string_types, text_type
import pandas.core.common as com
from pandas.core.ba... |
openstates/openstates | openstates/mo/people.py | import re
import lxml.html
from pupa.scrape import Person, Scraper
class MOPersonScraper(Scraper):
_assumed_address_fmt = "201 West Capitol Avenue {}, " "Jefferson City, MO 65101"
# senators_url = 'http://www.senate.mo.gov/{}info/senalpha.htm'
# ^^^^^^^^^^^ pre-2013 URL. Keep if we need to scrape old pag... |
tompecina/legal | legal/dir/migrations/0008_auto_20161218_0040.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-18 00:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dir', '0007_auto_20161123_1049'),
]
operations = [
migrations.AlterField(
... |
scith/htpc-manager_ynh | sources/modules/qbittorrent.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import htpc
import cherrypy
import json
import logging
import time
import math
from cherrypy.lib.auth2 import require, member_of
from htpc.helpers import striphttp, sizeof
import requests
from requests.auth import HTTPDigestAuth
class Qbittorrent(object):
session = r... |
erggo/Harpy | harpia/bpGUI/getSize.py | # -*- coding: utf-8 -*-
# [HARPIA PROJECT]
#
#
# S2i - Intelligent Industrial Systems
# DAS - Automation and Systems Department
# UFSC - Federal University of Santa Catarina
# Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org),
# Guilh... |
mmcauliffe/linguistic-helper-functions | linghelper/representations/classes.py | import re
import copy
from linghelper.representations.constants import ENGLISH_ONSETS as ONSETS,ENGLISH_VOWEL_PATTERN as VOWEL_PATTERN
class Word(object):
def __init__(self,orthography,transcription,frequency=0):
self.orthography = orthography
self.syllables = syllabify(transcription)
sel... |
RotorWidgets/base-station | base_station/races/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-18 04:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
... |
dtschan/weblate | weblate/accounts/tests/test_registration.py | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2016 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, eith... |
hagabbar/pycbc_copy | pycbc/workflow/coincidence.py | # Copyright (C) 2013 Ian Harry
#
# 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... |
philetus/geosolver | geosolver/cluster.py | """Clusters are generalised constraints on sets of points in R^n. Cluster
types are Rigids, Hedgehogs and Balloons. """
from multimethod import MultiVariable
class Distance:
"""A Distance represents an unknown distance between two points"""
def __init__(self, a, b):
"""Create a new Distance
... |
s-gogna/JST | symbol_table/scope.py | # This file is part of JST.
#
# JST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# JST is distributed in the hope that it will be ... |
darogan/ParticleStats | scripts/ParticleStats_ROI.py | #!/usr/bin/env python
###############################################################################
# ____ _ _ _ ____ _ _ #
# | _ \ __ _ _ __| |_(_) ___| | ___/ ___|| |_ __ _| |_ ___ #
# | |_) / _` | '__| __| |/ __| |/ _ \___ \| __/ _` |... |
bioinfo-core-BGU/neatseq-flow_modules | neatseq_flow_modules/Reports/NGSplot.py | # -*- coding: UTF-8 -*-
"""
``NGSplot``
-----------------------
:Authors: Menachem Sklarz
:Affiliation: Bioinformatics core facility
:Organization: National Institute of Biotechnology in the Negev, Ben Gurion University.
A module for running NGSplot:
Runs NGSplot on existing **sorted** BAM files.
Please make sur... |
PayloadSecurity/VxAPI | tests/_requests_scenarios/key/key_create.py | scenarios = [
{
"url": "/key/current",
"method": "get",
"status_code": 200,
"json": {"api_key": "111", "auth_level": 500, "auth_level_name": "elevated"},
"headers": {
"content-type": "application/json",
"webservice-version": "8.10",
"api-ve... |
NicovincX2/Python-3.5 | Statistiques/Estimation (statistique)/Régression/Robust regression/theil-sen.py | # -*- coding: utf-8 -*-
import os
# Author: Florian Wilhelm -- <florian.wilhelm@gmail.com>
# License: BSD 3 clause
import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression, TheilSenRegressor
from sklearn.linear_model import RANSACRegressor
estimators = [('OLS'... |
phw/weblate | weblate/metrics/apps.py | #
# Copyright © 2012 - 2021 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 Lice... |
fishpepper/OpenGround | scripts/generate_hoptable.py | #!/usr/bin/python
#
# this will generate a random frsky compatible
# hop table and a random txid
#
import random
import textwrap
random.seed()
#get a random number for the txid
txid = random.randint(513, 65000)
hoptable_ok = 0
#generate hoptable
hoptable_ok = 0
while (hoptable_ok == 0):
#get random numbers for ... |
avix060/avix-addons | plugin.video.einthusan-new/resources/lib/modules/addonutility.py | import urllib
import urllib2
import xbmc
import xbmcplugin
import xbmcaddon
import xbmcgui
import sys
import re
import zlib, json
from bs4 import BeautifulSoup
addon = xbmcaddon.Addon('plugin.video.einthusan-new')
addon_version = addon.getAddonInfo('version')
image_path = addon.getAddonInfo('path') + '/resources/ima... |
awickert/alluvstrat | base.py | #! /usr/bin/python
###################
# IMPORT PACKAGES #
###################
from __future__ import division
import numpy as np
from matplotlib import pyplot as plt
from scipy import sparse as sp
import scipy.sparse.linalg as lin
import ConfigParser
import sys
class alluvstrat(object):
"""
All of the concrete... |
scottbarton/MPR-lab | Student Composition Projects/CSP_Composer_V2/constraintsADT.py | # Abstract data type that stores the contraints. Contains alls
# methods for accessing these constraints.
import random as rdm
import operator
class lADT:
def __init__(self):
self.limit = []
# Adds the given limit and validity pair
def add(self, limit, valid = [0,float('infinity')]):
self.limit += [[valid,li... |
Matla/DebuggingModuleInterfacePython | code/app.py | #--------------------------------------------------------------------
#Administration Details
#--------------------------------------------------------------------
__author__ = "Mats Larsen"
__copyright__ = "Mats Larsen 2014"
__credits__ = ["Mats Larsen"]
__license__ = "GPLv3"
__maintainer__ = "Mats Larsen"
__email__ =... |
s0lst1c3/eaphammer | local/hostapd-eaphammer/tests/hwsim/test_p2p_grpform.py | # P2P group formation test cases
# Copyright (c) 2013-2019, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import logging
logger = logging.getLogger()
import struct
import time
impo... |
toolsprods/SniffVPN | core/logjson.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Alvaro Nunez
#
#This file is part of SniffVPN.
#
#SniffVPN 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
... |
alfa-addon/addon | plugin.video.alfa/servers/videossh.py | # -*- coding: utf-8 -*-
# --------------------------------------------------------
# Conector videossh By Alfa development Group
# --------------------------------------------------------
from core import httptools
from core import scrapertools
from platformcode import logger
def test_video_exists(page_url):
log... |
scaphe/lettuce-dirty | tests/functional/output_features/success_outline/success_outline_steps.py | # -*- coding: utf-8 -*-
# <Lettuce - Behaviour Driven Development for python>
# Copyright (C) <2010-2011> Gabriel Falcão <gabriel@nacaolivre.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundatio... |
lypnol/adventofcode-2016 | day-22/part-1/ayoub.py | from submission import Submission
class AyoubSubmission(Submission):
def author(self):
return 'Ayoub'
def run(self, s):
s = s.rstrip().split('\n')[2:]
nodes = []
for line in s:
tokens = line.split()
nodes.append((int(tokens[2][:-1]), int(tokens[3][:-1... |
YufeiZhang/Principles-of-Programming-Python-3 | Labs/lab9/word_ladder.py | # Computes all transformations from a word word_1 to a word word_2,
# consisting of sequences of words of minimal length, starting with word_1,
# ending in word_2, and such that two consecutive words in the sequence
# differ by at most one letter.
# All words have to occur in a dictionary with name dictionary.txt,
# st... |
jeremiah-c-leary/vhdl-style-guide | vsg/rules/if_statement/rule_003.py |
from vsg import parser
from vsg import token
from vsg.rules import single_space_between_token_pairs
lTokens = []
lTokens.append([token.if_statement.if_keyword, parser.open_parenthesis])
class rule_003(single_space_between_token_pairs):
'''
This rule checks for a single space between the **if** keyword and ... |
s0vereign/Ahti | utils/pyvis/TimeProp_diagonal_scheme.py | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
matplotlib.rcParams['text.usetex'] = True
def prop_time(psi0, nt, dt, V, x):
psi = psi0(x+0*1j)
dp = 2*np.pi/(x[-1] - x[0])
n = x.size
p0 = -x.size/2 * dp
p1 = x.size/2 * dp
p = np.zeros(n)
for i in range(0, int(n/2-1))... |
laborautonomo/bitmask_client | src/leap/bitmask/services/mail/plumber.py | # -*- coding: utf-8 -*-
# plumber.py
# Copyright (C) 2013, 2014 LEAP
#
# 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.
... |
eaobservatory/hedwig | test/test_jcmt_calc_s2.py | # Copyright (C) 2017 East Asian Observatory
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
#... |
kobigurk/tmsp-ethereum | vendor/github.com/tendermint/tmsp/example/python3/tmsp/server.py | import socket
import select
import sys
import logging
from .wire import decode_varint, encode
from .reader import BytesBuffer
from .msg import RequestDecoder, message_types
# hold the asyncronous state of a connection
# ie. we may not get enough bytes on one read to decode the message
logger = logging.getLogger(__na... |
wehr-lab/RPilot | autopilot/setup/setup_autopilot.py | """
After initial setup, configure autopilot: create an autopilot directory and a prefs.json file
"""
import npyscreen as nps
import _curses
from collections import OrderedDict as odict
import pprint
import json
import os
import subprocess
import argparse
import sys
import inspect
import pkgutil
import ast
import typ... |
aosprey/rose | lib/python/rose/apps/comparisons/within.py | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2012-8 Met Office.
#
# This file is part of Rose, a framework for meteorological suites.
#
# Rose is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
cbedetti/Dcm2Bids | tests/test_structure.py | # -*- coding: utf-8 -*-
from os.path import join as opj
import pytest
from dcm2bids.structure import Participant, Acquisition
@pytest.mark.parametrize(
"name,session,modality,custom,expected",
[
("AB", "", "T1w", "", opj("sub-AB", "anat", "sub-AB_T1w")),
("sub-AB", " ", "_T1w", "run-03", op... |
statsmaths/dtv-toolkit | setup.py | from setuptools import setup
from setuptools import find_packages
long_description= """
The Distant TV Toolkit is a Python package designed to facilitate the
computational analysis of visual culture. It contains low-level architecture
for applying state-of-the-art computer vision algorithms to still and moving
images.... |
pkom/gesiesweb | gesiesweb/profesores/migrations/0004_auto_20151019_1049.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('profesores', '0003_auto_20151019_0949'),
]
operations = [
migrations.AlterField(
model_name='profesor',
... |
drewblay/Personal-Finance-Django-App | banking/transactions/models.py | from django.db import models
from django.utils.text import slugify
from polymorphic.models import PolymorphicModel
import datetime
from accounts.models import Account
from budget.models import MonthlyBudget
class Transaction(models.Model):
date = models.DateField()
account = models.ForeignKey(Account)
am... |
corradio/electricitymap | parsers/EIA.py | #!/usr/bin/env python3
"""Parser for U.S. Energy Information Administration, https://www.eia.gov/ .
Aggregates and standardizes data from most of the US ISOs,
and exposes them via a unified API.
Requires an API key, set in the EIA_KEY environment variable. Get one here:
https://www.eia.gov/opendata/register.php
"""
i... |
loglow/spine | web/spine/spine_core/apps.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... |
streed/PyEndicia | setup.py | from setuptools import setup, find_packages
setup( name="PyEndicia",
version="1.0",
description="Python library to interface with the Endicia Postage API",
author="Sean Reed",
author_email="sean@bitpostage.net",
url="https://github.com/streed/PyEndicia",
long_description=open("README.txt").read(),
license="LICEN... |
RobotStudio/choreo-msg | msg/sensor/joint_pb2.py | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: sensor/joint.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _... |
jdsolucoes/Pymodoro | config.py | #!/usr/bin/env python2.6
#-*- coding: utf-8 -*-
# This file is part of Pymodoro.
# Pymodoro 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.
# Pymodoro is distributed in the hope that it will be use... |
supermurat/hamsi-manager | FileUtils/__init__.py | # This file is part of HamsiManager.
#
# Copyright (c) 2010 - 2015 Murat Demir <mopened@gmail.com>
#
# Hamsi Manager 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 yo... |
gbin/err | errbot/backends/telegram_messenger.py | import logging
import sys
from errbot.backends.base import RoomError, Identifier, Person, RoomOccupant, Stream, ONLINE, Room
from errbot.core import ErrBot
from errbot.rendering import text
from errbot.rendering.ansiext import enable_format, TEXT_CHRS
log = logging.getLogger(__name__)
UPDATES_OFFSET_KEY = '_telegram... |
pkom/gesiesweb | gesiesweb/partes/views.py | # -*- coding: utf-8 -*-
from django.utils import timezone
from django.http import JsonResponse, HttpResponse
from django.core.urlresolvers import reverse_lazy
from django.db.models import Q
from django.views.generic import TemplateView, ListView, CreateView, UpdateView, DetailView, DeleteView
from sorl.thumbnail import... |
FreshetDMS/FDCapacityPlanner | vsvbp/container.py | import unittest
import itertools
import operator
class Instance:
""" An instance """
def __init__(self, items, bins):
self.items = items[:]
self.bins = bins[:]
def __repr__(self):
return "Items:\n" + str(self.items) + "\nBins:\n" + str(self.bins)
def empty(self):
for... |
efernandez/aess_challenge_24h_2013_rebujitos_team | tests/wire/wire_controller.py | # -*- coding: UTF8 -*-
"""
Wire protocol controller over Arduino.
Valid commands:
r <DEV_ADDR> <REG_ADDR> <LENGTH> <BUFFER[LENGTH]>
R <DEV_ADDR> <LENGTH> <BUFFER[LENGTH]>
w <DEV_ADDR> <REG_ADDR> <LENGTH> <BUFFER[LENGTH]>
W <DEV_ADDR> <LENGTH> <BUFFER[LENGTH]>
r, R : read data
w, W : write dat... |
Kefkius/scallop | gui/qt/qrwindow.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 y... |
vivescere/yajuu | yajuu/unshorteners/mp4upload.py | import re
import logging
import requests
from yajuu.unshorteners.utils import get_quality
from yajuu.media.sources.source import Source
logger = logging.getLogger(__name__)
def unshorten(url, quality=None):
html = requests.get(url).text
if 'File was deleted' in html:
logger.warning('[mp4upload] Fi... |
JonSteinn/Kattis-Solutions | src/Saving the Universe/Python 3/main.py | def find_next(engines, words, used):
remaining = len(engines)-1
for word in words:
if engines[word] != used:
if remaining == 1:
return True
engines[word] = used
remaining -= 1
return False
def swaps_required(engines, words):
swaps, used = 0, T... |
mlabru/ptracks | model/visil/airspace_visil.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------------------------------
airspace_visil
DOCUMENT ME!
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
th... |
spiffytech/spiffybot | modules/weather/weather.py | #This file is part of Spiffybot.
#
#Spiffybot 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.
#
#Spiffybot is distributed in the hope that... |
citizensense/csk | libraries/utilities.py | #GENERAL HELPER CLASSES: FileManager, Switch
import cherrypy, os, threading, subprocess
#=======MANAGE FILES==========================================================#
class FileManager:
# initialise the object
def __init__(self):
self.lock = threading.Lock()
# Generate the filepath to the dat... |
tasoc/photometry | tests/test_linpsfphotometry.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Tests of Linear PSF photometry.
.. codeauthor:: Rasmus Handberg <rasmush@phys.au.dk>
"""
import pytest
import numpy as np
from bottleneck import allnan, anynan
import logging
from tempfile import TemporaryDirectory
from astropy.io import fits
import conftest # noqa: ... |
codeguida/vkutils | EnotikBot/main.py | #!/usr/bin/env python3
#-*- coding: UTF-8 -*-
import vk, os
from time import sleep
import requests as req
from lxml import html
from random import randint
def bash(id, mode='u'):
try:
r = req.get('http://bash.im/random')
doc = html.document_fromstring(r.text)
bash = '\n'.join(doc.xpath('//*... |
Balannen/LSMASOMM | atom3/Formalisms/LSMASOMM/hasActions.py | """
__hasActions.py_____________________________________________________
Automatically generated AToM3 syntactic object (DO NOT MODIFY DIRECTLY)
Author: bogdan
Modified: Sat Apr 14 23:09:41 2018
____________________________________________________________________
"""
from ASGNode import *
from ATOM3Type import *
fro... |
aidan-/ansible-modules-extras | identity/ipa/ipa_hostgroup.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... |
sangwook236/SWL | python/test/util/util_test.py | #!/usr/bin/env python
import sys
sys.path.append('../../src')
import os, math, time
import numpy as np
from swl.util import util as swl_util
def download_test():
url = 'http://www.example.com/example.tar.zip'
#url = 'http://www.example.com/example.tar.gz'
#url = 'http://www.example.com/example.tar.bzip2'
#url = ... |
robwarm/gpaw-symm | gpaw/test/big/Ru001/molecules.py | from ase.structure import molecule
from ase.optimize import BFGS
from gpaw import GPAW
from gpaw.mixer import MixerDif
for name in ['H2', 'N2', 'O2', 'NO']:
mol = molecule(name)
mol.center(vacuum=5.0)
calc = GPAW(xc='PBE',
h=0.2,
txt=name + '.txt')
if name == 'NO':
... |
Micket/CCBuilder | vol_stat_cc.py | #!/usr/bin/env python3
from __future__ import print_function
from __future__ import division
import argparse
import pickle
import time
import CCBuilder as ccb
import CCBuilder_c as ccb_c
import numpy as np
import scipy.special
def uniform_dist(x):
""" Returns uniform distributions of given range """
return lam... |
octoalmawaukh/math-waffle | work in progress/## 60 list of probability distributions/imgsrc/pdf_normalny.py | import numpy as np
import matplotlib.pyplot as plt
from pylab import rcParams
def make_gauss(N, sig, mu):
return lambda x: N/(sig * (2*np.pi)**.5) * np.e ** (-(x-mu)**2/(2 * sig**2))
def main():
rcParams['figure.figsize'] = 8, 6
ax = plt.figure().add_subplot(1,1,1)
x = np.arange(-4, 4, 0.01)
s = ... |
feranick/SpectralMachine | Utilities/XmuDataMaker.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
*********************************************
*
* XmuDataMaker
* Adds spectra to single file for classification
* File must be in Xmu
* version: 20180619a
*
* By: Nicola Ferralis <feranick@hotmail.com>
*
***********************************************
'''
print(__doc__... |
zhanglab/psamm | psamm/translate_id.py | # This file is part of PSAMM.
#
# PSAMM 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.
#
# PSAMM is distributed in the hope that it wi... |
DexGroves/dexml | tests/test_ppr.py | from dexml.ppr import *
from dexml.utils import sose
import numpy as np
p = 5
n = 100
M = 1
np.random.seed(1234)
y = np.random.normal(0, 1, n)
X = np.random.rand(n, p) - 0.5 # No intercept
fit_spline = fit_spline_generator(2, None)
def test_ppr_reduces_error_for_m_eq_1():
w_t = initialize_w(1, p)
g_t = [u... |
igurrutxaga/tvalacarta | python/main-classic/servers/descargavideos.py | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para descargavideos
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core i... |
dimh/saddam | models/saddam.py | class Saddam:
def __init__(self, palabra):
self.palabra = palabra
self._ofuscada = '_'*len(palabra)
def posicion(self, letra):
posiciones = []
i = 0
for l in self.palabra:
if l == letra:
posiciones.append(i)
i += 1
return posiciones
def ofuscada(self):
return self._ofuscada
def buscar... |
jbloom/phydms | phydmslib/utils.py | """Utilities for ``phydmslib``."""
import math
import tempfile
import numpy
import pandas
def modelComparisonDataFrame(modelcomparisonfile, splitparams):
"""Converts ``modelcomparison.md`` file to `pandas` DataFrame.
Running ``phydms_comprehensive`` creates a file with the suffix
``modelcomparison.md``... |
bastibl/gnuradio | gr-digital/python/digital/gmsk.py | #
# GMSK modulation and demodulation.
#
#
# Copyright 2005-2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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 versi... |
AnsonRS/HAL-9000 | hal.py | # -*- coding: utf-8 -*-
################################
######## Red - Discord bot #####
################################
# made by Twentysix
#
#
import discord
import logging
import time
import datetime
import requests
import aiohttp
import traceback
import re
import youtube_dl
import os
import... |
jpetto/bedrock | tests/functional/smarton/test_all.py | # 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 pytest
from pages.smarton.base import SmartOnBasePage
@pytest.mark.skip_if_firefox
@pytest.mark.nondestructive... |
Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_simpletest_sanity.py | # 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/.
from marionette_harness import MarionetteTestCase
class SimpletestSanityTest(MarionetteTestCase):
callFinish = "re... |
VWApplications/VWCurriculum | vwcurriculum/settings.py | """
Django settings for vwcurriculum 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/
"""
impo... |
raymak/contextualfeaturerecommender | phase1/analysis/munge_json.py | #!/usr/bin/python
import fileinput
import simplejson as json
import csv
import sys
fields = [u'experiment',
u'addon_version',
u'test_mode',
u'locale',
u'experiment_version',
u'systemversion',
u'os',
u'systemname',
u'userid',
u'ts',
u'arm',
u'type', u'value', u'triggerid']
print "\t".join... |
PyLink/pylink-contrib-modules | 2.0/plugins/badchans.py | """
badchans.py - Kills unopered users when they join specified channels and optionally reports them to DNSBLs.
"""
'''
Configuration example:
badchans:
# Configurable list of hosts to exempt. Opers, configured ulines, and non-global addresses
# (e.g. localhost, 10.x.x.x) are automatically exempt.
exempt_... |
Tayamarn/socorro | socorro/unittest/external/es/test_super_search_fields.py | # 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 copy
import datetime
import pytest
from socorro.lib import BadArgumentError
from socorro.external.es.super_sear... |
cjfernanders1986/is210-week-04-warmup | task_04.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""defining a function with three parameters"""
def too_many_kittens(kittens, litterboxes, catfood):
"""Declares three parameters for cats.
Args:
kittens(mixed): First parameter denoting number of kittens
litterboxes(int): a parameter defining n... |
jaumemarti/l10n-spain-txerpa | l10n_es_toponyms/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2009 Zikzakmedia S.L. (http://zikzakmedia.com)
# Jordi Esteve <jesteve@zikzakmedia.com>
# Copyright (c) 2013 Serv. Tecnol. Av... |
epeios-q37/epeios | tools/xdhq/Meta/PYH/main.py | #!/usr/bin/python3
# coding: utf-8
# All files under MIT license
# Copyright (c) 2019 Claude SIMON (https://q37.info/s/rmnmqd49)
# See 'LICENSE' file.
# For 'Repl.it'.
import os,sys
try:
input = raw_input
except NameError:
pass
loop = True
DEMOS = (
"Blank",
"Hello",
"Chatroom",
"Notes",
"TodoMVC",
"Hang... |
romain-li/edx-platform | openedx/core/djangoapps/credentials/utils.py | """Helper functions for working with Credentials."""
from __future__ import unicode_literals
import logging
from openedx.core.djangoapps.catalog.utils import get_programs
from openedx.core.djangoapps.credentials.models import CredentialsApiConfig
from openedx.core.lib.edx_api_utils import get_edx_api_data
log = logg... |
lafranceinsoumise/api-django | agir/mailing/migrations/0009_auto_20191119_1418.py | # Generated by Django 2.2.7 on 2019-11-19 13:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("mailing", "0008_segment_campaigns")]
operations = [
migrations.AlterField(
model_name="segment",
name="campaigns",
fi... |
studentenportal/web | apps/front/mixins.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
class LoginRequiredMixin(object):
"""Ensures that user must be authenticated in ord... |
js-landoo/connector | connector/backend_model.py | # -*- coding: utf-8 -*-
# Copyright 2013-2017 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import models, fields, api
from . import backend
class ConnectorBackend(models.AbstractModel):
""" An instance of an external backend to synchronize with.
The backends ha... |
aminotti/yameo | tests/test_api_REST.py | """
Use ``py.test -m apirest`` to run this test
"""
import pytest
import json
import urllib2
@pytest.fixture()
def hostname():
hostname = 'http://api.meezio.eu:5000/'
return hostname
@pytest.mark.apirest
@pytest.mark.all
def test_add_new_rooms(hostname):
url = "{}{}".format(hostname, "room/")
reque... |
Zaneh-/bearded-tribble-back | tests/integration/test_timeline.py | # Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
scylladb/scylla-longevity-tests | sdcm/sct_events/base.py | # This program 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 License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be usefu... |
apdjustino/DRCOG_Urbansim | src/opus_core/tools/start_calibration.py | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
import re
import os
import sys
import time
import pickle
import subprocess
import numpy as np
from copy import copy
from scipy.optimize import *
from numpy... |
Gebesa-Dev/Addons-gebesa | sale_goal/__openerp__.py | # -*- coding: utf-8 -*-
# © <YEAR(S)> <AUTHOR(S)>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Sales goals",
"summary": "Sales goals.",
"version": "9.0.1.0.0",
"category": "Sales",
"website": "https://odoo-community.org/",
"author": "<Samuel Barron>, Odoo Commu... |
ancafarcas/superdesk-core | apps/content_filters/filter_condition/filter_condition_service.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggin... |
NinjaMSP/crossbar | crossbar/controller/processtypes.py | #####################################################################################
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g.
# you have purchased a commercial license), the license terms below apply.
#
# Should you enter ... |
liqd/a4-meinberlin | tests/projectcontainers/dashboard_components/test_views_container_basic.py | import pytest
from adhocracy4.dashboard import components
from meinberlin.test.helpers import assert_dashboard_form_component_edited
from meinberlin.test.helpers import assert_dashboard_form_component_response
from meinberlin.test.helpers import setup_group_member
component = components.projects.get('container-basic'... |
node13h/droll | droll/tests/runner.py | # Copyright (C) 2017 Sergej Alikov <sergej.alikov@gmail.com>
# This program 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 License, or
# (at your option) any later version.
# ... |
bcgov/ckanext-bcgov | ckanext/bcgov/util/helpers.py | # Copyright 2015, Province of British Columbia
# License: https://github.com/bcgov/ckanext-bcgov/blob/master/license
import datetime
import pytz
import pprint
import logging
import ckan.lib.helpers
import ckan.model as model
import ckan.plugins.toolkit as toolkit
import ckan.logic as logic
from ckan.common import (c,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.