repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pauloAmaral/propertysearch | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "propertysearch.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure th... |
prospwro/odoo | refs/heads/8.0 | addons/payment/tests/common.py | 392 | # -*- coding: utf-8 -*-
from openerp.tests import common
class PaymentAcquirerCommon(common.TransactionCase):
def setUp(self):
super(PaymentAcquirerCommon, self).setUp()
self.payment_acquirer = self.registry('payment.acquirer')
self.payment_transaction = self.registry('payment.transactio... |
Havate/havate-openstack | refs/heads/master | proto-build/gui/horizon/Horizon_GUI/openstack_dashboard/dashboards/project/images_and_snapshots/volume_snapshots/tests.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
scipy/scipy-svn | refs/heads/master | scipy/fftpack/tests/test_helper.py | 12 | #!/usr/bin/env python
# Created by Pearu Peterson, September 2002
""" Test functions for fftpack.helper module
"""
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test(<level>)'
Run tests if fftpack is not installed:
python tests/... |
seaotterman/tensorflow | refs/heads/master | tensorflow/contrib/keras/api/keras/backend/__init__.py | 57 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
lahosken/pants | refs/heads/master | src/python/pants/backend/codegen/targets/java_ragel_library.py | 3 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.backend.c... |
samtx/whatsmyrankine | refs/heads/master | venv/lib/python2.7/site-packages/flask/testsuite/ext.py | 563 | # -*- coding: utf-8 -*-
"""
flask.testsuite.ext
~~~~~~~~~~~~~~~~~~~
Tests the extension import thing.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
try:
from imp import reload as reload_module
except ImportError:
reload... |
AloneRoad/Inforlearn | refs/heads/1.0-rc3 | vendor/django/utils/regex_helper.py | 361 | """
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 decompiler. It
should be good enough for a large class of URLS, however.
"""
# Mapping of an escape character to a r... |
andfoy/margffoy-tuay-server | refs/heads/master | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/cp949prober.py | 2800 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
Balannen/LSMASOMM | refs/heads/master | atom3/User Models/AddRoles_GG_rule.py | 1 | # _ AddRoles_GG_rule.py ____________________________________________________________________________
# File generated automatically by ATOM3. Graph Grammar Rule
# ___________________________________________________________________________________________
from GGrule import *
from hasObjective import *
from isPartOfOrgU... |
xq262144/hue | refs/heads/master | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/response.py | 31 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import calendar
import logging
from saml2.samlp import STATUS_VERSION_MISMATCH
from saml2.samlp import STATUS_AUTHN_FAILED
from saml2.samlp import STATUS_INVALID_ATTR_NAME_OR_VALUE
from saml2.samlp import STATUS_INVALID_NAMEID_POLICY
from saml2.samlp import STATUS_NO_AUT... |
vpodzime/pykickstart | refs/heads/master | tests/commands/network.py | 8 | #
# Radek Vykydal <rvykydal@redhat.com>
#
# Copyright 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# will be us... |
nicolasnoble/grpc | refs/heads/master | examples/python/multiplex/run_codegen.py | 27 | # Copyright 2016 gRPC authors.
#
# 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... |
jwilk/pdf2djvu | refs/heads/master | tests/test-labels.py | 1 | # encoding=UTF-8
# Copyright © 2015-2017 Jakub Wilk <jwilk@jwilk.net>
#
# This file is part of pdf2djvu.
#
# pdf2djvu 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.
#
# pdf2djvu is distributed in t... |
Allow2CEO/browser-ios | refs/heads/master | brave/node_modules/ad-block/vendor/depot_tools/third_party/gsutil/gslib/name_expansion.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... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/django-extensions-1.5.0/build/lib/django_extensions/tests/management_command.py | 36 | # -*- coding: utf-8 -*-
import sys
import logging
try:
from cStringIO import StringIO # NOQA
except ImportError:
from io import StringIO # NOQA
try:
import importlib # NOQA
except ImportError:
from django.utils import importlib # NOQA
from django.core.management import call_command
from django.te... |
androomerrill/scikit-nano | refs/heads/master | sknano/core/atoms/_lammps_atoms.py | 2 | # -*- coding: utf-8 -*-
"""
===============================================================================
Atom classes for LAMMPS structure data (:mod:`sknano.core.atoms._lammps_atoms`)
===============================================================================
.. currentmodule:: sknano.core.atoms._lammps_atoms
... |
kennedyshead/home-assistant | refs/heads/dev | homeassistant/components/kira/sensor.py | 5 | """KIRA interface to receive UDP packets from an IR-IP bridge."""
import logging
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import CONF_DEVICE, CONF_NAME, STATE_UNKNOWN
from . import CONF_SENSOR, DOMAIN
_LOGGER = logging.getLogger(__name__)
ICON = "mdi:remote"
def setup_plat... |
lubart2517/lubart_repo | refs/heads/master | polls/__init__.py | 12133432 | |
hydroshare/hydroshare | refs/heads/develop | hs_model_program/migrations/__init__.py | 12133432 | |
fxfitz/ansible | refs/heads/devel | lib/ansible/vars/__init__.py | 12133432 | |
swanijam/django-redcap | refs/heads/master | tests/fixtures/cmp_single_form_with_rep_fields_many_nested.py | 2 | from django.db import models
class Record(models.Model):
class Meta:
db_table = 'record'
class PriorGeneticTesting(models.Model):
mito_combo_analysis_loc = models.CharField(help_text=u'', null=True, max_length=2000, verbose_name=u'Lab where combination mitochondrial analysis was performed', blank=True)
... |
ReganBell/QReview | refs/heads/master | networkx/algorithms/centrality/katz.py | 8 | """
Katz centrality.
"""
# Copyright (C) 2004-2013 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <swart@lanl.gov>
# All rights reserved.
# BSD license.
import networkx as nx
from networkx.utils import not_implemented_for
__author__ = "\n".join(['Aric Hagberg (a... |
sahiljain/catapult | refs/heads/master | third_party/Paste/paste/util/findpackage.py | 50 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
import sys
import os
def find_package(dir):
"""
Given a directory, finds the equivalent package name. If it
is directly in sys.path, ret... |
sdsangee/MDTFitness | refs/heads/master | src/products/admin.py | 1 | from django.contrib import admin
# Register your models here.
from .models import Product, Variation, ProductImage
admin.site.register(Product)
admin.site.register(Variation)
admin.site.register(ProductImage) |
dayatz/taiga-back | refs/heads/stable | taiga/stats/routers.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Taiga Agile LLC <support@taiga.io>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option)... |
mitsuhiko/pip | refs/heads/develop | pip/_vendor/requests/packages/urllib3/fields.py | 404 | # urllib3/fields.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename... |
darknight-007/Firmware | refs/heads/master | testScripts/testFollow.py | 1 | """
testing offboard positon control with a simple takeoff script
"""
import rospy
from mavros_msgs.msg import State
from geometry_msgs.msg import PoseStamped, Point, Quaternion
import math
import numpy
import sys
class OffbPosCtl:
curr_pose = PoseStamped()
des_pose = PoseStamped()
leader_pose = PoseSt... |
subutai/nupic | refs/heads/master | src/nupic/algorithms/backtracking_tm_shim.py | 6 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
yize/grunt-tps | refs/heads/master | tasks/lib/python/Lib/python2.7/test/test_minidom.py | 46 | # test for xml.dom.minidom
import pickle
from StringIO import StringIO
from test.test_support import verbose, run_unittest, findfile
import unittest
import xml.dom
import xml.dom.minidom
import xml.parsers.expat
from xml.dom.minidom import parse, Node, Document, parseString
from xml.dom.minidom import getDOMImplemen... |
fernandezcuesta/ansible | refs/heads/devel | lib/ansible/utils/module_docs_fragments/tower.py | 44 | # (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# 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 la... |
yoyokko/syncless | refs/heads/master | examples/demo_wsgiapp.py | 5 | #! /usr/local/bin/stackless2.6
"""Simple demo WSGI application code."""
__author__ = 'pts@fazekas.hu (Peter Szabo)'
import cgi
import time
try:
from syncless import coio
except ImportError: # Don't ignore inner ImportError{}s.
coio = None
def WsgiApp(env, start_response):
"""A simple demo WSGI application fu... |
akarki15/mozillians | refs/heads/master | vendor-local/lib/python/rest_framework/tests/views.py | 17 | from rest_framework import generics
from rest_framework.tests.models import NullableForeignKeySource
from rest_framework.tests.serializers import NullableFKSourceSerializer
class NullableFKSourceDetail(generics.RetrieveUpdateDestroyAPIView):
model = NullableForeignKeySource
model_serializer_class = NullableFK... |
opensourcechipspark/platform_external_chromium_org | refs/heads/master | build/android/avd.py | 35 | #!/usr/bin/env python
# Copyright (c) 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.
"""Launches Android Virtual Devices with a set configuration for testing Chrome.
The script will launch a specified number of Andr... |
charlesvdv/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/gitignore/gitignore.py | 90 | import itertools
import re
import os
end_space = re.compile(r"([^\\]\s)*$")
def fnmatch_translate(pat, path_name=False):
parts = []
seq = False
i = 0
if pat[0] == "/" or path_name:
parts.append("^")
any_char = "[^/]"
if pat[0] == "/":
pat = pat[1:]
else:
... |
rnixx/chronotope | refs/heads/master | src/chronotope/publication.py | 1 | from chronotope.security import admin_permissions
from chronotope.security import authenticated_permissions
from chronotope.security import editor_permissions
from chronotope.security import manager_permissions
from chronotope.security import viewer_permissions
from pyramid.i18n import TranslationStringFactory
from pyr... |
michaelgira23/JEREMY | refs/heads/master | Skype4Py/enums.py | 22 | """
Skype4Py constants.
**Warning!** Remember that all constants defined here are available at
the `Skype4Py` package level and should be accessed from there.
Example:
.. python::
import Skype4Py
status = Skype4Py.apiAttachSuccess
"""
__docformat__ = 'restructuredtext en'
#{ Attachment status
apiAttac... |
damdam-s/OpenUpgrade | refs/heads/8.0 | addons/fleet/fleet.py | 266 | # -*- 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... |
kurikaesu/arsenalsuite | refs/heads/master | python/blur/blurFusion.py | 1 | #!/usr/bin/python
import re, sys
import decimal
def indentStr(level):
return ''.join(['\t' for i in range(0,level)])
# Todo, escape %"\, etc.
def escapeEyeonscriptString( pstr ):
pstr = pstr.replace('"','\\"')
pstr = pstr.replace('\\','\\\\')
return '"' + pstr + '"'
def unescapeEyeonscriptString( pstr ):
retu... |
grantmcconnaughey/django-app-gen | refs/heads/master | appgen/generator/base.py | 1 | import inspect
import os
from django.core.management.base import CommandError
from django.template.loader import render_to_string
class Generator(object):
"""
The Generator class takes a model class and generates one file out of it.
"""
# The template name used to generate a file.
template_name ... |
vgrachev8/youtube-dl | refs/heads/master | youtube_dl/extractor/firstpost.py | 3 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class FirstpostIE(InfoExtractor):
IE_NAME = 'Firstpost.com'
_VALID_URL = r'http://(?:www\.)?firstpost\.com/[^/]+/.*-(?P<id>[0-9]+)\.html'
_TEST = {
'url': 'http://www.firstpost.com/india/india-to-launch-indigeno... |
popazerty/dvbapp2-gui | refs/heads/master | lib/python/Tools/Notifications.py | 66 | notifications = [ ]
notificationAdded = [ ]
# notifications which are currently on screen (and might be closed by similiar notifications)
current_notifications = [ ]
def __AddNotification(fnc, screen, id, *args, **kwargs):
if ".MessageBox'>" in `screen`:
kwargs["simple"] = True
notifications.append((fnc, screen,... |
tamland/xbmc | refs/heads/master | addons/script.module.simplejson/lib/simplejson/__init__.py | 448 | r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
version of ... |
hekra01/mercurial | refs/heads/tizen | mercurial/pure/diffhelpers.py | 96 | # diffhelpers.py - pure Python implementation of diffhelpers.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
def addlines(fp, hunk, lena, lenb, a, b):
while True:
... |
khalibartan/pgmpy | refs/heads/dev | pgmpy/tests/test_estimators/test_BaseEstimator.py | 1 | import unittest
import pandas as pd
import numpy as np
from pgmpy.estimators import BaseEstimator
class TestBaseEstimator(unittest.TestCase):
def setUp(self):
self.d1 = pd.DataFrame(data={'A': [0, 0, 1],
'B': [0, 1, 0],
'C': [1, 1... |
caseyclements/bokeh | refs/heads/master | bokeh/charts/utils.py | 42 | """ This is the utils module that collects convenience functions and code that are
useful for charts ecosystem.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# Th... |
Carmezim/tensorflow | refs/heads/master | tensorflow/contrib/tfprof/python/tools/tfprof/model_analyzer_testlib.py | 8 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
EricYangzhiHong/python-docs-samples | refs/heads/master | localtesting/test_env_vars.py | 6 | # Copyright 2015 Google 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... |
rajul/tardis | refs/heads/master | ez_setup.py | 165 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... |
domibarton/ansible | refs/heads/devel | contrib/inventory/abiquo.py | 110 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
External inventory script for Abiquo
====================================
Shamelessly copied from an existing inventory script.
This script generates an inventory that Ansible can understand by making API requests to Abiquo API
Requires some python libraries, ensure ... |
TEAM-Gummy/platform_external_chromium_org | refs/heads/kk4.4 | tools/perf/measurements/memory_pressure.py | 24 | # 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.
"""Multi tab memory test.
This test is a multi tab test, but we're interested in measurements for
the entire test rather than each single page.
"""
import ... |
drjeep/django | refs/heads/master | django/db/backends/sqlite3/creation.py | 193 | import os
import sys
from django.core.exceptions import ImproperlyConfigured
from django.db.backends.base.creation import BaseDatabaseCreation
from django.utils.six.moves import input
class DatabaseCreation(BaseDatabaseCreation):
def _get_test_db_name(self):
test_database_name = self.connection.settings... |
ericmoritz/boxmath | refs/heads/develop | tests/__init__.py | 12133432 | |
open-austin/influence-texas | refs/heads/master | src/config/settings/__init__.py | 12133432 | |
darkryder/django | refs/heads/master | django/db/backends/sqlite3/introspection.py | 1 | import re
from collections import namedtuple
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',))
def get_field_size(name)... |
google/fedjax | refs/heads/main | fedjax/legacy/training/logging.py | 1 | # Copyright 2020 Google LLC
#
# 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, ... |
How2Compute/SmartHome | refs/heads/master | cli/py3env/lib/python3.4/site-packages/pkg_resources/__init__.py | 92 | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... |
mortada/scipy | refs/heads/master | scipy/signal/waveforms.py | 17 | # Author: Travis Oliphant
# 2003
#
# Feb. 2010: Updated by Warren Weckesser:
# Rewrote much of chirp()
# Added sweep_poly()
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import asarray, zeros, place, nan, mod, pi, extract, log, sqrt, \
exp, cos, sin, polyval, po... |
mbox/django | refs/heads/master | django/contrib/gis/tests/geoapp/feeds.py | 367 | from __future__ import unicode_literals
from django.contrib.gis import feeds
from .models import City
class TestGeoRSS1(feeds.Feed):
link = '/city/'
title = 'Test GeoDjango Cities'
def items(self):
return City.objects.all()
def item_link(self, item):
return '/city/%s/' % item.pk
... |
hgiemza/DIRAC | refs/heads/integration | Core/Base/Client.py | 2 | """ Base class for DIRAC Client """
__RCSID__ = "$Id$"
from DIRAC.Core.DISET.RPCClient import RPCClient
class Client( object ):
""" Simple class to redirect unknown actions directly to the server. Arguments
to the constructor are passed to the RPCClient constructor as they are.
Some... |
adedayo/intellij-community | refs/heads/master | python/testData/refactoring/unwrap/whileUnwrap_before.py | 83 | while True:
x =<caret> 1
|
ghtmtt/QGIS | refs/heads/master | python/plugins/processing/gui/FixedTablePanel.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
FixedTablePanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********************... |
mywaiting/LifeLogger | refs/heads/master | tornado/platform/twisted.py | 40 | # Author: Ovidiu Predescu
# Date: July 2011
#
# 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 ... |
Wallace-dyfq/example-code | refs/heads/master | attic/attributes/hasattr.py | 7 | import timeit
test_hasattr = """
if hasattr(gizmo, 'gadget'):
feature = gizmo.gadget
else:
feature = None
"""
test_getattr = """
feature = getattr(gizmo, 'gadget', None)
"""
test_tryget = """
try:
feature = getattr(gizmo, 'gadget')
except AttributeError:
feature = None
"""
class Gizmo:
def __in... |
takeshineshiro/django | refs/heads/master | django/test/runner.py | 148 | import logging
import os
import unittest
from importlib import import_module
from unittest import TestSuite, defaultTestLoader
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase, TestCase
from django.test.utils import setup_test_environment, ... |
ElricleNecro/LISA | refs/heads/master | LISA/Reader/Mock/Mock.py | 2 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import LISA.utils.colormaps as CM
import LISA.tools as t
from OpenGL import GL
from OpenGL.arrays import numpymodule
# from PyQt4 import QtGui as Qt
# from PyQt4 import QtCore
from LISA.Matrice import Vector
from LISA.gui.utils.signals import Signal
f... |
eklochkov/gitinspector | refs/heads/master | gitinspector/localization.py | 1 | # coding: utf-8
#
# Copyright © 2013-2015 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector 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 Lic... |
eayunstack/nova | refs/heads/develop | nova/network/api.py | 1 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you... |
petrjasek/superdesk-server | refs/heads/master | apps/item_lock/components/__init__.py | 395 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
|
x2Ident/x2Ident | refs/heads/master | mitmproxy/release/setup.py | 2 | from setuptools import setup
setup(
name='mitmproxy-rtool',
version="1.0",
py_modules=["rtool"],
install_requires=[
"click>=6.2, <7.0",
"twine>=1.6.5, <1.8",
"virtualenv>=14.0.5, <15.1",
"wheel>=0.29.0, <0.30",
"six>=1.10.0, <1.11",
"pysftp>=0... |
yeming233/rally | refs/heads/master | tests/unit/plugins/openstack/context/network/test_allow_ssh.py | 1 | # Copyright 2014: Mirantis 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 b... |
aitorhh/ncclient | refs/heads/master | ncclient/operations/third_party/__init__.py | 12133432 | |
karyon/django | refs/heads/master | tests/forms_tests/tests/tests.py | 16 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import models
from django.forms import (
CharField, FileField, Form, ModelChoiceField, ModelForm,
)
from django.forms.models import ModelFormMetaclass
from d... |
rosmo/boto | refs/heads/develop | boto/glacier/layer1.py | 121 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal ... |
benrudolph/commcare-hq | refs/heads/master | corehq/apps/app_manager/remote_app.py | 3 | from lxml import etree
import urllib2
import urlparse
from django.core import urlresolvers
from corehq.apps.app_manager.exceptions import AppEditingError
from corehq.apps.app_manager.xform import WrappedNode
from corehq.apps.users.util import cc_user_domain
class ProfileXML(WrappedNode):
def set_property(self, ke... |
sentinelsat/sentinelsat | refs/heads/main | tests/test_pandas.py | 2 | """
Tests methods dealing with converting product info into pandas and geopandas formats.
"""
import sys
import pytest
from sentinelsat import SentinelAPI
@pytest.mark.pandas
@pytest.mark.fast
def test_missing_dependency_dataframe(monkeypatch):
with pytest.raises(ImportError):
monkeypatch.setitem(sys.mo... |
40423201/2016fallcadp_bg03 | refs/heads/gh-pages | plugin/tipue_search/__init__.py | 371 | from .tipue_search import *
|
jomolinare/docker-crate | refs/heads/master | bootstrap.py | 95 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
lthurlow/Network-Grapher | refs/heads/master | proj/external/networkx-1.7/networkx/algorithms/flow/tests/test_maxflow.py | 35 | # -*- coding: utf-8 -*-
"""Max flow algorithm test suite.
Run with nose: nosetests -v test_max_flow.py
"""
__author__ = """Loïc Séguin-C. <loicseguin@gmail.com>"""
# Copyright (C) 2010 Loïc Séguin-C. <loicseguin@gmail.com>
# All rights reserved.
# BSD license.
import networkx as nx
from nose.tools import *
def com... |
souzainf3/namebench | refs/heads/master | nb_third_party/dns/tsigkeyring.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 ... |
rmehta/erpnext | refs/heads/develop | erpnext/selling/doctype/sms_center/sms_center.py | 82 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
from frappe import msgprint, _
from frappe.model.document import Document
from erpnext.setup.doctype.sms_... |
psfblair/FrameworkBenchmarks | refs/heads/master | frameworks/Python/uwsgi/hello.py | 67 | import ujson
def application(environ, start_response):
response = {
"message": "Hello, World!"
}
data = ujson.dumps(response)
response_headers = [
('Content-type', 'application/json'),
('Content-Length', str(len(data)))
]
start_response('200 OK', response_headers)
ret... |
srinivasanmit/all-in-all | refs/heads/master | interview_qns/enum_example.py | 1 | class Shapes:
Circle, Square, Triangle, Quadrangle = range(4)
print(Shapes.Circle, type(Shapes.Circle))
print(Shapes.Square)
print(Shapes.Triangle)
print(Shapes.Quadrangle)
|
CornerstoneAuto/CornerstoneAutoV1-Fail | refs/heads/master | contrib/seeds/makeseeds.py | 753 | #!/usr/bin/env python
#
# Generate pnSeed[] from Pieter's DNS seeder
#
NSEEDS=600
import re
import sys
from subprocess import check_output
def main():
lines = sys.stdin.readlines()
ips = []
pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):9333")
for line in lines:
m = patte... |
xen0l/ansible | refs/heads/devel | lib/ansible/modules/network/ios/ios_static_route.py | 58 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... |
oihane/odoo | refs/heads/8.0 | addons/point_of_sale/report/pos_order_report.py | 283 | # -*- 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... |
dmitry-r/incubator-airflow | refs/heads/master | tests/contrib/hooks/test_redis_hook.py | 38 | # -*- 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, software
... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.3.0/Lib/test/test_importlib/regrtest.py | 117 | """Run Python's standard test suite using importlib.__import__.
Tests known to fail because of assumptions that importlib (properly)
invalidates are automatically skipped if the entire test suite is run.
Otherwise all command-line options valid for test.regrtest are also valid for
this script.
"""
import importlib
im... |
Lekanich/intellij-community | refs/heads/master | python/testData/refactoring/rename/renameMultipleDefinitionsLocal.py | 83 | if foo():
x = 1
else:
x = 2
y = <caret>x
|
dotskapes/dotSkapes | refs/heads/master | controllers/data.py | 1 | def save():
datatype = require_alphanumeric (request.args[0])
lookup_id = require_alphanumeric (request.vars.get ('id'))
dm.link (datatype, lookup_id)
return dm.get (datatype, lookup_id).json ()
def load():
datatype = require_alphanumeric (request.args[0])
if len (request.args) > 1 and request.... |
littlstar/chromium.src | refs/heads/nw | tools/site_compare/drivers/win32/__init__.py | 12133432 | |
fedorpatlin/ansible | refs/heads/devel | test/units/contrib/inventory/__init__.py | 12133432 | |
YunoHost/moulinette-yunohost | refs/heads/unstable | src/yunohost/vendor/acme_tiny/__init__.py | 12133432 | |
20CM/Sanctuary | refs/heads/master | sanctuary/sanctuary/__init__.py | 12133432 | |
soldag/home-assistant | refs/heads/dev | tests/components/integration/test_sensor.py | 13 | """The tests for the integration sensor platform."""
from datetime import timedelta
from homeassistant.const import ENERGY_KILO_WATT_HOUR, POWER_WATT, TIME_SECONDS
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
from tests.async_mock import patch
async def test_state(ha... |
ahri/pycurlbrowser | refs/heads/master | tests/test_curl.py | 1 | from unittest import TestCase
from pycurlbrowser import CurlBackend
from datetime import timedelta
import pycurl
class TestBackendApi(TestCase):
"""
Test that the HttpBackend API is adhered-to.
"""
def setUp(self):
self.backend = CurlBackend()
self.backend._curl.setopt(pycurl.CONNECTT... |
RadioFreeAsia/RDacity | refs/heads/master | lib-src/lv2/lilv/waflib/Tools/cs.py | 198 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Utils,Task,Options,Logs,Errors
from waflib.TaskGen import before_method,after_method,feature
from waflib.Tools import ccroot
from waflib.Configure import co... |
X-DataInitiative/tick | refs/heads/master | examples/plot_robust_linear_regression.py | 2 | """
===========================
Robust linear model example
===========================
In this example with simulate a linear regression model with 1000 samples and
5 features. The simulated data is contaminated by 20% of outliers, in the form
of sparse sample intercepts (thus only on 20% of samples).
We illustrate ... |
dapperaeronaut/puzzle-submission | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "puzzle_submission.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
w0921444648/IT110_DJANGO_ATTEMPT2 | refs/heads/master | mysite/wsgi.py | 174 | """
WSGI config for mysite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.