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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
VERSION = (1, 0, 0, 'final', 0)
def get_version(): # pragma: no cover
version = '%s.%s' % (VERSION[0], VERSION[1])
if VERSION[2]:
version = '%s.%s' % (version, VERSION[2])
if VERSION[3:] == ('alpha', 0):
version = '%s pre-alpha' % version
else:
if VERSION... | fivethreeo/django-netaxept | djnetaxept/__init__.py | Python | bsd-3-clause | 423 |
import os
from django.contrib.auth import get_user_model
from django.utils.html import simple_email_re
from django.contrib import messages
from django.utils import timezone
from datetime import datetime
from . import defaults as defs
def get_user_by_username_or_email(username_or_email):
"""
Returns a user ... | un33k/django-userware | userware/utils.py | Python | bsd-3-clause | 1,092 |
# Copyright (C) 2009, Hyves (Startphone Ltd.)
#
# This module is part of the Concurrence Framework and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from xml.etree.cElementTree import iterparse, dump
from concurrence.io import Buffer
from concurrence.io.buffered import Bu... | concurrence/concurrence | lib/concurrence/xmpp/stream.py | Python | bsd-3-clause | 3,905 |
from __future__ import absolute_import
import six
from django.core.urlresolvers import reverse
from sentry.models import AuthIdentity, AuthProvider
from sentry.testutils import AuthProviderTestCase
from sentry.utils.auth import SSO_SESSION_KEY
from sentry.utils.linksign import generate_signed_link
class Authentica... | gencer/sentry | tests/integration/test_api.py | Python | bsd-3-clause | 4,313 |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#
#modification, are permitted provided that the following conditions are
#met:
#
... | DLR-SC/DataFinder | src/datafinder/gui/user/constants.py | Python | bsd-3-clause | 1,889 |
from setuptools import setup, find_packages
import sys, os
version = '1.0'
shortdesc = 'Application framework for repoze.bfg.'
longdesc = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
longdesc += open(os.path.join(os.path.dirname(__file__), 'LICENSE.rst')).read()
setup(name='bda.bfg.app',
v... | bluedynamics/bda.bfg.app | setup.py | Python | bsd-3-clause | 1,799 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_hsp_tiler
----------------------------------
Tests for `hsp_tiler` module.
"""
import unittest
from hsp_tiler import hsp_tiler
class TestHsp_tiler(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tear... | edraizen/hsp_tiler | tests/test_hsp_tiler.py | Python | bsd-3-clause | 392 |
from odm2cvs.settings.base import *
DEBUG = True
STATIC_URL = '/static/'
SITE_URL = ''
| ODM2/ODM2ControlledVocabularies | src/odm2cvs/odm2cvs/settings/windows_development.py | Python | bsd-3-clause | 89 |
#!/usr/bin/env python3
import os, sys, json, math, hashlib, bottle
from collections import defaultdict
import context, features as ftrs
SMOOTH = 0.5
CORPORA_DIR = "data"
def train(labeled_features):
label_freqs = defaultdict(int)
cond_freqs = defaultdict(lambda: defaultdict(int))
features = defaultdict(set)... | michaelnmmeyer/mascara | src/sbd/mkmodels.py | Python | bsd-3-clause | 4,515 |
#!/usr/bin/python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Host-driven Java tests which exercise sync functionality."""
from pylib import constants
from pylib.host_driven import test_case
from p... | ChromiumWebApps/chromium | chrome/android/host_driven_tests/SyncTest.py | Python | bsd-3-clause | 2,241 |
from ffflash.lib.locations import check_file_location
def test_check_file_location_empty():
assert check_file_location('', must_exist=True) is None
assert check_file_location('', must_exist=False) is None
def test_check_file_location_on_folders(tmpdir):
pf = tmpdir.join('parent')
ne = pf.join('does_... | spookey/ffflash | tests/lib/locations/test_check_file_location.py | Python | bsd-3-clause | 1,095 |
"""Django page CMS urlconf registry."""
from django.utils.translation import ugettext_lazy as _
class UrlconfAlreadyRegistered(Exception):
"""
An attempt was made to register a urlconf for Django page CMS more
than once.
"""
class UrlconfNotFound(Exception):
"""
The requested urlconf was not... | ArabellaTech/django-basic-cms | basic_cms/urlconf_registry.py | Python | bsd-3-clause | 1,128 |
from distutils.core import setup
app_name = 'contact_form'
setup(
name='django-contact-form',
version='0.9.0',
packages=[app_name, '%s.templatetags' % app_name],
package_data = {app_name: ['templates/%s/*.html' % app_name]},
author = 'Joshua Partogi',
author_email = 'joshua.partogi@gmail.com',... | jpartogi/django-contact-form | setup.py | Python | bsd-3-clause | 1,026 |
import imp, os, re
from calendar import monthrange
from datetime import datetime, timedelta, date
import django.utils.timezone as timezone
from email.mime.multipart import MIMEBase
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django... | bobev18/reflective | django2wrap/views.py | Python | bsd-3-clause | 22,883 |
# https://codereview.stackexchange.com/questions/44421/knapsack-branch-and-bound-forward-filter
import Queue
from collections import namedtuple
import numpy as np
import heapq
class Node(object):
def __init__(self, level, value, weight, taken):
self.level = level
self.value = value
self.wei... | kastnerkyle/discrete-opt | week2/bb_knapsack.py | Python | bsd-3-clause | 5,548 |
from django.conf.urls.defaults import *
urlpatterns = patterns("forms_builder.forms.views",
url(r"(?P<slug>.*)/sent/$", "form_sent", name="form_sent"),
url(r"(?P<slug>.*)/$", "form_detail", name="form_detail"),
)
| Govexec/django-forms-builder | forms_builder/forms/urls.py | Python | bsd-3-clause | 222 |
# -*- coding: utf8 -*-
from tower import ugettext_lazy as _
from lib.constants import ALL_CURRENCIES
# Paypal is an awful place that doesn't understand locales. Instead they have
# country codes. This maps our locales to their codes.
PAYPAL_COUNTRYMAP = {
'af': 'ZA', 'ar': 'EG', 'ca': 'ES', 'cs': 'CZ', 'cy': 'GB... | clouserw/olympia | apps/constants/payments.py | Python | bsd-3-clause | 4,534 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from unittest.case import TestCase
from djangorestframework_camel_case.util import camelize, underscoreize
class UnderscoreToCamelTestCase(TestCase):
def test_under_to_camel(self):
input = {
"title_display": 1
}
output = {
... | pombredanne/djangorestframework-camel-case | tests.py | Python | bsd-3-clause | 854 |
import json
from django.utils.translation import ugettext as _
from jsonobject.exceptions import BadValueError
from corehq.apps.userreports.exceptions import BadSpecError
from corehq.apps.userreports.transforms.specs import (
CustomTransform,
DateFormatTransform,
NumberFormatTransform,
TranslationTransf... | qedsoftware/commcare-hq | corehq/apps/userreports/transforms/factory.py | Python | bsd-3-clause | 1,120 |
from functools import partial
import numpy as np
import pytest
import elfi
import elfi.methods.post_processing as pp
from elfi.examples import gauss, ma2
from elfi.methods.post_processing import LinearAdjustment, adjust_posterior
def _statistics(arr):
return arr.mean(), arr.var()
def test_get_adjustment():
... | lintusj1/elfi | tests/functional/test_post_processing.py | Python | bsd-3-clause | 4,083 |
##########################################################################
#
# Copyright (c) 2019, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | andrewkaufman/gaffer | python/GafferUI/SpreadsheetUI/_Metadata.py | Python | bsd-3-clause | 8,877 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'BillsBeforeParliamentScraper'
db.create_table(u'scrapers_billsbeforeparliamentscraper', (
... | adieyal/billtracker | code/billtracker/scrapers/migrations/0002_auto__add_billsbeforeparliamentscraper.py | Python | bsd-3-clause | 3,821 |
#!/usr/bin/env python
import sys
import django
from django.conf import settings
from django.utils import six
from django.conf import global_settings
settings.configure(
DATABASES={
'default': {'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory;'}
},
INSTALLED_APPS=[
'django.contrib.a... | lyoniionly/django-friendship | friendship/tests/runtests.py | Python | bsd-3-clause | 1,283 |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class ScheduleConfig(AppConfig):
name = "schedule"
verbose_name = _("Schedules")
default_auto_field = "django.db.models.AutoField"
| llazzaro/django-scheduler | schedule/apps.py | Python | bsd-3-clause | 234 |
"""SCons.Executor
A module for executing actions with specific lists of target and source
Nodes.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documenta... | cournape/numscons | numscons/scons-local/scons-local-1.2.0/SCons/Executor.py | Python | bsd-3-clause | 21,495 |
from nbody_graph_search import Ugraph
# To find 4-body "improper" interactions, we would use this subgraph:
# 3
# * 1st bond connects atoms 0 and 1
# | => 2nd bond connects atoms 0 and 2
# _.*._ 3rd bond connects atoms 0 and 3
# ... | lkostler/AME60649_project_final | moltemplate/moltemplate/src/nbody_alternate_symmetry/nbody_Impropers_Icenter_swapJKL.py | Python | bsd-3-clause | 1,657 |
from sklearn2sql_heroku.tests.classification import generic as class_gen
class_gen.test_model("SVC_sigmoid" , "FourClass_500" , "sqlite")
| antoinecarme/sklearn2sql_heroku | tests/classification/FourClass_500/ws_FourClass_500_SVC_sigmoid_sqlite_code_gen.py | Python | bsd-3-clause | 140 |
# -*- coding: utf-8 -*-
# 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 require... | endlessm/chromium-browser | third_party/catapult/third_party/gsutil/gslib/gcs_json_media.py | Python | bsd-3-clause | 28,807 |
# -*- coding: utf-8 -*-
import os
import mimetypes
import shutil
import zipfile
from django.conf import settings
from django.core.cache import cache
from django.core.files.storage import default_storage as storage
from django import forms
from mock import Mock, patch
from nose.tools import eq_
from olympia import am... | jpetto/olympia | src/olympia/files/tests/test_helpers.py | Python | bsd-3-clause | 15,151 |
from distutils.core import setup
setup(
name='Flask-ACL',
version='0.0.1',
description='Access control lists for Flask.',
url='http://github.com/mikeboers/Flask-ACL',
author='Mike Boers',
author_email='flask-acl@mikeboers.com',
license='BSD-3',
install_requires=[
'Flas... | mikeboers/Flask-ACL | setup.py | Python | bsd-3-clause | 695 |
#!/usr/bin/env python
__author__ = "Daniel McDonald"
__copyright__ = "Copyright 2013, The American Gut Project"
__credits__ = ["Daniel McDonald"]
__license__ = "BSD"
__version__ = "unversioned"
__maintainer__ = "Daniel McDonald"
__email__ = "mcdonadt@colorado.edu"
def pick_rarifaction_level(id_, lookups):
"""Dete... | cuttlefishh/American-Gut | americangut/util.py | Python | bsd-3-clause | 1,469 |
from django.contrib import admin
from .models import Category, Post
@admin.register(Category)
class CategoryAdmin(admin.ModelAdmin):
prepopulated_fields = {
'slug': ('title',)
}
@admin.register(Post)
class PostAdmin(admin.ModelAdmin):
fieldsets = (
(None, {
'fields': ('title... | blancltd/blanc-basic-news | blanc_basic_news/admin.py | Python | bsd-3-clause | 716 |
from distutils.core import setup
# Dynamically calculate the version
version_tuple = __import__('addressbook').VERSION
if version_tuple[2] is not None:
version = "%d.%d_%s" % version_tuple
else:
version = "%d.%d" % version_tuple[:2]
setup(
author = 'Simon Luijk',
author_email = 'simon@simonluijk.com',... | simonluijk/django-addresses | setup.py | Python | bsd-3-clause | 936 |
"""Wrapper for the Trinity assembler."""
from os.path import join
from shutil import move
import psutil
from .base import BaseAssembler
class TrinityAssembler(BaseAssembler):
"""Wrapper for the trinity assembler."""
def __init__(self, args, cxn, log):
"""Build the assembler."""
super().__i... | juliema/aTRAM | lib/assemblers/trinity.py | Python | bsd-3-clause | 2,832 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.contrib import admin
from rwanda.models import *
admin.site.register(PregnantPerson)
admin.site.register(PregnancyReport)
admin.site.register(PreBirthReport)
admin.site.register(BirthReport)
admin.site.register(ChildReport)
#admin.site.register(Persista... | adammck/rapidsms-community-apps | rwanda/admin.py | Python | bsd-3-clause | 334 |
# $Id: psc.py 112 2008-04-05 21:19:14Z mp $
#
# Copyright (c) 2007-2008 ReThought Limited and Peloton Contributors
# All Rights Reserved
# See LICENSE for details
""" PSC: Peloton Service Controller
The service controller is the primary unit in the Peloton mesh.
PSC units link together to form a mesh; each PSC manag... | aquamatt/Peloton | src/peloton/psc.py | Python | bsd-3-clause | 6,998 |
from sklearn.feature_extraction import DictVectorizer
def prepare_record(record):
"""
Prepares a single record
"""
def prepare_value(dirty_value):
if isinstance(dirty_value, bool):
return str(dirty_value)
else:
return dirty_value
return {key: prepare_value(d... | shawnhermans/olivaw | ml/vectorizers.py | Python | bsd-3-clause | 2,544 |
"""
This module hanles configuration related stuff
"""
from builtins import object
import os.path as op
from . import conf_endpoints as scmc
from . import data_input_endpoints as scmdi
from . import property_endpoints as scmp
from . import request as req
def conf_file2name(conf_file):
conf_name = op.basename(co... | PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py3/cloudconnectlib/splunktalib/conf_manager/conf_manager.py | Python | isc | 8,388 |
from django import forms
from django.utils.safestring import mark_safe
from django.conf import settings
from .recaptcha.client import captcha
class ReCaptchaWidget(forms.widgets.Widget):
recaptcha_challenge_name = 'recaptcha_challenge_field'
recaptcha_response_name = 'recaptcha_response_field'
def render... | potatolondon/Recaptchapp | widgets.py | Python | mit | 771 |
from slack_sdk.models.messages.message import Message # noqa
| slackhq/python-slackclient | slack/web/classes/messages.py | Python | mit | 62 |
import unittest
import urllib2
import oembed
class EndpointTest(unittest.TestCase):
def testInit(self):
#plain init
ep = oembed.OEmbedEndpoint('http://www.flickr.com/services/oembed')
self.assertEqual(len(ep.getUrlSchemes()), 0)
#init with schemes
ep = o... | dokterbob/python-oembed | oembed_test.py | Python | mit | 5,331 |
# 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 ... | lmazuel/azure-sdk-for-python | azure-mgmt-servicefabric/azure/mgmt/servicefabric/models/resource.py | Python | mit | 1,581 |
#!/usr/bin/python
'''
Wrapper for the SRTM module (srtm.py)
It will grab the altitude of a long,lat pair from the SRTM database
Created by Stephen Dade (stephen_dade@hotmail.com)
'''
import numpy, os, time, sys, srtm, GAreader
class ElevationModel():
'''Elevation Model. Only SRTM for now'''
def __init__(self... | jiusanzhou/mavelous | modules/lib/mp_elevation.py | Python | mit | 3,018 |
from sofi.ui import Well
def test_basic():
assert(str(Well()) == "<div class=\"well\"></div>")
def test_text():
assert(str(Well("text")) == "<div class=\"well\">text</div>")
def test_small_size():
assert(str(Well("text", size="small")) == "<div class=\"well well-sm\">text</div>")
def test_large_size():
... | tryexceptpass/sofi | test/well_test.py | Python | mit | 674 |
#!/usr/bin/env python2
import os, sys, datetime
import pygit2
### Assume we're somewhere in the spacechem-scripts git repository.
### Also assume the pages git repository has already been made,
### and has at least one commit.
our_git = pygit2.discover_repository('.')
pages_git = os.path.join(our_git, '../pages/.git')... | sboparen/spacechem | net/history.py | Python | mit | 2,536 |
from keras.optimizers import SGD
# -------------------------------------------------
# Background config:
data_path= '../data/'
model_path = '../models/'
checkpoint_path = '../checkpoints/'
print_model_summary = True
save_model_plot = True
data_augmentation = False
# -------------------------------------------------
... | pratikgujjar/DeepIntent | code/vae_model/config.py | Python | mit | 1,084 |
"""Hard filtering of genomic variants.
"""
from distutils.version import LooseVersion
import math
import os
import shutil
import numpy
import toolz as tz
import vcf
import yaml
from bcbio import broad, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbio.... | guillermo-carrasco/bcbio-nextgen | bcbio/variation/vfilter.py | Python | mit | 10,608 |
import pydot
import ConfigParser
import sys
running = True
while(running):
phrase = str(raw_input("PHRASE: "))
fileout = "graph_" + phrase + ".png"
parser = ConfigParser.ConfigParser()
parser.optionxform=str
filein = sys.argv[1]
#fileout = sys.argv[2]
#phrase = sys.argv[3]
parser.read(filein)
nodes = parser.o... | yacklebeam/corpus-crawler | src/graph_phrase.py | Python | mit | 689 |
#!/usr/bin/env python
## @auth John Allard, Nick Church, others
## @date Oct 2015
## @github https://github.com/praxyk/praxyk-clients
## @license MIT
import os, sys, json, requests, time
import subprocess, argparse, getpass
import datetime as dt
from praxyk_exception import PraxykException
from base import PraxykBas... | jhallard/Praxyk-Clients | libs/python/praxyk/transaction.py | Python | mit | 6,698 |
"""
Django settings for {{ project_name }} project.
Common settings for all environments. Don't directly use this settings file,
use environments/development.py or environments/production.py and import this
file from there.
"""
import sys
from path import path
from django.conf import global_settings
PROJECT_ROOT = pa... | oopi/potluck | config/settings.py | Python | mit | 5,746 |
# Copyright 2013 by Rackspace Hosting, 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 t... | cdepman/falcon_api | site-packages/falcon/http_error.py | Python | mit | 8,482 |
#### 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/container/drum/shared_warren_drum_tech_chest.iff"
result.attribute_... | anhstudios/swganh | data/scripts/templates/object/tangible/container/drum/shared_warren_drum_tech_chest.py | Python | mit | 473 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Kin documentation build configuration file, created by
# sphinx-quickstart on Sun May 1 03:38:47 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | loveairbear/Kin | docs/conf.py | Python | mit | 9,540 |
#!/usr/bin/env python
import os
import sys
# For coverage.
if __package__ is None:
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..")
from unittest import main, TestCase
import requests
import requests_mock
from iris_sdk.client import Client
from iris_sdk.models.account import Account
XML_RES... | scottbarstow/iris-python | tests/test_notes.py | Python | mit | 2,406 |
"""
Compare the various algorithms on a synthetic dataset.
"""
import time
import cPickle
import os
import gzip
import pprint
import numpy as np
from scipy.misc import logsumexp
from scipy.special import gammaln
# Use the Agg backend in running on a server without the DISPLAY variable
if "DISPLAY" not in os.environ:
... | mattjj/pyhawkes | experiments/synthetic_comparison.py | Python | mit | 35,847 |
from datetime import datetime
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from django.template.loader import render_to_string
from django.utils.translation import get_language
from i18n.utils import normalize_language_code
from newsfeed.utils import get_collection
... | bahattincinic/arguman.org | web/newsfeed/models.py | Python | mit | 8,851 |
# ============================================================================
#
# Copyright (c) 2007-2012 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 | wlst/osb.py | Python | mit | 5,784 |
"""Structural variation detection for split and paired reads using lumpy.
Uses lumpyexpress for lumpy integration and samblaster for read preparation:
https://github.com/GregoryFaust/samblaster
https://github.com/arq5x/lumpy-sv
"""
import contextlib
import os
import sys
import shutil
import vcf
from bcbio import uti... | Cyberbio-Lab/bcbio-nextgen | bcbio/structural/lumpy.py | Python | mit | 10,753 |
# -*- coding: utf-8 -*-
"""
Site tools views module
===============================================
.. module:: sitetools.views
:platform: Django
:synopsis: Site tools views module
.. moduleauthor:: (C) 2014 Oliver Gutiérrez
"""
# Python imports
import os
# Django imports
from django.template.response impor... | R3v1L/django-sitetools | sitetools/views.py | Python | mit | 6,005 |
#### 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_tiebomber_tier1.iff"
result.attribute_template_id = -1
result.stfNa... | anhstudios/swganh | data/scripts/templates/object/ship/shared_tiebomber_tier1.py | Python | mit | 412 |
"""python modules"""
__all__ = ['util', 'log', 'verbs', 'config', 'fips', 'registry', 'settings', 'doc']
| floooh/fips | mod/__init__.py | Python | mit | 105 |
from urllib.parse import urlparse
import logging
import asyncio
import aiohttp
logger = logging.getLogger()
class HTTPClient(object):
def __init__(self):
self._lock = asyncio.Lock()
self._session = None
async def async_call(self, url, method='GET', headers=dict(), body=None, timeout=10):
... | RyouZhang/nori | noir/util/http/client.py | Python | mit | 2,139 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | crossbario/autobahn-python | autobahn/wamp/interfaces.py | Python | mit | 28,746 |
class A(object):
def foo(self):
print self._foo1()
def _foo1(self):
return "foo"
class B(A):
def _foo1(self):
print "B-foo1"
# def foo(self):
# raise AttributeError, "wtf!"
def foo2(self):
self.foo()
myB = B()
myB.foo2() | dikujepsen/OpenTran | v3.0/test/C/test.py | Python | mit | 283 |
#!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | QingChenmsft/azure-cli | src/command_modules/azure-cli-acs/setup.py | Python | mit | 2,103 |
#### 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/lair/kwi/shared_lair_kwi_forest.iff"
result.attribute_template_id =... | anhstudios/swganh | data/scripts/templates/object/tangible/lair/kwi/shared_lair_kwi_forest.py | Python | mit | 445 |
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
import pybullet as p
import math
import time
import pybullet_data
p.connect(p.GUI)
#p.loadURDF("wheel.urdf",[0,0,3])... | MadManRises/Madgine | shared/bullet3-2.89/examples/pybullet/gym/pybullet_envs/examples/testBike.py | Python | mit | 4,627 |
"""
For CommonsCloud copyright information please see the License document included with
this software package.
Licensing information can be found in the LICENSE document (the "License")
included with this copy of the software and this file may not be used in any
manner except in compliance with the License
Unless re... | CommonsCloud/Proxy | settings_testing.py | Python | mit | 620 |
from __future__ import division, print_function
import six
from time import time, ctime
from subprocess import PIPE, CalledProcessError
if six.PY3:
from subprocess import run
else:
from subprocess import check_call
class Executor(object):
"""
Log and execute shell commands.
@param dryRun: If C{... | terrycojones/dark-matter | dark/process.py | Python | mit | 4,451 |
from __future__ import print_function
import sys
import os
import runpy
import traceback
import contextlib
import argparse
from tracestack.handler import ExceptionHandler
from tracestack.console import TracestackConsole
def run():
"""Runs the script provided by the arguments, using the
tracestack exception ha... | kod3r/tracestack | tracestack/command_line.py | Python | mit | 3,277 |
#### 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/wearables/ring/shared_ring_s02.iff"
result.attribute_template_id = ... | anhstudios/swganh | data/scripts/templates/object/tangible/wearables/ring/shared_ring_s02.py | Python | mit | 450 |
import os, os.path
import datetime
from sfa.util.faults import SfaFault, SfaAPIError, RecordNotFound
from sfa.util.genicode import GENICODE
from sfa.util.config import Config
from sfa.util.cache import Cache
from sfa.trust.auth import Auth
from sfa.trust.certificate import Keypair, Certificate
from sfa.trust.credenti... | onelab-eu/sfa | sfa/server/sfaapi.py | Python | mit | 9,439 |
import _plotly_utils.basevalidators
class LayersValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(self, plotly_name="layers", parent_name="layout.mapbox", **kwargs):
super(LayersValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | plotly/python-api | packages/python/plotly/plotly/validators/layout/mapbox/_layers.py | Python | mit | 6,142 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | 0vercl0k/rp | src/third_party/beaengine/tests/0f3804.py | Python | mit | 5,030 |
#imports
from flask import Flask
from flask import render_template
from flask import url_for
from flask import request
from twilio import twiml
from twilio.util import TwilioCapability
import re
import foursquare
# Declare and configure application
app = Flask(__name__, static_url_path='/static')
app.config.from_pyf... | adityadalal924/aroundme | hackpack/app.py | Python | mit | 3,614 |
import hashlib
import base64
class Handshake:
"""
Handles the WebSocket handshake.
"""
def perform(self, data):
"""
Parses the given request data and returns a matching response header.
"""
key = self._build_web_socket_accept_from_request_header(data.decode("utf-8"))
... | Cottin/BrowserREPL-for-Sublime | WebSocket/Handshake.py | Python | mit | 1,310 |
def deprecation_warning_for_admin(f):
err = (
"admin_only=True is deprecated and is being used by the `%s` method.\n" % (f.__name__, ) +
" Please use ACLs instead. admin_only will be removed at the end of 2017."
)
return err
def passthrough_decorator(*args, **kwargs):
def wrap(f):
... | mike-love/will | will/decorators.py | Python | mit | 5,821 |
# 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 ... | SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/resources/v2017_05_10/models/http_message.py | Python | mit | 796 |
import string
__version__ = string.split('$Revision: 1.9 $')[1]
__date__ = string.join(string.split('$Date: 2001/08/09 19:30:29 $')[1:3], ' ')
__author__ = 'Tarn Weisner Burton <twburton@users.sourceforge.net>'
__doc__ = 'http://oss.sgi.com/projects/ogl-sample/registry/SGI/color_matrix.txt'
__api_version__ = 0x108... | fxia22/ASM_xf | PythonD/site_python/OpenGL/GL/SGI/color_matrix.py | Python | gpl-2.0 | 1,073 |
# -*- coding: utf-8 -*-
##
# This file is part of Testerman, a test automation system.
# Copyright (c) 2008-2009 Sebastien Lefevre and other contributors
#
# 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
# Fo... | seblefevre/testerman | plugins/codecs/SipBasic.py | Python | gpl-2.0 | 9,995 |
from subprocess import check_output
class Command:
"""representation of scripts in spec file"""
def __init__(self, cmdline=None):
"""cmdline could be list of strings or string containing multiple lines
"""
self.rpm_variables = []
self._command_lines = []
if cmdlin... | ignatenkobrain/rpg | rpg/command.py | Python | gpl-2.0 | 2,074 |
from Sire.Tools import Nautilus
from Sire.Tools import readParams
import Sire.Config
import argparse
import os
import sys
import ast
parser = argparse.ArgumentParser(description="Focusgrid, a protocol where selected coordinates are used to define "
"regions with a spheri... | chryswoods/Sire | wrapper/python/scripts/nautilus-focusgrid.py | Python | gpl-2.0 | 3,292 |
# Copyright 2016 Nick Boultbee
#
# 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.
from quodlibet import _
from quodlibet... | Mellthas/quodlibet | quodlibet/order/repeat.py | Python | gpl-2.0 | 2,185 |
# Copyright (C) 2014 Saggi Mizrahi, 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 version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY... | kvaps/vdsm | lib/yajsonrpc/stomp.py | Python | gpl-2.0 | 15,600 |
import gtk
gdk = gtk.gdk
from gettext import gettext as _
import gobject
import pango
import dialogs
import stock
from lib.layer import COMPOSITE_OPS
def stock_button(stock_id):
b = gtk.Button()
img = gtk.Image()
img.set_from_stock(stock_id, gtk.ICON_SIZE_MENU)
b.add(img)
return b
def make_compo... | dvberkel/mypaint | gui/layerswindow.py | Python | gpl-2.0 | 13,258 |
import serial
turretChangeDir = 'a'
turretChangeSpd = 'b'
treadSetSpeedDir = 'c'
turretSetDir = 'd'
class motorcontrol:
def __init__(self, targetPort="/dev/ttyUSB0", speed=9600):
self.targetPort = targetPort
self.speed = speed
self.ser = serial.Serial(port=self.targetPort, baudrat... | umbc-hackafe/autotank | server/motorserial.py | Python | gpl-2.0 | 1,485 |
"""Tests for pad.rules.parser"""
import logging
import unittest
from builtins import UnicodeDecodeError
try:
from unittest.mock import patch, Mock, mock_open, MagicMock
except ImportError:
from mock import patch, Mock, mock_open, MagicMock
import oa.errors
import oa.rules.parser
class TestParseGetRuleset(u... | SpamExperts/SpamPAD | tests/unit/test_rules/test_parser.py | Python | gpl-2.0 | 19,858 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
store.py
---------------------
Date : November 2012
Copyright : (C) 2012 by David Winslow
Email : dwins at opengeo dot com
******************************... | luca76/QGIS | python/plugins/processing/algs/admintools/geoserver/store.py | Python | gpl-2.0 | 5,280 |
__author__ = 'tonycastronova'
from os.path import *
import unittest
from datetime import datetime
from utilities import gui
import matplotlib.pyplot as plt
from descartes.patch import *
from models.swmm.src import geometry
from models.swmm.src import swmm_wrapper
# from ..src.parse_swmm import *
import time
class ... | Castronova/EMIT | models/swmm_win/test/test_run.py | Python | gpl-2.0 | 6,036 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from urbansim.functions import attribute_label
from variable_functions import my_attribute_label
from opus_core.logger import logger
class n... | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/washtenaw/region/number_of_development_events_in_developed_cell.py | Python | gpl-2.0 | 2,431 |
# coding=utf-8
# Copyright (c) 2016 Intel, Inc.
# Author Simo Kuusela <simo.kuusela@intel.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; version 2 of the License
#
# This program is dist... | 01org/AFT | testing_harness/cutters/netbootercutter.py | Python | gpl-2.0 | 1,897 |
# EBML/Matroska parser
# Copyright (C) 2010, 2015 Johannes Sasongko <sasongko@gmail.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, or (at your option)
# any later vers... | virtuald/exaile | xl/metadata/_matroska.py | Python | gpl-2.0 | 12,726 |
import pytest
class TestPyvenv:
@pytest.mark.complete("pyvenv ")
def test_1(self, completion):
assert completion
| algorythmic/bash-completion | test/t/test_pyvenv.py | Python | gpl-2.0 | 131 |
#!/usr/bin/env python
from threading import Thread
from Queue import Queue
import multiprocessing
import subprocess
import platform
import argparse
import time
import sys
import os
TEST_DIR = "test/functional"
CLASSPATH_DIR = os.popen('tools/classpath-config').read().strip()
if not CLASSPATH_DIR:
print "GNU Class... | penberg/jato | tools/test.py | Python | gpl-2.0 | 10,412 |
#!/usr/bin/env python
import pip
from sys import argv
from subprocess import check_output, Popen, PIPE
from os import devnull, execv
def ppip():
installed = []
installed = []
fi = open("./REQUIREMENTS.txt", "r")
data = fi.read()
fi.close()
tt= []
output = check_output("pip ... | PrometheanInfoSec/TALOS | core/depends.py | Python | gpl-2.0 | 1,421 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
#end_pymotw_header
| qilicun/python | python2/PyMOTW-1.132/PyMOTW/sys/package_dir_b/__init__.py | Python | gpl-3.0 | 127 |
# Copyright (c) 2014-2016 Genome Research Ltd.
#
# This file is part of IVA.
#
# IVA 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.
# ... | martinghunt/iva | iva/kcount.py | Python | gpl-3.0 | 9,487 |
import pytest
import numpy
import astropy.wcs
from ..fluxcalib import update_flux_limits, WAVLIM_KEYS, PIXLIM_KEYS
def generate_wcs():
wcsl = astropy.wcs.WCS(naxis=2)
crpix = 3.0
crval = 5300.0
cdelt = 0.1
wcsl.wcs.crpix = [crpix, 0.0]
wcsl.wcs.crval = [crval, 0.0]
wcsl.wcs.cdelt = [cd... | sergiopasra/megaradrp | megaradrp/processing/tests/test_fluxcalib.py | Python | gpl-3.0 | 1,433 |
from p2pool.bitcoin import networks
PARENT = networks.nets['vertcoin']
SHARE_PERIOD = 15 # seconds
CHAIN_LENGTH = 24*60*60//10 # shares
REAL_CHAIN_LENGTH = 24*60*60//10 # shares
TARGET_LOOKBEHIND = 200 # shares
SPREAD = 12 # blocks
IDENTIFIER = 'a06a81c827cab975'.decode('hex')
PREFIX = '7c3614a6bcdcf796'.decode('hex')... | depboy/p2pool-depboy | p2pool/networks/vertcoin3.py | Python | gpl-3.0 | 545 |
"""
Object to manage regular expressions, try to optimize the result:
- '(a|b)' => '[ab]'
- '(color red|color blue)' => 'color (red|blue)'
- '([ab]|c)' => '[abc]'
- 'ab' + 'cd' => 'abcd' (one long string)
- [a-z]|[b] => [a-z]
- [a-c]|[a-e] => [a-z]
- [a-c]|[d] => [a-d]
- [a-c]|[d-f] => [a-f]
Operation:
- str(... | SickGear/SickGear | lib/hachoir_py3/regex/regex.py | Python | gpl-3.0 | 26,058 |