repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
kyoren/https-github.com-h2oai-h2o-3
refs/heads/master
py2/h2o_os_util.py
30
import subprocess import getpass def kill_process_tree(pid, including_parent=True): parent = psutil.Process(pid) for child in parent.get_children(recursive=True): child.kill() if including_parent: parent.kill() def kill_child_processes(): me = os.getpid() kill_process_tree(me, inc...
puttarajubr/commcare-hq
refs/heads/master
corehq/apps/export/tests/__init__.py
2
from corehq.apps.export.tests.test_form_schema import *
ngonzalvez/sentry
refs/heads/master
src/sentry/middleware/env.py
12
from __future__ import absolute_import from django.conf import settings from django.core.urlresolvers import reverse from sentry.app import env class SentryEnvMiddleware(object): def process_request(self, request): # HACK: bootstrap some env crud if we haven't yet if not settings.SENTRY_URL_PREF...
xindus40223115/w16b_test
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_discovery.py
785
import os import re import sys import unittest class TestableTestProgram(unittest.TestProgram): module = '__main__' exit = True defaultTest = failfast = catchbreak = buffer = None verbosity = 1 progName = '' testRunner = testLoader = None def __init__(self): pass class TestDisc...
Lekanich/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/auth/tests/views.py
71
import os import re import urllib from django.conf import settings from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME from django.contrib.auth.forms import AuthenticationForm from django.contrib.sites.models import Site from django.contrib.auth.models import User from django.test import TestCase from dja...
radiasoft/pykern
refs/heads/master
tests/pkcompat_test.py
1
# -*- coding: utf-8 -*- u"""pytest for :mod:`pykern.pkcompat` :copyright: Copyright (c) 2015 Bivio Software, Inc. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import locale import os import pytest import six def...
fujunwei/chromium-crosswalk
refs/heads/master
tools/telemetry/telemetry/__init__.py
49
# 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. """A library for cross-platform browser tests.""" import sys # Ensure Python >= 2.7. if sys.version_info < (2, 7): print >> sys.stderr, 'Need Python 2.7 ...
msmolens/girder
refs/heads/master
tests/js_coverage_tool.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
yamahata/python-tackerclient
refs/heads/tackerclient
tackerclient/shell.py
1
# Copyright 2012 OpenStack Foundation. # 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...
bryanveloso/avalonstar-tv
refs/heads/master
avalonstar/settings/development.py
1
# -*- coding: utf-8 -*- from configurations import values from .base import Base as Settings class Development(Settings): MIDDLEWARE_CLASSES = Settings.MIDDLEWARE_CLASSES # Site Configuration. # -------------------------------------------------------------------------- ALLOWED_HOSTS = ['*'] # D...
linjoahow/W16_test1
refs/heads/master
static/Brython3.1.3-20150514-095342/Lib/multiprocessing/dummy/__init__.py
693
# # Support for the API of the multiprocessing package using threads # # multiprocessing/dummy/__init__.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: ...
bluedynamics/node.ext.python
refs/heads/master
src/node/ext/python/goparser.py
1
# -*- coding: utf-8 -*- # Copyright 2009, BlueDynamics Alliance - http://bluedynamics.com # GNU General Public License Version 2 # Georg Gogo. BERNHARD gogo@bluedynamics.com # import os import re import ast import _ast import sys import compiler class metanode(object): def __init__( self, ...
BorisJeremic/Real-ESSI-Examples
refs/heads/master
analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/HardContact_ElPPlShear/Area/A_1e-2/Normalized_Shear_Stress_Plot.py
48
#!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as np; plt.rcParams.update({'font.size': 28}) # set tick width mpl.rcParams['xtick.major.size'] = 10 mpl.rcParams['xtick.major.width'] = 5 mpl.rcParams['xtick.minor.size'] = 10 mpl.rcParams['xtick.minor.width...
p4datasystems/CarnotKE
refs/heads/master
jyhton/lib-python/2.7/encodings/shift_jis.py
816
# # shift_jis.py: Python Unicode Codec for SHIFT_JIS # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('shift_jis') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.Multib...
kura/blackhole
refs/heads/master
tests/test_worker_child_communication.py
1
# -*- coding: utf-8 -*- # (The MIT License) # # Copyright (c) 2013-2020 Kura # # 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 # ...
sfpprxy/py-reminder
refs/heads/master
libs/contrib/geoa/form.py
44
from flask_admin.model.form import converts from flask_admin.contrib.sqla.form import AdminModelConverter as SQLAAdminConverter from .fields import GeoJSONField class AdminModelConverter(SQLAAdminConverter): @converts('Geography', 'Geometry') def convert_geom(self, column, field_args, **extra): field_...
justajeffy/arsenalsuite
refs/heads/master
cpp/lib/PyQt4/pyuic/uic/autoconnect.py
11
from PyQt4 import QtCore from itertools import ifilter def is_autoconnect_slot((name, attr)): return callable(attr) and name.startswith("on_") def signals(child): meta = child.metaObject() for idx in xrange(meta.methodOffset(), meta.methodOffset() + meta.methodCount()): metho...
Mhynlo/SickRage
refs/heads/master
lib/enzyme/exceptions.py
76
# -*- coding: utf-8 -*- __all__ = ['Error', 'MalformedMKVError', 'ParserError', 'ReadError', 'SizeError'] class Error(Exception): """Base class for enzyme exceptions""" pass class MalformedMKVError(Error): """Wrong or malformed element found""" pass class ParserError(Error): """Base class for ...
TEDICpy/write-it
refs/heads/master
mailit/migrations/0003_auto__add_field_mailittemplate_content_html_template.py
2
# -*- 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): # Adding field 'MailItTemplate.content_html_template' db.add_column(u'mai...
supergentle/migueltutorial
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.py
915
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBu...
jpaton/xen-4.1-LJX1
refs/heads/master
tools/python/xen/xm/dumppolicy.py
49
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
wbc2010/django1.2.5
refs/heads/master
tests/regressiontests/makemessages/tests.py
49
import os import re from subprocess import Popen, PIPE def find_command(cmd, path=None, pathext=None): if path is None: path = os.environ.get('PATH', []).split(os.pathsep) if isinstance(path, basestring): path = [path] # check if there are funny path extensions for executables, e.g. Windows...
Jumpscale/web
refs/heads/master
pythonlib/werkzeug/testsuite/contrib/wrappers.py
146
# -*- coding: utf-8 -*- """ werkzeug.testsuite.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Added tests for the sessions. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import with_statement import unittest from werkzeug.testsuit...
HackFisher/depot_tools
refs/heads/master
third_party/gsutil/gslib/commands/getcors.py
51
# Copyright 2012 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...
ammarkhann/FinalSeniorCode
refs/heads/master
lib/python2.7/site-packages/pandas/tests/plotting/test_hist_method.py
6
# coding: utf-8 """ Test cases for .hist method """ import pytest from pandas import Series, DataFrame import pandas.util.testing as tm from pandas.util.testing import slow import numpy as np from numpy.random import randn from pandas.plotting._core import grouped_hist from pandas.tests.plotting.common import (Tes...
mgit-at/ansible
refs/heads/devel
lib/ansible/modules/network/cloudengine/ce_vlan.py
7
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
nicobustillos/odoo
refs/heads/8.0
addons/hr_payroll/wizard/__init__.py
442
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
iostackproject/Swift-Microcontroller
refs/heads/master
Engine/swift/vertigo_middleware/gateways/docker/datagram.py
1
import json import os import syslog SBUS_FD_OUTPUT_OBJECT = 1 SBUS_CMD_NOP = 9 class Datagram(object): '''@summary: This class aggregates data to be transferred using SBus functionality. ''' command_dict_key_name_ = 'command' task_id_dict_key_name_ = 'taskId' def __init__(self): ...
dhoffman34/django
refs/heads/master
django/templatetags/future.py
45
import warnings from django.template import Library from django.template import defaulttags from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning register = Library() @register.tag def ssi(parser, token): warnings.warn( "Loading the `ssi` tag from the `future` library i...
tsuru/tsuru-autoscale-dashboard
refs/heads/master
tsuru_autoscale/datasource/views.py
1
from django.shortcuts import render, redirect from django.core.urlresolvers import reverse from django.contrib import messages from tsuru_autoscale.datasource.forms import DataSourceForm from tsuru_autoscale.datasource import client def new(request): form = DataSourceForm(request.POST or None) if form.is_va...
aviciimaxwell/odoo
refs/heads/8.0
addons/account/wizard/account_state_open.py
341
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
zachjanicki/osf.io
refs/heads/develop
website/addons/github/__init__.py
21
import os from website.addons.github import routes, views, model MODELS = [ model.GitHubUserSettings, model.GitHubNodeSettings, ] USER_SETTINGS_MODEL = model.GitHubUserSettings NODE_SETTINGS_MODEL = model.GitHubNodeSettings ROUTES = [routes.api_routes] SHORT_NAME = 'github' FULL_NAME = 'GitHub' OWNERS = ['...
kalahbrown/HueBigSQL
refs/heads/master
desktop/core/ext-py/pysaml2-2.4.0/src/xmldsig/__init__.py
32
#!/usr/bin/env python # # Generated Mon May 2 14:23:33 2011 by parse_xsd.py version 0.4. # import saml2 from saml2 import SamlBase NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#' ENCODING_BASE64 = 'http://www.w3.org/2000/09/xmldsig#base64' # digest and signature algorithms (not implemented = commented out) DIGES...
fusion809/fusion809.github.io-old
refs/heads/master
vendor/bundle/ruby/2.2.0/gems/pygments.rb-0.6.3/vendor/simplejson/simplejson/tests/test_item_sort_key.py
60
from unittest import TestCase import simplejson as json from operator import itemgetter class TestItemSortKey(TestCase): def test_simple_first(self): a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'} self.assertEquals( ...
bop/rango
refs/heads/master
lib/python2.7/site-packages/django/contrib/gis/db/backends/oracle/compiler.py
148
from django.contrib.gis.db.models.sql.compiler import GeoSQLCompiler as BaseGeoSQLCompiler from django.db.backends.oracle import compiler SQLCompiler = compiler.SQLCompiler class GeoSQLCompiler(BaseGeoSQLCompiler, SQLCompiler): pass class SQLInsertCompiler(compiler.SQLInsertCompiler, GeoSQLCompiler): pass c...
PalmBeachPost/panda
refs/heads/1.2.0
panda/tests/test_solr.py
6
#!/usr/bin/env python import datetime from django.test import TestCase from panda import solr as solrjson class TestSolrJSONEncoder(TestCase): def test_datetime(self): v = { 'datetime': datetime.datetime(2012, 4, 11, 11, 3, 0) } self.assertEqual(solrjson.dumps(v), '{"datetime": "2012-04-11T11:03...
PetePriority/home-assistant
refs/heads/dev
homeassistant/components/sensor/srp_energy.py
4
""" Platform for retrieving energy data from SRP. For more details about this platform, please refer to the documentation https://home-assistant.io/components/sensor.srp_energy/ """ from datetime import datetime, timedelta import logging from requests.exceptions import ( ConnectionError as ConnectError, HTTPError...
akretion/odoo
refs/heads/12-patch-paging-100-in-o2m
addons/account/models/reconciliation_widget.py
6
# -*- coding: utf-8 -*- import copy from odoo import api, fields, models, _ from odoo.exceptions import UserError from odoo.osv import expression from odoo.tools import pycompat from odoo.tools.misc import formatLang from odoo.tools import misc class AccountReconciliation(models.AbstractModel): _name = 'account....
phy0/namebench
refs/heads/master
nb_third_party/dns/ttl.py
248
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 ...
2ndQuadrant/ansible
refs/heads/master
test/units/modules/network/f5/test_bigip_profile_http2.py
16
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
denys-duchier/sorl-thumbnail-py3
refs/heads/master
sorl/thumbnail/fields.py
1
from django.db import models from django.db.models import Q from django import forms from django.utils.translation import ugettext_lazy as _ from sorl.thumbnail import default import collections __all__ = ('ImageField', 'ImageFormField') class ImageField(models.FileField): def delete_file(self, instance, sende...
jamezpolley/pip
refs/heads/develop
tests/data/packages/LocalExtras/setup.py
46
import os from setuptools import setup, find_packages def path_to_url(path): """ Convert a path to URI. The path will be made absolute and will not have quoted path parts. """ path = os.path.normpath(os.path.abspath(path)) drive, path = os.path.splitdrive(path) filepath = path.split(os.pat...
AngelkPetkov/titanium_mobile
refs/heads/master
support/common/css/serialize.py
75
# -*- coding: utf-8 -*- ''' A serializer for CSS. ''' import css # This module comprises all serialization code for the # syntax object of CSS, kept here so that the serialization # strategy for the whole system can be modified easily # without the need to touch a dozen classes. # # Adding a # new type of data requ...
bayespy/bayespy
refs/heads/develop
bayespy/inference/vmp/nodes/gaussian.py
2
################################################################################ # Copyright (C) 2011-2014 Jaakko Luttinen # # This file is licensed under the MIT License. ################################################################################ """ Module for the Gaussian distribution and similar distribution...
emanuelschuetze/OpenSlides
refs/heads/master
openslides/users/migrations/0009_auto_20190119_0941.py
8
# Generated by Django 2.1.5 on 2019-01-19 08:41 from django.db import migrations class Migration(migrations.Migration): dependencies = [("users", "0008_user_gender")] operations = [ migrations.AlterModelOptions( name="user", options={ "default_permissions": (...
Kaushikpatnaik/Active-Learning-and-Best-Response-Dynamics
refs/heads/master
passive_learners.py
1
from numpy import * from numpy.linalg import svd from scipy.stats import norm as normal from scipy import linalg as lin import time import itertools import random from learners import * from cvxopt import matrix, solvers, spdiag solvers.options['show_progress'] = False solvers.options['maxiters'] = 2000 class Hinge...
jelugbo/ddi
refs/heads/master
lms/lib/comment_client/user.py
5
from .utils import merge_dict, perform_request, CommentClientRequestError import models import settings class User(models.Model): accessible_fields = ['username', 'follower_ids', 'upvoted_ids', 'downvoted_ids', 'id', 'external_id', 'subscribed_user_ids', 'children', 'course_id', ...
enriclluelles/ansible-modules-extras
refs/heads/devel
database/vertica/vertica_configuration.py
148
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
drewswu/moviemap
refs/heads/master
webapp/tests.py
24123
from django.test import TestCase # Create your tests here.
npe9/depot_tools
refs/heads/master
third_party/logilab/astroid/brain/py2mechanize.py
76
from astroid import MANAGER, register_module_extender from astroid.builder import AstroidBuilder def mechanize_transform(): return AstroidBuilder(MANAGER).string_build(''' class Browser(object): def open(self, url, data=None, timeout=None): return None def open_novisit(self, url, data=None, timeou...
minhpqn/chainer
refs/heads/master
cupy/cudnn.py
11
import atexit import ctypes import numpy import six from cupy import cuda from cupy.cuda import cudnn _handles = {} def get_handle(): global _handles device = cuda.Device() handle = _handles.get(device.id, None) if handle is None: handle = cudnn.create() _handles[device.id] = handl...
kurkop/server-tools
refs/heads/master
__unported__/import_odbc/import_odbc.py
6
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis # 2011 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software ...
openiitbombayx/edx-platform
refs/heads/master
cms/djangoapps/xblock_config/models.py
172
""" Models used by Studio XBlock infrastructure. Includes: StudioConfig: A ConfigurationModel for managing Studio. """ from django.db.models import TextField from config_models.models import ConfigurationModel class StudioConfig(ConfigurationModel): """ Configuration for XBlockAsides. """ disab...
antoviaque/edx-platform
refs/heads/master
cms/djangoapps/contentstore/views/tests/utils.py
198
""" Utilities for view tests. """ import json from contentstore.tests.utils import CourseTestCase from contentstore.views.helpers import xblock_studio_url from xmodule.modulestore.tests.factories import ItemFactory class StudioPageTestCase(CourseTestCase): """ Base class for all tests of Studio pages. "...
quillford/redeem
refs/heads/master
redeem/Pipe.py
1
#!/usr/bin/env python """ Pipe - This uses a virtual TTY for communicating with Toggler or similar front end. Author: Elias Bakken email: elias(dot)bakken(at)gmail(dot)com Website: http://www.thing-printer.com License: GNU GPL v3: http://www.gnu.org/copyleft/gpl.html Redeem is free software: you can redistribute it ...
maurerpe/FreeCAD
refs/heads/master
src/Mod/Import/App/SCL/essa_par.py
30
def process_nested_parent_str(attr_str): ''' The first letter should be a parenthesis input string: "(1,4,(5,6),7)" output: tuple (1,4,(4,6),7) ''' params = [] agg_scope_level = 0 current_param = '' for i,ch in enumerate(attr_str): if ch==',': params.append(curren...
pastaread/TanksBattle
refs/heads/master
cocos2d/plugin/tools/pluginx-bindings-generator/genbindings-lua.py
130
#!/usr/bin/python # This script is used to generate luabinding glue codes. # Android ndk version must be ndk-r9b. import sys import os, os.path import shutil import ConfigParser import subprocess import re from contextlib import contextmanager import shutil import yaml import tempfile def _check_ndk_root_env(): ...
pasiegel/SickGear
refs/heads/master
lib/subliminal/services/podnapisiweb.py
23
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
cinayc/crawler
refs/heads/master
crawler/spiders/test_spider.py
1
# -*- coding: utf-8 -*- import scrapy from scrapy.exceptions import IgnoreRequest from scrapy.linkextractors import LinkExtractor from scrapy.spidermiddlewares.httperror import HttpError from scrapy.spiders import Rule, CrawlSpider from service_identity.exceptions import DNSMismatch from twisted.internet.error import D...
meetmangukiya/coala
refs/heads/master
tests/results/LineDiffTest.py
35
import unittest from coalib.results.LineDiff import LineDiff, ConflictError class LineDiffTest(unittest.TestCase): def test_everything(self): self.assertRaises(TypeError, LineDiff, delete=5) self.assertRaises(TypeError, LineDiff, change=5) self.assertRaises(TypeError, LineDiff, add_after...
tph-thuering/vnetsource
refs/heads/master
ts_emod2/utils/launch.py
2
from django.core.exceptions import PermissionDenied from django.shortcuts import redirect from vecnet.simulation import sim_model, sim_status from data_services.data_api import EMODBaseline from lib.templatetags.base_extras import set_notification from sim_services import dispatcher from data_services.models import D...
sixninetynine/pex
refs/heads/master
pex/resolver.py
1
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import print_function import itertools import os import shutil import time from collections import namedtuple from pkg_resources import safe_name from .common import saf...
seniorivn/python_contact_book
refs/heads/master
contact.py
1
import sqlite3 from datetime import date from time import strptime class Contact(object): """class of contact with fields id,fname,lname,mname,phone,bday""" _cid = "" _fname = "" _lname = "" _mname = "" _phone = "" _bday = "" bday_types=["%d/%m/%Y","%d/%m/%y"] def __init__(self,...
bear/circleci-nginx-proxy
refs/heads/master
foob/settings.py
1
# -*- coding: utf-8 -*- """ :copyright: (c) 2016 by Mike Taylor :license: CC0 1.0 Universal, see LICENSE for more details. """ import os _cwd = os.path.dirname(os.path.abspath(__file__)) class Config(object): SECRET_KEY = "foob" TEMPLATES = os.path.join(_cwd, 'templates') class ProdConfig(Config): ENV...
neavouli/yournextrepresentative
refs/heads/release-neavouli
candidates/tests/test_feeds.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django_webtest import WebTest from popolo.models import Person from .auth import TestUserMixin from ..models import LoggedAction class TestFeeds(TestUserMixin, WebTest): def setUp(self): self.person1 = Person.objects.create( ...
BCriswell/crud-fusion
refs/heads/master
config/settings/production.py
1
# -*- coding: utf-8 -*- ''' Production Configurations - Use djangosecure - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis on Heroku ''' from __future__ import absolute_import, unicode_literals from boto.s3.connection import OrdinaryCallingFormat from django.utils...
ibelem/crosswalk-test-suite
refs/heads/master
webapi/tct-csp-w3c-tests/csp-py/csp_object-src_none_blocked_int-manual.py
30
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "object-src 'none'" ...
CSC301H-Fall2013/JuakStore
refs/heads/master
site-packages/django/conf/locale/pt_BR/formats.py
107
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j \d\e F \d\e Y' TIME_FORMAT = '...
consulo/consulo-python
refs/heads/master
plugin/src/test/resources/refactoring/inlinelocal/multiple.after.py
4
aoo = 10 + 10 boo = 10 + 10 coo = 10 + 10 doo = 10 + 10 eoo = 10 + 10 goo = 10 + 10 hoo = 10 + 10 ioo = 10 + 10 joo = 10 + 10 koo = 10 + 10 loo = 10 + 10 moo = 10 + 10 noo = 10 + 10 ooo = 10 + 10 poo = 10 + 10 qoo = 10 + 10 roo = 10 + 10 soo = 10 + 10 too = 10 + 10 uoo = 10 + 10 voo = 10 + 10 woo = 10 + 10 xoo = 10 + 1...
technologiescollege/s2a_fr
refs/heads/portable
s2a/Python/Lib/test/test_grp.py
39
"""Test script for the grp module.""" import unittest from test import test_support grp = test_support.import_module('grp') class GroupDatabaseTestCase(unittest.TestCase): def check_value(self, value): # check that a grp tuple has the entries and # attributes promised by the docs self.as...
lthall/Leonard_ardupilot
refs/heads/master
Tools/autotest/examples.py
14
#!/usr/bin/env python """ Contains functions used to test the ArduPilot examples AP_FLAKE8_CLEAN """ from __future__ import print_function import os import pexpect import signal import subprocess import time from pysim import util def run_example(filepath, valgrind=False, gdb=False): cmd = [] if valgrin...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/mobile/shared_dressed_criminal_organized_human_female_01.py
2
#### 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 = Creature() result.template = "object/mobile/shared_dressed_criminal_organized_human_female_01.iff" result.attribu...
WillWeatherford/mars-rover
refs/heads/master
api/tests.py
24123
from django.test import TestCase # Create your tests here.
SmartcitySantiagoChile/onlineGPS
refs/heads/master
gpsmap/tests.py
24123
from django.test import TestCase # Create your tests here.
JSchwerberg/review
refs/heads/master
review/review/settings/test.py
1
from __future__ import absolute_import from .base import * ########## TEST SETTINGS TEST_RUNNER = 'discover_runner.DiscoverRunner' TEST_DISCOVER_TOP_LEVEL = SITE_ROOT TEST_DISCOVER_ROOT = SITE_ROOT TEST_DISCOVER_PATTERN = "test_*.py" ########## IN-MEMORY TEST DATABASE DATABASES = { "default": { ...
odahoda/noisicaa
refs/heads/master
noisicaa/builtin_nodes/step_sequencer/model_test.py
1
#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # 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 y...
insequent/libcalico
refs/heads/master
calico_containers/tests/unit/test_handle.py
3
# Copyright (c) 2015-2016 Tigera, 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 applicabl...
adomasalcore3/android_kernel_Vodafone_VDF600
refs/heads/master
tools/perf/tests/attr.py
3174
#! /usr/bin/python import os import sys import glob import optparse import tempfile import logging import shutil import ConfigParser class Fail(Exception): def __init__(self, test, msg): self.msg = msg self.test = test def getMsg(self): return '\'%s\' - %s' % (self.test.path, self.msg)...
saguziel/incubator-airflow
refs/heads/master
tests/executors/__init__.py
44
# -*- coding: utf-8 -*- # # 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, softw...
cosmiclattes/TPBviz
refs/heads/master
torrent/lib/python2.7/posixpath.py
4
/usr/lib/python2.7/posixpath.py
imsparsh/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/encodings/cp775.py
272
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict...
arnaudsj/titanium_mobile
refs/heads/master
support/project.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Unified Titanium Mobile Project Script # import os, sys, subprocess, shutil, codecs def run(args): return subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE).communicate() def main(args): argc = len(args) if argc < 5 or args[1]=='--help': print...
jackytu/newbrandx
refs/heads/rankx
sites/us/apps/shipping/models.py
34
from oscar.apps.shipping.models import *
hiway/micropython
refs/heads/master
examples/network/http_server_ssl.py
39
try: import usocket as socket except: import socket import ussl as ssl CONTENT = b"""\ HTTP/1.0 200 OK Hello #%d from MicroPython! """ def main(use_stream=True): s = socket.socket() # Binding to all interfaces - server will be accessible to other hosts! ai = socket.getaddrinfo("0.0.0.0", 8443) ...
YannChemin/distRS
refs/heads/master
prog/prog_ETa_Global/Global_ET_Biome_parameters.py
2
#!/usr/bin/python from math import * def fc( ndvi ): """Fraction of vegetation cover""" ndvimin = 0.05 ndvimax = 0.95 return ( ( ndvi - ndvimin ) / ( ndvimax - ndvimin ) ) def bdpc( ndvi, b1, b2, b3, b4 ): """Biome dependent potential conductance (g0 in Zhang et al, 2009. WRR)""" return (1.0 / (b1 + b2 * exp(-b...
srivassumit/servo
refs/heads/master
tests/wpt/css-tests/tools/pywebsocket/src/example/origin_check_wsh.py
516
# Copyright 2011, Google 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: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
lileeyao/acm
refs/heads/master
linked_list/intermediate/copy_list_with_random_pointer.py
2
# Definition for singly-linked list with a random pointer. # class RandomListNode: # def __init__(self, x): # self.label = x # self.next = None # self.random = None class Solution: # @param head, a RandomListNode # @return a RandomListNode def copyRandomList(self, head...
alhashash/odoo
refs/heads/master
addons/l10n_ca/__init__.py
8
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify # it...
GerHobbelt/civet-webserver
refs/heads/master
conan/build.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re from cpt.packager import ConanMultiPackager from cpt.ci_manager import CIManager from cpt.printer import Printer class BuilderSettings(object): @property def branch(self): """ Get branch name """ printer = Printer(None...
pshowalter/solutions-geoprocessing-toolbox
refs/heads/dev
military_aspects_of_weather/scripts/MultidimensionSupplementalTools/MultidimensionSupplementalTools/Scripts/mds/netcdf/convention/__init__.py
2
# -*- coding: utf-8 -*- from coordinate import * from coards import * from cf import * from conventions import * from generic import * CONVENTION_CLASSES = [ CF, Coards, Coordinate ] """ Classes that implement a netcdf convention. """ def select_convention( dataset, filter_out_nd_coordin...
ThiefMaster/werkzeug
refs/heads/master
werkzeug/wsgi.py
85
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import os import posixpath import mimetypes from itertools import...
chrisdjscott/Atoman
refs/heads/master
atoman/filtering/filters/tests/test_cropSphere.py
1
""" Unit tests for the crop sphere filter """ from __future__ import absolute_import from __future__ import unicode_literals import unittest import numpy as np from ....system import lattice from .. import cropSphereFilter from .. import base #######################################################################...
goddardl/gaffer
refs/heads/master
python/Gaffer/UndoContext.py
2
########################################################################## # # Copyright (c) 2011, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
shaistaansari/django
refs/heads/master
tests/sessions_tests/tests.py
80
import base64 import os import shutil import string import sys import tempfile import unittest from datetime import timedelta from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.sessions.backends.cached_db import \ SessionStore as Cac...
google-code/android-scripting
refs/heads/master
python/src/Lib/plat-mac/Carbon/Snd.py
82
from _Snd import *
kalcho83/black-hat-python
refs/heads/master
demos/demo_server.py
1
#!/usr/bin/env python # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 2....
ZLLab-Mooc/edx-platform
refs/heads/named-release/dogwood.rc
common/test/acceptance/fixtures/library.py
147
""" Fixture to create a Content Library """ from opaque_keys.edx.keys import CourseKey from . import STUDIO_BASE_URL from .base import XBlockContainerFixture, FixtureError class LibraryFixture(XBlockContainerFixture): """ Fixture for ensuring that a library exists. WARNING: This fixture is NOT idempote...
gptech/ansible
refs/heads/devel
lib/ansible/modules/cloud/profitbricks/profitbricks_volume.py
66
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
ofer43211/unisubs
refs/heads/staging
apps/teams/migrations/0037_auto__add_field_invite_author.py
5
# encoding: 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 field 'Invite.author' db.add_column('teams_invite', 'author', self.gf('django.db.models.field...
onitake/ansible
refs/heads/devel
lib/ansible/plugins/connection/buildah.py
12
# Based on the docker connection plugin # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # # Connection plugin for building container images using buildah tool # https://github.com/projectatomic/buildah # # Written by: Tomas Tomecek (htt...