code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#!/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... | scith/htpc-manager_ynh | sources/modules/qbittorrent.py | Python | gpl-3.0 | 12,598 |
# -*- 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... | erggo/Harpy | harpia/bpGUI/getSize.py | Python | gpl-3.0 | 6,145 |
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... | mmcauliffe/linguistic-helper-functions | linghelper/representations/classes.py | Python | gpl-3.0 | 4,708 |
# -*- 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 = [
... | RotorWidgets/base-station | base_station/races/migrations/0001_initial.py | Python | gpl-3.0 | 2,357 |
# -*- 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... | dtschan/weblate | weblate/accounts/tests/test_registration.py | Python | gpl-3.0 | 12,170 |
# 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... | hagabbar/pycbc_copy | pycbc/workflow/coincidence.py | Python | gpl-3.0 | 22,344 |
"""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
... | philetus/geosolver | geosolver/cluster.py | Python | gpl-3.0 | 13,852 |
# 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 ... | s-gogna/JST | symbol_table/scope.py | Python | gpl-3.0 | 2,299 |
#!/usr/bin/env python
###############################################################################
# ____ _ _ _ ____ _ _ #
# | _ \ __ _ _ __| |_(_) ___| | ___/ ___|| |_ __ _| |_ ___ #
# | |_) / _` | '__| __| |/ __| |/ _ \___ \| __/ _` |... | darogan/ParticleStats | scripts/ParticleStats_ROI.py | Python | gpl-3.0 | 5,670 |
# -*- 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... | bioinfo-core-BGU/neatseq-flow_modules | neatseq_flow_modules/Reports/NGSplot.py | Python | gpl-3.0 | 6,561 |
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... | PayloadSecurity/VxAPI | tests/_requests_scenarios/key/key_create.py | Python | gpl-3.0 | 1,226 |
# -*- 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'... | NicovincX2/Python-3.5 | Statistiques/Estimation (statistique)/Régression/Robust regression/theil-sen.py | Python | gpl-3.0 | 1,947 |
#
# 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... | phw/weblate | weblate/metrics/apps.py | Python | gpl-3.0 | 906 |
#!/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 ... | fishpepper/OpenGround | scripts/generate_hoptable.py | Python | gpl-3.0 | 2,370 |
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... | avix060/avix-addons | plugin.video.einthusan-new/resources/lib/modules/addonutility.py | Python | gpl-3.0 | 2,720 |
#! /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... | awickert/alluvstrat | base.py | Python | gpl-3.0 | 14,947 |
# 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... | scottbarton/MPR-lab | Student Composition Projects/CSP_Composer_V2/constraintsADT.py | Python | gpl-3.0 | 7,626 |
import random
a = random.randint(1,6)
b = random.randint(1,6)
c = random.randint(1,6)
if a == b == c:
score = a + b + c
elif a == b:
score = (a + b) - c
elif b == c:
score = (b + c) - a
elif a == c:
score = (a + c) - b
else:
score = 0
print(score)
| joeyoung658/A-Level_2016-18 | Other/Dice.py | Python | gpl-3.0 | 287 |
#--------------------------------------------------------------------
#Administration Details
#--------------------------------------------------------------------
__author__ = "Mats Larsen"
__copyright__ = "Mats Larsen 2014"
__credits__ = ["Mats Larsen"]
__license__ = "GPLv3"
__maintainer__ = "Mats Larsen"
__email__ =... | Matla/DebuggingModuleInterfacePython | code/app.py | Python | gpl-3.0 | 3,014 |
# 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... | s0lst1c3/eaphammer | local/hostapd-eaphammer/tests/hwsim/test_p2p_grpform.py | Python | gpl-3.0 | 51,106 |
#!/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
... | toolsprods/SniffVPN | core/logjson.py | Python | gpl-3.0 | 1,054 |
# -*- 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... | alfa-addon/addon | plugin.video.alfa/servers/videossh.py | Python | gpl-3.0 | 1,112 |
# -*- 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... | scaphe/lettuce-dirty | tests/functional/output_features/success_outline/success_outline_steps.py | Python | gpl-3.0 | 1,529 |
#####################################################################
# #
# Refinement Script with SHELX and CCP4/REFMAC5 #
# #
# Copyright: Molecular Images 2005 ... | mifit/miexpert | mi_refine.py | Python | gpl-3.0 | 134,553 |
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... | lypnol/adventofcode-2016 | day-22/part-1/ayoub.py | Python | gpl-3.0 | 634 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Find the prefix string common to a group of paths.
"""
__version__ = "$Id$"
#end_pymotw_header
import os.path
paths = ['/one/two/three/four',
'/one/two/threefold',
'/one/two/three/',
]
pr... | qilicun/python | python2/PyMOTW-1.132/PyMOTW/ospath/ospath_commonprefix.py | Python | gpl-3.0 | 363 |
def f(a, b):
return a == b
f("abc", True)
| pyta-uoft/pyta | sample_usage/typecheck/fail/3_comp_str_bool.py | Python | gpl-3.0 | 48 |
# 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... | YufeiZhang/Principles-of-Programming-Python-3 | Labs/lab9/word_ladder.py | Python | gpl-3.0 | 2,411 |
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 ... | jeremiah-c-leary/vhdl-style-guide | vsg/rules/if_statement/rule_003.py | Python | gpl-3.0 | 714 |
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))... | s0vereign/Ahti | utils/pyvis/TimeProp_diagonal_scheme.py | Python | gpl-3.0 | 1,366 |
# -*- 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.
... | laborautonomo/bitmask_client | src/leap/bitmask/services/mail/plumber.py | Python | gpl-3.0 | 10,121 |
# 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.
#
#... | eaobservatory/hedwig | test/test_jcmt_calc_s2.py | Python | gpl-3.0 | 4,087 |
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... | kobigurk/tmsp-ethereum | vendor/github.com/tendermint/tmsp/example/python3/tmsp/server.py | Python | gpl-3.0 | 6,830 |
"""
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... | wehr-lab/RPilot | autopilot/setup/setup_autopilot.py | Python | gpl-3.0 | 27,926 |
# -*- 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 ... | aosprey/rose | lib/python/rose/apps/comparisons/within.py | Python | gpl-3.0 | 5,622 |
# -*- 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... | cbedetti/Dcm2Bids | tests/test_structure.py | Python | gpl-3.0 | 952 |
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.... | statsmaths/dtv-toolkit | setup.py | Python | gpl-3.0 | 2,665 |
# -*- 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',
... | pkom/gesiesweb | gesiesweb/profesores/migrations/0004_auto_20151019_1049.py | Python | gpl-3.0 | 476 |
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... | drewblay/Personal-Finance-Django-App | banking/transactions/models.py | Python | gpl-3.0 | 1,493 |
#!/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... | corradio/electricitymap | parsers/EIA.py | Python | gpl-3.0 | 22,419 |
# ##### 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... | loglow/spine | web/spine/spine_core/apps.py | Python | gpl-3.0 | 888 |
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... | streed/PyEndicia | setup.py | Python | gpl-3.0 | 518 |
# 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 _... | RobotStudio/choreo-msg | msg/sensor/joint_pb2.py | Python | gpl-3.0 | 7,717 |
#!/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... | jdsolucoes/Pymodoro | config.py | Python | gpl-3.0 | 856 |
# 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... | supermurat/hamsi-manager | FileUtils/__init__.py | Python | gpl-3.0 | 86,887 |
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... | gbin/err | errbot/backends/telegram_messenger.py | Python | gpl-3.0 | 15,683 |
# -*- 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... | pkom/gesiesweb | gesiesweb/partes/views.py | Python | gpl-3.0 | 11,053 |
#!/usr/bin/env python
import util
print "Point your browser at\n\n https://cloud.sagemath.com" + util.base_url() + '\n\n'
| evelynmitchell/smc | src/dev/project/info.py | Python | gpl-3.0 | 128 |
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... | FreshetDMS/FDCapacityPlanner | vsvbp/container.py | Python | gpl-3.0 | 2,389 |
from distutils.core import setup
setup(
name='micromeritics',
version='0.2.0',
packages=['micromeritics',],
maintainer='Stefan Koch',
description='Python package for gas adsorption calculations and support tools.',
maintainer_email='stefan.koch.micro@gmail.com',
url='https://githu... | RJC0514/micromeritics | setup.py | Python | gpl-3.0 | 461 |
# -*- 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... | efernandez/aess_challenge_24h_2013_rebujitos_team | tests/wire/wire_controller.py | Python | gpl-3.0 | 1,324 |
#!/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... | Kefkius/scallop | gui/qt/qrwindow.py | Python | gpl-3.0 | 2,750 |
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... | vivescere/yajuu | yajuu/unshorteners/mp4upload.py | Python | gpl-3.0 | 584 |
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... | JonSteinn/Kattis-Solutions | src/Saving the Universe/Python 3/main.py | Python | gpl-3.0 | 766 |
#!/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... | mlabru/ptracks | model/visil/airspace_visil.py | Python | gpl-3.0 | 20,764 |
#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... | spiffytech/spiffybot | modules/weather/weather.py | Python | gpl-3.0 | 2,993 |
#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... | citizensense/csk | libraries/utilities.py | Python | gpl-3.0 | 4,783 |
#!/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: ... | tasoc/photometry | tests/test_linpsfphotometry.py | Python | gpl-3.0 | 3,551 |
#!/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('//*... | codeguida/vkutils | EnotikBot/main.py | Python | gpl-3.0 | 2,949 |
"""
__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... | Balannen/LSMASOMM | atom3/Formalisms/LSMASOMM/hasActions.py | Python | gpl-3.0 | 3,632 |
#!/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.
#
... | aidan-/ansible-modules-extras | identity/ipa/ipa_hostgroup.py | Python | gpl-3.0 | 9,452 |
#!/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 = ... | sangwook236/SWL | python/test/util/util_test.py | Python | gpl-3.0 | 7,792 |
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':
... | robwarm/gpaw-symm | gpaw/test/big/Ru001/molecules.py | Python | gpl-3.0 | 537 |
#!/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... | Micket/CCBuilder | vol_stat_cc.py | Python | gpl-3.0 | 10,117 |
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 = ... | octoalmawaukh/math-waffle | work in progress/## 60 list of probability distributions/imgsrc/pdf_normalny.py | Python | gpl-3.0 | 744 |
#!/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__... | feranick/SpectralMachine | Utilities/XmuDataMaker.py | Python | gpl-3.0 | 7,270 |
# 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... | zhanglab/psamm | psamm/translate_id.py | Python | gpl-3.0 | 8,741 |
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... | DexGroves/dexml | tests/test_ppr.py | Python | gpl-3.0 | 1,077 |
# -*- 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... | igurrutxaga/tvalacarta | python/main-classic/servers/descargavideos.py | Python | gpl-3.0 | 1,395 |
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... | dimh/saddam | models/saddam.py | Python | gpl-3.0 | 522 |
"""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``... | jbloom/phydms | phydmslib/utils.py | Python | gpl-3.0 | 4,686 |
#
# 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... | bastibl/gnuradio | gr-digital/python/digital/gmsk.py | Python | gpl-3.0 | 11,200 |
# -*- 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... | AnsonRS/HAL-9000 | hal.py | Python | gpl-3.0 | 81,472 |
L: List[int] = list()
x: int = 2
# STATE: L -> ⊥; len(L) -> [0, 0]; x -> [2, 2]
if x in L:
# STATE: L -> ⊥; len(L) -> [0, 0]; x -> ⊥
print(x)
else:
raise ValueError
# FINAL: L -> ⊥; len(L) -> [0, 0]; x -> ⊥
| caterinaurban/Lyra | src/lyra/unittests/numerical/interval/forward/summarization/inL2.py | Python | mpl-2.0 | 230 |
# 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... | jpetto/bedrock | tests/functional/smarton/test_all.py | Python | mpl-2.0 | 1,151 |
# 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 https://mozilla.org/MPL/2.0/.
WINDOWS_MSVC = {
"cmake": "3.14.3",
"llvm": "8.0.1",
"moztools": "3.2",
"ninja": "1.7.1",
"nuget": ... | UK992/servo | python/servo/packages.py | Python | mpl-2.0 | 476 |
# 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... | Yukarumya/Yukarum-Redfoxes | testing/marionette/harness/marionette_harness/tests/unit/test_simpletest_sanity.py | Python | mpl-2.0 | 5,270 |
"""
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... | VWApplications/VWCurriculum | vwcurriculum/settings.py | Python | mpl-2.0 | 4,148 |
VERSION = (2, 2, 0)
__version__ = ".".join(str(v) for v in VERSION)
| rehandalal/therapist | therapist/__init__.py | Python | mpl-2.0 | 70 |
#!/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... | raymak/contextualfeaturerecommender | phase1/analysis/munge_json.py | Python | mpl-2.0 | 523 |
"""
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_... | PyLink/pylink-contrib-modules | 2.0/plugins/badchans.py | Python | mpl-2.0 | 8,466 |
# 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... | Tayamarn/socorro | socorro/unittest/external/es/test_super_search_fields.py | Python | mpl-2.0 | 8,016 |
#!/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... | cjfernanders1986/is210-week-04-warmup | task_04.py | Python | mpl-2.0 | 724 |
# -*- coding: utf-8 -*-
from code_coverage_bot import codecov
def test_ok():
assert(codecov)
| lundjordan/services | src/codecoverage/bot/tests/test_codecov.py | Python | mpl-2.0 | 100 |
# -*- 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... | jaumemarti/l10n-spain-txerpa | l10n_es_toponyms/__openerp__.py | Python | agpl-3.0 | 2,414 |
#!/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... | epeios-q37/epeios | tools/xdhq/Meta/PYH/main.py | Python | agpl-3.0 | 1,604 |
# Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
from UM.Mesh.MeshData import MeshData
@profile
def addVertex(mesh):
mesh.addVertex(0, 1, 0)
mesh = MeshData()
mesh.reserveVertexCount(1000000)
for i in range(1000000):
addVertex(mesh)
| onitake/Uranium | tests/benchmarks/MeshData/profile_addvertex.py | Python | agpl-3.0 | 294 |
# -*- coding: utf-8 -*-
# Copyright 2017 KMEE
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
# from . import financial_cashflow
# from . import financial_statement_report
from . import report_xlsx_financial_base
from . import report_xlsx_financial_cashflow
from . import report_xlsx_financial_cashflow... | odoo-brazil/l10n-brazil-wip | financial/reports/__init__.py | Python | agpl-3.0 | 328 |
"""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... | romain-li/edx-platform | openedx/core/djangoapps/credentials/utils.py | Python | agpl-3.0 | 4,391 |
# 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... | lafranceinsoumise/api-django | agir/mailing/migrations/0009_auto_20191119_1418.py | Python | agpl-3.0 | 579 |
# -*- 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... | studentenportal/web | apps/front/mixins.py | Python | agpl-3.0 | 1,017 |
# -*- 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... | js-landoo/connector | connector/backend_model.py | Python | agpl-3.0 | 3,488 |
"""
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... | aminotti/yameo | tests/test_api_REST.py | Python | agpl-3.0 | 2,602 |
# -*- coding: utf-8 -*-
# © 2016 Antiun Ingeniería S.L. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Mail Debrand",
"summary": "Remove Odoo branding from email footers",
"version": "8.0.1.0.0",
"category": "Social Network",
"website": "http://www.ant... | open-synergy/social | mail_debrand/__openerp__.py | Python | agpl-3.0 | 525 |
# 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... | Zaneh-/bearded-tribble-back | tests/integration/test_timeline.py | Python | agpl-3.0 | 2,275 |
# 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... | scylladb/scylla-longevity-tests | sdcm/sct_events/base.py | Python | agpl-3.0 | 16,570 |
# 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... | apdjustino/DRCOG_Urbansim | src/opus_core/tools/start_calibration.py | Python | agpl-3.0 | 23,579 |
# -*- 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... | Gebesa-Dev/Addons-gebesa | sale_goal/__openerp__.py | Python | agpl-3.0 | 774 |
# -*- 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... | ancafarcas/superdesk-core | apps/content_filters/filter_condition/filter_condition_service.py | Python | agpl-3.0 | 5,680 |
#####################################################################################
#
# 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 ... | NinjaMSP/crossbar | crossbar/controller/processtypes.py | Python | agpl-3.0 | 11,472 |