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 |
|---|---|---|---|---|---|
# vim: set sw=2 ts=2 softtabstop=2 expandtab:
from . BackendBase import *
import logging
import os
import pprint
import time
import psutil
import threading
import requests.exceptions
_logger = logging.getLogger(__name__)
class DockerBackendException(BackendException):
pass
try:
import docker
except ImportError:
... | symbooglix/boogie-runner | BoogieRunner/Backends/Docker.py | Python | bsd-3-clause | 11,324 |
import tests.periodicities.period_test as per
per.buildModel((5 , 'D' , 25));
| antoinecarme/pyaf | tests/periodicities/Day/Cycle_Day_25_D_5.py | Python | bsd-3-clause | 80 |
"""Test an unformatted document is editable.
Examine and type over the text in the window that appears. The window
contents can be scrolled with the mouse wheel.
Press ESC to exit the test.
"""
import unittest
from pyglet import app
from pyglet import gl
from pyglet import graphics
from pyglet import text
from py... | bitcraft/pyglet | tests/interactive/text/plain.py | Python | bsd-3-clause | 4,976 |
from __future__ import division, print_function, absolute_import
import selfsup
import tensorflow as tf
import os
from .base import Method
from autocolorize.tensorflow.sparse_extractor import sparse_extractor
from autocolorize.extraction import calc_rgb_from_hue_chroma
from collections import OrderedDict
import functoo... | gustavla/self-supervision | selfsup/multi/methods/video_relative_flow.py | Python | bsd-3-clause | 4,335 |
import morepath
from morepath.traject import (
TrajectRegistry,
Node,
Step,
TrajectError,
is_identifier,
parse_variables,
Path,
create_path,
parse_path,
normalize_path,
ParameterFactory,
)
from morepath.converter import Converter, IDENTITY_CONVERTER
import pytest
from webob.e... | morepath/morepath | morepath/tests/test_traject.py | Python | bsd-3-clause | 24,893 |
# stdlib
from datetime import datetime
import os.path
import re
import socket
import ssl
import time
import warnings
from urlparse import urlparse
# 3rd party
import requests
import tornado
from requests.adapters import HTTPAdapter
from requests.packages import urllib3
from requests.packages.urllib3.util import ssl_
... | amalakar/dd-agent | checks.d/http_check.py | Python | bsd-3-clause | 16,894 |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from django.db import migrations
from dash.utils import chunks
def split_outgoings(apps, schema_editor):
Outgoing = apps.get_model('msgs', 'Outgoing')
outgoing_ids = Outgoing.objects.all().values_list('pk', flat=True)
for i... | xkmato/casepro | casepro/msgs/migrations/0041_outgoing_as_single_pt2.py | Python | bsd-3-clause | 1,792 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# openhatch-issues documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in t... | willingc/openhatch-issues | docs/conf.py | Python | bsd-3-clause | 8,507 |
from django.shortcuts import render, redirect
from tsadm.slave import TSAdmSlave
from tsadm.wapp import TSAdmWApp
wapp = TSAdmWApp()
def dashboard(req, slave_slug):
if not wapp.start(req, '__slave/dashboard', '__slave/dashboard'):
return wapp.error_page()
tmpl_data = wapp.tmpl_data()
slave_id = ... | jctincan/tsadm-webapp | tsadm/slave/views.py | Python | bsd-3-clause | 1,184 |
# -*- coding: utf-8 -*-
""" Simple urls for use in testing the gcframe app. """
from __future__ import unicode_literals
try:
from django.conf.urls import patterns, url
except ImportError: # Django 1.3
from django.conf.urls.defaults import patterns, url
from .views import normal, framed, exempt
urlpattern... | benspaulding/django-gcframe | gcframe/tests/urls.py | Python | bsd-3-clause | 513 |
def comment_definition(commandname,name,comment_text):
return r'\newcommand{\%s}{%s}'%(commandname,comment_text)+"\n"
def generate_alphabetnumber(x):
if x<26:
return chr(ord("a")+x)
else:
higher_places = x//26
return generate_alphabetnumber(higher_places-1)+generate_alphabetnumber(x-... | jmfranck/pyDiffTools | pydifftools/comment_functions.py | Python | bsd-3-clause | 1,059 |
# -*- coding: utf-8 -*-
"""
A dataset for Matrix Market files.
"""
__authors__ = "Nicholas Dronen"
__copyright__ = "Copyright 2013, Nicholas Dronen"
__credits__ = ["Nicholas Dronen"]
__license__ = "3-clause BSD"
__maintainer__ = "Nicholas Dronen"
__email__ = "ndronen@gmail.com"
import scipy.io
from pylearn2.datasets... | ndronen/pylearnutils | pylearnutils/datasets/mm.py | Python | bsd-3-clause | 1,370 |
#!/opt/datadog-agent/embedded/bin/python
"""
Datadog
www.datadoghq.com
----
Cloud-Scale Monitoring. Monitoring that tracks your dynamic infrastructure.
Licensed under Simplified BSD License (see LICENSE)
(C) Boxed Ice 2010 all rights reserved
(C) Datadog, Inc. 2010-2016 all rights reserved
... | takus/dd-agent | agent.py | Python | bsd-3-clause | 22,358 |
#!/usr/bin/env python
# -*- mode: python; c-basic-offset: 2; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
# gearman-interface: Interface Wrappers for Gearman
# Copyright (c) 2009 Monty Taylor
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or witho... | emonty/gearman-interface | python/setup.py | Python | bsd-3-clause | 2,902 |
from core import *
def load(script,olist):
f = None
cls,args,props = olist
if cls == "bg":
o = bg()
if cls == "testimony_blink":
o = testimony_blink(*args)
if cls == "fg":
o = fg()
if cls in ["bg","fg","testimony_blink"]:
for p in props:
... | crxtrdude/pywright | core/load.py | Python | bsd-3-clause | 4,348 |
import sys
import unittest
import webbrowser
from PyQt5 import QtGui, QtWidgets
from PyQt5.QtTest import QTest
from PyQt5 import QtCore
from unittest.mock import MagicMock
####### TEMP
import sas.qtgui.path_prepare
#######
# Local
#from sas.qtgui.Calculators.SldPanel import SldResult
from sas.qtgui.Calculators.SldPa... | SasView/sasview | src/sas/qtgui/Calculators/UnitTesting/SLDCalculatorTest.py | Python | bsd-3-clause | 5,189 |
# encoding: utf-8
"""
Copyright (c) 2012 - 2016, Ernesto Ruge
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of condit... | ruhrmobil-E/mobilitaet-finden | webapp/util.py | Python | bsd-3-clause | 12,263 |
import time
import hashlib, random
from log import log
from log import logp
from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseRedirect
import pymongo
from profiling_decorator import hotshot_heapy_profile
from googlemaps import GoogleMaps
import obfuscation
import cjson
import json
# do this in... | nesl/SensorSafeV1-DataStore | datastore/privacyengine.py | Python | bsd-3-clause | 24,000 |
import structlog
from opentaxii.local import context
from opentaxii.signals import (CONTENT_BLOCK_CREATED, INBOX_MESSAGE_CREATED,
SUBSCRIPTION_CREATED)
log = structlog.getLogger(__name__)
class BasePersistenceManager:
pass
class Taxii1PersistenceManager(BasePersistenceManager):
... | EclecticIQ/OpenTAXII | opentaxii/persistence/manager.py | Python | bsd-3-clause | 13,117 |
"""Fast Gradient Boosting decision trees for classification and regression."""
# Author: Nicolas Hug
from abc import ABC, abstractmethod
from functools import partial
import warnings
import numpy as np
from timeit import default_timer as time
from ...base import (BaseEstimator, RegressorMixin, ClassifierMixin,
... | glemaitre/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py | Python | bsd-3-clause | 63,676 |
INSTALLED_APPS = [
"django.contrib.auth",
"django.contrib.sessions",
"django.contrib.contenttypes",
"django.contrib.admin",
"django.contrib.sites",
"preferences",
"preferences.tests",
]
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
}
}
MIDDLEWARE_CLASSE... | praekelt/django-preferences | preferences/tests/settings/111.py | Python | bsd-3-clause | 1,419 |
import pandas as pd
import numpy as np
from pprint import pprint as pp
import datetime
import re
import math
import logging
from abg.elo import ELO
from bisect import bisect
from dateutil import parser
def zodiac_sign(d):
m = d.month
d = d.day
signs = [(1,20,"Cap"), (2,18,"Aqu"), (3,20,"Pis"), (4,20,"Ari")... | jacobSingh/allbackgammongroup | ripper/abg/stats.py | Python | bsd-3-clause | 12,252 |
# Future Imports for py2/3 backwards compat.
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from .load_unittest import unittest
from .context import nexpose
from nexpose import *
from .NexposeSessionSpy import NexposeSessionSpy, SpyFactory
from future import... | derpadoo/nexpose-client-python | tests/test_NexposeSession.py | Python | bsd-3-clause | 4,097 |
# THIS IS TOTALLY BORROWED FROM DJANGO
# SORRY GUYS
# I'll probably switch to something simpler in the future.
"""
Functions for reversing a regular expression (used in reverse URL resolving).
Used internally by Django and not intended for external use.
This is not, and is not intended to be, a complete reg-exp decom... | chrisdickinson/thundercat | thundercat/regex_helper.py | Python | bsd-3-clause | 12,191 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('scorecard', '0007_auto_20150602_1915'),
]
operations = [
migrations.AddField(
model_name='country',
... | sunlightlabs/mptindicators | mptindicators/scorecard/migrations/0008_auto_20150617_1558.py | Python | bsd-3-clause | 805 |
# provide the pinyin initial table for Chinese characters
# vim: set fileencoding=utf-8 :
pinyin_initial = {
u'䤆' : [u'k'] ,
u'涉' : [u's', u'd'] ,
u'鈌' : [u'j'] ,
u'㲓' : [u'r'] ,
u'愖' : [u'c'] ,
u'薙' : [u't'] ,
u'咣' : [u'g'] ,
u'礦' : [u'k'] ,
u'鶩' : [u'm', u'w'] ,
u'䠰' : [u'q'] ,
u'河' : [u'h'] ,
u'鄶' : [u'k'] ,
u'恀'... | Vayn/dotfiles | tools/pinyin-completion/pinyin/pinyin_initial.py | Python | mit | 482,244 |
import sys
out = open('config.dat','w')
out.write(raw_input('Gmail Account: ')+",")
out.write(raw_input('Gmail Passworld: ')+",")
out.write(raw_input('E-mail Subject: ')+",")
print "E-mail Text (Finish with Ctrl + D):"
text = sys.stdin.readlines()
msg = ''
for line in text:
msg = msg+line
print msg
out.write(msg+... | Azrrael-exe/RPiPhotoShoot | Tests/config.py | Python | mit | 568 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2017 Alex Forencich
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... | python-ivi/python-ivi | ivi/agilent/agilentDSO7012B.py | Python | mit | 1,688 |
class FollowerCountFilter:
def __init__(self, requiredFollowersToPass):
self.requiredFollowersToPass = requiredFollowersToPass;
def filterTweet(self, data):
return data['user']['followers_count'] > self.requiredFollowersToPass
| Lily418/CatHack | FollowerCountFilter.py | Python | mit | 235 |
from django import forms
from django.utils.translation import ugettext as _
from wagtail.wagtailcore.models import Page
from django.utils.safestring import mark_safe
class CustomModelChoiceField(forms.ModelChoiceField):
def label_from_instance(self, obj):
bits = []
for ancestor in obj.get_ancestor... | ababic/wagtailmodeladmin | wagtailmodeladmin/forms.py | Python | mit | 964 |
# materialized_view_factory.py
from sqlalchemy.ext import compiler
from sqlalchemy.schema import DDLElement
from bootstrap import db
class CreateMaterializedView(DDLElement):
def __init__(self, name, selectable):
self.name = name
self.selectable = selectable
@compiler.compiles(CreateMaterializedVi... | rodekruis/shelter-database | src/web/materialized_view_factory.py | Python | mit | 1,212 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# fs_module.py
#
# Copyright © 2013-2015 DSGos
#
# This file is part of DSGos_Installer.
#
# DSGos_Installer 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... | DecisionSystemsGroup/DSGos | airootfs/usr/share/DSGos-Installer/DSGos_Installer/parted3/fs_module.py | Python | mit | 10,464 |
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask.ext.login import UserMixin, AnonymousUserMixin
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from flask import current_app
from . import db, login_manager, ma
class Permission:
... | inaki/farm-stand | app/models.py | Python | mit | 5,952 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | twilio/twilio-python | twilio/rest/studio/v1/flow/engagement/__init__.py | Python | mit | 16,213 |
import random
import string
import pytest
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from openslides.core.config import config
from openslides.core.models i... | CatoTH/OpenSlides | server/tests/integration/core/test_viewset.py | Python | mit | 15,287 |
import pytest
from paramiko.client import SSHClient
from margaritashotgun.remote_shell import RemoteShell, Commands
from margaritashotgun.auth import Auth
from margaritashotgun.exceptions import *
def test_commands_enum():
for command in Commands:
assert isinstance(command.value, str)
def test_remote_shel... | joelferrier/margaritashotgun | tests/unit/test_remote_shell.py | Python | mit | 561 |
# orm/relationships.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Heuristics related to join conditions as used in
:func:`.relationship`.
Pro... | sandan/sqlalchemy | lib/sqlalchemy/orm/relationships.py | Python | mit | 117,600 |
# encoding: utf-8
import re
from tornado.web import HTTPError
from pypi_server.db.users import Users
from pypi_server.handlers import route
from pypi_server.handlers.base import threaded
from pypi_server.handlers.api import JSONHandler
from pypi_server.handlers.api.login import authorization_required
LOGIN_EXP = re.c... | mosquito/pypi-server | pypi_server/handlers/api/users.py | Python | mit | 2,057 |
"""
This module compares Ruler performance to that of the Python standard
re library. The idea is to match the same few lines of text and
compare how long it takes using re and ruler.
Since the measurements always have non-deterministic, but always
positive, measurement errors, we will make many short measurements
and... | yanivmo/rulre | performance/re_compare.py | Python | mit | 4,119 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('auth2', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='userdata',
name='is_facul... | aspc/mainsite | aspc/auth2/migrations/0002_userdata_is_faculty.py | Python | mit | 396 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/hair/rodian/shared_hair_rodian_male_s06.iff"
result.attribute_templ... | obi-two/Rebelion | data/scripts/templates/object/tangible/hair/rodian/shared_hair_rodian_male_s06.py | Python | mit | 452 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
#
# Copyright 2010 Bitly
#
# 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 ... | matthsims/dotfiles | dot/scripts/bin/bar_chart.py | Python | mit | 4,472 |
#coding: utf-8
import numpy as np
import pylab as pl
from matplotlib.colors import ListedColormap
from sklearn import svm
from sklearn.metrics import classification_report
N = 100
# 訓練データを作成
mean1 = [-1, 2]
mean2 = [1, -1]
mean3 = [4, -4]
mean4 = [-4, 4]
cov = [[1.0, 0.8], [0.8, 1.0]]
X = np.r_[np.random.multivariat... | TenninYan/Perceptron | sklearn/nonlinear_svm.py | Python | mit | 1,708 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask, request, render_template
import jinja2
import json
import string
import smtplib
import subprocess
from sqlalchemy import create_engine
from sqlalchemy import update
from sqlalchemy.orm import Session, sessionmaker
from alchemy import Photos, Base
from ... | NaturalSolutions/iFeedBird | back/server.py | Python | mit | 5,876 |
"""Replacement authentication decorators that work around redirection loops"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps
from urllib import urlencode
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.contrib.auth.decorators import login_requir... | divio/django-cas | cas/decorators.py | Python | mit | 3,062 |
import django_rq
def perform_all_jobs_sync():
worker = django_rq.get_worker()
worker.work(burst=True)
| geometalab/osmaxx | tests/redis_test_helpers.py | Python | mit | 112 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | v-iam/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/ip_configuration.py | Python | mit | 2,982 |
MAGIC_8_BALL_RESPONSES = [
'It is certain.',
'It is decidedly so.',
'Without a doubt.',
'Yes - definitely.',
'You may rely on it.',
'As I see it, yes.',
'Most likely.',
'Outlook good.',
'Yes.',
'Signs point to yes.',
'Reply hazy, try again.',
'Ask again later.',
'Bett... | richardcornish/conference | emojiweather/commands/data/ask.py | Python | mit | 530 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gk_collections_moving_image', '0005_auto_20161117_1801'),
('gk_collections_film', '0002_film_trailer'),
]
operations = [
... | ic-labs/glamkit-collections | glamkit_collections/contrib/work_creator/plugins/film/migrations/0003_auto_20161117_1801.py | Python | mit | 907 |
#!/usr/bin/env python
"""
Create an inbox.
"""
from diffscuss.mailbox.common import get_inbox_name, get_inbox_path, \
check_inited, mkdir_for_keeps
def main(args):
check_inited(args.git_exe)
inbox = args.inbox
inbox_path = get_inbox_path(inbox, args.git_exe)
mkdir_for_keeps(inbox_path)
| tomheon/diffscuss | diffscuss/mailbox/make_inbox.py | Python | mit | 310 |
# -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Pieter Mulder.
#
# 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 th... | xsteadfastx/beets | beetsplug/absubmit.py | Python | mit | 6,416 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.template.defaultfilters import slugify
from forms_builder.forms.utils import unique_slug
def create_slugs(apps, _):
GL = apps.get_model('glamkit_collections', 'GeographicLocation')
for self i... | ic-labs/glamkit-collections | glamkit_collections/migrations/0004_geographiclocation_slug.py | Python | mit | 1,304 |
# ============================================================================
#
# Copyright (c) 2007-2011 Integral Technology Solutions Pty Ltd,
# All Rights Reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL... | Integral-Technology-Solutions/ConfigNOW | core/commands/deploy_apps.py | Python | mit | 1,699 |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('bar')
def test_hostname(host):
assert 'instance-1-multi-node' == host.system_info.hostname
def test_etc_molecule_directory(host):
f = host.f... | retr0h/molecule | test/scenarios/driver/docker/molecule/multi-node/tests/test_bar.py | Python | mit | 668 |
# Copyright 2012-2013 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | LockScreen/Backend | venv/lib/python2.7/site-packages/awscli/customizations/__init__.py | Python | mit | 1,484 |
#!/usr/env/python
"""
isotropic_turbulent_suspension_with_settling_and_bleaching.py
Example of a continuous-time, stochastic, pair-based cellular automaton model,
which simulates the diffusion of suspended particles in a turbulent fluid.
Particles start with an accumulated luminescence signal L = 1, and are bleached
... | laijingtao/landlab | landlab/ca/examples/turbulent_suspension_with_settling_and_bleaching.py | Python | mit | 16,819 |
# The MIT License
#
# Copyright (c) 2011 Wyss Institute at Harvard University
#
# 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
# ... | amylittleyang/OtraCAD | cadnano25/cadnano/gui/plugins/autobreak/autobreakconfig.py | Python | mit | 2,723 |
def repeat_lyrics():
print_lyrics()
print_lyrics()
def print_lyrics():
print 'Crash'
print 'Boom'
print 'Bang'
repeat_lyrics()
| sokolowskik/Tutorials | ThinkPython/chap3/ex1.py | Python | mit | 150 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base.domain import Domain
from twilio.rest.conversations.v1 import V1
class Conversations(Domain):
def __init__(self, twilio):
"""
Initialize the Conversations Doma... | tysonholub/twilio-python | twilio/rest/conversations/__init__.py | Python | mit | 1,369 |
__author__ = 'brendan'
import webapp2
from backend.auth import *
config = {
'webapp2_extras.auth': {
'user_model': 'backend.models.User',
'user_attributes': ['email']
},
'webapp2_extras.sessions': {
# TODO: Set before launch
# Secret key to generate session cookies
... | boneil3/hyperAdmit | api.py | Python | mit | 731 |
#!/usr/bin/env python
import os
import subprocess
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
os.environ['DJANGO_SETTINGS_MODULE'] = 'savory_pie.tests.django.dummy_settings'
subprocess.call(['make', 'html'], cwd='docs')
subprocess.call(['open', 'index.html'], cwd='docs/_build/html')
| RueLaLaTech/savory-pie | make_html_docs.py | Python | mit | 300 |
# -*- coding: utf-8 -*-
"""
Newspaper uses a lot of python-goose's parsing code. View theirlicense:
https://github.com/codelucas/newspaper/blob/master/GOOSE-LICENSE.txt
Parser objects will only contain operations that manipulate
or query an lxml or soup dom object generated from an article's html.
"""
import logging
i... | srujant/MLNews | newspaper/parsers.py | Python | mit | 7,219 |
#!/usr/bin/env python
"""polynomial.py: Demonstrate equation solvers of SciPy.
"""
from numpy.polynomial.polynomial import Polynomial
# pylint: disable=invalid-name
# Define a polynomial x^3 - 2 x^2 + x - 2.
f = Polynomial([-2, 1, -2, 1])
print("polynomial: ", f)
# Solve f(x) == 0.
print("roots: ", f.roots())
| showa-yojyo/notebook | source/_sample/scipy/polynomial.py | Python | mit | 314 |
"""
Tk2
Wraps around all the major widgets
"""
# Imports
import sys
if sys.version.startswith("2"):
import Tkinter as tk
import Tkdnd as dnd
import Queue
else:
import tkinter as tk
import tkinter.dnd as dnd
import queue as Queue
import ttk
import threading
import traceback
from . import fil... | karimbahgat/Tk2 | tk2/mixins.py | Python | mit | 12,997 |
from SurveyTDEM import * #SurveyTDEM, RxTDEM, SrcTDEM
from BaseTDEM import BaseTDEMProblem, FieldsTDEM
from TDEM_b import ProblemTDEM_b
| lheagy/simpegem | simpegEM/TDEM/__init__.py | Python | mit | 136 |
import multiprocessing
import h5py as hdf
import numpy as np
from data_handler import mkTruth, mkHalo, mkOii_all
from halo_handler import find_indices, find_indices_multi
from calc_cluster_props import (updateArray, findClusterRedshift, findLOSV,
findLOSVDmcmc, calc_mass_Evrard)
import o... | boada/desCluster | mkTargeted/mkTargeted_async.py | Python | mit | 4,476 |
from .base import * # noqa
# SECURITY WARNING: don't run with debug turned on in production!
# See: https://docs.djangoproject.com/en/dev/ref/settings/#debug
DEBUG = True
TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
| rgreinho/docker-django-cookiecutter | {{ cookiecutter.project_name }}/{{ cookiecutter.project_name }}/settings/testing.py | Python | mit | 214 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/loot/dungeon/corellian_corvette/shared_neutral_destroy_filler02.iff"... | anhstudios/swganh | data/scripts/templates/object/tangible/loot/dungeon/corellian_corvette/shared_neutral_destroy_filler02.py | Python | mit | 491 |
from axelrod import Player, obey_axelrod, Actions
from ._strategies import strategies
from .hunter import DefectorHunter, AlternatorHunter, RandomHunter, MathConstantHunter, CycleHunter, EventualCycleHunter
from .cooperator import Cooperator
# Needs to be computed manually to prevent circular dependency
ordinary_strat... | mojones/Axelrod | axelrod/strategies/meta.py | Python | mit | 9,056 |
from app.test_config import BaseTestCase
class RegisterTestCase(BaseTestCase):
def test_creates_new_user_successfully(self):
data = {
'username': 'user',
'password': 'password'
}
response = self.client.post('/auth/register/', data=data, follow_redirects=True)
... | brotich/CP2-bucket-list-api | app/mod_auth/tests/test_register.py | Python | mit | 1,792 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Ship()
result.template = "object/ship/shared_droid_fighter_tier5.iff"
result.attribute_template_id = -1
result.s... | anhstudios/swganh | data/scripts/templates/object/ship/shared_droid_fighter_tier5.py | Python | mit | 416 |
# -*- coding: utf-8 -*-
"""
PyValitron
~~~~~~
Python Inputs Validation Library
:copyright: (c) 2016 by Clivern (hello@clivern.com).
:license: MIT, see LICENSE for more details.
"""
| Clivern/PyValitron | examples/form_example.py | Python | mit | 201 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from collections import defaultdict
from google.appengine.api.namespace_manager.namespace_manager import set_namespace
from gaepermission.decorator import login_not_required
from tekton.gae.middleware import Middleware
_domain_dct = {}
_s... | erikabarros/naguil | backend/apps/multitenancy.py | Python | mit | 933 |
import unittest, argparse, sys, StringIO
from echolalia.writer.stdout import Writer
class StdoutTestCase(unittest.TestCase):
def setUp(self):
self.parser = argparse.ArgumentParser()
self.data = [{chr(i): i - 96} for i in xrange(97, 123)]
self.writer = Writer()
def test_add_args(self):
self.assert... | eiri/echolalia | tests/writer/test_stdout.py | Python | mit | 714 |
from collections import defaultdict
from pyramid.events import (
BeforeRender,
subscriber,
)
from pyramid.traversal import resource_path
from . import (
AfterModified,
BeforeModified,
Created,
simple_path_ids,
)
import transaction
def includeme(config):
config.scan(__name__)
config.add... | ClinGen/clincoded | src/contentbase/invalidation.py | Python | mit | 3,371 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-25 08:52
from __future__ import unicode_literals
from django.db import migrations
import toucan.notifications
class Migration(migrations.Migration):
dependencies = [
('user_profile', '0002_profile_user_mention_notification'),
]
oper... | mcallistersean/b2-issue-tracker | toucan/user_profile/migrations/0003_auto_20160525_0852.py | Python | mit | 697 |
from django.core.management.base import NoArgsCommand, CommandError
from django.db import transaction
from orm.models import Build, ToasterSetting, LogMessage, Target
from bldcontrol.bbcontroller import getBuildEnvironmentController, ShellCmdException, BuildSetupException
from bldcontrol.models import BuildRequest, Bui... | jaimeantena4040/MiSitioWeb | lib/toaster/bldcontrol/management/commands/runbuilds.py | Python | gpl-2.0 | 6,304 |
from Renderer import Renderer
from enigma import eLabel
from enigma import ePoint, eTimer
from Components.VariableText import VariableText
class Roller(VariableText, Renderer):
def __init__(self):
Renderer.__init__(self)
VariableText.__init__(self)
self.skinsize = (0, 0)
self.skinposition = (0, 0)
self.maxw... | SIFTeam/enigma2 | lib/python/Components/Renderer/Roller.py | Python | gpl-2.0 | 2,088 |
# Rekall Memory Forensics
# Copyright (c) 2012 Michael Cohen <scudette@gmail.com>
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | rlugojr/rekall | rekall-core/rekall/plugins/windows/registry/registry.py | Python | gpl-2.0 | 21,887 |
"""
--
-- Copyright (c) 2011 Novell
-- Uwe Gansert <ug@suse.de>
--
-- This software is licensed to you under the GNU General Public License,
-- version 2 (GPLv2). There is NO WARRANTY for this software, express or
-- implied, including the implied warranties of MERCHANTABILITY or FITNESS
-- FOR A PARTICULAR PURPOSE. Yo... | larsks/cobbler-larsks | cobbler/modules/manage_import_suse.py | Python | gpl-2.0 | 31,802 |
#
# Copyright 2016-2017 Red Hat, Inc.
#
# 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 distributed ... | nirs/vdsm | lib/vdsm/cpuinfo.py | Python | gpl-2.0 | 5,598 |
"""
This page is in the table of contents.
Gcode step is an export plugin to convert gcode from float position to number of steps.
An export plugin is a script in the export_plugins folder which has the getOutput function, the globalIsReplaceable variable and if it's output is not replaceable, the writeOutput function... | natetrue/ReplicatorG | skein_engines/skeinforge-40/skeinforge_application/skeinforge_plugins/craft_plugins/export_plugins/gcode_step.py | Python | gpl-2.0 | 9,483 |
# -*- Mode: Python; test-case-name: flumotion.test.test_credentials -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Pub... | offlinehacker/flumotion | flumotion/twisted/credentials.py | Python | gpl-2.0 | 11,912 |
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright (C) 2010 NextGIS (http://nextgis.org),
# Alexander Bruy (alexander.bruy@gmail.com),
# Maxim Dubinin (sim@gis-lab.info),
#
# Copyright (C) 2014 Tom Kralidis (tomkral... | yordan-desta/QgisIns | python/plugins/MetaSearch/plugin.py | Python | gpl-2.0 | 4,677 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
OutputSelectionPanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
******************... | CS-SI/QGIS | python/plugins/processing/gui/DestinationSelectionPanel.py | Python | gpl-2.0 | 13,357 |
#!/usr/bin/python
from pisi.actionsapi import autotools
def setup():
autotools.configure("--disable-static")
def build():
autotools.make()
def install():
autotools.install()
| richard-fisher/repository | xorg/proto/presentproto/actions.py | Python | gpl-2.0 | 191 |
def setupVarious(context):
# Ordinarily, GenericSetup handlers check for the existence of XML files.
# Here, we are not parsing an XML file, but we use this text file as a
# flag to check that we actually meant for this import step to be run.
# The file is found in profiles/default.
if context.rea... | uwosh/uwosh.intranet_theme_clean | uwosh/intranet_theme_clean/setuphandlers.py | Python | gpl-2.0 | 428 |
'''Goes through a bunch of possible classification pipelines and
scores each with cross-validation and print scores.
'''
import numpy as np
# classifiers / transformers / pipelines
from sklearn import naive_bayes
from sklearn import svm
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from sklea... | afoss925/kaggle_schizophrenia_2014 | make_benchmarks.py | Python | gpl-2.0 | 6,503 |
# #####################################################################
#
# System Simulation Core (SSC) Python Wrapper using Classes
# Author: Aron Dobos @ NREL and Steven Janzou @ NREL
#
# #####################################################################
import logging
import string
import sys
import struct
... | geomf/omf-fork | omf/solvers/nrelsam2015/__init__.py | Python | gpl-2.0 | 14,531 |
# -*- coding: utf-8 -*-
# This file is part of the Horus Project
__author__ = 'Jesús Arroyo Torrens <jesus.arroyo@bq.com>'
__copyright__ = 'Copyright (C) 2014-2016 Mundo Reader S.L.\
Copyright (C) 2013 David Braam from Cura Project'
__license__ = 'GNU General Public License v2 http://www.gnu.org/licen... | bqlabs/horus | src/horus/gui/util/opengl_gui.py | Python | gpl-2.0 | 9,374 |
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2020 EventGhost Project <http://www.eventghost.net/>
#
# EventGhost 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 versio... | EventGhost/EventGhost | plugins/System/Registry.py | Python | gpl-2.0 | 27,826 |
from probe import datamanipulation
import unittest
class DatamanipulationErrorsTest(unittest.TestCase):
def test_print(self):
manipulation_error = datamanipulation.DatamanipulationError()
page_error = datamanipulation.PageNotFoundError()
list_error = datamanipulation.NotAListError()
... | Mystfinder/probe | probe/test_files/test_datamanipulation.py | Python | gpl-2.0 | 12,009 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
from logging import getLogger
import re
from .plex_api.media import Media
from . import utils
from . import variables as v
###############################################################################
LO... | croneter/PlexKodiConnect | resources/lib/music.py | Python | gpl-2.0 | 3,523 |
# -*- coding: utf-8 -*-
### cyanide_bot
### GNU/GPL v2
### Author: Cody Rocker
### Author_email: cody.rocker.83@gmail.com
### 2016
#-----------------------------------
# Requires: """
# - Python 3 """
# - imgurpython """
#-----------------------------------
imp... | CodyTXR0KR/cyanideBot | cyanide_bot/bot_logic.py | Python | gpl-2.0 | 9,045 |
#!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# {LicenseText}
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... | bmi-forum/bmi-pyre | pythia-0.8/packages/pyre/pyre/inventory/odb/Curator.py | Python | gpl-2.0 | 7,386 |
import unittest
from mock import Mock
import os
from katello.tests.core.action_test_utils import CLIOptionTestCase, CLIActionTestCase
from katello.tests.core.permission import permission_data
from katello.tests.core.user import user_data
import katello.client.core.permission
from katello.client.core.permission impor... | beav/katello | cli/test/katello/tests/core/permission/permission_create_test.py | Python | gpl-2.0 | 3,596 |
import pytest
class TestVgdisplay:
@pytest.mark.complete(
"vgdisplay -", require_cmd=True, xfail="! vgdisplay --help &>/dev/null"
)
def test_1(self, completion):
assert completion
| algorythmic/bash-completion | test/t/test_vgdisplay.py | Python | gpl-2.0 | 210 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | Glignos/inspire-next | inspirehep/factory.py | Python | gpl-3.0 | 2,622 |
#!/usr/bin/env python3
import sys
from vaspirin import outcar,graceIO,datIO
import argparse
################################
## PARSING AND HELLO MESSAGES ##
################################
def positive_int (value):
'''
Type for allowing only positive int values for argparser
taken from http://stackoverflow.com/... | gmsn-ita/vaspirin | scripts/plot_compared_bands.py | Python | gpl-3.0 | 6,165 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_scoretools_Tuplet_from_duration_and_ratio_01():
duration = Duration(3, 16)
tuplet = Tuplet.from_duration_and_ratio(
duration,
[1],
avoid_dots=True,
is_diminution=False,
)
assert systemtools.TestManager.compar... | mscuthbert/abjad | abjad/tools/scoretools/test/test_scoretools_Tuplet_from_duration_and_ratio.py | Python | gpl-3.0 | 19,529 |