text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | chepazzo/ansible-modules-extras | cloud/amazon/ec2_eni.py | Python | gpl-3.0 | 13,881 | 0.004322 |
from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'', include('dju_privateurl.urls')),
]
| liminspace/dju-privateurl | tests/urls.py | Python | mit | 188 | 0 |
from patients.models import Patient, Next_of_Kin, Vitals, Visits, Diagnosis, Medication, History, Documents
from django import forms
class PatientForm(forms.ModelForm):
class Meta:
model = Patient
class Next_of_KinForm(forms.ModelForm):
class Meta:
model = Next_of_Kin
class VitalsForm(form... | ianjuma/usiu-app-dir | benchcare/patients/forms.py | Python | gpl-2.0 | 775 | 0.00129 |
# http://rosalind.info/problems/long/
def superstring(arr, accumulator=''):
# We now have all strings
if len(arr) == 0:
return accumulator
# Initial call
elif len(accumulator) == 0:
accumulator = arr.pop(0)
return superstring(arr, accumulator)
# Recursive call
else:
... | AntoineAugusti/katas | rosalind/long.py | Python | mit | 1,108 | 0.001805 |
import glob
import os
from os.path import join
import numpy as n
def writeScript(rootName, plate, env):
f=open(rootName+".sh",'w')
f.write("#!/bin/bash \n")
f.write("#PBS -l walltime=40:00:00 \n")
f.write("#PBS -o "+plate+".o.$PBS_JOBID \n")
f.write("#PBS -e "+plate+".e$PBS_JOBID \n")
f.write("#PBS -M comparat@m... | JohanComparat/pySU | spm/bin/combine_model_spectra_write_scripts.py | Python | cc0-1.0 | 1,246 | 0.028892 |
#coding:utf-8
import functools
from cactus.utils.internal import getargspec
from cactus.plugin import defaults
class PluginManager(object):
def __init__(self, site, loaders):
self.site = site
self.loaders = loaders
self.reload()
for plugin_method in defaults.DEFAULTS:
... | ibarria0/Cactus | cactus/plugin/manager.py | Python | bsd-3-clause | 2,122 | 0.001885 |
#
# NineMSN CatchUp TV Video API Library
#
# This code is forked from Network Ten CatchUp TV Video API Library
# Copyright (c) 2013 Adam Malcontenti-Wilson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), ... | predakanga/plugin.video.catchuptv.au.ninemsn | resources/lib/ninemsnvideo/objects.py | Python | mit | 3,248 | 0.011084 |
from datetime import datetime
from sqlalchemy.orm import reconstructor, relationship, backref
from sqlalchemy.schema import Column, ForeignKey
from sqlalchemy.types import Integer, Unicode, Boolean, DateTime
from sqlalchemy import BigInteger
from sqlalchemy.sql.expression import false, or_
from sqlalchemy.ext.associati... | USStateDept/FPA_Core | openspending/model/dataorg.py | Python | agpl-3.0 | 5,452 | 0.004585 |
# 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 writing, software
# d... | wolverineav/neutron | neutron/tests/unit/agent/l3/test_router_info.py | Python | apache-2.0 | 16,514 | 0 |
import magics
__all__ = ['by_version', 'by_magic']
_fallback = {
'EXTENDED_ARG': None,
'hasfree': [],
}
class dis(object):
def __init__(self, version, module):
self._version = version
from __builtin__ import __import__
self._module = __import__('decompyle.%s' % module, globals... | devyn/unholy | decompyle/decompyle/dis_files.py | Python | mit | 1,163 | 0.006019 |
import _plotly_utils.basevalidators
class ColorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="color", parent_name="layout.xaxis.tickfont", **kwargs
):
super(ColorValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pa... | plotly/plotly.py | packages/python/plotly/plotly/validators/layout/xaxis/tickfont/_color.py | Python | mit | 418 | 0.002392 |
# ####################### BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | insiderr/insiderr-app | app/modules/requests/packages/chardet/big5prober.py | Python | gpl-3.0 | 1,685 | 0.000593 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import get_request_site_address, encode
from frappe.model.document import Document
from six.moves.urllib.parse import quote
fr... | StrellaGroup/frappe | frappe/website/doctype/website_settings/website_settings.py | Python | mit | 4,709 | 0.026545 |
# =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... | bsmr-eve/Pyfa | gui/builtinStatsViews/resourcesViewFull.py | Python | gpl-3.0 | 15,284 | 0.002748 |
from django.template import RequestContext
from django.shortcuts import render_to_response
from django.http import HttpResponse, HttpResponseRedirect, Http404
from django.forms.models import modelformset_factory
from worldcup.common.msg_util import *
from worldcup.common.user_util import *
from worldcup.matches.models ... | raprasad/worldcup | worldcup/worldcup/predictions/views.py | Python | mit | 6,415 | 0.018083 |
import recurly
class RecurlyError(Exception):
@classmethod
def error_from_status(cls, status):
return recurly.errors.ERROR_MAP.get(status, "")
class ApiError(RecurlyError):
def __init__(self, message, error):
super(ApiError, self).__init__(message)
self.error = error
class Netw... | recurly/recurly-client-python | recurly/base_errors.py | Python | mit | 353 | 0 |
'''
Contains physical constants used in snow modeling.
@var a_gravity: Gravitational acceleration [m s-2]
@var eta0: Viscosity of snow at T=0C and density=0 [N s m- 2 = kg m-1 s-1]
@var rho_air: Density of air [kg m-3], dry air at 0 C and 100 kPa
@var rho_water: Density of water [kg m-3]
@var rho_ice: Density o... | kmunve/pysenorge | pysenorge/constants.py | Python | gpl-3.0 | 1,844 | 0.005965 |
# Copyright 2014-2020 Scalyr Inc.
#
# 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 writin... | imron/scalyr-agent-2 | benchmarks/micro/test_json_serialization.py | Python | apache-2.0 | 5,318 | 0.00188 |
""".. Ignore pydocstyle D400.
==================
Storage Management
==================
.. automodule:: resolwe.storage.management.commands.run_storage_manager
:members:
"""
| genialis/resolwe | resolwe/storage/management/__init__.py | Python | apache-2.0 | 180 | 0 |
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | krafczyk/spack | var/spack/repos/builtin/packages/py-lrudict/package.py | Python | lgpl-2.1 | 1,591 | 0.001257 |
"""Sections variable used for grouping Gjoneska 2015 GO IDs."""
__copyright__ = "Copyright (C) 2016-2018, DV Klopfenstein, H Tang. All rights reserved."
__author__ = "DV Klopfenstein"
SECTIONS = [ # 18 sections
("immune", [ # 15 GO-headers
"GO:0002376", # BP 564 L01 D01 M immune system process
... | tanghaibao/goatools | goatools/test_data/sections/gjoneska_pfenning.py | Python | bsd-2-clause | 9,848 | 0.017465 |
# This file is autogenerated. Do not edit it manually.
# If you want change the content of this file, edit
#
# spec/fixtures/responses/whois.biz/status_available
#
# and regenerate the tests with the following script
#
# $ scripts/generate_tests.py
#
from nose.tools import *
from dateutil.parser import parse as t... | huyphan/pyyawhois | test/record/parser/test_response_whois_biz_status_available.py | Python | mit | 1,928 | 0.002593 |
#!/usr/bin/env python3
# See [1] https://pubs.acs.org/doi/pdf/10.1021/j100247a015
# Banerjee, 1985
# [2] https://aip.scitation.org/doi/abs/10.1063/1.2104507
# Heyden, 2005
# [3] https://onlinelibrary.wiley.com/doi/abs/10.1002/jcc.540070402
# Baker, 1985
# [4] 10.1007/s002140050387
#... | eljost/pysisyphus | deprecated/optimizers/RSRFOptimizer.py | Python | gpl-3.0 | 5,961 | 0.001342 |
from time import sleep
class TestPyTest:
def testOne(self):
sleep(1.5) # To check duration
assert 4 == 2*2
def testTwo(self):
assert True
def testThree():
assert 4 == 2*2
| paplorinc/intellij-community | python/testData/testRunner/env/pytest/test1.py | Python | apache-2.0 | 209 | 0.014354 |
"""Facebook platform for notify component."""
import json
import logging
from aiohttp.hdrs import CONTENT_TYPE
import requests
import voluptuous as vol
from homeassistant.const import CONTENT_TYPE_JSON
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (
ATTR_DATA,
... | fbradyirl/home-assistant | homeassistant/components/facebook/notify.py | Python | apache-2.0 | 3,953 | 0.000253 |
from __future__ import unicode_literals
from djblets.webapi.errors import WebAPIError
class WebAPITokenGenerationError(Exception):
"""An error generating a Web API token."""
pass
#
# Standard error messages
#
UNSPECIFIED_DIFF_REVISION = WebAPIError(
200,
'Diff revision not specified.',
http_sta... | custode/reviewboard | reviewboard/webapi/errors.py | Python | mit | 4,753 | 0 |
from t_core.composer import Composer
from t_core.matcher import Matcher
from t_core.iterator import Iterator
from t_core.rewriter import Rewriter
from t_core.resolver import Resolver
class ARule(Composer):
'''
Applies the transformation on one match.
'''
def __init__(self, LHS, RHS):
... | levilucio/SyVOLT | t_core/tc_python/arule.py | Python | mit | 2,673 | 0.001871 |
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, m... | MSEMJEJME/Get-Dumped | renpy/display/imagelike.py | Python | gpl-2.0 | 10,715 | 0.004666 |
# Copyright 2013-2016 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''This module defines the L{main()} function for executing the zim
application. It also defines a number of command classes that implement
specific commandline commands and an singleton application object that
takes core of the process life cycle.
'... | jaap-karssenberg/zim-desktop-wiki | zim/main/__init__.py | Python | gpl-2.0 | 28,210 | 0.026728 |
__author__ = 'jhala'
import Helpers
import json
import os
''' creates a location lookup, and an associated image lookup '''
''' main '''
if __name__ == "__main__":
fil = r"c:\capstone\featureInfo.csv"
outLoc = r"c:\capstone\locationLookup.json"
imageBaseDir="C:\\Users\\jhala\\angular-seed\\app\\images\\"... | dbk138/ImageRegionRecognition-FrontEnd | PythonScripts/LocationLookup.py | Python | mit | 2,163 | 0.017568 |
# pylint: disable=missing-docstring
import json
from urlparse import urlparse
from django.core.urlresolvers import reverse
from django.http import QueryDict
from django.test import TestCase
import jwt
import provider.scope
from oauth2_provider.models import TrustedClient
from oauth2_provider.tests.util import normp... | GbalsaC/bitnamiP | venv/src/oauth2-provider/oauth2_provider/tests/base.py | Python | agpl-3.0 | 5,353 | 0.000374 |
import logging, couchdb, oauth2, json, sys
from decorator import decorator
from pylons import config, request as r, response as res, session
from pylons.controllers.util import abort
from functools import wraps
log = logging.getLogger(__name__)
appConfig = config['app_conf']
class Error(RuntimeError):
"""Generic... | jimklo/LearningRegistry | LR/lr/lib/oauth.py | Python | apache-2.0 | 6,907 | 0.007963 |
# encoding: utf-8
# module PyKDE4.kio
# from /usr/lib/python3/dist-packages/PyKDE4/kio.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdeui as __PyKDE4_kdeui
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
class KIconDialog(__PyKDE4_kdeui.KDialog):
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kio/KIconDialog.py | Python | gpl-2.0 | 1,319 | 0.010614 |
#
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2020
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... | steve-ord/daliuge | daliuge-engine/dlg/runtime/tool_commands.py | Python | lgpl-2.1 | 1,948 | 0.00462 |
from typing import Any
from typing import Dict
from sqlalchemy.orm import declarative_base
from sqlalchemy.orm import declared_attr
Base = declarative_base()
class Foo(Base):
@declared_attr
def __tablename__(cls) -> str:
return "name"
@declared_attr
def __mapper_args__(cls) -> Dict[Any, An... | sqlalchemy/sqlalchemy | test/ext/mypy/plugin_files/issue_7321.py | Python | mit | 427 | 0 |
"""Schema migrations."""
| yongwen/makahiki | makahiki/apps/widgets/smartgrid_play_tester/migrations/__init__.py | Python | mit | 25 | 0 |
from django.apps import AppConfig
from django.utils.translation import ugettext as __, ugettext_lazy as _
class TaskerConfig(AppConfig):
name = 'django_tasker'
verbose_name = _('tasker')
| wooyek/django-tasker | django_tasker/apps.py | Python | mit | 197 | 0 |
import numpy as np
from sklearn import linear_model
import matplotlib.pyplot as plt
from scipy.special import zeta
from .distribution import frequency_distribution, powerlaw_series, random_series
from .utils import unique
from math import pow, e, log, sqrt
import sys
import random
def least_square_regression(x, y, ... | shagunsodhani/powerlaw | powerlaw/regression.py | Python | mit | 7,543 | 0.012727 |
#!/usr/bin/env python
from setuptools import setup, find_packages
REPO_NAME = 'chickenzord/dotenvy'
VERSION = '0.2.0'
ARCHIVE_URL = 'https://github.com/%s/archive/v%s.tar.gz' % (REPO_NAME, VERSION)
setup(
# packaging
packages=find_packages('src'),
package_dir={'': 'src'},
package_data={},
instal... | chickenzord/dotenvy | setup.py | Python | mit | 1,627 | 0 |
# coding: utf8
"""
webencodings.tests
~~~~~~~~~~~~~~~~~~
A basic test suite for Encoding.
:copyright: Copyright 2012 by Simon Sapin
:license: BSD, see LICENSE for details.
"""
from __future__ import unicode_literals
from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode,
... | aeroaks/httpProfiler | methods/webencodings/tests.py | Python | mit | 6,184 | 0 |
# Author: Marvin Pinto <me@marvinp.ca>
# Author: Dennis Lutter <lad1337@gmail.com>
# Author: Shawn Conroyd <mongo527@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General P... | imajes/Sick-Beard | sickbeard/notifiers/boxcar2.py | Python | gpl-3.0 | 5,011 | 0.002993 |
###############################################################################
# Name: smalltalk.py #
# Purpose: Define Smalltalk syntax for highlighting and other features #
# Author: Cody Precord <cprecord@editra.org> #
... | garrettcap/Bulletproof-Backup | wx/tools/Editra/src/syntax/_smalltalk.py | Python | gpl-2.0 | 3,406 | 0.00411 |
import numdifftools
numdifftools.test() | maniteja123/numdifftools | conda_recipe/run_test.py | Python | bsd-3-clause | 40 | 0.025 |
from django.conf.urls import url
from ..views import (PowerCycleListView, PowerCycleCreateView, PowerCycleDetailView,
PowerCycleUpdateView, PowerCycleDeleteView)
from django.contrib.auth.decorators import login_required
urlpatterns = [
url(r'^create/$', # NOQA
login_required(PowerCyc... | Hattivat/hypergolic-django | hypergolic/catalog/urls/power_cycle_urls.py | Python | agpl-3.0 | 826 | 0.001211 |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | AdrianGaudebert/configman | configman/converters.py | Python | bsd-3-clause | 15,400 | 0.002013 |
# -*- coding: utf-8 -*-
"""
Various i18n functions.
Helper functions for both the internal translation system
and for TranslateWiki-based translations.
By default messages are assumed to reside in a package called
'scripts.i18n'. In pywikibot 2.0, that package is not packaged
with pywikibot, and pywikibot 2.0 does ... | emijrp/pywikibot-core | pywikibot/i18n.py | Python | mit | 21,745 | 0.000368 |
#!/usr/bin/python
"""
*************************************************
* @Project: Self Balance
* @Platform: Raspberry PI 2 B+
* @Description: Motor module
* DC Motor with gearbox/encoder
* Motor driver VNH2SP30
* @Owner: Guilherme Chinellato
* @Email: guilhermechi... | gchinellato/Self-Balance-Robot | nfs-server/modules/Motion/Motor/motor.py | Python | gpl-3.0 | 3,971 | 0.007555 |
import ssl
import sys
from tornado import web, httpserver, ioloop, process, autoreload
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader
from RESTDIRAC.RESTSystem.Base.RESTHandler import RESTHandler
from RESTDIRAC.ConfigurationSystem.Client.Helpers import RESTConf
cl... | DIRACGrid/RESTDIRAC | RESTSystem/private/RESTApp.py | Python | gpl-3.0 | 2,840 | 0.044366 |
"""
The Tornado Framework
By Ali Pesaranghader
University of Ottawa, Ontario, Canada
E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com
---
*** The Page Hinkley (PH) Method Implementation ***
Paper: Page, Ewan S. "Continuous inspection schemes."
Published in: Biometrika 41.1/2 (1954): 100-115... | alipsgh/tornado | drift_detection/page_hinkley.py | Python | mit | 2,052 | 0.001462 |
"""
Development specific settings for troupon project.
"""
from .base import *
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'troupon',
'USER': os.getenv('DB_USER'),
... | andela/troupon | troupon/troupon/settings/development.py | Python | mit | 420 | 0.002381 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | mitya57/debian-buildbot | buildbot/db/connector.py | Python | gpl-2.0 | 5,291 | 0.000756 |
import ninjag
from ninjag.tk.ioTK import read_all
def test():
f_input = "input/in5.yaml"
f_answer = "output/out5.ninja"
f_solution = "solution/sol5.ninja"
ninjag.main(f_answer, [f_input])
answer = read_all(f_answer)
solution = read_all(f_solution)
assert answer == solution
| yuhangwang/ninjag-python | test/frontend/build_dep/test_5.py | Python | mit | 304 | 0 |
# Copyright 2018 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 applica... | gunan/tensorflow | tensorflow/python/keras/saving/saved_model/load.py | Python | apache-2.0 | 40,001 | 0.006875 |
#!/usr/bin/env python2
###############################################################################
#
# Set a baseline for all benchmarks using numpy's serial matrix multiplication
#
# Copyright (C) 2015, Jonathan Gillett
# All rights reserved.
#
#
# This program is free software: you can redistribute it and/or modi... | gnu-user/mcsc-6030-project | codes/benchmarks/baseline.py | Python | gpl-3.0 | 1,605 | 0 |
#!/usr/bin/env python
"""
basketPInfo data procesors (rrdtool output)
Rafal Zawadzki <bluszcz@bluszcz.net>
BSD License (license.txt)
"""
import sys
def exit_failure():
" Nice info on failure "
print "usage: %s int\n" % sys.argv[0]
print "int should be 2 (humidity) or 3 (temperature)"
sys.exit(-1)
if... | bluszcz/basketpinfo | python/process_to_rrdtool.py | Python | bsd-3-clause | 812 | 0.011084 |
# -*- coding: utf-8 -*-
# Copyright(C) 2019 Sylvie Ye
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) ... | vicnet/weboob | modules/ing/api/login.py | Python | lgpl-3.0 | 5,888 | 0.002887 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Product Matrix",
'summary': """
Technical module: Matrix Implementation
""",
'description': """
Please refer to Sale Matrix or Purchase Matrix for the use of this module.
""",
'ca... | jeremiahyan/odoo | addons/product_matrix/__manifest__.py | Python | gpl-3.0 | 888 | 0 |
from SimPEG import Mesh, Regularization, Maps, Utils, EM
from SimPEG.EM.Static import DC
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import copy
#import pandas as pd
#from scipy.sparse import csr_matrix, spdiags, dia_matrix,diags
#from scipy.sparse.linalg import spsolve
from scipy.stats imp... | thast/EOSC513 | DC/SimultaneousSources/Update_W_each_3it_5s_rademacher/Update_W_each_3it_5s_rademacher.py | Python | mit | 8,698 | 0.022189 |
#!/usr/bin/env python
# hot_drinks.py
# Copyright (C) ContinuumBridge Limited, 2014-2015 - All Rights Reserved
# Written by Peter Claydon
#
# Default values:
config = {
"hot_drinks": True,
"name": "A Human Being",
"alert": True,
"ignore_time": 120,
"window": 360,
"threshold": 10,
"daily_rep... | ContinuumBridge/hot_drinks_app | hot_drinks.py | Python | mit | 13,490 | 0.005263 |
# Copyright (C) 2005-2010 MISG/ICTI/EIA-FR
# See LICENSE for details.
"""
Factories for AMQ clients, Thrift clients and SMAC Clients and servers.
@author: Jonathan Stoppani <jonathan.stoppani@edu.hefr.ch>
"""
import weakref
from twisted.internet.protocol import ReconnectingClientFactory
from twisted.internet impo... | SMAC/corelib | smac/amqp/protocol.py | Python | gpl-3.0 | 13,170 | 0.008276 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
pass
def backwards(self, orm):
pass
models = {
}
... | CWVanderReyden/originalMyHomeNet | recipeBox/migrations/0001_initial.py | Python | gpl-3.0 | 353 | 0.005666 |
#!/usr/bin/env python
#
# Copyright 2004,2005,2007,2010,2012,2013 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 version ... | trondeau/gnuradio-old | gr-blocks/python/blocks/qa_stream_mux.py | Python | gpl-3.0 | 6,241 | 0.005929 |
# -*- coding: utf-8 -*-
# Copyright 2015 Red Hat, Inc.
#
# 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... | Akrog/gcs-client | gcs_client/common.py | Python | apache-2.0 | 7,705 | 0 |
# Copyright 2018 SAS Project 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 requ... | Wireless-Innovation-Forum/Spectrum-Access-System | src/harness/reference_models/pre_iap_filtering/inter_sas_duplicate_grant.py | Python | apache-2.0 | 2,583 | 0.00813 |
import asyncio
import email.utils
import json
import sys
from cgi import parse_header
from collections import namedtuple
from http.cookies import SimpleCookie
from urllib.parse import parse_qs, unquote, urlunparse
from httptools import parse_url
from sanic.exceptions import InvalidUsage
from sanic.log import error_l... | lixxu/sanic | sanic/request.py | Python | mit | 11,420 | 0.000088 |
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.utils import six
class AccountActivationTokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, user, timestamp):
return (six.text_type(user.pk) + six.text_type(timestamp)) + six.text_type(user.is_active)
accou... | srijannnd/Login-and-Register-App-in-Django | simplesocial/accounts/tokens.py | Python | mit | 375 | 0.008 |
# 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 sys
import traceback
from StringIO import StringIO
import re
import datetime
from urllib import urlencode
from co... | mozilla/pto | pto/apps/dates/views.py | Python | mpl-2.0 | 37,380 | 0.00099 |
from django.test import TestCase
from .utils import is_holiday
from datetime import date, timedelta
class HolidaysTests(TestCase):
longMessage = True
fixtures = ['demo']
def fullYearTest(self, group, year, holidays):
it = date(year, 1, 1)
end = date(year, 12, 31)
delta = timedelta... | fopina/django-holidays | holidays/tests.py | Python | mit | 1,476 | 0 |
import logging
import sys
import traceback
from collections import namedtuple
import numpy as np
import pandas as pd
from scipy.stats import chisquare
from . import categorizer as cat
from . import draw
from .ipf.ipf import calculate_constraints
from .ipu.ipu import household_weights
logger = logging.getLogger("synt... | sfcta/synthpop | synthpop/synthesizer.py | Python | bsd-3-clause | 6,015 | 0.001829 |
from __future__ import unicode_literals
from rest_framework import viewsets
from rest_framework import permissions
from videos.api.serializers import video as video_serializers
from videos.models import Video
class VideoViewSet(viewsets.ModelViewSet):
permission_classes = [permissions.DjangoModelPermissionsOrA... | sdeleeuw/contagement | videos/api/viewsets/video.py | Python | gpl-3.0 | 1,272 | 0 |
#hw 1/ task8/ Sergei Shybkoi
t = (1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 'a', 'b', 'c')
print "Set:",t
print "Each third element:"
print t[2::3]
print t[-1*len(t)+2:-1:3] | pybursa/homeworks | s_shybkoy/hw1/hw1_task8_ShybkoiSergei.py | Python | gpl-2.0 | 162 | 0.018519 |
# -*- coding: utf-8 -*-
from django import forms
from django.core.exceptions import ImproperlyConfigured
from django.db.models import fields
from modeltranslation import settings as mt_settings
from modeltranslation.utils import (
get_language, build_localized_fieldname, build_localized_verbose_name, resolution_or... | yaroslavprogrammer/django-modeltranslation | modeltranslation/fields.py | Python | bsd-3-clause | 15,602 | 0.002628 |
#!/usr/bin/env python
# Copyright (c) 2006 Damien Miller <djm@mindrot.org>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | com4/py-editdist | test.py | Python | isc | 1,856 | 0.033405 |
#!/usr/bin/env python3
#pylint: disable=missing-docstring
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
... | nuclear-wizard/moose | python/chigger/tests/wireframe/points.py | Python | lgpl-2.1 | 936 | 0.019231 |
# Copyright 2014 Google Inc. 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 law or a... | google/syzygy | syzygy/build/gyp_main.py | Python | apache-2.0 | 3,560 | 0.009551 |
import logging
import re
import time
import os
from autotest.client.shared import error, utils
from virttest import utils_misc, env_process
@error.context_aware
def run_watchdog(test, params, env):
"""
Configure watchdog, crash the guest and check if watchdog_action occurs.
Test Step:
1. see every... | spiceqa/virt-test | qemu/tests/watchdog.py | Python | gpl-2.0 | 12,256 | 0.000408 |
def findBestShift(wordList, text):
text = "".join((char if char.isalpha() else " ") for char in text).split()
max_valid = 0
best_shift = 0
for shift in range(26):
num_valid = 0
for word in text:
plaintext = applyShift(word, shift)
if isWord(wordList, plaintext):... | iharsh234/MIT6.00x | pset6-P2-FindBestShift.py | Python | mit | 475 | 0 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2018 Steve R <steversig@virginmedia.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the... | StefanBruens/libsigrokdecode | decoders/rc_encode/pd.py | Python | gpl-3.0 | 6,428 | 0.007156 |
#!/usr/bin/env python
# pylint: disable=R0903
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public L... | franciscod/python-telegram-bot | telegram/parsemode.py | Python | gpl-2.0 | 1,054 | 0 |
#! /usr/bin/env python
from openturns import *
from math import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
# Instanciate one distribution object
dim = 1
meanPoint = NumericalPoint(dim, 1.0)
meanPoint[0] = 0.5
sigma = NumericalPoint(dim, 1.0)
sigma[0] = 2.0
R = CorrelationMatrix(dim)... | sofianehaddad/ot-svn | python/test/t_BarPlot_std.py | Python | mit | 1,975 | 0.000506 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0009_auto_20150729_1745'),
]
operations = [
migrations.AlterField(
model_name='areasoltura',
... | igor-rodrigues01/casv | casv/core/migrations/0010_auto_20150804_1030.py | Python | agpl-3.0 | 443 | 0.002257 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 7, transform = "Anscombe", sigma = 0.0, exog_count = 0, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Anscombe/trend_PolyTrend/cycle_7/ar_/test_artificial_32_Anscombe_PolyTrend_7__0.py | Python | bsd-3-clause | 261 | 0.088123 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# 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 l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/cr/crvserver_crpolicy_binding.py | Python | apache-2.0 | 7,634 | 0.037595 |
__author__ = 'sfaci'
"""
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 writing, software
distr... | OSAlt/secret-santa | santa_lib/__init__.py | Python | mit | 559 | 0.003578 |
"""
Test notifiers
"""
import unittest
from sickchill.oldbeard import db
from sickchill.oldbeard.notifiers.emailnotify import Notifier as EmailNotifier
from sickchill.oldbeard.notifiers.prowl import Notifier as ProwlNotifier
from sickchill.tv import TVEpisode, TVShow
from sickchill.views.home import Home
from tests ... | Vagab0nd/SiCKRAGE | tests/notifier_tests.py | Python | gpl-3.0 | 9,061 | 0.002097 |
## A script for extracting info about the patients used in the analysis
## Load necessary modules
from rpy2 import robjects as ro
import numpy as np
import os
ro.r('library(survival)')
import re
##This call will only work if you are running python from the command line.
##If you are not running from the command line... | OmnesRes/onco_lnc | lncrna/cox/COAD/patient_info.py | Python | mit | 6,839 | 0.021787 |
# Copyright (c) 2018 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from typing import Optional, Dict, Any
class PluginObject:
"""Base class for objects that can be provided by a plugin.
This class should be inherited by any class that can be provided
by a plugin. Its only ... | Ultimaker/Uranium | UM/PluginObject.py | Python | lgpl-3.0 | 1,812 | 0.002208 |
from cherrypy.process.plugins import PIDFile
import argparse
import cherrypy
from PressUI.cherrypy.PressConfig import PressConfig
import PressUI.cherrypy.PressProduction as PressProduction
parser = argparse.ArgumentParser()
parser.add_argument(
'--production',
help = 'Run app in production mode',
action =... | maarons/pressui | cherrypy/server.py | Python | mit | 1,340 | 0.009701 |
# copyright: (c) 2012 by Hansel Dunlop.
# license: ISC, see LICENSE for more details.
#
# secret keys for virtual server providers
# Users of this package will need to add their
# keys to this file for it to work
#
AWS_ACCESS_KEY_ID = ''
AWS_SECRET_ACCESS_KEY = ''
RACKSPACE_USERNAME = ''
RACKSPACE_API_KEY = ''
KEY_F... | aychedee/kubrick | kubrick/secrets.py | Python | isc | 333 | 0 |
from django import template as template_
from django.conf import settings
from django.utils.safestring import mark_safe
from extras.plugins import PluginTemplateExtension
from extras.registry import registry
register = template_.Library()
def _get_registered_content(obj, method, template_context):
"""
Given... | digitalocean/netbox | netbox/extras/templatetags/plugins.py | Python | apache-2.0 | 2,412 | 0.001658 |
# -*- coding: utf-8 -*-
"""
TeleMir developpement version with fake acquisition device
lancer dans un terminal :
python examples/test_osc_receive.py
"""
from pyacq import StreamHandler, FakeMultiSignals
from pyacq.gui import Oscilloscope, Oscilloscope_f, TimeFreq, TimeFreq2
from TeleMir.gui import Topoplot, Kurtosis... | Hemisphere-Project/Telemir-DatabitMe | Telemir-EEG/TeleMir_171013/Fake_TeleMir_CB.py | Python | gpl-2.0 | 6,881 | 0.034443 |
"""
This file re-creates the major DFXML classes with an emphasis on type safety, serializability, and de-serializability.
With this module, reading disk images or DFXML files is done with the parse or iterparse functions. Writing DFXML files can be done with the DFXMLObject.print_dfxml function.
"""
__version__ = ... | thomaslaurenson/Vestigium | dfxml/Objects.py | Python | gpl-2.0 | 127,176 | 0.005198 |
from __future__ import unicode_literals
from django.conf.urls import include, url
from django.test import TestCase
from django.utils import six
from rest_framework import generics, routers, serializers, status, viewsets
from rest_framework.renderers import (
BaseRenderer, BrowsableAPIRenderer, JSONRenderer
)
from... | rubendura/django-rest-framework | tests/test_response.py | Python | bsd-2-clause | 10,811 | 0.002312 |
# Copyright ClusterHQ Inc. See LICENSE file for details.
"""
Tests for the Volumes Plugin API provided by the plugin.
"""
from uuid import uuid4, UUID
from twisted.web.http import OK
from twisted.internet import reactor
from .._api import VolumePlugin, DEFAULT_SIZE
from ...apiclient import FakeFlockerClient, Datas... | adamtheturtle/flocker | flocker/dockerplugin/test/test_api.py | Python | apache-2.0 | 6,785 | 0.000147 |
# -*- coding:utf-8 -*-
from attribute import attribute
from ci_type import citype
from ci_type_relation import cityperelation
from ci_relation import cirelation
from ci import ci
from history import history
from account import account
from special import special
from dns_record import dnsrecord
| kdyq007/cmdb-api | core/__init__.py | Python | gpl-2.0 | 299 | 0.003344 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | Fokko/incubator-airflow | airflow/contrib/sensors/bigquery_sensor.py | Python | apache-2.0 | 1,138 | 0 |
#!/usr/bin/env python
from setuptools import setup, find_packages
import versioneer
setup(name='conwhat', #version=versioneer.get_version(),
description='python library for connectome-based white matter atlas analyses in neuroimaging',
long_description='python library for connectome-based white matter at... | JohnGriffiths/ConWhAt | setup.py | Python | bsd-3-clause | 1,353 | 0.005913 |
"""Utility functions for Certbot plugin tests."""
import argparse
import copy
import os
import re
import shutil
import tarfile
import josepy as jose
from certbot._internal import constants
from certbot.tests import util as test_util
from certbot_compatibility_test import errors
_KEY_BASE = "rsa2048_key.pem"
KEY_PATH... | stweil/letsencrypt | certbot-compatibility-test/certbot_compatibility_test/util.py | Python | apache-2.0 | 1,520 | 0 |
# Copyright 2004 by Bob Bussell. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""NOEtools: For predicting NOE coordinates from assignment data.
The input and output are model... | zjuchenyuan/BioWeb | Lib/Bio/NMR/NOEtools.py | Python | mit | 3,420 | 0.000877 |
"""
Generic framework path manipulation
"""
import re
__all__ = ["framework_info"]
_STRICT_FRAMEWORK_RE = re.compile(
r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
(?P<shortname>[-_A-Za-z0-9]+).framework/
(?:Versions/(?P<version>[^/]+)/)?
(?P=shortname)
(?:_(?P<suffix>[^_]+))?
)$
"""
)
def framew... | etherkit/OpenBeacon2 | macos/venv/lib/python3.8/site-packages/macholib/framework.py | Python | gpl-3.0 | 1,125 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.